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)
20 #include <tcpdump-stdinc.h>
26 #include "interface.h"
28 #include "addrtoname.h"
35 * LSPPING common header
38 * 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
39 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40 * | Version Number | Must Be Zero |
41 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
42 * | Message Type | Reply mode | Return Code | Return Subcode|
43 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
45 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
47 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
48 * | TimeStamp Sent (seconds) |
49 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
50 * | TimeStamp Sent (microseconds) |
51 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
52 * | TimeStamp Received (seconds) |
53 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
54 * | TimeStamp Received (microseconds) |
55 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
62 struct lspping_common_header
{
68 u_int8_t return_subcode
;
69 u_int8_t sender_handle
[4];
70 u_int8_t seq_number
[4];
71 u_int8_t ts_sent_sec
[4];
72 u_int8_t ts_sent_usec
[4];
73 u_int8_t ts_rcvd_sec
[4];
74 u_int8_t ts_rcvd_usec
[4];
77 #define LSPPING_VERSION 1
79 static const struct tok lspping_msg_type_values
[] = {
80 { 1, "MPLS Echo Request"},
81 { 2, "MPLS Echo Reply"},
85 static const struct tok lspping_reply_mode_values
[] = {
87 { 2, "Reply via an IPv4/IPv6 UDP packet"},
88 { 3, "Reply via an IPv4/IPv6 UDP packet with Router Alert"},
89 { 4, "Reply via application level control channel"},
93 static const struct tok lspping_return_code_values
[] = {
94 { 0, "No return code or return code contained in the Error Code TLV"},
95 { 1, "Malformed echo request received"},
96 { 2, "One or more of the TLVs was not understood"},
97 { 3, "Replying router is an egress for the FEC at stack depth"},
98 { 4, "Replying router has no mapping for the FEC at stack depth"},
102 { 8, "Label switched at stack-depth"},
103 { 9, "Label switched but no MPLS forwarding at stack-depth"},
104 { 10, "Mapping for this FEC is not the given label at stack depth"},
105 { 11, "No label entry at stack-depth"},
106 { 12, "Protocol not associated with interface at FEC stack depth"},
113 * 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
114 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
116 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
122 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
125 struct lspping_tlv_header
{
130 #define LSPPING_TLV_TARGET_FEC_STACK 1
131 #define LSPPING_TLV_DOWNSTREAM_MAPPING 2
132 #define LSPPING_TLV_PAD 3
133 #define LSPPING_TLV_VENDOR_ENTERPRISE 5
134 #define LSPPING_TLV_VENDOR_ENTERPRISE_LEN 4
135 #define LSPPING_TLV_INTERFACE_LABEL_STACK 7
136 #define LSPPING_TLV_ERROR_CODE 9
137 #define LSPPING_TLV_REPLY_TOS_BYTE 10
138 #define LSPPING_TLV_BFD_DISCRIMINATOR 15 /* draft-ietf-bfd-mpls-02 */
139 #define LSPPING_TLV_BFD_DISCRIMINATOR_LEN 4
140 #define LSPPING_TLV_VENDOR_PRIVATE 0xfc00
142 static const struct tok lspping_tlv_values
[] = {
143 { LSPPING_TLV_TARGET_FEC_STACK
, "Target FEC Stack" },
144 { LSPPING_TLV_DOWNSTREAM_MAPPING
, "Downstream Mapping" },
145 { LSPPING_TLV_PAD
, "Pad" },
146 { LSPPING_TLV_ERROR_CODE
, "Error Code" },
147 { LSPPING_TLV_VENDOR_ENTERPRISE
, "Vendor Enterprise Code" },
148 { LSPPING_TLV_INTERFACE_LABEL_STACK
, "Interface Label Stack" },
149 { LSPPING_TLV_REPLY_TOS_BYTE
, "Reply TOS Byte" },
150 { LSPPING_TLV_BFD_DISCRIMINATOR
, "BFD Discriminator" },
151 { LSPPING_TLV_VENDOR_PRIVATE
, "Vendor Private Code" },
155 #define LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV4 1
156 #define LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV6 2
157 #define LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV4 3
158 #define LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV6 4
159 #define LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV4 6
160 #define LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV6 7
161 #define LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_ENDPT 8
162 #define LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_VCID_OLD 9
163 #define LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_VCID 10
164 #define LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV4 11
165 #define LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV6 12
167 static const struct tok lspping_tlvtargetfec_subtlv_values
[] = {
168 { LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV4
, "LDP IPv4 prefix"},
169 { LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV6
, "LDP IPv6 prefix"},
170 { LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV4
, "RSVP IPv4 Session Query"},
171 { LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV6
, "RSVP IPv6 Session Query"},
173 { LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV4
, "VPN IPv4 prefix"},
174 { LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV6
, "VPN IPv6 prefix"},
175 { LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_ENDPT
, "L2 VPN endpoint"},
176 { LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_VCID_OLD
, "L2 circuit ID (old)"},
177 { LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_VCID
, "L2 circuit ID"},
178 { LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV4
, "BGP labeled IPv4 prefix"},
179 { LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV6
, "BGP labeled IPv6 prefix"},
185 * 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
186 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
188 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
189 * | Prefix Length | Must Be Zero |
190 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
192 struct lspping_tlv_targetfec_subtlv_ldp_ipv4_t
{
199 * 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
200 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
205 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
206 * | Prefix Length | Must Be Zero |
207 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
209 struct lspping_tlv_targetfec_subtlv_ldp_ipv6_t
{
210 u_int8_t prefix
[16];
215 * 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
216 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
217 * | Sender identifier |
218 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
220 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
221 * | Prefix Length | Must Be Zero |
222 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
224 struct lspping_tlv_targetfec_subtlv_bgp_ipv4_t
{
225 u_int8_t sender_id
[4];
231 * 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
232 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
233 * | Sender identifier |
237 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
242 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
243 * | Prefix Length | Must Be Zero |
244 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
246 struct lspping_tlv_targetfec_subtlv_bgp_ipv6_t
{
247 u_int8_t sender_id
[16];
248 u_int8_t prefix
[16];
254 * 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
255 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
256 * | IPv4 tunnel end point address |
257 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
258 * | Must Be Zero | Tunnel ID |
259 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
260 * | Extended Tunnel ID |
261 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
262 * | IPv4 tunnel sender address |
263 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
264 * | Must Be Zero | LSP ID |
265 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
267 struct lspping_tlv_targetfec_subtlv_rsvp_ipv4_t
{
268 u_int8_t tunnel_endpoint
[4];
270 u_int8_t tunnel_id
[2];
271 u_int8_t extended_tunnel_id
[4];
272 u_int8_t tunnel_sender
[4];
279 * 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
280 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
281 * | IPv6 tunnel end point address |
285 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
286 * | Must Be Zero | Tunnel ID |
287 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
288 * | Extended Tunnel ID |
292 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
293 * | IPv6 tunnel sender address |
297 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
298 * | Must Be Zero | LSP ID |
299 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
301 struct lspping_tlv_targetfec_subtlv_rsvp_ipv6_t
{
302 u_int8_t tunnel_endpoint
[16];
304 u_int8_t tunnel_id
[2];
305 u_int8_t extended_tunnel_id
[16];
306 u_int8_t tunnel_sender
[16];
313 * 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
314 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
315 * | Route Distinguisher |
317 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
319 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
320 * | Prefix Length | Must Be Zero |
321 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
323 struct lspping_tlv_targetfec_subtlv_l3vpn_ipv4_t
{
331 * 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
332 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
333 * | Route Distinguisher |
335 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
340 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
341 * | Prefix Length | Must Be Zero |
342 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
344 struct lspping_tlv_targetfec_subtlv_l3vpn_ipv6_t
{
346 u_int8_t prefix
[16];
352 * 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
353 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
354 * | Route Distinguisher |
356 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
357 * | Sender's CE ID | Receiver's CE ID |
358 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
359 * | Encapsulation Type | Must Be Zero |
360 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
363 struct lspping_tlv_targetfec_subtlv_l2vpn_endpt_t
{
365 u_int8_t sender_ce_id
[2];
366 u_int8_t receiver_ce_id
[2];
367 u_int8_t encapsulation
[2];
371 * 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
372 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
373 * | Remote PE Address |
374 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
376 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
377 * | Encapsulation Type | Must Be Zero |
378 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
380 struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_old_t
{
381 u_int8_t remote_pe_address
[4];
383 u_int8_t encapsulation
[2];
387 * 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
388 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
389 * | Sender's PE Address |
390 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
391 * | Remote PE Address |
392 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
394 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
395 * | Encapsulation Type | Must Be Zero |
396 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
398 struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_t
{
399 u_int8_t sender_pe_address
[4];
400 u_int8_t remote_pe_address
[4];
402 u_int8_t encapsulation
[2];
407 * 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
408 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
409 * | MTU | Address Type | Resvd (SBZ) |
410 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
411 * | Downstream IP Address (4 or 16 octets) |
412 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
413 * | Downstream Interface Address (4 or 16 octets) |
414 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
415 * | Hash Key Type | Depth Limit | Multipath Length |
416 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
418 * . (Multipath Information) .
420 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
421 * | Downstream Label | Protocol |
422 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
426 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
427 * | Downstream Label | Protocol |
428 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
430 struct lspping_tlv_downstream_map_ipv4_t
{
432 u_int8_t address_type
;
434 u_int8_t downstream_ip
[4];
435 u_int8_t downstream_interface
[4];
438 struct lspping_tlv_downstream_map_ipv6_t
{
440 u_int8_t address_type
;
442 u_int8_t downstream_ip
[16];
443 u_int8_t downstream_interface
[16];
446 struct lspping_tlv_downstream_map_info_t
{
447 u_int8_t hash_key_type
;
448 u_int8_t depth_limit
;
449 u_int8_t multipath_length
[2];
452 #define LSPPING_AFI_IPV4 1
453 #define LSPPING_AFI_UNMB 2
454 #define LSPPING_AFI_IPV6 3
456 static const struct tok lspping_tlv_downstream_addr_values
[] = {
457 { LSPPING_AFI_IPV4
, "IPv4"},
458 { LSPPING_AFI_IPV6
, "IPv6"},
459 { LSPPING_AFI_UNMB
, "Unnumbered"},
464 lspping_print(register const u_char
*pptr
, register u_int len
) {
466 const struct lspping_common_header
*lspping_com_header
;
467 const struct lspping_tlv_header
*lspping_tlv_header
;
468 const struct lspping_tlv_header
*lspping_subtlv_header
;
469 const u_char
*tptr
,*tlv_tptr
,*subtlv_tptr
;
470 int tlen
,lspping_tlv_len
,lspping_tlv_type
,tlv_tlen
;
471 int tlv_hexdump
,subtlv_hexdump
;
472 int lspping_subtlv_len
,lspping_subtlv_type
;
473 struct timeval timestamp
;
476 const struct lspping_tlv_downstream_map_ipv4_t
*lspping_tlv_downstream_map_ipv4
;
477 const struct lspping_tlv_downstream_map_ipv6_t
*lspping_tlv_downstream_map_ipv6
;
478 const struct lspping_tlv_downstream_map_info_t
*lspping_tlv_downstream_map_info
;
482 const struct lspping_tlv_targetfec_subtlv_ldp_ipv4_t
*lspping_tlv_targetfec_subtlv_ldp_ipv4
;
483 const struct lspping_tlv_targetfec_subtlv_ldp_ipv6_t
*lspping_tlv_targetfec_subtlv_ldp_ipv6
;
484 const struct lspping_tlv_targetfec_subtlv_rsvp_ipv4_t
*lspping_tlv_targetfec_subtlv_rsvp_ipv4
;
485 const struct lspping_tlv_targetfec_subtlv_rsvp_ipv6_t
*lspping_tlv_targetfec_subtlv_rsvp_ipv6
;
486 const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv4_t
*lspping_tlv_targetfec_subtlv_l3vpn_ipv4
;
487 const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv6_t
*lspping_tlv_targetfec_subtlv_l3vpn_ipv6
;
488 const struct lspping_tlv_targetfec_subtlv_l2vpn_endpt_t
*lspping_tlv_targetfec_subtlv_l2vpn_endpt
;
489 const struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_old_t
*lspping_tlv_targetfec_subtlv_l2vpn_vcid_old
;
490 const struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_t
*lspping_tlv_targetfec_subtlv_l2vpn_vcid
;
491 const struct lspping_tlv_targetfec_subtlv_bgp_ipv4_t
*lspping_tlv_targetfec_subtlv_bgp_ipv4
;
492 const struct lspping_tlv_targetfec_subtlv_bgp_ipv6_t
*lspping_tlv_targetfec_subtlv_bgp_ipv6
;
496 lspping_com_header
= (const struct lspping_common_header
*)pptr
;
497 TCHECK(*lspping_com_header
);
500 * Sanity checking of the header.
502 if (EXTRACT_16BITS(&lspping_com_header
->version
[0]) != LSPPING_VERSION
) {
503 printf("LSP-PING version %u packet not supported",
504 EXTRACT_16BITS(&lspping_com_header
->version
[0]));
508 /* in non-verbose mode just lets print the basic Message Type*/
510 printf("LSP-PINGv%u, %s, seq %u, length: %u",
511 EXTRACT_16BITS(&lspping_com_header
->version
[0]),
512 tok2str(lspping_msg_type_values
, "unknown (%u)",lspping_com_header
->msg_type
),
513 EXTRACT_32BITS(lspping_com_header
->seq_number
),
518 /* ok they seem to want to know everything - lets fully decode it */
522 printf("\n\tLSP-PINGv%u, msg-type: %s (%u), length: %u\n\t reply-mode: %s (%u)",
523 EXTRACT_16BITS(&lspping_com_header
->version
[0]),
524 tok2str(lspping_msg_type_values
, "unknown",lspping_com_header
->msg_type
),
525 lspping_com_header
->msg_type
,
527 tok2str(lspping_reply_mode_values
, "unknown",lspping_com_header
->reply_mode
),
528 lspping_com_header
->reply_mode
);
531 * the following return codes require that the subcode is attached
532 * at the end of the translated token output
534 if (lspping_com_header
->return_code
== 3 ||
535 lspping_com_header
->return_code
== 4 ||
536 lspping_com_header
->return_code
== 8 ||
537 lspping_com_header
->return_code
== 10 ||
538 lspping_com_header
->return_code
== 11 ||
539 lspping_com_header
->return_code
== 12 )
540 printf("\n\t Return Code: %s %u (%u)\n\t Return Subcode: (%u)",
541 tok2str(lspping_return_code_values
, "unknown",lspping_com_header
->return_code
),
542 lspping_com_header
->return_subcode
,
543 lspping_com_header
->return_code
,
544 lspping_com_header
->return_subcode
);
546 printf("\n\t Return Code: %s (%u)\n\t Return Subcode: (%u)",
547 tok2str(lspping_return_code_values
, "unknown",lspping_com_header
->return_code
),
548 lspping_com_header
->return_code
,
549 lspping_com_header
->return_subcode
);
551 printf("\n\t Sender Handle: 0x%08x, Sequence: %u",
552 EXTRACT_32BITS(lspping_com_header
->sender_handle
),
553 EXTRACT_32BITS(lspping_com_header
->seq_number
));
555 timestamp
.tv_sec
=EXTRACT_32BITS(lspping_com_header
->ts_sent_sec
);
556 timestamp
.tv_usec
=EXTRACT_32BITS(lspping_com_header
->ts_sent_usec
);
557 printf("\n\t Sender Timestamp: ");
558 ts_print(×tamp
);
560 timestamp
.tv_sec
=EXTRACT_32BITS(lspping_com_header
->ts_rcvd_sec
);
561 timestamp
.tv_usec
=EXTRACT_32BITS(lspping_com_header
->ts_rcvd_usec
);
562 printf("Receiver Timestamp: ");
563 if ((timestamp
.tv_sec
!= 0) && (timestamp
.tv_usec
!= 0))
564 ts_print(×tamp
);
566 printf("no timestamp");
568 tptr
+=sizeof(const struct lspping_common_header
);
569 tlen
-=sizeof(const struct lspping_common_header
);
571 while(tlen
>(int)sizeof(struct lspping_tlv_header
)) {
573 /* did we capture enough for fully decoding the tlv header ? */
574 if (!TTEST2(*tptr
, sizeof(struct lspping_tlv_header
)))
577 lspping_tlv_header
= (const struct lspping_tlv_header
*)tptr
;
578 lspping_tlv_type
=EXTRACT_16BITS(lspping_tlv_header
->type
);
579 lspping_tlv_len
=EXTRACT_16BITS(lspping_tlv_header
->length
);
581 /* some little sanity checking */
582 if (lspping_tlv_type
== 0 || lspping_tlv_len
== 0)
585 if(lspping_tlv_len
< 4) {
586 printf("\n\t ERROR: TLV %u bogus size %u",lspping_tlv_type
,lspping_tlv_len
);
590 printf("\n\t %s TLV (%u), length: %u",
591 tok2str(lspping_tlv_values
,
597 tlv_tptr
=tptr
+sizeof(struct lspping_tlv_header
);
598 tlv_tlen
=lspping_tlv_len
; /* header not included -> no adjustment */
600 /* did we capture enough for fully decoding the tlv ? */
601 if (!TTEST2(*tptr
, lspping_tlv_len
))
605 switch(lspping_tlv_type
) {
606 case LSPPING_TLV_TARGET_FEC_STACK
:
607 while(tlv_tlen
>(int)sizeof(struct lspping_tlv_header
)) {
609 /* did we capture enough for fully decoding the subtlv header ? */
610 if (!TTEST2(*tptr
, sizeof(struct lspping_tlv_header
)))
612 subtlv_hexdump
=FALSE
;
614 lspping_subtlv_header
= (const struct lspping_tlv_header
*)tlv_tptr
;
615 lspping_subtlv_type
=EXTRACT_16BITS(lspping_subtlv_header
->type
);
616 lspping_subtlv_len
=EXTRACT_16BITS(lspping_subtlv_header
->length
);
617 subtlv_tptr
=tlv_tptr
+sizeof(struct lspping_tlv_header
);
619 if (lspping_subtlv_len
== 0)
622 printf("\n\t %s subTLV (%u), length: %u",
623 tok2str(lspping_tlvtargetfec_subtlv_values
,
625 lspping_subtlv_type
),
629 switch(lspping_subtlv_type
) {
631 case LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV4
:
632 subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv4
= \
633 (const struct lspping_tlv_targetfec_subtlv_ldp_ipv4_t
*)subtlv_tptr
;
635 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv4
->prefix
),
636 subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv4
->prefix_len
);
640 case LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV6
:
641 subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv6
= \
642 (const struct lspping_tlv_targetfec_subtlv_ldp_ipv6_t
*)subtlv_tptr
;
644 ip6addr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv6
->prefix
),
645 subtlv_ptr
.lspping_tlv_targetfec_subtlv_ldp_ipv6
->prefix_len
);
649 case LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV4
:
650 subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv4
= \
651 (const struct lspping_tlv_targetfec_subtlv_bgp_ipv4_t
*)subtlv_tptr
;
652 printf("\n\t %s/%u, sender-id %s",
653 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv4
->prefix
),
654 subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv4
->prefix_len
,
655 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv4
->sender_id
));
659 case LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV6
:
660 subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv6
= \
661 (const struct lspping_tlv_targetfec_subtlv_bgp_ipv6_t
*)subtlv_tptr
;
662 printf("\n\t %s/%u, sender-id %s",
663 ip6addr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv6
->prefix
),
664 subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv6
->prefix_len
,
665 ip6addr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_bgp_ipv6
->sender_id
));
669 case LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV4
:
670 subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
= \
671 (const struct lspping_tlv_targetfec_subtlv_rsvp_ipv4_t
*)subtlv_tptr
;
672 printf("\n\t tunnel end-point %s, tunnel sender %s, lsp-id 0x%04x" \
673 "\n\t tunnel-id 0x%04x, extended tunnel-id %s",
674 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
->tunnel_endpoint
),
675 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
->tunnel_sender
),
676 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
->lsp_id
),
677 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
->tunnel_id
),
678 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv4
->extended_tunnel_id
));
682 case LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV6
:
683 subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
= \
684 (const struct lspping_tlv_targetfec_subtlv_rsvp_ipv6_t
*)subtlv_tptr
;
685 printf("\n\t tunnel end-point %s, tunnel sender %s, lsp-id 0x%04x" \
686 "\n\t tunnel-id 0x%04x, extended tunnel-id %s",
687 ip6addr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
->tunnel_endpoint
),
688 ip6addr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
->tunnel_sender
),
689 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
->lsp_id
),
690 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
->tunnel_id
),
691 ip6addr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_rsvp_ipv6
->extended_tunnel_id
));
695 case LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV4
:
696 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv4
= \
697 (const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv4_t
*)subtlv_tptr
;
698 printf("\n\t RD: %s, %s/%u",
699 bgp_vpn_rd_print(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv4
->rd
),
700 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv4
->prefix
),
701 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv4
->prefix_len
);
705 case LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV6
:
706 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv6
= \
707 (const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv6_t
*)subtlv_tptr
;
708 printf("\n\t RD: %s, %s/%u",
709 bgp_vpn_rd_print(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv6
->rd
),
710 ip6addr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv6
->prefix
),
711 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l3vpn_ipv6
->prefix_len
);
715 case LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_ENDPT
:
716 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_endpt
= \
717 (const struct lspping_tlv_targetfec_subtlv_l2vpn_endpt_t
*)subtlv_tptr
;
718 printf("\n\t RD: %s, Sender CE-ID: %u, Receiver CE-ID: %u" \
719 "\n\t Encapsulation Type: %s (%u)",
720 bgp_vpn_rd_print(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_endpt
->rd
),
721 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_endpt
->sender_ce_id
),
722 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_endpt
->receiver_ce_id
),
723 tok2str(l2vpn_encaps_values
,
725 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_endpt
->encapsulation
)),
726 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_endpt
->encapsulation
));
730 /* the old L2VPN VCID subTLV does not have support for the sender field */
731 case LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_VCID_OLD
:
732 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old
= \
733 (const struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_old_t
*)subtlv_tptr
;
734 printf("\n\t Remote PE: %s" \
735 "\n\t VC-ID: 0x%08x, Encapsulation Type: %s (%u)",
736 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old
->remote_pe_address
),
737 EXTRACT_32BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old
->vc_id
),
738 tok2str(l2vpn_encaps_values
,
740 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old
->encapsulation
)),
741 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old
->encapsulation
));
745 case LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_VCID
:
746 subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid
= \
747 (const struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_t
*)subtlv_tptr
;
748 printf("\n\t Sender PE: %s, Remote PE: %s" \
749 "\n\t VC-ID: 0x%08x, Encapsulation Type: %s (%u)",
750 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid
->sender_pe_address
),
751 ipaddr_string(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid
->remote_pe_address
),
752 EXTRACT_32BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid
->vc_id
),
753 tok2str(l2vpn_encaps_values
,
755 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid
->encapsulation
)),
756 EXTRACT_16BITS(subtlv_ptr
.lspping_tlv_targetfec_subtlv_l2vpn_vcid
->encapsulation
));
761 subtlv_hexdump
=TRUE
; /* unknown subTLV just hexdump it */
764 /* do we want to see an additionally subtlv hexdump ? */
765 if (vflag
> 1 || subtlv_hexdump
==TRUE
)
766 print_unknown_data(gndo
,tlv_tptr
+sizeof(struct lspping_tlv_header
), \
770 tlv_tptr
+=lspping_subtlv_len
;
771 tlv_tlen
-=lspping_subtlv_len
+sizeof(struct lspping_tlv_header
);
775 case LSPPING_TLV_DOWNSTREAM_MAPPING
:
776 /* that strange thing with the downstream map TLV is that until now
777 * we do not know if its IPv4 or IPv6 , after we found the adress-type
778 * lets recast the tlv_tptr and move on */
780 tlv_ptr
.lspping_tlv_downstream_map_ipv4
= \
781 (const struct lspping_tlv_downstream_map_ipv4_t
*)tlv_tptr
;
782 tlv_ptr
.lspping_tlv_downstream_map_ipv6
= \
783 (const struct lspping_tlv_downstream_map_ipv6_t
*)tlv_tptr
;
784 printf("\n\t MTU: %u, Address-Type: %s (%u)",
785 EXTRACT_16BITS(tlv_ptr
.lspping_tlv_downstream_map_ipv4
->mtu
),
786 tok2str(lspping_tlv_downstream_addr_values
,
788 tlv_ptr
.lspping_tlv_downstream_map_ipv4
->address_type
),
789 tlv_ptr
.lspping_tlv_downstream_map_ipv4
->address_type
);
791 switch(tlv_ptr
.lspping_tlv_downstream_map_ipv4
->address_type
) {
793 case LSPPING_AFI_IPV4
:
794 printf("\n\t Downstream IP: %s" \
795 "\n\t Downstream Interface IP: %s",
796 ipaddr_string(tlv_ptr
.lspping_tlv_downstream_map_ipv4
->downstream_ip
),
797 ipaddr_string(tlv_ptr
.lspping_tlv_downstream_map_ipv4
->downstream_interface
));
798 tlv_tptr
+=sizeof(struct lspping_tlv_downstream_map_ipv4_t
);
799 tlv_tlen
-=sizeof(struct lspping_tlv_downstream_map_ipv4_t
);
802 case LSPPING_AFI_IPV6
:
803 printf("\n\t Downstream IP: %s" \
804 "\n\t Downstream Interface IP: %s",
805 ip6addr_string(tlv_ptr
.lspping_tlv_downstream_map_ipv6
->downstream_ip
),
806 ip6addr_string(tlv_ptr
.lspping_tlv_downstream_map_ipv6
->downstream_interface
));
807 tlv_tptr
+=sizeof(struct lspping_tlv_downstream_map_ipv6_t
);
808 tlv_tlen
-=sizeof(struct lspping_tlv_downstream_map_ipv6_t
);
811 case LSPPING_AFI_UNMB
:
812 printf("\n\t Downstream IP: %s" \
813 "\n\t Downstream Interface Index: 0x%08x",
814 ipaddr_string(tlv_ptr
.lspping_tlv_downstream_map_ipv4
->downstream_ip
),
815 EXTRACT_32BITS(tlv_ptr
.lspping_tlv_downstream_map_ipv4
->downstream_interface
));
816 tlv_tptr
+=sizeof(struct lspping_tlv_downstream_map_ipv4_t
);
817 tlv_tlen
-=sizeof(struct lspping_tlv_downstream_map_ipv4_t
);
821 /* should not happen ! - no error message - tok2str() has barked already */
825 tlv_ptr
.lspping_tlv_downstream_map_info
= \
826 (const struct lspping_tlv_downstream_map_info_t
*)tlv_tptr
;
828 /* FIXME add hash-key type, depth limit, multipath processing */
831 tlv_tptr
+=sizeof(struct lspping_tlv_downstream_map_info_t
);
832 tlv_tlen
-=sizeof(struct lspping_tlv_downstream_map_info_t
);
834 /* FIXME print downstream labels */
837 tlv_hexdump
=TRUE
; /* dump the TLV until code complete */
841 case LSPPING_TLV_BFD_DISCRIMINATOR
:
842 tptr
+= sizeof(struct lspping_tlv_header
);
843 if (!TTEST2(*tptr
, LSPPING_TLV_BFD_DISCRIMINATOR_LEN
))
845 printf("\n\t BFD Discriminator 0x%08x", EXTRACT_32BITS(tptr
));
848 case LSPPING_TLV_VENDOR_ENTERPRISE
:
852 if (!TTEST2(*tptr
, LSPPING_TLV_VENDOR_ENTERPRISE_LEN
))
854 vendor_id
= EXTRACT_32BITS(tlv_tptr
);
855 printf("\n\t Vendor: %s (0x%04x)",
856 tok2str(smi_values
, "Unknown", vendor_id
),
862 * FIXME those are the defined TLVs that lack a decoder
863 * you are welcome to contribute code ;-)
865 case LSPPING_TLV_PAD
:
866 case LSPPING_TLV_ERROR_CODE
:
867 case LSPPING_TLV_VENDOR_PRIVATE
:
871 print_unknown_data(gndo
,tlv_tptr
,"\n\t ",tlv_tlen
);
874 /* do we want to see an additionally tlv hexdump ? */
875 if (vflag
> 1 || tlv_hexdump
==TRUE
)
876 print_unknown_data(gndo
,tptr
+sizeof(struct lspping_tlv_header
),"\n\t ",
880 /* All TLVs are aligned to four octet boundary */
881 if (lspping_tlv_len
% 4) {
882 lspping_tlv_len
+= (4 - lspping_tlv_len
% 4);
885 tptr
+=lspping_tlv_len
+sizeof(struct lspping_tlv_header
);
886 tlen
-=lspping_tlv_len
+sizeof(struct lspping_tlv_header
);
890 printf("\n\t\t packet exceeded snapshot");
894 * c-style: whitesmith