epan/dissectors/pidl/samr/samr.cnf cnf_dissect_lsa_BinaryString => lsarpc_dissect_str...
[wireshark-sm.git] / epan / dissectors / packet-mpls-echo.c
blobdb6a9e4a5c73a623d8d695041395e74bd2caa404
1 /* packet-mpls-echo.c
2 * Routines for Multiprotocol Label Switching Echo dissection
3 * Copyright 2004, Carlos Pignataro <cpignata@cisco.com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * (c) Copyright 2011, Jaihari Kalijanakiraman <jaiharik@ipinfusion.com>
10 * Krishnamurthy Mayya <krishnamurthy.mayya@ipinfusion.com>
11 * Nikitha Malgi <malgi.nikitha@ipinfusion.com>
12 * - Support for LSP Ping extensions as per RFC 6426
13 * Mayuresh Raut <msraut@ncsu.edu>
14 * - Support for LSP ping over MPLS as per RFC 6424
15 * (c) Copyright 2012, Subramanian Ramachandran <sramach6@ncsu.edu>
16 * - Support for BFD for MPLS as per RFC 5884
18 * SPDX-License-Identifier: GPL-2.0-or-later
21 #include "config.h"
23 #include <epan/packet.h>
24 #include <epan/addr_resolv.h>
25 #include <epan/expert.h>
26 #include <epan/to_str.h>
28 #include "packet-ldp.h"
29 #include "packet-mpls.h"
31 void proto_register_mpls_echo(void);
32 void proto_reg_handoff_mpls_echo(void);
34 static dissector_handle_t mpls_echo_handle;
36 #define UDP_PORT_MPLS_ECHO 3503
38 static int proto_mpls_echo;
39 static int hf_mpls_echo_version;
40 static int hf_mpls_echo_mbz;
41 static int hf_mpls_echo_gflags;
42 static int hf_mpls_echo_flag_sbz;
43 static int hf_mpls_echo_flag_v;
44 static int hf_mpls_echo_flag_t;
45 static int hf_mpls_echo_flag_r;
46 static int hf_mpls_echo_msgtype;
47 static int hf_mpls_echo_replymode;
48 static int hf_mpls_echo_returncode;
49 static int hf_mpls_echo_returnsubcode;
50 static int hf_mpls_echo_handle;
51 static int hf_mpls_echo_sequence;
52 static int hf_mpls_echo_ts_sent;
53 static int hf_mpls_echo_ts_rec;
54 static int hf_mpls_echo_tlv_type;
55 static int hf_mpls_echo_tlv_len;
56 static int hf_mpls_echo_tlv_value;
57 static int hf_mpls_echo_tlv_fec_type;
58 static int hf_mpls_echo_tlv_fec_len;
59 static int hf_mpls_echo_tlv_fec_value;
60 static int hf_mpls_echo_tlv_fec_ldp_ipv4;
61 static int hf_mpls_echo_tlv_fec_ldp_ipv4_mask;
62 static int hf_mpls_echo_tlv_fec_ldp_ipv6;
63 static int hf_mpls_echo_tlv_fec_ldp_ipv6_mask;
64 static int hf_mpls_echo_tlv_fec_rsvp_ipv4_ipv4_endpoint;
65 static int hf_mpls_echo_tlv_fec_rsvp_ipv6_ipv6_endpoint;
66 static int hf_mpls_echo_tlv_fec_rsvp_ip_mbz1;
67 static int hf_mpls_echo_tlv_fec_rsvp_ip_tunnel_id;
68 static int hf_mpls_echo_tlv_fec_rsvp_ipv4_ext_tunnel_id;
69 static int hf_mpls_echo_tlv_fec_rsvp_ipv4_ipv4_sender;
70 static int hf_mpls_echo_tlv_fec_rsvp_ipv6_ext_tunnel_id;
71 static int hf_mpls_echo_tlv_fec_rsvp_ipv6_ipv6_sender;
72 static int hf_mpls_echo_tlv_fec_rsvp_ip_mbz2;
73 static int hf_mpls_echo_tlv_fec_rsvp_ip_lsp_id;
74 static int hf_mpls_echo_tlv_fec_vpn_route_dist;
75 static int hf_mpls_echo_tlv_fec_vpn_ipv4;
76 static int hf_mpls_echo_tlv_fec_vpn_len;
77 static int hf_mpls_echo_tlv_fec_vpn_ipv6;
78 static int hf_mpls_echo_tlv_fec_l2_vpn_route_dist;
79 static int hf_mpls_echo_tlv_fec_l2_vpn_send_ve_id;
80 static int hf_mpls_echo_tlv_fec_l2_vpn_recv_ve_id;
81 static int hf_mpls_echo_tlv_fec_l2_vpn_encap_type;
82 static int hf_mpls_echo_tlv_fec_l2cid_sender;
83 static int hf_mpls_echo_tlv_fec_l2cid_remote;
84 static int hf_mpls_echo_tlv_fec_l2cid_vcid;
85 static int hf_mpls_echo_tlv_fec_l2cid_encap;
86 static int hf_mpls_echo_tlv_fec_l2cid_mbz;
87 static int hf_mpls_echo_tlv_fec_bgp_ipv4;
88 static int hf_mpls_echo_tlv_fec_bgp_ipv6;
89 static int hf_mpls_echo_tlv_fec_bgp_len;
90 static int hf_mpls_echo_tlv_fec_gen_ipv4;
91 static int hf_mpls_echo_tlv_fec_gen_ipv4_mask;
92 static int hf_mpls_echo_tlv_fec_gen_ipv6;
93 static int hf_mpls_echo_tlv_fec_gen_ipv6_mask;
94 static int hf_mpls_echo_tlv_fec_nil_label;
95 static int hf_mpls_echo_tlv_fec_pw_ipv6_128_sender;
96 static int hf_mpls_echo_tlv_fec_pw_ipv6_128_remote;
97 static int hf_mpls_echo_tlv_fec_pw_ipv6_128_pw_id;
98 static int hf_mpls_echo_tlv_fec_pw_ipv6_128_pw_type;
99 static int hf_mpls_echo_tlv_fec_pw_ipv6_128_mbz;
100 static int hf_mpls_echo_tlv_fec_igp_ipv4;
101 static int hf_mpls_echo_tlv_fec_igp_ipv6;
102 static int hf_mpls_echo_tlv_fec_igp_mask;
103 static int hf_mpls_echo_tlv_fec_igp_protocol;
104 static int hf_mpls_echo_tlv_fec_igp_reserved;
105 static int hf_mpls_echo_tlv_fec_igp_adj_type;
106 static int hf_mpls_echo_tlv_fec_igp_adj_local_ipv4;
107 static int hf_mpls_echo_tlv_fec_igp_adj_local_ipv6;
108 static int hf_mpls_echo_tlv_fec_igp_adj_local_ident;
109 static int hf_mpls_echo_tlv_fec_igp_adj_remote_ipv4;
110 static int hf_mpls_echo_tlv_fec_igp_adj_remote_ipv6;
111 static int hf_mpls_echo_tlv_fec_igp_adj_remote_ident;
112 static int hf_mpls_echo_tlv_fec_igp_adj_adv_ident_ospf;
113 static int hf_mpls_echo_tlv_fec_igp_adj_adv_ident_isis;
114 static int hf_mpls_echo_tlv_fec_igp_adj_adv_ident;
115 static int hf_mpls_echo_tlv_fec_igp_adj_rec_ident_ospf;
116 static int hf_mpls_echo_tlv_fec_igp_adj_rec_ident_isis;
117 static int hf_mpls_echo_tlv_fec_igp_adj_rec_ident;
118 static int hf_mpls_echo_tlv_ds_map_mtu;
119 static int hf_mpls_echo_tlv_ds_map_addr_type;
120 static int hf_mpls_echo_tlv_ds_map_res;
121 static int hf_mpls_echo_tlv_ds_map_flag_res;
122 static int hf_mpls_echo_tlv_ds_map_flag_i;
123 static int hf_mpls_echo_tlv_ds_map_flag_n;
124 static int hf_mpls_echo_tlv_ds_map_ds_ip;
125 static int hf_mpls_echo_tlv_ds_map_int_ip;
126 static int hf_mpls_echo_tlv_ds_map_if_index;
127 static int hf_mpls_echo_tlv_ds_map_ds_ipv6;
128 static int hf_mpls_echo_tlv_ds_map_int_ipv6;
129 static int hf_mpls_echo_tlv_ds_map_hash_type;
130 static int hf_mpls_echo_tlv_ds_map_depth;
131 static int hf_mpls_echo_tlv_ds_map_muti_len;
132 static int hf_mpls_echo_tlv_ds_map_mp_ip;
133 static int hf_mpls_echo_tlv_ds_map_mp_mask;
134 static int hf_mpls_echo_tlv_ds_map_mp_ip_low;
135 static int hf_mpls_echo_tlv_ds_map_mp_ip_high;
136 static int hf_mpls_echo_tlv_ds_map_mp_no_multipath_info;
137 static int hf_mpls_echo_tlv_ds_map_mp_value;
138 static int hf_mpls_echo_tlv_ds_map_mp_label;
139 static int hf_mpls_echo_tlv_ds_map_mp_exp;
140 static int hf_mpls_echo_tlv_ds_map_mp_bos;
141 static int hf_mpls_echo_tlv_ds_map_mp_proto;
142 static int hf_mpls_echo_tlv_dd_map_mtu;
143 static int hf_mpls_echo_tlv_dd_map_addr_type;
144 static int hf_mpls_echo_tlv_dd_map_res;
145 static int hf_mpls_echo_tlv_dd_map_flag_res;
146 static int hf_mpls_echo_tlv_dd_map_flag_i;
147 static int hf_mpls_echo_tlv_dd_map_flag_n;
148 static int hf_mpls_echo_tlv_dd_map_ds_ip;
149 static int hf_mpls_echo_tlv_dd_map_int_ip;
150 static int hf_mpls_echo_tlv_dd_map_ds_ipv6;
151 static int hf_mpls_echo_tlv_dd_map_int_ipv6;
152 static int hf_mpls_echo_tlv_dd_map_return_code;
153 static int hf_mpls_echo_tlv_dd_map_return_subcode;
154 static int hf_mpls_echo_tlv_dd_map_subtlv_len;
155 static int hf_mpls_echo_tlv_dd_map_ingress_if_num;
156 static int hf_mpls_echo_tlv_dd_map_egress_if_num;
157 static int hf_mpls_echo_sub_tlv_multipath_type;
158 static int hf_mpls_echo_sub_tlv_multipath_length;
159 static int hf_mpls_echo_sub_tlv_multipath_value;
160 static int hf_mpls_echo_sub_tlv_resv;
161 static int hf_mpls_echo_sub_tlv_multipath_info;
162 /* static int hf_mpls_echo_tlv_ddstlv_map_mp_label; */
163 static int hf_mpls_echo_tlv_ddstlv_map_mp_proto;
164 /* static int hf_mpls_echo_tlv_ddstlv_map_mp_exp; */
165 /* static int hf_mpls_echo_tlv_ddstlv_map_mp_bos; */
166 static int hf_mpls_echo_sub_tlv_multipath_ip;
167 static int hf_mpls_echo_sub_tlv_mp_ip_low;
168 static int hf_mpls_echo_sub_tlv_mp_ip_high;
169 static int hf_mpls_echo_sub_tlv_mp_mask;
170 static int hf_mpls_echo_sub_tlv_op_type;
171 static int hf_mpls_echo_sub_tlv_addr_type;
172 static int hf_mpls_echo_sub_tlv_fec_tlv_value;
173 static int hf_mpls_echo_sub_tlv_label;
174 static int hf_mpls_echo_sub_tlv_traffic_class;
175 static int hf_mpls_echo_sub_tlv_s_bit;
176 static int hf_mpls_echo_sub_tlv_res;
177 static int hf_mpls_echo_sub_tlv_remote_peer_unspecified;
178 static int hf_mpls_echo_sub_tlv_remote_peer_ip;
179 static int hf_mpls_echo_sub_tlv_remore_peer_ipv6;
180 static int hf_mpls_echo_tlv_dd_map_type;
181 static int hf_mpls_echo_tlv_dd_map_length;
182 static int hf_mpls_echo_tlv_dd_map_value;
183 static int hf_mpls_echo_tlv_padaction;
184 static int hf_mpls_echo_tlv_padding;
185 static int hf_mpls_echo_tlv_vendor;
186 static int hf_mpls_echo_tlv_ilso_addr_type;
187 static int hf_mpls_echo_tlv_ilso_mbz;
188 static int hf_mpls_echo_tlv_ilso_ipv4_addr;
189 static int hf_mpls_echo_tlv_ilso_ipv4_int_addr;
190 static int hf_mpls_echo_tlv_ilso_ipv6_addr;
191 static int hf_mpls_echo_tlv_ilso_ipv6_int_addr;
192 static int hf_mpls_echo_tlv_ilso_int_index;
193 static int hf_mpls_echo_tlv_ilso_label;
194 static int hf_mpls_echo_tlv_ilso_exp;
195 static int hf_mpls_echo_tlv_ilso_bos;
196 static int hf_mpls_echo_tlv_ilso_ttl;
197 #if 0
198 static int hf_mpls_echo_tlv_rto_ipv4;
199 static int hf_mpls_echo_tlv_rto_ipv6;
200 #endif
201 static int hf_mpls_echo_tlv_reply_tos;
202 static int hf_mpls_echo_tlv_reply_tos_mbz;
203 static int hf_mpls_echo_tlv_errored_type;
204 static int hf_mpls_echo_tlv_ds_map_ingress_if_num;
205 static int hf_mpls_echo_tlv_ds_map_egress_if_num;
206 static int hf_mpls_echo_lspping_tlv_src_gid;
207 static int hf_mpls_echo_lspping_tlv_src_nid;
208 static int hf_mpls_echo_lspping_tlv_src_tunnel_no;
209 static int hf_mpls_echo_lspping_tlv_lsp_no;
210 static int hf_mpls_echo_lspping_tlv_dst_gid;
211 static int hf_mpls_echo_lspping_tlv_dst_nid;
212 static int hf_mpls_echo_lspping_tlv_dst_tunnel_no;
213 static int hf_mpls_echo_lspping_tlv_resv;
214 static int hf_mpls_echo_lspping_tlv_src_addr_gid;
215 static int hf_mpls_echo_lspping_tlv_src_addr_nid;
216 static int hf_mpls_echo_lspping_tlv_pw_serv_identifier;
217 static int hf_mpls_echo_lspping_tlv_pw_src_ac_id;
218 static int hf_mpls_echo_lspping_tlv_pw_dst_ac_id;
219 static int hf_mpls_echo_padding;
220 /* static int hf_mpls_echo_lspping_tlv_pw_agi_type; */
221 /* static int hf_mpls_echo_lspping_tlv_pw_agi_len; */
222 /* static int hf_mpls_echo_lspping_tlv_pw_agi_val; */
223 static int hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv4_p2mp_id;
224 static int hf_mpls_echo_tlv_fec_rsvp_p2mp_ip_mbz1;
225 static int hf_mpls_echo_tlv_fec_rsvp_p2mp_ip_tunnel_id;
226 static int hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv4_ext_tunnel_id;
227 static int hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv4_ipv4_sender;
228 static int hf_mpls_echo_tlv_fec_rsvp_p2mp_ip_mbz2;
229 static int hf_mpls_echo_tlv_fec_rsvp_p2mp_ip_lsp_id;
230 static int hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv6_p2mp_id;
231 static int hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv6_ext_tunnel_id;
232 static int hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv6_ipv6_sender;
233 static int hf_mpls_echo_tlv_echo_jitter;
234 static int hf_mpls_echo_tlv_responder_indent_type;
235 static int hf_mpls_echo_tlv_responder_indent_len;
236 static int hf_mpls_echo_tlv_responder_indent_ipv4;
237 static int hf_mpls_echo_tlv_responder_indent_ipv6;
238 static int hf_mpls_echo_tlv_bfd;
240 static int ett_mpls_echo;
241 static int ett_mpls_echo_gflags;
242 static int ett_mpls_echo_tlv;
243 static int ett_mpls_echo_tlv_fec;
244 static int ett_mpls_echo_tlv_ds_map;
245 static int ett_mpls_echo_tlv_ilso;
246 static int ett_mpls_echo_tlv_dd_map;
247 static int ett_mpls_echo_tlv_ddstlv_map;
249 static expert_field ei_mpls_echo_tlv_fec_len;
250 static expert_field ei_mpls_echo_tlv_dd_map_subtlv_len;
251 static expert_field ei_mpls_echo_tlv_len;
252 static expert_field ei_mpls_echo_tlv_ds_map_muti_len;
253 static expert_field ei_mpls_echo_unknown_address_type;
254 static expert_field ei_mpls_echo_incorrect_address_type;
255 static expert_field ei_mpls_echo_malformed;
257 static const value_string mpls_echo_msgtype[] = {
258 {1, "MPLS Echo Request"},
259 {2, "MPLS Echo Reply"},
260 {3, "MPLS Data Plane Verification Request"},
261 {4, "MPLS Data Plane Verification Reply"},
262 {0, NULL}
265 static const value_string mpls_echo_replymode[] = {
266 {1, "Do not reply"},
267 {2, "Reply via an IPv4/IPv6 UDP packet"},
268 {3, "Reply via an IPv4/IPv6 UDP packet with Router Alert"},
269 {4, "Reply via application level control channel"},
270 {0, NULL}
273 /* http://www.iana.org/assignments/mpls-lsp-ping-parameters/mpls-lsp-ping-parameters.xml */
274 static const value_string mpls_echo_returncode[] = {
275 { 0, "No return code"},
276 { 1, "Malformed echo request received"},
277 { 2, "One or more of the TLVs was not understood"},
278 { 3, "Replying router is an egress for the FEC at stack depth RSC"},
279 { 4, "Replying router has no mapping for the FEC at stack depth RSC"},
280 { 5, "Downstream Mapping Mismatch"}, /*[RFC4379] */
281 { 6, "Upstream Interface Index Unknown"}, /*[RFC4379]*/
282 { 7, "Reserved"},
283 { 8, "Label switched at stack-depth RSC"},
284 { 9, "Label switched but no MPLS forwarding at stack-depth RSC"},
285 {10, "Mapping for this FEC is not the given label at stack depth RSC"},
286 {11, "No label entry at stack-depth RSC"},
287 {12, "Protocol not associated with interface at FEC stack depth RSC"},
288 {13, "Premature termination, label stack shrinking to a single label"},
289 {14, "See DDM TLV for meaning of Return Code and Return SubCode"}, /* [RFC6424] */
290 {15, "Label switched with FEC change"}, /* [RFC6424] */
291 /* 16-251 Unassigned */
292 /* 252-255 Reserved for Vendor private use [RFC4379 */
293 {0, NULL}
295 static value_string_ext mpls_echo_returncode_ext = VALUE_STRING_EXT_INIT(mpls_echo_returncode);
297 #define TLV_TARGET_FEC_STACK 0x0001
298 #define TLV_DOWNSTREAM_MAPPING 0x0002
299 #define TLV_PAD 0x0003
300 #define TLV_ERROR_CODE 0x0004
301 #define TLV_VENDOR_CODE 0x0005
302 #define TLV_TBD 0x0006
303 #define TLV_ILSO_IPv4 0x0007
304 #define TLV_ILSO_IPv6 0x0008
305 #define TLV_ERRORED_TLV 0x0009
306 #define TLV_REPLY_TOS 0x000A
307 #if 0
308 #define TLV_RTO_IPv4 0x000B
309 #define TLV_RTO_IPv6 0x000C
310 #endif
311 #define TLV_P2MP_RESPONDER_IDENT 0x000B
312 #define TLV_P2MP_ECHO_JITTER 0x000C
313 /* As per RFC 6426 https://tools.ietf.org/html/rfc6426 Section: 2.2.1 */
314 #define TLV_SRC_IDENTIFIER 0x000D
315 #define TLV_DST_IDENTIFIER 0x000E
316 /* As per RFC 5884 https://tools.ietf.org/html/rfc5884 Section: 6.1 */
317 #define TLV_BFD_DISCRIMINATOR 0x000F
318 /* As per RFC 6426 https://tools.ietf.org/html/rfc6426 Section: 7.3 */
319 #define TLV_REVERSE_PATH_FEC_STACK 0x0010
320 #define TLV_DETAILED_DOWNSTREAM 0x0014 /* [RFC6424] */
321 #define TLV_VENDOR_PRIVATE_START 0xFC00
322 #define TLV_VENDOR_PRIVATE_END 0xFFFF
324 /* MPLS Echo TLV Type names */
325 static const value_string mpls_echo_tlv_type_names[] = {
326 { TLV_TARGET_FEC_STACK, "Target FEC Stack" },
327 { TLV_DOWNSTREAM_MAPPING, "Downstream Mapping" },
328 { TLV_PAD, "Pad" },
329 { TLV_ERROR_CODE, "Error Code" },
330 { TLV_VENDOR_CODE, "Vendor Enterprise Code" },
331 { TLV_TBD, "TDB" },
332 { TLV_ILSO_IPv4, "IPv4 Interface and Label Stack Object" },
333 { TLV_ILSO_IPv6, "IPv6 Interface and Label Stack Object" },
334 { TLV_ERRORED_TLV, "Errored TLVs" },
335 { TLV_REPLY_TOS, "Reply TOS Byte" },
336 #if 0
337 { TLV_RTO_IPv4, "IPv4 Reply-to Object" },
338 { TLV_RTO_IPv6, "IPv6 Reply-to Object" },
339 #endif
340 { TLV_P2MP_RESPONDER_IDENT, "P2MP Responder Identifier" },
341 { TLV_P2MP_ECHO_JITTER, "P2MP Echo Jitter" },
342 { TLV_SRC_IDENTIFIER, "Source Identifier TLV" },
343 { TLV_DST_IDENTIFIER, "Destination Identifier TLV" },
344 { TLV_BFD_DISCRIMINATOR, "BFD Discriminator TLV" },
345 { TLV_REVERSE_PATH_FEC_STACK, "Reverse-path Target FEC Stack" },
346 { TLV_DETAILED_DOWNSTREAM, "Detailed Downstream Mapping"},
347 { TLV_VENDOR_PRIVATE_START, "Vendor Private" },
348 { 0, NULL}
350 static value_string_ext mpls_echo_tlv_type_names_ext = VALUE_STRING_EXT_INIT(mpls_echo_tlv_type_names);
352 /*As per RFC 4379, https://tools.ietf.org/html/rfc4379 Section: 3.2 */
353 #define TLV_FEC_STACK_LDP_IPv4 1
354 #define TLV_FEC_STACK_LDP_IPv6 2
355 #define TLV_FEC_STACK_RSVP_IPv4 3
356 #define TLV_FEC_STACK_RSVP_IPv6 4
357 #define TLV_FEC_STACK_RES 5
358 #define TLV_FEC_STACK_VPN_IPv4 6
359 #define TLV_FEC_STACK_VPN_IPv6 7
360 #define TLV_FEC_STACK_L2_VPN 8
361 #define TLV_FEC_STACK_L2_CID_OLD 9
362 #define TLV_FEC_STACK_L2_CID_NEW 10
363 #define TLV_FEC_STACK_L2_FEC_129 11
364 #define TLV_FEC_STACK_BGP_LAB_v4 12
365 #define TLV_FEC_STACK_BGP_LAB_v6 13
366 #define TLV_FEC_STACK_GEN_IPv4 14
367 #define TLV_FEC_STACK_GEN_IPv6 15
368 #define TLV_FEC_STACK_NIL 16
369 /*As per RFC 6425, https://tools.ietf.org/html/rfc6425 Section: 3.1 */
370 #define TLV_FEC_STACK_P2MP_IPv4 17
371 #define TLV_FEC_STACK_P2MP_IPv6 18
372 /*As per RFC 6426, https://tools.ietf.org/html/rfc6426 Section: 2.3 */
373 #define TLV_FEC_STACK_STATIC_LSP 22
374 #define TLV_FEC_STACK_STATIC_PW 23
375 /*As per RFC 8029, https://tools.ietf.org/html/rfc8029 Section 3.2 */
376 #define TLV_FEC_STACK_PW_IPv6_FEC_128 24
377 #define TLV_FEC_STACK_PW_IPv6_FEC_129 25
378 #define TLV_FEC_VENDOR_PRIVATE_START 0xFC00
379 #define TLV_FEC_VENDOR_PRIVATE_END 0xFFFF
380 /*As per RFC 8287, https://tools.ietf.org/html/rfc8287 Section: 9.1 */
381 #define TLV_FEC_STACK_SR_IGP_IPv4 34
382 #define TLV_FEC_STACK_SR_IGP_IPv6 35
383 #define TLV_FEC_STACK_SR_IGP_ADJ 36
385 /* FEC sub-TLV Type names */
386 static const value_string mpls_echo_tlv_fec_names[] = {
387 { TLV_FEC_STACK_LDP_IPv4, "LDP IPv4 prefix"},
388 { TLV_FEC_STACK_LDP_IPv6, "LDP IPv6 prefix"},
389 { TLV_FEC_STACK_RSVP_IPv4, "RSVP IPv4 Session Query"},
390 { TLV_FEC_STACK_RSVP_IPv6, "RSVP IPv6 Session Query"},
391 { TLV_FEC_STACK_RES, "Reserved"},
392 { TLV_FEC_STACK_VPN_IPv4, "VPN IPv4 prefix"},
393 { TLV_FEC_STACK_VPN_IPv6, "VPN IPv6 prefix"},
394 { TLV_FEC_STACK_L2_VPN, "L2 VPN endpoint"},
395 { TLV_FEC_STACK_L2_CID_OLD, "FEC 128 Pseudowire - IPv4 (Deprecated)"},
396 { TLV_FEC_STACK_L2_CID_NEW, "FEC 128 Pseudowire - IPv4"},
397 { TLV_FEC_STACK_L2_FEC_129, "FEC 129 Pseudowire - IPv4"},
398 { TLV_FEC_STACK_BGP_LAB_v4, "BGP labeled IPv4 prefix"},
399 { TLV_FEC_STACK_BGP_LAB_v6, "BGP labeled IPv6 prefix"},
400 { TLV_FEC_STACK_GEN_IPv4, "Generic IPv4 prefix"},
401 { TLV_FEC_STACK_GEN_IPv6, "Generic IPv6 prefix"},
402 { TLV_FEC_STACK_NIL, "Nil FEC"},
403 { TLV_FEC_STACK_P2MP_IPv4, "RSVP P2MP IPv4 Session Query"},
404 { TLV_FEC_STACK_P2MP_IPv6, "RSVP P2MP IPv6 Session Query"},
405 { TLV_FEC_STACK_STATIC_LSP, "Static LSP"},
406 { TLV_FEC_STACK_STATIC_PW, "Static Pseudowire"},
407 { TLV_FEC_STACK_PW_IPv6_FEC_128,"FEC 128 Pseudowire - IPv6"},
408 { TLV_FEC_STACK_PW_IPv6_FEC_129,"FEC 129 Pseudowire - IPv6"},
409 { TLV_FEC_STACK_SR_IGP_IPv4, "IPv4 IGP-Prefix Segment ID"},
410 { TLV_FEC_STACK_SR_IGP_IPv6, "IPv6 IGP-Prefix Segment ID"},
411 { TLV_FEC_STACK_SR_IGP_ADJ, "IGP-Adjacency Segment ID"},
412 { TLV_FEC_VENDOR_PRIVATE_START, "Vendor Private"},
413 { 0, NULL}
415 static value_string_ext mpls_echo_tlv_fec_names_ext = VALUE_STRING_EXT_INIT(mpls_echo_tlv_fec_names);
417 /* [RFC 6424] */
418 #define TLV_FEC_MULTIPATH_DATA 1
419 #define TLV_FEC_LABEL_STACK 2
420 #define TLV_FEC_STACK_CHANGE 3
422 #if 0
423 static const value_string mpls_echo_subtlv_names[] = {
424 { TLV_FEC_MULTIPATH_DATA, "Multipath data"},
425 { TLV_FEC_LABEL_STACK, "Label stack"},
426 { TLV_FEC_STACK_CHANGE, "FEC stack change"},
427 { 0, NULL}
429 #endif
431 /* [RFC 6424] */
432 #define TLV_MULTIPATH_NO_MULTIPATH 0
433 #define TLV_MULTIPATH_IP_ADDRESS 2
434 #define TLV_MULTIPATH_IP_ADDRESS_RANGE 4
435 #define TLV_MULTIPATH_BIT_MASKED_IP 8
436 #define TLV_MULTIPATH_BIT_MASKED_LABEL_SET 9
438 #if 0
439 static const value_string mpls_echo_multipathtlv_type[] = {
440 { TLV_MULTIPATH_NO_MULTIPATH, "Empty (Multipath Length = 0)"},
441 { TLV_MULTIPATH_IP_ADDRESS, "IP addresses"},
442 { TLV_MULTIPATH_IP_ADDRESS_RANGE, "low/high address pairs"},
443 { TLV_MULTIPATH_BIT_MASKED_IP, "IP address prefix and bit mask"},
444 { TLV_MULTIPATH_BIT_MASKED_LABEL_SET, "Label prefix and bit mask"},
445 { 0, NULL}
447 #endif
449 /* [RFC 6424] */
450 #define SUB_TLV_FEC_PUSH 1
451 #define SUB_TLV_FEC_POP 2
453 static const value_string mpls_echo_subtlv_op_types[] = {
454 { SUB_TLV_FEC_PUSH, "Push"},
455 { SUB_TLV_FEC_POP, "Pop"},
456 { 0, NULL}
459 /* [RFC 6424] */
460 #define SUB_TLV_FEC_UNSPECIFIED 0
461 #define SUB_TLV_FEC_IPV4 1
462 #define SUB_TLV_FEC_IPV6 2
464 static const value_string mpls_echo_subtlv_addr_types[] = {
465 { SUB_TLV_FEC_UNSPECIFIED, "Unspecified"},
466 { SUB_TLV_FEC_IPV4, "IPv4"},
467 { SUB_TLV_FEC_IPV6, "IPv6"},
468 { 0, NULL}
471 /* [RFC 8287] */
472 #define SUB_TLV_FEC_SR_PROTO_ANY 0
473 #define SUB_TLV_FEC_SR_PROTO_OSPF 1
474 #define SUB_TLV_FEC_SR_PROTO_ISIS 2
476 static const value_string mpls_echo_subtlv_sr_protocol_types[] = {
477 { SUB_TLV_FEC_SR_PROTO_ANY, "Any IGP protocol"},
478 { SUB_TLV_FEC_SR_PROTO_OSPF, "OSPF"},
479 { SUB_TLV_FEC_SR_PROTO_ISIS, "IS-IS"},
480 { 0, NULL}
483 /* [RFC 8287] */
484 #define SUB_TLV_FEC_SR_IGP_ADJ_UNNUMBERED 0
485 #define SUB_TLV_FEC_SR_IGP_ADJ_PARALLEL 1
486 #define SUB_TLV_FEC_SR_IGP_ADJ_IPv4 4
487 #define SUB_TLV_FEC_SR_IGP_ADJ_IPv6 6
489 static const value_string mpls_echo_subtlv_igp_adjacency_types[] = {
490 { SUB_TLV_FEC_SR_IGP_ADJ_UNNUMBERED, "Unnumbered Interface Adjacency"},
491 { SUB_TLV_FEC_SR_IGP_ADJ_PARALLEL, "Parallel Adjacency"},
492 { SUB_TLV_FEC_SR_IGP_ADJ_IPv4, "IPv4, Non-parallel Adjacency"},
493 { SUB_TLV_FEC_SR_IGP_ADJ_IPv6, "IPv6, Non-parallel Adjacency"},
494 { 0, NULL}
497 static const value_string mpls_echo_tlv_pad[] = {
498 { 1, "Drop Pad TLV from reply" },
499 { 2, "Copy Pad TLV to reply" },
500 { 0, NULL}
503 /* [RFC 6425] */
504 #define TLV_P2MP_RESPONDER_IDENT_IPV4_EGRESS_ADDR 1
505 #define TLV_P2MP_RESPONDER_IDENT_IPV6_EGRESS_ADDR 2
506 #define TLV_P2MP_RESPONDER_IDENT_IPV4_NODE_ADDR 3
507 #define TLV_P2MP_RESPONDER_IDENT_IPV6_NODE_ADDR 4
508 static const value_string mpls_echo_tlv_responder_ident_sub_tlv_type[] = {
509 { TLV_P2MP_RESPONDER_IDENT_IPV4_EGRESS_ADDR, "IPv4 Egress Address P2MP Responder Identifier"},
510 { TLV_P2MP_RESPONDER_IDENT_IPV6_EGRESS_ADDR, "IPv6 Egress Address P2MP Responder Identifier"},
511 { TLV_P2MP_RESPONDER_IDENT_IPV4_NODE_ADDR, "IPv4 Node Address P2MP Responder Identifier"},
512 { TLV_P2MP_RESPONDER_IDENT_IPV6_NODE_ADDR, "IPv6 Node Address P2MP Responder Identifier"},
513 {0, NULL}
516 #define TLV_ADDR_IPv4 1
517 #define TLV_ADDR_UNNUM_IPv4 2
518 #define TLV_ADDR_IPv6 3
519 #define TLV_ADDR_UNNUM_IPv6 4
520 /* As per RFC 6426, https://tools.ietf.org/html/rfc6426 Section: 2.1 */
521 #define TLV_ADDR_NONIP 5
523 static const value_string mpls_echo_tlv_addr_type[] = {
524 {TLV_ADDR_IPv4, "IPv4 Numbered"},
525 {TLV_ADDR_UNNUM_IPv4, "IPv4 Unnumbered"},
526 {TLV_ADDR_IPv6, "IPv6 Numbered"},
527 {TLV_ADDR_UNNUM_IPv6, "IPv6 Unnumbered"},
528 {TLV_ADDR_NONIP, "Non IP"},
529 {0, NULL}
532 #define TLV_DS_MAP_HASH_NO_MP 0
533 #define TLV_DS_MAP_HASH_LABEL 1
534 #define TLV_DS_MAP_HASH_IP 2
535 #define TLV_DS_MAP_HASH_LABEL_RANGE 3
536 #define TLV_DS_MAP_HASH_IP_RANGE 4
537 #define TLV_DS_MAP_HASH_NO_LABEL 5
538 #define TLV_DS_MAP_HASH_ALL_IP 6
539 #define TLV_DS_MAP_HASH_NO_MATCH 7
540 #define TLV_DS_MAP_HASH_BITMASK_IP 8
541 #define TLV_DS_MAP_HASH_BITMASK_LABEL 9
543 static const value_string mpls_echo_tlv_ds_map_hash_type[] = {
544 {TLV_DS_MAP_HASH_NO_MP, "no multipath"},
545 {TLV_DS_MAP_HASH_LABEL, "label"},
546 {TLV_DS_MAP_HASH_IP, "IP address"},
547 {TLV_DS_MAP_HASH_LABEL_RANGE, "label range"},
548 {TLV_DS_MAP_HASH_IP_RANGE, "IP address range"},
549 {TLV_DS_MAP_HASH_NO_LABEL, "no more labels"},
550 {TLV_DS_MAP_HASH_ALL_IP, "All IP addresses"},
551 {TLV_DS_MAP_HASH_NO_MATCH, "no match"},
552 {TLV_DS_MAP_HASH_BITMASK_IP, "Bit-masked IPv4 address set"},
553 {TLV_DS_MAP_HASH_BITMASK_LABEL, "Bit-masked label set"},
554 {0, NULL}
556 static value_string_ext mpls_echo_tlv_ds_map_hash_type_ext = VALUE_STRING_EXT_INIT(mpls_echo_tlv_ds_map_hash_type);
558 static const value_string mpls_echo_tlv_ds_map_mp_proto[] = {
559 {0, "Unknown"},
560 {1, "Static"},
561 {2, "BGP"},
562 {3, "LDP"},
563 {4, "RSVP-TE"},
564 {5, "OSPF"},
565 {6, "IS-IS"},
566 {0, NULL}
570 * Dissector for FEC sub-TLVs
572 static void
573 dissect_mpls_echo_tlv_fec(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
575 proto_tree *ti, *tlv_fec_tree;
576 uint16_t idx = 1, nil_idx = 1, type, saved_type;
577 int length, nil_length, pad;
578 uint32_t label, adj_offset, adj_type, adj_proto;
579 uint8_t exp, bos, ttl;
581 while (rem >= 4) { /* Type, Length */
582 type = tvb_get_ntohs(tvb, offset);
583 saved_type = type;
584 /* Check for Vendor Private sub-TLVs */
585 if (type >= TLV_FEC_VENDOR_PRIVATE_START) /* && <= TLV_FEC_VENDOR_PRIVATE_END always true */
586 type = TLV_FEC_VENDOR_PRIVATE_START;
588 length = tvb_get_ntohs(tvb, offset + 2);
590 ti = NULL;
591 tlv_fec_tree = NULL;
593 if (tree) {
594 tlv_fec_tree = proto_tree_add_subtree_format(tree, tvb, offset, length + (4-(length%4)),
595 ett_mpls_echo_tlv_fec, NULL, "FEC Element %u: %s",
596 idx, val_to_str_ext(type, &mpls_echo_tlv_fec_names_ext,
597 "Unknown FEC type (0x%04X)"));
599 /* FEC sub-TLV Type and Length */
600 proto_tree_add_uint_format_value(tlv_fec_tree, hf_mpls_echo_tlv_fec_type, tvb,
601 offset, 2, saved_type, "%s (%u)",
602 val_to_str_ext_const(type, &mpls_echo_tlv_fec_names_ext,
603 "Unknown sub-TLV type"), saved_type);
605 ti = proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_len, tvb, offset + 2,
606 2, ENC_BIG_ENDIAN);
609 if (length + 4 > rem) {
610 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_fec_len,
611 "Invalid FEC Sub-TLV Length (claimed %u, found %u)",
612 length, rem - 4);
613 return;
616 /* FEC sub-TLV Value */
617 switch (type) {
618 case TLV_FEC_STACK_LDP_IPv4:
619 if (tree) {
620 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_ldp_ipv4,
621 tvb, offset + 4, 4, ENC_BIG_ENDIAN);
622 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_ldp_ipv4_mask,
623 tvb, offset + 8, 1, ENC_BIG_ENDIAN);
625 break;
626 case TLV_FEC_STACK_LDP_IPv6:
627 if (tree) {
628 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_ldp_ipv6,
629 tvb, offset + 4, 16, ENC_NA);
630 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_ldp_ipv6_mask,
631 tvb, offset + 20, 1, ENC_BIG_ENDIAN);
633 break;
634 case TLV_FEC_STACK_RSVP_IPv4:
635 if (length != 20) {
636 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_fec_len,
637 "Invalid FEC Sub-TLV Length "
638 "(claimed %u, should be %u)",
639 length, 20);
640 return;
642 if (tree) {
643 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ipv4_ipv4_endpoint,
644 tvb, offset + 4, 4, ENC_BIG_ENDIAN);
645 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ip_mbz1,
646 tvb, offset + 8, 2, ENC_BIG_ENDIAN);
647 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ip_tunnel_id,
648 tvb, offset + 10, 2, ENC_BIG_ENDIAN);
649 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ipv4_ext_tunnel_id,
650 tvb, offset + 12, 4, ENC_BIG_ENDIAN);
651 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ipv4_ipv4_sender,
652 tvb, offset + 16, 4, ENC_BIG_ENDIAN);
653 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ip_mbz2,
654 tvb, offset + 20, 2, ENC_BIG_ENDIAN);
655 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ip_lsp_id,
656 tvb, offset + 22, 2, ENC_BIG_ENDIAN);
658 break;
659 case TLV_FEC_STACK_RSVP_IPv6:
660 if (length != 56) {
661 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_fec_len,
662 "Invalid FEC Sub-TLV Length "
663 "(claimed %u, should be %u)",
664 length, 56);
665 return;
667 if (tree) {
668 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ipv6_ipv6_endpoint,
669 tvb, offset + 4, 16, ENC_NA);
670 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ip_mbz1,
671 tvb, offset + 20, 2, ENC_BIG_ENDIAN);
672 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ip_tunnel_id,
673 tvb, offset + 22, 2, ENC_BIG_ENDIAN);
674 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ipv6_ext_tunnel_id,
675 tvb, offset + 24, 16, ENC_NA);
676 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ipv6_ipv6_sender,
677 tvb, offset + 40, 16, ENC_NA);
678 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ip_mbz2,
679 tvb, offset + 56, 2, ENC_BIG_ENDIAN);
680 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ip_lsp_id,
681 tvb, offset + 58, 2, ENC_BIG_ENDIAN);
683 break;
684 case TLV_FEC_STACK_VPN_IPv4:
685 if (tree) {
686 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_vpn_route_dist,
687 tvb, offset + 4, 8, ENC_NA);
688 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_vpn_ipv4,
689 tvb, offset + 12, 4, ENC_BIG_ENDIAN);
690 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_vpn_len,
691 tvb, offset + 16, 1, ENC_BIG_ENDIAN);
693 break;
694 case TLV_FEC_STACK_VPN_IPv6:
695 if (tree) {
696 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_vpn_route_dist,
697 tvb, offset + 4, 8, ENC_NA);
698 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_vpn_ipv6,
699 tvb, offset + 12, 16, ENC_NA);
700 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_vpn_len,
701 tvb, offset + 28, 1, ENC_BIG_ENDIAN);
703 break;
704 case TLV_FEC_STACK_L2_VPN:
705 if (tree) {
706 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_l2_vpn_route_dist,
707 tvb, offset + 4, 8, ENC_NA);
708 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_l2_vpn_send_ve_id,
709 tvb, offset + 12, 2, ENC_BIG_ENDIAN);
710 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_l2_vpn_recv_ve_id,
711 tvb, offset + 14, 2, ENC_BIG_ENDIAN);
712 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_l2_vpn_encap_type,
713 tvb, offset + 16, 2, ENC_BIG_ENDIAN);
715 break;
716 case TLV_FEC_STACK_L2_CID_OLD:
717 if (tree) {
718 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_l2cid_remote,
719 tvb, offset + 4, 4, ENC_BIG_ENDIAN);
720 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_l2cid_vcid,
721 tvb, offset + 8, 4, ENC_BIG_ENDIAN);
722 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_l2cid_encap,
723 tvb, offset + 12, 2, ENC_BIG_ENDIAN);
724 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_l2cid_mbz,
725 tvb, offset + 14, 2, ENC_BIG_ENDIAN);
727 break;
728 case TLV_FEC_STACK_L2_CID_NEW:
729 if (length < 14) {
730 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_fec_len,
731 "Invalid FEC Sub-TLV Length "
732 "(claimed %u, should be %u)",
733 length, 14);
734 return;
736 if (tree) {
737 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_l2cid_sender,
738 tvb, offset + 4, 4, ENC_BIG_ENDIAN);
739 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_l2cid_remote,
740 tvb, offset + 8, 4, ENC_BIG_ENDIAN);
741 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_l2cid_vcid,
742 tvb, offset + 12, 4, ENC_BIG_ENDIAN);
743 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_l2cid_encap,
744 tvb, offset + 16, 2, ENC_BIG_ENDIAN);
745 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_l2cid_mbz,
746 tvb, offset + 18, 2, ENC_BIG_ENDIAN);
748 break;
749 case TLV_FEC_VENDOR_PRIVATE_START:
750 if (length < 4) { /* SMI Enterprise code */
751 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_fec_len,
752 "Invalid FEC Sub-TLV Length "
753 "(claimed %u, should be >= %u)",
754 length, 4);
755 } else {
756 if (tree) {
757 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_vendor, tvb,
758 offset + 4, 4, ENC_BIG_ENDIAN);
759 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_value, tvb,
760 offset + 8, length - 4, ENC_NA);
763 break;
764 case TLV_FEC_STACK_BGP_LAB_v4:
765 if (tree) {
766 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_bgp_ipv4,
767 tvb, offset + 4, 4, ENC_BIG_ENDIAN);
768 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_bgp_len,
769 tvb, offset + 8, 1, ENC_BIG_ENDIAN);
771 break;
772 case TLV_FEC_STACK_BGP_LAB_v6:
773 if (tree) {
774 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_bgp_ipv6,
775 tvb, offset + 4, 16, ENC_NA);
776 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_bgp_len,
777 tvb, offset + 20, 1, ENC_BIG_ENDIAN);
779 break;
780 case TLV_FEC_STACK_GEN_IPv4:
781 if (tree) {
782 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_gen_ipv4,
783 tvb, offset + 4, 4, ENC_BIG_ENDIAN);
784 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_gen_ipv4_mask,
785 tvb, offset + 8, 1, ENC_BIG_ENDIAN);
787 break;
788 case TLV_FEC_STACK_GEN_IPv6:
789 if (tree) {
790 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_gen_ipv6,
791 tvb, offset + 4, 16, ENC_NA);
792 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_gen_ipv6_mask,
793 tvb, offset + 20, 1, ENC_BIG_ENDIAN);
795 break;
796 case TLV_FEC_STACK_PW_IPv6_FEC_128:
797 if (length != 38) {
798 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_fec_len,
799 "Invalid FEC Sub-TLV Length "
800 "(claimed %u, should be %u)",
801 length, 38);
802 return;
804 if (tree) {
805 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_pw_ipv6_128_sender,
806 tvb, offset + 4, 16, ENC_NA);
807 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_pw_ipv6_128_remote,
808 tvb, offset + 20, 16, ENC_NA);
809 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_pw_ipv6_128_pw_id,
810 tvb, offset + 36, 2, ENC_BIG_ENDIAN);
811 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_pw_ipv6_128_pw_type,
812 tvb, offset + 38, 2, ENC_BIG_ENDIAN);
813 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_pw_ipv6_128_mbz,
814 tvb, offset + 40, 2, ENC_BIG_ENDIAN);
816 break;
817 case TLV_FEC_STACK_NIL:
818 nil_length = length;
819 while (nil_length >= 4) {
820 decode_mpls_label(tvb, offset + 4, &label, &exp, &bos, &ttl);
821 if (label <= MPLS_LABEL_MAX_RESERVED) {
822 proto_tree_add_uint_format(tlv_fec_tree, hf_mpls_echo_tlv_fec_nil_label,
823 tvb, offset + 4, 3, label, "Label %u: %u (%s)", nil_idx, label,
824 val_to_str_const(label, special_labels, "Reserved - Unknown"));
825 } else {
826 proto_tree_add_uint_format(tlv_fec_tree, hf_mpls_echo_tlv_fec_nil_label,
827 tvb, offset + 4, 3, label, "Label %u: %u", nil_idx, label);
829 nil_length -= 4;
830 offset += 4;
831 nil_idx++;
833 break;
834 case TLV_FEC_STACK_P2MP_IPv4:
835 if (length != 20) {
836 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_fec_len,
837 "Invalid FEC Sub-TLV Length "
838 "(claimed %u, should be %u)",
839 length, 20);
840 return;
842 if (tree) {
843 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv4_p2mp_id,
844 tvb, offset + 4, 4, ENC_BIG_ENDIAN);
845 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_p2mp_ip_mbz1,
846 tvb, offset + 8, 2, ENC_BIG_ENDIAN);
847 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_p2mp_ip_tunnel_id,
848 tvb, offset + 10, 2, ENC_BIG_ENDIAN);
849 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv4_ext_tunnel_id,
850 tvb, offset + 12, 4, ENC_BIG_ENDIAN);
851 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv4_ipv4_sender,
852 tvb, offset + 16, 4, ENC_BIG_ENDIAN);
853 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_p2mp_ip_mbz2,
854 tvb, offset + 20, 2, ENC_BIG_ENDIAN);
855 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_p2mp_ip_lsp_id,
856 tvb, offset + 22, 2, ENC_BIG_ENDIAN);
858 break;
860 case TLV_FEC_STACK_P2MP_IPv6:
861 if (length != 56) {
862 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_fec_len,
863 "Invalid FEC Sub-TLV Length "
864 "(claimed %u, should be %u)",
865 length, 56);
866 return;
868 if (tree) {
869 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv6_p2mp_id,
870 tvb, offset + 4, 16, ENC_NA);
871 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_p2mp_ip_mbz1,
872 tvb, offset + 20, 2, ENC_BIG_ENDIAN);
873 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_p2mp_ip_tunnel_id,
874 tvb, offset + 22, 2, ENC_BIG_ENDIAN);
875 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv6_ext_tunnel_id,
876 tvb, offset + 24, 16, ENC_NA);
877 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv6_ipv6_sender,
878 tvb, offset + 40, 16, ENC_NA);
879 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ip_mbz2,
880 tvb, offset + 56, 2, ENC_BIG_ENDIAN);
881 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_p2mp_ip_lsp_id,
882 tvb, offset + 58, 2, ENC_BIG_ENDIAN);
884 break;
885 case TLV_FEC_STACK_STATIC_LSP:
886 if (tree) {
887 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_lspping_tlv_src_gid,
888 tvb, (offset + 4), 4, ENC_BIG_ENDIAN);
889 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_lspping_tlv_src_nid,
890 tvb, (offset + 8), 4, ENC_BIG_ENDIAN);
891 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_lspping_tlv_src_tunnel_no,
892 tvb, (offset + 12), 2, ENC_BIG_ENDIAN);
893 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_lspping_tlv_lsp_no,
894 tvb, (offset + 14), 2, ENC_BIG_ENDIAN);
895 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_lspping_tlv_dst_gid,
896 tvb, (offset + 16), 4, ENC_BIG_ENDIAN);
897 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_lspping_tlv_dst_nid,
898 tvb, (offset + 20), 4, ENC_BIG_ENDIAN);
899 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_lspping_tlv_dst_tunnel_no,
900 tvb, (offset + 24), 2, ENC_BIG_ENDIAN);
901 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_lspping_tlv_resv,
902 tvb, (offset + 26), 2, ENC_BIG_ENDIAN);
904 break;
905 case TLV_FEC_STACK_STATIC_PW:
906 if (tree) {
907 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_lspping_tlv_pw_serv_identifier,
908 tvb, (offset + 4), 8, ENC_BIG_ENDIAN);
909 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_lspping_tlv_src_gid,
910 tvb, (offset + 12), 4, ENC_BIG_ENDIAN);
911 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_lspping_tlv_src_nid,
912 tvb, (offset + 16), 4, ENC_BIG_ENDIAN);
913 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_lspping_tlv_pw_src_ac_id,
914 tvb, (offset + 20), 4, ENC_BIG_ENDIAN);
915 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_lspping_tlv_dst_gid,
916 tvb, (offset + 24), 4, ENC_BIG_ENDIAN);
917 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_lspping_tlv_dst_nid,
918 tvb, (offset + 28), 4, ENC_BIG_ENDIAN);
919 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_lspping_tlv_pw_dst_ac_id,
920 tvb, (offset + 32), 4, ENC_BIG_ENDIAN);
922 break;
923 case TLV_FEC_STACK_SR_IGP_IPv4:
924 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_ipv4,
925 tvb, offset + 4, 4, ENC_NA);
926 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_mask,
927 tvb, offset + 8, 1, ENC_BIG_ENDIAN);
928 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_protocol,
929 tvb, offset + 9, 1, ENC_BIG_ENDIAN);
930 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_reserved,
931 tvb, offset + 10, 2, ENC_NA);
932 break;
933 case TLV_FEC_STACK_SR_IGP_IPv6:
934 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_ipv6,
935 tvb, offset + 4, 16, ENC_NA);
936 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_mask,
937 tvb, offset + 20, 1, ENC_BIG_ENDIAN);
938 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_protocol,
939 tvb, offset + 21, 1, ENC_BIG_ENDIAN);
940 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_reserved,
941 tvb, offset + 22, 2, ENC_NA);
942 break;
943 case TLV_FEC_STACK_SR_IGP_ADJ:
944 adj_offset = offset +4;
945 proto_tree_add_item_ret_uint(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_adj_type,
946 tvb, adj_offset, 1, ENC_BIG_ENDIAN, &adj_type);
947 adj_offset += 1;
948 proto_tree_add_item_ret_uint(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_protocol,
949 tvb, adj_offset, 1, ENC_BIG_ENDIAN, &adj_proto);
950 adj_offset += 1;
951 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_reserved,
952 tvb, adj_offset, 2, ENC_NA);
953 adj_offset += 2;
954 switch(adj_type) {
955 case SUB_TLV_FEC_SR_IGP_ADJ_IPv4:
956 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_adj_local_ipv4,
957 tvb, adj_offset, 4, ENC_NA);
958 adj_offset += 4;
959 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_adj_remote_ipv4,
960 tvb, adj_offset, 4, ENC_NA);
961 adj_offset += 4;
962 break;
963 case SUB_TLV_FEC_SR_IGP_ADJ_IPv6:
964 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_adj_local_ipv6,
965 tvb, adj_offset, 16, ENC_NA);
966 adj_offset += 16;
967 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_adj_remote_ipv6,
968 tvb, adj_offset, 16, ENC_NA);
969 adj_offset += 16;
970 break;
971 case SUB_TLV_FEC_SR_IGP_ADJ_UNNUMBERED:
972 case SUB_TLV_FEC_SR_IGP_ADJ_PARALLEL:
973 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_adj_local_ident,
974 tvb, adj_offset, 4, ENC_NA);
975 adj_offset += 4;
976 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_adj_remote_ident,
977 tvb, adj_offset, 4, ENC_NA);
978 adj_offset += 4;
979 break;
981 switch(adj_proto) {
982 case SUB_TLV_FEC_SR_PROTO_OSPF:
983 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_adj_adv_ident_ospf,
984 tvb, adj_offset, 4, ENC_NA);
985 adj_offset += 4;
986 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_adj_rec_ident_ospf,
987 tvb, adj_offset, 4, ENC_NA);
988 break;
989 case SUB_TLV_FEC_SR_PROTO_ISIS:
990 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_adj_adv_ident_isis,
991 tvb, adj_offset, 6, ENC_NA);
992 adj_offset += 6;
993 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_adj_rec_ident_isis,
994 tvb, adj_offset, 6, ENC_NA);
995 break;
996 case SUB_TLV_FEC_SR_PROTO_ANY:
997 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_adj_adv_ident,
998 tvb, adj_offset, 4, ENC_NA);
999 adj_offset += 4;
1000 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_igp_adj_rec_ident,
1001 tvb, adj_offset, 4, ENC_NA);
1002 break;
1004 break;
1005 case TLV_FEC_STACK_RES:
1006 default:
1007 if (length)
1008 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_value,
1009 tvb, offset + 4, length, ENC_NA);
1010 break;
1014 * Check for padding based on sub-TLV length alignment;
1015 * FEC sub-TLVs is zero-padded to align to four-octet boundary.
1017 if (length % 4) {
1018 pad = 4 - (length % 4);
1019 if (length + 4 + pad > rem) {
1020 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_fec_len,
1021 "Invalid FEC Sub-TLV Padded Length (claimed %u, found %u)",
1022 length + pad, rem - 4);
1023 return;
1024 } else {
1025 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_padding, tvb, offset + 4 + length, pad, ENC_NA);
1027 length += pad;
1030 rem -= 4 + length;
1031 offset += 4 + length;
1032 idx++;
1038 * Dissector for Downstream Mapping TLV
1040 static void
1041 dissect_mpls_echo_tlv_ds_map(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
1043 proto_tree *ti, *tlv_ds_map_tree;
1044 proto_tree *addr_ti;
1045 uint16_t mplen, idx = 1;
1046 uint32_t label;
1047 uint8_t exp, bos, proto;
1048 uint8_t hash_type, addr_type;
1050 proto_tree_add_item(tree, hf_mpls_echo_tlv_ds_map_mtu, tvb,
1051 offset, 2, ENC_BIG_ENDIAN);
1052 addr_ti = proto_tree_add_item(tree, hf_mpls_echo_tlv_ds_map_addr_type, tvb,
1053 offset + 2, 1, ENC_BIG_ENDIAN);
1054 ti = proto_tree_add_item(tree, hf_mpls_echo_tlv_ds_map_res, tvb,
1055 offset + 3, 1, ENC_BIG_ENDIAN);
1056 tlv_ds_map_tree = proto_item_add_subtree(ti, ett_mpls_echo_tlv_ds_map);
1058 proto_tree_add_item(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_flag_res, tvb,
1059 offset + 3, 1, ENC_BIG_ENDIAN);
1060 proto_tree_add_item(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_flag_i, tvb,
1061 offset + 3, 1, ENC_BIG_ENDIAN);
1062 proto_tree_add_item(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_flag_n, tvb,
1063 offset + 3, 1, ENC_BIG_ENDIAN);
1065 addr_type = tvb_get_uint8(tvb, offset + 2);
1066 switch (addr_type) {
1067 case TLV_ADDR_IPv4:
1068 proto_tree_add_item(tree, hf_mpls_echo_tlv_ds_map_ds_ip, tvb,
1069 offset + 4, 4, ENC_BIG_ENDIAN);
1070 proto_tree_add_item(tree, hf_mpls_echo_tlv_ds_map_int_ip, tvb,
1071 offset + 8, 4, ENC_BIG_ENDIAN);
1072 break;
1073 case TLV_ADDR_UNNUM_IPv4:
1074 case TLV_ADDR_UNNUM_IPv6:
1075 proto_tree_add_item(tree, hf_mpls_echo_tlv_ds_map_ds_ip, tvb,
1076 offset + 4, 4, ENC_BIG_ENDIAN);
1077 proto_tree_add_item(tree, hf_mpls_echo_tlv_ds_map_if_index, tvb,
1078 offset + 8, 4, ENC_BIG_ENDIAN);
1079 break;
1080 case TLV_ADDR_IPv6:
1081 proto_tree_add_item(tree, hf_mpls_echo_tlv_ds_map_ds_ipv6, tvb,
1082 offset + 4, 16, ENC_NA);
1083 proto_tree_add_item(tree, hf_mpls_echo_tlv_ds_map_int_ipv6, tvb,
1084 offset + 20, 16, ENC_NA);
1085 rem -= 24;
1086 offset += 24;
1087 break;
1088 case TLV_ADDR_NONIP :
1089 proto_tree_add_item(tree, hf_mpls_echo_tlv_ds_map_ingress_if_num, tvb,
1090 (offset + 4), 4, ENC_BIG_ENDIAN);
1091 proto_tree_add_item(tree, hf_mpls_echo_tlv_ds_map_egress_if_num, tvb,
1092 (offset + 8), 4, ENC_BIG_ENDIAN);
1093 break;
1094 default:
1095 expert_add_info_format(pinfo, addr_ti, &ei_mpls_echo_unknown_address_type,
1096 "Unknown Address Type (%u)", addr_type);
1097 break;
1099 proto_tree_add_item(tree, hf_mpls_echo_tlv_ds_map_hash_type, tvb,
1100 offset + 12, 1, ENC_BIG_ENDIAN);
1101 proto_tree_add_item(tree, hf_mpls_echo_tlv_ds_map_depth, tvb,
1102 offset + 13, 1, ENC_BIG_ENDIAN);
1103 ti = proto_tree_add_item(tree, hf_mpls_echo_tlv_ds_map_muti_len, tvb,
1104 offset + 14, 2, ENC_BIG_ENDIAN);
1106 /* Get the Multipath Length and Hash Type */
1107 mplen = tvb_get_ntohs(tvb, offset + 14);
1108 hash_type = tvb_get_uint8(tvb, offset + 12);
1110 rem -= 16;
1111 offset += 16;
1112 if (rem < mplen) {
1113 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_ds_map_muti_len,
1114 "Invalid FEC Multipath (claimed %u, found %u)",
1115 mplen, rem);
1116 return;
1118 rem -= mplen;
1119 if (mplen) {
1120 switch (hash_type) {
1121 case TLV_DS_MAP_HASH_IP:
1122 if (mplen != 4) {
1123 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_ds_map_muti_len,
1124 "Invalid FEC Multipath (claimed %u, should be 4)",
1125 mplen);
1126 break;
1128 tlv_ds_map_tree = proto_tree_add_subtree(tree, tvb, offset, 4,
1129 ett_mpls_echo_tlv_ds_map, NULL, "Multipath Information");
1130 proto_tree_add_item(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_ip, tvb,
1131 offset, 4, ENC_BIG_ENDIAN);
1132 break;
1133 case TLV_DS_MAP_HASH_IP_RANGE:
1134 if (mplen != 8) {
1135 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_ds_map_muti_len,
1136 "Invalid FEC Multipath (claimed %u, should be 8)",
1137 mplen);
1138 break;
1140 tlv_ds_map_tree = proto_tree_add_subtree(tree, tvb, offset, 8,
1141 ett_mpls_echo_tlv_ds_map, NULL, "Multipath Information");
1142 proto_tree_add_item(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_ip_low, tvb,
1143 offset, 4, ENC_BIG_ENDIAN);
1144 proto_tree_add_item(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_ip_high, tvb,
1145 offset + 4, 4, ENC_BIG_ENDIAN);
1146 break;
1147 case TLV_DS_MAP_HASH_NO_MP:
1148 case TLV_DS_MAP_HASH_NO_LABEL:
1149 case TLV_DS_MAP_HASH_ALL_IP:
1150 case TLV_DS_MAP_HASH_NO_MATCH:
1151 proto_tree_add_item(tree, hf_mpls_echo_tlv_ds_map_mp_no_multipath_info, tvb, offset, mplen, ENC_NA);
1152 break;
1153 case TLV_DS_MAP_HASH_BITMASK_IP:
1154 if (mplen < 4) {
1155 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_ds_map_muti_len,
1156 "Invalid FEC Multipath (claimed %u, should be 4)",
1157 mplen);
1158 break;
1160 tlv_ds_map_tree = proto_tree_add_subtree(tree, tvb, offset, mplen,
1161 ett_mpls_echo_tlv_ds_map, NULL, "Multipath Information");
1162 proto_tree_add_item(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_ip, tvb,
1163 offset, 4, ENC_BIG_ENDIAN);
1164 if (mplen > 4)
1165 proto_tree_add_item(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_mask, tvb,
1166 offset + 4, mplen - 4, ENC_NA);
1167 break;
1168 default:
1169 proto_tree_add_item(tree, hf_mpls_echo_tlv_ds_map_mp_value, tvb,
1170 offset, mplen, ENC_NA);
1171 break;
1175 offset += mplen;
1177 if (tree) {
1178 while (rem >= 4) {
1179 decode_mpls_label(tvb, offset, &label, &exp, &bos, &proto);
1180 tlv_ds_map_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
1181 ett_mpls_echo_tlv_ds_map, &ti, "Downstream Label Element %u", idx);
1182 proto_item_append_text(ti, ", Label: %u", label);
1183 if (label <= MPLS_LABEL_MAX_RESERVED) {
1184 proto_tree_add_uint(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_label,
1185 tvb, offset, 3, label);
1186 proto_item_append_text(ti, " (%s)", val_to_str_const(label, special_labels,
1187 "Reserved - Unknown"));
1188 } else {
1189 proto_tree_add_uint_format_value(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_label,
1190 tvb, offset, 3, label, "%u", label);
1192 proto_item_append_text(ti, ", Exp: %u, BOS: %u", exp, bos);
1193 proto_tree_add_uint(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_exp,
1194 tvb, offset + 2, 1, exp);
1195 proto_tree_add_uint(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_bos,
1196 tvb, offset + 2, 1, bos);
1197 proto_tree_add_item(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_proto,
1198 tvb, offset + 3, 1, ENC_BIG_ENDIAN);
1199 proto_item_append_text(ti, ", Protocol: %u (%s)", proto,
1200 val_to_str_const(proto, mpls_echo_tlv_ds_map_mp_proto, "Unknown"));
1201 rem -= 4;
1202 offset += 4;
1203 idx++;
1208 /* Dissector for Detailed Downstream Mapping TLV - RFC [6424] */
1209 static void
1210 dissect_mpls_echo_tlv_dd_map(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
1212 proto_tree *ddti = NULL, *tlv_dd_map_tree, *tlv_ddstlv_map_tree;
1213 proto_tree *ddsti, *ddsti2;
1214 uint16_t subtlv_length, subtlv_type, multipath_length;
1215 uint8_t addr_type, multipath_type, fec_tlv_length;
1216 uint16_t idx = 1;
1217 uint32_t label;
1218 uint8_t tc, s_bit, proto;
1220 if (tree) {
1221 proto_tree_add_item(tree, hf_mpls_echo_tlv_dd_map_mtu, tvb,
1222 offset, 2, ENC_BIG_ENDIAN);
1223 proto_tree_add_item(tree, hf_mpls_echo_tlv_dd_map_addr_type, tvb,
1224 offset + 2, 1, ENC_BIG_ENDIAN);
1225 ddti = proto_tree_add_item(tree, hf_mpls_echo_tlv_dd_map_res, tvb,
1226 offset + 3, 1, ENC_BIG_ENDIAN);
1227 tlv_dd_map_tree = proto_item_add_subtree(ddti, ett_mpls_echo_tlv_dd_map);
1229 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_tlv_dd_map_flag_res, tvb,
1230 offset + 3, 1, ENC_BIG_ENDIAN);
1231 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_tlv_dd_map_flag_i, tvb,
1232 offset + 3, 1, ENC_BIG_ENDIAN);
1233 ddti = proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_tlv_dd_map_flag_n, tvb,
1234 offset + 3, 1, ENC_BIG_ENDIAN);
1236 addr_type = tvb_get_uint8(tvb, offset + 2);
1237 switch (addr_type) {
1238 case TLV_ADDR_IPv4:
1239 proto_tree_add_item(tree, hf_mpls_echo_tlv_dd_map_ds_ip, tvb,
1240 offset + 4, 4, ENC_BIG_ENDIAN);
1241 proto_tree_add_item(tree, hf_mpls_echo_tlv_dd_map_int_ip, tvb,
1242 offset + 8, 4, ENC_BIG_ENDIAN);
1243 break;
1244 case TLV_ADDR_IPv6:
1245 proto_tree_add_item(tree, hf_mpls_echo_tlv_dd_map_ds_ipv6, tvb,
1246 offset + 4, 16, ENC_NA);
1247 proto_tree_add_item(tree, hf_mpls_echo_tlv_dd_map_int_ipv6, tvb,
1248 offset + 20, 16, ENC_NA);
1249 rem -= 24;
1250 offset += 24;
1251 break;
1252 case TLV_ADDR_NONIP :
1253 proto_tree_add_item (tree, hf_mpls_echo_tlv_dd_map_ingress_if_num, tvb,
1254 (offset + 4), 4, ENC_BIG_ENDIAN);
1255 proto_tree_add_item (tree, hf_mpls_echo_tlv_dd_map_egress_if_num, tvb,
1256 (offset + 8), 4, ENC_BIG_ENDIAN);
1257 break;
1258 default:
1259 expert_add_info_format(pinfo, ddti, &ei_mpls_echo_unknown_address_type,
1260 "Unknown Address Type (%u)", addr_type);
1261 break;
1264 if (tree) {
1265 proto_tree_add_item(tree, hf_mpls_echo_tlv_dd_map_return_code, tvb,
1266 offset + 12, 1, ENC_BIG_ENDIAN);
1267 proto_tree_add_item(tree, hf_mpls_echo_tlv_dd_map_return_subcode, tvb,
1268 offset + 13, 1, ENC_BIG_ENDIAN);
1269 ddti = proto_tree_add_item(tree, hf_mpls_echo_tlv_dd_map_subtlv_len, tvb,
1270 offset + 14, 2, ENC_BIG_ENDIAN);
1273 rem -= 16;
1274 offset += 16;
1276 while (rem > 4) {
1277 /* Get the Sub-tlv Type and Length */
1278 subtlv_type = tvb_get_ntohs(tvb, offset);
1279 subtlv_length = tvb_get_ntohs(tvb, offset+2);
1280 rem -= 4;
1281 offset += 4;
1283 if (rem<subtlv_length){
1284 expert_add_info_format(pinfo, ddti, &ei_mpls_echo_tlv_dd_map_subtlv_len,
1285 "Invalid Sub-tlv Length (claimed %u, found %u)",
1286 subtlv_length, rem);
1287 return;
1290 switch (subtlv_type) {
1291 case TLV_FEC_MULTIPATH_DATA:
1292 multipath_type = tvb_get_uint8(tvb, offset);
1293 multipath_length = tvb_get_ntohs(tvb, offset + 1);
1294 tlv_dd_map_tree = proto_tree_add_subtree(tree, tvb, offset - 4, multipath_length + 8,
1295 ett_mpls_echo_tlv_dd_map, &ddsti, "Multipath sub-TLV");
1297 switch (multipath_type) {
1298 case TLV_MULTIPATH_NO_MULTIPATH:
1299 if (!tree)
1300 break;
1301 proto_tree_add_item(tlv_dd_map_tree,
1302 hf_mpls_echo_sub_tlv_multipath_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1303 proto_tree_add_item(tlv_dd_map_tree,
1304 hf_mpls_echo_sub_tlv_multipath_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
1305 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_resv, tvb,
1306 offset + 3, 1, ENC_BIG_ENDIAN);
1307 tlv_ddstlv_map_tree = proto_tree_add_subtree(tlv_dd_map_tree, tvb, offset + 4, multipath_length,
1308 ett_mpls_echo_tlv_ddstlv_map, NULL, "Empty (Multipath Length = 0)");
1309 proto_tree_add_item(tlv_ddstlv_map_tree, hf_mpls_echo_sub_tlv_multipath_info,
1310 tvb, offset + 4, multipath_length, ENC_NA);
1311 break;
1313 case TLV_MULTIPATH_IP_ADDRESS:
1314 if (multipath_length != 4) {
1315 expert_add_info_format(pinfo, ddsti, &ei_mpls_echo_tlv_dd_map_subtlv_len,
1316 "Invalid Sub-tlv Length (claimed %u, should be 4)",
1317 multipath_length);
1318 break;
1320 if (!tree)
1321 break;
1322 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_multipath_type, tvb,
1323 offset, 1, ENC_BIG_ENDIAN);
1324 proto_tree_add_item(tlv_dd_map_tree,
1325 hf_mpls_echo_sub_tlv_multipath_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
1326 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_resv, tvb,
1327 offset + 3, 1, ENC_BIG_ENDIAN);
1329 tlv_ddstlv_map_tree = proto_tree_add_subtree(tlv_dd_map_tree, tvb, offset + 4, multipath_length,
1330 ett_mpls_echo_tlv_ddstlv_map, NULL, "Multipath Information (IP addresses)");
1332 proto_tree_add_item(tlv_ddstlv_map_tree, hf_mpls_echo_sub_tlv_multipath_ip, tvb,
1333 offset + 4, 4, ENC_BIG_ENDIAN);
1334 break;
1336 case TLV_MULTIPATH_IP_ADDRESS_RANGE:
1337 if (multipath_length != 8) {
1338 expert_add_info_format(pinfo, ddsti, &ei_mpls_echo_tlv_dd_map_subtlv_len,
1339 "Invalid Sub-tlv Length (claimed %u, should be 8)",
1340 multipath_length);
1341 break;
1343 if (!tree)
1344 break;
1345 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_multipath_type, tvb,
1346 offset, 1, ENC_BIG_ENDIAN);
1347 proto_tree_add_item(tlv_dd_map_tree,
1348 hf_mpls_echo_sub_tlv_multipath_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
1349 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_resv, tvb,
1350 offset + 3, 1, ENC_BIG_ENDIAN);
1352 tlv_ddstlv_map_tree = proto_tree_add_subtree(tlv_dd_map_tree, tvb, offset + 4, multipath_length,
1353 ett_mpls_echo_tlv_ddstlv_map, NULL, "Multipath Information (low/high address pairs)");
1355 proto_tree_add_item(tlv_ddstlv_map_tree, hf_mpls_echo_sub_tlv_mp_ip_low, tvb,
1356 offset + 4, 4, ENC_BIG_ENDIAN);
1357 proto_tree_add_item(tlv_ddstlv_map_tree, hf_mpls_echo_sub_tlv_mp_ip_high, tvb,
1358 offset + 8, 4, ENC_BIG_ENDIAN);
1359 break;
1361 case TLV_MULTIPATH_BIT_MASKED_IP:
1362 if (multipath_length < 4) {
1363 expert_add_info_format(pinfo, ddsti, &ei_mpls_echo_tlv_dd_map_subtlv_len,
1364 "Invalid Sub-tlv Length (claimed %u, should be >= 4)",
1365 multipath_length);
1366 break;
1368 if (!tree)
1369 break;
1370 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_multipath_type, tvb,
1371 offset, 1, ENC_BIG_ENDIAN);
1372 proto_tree_add_item(tlv_dd_map_tree,
1373 hf_mpls_echo_sub_tlv_multipath_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
1374 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_resv, tvb,
1375 offset + 3, 1, ENC_BIG_ENDIAN);
1377 tlv_ddstlv_map_tree = proto_tree_add_subtree(tlv_dd_map_tree, tvb, offset + 4, multipath_length,
1378 ett_mpls_echo_tlv_ddstlv_map, NULL, "Multipath Information (IP address prefix and bit mask)");
1380 proto_tree_add_item(tlv_ddstlv_map_tree, hf_mpls_echo_sub_tlv_multipath_ip, tvb,
1381 offset + 4, 4, ENC_BIG_ENDIAN);
1382 if (multipath_length > 4)
1383 proto_tree_add_item(tlv_ddstlv_map_tree, hf_mpls_echo_sub_tlv_mp_mask,
1384 tvb, offset + 8, multipath_length - 4, ENC_NA);
1385 break;
1387 case TLV_MULTIPATH_BIT_MASKED_LABEL_SET:
1388 proto_tree_add_uint_format(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_multipath_type, tvb, offset, 1, multipath_type,
1389 "Multipath Information (Label prefix and bit mask)");
1390 break;
1392 default:
1393 if (!tree)
1394 break;
1395 proto_tree_add_uint_format(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_multipath_type, tvb, offset, 1, multipath_type,
1396 "Multipath Type not identified (%u)", multipath_type);
1397 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_multipath_type, tvb,
1398 offset, 1, ENC_BIG_ENDIAN);
1399 proto_tree_add_item(tlv_dd_map_tree,
1400 hf_mpls_echo_sub_tlv_multipath_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
1401 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_multipath_value, tvb,
1402 offset + 3, rem, ENC_NA);
1403 break;
1406 rem -= (multipath_length + 4);
1407 break;
1409 case TLV_FEC_LABEL_STACK:
1410 tlv_dd_map_tree = proto_tree_add_subtree(tree, tvb, offset - 4, subtlv_length + 4,
1411 ett_mpls_echo_tlv_dd_map, NULL, "Label stack sub-TLV");
1413 while (subtlv_length >= 4) {
1414 if (tree) {
1415 decode_mpls_label(tvb, offset, &label, &tc, &s_bit, &proto);
1417 tlv_ddstlv_map_tree = proto_tree_add_subtree_format(tlv_dd_map_tree, tvb, offset, 4,
1418 ett_mpls_echo_tlv_ddstlv_map, &ddsti2, "Downstream Label Element %u", idx);
1419 proto_item_append_text(ddsti2, ", Label: %u , Protocol: %u", label, proto);
1420 proto_tree_add_uint(tlv_ddstlv_map_tree, hf_mpls_echo_sub_tlv_label, tvb, offset, 3, label);
1421 proto_tree_add_uint(tlv_ddstlv_map_tree, hf_mpls_echo_sub_tlv_traffic_class, tvb, offset + 2, 1, tc);
1422 proto_tree_add_uint(tlv_ddstlv_map_tree, hf_mpls_echo_sub_tlv_s_bit, tvb, offset + 2, 1, s_bit);
1423 proto_tree_add_item(tlv_ddstlv_map_tree, hf_mpls_echo_tlv_ddstlv_map_mp_proto,
1424 tvb, offset + 3, 1, ENC_BIG_ENDIAN);
1426 subtlv_length -= 4;
1427 rem -= 4;
1428 offset += 4;
1429 idx++;
1431 break;
1433 case TLV_FEC_STACK_CHANGE: {
1434 addr_type = tvb_get_uint8(tvb, offset + 1);
1435 fec_tlv_length = tvb_get_uint8(tvb, offset + 2);
1436 tlv_dd_map_tree = proto_tree_add_subtree(tree, tvb, offset - 4, fec_tlv_length + 12,
1437 ett_mpls_echo_tlv_dd_map, NULL, "Stack change sub-TLV");
1439 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_op_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1440 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_addr_type, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
1441 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_fec_tlv_value, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
1442 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_res, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
1443 switch (addr_type) {
1444 case SUB_TLV_FEC_UNSPECIFIED:
1445 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_remote_peer_unspecified, tvb, offset + 4, 0, ENC_NA);
1446 break;
1447 case SUB_TLV_FEC_IPV4:
1448 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_remote_peer_ip, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
1449 rem -= 4;
1450 offset += 4;
1451 break;
1452 case SUB_TLV_FEC_IPV6:
1453 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_sub_tlv_remore_peer_ipv6, tvb, offset + 4, 16, ENC_NA);
1454 rem -= 16;
1455 offset += 16;
1456 break;
1459 offset += 4;
1460 dissect_mpls_echo_tlv_fec(tvb, pinfo, offset, tlv_dd_map_tree, fec_tlv_length);
1462 rem -= (fec_tlv_length + 4);
1463 break;
1466 default:
1467 tlv_dd_map_tree = proto_tree_add_subtree(tree, tvb, offset, subtlv_length, ett_mpls_echo_tlv_dd_map, NULL, "Error processing sub-TLV");
1468 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_tlv_dd_map_type, tvb, offset - 4, 2, ENC_BIG_ENDIAN);
1469 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_tlv_dd_map_length, tvb, offset - 2, 2, ENC_BIG_ENDIAN);
1470 proto_tree_add_item(tlv_dd_map_tree, hf_mpls_echo_tlv_dd_map_value, tvb, offset, subtlv_length, ENC_NA);
1471 rem -= subtlv_length;
1472 break;
1478 * Dissector for IPv4 and IPv6 Interface and Label Stack Object
1480 static void
1481 dissect_mpls_echo_tlv_ilso(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem, bool is_ipv6)
1483 proto_tree *ti;
1484 uint8_t type;
1485 uint16_t idx = 1;
1486 uint32_t label;
1487 uint8_t exp, bos, ttl;
1489 ti = proto_tree_add_item(tree, hf_mpls_echo_tlv_ilso_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1490 type = tvb_get_uint8(tvb, offset);
1491 offset += 1;
1492 rem -= 1;
1494 proto_tree_add_item(tree, hf_mpls_echo_tlv_ilso_mbz, tvb, offset, 3, ENC_BIG_ENDIAN);
1495 offset += 3;
1496 rem -= 3;
1498 if ((type == TLV_ADDR_IPv4) || (type == TLV_ADDR_UNNUM_IPv4)) {
1499 if (is_ipv6) {
1500 expert_add_info(pinfo, ti, &ei_mpls_echo_incorrect_address_type);
1502 proto_tree_add_item(tree, hf_mpls_echo_tlv_ilso_ipv4_addr, tvb,
1503 offset, 4, ENC_BIG_ENDIAN);
1504 if (type == TLV_ADDR_IPv4) {
1505 proto_tree_add_item(tree, hf_mpls_echo_tlv_ilso_ipv4_int_addr, tvb,
1506 offset + 4, 4, ENC_BIG_ENDIAN);
1507 } else {
1508 proto_tree_add_item(tree, hf_mpls_echo_tlv_ilso_int_index, tvb,
1509 offset + 4, 4, ENC_BIG_ENDIAN);
1511 offset += 8;
1512 rem -= 8;
1513 } else if ((type == TLV_ADDR_IPv6) || (type == TLV_ADDR_UNNUM_IPv6)) {
1514 if (!is_ipv6) {
1515 expert_add_info(pinfo, ti, &ei_mpls_echo_incorrect_address_type);
1518 proto_tree_add_item(tree, hf_mpls_echo_tlv_ilso_ipv6_addr, tvb,
1519 offset, 16, ENC_NA);
1520 if (type == TLV_ADDR_IPv6) {
1521 proto_tree_add_item(tree, hf_mpls_echo_tlv_ilso_ipv6_int_addr, tvb,
1522 offset + 16, 16, ENC_NA);
1523 offset += 32;
1524 rem -= 32;
1525 } else {
1526 proto_tree_add_item(tree, hf_mpls_echo_tlv_ilso_int_index, tvb,
1527 offset + 16, 4, ENC_BIG_ENDIAN);
1528 offset += 20;
1529 rem -= 20;
1531 } else {
1532 expert_add_info(pinfo, ti, &ei_mpls_echo_incorrect_address_type);
1533 return;
1536 if (tree) {
1537 while (rem >= 4) {
1538 proto_tree *tlv_ilso;
1540 decode_mpls_label(tvb, offset, &label, &exp, &bos, &ttl);
1541 tlv_ilso = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_mpls_echo_tlv_ilso, &ti, "Label Stack Element %u", idx);
1542 proto_item_append_text(ti, ", Label: %u", label);
1543 if (label <= MPLS_LABEL_MAX_RESERVED) {
1544 proto_tree_add_uint_format_value(tlv_ilso, hf_mpls_echo_tlv_ilso_label,
1545 tvb, offset, 3, label, "%u (%s)", label,
1546 val_to_str_const(label, special_labels, "Reserved - Unknown"));
1547 proto_item_append_text(ti, " (%s)", val_to_str_const(label, special_labels,
1548 "Reserved - Unknown"));
1549 } else {
1550 proto_tree_add_uint_format_value(tlv_ilso, hf_mpls_echo_tlv_ilso_label,
1551 tvb, offset, 3, label, "%u", label);
1553 proto_item_append_text(ti, ", Exp: %u, BOS: %u, TTL: %u",
1554 exp, bos, ttl);
1555 proto_tree_add_uint(tlv_ilso, hf_mpls_echo_tlv_ilso_exp,
1556 tvb, offset + 2, 1, exp);
1557 proto_tree_add_uint(tlv_ilso, hf_mpls_echo_tlv_ilso_bos,
1558 tvb, offset + 2, 1, bos);
1559 proto_tree_add_item(tlv_ilso, hf_mpls_echo_tlv_ilso_ttl,
1560 tvb, offset + 3, 1, ENC_BIG_ENDIAN);
1561 rem -= 4;
1562 offset += 4;
1563 idx++;
1568 static int
1569 dissect_mpls_echo_tlv(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem, bool in_errored);
1572 * Dissector for Errored TLVs
1574 static void
1575 // NOLINTNEXTLINE(misc-no-recursion)
1576 dissect_mpls_echo_tlv_errored(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
1578 int errored_tlv_length;
1580 increment_dissection_depth(pinfo);
1581 while (rem >= 4) {
1582 errored_tlv_length = dissect_mpls_echo_tlv(tvb, pinfo, offset, tree, rem, true);
1583 rem -= errored_tlv_length;
1584 offset += errored_tlv_length;
1586 increment_dissection_depth(pinfo);
1590 * Dissector for MPLS Echo TLVs and return bytes consumed
1592 static int
1593 // NOLINTNEXTLINE(misc-no-recursion)
1594 dissect_mpls_echo_tlv(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem, bool in_errored)
1596 proto_tree *ti = NULL, *mpls_echo_tlv_tree = NULL;
1597 uint16_t type, saved_type;
1598 int length;
1600 length = tvb_reported_length_remaining(tvb, offset);
1601 rem = MIN(rem, length);
1603 if ( rem < 4 ) { /* Type Length */
1604 proto_tree_add_expert_format(tree, pinfo, &ei_mpls_echo_tlv_len, tvb, offset, rem,
1605 "Error processing TLV: length is %d, should be >= 4", rem);
1606 return rem;
1609 type = tvb_get_ntohs(tvb, offset);
1610 length = tvb_get_ntohs(tvb, offset + 2);
1611 rem -= 4; /* do not count Type Length */
1612 length = MIN(length, rem);
1614 /* Check for Vendor Private TLVs */
1615 saved_type = type;
1616 if (type >= TLV_VENDOR_PRIVATE_START) /* && <= TLV_VENDOR_PRIVATE_END always true */
1617 type = TLV_VENDOR_PRIVATE_START;
1619 if (tree) {
1620 mpls_echo_tlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, length + 4, ett_mpls_echo_tlv, NULL,
1621 "%s%s", in_errored ? "Errored TLV Type: " : "",
1622 val_to_str_ext(type, &mpls_echo_tlv_type_names_ext, "Unknown TLV type (0x%04X)"));
1624 /* MPLS Echo TLV Type and Length */
1625 if (in_errored) {
1626 proto_tree_add_uint_format_value(mpls_echo_tlv_tree, hf_mpls_echo_tlv_errored_type, tvb,
1627 offset, 2, saved_type, "%s (%u)",
1628 val_to_str_ext_const(type, &mpls_echo_tlv_type_names_ext,
1629 "Unknown TLV type"), saved_type);
1630 } else {
1631 proto_tree_add_uint_format_value(mpls_echo_tlv_tree, hf_mpls_echo_tlv_type, tvb,
1632 offset, 2, saved_type, "%s (%u)",
1633 val_to_str_ext_const(type, &mpls_echo_tlv_type_names_ext,
1634 "Unknown TLV type"), saved_type);
1636 ti = proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_len, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1639 /* MPLS Echo TLV Value */
1640 if (length == 0)
1641 return 4; /* Empty TLV, return Type and Length consumed. */
1643 switch (type) {
1644 case TLV_TARGET_FEC_STACK:
1645 dissect_mpls_echo_tlv_fec(tvb, pinfo, offset + 4, mpls_echo_tlv_tree, length);
1646 break;
1647 case TLV_PAD:
1648 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_padaction, tvb,
1649 offset + 4, 1, ENC_BIG_ENDIAN);
1650 if (length > 1)
1651 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_padding, tvb,
1652 offset + 5, length - 1, ENC_NA);
1653 break;
1654 case TLV_VENDOR_CODE:
1655 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_vendor, tvb,
1656 offset + 4, 4, ENC_BIG_ENDIAN);
1657 break;
1658 case TLV_ILSO_IPv4:
1659 if (length < 12) {
1660 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_len,
1661 "Invalid TLV Length (claimed %u, should be >= 12)",
1662 length);
1663 break;
1665 dissect_mpls_echo_tlv_ilso(tvb, pinfo, offset + 4, mpls_echo_tlv_tree, length, false);
1666 break;
1667 case TLV_ILSO_IPv6:
1668 if (length < 24) {
1669 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_len,
1670 "Invalid TLV Length (claimed %u, should be >= 24)",
1671 length);
1672 break;
1674 dissect_mpls_echo_tlv_ilso(tvb, pinfo, offset + 4, mpls_echo_tlv_tree, length, true);
1675 break;
1676 #if 0
1677 case TLV_RTO_IPv4:
1678 if (length != 4) {
1679 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_len,
1680 "Invalid TLV Length (claimed %u, should be 4)",
1681 length);
1682 break;
1684 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_rto_ipv4,
1685 tvb, offset + 4, 4, ENC_BIG_ENDIAN);
1686 break;
1687 case TLV_RTO_IPv6:
1688 if (length != 16) {
1689 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_len,
1690 "Invalid TLV Length (claimed %u, should be 16)",
1691 length);
1692 break;
1694 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_rto_ipv6,
1695 tvb, offset + 4, 16, ENC_NA);
1696 break;
1697 #endif
1698 case TLV_P2MP_ECHO_JITTER:
1699 if (length != 4) {
1700 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_len,
1701 "Invalid TLV Length (claimed %u, should be 4)",
1702 length);
1703 break;
1705 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_echo_jitter,
1706 tvb, offset + 4, 4, ENC_BIG_ENDIAN);
1707 break;
1708 case TLV_P2MP_RESPONDER_IDENT: {
1709 uint16_t resp_ident_type, resp_ident_len;
1710 proto_item *hidden_item;
1712 resp_ident_type = tvb_get_ntohs(tvb, offset + 4);
1713 resp_ident_len = tvb_get_ntohs(tvb, offset + 6);
1714 /* Check addr length */
1715 switch (resp_ident_type) {
1716 case TLV_P2MP_RESPONDER_IDENT_IPV4_EGRESS_ADDR:
1717 case TLV_P2MP_RESPONDER_IDENT_IPV4_NODE_ADDR:
1718 if (resp_ident_len != 4) {
1719 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_len,
1720 "Invalid TLV Length (claimed %u, should be 4)",
1721 length);
1722 break;
1724 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_responder_indent_type,
1725 tvb, offset + 4, 2, ENC_BIG_ENDIAN);
1726 hidden_item = proto_tree_add_item(mpls_echo_tlv_tree,
1727 hf_mpls_echo_tlv_responder_indent_len, tvb,
1728 offset + 6, 2, ENC_BIG_ENDIAN);
1729 proto_item_set_hidden(hidden_item);
1730 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_responder_indent_ipv4,
1731 tvb, offset + 8, 4, ENC_BIG_ENDIAN);
1732 break;
1733 case TLV_P2MP_RESPONDER_IDENT_IPV6_EGRESS_ADDR:
1734 case TLV_P2MP_RESPONDER_IDENT_IPV6_NODE_ADDR:
1735 if (resp_ident_len != 16) {
1736 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_len,
1737 "Invalid TLV Length (claimed %u, should be 16)",
1738 length);
1739 break;
1741 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_responder_indent_type,
1742 tvb, offset + 4, 2, ENC_BIG_ENDIAN);
1743 hidden_item = proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_responder_indent_len,
1744 tvb, offset + 6, 2, ENC_BIG_ENDIAN);
1745 proto_item_set_hidden(hidden_item);
1746 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_responder_indent_ipv6,
1747 tvb, offset + 8, 16, ENC_NA);
1748 break;
1750 break;
1752 case TLV_VENDOR_PRIVATE_START:
1753 if (length < 4) { /* SMI Enterprise code */
1754 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_len,
1755 "Invalid TLV Length (claimed %u, should be >= 4)",
1756 length);
1757 } else {
1758 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_vendor, tvb,
1759 offset + 4, 4, ENC_BIG_ENDIAN);
1760 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_value, tvb,
1761 offset + 8, length - 4, ENC_NA);
1763 break;
1764 case TLV_DOWNSTREAM_MAPPING:
1765 if (length < 16) {
1766 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_len,
1767 "Invalid TLV Length (claimed %u, should be >= 16)",
1768 length);
1769 break;
1771 dissect_mpls_echo_tlv_ds_map(tvb, pinfo, offset + 4, mpls_echo_tlv_tree, length);
1772 break;
1773 case TLV_DETAILED_DOWNSTREAM: /* [RFC 6424] */
1774 if (length < 16) {
1775 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_len,
1776 "Invalid TLV Length (claimed %u, should be >= 16)",
1777 length);
1778 break;
1780 dissect_mpls_echo_tlv_dd_map(tvb, pinfo, offset + 4, mpls_echo_tlv_tree, length);
1781 break;
1782 case TLV_ERRORED_TLV:
1783 if (in_errored)
1784 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_value, tvb,
1785 offset + 4, length, ENC_NA);
1786 else
1787 dissect_mpls_echo_tlv_errored(tvb, pinfo, offset + 4, mpls_echo_tlv_tree, length);
1788 break;
1789 case TLV_REPLY_TOS:
1790 if (length != 4) {
1791 expert_add_info_format(pinfo, ti, &ei_mpls_echo_tlv_len,
1792 "Invalid TLV Length (claimed %u, should be 4)",
1793 length);
1794 break;
1796 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_reply_tos, tvb,
1797 offset + 4, 1, ENC_BIG_ENDIAN);
1798 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_reply_tos_mbz, tvb,
1799 offset + 5, 3, ENC_BIG_ENDIAN);
1800 break;
1801 case TLV_SRC_IDENTIFIER:
1802 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_lspping_tlv_src_addr_gid,
1803 tvb, (offset + 4), 4, ENC_BIG_ENDIAN);
1804 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_lspping_tlv_src_addr_nid,
1805 tvb, (offset + 8), 4, ENC_BIG_ENDIAN);
1806 break;
1807 case TLV_DST_IDENTIFIER:
1808 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_lspping_tlv_src_addr_gid,
1809 tvb, (offset + 4), 4, ENC_BIG_ENDIAN);
1810 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_lspping_tlv_src_addr_nid,
1811 tvb, (offset + 8), 4, ENC_BIG_ENDIAN);
1812 break;
1813 case TLV_BFD_DISCRIMINATOR:
1814 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_bfd,
1815 tvb, (offset + 4), 4, ENC_BIG_ENDIAN);
1816 break;
1817 case TLV_REVERSE_PATH_FEC_STACK:
1818 dissect_mpls_echo_tlv_fec (tvb, pinfo, (offset + 4), mpls_echo_tlv_tree, length);
1819 break ;
1820 case TLV_ERROR_CODE:
1821 default:
1822 proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_value, tvb,
1823 offset + 4, length, ENC_NA);
1824 break;
1826 return length + 4; /* Length of the Value field + Type Length */
1829 #define MSGTYPE_MPLS_ECHO(msgtype) ((msgtype == 1) || (msgtype == 2))
1830 #define MSGTYPE_DATAPLANE(msgtype) ((msgtype == 3) || (msgtype == 4))
1833 * Dissector for MPLS Echo (LSP PING) packets
1835 static int
1836 dissect_mpls_echo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1838 int offset = 0, rem = 0, len;
1839 proto_item *ti = NULL;
1840 proto_tree *mpls_echo_tree = NULL;
1841 uint8_t msgtype;
1843 /* If version != 1 we assume it's not an mpls ping packet */
1844 if (tvb_captured_length(tvb) < 5) {
1845 return 0; /* Not enough information to tell version and message type. */
1847 if (tvb_get_ntohs(tvb, 0) != 1) {
1848 return 0; /* Not version 1. */
1851 /* Make entries in Protocol column and Info column on summary display */
1852 col_set_str(pinfo->cinfo, COL_PROTOCOL, "MPLS ECHO");
1854 /* Clear the info column so it's sane if we crash. We fill it in later when
1855 * we've dissected more of the packet. */
1856 col_clear(pinfo->cinfo, COL_INFO);
1858 rem = tvb_reported_length_remaining(tvb, offset);
1860 /* Get the message type and fill in the Column info */
1861 msgtype = tvb_get_uint8(tvb, offset + 4);
1863 /* The minimum fixed part of the packet is 16 Bytes or 32 Bytes depending on Msg Type */
1864 if ( ((!MSGTYPE_MPLS_ECHO(msgtype)) && (rem < 16)) ||
1865 ((MSGTYPE_MPLS_ECHO(msgtype)) && (rem < 32)) ) {
1866 col_set_str(pinfo->cinfo, COL_INFO, "Malformed Message");
1867 ti = proto_tree_add_item(tree, proto_mpls_echo, tvb, 0, -1, ENC_NA);
1868 expert_add_info_format(pinfo, ti, &ei_mpls_echo_malformed, "Error processing Message: length is %d, should be >= %u",
1869 rem, (MSGTYPE_MPLS_ECHO(msgtype)) ? 32 : 16);
1870 return 0;
1873 col_add_str(pinfo->cinfo, COL_INFO,
1874 val_to_str(msgtype, mpls_echo_msgtype, "Unknown Message Type (0x%02X)"));
1877 if (tree) {
1878 /* Add subtree and dissect the fixed part of the message */
1879 ti = proto_tree_add_item(tree, proto_mpls_echo, tvb, 0, -1, ENC_NA);
1880 mpls_echo_tree = proto_item_add_subtree(ti, ett_mpls_echo);
1882 proto_tree_add_item(mpls_echo_tree,
1883 hf_mpls_echo_version, tvb, offset, 2, ENC_BIG_ENDIAN);
1885 if (MSGTYPE_MPLS_ECHO(msgtype)) {
1886 proto_tree *mpls_echo_gflags;
1887 ti = proto_tree_add_item(mpls_echo_tree,
1888 hf_mpls_echo_gflags, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1889 mpls_echo_gflags = proto_item_add_subtree(ti, ett_mpls_echo_gflags);
1890 proto_tree_add_item(mpls_echo_gflags,
1891 hf_mpls_echo_flag_sbz, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1892 proto_tree_add_item(mpls_echo_gflags,
1893 hf_mpls_echo_flag_v, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1894 proto_tree_add_item(mpls_echo_gflags,
1895 hf_mpls_echo_flag_t, tvb, (offset + 2), 2, ENC_BIG_ENDIAN);
1896 proto_tree_add_item(mpls_echo_gflags,
1897 hf_mpls_echo_flag_r, tvb, (offset + 2), 2, ENC_BIG_ENDIAN);
1898 } else {
1899 proto_tree_add_item(mpls_echo_tree,
1900 hf_mpls_echo_mbz, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1903 proto_tree_add_item(mpls_echo_tree,
1904 hf_mpls_echo_msgtype, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
1905 proto_tree_add_item(mpls_echo_tree,
1906 hf_mpls_echo_replymode, tvb, offset + 5, 1, ENC_BIG_ENDIAN);
1907 proto_tree_add_item(mpls_echo_tree,
1908 hf_mpls_echo_returncode, tvb, offset + 6, 1, ENC_BIG_ENDIAN);
1909 proto_tree_add_item(mpls_echo_tree,
1910 hf_mpls_echo_returnsubcode, tvb, offset + 7, 1, ENC_BIG_ENDIAN);
1911 proto_tree_add_item(mpls_echo_tree,
1912 hf_mpls_echo_handle, tvb, offset + 8, 4, ENC_BIG_ENDIAN);
1913 proto_tree_add_item(mpls_echo_tree,
1914 hf_mpls_echo_sequence, tvb, offset + 12, 4, ENC_BIG_ENDIAN);
1916 if (MSGTYPE_MPLS_ECHO(msgtype)) {
1917 proto_tree_add_item(mpls_echo_tree, hf_mpls_echo_ts_sent, tvb,
1918 offset + 16, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN);
1919 proto_tree_add_item(mpls_echo_tree, hf_mpls_echo_ts_rec, tvb,
1920 offset + 24, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN);
1924 if (MSGTYPE_MPLS_ECHO(msgtype)) {
1925 offset += 32;
1926 rem -= 32;
1927 } else {
1928 offset += 16;
1929 rem -= 16;
1932 /* Dissect all TLVs */
1933 while (tvb_reported_length_remaining(tvb, offset) > 0 ) {
1934 len = dissect_mpls_echo_tlv(tvb, pinfo, offset, mpls_echo_tree, rem, false);
1935 offset += len;
1936 rem -= len;
1940 return tvb_captured_length(tvb);
1943 /* Register the protocol with Wireshark */
1945 void
1946 proto_register_mpls_echo(void)
1949 static hf_register_info hf[] = {
1950 { &hf_mpls_echo_version,
1951 { "Version", "mpls_echo.version",
1952 FT_UINT16, BASE_DEC, NULL, 0x0, "MPLS ECHO Version Number", HFILL}
1954 { &hf_mpls_echo_mbz,
1955 { "MBZ", "mpls_echo.mbz",
1956 FT_UINT16, BASE_HEX, NULL, 0x0, "MPLS ECHO Must be Zero", HFILL}
1958 { &hf_mpls_echo_gflags,
1959 { "Global Flags", "mpls_echo.flags",
1960 FT_UINT16, BASE_HEX, NULL, 0x0, "MPLS ECHO Global Flags", HFILL}
1962 { &hf_mpls_echo_flag_sbz,
1963 { "Reserved", "mpls_echo.flag_sbz",
1964 FT_UINT16, BASE_HEX, NULL, 0xFFF8, "MPLS ECHO Reserved Flags", HFILL}
1966 { &hf_mpls_echo_flag_v,
1967 { "Validate FEC Stack", "mpls_echo.flag_v",
1968 FT_BOOLEAN, 16, NULL, 0x0001, "MPLS ECHO Validate FEC Stack Flag", HFILL}
1970 { &hf_mpls_echo_flag_t,
1971 { "Respond only if TTL expired", "mpls_echo.flag_t",
1972 FT_BOOLEAN, 16, NULL, 0x0002, "MPLS ECHO Respond only if TTL expired Flag", HFILL}
1974 { &hf_mpls_echo_flag_r,
1975 { "Validate Reverse Path", "mpls_echo.flag_r",
1976 FT_BOOLEAN, 16, NULL, 0x0004, "MPLS ECHO Validate Reverse Path Flag", HFILL}
1978 { &hf_mpls_echo_msgtype,
1979 { "Message Type", "mpls_echo.msg_type",
1980 FT_UINT8, BASE_DEC, VALS(mpls_echo_msgtype), 0x0, "MPLS ECHO Message Type", HFILL}
1982 { &hf_mpls_echo_replymode,
1983 { "Reply Mode", "mpls_echo.reply_mode",
1984 FT_UINT8, BASE_DEC, VALS(mpls_echo_replymode), 0x0, "MPLS ECHO Reply Mode", HFILL}
1986 { &hf_mpls_echo_returncode,
1987 { "Return Code", "mpls_echo.return_code",
1988 FT_UINT8, BASE_DEC | BASE_EXT_STRING, &mpls_echo_returncode_ext, 0x0, "MPLS ECHO Return Code", HFILL}
1990 { &hf_mpls_echo_returnsubcode,
1991 { "Return Subcode", "mpls_echo.return_subcode",
1992 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO Return Subcode", HFILL}
1994 { &hf_mpls_echo_handle,
1995 { "Sender's Handle", "mpls_echo.sender_handle",
1996 FT_UINT32, BASE_HEX, NULL, 0x0, "MPLS ECHO Sender's Handle", HFILL}
1998 { &hf_mpls_echo_sequence,
1999 { "Sequence Number", "mpls_echo.sequence",
2000 FT_UINT32, BASE_DEC, NULL, 0x0, "MPLS ECHO Sequence Number", HFILL}
2002 { &hf_mpls_echo_ts_sent,
2003 { "Timestamp Sent", "mpls_echo.timestamp_sent",
2004 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, "MPLS ECHO Timestamp Sent", HFILL}
2006 { &hf_mpls_echo_ts_rec,
2007 { "Timestamp Received", "mpls_echo.timestamp_rec",
2008 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, "MPLS ECHO Timestamp Received", HFILL}
2010 { &hf_mpls_echo_tlv_type,
2011 { "Type", "mpls_echo.tlv.type",
2012 FT_UINT16, BASE_DEC | BASE_EXT_STRING, &mpls_echo_tlv_type_names_ext, 0x0,
2013 "MPLS ECHO TLV Type", HFILL}
2015 { &hf_mpls_echo_tlv_len,
2016 { "Length", "mpls_echo.tlv.len",
2017 FT_UINT16, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Length", HFILL}
2019 { &hf_mpls_echo_tlv_value,
2020 { "Value", "mpls_echo.tlv.value",
2021 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Value", HFILL}
2023 { &hf_mpls_echo_tlv_fec_type,
2024 { "Type", "mpls_echo.tlv.fec.type",
2025 FT_UINT16, BASE_DEC | BASE_EXT_STRING, &mpls_echo_tlv_fec_names_ext, 0x0,
2026 "MPLS ECHO TLV FEC Stack Type", HFILL}
2028 { &hf_mpls_echo_tlv_fec_len,
2029 { "Length", "mpls_echo.tlv.fec.len",
2030 FT_UINT16, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack Length", HFILL}
2032 { &hf_mpls_echo_tlv_fec_value,
2033 { "Value", "mpls_echo.tlv.fec.value",
2034 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack Value", HFILL}
2036 { &hf_mpls_echo_tlv_fec_ldp_ipv4,
2037 { "IPv4 Prefix", "mpls_echo.tlv.fec.ldp_ipv4",
2038 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack LDP IPv4", HFILL}
2040 { &hf_mpls_echo_tlv_fec_ldp_ipv4_mask,
2041 { "Prefix Length", "mpls_echo.tlv.fec.ldp_ipv4_mask",
2042 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack LDP IPv4 Prefix Length", HFILL}
2044 { &hf_mpls_echo_tlv_fec_ldp_ipv6,
2045 { "IPv6 Prefix", "mpls_echo.tlv.fec.ldp_ipv6",
2046 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack LDP IPv6", HFILL}
2048 { &hf_mpls_echo_tlv_fec_ldp_ipv6_mask,
2049 { "Prefix Length", "mpls_echo.tlv.fec.ldp_ipv6_mask",
2050 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack LDP IPv6 Prefix Length", HFILL}
2052 { &hf_mpls_echo_tlv_fec_rsvp_ipv4_ipv4_endpoint,
2053 { "IPv4 Tunnel endpoint address", "mpls_echo.tlv.fec.rsvp_ipv4_ep",
2054 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP IPv4 Tunnel Endpoint Address", HFILL}
2056 { &hf_mpls_echo_tlv_fec_rsvp_ipv6_ipv6_endpoint,
2057 { "IPv6 Tunnel endpoint address", "mpls_echo.tlv.fec.rsvp_ipv6_ep",
2058 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP IPv6 Tunnel Endpoint Address", HFILL}
2060 { &hf_mpls_echo_tlv_fec_rsvp_ip_mbz1,
2061 { "Must Be Zero", "mpls_echo.tlv.fec.rsvp_ip_mbz1",
2062 FT_UINT16, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP MBZ", HFILL}
2064 { &hf_mpls_echo_tlv_fec_rsvp_ip_tunnel_id,
2065 { "Tunnel ID", "mpls_echo.tlv.fec.rsvp_ip_tun_id",
2066 FT_UINT16, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP Tunnel ID", HFILL}
2068 { &hf_mpls_echo_tlv_fec_rsvp_ipv4_ext_tunnel_id,
2069 { "Extended Tunnel ID", "mpls_echo.tlv.fec.rsvp_ipv4_ext_tun_id",
2070 FT_UINT32, BASE_HEX, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP IPv4 Extended Tunnel ID", HFILL}
2072 { &hf_mpls_echo_tlv_fec_rsvp_ipv4_ipv4_sender,
2073 { "IPv4 Tunnel sender address", "mpls_echo.tlv.fec.rsvp_ipv4_sender",
2074 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP IPv4 Sender", HFILL}
2076 { &hf_mpls_echo_tlv_fec_rsvp_ipv6_ext_tunnel_id,
2077 { "Extended Tunnel ID", "mpls_echo.tlv.fec.rsvp_ipv6_ext_tun_id",
2078 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP IPv6 Extended Tunnel ID", HFILL}
2080 { &hf_mpls_echo_tlv_fec_rsvp_ipv6_ipv6_sender,
2081 { "IPv6 Tunnel sender address", "mpls_echo.tlv.fec.rsvp_ipv6_sender",
2082 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP IPv4 Sender", HFILL}
2084 { &hf_mpls_echo_tlv_fec_rsvp_ip_mbz2,
2085 { "Must Be Zero", "mpls_echo.tlv.fec.rsvp_ip_mbz2",
2086 FT_UINT16, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP MBZ", HFILL}
2088 { &hf_mpls_echo_tlv_fec_rsvp_ip_lsp_id,
2089 { "LSP ID", "mpls_echo.tlv.fec.rsvp_ip_lsp_id",
2090 FT_UINT16, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP LSP ID", HFILL}
2092 { &hf_mpls_echo_tlv_fec_vpn_route_dist,
2093 { "Route Distinguisher", "mpls_echo.tlv.fec.vpn_route_dist",
2094 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack VPN Route Distinguisher", HFILL}
2096 { &hf_mpls_echo_tlv_fec_vpn_ipv4,
2097 { "IPv4 Prefix", "mpls_echo.tlv.fec.vpn_ipv4",
2098 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack VPN IPv4", HFILL}
2100 { &hf_mpls_echo_tlv_fec_vpn_ipv6,
2101 { "IPv6 Prefix", "mpls_echo.tlv.fec.vpn_ipv6",
2102 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack VPN IPv6", HFILL}
2104 { &hf_mpls_echo_tlv_fec_vpn_len,
2105 { "Prefix Length", "mpls_echo.tlv.fec.vpn_len",
2106 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack VPN Prefix Length", HFILL}
2108 { &hf_mpls_echo_tlv_fec_l2_vpn_route_dist,
2109 { "Route Distinguisher", "mpls_echo.tlv.fec.l2vpn_route_dist",
2110 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack L2VPN Route Distinguisher", HFILL}
2112 { &hf_mpls_echo_tlv_fec_l2_vpn_send_ve_id,
2113 { "Sender's VE ID", "mpls_echo.tlv.fec.l2vpn_send_ve_id",
2114 FT_UINT16, BASE_HEX, NULL, 0x0, "MPLS ECHO TLV FEC Stack L2VPN Sender's VE ID", HFILL}
2116 { &hf_mpls_echo_tlv_fec_l2_vpn_recv_ve_id,
2117 { "Receiver's VE ID", "mpls_echo.tlv.fec.l2vpn_recv_ve_id",
2118 FT_UINT16, BASE_HEX, NULL, 0x0, "MPLS ECHO TLV FEC Stack L2VPN Receiver's VE ID", HFILL}
2120 { &hf_mpls_echo_tlv_fec_l2_vpn_encap_type,
2121 { "Encapsulation", "mpls_echo.tlv.fec.l2vpn_encap_type",
2122 FT_UINT16, BASE_DEC, VALS(fec_vc_types_vals), 0x0, "MPLS ECHO TLV FEC Stack L2VPN Encapsulation", HFILL}
2124 { &hf_mpls_echo_tlv_fec_l2cid_sender,
2125 { "Sender's PE Address", "mpls_echo.tlv.fec.l2cid_sender",
2126 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack L2CID Sender", HFILL}
2128 { &hf_mpls_echo_tlv_fec_l2cid_remote,
2129 { "Remote PE Address", "mpls_echo.tlv.fec.l2cid_remote",
2130 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack L2CID Remote", HFILL}
2132 { &hf_mpls_echo_tlv_fec_l2cid_vcid,
2133 { "VC ID", "mpls_echo.tlv.fec.l2cid_vcid",
2134 FT_UINT32, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack L2CID VCID", HFILL}
2136 { &hf_mpls_echo_tlv_fec_l2cid_encap,
2137 { "Encapsulation", "mpls_echo.tlv.fec.l2cid_encap",
2138 FT_UINT16, BASE_DEC, VALS(fec_vc_types_vals), 0x0, "MPLS ECHO TLV FEC Stack L2CID Encapsulation", HFILL}
2140 { &hf_mpls_echo_tlv_fec_l2cid_mbz,
2141 { "MBZ", "mpls_echo.tlv.fec.l2cid_mbz",
2142 FT_UINT16, BASE_HEX, NULL, 0x0, "MPLS ECHO TLV FEC Stack L2CID MBZ", HFILL}
2144 { &hf_mpls_echo_tlv_fec_bgp_ipv4,
2145 { "IPv4 Prefix", "mpls_echo.tlv.fec.bgp_ipv4",
2146 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack BGP IPv4", HFILL}
2148 { &hf_mpls_echo_tlv_fec_bgp_ipv6,
2149 { "IPv6 Prefix", "mpls_echo.tlv.fec.bgp_ipv6",
2150 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack BGP IPv6", HFILL}
2152 { &hf_mpls_echo_tlv_fec_bgp_len,
2153 { "Prefix Length", "mpls_echo.tlv.fec.bgp_len",
2154 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack BGP Prefix Length", HFILL}
2156 { &hf_mpls_echo_tlv_fec_gen_ipv4,
2157 { "IPv4 Prefix", "mpls_echo.tlv.fec.gen_ipv4",
2158 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack Generic IPv4", HFILL}
2160 { &hf_mpls_echo_tlv_fec_gen_ipv4_mask,
2161 { "Prefix Length", "mpls_echo.tlv.fec.gen_ipv4_mask",
2162 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack Generic IPv4 Prefix Length", HFILL}
2164 { &hf_mpls_echo_tlv_fec_gen_ipv6,
2165 { "IPv6 Prefix", "mpls_echo.tlv.fec.gen_ipv6",
2166 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack Generic IPv6", HFILL}
2168 { &hf_mpls_echo_tlv_fec_gen_ipv6_mask,
2169 { "Prefix Length", "mpls_echo.tlv.fec.gen_ipv6_mask",
2170 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack Generic IPv6 Prefix Length", HFILL}
2172 { &hf_mpls_echo_tlv_fec_nil_label,
2173 { "Label", "mpls_echo.tlv.fec.nil_label",
2174 FT_UINT24, BASE_DEC, VALS(special_labels), 0x0, "MPLS ECHO TLV FEC Stack NIL Label", HFILL}
2176 { &hf_mpls_echo_tlv_fec_pw_ipv6_128_sender,
2177 { "Sender's PE Address", "mpls_echo.tlv.fec.pw_ipv6_128_sender",
2178 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC PW IPV6 FEC 128 SENDER", HFILL }
2180 { &hf_mpls_echo_tlv_fec_pw_ipv6_128_remote,
2181 { "Remote's PE Address", "mpls_echo.tlv.fec.pw_ipv6_128_remote",
2182 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC PW IPV6 FEC 128 REMOTE", HFILL }
2184 { &hf_mpls_echo_tlv_fec_pw_ipv6_128_pw_id,
2185 { "PW ID", "mpls_echo.tlv.fec.fec.pw_ipv6_128_pwid",
2186 FT_UINT16, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC PW IPV6 FEC 128 PW ID", HFILL}
2188 { &hf_mpls_echo_tlv_fec_pw_ipv6_128_pw_type,
2189 { "PW TYPE", "mpls_echo.tlv.fec.fec.pw_ipv6_128_pw_type",
2190 FT_UINT16, BASE_DEC, VALS(fec_vc_types_vals), 0x0, "MPLS ECHO TLV FEC PW IPV6 FEC 128 PW TYPE", HFILL}
2192 { &hf_mpls_echo_tlv_fec_pw_ipv6_128_mbz,
2193 { "MBZ", "mpls_echo.tlv.fec.fec.pw_ipv6_128_mbz",
2194 FT_UINT16, BASE_HEX, NULL, 0x0, "MPLS ECHO TLV FEC PW IPV6 FEC 128 MBZ", HFILL}
2196 { &hf_mpls_echo_tlv_fec_igp_ipv4,
2197 { "IPv4 Prefix", "mpls_echo.tlv.fec.igp_ipv4",
2198 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack IGP IPv4", HFILL}
2200 { &hf_mpls_echo_tlv_fec_igp_ipv6,
2201 { "IPv6 Prefix", "mpls_echo.tlv.fec.igp_ipv6",
2202 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack IGP IPv6", HFILL}
2204 { &hf_mpls_echo_tlv_fec_igp_mask,
2205 { "Prefix Length", "mpls_echo.tlv.fec.igp_mask",
2206 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack IGP Prefix Length", HFILL}
2208 { &hf_mpls_echo_tlv_fec_igp_protocol,
2209 { "Protocol", "mpls_echo.tlv.fec.igp_protocol",
2210 FT_UINT8, BASE_DEC, VALS(mpls_echo_subtlv_sr_protocol_types), 0x0, "MPLS ECHO TLV FEC Stack IGP Protocol", HFILL}
2212 { &hf_mpls_echo_tlv_fec_igp_reserved,
2213 { "Reserved", "mpls_echo.tlv.fec.igp_reserved",
2214 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack IGP Reserved", HFILL}
2216 { &hf_mpls_echo_tlv_fec_igp_adj_type,
2217 { "Adjacency Type", "mpls_echo.tlv.fec.igp_adj_type",
2218 FT_UINT8, BASE_DEC, VALS(mpls_echo_subtlv_igp_adjacency_types), 0x0, "MPLS ECHO TLV FEC Stack IGP Adjacency Type", HFILL}
2220 { &hf_mpls_echo_tlv_fec_igp_adj_local_ipv4,
2221 { "Local Interface ID", "mpls_echo.tlv.fec.igp_adj_local_id.ipv4",
2222 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack IGP Adjacency Local Interface ID", HFILL}
2224 { &hf_mpls_echo_tlv_fec_igp_adj_local_ipv6,
2225 { "Local Interface ID", "mpls_echo.tlv.fec.igp_adj_local_id.ipv6",
2226 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack IGP Adjacency Local Interface ID", HFILL}
2228 { &hf_mpls_echo_tlv_fec_igp_adj_local_ident,
2229 { "Local Interface ID", "mpls_echo.tlv.fec.igp_adj_local_id.ident",
2230 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack IGP Adjacency Local Interface ID", HFILL}
2232 { &hf_mpls_echo_tlv_fec_igp_adj_remote_ipv4,
2233 { "Remote Interface ID", "mpls_echo.tlv.fec.igp_adj_remote_id.ipv4",
2234 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack IGP Adjacency Remote Interface ID", HFILL}
2236 { &hf_mpls_echo_tlv_fec_igp_adj_remote_ipv6,
2237 { "Remote Interface ID", "mpls_echo.tlv.fec.igp_adj_remote_id.ipv6",
2238 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack IGP Adjacency Remote Interface ID", HFILL}
2240 { &hf_mpls_echo_tlv_fec_igp_adj_remote_ident,
2241 { "Remote Interface ID", "mpls_echo.tlv.fec.igp_adj_remote_id.ident",
2242 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack IGP Adjacency Remote Interface ID", HFILL}
2244 { &hf_mpls_echo_tlv_fec_igp_adj_adv_ident_ospf,
2245 { "Advertising Node Identifier Router ID", "mpls_echo.tlv.fec.igp_adj_adv_node_id.ospf",
2246 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack IGP Adjacency Advertising Node Identifier OSPF Router ID", HFILL}
2248 { &hf_mpls_echo_tlv_fec_igp_adj_adv_ident_isis,
2249 { "Advertising Node Identifier System ID", "mpls_echo.tlv.fec.igp_adj_adv_node_id.isis",
2250 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack IGP Adjacency Advertising Node Identifier IS-IS System ID", HFILL}
2252 { &hf_mpls_echo_tlv_fec_igp_adj_adv_ident,
2253 { "Advertising Node Identifier", "mpls_echo.tlv.fec.igp_adj_adv_node_id.ident",
2254 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack IGP Adjacency Advertising Node Identifier", HFILL}
2256 { &hf_mpls_echo_tlv_fec_igp_adj_rec_ident_ospf,
2257 { "Receiving Node Identifier Router ID", "mpls_echo.tlv.fec.igp_adj_rec_node_id.ospf",
2258 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack IGP Adjacency Receiving Node Identifier OSPF Router ID", HFILL}
2260 { &hf_mpls_echo_tlv_fec_igp_adj_rec_ident_isis,
2261 { "Receiving Node Identifier System ID", "mpls_echo.tlv.fec.igp_adj_rec_node_id.isis",
2262 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack IGP Adjacency Receiving Node Identifier IS-IS System ID", HFILL}
2264 { &hf_mpls_echo_tlv_fec_igp_adj_rec_ident,
2265 { "Receiving Node Identifier", "mpls_echo.tlv.fec.igp_adj_rec_node_id.ident",
2266 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack IGP Adjacency Receiving Node Identifier", HFILL}
2268 { &hf_mpls_echo_tlv_ds_map_mtu,
2269 { "MTU", "mpls_echo.tlv.ds_map.mtu",
2270 FT_UINT16, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Downstream Map MTU", HFILL}
2272 { &hf_mpls_echo_tlv_ds_map_addr_type,
2273 { "Address Type", "mpls_echo.tlv.ds_map.addr_type",
2274 FT_UINT8, BASE_DEC, VALS(mpls_echo_tlv_addr_type), 0x0,
2275 "MPLS ECHO TLV Downstream Map Address Type", HFILL}
2277 { &hf_mpls_echo_tlv_ds_map_res,
2278 { "DS Flags", "mpls_echo.tlv.ds_map.res",
2279 FT_UINT8, BASE_HEX, NULL, 0x0, "MPLS ECHO TLV Downstream Map DS Flags", HFILL}
2281 { &hf_mpls_echo_tlv_ds_map_flag_res,
2282 { "MBZ", "mpls_echo.tlv.ds_map.flag_res",
2283 FT_UINT8, BASE_HEX, NULL, 0xFC, "MPLS ECHO TLV Downstream Map Reserved Flags", HFILL}
2285 { &hf_mpls_echo_tlv_ds_map_flag_i,
2286 { "Interface and Label Stack Request", "mpls_echo.tlv.ds_map.flag_i",
2287 FT_BOOLEAN, 8, NULL, 0x02, "MPLS ECHO TLV Downstream Map I-Flag", HFILL}
2289 { &hf_mpls_echo_tlv_ds_map_flag_n,
2290 { "Treat as Non-IP Packet", "mpls_echo.tlv.ds_map.flag_n",
2291 FT_BOOLEAN, 8, NULL, 0x01, "MPLS ECHO TLV Downstream Map N-Flag", HFILL}
2293 { &hf_mpls_echo_tlv_ds_map_ds_ip,
2294 { "Downstream IP Address", "mpls_echo.tlv.ds_map.ds_ip",
2295 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Downstream Map IP Address", HFILL}
2297 { &hf_mpls_echo_tlv_ds_map_int_ip,
2298 { "Downstream Interface Address", "mpls_echo.tlv.ds_map.int_ip",
2299 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Downstream Map Interface Address", HFILL}
2301 { &hf_mpls_echo_tlv_ds_map_if_index,
2302 { "Upstream Interface Index", "mpls_echo.tlv.ds_map.if_index",
2303 FT_UINT32, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Downstream Map Interface Index", HFILL}
2305 { &hf_mpls_echo_tlv_ds_map_ds_ipv6,
2306 { "Downstream IPv6 Address", "mpls_echo.tlv.ds_map.ds_ipv6",
2307 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Downstream Map IPv6 Address", HFILL}
2309 { &hf_mpls_echo_tlv_ds_map_int_ipv6,
2310 { "Downstream Interface IPv6 Address", "mpls_echo.tlv.ds_map.int_ipv6",
2311 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Downstream Map Interface IPv6 Address", HFILL}
2313 { &hf_mpls_echo_tlv_ds_map_hash_type,
2314 { "Multipath Type", "mpls_echo.tlv.ds_map.hash_type",
2315 FT_UINT8, BASE_DEC | BASE_EXT_STRING, &mpls_echo_tlv_ds_map_hash_type_ext, 0x0,
2316 "MPLS ECHO TLV Downstream Map Multipath Type", HFILL}
2318 { &hf_mpls_echo_tlv_ds_map_depth,
2319 { "Depth Limit", "mpls_echo.tlv.ds_map.depth",
2320 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Downstream Map Depth Limit", HFILL}
2322 { &hf_mpls_echo_tlv_ds_map_muti_len,
2323 { "Multipath Length", "mpls_echo.tlv.ds_map.multi_len",
2324 FT_UINT16, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Downstream Map Multipath Length", HFILL}
2326 { &hf_mpls_echo_tlv_ds_map_mp_ip,
2327 { "IP Address", "mpls_echo.tlv.ds_map_mp.ip",
2328 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Downstream Map Multipath IP Address", HFILL}
2330 { &hf_mpls_echo_tlv_ds_map_mp_mask,
2331 { "Mask", "mpls_echo.tlv.ds_map_mp.mask",
2332 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Downstream Map Multipath Mask", HFILL}
2334 { &hf_mpls_echo_tlv_ds_map_mp_ip_low,
2335 { "IP Address Low", "mpls_echo.tlv.ds_map_mp.ip_low",
2336 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Downstream Map Multipath Low IP Address", HFILL}
2338 { &hf_mpls_echo_tlv_ds_map_mp_ip_high,
2339 { "IP Address High", "mpls_echo.tlv.ds_map_mp.ip_high",
2340 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Downstream Map Multipath High IP Address", HFILL}
2342 { &hf_mpls_echo_tlv_ds_map_mp_no_multipath_info,
2343 { "No Multipath Information", "mpls_echo.tlv.ds_map_mp.no_multipath_info",
2344 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
2346 { &hf_mpls_echo_tlv_ds_map_mp_value,
2347 { "Multipath Value", "mpls_echo.tlv.ds_map_mp.value",
2348 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Multipath Value", HFILL}
2350 { &hf_mpls_echo_tlv_ds_map_mp_label,
2351 { "Downstream Label", "mpls_echo.tlv.ds_map.mp_label",
2352 FT_UINT24, BASE_DEC, VALS(special_labels), 0x0, "MPLS ECHO TLV Downstream Map Downstream Label", HFILL}
2354 { &hf_mpls_echo_tlv_ds_map_mp_exp,
2355 { "Downstream Exp", "mpls_echo.tlv.ds_map.mp_exp",
2356 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Downstream Map Downstream Experimental", HFILL}
2358 { &hf_mpls_echo_tlv_ds_map_mp_bos,
2359 { "Downstream BOS", "mpls_echo.tlv.ds_map.mp_bos",
2360 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Downstream Map Downstream BOS", HFILL}
2362 { &hf_mpls_echo_tlv_ds_map_mp_proto,
2363 { "Downstream Protocol", "mpls_echo.tlv.ds_map.mp_proto",
2364 FT_UINT8, BASE_DEC, VALS(mpls_echo_tlv_ds_map_mp_proto), 0x0,
2365 "MPLS ECHO TLV Downstream Map Downstream Protocol", HFILL}
2367 { &hf_mpls_echo_tlv_padaction,
2368 { "Pad Action", "mpls_echo.tlv.pad_action",
2369 FT_UINT8, BASE_DEC, VALS(mpls_echo_tlv_pad), 0x0, "MPLS ECHO Pad TLV Action", HFILL}
2371 { &hf_mpls_echo_tlv_padding,
2372 { "Padding", "mpls_echo.tlv.pad_padding",
2373 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO Pad TLV Padding", HFILL}
2375 { &hf_mpls_echo_tlv_vendor,
2376 { "Vendor Id", "mpls_echo.tlv.vendor_id",
2377 FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0x0, "MPLS ECHO Vendor Id", HFILL}
2379 { &hf_mpls_echo_tlv_ilso_addr_type,
2380 { "Address Type", "mpls_echo.tlv.ilso.addr_type",
2381 FT_UINT8, BASE_DEC, VALS(mpls_echo_tlv_addr_type), 0x0,
2382 "MPLS ECHO TLV Interface and Label Stack Address Type", HFILL}
2384 { &hf_mpls_echo_tlv_ilso_mbz,
2385 { "Must Be Zero", "mpls_echo.tlv.ilso.mbz",
2386 FT_UINT24, BASE_HEX, NULL, 0x0, "MPLS ECHO TLV Interface and Label Stack MBZ", HFILL}
2388 { &hf_mpls_echo_tlv_ilso_ipv4_addr,
2389 { "Downstream IPv4 Address", "mpls_echo.tlv.ilso_ipv4.addr",
2390 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Interface and Label Stack Address", HFILL}
2392 { &hf_mpls_echo_tlv_ilso_ipv4_int_addr,
2393 { "Downstream Interface Address", "mpls_echo.tlv.ilso_ipv4.int_addr",
2394 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Interface and Label Stack Interface Address", HFILL}
2396 { &hf_mpls_echo_tlv_ilso_ipv6_addr,
2397 { "Downstream IPv6 Address", "mpls_echo.tlv.ilso_ipv6.addr",
2398 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Interface and Label Stack Address", HFILL}
2400 { &hf_mpls_echo_tlv_ilso_ipv6_int_addr,
2401 { "Downstream Interface Address", "mpls_echo.tlv.ilso_ipv6.int_addr",
2402 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Interface and Label Stack Interface Address", HFILL}
2404 { &hf_mpls_echo_tlv_ilso_int_index,
2405 { "Downstream Interface Index", "mpls_echo.tlv.ilso.int_index",
2406 FT_UINT32, BASE_HEX, NULL, 0x0, "MPLS ECHO TLV Interface and Label Stack Interface Index", HFILL}
2408 { &hf_mpls_echo_tlv_ilso_label,
2409 { "Label", "mpls_echo.tlv.ilso_ipv4.label",
2410 FT_UINT24, BASE_DEC, VALS(special_labels), 0x0, "MPLS ECHO TLV Interface and Label Stack Label", HFILL}
2412 { &hf_mpls_echo_tlv_ilso_exp,
2413 { "Exp", "mpls_echo.tlv.ilso_ipv4.exp",
2414 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Interface and Label Stack Exp", HFILL}
2416 { &hf_mpls_echo_tlv_ilso_bos,
2417 { "BOS", "mpls_echo.tlv.ilso_ipv4.bos",
2418 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Interface and Label Stack BOS", HFILL}
2420 { &hf_mpls_echo_tlv_ilso_ttl,
2421 { "TTL", "mpls_echo.tlv.ilso_ipv4.ttl",
2422 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Interface and Label Stack TTL", HFILL}
2424 #if 0
2425 { &hf_mpls_echo_tlv_rto_ipv4,
2426 { "Reply-to IPv4 Address", "mpls_echo.tlv.rto.ipv4",
2427 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV IPv4 Reply-To Object", HFILL}
2429 { &hf_mpls_echo_tlv_rto_ipv6,
2430 { "Reply-to IPv6 Address", "mpls_echo.tlv.rto.ipv6",
2431 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV IPv6 Reply-To Object", HFILL}
2433 #endif
2434 { &hf_mpls_echo_tlv_reply_tos,
2435 { "Reply-TOS Byte", "mpls_echo.tlv.reply.tos",
2436 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Reply-TOS Byte", HFILL}
2438 { &hf_mpls_echo_tlv_reply_tos_mbz,
2439 { "MBZ", "mpls_echo.tlv.reply.tos.mbz",
2440 FT_UINT24, BASE_HEX, NULL, 0x0, "MPLS ECHO TLV Reply-TOS MBZ", HFILL}
2442 { &hf_mpls_echo_tlv_errored_type,
2443 { "Errored TLV Type", "mpls_echo.tlv.errored.type",
2444 FT_UINT16, BASE_DEC | BASE_EXT_STRING, &mpls_echo_tlv_type_names_ext, 0x0,
2445 "MPLS ECHO TLV Errored TLV Type", HFILL}
2447 { &hf_mpls_echo_tlv_ds_map_ingress_if_num,
2448 { "Ingress Interface Number", "mpls_echo.tlv.ds_map.ingress.if.num",
2449 FT_UINT32, BASE_DEC, NULL, 0x0,
2450 "MPLS ECHO TLV DownStream Map Ingress Interface Number", HFILL}
2452 { &hf_mpls_echo_tlv_ds_map_egress_if_num,
2453 { "Egress Interface Number", "mpls_echo.tlv.ds_map.egress.if.num",
2454 FT_UINT32, BASE_DEC, NULL, 0x0,
2455 "MPLS ECHO TLV DownStream Map Egress Interface Number", HFILL}
2457 { &hf_mpls_echo_lspping_tlv_src_gid,
2458 { "SRC GLOBAL ID", "mpls_echo.lspping.tlv.src.gid",
2459 FT_UINT32, BASE_DEC, NULL, 0x0, "LSP SRC GID", HFILL}
2461 { &hf_mpls_echo_lspping_tlv_src_nid,
2462 { "SRC NODE ID", "mpls_echo.lspping.tlv.src.nid",
2463 FT_IPv4, BASE_NONE, NULL, 0x0, "LSP SRC NID", HFILL}
2465 { &hf_mpls_echo_lspping_tlv_src_tunnel_no,
2466 { "SRC Tunnel Number", "mpls_echo.lspping.tlv.tunnel.no",
2467 FT_UINT16, BASE_DEC, NULL, 0x0, "LSP FEC Tunnel Number", HFILL}
2469 { &hf_mpls_echo_lspping_tlv_lsp_no,
2470 { "SRC LSP Number", "mpls_echo.lspping.tlv.lsp.no",
2471 FT_UINT16, BASE_DEC, NULL, 0x0, "LSP FEC LSP Number", HFILL}
2473 { &hf_mpls_echo_lspping_tlv_dst_gid,
2474 { "DST GLOBAL ID", "mpls_echo.lspping.tlv.dst.gid",
2475 FT_UINT32, BASE_DEC, NULL, 0x0, "LSP FEC DST GID", HFILL}
2477 { &hf_mpls_echo_lspping_tlv_dst_nid,
2478 { "DST NODE ID", "mpls_echo.lspping.tlv.dst.nid",
2479 FT_IPv4, BASE_NONE, NULL, 0x0, "LSP FEC DST NID", HFILL}
2481 { &hf_mpls_echo_lspping_tlv_dst_tunnel_no,
2482 { "DST Tunnel Number", "mpls_echo.lspping.tlv.dst.tunnel.no",
2483 FT_UINT16, BASE_DEC, NULL, 0x0, "LSP FEC DST Tunnel Number", HFILL}
2485 { &hf_mpls_echo_lspping_tlv_resv,
2486 { "RESERVED", "mpls_echo.lspping.tlv.resv",
2487 FT_UINT16, BASE_DEC, NULL, 0x0, "RESERVED BITS", HFILL}
2489 { &hf_mpls_echo_lspping_tlv_src_addr_gid,
2490 { "Global ID", "mpls_echo.lspping.tlv.src.addr.gid",
2491 FT_UINT32, BASE_DEC, NULL, 0x0, "SRC ADDR TLV GID", HFILL}
2493 { &hf_mpls_echo_lspping_tlv_src_addr_nid,
2494 { "Node ID", "mpls_echo.lspping.tlv.src.addr.nid",
2495 FT_IPv4, BASE_NONE, NULL, 0x0, "SRC ADDR TLV NID", HFILL}
2497 { &hf_mpls_echo_lspping_tlv_pw_serv_identifier,
2498 { "Service identifier", "mpls_echo.lspping.tlv.pw.serv.identifier",
2499 FT_UINT64, BASE_DEC, NULL, 0x0, "PW FEC Service identifier", HFILL}
2501 { &hf_mpls_echo_lspping_tlv_pw_src_ac_id,
2502 { "SRC AC ID", "mpls_echo.lspping.tlv.pw.src.ac.id",
2503 FT_UINT32, BASE_DEC, NULL, 0x0, "PW FEC SRC AC ID", HFILL}
2505 { &hf_mpls_echo_lspping_tlv_pw_dst_ac_id,
2506 { "DST AC ID", "mpls_echo.lspping.tlv.pw.dst.ac.id",
2507 FT_UINT32, BASE_DEC, NULL, 0x0, "PW FEC DST AC ID", HFILL}
2509 { &hf_mpls_echo_padding,
2510 { "Padding", "mpls_echo.padding",
2511 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
2513 #if 0
2514 { &hf_mpls_echo_lspping_tlv_pw_agi_type,
2515 { "AGI TYPE", "mpls_echo.lspping.tlv.pw.agi.type",
2516 FT_UINT8, BASE_DEC, NULL, 0x0, "PW AGI TYPE", HFILL}
2518 #endif
2519 #if 0
2520 { &hf_mpls_echo_lspping_tlv_pw_agi_len,
2521 { "AGI Length", "mpls_echo.lspping.tlv.pw.agi.len",
2522 FT_UINT8, BASE_DEC, NULL, 0x0, "PW AGI LENGTH", HFILL}
2524 #endif
2525 #if 0
2526 { &hf_mpls_echo_lspping_tlv_pw_agi_val,
2527 { "AGI VALUE", "mpls_echo.lspping.tlv.pw.agi.val",
2528 FT_STRING, BASE_NONE, NULL, 0x0, "PW AGI VALUE", HFILL}
2530 #endif
2531 { &hf_mpls_echo_tlv_dd_map_mtu,
2532 { "MTU", "mpls_echo.lspping.tlv.dd_map.mtu",
2533 FT_UINT16, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Detailed Downstream Map MTU", HFILL}
2535 { &hf_mpls_echo_tlv_dd_map_addr_type,
2536 { "Address Type", "mpls_echo.tlv.dd_map.addr_type",
2537 FT_UINT8, BASE_DEC, VALS(mpls_echo_tlv_addr_type), 0x0, "MPLS ECHO TLV Detailed Downstream Map Address Type", HFILL}
2539 { &hf_mpls_echo_tlv_dd_map_res,
2540 { "DS Flags", "mpls_echo.tlv.dd_map.res",
2541 FT_UINT8, BASE_HEX, NULL, 0x0, "MPLS ECHO TLV Detailed Downstream Map DS Flags", HFILL}
2543 { &hf_mpls_echo_tlv_dd_map_flag_res,
2544 { "MBZ", "mpls_echo.tlv.dd_map.flag_res",
2545 FT_UINT8, BASE_HEX, NULL, 0xFC, "MPLS ECHO TLV Detailed Downstream Map Reserved Flags", HFILL}
2547 { &hf_mpls_echo_tlv_dd_map_flag_i,
2548 { "Interface and Label Stack Request", "mpls_echo.tlv.dd_map.flag_i",
2549 FT_BOOLEAN, 8, NULL, 0x02, "MPLS ECHO TLV Detailed Downstream Map I-Flag", HFILL}
2551 { &hf_mpls_echo_tlv_dd_map_flag_n,
2552 { "Treat as Non-IP Packet", "mpls_echo.tlv.dd_map.flag_n",
2553 FT_BOOLEAN, 8, NULL, 0x01, "MPLS ECHO TLV Detailed Downstream Map N-Flag", HFILL}
2555 { &hf_mpls_echo_tlv_dd_map_ds_ip,
2556 { "Downstream IP Address", "mpls_echo.tlv.dd_map.ds_ip",
2557 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Detailed Downstream Map IP Address", HFILL}
2559 { &hf_mpls_echo_tlv_dd_map_int_ip,
2560 { "Downstream Interface Address", "mpls_echo.tlv.dd_map.int_ip",
2561 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Detailed Downstream Map Interface Address", HFILL}
2563 { &hf_mpls_echo_tlv_dd_map_ds_ipv6,
2564 { "Downstream IPv6 Address", "mpls_echo.tlv.dd_map.ds_ipv6",
2565 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Detailed Downstream Map IPv6 Address", HFILL}
2567 { &hf_mpls_echo_tlv_dd_map_int_ipv6,
2568 { "Downstream Interface IPv6 Address", "mpls_echo.tlv.dd_map.int_ipv6",
2569 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Detailed Downstream Map Interface IPv6 Address", HFILL}
2571 { &hf_mpls_echo_tlv_dd_map_return_code,
2572 { "Return Code", "mpls_echo.tlv.dd_map.return_code",
2573 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Detailed Downstream Map Return Code", HFILL}
2575 { &hf_mpls_echo_tlv_dd_map_return_subcode,
2576 { "Return Subcode", "mpls_echo.tlv.dd_map.return_subcode",
2577 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Detailed Downstream Map Return Subcode", HFILL}
2579 { &hf_mpls_echo_tlv_dd_map_ingress_if_num,
2580 { "Ingress Interface Number", "mpls_echo.tlv.dd_map.ingress.if.num",
2581 FT_UINT32, BASE_DEC, NULL, 0x0,
2582 "MPLS ECHO TLV Detailed DownStream Map Ingress Interface Number", HFILL}
2584 { &hf_mpls_echo_tlv_dd_map_egress_if_num,
2585 { "Egress Interface Number", "mpls_echo.tlv.dd_map.egress.if.num",
2586 FT_UINT32, BASE_DEC, NULL, 0x0,
2587 "MPLS ECHO TLV Detailed DownStream Map Egress Interface Number", HFILL}
2589 { &hf_mpls_echo_tlv_dd_map_subtlv_len,
2590 { "Subtlv Length", "mpls_echo.tlv.dd_map.subtlv_len",
2591 FT_UINT16, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Detailed Downstream Map Subtlv Length", HFILL}
2593 { &hf_mpls_echo_sub_tlv_multipath_type,
2594 { "Multipath Type", "mpls_echo.subtlv.dd_map.multipath_type",
2595 FT_UINT8, BASE_DEC, NULL, 0x0, "Detailed Downstream Mapping TLV Multipath Data Sub-TLV Multipath Type", HFILL}
2597 { &hf_mpls_echo_sub_tlv_multipath_length,
2598 { "Multipath Length", "mpls_echo.subtlv.dd_map.multipath_length",
2599 FT_UINT16, BASE_DEC, NULL, 0x0, "Detailed Downstream Mapping TLV Multipath Data Sub-TLV Multipath Length", HFILL}
2601 { &hf_mpls_echo_sub_tlv_multipath_value,
2602 { "Multipath Value", "mpls_echo.subtlv.dd_map.multipath_value",
2603 FT_BYTES, BASE_NONE, NULL, 0x0, "Detailed Downstream Mapping TLV Multipath Data Sub-TLV Multipath Value", HFILL}
2605 { &hf_mpls_echo_sub_tlv_resv,
2606 { "Reserved", "mpls_echo.subtlv.dd_map.reserved",
2607 FT_UINT8, BASE_DEC, NULL, 0x0, "Detailed Downstream Mapping TLV Multipath Data Sub-TLV Reserved Bits", HFILL}
2609 { &hf_mpls_echo_sub_tlv_multipath_info,
2610 { "Multipath Information", "mpls_echo.subtlv.dd_map.multipath_info",
2611 FT_BYTES, BASE_NONE, NULL, 0x0, "Detailed Downstream Mapping TLV Multipath Data Sub-TLV Value", HFILL}
2613 #if 0
2614 { &hf_mpls_echo_tlv_ddstlv_map_mp_label,
2615 { "Downstream Label", "mpls_echo.tlv.ddstlv_map.mp_label",
2616 FT_UINT24, BASE_DEC, VALS(special_labels), 0x0, "MPLS ECHO TLV Detailed Downstream Map Downstream Label", HFILL}
2618 #endif
2619 { &hf_mpls_echo_tlv_ddstlv_map_mp_proto,
2620 { "Downstream Protocol", "mpls_echo.tlv.ddstlv_map.mp_proto",
2621 FT_UINT8, BASE_DEC, VALS(mpls_echo_tlv_ds_map_mp_proto), 0x0,
2622 "MPLS ECHO TLV Detailed Downstream Map Downstream Protocol", HFILL}
2624 #if 0
2625 { &hf_mpls_echo_tlv_ddstlv_map_mp_exp,
2626 { "Downstream Experimental", "mpls_echo.tlv.ddstlv_map.mp_exp",
2627 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Detailed Downstream Map Downstream Experimental", HFILL}
2629 #endif
2630 #if 0
2631 { &hf_mpls_echo_tlv_ddstlv_map_mp_bos,
2632 { "Downstream BOS", "mpls_echo.tlv.ddstlv_map.mp_bos",
2633 FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Detailed Downstream Map Downstream BOS", HFILL}
2635 #endif
2636 { &hf_mpls_echo_sub_tlv_multipath_ip,
2637 { "IP Address", "mpls_echo.tlv.ddstlv_map_mp.ip",
2638 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Detailed Downstream Map Multipath IP Address", HFILL}
2640 { &hf_mpls_echo_sub_tlv_mp_ip_low,
2641 { "IP Address Low", "mpls_echo.tlv.ddstlv_map_mp.ip_low",
2642 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Detailed Downstream Map Multipath Low IP Address", HFILL}
2644 { &hf_mpls_echo_sub_tlv_mp_ip_high,
2645 { "IP Address High", "mpls_echo.tlv.ddstlv_map_mp.ip_high",
2646 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Detailed Downstream Map Multipath High IP Address", HFILL}
2648 { &hf_mpls_echo_sub_tlv_mp_mask,
2649 { "Mask", "mpls_echo.tlv.ddstlv_map_mp.mask",
2650 FT_BYTES, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV Detailed Downstream Map Multipath Mask", HFILL}
2652 { &hf_mpls_echo_sub_tlv_op_type,
2653 { "Operation Type", "mpls_echo.tlv.ddstlv_map.op_type",
2654 FT_UINT8, BASE_DEC, VALS(mpls_echo_subtlv_op_types), 0x0,
2655 "MPLS ECHO TLV Detailed Downstream Map Stack Change Operation Type", HFILL}
2657 { &hf_mpls_echo_sub_tlv_addr_type,
2658 { "Address Type", "mpls_echo.tlv.ddstlv_map.address_type",
2659 FT_UINT8, BASE_DEC, VALS(mpls_echo_subtlv_addr_types), 0x0,
2660 "MPLS ECHO TLV Detailed Downstream Map Stack Change Address Type", HFILL}
2662 { &hf_mpls_echo_sub_tlv_fec_tlv_value,
2663 { "FEC tlv Length", "mpls_echo.subtlv.dd_map.fec_tlv_type",
2664 FT_UINT8, BASE_DEC, NULL, 0x0, "Detailed Downstream Map FEC TLV Length", HFILL}
2666 { &hf_mpls_echo_sub_tlv_label,
2667 { "Label", "mpls_echo.subtlv.label",
2668 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
2670 { &hf_mpls_echo_sub_tlv_traffic_class,
2671 { "Traffic Class", "mpls_echo.subtlv.traffic_class",
2672 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
2674 { &hf_mpls_echo_sub_tlv_s_bit,
2675 { "S bit", "mpls_echo.subtlv.s_bit",
2676 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
2678 { &hf_mpls_echo_sub_tlv_res,
2679 { "Reserved", "mpls_echo.subtlv.dd_map.reserved",
2680 FT_UINT8, BASE_DEC, NULL, 0x0, "Detailed Downstream Map FEC Stack Change Reserved Bits", HFILL}
2682 { &hf_mpls_echo_sub_tlv_remote_peer_unspecified,
2683 { "Unspecified (Address Length = 0)", "mpls_echo.tlv.dd_map.unspecified",
2684 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}
2686 { &hf_mpls_echo_sub_tlv_remote_peer_ip,
2687 { "Remote Peer IP Address", "mpls_echo.tlv.dd_map.remote_ip",
2688 FT_IPv4, BASE_NONE, NULL, 0x0, "Detailed Downstream Map FEC Stack Change Remote Peer IP Address", HFILL}
2690 { &hf_mpls_echo_sub_tlv_remore_peer_ipv6,
2691 { "Remote Peer IPv6 Address", "mpls_echo.tlv.dd_map.remote_ipv6",
2692 FT_IPv6, BASE_NONE, NULL, 0x0, "Detailed Downstream Map FEC Stack Change Remote Peer IPv6 Address", HFILL}
2694 { &hf_mpls_echo_tlv_dd_map_type,
2695 { "Sub-TLV Type", "mpls_echo.subtlv.dd_map.type",
2696 FT_UINT16, BASE_DEC, NULL, 0x0, "Detailed Downstream Mapping TLV Type", HFILL}
2698 { &hf_mpls_echo_tlv_dd_map_length,
2699 { "Sub-TLV Length", "mpls_echo.subtlv.dd_map.length",
2700 FT_UINT16, BASE_DEC, NULL, 0x0, "Detailed Downstream Mapping TLV Length", HFILL}
2702 { &hf_mpls_echo_tlv_dd_map_value,
2703 { "Sub-TLV Value", "mpls_echo.subtlv.dd_map.value",
2704 FT_BYTES, BASE_NONE, NULL, 0x0, "Detailed Downstream Mapping TLV Value", HFILL}
2706 { &hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv4_p2mp_id,
2707 { "P2MP ID", "mpls_echo.tlv.fec.rsvp_p2mp_ipv4_id",
2708 FT_UINT32, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP P2MP ID", HFILL}
2710 { &hf_mpls_echo_tlv_fec_rsvp_p2mp_ip_mbz1,
2711 { "Must Be Zero", "mpls_echo.tlv.fec.rsvp_p2mp_ip_mbz1",
2712 FT_UINT16, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP P2MP MBZ", HFILL}
2714 { &hf_mpls_echo_tlv_fec_rsvp_p2mp_ip_tunnel_id,
2715 { "Tunnel ID", "mpls_echo.tlv.fec.rsvp_p2mp_ip_tun_id",
2716 FT_UINT16, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP P2MP Tunnel ID", HFILL}
2718 { &hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv4_ext_tunnel_id,
2719 { "Extended Tunnel ID", "mpls_echo.tlv.fec.rsvp_p2mp_ipv4_ext_tun_id",
2720 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP P2MP IPv4 Extended Tunnel ID", HFILL}
2722 { &hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv4_ipv4_sender,
2723 { "IPv4 Tunnel sender address", "mpls_echo.tlv.fec.rsvp_p2mp_ipv4_sender",
2724 FT_IPv4, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP P2MP IPv4 Sender", HFILL}
2726 { &hf_mpls_echo_tlv_fec_rsvp_p2mp_ip_mbz2,
2727 { "Must Be Zero", "mpls_echo.tlv.fec.rsvp_p2mp_ip_mbz2",
2728 FT_UINT16, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP P2MP MBZ", HFILL}
2730 { &hf_mpls_echo_tlv_fec_rsvp_p2mp_ip_lsp_id,
2731 { "LSP ID", "mpls_echo.tlv.fec.rsvp_p2mp_ip_lsp_id",
2732 FT_UINT16, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP P2MP LSP ID", HFILL}
2734 { &hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv6_p2mp_id,
2735 { "P2MP IPv6 Tunnel ID address", "mpls_echo.tlv.fec.rsvp_p2mp_ipv6_id",
2736 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP P2MP IPv6 ID", HFILL}
2738 { &hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv6_ext_tunnel_id,
2739 { "Extended Tunnel ID", "mpls_echo.tlv.fec.rsvp_p2mp_ipv6_ext_tun_id",
2740 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP P2MP IPv6 Extended Tunnel ID", HFILL}
2742 { &hf_mpls_echo_tlv_fec_rsvp_p2mp_ipv6_ipv6_sender,
2743 { "P2MP IPv6 Tunnel sender address", "mpls_echo.tlv.fec.rsvp_p2mp_ipv6_sender",
2744 FT_IPv6, BASE_NONE, NULL, 0x0, "MPLS ECHO TLV FEC Stack RSVP P2MP IPv6 Sender", HFILL}
2746 { &hf_mpls_echo_tlv_responder_indent_type,
2747 { "Target Type", "mpls_echo.tlv.resp_id.type",
2748 FT_UINT16, BASE_DEC, VALS(mpls_echo_tlv_responder_ident_sub_tlv_type), 0x0, "P2MP Responder ID TLV", HFILL}
2750 { &hf_mpls_echo_tlv_responder_indent_len,
2751 { "Length", "mpls_echo.tlv.resp_id.length",
2752 FT_UINT16, BASE_DEC, NULL, 0x0, "P2MP Responder ID TLV LENGTH", HFILL}
2754 { &hf_mpls_echo_tlv_responder_indent_ipv4,
2755 { "Target IPv4 Address", "mpls_echo.tlv.resp_id.ipv4",
2756 FT_IPv4, BASE_NONE, NULL, 0x0, "P2MP Responder ID TLV IPv4 Address", HFILL}
2758 { &hf_mpls_echo_tlv_responder_indent_ipv6,
2759 { "Target IPv6 Address", "mpls_echo.tlv.resp_id.ipv6",
2760 FT_IPv6, BASE_NONE, NULL, 0x0, "P2MP Responder ID TLV IPv6 Address", HFILL}
2762 { &hf_mpls_echo_tlv_echo_jitter,
2763 { "Echo Jitter time", "mpls_echo.tlv.echo_jitter",
2764 FT_UINT32, BASE_DEC, NULL, 0x0, "MPLS ECHO Jitter time", HFILL}
2766 { &hf_mpls_echo_tlv_bfd,
2767 { "BFD Discriminator", "mpls_echo.bfd_discriminator",
2768 FT_UINT32, BASE_HEX, NULL, 0x0, "MPLS ECHO BFD Discriminator", HFILL}
2772 static int *ett[] = {
2773 &ett_mpls_echo,
2774 &ett_mpls_echo_gflags,
2775 &ett_mpls_echo_tlv,
2776 &ett_mpls_echo_tlv_fec,
2777 &ett_mpls_echo_tlv_ds_map,
2778 &ett_mpls_echo_tlv_ilso,
2779 &ett_mpls_echo_tlv_dd_map,
2780 &ett_mpls_echo_tlv_ddstlv_map
2783 static ei_register_info ei[] = {
2784 { &ei_mpls_echo_tlv_fec_len, { "mpls_echo.tlv.fec.len.invalid", PI_MALFORMED, PI_ERROR, "Invalid FEC TLV length", EXPFILL }},
2785 { &ei_mpls_echo_tlv_dd_map_subtlv_len, { "mpls_echo.tlv.dd_map.subtlv_len.invalid", PI_MALFORMED, PI_ERROR, "Invalid Sub-TLV length", EXPFILL }},
2786 { &ei_mpls_echo_tlv_len, { "mpls_echo.tlv.len.invalid", PI_MALFORMED, PI_ERROR, "Invalid TLV length", EXPFILL }},
2787 { &ei_mpls_echo_tlv_ds_map_muti_len, { "mpls_echo.tlv.ds_map.multi_len.invalid", PI_MALFORMED, PI_ERROR, "Invalid Multipath TLV length", EXPFILL }},
2788 { &ei_mpls_echo_unknown_address_type, { "mpls_echo.address_type.unknown", PI_UNDECODED, PI_WARN, "Unknown Address Type", EXPFILL }},
2789 { &ei_mpls_echo_incorrect_address_type, { "mpls_echo.address_type.incorrect", PI_PROTOCOL, PI_WARN, "Incorrect address type for TLV?", EXPFILL }},
2790 { &ei_mpls_echo_malformed, { "mpls_echo.malformed", PI_MALFORMED, PI_ERROR, "Malformed MPLS message", EXPFILL }},
2793 expert_module_t* expert_mpls_echo;
2795 proto_mpls_echo = proto_register_protocol("Multiprotocol Label Switching Echo", "MPLS Echo", "mpls-echo");
2797 proto_register_field_array(proto_mpls_echo, hf, array_length(hf));
2798 proto_register_subtree_array(ett, array_length(ett));
2799 expert_mpls_echo = expert_register_protocol(proto_mpls_echo);
2800 expert_register_field_array(expert_mpls_echo, ei, array_length(ei));
2802 mpls_echo_handle = register_dissector("mpls-echo", dissect_mpls_echo, proto_mpls_echo);
2806 void
2807 proto_reg_handoff_mpls_echo(void)
2809 dissector_add_uint_with_preference("udp.port", UDP_PORT_MPLS_ECHO, mpls_echo_handle);
2811 dissector_add_uint("pwach.channel_type", PW_ACH_TYPE_ONDEMAND_CV, mpls_echo_handle);
2815 * Editor modelines - https://www.wireshark.org/tools/modelines.html
2817 * Local variables:
2818 * c-basic-offset: 4
2819 * tab-width: 8
2820 * indent-tabs-mode: nil
2821 * End:
2823 * vi: set shiftwidth=4 tabstop=8 expandtab:
2824 * :indentSize=4:tabSize=8:noTabs=true: