]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ldp.c
Shorten a status text description.
[tcpdump] / print-ldp.c
index d31bfa8963110e69ff54e5623144f6ec96b5ccd5..fc5ff42e67fbaac08f4fde465dcc5844a047519d 100644 (file)
  */
 
 struct ldp_common_header {
-    u_int8_t version[2];
-    u_int8_t pdu_length[2];
-    u_int8_t lsr_id[4];
-    u_int8_t label_space[2];
+    uint8_t version[2];
+    uint8_t pdu_length[2];
+    uint8_t lsr_id[4];
+    uint8_t label_space[2];
 };
 
 #define LDP_VERSION 1
@@ -77,9 +77,9 @@ struct ldp_common_header {
  */
 
 struct ldp_msg_header {
-    u_int8_t type[2];
-    u_int8_t length[2];
-    u_int8_t id[4];
+    uint8_t type[2];
+    uint8_t length[2];
+    uint8_t id[4];
 };
 
 #define        LDP_MASK_MSG_TYPE(x)  ((x)&0x7fff)
@@ -236,8 +236,8 @@ ldp_tlv_print(netdissect_options *ndo,
               register const u_char *tptr) {
 
     struct ldp_tlv_header {
-        u_int8_t type[2];
-        u_int8_t length[2];
+        uint8_t type[2];
+        uint8_t length[2];
     };
 
     const struct ldp_tlv_header *ldp_tlv_header;
@@ -276,12 +276,12 @@ ldp_tlv_print(netdissect_options *ndo,
 
     case LDP_TLV_IPV4_TRANSPORT_ADDR:
         TLV_TCHECK(4);
-        ND_PRINT((ndo, "\n\t      IPv4 Transport Address: %s", ipaddr_string(tptr)));
+        ND_PRINT((ndo, "\n\t      IPv4 Transport Address: %s", ipaddr_string(ndo, tptr)));
         break;
 #ifdef INET6
     case LDP_TLV_IPV6_TRANSPORT_ADDR:
         TLV_TCHECK(16);
-        ND_PRINT((ndo, "\n\t      IPv6 Transport Address: %s", ip6addr_string(tptr)));
+        ND_PRINT((ndo, "\n\t      IPv6 Transport Address: %s", ip6addr_string(ndo, tptr)));
         break;
 #endif
     case LDP_TLV_CONFIG_SEQ_NUMBER:
@@ -300,7 +300,7 @@ ldp_tlv_print(netdissect_options *ndo,
         case AFNUM_INET:
            while(tlv_tlen >= sizeof(struct in_addr)) {
                ND_TCHECK2(*tptr, sizeof(struct in_addr));
-               ND_PRINT((ndo, " %s", ipaddr_string(tptr)));
+               ND_PRINT((ndo, " %s", ipaddr_string(ndo, tptr)));
                tlv_tlen-=sizeof(struct in_addr);
                tptr+=sizeof(struct in_addr);
            }
@@ -309,7 +309,7 @@ ldp_tlv_print(netdissect_options *ndo,
         case AFNUM_INET6:
            while(tlv_tlen >= sizeof(struct in6_addr)) {
                ND_TCHECK2(*tptr, sizeof(struct in6_addr));
-               ND_PRINT((ndo, " %s", ip6addr_string(tptr)));
+               ND_PRINT((ndo, " %s", ip6addr_string(ndo, tptr)));
                tlv_tlen-=sizeof(struct in6_addr);
                tptr+=sizeof(struct in6_addr);
            }
@@ -349,7 +349,7 @@ ldp_tlv_print(netdissect_options *ndo,
            tptr+=LDP_TLV_ADDRESS_LIST_AFNUM_LEN;
            tlv_tlen-=LDP_TLV_ADDRESS_LIST_AFNUM_LEN;
            if (af == AFNUM_INET) {
-               i=decode_prefix4(tptr,tlv_tlen,buf,sizeof(buf));
+               i=decode_prefix4(ndo, tptr, tlv_tlen, buf, sizeof(buf));
                if (i == -2)
                    goto trunc;
                if (i == -3)
@@ -361,7 +361,7 @@ ldp_tlv_print(netdissect_options *ndo,
            }
 #ifdef INET6
            else if (af == AFNUM_INET6) {
-               i=decode_prefix6(tptr,tlv_tlen,buf,sizeof(buf));
+               i=decode_prefix6(ndo, tptr, tlv_tlen, buf, sizeof(buf));
                if (i == -2)
                    goto trunc;
                if (i == -3)
@@ -433,7 +433,7 @@ ldp_tlv_print(netdissect_options *ndo,
                 case LDP_FEC_MARTINI_IFPARM_DESC:
                     ND_PRINT((ndo, ": "));
                     for (idx = 2; idx < vc_info_tlv_len; idx++)
-                        safeputchar(*(tptr+idx));
+                        safeputchar(ndo, *(tptr + idx));
                     break;
 
                 case LDP_FEC_MARTINI_IFPARM_VCCV:
@@ -577,7 +577,7 @@ ldp_msg_print(netdissect_options *ndo,
     pdu_len = EXTRACT_16BITS(&ldp_com_header->pdu_length);
     ND_PRINT((ndo, "%sLDP, Label-Space-ID: %s:%u, pdu-length: %u",
            (ndo->ndo_vflag < 1) ? "" : "\n\t",
-           ipaddr_string(&ldp_com_header->lsr_id),
+           ipaddr_string(ndo, &ldp_com_header->lsr_id),
            EXTRACT_16BITS(&ldp_com_header->label_space),
            pdu_len));