#include "addrtoname.h"
#include "gmpls.h"
+static const char tstr[] = " [|LMP]";
+
/*
* LMP common header
*
} bw;
while (total_subobj_len > 0 && hexdump == FALSE ) {
+ ND_TCHECK_16BITS(obj_tptr + offset);
subobj_type = EXTRACT_8BITS(obj_tptr + offset);
subobj_len = EXTRACT_8BITS(obj_tptr + offset + 1);
ND_PRINT((ndo, "\n\t Subobject, Type: %s (%u), Length: %u",
}
switch(subobj_type) {
case INT_SWITCHING_TYPE_SUBOBJ:
+ ND_TCHECK_8BITS(obj_tptr + offset + 2);
ND_PRINT((ndo, "\n\t Switching Type: %s (%u)",
tok2str(gmpls_switch_cap_values,
"Unknown",
EXTRACT_8BITS(obj_tptr + offset + 2)),
EXTRACT_8BITS(obj_tptr + offset + 2)));
+ ND_TCHECK_8BITS(obj_tptr + offset + 3);
ND_PRINT((ndo, "\n\t Encoding Type: %s (%u)",
tok2str(gmpls_encoding_values,
"Unknown",
EXTRACT_8BITS(obj_tptr + offset + 3)),
EXTRACT_8BITS(obj_tptr + offset + 3)));
+ ND_TCHECK_32BITS(obj_tptr + offset + 4);
bw.i = EXTRACT_32BITS(obj_tptr+offset+4);
ND_PRINT((ndo, "\n\t Min Reservable Bandwidth: %.3f Mbps",
bw.f*8/1000000));
+ ND_TCHECK_32BITS(obj_tptr + offset + 8);
bw.i = EXTRACT_32BITS(obj_tptr+offset+8);
ND_PRINT((ndo, "\n\t Max Reservable Bandwidth: %.3f Mbps",
bw.f*8/1000000));
break;
case WAVELENGTH_SUBOBJ:
+ ND_TCHECK_32BITS(obj_tptr + offset + 4);
ND_PRINT((ndo, "\n\t Wavelength: %u",
EXTRACT_32BITS(obj_tptr+offset+4)));
break;
offset+=subobj_len;
}
return (hexdump);
+trunc:
+ return -1;
}
void
const struct lmp_object_header *lmp_obj_header;
const u_char *tptr,*obj_tptr;
u_int tlen,lmp_obj_len,lmp_obj_ctype,obj_tlen;
- int hexdump;
+ int hexdump, ret;
u_int offset;
u_int link_type;
ipaddr_string(ndo, obj_tptr+8),
EXTRACT_32BITS(obj_tptr+8)));
- if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 12, 12))
+ ret = lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 12, 12);
+ if (ret == -1)
+ goto trunc;
+ if (ret == TRUE)
hexdump=TRUE;
break;
ip6addr_string(ndo, obj_tptr+20),
EXTRACT_32BITS(obj_tptr+20)));
- if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 36, 36))
+ ret = lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 36, 36);
+ if (ret == -1)
+ goto trunc;
+ if (ret == TRUE)
hexdump=TRUE;
break;
EXTRACT_32BITS(obj_tptr+8),
EXTRACT_32BITS(obj_tptr+8)));
- if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 12, 12))
+ ret = lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 12, 12);
+ if (ret == -1)
+ goto trunc;
+ if (ret == TRUE)
hexdump=TRUE;
break;
}
return;
trunc:
- ND_PRINT((ndo, "\n\t\t packet exceeded snapshot"));
+ ND_PRINT((ndo, "%s", tstr));
}
/*
* Local Variables: