/* \summary: Link Management Protocol (LMP) printer */
/* specification: RFC 4204 */
-/* OIF UNI 1.0: http://www.oiforum.com/public/documents/OIF-UNI-01.0.pdf */
+/* OIF UNI 1.0: https://web.archive.org/web/20160401194747/http://www.oiforum.com/public/documents/OIF-UNI-01.0.pdf */
#ifdef HAVE_CONFIG_H
#include <config.h>
#include "netdissect-stdinc.h"
+#define ND_LONGJMP_FROM_TCHECK
#include "netdissect.h"
#include "extract.h"
#include "addrtoname.h"
const u_char *pptr, u_int length)
{
const struct lmp_common_header *lmp_com_header;
- const struct lmp_object_header *lmp_obj_header;
const u_char *tptr,*obj_tptr;
u_int version_res, tlen, lmp_obj_len, lmp_obj_ctype, obj_tlen;
int hexdump;
tlen-=sizeof(struct lmp_common_header);
while(tlen>0) {
- /* did we capture enough for fully decoding the object header ? */
- ND_TCHECK_LEN(tptr, sizeof(struct lmp_object_header));
-
- lmp_obj_header = (const struct lmp_object_header *)tptr;
+ const struct lmp_object_header *lmp_obj_header =
+ (const struct lmp_object_header *)tptr;
lmp_obj_len=GET_BE_U_2(lmp_obj_header->length);
lmp_obj_ctype=GET_U_1(lmp_obj_header->ctype)&0x7f;
break;
}
ND_PRINT("\n\t IPv4 Link ID: %s (0x%08x)",
- ipaddr_string(ndo, obj_tptr),
+ GET_IPADDR_STRING(obj_tptr),
GET_BE_U_4(obj_tptr));
break;
case LMP_CTYPE_IPV6_LOC:
break;
}
ND_PRINT("\n\t IPv6 Link ID: %s (0x%08x)",
- ip6addr_string(ndo, obj_tptr),
+ GET_IP6ADDR_STRING(obj_tptr),
GET_BE_U_4(obj_tptr));
break;
case LMP_CTYPE_UNMD_LOC:
break;
}
ND_PRINT("\n\t Node ID: %s (0x%08x)",
- ipaddr_string(ndo, obj_tptr),
+ GET_IPADDR_STRING(obj_tptr),
GET_BE_U_4(obj_tptr));
break;
ND_PRINT("\n\t Local Link-ID: %s (0x%08x)"
"\n\t Remote Link-ID: %s (0x%08x)",
- ipaddr_string(ndo, obj_tptr+4),
+ GET_IPADDR_STRING(obj_tptr+4),
GET_BE_U_4(obj_tptr + 4),
- ipaddr_string(ndo, obj_tptr+8),
+ GET_IPADDR_STRING(obj_tptr+8),
GET_BE_U_4(obj_tptr + 8));
break;
ND_PRINT("\n\t Local Link-ID: %s (0x%08x)"
"\n\t Remote Link-ID: %s (0x%08x)",
- ip6addr_string(ndo, obj_tptr+4),
+ GET_IP6ADDR_STRING(obj_tptr+4),
GET_BE_U_4(obj_tptr + 4),
- ip6addr_string(ndo, obj_tptr+20),
+ GET_IP6ADDR_STRING(obj_tptr+20),
GET_BE_U_4(obj_tptr + 20));
break;
GET_U_1(obj_tptr)));
ND_PRINT("\n\t Local Interface ID: %s (0x%08x)"
"\n\t Remote Interface ID: %s (0x%08x)",
- ipaddr_string(ndo, obj_tptr+4),
+ GET_IPADDR_STRING(obj_tptr+4),
GET_BE_U_4(obj_tptr + 4),
- ipaddr_string(ndo, obj_tptr+8),
+ GET_IPADDR_STRING(obj_tptr+8),
GET_BE_U_4(obj_tptr + 8));
if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 12, 12))
GET_U_1(obj_tptr)));
ND_PRINT("\n\t Local Interface ID: %s (0x%08x)"
"\n\t Remote Interface ID: %s (0x%08x)",
- ip6addr_string(ndo, obj_tptr+4),
+ GET_IP6ADDR_STRING(obj_tptr+4),
GET_BE_U_4(obj_tptr + 4),
- ip6addr_string(ndo, obj_tptr+20),
+ GET_IP6ADDR_STRING(obj_tptr+20),
GET_BE_U_4(obj_tptr + 20));
if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 36, 36))
/* Decode pairs: <Interface_ID (4 bytes), Channel_status (4 bytes)> */
while (offset+8 <= obj_tlen) {
ND_PRINT("\n\t Interface ID: %s (0x%08x)",
- ipaddr_string(ndo, obj_tptr+offset),
+ GET_IPADDR_STRING(obj_tptr+offset),
GET_BE_U_4(obj_tptr + offset));
ND_PRINT("\n\t\t Active: %s (%u)",
/* Decode pairs: <Interface_ID (16 bytes), Channel_status (4 bytes)> */
while (offset+20 <= obj_tlen) {
ND_PRINT("\n\t Interface ID: %s (0x%08x)",
- ip6addr_string(ndo, obj_tptr+offset),
+ GET_IP6ADDR_STRING(obj_tptr+offset),
GET_BE_U_4(obj_tptr + offset));
ND_PRINT("\n\t\t Active: %s (%u)",
offset = 0;
while (offset+4 <= obj_tlen) {
ND_PRINT("\n\t Interface ID: %s (0x%08x)",
- ipaddr_string(ndo, obj_tptr+offset),
+ GET_IPADDR_STRING(obj_tptr+offset),
GET_BE_U_4(obj_tptr + offset));
offset+=4;
}
offset = 0;
while (offset+16 <= obj_tlen) {
ND_PRINT("\n\t Interface ID: %s (0x%08x)",
- ip6addr_string(ndo, obj_tptr+offset),
+ GET_IP6ADDR_STRING(obj_tptr+offset),
GET_BE_U_4(obj_tptr + offset));
offset+=16;
}
GET_BE_U_2(obj_tptr + 10));
ND_PRINT("\n\t Local Interface ID: %s (0x%08x)",
- ipaddr_string(ndo, obj_tptr+12),
+ GET_IPADDR_STRING(obj_tptr+12),
GET_BE_U_4(obj_tptr + 12));
break;
tptr+=lmp_obj_len;
tlen-=lmp_obj_len;
}
- return;
-trunc:
- nd_print_trunc(ndo);
}