void
lspping_print(netdissect_options *ndo,
- register const u_char *pptr, register u_int len) {
-
+ register const u_char *pptr, register u_int len)
+{
const struct lspping_common_header *lspping_com_header;
const struct lspping_tlv_header *lspping_tlv_header;
const struct lspping_tlv_header *lspping_subtlv_header;
while(tlen>(int)sizeof(struct lspping_tlv_header)) {
/* did we capture enough for fully decoding the tlv header ? */
- if (!ND_TTEST2(*tptr, sizeof(struct lspping_tlv_header)))
- goto trunc;
+ ND_TCHECK2(*tptr, sizeof(struct lspping_tlv_header));
lspping_tlv_header = (const struct lspping_tlv_header *)tptr;
lspping_tlv_type=EXTRACT_16BITS(lspping_tlv_header->type);
tlv_tlen=lspping_tlv_len; /* header not included -> no adjustment */
/* did we capture enough for fully decoding the tlv ? */
- if (!ND_TTEST2(*tptr, lspping_tlv_len))
- goto trunc;
+ ND_TCHECK2(*tptr, lspping_tlv_len);
tlv_hexdump=FALSE;
switch(lspping_tlv_type) {
while(tlv_tlen>(int)sizeof(struct lspping_tlv_header)) {
/* did we capture enough for fully decoding the subtlv header ? */
- if (!ND_TTEST2(*tptr, sizeof(struct lspping_tlv_header)))
- goto trunc;
+ ND_TCHECK2(*tptr, sizeof(struct lspping_tlv_header));
subtlv_hexdump=FALSE;
lspping_subtlv_header = (const struct lspping_tlv_header *)tlv_tptr;
case LSPPING_TLV_DOWNSTREAM_MAPPING:
/* that strange thing with the downstream map TLV is that until now
- * we do not know if its IPv4 or IPv6 , after we found the adress-type
+ * we do not know if its IPv4 or IPv6 , after we found the address-type
* lets recast the tlv_tptr and move on */
tlv_ptr.lspping_tlv_downstream_map_ipv4= \
case LSPPING_TLV_BFD_DISCRIMINATOR:
tptr += sizeof(struct lspping_tlv_header);
- if (!ND_TTEST2(*tptr, LSPPING_TLV_BFD_DISCRIMINATOR_LEN))
- goto trunc;
+ ND_TCHECK2(*tptr, LSPPING_TLV_BFD_DISCRIMINATOR_LEN);
ND_PRINT((ndo, "\n\t BFD Discriminator 0x%08x", EXTRACT_32BITS(tptr)));
break;
{
uint32_t vendor_id;
- if (!ND_TTEST2(*tptr, LSPPING_TLV_VENDOR_ENTERPRISE_LEN))
- goto trunc;
+ ND_TCHECK2(*tptr, LSPPING_TLV_VENDOR_ENTERPRISE_LEN);
vendor_id = EXTRACT_32BITS(tlv_tptr);
ND_PRINT((ndo, "\n\t Vendor: %s (0x%04x)",
tok2str(smi_values, "Unknown", vendor_id),