* 'h->len' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
-u_int
+void
atm_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
uint32_t llchdr;
u_int hdrlen = 0;
- ndo->ndo_protocol = "atm_if";
+ ndo->ndo_protocol = "atm";
if (caplen < 1) {
nd_print_trunc(ndo);
- return (caplen);
+ ndo->ndo_ll_hdr_len += caplen;
+ return;
}
/* Cisco Style NLPID ? */
if (ndo->ndo_eflag)
ND_PRINT("CNLPID ");
isoclns_print(ndo, p + 1, length - 1);
- return hdrlen;
+ ndo->ndo_ll_hdr_len += hdrlen;
+ return;
}
/*
*/
if (caplen < 3) {
nd_print_trunc(ndo);
- return (caplen);
+ ndo->ndo_ll_hdr_len += caplen;
+ return;
}
/*
*/
if (caplen < 20) {
nd_print_trunc(ndo);
- return (caplen);
+ ndo->ndo_ll_hdr_len += caplen;
+ return;
}
if (ndo->ndo_eflag)
ND_PRINT("%08x%08x %08x%08x ",
hdrlen += 20;
}
hdrlen += atm_llc_print(ndo, p, length, caplen);
- return (hdrlen);
+ ndo->ndo_ll_hdr_len += hdrlen;
}
/*
{
uint32_t call_ref;
- ND_TCHECK_1(p + PROTO_POS);
if (GET_U_1(p + PROTO_POS) == Q2931) {
/*
* protocol:Q.2931 for User to Network Interface
* (UNI 3.1) signalling
*/
ND_PRINT("Q.2931");
- ND_TCHECK_1(p + MSG_TYPE_POS);
ND_PRINT(":%s ",
tok2str(msgtype2str, "msgtype#%u", GET_U_1(p + MSG_TYPE_POS)));
/* SSCOP with some unknown protocol atop it */
ND_PRINT("SSCOP, proto %u ", GET_U_1(p + PROTO_POS));
}
- return;
-
-trunc:
- nd_print_trunc(ndo);
}
/*
} oam_ptr;
ndo->ndo_protocol = "oam";
- ND_TCHECK_1(p + ATM_HDR_LEN_NOHEC + hec);
cell_header = GET_BE_U_4(p + hec);
cell_type = (GET_U_1((p + ATM_HDR_LEN_NOHEC + hec)) >> 4) & 0x0f;
func_type = GET_U_1((p + ATM_HDR_LEN_NOHEC + hec)) & 0x0f;
}
/* crc10 checksum verification */
- ND_TCHECK_2(p + OAM_CELLTYPE_FUNCTYPE_LEN + OAM_FUNCTION_SPECIFIC_LEN);
cksum = GET_BE_U_2(p + OAM_CELLTYPE_FUNCTYPE_LEN + OAM_FUNCTION_SPECIFIC_LEN)
& OAM_CRC10_MASK;
cksum_shouldbe = verify_crc10_cksum(0, p, OAM_PAYLOAD_LEN);