]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-lmp.c
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / print-lmp.c
index 4999e786cb0313fbc7299c9586b5fb1b3ba8cd29..bfb0798e578797e8ea14435a304478b17d364764 100644 (file)
 /* \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>
-#endif
 
 #include "netdissect-stdinc.h"
 
+#define ND_LONGJMP_FROM_TCHECK
 #include "netdissect.h"
 #include "extract.h"
 #include "addrtoname.h"
@@ -362,14 +361,9 @@ lmp_print_data_link_subobjs(netdissect_options *ndo, const u_char *obj_tptr,
     int hexdump = FALSE;
     int subobj_type, subobj_len;
 
-    union { /* int to float conversion buffer */
-        float f;
-        uint32_t i;
-    } bw;
-
     while (total_subobj_len > 0 && hexdump == FALSE ) {
-       subobj_type = EXTRACT_U_1(obj_tptr + offset);
-       subobj_len  = EXTRACT_U_1(obj_tptr + offset + 1);
+       subobj_type = GET_U_1(obj_tptr + offset);
+       subobj_len  = GET_U_1(obj_tptr + offset + 1);
        ND_PRINT("\n\t    Subobject, Type: %s (%u), Length: %u",
                tok2str(lmp_data_link_subobj,
                        "Unknown",
@@ -393,23 +387,21 @@ lmp_print_data_link_subobjs(netdissect_options *ndo, const u_char *obj_tptr,
            ND_PRINT("\n\t      Switching Type: %s (%u)",
                tok2str(gmpls_switch_cap_values,
                        "Unknown",
-                       EXTRACT_U_1(obj_tptr + offset + 2)),
-               EXTRACT_U_1(obj_tptr + offset + 2));
+                       GET_U_1(obj_tptr + offset + 2)),
+               GET_U_1(obj_tptr + offset + 2));
            ND_PRINT("\n\t      Encoding Type: %s (%u)",
                tok2str(gmpls_encoding_values,
                        "Unknown",
-                       EXTRACT_U_1(obj_tptr + offset + 3)),
-               EXTRACT_U_1(obj_tptr + offset + 3));
-           bw.i = EXTRACT_BE_U_4(obj_tptr + offset + 4);
+                       GET_U_1(obj_tptr + offset + 3)),
+               GET_U_1(obj_tptr + offset + 3));
            ND_PRINT("\n\t      Min Reservable Bandwidth: %.3f Mbps",
-                bw.f*8/1000000);
-           bw.i = EXTRACT_BE_U_4(obj_tptr + offset + 8);
+               GET_BE_F_4(obj_tptr + offset + 4)*8/1000000);
            ND_PRINT("\n\t      Max Reservable Bandwidth: %.3f Mbps",
-                bw.f*8/1000000);
+               GET_BE_F_4(obj_tptr + offset + 8)*8/1000000);
            break;
        case WAVELENGTH_SUBOBJ:
            ND_PRINT("\n\t      Wavelength: %u",
-               EXTRACT_BE_U_4(obj_tptr + offset + 4));
+               GET_BE_U_4(obj_tptr + offset + 4));
            break;
        default:
            /* Any Unknown Subobject ==> Exit loop */
@@ -427,24 +419,18 @@ lmp_print(netdissect_options *ndo,
           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;
     u_int offset;
     u_int link_type;
 
-    union { /* int to float conversion buffer */
-        float f;
-        uint32_t i;
-    } bw;
-
     ndo->ndo_protocol = "lmp";
     tptr=pptr;
     lmp_com_header = (const struct lmp_common_header *)pptr;
     ND_TCHECK_SIZE(lmp_com_header);
 
-    version_res = EXTRACT_BE_U_2(lmp_com_header->version_res);
+    version_res = GET_BE_U_2(lmp_com_header->version_res);
 
     /*
      * Sanity checking of the header.
@@ -459,19 +445,19 @@ lmp_print(netdissect_options *ndo,
     if (ndo->ndo_vflag < 1) {
         ND_PRINT("LMPv%u %s Message, length: %u",
                LMP_EXTRACT_VERSION(version_res),
-               tok2str(lmp_msg_type_values, "unknown (%u)",EXTRACT_U_1(lmp_com_header->msg_type)),
+               tok2str(lmp_msg_type_values, "unknown (%u)",GET_U_1(lmp_com_header->msg_type)),
                length);
         return;
     }
 
     /* ok they seem to want to know everything - lets fully decode it */
 
-    tlen=EXTRACT_BE_U_2(lmp_com_header->length);
+    tlen=GET_BE_U_2(lmp_com_header->length);
 
     ND_PRINT("\n\tLMPv%u, msg-type: %s, Flags: [%s], length: %u",
            LMP_EXTRACT_VERSION(version_res),
-           tok2str(lmp_msg_type_values, "unknown, type: %u",EXTRACT_U_1(lmp_com_header->msg_type)),
-           bittok2str(lmp_header_flag_values,"none",EXTRACT_U_1(lmp_com_header->flags)),
+           tok2str(lmp_msg_type_values, "unknown, type: %u",GET_U_1(lmp_com_header->msg_type)),
+           bittok2str(lmp_header_flag_values,"none",GET_U_1(lmp_com_header->flags)),
            tlen);
     if (tlen < sizeof(struct lmp_common_header)) {
         ND_PRINT(" (too short)");
@@ -485,24 +471,22 @@ lmp_print(netdissect_options *ndo,
     tptr+=sizeof(struct lmp_common_header);
     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;
-        lmp_obj_len=EXTRACT_BE_U_2(lmp_obj_header->length);
-        lmp_obj_ctype=EXTRACT_U_1(lmp_obj_header->ctype)&0x7f;
+    while(tlen != 0) {
+        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;
 
         ND_PRINT("\n\t  %s Object (%u), Class-Type: %s (%u) Flags: [%snegotiable], length: %u",
                tok2str(lmp_obj_values,
                        "Unknown",
-                       EXTRACT_U_1(lmp_obj_header->class_num)),
-               EXTRACT_U_1(lmp_obj_header->class_num),
+                       GET_U_1(lmp_obj_header->class_num)),
+               GET_U_1(lmp_obj_header->class_num),
                tok2str(lmp_ctype_values,
                        "Unknown",
-                       (EXTRACT_U_1(lmp_obj_header->class_num)<<8)+lmp_obj_ctype),
+                       (GET_U_1(lmp_obj_header->class_num)<<8)+lmp_obj_ctype),
                lmp_obj_ctype,
-               EXTRACT_U_1(lmp_obj_header->ctype)&0x80 ? "" : "non-",
+               GET_U_1(lmp_obj_header->ctype)&0x80 ? "" : "non-",
                lmp_obj_len);
 
         if (lmp_obj_len < 4) {
@@ -521,7 +505,7 @@ lmp_print(netdissect_options *ndo,
         ND_TCHECK_LEN(tptr, lmp_obj_len);
         hexdump=FALSE;
 
-        switch(EXTRACT_U_1(lmp_obj_header->class_num)) {
+        switch(GET_U_1(lmp_obj_header->class_num)) {
 
         case LMP_OBJ_CC_ID:
             switch(lmp_obj_ctype) {
@@ -532,8 +516,8 @@ lmp_print(netdissect_options *ndo,
                     break;
                 }
                 ND_PRINT("\n\t    Control Channel ID: %u (0x%08x)",
-                       EXTRACT_BE_U_4(obj_tptr),
-                       EXTRACT_BE_U_4(obj_tptr));
+                       GET_BE_U_4(obj_tptr),
+                       GET_BE_U_4(obj_tptr));
                 break;
 
             default:
@@ -551,8 +535,8 @@ lmp_print(netdissect_options *ndo,
                     break;
                 }
                 ND_PRINT("\n\t    IPv4 Link ID: %s (0x%08x)",
-                       ipaddr_string(ndo, obj_tptr),
-                       EXTRACT_BE_U_4(obj_tptr));
+                       GET_IPADDR_STRING(obj_tptr),
+                       GET_BE_U_4(obj_tptr));
                 break;
             case LMP_CTYPE_IPV6_LOC:
             case LMP_CTYPE_IPV6_RMT:
@@ -561,8 +545,8 @@ lmp_print(netdissect_options *ndo,
                     break;
                 }
                 ND_PRINT("\n\t    IPv6 Link ID: %s (0x%08x)",
-                       ip6addr_string(ndo, obj_tptr),
-                       EXTRACT_BE_U_4(obj_tptr));
+                       GET_IP6ADDR_STRING(obj_tptr),
+                       GET_BE_U_4(obj_tptr));
                 break;
             case LMP_CTYPE_UNMD_LOC:
             case LMP_CTYPE_UNMD_RMT:
@@ -571,8 +555,8 @@ lmp_print(netdissect_options *ndo,
                     break;
                 }
                 ND_PRINT("\n\t    Link ID: %u (0x%08x)",
-                       EXTRACT_BE_U_4(obj_tptr),
-                       EXTRACT_BE_U_4(obj_tptr));
+                       GET_BE_U_4(obj_tptr),
+                       GET_BE_U_4(obj_tptr));
                 break;
             default:
                 hexdump=TRUE;
@@ -587,8 +571,8 @@ lmp_print(netdissect_options *ndo,
                     break;
                 }
                 ND_PRINT("\n\t    Message ID: %u (0x%08x)",
-                       EXTRACT_BE_U_4(obj_tptr),
-                       EXTRACT_BE_U_4(obj_tptr));
+                       GET_BE_U_4(obj_tptr),
+                       GET_BE_U_4(obj_tptr));
                 break;
             case LMP_CTYPE_2:
                 if (obj_tlen != 4) {
@@ -596,8 +580,8 @@ lmp_print(netdissect_options *ndo,
                     break;
                 }
                 ND_PRINT("\n\t    Message ID Ack: %u (0x%08x)",
-                       EXTRACT_BE_U_4(obj_tptr),
-                       EXTRACT_BE_U_4(obj_tptr));
+                       GET_BE_U_4(obj_tptr),
+                       GET_BE_U_4(obj_tptr));
                 break;
             default:
                 hexdump=TRUE;
@@ -613,8 +597,8 @@ lmp_print(netdissect_options *ndo,
                     break;
                 }
                 ND_PRINT("\n\t    Node ID: %s (0x%08x)",
-                       ipaddr_string(ndo, obj_tptr),
-                       EXTRACT_BE_U_4(obj_tptr));
+                       GET_IPADDR_STRING(obj_tptr),
+                       GET_BE_U_4(obj_tptr));
                 break;
 
             default:
@@ -630,8 +614,8 @@ lmp_print(netdissect_options *ndo,
                     break;
                 }
                 ND_PRINT("\n\t    Hello Interval: %u\n\t    Hello Dead Interval: %u",
-                       EXTRACT_BE_U_2(obj_tptr),
-                       EXTRACT_BE_U_2(obj_tptr + 2));
+                       GET_BE_U_2(obj_tptr),
+                       GET_BE_U_2(obj_tptr + 2));
                 break;
 
             default:
@@ -647,8 +631,8 @@ lmp_print(netdissect_options *ndo,
                     break;
                 }
                 ND_PRINT("\n\t    Tx Seq: %u, Rx Seq: %u",
-                       EXTRACT_BE_U_4(obj_tptr),
-                       EXTRACT_BE_U_4(obj_tptr + 4));
+                       GET_BE_U_4(obj_tptr),
+                       GET_BE_U_4(obj_tptr + 4));
                 break;
 
             default:
@@ -666,14 +650,14 @@ lmp_print(netdissect_options *ndo,
                ND_PRINT("\n\t    Flags: [%s]",
                    bittok2str(lmp_obj_te_link_flag_values,
                        "none",
-                       EXTRACT_U_1(obj_tptr)));
+                       GET_U_1(obj_tptr)));
 
                ND_PRINT("\n\t    Local Link-ID: %s (0x%08x)"
                       "\n\t    Remote Link-ID: %s (0x%08x)",
-                       ipaddr_string(ndo, obj_tptr+4),
-                       EXTRACT_BE_U_4(obj_tptr + 4),
-                       ipaddr_string(ndo, obj_tptr+8),
-                       EXTRACT_BE_U_4(obj_tptr + 8));
+                       GET_IPADDR_STRING(obj_tptr+4),
+                       GET_BE_U_4(obj_tptr + 4),
+                       GET_IPADDR_STRING(obj_tptr+8),
+                       GET_BE_U_4(obj_tptr + 8));
                break;
 
            case LMP_CTYPE_IPV6:
@@ -684,14 +668,14 @@ lmp_print(netdissect_options *ndo,
                ND_PRINT("\n\t    Flags: [%s]",
                    bittok2str(lmp_obj_te_link_flag_values,
                        "none",
-                       EXTRACT_U_1(obj_tptr)));
+                       GET_U_1(obj_tptr)));
 
                ND_PRINT("\n\t    Local Link-ID: %s (0x%08x)"
                       "\n\t    Remote Link-ID: %s (0x%08x)",
-                       ip6addr_string(ndo, obj_tptr+4),
-                       EXTRACT_BE_U_4(obj_tptr + 4),
-                       ip6addr_string(ndo, obj_tptr+20),
-                       EXTRACT_BE_U_4(obj_tptr + 20));
+                       GET_IP6ADDR_STRING(obj_tptr+4),
+                       GET_BE_U_4(obj_tptr + 4),
+                       GET_IP6ADDR_STRING(obj_tptr+20),
+                       GET_BE_U_4(obj_tptr + 20));
                 break;
 
            case LMP_CTYPE_UNMD:
@@ -702,14 +686,14 @@ lmp_print(netdissect_options *ndo,
                ND_PRINT("\n\t    Flags: [%s]",
                    bittok2str(lmp_obj_te_link_flag_values,
                        "none",
-                       EXTRACT_U_1(obj_tptr)));
+                       GET_U_1(obj_tptr)));
 
                ND_PRINT("\n\t    Local Link-ID: %u (0x%08x)"
                       "\n\t    Remote Link-ID: %u (0x%08x)",
-                       EXTRACT_BE_U_4(obj_tptr + 4),
-                       EXTRACT_BE_U_4(obj_tptr + 4),
-                       EXTRACT_BE_U_4(obj_tptr + 8),
-                       EXTRACT_BE_U_4(obj_tptr + 8));
+                       GET_BE_U_4(obj_tptr + 4),
+                       GET_BE_U_4(obj_tptr + 4),
+                       GET_BE_U_4(obj_tptr + 8),
+                       GET_BE_U_4(obj_tptr + 8));
                break;
 
             default:
@@ -727,13 +711,13 @@ lmp_print(netdissect_options *ndo,
                ND_PRINT("\n\t    Flags: [%s]",
                    bittok2str(lmp_obj_data_link_flag_values,
                        "none",
-                       EXTRACT_U_1(obj_tptr)));
+                       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),
-                       EXTRACT_BE_U_4(obj_tptr + 4),
-                       ipaddr_string(ndo, obj_tptr+8),
-                       EXTRACT_BE_U_4(obj_tptr + 8));
+                       GET_IPADDR_STRING(obj_tptr+4),
+                       GET_BE_U_4(obj_tptr + 4),
+                       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))
                    hexdump=TRUE;
@@ -747,13 +731,13 @@ lmp_print(netdissect_options *ndo,
                ND_PRINT("\n\t    Flags: [%s]",
                    bittok2str(lmp_obj_data_link_flag_values,
                        "none",
-                       EXTRACT_U_1(obj_tptr)));
+                       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),
-                       EXTRACT_BE_U_4(obj_tptr + 4),
-                       ip6addr_string(ndo, obj_tptr+20),
-                       EXTRACT_BE_U_4(obj_tptr + 20));
+                       GET_IP6ADDR_STRING(obj_tptr+4),
+                       GET_BE_U_4(obj_tptr + 4),
+                       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))
                    hexdump=TRUE;
@@ -767,13 +751,13 @@ lmp_print(netdissect_options *ndo,
                ND_PRINT("\n\t    Flags: [%s]",
                    bittok2str(lmp_obj_data_link_flag_values,
                        "none",
-                       EXTRACT_U_1(obj_tptr)));
+                       GET_U_1(obj_tptr)));
                 ND_PRINT("\n\t    Local Interface ID: %u (0x%08x)"
                        "\n\t    Remote Interface ID: %u (0x%08x)",
-                       EXTRACT_BE_U_4(obj_tptr + 4),
-                       EXTRACT_BE_U_4(obj_tptr + 4),
-                       EXTRACT_BE_U_4(obj_tptr + 8),
-                       EXTRACT_BE_U_4(obj_tptr + 8));
+                       GET_BE_U_4(obj_tptr + 4),
+                       GET_BE_U_4(obj_tptr + 4),
+                       GET_BE_U_4(obj_tptr + 8),
+                       GET_BE_U_4(obj_tptr + 8));
 
                if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 12, 12))
                    hexdump=TRUE;
@@ -794,21 +778,21 @@ lmp_print(netdissect_options *ndo,
                ND_PRINT("\n\t    Flags: %s",
                bittok2str(lmp_obj_begin_verify_flag_values,
                        "none",
-                       EXTRACT_BE_U_2(obj_tptr)));
+                       GET_BE_U_2(obj_tptr)));
                ND_PRINT("\n\t    Verify Interval: %u",
-                       EXTRACT_BE_U_2(obj_tptr + 2));
+                       GET_BE_U_2(obj_tptr + 2));
                ND_PRINT("\n\t    Data links: %u",
-                       EXTRACT_BE_U_4(obj_tptr + 4));
+                       GET_BE_U_4(obj_tptr + 4));
                 ND_PRINT("\n\t    Encoding type: %s",
-                       tok2str(gmpls_encoding_values, "Unknown", EXTRACT_U_1((obj_tptr + 8))));
+                       tok2str(gmpls_encoding_values, "Unknown", GET_U_1((obj_tptr + 8))));
                 ND_PRINT("\n\t    Verify Transport Mechanism: %u (0x%x)%s",
-                       EXTRACT_BE_U_2(obj_tptr + 10),
-                       EXTRACT_BE_U_2(obj_tptr + 10),
-                       EXTRACT_BE_U_2(obj_tptr + 10)&8000 ? " (Payload test messages capable)" : "");
-                bw.i = EXTRACT_BE_U_4(obj_tptr + 12);
-               ND_PRINT("\n\t    Transmission Rate: %.3f Mbps",bw.f*8/1000000);
+                       GET_BE_U_2(obj_tptr + 10),
+                       GET_BE_U_2(obj_tptr + 10),
+                       GET_BE_U_2(obj_tptr + 10)&8000 ? " (Payload test messages capable)" : "");
+               ND_PRINT("\n\t    Transmission Rate: %.3f Mbps",
+                       GET_BE_F_4(obj_tptr + 12)*8/1000000);
                ND_PRINT("\n\t    Wavelength: %u",
-                       EXTRACT_BE_U_4(obj_tptr + 16));
+                       GET_BE_U_4(obj_tptr + 16));
                break;
 
             default:
@@ -825,8 +809,8 @@ lmp_print(netdissect_options *ndo,
                 }
                 ND_PRINT("\n\t    Verify Dead Interval: %u"
                        "\n\t    Verify Transport Response: %u",
-                       EXTRACT_BE_U_2(obj_tptr),
-                       EXTRACT_BE_U_2(obj_tptr + 2));
+                       GET_BE_U_2(obj_tptr),
+                       GET_BE_U_2(obj_tptr + 2));
                 break;
 
             default:
@@ -842,7 +826,7 @@ lmp_print(netdissect_options *ndo,
                     break;
                 }
                 ND_PRINT("\n\t    Verify ID: %u",
-                       EXTRACT_BE_U_4(obj_tptr));
+                       GET_BE_U_4(obj_tptr));
                 break;
 
             default:
@@ -857,24 +841,24 @@ lmp_print(netdissect_options *ndo,
                /* 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),
-                       EXTRACT_BE_U_4(obj_tptr + offset));
+                       GET_IPADDR_STRING(obj_tptr+offset),
+                       GET_BE_U_4(obj_tptr + offset));
 
                        ND_PRINT("\n\t\t    Active: %s (%u)",
-                               (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>31) ?
+                               (GET_BE_U_4(obj_tptr + offset + 4)>>31) ?
                                "Allocated" : "Non-allocated",
-                               (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>31));
+                               (GET_BE_U_4(obj_tptr + offset + 4)>>31));
 
                        ND_PRINT("\n\t\t    Direction: %s (%u)",
-                               (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>30)&0x1 ?
+                               (GET_BE_U_4(obj_tptr + offset + 4)>>30)&0x1 ?
                                "Transmit" : "Receive",
-                               (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>30)&0x1);
+                               (GET_BE_U_4(obj_tptr + offset + 4)>>30)&0x1);
 
                        ND_PRINT("\n\t\t    Channel Status: %s (%u)",
                                        tok2str(lmp_obj_channel_status_values,
                                        "Unknown",
-                                       EXTRACT_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF),
-                                       EXTRACT_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF);
+                                       GET_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF),
+                                       GET_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF);
                        offset+=8;
                }
                 break;
@@ -884,24 +868,24 @@ lmp_print(netdissect_options *ndo,
                /* 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),
-                       EXTRACT_BE_U_4(obj_tptr + offset));
+                       GET_IP6ADDR_STRING(obj_tptr+offset),
+                       GET_BE_U_4(obj_tptr + offset));
 
                        ND_PRINT("\n\t\t    Active: %s (%u)",
-                               (EXTRACT_BE_U_4(obj_tptr + offset + 16)>>31) ?
+                               (GET_BE_U_4(obj_tptr + offset + 16)>>31) ?
                                "Allocated" : "Non-allocated",
-                               (EXTRACT_BE_U_4(obj_tptr + offset + 16)>>31));
+                               (GET_BE_U_4(obj_tptr + offset + 16)>>31));
 
                        ND_PRINT("\n\t\t    Direction: %s (%u)",
-                               (EXTRACT_BE_U_4(obj_tptr + offset + 16)>>30)&0x1 ?
+                               (GET_BE_U_4(obj_tptr + offset + 16)>>30)&0x1 ?
                                "Transmit" : "Receive",
-                               (EXTRACT_BE_U_4(obj_tptr + offset + 16)>>30)&0x1);
+                               (GET_BE_U_4(obj_tptr + offset + 16)>>30)&0x1);
 
                        ND_PRINT("\n\t\t    Channel Status: %s (%u)",
                                        tok2str(lmp_obj_channel_status_values,
                                        "Unknown",
-                                       EXTRACT_BE_U_4(obj_tptr + offset + 16)&0x3FFFFFF),
-                                       EXTRACT_BE_U_4(obj_tptr + offset + 16)&0x3FFFFFF);
+                                       GET_BE_U_4(obj_tptr + offset + 16)&0x3FFFFFF),
+                                       GET_BE_U_4(obj_tptr + offset + 16)&0x3FFFFFF);
                        offset+=20;
                }
                 break;
@@ -911,24 +895,24 @@ lmp_print(netdissect_options *ndo,
                /* Decode pairs: <Interface_ID (4 bytes), Channel_status (4 bytes)> */
                while (offset+8 <= obj_tlen) {
                        ND_PRINT("\n\t    Interface ID: %u (0x%08x)",
-                       EXTRACT_BE_U_4(obj_tptr + offset),
-                       EXTRACT_BE_U_4(obj_tptr + offset));
+                       GET_BE_U_4(obj_tptr + offset),
+                       GET_BE_U_4(obj_tptr + offset));
 
                        ND_PRINT("\n\t\t    Active: %s (%u)",
-                               (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>31) ?
+                               (GET_BE_U_4(obj_tptr + offset + 4)>>31) ?
                                "Allocated" : "Non-allocated",
-                               (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>31));
+                               (GET_BE_U_4(obj_tptr + offset + 4)>>31));
 
                        ND_PRINT("\n\t\t    Direction: %s (%u)",
-                               (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>30)&0x1 ?
+                               (GET_BE_U_4(obj_tptr + offset + 4)>>30)&0x1 ?
                                "Transmit" : "Receive",
-                               (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>30)&0x1);
+                               (GET_BE_U_4(obj_tptr + offset + 4)>>30)&0x1);
 
                        ND_PRINT("\n\t\t    Channel Status: %s (%u)",
                                        tok2str(lmp_obj_channel_status_values,
                                        "Unknown",
-                                       EXTRACT_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF),
-                                       EXTRACT_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF);
+                                       GET_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF),
+                                       GET_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF);
                        offset+=8;
                }
                 break;
@@ -944,8 +928,8 @@ lmp_print(netdissect_options *ndo,
                offset = 0;
                while (offset+4 <= obj_tlen) {
                        ND_PRINT("\n\t    Interface ID: %s (0x%08x)",
-                       ipaddr_string(ndo, obj_tptr+offset),
-                       EXTRACT_BE_U_4(obj_tptr + offset));
+                       GET_IPADDR_STRING(obj_tptr+offset),
+                       GET_BE_U_4(obj_tptr + offset));
                        offset+=4;
                }
                 break;
@@ -954,8 +938,8 @@ lmp_print(netdissect_options *ndo,
                offset = 0;
                while (offset+16 <= obj_tlen) {
                        ND_PRINT("\n\t    Interface ID: %s (0x%08x)",
-                       ip6addr_string(ndo, obj_tptr+offset),
-                       EXTRACT_BE_U_4(obj_tptr + offset));
+                       GET_IP6ADDR_STRING(obj_tptr+offset),
+                       GET_BE_U_4(obj_tptr + offset));
                        offset+=16;
                }
                 break;
@@ -964,8 +948,8 @@ lmp_print(netdissect_options *ndo,
                offset = 0;
                while (offset+4 <= obj_tlen) {
                        ND_PRINT("\n\t    Interface ID: %u (0x%08x)",
-                       EXTRACT_BE_U_4(obj_tptr + offset),
-                       EXTRACT_BE_U_4(obj_tptr + offset));
+                       GET_BE_U_4(obj_tptr + offset),
+                       GET_BE_U_4(obj_tptr + offset));
                        offset+=4;
                }
                 break;
@@ -985,7 +969,7 @@ lmp_print(netdissect_options *ndo,
                ND_PRINT("\n\t    Error Code: %s",
                bittok2str(lmp_obj_begin_verify_error_values,
                        "none",
-                       EXTRACT_BE_U_4(obj_tptr)));
+                       GET_BE_U_4(obj_tptr)));
                 break;
 
             case LMP_CTYPE_LINK_SUMMARY_ERROR:
@@ -996,7 +980,7 @@ lmp_print(netdissect_options *ndo,
                ND_PRINT("\n\t    Error Code: %s",
                bittok2str(lmp_obj_link_summary_error_values,
                        "none",
-                       EXTRACT_BE_U_4(obj_tptr)));
+                       GET_BE_U_4(obj_tptr)));
                 break;
             default:
                 hexdump=TRUE;
@@ -1013,10 +997,10 @@ lmp_print(netdissect_options *ndo,
                ND_PRINT("\n\t Flags: %s",
                       bittok2str(lmp_obj_service_config_sp_flag_values,
                                  "none",
-                                 EXTRACT_U_1(obj_tptr)));
+                                 GET_U_1(obj_tptr)));
 
                ND_PRINT("\n\t  UNI Version: %u",
-                      EXTRACT_U_1(obj_tptr + 1));
+                      GET_U_1(obj_tptr + 1));
 
                break;
 
@@ -1026,7 +1010,7 @@ lmp_print(netdissect_options *ndo,
                     break;
                 }
 
-               link_type = EXTRACT_U_1(obj_tptr);
+               link_type = GET_U_1(obj_tptr);
 
                ND_PRINT("\n\t Link Type: %s (%u)",
                       tok2str(lmp_sd_service_config_cpsa_link_type_values,
@@ -1038,44 +1022,44 @@ lmp_print(netdissect_options *ndo,
                    ND_PRINT("\n\t Signal Type: %s (%u)",
                           tok2str(lmp_sd_service_config_cpsa_signal_type_sdh_values,
                                   "Unknown",
-                                  EXTRACT_U_1(obj_tptr + 1)),
-                          EXTRACT_U_1(obj_tptr + 1));
+                                  GET_U_1(obj_tptr + 1)),
+                          GET_U_1(obj_tptr + 1));
                    break;
 
                case LMP_SD_SERVICE_CONFIG_CPSA_LINK_TYPE_SONET:
                    ND_PRINT("\n\t Signal Type: %s (%u)",
                           tok2str(lmp_sd_service_config_cpsa_signal_type_sonet_values,
                                   "Unknown",
-                                  EXTRACT_U_1(obj_tptr + 1)),
-                          EXTRACT_U_1(obj_tptr + 1));
+                                  GET_U_1(obj_tptr + 1)),
+                          GET_U_1(obj_tptr + 1));
                    break;
                }
 
                ND_PRINT("\n\t Transparency: %s",
                       bittok2str(lmp_obj_service_config_cpsa_tp_flag_values,
                                  "none",
-                                 EXTRACT_U_1(obj_tptr + 2)));
+                                 GET_U_1(obj_tptr + 2)));
 
                ND_PRINT("\n\t Contiguous Concatenation Types: %s",
                       bittok2str(lmp_obj_service_config_cpsa_cct_flag_values,
                                  "none",
-                                 EXTRACT_U_1(obj_tptr + 3)));
+                                 GET_U_1(obj_tptr + 3)));
 
                ND_PRINT("\n\t Minimum NCC: %u",
-                      EXTRACT_BE_U_2(obj_tptr + 4));
+                      GET_BE_U_2(obj_tptr + 4));
 
                ND_PRINT("\n\t Maximum NCC: %u",
-                      EXTRACT_BE_U_2(obj_tptr + 6));
+                      GET_BE_U_2(obj_tptr + 6));
 
                ND_PRINT("\n\t Minimum NVC:%u",
-                      EXTRACT_BE_U_2(obj_tptr + 8));
+                      GET_BE_U_2(obj_tptr + 8));
 
                ND_PRINT("\n\t Maximum NVC:%u",
-                      EXTRACT_BE_U_2(obj_tptr + 10));
+                      GET_BE_U_2(obj_tptr + 10));
 
                ND_PRINT("\n\t    Local Interface ID: %s (0x%08x)",
-                      ipaddr_string(ndo, obj_tptr+12),
-                      EXTRACT_BE_U_4(obj_tptr + 12));
+                      GET_IPADDR_STRING(obj_tptr+12),
+                      GET_BE_U_4(obj_tptr + 12));
 
                break;
 
@@ -1089,13 +1073,13 @@ lmp_print(netdissect_options *ndo,
                       bittok2str(
                           lmp_obj_service_config_nsa_transparency_flag_values,
                           "none",
-                          EXTRACT_BE_U_4(obj_tptr)));
+                          GET_BE_U_4(obj_tptr)));
 
                ND_PRINT("\n\t TCM Monitoring Flags: %s",
                       bittok2str(
                           lmp_obj_service_config_nsa_tcm_flag_values,
                           "none",
-                          EXTRACT_U_1(obj_tptr + 7)));
+                          GET_U_1(obj_tptr + 7)));
 
                break;
 
@@ -1109,7 +1093,7 @@ lmp_print(netdissect_options *ndo,
                       bittok2str(
                           lmp_obj_service_config_nsa_network_diversity_flag_values,
                           "none",
-                          EXTRACT_U_1(obj_tptr + 3)));
+                          GET_U_1(obj_tptr + 3)));
                break;
 
            default:
@@ -1136,7 +1120,4 @@ lmp_print(netdissect_options *ndo,
         tptr+=lmp_obj_len;
         tlen-=lmp_obj_len;
     }
-    return;
-trunc:
-    nd_print_trunc(ndo);
 }