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)
16 #define NETDISSECT_REWORKED
21 #include <tcpdump-stdinc.h>
23 #include "interface.h"
25 #include "addrtoname.h"
31 * LSPPING common header
34 * 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
35 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
36 * | Version Number | Must Be Zero |
37 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
38 * | Message Type | Reply mode | Return Code | Return Subcode|
39 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
43 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
44 * | TimeStamp Sent (seconds) |
45 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
46 * | TimeStamp Sent (microseconds) |
47 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
48 * | TimeStamp Received (seconds) |
49 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
50 * | TimeStamp Received (microseconds) |
51 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
58 struct lspping_common_header
{
64 u_int8_t return_subcode
;
65 u_int8_t sender_handle
[4];
66 u_int8_t seq_number
[4];
67 u_int8_t ts_sent_sec
[4];
68 u_int8_t ts_sent_usec
[4];
69 u_int8_t ts_rcvd_sec
[4];
70 u_int8_t ts_rcvd_usec
[4];
73 #define LSPPING_VERSION 1
75 static const struct tok lspping_msg_type_values
[] = {
76 { 1, "MPLS Echo Request"},
77 { 2, "MPLS Echo Reply"},
81 static const struct tok lspping_reply_mode_values
[] = {
83 { 2, "Reply via an IPv4/IPv6 UDP packet"},
84 { 3, "Reply via an IPv4/IPv6 UDP packet with Router Alert"},
85 { 4, "Reply via application level control channel"},
89 static const struct tok lspping_return_code_values
[] = {
90 { 0, "No return code or return code contained in the Error Code TLV"},
91 { 1, "Malformed echo request received"},
92 { 2, "One or more of the TLVs was not understood"},
93 { 3, "Replying router is an egress for the FEC at stack depth"},
94 { 4, "Replying router has no mapping for the FEC at stack depth"},
98 { 8, "Label switched at stack-depth"},
99 { 9, "Label switched but no MPLS forwarding at stack-depth"},
100 { 10, "Mapping for this FEC is not the given label at stack depth"},
101 { 11, "No label entry at stack-depth"},
102 { 12, "Protocol not associated with interface at FEC stack depth"},
109 * 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
110 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
112 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
118 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
121 struct lspping_tlv_header
{
126 #define LSPPING_TLV_TARGET_FEC_STACK 1
127 #define LSPPING_TLV_DOWNSTREAM_MAPPING 2
128 #define LSPPING_TLV_PAD 3
129 #define LSPPING_TLV_VENDOR_ENTERPRISE 5
130 #define LSPPING_TLV_VENDOR_ENTERPRISE_LEN 4
131 #define LSPPING_TLV_INTERFACE_LABEL_STACK 7
132 #define LSPPING_TLV_ERROR_CODE 9
133 #define LSPPING_TLV_REPLY_TOS_BYTE 10
134 #define LSPPING_TLV_BFD_DISCRIMINATOR 15 /* draft-ietf-bfd-mpls-02 */
135 #define LSPPING_TLV_BFD_DISCRIMINATOR_LEN 4
136 #define LSPPING_TLV_VENDOR_PRIVATE 0xfc00
138 static const struct tok lspping_tlv_values
[] = {
139 { LSPPING_TLV_TARGET_FEC_STACK
, "Target FEC Stack" },
140 { LSPPING_TLV_DOWNSTREAM_MAPPING
, "Downstream Mapping" },
141 { LSPPING_TLV_PAD
, "Pad" },
142 { LSPPING_TLV_ERROR_CODE
, "Error Code" },
143 { LSPPING_TLV_VENDOR_ENTERPRISE
, "Vendor Enterprise Code" },
144 { LSPPING_TLV_INTERFACE_LABEL_STACK
, "Interface Label Stack" },
145 { LSPPING_TLV_REPLY_TOS_BYTE
, "Reply TOS Byte" },
146 { LSPPING_TLV_BFD_DISCRIMINATOR
, "BFD Discriminator" },
147 { LSPPING_TLV_VENDOR_PRIVATE
, "Vendor Private Code" },
151 #define LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV4 1
152 #define LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV6 2
153 #define LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV4 3
154 #define LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV6 4
155 #define LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV4 6
156 #define LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV6 7
157 #define LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_ENDPT 8
158 #define LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_VCID_OLD 9
159 #define LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_VCID 10
160 #define LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV4 11
161 #define LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV6 12
163 static const struct tok lspping_tlvtargetfec_subtlv_values
[] = {
164 { LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV4
, "LDP IPv4 prefix"},
165 { LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV6
, "LDP IPv6 prefix"},
166 { LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV4
, "RSVP IPv4 Session Query"},
167 { LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV6
, "RSVP IPv6 Session Query"},
169 { LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV4
, "VPN IPv4 prefix"},
170 { LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV6
, "VPN IPv6 prefix"},
171 { LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_ENDPT
, "L2 VPN endpoint"},
172 { LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_VCID_OLD
, "L2 circuit ID (old)"},
173 { LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_VCID
, "L2 circuit ID"},
174 { LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV4
, "BGP labeled IPv4 prefix"},
175 { LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV6
, "BGP labeled IPv6 prefix"},
181 * 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
182 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
184 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
185 * | Prefix Length | Must Be Zero |
186 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
188 struct lspping_tlv_targetfec_subtlv_ldp_ipv4_t
{
195 * 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
196 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
201 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
202 * | Prefix Length | Must Be Zero |
203 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
205 struct lspping_tlv_targetfec_subtlv_ldp_ipv6_t
{
206 u_int8_t prefix
[16];
211 * 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
212 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
213 * | Sender identifier |
214 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
216 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
217 * | Prefix Length | Must Be Zero |
218 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
220 struct lspping_tlv_targetfec_subtlv_bgp_ipv4_t
{
221 u_int8_t sender_id
[4];
227 * 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
228 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
229 * | Sender identifier |
233 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
238 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
239 * | Prefix Length | Must Be Zero |
240 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
242 struct lspping_tlv_targetfec_subtlv_bgp_ipv6_t
{
243 u_int8_t sender_id
[16];
244 u_int8_t prefix
[16];
250 * 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
251 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
252 * | IPv4 tunnel end point address |
253 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
254 * | Must Be Zero | Tunnel ID |
255 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
256 * | Extended Tunnel ID |
257 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
258 * | IPv4 tunnel sender address |
259 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
260 * | Must Be Zero | LSP ID |
261 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
263 struct lspping_tlv_targetfec_subtlv_rsvp_ipv4_t
{
264 u_int8_t tunnel_endpoint
[4];
266 u_int8_t tunnel_id
[2];
267 u_int8_t extended_tunnel_id
[4];
268 u_int8_t tunnel_sender
[4];
275 * 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
276 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
277 * | IPv6 tunnel end point address |
281 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
282 * | Must Be Zero | Tunnel ID |
283 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
284 * | Extended Tunnel ID |
288 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
289 * | IPv6 tunnel sender address |
293 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
294 * | Must Be Zero | LSP ID |
295 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
297 struct lspping_tlv_targetfec_subtlv_rsvp_ipv6_t
{
298 u_int8_t tunnel_endpoint
[16];
300 u_int8_t tunnel_id
[2];
301 u_int8_t extended_tunnel_id
[16];
302 u_int8_t tunnel_sender
[16];
309 * 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
310 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
311 * | Route Distinguisher |
313 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
315 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
316 * | Prefix Length | Must Be Zero |
317 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
319 struct lspping_tlv_targetfec_subtlv_l3vpn_ipv4_t
{
327 * 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
328 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
329 * | Route Distinguisher |
331 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
336 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
337 * | Prefix Length | Must Be Zero |
338 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
340 struct lspping_tlv_targetfec_subtlv_l3vpn_ipv6_t
{
342 u_int8_t prefix
[16];
348 * 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
349 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
350 * | Route Distinguisher |
352 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
353 * | Sender's CE ID | Receiver's CE ID |
354 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
355 * | Encapsulation Type | Must Be Zero |
356 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
359 struct lspping_tlv_targetfec_subtlv_l2vpn_endpt_t
{
361 u_int8_t sender_ce_id
[2];
362 u_int8_t receiver_ce_id
[2];
363 u_int8_t encapsulation
[2];
367 * 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
368 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
369 * | Remote PE Address |
370 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
372 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
373 * | Encapsulation Type | Must Be Zero |
374 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
376 struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_old_t
{
377 u_int8_t remote_pe_address
[4];
379 u_int8_t encapsulation
[2];
383 * 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
384 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
385 * | Sender's PE Address |
386 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
387 * | Remote PE Address |
388 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
390 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
391 * | Encapsulation Type | Must Be Zero |
392 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
394 struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_t
{
395 u_int8_t sender_pe_address
[4];
396 u_int8_t remote_pe_address
[4];
398 u_int8_t encapsulation
[2];
403 * 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
404 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
405 * | MTU | Address Type | Resvd (SBZ) |
406 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
407 * | Downstream IP Address (4 or 16 octets) |
408 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
409 * | Downstream Interface Address (4 or 16 octets) |
410 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
411 * | Hash Key Type | Depth Limit | Multipath Length |
412 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
414 * . (Multipath Information) .
416 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
417 * | Downstream Label | Protocol |
418 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
422 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
423 * | Downstream Label | Protocol |
424 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
426 struct lspping_tlv_downstream_map_ipv4_t
{
428 u_int8_t address_type
;
430 u_int8_t downstream_ip
[4];
431 u_int8_t downstream_interface
[4];
434 struct lspping_tlv_downstream_map_ipv6_t
{
436 u_int8_t address_type
;
438 u_int8_t downstream_ip
[16];
439 u_int8_t downstream_interface
[16];
442 struct lspping_tlv_downstream_map_info_t
{
443 u_int8_t hash_key_type
;
444 u_int8_t depth_limit
;
445 u_int8_t multipath_length
[2];
448 #define LSPPING_AFI_IPV4 1
449 #define LSPPING_AFI_UNMB 2
450 #define LSPPING_AFI_IPV6 3
452 static const struct tok lspping_tlv_downstream_addr_values
[] = {
453 { LSPPING_AFI_IPV4
, "IPv4"},
454 { LSPPING_AFI_IPV6
, "IPv6"},
455 { LSPPING_AFI_UNMB
, "Unnumbered"},
460 lspping_print(netdissect_options
*ndo
,
461 register const u_char
*pptr
, register u_int len
) {
463 const struct lspping_common_header
*lspping_com_header
;
464 const struct lspping_tlv_header
*lspping_tlv_header
;
465 const struct lspping_tlv_header
*lspping_subtlv_header
;
466 const u_char
*tptr
,*tlv_tptr
,*subtlv_tptr
;
467 int tlen
,lspping_tlv_len
,lspping_tlv_type
,tlv_tlen
;
468 int tlv_hexdump
,subtlv_hexdump
;
469 int lspping_subtlv_len
,lspping_subtlv_type
;
470 struct timeval timestamp
;
473 const struct lspping_tlv_downstream_map_ipv4_t
*lspping_tlv_downstream_map_ipv4
;
474 const struct lspping_tlv_downstream_map_ipv6_t
*lspping_tlv_downstream_map_ipv6
;
475 const struct lspping_tlv_downstream_map_info_t
*lspping_tlv_downstream_map_info
;
479 const struct lspping_tlv_targetfec_subtlv_ldp_ipv4_t
*lspping_tlv_targetfec_subtlv_ldp_ipv4
;
480 const struct lspping_tlv_targetfec_subtlv_ldp_ipv6_t
*lspping_tlv_targetfec_subtlv_ldp_ipv6
;
481 const struct lspping_tlv_targetfec_subtlv_rsvp_ipv4_t
*lspping_tlv_targetfec_subtlv_rsvp_ipv4
;
482 const struct lspping_tlv_targetfec_subtlv_rsvp_ipv6_t
*lspping_tlv_targetfec_subtlv_rsvp_ipv6
;
483 const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv4_t
*lspping_tlv_targetfec_subtlv_l3vpn_ipv4
;
484 const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv6_t
*lspping_tlv_targetfec_subtlv_l3vpn_ipv6
;
485 const struct lspping_tlv_targetfec_subtlv_l2vpn_endpt_t
*lspping_tlv_targetfec_subtlv_l2vpn_endpt
;
486 const struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_old_t
*lspping_tlv_targetfec_subtlv_l2vpn_vcid_old
;
487 const struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_t
*lspping_tlv_targetfec_subtlv_l2vpn_vcid
;
488 const struct lspping_tlv_targetfec_subtlv_bgp_ipv4_t
*lspping_tlv_targetfec_subtlv_bgp_ipv4
;
489 const struct lspping_tlv_targetfec_subtlv_bgp_ipv6_t
*lspping_tlv_targetfec_subtlv_bgp_ipv6
;
493 lspping_com_header
= (const struct lspping_common_header
*)pptr
;
494 ND_TCHECK(*lspping_com_header
);
497 * Sanity checking of the header.
499 if (EXTRACT_16BITS(&lspping_com_header
->version
[0]) != LSPPING_VERSION
) {
500 ND_PRINT((ndo
, "LSP-PING version %u packet not supported",
501 EXTRACT_16BITS(&lspping_com_header
->version
[0])));
505 /* in non-verbose mode just lets print the basic Message Type*/
506 if (ndo
->ndo_vflag
< 1) {
507 ND_PRINT((ndo
, "LSP-PINGv%u, %s, seq %u, length: %u",
508 EXTRACT_16BITS(&lspping_com_header
->version
[0]),
509 tok2str(lspping_msg_type_values
, "unknown (%u)",lspping_com_header
->msg_type
),
510 EXTRACT_32BITS(lspping_com_header
->seq_number
),
515 /* ok they seem to want to know everything - lets fully decode it */
519 ND_PRINT((ndo
, "\n\tLSP-PINGv%u, msg-type: %s (%u), length: %u\n\t reply-mode: %s (%u)",
520 EXTRACT_16BITS(&lspping_com_header
->version
[0]),
521 tok2str(lspping_msg_type_values
, "unknown",lspping_com_header
->msg_type
),
522 lspping_com_header
->msg_type
,
524 tok2str(lspping_reply_mode_values
, "unknown",lspping_com_header
->reply_mode
),
525 lspping_com_header
->reply_mode
));
528 * the following return codes require that the subcode is attached
529 * at the end of the translated token output
531 if (lspping_com_header
->return_code
== 3 ||
532 lspping_com_header
->return_code
== 4 ||
533 lspping_com_header
->return_code
== 8 ||
534 lspping_com_header
->return_code
== 10 ||
535 lspping_com_header
->return_code
== 11 ||
536 lspping_com_header
->return_code
== 12 )
537 ND_PRINT((ndo
, "\n\t Return Code: %s %u (%u)\n\t Return Subcode: (%u)",
538 tok2str(lspping_return_code_values
, "unknown",lspping_com_header
->return_code
),
539 lspping_com_header
->return_subcode
,
540 lspping_com_header
->return_code
,
541 lspping_com_header
->return_subcode
));
543 ND_PRINT((ndo
, "\n\t Return Code: %s (%u)\n\t Return Subcode: (%u)",
544 tok2str(lspping_return_code_values
, "unknown",lspping_com_header
->return_code
),
545 lspping_com_header
->return_code
,
546 lspping_com_header
->return_subcode
));
548 ND_PRINT((ndo
, "\n\t Sender Handle: 0x%08x, Sequence: %u",
549 EXTRACT_32BITS(lspping_com_header
->sender_handle
),
550 EXTRACT_32BITS(lspping_com_header
->seq_number
)));
552 timestamp
.tv_sec
=EXTRACT_32BITS(lspping_com_header
->ts_sent_sec
);
553 timestamp
.tv_usec
=EXTRACT_32BITS(lspping_com_header
->ts_sent_usec
);
554 ND_PRINT((ndo
, "\n\t Sender Timestamp: "));
555 ts_print(ndo
, ×tamp
);
557 timestamp
.tv_sec
=EXTRACT_32BITS(lspping_com_header
->ts_rcvd_sec
);
558 timestamp
.tv_usec
=EXTRACT_32BITS(lspping_com_header
->ts_rcvd_usec
);
559 ND_PRINT((ndo
, "Receiver Timestamp: "));
560 if ((timestamp
.tv_sec
!= 0) && (timestamp
.tv_usec
!= 0))
561 ts_print(ndo
, ×tamp
);
563 ND_PRINT((ndo
, "no timestamp"));
565 tptr
+=sizeof(const struct lspping_common_header
);
566 tlen
-=sizeof(const struct lspping_common_header
);
568 while(tlen
>(int)sizeof(struct lspping_tlv_header
)) {
570 /* did we capture enough for fully decoding the tlv header ? */
571 if (!ND_TTEST2(*tptr
, sizeof(struct lspping_tlv_header
)))
574 lspping_tlv_header
= (const struct lspping_tlv_header
*)tptr
;
575 lspping_tlv_type
=EXTRACT_16BITS(lspping_tlv_header
->type
);
576 lspping_tlv_len
=EXTRACT_16BITS(lspping_tlv_header
->length
);
578 /* some little sanity checking */
579 if (lspping_tlv_type
== 0 || lspping_tlv_len
== 0)
582 if(lspping_tlv_len
< 4) {
583 ND_PRINT((ndo
, "\n\t ERROR: TLV %u bogus size %u",lspping_tlv_type
,lspping_tlv_len
));
587 ND_PRINT((ndo
, "\n\t %s TLV (%u), length: %u",
588 tok2str(lspping_tlv_values
,
594 tlv_tptr
=tptr
+sizeof(struct lspping_tlv_header
);
595 tlv_tlen
=lspping_tlv_len
; /* header not included -> no adjustment */
597 /* did we capture enough for fully decoding the tlv ? */
598 if (!ND_TTEST2(*tptr
, lspping_tlv_len
))
602 switch(lspping_tlv_type
) {
603 case LSPPING_TLV_TARGET_FEC_STACK
:
604 while(tlv_tlen
>(int)sizeof(struct lspping_tlv_header
)) {
606 /* did we capture enough for fully decoding the subtlv header ? */
607 if (!ND_TTEST2(*tptr
, sizeof(struct lspping_tlv_header
)))
609 subtlv_hexdump
=FALSE
;
611 lspping_subtlv_header
= (const struct lspping_tlv_header
*)tlv_tptr
;
612 lspping_subtlv_type
=EXTRACT_16BITS(lspping_subtlv_header
->type
);
613 lspping_subtlv_len
=EXTRACT_16BITS(lspping_subtlv_header
->length
);
614 subtlv_tptr
=tlv_tptr
+sizeof(struct lspping_tlv_header
);
616 if (lspping_subtlv_len
== 0)
619 ND_PRINT((ndo
, "\n\t %s subTLV (%u), length: %u",
620 tok2str(lspping_tlvtargetfec_subtlv_values
,
622 lspping_subtlv_type
),
624 lspping_subtlv_len
));
626 switch(lspping_subtlv_type
) {
628 case LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV4
:
629 subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv4
= \
630 (const struct lspping_tlv_targetfec_subtlv_ldp_ipv4_t
*)subtlv_tptr
;
631 ND_PRINT((ndo
, "\n\t %s/%u",
632 ipaddr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv4
->prefix
),
633 subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv4
->prefix_len
));
637 case LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV6
:
638 subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv6
= \
639 (const struct lspping_tlv_targetfec_subtlv_ldp_ipv6_t
*)subtlv_tptr
;
640 ND_PRINT((ndo
, "\n\t %s/%u",
641 ip6addr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv6
->prefix
),
642 subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv6
->prefix_len
));
646 case LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV4
:
647 subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv4
= \
648 (const struct lspping_tlv_targetfec_subtlv_bgp_ipv4_t
*)subtlv_tptr
;
649 ND_PRINT((ndo
, "\n\t %s/%u, sender-id %s",
650 ipaddr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv4
->prefix
),
651 subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv4
->prefix_len
,
652 ipaddr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv4
->sender_id
)));
656 case LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV6
:
657 subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv6
= \
658 (const struct lspping_tlv_targetfec_subtlv_bgp_ipv6_t
*)subtlv_tptr
;
659 ND_PRINT((ndo
, "\n\t %s/%u, sender-id %s",
660 ip6addr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv6
->prefix
),
661 subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv6
->prefix_len
,
662 ip6addr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv6
->sender_id
)));
666 case LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV4
:
667 subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
= \
668 (const struct lspping_tlv_targetfec_subtlv_rsvp_ipv4_t
*)subtlv_tptr
;
669 ND_PRINT((ndo
, "\n\t tunnel end-point %s, tunnel sender %s, lsp-id 0x%04x" \
670 "\n\t tunnel-id 0x%04x, extended tunnel-id %s",
671 ipaddr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
->tunnel_endpoint
),
672 ipaddr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
->tunnel_sender
),
673 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
->lsp_id
),
674 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
->tunnel_id
),
675 ipaddr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
->extended_tunnel_id
)));
679 case LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV6
:
680 subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
= \
681 (const struct lspping_tlv_targetfec_subtlv_rsvp_ipv6_t
*)subtlv_tptr
;
682 ND_PRINT((ndo
, "\n\t tunnel end-point %s, tunnel sender %s, lsp-id 0x%04x" \
683 "\n\t tunnel-id 0x%04x, extended tunnel-id %s",
684 ip6addr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
->tunnel_endpoint
),
685 ip6addr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
->tunnel_sender
),
686 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
->lsp_id
),
687 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
->tunnel_id
),
688 ip6addr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
->extended_tunnel_id
)));
692 case LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV4
:
693 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv4
= \
694 (const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv4_t
*)subtlv_tptr
;
695 ND_PRINT((ndo
, "\n\t RD: %s, %s/%u",
696 bgp_vpn_rd_print(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv4
->rd
),
697 ipaddr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv4
->prefix
),
698 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv4
->prefix_len
));
702 case LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV6
:
703 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv6
= \
704 (const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv6_t
*)subtlv_tptr
;
705 ND_PRINT((ndo
, "\n\t RD: %s, %s/%u",
706 bgp_vpn_rd_print(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv6
->rd
),
707 ip6addr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv6
->prefix
),
708 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv6
->prefix_len
));
712 case LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_ENDPT
:
713 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_endpt
= \
714 (const struct lspping_tlv_targetfec_subtlv_l2vpn_endpt_t
*)subtlv_tptr
;
715 ND_PRINT((ndo
, "\n\t RD: %s, Sender CE-ID: %u, Receiver CE-ID: %u" \
716 "\n\t Encapsulation Type: %s (%u)",
717 bgp_vpn_rd_print(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_endpt
->rd
),
718 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_endpt
->sender_ce_id
),
719 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_endpt
->receiver_ce_id
),
720 tok2str(l2vpn_encaps_values
,
722 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_endpt
->encapsulation
)),
723 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_endpt
->encapsulation
)));
727 /* the old L2VPN VCID subTLV does not have support for the sender field */
728 case LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_VCID_OLD
:
729 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old
= \
730 (const struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_old_t
*)subtlv_tptr
;
731 ND_PRINT((ndo
, "\n\t Remote PE: %s" \
732 "\n\t VC-ID: 0x%08x, Encapsulation Type: %s (%u)",
733 ipaddr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old
->remote_pe_address
),
734 EXTRACT_32BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old
->vc_id
),
735 tok2str(l2vpn_encaps_values
,
737 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old
->encapsulation
)),
738 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old
->encapsulation
)));
742 case LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_VCID
:
743 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid
= \
744 (const struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_t
*)subtlv_tptr
;
745 ND_PRINT((ndo
, "\n\t Sender PE: %s, Remote PE: %s" \
746 "\n\t VC-ID: 0x%08x, Encapsulation Type: %s (%u)",
747 ipaddr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid
->sender_pe_address
),
748 ipaddr_string(ndo
, subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid
->remote_pe_address
),
749 EXTRACT_32BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid
->vc_id
),
750 tok2str(l2vpn_encaps_values
,
752 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid
->encapsulation
)),
753 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid
->encapsulation
)));
758 subtlv_hexdump
=TRUE
; /* unknown subTLV just hexdump it */
761 /* do we want to see an additionally subtlv hexdump ? */
762 if (ndo
->ndo_vflag
> 1 || subtlv_hexdump
==TRUE
)
763 print_unknown_data(ndo
, tlv_tptr
+sizeof(struct lspping_tlv_header
), \
767 tlv_tptr
+=lspping_subtlv_len
;
768 tlv_tlen
-=lspping_subtlv_len
+sizeof(struct lspping_tlv_header
);
772 case LSPPING_TLV_DOWNSTREAM_MAPPING
:
773 /* that strange thing with the downstream map TLV is that until now
774 * we do not know if its IPv4 or IPv6 , after we found the adress-type
775 * lets recast the tlv_tptr and move on */
777 tlv_ptr
.lspping_tlv_downstream_map_ipv4
= \
778 (const struct lspping_tlv_downstream_map_ipv4_t
*)tlv_tptr
;
779 tlv_ptr
.lspping_tlv_downstream_map_ipv6
= \
780 (const struct lspping_tlv_downstream_map_ipv6_t
*)tlv_tptr
;
781 ND_PRINT((ndo
, "\n\t MTU: %u, Address-Type: %s (%u)",
782 EXTRACT_16BITS(tlv_ptr
.lspping_tlv_downstream_map_ipv4
->mtu
),
783 tok2str(lspping_tlv_downstream_addr_values
,
785 tlv_ptr
.lspping_tlv_downstream_map_ipv4
->address_type
),
786 tlv_ptr
.lspping_tlv_downstream_map_ipv4
->address_type
));
788 switch(tlv_ptr
.lspping_tlv_downstream_map_ipv4
->address_type
) {
790 case LSPPING_AFI_IPV4
:
791 ND_PRINT((ndo
, "\n\t Downstream IP: %s" \
792 "\n\t Downstream Interface IP: %s",
793 ipaddr_string(ndo
, tlv_ptr
.lspping_tlv_downstream_map_ipv4
->downstream_ip
),
794 ipaddr_string(ndo
, tlv_ptr
.lspping_tlv_downstream_map_ipv4
->downstream_interface
)));
795 tlv_tptr
+=sizeof(struct lspping_tlv_downstream_map_ipv4_t
);
796 tlv_tlen
-=sizeof(struct lspping_tlv_downstream_map_ipv4_t
);
799 case LSPPING_AFI_IPV6
:
800 ND_PRINT((ndo
, "\n\t Downstream IP: %s" \
801 "\n\t Downstream Interface IP: %s",
802 ip6addr_string(ndo
, tlv_ptr
.lspping_tlv_downstream_map_ipv6
->downstream_ip
),
803 ip6addr_string(ndo
, tlv_ptr
.lspping_tlv_downstream_map_ipv6
->downstream_interface
)));
804 tlv_tptr
+=sizeof(struct lspping_tlv_downstream_map_ipv6_t
);
805 tlv_tlen
-=sizeof(struct lspping_tlv_downstream_map_ipv6_t
);
808 case LSPPING_AFI_UNMB
:
809 ND_PRINT((ndo
, "\n\t Downstream IP: %s" \
810 "\n\t Downstream Interface Index: 0x%08x",
811 ipaddr_string(ndo
, tlv_ptr
.lspping_tlv_downstream_map_ipv4
->downstream_ip
),
812 EXTRACT_32BITS(tlv_ptr
.lspping_tlv_downstream_map_ipv4
->downstream_interface
)));
813 tlv_tptr
+=sizeof(struct lspping_tlv_downstream_map_ipv4_t
);
814 tlv_tlen
-=sizeof(struct lspping_tlv_downstream_map_ipv4_t
);
818 /* should not happen ! - no error message - tok2str() has barked already */
822 tlv_ptr
.lspping_tlv_downstream_map_info
= \
823 (const struct lspping_tlv_downstream_map_info_t
*)tlv_tptr
;
825 /* FIXME add hash-key type, depth limit, multipath processing */
828 tlv_tptr
+=sizeof(struct lspping_tlv_downstream_map_info_t
);
829 tlv_tlen
-=sizeof(struct lspping_tlv_downstream_map_info_t
);
831 /* FIXME print downstream labels */
834 tlv_hexdump
=TRUE
; /* dump the TLV until code complete */
838 case LSPPING_TLV_BFD_DISCRIMINATOR
:
839 tptr
+= sizeof(struct lspping_tlv_header
);
840 if (!ND_TTEST2(*tptr
, LSPPING_TLV_BFD_DISCRIMINATOR_LEN
))
842 ND_PRINT((ndo
, "\n\t BFD Discriminator 0x%08x", EXTRACT_32BITS(tptr
)));
845 case LSPPING_TLV_VENDOR_ENTERPRISE
:
849 if (!ND_TTEST2(*tptr
, LSPPING_TLV_VENDOR_ENTERPRISE_LEN
))
851 vendor_id
= EXTRACT_32BITS(tlv_tptr
);
852 ND_PRINT((ndo
, "\n\t Vendor: %s (0x%04x)",
853 tok2str(smi_values
, "Unknown", vendor_id
),
859 * FIXME those are the defined TLVs that lack a decoder
860 * you are welcome to contribute code ;-)
862 case LSPPING_TLV_PAD
:
863 case LSPPING_TLV_ERROR_CODE
:
864 case LSPPING_TLV_VENDOR_PRIVATE
:
867 if (ndo
->ndo_vflag
<= 1)
868 print_unknown_data(ndo
, tlv_tptr
, "\n\t ", tlv_tlen
);
871 /* do we want to see an additionally tlv hexdump ? */
872 if (ndo
->ndo_vflag
> 1 || tlv_hexdump
==TRUE
)
873 print_unknown_data(ndo
, tptr
+sizeof(struct lspping_tlv_header
), "\n\t ",
877 /* All TLVs are aligned to four octet boundary */
878 if (lspping_tlv_len
% 4) {
879 lspping_tlv_len
+= (4 - lspping_tlv_len
% 4);
882 tptr
+=lspping_tlv_len
+sizeof(struct lspping_tlv_header
);
883 tlen
-=lspping_tlv_len
+sizeof(struct lspping_tlv_header
);
887 ND_PRINT((ndo
, "\n\t\t packet exceeded snapshot"));
891 * c-style: whitesmith