]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-lspping.c
Translate UDP/1700 as RADIUS
[tcpdump] / print-lspping.c
index 3124ca0815eb21abb610981e7acf1b7086df017b..3e48504963e096f70208787e18f62616cc8aa685 100644 (file)
  * Original code by Hannes Gredler ([email protected])
  */
 
-#define NETDISSECT_REWORKED
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
 
-#include "interface.h"
+#include "netdissect.h"
 #include "extract.h"
 #include "addrtoname.h"
 
@@ -458,8 +457,8 @@ static const struct tok lspping_tlv_downstream_addr_values[] = {
 
 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;
@@ -630,7 +629,6 @@ lspping_print(netdissect_options *ndo,
                            subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv4->prefix_len));
                     break;
 
-#ifdef INET6
                 case LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV6:
                     subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv6 = \
                         (const struct lspping_tlv_targetfec_subtlv_ldp_ipv6_t *)subtlv_tptr;
@@ -638,7 +636,6 @@ lspping_print(netdissect_options *ndo,
                            ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv6->prefix),
                            subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv6->prefix_len));
                     break;
-#endif
 
                 case LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV4:
                     subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv4 = \
@@ -649,7 +646,6 @@ lspping_print(netdissect_options *ndo,
                            ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv4->sender_id)));
                     break;
 
-#ifdef INET6
                 case LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV6:
                     subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv6 = \
                         (const struct lspping_tlv_targetfec_subtlv_bgp_ipv6_t *)subtlv_tptr;
@@ -658,7 +654,6 @@ lspping_print(netdissect_options *ndo,
                            subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv6->prefix_len,
                            ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv6->sender_id)));
                     break;
-#endif
 
                 case LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV4:
                     subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4 = \
@@ -672,7 +667,6 @@ lspping_print(netdissect_options *ndo,
                            ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4->extended_tunnel_id)));
                     break;
 
-#ifdef INET6
                 case LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV6:
                     subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6 = \
                         (const struct lspping_tlv_targetfec_subtlv_rsvp_ipv6_t *)subtlv_tptr;
@@ -684,7 +678,6 @@ lspping_print(netdissect_options *ndo,
                            EXTRACT_16BITS(subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6->tunnel_id),
                            ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6->extended_tunnel_id)));
                     break;
-#endif
 
                 case LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV4:
                     subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv4 = \
@@ -695,7 +688,6 @@ lspping_print(netdissect_options *ndo,
                            subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv4->prefix_len));
                     break;
 
-#ifdef INET6
                 case LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV6:
                     subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv6 = \
                         (const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv6_t *)subtlv_tptr;
@@ -704,7 +696,6 @@ lspping_print(netdissect_options *ndo,
                            ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv6->prefix),
                            subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv6->prefix_len));
                     break;
-#endif
 
                 case LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_ENDPT:
                     subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_endpt = \
@@ -768,7 +759,7 @@ lspping_print(netdissect_options *ndo,
 
         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= \
@@ -792,7 +783,6 @@ lspping_print(netdissect_options *ndo,
                 tlv_tptr+=sizeof(struct lspping_tlv_downstream_map_ipv4_t);
                 tlv_tlen-=sizeof(struct lspping_tlv_downstream_map_ipv4_t);
                 break;
-#ifdef INET6
              case LSPPING_AFI_IPV6:
                 ND_PRINT((ndo, "\n\t    Downstream IP: %s" \
                        "\n\t    Downstream Interface IP: %s",
@@ -801,7 +791,6 @@ lspping_print(netdissect_options *ndo,
                 tlv_tptr+=sizeof(struct lspping_tlv_downstream_map_ipv6_t);
                 tlv_tlen-=sizeof(struct lspping_tlv_downstream_map_ipv6_t);
                 break;
-#endif
             case LSPPING_AFI_UNMB:
                 ND_PRINT((ndo, "\n\t    Downstream IP: %s" \
                        "\n\t    Downstream Interface Index: 0x%08x",