Update this field in printer entry functions.
It will be used for some printings.
* 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 */
struct lladdr_info src, dst;
int llc_hdrlen;
+ ndo->ndo_protocol = "802.11";
caplen = orig_caplen;
/* Remove FCS, if present */
if (length < fcslen) {
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);
}
int pad;
u_int fcslen;
+ ndo->ndo_protocol = "802.11_radio";
if (caplen < sizeof(*hdr)) {
ND_PRINT("%s", tstr);
return caplen;
{
uint32_t caphdr_len;
+ ndo->ndo_protocol = "802.11_radio_avs";
if (caplen < 8) {
ND_PRINT("%s", tstr);
return caplen;
u_int length = h->len;
uint32_t msgcode;
+ ndo->ndo_protocol = "prism_if";
if (caplen < 4) {
ND_PRINT("%s", tstr);
return caplen;
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);
}
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);
}
uint8_t seq;
uint16_t panid = 0;
+ ndo->ndo_protocol = "802.15.4";
if (caplen < 3) {
ND_PRINT("[|802.15.4]");
return caplen;
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);
}
const struct ah *ah;
u_int sumlen;
+ ndo->ndo_protocol = "ah";
ah = (const struct ah *)bp;
ND_TCHECK_SIZE(ah);
const u_char *ep = ndo->ndo_snapend;
uint8_t version;
+ ndo->ndo_protocol = "ahcp";
ND_PRINT("AHCP");
if (len < 2)
goto invalid;
{
uint8_t msg_type;
+ ndo->ndo_protocol = "aodv";
/*
* The message type is the first byte; make sure we have it
* and then fetch it.
const u_char *ep = ndo->ndo_snapend;
uint8_t ver;
+ ndo->ndo_protocol = "aoe";
ND_PRINT("AoE length %u", len);
if (len < 1)
u_short ether_type;
struct lladdr_info src, dst;
+ ndo->ndo_protocol = "ap1394_if";
if (caplen < FIREWIRE_HDRLEN) {
ND_PRINT("[|ap1394]");
return FIREWIRE_HDRLEN;
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),
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);
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);
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);
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;
{
u_int hdrlen;
+ ndo->ndo_protocol = "ltalk_if";
hdrlen = llap_print(ndo, p, h->len);
if (hdrlen == 0) {
/* Cut short by the snapshot length. */
u_short snet;
u_int hdrlen;
+ ndo->ndo_protocol = "llap";
if (length < sizeof(*lp)) {
ND_PRINT(" [|llap %u]", length);
return (length);
const struct atDDP *dp;
u_short snet;
+ ndo->ndo_protocol = "atalk";
if(!ndo->ndo_eflag)
ND_PRINT("AT ");
#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)) {
uint32_t llchdr;
u_int hdrlen = 0;
+ ndo->ndo_protocol = "atm_if";
if (caplen < 1 || length < 1) {
ND_PRINT("%s", tstr);
return (caplen);
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);
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;
babel_print(netdissect_options *ndo,
const u_char *cp, u_int length)
{
+ ndo->ndo_protocol = "babel";
ND_PRINT("babel");
ND_TCHECK_4(cp);
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))
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) {
const struct bgp *bgp_header;
uint16_t hlen;
+ ndo->ndo_protocol = "bgp";
ND_PRINT(": BGP");
if (ndo->ndo_vflag < 1) /* lets be less chatty */
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);
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;
u_int srcNwref;
u_int dstNwref;
+ ndo->ndo_protocol = "calm_fast";
ND_TCHECK_2(bp);
if (length < 2)
goto trunc;
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;
u_int type, len, i, j;
const u_char *tptr;
+ ndo->ndo_protocol = "cdp";
if (caplen < CDP_HEADER_LEN) {
ND_PRINT("%s", tstr);
return;
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))
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);
}
u_int proto;
const u_char *bp = p;
+ ndo->ndo_protocol = "chdlc";
if (length < CHDLC_HDRLEN)
goto trunc;
ND_TCHECK_LEN(p, CHDLC_HDRLEN);
size_t cmplen;
int llc_hdrlen;
+ ndo->ndo_protocol = "cip_if";
cmplen = sizeof(rfcllc);
if (cmplen > caplen)
cmplen = caplen;
/*
* First 2 bytes are the version number.
*/
+ ndo->ndo_protocol = "cnfp";
ND_TCHECK_2(cp);
ver = EXTRACT_BE_U_2(cp);
switch (ver) {
u_int fixed_hdrlen;
uint8_t dccph_type;
+ ndo->ndo_protocol = "dccp";
dh = (const struct dccp_hdr *)bp;
ip = (const struct ip *)data2;
u_int nsplen, pktlen;
const u_char *nspp;
+ ndo->ndo_protocol = "decnet";
if (length < sizeof(struct shorthdr)) {
ND_PRINT("%s", tstr);
return;
const u_char *extp;
const char *name;
+ ndo->ndo_protocol = "dhcp6";
ND_PRINT("dhcp6");
ep = ndo->ndo_snapend;
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);
int type, len;
const u_char *tptr;
+ ndo->ndo_protocol = "dtp";
if (length < DTP_HEADER_LEN)
goto trunc;
u_char type;
uint8_t major_version, minor_version;
+ ndo->ndo_protocol = "dvmrp";
ep = ndo->ndo_snapend;
if (bp >= ep)
return;
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;
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]");
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);
u_int af, flags;
const struct enchdr *hdr;
+ ndo->ndo_protocol = "enc_if";
if (caplen < ENC_HDRLEN) {
ND_PRINT("[|enc]");
goto out;
u_char *output_buffer;
#endif
+ ndo->ndo_protocol = "esp";
esp = (const struct newesp *)bp;
#ifdef HAVE_LIBCRYPTO
int llc_hdrlen;
struct lladdr_info src, dst;
+ ndo->ndo_protocol = "ether";
if (caplen < ETHER_HDRLEN) {
ND_PRINT("[|ether]");
return (caplen);
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));
}
/*
* 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);
* 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);
struct lladdr_info src, dst;
int llc_hdrlen;
+ ndo->ndo_protocol = "fddi";
if (caplen < FDDI_HDRLEN) {
ND_PRINT("[|fddi]");
return (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));
}
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);
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)
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;
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)
* +----+----+----+----+----+----+----+----+
*/
+ 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) {
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)) {
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;
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);
}
uint8_t reserved;
u_int opts_len;
+ ndo->ndo_protocol = "geneve";
ND_PRINT("Geneve");
ND_TCHECK_8(bp);
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));
{
u_int len = length, vers;
+ ndo->ndo_protocol = "gre";
ND_TCHECK_2(bp);
if (len < 2)
goto trunc;
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);
}
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);
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);
}
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;
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);
{
struct cksum_vec vec[1];
+ ndo->ndo_protocol = "igmp";
if (ndo->ndo_qflag) {
ND_PRINT("igmp");
return;
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:");
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 */
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;
int fragmented = 0;
u_int flow;
+ ndo->ndo_protocol = "ip6";
ip6 = (const struct ip6_hdr *)bp;
ND_TCHECK_SIZE(ip6);
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);
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);
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);
struct lladdr_info src, dst;
int llc_hdrlen;
+ ndo->ndo_protocol = "ipfc";
if (caplen < IPFC_HDRLEN)
goto 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));
}
{
const ipnet_hdr_t *hdr;
+ ndo->ndo_protocol = "ipnet";
if (caplen < sizeof(ipnet_hdr_t))
goto trunc;
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));
{
const struct ipxHdr *ipx = (const struct ipxHdr *)p;
+ ndo->ndo_protocol = "ipx";
if (!ndo->ndo_eflag)
ND_PRINT("IPX ");
const u_char *ep;
u_int major, minor;
+ ndo->ndo_protocol = "isakmp";
#ifdef HAVE_LIBCRYPTO
/* initialize SAs */
if (ndo->ndo_sa_list_head == NULL) {
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");
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;
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;
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;
};
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;
};
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;
{
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;
{
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;
{
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;
{
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;
{
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;
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;
{
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;
{
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)
{
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;
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;
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;
{
const struct krb *kp;
+ ndo->ndo_protocol = "krb";
kp = (const struct krb *)dat;
if (dat >= ndo->ndo_snapend) {
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 */
{
const struct lane_controlhdr *lec;
+ ndo->ndo_protocol = "lane";
if (caplen < sizeof(struct lane_controlhdr)) {
ND_PRINT("[|lane]");
return;
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));
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)
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;
int hdrlen;
int is_u;
+ ndo->ndo_protocol = "llc";
if (caplen < 3) {
ND_PRINT("[|llc]");
ND_DEFAULTPRINT((const u_char *)p, caplen);
u_short et;
int ret;
+ ndo->ndo_protocol = "snap";
ND_TCHECK_5(p);
if (caplen < 5 || length < 5)
goto trunc;
const u_char *tptr;
char *network_addr;
+ ndo->ndo_protocol = "lldp";
tptr = pptr;
tlen = len;
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);
const u_char *ep = ndo->ndo_snapend;
uint16_t skipCount;
+ ndo->ndo_protocol = "loopback";
ND_PRINT("Loopback");
if (len < 2)
goto invalid;
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))
u_int tlen;
u_int msg_type, msg_tlen;
+ ndo->ndo_protocol = "lwapp_control";
tptr=pptr;
if (has_ap_ident) {
u_int tlen;
u_int version;
+ ndo->ndo_protocol = "lwapp_data";
tptr=pptr;
/* check if enough bytes for AP identity */
int advance;
int unsupported = 0;
+ ndo->ndo_protocol = "lwres";
np = (const struct lwres_lwpacket *)bp;
ND_TCHECK_2(np->authlength);
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;
const struct medsa_pkthdr *medsa;
u_short ether_type;
+ ndo->ndo_protocol = "medsa";
medsa = (const struct medsa_pkthdr *)bp;
ND_TCHECK_SIZE(medsa);
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)) {
unsigned mhlen, hlen;
uint8_t type;
+ ndo->ndo_protocol = "mobility";
mh = (const struct ip6_mobility *)bp;
/* 'ep' points to the end of available data. */
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;
uint16_t label_stack_depth = 0;
enum mpls_packet_type pt = PT_UNKNOWN;
+ ndo->ndo_protocol = "mpls";
p = bp;
ND_PRINT("MPLS");
do {
const struct mptcp_option *opt;
u_int subtype;
+ ndo->ndo_protocol = "mptcp";
if (len < 3)
return 0;
{
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);
{
const struct msnlb_heartbeat_pkt *hb;
+ ndo->ndo_protocol = "msnlb";
hb = (const struct msnlb_heartbeat_pkt *)bp;
ND_TCHECK_SIZE(hb);
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;
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;
uint32_t rhigh;
enum sunrpc_auth_stat rwhy;
+ ndo->ndo_protocol = "nfsreply_noaddr";
nfserr = 0; /* assume no error */
rp = (const struct sunrpc_msg *)bp;
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;
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;
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);
u_int caplen = h->caplen;
uint32_t family;
+ ndo->ndo_protocol = "null_if";
if (caplen < NULL_HDRLEN)
goto trunc;
uint8_t link_type, neighbor_type;
const u_char *tptr, *msg_data;
+ ndo->ndo_protocol = "olsr";
tptr = pptr;
if (length < sizeof(struct olsr_common)) {
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);
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 */
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 */
{
uint8_t flags;
+ ndo->ndo_protocol = "otv";
ND_PRINT("OTV, ");
if (len < OTV_HDR_LEN)
goto trunc;
{
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)
const struct pfloghdr *hdr;
uint8_t af;
+ ndo->ndo_protocol = "pflog_if";
/* check length */
if (caplen < sizeof(uint8_t)) {
ND_PRINT("%s", tstr);
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)
{
u_char type;
+ ndo->ndo_protocol = "pimv1";
ND_TCHECK_1(bp + 1);
type = EXTRACT_U_1(bp + 1);
u_int numrps;
u_int hold;
+ ndo->ndo_protocol = "cisco_autorp";
if (len < 8)
goto trunc;
ND_TCHECK_1(bp);
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
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);
uint32_t hdrlen;
struct pcap_pkthdr nhdr;
+ ndo->ndo_protocol = "ppi";
if (caplen < sizeof(ppi_header_t)) {
ND_PRINT(" %s", tstr);
return (caplen);
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));
}
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).
u_int length = h->len;
u_int caplen = h->caplen;
+ ndo->ndo_protocol = "ppp_if";
if (caplen < PPP_HDRLEN) {
ND_PRINT("[|ppp]");
return (caplen);
u_int proto;
u_int hdrlen = 0;
+ ndo->ndo_protocol = "ppp_hdlc_if";
if (caplen < 2) {
ND_PRINT("[|ppp]");
return (caplen);
const u_char *q;
u_int i;
+ ndo->ndo_protocol = "ppp_bsdos_if";
if (caplen < PPP_BSDI_HDRLEN) {
ND_PRINT("[|ppp]");
return (caplen);
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));
}
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);
uint32_t mc;
uint16_t ctrl_msg_type;
+ ndo->ndo_protocol = "pptp";
ND_PRINT(": pptp");
hdr = (const struct pptp_hdr *)dat;
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);
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: ");
{
int ret_len = 0, length_cur = length;
+ ndo->ndo_protocol = "resp";
if(!bp || length <= 0)
return;
u_int i, j;
unsigned entry_size;
+ ndo->ndo_protocol = "rip";
if (ndo->ndo_snapend < dat) {
ND_PRINT(" %s", tstr);
return;
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) {
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;
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);
const u_char *tptr;
u_short plen, tlen;
+ ndo->ndo_protocol = "rsvp";
tptr=pptr;
rsvp_com_header = (const struct rsvp_common_header *)pptr;
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);
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);
}
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;
const char *sep;
int isforces = 0;
+ ndo->ndo_protocol = "sctp";
if (sctpPacketLength < sizeof(struct sctpHeader))
{
ND_PRINT("truncated-sctp - %ld bytes missing!",
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;
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);
}
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);
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);
{
u_short ether_type;
+ ndo->ndo_protocol = "sll";
ND_PRINT("%3s ",tok2str(sll_pkttype_values,"?",EXTRACT_BE_U_2(sllp->sll_pkttype)));
/*
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
int print_version;
u_int subtype;
+ ndo->ndo_protocol = "slow";
if (len < 1)
goto tooshort;
ND_TCHECK_1(pptr);
u_int nbt_len;
const u_char *maxbuf;
+ ndo->ndo_protocol = "nbt_tcp";
if (length < 4)
goto trunc;
if (ndo->ndo_snapend < data)
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);
u_int smb_len;
const u_char *maxbuf;
+ ndo->ndo_protocol = "smb_tcp";
if (length < 4)
goto trunc;
if (ndo->ndo_snapend < data)
{
const u_char *maxbuf = data + length;
+ ndo->ndo_protocol = "nbt_udp138";
if (maxbuf > ndo->ndo_snapend)
maxbuf = ndo->ndo_snapend;
if (maxbuf <= data)
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);
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)
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);
}
int count = 0;
int version = 0;
+ ndo->ndo_protocol = "snmp";
ND_PRINT(" ");
/* initial Sequence */
u_int mstp_len;
u_int spb_len;
+ ndo->ndo_protocol = "stp";
stp_bpdu = (const struct stp_bpdu_*)p;
/* Minimum STP Frame size. */
u_char vpi;
u_int traftype;
+ ndo->ndo_protocol = "sunatm_if";
if (caplen < PKT_BEGIN_POS) {
ND_PRINT("[|atm]");
return (caplen);
uint32_t x;
char srcid[20], dstid[20]; /*fits 32bit*/
+ ndo->ndo_protocol = "sunrpc";
rp = (const struct sunrpc_msg *)bp;
if (!ndo->ndo_nflag) {
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;
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
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)
const u_char *osp;
int l;
+ ndo->ndo_protocol = "telnet";
osp = sp;
ND_TCHECK_1(sp);
u_int opcode;
u_int ui;
+ ndo->ndo_protocol = "tftp";
/* Print length */
ND_PRINT(" %u", length);
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)
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);
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) {
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));
}
int code, type, len;
const u_char *tptr;
+ ndo->ndo_protocol = "udld";
if (length < UDLD_HEADER_LEN)
goto trunc;
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)
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));
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));
{
int i;
+ ndo->ndo_protocol = "vjc";
switch (EXTRACT_U_1(bp) & 0xf0) {
case TYPE_IP:
if (ndo->ndo_eflag)
u_int tlen;
uint8_t nitems;
+ ndo->ndo_protocol = "vqp";
tptr=pptr;
tlen = len;
vqp_common_header = (const struct vqp_common_header_t *)pptr;
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;
const u_char *tptr;
const struct vtp_vlan_ *vtp_vlan;
+ ndo->ndo_protocol = "vtp";
if (length < VTP_HEADER_LEN)
goto trunc;
uint8_t next_protocol;
uint32_t vni;
+ ndo->ndo_protocol = "vxlan_gpe";
if (len < VXLAN_GPE_HDR_LEN)
goto trunc;
uint8_t flags;
uint32_t vni;
+ ndo->ndo_protocol = "vxlan";
if (len < VXLAN_HDR_LEN)
goto trunc;
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);
int lose = 0;
int truncated = 0;
+ ndo->ndo_protocol = "zephyr";
/* squelch compiler warnings */
#define PARSE_STRING \
{
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);
{
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);