]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-tipc.c
Avoid -E and -M options inconsistencies with no libcrypto
[tcpdump] / print-tipc.c
index cd52d2393330dfaf51a0841340f5138b13e60882..ec5f1a542c7b907cc4a2ed28ecdfc83702979a86 100644 (file)
  *     https://web.archive.org/web/20161025110514/http://tipc.sourceforge.net/doc/tipc_message_formats.html
  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
 #include "netdissect.h"
-#include "ethertype.h"
 #include "extract.h"
 
 
@@ -170,7 +167,6 @@ print_payload(netdissect_options *ndo, const struct payload_tipc_pkthdr *ap)
        u_int orig_node;
        u_int dest_node;
 
-       ND_TCHECK_4(ap->dest_port);
        w0 = GET_BE_U_4(ap->w0);
        user = TIPC_USER(w0);
        hsize = TIPC_HSIZE(w0);
@@ -189,7 +185,6 @@ print_payload(netdissect_options *ndo, const struct payload_tipc_pkthdr *ap)
                    tok2str(tipcuser_values, "unknown", user),
                    tok2str(tipcmtype_values, "Unknown", mtype));
        } else {
-               ND_TCHECK_4(ap->dest_node);
                orig_node = GET_BE_U_4(ap->orig_node);
                dest_node = GET_BE_U_4(ap->dest_node);
                ND_PRINT("TIPC v%u.0 %u.%u.%u:%u > %u.%u.%u:%u, headerlength %u bytes, MessageSize %u bytes, %s, messageType %s",
@@ -212,10 +207,6 @@ print_payload(netdissect_options *ndo, const struct payload_tipc_pkthdr *ap)
                            broadcast_ack, link_ack, link_seq);
                }
        }
-       return;
-
-trunc:
-       nd_print_trunc(ndo);
 }
 
 static void
@@ -240,7 +231,6 @@ print_internal(netdissect_options *ndo, const struct internal_tipc_pkthdr *ap)
        u_int msg_cnt;
        u_int link_tol;
 
-       ND_TCHECK_4(ap->dest_node);
        w0 = GET_BE_U_4(ap->w0);
        user = TIPC_USER(w0);
        hsize = TIPC_HSIZE(w0);
@@ -258,7 +248,6 @@ print_internal(netdissect_options *ndo, const struct internal_tipc_pkthdr *ap)
            tok2str(tipcmtype_values, "Unknown", mtype), w1);
 
        if (ndo->ndo_vflag) {
-               ND_TCHECK_SIZE(ap);
                seq_gap = TIPC_SEQ_GAP(w1);
                broadcast_ack = TIPC_BROADCAST_ACK(w1);
                w2 = GET_BE_U_4(ap->w2);
@@ -280,10 +269,6 @@ print_internal(netdissect_options *ndo, const struct internal_tipc_pkthdr *ap)
                    last_sent_frag, next_sent_frag, trans_seq, msg_cnt,
                    link_tol);
        }
-       return;
-
-trunc:
-       nd_print_trunc(ndo);
 }
 
 static void
@@ -300,7 +285,6 @@ print_link_conf(netdissect_options *ndo, const struct link_conf_tipc_pkthdr *ap)
        u_int ntwrk_id;
        u_int media_id;
 
-       ND_TCHECK_4(ap->prev_node);
        w0 = GET_BE_U_4(ap->w0);
        user = TIPC_USER(w0);
        hsize = TIPC_HSIZE(w0);
@@ -318,7 +302,6 @@ print_link_conf(netdissect_options *ndo, const struct link_conf_tipc_pkthdr *ap)
            tok2str(tipcuser_values, "unknown", user),
            tok2str(tipc_linkconf_mtype_values, "Unknown", mtype));
        if (ndo->ndo_vflag) {
-               ND_TCHECK_4(ap->w5);
                node_sig = TIPC_NODE_SIG(w1);
                ntwrk_id = GET_BE_U_4(ap->ntwrk_id);
                w5 = GET_BE_U_4(ap->w5);
@@ -326,10 +309,6 @@ print_link_conf(netdissect_options *ndo, const struct link_conf_tipc_pkthdr *ap)
                ND_PRINT("\n\tNodeSignature %u, network_id %u, media_id %u",
                    node_sig, ntwrk_id, media_id);
        }
-       return;
-
-trunc:
-       nd_print_trunc(ndo);
 }
 
 void
@@ -342,12 +321,10 @@ tipc_print(netdissect_options *ndo, const u_char *bp, u_int length _U_,
 
        ndo->ndo_protocol = "tipc";
        ap = (const struct tipc_pkthdr *)bp;
-       ND_TCHECK_4(ap->w0);
        w0 = GET_BE_U_4(ap->w0);
        user = TIPC_USER(w0);
 
-       switch (user)
-       {
+       switch (user) {
                case TIPC_USER_LOW_IMPORTANCE:
                case TIPC_USER_MEDIUM_IMPORTANCE:
                case TIPC_USER_HIGH_IMPORTANCE:
@@ -370,8 +347,4 @@ tipc_print(netdissect_options *ndo, const u_char *bp, u_int length _U_,
                        break;
 
        }
-       return;
-
-trunc:
-       nd_print_trunc(ndo);
 }