etherproto_string(htons(extracted_ethertype))));
}
if (!ndo->ndo_suppress_default_print)
- ndo->ndo_default_print(ndo, p, caplen);
+ ND_DEFAULTPRINT(p, caplen);
}
}
{
u_int caplen = h->caplen;
u_int length = h->len;
- u_int32_t llchdr;
+ uint32_t llchdr;
u_int hdrlen = 0;
- if (caplen < 8) {
+ if (caplen < 1 || length < 1) {
ND_PRINT((ndo, "%s", tstr));
return (caplen);
}
if (*p == LLC_UI) {
if (ndo->ndo_eflag)
ND_PRINT((ndo, "CNLPID "));
- isoclns_print(p+1, length-1, caplen-1);
+ isoclns_print(ndo, p + 1, length - 1, caplen - 1);
return hdrlen;
}
+ /*
+ * Must have at least a DSAP, an SSAP, and the first byte of the
+ * control field.
+ */
+ if (caplen < 3 || length < 3) {
+ ND_PRINT((ndo, "%s", tstr));
+ return (caplen);
+ }
+
/*
* Extract the presumed LLC header into a variable, for quick
* testing.
* packets? If so, could it be changed to use a
* new DLT_IEEE802_6 value if we added it?
*/
+ if (caplen < 20 || length < 20) {
+ ND_PRINT((ndo, "%s", tstr));
+ return (caplen);
+ }
if (ndo->ndo_eflag)
ND_PRINT((ndo, "%08x%08x %08x%08x ",
EXTRACT_32BITS(p),
sig_print(netdissect_options *ndo,
const u_char *p, int caplen)
{
- bpf_u_int32 call_ref;
+ uint32_t call_ref;
if (caplen < PROTO_POS) {
ND_PRINT((ndo, "%s", tstr));
case VCI_ILMIC:
ND_PRINT((ndo, "ilmi: "));
- snmp_print(p, length);
+ snmp_print(ndo, p, length);
return;
}
}
}
struct oam_fm_loopback_t {
- u_int8_t loopback_indicator;
- u_int8_t correlation_tag[4];
- u_int8_t loopback_id[12];
- u_int8_t source_id[12];
- u_int8_t unused[16];
+ uint8_t loopback_indicator;
+ uint8_t correlation_tag[4];
+ uint8_t loopback_id[12];
+ uint8_t source_id[12];
+ uint8_t unused[16];
};
struct oam_fm_ais_rdi_t {
- u_int8_t failure_type;
- u_int8_t failure_location[16];
- u_int8_t unused[28];
+ uint8_t failure_type;
+ uint8_t failure_location[16];
+ uint8_t unused[28];
};
int
oam_print (netdissect_options *ndo,
const u_char *p, u_int length, u_int hec) {
- u_int32_t cell_header;
- u_int16_t vpi, vci, cksum, cksum_shouldbe, idx;
- u_int8_t cell_type, func_type, payload, clp;
+ uint32_t cell_header;
+ uint16_t vpi, vci, cksum, cksum_shouldbe, idx;
+ uint8_t cell_type, func_type, payload, clp;
union {
const struct oam_fm_loopback_t *oam_fm_loopback;