]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Add the ndo_protocol field in the netdissect_options structure
authorFrancois-Xavier Le Bail <[email protected]>
Wed, 14 Mar 2018 15:54:17 +0000 (16:54 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 16 Mar 2018 18:44:47 +0000 (19:44 +0100)
Update this field in printer entry functions.
It will be used for some printings.

145 files changed:
netdissect.h
print-802_11.c
print-802_15_4.c
print-ah.c
print-ahcp.c
print-aodv.c
print-aoe.c
print-ap1394.c
print-arcnet.c
print-arp.c
print-ascii.c
print-atalk.c
print-atm.c
print-babel.c
print-beep.c
print-bfd.c
print-bgp.c
print-bootp.c
print-bt.c
print-calm-fast.c
print-carp.c
print-cdp.c
print-cfm.c
print-chdlc.c
print-cip.c
print-cnfp.c
print-dccp.c
print-decnet.c
print-dhcp6.c
print-domain.c
print-dtp.c
print-dvmrp.c
print-eap.c
print-egp.c
print-eigrp.c
print-enc.c
print-esp.c
print-ether.c
print-fddi.c
print-forces.c
print-fr.c
print-frag6.c
print-ftp.c
print-geneve.c
print-geonet.c
print-gre.c
print-hncp.c
print-hsrp.c
print-http.c
print-icmp.c
print-icmp6.c
print-igmp.c
print-igrp.c
print-ip.c
print-ip6.c
print-ip6opts.c
print-ipcomp.c
print-ipfc.c
print-ipnet.c
print-ipx.c
print-isakmp.c
print-isoclns.c
print-juniper.c
print-krb.c
print-l2tp.c
print-lane.c
print-ldp.c
print-lisp.c
print-llc.c
print-lldp.c
print-lmp.c
print-loopback.c
print-lspping.c
print-lwapp.c
print-lwres.c
print-m3ua.c
print-medsa.c
print-mobile.c
print-mobility.c
print-mpcp.c
print-mpls.c
print-mptcp.c
print-msdp.c
print-msnlb.c
print-nflog.c
print-nfs.c
print-nsh.c
print-ntp.c
print-null.c
print-olsr.c
print-openflow.c
print-ospf.c
print-ospf6.c
print-otv.c
print-pflog.c
print-pgm.c
print-pim.c
print-pktap.c
print-ppi.c
print-ppp.c
print-pppoe.c
print-pptp.c
print-radius.c
print-raw.c
print-resp.c
print-rip.c
print-ripng.c
print-rpki-rtr.c
print-rrcp.c
print-rsvp.c
print-rt6.c
print-rtsp.c
print-rx.c
print-sctp.c
print-sflow.c
print-sip.c
print-sl.c
print-sll.c
print-slow.c
print-smb.c
print-smtp.c
print-snmp.c
print-stp.c
print-sunatm.c
print-sunrpc.c
print-symantec.c
print-syslog.c
print-tcp.c
print-telnet.c
print-tftp.c
print-timed.c
print-tipc.c
print-token.c
print-udld.c
print-udp.c
print-usb.c
print-vjc.c
print-vqp.c
print-vrrp.c
print-vtp.c
print-vxlan-gpe.c
print-vxlan.c
print-wb.c
print-zephyr.c
print-zeromq.c

index 0d996854b2ffa879583ac0304ade6ac27ccd2328..365b4b95895dd0af37aaf1ce894121d14d97fbb4 100644 (file)
@@ -182,6 +182,7 @@ struct netdissect_options {
                                 * LF, CR and SPACE as graphical chars
                                 */
   int ndo_Hflag;               /* dissect 802.11s draft mesh standard */
+  const char *ndo_protocol;    /* protocol */
   void *ndo_last_mem_p;                /* pointer to the last allocated memory chunk */
   int ndo_packet_number;       /* print a packet number in the beginning of line */
   int ndo_suppress_default_print; /* don't use default_print() for unknown packet types */
index 5849a071845d9b3265eeaf6dd7ef7f4cd361b7a6..a3d376b6a79daaf09ec63966275a2d0670db0813 100644 (file)
@@ -2016,6 +2016,7 @@ ieee802_11_print(netdissect_options *ndo,
        struct lladdr_info src, dst;
        int llc_hdrlen;
 
+       ndo->ndo_protocol = "802.11";
        caplen = orig_caplen;
        /* Remove FCS, if present */
        if (length < fcslen) {
@@ -2124,6 +2125,7 @@ u_int
 ieee802_11_if_print(netdissect_options *ndo,
                     const struct pcap_pkthdr *h, const u_char *p)
 {
+       ndo->ndo_protocol = "802.11_if";
        return ieee802_11_print(ndo, p, h->len, h->caplen, 0, 0);
 }
 
@@ -3080,6 +3082,7 @@ ieee802_11_radio_print(netdissect_options *ndo,
        int pad;
        u_int fcslen;
 
+       ndo->ndo_protocol = "802.11_radio";
        if (caplen < sizeof(*hdr)) {
                ND_PRINT("%s", tstr);
                return caplen;
@@ -3257,6 +3260,7 @@ ieee802_11_radio_avs_print(netdissect_options *ndo,
 {
        uint32_t caphdr_len;
 
+       ndo->ndo_protocol = "802.11_radio_avs";
        if (caplen < 8) {
                ND_PRINT("%s", tstr);
                return caplen;
@@ -3309,6 +3313,7 @@ prism_if_print(netdissect_options *ndo,
        u_int length = h->len;
        uint32_t msgcode;
 
+       ndo->ndo_protocol = "prism_if";
        if (caplen < 4) {
                ND_PRINT("%s", tstr);
                return caplen;
@@ -3336,6 +3341,7 @@ u_int
 ieee802_11_radio_if_print(netdissect_options *ndo,
                           const struct pcap_pkthdr *h, const u_char *p)
 {
+       ndo->ndo_protocol = "802.11_radio_if";
        return ieee802_11_radio_print(ndo, p, h->len, h->caplen);
 }
 
@@ -3348,5 +3354,6 @@ u_int
 ieee802_11_radio_avs_if_print(netdissect_options *ndo,
                               const struct pcap_pkthdr *h, const u_char *p)
 {
+       ndo->ndo_protocol = "802.11_radio_avs_if";
        return ieee802_11_radio_avs_print(ndo, p, h->len, h->caplen);
 }
index 17d0ded746f3e65577487a76766a0a6b50e78d75..bf96087131e265d69ceaadd514b98aea8c624906 100644 (file)
@@ -70,6 +70,7 @@ ieee802_15_4_print(netdissect_options *ndo,
        uint8_t seq;
        uint16_t panid = 0;
 
+       ndo->ndo_protocol = "802.15.4";
        if (caplen < 3) {
                ND_PRINT("[|802.15.4]");
                return caplen;
@@ -226,5 +227,6 @@ u_int
 ieee802_15_4_if_print(netdissect_options *ndo,
                       const struct pcap_pkthdr *h, const u_char *p)
 {
+       ndo->ndo_protocol = "802.15.4_if";
        return ieee802_15_4_print(ndo, p, h->caplen);
 }
index 2f58716b8a553eb8d9c7b50dc5b23dbdc531c6d2..ec94cc1446afec29a3778bb45a53064a4316443c 100644 (file)
@@ -40,6 +40,7 @@ ah_print(netdissect_options *ndo, const u_char *bp)
        const struct ah *ah;
        u_int sumlen;
 
+       ndo->ndo_protocol = "ah";
        ah = (const struct ah *)bp;
 
        ND_TCHECK_SIZE(ah);
index e452e383682e6c8c6ebf038f1ca773ce88676e69..9ac7de05c7c7e072d3f104c35eccccb4516784fb 100644 (file)
@@ -350,6 +350,7 @@ ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len)
        const u_char *ep = ndo->ndo_snapend;
        uint8_t version;
 
+       ndo->ndo_protocol = "ahcp";
        ND_PRINT("AHCP");
        if (len < 2)
                goto invalid;
index e47ff184fbf1f35ff6aa9d0698585a50d9b129f0..52024dc05e510e3a16e254774bf04af35a6e8aad 100644 (file)
@@ -478,6 +478,7 @@ aodv_print(netdissect_options *ndo,
 {
        uint8_t msg_type;
 
+       ndo->ndo_protocol = "aodv";
        /*
         * The message type is the first byte; make sure we have it
         * and then fetch it.
index b56af2cb44d97390ac37cd6549494f950d37bbf9..322b6fd5ad52a8a776a20135299cc720563b7a79 100644 (file)
@@ -402,6 +402,7 @@ aoe_print(netdissect_options *ndo,
        const u_char *ep = ndo->ndo_snapend;
        uint8_t ver;
 
+       ndo->ndo_protocol = "aoe";
        ND_PRINT("AoE length %u", len);
 
        if (len < 1)
index d39f27f7cf4df9515655515a5b934fd426349244..4326707f266b1d5ba561a6042c7a11599afee059 100644 (file)
@@ -94,6 +94,7 @@ ap1394_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ch
        u_short ether_type;
        struct lladdr_info src, dst;
 
+       ndo->ndo_protocol = "ap1394_if";
        if (caplen < FIREWIRE_HDRLEN) {
                ND_PRINT("[|ap1394]");
                return FIREWIRE_HDRLEN;
index 469361efebaadc71917fa2c9743b990a01146120..f40201719f56557f88c41a0d1ce5f46c7373d483 100644 (file)
@@ -125,10 +125,9 @@ arcnet_print(netdissect_options *ndo, const u_char *bp, u_int length, int phds,
        const struct arc_header *ap;
        const char *arctypename;
 
-
+       ndo->ndo_protocol = "arcnet";
        ap = (const struct arc_header *)bp;
 
-
        if (ndo->ndo_qflag) {
                ND_PRINT("%02x %02x %u: ",
                             EXTRACT_U_1(ap->arc_shost),
@@ -191,6 +190,7 @@ arcnet_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ch
        u_int seqid = 0;
        u_char arc_type;
 
+       ndo->ndo_protocol = "arcnet_if";
        if (caplen < ARC_HDRLEN || length < ARC_HDRLEN) {
                ND_PRINT("[|arcnet]");
                return (caplen);
@@ -278,6 +278,7 @@ arcnet_linux_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, cons
        int archdrlen = 0;
        u_char arc_type;
 
+       ndo->ndo_protocol = "arcnet_linux_if";
        if (caplen < ARC_LINUX_HDRLEN || length < ARC_LINUX_HDRLEN) {
                ND_PRINT("[|arcnet]");
                return (caplen);
index c7eeeb9697c6d6a0bd7ecdfd4890aba4a332b0f3..e026bd46789a0ba756e58f6484c7ac595b6cc3f8 100644 (file)
@@ -359,6 +359,7 @@ arp_print(netdissect_options *ndo,
        const struct arp_pkthdr *ap;
        u_short pro, hrd, op, linkaddr;
 
+       ndo->ndo_protocol = "arp";
        ap = (const struct arp_pkthdr *)bp;
        ND_TCHECK_SIZE(ap);
 
index 0c347bf08825f33a2f60658bd205a1e82767fa1e..78bced6a77b7687e52548ed970863dc941d1d2dd 100644 (file)
@@ -62,6 +62,7 @@ ascii_print(netdissect_options *ndo,
        u_int caplength;
        u_char s;
 
+       ndo->ndo_protocol = "ascii";
        caplength = (ndo->ndo_snapend >= cp) ? ndo->ndo_snapend - cp : 0;
        if (length > caplength)
                length = caplength;
index 0e0ab00301bb27e2990cbe7838628d1a46824dca..7398b15dcb6b4c944fb569a92d1c5bdca6f48e98 100644 (file)
@@ -79,6 +79,7 @@ ltalk_if_print(netdissect_options *ndo,
 {
        u_int hdrlen;
 
+       ndo->ndo_protocol = "ltalk_if";
        hdrlen = llap_print(ndo, p, h->len);
        if (hdrlen == 0) {
                /* Cut short by the snapshot length. */
@@ -100,6 +101,7 @@ llap_print(netdissect_options *ndo,
        u_short snet;
        u_int hdrlen;
 
+       ndo->ndo_protocol = "llap";
        if (length < sizeof(*lp)) {
                ND_PRINT(" [|llap %u]", length);
                return (length);
@@ -182,6 +184,7 @@ atalk_print(netdissect_options *ndo,
        const struct atDDP *dp;
        u_short snet;
 
+       ndo->ndo_protocol = "atalk";
         if(!ndo->ndo_eflag)
             ND_PRINT("AT ");
 
@@ -214,6 +217,7 @@ aarp_print(netdissect_options *ndo,
 
 #define AT(member) ataddr_string(ndo, (ap->member[1]<<8)|ap->member[2],ap->member[3])
 
+       ndo->ndo_protocol = "aarp";
        ND_PRINT("aarp ");
        ap = (const struct aarp *)bp;
        if (!ND_TTEST_SIZE(ap)) {
index eb661c28e9374d601204f11b4dc75b4e85bab221..22acd73f755474ae49f9185b83d51356e23e4610 100644 (file)
@@ -253,6 +253,7 @@ atm_if_print(netdissect_options *ndo,
        uint32_t llchdr;
        u_int hdrlen = 0;
 
+       ndo->ndo_protocol = "atm_if";
        if (caplen < 1 || length < 1) {
                ND_PRINT("%s", tstr);
                return (caplen);
@@ -386,6 +387,7 @@ atm_print(netdissect_options *ndo,
           u_int vpi, u_int vci, u_int traftype, const u_char *p, u_int length,
           u_int caplen)
 {
+       ndo->ndo_protocol = "atm";
        if (ndo->ndo_eflag)
                ND_PRINT("VPI:%u VCI:%u ", vpi, vci);
 
@@ -459,7 +461,7 @@ oam_print (netdissect_options *ndo,
         const struct oam_fm_ais_rdi_t *oam_fm_ais_rdi;
     } oam_ptr;
 
-
+    ndo->ndo_protocol = "oam";
     ND_TCHECK_1(p + ATM_HDR_LEN_NOHEC + hec);
     cell_header = EXTRACT_BE_U_4(p + hec);
     cell_type = (EXTRACT_U_1((p + ATM_HDR_LEN_NOHEC + hec)) >> 4) & 0x0f;
index c7fef600ca287048fd85496e55503d263ec11898..9f2ecf106da2b81d6fc1058f3ec283ee34f93024 100644 (file)
@@ -49,6 +49,7 @@ void
 babel_print(netdissect_options *ndo,
             const u_char *cp, u_int length)
 {
+    ndo->ndo_protocol = "babel";
     ND_PRINT("babel");
 
     ND_TCHECK_4(cp);
index 69bd8ec36c764eb84ed2f01766ef6ba94e0f4021..76017eaf89dc38161cc6db7a5dd50f1ec7a2c7dd 100644 (file)
@@ -49,6 +49,7 @@ void
 beep_print(netdissect_options *ndo, const u_char *bp, u_int length)
 {
 
+       ndo->ndo_protocol = "beep";
        if (l_strnstart(ndo, "MSG", 4, (const char *)bp, length)) /* A REQuest */
                ND_PRINT(" BEEP MSG");
        else if (l_strnstart(ndo, "RPY ", 4, (const char *)bp, length))
index 558439f943ac3c3851bab33ee79674af962c1892..0d1732cd763a9b2d7bed7b43f179ed7ee7cfa3b5 100644 (file)
@@ -299,6 +299,7 @@ bfd_print(netdissect_options *ndo, const u_char *pptr,
         uint8_t version = 0;
         uint8_t flags;
 
+       ndo->ndo_protocol = "bfd";
         bfd_header = (const struct bfd_header_t *)pptr;
         version_diag = EXTRACT_U_1(bfd_header->version_diag);
         if (port == BFD_CONTROL_PORT) {
index fff46bf13061d72f04475b72006957071a98c775..2a3e765122c839739f909f6ba26b59359e6a0dbf 100644 (file)
@@ -3065,6 +3065,7 @@ bgp_print(netdissect_options *ndo,
     const struct bgp *bgp_header;
     uint16_t hlen;
 
+    ndo->ndo_protocol = "bgp";
     ND_PRINT(": BGP");
 
     if (ndo->ndo_vflag < 1) /* lets be less chatty */
index bddd5f9b685407f2ae84ea9ebfe54dcab9e2a7d2..aef7063cf568fbd7776d88ff0541bfa7dfe0c765 100644 (file)
@@ -288,6 +288,7 @@ bootp_print(netdissect_options *ndo,
        static const u_char vm_rfc1048[4] = VM_RFC1048;
        uint8_t bp_op, bp_htype, bp_hlen;
 
+       ndo->ndo_protocol = "bootp";
        bp = (const struct bootp *)cp;
        ND_TCHECK_1(bp->bp_op);
        bp_op = EXTRACT_U_1(bp->bp_op);
index 40b7f9718cf3e935708b4ebddfba1a14656c32f5..61eb7b23d8ed61206436a83520eabb5a4320bd07 100644 (file)
@@ -47,6 +47,7 @@ bt_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *
        u_int caplen = h->caplen;
        const pcap_bluetooth_h4_header* hdr = (const pcap_bluetooth_h4_header*)p;
 
+       ndo->ndo_protocol = "bt_if";
        if (caplen < BT_HDRLEN || length < BT_HDRLEN)
                goto trunc;
        caplen -= BT_HDRLEN;
index fa1d903435f95f3126a437abcc375a2088fcbb4c..d516cdffbb71decc540ee32d7318fac209407d79 100644 (file)
@@ -43,6 +43,7 @@ calm_fast_print(netdissect_options *ndo, const u_char *bp, u_int length, const s
        u_int srcNwref;
        u_int dstNwref;
 
+       ndo->ndo_protocol = "calm_fast";
        ND_TCHECK_2(bp);
        if (length < 2)
                goto trunc;
index 8e82f6dbc0e04a5cfba68e021c42cdb34898a48d..0a505238a01e6ac615a1780f392c8ff1652d452f 100644 (file)
@@ -51,6 +51,7 @@ carp_print(netdissect_options *ndo, const u_char *bp, u_int len, u_int ttl)
        u_int version, type;
        const char *type_s;
 
+       ndo->ndo_protocol = "carp";
        ND_TCHECK_1(bp);
        version = (EXTRACT_U_1(bp) & 0xf0) >> 4;
        type = EXTRACT_U_1(bp) & 0x0f;
index 9e88ab392d1073e254b37b4de8a7349fa1735d7f..1e1d66ab7902b4a17cde52c6061d5fe335209d5e 100644 (file)
@@ -97,6 +97,7 @@ cdp_print(netdissect_options *ndo,
        u_int type, len, i, j;
        const u_char *tptr;
 
+       ndo->ndo_protocol = "cdp";
        if (caplen < CDP_HEADER_LEN) {
                ND_PRINT("%s", tstr);
                return;
index 050a99a366f41a7b269967f2c4230a28059deba5..568e30367d1a0ebe16dbedc4e1e85a9ca8bf4d4b 100644 (file)
@@ -292,6 +292,7 @@ cfm_print(netdissect_options *ndo,
         const struct cfm_ltr_t *cfm_ltr;
     } msg_ptr;
 
+    ndo->ndo_protocol = "cfm";
     tptr=pptr;
     cfm_common_header = (const struct cfm_common_header_t *)pptr;
     if (length < sizeof(*cfm_common_header))
index 6a4209297eb8c63677800421f8998f93fd1634c0..8dc20ae41a5234129b4aeaf9f59c1ece5eb13317 100644 (file)
@@ -47,6 +47,7 @@ static const struct tok chdlc_cast_values[] = {
 u_int
 chdlc_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
+       ndo->ndo_protocol = "chdlc_if";
        return chdlc_print(ndo, p, h->len);
 }
 
@@ -56,6 +57,7 @@ chdlc_print(netdissect_options *ndo, const u_char *p, u_int length)
        u_int proto;
        const u_char *bp = p;
 
+       ndo->ndo_protocol = "chdlc";
        if (length < CHDLC_HDRLEN)
                goto trunc;
        ND_TCHECK_LEN(p, CHDLC_HDRLEN);
index a85388671135f43423d6be20131abe787440d31e..468477a68b6f56404b3adba386b6fa56f466c546 100644 (file)
@@ -64,6 +64,7 @@ cip_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char
        size_t cmplen;
        int llc_hdrlen;
 
+       ndo->ndo_protocol = "cip_if";
        cmplen = sizeof(rfcllc);
        if (cmplen > caplen)
                cmplen = caplen;
index c1c3e0c9d0ce69e4f3baa636abcdcd0c9a74342a..f010e90cf0d53b390a3ee6da52c999b3be087c6a 100644 (file)
@@ -467,6 +467,7 @@ cnfp_print(netdissect_options *ndo, const u_char *cp)
        /*
         * First 2 bytes are the version number.
         */
+       ndo->ndo_protocol = "cnfp";
        ND_TCHECK_2(cp);
        ver = EXTRACT_BE_U_2(cp);
        switch (ver) {
index 5937d53aa4ac73cc25cd9a795f301b5a506b56bd..a717b166d01bee53f1b7c3936f1294bf6c140632 100644 (file)
@@ -284,6 +284,7 @@ dccp_print(netdissect_options *ndo, const u_char *bp, const u_char *data2,
        u_int fixed_hdrlen;
        uint8_t dccph_type;
 
+       ndo->ndo_protocol = "dccp";
        dh = (const struct dccp_hdr *)bp;
 
        ip = (const struct ip *)data2;
index 253d133d9cd076ace4e071ccf74858c96ee05f67..6f68feb8ad6e2c82b5f7e4d6731cbd2070656204 100644 (file)
@@ -507,6 +507,7 @@ decnet_print(netdissect_options *ndo,
        u_int nsplen, pktlen;
        const u_char *nspp;
 
+       ndo->ndo_protocol = "decnet";
        if (length < sizeof(struct shorthdr)) {
                ND_PRINT("%s", tstr);
                return;
index f7bc45a7cad8fc4f6fe5acc5030f7aedc19bee37..a45fe5c01682b1a6b7354592a2c156c6cf8a3f8c 100644 (file)
@@ -795,6 +795,7 @@ dhcp6_print(netdissect_options *ndo,
        const u_char *extp;
        const char *name;
 
+       ndo->ndo_protocol = "dhcp6";
        ND_PRINT("dhcp6");
 
        ep = ndo->ndo_snapend;
index 80f021ce54860b4755fedf333d811dc4345c6188..4e21191833a5608e03e8d604647dd33b903ed94f 100644 (file)
@@ -598,6 +598,7 @@ domain_print(netdissect_options *ndo,
        const u_char *cp;
        uint16_t b2;
 
+       ndo->ndo_protocol = "domain";
        np = (const dns_header_t *)bp;
        ND_TCHECK_SIZE(np);
        flags = EXTRACT_BE_U_2(np->flags);
index 47e8b1aa3cf8ae103e28cadfcbe83e05a77a2218..5e76e2a2a417f26efb48aa58614507ff68be1b97 100644 (file)
@@ -49,6 +49,7 @@ dtp_print (netdissect_options *ndo, const u_char *pptr, u_int length)
     int type, len;
     const u_char *tptr;
 
+    ndo->ndo_protocol = "dtp";
     if (length < DTP_HEADER_LEN)
         goto trunc;
 
index b6e129a588054693b5b5675cfa265569bd23d913..6cc7da7c5530033526d21e3b29ca4677c7172807 100644 (file)
@@ -73,6 +73,7 @@ dvmrp_print(netdissect_options *ndo,
        u_char type;
        uint8_t major_version, minor_version;
 
+       ndo->ndo_protocol = "dvmrp";
        ep = ndo->ndo_snapend;
        if (bp >= ep)
                return;
index f0a5de058276c0bac6a90573271822da248df76f..a17a740ace3327cb2b5260a7c7d1f74594e07e9a 100644 (file)
@@ -156,6 +156,7 @@ eap_print(netdissect_options *ndo,
     u_int eap_type, tlen, type, subtype;
     int count=0, len;
 
+    ndo->ndo_protocol = "eap";
     tptr = cp;
     tlen = length;
     eap = (const struct eap_frame_t *)cp;
index 3a689d92612a8af2182b39a4eaa15a11e843cd15..aa8c7ce5c5f57f6a63a930ebc1824a1673a2d130 100644 (file)
@@ -255,6 +255,7 @@ egp_print(netdissect_options *ndo,
        u_int code;
        u_int status;
 
+       ndo->ndo_protocol = "egp";
        egp = (const struct egp_packet *)bp;
        if (length < sizeof(*egp) || !ND_TTEST_SIZE(egp)) {
                ND_PRINT("[|egp]");
index 022c93553a7220d926ab5d85ad6d3cb79b0f4272..a9206a8761438727b3bb3d8c1f59fd79b7b000db 100644 (file)
@@ -228,6 +228,7 @@ eigrp_print(netdissect_options *ndo, const u_char *pptr, u_int len)
         const struct eigrp_tlv_at_ext_t *eigrp_tlv_at_ext;
     } tlv_ptr;
 
+    ndo->ndo_protocol = "eigrp";
     tptr=pptr;
     eigrp_com_header = (const struct eigrp_common_header *)pptr;
     ND_TCHECK_SIZE(eigrp_com_header);
index 94f4b095a1400b5a744fb25de07ef396d7de8b50..fb9b708797feda2e13a13b64a9f5b1681da37ec4 100644 (file)
@@ -103,6 +103,7 @@ enc_if_print(netdissect_options *ndo,
        u_int af, flags;
        const struct enchdr *hdr;
 
+       ndo->ndo_protocol = "enc_if";
        if (caplen < ENC_HDRLEN) {
                ND_PRINT("[|enc]");
                goto out;
index 31630100cde1ccebe0677dfa9a1d929730485e25..53b6d243e7410c200a0fe8e6b356b84a8b7b6bba 100644 (file)
@@ -670,6 +670,7 @@ esp_print(netdissect_options *ndo,
        u_char *output_buffer;
 #endif
 
+       ndo->ndo_protocol = "esp";
        esp = (const struct newesp *)bp;
 
 #ifdef HAVE_LIBCRYPTO
index 0a331d188b8f10c344379b8bc0626a091be6ecd4..112c6e812ba22e82877da053d1537eacbc0cb55e 100644 (file)
@@ -157,6 +157,7 @@ ether_print(netdissect_options *ndo,
        int llc_hdrlen;
        struct lladdr_info src, dst;
 
+       ndo->ndo_protocol = "ether";
        if (caplen < ETHER_HDRLEN) {
                ND_PRINT("[|ether]");
                return (caplen);
@@ -274,6 +275,7 @@ u_int
 ether_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
                const u_char *p)
 {
+       ndo->ndo_protocol = "ether_if";
        return (ether_print(ndo, p, h->len, h->caplen, NULL, NULL));
 }
 
@@ -293,6 +295,7 @@ netanalyzer_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
        /*
         * Fail if we don't have enough data for the Hilscher pseudo-header.
         */
+       ndo->ndo_protocol = "netanalyzer_if";
        if (h->len < 4 || h->caplen < 4) {
                ND_PRINT("[|netanalyzer]");
                return (h->caplen);
@@ -321,6 +324,7 @@ netanalyzer_transparent_if_print(netdissect_options *ndo,
         * Fail if we don't have enough data for the Hilscher pseudo-header,
         * preamble, and SOF.
         */
+       ndo->ndo_protocol = "netanalyzer_transparent_if";
        if (h->len < 12 || h->caplen < 12) {
                ND_PRINT("[|netanalyzer-transparent]");
                return (h->caplen);
index f87c00f7c93cb668f8fae4854319bcfa4f4e59d7..af8477ef1afef6c9a864098abba8921f7107cc86 100644 (file)
@@ -282,6 +282,7 @@ fddi_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
        struct lladdr_info src, dst;
        int llc_hdrlen;
 
+       ndo->ndo_protocol = "fddi";
        if (caplen < FDDI_HDRLEN) {
                ND_PRINT("[|fddi]");
                return (caplen);
@@ -344,5 +345,6 @@ fddi_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
 u_int
 fddi_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
+       ndo->ndo_protocol = "fddi_if";
        return (fddi_print(ndo, p, h->len, h->caplen));
 }
index 6835522a8e7605f0e759712a4a1c8c75a29508f0..be978f28849bdb04ffe033fd7c5de05d65ca0b35 100644 (file)
@@ -1707,6 +1707,7 @@ forces_print(netdissect_options *ndo,
        const struct tom_h *tops;
        int rc = 0;
 
+       ndo->ndo_protocol = "forces";
        fhdr = (const struct forcesh *)pptr;
        ND_TCHECK_SIZE(fhdr);
        tom = EXTRACT_U_1(fhdr->fm_tom);
index cfd1747d76e5aab8d6cf19e3460ebf1b32b46264..88f7de179ea596ae029cebf1bbddb8ce55fb2664 100644 (file)
@@ -220,6 +220,7 @@ fr_if_print(netdissect_options *ndo,
        u_int length = h->len;
        u_int caplen = h->caplen;
 
+       ndo->ndo_protocol = "fr_if";
         ND_TCHECK_4(p); /* minimum frame header length */
 
         if ((length = fr_print(ndo, p, length)) == 0)
@@ -243,6 +244,7 @@ fr_print(netdissect_options *ndo,
        u_int hdr_len;
        uint32_t flags;
 
+       ndo->ndo_protocol = "fr";
        ret = parse_q922_header(ndo, p, &dlci, &addr_len, &flags, length);
        if (ret == -1)
                goto trunc;
@@ -376,6 +378,7 @@ mfr_if_print(netdissect_options *ndo,
        u_int length = h->len;
        u_int caplen = h->caplen;
 
+       ndo->ndo_protocol = "mfr_if";
         ND_TCHECK_2(p); /* minimum frame header length */
 
         if ((length = mfr_print(ndo, p, length)) == 0)
@@ -454,6 +457,7 @@ mfr_print(netdissect_options *ndo,
  *    +----+----+----+----+----+----+----+----+
  */
 
+    ndo->ndo_protocol = "mfr";
     ND_TCHECK_4(p); /* minimum frame header length */
 
     if ((EXTRACT_U_1(p) & MFR_BEC_MASK) == MFR_CTRL_FRAME && EXTRACT_U_1(p + 1) == 0) {
@@ -798,6 +802,7 @@ q933_print(netdissect_options *ndo,
        u_int non_locking_shift;
        u_int unshift_codeset;
 
+       ndo->ndo_protocol = "q933";
        ND_PRINT("%s", ndo->ndo_eflag ? "" : "Q.933");
 
        if (length == 0 || !ND_TTEST_1(p)) {
index 634e7c9a12fd488e1121df8af50c599322ced4a7..f545d2d5b6e701d5382e1480e7269d6755a980fc 100644 (file)
@@ -38,6 +38,7 @@ frag6_print(netdissect_options *ndo, const u_char *bp, const u_char *bp2)
        const struct ip6_frag *dp;
        const struct ip6_hdr *ip6;
 
+       ndo->ndo_protocol = "frag6";
        dp = (const struct ip6_frag *)bp;
        ip6 = (const struct ip6_hdr *)bp2;
 
index b4936077eeb57bd4bbebf1692623939665d4f38a..f56468740161b7bb51111807d1e31d046c060f71 100644 (file)
@@ -28,5 +28,6 @@
 void
 ftp_print(netdissect_options *ndo, const u_char *pptr, u_int len)
 {
+       ndo->ndo_protocol = "ftp";
        txtproto_print(ndo, pptr, len, "ftp", NULL, 0);
 }
index a27c2b066ad732412dd99e722294552f5526891b..cfc981ede915800d6352cf1d9db319de11ac40f0 100644 (file)
@@ -153,6 +153,7 @@ geneve_print(netdissect_options *ndo, const u_char *bp, u_int len)
     uint8_t reserved;
     u_int opts_len;
 
+    ndo->ndo_protocol = "geneve";
     ND_PRINT("Geneve");
 
     ND_TCHECK_8(bp);
index c029cdc460208ded824e35041f2da93d2cfb0058..6558eacd47631468bbcd45bf62b792fbab9360aa 100644 (file)
@@ -118,6 +118,7 @@ geonet_print(netdissect_options *ndo, const u_char *bp, u_int length,
        const char *hdr_type_txt = "Unknown";
        int hdr_size = -1;
 
+       ndo->ndo_protocol = "geonet";
        ND_PRINT("GeoNet ");
        if (src != NULL)
                ND_PRINT("src:%s", (src->addr_string)(ndo, src->addr));
index 66069086c4d42816425993f35a81d909228db570..73fcb923614cd68ccdf410a3a24269907d34644d 100644 (file)
@@ -89,6 +89,7 @@ gre_print(netdissect_options *ndo, const u_char *bp, u_int length)
 {
        u_int len = length, vers;
 
+       ndo->ndo_protocol = "gre";
        ND_TCHECK_2(bp);
        if (len < 2)
                goto trunc;
index e448f567a05859d49a3284e7850b5ff80af70499..471161f1dbf8007f02fba880d28da807d4f62600 100644 (file)
@@ -49,6 +49,7 @@ void
 hncp_print(netdissect_options *ndo,
            const u_char *cp, u_int length)
 {
+    ndo->ndo_protocol = "hncp";
     ND_PRINT("hncp (%u)", length);
     hncp_print_rec(ndo, cp, length, 1);
 }
index b29135f38c8b77dd13e378c96e16987f2fd381ac..cc9655ca214292f8ef0f573edb288d9aff4964d6 100644 (file)
@@ -99,6 +99,7 @@ hsrp_print(netdissect_options *ndo, const u_char *bp, u_int len)
        const struct hsrp *hp = (const struct hsrp *) bp;
        uint8_t version;
 
+       ndo->ndo_protocol = "hsrp";
        ND_TCHECK_1(hp->hsrp_version);
        version = EXTRACT_U_1(hp->hsrp_version);
        ND_PRINT("HSRPv%u", version);
index f4cc0e7bd39ea329128172e8b4ed53fea1f461b8..c8b6be127bc462c6b19c4a99329be630bd808757 100644 (file)
@@ -73,5 +73,6 @@ static const char *httpcmds[] = {
 void
 http_print(netdissect_options *ndo, const u_char *pptr, u_int len)
 {
+       ndo->ndo_protocol = "http";
        txtproto_print(ndo, pptr, len, "http", httpcmds, RESP_CODE_SECOND_TOKEN);
 }
index a5b94d63031309ffd4b05dbba8502b5a81b6fe6d..7ad886d276c1f0ee63755d3e7bbdbe7c84d87892 100644 (file)
@@ -347,6 +347,7 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char *
        char buf[MAXHOSTNAMELEN + 100];
        struct cksum_vec vec[1];
 
+       ndo->ndo_protocol = "icmp";
        dp = (const struct icmp *)bp;
         ext_dp = (const struct icmp_ext_t *)bp;
        ip = (const struct ip *)bp2;
index 9bbd5c81f5d38a812db6b96f719eed06edf96d95..151a4db7b80b809fd54b9784cb8769b69f627499 100644 (file)
@@ -1033,6 +1033,7 @@ icmp6_print(netdissect_options *ndo,
        const u_char *ep;
        u_int prot;
 
+       ndo->ndo_protocol = "icmp6";
        dp = (const struct icmp6_hdr *)bp;
        ip = (const struct ip6_hdr *)bp2;
        oip = (const struct ip6_hdr *)(dp + 1);
index d78e913f32e30a481ea474e0bfd11ce7f2f31d5f..fdfae53de3b434690ceffd1de2856e5cbf3de04b 100644 (file)
@@ -268,6 +268,7 @@ igmp_print(netdissect_options *ndo,
 {
     struct cksum_vec vec[1];
 
+    ndo->ndo_protocol = "igmp";
     if (ndo->ndo_qflag) {
         ND_PRINT("igmp");
         return;
index e40c22f78666a2a970e405d71774b47826fa6263..f0fe6013e8c28f25e2788fde78637413409d4c48 100644 (file)
@@ -108,6 +108,7 @@ igrp_print(netdissect_options *ndo, const u_char *bp, u_int length)
        const u_char *cp;
        u_int nint, nsys, next;
 
+       ndo->ndo_protocol = "igrp";
        hdr = (const struct igrphdr *)bp;
        cp = (const u_char *)(hdr + 1);
        ND_PRINT("igrp:");
index e116f06516888d0904b8a3e9e2905dde55678068..b1a23db9219f251d1ef97392172c295728a3c63b 100644 (file)
@@ -549,6 +549,7 @@ ip_print(netdissect_options *ndo,
        uint16_t sum, ip_sum;
        const char *p_name;
 
+       ndo->ndo_protocol = "ip";
        ipds->ip = (const struct ip *)bp;
        ND_TCHECK_1(ipds->ip->ip_vhl);
        if (IP_V(ipds->ip) != 4) { /* print version and fail if != 4 */
@@ -710,6 +711,7 @@ trunc:
 void
 ipN_print(netdissect_options *ndo, const u_char *bp, u_int length)
 {
+       ndo->ndo_protocol = "ipN";
        if (length < 1) {
                ND_PRINT("truncated-ip %u", length);
                return;
index f22d2c05f52e9bad7447dacb5442ca318a8f3eb7..50374e089bdca135a3cc3318d4d5821c3a7bc196 100644 (file)
@@ -224,6 +224,7 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length)
        int fragmented = 0;
        u_int flow;
 
+       ndo->ndo_protocol = "ip6";
        ip6 = (const struct ip6_hdr *)bp;
 
        ND_TCHECK_SIZE(ip6);
index 5d4ecb246706141dcf841d6a8b51aafcf20b32b5..3152388387f0b4e2600f5f8f2f755114c5e4ccc4 100644 (file)
@@ -176,6 +176,7 @@ hbhopt_print(netdissect_options *ndo, const u_char *bp)
     const struct ip6_hbh *dp = (const struct ip6_hbh *)bp;
     u_int hbhlen = 0;
 
+    ndo->ndo_protocol = "hbhopt";
     ND_TCHECK_1(dp->ip6h_len);
     hbhlen = (EXTRACT_U_1(dp->ip6h_len) + 1) << 3;
     ND_TCHECK_LEN(dp, hbhlen);
@@ -196,6 +197,7 @@ dstopt_print(netdissect_options *ndo, const u_char *bp)
     const struct ip6_dest *dp = (const struct ip6_dest *)bp;
     u_int dstoptlen = 0;
 
+    ndo->ndo_protocol = "dstopt";
     ND_TCHECK_1(dp->ip6d_len);
     dstoptlen = (EXTRACT_U_1(dp->ip6d_len) + 1) << 3;
     ND_TCHECK_LEN(dp, dstoptlen);
index 28fac51d6e76c632f206e426f35b60cf49a05e1d..e0aefcbbc74806da753e68d880eabe57853140de 100644 (file)
@@ -42,6 +42,7 @@ ipcomp_print(netdissect_options *ndo, const u_char *bp)
        const struct ipcomp *ipcomp;
        uint16_t cpi;
 
+       ndo->ndo_protocol = "ipcomp";
        ipcomp = (const struct ipcomp *)bp;
        ND_TCHECK_SIZE(ipcomp);
        cpi = EXTRACT_BE_U_2(ipcomp->comp_cpi);
index 358bf0ba24c97bcbd56b422be410b95addb7755c..5df6127c712851e3fa716f2a7db9a180ec1ecb50 100644 (file)
@@ -95,6 +95,7 @@ ipfc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
        struct lladdr_info src, dst;
        int llc_hdrlen;
 
+       ndo->ndo_protocol = "ipfc";
        if (caplen < IPFC_HDRLEN)
                goto trunc;
        /*
@@ -142,5 +143,6 @@ trunc:
 u_int
 ipfc_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
+       ndo->ndo_protocol = "ipfc_if";
        return (ipfc_print(ndo, p, h->len, h->caplen));
 }
index 9777909b48fd94aacfa4d7421c036b1677605f64..627c9b945b4f33c3b160dc8f52a44ad0a4f852e3 100644 (file)
@@ -66,6 +66,7 @@ ipnet_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen
 {
        const ipnet_hdr_t *hdr;
 
+       ndo->ndo_protocol = "ipnet";
        if (caplen < sizeof(ipnet_hdr_t))
                goto trunc;
 
@@ -112,6 +113,7 @@ u_int
 ipnet_if_print(netdissect_options *ndo,
                const struct pcap_pkthdr *h, const u_char *p)
 {
+       ndo->ndo_protocol = "ipnet_if";
        ipnet_print(ndo, p, h->len, h->caplen);
 
        return (sizeof(ipnet_hdr_t));
index 80c7661984012985b035ad914f40da0fbd597f1f..b17cdf61818092b985260f1494c911ad0f2147f0 100644 (file)
@@ -73,6 +73,7 @@ ipx_print(netdissect_options *ndo, const u_char *p, u_int length)
 {
        const struct ipxHdr *ipx = (const struct ipxHdr *)p;
 
+       ndo->ndo_protocol = "ipx";
        if (!ndo->ndo_eflag)
                ND_PRINT("IPX ");
 
index 5ca215dabc8cdbc16b552bca22c2cf247b9ceafa..d407e81049e076a48730386662325556b234d417 100644 (file)
@@ -3032,6 +3032,7 @@ isakmp_print(netdissect_options *ndo,
        const u_char *ep;
        u_int major, minor;
 
+       ndo->ndo_protocol = "isakmp";
 #ifdef HAVE_LIBCRYPTO
        /* initialize SAs */
        if (ndo->ndo_sa_list_head == NULL) {
@@ -3087,6 +3088,7 @@ isakmp_rfc3948_print(netdissect_options *ndo,
                     const u_char *bp, u_int length,
                     const u_char *bp2)
 {
+       ndo->ndo_protocol = "isakmp_rfc3948";
        ND_TCHECK_1(bp);
        if(length == 1 && EXTRACT_U_1(bp)==0xff) {
                ND_PRINT("isakmp-nat-keep-alive");
index 329d52f262a44f13c4d3b4cd2f2ab140e5f85c78..f79f240406f5cccf226551b0b30e30b53e5fc096 100644 (file)
@@ -679,6 +679,7 @@ struct isis_tlv_lsp {
 void
 isoclns_print(netdissect_options *ndo, const u_char *p, u_int length)
 {
+       ndo->ndo_protocol = "isoclns";
        if (!ND_TTEST_1(p)) { /* enough bytes on the wire ? */
                ND_PRINT("|OSI");
                return;
index d1f9a663d09f1ae3ca7bc1528c3887515f39e4b6..28ce37f310c52550d43365e2e8450f50a23a55c7 100644 (file)
@@ -466,6 +466,7 @@ juniper_ggsn_if_print(netdissect_options *ndo,
         const struct juniper_ggsn_header *gh;
         uint8_t proto;
 
+       ndo->ndo_protocol = "juniper_ggsn_if";
         l2info.pictype = DLT_JUNIPER_GGSN;
         if (juniper_parse_header(ndo, p, h, &l2info) == 0)
             return l2info.header_len;
@@ -519,6 +520,7 @@ juniper_es_if_print(netdissect_options *ndo,
         u_int rewrite_len,es_type_bundle;
         const struct juniper_ipsec_header *ih;
 
+       ndo->ndo_protocol = "juniper_es_if";
         l2info.pictype = DLT_JUNIPER_ES;
         if (juniper_parse_header(ndo, p, h, &l2info) == 0)
             return l2info.header_len;
@@ -593,6 +595,7 @@ juniper_monitor_if_print(netdissect_options *ndo,
         };
         const struct juniper_monitor_header *mh;
 
+       ndo->ndo_protocol = "juniper_monitor_if";
         l2info.pictype = DLT_JUNIPER_MONITOR;
         if (juniper_parse_header(ndo, p, h, &l2info) == 0)
             return l2info.header_len;
@@ -633,6 +636,7 @@ juniper_services_if_print(netdissect_options *ndo,
         };
         const struct juniper_services_header *sh;
 
+       ndo->ndo_protocol = "juniper_services_if";
         l2info.pictype = DLT_JUNIPER_SERVICES;
         if (juniper_parse_header(ndo, p, h, &l2info) == 0)
             return l2info.header_len;
@@ -666,6 +670,7 @@ juniper_pppoe_if_print(netdissect_options *ndo,
 {
         struct juniper_l2info_t l2info;
 
+       ndo->ndo_protocol = "juniper_pppoe_if";
         l2info.pictype = DLT_JUNIPER_PPPOE;
         if (juniper_parse_header(ndo, p, h, &l2info) == 0)
             return l2info.header_len;
@@ -684,6 +689,7 @@ juniper_ether_if_print(netdissect_options *ndo,
 {
         struct juniper_l2info_t l2info;
 
+       ndo->ndo_protocol = "juniper_ether_if";
         l2info.pictype = DLT_JUNIPER_ETHER;
         if (juniper_parse_header(ndo, p, h, &l2info) == 0)
             return l2info.header_len;
@@ -702,6 +708,7 @@ juniper_ppp_if_print(netdissect_options *ndo,
 {
         struct juniper_l2info_t l2info;
 
+       ndo->ndo_protocol = "juniper_ppp_if";
         l2info.pictype = DLT_JUNIPER_PPP;
         if (juniper_parse_header(ndo, p, h, &l2info) == 0)
             return l2info.header_len;
@@ -720,6 +727,7 @@ juniper_frelay_if_print(netdissect_options *ndo,
 {
         struct juniper_l2info_t l2info;
 
+       ndo->ndo_protocol = "juniper_frelay_if";
         l2info.pictype = DLT_JUNIPER_FRELAY;
         if (juniper_parse_header(ndo, p, h, &l2info) == 0)
             return l2info.header_len;
@@ -738,6 +746,7 @@ juniper_chdlc_if_print(netdissect_options *ndo,
 {
         struct juniper_l2info_t l2info;
 
+       ndo->ndo_protocol = "juniper_chdlc_if";
         l2info.pictype = DLT_JUNIPER_CHDLC;
         if (juniper_parse_header(ndo, p, h, &l2info) == 0)
             return l2info.header_len;
@@ -757,6 +766,7 @@ juniper_pppoe_atm_if_print(netdissect_options *ndo,
         struct juniper_l2info_t l2info;
        uint16_t extracted_ethertype;
 
+       ndo->ndo_protocol = "juniper_pppoe_atm_if";
         l2info.pictype = DLT_JUNIPER_PPPOE_ATM;
         if (juniper_parse_header(ndo, p, h, &l2info) == 0)
             return l2info.header_len;
@@ -790,6 +800,7 @@ juniper_mlppp_if_print(netdissect_options *ndo,
 {
         struct juniper_l2info_t l2info;
 
+       ndo->ndo_protocol = "juniper_mlppp_if";
         l2info.pictype = DLT_JUNIPER_MLPPP;
         if (juniper_parse_header(ndo, p, h, &l2info) == 0)
             return l2info.header_len;
@@ -850,6 +861,7 @@ juniper_mfr_if_print(netdissect_options *ndo,
 {
         struct juniper_l2info_t l2info;
 
+       ndo->ndo_protocol = "juniper_mfr_if";
         memset(&l2info, 0, sizeof(l2info));
         l2info.pictype = DLT_JUNIPER_MFR;
         if (juniper_parse_header(ndo, p, h, &l2info) == 0)
@@ -912,6 +924,7 @@ juniper_mlfr_if_print(netdissect_options *ndo,
 {
         struct juniper_l2info_t l2info;
 
+       ndo->ndo_protocol = "juniper_mlfr_if";
         l2info.pictype = DLT_JUNIPER_MLFR;
         if (juniper_parse_header(ndo, p, h, &l2info) == 0)
             return l2info.header_len;
@@ -957,6 +970,7 @@ juniper_atm1_if_print(netdissect_options *ndo,
 
         struct juniper_l2info_t l2info;
 
+       ndo->ndo_protocol = "juniper_atm1_if";
         l2info.pictype = DLT_JUNIPER_ATM1;
         if (juniper_parse_header(ndo, p, h, &l2info) == 0)
             return l2info.header_len;
@@ -1011,6 +1025,7 @@ juniper_atm2_if_print(netdissect_options *ndo,
 
         struct juniper_l2info_t l2info;
 
+       ndo->ndo_protocol = "juniper_atm2_if";
         l2info.pictype = DLT_JUNIPER_ATM2;
         if (juniper_parse_header(ndo, p, h, &l2info) == 0)
             return l2info.header_len;
index 5e7cb4128bc6e0bad2aced7a7de94c5854449143..ab5989985eb6e9b76ba6ac2c5c1d05f101f3268c 100644 (file)
@@ -241,6 +241,7 @@ krb_print(netdissect_options *ndo,
 {
        const struct krb *kp;
 
+       ndo->ndo_protocol = "krb";
        kp = (const struct krb *)dat;
 
        if (dat >= ndo->ndo_snapend) {
index eb05029c8d8fb2951799203d6dc62966c3937500..ed351af947594d37032bf93c69f0c376005f9112 100644 (file)
@@ -775,6 +775,7 @@ l2tp_print(netdissect_options *ndo, const u_char *dat, u_int length)
        int flag_t, flag_l, flag_s, flag_o;
        uint16_t l2tp_len;
 
+       ndo->ndo_protocol = "l2tp";
        flag_t = flag_l = flag_s = flag_o = FALSE;
 
        ND_TCHECK_2(ptr);       /* Flags & Version */
index aaa242c7a7c1623b59124361239cc1896b70a995..c9acd446b2fb82136a8d3615a4a3adea37c56e26 100644 (file)
@@ -84,6 +84,7 @@ lane_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
 {
        const struct lane_controlhdr *lec;
 
+       ndo->ndo_protocol = "lane";
        if (caplen < sizeof(struct lane_controlhdr)) {
                ND_PRINT("[|lane]");
                return;
@@ -118,6 +119,7 @@ lane_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
 u_int
 lane_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
+       ndo->ndo_protocol = "lane_if";
        lane_print(ndo, p, h->len, h->caplen);
 
        return (sizeof(struct lecdatahdr_8023));
index 1e1f1b679e073ff17011aed3bf7d077f1a4e7225..1fbc0567bd78afe8f28da85baf6005155a0e5166 100644 (file)
@@ -549,6 +549,8 @@ ldp_print(netdissect_options *ndo,
           const u_char *pptr, u_int len)
 {
     int processed;
+
+    ndo->ndo_protocol = "ldp";
     while (len > (sizeof(struct ldp_common_header) + sizeof(struct ldp_msg_header))) {
         processed = ldp_pdu_print(ndo, pptr);
         if (processed == 0)
index 01e3fa01a3b313cae27385beaec27f1991297d96..2b903623d8eaef39289d2c061eb3af304c87482c 100644 (file)
@@ -250,6 +250,7 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length)
        const lisp_map_register_eid *lisp_eid;
        const lisp_map_register_loc *lisp_loc;
 
+       ndo->ndo_protocol = "lisp";
        /* Check if enough bytes for header are available */
        ND_TCHECK_LEN(bp, MAP_REGISTER_HDR_LEN);
        lisp_hdr = (const lisp_map_register_hdr *) bp;
index 86b90dffaa1eac0b4d7ff6ab73e60089a90c5acf..bb18603c4c5c6b1b124ead652d039d7417ac2975 100644 (file)
@@ -155,6 +155,7 @@ llc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen,
        int hdrlen;
        int is_u;
 
+       ndo->ndo_protocol = "llc";
        if (caplen < 3) {
                ND_PRINT("[|llc]");
                ND_DEFAULTPRINT((const u_char *)p, caplen);
@@ -427,6 +428,7 @@ snap_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen,
        u_short et;
        int ret;
 
+       ndo->ndo_protocol = "snap";
        ND_TCHECK_5(p);
        if (caplen < 5 || length < 5)
                goto trunc;
index c91b4c27cc54c97a672e8e0383e0485ceb68c992..dab0a99b8470c70623e13e3bd68043c0b68e1392 100644 (file)
@@ -1438,6 +1438,7 @@ lldp_print(netdissect_options *ndo,
     const u_char *tptr;
     char *network_addr;
 
+    ndo->ndo_protocol = "lldp";
     tptr = pptr;
     tlen = len;
 
index 6e3f9810fffe5d7b657714e0fca03228a357abef..6c0f671d33ddc8e80ab41eb806fe87217206de40 100644 (file)
@@ -440,6 +440,7 @@ lmp_print(netdissect_options *ndo,
         uint32_t i;
     } bw;
 
+    ndo->ndo_protocol = "lmp";
     tptr=pptr;
     lmp_com_header = (const struct lmp_common_header *)pptr;
     ND_TCHECK_SIZE(lmp_com_header);
index 46942c94d7190a73ee00ec9c78b5b0cef9e2e6ba..e0df6f26c8604d40fda6485c475154c0eb6655d2 100644 (file)
@@ -110,6 +110,7 @@ loopback_print(netdissect_options *ndo, const u_char *cp, const u_int len)
        const u_char *ep = ndo->ndo_snapend;
        uint16_t skipCount;
 
+       ndo->ndo_protocol = "loopback";
        ND_PRINT("Loopback");
        if (len < 2)
                goto invalid;
index bb32b3e3835dfbc7a9a380d73e8d17c543df20a7..f20d9b75dff0ba336181ea2f2507bef38ca29095 100644 (file)
@@ -525,6 +525,7 @@ lspping_print(netdissect_options *ndo,
         const struct lspping_tlv_targetfec_subtlv_bgp_ipv6_t *lspping_tlv_targetfec_subtlv_bgp_ipv6;
     } subtlv_ptr;
 
+    ndo->ndo_protocol = "lspping";
     tptr=pptr;
     lspping_com_header = (const struct lspping_common_header *)pptr;
     if (len < sizeof(struct lspping_common_header))
index 15e2022ce8e06975bdbca73b59e2baf52b81c94f..a18459242400807d4b746c0f73e4e8304862febc 100644 (file)
@@ -175,6 +175,7 @@ lwapp_control_print(netdissect_options *ndo,
     u_int tlen;
     u_int msg_type, msg_tlen;
 
+    ndo->ndo_protocol = "lwapp_control";
     tptr=pptr;
 
     if (has_ap_ident) {
@@ -307,6 +308,7 @@ lwapp_data_print(netdissect_options *ndo,
     u_int tlen;
     u_int version;
 
+    ndo->ndo_protocol = "lwapp_data";
     tptr=pptr;
 
     /* check if enough bytes for AP identity */
index b2a32be6d36be9f806e4e1705f056ac70cd2928d..520c235658d9ac0c4e569fbf58fa6289b7c5e24d 100644 (file)
@@ -315,6 +315,7 @@ lwres_print(netdissect_options *ndo,
        int advance;
        int unsupported = 0;
 
+       ndo->ndo_protocol = "lwres";
        np = (const struct lwres_lwpacket *)bp;
        ND_TCHECK_2(np->authlength);
 
index 799966461dbb30cb2b001aba1083fecf037885e6..a94003970ef2960e80283b2bb0961a5b91cb1fe4 100644 (file)
@@ -304,6 +304,7 @@ m3ua_print(netdissect_options *ndo,
   const struct tok *dict;
   uint8_t msg_class;
 
+  ndo->ndo_protocol = "m3ua";
   /* size includes the header */
   if (size < sizeof(struct m3ua_common_header))
     goto invalid;
index 8161012bf110147d71db7e14c850b243dd880ee1..dce2b4e8fefc32c1fe7fda1768a047b07dd053d5 100644 (file)
@@ -147,6 +147,7 @@ medsa_print(netdissect_options *ndo,
        const struct medsa_pkthdr *medsa;
        u_short ether_type;
 
+       ndo->ndo_protocol = "medsa";
        medsa = (const struct medsa_pkthdr *)bp;
        ND_TCHECK_SIZE(medsa);
 
index ee916a943b0420d08b7f36a45a682835984226c7..11314d7c7f19c35d29cc6089af67d0abe5dceaf6 100644 (file)
@@ -70,6 +70,7 @@ mobile_print(netdissect_options *ndo, const u_char *bp, u_int length)
        u_short proto,crc;
        u_char osp =0;                  /* old source address present */
 
+       ndo->ndo_protocol = "mobile";
        mob = (const struct mobile_ip *)bp;
 
        if (length < MOBILE_SIZE || !ND_TTEST_SIZE(mob)) {
index 551c316d862204ad360a5d4e0c75788ee3844e8e..138d2396b339db2df0ee55458e2ed1f4fa1c7615 100644 (file)
@@ -207,6 +207,7 @@ mobility_print(netdissect_options *ndo,
        unsigned mhlen, hlen;
        uint8_t type;
 
+       ndo->ndo_protocol = "mobility";
        mh = (const struct ip6_mobility *)bp;
 
        /* 'ep' points to the end of available data. */
index 88862896083407e8a5022302f7c5e50d9420abb5..6535ad290cdf1621d7e0c118ca281cee23304f73 100644 (file)
@@ -134,6 +134,7 @@ mpcp_print(netdissect_options *ndo, const u_char *pptr, u_int length)
     uint8_t grant_numbers, grant;
     uint8_t queue_sets, queue_set, report_bitmap, report;
 
+    ndo->ndo_protocol = "mpcp";
     tptr=pptr;
     mpcp.common_header = (const struct mpcp_common_header_t *)pptr;
 
index 1ade6e65d9b92b288e7a1a2159ac6de965df5ba8..db9be428fb784cf8e6d8086765e2440944114963 100644 (file)
@@ -64,6 +64,7 @@ mpls_print(netdissect_options *ndo, const u_char *bp, u_int length)
        uint16_t label_stack_depth = 0;
        enum mpls_packet_type pt = PT_UNKNOWN;
 
+       ndo->ndo_protocol = "mpls";
        p = bp;
        ND_PRINT("MPLS");
        do {
index 4dd450b9f52ad70931f215e144fe0ff37f42d9de..5a7cec8b2129ae4c08f933118cc49f09f3abd134 100644 (file)
@@ -437,6 +437,7 @@ mptcp_print(netdissect_options *ndo,
         const struct mptcp_option *opt;
         u_int subtype;
 
+       ndo->ndo_protocol = "mptcp";
         if (len < 3)
                 return 0;
 
index 5fd86422a9d7e592882d2b3eafe8d055ce46717c..bb3b95b89446c6dff5ecdeb2c17185b59ad565f6 100644 (file)
@@ -35,6 +35,7 @@ msdp_print(netdissect_options *ndo, const u_char *sp, u_int length)
 {
        unsigned int type, len;
 
+       ndo->ndo_protocol = "msdp";
        ND_TCHECK_3(sp);
        /* See if we think we're at the beginning of a compound packet */
        type = EXTRACT_U_1(sp);
index 3d201fa30cdecc8b4abcb1e9d17e6f99d07a6555..5fdf5575991133aa895882dde0e1a1ae0dbad5e0 100644 (file)
@@ -52,6 +52,7 @@ msnlb_print(netdissect_options *ndo, const u_char *bp)
 {
        const struct msnlb_heartbeat_pkt *hb;
 
+       ndo->ndo_protocol = "msnlb";
        hb = (const struct msnlb_heartbeat_pkt *)bp;
        ND_TCHECK_SIZE(hb);
 
index 522d212ce06f33832da31c747c00d0d8ff99889a..6a22ca9db8f0ce271730bc489422a5440ccffcfd 100644 (file)
@@ -77,6 +77,7 @@ nflog_if_print(netdissect_options *ndo,
        u_int caplen = h->caplen;
        u_int length = h->len;
 
+       ndo->ndo_protocol = "nflog_if";
        if (caplen < sizeof(nflog_hdr_t) || length < sizeof(nflog_hdr_t))
                goto trunc;
 
index e240a0e7d872afb956428614bacfe8ca7e36fe60..6866b1d39cb650dd9867ba2c45810daec5ba97a1 100644 (file)
@@ -326,6 +326,7 @@ nfsreply_print(netdissect_options *ndo,
        const struct sunrpc_msg *rp;
        char srcid[20], dstid[20];      /*fits 32bit*/
 
+       ndo->ndo_protocol = "nfsreply";
        nfserr = 0;             /* assume no error */
        rp = (const struct sunrpc_msg *)bp;
 
@@ -361,6 +362,7 @@ nfsreply_noaddr_print(netdissect_options *ndo,
        uint32_t rhigh;
        enum sunrpc_auth_stat rwhy;
 
+       ndo->ndo_protocol = "nfsreply_noaddr";
        nfserr = 0;             /* assume no error */
        rp = (const struct sunrpc_msg *)bp;
 
@@ -530,6 +532,7 @@ nfsreq_noaddr_print(netdissect_options *ndo,
        uint32_t access_flags;
        struct nfsv3_sattr sa3;
 
+       ndo->ndo_protocol = "nfsreq_noaddr";
        ND_PRINT("%u", length);
        nfserr = 0;             /* assume no error */
        rp = (const struct sunrpc_msg *)bp;
index 5ece5b5e72fe5d08ae60ed3f461589c98ed57210..fc129200ca589ba433bc1deb0b52306b4647d894 100644 (file)
@@ -62,6 +62,7 @@ nsh_print(netdissect_options *ndo, const u_char *bp, u_int len)
     uint8_t tlv_len;
     u_int next_len;
 
+    ndo->ndo_protocol = "nsh";
     /* print Base Header and Service Path Header */
     if (len < NSH_BASE_HDR_LEN + NSH_SERVICE_PATH_HDR_LEN)
         goto trunc;
index faa31fa40b42e81e6dfc48ab3d6e2170c9c9631c..b8772e9eab7bb0f7801ddb256bd9cf7125c2d9f0 100644 (file)
@@ -456,6 +456,7 @@ ntp_print(netdissect_options *ndo,
        u_int mode, version, leapind;
        uint8_t status;
 
+       ndo->ndo_protocol = "ntp";
        ND_TCHECK_1(bp->td.status);
        status = EXTRACT_U_1(bp->td.status);
 
index f1067ff5ca1d673560b0a7aad96b0026f786e125..f1f66930f480f31ec005d426e371df6e73f41ec9 100644 (file)
@@ -82,6 +82,7 @@ null_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char
        u_int caplen = h->caplen;
        uint32_t family;
 
+       ndo->ndo_protocol = "null_if";
        if (caplen < NULL_HDRLEN)
                goto trunc;
 
index cd96e95dfa1e4de0f1565f0ec7b2065b16922d59..09b6c74c5869b55acd39cb7d7626c4b8c3f8beee 100644 (file)
@@ -327,6 +327,7 @@ olsr_print(netdissect_options *ndo,
     uint8_t link_type, neighbor_type;
     const u_char *tptr, *msg_data;
 
+    ndo->ndo_protocol = "olsr";
     tptr = pptr;
 
     if (length < sizeof(struct olsr_common)) {
index ee972cfe6b8de3d4101efab5420fb1c58627dbde..a0cabbe67b5be0ccfac8c363d7c4f5bdbda4b61c 100644 (file)
@@ -134,6 +134,7 @@ trunc:
 void
 openflow_print(netdissect_options *ndo, const u_char *cp, const u_int len _U_)
 {
+       ndo->ndo_protocol = "openflow";
        ND_PRINT(": OpenFlow");
        while (cp < ndo->ndo_snapend)
                cp = of_header_body_print(ndo, cp, ndo->ndo_snapend);
index 8e2bcfaeead6d8988b35ea1329db89ae2457c8d0..8907df14b5b36f8d3d2cc3c7eb9807f23acd4949 100644 (file)
@@ -1111,6 +1111,7 @@ ospf_print(netdissect_options *ndo,
        const u_char *dataend;
        const char *cp;
 
+       ndo->ndo_protocol = "ospf";
        op = (const struct ospfhdr *)bp;
 
        /* XXX Before we do anything else, strip off the MD5 trailer */
index 9164a008df224cd6997412cb5753c24b4b441de7..a3800109712a0ab2e9d87af9ff3913c62871581a 100644 (file)
@@ -962,6 +962,7 @@ ospf6_print(netdissect_options *ndo,
        const char *cp;
        uint16_t datalen;
 
+       ndo->ndo_protocol = "ospf6";
        op = (const struct ospf6hdr *)bp;
 
        /* If the type is valid translate it, or just print the type */
index 88c8cacc1c7142f9c24bef6d00289e4796d41f66..beda42e71a89447e6c58ebec0ba49df8124ef586 100644 (file)
@@ -45,6 +45,7 @@ otv_print(netdissect_options *ndo, const u_char *bp, u_int len)
 {
     uint8_t flags;
 
+    ndo->ndo_protocol = "otv";
     ND_PRINT("OTV, ");
     if (len < OTV_HDR_LEN)
         goto trunc;
index 722ce65bac3c25a181da197168dc652ce038f711..0be4e8ae76c823b181eb0627079083aa71d4943b 100644 (file)
@@ -90,6 +90,7 @@ pflog_print(netdissect_options *ndo, const struct pfloghdr *hdr)
 {
        uint32_t rulenr, subrulenr;
 
+       ndo->ndo_protocol = "pflog";
        rulenr = EXTRACT_BE_U_4(&hdr->rulenr);
        subrulenr = EXTRACT_BE_U_4(&hdr->subrulenr);
        if (subrulenr == (uint32_t)-1)
@@ -114,6 +115,7 @@ pflog_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
        const struct pfloghdr *hdr;
        uint8_t af;
 
+       ndo->ndo_protocol = "pflog_if";
        /* check length */
        if (caplen < sizeof(uint8_t)) {
                ND_PRINT("%s", tstr);
index e7bad48a87d4031245f7d93b3b1a146f744646db..fdab66f825f07a60a2570c99e5826569d8f1a5fb 100644 (file)
@@ -158,6 +158,7 @@ pgm_print(netdissect_options *ndo,
        uint8_t opt_type, opt_len;
        uint32_t seq, opts_len, len, offset;
 
+       ndo->ndo_protocol = "pgm";
        pgm = (const struct pgm_header *)bp;
        ip = (const struct ip *)bp2;
        if (IP_V(ip) == 6)
index 49c9f4659358a2dfc5d2136b917ef91ea02faf64..962f8772aa92a7e623723c8e259c1d0ecff27210 100644 (file)
@@ -254,6 +254,7 @@ pimv1_print(netdissect_options *ndo,
 {
        u_char type;
 
+       ndo->ndo_protocol = "pimv1";
        ND_TCHECK_1(bp + 1);
        type = EXTRACT_U_1(bp + 1);
 
@@ -350,6 +351,7 @@ cisco_autorp_print(netdissect_options *ndo,
        u_int numrps;
        u_int hold;
 
+       ndo->ndo_protocol = "cisco_autorp";
        if (len < 8)
                goto trunc;
        ND_TCHECK_1(bp);
@@ -461,6 +463,7 @@ pim_print(netdissect_options *ndo,
        const struct pim *pim = (const struct pim *)bp;
        uint8_t pim_typever;
 
+       ndo->ndo_protocol = "pim";
 #ifdef notyet                  /* currently we see only version and type */
        ND_TCHECK_1(pim->pim_rsv);
 #endif
index 3f28ccb08399ffa0fdd40bf7bf2dffc54982e9c5..6db3de503d64c1a3a4b95dbc15d79512963dca77 100644 (file)
@@ -106,6 +106,7 @@ pktap_if_print(netdissect_options *ndo,
        const pktap_header_t *hdr;
        struct pcap_pkthdr nhdr;
 
+       ndo->ndo_protocol = "pktap_if";
        if (caplen < sizeof(pktap_header_t) || length < sizeof(pktap_header_t)) {
                ND_PRINT("[|pktap]");
                return (0);
index 09cac11e81fd5d730a11c5728a73eac7f7239659..c58a3627b67d88a238685d13ad00d3884e2def40 100644 (file)
@@ -64,6 +64,7 @@ ppi_print(netdissect_options *ndo,
        uint32_t hdrlen;
        struct pcap_pkthdr nhdr;
 
+       ndo->ndo_protocol = "ppi";
        if (caplen < sizeof(ppi_header_t)) {
                ND_PRINT(" %s", tstr);
                return (caplen);
@@ -122,6 +123,7 @@ u_int
 ppi_if_print(netdissect_options *ndo,
             const struct pcap_pkthdr *h, const u_char *p)
 {
+       ndo->ndo_protocol = "ppi_if";
        return (ppi_print(ndo, h, p));
 }
 
index 7631ca586276fc5ba45545cdd280e8171704096a..a5bf65df1067114ebeffbdfac2d3e88f61cbd94a 100644 (file)
@@ -1544,6 +1544,7 @@ ppp_print(netdissect_options *ndo,
         u_int olen = length; /* _o_riginal length */
        u_int hdr_len = 0;
 
+       ndo->ndo_protocol = "ppp";
        /*
         * Here, we assume that p points to the Address and Control
         * field (if they present).
@@ -1614,6 +1615,7 @@ ppp_if_print(netdissect_options *ndo,
        u_int length = h->len;
        u_int caplen = h->caplen;
 
+       ndo->ndo_protocol = "ppp_if";
        if (caplen < PPP_HDRLEN) {
                ND_PRINT("[|ppp]");
                return (caplen);
@@ -1684,6 +1686,7 @@ ppp_hdlc_if_print(netdissect_options *ndo,
        u_int proto;
        u_int hdrlen = 0;
 
+       ndo->ndo_protocol = "ppp_hdlc_if";
        if (caplen < 2) {
                ND_PRINT("[|ppp]");
                return (caplen);
@@ -1758,6 +1761,7 @@ ppp_bsdos_if_print(netdissect_options *ndo _U_,
        const u_char *q;
        u_int i;
 
+       ndo->ndo_protocol = "ppp_bsdos_if";
        if (caplen < PPP_BSDI_HDRLEN) {
                ND_PRINT("[|ppp]");
                return (caplen);
index f7ac210be2a5449070669e8c0c137694a5a2ccb6..06e330fc54e6ba337c000e6d0156519bc00bd2cb 100644 (file)
@@ -87,6 +87,7 @@ static const struct tok pppoetag2str[] = {
 u_int
 pppoe_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
+       ndo->ndo_protocol = "pppoe_if";
        return (pppoe_print(ndo, p, h->len));
 }
 
@@ -97,6 +98,7 @@ pppoe_print(netdissect_options *ndo, const u_char *bp, u_int length)
        u_int pppoe_length;
        const u_char *pppoe_packet, *pppoe_payload;
 
+       ndo->ndo_protocol = "pppoe";
        if (length < PPPOE_HDRLEN) {
                ND_PRINT("truncated-pppoe %u", length);
                return (length);
index 25275981e5bce506aaadea9e5fc2545e1d97b30a..7eb6bc5912970cfca244d2892d2b96b549cd254f 100644 (file)
@@ -929,6 +929,7 @@ pptp_print(netdissect_options *ndo,
        uint32_t mc;
        uint16_t ctrl_msg_type;
 
+       ndo->ndo_protocol = "pptp";
        ND_PRINT(": pptp");
 
        hdr = (const struct pptp_hdr *)dat;
index b61aa23dd5262d572dc3749a326e39305c13495a..62f61f0c09cd220fdb0e4cdf71971ce019da1ba1 100644 (file)
@@ -1124,6 +1124,7 @@ radius_print(netdissect_options *ndo,
    const struct radius_hdr *rad;
    u_int len, auth_idx;
 
+   ndo->ndo_protocol = "radius";
    ND_TCHECK_LEN(dat, MIN_RADIUS_LEN);
    rad = (const struct radius_hdr *)dat;
    len = EXTRACT_BE_U_2(rad->len);
index 23ced7b07fe4b7a07dacc695c0d196ae5705d8d9..8d27a06ace4867f76fb3849ca350c43094c3765b 100644 (file)
@@ -36,6 +36,7 @@
 u_int
 raw_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
+       ndo->ndo_protocol = "raw_if";
        if (ndo->ndo_eflag)
                ND_PRINT("ip: ");
 
index 74fc2fdb4fae48f50c83cda3effae5edf651cd45..76d3744a9399328ba311aba77c76f4e619c209af 100644 (file)
@@ -214,6 +214,7 @@ resp_print(netdissect_options *ndo, const u_char *bp, u_int length)
 {
     int ret_len = 0, length_cur = length;
 
+    ndo->ndo_protocol = "resp";
     if(!bp || length <= 0)
         return;
 
index 2c3613551f6d8c35774466f447061b1afa47298d..1ec00d6e1b62f4bd77e30ece542011669658614c 100644 (file)
@@ -289,6 +289,7 @@ rip_print(netdissect_options *ndo,
        u_int i, j;
        unsigned entry_size;
 
+       ndo->ndo_protocol = "rip";
        if (ndo->ndo_snapend < dat) {
                ND_PRINT(" %s", tstr);
                return;
index 8a66cf4030fe8e1fa11c4ff0059c6a273fcb0f37..90eddf4571703719d5a1904f6f8839197e12062e 100644 (file)
@@ -116,6 +116,7 @@ ripng_print(netdissect_options *ndo, const u_char *dat, unsigned int length)
        unsigned int length_left;
        u_int j;
 
+       ndo->ndo_protocol = "ripng";
        ND_TCHECK_1(rp->rip6_cmd);
        cmd = EXTRACT_U_1(rp->rip6_cmd);
        switch (cmd) {
index 02fc4c9632d4bebd609b2dac6fd49f02933ab5b0..8642377cd3041377112ae7cb49abee2f6945fc39 100644 (file)
@@ -388,6 +388,7 @@ trunc:
 void
 rpki_rtr_print(netdissect_options *ndo, const u_char *pptr, u_int len)
 {
+    ndo->ndo_protocol = "rpki_rtr";
     if (!ndo->ndo_vflag) {
        ND_PRINT(", RPKI-RTR");
        return;
index 4d4aa6ed40cbfbcae6d76d4c32eb4a48ef9ec966..7e140fb92972f55ce69cfa8c284d0f6976719ee7 100644 (file)
@@ -96,6 +96,7 @@ rrcp_print(netdissect_options *ndo,
        uint8_t rrcp_proto;
        uint8_t rrcp_opcode;
 
+       ndo->ndo_protocol = "rrcp";
        ND_TCHECK_1(cp + RRCP_PROTO_OFFSET);
        rrcp_proto = EXTRACT_U_1(cp + RRCP_PROTO_OFFSET);
        ND_TCHECK_1(cp + RRCP_OPCODE_ISREPLY_OFFSET);
index eb4c917ec189bb0033336d681994b681ed214792..27b6933d1aec0e6c301c49933a40e18cdb34bdbf 100644 (file)
@@ -1880,6 +1880,7 @@ rsvp_print(netdissect_options *ndo,
     const u_char *tptr;
     u_short plen, tlen;
 
+    ndo->ndo_protocol = "rsvp";
     tptr=pptr;
 
     rsvp_com_header = (const struct rsvp_common_header *)pptr;
index 2c67c11dbacbe5b39d77ea66a62b6063f13915a9..ab2798764b8b7ac50960d45bc5e3a636b2fe16e4 100644 (file)
@@ -44,6 +44,7 @@ rt6_print(netdissect_options *ndo, const u_char *bp, const u_char *bp2 _U_)
        u_int i, len, type;
        const u_char *p;
 
+       ndo->ndo_protocol = "rt6";
        dp = (const struct ip6_rthdr *)bp;
 
        ND_TCHECK_1(dp->ip6r_segleft);
index 368f0881a5f7ae8e582e9653dd96c88a0e88aedb..8c04e11acb064758e56b1c24a1a8ab665142952f 100644 (file)
@@ -43,5 +43,6 @@ static const char *rtspcmds[] = {
 void
 rtsp_print(netdissect_options *ndo, const u_char *pptr, u_int len)
 {
+       ndo->ndo_protocol = "rtsp";
        txtproto_print(ndo, pptr, len, "rtsp", rtspcmds, RESP_CODE_SECOND_TOKEN);
 }
index f91e936c56e9b47ddfec5396d3c42deb00f6c139..534278bcba8c8e3ab8734e49f62182cadb05fc90 100644 (file)
@@ -534,6 +534,7 @@ rx_print(netdissect_options *ndo,
        uint8_t type, flags;
        uint32_t opcode;
 
+       ndo->ndo_protocol = "rx";
        if (!ND_TTEST_LEN(bp, sizeof(struct rx_header))) {
                ND_PRINT(" [|rx] (%u)", length);
                return;
index f8d51c96e98aab52c71faa2b2765396f3882038a..5aed68427770e00f438cb7a468b78b859f67a48b 100644 (file)
@@ -464,6 +464,7 @@ sctp_print(netdissect_options *ndo,
   const char *sep;
   int isforces = 0;
 
+  ndo->ndo_protocol = "sctp";
   if (sctpPacketLength < sizeof(struct sctpHeader))
     {
       ND_PRINT("truncated-sctp - %ld bytes missing!",
index a6cc8eea3ce37a88297e850d1040fed6798e940d..1da0e97b191b9c65410370fbf7cfec0bd56c62b3 100644 (file)
@@ -868,6 +868,7 @@ sflow_print(netdissect_options *ndo,
     uint32_t sflow_sample_type, sflow_sample_len;
     uint32_t nsamples;
 
+    ndo->ndo_protocol = "sflow";
     tptr = pptr;
     tlen = len;
     sflow_datagram = (const struct sflow_datagram_t *)pptr;
index 50a846eb0066171fcab1b64937990dc0d39512df..3be6a38379475191de6fb38b19905048c37bfc2e 100644 (file)
@@ -50,5 +50,6 @@ static const char *sipcmds[] = {
 void
 sip_print(netdissect_options *ndo, const u_char *pptr, u_int len)
 {
+       ndo->ndo_protocol = "sip";
        txtproto_print(ndo, pptr, len, "sip", sipcmds, RESP_CODE_SECOND_TOKEN);
 }
index 2aad552f2798a67de7d4450b3115413876632a0a..161c5efa12fe3df090fc295b6af188c68d4ed244 100644 (file)
@@ -63,6 +63,7 @@ sl_if_print(netdissect_options *ndo,
        u_int length = h->len;
        const struct ip *ip;
 
+       ndo->ndo_protocol = "sl_if";
        if (caplen < SLIP_HDRLEN || length < SLIP_HDRLEN) {
                ND_PRINT("%s", tstr);
                return (caplen);
@@ -103,6 +104,7 @@ sl_bsdos_if_print(netdissect_options *ndo,
        u_int length = h->len;
        const struct ip *ip;
 
+       ndo->ndo_protocol = "sl_bsdos_if";
        if (caplen < SLIP_HDRLEN) {
                ND_PRINT("%s", tstr);
                return (caplen);
index 24dc2d46939cdfedcadbc128e46862e4bea4788b..0e570bf6cd08f54f61b16a14bd52880a93d9a295 100644 (file)
@@ -134,6 +134,7 @@ sll_print(netdissect_options *ndo, const struct sll_header *sllp, u_int length)
 {
        u_short ether_type;
 
+       ndo->ndo_protocol = "sll";
         ND_PRINT("%3s ",tok2str(sll_pkttype_values,"?",EXTRACT_BE_U_2(sllp->sll_pkttype)));
 
        /*
@@ -200,6 +201,7 @@ sll_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char
        int llc_hdrlen;
        u_int hdrlen;
 
+       ndo->ndo_protocol = "sll_if";
        if (caplen < SLL_HDR_LEN) {
                /*
                 * XXX - this "can't happen" because "pcap-linux.c" always
index 976c576639b632965320d18dd62eab27eadf75da..087af0ff407124b4ae8ed57584927c065681c368 100644 (file)
@@ -249,6 +249,7 @@ slow_print(netdissect_options *ndo,
     int print_version;
     u_int subtype;
 
+    ndo->ndo_protocol = "slow";
     if (len < 1)
         goto tooshort;
     ND_TCHECK_1(pptr);
index aa4732d6acd42b596b7a95507b49bbb015134d53..49d51091c7c5affa4f9917df8b9945d6bf29acf4 100644 (file)
@@ -939,6 +939,7 @@ nbt_tcp_print(netdissect_options *ndo,
     u_int nbt_len;
     const u_char *maxbuf;
 
+    ndo->ndo_protocol = "nbt_tcp";
     if (length < 4)
        goto trunc;
     if (ndo->ndo_snapend < data)
@@ -1115,6 +1116,7 @@ nbt_udp137_print(netdissect_options *ndo,
     const u_char *p;
     u_int total, i;
 
+    ndo->ndo_protocol = "nbt_udp137";
     ND_TCHECK_2(data + 10);
     name_trn_id = EXTRACT_BE_U_2(data);
     response = (EXTRACT_U_1(data + 2) >> 7);
@@ -1255,6 +1257,7 @@ smb_tcp_print(netdissect_options *ndo,
     u_int smb_len;
     const u_char *maxbuf;
 
+    ndo->ndo_protocol = "smb_tcp";
     if (length < 4)
        goto trunc;
     if (ndo->ndo_snapend < data)
@@ -1296,6 +1299,7 @@ nbt_udp138_print(netdissect_options *ndo,
 {
     const u_char *maxbuf = data + length;
 
+    ndo->ndo_protocol = "nbt_udp138";
     if (maxbuf > ndo->ndo_snapend)
        maxbuf = ndo->ndo_snapend;
     if (maxbuf <= data)
@@ -1392,6 +1396,7 @@ netbeui_print(netdissect_options *ndo,
     const u_char *data2;
     int is_truncated = 0;
 
+    ndo->ndo_protocol = "netbeui";
     if (maxbuf > ndo->ndo_snapend)
        maxbuf = ndo->ndo_snapend;
     ND_TCHECK_1(data + 4);
@@ -1491,6 +1496,7 @@ ipx_netbios_print(netdissect_options *ndo,
     u_int i;
     const u_char *maxbuf;
 
+    ndo->ndo_protocol = "ipx_netbios";
     maxbuf = data + length;
     /* Don't go past the end of the captured data in the packet. */
     if (maxbuf > ndo->ndo_snapend)
index f1a2582b2068014e01db3cbe3b8d732fcbb5a519..a85ea8a9fc4c606ed1a47b8f503cd5f856139212 100644 (file)
@@ -28,5 +28,6 @@
 void
 smtp_print(netdissect_options *ndo, const u_char *pptr, u_int len)
 {
+       ndo->ndo_protocol = "smtp";
        txtproto_print(ndo, pptr, len, "smtp", NULL, 0);
 }
index 3153076d0c234e24c9a1b2a48d5579b01f352057..856309b6bfc9c649b63d0651bb2f0b004d817b42 100644 (file)
@@ -1884,6 +1884,7 @@ snmp_print(netdissect_options *ndo,
        int count = 0;
        int version = 0;
 
+       ndo->ndo_protocol = "snmp";
        ND_PRINT(" ");
 
        /* initial Sequence */
index f0fecaf748e683b69873f8055eb81d28e0ea4f76..eb5c90f172b44dbb1d212c80e08ab6b3e708613e 100644 (file)
@@ -412,6 +412,7 @@ stp_print(netdissect_options *ndo, const u_char *p, u_int length)
     u_int                  mstp_len;
     u_int                  spb_len;
 
+    ndo->ndo_protocol = "stp";
     stp_bpdu = (const struct stp_bpdu_*)p;
 
     /* Minimum STP Frame size. */
index cb9737b9a1e68743acb28c5653ceee1b6eca5d5e..f0857c2a98a3b64f5f4f00fe1a9ebf49260b1019 100644 (file)
@@ -69,6 +69,7 @@ sunatm_if_print(netdissect_options *ndo,
        u_char vpi;
        u_int traftype;
 
+       ndo->ndo_protocol = "sunatm_if";
        if (caplen < PKT_BEGIN_POS) {
                ND_PRINT("[|atm]");
                return (caplen);
index 9c62728fc1b3f950e29211e74ba95ef828b0a5ba..d5ffe8d46d369473c349cd38ac13d08cbd162f45 100644 (file)
@@ -167,6 +167,7 @@ sunrpc_print(netdissect_options *ndo, const u_char *bp,
        uint32_t x;
        char srcid[20], dstid[20];      /*fits 32bit*/
 
+       ndo->ndo_protocol = "sunrpc";
        rp = (const struct sunrpc_msg *)bp;
 
        if (!ndo->ndo_nflag) {
index 4fd834e1bf6c06d2d7ace7b6de70dd885cabebdd..8d938b445ff3183a13d16b446600af4f2a540731 100644 (file)
@@ -77,6 +77,7 @@ symantec_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_
        const struct symantec_header *sp;
        u_short ether_type;
 
+       ndo->ndo_protocol = "symantec_if";
        if (caplen < sizeof (struct symantec_header)) {
                ND_PRINT("[|symantec]");
                return caplen;
index cdb81148063d3369a7d577b59e3eaad56e381512..1a563e007048241021d8b50d8ef7ae2f770d0e60 100644 (file)
@@ -84,6 +84,7 @@ syslog_print(netdissect_options *ndo,
     uint16_t pri = 0;
     uint16_t facility,severity;
 
+    ndo->ndo_protocol = "syslog";
     /* extract decimal figures that are
      * encapsulated within < > tags
      * based on this decimal figure extract the
index ab3dbbf3e6533d2a4ef367d82baac874b8e89f9c..3b81059b9ea0c9e42f50ce73effbfa585436226e 100644 (file)
@@ -173,6 +173,7 @@ tcp_print(netdissect_options *ndo,
         int rev;
         const struct ip6_hdr *ip6;
 
+       ndo->ndo_protocol = "tcp";
         tp = (const struct tcphdr *)bp;
         ip = (const struct ip *)bp2;
         if (IP_V(ip) == 6)
index 6c3e7d532c17470a15fd1dd50b490f1e159f41f8..204654ce23a900f9dc35db10eea71d920d8eb629 100644 (file)
@@ -514,6 +514,7 @@ telnet_print(netdissect_options *ndo, const u_char *sp, u_int length)
        const u_char *osp;
        int l;
 
+       ndo->ndo_protocol = "telnet";
        osp = sp;
 
        ND_TCHECK_1(sp);
index 0f0c40696e9e54bd17cafb551301a884d1e99b49..1cd1c3f8420fdc8c84e96454cf60b0746de3f8e6 100644 (file)
@@ -95,6 +95,7 @@ tftp_print(netdissect_options *ndo,
        u_int opcode;
        u_int ui;
 
+       ndo->ndo_protocol = "tftp";
        /* Print length */
        ND_PRINT(" %u", length);
 
index ecc4c388c1c3d481a9534c01a4fe228731eff6bb..f6bfc8ecf0ed7c33c76060b5522a6f964149d9c6 100644 (file)
@@ -98,6 +98,7 @@ timed_print(netdissect_options *ndo,
        uint8_t tsp_type;
        int sec, usec;
 
+       ndo->ndo_protocol = "timed";
        ND_TCHECK_1(tsp->tsp_type);
        tsp_type = EXTRACT_U_1(tsp->tsp_type);
        if (tsp_type < TSPTYPENUMBER)
index 40bc59c861391901b071026c3358036ee1c5816f..4596dd7ea5b41221a0a9f97540b0b421e949da1b 100644 (file)
@@ -341,6 +341,7 @@ tipc_print(netdissect_options *ndo, const u_char *bp, u_int length _U_,
        uint32_t w0;
        u_int user;
 
+       ndo->ndo_protocol = "tipc";
        ap = (const struct tipc_pkthdr *)bp;
        ND_TCHECK_4(ap->w0);
        w0 = EXTRACT_BE_U_4(ap->w0);
index fa7f07f4b7b705c9c3f169fe3e8490608ae837d5..dcd023c06ac73deb2db42a0384d81fe10717dac1 100644 (file)
@@ -153,6 +153,7 @@ token_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen
        u_int route_len = 0, hdr_len = TOKEN_HDRLEN;
        int seg;
 
+       ndo->ndo_protocol = "token";
        trp = (const struct token_header *)p;
 
        if (caplen < TOKEN_HDRLEN) {
@@ -244,5 +245,6 @@ token_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen
 u_int
 token_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
+       ndo->ndo_protocol = "token_if";
        return (token_print(ndo, p, h->len, h->caplen));
 }
index dda6fd8919de82c7c0e642c48bb2bed9e373628f..4f444caaee1458f064bb0f095f1532f8f263e6d5 100644 (file)
@@ -99,6 +99,7 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length)
     int code, type, len;
     const u_char *tptr;
 
+    ndo->ndo_protocol = "udld";
     if (length < UDLD_HEADER_LEN)
         goto trunc;
 
index 8c558cf5921592b08c0ddae7e84f6adc1f178c20..e56deb656c1d11dcf9f620f3184643c046426499 100644 (file)
@@ -390,6 +390,7 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length,
        uint16_t sport, dport, ulen;
        const struct ip6_hdr *ip6;
 
+       ndo->ndo_protocol = "udp";
        up = (const struct udphdr *)bp;
        ip = (const struct ip *)bp2;
        if (IP_V(ip) == 6)
index e2c1d78da90d23f442ea648bd9deb207f20181ed..7b750a06c85919379c070dd599f3b21346d6521d 100644 (file)
@@ -243,6 +243,7 @@ u_int
 usb_linux_48_byte_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
                            const u_char *p)
 {
+       ndo->ndo_protocol = "usb_linux_48_byte_if";
        if (h->caplen < sizeof(pcap_usb_header)) {
                ND_PRINT("%s", tstr);
                return(sizeof(pcap_usb_header));
@@ -266,6 +267,7 @@ u_int
 usb_linux_64_byte_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
                            const u_char *p)
 {
+       ndo->ndo_protocol = "usb_linux_64_byte_if";
        if (h->caplen < sizeof(pcap_usb_header_mmapped)) {
                ND_PRINT("%s", tstr);
                return(sizeof(pcap_usb_header_mmapped));
index cdfa1c960cb65716a5627eb320e3b661e2980bb2..4fadc8a1dd0f4b4db205fbda8d3f24a8d7254e30 100644 (file)
@@ -88,6 +88,7 @@ vjc_print(netdissect_options *ndo, const u_char *bp, u_short proto _U_)
 {
        int i;
 
+       ndo->ndo_protocol = "vjc";
        switch (EXTRACT_U_1(bp) & 0xf0) {
        case TYPE_IP:
                if (ndo->ndo_eflag)
index a5b13f661528d33856804cc05c78c74ce6ad1a0b..ab00a79961eb7d0044237fcdd7ba9fa3b8634ec2 100644 (file)
@@ -108,6 +108,7 @@ vqp_print(netdissect_options *ndo, const u_char *pptr, u_int len)
     u_int tlen;
     uint8_t nitems;
 
+    ndo->ndo_protocol = "vqp";
     tptr=pptr;
     tlen = len;
     vqp_common_header = (const struct vqp_common_header_t *)pptr;
index b0db29ce7212751bf9ed5b624ab8fe864961c801..ae879647596da58bb287cb1eafae1e4c4485cca6 100644 (file)
@@ -110,6 +110,7 @@ vrrp_print(netdissect_options *ndo,
        int version, type, auth_type = VRRP_AUTH_NONE; /* keep compiler happy */
        const char *type_s;
 
+       ndo->ndo_protocol = "vrrp";
        ND_TCHECK_1(bp);
        version = (EXTRACT_U_1(bp) & 0xf0) >> 4;
        type = EXTRACT_U_1(bp) & 0x0f;
index 133de552bd92e67c831ac96c38aa53aedd7b7f4d..7abf368972615650fda11e928298dfaa2a33d4cd 100644 (file)
@@ -123,6 +123,7 @@ vtp_print (netdissect_options *ndo,
     const u_char *tptr;
     const struct vtp_vlan_ *vtp_vlan;
 
+    ndo->ndo_protocol = "vtp";
     if (length < VTP_HEADER_LEN)
         goto trunc;
 
index 038b772e65f5de90136e8d369f16b3784126b68b..fb903c2105e88d1d28b00a5c9943d136ccb0f4ab 100644 (file)
@@ -64,6 +64,7 @@ vxlan_gpe_print(netdissect_options *ndo, const u_char *bp, u_int len)
     uint8_t next_protocol;
     uint32_t vni;
 
+    ndo->ndo_protocol = "vxlan_gpe";
     if (len < VXLAN_GPE_HDR_LEN)
         goto trunc;
 
index 80c8ddce023e91c22ce8253d59945d61a89066c8..826d2aaf2f3054a53a005003fec12425a5aa8699 100644 (file)
@@ -50,6 +50,7 @@ vxlan_print(netdissect_options *ndo, const u_char *bp, u_int len)
     uint8_t flags;
     uint32_t vni;
 
+    ndo->ndo_protocol = "vxlan";
     if (len < VXLAN_HDR_LEN)
         goto trunc;
 
index 4d8f54034aca14a4444161255a16d80c2bbbfacd..42686906c252a4a3edd9b5cb99f310dbf8bb76af 100644 (file)
@@ -402,6 +402,7 @@ wb_print(netdissect_options *ndo,
        const struct pkt_hdr *ph;
        uint8_t type;
 
+       ndo->ndo_protocol = "wb";
        ph = (const struct pkt_hdr *)hdr;
        if (len < sizeof(*ph) || !ND_TTEST_SIZE(ph)) {
                ND_PRINT("%s", tstr);
index eddbe8598fb43895254712e33788b88fc9fc6893..3edbeea42a0b3379c1f4fbe7d3ec6afccc04e9cf 100644 (file)
@@ -169,6 +169,7 @@ zephyr_print(netdissect_options *ndo, const u_char *cp, int length)
     int lose = 0;
     int truncated = 0;
 
+    ndo->ndo_protocol = "zephyr";
     /* squelch compiler warnings */
 
 #define PARSE_STRING                                           \
index 05dc0c472f9f13e047dbc8f1ea6b87202c07bae4..eb41414a0be947cab265b03ac8b82ff34739e8cd 100644 (file)
@@ -145,6 +145,7 @@ zmtp1_print(netdissect_options *ndo, const u_char *cp, u_int len)
 {
        const u_char *ep = min(ndo->ndo_snapend, cp + len);
 
+       ndo->ndo_protocol = "zmtp1";
        ND_PRINT(": ZMTP/1.0");
        while (cp < ep)
                cp = zmtp1_print_frame(ndo, cp, ep);
@@ -214,6 +215,7 @@ zmtp1_datagram_print(netdissect_options *ndo, const u_char *cp, const u_int len)
 {
        const u_char *ep = min(ndo->ndo_snapend, cp + len);
 
+       ndo->ndo_protocol = "zmtp1_datagram";
        cp = zmtp1_print_intermediate_part(ndo, cp, len);
        while (cp < ep)
                cp = zmtp1_print_frame(ndo, cp, ep);