if (len < AOEV1_MAC_ARG_LEN)
goto invalid;
/* Reserved */
- ND_TCHECK_1(cp);
cp += 1;
/* MCmd */
ND_PRINT("\n\tMCmd: %s",
/* directives */
for (i = 0; i < dircount; i++) {
/* Reserved */
- ND_TCHECK_1(cp);
cp += 1;
/* DCmd */
ND_PRINT("\n\t DCmd: %s",
tok2str(aoev1_dcmd_str, "Unknown (0x%02x)", GET_U_1(cp)));
cp += 1;
/* Ethernet Address */
- ND_TCHECK_LEN(cp, MAC_ADDR_LEN);
ND_PRINT(", Ethernet Address: %s", GET_ETHERADDR_STRING(cp));
cp += MAC_ADDR_LEN;
}
goto invalid;
/* addresses */
for (i = 0; i < nmacs; i++) {
- ND_TCHECK_LEN(cp, MAC_ADDR_LEN);
ND_PRINT("\n\tEthernet Address %u: %s", i, GET_ETHERADDR_STRING(cp));
cp += MAC_ADDR_LEN;
}
} 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;
u_int addr_length, sg_length;
u_int offset;
- ND_TCHECK_2(pptr);
route_type = GET_U_1(pptr);
pptr++;
route_length = GET_U_1(pptr);
}
return plen + 2;
}
- ND_TCHECK_3(pptr);
tlv_type = GET_U_1(pptr);
pptr++;
tlv_len = GET_BE_U_2(pptr); /* length, in *bits* */
* each.
*/
while (tptr < pptr + len) {
- ND_TCHECK_1(tptr);
-
/*
* If we do not find a valid segment type, our guess might be wrong.
*/
ND_PRINT("invalid len");
break;
}
- ND_TCHECK_8(tptr);
ND_PRINT(" AS #%s, origin %s",
as_printf(ndo, astostr, sizeof(astostr), GET_BE_U_4(tptr)),
GET_IPADDR_STRING(tptr + 4));
switch (tunnel_type) {
case BGP_PMSI_TUNNEL_PIM_SM: /* fall through */
case BGP_PMSI_TUNNEL_PIM_BIDIR:
- ND_TCHECK_8(tptr);
ND_PRINT("\n\t Sender %s, P-Group %s",
GET_IPADDR_STRING(tptr),
GET_IPADDR_STRING(tptr+4));
break;
case BGP_PMSI_TUNNEL_PIM_SSM:
- ND_TCHECK_8(tptr);
ND_PRINT("\n\t Root-Node %s, P-Group %s",
GET_IPADDR_STRING(tptr),
GET_IPADDR_STRING(tptr+4));
break;
case BGP_PMSI_TUNNEL_LDP_P2MP: /* fall through */
case BGP_PMSI_TUNNEL_LDP_MP2MP:
- ND_TCHECK_8(tptr);
ND_PRINT("\n\t Root-Node %s, LSP-ID 0x%08x",
GET_IPADDR_STRING(tptr),
GET_BE_U_4(tptr + 4));
break;
case BGP_PMSI_TUNNEL_RSVP_P2MP:
- ND_TCHECK_8(tptr);
ND_PRINT("\n\t Extended-Tunnel-ID %s, P2MP-ID 0x%08x",
GET_IPADDR_STRING(tptr),
GET_BE_U_4(tptr + 4));
uint16_t length;
while (tlen >= 3) {
-
- ND_TCHECK_3(tptr);
-
type = GET_U_1(tptr);
length = GET_BE_U_2(tptr + 1);
tptr += 3;
}
ND_PRINT("\n\t ");
while (len != 0) {
- ND_TCHECK_LEN(tptr, 12);
ND_PRINT("%u:%u:%u%s",
GET_BE_U_4(tptr),
GET_BE_U_4(tptr + 4),
*/
if(bgpn_minor == BGP_NOTIFY_MINOR_CEASE_MAXPRFX && length >= BGP_NOTIFICATION_SIZE + 7) {
tptr = dat + BGP_NOTIFICATION_SIZE;
- ND_TCHECK_7(tptr);
ND_PRINT(", AFI %s (%u), SAFI %s (%u), Max Prefixes: %u",
tok2str(af_values, "Unknown", GET_BE_U_2(tptr)),
GET_BE_U_2(tptr),
bp_htype = GET_U_1(bp->bp_htype);
bp_hlen = GET_U_1(bp->bp_hlen);
if (bp_htype == 1 && bp_hlen == 6 && bp_op == BOOTPREQUEST) {
- ND_TCHECK_6(bp->bp_chaddr);
ND_PRINT(" from %s", GET_ETHERADDR_STRING(bp->bp_chaddr));
}
/* Client's Ethernet address */
if (bp_htype == 1 && bp_hlen == 6) {
- ND_TCHECK_6(bp->bp_chaddr);
ND_PRINT("\n\t Client-Ethernet-Address %s", GET_ETHERADDR_STRING(bp->bp_chaddr));
}
ndo->ndo_protocol = "chdlc";
if (length < CHDLC_HDRLEN)
goto trunc;
- ND_TCHECK_LEN(p, CHDLC_HDRLEN);
proto = GET_BE_U_2(p + 2);
if (ndo->ndo_eflag) {
ND_PRINT("%s, ethertype %s (0x%04x), length %u: ",
/* is the fudge byte set ? lets verify by spotting ISO headers */
if (length < 2)
goto trunc;
- ND_TCHECK_2(p);
if (GET_U_1(p + 1) == NLPID_CLNP ||
GET_U_1(p + 1) == NLPID_ESIS ||
GET_U_1(p + 1) == NLPID_ISIS)
uint64_t ackno;
if (DCCPH_X(dh) != 0) {
- ND_TCHECK_8(ackp);
ackno = GET_BE_U_6(ackp + 2);
} else {
- ND_TCHECK_4(ackp);
ackno = GET_BE_U_3(ackp + 1);
}
ND_PRINT("(ack=%" PRIu64 ") ", ackno);
-trunc:
- return;
}
static u_int dccp_print_option(netdissect_options *, const u_char *, u_int);
* extract version from IGMP group address field
*/
bp -= 4;
- ND_TCHECK_4(bp);
major_version = GET_U_1(bp + 3);
minor_version = GET_U_1(bp + 2);
bp += 4;
ND_PRINT(" [|]");
return (0);
}
- ND_TCHECK_3(bp);
mask = (uint32_t)0xff << 24 | GET_U_1(bp) << 16 |
GET_U_1(bp + 1) << 8 | GET_U_1(bp + 2);
width = 1;
} while (!done);
}
return (0);
-trunc:
- return (-1);
}
static int
print_prune(netdissect_options *ndo,
const u_char *bp)
{
- ND_TCHECK_LEN(bp, 12);
ND_PRINT(" src %s grp %s", GET_IPADDR_STRING(bp), GET_IPADDR_STRING(bp + 4));
bp += 8;
ND_PRINT(" timer ");
unsigned_relts_print(ndo, GET_BE_U_4(bp));
return (0);
-trunc:
- return (-1);
}
static int
print_graft(netdissect_options *ndo,
const u_char *bp)
{
- ND_TCHECK_8(bp);
ND_PRINT(" src %s grp %s", GET_IPADDR_STRING(bp), GET_IPADDR_STRING(bp + 4));
return (0);
-trunc:
- return (-1);
}
static int
print_graft_ack(netdissect_options *ndo,
const u_char *bp)
{
- ND_TCHECK_8(bp);
ND_PRINT(" src %s grp %s", GET_IPADDR_STRING(bp), GET_IPADDR_STRING(bp + 4));
return (0);
-trunc:
- return (-1);
}
break;
case EAP_TYPE_FAST:
- ND_TCHECK_1(cp + 5);
ND_PRINT(" FASTv%u",
EAP_TTLS_VERSION(GET_U_1((cp + 5))));
ND_PRINT(" flags [%s] 0x%02x,",
while (distances != 0) {
if (length < 2)
goto trunc;
- ND_TCHECK_2(cp);
ND_PRINT("%sd%u:", comma, GET_U_1(cp));
cp++;
comma = ", ";
} else if (!IN_CLASSA(addr)) {
if (length < 2)
goto trunc;
- ND_TCHECK_2(cp);
addr |= ((uint32_t) GET_U_1(cp)) << 16;
cp++;
addr |= ((uint32_t) GET_U_1(cp)) << 8;
if (length < 2)
goto trunc;
- ND_TCHECK_2(p);
flags = GET_U_1(p)&MFR_BEC_MASK;
sequence_num = (GET_U_1(p)&0x1e)<<7 | GET_U_1(p + 1);
{
uint32_t lat, lon;
- ND_TCHECK_LEN(bp, GEONET_ADDR_LEN);
ND_PRINT("GN_ADDR:%s ", GET_LINKADDR_STRING(bp, LINKADDR_OTHER, GEONET_ADDR_LEN));
- ND_TCHECK_8(bp + 12);
lat = GET_BE_U_4(bp + 12);
ND_PRINT("lat:%u ", lat);
lon = GET_BE_U_4(bp + 16);
ND_PRINT("lon:%u", lon);
return (0);
-trunc:
- return -1;
}
ND_PRINT("HSRPv%u", version);
if (version != 0)
return;
- ND_TCHECK_1(hp->hsrp_op_code);
ND_PRINT("-");
ND_PRINT("%s ",
tok2strary(op_code_str, "unknown (%u)", GET_U_1(hp->hsrp_op_code)));
ND_PRINT(" [gaddr %s", GET_IP6ADDR_STRING(bp + 8));
if (ndo->ndo_vflag) {
- ND_TCHECK_1(bp + 25);
if (GET_U_1(bp + 24) & 0x08) {
ND_PRINT(" sflag");
}
ND_PRINT(", %u source(s)", nsrcs);
}
ND_PRINT("]");
- return;
-trunc:
- nd_print_trunc(ndo);
- return;
}
static void
* the header, in units of 8 octets, excluding
* the first 8 octets.
*/
- ND_TCHECK_2(cp);
advance = (GET_U_1(cp + 1) + 1) << 3;
nh = GET_U_1(cp);
break;
if (length != 0) {
if (length < 8)
goto trunc;
- ND_TCHECK_8(ipx);
ND_PRINT(" %08x/%u.%u", GET_BE_U_4(ipx),
GET_BE_U_2(ipx + 4), GET_BE_U_2(ipx + 6));
}
for (i = 0; i < 50 && length != 0; i++) {
if (length < 8)
goto trunc;
- ND_TCHECK_8(ipx);
ND_PRINT(" %08x/%u.%u", GET_BE_U_4(ipx),
GET_BE_U_2(ipx + 4), GET_BE_U_2(ipx + 6));
if(length < 4) {
goto trunc;
}
- ND_TCHECK_1(bp + 3);
/*
* see if this is an IKE packet
ND_PRINT(", bad opts/li");
return (0);
}
- ND_TCHECK_2(pptr);
op = GET_U_1(pptr);
opli = GET_U_1(pptr + 1);
pptr += 2;
ND_PRINT(", bad opts/li");
return;
}
- ND_TCHECK_2(pptr);
op = GET_U_1(pptr);
opli = GET_U_1(pptr + 1);
pptr += 2;
while (len > 2)
{
- ND_TCHECK_2(tptr);
stlv_type = GET_U_1(tptr);
stlv_len = GET_U_1(tptr + 1);
while (len > 2)
{
- ND_TCHECK_2(tptr);
stlv_type = GET_U_1(tptr);
stlv_len = GET_U_1(tptr + 1);
tptr += 2;
{
if (tlv_remaining < 2)
goto trunc;
- ND_TCHECK_2(tptr);
ND_PRINT("%s%s",
ident,
}
processed++;
} else if (afi == AF_INET6) {
- ND_TCHECK_2(tptr);
status_byte=GET_U_1(tptr);
bit_length=GET_U_1(tptr + 1);
if (bit_length > 128) {
ND_PRINT(" (%u)", sublen); /* print out subTLV length */
while (sublen>0) {
- ND_TCHECK_2(tptr);
subtlvtype=GET_U_1(tptr);
subtlvlen=GET_U_1(tptr + 1);
tptr+=2;
uint8_t subt, subl;
while (tlen >= 2) {
- ND_TCHECK_LEN(tptr, 2);
subt = GET_U_1(tptr);
subl = GET_U_1(tptr+1);
tlen -= 2;
{
if (tlen < 2)
goto tlv_trunc;
- ND_TCHECK_2(tptr);
ND_PRINT("\n\t RES: %u, MTID(s): %u",
(GET_BE_U_2(tptr) >> 12),
nd_print_invalid(ndo);
break;
}
- ND_TCHECK_5(tptr); /* router-id + flags */
ND_PRINT("\n\t Router-ID %s", GET_IPADDR_STRING(tptr));
ND_PRINT(", Flags [%s]",
bittok2str(isis_tlv_router_capability_flags, "none", GET_U_1(tptr+4)));
l2info->length = h->len;
l2info->caplen = h->caplen;
- ND_TCHECK_4(p);
l2info->flags = GET_U_1(p + 3);
l2info->direction = GET_U_1(p + 3) & JUNIPER_BPF_PKT_IN;
if (len < 8)
goto invalid;
/* forwarding address */
- ND_TCHECK_LEN(cp, MAC_ADDR_LEN);
ND_PRINT(", forwarding address %s", GET_ETHERADDR_STRING(cp));
cp += MAC_ADDR_LEN;
/* data */
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 = GET_U_1(sp);
len = GET_BE_U_2(sp + 1);
goto trunc; /* not really truncated, but still not decodable */
ND_PRINT(" msdp:");
while (length != 0) {
- ND_TCHECK_3(sp);
type = GET_U_1(sp);
len = GET_BE_U_2(sp + 1);
if (len > 1400 || ndo->ndo_vflag)
break;
case 2:
ND_PRINT(" SA-Request");
- ND_TCHECK_5(sp);
ND_PRINT(" for %s", GET_IPADDR_STRING(sp + 1));
break;
case 4:
sa3->sa_atimetype = GET_BE_U_4(dp);
dp++;
if (sa3->sa_atimetype == NFSV3SATTRTIME_TOCLIENT) {
- ND_TCHECK_4(dp + 1);
sa3->sa_atime.nfsv3_sec = GET_BE_U_4(dp);
dp++;
sa3->sa_atime.nfsv3_nsec = GET_BE_U_4(dp);
sa3->sa_mtimetype = GET_BE_U_4(dp);
dp++;
if (sa3->sa_mtimetype == NFSV3SATTRTIME_TOCLIENT) {
- ND_TCHECK_4(dp + 1);
sa3->sa_mtime.nfsv3_sec = GET_BE_U_4(dp);
dp++;
sa3->sa_mtime.nfsv3_nsec = GET_BE_U_4(dp);
}
return dp;
-trunc:
- return NULL;
}
static void
if (msg_tlen < 4)
goto trunc;
- ND_TCHECK_4(msg_data);
name_entries = GET_BE_U_2(msg_data + 2);
addr_size = 4;
if (msg_tlen < 4)
break;
- ND_TCHECK_4(msg_data);
name_entry_type = GET_BE_U_2(msg_data);
name_entry_len = GET_BE_U_2(msg_data + 2);
ND_PRINT(", index %u", GET_U_1(cp));
cp += 1;
/* pad */
- ND_TCHECK_3(cp);
cp += 3;
/* mask */
ND_TCHECK_4(cp);
ND_PRINT("%smatch dl_vlan_pcp %s", pfx, pcp_str(GET_U_1(cp)));
cp += 1;
/* pad1 */
- ND_TCHECK_1(cp);
cp += 1;
/* dl_type */
dl_type = GET_BE_U_2(cp);
ND_PRINT(", n_tables %u", GET_U_1(cp));
cp += 1;
/* pad */
- ND_TCHECK_3(cp);
cp += 3;
/* capabilities */
ND_PRINT("\n\t capabilities 0x%08x", GET_BE_U_4(cp));
cp += 4;
/* ports */
return of10_phy_ports_print(ndo, cp, ep, len - OF_SWITCH_FEATURES_LEN);
-
-trunc:
- nd_print_trunc(ndo);
- return ep;
}
/* [OF10] Section 5.3.3 */
ND_PRINT("\n\t port_no %s", tok2str(ofpp_str, "%u", GET_BE_U_2(cp)));
cp += 2;
/* hw_addr */
- ND_TCHECK_LEN(cp, MAC_ADDR_LEN);
ND_PRINT(", hw_addr %s", GET_ETHERADDR_STRING(cp));
cp += MAC_ADDR_LEN;
/* config */
tok2str(tableid_str, "%u", GET_U_1(cp)));
cp += 1;
/* pad */
- ND_TCHECK_1(cp);
cp += 1;
/* out_port */
ND_PRINT(", out_port %s",
ND_PRINT(", hard_timeout %u", GET_BE_U_2(cp));
cp += 2;
/* pad2 */
- ND_TCHECK_6(cp);
cp += 6;
/* cookie */
ND_PRINT(", cookie 0x%016" PRIx64, GET_BE_U_8(cp));
goto next_port;
}
/* pad */
- ND_TCHECK_6(cp);
cp += 6;
/* rx_packets */
ND_PRINT(", rx_packets %" PRIu64, GET_BE_U_8(cp));
tok2str(ofpp_str, "%u", GET_BE_U_2(cp)));
cp += 2;
/* pad */
- ND_TCHECK_2(cp);
cp += 2;
/* queue_id */
ND_PRINT(", queue_id %u", GET_BE_U_4(cp));
tok2str(ofprr_str, "unknown (0x%02x)", GET_U_1(cp)));
cp += 1;
/* pad */
- ND_TCHECK_1(cp);
cp += 1;
/* duration_sec */
ND_PRINT(", duration_sec %u", GET_BE_U_4(cp));
ND_PRINT(", idle_timeout %u", GET_BE_U_2(cp));
cp += 2;
/* pad2 */
- ND_TCHECK_2(cp);
cp += 2;
/* packet_count */
ND_PRINT(", packet_count %" PRIu64, GET_BE_U_8(cp));
/* byte_count */
ND_PRINT(", byte_count %" PRIu64, GET_BE_U_8(cp));
return cp + 8;
-
-trunc:
- nd_print_trunc(ndo);
- return ep;
}
/* [OF10] Section 5.4.4 */
cp += 2;
ND_PRINT("\n\t type %s", tok2str(ofpet_str, "invalid (0x%04x)", type));
/* code */
- ND_TCHECK_2(cp);
code_str =
type == OFPET_HELLO_FAILED ? ofphfc_str :
type == OFPET_BAD_REQUEST ? ofpbrc_str :
cp += 2;
/* data */
return of10_data_print(ndo, cp, ep, len - OF_ERROR_MSG_LEN);
-
-trunc:
- nd_print_trunc(ndo);
- return ep;
}
const u_char *
tlv_length);
return -1;
}
- ND_TCHECK_4(tptr);
subtlv_type = GET_BE_U_2(tptr);
subtlv_length = GET_BE_U_2(tptr + 2);
tptr+=4;
ND_PRINT(", length: %u", length2);
dptr += 2;
- ND_TCHECK_1(dptr);
while (dptr < dataend) {
lls_type = GET_BE_U_2(dptr);
ND_PRINT("\n\t %s (%u)",
}
return (0);
-trunc:
- return (1);
}
static int
goto trunc;
cp += 2;
/* Reserved */
- ND_TCHECK_2(cp);
cp += 2;
/* Security Association ID */
ND_PRINT(", SAID %u", GET_BE_U_2(cp));
ND_PRINT("[Total option length leaves no room for final option]");
return;
}
- ND_TCHECK_2(bp);
opt_type = GET_U_1(bp);
bp++;
opt_len = GET_U_1(bp);
len -= 4;
if (len < 4)
goto trunc;
- ND_TCHECK_2(bp + 2);
if (ndo->ndo_vflag > 1)
ND_PRINT("\n");
ND_PRINT(" Hold time: ");
if (len < 4)
goto trunc;
- ND_TCHECK_4(bp);
ngroups = GET_U_1(bp + 3);
bp += 4;
len -= 4;
len -= 4;
if (len < 4)
goto trunc;
- ND_TCHECK_4(bp);
njoin = GET_BE_U_2(bp);
nprune = GET_BE_U_2(bp + 2);
ND_PRINT(" joined: %u pruned: %u", njoin, nprune);
type = "Prune";
if (len < 6)
goto trunc;
- ND_TCHECK_6(bp);
ND_PRINT("\n\t%s %s%s%s%s/%u", type,
(GET_U_1(bp) & 0x01) ? "Sparse " : "Dense ",
(GET_U_1(bp + 1) & 0x80) ? "WC " : "",
while (nentries != 0) {
if (len < 6)
goto trunc;
- ND_TCHECK_6(bp);
ND_PRINT("%c%s%s/%u", s, GET_U_1(bp) & 1 ? "!" : "",
GET_IPADDR_STRING(bp + 2), GET_U_1(bp + 1));
if (GET_U_1(bp) & 0x02) {
if (addr_len == 0) {
if (len < 2)
goto trunc;
- ND_TCHECK_1(bp + 1);
switch (GET_U_1(bp)) {
case 1:
af = AF_INET;
nd_print_invalid(ndo);
return;
}
- ND_TCHECK_1(pim->pim_rsv);
pim_typever = GET_U_1(pim->pim_typever);
/* RFC5015 allocates the high 4 bits of pim_rsv for "subtype". */
pimv2_addr_len = GET_U_1(pim->pim_rsv) & 0x0f;
while (len > 0) {
if (len < 4)
goto trunc;
- ND_TCHECK_4(bp);
otype = GET_BE_U_2(bp);
olen = GET_BE_U_2(bp + 2);
ND_PRINT("\n\t %s Option (%u), length %u, Value: ",
if (len == 0)
goto trunc;
ip = (const struct ip *)bp;
- ND_TCHECK_1(ip->ip_vhl);
switch (IP_V(ip)) {
case 0: /* Null header */
ND_TCHECK_4(ip->ip_dst);
ND_PRINT(" (length bogus, should be = 9)");
return 0;
}
- ND_TCHECK_6(p + 3);
ND_PRINT(": MAC %s", GET_ETHERADDR_STRING(p + 3));
break;
case MEDCLASS_MNB:
* tag_type is previous tag or 0xffff for first iteration
*/
while (tag_type && p < pppoe_payload + pppoe_length) {
- ND_TCHECK_4(p);
tag_type = GET_BE_U_2(p);
tag_len = GET_BE_U_2(p + 2);
p += 4;
vendor_id);
while (length >= 2) {
- ND_TCHECK_2(data);
-
vendor_type = GET_U_1(data);
vendor_length = GET_U_1(data + 1);
return;
}
- ND_TCHECK_4(data);
/* This attribute has standard values */
if (attr_type[attr_code].siz_subtypes)
{
} /* switch */
} /* if-else */
-
- return;
-
- trunc:
- nd_print_trunc(ndo);
}
/*****************************/
return;
}
- ND_TCHECK_4(data);
-
switch(attr_code)
{
case FRM_IPADDR:
ND_PRINT("%s", GET_IPADDR_STRING(data));
break;
}
-
- return;
-
- trunc:
- nd_print_trunc(ndo);
}
/*****************************/
if (len == 0)
goto trunc;
- ND_TCHECK_1(bp);
too_large = 0;
neg = 0;
if (GET_U_1(bp) == '-') {
u_int total, i;
ndo->ndo_protocol = "nbt_udp137";
- ND_TCHECK_2(data + 10);
name_trn_id = GET_BE_U_2(data);
response = (GET_U_1(data + 2) >> 7);
opcode = (GET_U_1(data + 2) >> 3) & 0xF;
return 1;
}
- ND_TCHECK_2(stp_bpdu->forward_delay);
ND_PRINT("\n\tmessage-age %.2fs, max-age %.2fs"
", hello-time %.2fs, forwarding-delay %.2fs",
(float) GET_BE_U_2(stp_bpdu->message_age) / STP_TIME_BASE,
RSTP_EXTRACT_PORT_ROLE(bpdu_flags)));
}
return 1;
-
-trunc:
- return 0;
}
/*
ND_PRINT("CIST port-id %04x,", GET_BE_U_2(stp_bpdu->port_id));
- ND_TCHECK_2(stp_bpdu->forward_delay);
ND_PRINT("\n\tmessage-age %.2fs, max-age %.2fs"
", hello-time %.2fs, forwarding-delay %.2fs",
(float) GET_BE_U_2(stp_bpdu->message_age) / STP_TIME_BASE,
/* IAC SB .... IAC SE */
p = sp;
while (length > (u_int)(p + 1 - sp)) {
- ND_TCHECK_2(p);
if (GET_U_1(p) == IAC && GET_U_1(p + 1) == SE)
break;
p++;
done:
return (int)(sp - osp);
-trunc:
- nd_print_trunc(ndo);
pktend:
return -1;
#undef FETCH
case TSP_ADJTIME:
case TSP_SETDATE:
case TSP_SETDATEREQ:
- ND_TCHECK_8(&tsp->tsp_time);
sec = GET_BE_S_4(tsp->tsp_time.tv_sec);
usec = GET_BE_S_4(tsp->tsp_time.tv_usec);
/* XXX The comparison below is always false? */
while (tptr < (pptr+length)) {
- ND_TCHECK_4(tptr);
type = GET_BE_U_2(tptr);
len = GET_BE_U_2(tptr + 2);
ND_PRINT("udp/va/vat, length %u < 2", length);
return;
}
- ND_TCHECK_2((const u_int *)hdr);
ts = GET_BE_U_2(hdr);
if ((ts & 0xf060) != 0) {
/* probably vt */
if (i0 & 0x3f000000)
ND_PRINT(" s%u", (i0 >> 24) & 0x3f);
}
- return;
-
-trunc:
- nd_print_trunc(ndo);
}
static void
c = ' ';
bp += 8;
for (i = 0; i < naddrs; i++) {
- ND_TCHECK_1(bp + 3);
ND_PRINT("%c%s", c, GET_IPADDR_STRING(bp));
c = ',';
bp += 4;