2 * Redistribution and use in source and binary forms, with or without
3 * modification, are permitted provided that: (1) source code
4 * distributions retain the above copyright notice and this paragraph
5 * in its entirety, and (2) distributions including binary code include
6 * the above copyright notice and this paragraph in its entirety in
7 * the documentation or other materials provided with the distribution.
8 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
9 * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
10 * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
11 * FOR A PARTICULAR PURPOSE.
13 * Original code by Hannes Gredler (hannes@juniper.net)
17 static const char rcsid
[] _U_
=
18 "@(#) $Header: /tcpdump/master/tcpdump/print-lspping.c,v 1.4 2004-06-12 08:23:45 hannes Exp $";
25 #include <tcpdump-stdinc.h>
31 #include "interface.h"
33 #include "addrtoname.h"
37 * LSPPING common header
40 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
41 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
42 * | Version Number | Must Be Zero |
43 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
44 * | Message Type | Reply mode | Return Code | Return Subcode|
45 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
47 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
49 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
50 * | TimeStamp Sent (seconds) |
51 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
52 * | TimeStamp Sent (microseconds) |
53 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
54 * | TimeStamp Received (seconds) |
55 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
56 * | TimeStamp Received (microseconds) |
57 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
64 struct lspping_common_header
{
70 u_int8_t return_subcode
;
71 u_int8_t sender_handle
[4];
72 u_int8_t seq_number
[4];
73 u_int8_t ts_sent_sec
[4];
74 u_int8_t ts_sent_usec
[4];
75 u_int8_t ts_rcvd_sec
[4];
76 u_int8_t ts_rcvd_usec
[4];
79 #define LSPPING_VERSION 1
83 static const struct tok lspping_msg_type_values
[] = {
84 { 1, "MPLS Echo Request"},
85 { 2, "MPLS Echo Reply"},
89 static const struct tok lspping_reply_mode_values
[] = {
91 { 2, "Reply via an IPv4/IPv6 UDP packet"},
92 { 3, "Reply via an IPv4/IPv6 UDP packet with Router Alert"},
93 { 4, "Reply via application level control channel"},
97 static const struct tok lspping_return_code_values
[] = {
98 { 0, "No return code or return code contained in the Error Code TLV"},
99 { 1, "Malformed echo request received"},
100 { 2, "One or more of the TLVs was not understood"},
101 { 3, "Replying router is an egress for the FEC at stack depth"},
102 { 4, "Replying router has no mapping for the FEC at stack depth"},
106 { 8, "Label switched at stack-depth"},
107 { 9, "Label switched but no MPLS forwarding at stack-depth"},
108 { 10, "Mapping for this FEC is not the given label at stack depth"},
109 { 11, "No label entry at stack-depth"},
110 { 12, "Protocol not associated with interface at FEC stack depth"},
117 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
118 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
120 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
126 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
129 struct lspping_tlv_header
{
134 #define LSPPING_TLV_TARGET_FEC_STACK 1
135 #define LSPPING_TLV_DOWNSTREAM_MAPPING 2
136 #define LSPPING_TLV_PAD 3
137 #define LSPPING_TLV_ERROR_CODE 4
138 #define LSPPING_TLV_VENDOR_PRIVATE 5
140 static const struct tok lspping_tlv_values
[] = {
141 { LSPPING_TLV_TARGET_FEC_STACK
, "Target FEC Stack" },
142 { LSPPING_TLV_DOWNSTREAM_MAPPING
, "Downstream Mapping" },
143 { LSPPING_TLV_PAD
, "Pad" },
144 { LSPPING_TLV_ERROR_CODE
, "Error Code" },
145 { LSPPING_TLV_VENDOR_PRIVATE
, "Vendor Enterprise Code" },
149 #define LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV4 1
150 #define LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV6 2
151 #define LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV4 3
152 #define LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV6 4
153 #define LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV4 6
154 #define LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV6 7
155 #define LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_ENDPT 8
156 #define LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_VCID 9
157 #define LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV4 10
158 #define LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV6 11
160 static const struct tok lspping_tlvtargetfec_subtlv_values
[] = {
161 { LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV4
, "LDP IPv4 prefix"},
162 { LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV6
, "LDP IPv6 prefix"},
163 { LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV4
, "RSVP IPv4 Session Query"},
164 { LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV6
, "RSVP IPv6 Session Query"},
166 { LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV4
, "VPN IPv4 prefix"},
167 { LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV6
, "VPN IPv6 prefix"},
168 { LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_ENDPT
, "L2 VPN endpoint"},
169 { LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_VCID
, "L2 circuit ID"},
170 { LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV4
, "BGP labeled IPv4 prefix"},
171 { LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV6
, "BGP labeled IPv6 prefix"},
177 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
178 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
180 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
181 * | Prefix Length | Must Be Zero |
182 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
184 struct lspping_tlv_targetfec_subtlv_ldp_ipv4_t
{
191 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
192 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
197 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
198 * | Prefix Length | Must Be Zero |
199 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
201 struct lspping_tlv_targetfec_subtlv_ldp_ipv6_t
{
202 u_int8_t prefix
[16];
207 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
208 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
209 * | Sender identifier |
210 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
212 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
213 * | Prefix Length | Must Be Zero |
214 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
216 struct lspping_tlv_targetfec_subtlv_bgp_ipv4_t
{
217 u_int8_t sender_id
[4];
223 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
224 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
225 * | Sender identifier |
229 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
234 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
235 * | Prefix Length | Must Be Zero |
236 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
238 struct lspping_tlv_targetfec_subtlv_bgp_ipv6_t
{
239 u_int8_t sender_id
[16];
240 u_int8_t prefix
[16];
246 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
247 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
248 * | IPv4 tunnel end point address |
249 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
250 * | Must Be Zero | Tunnel ID |
251 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
252 * | Extended Tunnel ID |
253 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
254 * | IPv4 tunnel sender address |
255 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
256 * | Must Be Zero | LSP ID |
257 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
259 struct lspping_tlv_targetfec_subtlv_rsvp_ipv4_t
{
260 u_int8_t tunnel_endpoint
[4];
262 u_int8_t tunnel_id
[2];
263 u_int8_t extended_tunnel_id
[4];
264 u_int8_t tunnel_sender
[4];
271 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
272 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
273 * | IPv6 tunnel end point address |
277 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
278 * | Must Be Zero | Tunnel ID |
279 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
280 * | Extended Tunnel ID |
284 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
285 * | IPv6 tunnel sender address |
289 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
290 * | Must Be Zero | LSP ID |
291 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
293 struct lspping_tlv_targetfec_subtlv_rsvp_ipv6_t
{
294 u_int8_t tunnel_endpoint
[16];
296 u_int8_t tunnel_id
[2];
297 u_int8_t extended_tunnel_id
[16];
298 u_int8_t tunnel_sender
[16];
305 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
306 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
307 * | Route Distinguisher |
309 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
311 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
312 * | Prefix Length | Must Be Zero |
313 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
315 struct lspping_tlv_targetfec_subtlv_l3vpn_ipv4_t
{
323 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
324 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
325 * | Route Distinguisher |
327 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
332 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
333 * | Prefix Length | Must Be Zero |
334 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
336 struct lspping_tlv_targetfec_subtlv_l3vpn_ipv6_t
{
338 u_int8_t prefix
[16];
343 lspping_print(register const u_char
*pptr
, register u_int len
) {
345 const struct lspping_common_header
*lspping_com_header
;
346 const struct lspping_tlv_header
*lspping_tlv_header
;
347 const struct lspping_tlv_header
*lspping_subtlv_header
;
348 const u_char
*tptr
,*tlv_tptr
,*subtlv_tptr
;
349 int tlen
,lspping_tlv_len
,lspping_tlv_type
,tlv_tlen
;
350 int tlv_hexdump
,subtlv_hexdump
;
351 int lspping_subtlv_len
,lspping_subtlv_type
;
354 const struct lspping_tlv_targetfec_subtlv_ldp_ipv4_t
*lspping_tlv_targetfec_subtlv_ldp_ipv4
;
355 const struct lspping_tlv_targetfec_subtlv_ldp_ipv6_t
*lspping_tlv_targetfec_subtlv_ldp_ipv6
;
356 const struct lspping_tlv_targetfec_subtlv_rsvp_ipv4_t
*lspping_tlv_targetfec_subtlv_rsvp_ipv4
;
357 const struct lspping_tlv_targetfec_subtlv_rsvp_ipv6_t
*lspping_tlv_targetfec_subtlv_rsvp_ipv6
;
358 const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv4_t
*lspping_tlv_targetfec_subtlv_l3vpn_ipv4
;
359 const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv6_t
*lspping_tlv_targetfec_subtlv_l3vpn_ipv6
;
360 const struct lspping_tlv_targetfec_subtlv_bgp_ipv4_t
*lspping_tlv_targetfec_subtlv_bgp_ipv4
;
361 const struct lspping_tlv_targetfec_subtlv_bgp_ipv6_t
*lspping_tlv_targetfec_subtlv_bgp_ipv6
;
365 lspping_com_header
= (const struct lspping_common_header
*)pptr
;
366 TCHECK(*lspping_com_header
);
369 * Sanity checking of the header.
371 if (EXTRACT_16BITS(&lspping_com_header
->version
[0]) != LSPPING_VERSION
) {
372 printf("LSP-PING version %u packet not supported",
373 EXTRACT_16BITS(&lspping_com_header
->version
[0]));
377 /* in non-verbose mode just lets print the basic Message Type*/
379 printf("LSP-PINGv%u, %s, seq %u, length: %u",
380 EXTRACT_16BITS(&lspping_com_header
->version
[0]),
381 tok2str(lspping_msg_type_values
, "unknown (%u)",lspping_com_header
->msg_type
),
382 EXTRACT_32BITS(lspping_com_header
->seq_number
),
387 /* ok they seem to want to know everything - lets fully decode it */
391 printf("\n\tLSP-PINGv%u, msg-type: %s (%u), reply-mode: %s (%u)",
392 EXTRACT_16BITS(&lspping_com_header
->version
[0]),
393 tok2str(lspping_msg_type_values
, "unknown",lspping_com_header
->msg_type
),
394 lspping_com_header
->msg_type
,
395 tok2str(lspping_reply_mode_values
, "unknown",lspping_com_header
->reply_mode
),
396 lspping_com_header
->reply_mode
);
399 * the following return codes require that the subcode is attached
400 * at the end of the translated token output
402 if (lspping_com_header
->return_code
== 3 ||
403 lspping_com_header
->return_code
== 4 ||
404 lspping_com_header
->return_code
== 8 ||
405 lspping_com_header
->return_code
== 10 ||
406 lspping_com_header
->return_code
== 11 ||
407 lspping_com_header
->return_code
== 12 )
408 printf("\n\t Return Code: %s %u (%u), Return Subcode: (%u)",
409 tok2str(lspping_return_code_values
, "unknown",lspping_com_header
->return_code
),
410 lspping_com_header
->return_subcode
,
411 lspping_com_header
->return_code
,
412 lspping_com_header
->return_subcode
);
414 printf("\n\t Return Code: %s (%u), Return Subcode: (%u)",
415 tok2str(lspping_return_code_values
, "unknown",lspping_com_header
->return_code
),
416 lspping_com_header
->return_code
,
417 lspping_com_header
->return_subcode
);
419 printf("\n\t Sender Handle: 0x%08x, Sequence: %u" \
420 "\n\t Sender Timestamp %u.%us, Receiver Timestamp %u.%us",
421 EXTRACT_32BITS(lspping_com_header
->sender_handle
),
422 EXTRACT_32BITS(lspping_com_header
->seq_number
),
423 EXTRACT_32BITS(lspping_com_header
->ts_sent_sec
), /* FIXME: replace with ts_print() */
424 EXTRACT_32BITS(lspping_com_header
->ts_sent_usec
),
425 EXTRACT_32BITS(lspping_com_header
->ts_rcvd_sec
), /* FIXME: replace with ts_print() */
426 EXTRACT_32BITS(lspping_com_header
->ts_rcvd_usec
));
428 tptr
+=sizeof(const struct lspping_common_header
);
429 tlen
-=sizeof(const struct lspping_common_header
);
432 /* did we capture enough for fully decoding the tlv header ? */
433 if (!TTEST2(*tptr
, sizeof(struct lspping_tlv_header
)))
436 lspping_tlv_header
= (const struct lspping_tlv_header
*)tptr
;
437 lspping_tlv_type
=EXTRACT_16BITS(lspping_tlv_header
->type
);
438 lspping_tlv_len
=EXTRACT_16BITS(lspping_tlv_header
->length
);
440 if (lspping_tlv_len
== 0)
443 if(lspping_tlv_len
% 4 || lspping_tlv_len
< 4) { /* aligned to four octet boundary */
444 printf("\n\t ERROR: TLV %u bogus size %u",lspping_tlv_type
,lspping_tlv_len
);
448 printf("\n\t %s TLV (%u), length: %u",
449 tok2str(lspping_tlv_values
,
455 tlv_tptr
=tptr
+sizeof(struct lspping_tlv_header
);
456 tlv_tlen
=lspping_tlv_len
; /* header not included -> no adjustment */
458 /* did we capture enough for fully decoding the tlv ? */
459 if (!TTEST2(*tptr
, lspping_tlv_len
))
463 switch(lspping_tlv_type
) {
464 case LSPPING_TLV_TARGET_FEC_STACK
:
465 while(tlv_tlen
>(int)sizeof(struct lspping_tlv_header
)) {
467 /* did we capture enough for fully decoding the subtlv header ? */
468 if (!TTEST2(*tptr
, sizeof(struct lspping_tlv_header
)))
470 subtlv_hexdump
=FALSE
;
472 lspping_subtlv_header
= (const struct lspping_tlv_header
*)tlv_tptr
;
473 lspping_subtlv_type
=EXTRACT_16BITS(lspping_subtlv_header
->type
);
474 lspping_subtlv_len
=EXTRACT_16BITS(lspping_subtlv_header
->length
);
475 subtlv_tptr
=tlv_tptr
+sizeof(struct lspping_tlv_header
);
477 if (lspping_subtlv_len
== 0)
480 printf("\n\t %s subTLV (%u), length: %u",
481 tok2str(lspping_tlvtargetfec_subtlv_values
,
483 lspping_subtlv_type
),
487 switch(lspping_subtlv_type
) {
489 case LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV4
:
490 subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv4
= \
491 (const struct lspping_tlv_targetfec_subtlv_ldp_ipv4_t
*)subtlv_tptr
;
493 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv4
->prefix
),
494 subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv4
->prefix_len
);
498 case LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV6
:
499 subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv6
= \
500 (const struct lspping_tlv_targetfec_subtlv_ldp_ipv6_t
*)subtlv_tptr
;
502 ip6addr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv6
->prefix
),
503 subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv6
->prefix_len
);
507 case LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV4
:
508 subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv4
= \
509 (const struct lspping_tlv_targetfec_subtlv_bgp_ipv4_t
*)subtlv_tptr
;
510 printf("\n\t %s/%u, sender-id %s",
511 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv4
->prefix
),
512 subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv4
->prefix_len
,
513 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv4
->sender_id
));
517 case LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV6
:
518 subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv6
= \
519 (const struct lspping_tlv_targetfec_subtlv_bgp_ipv6_t
*)subtlv_tptr
;
520 printf("\n\t %s/%u, sender-id %s",
521 ip6addr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv6
->prefix
),
522 subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv6
->prefix_len
,
523 ip6addr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv6
->sender_id
));
527 case LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV4
:
528 subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
= \
529 (const struct lspping_tlv_targetfec_subtlv_rsvp_ipv4_t
*)subtlv_tptr
;
530 printf("\n\t tunnel end-point %s, tunnel sender %s, lsp-id 0x%04x" \
531 "\n\t tunnel-id 0x%04x, extended tunnel-id %s",
532 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
->tunnel_endpoint
),
533 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
->tunnel_sender
),
534 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
->lsp_id
),
535 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
->tunnel_id
),
536 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
->extended_tunnel_id
));
540 case LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV6
:
541 subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
= \
542 (const struct lspping_tlv_targetfec_subtlv_rsvp_ipv6_t
*)subtlv_tptr
;
543 printf("\n\t tunnel end-point %s, tunnel sender %s, lsp-id 0x%04x" \
544 "\n\t tunnel-id 0x%04x, extended tunnel-id %s",
545 ip6addr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
->tunnel_endpoint
),
546 ip6addr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
->tunnel_sender
),
547 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
->lsp_id
),
548 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
->tunnel_id
),
549 ip6addr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
->extended_tunnel_id
));
553 case LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV4
:
554 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv4
= \
555 (const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv4_t
*)subtlv_tptr
;
556 printf("\n\t RD: %s :%s/%u",
557 bgp_vpn_rd_print(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv4
->rd
),
558 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv4
->prefix
),
559 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv4
->prefix_len
);
563 case LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV6
:
564 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv6
= \
565 (const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv6_t
*)subtlv_tptr
;
566 printf("\n\t RD: %s :%s/%u",
567 bgp_vpn_rd_print(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv6
->rd
),
568 ip6addr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv6
->prefix
),
569 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv6
->prefix_len
);
575 * FIXME those are the defined subTLVs that lack a decoder
576 * you are welcome to contribute code ;-)
579 case LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_ENDPT
:
580 case LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_VCID
:
583 subtlv_hexdump
=TRUE
; /* unknown subTLV just hexdump it */
586 /* do we want to see an additionally subtlv hexdump ? */
587 if (vflag
> 1 || subtlv_hexdump
==TRUE
)
588 print_unknown_data(tlv_tptr
+sizeof(struct lspping_tlv_header
), \
592 tlv_tptr
+=lspping_subtlv_len
;
593 tlv_tlen
-=lspping_subtlv_len
+sizeof(struct lspping_tlv_header
);
598 * FIXME those are the defined TLVs that lack a decoder
599 * you are welcome to contribute code ;-)
602 case LSPPING_TLV_DOWNSTREAM_MAPPING
:
603 case LSPPING_TLV_PAD
:
604 case LSPPING_TLV_ERROR_CODE
:
605 case LSPPING_TLV_VENDOR_PRIVATE
:
609 print_unknown_data(tlv_tptr
,"\n\t ",tlv_tlen
);
612 /* do we want to see an additionally tlv hexdump ? */
613 if (vflag
> 1 || tlv_hexdump
==TRUE
)
614 print_unknown_data(tptr
+sizeof(sizeof(struct lspping_tlv_header
)),"\n\t ",
617 tptr
+=lspping_tlv_len
;
618 tlen
-=lspping_tlv_len
;
622 printf("\n\t\t packet exceeded snapshot");