Coverage Report

Created: 2025-08-04 07:15

/src/wireshark/epan/dissectors/packet-ldp.c
Line
Count
Source (jump to first uncovered line)
1
/* packet-ldp.c
2
 * Routines for LDP (RFC 3036) packet disassembly
3
 *
4
 * Copyright (c) November 2000 by Richard Sharpe <rsharpe@ns.aus.com>
5
 *
6
 * CRLDP (RFC3212) is now supported
7
 *   - (c) 2002 Michael Rozhavsky <mike[AT]tochna.technion.ac.il>
8
 *
9
 * (c) Copyright 2011, Shobhank Sharma <ssharma5@ncsu.edu>
10
 *   -  update the VCCV bitmaps as per RFC 5885
11
 *
12
 * (c) Copyright 2012, Aditya Ambadkar and Diana Chris <arambadk,dvchris@ncsu.edu>
13
 *   -  support for the flowlabel sub-tlv as per RFC 6391
14
 *
15
 * (c) Copyright 2013, Gaurav Patwardhan <gspatwar@ncsu.edu>
16
 *   -  support for the GTSM flag as per RFC 6720
17
 *
18
 * (c) Copyright 2013, Rupesh Patro <rbpatro@ncsu.edu>
19
 *   -  Support for Upstream-Assigned Label TLVs and Sub-TLVs as per RFC 6389
20
 *
21
 * Wireshark - Network traffic analyzer
22
 * By Gerald Combs <gerald@wireshark.org>
23
 * Copyright 1999 Gerald Combs
24
 *
25
 * SPDX-License-Identifier: GPL-2.0-or-later
26
 */
27
28
#include "config.h"
29
30
#include <epan/packet.h>
31
#include <epan/exceptions.h>
32
#include <epan/addr_resolv.h>
33
#include <epan/prefs.h>
34
#include <epan/afn.h>
35
#include <epan/expert.h>
36
#include <epan/show_exception.h>
37
#include <epan/tfs.h>
38
#include <wsutil/array.h>
39
40
#include "packet-diffserv-mpls-common.h"
41
#include "packet-ldp.h"
42
43
14
#define TCP_PORT_LDP 646
44
14
#define UDP_PORT_LDP 646
45
46
47
void proto_register_ldp(void);
48
void proto_reg_handoff_ldp(void);
49
50
static dissector_handle_t ldp_tcp_handle, ldp_handle;
51
52
static int proto_ldp;
53
54
/* Delete the following if you do not use it, or add to it if you need */
55
/* static int hf_ldp_req; */
56
/* static int hf_ldp_rsp; */
57
static int hf_ldp_version;
58
static int hf_ldp_pdu_len;
59
static int hf_ldp_lsr;
60
static int hf_ldp_ls_id;
61
static int hf_ldp_msg_ubit;
62
static int hf_ldp_msg_type;
63
static int hf_ldp_msg_len;
64
static int hf_ldp_msg_id;
65
static int hf_ldp_msg_vendor_id;
66
static int hf_ldp_msg_experiment_id;
67
static int hf_ldp_tlv_value;
68
static int hf_ldp_tlv_type;
69
static int hf_ldp_tlv_unknown;
70
static int hf_ldp_tlv_len;
71
static int hf_ldp_tlv_val_hold;
72
static int hf_ldp_tlv_val_target;
73
static int hf_ldp_tlv_val_request;
74
static int hf_ldp_tlv_val_res;
75
static int hf_ldp_tlv_val_gtsm_flag;
76
static int hf_ldp_tlv_ipv4_taddr;
77
static int hf_ldp_tlv_config_seqno;
78
static int hf_ldp_tlv_ipv6_taddr;
79
static int hf_ldp_tlv_fec_wc;
80
static int hf_ldp_tlv_fec_af;
81
static int hf_ldp_tlv_fec_len;
82
static int hf_ldp_tlv_fec_pfval;
83
static int hf_ldp_tlv_fec_hoval;
84
static int hf_ldp_tlv_addrl_addr_family;
85
static int hf_ldp_tlv_addrl_addr;
86
static int hf_ldp_tlv_hc_value;
87
static int hf_ldp_tlv_pv_lsrid;
88
static int hf_ldp_tlv_generic_label;
89
static int hf_ldp_tlv_atm_label_vbits;
90
static int hf_ldp_tlv_atm_label_vpi;
91
static int hf_ldp_tlv_atm_label_vci;
92
static int hf_ldp_tlv_fr_label_len;
93
static int hf_ldp_tlv_fr_label_dlci;
94
static int hf_ldp_tlv_ft_protect_sequence_num;
95
static int hf_ldp_tlv_status_ebit;
96
static int hf_ldp_tlv_status_fbit;
97
static int hf_ldp_tlv_status_data;
98
static int hf_ldp_tlv_status_msg_id;
99
static int hf_ldp_tlv_status_msg_type;
100
static int hf_ldp_tlv_extstatus_data;
101
static int hf_ldp_tlv_returned_version;
102
static int hf_ldp_tlv_returned_pdu_len;
103
static int hf_ldp_tlv_returned_lsr;
104
static int hf_ldp_tlv_returned_ls_id;
105
static int hf_ldp_tlv_returned_msg_ubit;
106
static int hf_ldp_tlv_returned_msg_type;
107
static int hf_ldp_tlv_returned_msg_len;
108
static int hf_ldp_tlv_returned_msg_id;
109
static int hf_ldp_tlv_mac;
110
static int hf_ldp_tlv_sess_ver;
111
static int hf_ldp_tlv_sess_ka;
112
static int hf_ldp_tlv_sess_advbit;
113
static int hf_ldp_tlv_sess_ldetbit;
114
static int hf_ldp_tlv_sess_pvlim;
115
static int hf_ldp_tlv_sess_mxpdu;
116
static int hf_ldp_tlv_sess_rxlsr;
117
static int hf_ldp_tlv_sess_rxls;
118
static int hf_ldp_tlv_sess_atm_merge;
119
static int hf_ldp_tlv_sess_atm_lr;
120
static int hf_ldp_tlv_sess_atm_dir;
121
static int hf_ldp_tlv_sess_atm_minvpi;
122
static int hf_ldp_tlv_sess_atm_maxvpi;
123
static int hf_ldp_tlv_sess_atm_minvci;
124
static int hf_ldp_tlv_sess_atm_maxvci;
125
static int hf_ldp_tlv_sess_fr_merge;
126
static int hf_ldp_tlv_sess_fr_lr;
127
static int hf_ldp_tlv_sess_fr_dir;
128
static int hf_ldp_tlv_sess_fr_len;
129
static int hf_ldp_tlv_sess_fr_mindlci;
130
static int hf_ldp_tlv_sess_fr_maxdlci;
131
static int hf_ldp_tlv_ft_sess_flags;
132
static int hf_ldp_tlv_ft_sess_flag_r;
133
static int hf_ldp_tlv_ft_sess_flag_res;
134
static int hf_ldp_tlv_ft_sess_flag_s;
135
static int hf_ldp_tlv_ft_sess_flag_a;
136
static int hf_ldp_tlv_ft_sess_flag_c;
137
static int hf_ldp_tlv_ft_sess_flag_l;
138
static int hf_ldp_tlv_ft_sess_res;
139
static int hf_ldp_tlv_ft_sess_reconn_to;
140
static int hf_ldp_tlv_ft_sess_recovery_time;
141
static int hf_ldp_tlv_ft_ack_sequence_num;
142
static int hf_ldp_tlv_lbl_req_msg_id;
143
static int hf_ldp_tlv_vendor_id;
144
static int hf_ldp_tlv_experiment_id;
145
static int hf_ldp_tlv_fec_vc_controlword;
146
static int hf_ldp_tlv_fec_vc_vctype;
147
static int hf_ldp_tlv_fec_vc_infolength;
148
static int hf_ldp_tlv_fec_vc_groupid;
149
static int hf_ldp_tlv_fec_vc_vcid;
150
static int hf_ldp_tlv_fec_vc_intparam_length;
151
static int hf_ldp_tlv_fec_vc_intparam_mtu;
152
static int hf_ldp_tlv_fec_vc_intparam_tdmbps;
153
static int hf_ldp_tlv_fec_vc_intparam_id;
154
static int hf_ldp_tlv_fec_vc_intparam_maxcatmcells;
155
static int hf_ldp_tlv_fec_vc_intparam_desc;
156
static int hf_ldp_tlv_fec_vc_intparam_cepbytes;
157
static int hf_ldp_tlv_fec_vc_intparam_cepopt_ais;
158
static int hf_ldp_tlv_fec_vc_intparam_cepopt_une;
159
static int hf_ldp_tlv_fec_vc_intparam_cepopt_rtp;
160
static int hf_ldp_tlv_fec_vc_intparam_cepopt_ebm;
161
static int hf_ldp_tlv_fec_vc_intparam_cepopt_mah;
162
static int hf_ldp_tlv_fec_vc_intparam_cepopt_res;
163
static int hf_ldp_tlv_fec_vc_intparam_cepopt_ceptype;
164
static int hf_ldp_tlv_fec_vc_intparam_cepopt_t3;
165
static int hf_ldp_tlv_fec_vc_intparam_cepopt_e3;
166
static int hf_ldp_tlv_fec_vc_intparam_vlanid;
167
static int hf_ldp_tlv_fec_vc_intparam_dlcilen;
168
static int hf_ldp_tlv_fec_vc_intparam_fcslen;
169
static int hf_ldp_tlv_fec_vc_intparam_tdmopt_r;
170
static int hf_ldp_tlv_fec_vc_intparam_tdmopt_d;
171
static int hf_ldp_tlv_fec_vc_intparam_tdmopt_f;
172
static int hf_ldp_tlv_fec_vc_intparam_tdmopt_res1;
173
static int hf_ldp_tlv_fec_vc_intparam_tdmopt_pt;
174
static int hf_ldp_tlv_fec_vc_intparam_tdmopt_res2;
175
static int hf_ldp_tlv_fec_vc_intparam_tdmopt_freq;
176
static int hf_ldp_tlv_fec_vc_intparam_tdmopt_ssrc;
177
static int hf_ldp_tlv_fec_vc_intparam_vccv_cctype_cw;
178
static int hf_ldp_tlv_fec_vc_intparam_vccv_cctype_mplsra;
179
static int hf_ldp_tlv_fec_vc_intparam_vccv_cctype_ttl1;
180
static int hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_icmpping;
181
static int hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_lspping;
182
static int hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd1;
183
static int hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd2;
184
static int hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd3;
185
static int hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd4;
186
static int hf_ldp_tlv_fec_vc_intparam_flowlabel_t;                    /* Flow label interface parameter RFC6391 */
187
static int hf_ldp_tlv_fec_vc_intparam_flowlabel_r;                    /* Flow label interface parameter RFC6391 */
188
static int hf_ldp_tlv_fec_vc_intparam_flowlabel_res;                  /* Flow label interface parameter RFC6391 */
189
static int hf_ldp_tlv_lspid_act_flg;
190
static int hf_ldp_tlv_lspid_cr_lsp;
191
static int hf_ldp_tlv_lspid_ldpid;
192
static int hf_ldp_tlv_er_hop_loose;
193
static int hf_ldp_tlv_er_hop_prelen;
194
static int hf_ldp_tlv_er_hop_prefix4;
195
static int hf_ldp_tlv_er_hop_prefix6;
196
static int hf_ldp_tlv_er_hop_as;
197
static int hf_ldp_tlv_er_hop_cr_lsp;
198
static int hf_ldp_tlv_er_hop_ldpid;
199
static int hf_ldp_tlv_flags_reserv;
200
static int hf_ldp_tlv_flags_weight;
201
static int hf_ldp_tlv_flags_ebs;
202
static int hf_ldp_tlv_flags_cbs;
203
static int hf_ldp_tlv_flags_cdr;
204
static int hf_ldp_tlv_flags_pbs;
205
static int hf_ldp_tlv_flags_pdr;
206
static int hf_ldp_tlv_frequency;
207
static int hf_ldp_tlv_pdr;
208
static int hf_ldp_tlv_pbs;
209
static int hf_ldp_tlv_cdr;
210
static int hf_ldp_tlv_cbs;
211
static int hf_ldp_tlv_ebs;
212
static int hf_ldp_tlv_weight;
213
static int hf_ldp_tlv_set_prio;
214
static int hf_ldp_tlv_hold_prio;
215
static int hf_ldp_tlv_route_pinning;
216
static int hf_ldp_tlv_resource_class;
217
/* static int hf_ldp_tlv_diffserv; */
218
static int hf_ldp_tlv_diffserv_type;
219
static int hf_ldp_tlv_diffserv_mapnb;
220
static int hf_ldp_tlv_diffserv_map;
221
static int hf_ldp_tlv_diffserv_map_exp;
222
static int hf_ldp_tlv_diffserv_phbid;
223
static int hf_ldp_tlv_diffserv_phbid_dscp;
224
static int hf_ldp_tlv_diffserv_phbid_code;
225
static int hf_ldp_tlv_diffserv_phbid_bit14;
226
static int hf_ldp_tlv_diffserv_phbid_bit15;
227
static int hf_ldp_tlv_fec_gen_agi_type;
228
static int hf_ldp_tlv_fec_gen_agi_length;
229
static int hf_ldp_tlv_fec_gen_agi_value;
230
static int hf_ldp_tlv_fec_gen_saii_type;
231
static int hf_ldp_tlv_fec_gen_saii_length;
232
static int hf_ldp_tlv_fec_gen_saii_value;
233
static int hf_ldp_tlv_fec_gen_taii_type;
234
static int hf_ldp_tlv_fec_gen_taii_length;
235
static int hf_ldp_tlv_fec_gen_taii_value;
236
static int hf_ldp_tlv_fec_gen_aai_globalid;
237
static int hf_ldp_tlv_fec_gen_aai_prefix;
238
static int hf_ldp_tlv_fec_gen_aai_ac_id;
239
static int hf_ldp_tlv_fec_pw_controlword;
240
static int hf_ldp_tlv_fec_pw_pwtype;
241
static int hf_ldp_tlv_fec_pw_infolength;
242
static int hf_ldp_tlv_fec_pw_groupid;
243
static int hf_ldp_tlv_fec_pw_pwid;
244
static int hf_ldp_tlv_pw_status_data;
245
static int hf_ldp_tlv_pw_not_forwarding;
246
static int hf_ldp_tlv_pw_lac_ingress_recv_fault;
247
static int hf_ldp_tlv_pw_lac_egress_recv_fault;
248
static int hf_ldp_tlv_pw_psn_pw_ingress_recv_fault;
249
static int hf_ldp_tlv_pw_psn_pw_egress_recv_fault;
250
static int hf_ldp_tlv_pw_grouping_value;
251
static int hf_ldp_tlv_intparam_length;
252
static int hf_ldp_tlv_intparam_mtu;
253
static int hf_ldp_tlv_intparam_tdmbps;
254
static int hf_ldp_tlv_intparam_id;
255
static int hf_ldp_tlv_intparam_maxcatmcells;
256
static int hf_ldp_tlv_intparam_desc;
257
static int hf_ldp_tlv_intparam_cepbytes;
258
static int hf_ldp_tlv_intparam_cepopt_ais;
259
static int hf_ldp_tlv_intparam_cepopt_une;
260
static int hf_ldp_tlv_intparam_cepopt_rtp;
261
static int hf_ldp_tlv_intparam_cepopt_ebm;
262
static int hf_ldp_tlv_intparam_cepopt_mah;
263
static int hf_ldp_tlv_intparam_cepopt_res;
264
static int hf_ldp_tlv_intparam_cepopt_ceptype;
265
static int hf_ldp_tlv_intparam_cepopt_t3;
266
static int hf_ldp_tlv_intparam_cepopt_e3;
267
static int hf_ldp_tlv_intparam_vlanid;
268
static int hf_ldp_tlv_intparam_dlcilen;
269
static int hf_ldp_tlv_intparam_fcslen;
270
static int hf_ldp_tlv_intparam_tdmopt_r;
271
static int hf_ldp_tlv_intparam_tdmopt_d;
272
static int hf_ldp_tlv_intparam_tdmopt_f;
273
static int hf_ldp_tlv_intparam_tdmopt_res1;
274
static int hf_ldp_tlv_intparam_tdmopt_pt;
275
static int hf_ldp_tlv_intparam_tdmopt_res2;
276
static int hf_ldp_tlv_intparam_tdmopt_freq;
277
static int hf_ldp_tlv_intparam_tdmopt_ssrc;
278
static int hf_ldp_tlv_intparam_vccv_cctype_cw;
279
static int hf_ldp_tlv_intparam_vccv_cctype_mplsra;
280
static int hf_ldp_tlv_intparam_vccv_cctype_ttl1;
281
static int hf_ldp_tlv_intparam_vccv_cvtype_icmpping;
282
static int hf_ldp_tlv_intparam_vccv_cvtype_lspping;
283
static int hf_ldp_tlv_intparam_vccv_cvtype_bfd;
284
static int hf_ldp_tlv_upstr_sbit;
285
static int hf_ldp_tlv_upstr_lbl_req_resvbit;
286
static int hf_ldp_tlv_upstr_ass_lbl;
287
static int hf_ldp_tlv_upstr_lbl_resvbit;
288
static int hf_ldp_tlv_ipv4_intID_hop_addr;
289
static int hf_ldp_tlv_logical_intID;
290
static int hf_ldp_tlv_ip_multicast_srcaddr;
291
static int hf_ldp_tlv_ip_multicast_mltcstaddr;
292
static int hf_ldp_tlv_ldp_p2mp_lsptype;
293
static int hf_ldp_tlv_ip_mpls_context_srcaddr;
294
static int hf_ldp_tlv_ldp_p2mp_addrfam;
295
static int hf_ldp_tlv_ldp_p2mp_addrlen;
296
static int hf_ldp_tlv_ldp_p2mp_rtnodeaddr;
297
static int hf_ldp_tlv_ldp_p2mp_oplength;
298
static int hf_ldp_tlv_ldp_p2mp_opvalue;
299
static int hf_ldp_tlv_rsvp_te_p2mp_id;
300
static int hf_ldp_tlv_must_be_zero;
301
static int hf_ldp_tlv_tunnel_id;
302
static int hf_ldp_tlv_ext_tunnel_id;
303
static int hf_ldp_tlv_inv_length;
304
static int hf_ldp_returned_pdu_data;
305
static int hf_ldp_returned_message_parameters;
306
static int hf_ldp_data;
307
static int hf_ldp_unknown_data;
308
309
310
static int ett_ldp;
311
static int ett_ldp_header;
312
static int ett_ldp_ldpid;
313
static int ett_ldp_message;
314
static int ett_ldp_tlv;
315
static int ett_ldp_tlv_val;
316
static int ett_ldp_tlv_ft_flags;
317
static int ett_ldp_fec;
318
static int ett_ldp_fec_vc_interfaceparam;
319
static int ett_ldp_fec_vc_interfaceparam_cepopt;
320
static int ett_ldp_fec_vc_interfaceparam_vccvtype;
321
static int ett_ldp_diffserv_map;
322
static int ett_ldp_diffserv_map_phbid;
323
static int ett_ldp_gen_agi;
324
static int ett_ldp_gen_saii;
325
static int ett_ldp_gen_taii;
326
static int ett_ldp_gen_aai_type2;
327
static int ett_ldp_sub_tlv;
328
329
static expert_field ei_ldp_dtsm_and_target;
330
static expert_field ei_ldp_gtsm_supported;
331
static expert_field ei_ldp_gtsm_not_supported_basic_discovery;
332
static expert_field ei_ldp_gtsm_not_supported;
333
static expert_field ei_ldp_inv_length;
334
static expert_field ei_ldp_tlv_fec_vc_infolength;
335
static expert_field ei_ldp_tlv_fec_type;
336
static expert_field ei_ldp_tlv_fec_len;
337
static expert_field ei_ldp_malformed_data;
338
static expert_field ei_ldp_address_family_not_implemented;
339
static expert_field ei_ldp_malformed_interface_parameter;
340
static expert_field ei_ldp_tlv_fec;
341
342
/* desegmentation of LDP over TCP */
343
static bool ldp_desegment = true;
344
345
/*
346
 * The following define all the TLV types I know about
347
 * http://www.iana.org/assignments/ldp-namespaces
348
 */
349
#define TLV_SEQUENCE_NUMBER                     0x0001  /* [RFC7769] */
350
37
#define TLV_FEC                                 0x0100  /* [RFC5036] */
351
24
#define TLV_ADDRESS_LIST                        0x0101  /* [RFC5036] */
352
2
#define TLV_HOP_COUNT                           0x0103  /* [RFC5036] */
353
6
#define TLV_PATH_VECTOR                         0x0104  /* [RFC5036] */
354
5
#define TLV_GENERIC_LABEL                       0x0200  /* [RFC5036] */
355
4
#define TLV_ATM_LABEL                           0x0201  /* [RFC5036] */
356
5
#define TLV_FRAME_RELAY_LABEL                   0x0202  /* [RFC5036] */
357
2
#define TLV_FT_PROTECTION                       0x0203  /* [RFC3479] */
358
0
#define TLV_LDP_UPSTREAM_ASSIGNED_LABEL         0x0204  /* [RFC6389] */
359
0
#define TLV_LDP_UPSTREAM_ASSIGNED_LABEL_REQUEST 0x0205  /* [RFC6389] */
360
2
#define TLV_ENTROPY_LABEL_CAPA                  0x0206  /* [RFC6790] */
361
2
#define TLV_STATUS                              0x0300  /* [RFC5036] */
362
1
#define TLV_EXTENDED_STATUS                     0x0301  /* [RFC5036] */
363
2
#define TLV_RETURNED_PDU                        0x0302  /* [RFC5036] */
364
3
#define TLV_RETURNED_MESSAGE                    0x0303  /* [RFC5036] */
365
#define TLV_RETURNED_TLVS                       0x0304  /* [RFC5561] */
366
11
#define TLV_COMMON_HELLO_PARAMS                 0x0400  /* [RFC5036] */
367
2
#define TLV_IPV4_TRANSPORT_ADDRESS              0x0401  /* [RFC5036] */
368
1
#define TLV_CONFIGURATION_SEQUENCE_NUMBER       0x0402  /* [RFC5036] */
369
0
#define TLV_IPV6_TRANSPORT_ADDRESS              0x0403  /* [RFC5036] */
370
19
#define TLV_MAC                                 0x0404  /* [RFC4762] */
371
#define TLV_CRYPTOGRAPHIC_AUTHENTICATION        0x0405  /* [RFC7349] */
372
#define TLV_MAC_FLUSH_PARAMS                    0x0406  /* [RFC7361] */
373
#define TLV_PBB_B_MAC_LIST_SUB                  0x0407  /* [RFC7361] */
374
#define TLV_PBB_I_SID_LIST_SUB                  0x0408  /* [RFC7361] */
375
5
#define TLV_COMMON_SESSION_PARAMS               0x0500  /* [RFC5036] */
376
0
#define TLV_ATM_SESSION_PARAMS                  0x0501  /* [RFC5036] */
377
5
#define TLV_FRAME_RELAY_SESSION_PARAMS          0x0502  /* [RFC5036] */
378
0
#define TLV_FT_SESSION                          0x0503  /* [RFC3479] */
379
0
#define TLV_FT_ACK                              0x0504  /* [RFC3479] */
380
1
#define TLV_FT_CORK                             0x0505  /* [RFC3479] */
381
#define TLV_DYNAMIC_CAPA_ANNOUNCEMENT           0x0506  /* [RFC5561] */
382
0
#define TLV_LDP_UPSTREAM_LABEL_ASSIGNMENT_CAPA  0x0507  /* [RFC6389] */
383
#define TLV_P2MP_CAPA_PARAM                     0x0508  /* [RFC6388] */
384
#define TLV_MP2MP_CAPA_PARAM                    0x0509  /* [RFC6388] */
385
#define TLV_MBB_CAPA_PARAM                      0x050A  /* [RFC6388] */
386
#define TLV_TYPED_WILDCARD_FEC_CAPA             0x050B  /* [RFC5918] */
387
#define TLV_MULTI_TOPOLOGY_CAPA                 0x050C  /* [RFC7307] */
388
#define TLV_STATE_ADVERTISEMENT_CONTROL_CAPA    0x050D  /* [RFC7473] */
389
#define TLV_MRT_CAPA                            0x050E  /* [RFC8320] */
390
#define TLV_TARGETED_APPLICATION_CAPA           0x050F  /* [RFC8223] */
391
#define TLV_MT_MULTIPOINT_CAPA                  0x0510  /* [RFC9658] */
392
4
#define TLV_LABEL_REQUEST_MESSAGE_ID            0x0600  /* [RFC5036] */
393
#define TLV_MTU                                 0x0601  /* [RFC3988] */
394
#define TLV_UNRECOGNIZED_NOTIFICATION_CAPA      0x0603  /* [RFC5919] */
395
#define TLV_ICCP_CAPA                           0x0700  /* [RFC7275] */
396
#define TLV_DUAL_STACK_CAPA                     0x0701  /* [RFC7552] */
397
#define TLV_P2MP_PW_CAPA                        0x0703  /* [RFC8338] */
398
#define TLV_EXPLICIT_ROUTE                      0x0800  /* [RFC3212] */
399
2
#define TLV_IPV4_PREFIX_ER_HOP                  0x0801  /* [RFC3212] */
400
1
#define TLV_IPV6_PREFIX_ER_HOP                  0x0802  /* [RFC3212] */
401
0
#define TLV_AUTONOMOUS_SYSTEM_NUMBER_ER_HOP     0x0803  /* [RFC3212] */
402
0
#define TLV_LSP_ID_ER_HOP                       0x0804  /* [RFC3212] */
403
#define TLV_L2_PW_ADDRESS_OF_SWITCHING_POINT    0x0805  /* [RFC7392] */
404
0
#define TLV_TRAFFIC_PARAMS                      0x0810  /* [RFC3212] */
405
0
#define TLV_PREEMPTION                          0x0820  /* [RFC3212] */
406
1
#define TLV_LSPID                               0x0821  /* [RFC3212] */
407
0
#define TLV_RESOURCE_CLASS                      0x0822  /* [RFC3212] */
408
2
#define TLV_ROUTE_PINNING                       0x0823  /* [RFC3212] */
409
#define TLV_GENERALIZED_LABEL_REQUEST           0x0824  /* [RFC3472] */
410
#define TLV_GENERALIZED_LABEL                   0x0825  /* [RFC3472] */
411
#define TLV_UPSTREAM_LABEL                      0x0826  /* [RFC3472] */
412
#define TLV_LABEL_SET                           0x0827  /* [RFC3472] */
413
#define TLV_WAVEBAND_LABEL                      0x0828  /* [RFC3472] */
414
0
#define TLV_ER_HOP                              0x0829  /* [RFC3472] */
415
#define TLV_ACCEPTABLE_LABEL_SET                0x082A  /* [RFC3472] */
416
#define TLV_ADMIN_STATUS                        0x082B  /* [RFC3472] */
417
#define TLV_INTERFACE_ID                        0x082C  /* [RFC3472] */
418
0
#define TLV_IPV4_INTERFACE_ID                   0x082D  /* [RFC3472] */
419
#define TLV_IPV6_INTERFACE_ID                   0x082E  /* [RFC3472] */
420
#define TLV_IPV4_IF_ID_STATUS                   0x082F  /* [RFC3472] */
421
#define TLV_IPV6_IF_ID_STATUS                   0x0830  /* [RFC3472] */
422
#define TLV_OP_SP_CALL_ID                       0x0831  /* [RFC3475] */
423
#define TLV_GU_CALL_ID                          0x0832  /* [RFC3475] */
424
#define TLV_CALL_CAPA                           0x0833  /* [RFC3475] */
425
#define TLV_CRANKBACK                           0x0834  /* [RFC3475] */
426
#define TLV_PROTECTION                          0x0835  /* [RFC3472] */
427
#define TLV_LSP_TUNNEL_INTERFACE_ID             0x0836  /* [RFC3480] */
428
#define TLV_UNNUMBERED_INTERFACE_ID             0x0837  /* [RFC3480] */
429
#define TLV_SONET_SDH_TRAFFIC_PARAMS            0x0838  /* [RFC4606] */
430
5
#define TLV_DIFF_SERV                           0x0901  /* [RFC3270] */
431
1
#define TLV_HSMP_LSP_CAPA_PARAM                 0x0902  /* [RFC7140] */
432
#define TLV_IPV4_SOURCE_ID                      0x0960  /* [RFC3476] */
433
#define TLV_IPV6_SOURCE_ID                      0x0961  /* [RFC3476] */
434
#define TLV_NSAP_SOURCE_ID                      0x0962  /* [RFC3476] */
435
#define TLV_IPV4_DESTINATION_ID                 0x0963  /* [RFC3476] */
436
#define TLV_IPV6_DESTINATION_ID                 0x0964  /* [RFC3476] */
437
#define TLV_NSAP_DESTINATION_ID                 0x0965  /* [RFC3476] */
438
#define TLV_EGRESS_LABEL                        0x0966  /* [RFC3476] */
439
#define TLV_LOCAL_CONNECTION_ID                 0x0967  /* [RFC3476] */
440
#define TLV_DIVERSITY                           0x0968  /* [RFC3476] */
441
#define TLV_CONTRACT_ID                         0x0969  /* [RFC3476] */
442
0
#define TLV_PW_STATUS                           0x096A  /* [RFC8077] */
443
0
#define TLV_PW_INTERFACE_PARAMS                 0x096B  /* [RFC8077] */
444
0
#define TLV_PW_GROUP_ID                         0x096C  /* [RFC8077] */
445
#define TLV_PSEUDOWIRE_SWITCHING_POINT_PE       0x096D  /* [RFC6073] */
446
#define TLV_BANDWIDTH                           0x096E  /* [RFC7267] */
447
#define TLV_LDP_MP_STATUS_TLV_TYPE              0x096F  /* [RFC6388] */
448
#define TLV_UNI_SERVICE_LEVEL                   0x0970  /* [RFC3476] */
449
#define TLV_QUEUE_REQUEST                       0x0971  /* [RFC7032] */
450
#define TLV_MP_NODE_PROTECTION_CAPA             0x0972  /* [RFC7715] */
451
#define TLV_PSN_TUNNEL_BINDING                  0x0973  /* [RFC7965] */
452
#define TLV_EGRESS_PROTECTION_CAPA              0x0974  /* [RFC8104] */
453
454
/* Not in IANA list */
455
0
#define TLV_RSVP_TE_P2MP_LSP         0x001C
456
1
#define TLV_LDP_P2MP_LSP             0x001D
457
1
#define TLV_IP_MULTICAST_TUNNEL      0x001E
458
1
#define TLV_MPLS_CONTEXT_LBL         0x001F
459
1.90k
#define TLV_VENDOR_PRIVATE_START     0x3E00
460
33
#define TLV_VENDOR_PRIVATE_END       0x3EFF
461
1.94k
#define TLV_EXPERIMENTAL_START       0x3F00
462
25
#define TLV_EXPERIMENTAL_END         0x3FFF
463
464
static const value_string tlv_type_names[] = {
465
    { TLV_SEQUENCE_NUMBER,                     "Sequence Number TLV"                    },
466
    { TLV_FEC,                                 "FEC"                                    },
467
    { TLV_ADDRESS_LIST,                        "Address List"                           },
468
    { TLV_HOP_COUNT,                           "Hop Count"                              },
469
    { TLV_PATH_VECTOR,                         "Path Vector"                            },
470
    { TLV_GENERIC_LABEL,                       "Generic Label"                          },
471
    { TLV_ATM_LABEL,                           "ATM Label"                              },
472
    { TLV_FRAME_RELAY_LABEL,                   "Frame Relay Label"                      },
473
    { TLV_FT_PROTECTION,                       "FT Protection TLV"                      },
474
    { TLV_LDP_UPSTREAM_ASSIGNED_LABEL,         "LDP Upstream-Assigned Label TLV"        },
475
    { TLV_LDP_UPSTREAM_ASSIGNED_LABEL_REQUEST, "LDP Upstream-Assigned Label Request TLV" },
476
    { TLV_ENTROPY_LABEL_CAPA,                  "Entropy Label Capability TLV"           },
477
    { TLV_STATUS,                              "Status"                                 },
478
    { TLV_EXTENDED_STATUS,                     "Extended Status"                        },
479
    { TLV_RETURNED_PDU,                        "Returned PDU"                           },
480
    { TLV_RETURNED_MESSAGE,                    "Returned Message"                       },
481
    { TLV_RETURNED_TLVS,                       "Returned TLVs"                          },
482
    { TLV_COMMON_HELLO_PARAMS,                 "Common Hello Parameters"                },
483
    { TLV_IPV4_TRANSPORT_ADDRESS,              "IPv4 Transport Address"                 },
484
    { TLV_CONFIGURATION_SEQUENCE_NUMBER,       "Configuration Sequence Number"          },
485
    { TLV_IPV6_TRANSPORT_ADDRESS,              "IPv6 Transport Address"                 },
486
    { TLV_MAC,                                 "MAC TLV"                                },
487
    { TLV_CRYPTOGRAPHIC_AUTHENTICATION,        "Cryptographic Authentication TLV"       },
488
    { TLV_MAC_FLUSH_PARAMS,                    "MAC Flush Parameters TLV"               },
489
    { TLV_PBB_B_MAC_LIST_SUB,                  "PBB B-MAC List Sub-TLV"                 },
490
    { TLV_PBB_I_SID_LIST_SUB,                  "PBB I-SID List Sub-TLV"                 },
491
    { TLV_COMMON_SESSION_PARAMS,               "Common Session Parameters"              },
492
    { TLV_ATM_SESSION_PARAMS,                  "ATM Session Parameters"                 },
493
    { TLV_FRAME_RELAY_SESSION_PARAMS,          "Frame Relay Session Parameters"         },
494
    { TLV_FT_SESSION,                          "FT Session TLV"                         },
495
    { TLV_FT_ACK,                              "FT Ack TLV"                             },
496
    { TLV_FT_CORK,                             "FT Cork TLV"                            },
497
    { TLV_DYNAMIC_CAPA_ANNOUNCEMENT,           "Dynamic Capability Announcement"        },
498
    { TLV_LDP_UPSTREAM_LABEL_ASSIGNMENT_CAPA,  "LDP Upstream Label Assignment Capability TLV" },
499
    { TLV_P2MP_CAPA_PARAM,                     "P2MP Capability Parameter"              },
500
    { TLV_MP2MP_CAPA_PARAM,                    "MP2MP Capability Parameter"             },
501
    { TLV_MBB_CAPA_PARAM,                      "MBB Capability Parameter"               },
502
    { TLV_TYPED_WILDCARD_FEC_CAPA,             "Typed Wildcard FEC Capability"          },
503
    { TLV_MULTI_TOPOLOGY_CAPA,                 "Multi-Topology Capability"              },
504
    { TLV_STATE_ADVERTISEMENT_CONTROL_CAPA,    "State Advertisement Control Capability" },
505
    { TLV_TARGETED_APPLICATION_CAPA,           "Targeted Application Capability"        },
506
    { TLV_MT_MULTIPOINT_CAPA,                  "MT Multipoint Capability"               },
507
    { TLV_LABEL_REQUEST_MESSAGE_ID,            "Label Request Message ID"               },
508
    { TLV_MTU,                                 "MTU TLV"                                },
509
    { TLV_UNRECOGNIZED_NOTIFICATION_CAPA,      "Unrecognized Notification Capability"   },
510
    { TLV_ICCP_CAPA,                           "ICCP capability TLV"                    },
511
    { TLV_DUAL_STACK_CAPA,                     "Dual-Stack capability"                  },
512
    { TLV_P2MP_PW_CAPA,                        "P2MP PW Capability"                     },
513
    { TLV_EXPLICIT_ROUTE,                      "Explicit Route TLV"                     },
514
    { TLV_IPV4_PREFIX_ER_HOP,                  "Ipv4 Prefix ER-Hop TLV"                 },
515
    { TLV_IPV6_PREFIX_ER_HOP,                  "Ipv6 Prefix ER-Hop TLV"                 },
516
    { TLV_AUTONOMOUS_SYSTEM_NUMBER_ER_HOP,     "Autonomous System Number ER-Hop TLV"    },
517
    { TLV_LSP_ID_ER_HOP,                       "LSP-ID ER-HOP TLV"                      },
518
    { TLV_L2_PW_ADDRESS_OF_SWITCHING_POINT,    "L2 PW Address of Switching Point"       },
519
    { TLV_TRAFFIC_PARAMS,                      "Traffic Parameters TLV"                 },
520
    { TLV_PREEMPTION,                          "Preemption TLV"                         },
521
    { TLV_LSPID,                               "LSPID TLV"                              },
522
    { TLV_RESOURCE_CLASS,                      "Resource Class TLV"                     },
523
    { TLV_ROUTE_PINNING,                       "Route Pinning TLV"                      },
524
    { TLV_GENERALIZED_LABEL_REQUEST,           "Generalized Label Request TLV"          },
525
    { TLV_GENERALIZED_LABEL,                   "Generalized Label TLV"                  },
526
    { TLV_UPSTREAM_LABEL,                      "Upstream Label TLV"                     },
527
    { TLV_LABEL_SET,                           "Label Set TLV"                          },
528
    { TLV_WAVEBAND_LABEL,                      "Waveband Label TLV"                     },
529
    { TLV_ER_HOP,                              "ER-Hop TLV"                             },
530
    { TLV_ACCEPTABLE_LABEL_SET,                "Acceptable Label Set TLV"               },
531
    { TLV_ADMIN_STATUS,                        "Admin Status TLV"                       },
532
    { TLV_INTERFACE_ID,                        "Interface ID TLV"                       },
533
    { TLV_IPV4_INTERFACE_ID,                   "IPV4 Interface ID TLV"                  },
534
    { TLV_IPV6_INTERFACE_ID,                   "IPV6 Interface ID TLV"                  },
535
    { TLV_IPV4_IF_ID_STATUS,                   "IPv4 IF_ID Status TLV"                  },
536
    { TLV_IPV6_IF_ID_STATUS,                   "IPv6 IF_ID Status TLV"                  },
537
    { TLV_OP_SP_CALL_ID,                       "Op-Sp Call ID TLV"                      },
538
    { TLV_GU_CALL_ID,                          "GU Call ID TLV"                         },
539
    { TLV_CALL_CAPA,                           "Call Capability TLV"                    },
540
    { TLV_CRANKBACK,                           "Crankback TLV"                          },
541
    { TLV_PROTECTION,                          "Protection TLV"                         },
542
    { TLV_LSP_TUNNEL_INTERFACE_ID,             "LSP_TUNNEL_INTERFACE_ID TLV"            },
543
    { TLV_UNNUMBERED_INTERFACE_ID,             "Unnumbered Interface ID TLV"            },
544
    { TLV_SONET_SDH_TRAFFIC_PARAMS,            "SONET/SDH Traffic Parameters TLV"       },
545
    { TLV_DIFF_SERV,                           "Diff-Serv TLV"                          },
546
    { TLV_HSMP_LSP_CAPA_PARAM,                 "HSMP LSP Capability Parameter"          },
547
    { TLV_IPV4_SOURCE_ID,                      "IPv4 Source ID TLV"                     },
548
    { TLV_IPV6_SOURCE_ID,                      "IPv6 Source ID TLV"                     },
549
    { TLV_NSAP_SOURCE_ID,                      "NSAP Source ID TLV"                     },
550
    { TLV_IPV4_DESTINATION_ID,                 "IPv4 Destination ID TLV"                },
551
    { TLV_IPV6_DESTINATION_ID,                 "IPv6 Destination ID TLV"                },
552
    { TLV_NSAP_DESTINATION_ID,                 "NSAP Destination ID TLV"                },
553
    { TLV_EGRESS_LABEL,                        "Egress Label TLV"                       },
554
    { TLV_LOCAL_CONNECTION_ID,                 "Local Connection ID TLV"                },
555
    { TLV_DIVERSITY,                           "Diversity TLV"                          },
556
    { TLV_CONTRACT_ID,                         "Contract ID TLV"                        },
557
    { TLV_PW_STATUS,                           "PW Status TLV"                          },
558
    { TLV_PW_INTERFACE_PARAMS,                 "PW Interface Parameters TLV"            },
559
    { TLV_PW_GROUP_ID,                         "PW Group ID TLV"                        },
560
    { TLV_PSEUDOWIRE_SWITCHING_POINT_PE,       "Pseudowire Switching Point PE TLV"      },
561
    { TLV_BANDWIDTH,                           "Bandwidth TLV"                          },
562
    { TLV_LDP_MP_STATUS_TLV_TYPE,              "LDP MP Status TLV Type"                 },
563
    { TLV_UNI_SERVICE_LEVEL,                   "UNI Service Level TLV"                  },
564
    { TLV_QUEUE_REQUEST,                       "Queue Request TLV"                      },
565
    { TLV_MP_NODE_PROTECTION_CAPA,             "MP Node Protection Capability"          },
566
    { TLV_PSN_TUNNEL_BINDING,                  "PSN Tunnel Binding TLV"                 },
567
    { TLV_EGRESS_PROTECTION_CAPA,              "Egress Protection Capability"           },
568
569
    { TLV_RSVP_TE_P2MP_LSP,                    "RSVP-TE P2MP LSP TLV"                   },
570
    { TLV_LDP_P2MP_LSP,                        "LDP P2MP LSP TLV"                       },
571
    { TLV_IP_MULTICAST_TUNNEL,                 "IP Multicast Tunnel TLV"                },
572
573
    { 0, NULL}
574
};
575
576
/*
577
 * https://www.iana.org/assignments/ldp-namespaces
578
 */
579
580
#define LDP_NOTIFICATION                0x0001  /* [RFC5036] */
581
#define LDP_HELLO                       0x0100  /* [RFC5036] */
582
#define LDP_INITIALIZATION              0x0200  /* [RFC5036] */
583
#define LDP_KEEPALIVE                   0x0201  /* [RFC5036] */
584
#define LDP_CAPABILITY                  0x0202  /* [RFC5561] */
585
#define LDP_ADDRESS                     0x0300  /* [RFC5036] */
586
#define LDP_ADDRESS_WITHDRAWAL          0x0301  /* [RFC5036] */
587
#define LDP_LABEL_MAPPING               0x0400  /* [RFC5036] */
588
#define LDP_LABEL_REQUEST               0x0401  /* [RFC5036] */
589
#define LDP_LABEL_WITHDRAWAL            0x0402  /* [RFC5036] */
590
#define LDP_LABEL_RELEASE               0x0403  /* [RFC5036] */
591
#define LDP_LABEL_ABORT_REQUEST         0x0404  /* [RFC5036] */
592
#define LDP_CALL_SETUP                  0x0500  /* [RFC3475] */
593
#define LDP_CALL_RELEASE                0x0501  /* [RFC3475] */
594
#define LDP_RG_CONNECT_MESSAGE          0x0700  /* [RFC7275] */
595
#define LDP_RG_DISCONNECT_MESSAGE       0x0701  /* [RFC7275] */
596
#define LDP_RG_NOTIFICATION_MESSAGE     0x0702  /* [RFC7275] */
597
#define LDP_RG_APPLICATION_DATA_MESSAGE 0x0703  /* [RFC7275] */
598
653
#define LDP_VENDOR_PRIVATE_START        0x3E00
599
117
#define LDP_VENDOR_PRIVATE_END          0x3EFF
600
639
#define LDP_EXPERIMENTAL_MESSAGE_START  0x3F00
601
113
#define LDP_EXPERIMENTAL_MESSAGE_END    0x3FFF
602
603
static const value_string ldp_message_types[] = {
604
    {LDP_NOTIFICATION,                 "Notification Message"},
605
    {LDP_HELLO,                        "Hello Message"},
606
    {LDP_INITIALIZATION,               "Initialization Message"},
607
    {LDP_KEEPALIVE,                    "Keep Alive Message"},
608
    {LDP_CAPABILITY,                   "Capability Message"},
609
    {LDP_ADDRESS,                      "Address Message"},
610
    {LDP_ADDRESS_WITHDRAWAL,           "Address Withdrawal Message"},
611
    {LDP_LABEL_MAPPING,                "Label Mapping Message"},
612
    {LDP_LABEL_REQUEST,                "Label Request Message"},
613
    {LDP_LABEL_WITHDRAWAL,             "Label Withdrawal Message"},
614
    {LDP_LABEL_RELEASE,                "Label Release Message"},
615
    {LDP_LABEL_ABORT_REQUEST,          "Label Abort Request Message"},
616
    {LDP_CALL_SETUP,                   "Call Setup Message"},
617
    {LDP_CALL_RELEASE,                 "Call Release Message"},
618
    {LDP_RG_CONNECT_MESSAGE,           "RG Connect Message"},
619
    {LDP_RG_DISCONNECT_MESSAGE,        "RG Disconnect Message"},
620
    {LDP_RG_NOTIFICATION_MESSAGE,      "RG Notification Message"},
621
    {LDP_RG_APPLICATION_DATA_MESSAGE,  "RG Application Data Message"},
622
    {LDP_VENDOR_PRIVATE_START,         "Vendor-Private Message"},
623
    {LDP_EXPERIMENTAL_MESSAGE_START,   "Experimental Message"},
624
    {0, NULL}
625
};
626
627
static const true_false_string ldp_message_ubit = {
628
    "Unknown bit set",
629
    "Unknown bit not set"
630
};
631
632
static const true_false_string hello_targeted_vals = {
633
    "Targeted Hello",
634
    "Link Hello"
635
};
636
637
static const value_string tlv_unknown_vals[] = {
638
    {0, "Known TLV, do not Forward"},
639
    {1, "Known TLV, do Forward"},
640
    {2, "Unknown TLV, do not Forward"},
641
    {3, "Unknown TLV, do Forward"},
642
    {0, NULL}
643
};
644
645
6
#define WILDCARD_FEC                  0x01    /* [RFC5036][RFC7358] */
646
3
#define PREFIX_FEC                    0x02    /* [RFC5036][RFC7358] */
647
0
#define HOST_FEC                      0x03    /* "Unassigned" according to IANA */
648
11
#define CRLSP_FEC                     0x04    /* [RFC3212][RFC7358] */
649
0
#define TYPED_WILDCARD_FEC            0x05    /* [RFC5918][RFC7358] */
650
0
#define P2MP_FEC                      0x06    /* [RFC6388][RFC7358] */
651
1
#define MP2MP_FEC_UP                  0x07    /* [RFC6388][RFC7358] */
652
4
#define MP2MP_FEC_DOWN                0x08    /* [RFC6388][RFC7358] */
653
6
#define HSMP_UPSTREAM                 0x09    /* [RFC7140][RFC7358] */
654
7
#define HSMP_DOWNSTREAM               0x0A    /* [RFC7140][RFC7358] */
655
0
#define PWID_FEC_ELEMENT              0x80    /* [RFC8077][RFC7358] */
656
0
#define GENERALIZED_PWID_FEC          0x81    /* [RFC8077][RFC7358] */
657
1
#define P2MP_PW_UPSTREAM_FEC          0x82    /* [RFC8338][RFC7358] */
658
#define PROTECTION_FEC                0x83    /* [RFC8104][RFC7358] */
659
#define P2MP_PW_DOWNSTREAM_FEC        0x84    /* [RFC8338][RFC7358] */
660
661
const value_string fec_types_vals[] = {
662
  {WILDCARD_FEC,                      "Wildcard FEC"},
663
  {PREFIX_FEC,                        "Prefix FEC"},
664
  {HOST_FEC,                          "Host Address FEC"},
665
  {CRLSP_FEC,                         "CR LSP FEC"},
666
  {TYPED_WILDCARD_FEC,                "Typed Wildcard FEC Element"},
667
  {P2MP_FEC,                          "P2MP"},
668
  {MP2MP_FEC_UP,                      "MP2MP-up"},
669
  {MP2MP_FEC_DOWN,                    "MP2MP-down"},
670
  {HSMP_UPSTREAM,                     "HSMP-upstream"},
671
  {HSMP_DOWNSTREAM,                   "HSMP-downstream"},
672
  {PWID_FEC_ELEMENT,                  "PWid FEC Element"},
673
  {GENERALIZED_PWID_FEC,              "Generalized PWid FEC Element"},
674
  {P2MP_PW_UPSTREAM_FEC,              "P2MP PW Upstream FEC Element"},
675
  {PROTECTION_FEC,                    "Protection FEC Element"},
676
  {P2MP_PW_DOWNSTREAM_FEC,            "P2MP PW Downstream FEC Element"},
677
678
  {0, NULL}
679
};
680
681
682
/*
683
 * MPLS Pseudowire Types
684
 *
685
 * RFC 4446
686
 *
687
 * https://www.iana.org/assignments/pwe3-parameters/pwe3-parameters.xhtml#pwe3-parameters-2
688
 */
689
const value_string fec_vc_types_vals[] = {
690
    {0x0001, "Frame Relay DLCI (Martini Mode)"},
691
    {0x0002, "ATM AAL5 SDU VCC transport"},
692
    {0x0003, "ATM transparent cell transport"},
693
    {0x0004, "Ethernet Tagged Mode"},
694
    {0x0005, "Ethernet"},
695
    {0x0006, "HDLC"},
696
    {0x0007, "PPP"},
697
    {0x0008, "SONET/SDH Circuit Emulation Service"},
698
    {0x0009, "ATM n-to-one VCC cell transport"},
699
    {0x000A, "ATM n-to-one VPC cell transport"},
700
    {0x000B, "IP layer2 transport"},
701
    {0x000C, "ATM one-to-one VCC Cell Mode"},
702
    {0x000D, "ATM one-to-one VPC Cell Mode"},
703
    {0x000E, "ATM AAL5 PDU VCC transport"},
704
    {0x000F, "Frame-Relay Port mode"},
705
    {0x0010, "SONET/SDH Circuit Emulation over Packet"},
706
    {0x0011, "Structure-agnostic E1 over Packet"},
707
    {0x0012, "Structure-agnostic T1 (DS1) over Packet"},
708
    {0x0013, "Structure-agnostic E3 over Packet"},
709
    {0x0014, "Structure-agnostic T3 (DS3) over Packet"},
710
    {0x0015, "CESoPSN basic mode"},
711
    {0x0016, "TDMoIP AAL1 Mode"},
712
    {0x0017, "CESoPSN TDM with CAS"},
713
    {0x0018, "TDMoIP AAL2 Mode"},
714
    {0x0019, "Frame Relay DLCI"},
715
    {0x001A, "ROHC Transport Header-compressed Packets"},
716
    {0x001B, "ECRTP Transport Header-compressed Packets"},
717
    {0x001C, "IPHC Transport Header-compressed Packets"},
718
    {0x001D, "cRTP Transport Header-compressed Packets"},
719
    {0x001E, "ATM VP Virtual Trunk"},
720
    {0x001F, "FC Port Mode"},
721
722
    {0, NULL}
723
};
724
725
726
static const value_string fec_vc_ceptype_vals[] = {
727
    {0, "SPE mode (STS-1/STS-Mc)"},
728
    {1, "VT mode (VT1.5/VT2/VT3/VT6)"},
729
    {2, "Fractional SPE (STS-1/VC-3/VC-4)"},
730
    {0, NULL}
731
};
732
733
static const true_false_string fec_vc_tdmopt_r = {
734
    "Expects to receive RTP Header",
735
    "Does not expect to receive RTP Header"
736
};
737
738
static const true_false_string fec_vc_tdmopt_d = {
739
    "Expects the peer to use Differential timestamping",
740
    "Does not expect the peer to use Differential timestamping"
741
};
742
743
static const true_false_string fec_vc_tdmopt_f = {
744
    "Expects TDMoIP encapsulation",
745
    "Expects CESoPSN encapsulation"
746
};
747
748
749
0
#define FEC_VC_INTERFACEPARAM_MTU          0x01
750
0
#define FEC_VC_INTERFACEPARAM_MAXCATMCELLS 0x02
751
0
#define FEC_VC_INTERFACEPARAM_DESCRIPTION  0x03
752
0
#define FEC_VC_INTERFACEPARAM_CEPBYTES     0x04
753
0
#define FEC_VC_INTERFACEPARAM_CEPOPTIONS   0x05
754
0
#define FEC_VC_INTERFACEPARAM_VLANID       0x06
755
0
#define FEC_VC_INTERFACEPARAM_TDMBPS       0x07
756
0
#define FEC_VC_INTERFACEPARAM_FRDLCILEN    0x08
757
0
#define FEC_VC_INTERFACEPARAM_FRAGIND      0x09
758
0
#define FEC_VC_INTERFACEPARAM_FCSRETENT    0x0A
759
0
#define FEC_VC_INTERFACEPARAM_TDMOPTION    0x0B
760
0
#define FEC_VC_INTERFACEPARAM_VCCV         0x0C
761
#define FEC_VC_INTERFACEPARAM_ROHCOMPLS    0x0D
762
#define FEC_VC_INTERFACEPARAM_TDMOIPAAL1C  0x0E
763
#define FEC_VC_INTERFACEPARAM_CEIOMPLS     0x0F
764
#define FEC_VC_INTERFACEPARAM_TDMOIPAAL1   0x10
765
#define FEC_VC_INTERFACEPARAM_TDMOIPAAL2   0x11
766
#define FEC_VC_INTERFACEPARAM_STACK        0x16
767
0
#define FEC_VC_INTERFACEPARAM_FLOWLABEL    0x17
768
#define FEC_VC_INTERFACEPARAM_PWGENFLAGS   0x18
769
#define FEC_VC_INTERFACEPARAM_VCCVEXTCV    0x19
770
#define FEC_VC_INTERFACEPARAM_ETREE        0x1A
771
#define FEC_VC_INTERFACEPARAM_ZTEPRIVATE   0xFD
772
773
774
static const value_string fec_vc_interfaceparm[] = {
775
  {FEC_VC_INTERFACEPARAM_MTU,           "Interface MTU"},
776
  {FEC_VC_INTERFACEPARAM_MAXCATMCELLS,  "Max Concatenated ATM cells"},
777
  {FEC_VC_INTERFACEPARAM_DESCRIPTION,   "Interface Description"},
778
  {FEC_VC_INTERFACEPARAM_CEPBYTES,      "CEP/TDM Payload Bytes"},
779
  {FEC_VC_INTERFACEPARAM_CEPOPTIONS,    "CEP options"},
780
  {FEC_VC_INTERFACEPARAM_VLANID,        "Requested VLAN ID"},
781
  {FEC_VC_INTERFACEPARAM_TDMBPS,        "CEP/TDM bit-rate"},
782
  {FEC_VC_INTERFACEPARAM_FRDLCILEN,     "Frame-Relay DLCI Length"},
783
  {FEC_VC_INTERFACEPARAM_FRAGIND,       "Fragmentation indicator"},
784
  {FEC_VC_INTERFACEPARAM_FCSRETENT,     "FCS retention indicator"},
785
  {FEC_VC_INTERFACEPARAM_TDMOPTION,     "TDM options"},
786
  {FEC_VC_INTERFACEPARAM_VCCV,          "VCCV"},
787
  {FEC_VC_INTERFACEPARAM_ROHCOMPLS,     "ROHC over MPLS configuration"},
788
  {FEC_VC_INTERFACEPARAM_TDMOIPAAL1C,   "TDMoIP AAL1 cells per packet"},
789
  {FEC_VC_INTERFACEPARAM_CEIOMPLS,      "CRTP/ECRTP/IPHC HC over MPLS configuration"},
790
  {FEC_VC_INTERFACEPARAM_TDMOIPAAL1,    "TDMoIP AAL1 mode"},
791
  {FEC_VC_INTERFACEPARAM_TDMOIPAAL2,    "TDMoIP AAL2 Options"},
792
  {FEC_VC_INTERFACEPARAM_STACK,         "Stack capability"},
793
  {FEC_VC_INTERFACEPARAM_FLOWLABEL,     "Flow Label"},
794
  {FEC_VC_INTERFACEPARAM_PWGENFLAGS,    "PW Generic Protocol Flags"},
795
  {FEC_VC_INTERFACEPARAM_VCCVEXTCV,     "VCCV Extended CV Parameter"},
796
  {FEC_VC_INTERFACEPARAM_ETREE,         "E-Tree"},
797
  {FEC_VC_INTERFACEPARAM_ZTEPRIVATE,    "Zte optional Supplier private interface parameters"},
798
799
  {0, NULL},
800
};
801
802
static const true_false_string fec_vc_cbit = {
803
    "Control Word Present",
804
    "Control Word NOT Present"
805
};
806
807
static const value_string tlv_atm_merge_vals[] = {
808
    {0, "Merge not supported"},
809
    {1, "VP merge supported"},
810
    {2, "VC merge supported"},
811
    {3, "VP & VC merge supported"},
812
    {0, NULL}
813
};
814
815
static const value_string tlv_atm_vbits_vals[] = {
816
    {0, "VPI & VCI Significant"},
817
    {1, "Only VPI Significant"},
818
    {2, "Only VCI Significant"},
819
    {3, "VPI & VCI not Significant, nonsense"},
820
    {0, NULL}
821
};
822
823
static const value_string tlv_fr_merge_vals[] = {
824
    {0, "Merge not supported"},
825
    {1, "Merge supported"},
826
    {2, "Unspecified"},
827
    {3, "Unspecified"},
828
    {0, NULL}
829
};
830
831
static const value_string tlv_fr_len_vals[] = {
832
    {0, "10 bits"},
833
    {1, "Reserved"},
834
    {2, "23 bits"},
835
    {3, "Reserved"},
836
    {0, NULL}
837
};
838
839
static const value_string tlv_ft_flags[] = {
840
    { 0, "Invalid"},
841
    { 1, "Using LDP Graceful Restart"},
842
    { 2, "Check-Pointing of all labels"},
843
    { 3, "Invalid"},
844
    { 4, "Invalid"},
845
    { 5, "Invalid"},
846
    { 6, "Check-Pointing of all labels"},
847
    { 7, "Invalid"},
848
    { 8, "Full FT on selected labels"},
849
    { 9, "Invalid"},
850
    {10, "Full FT on selected labels"},
851
    {11, "Invalid"},
852
    {12, "Full FT on all labels"},
853
    {13, "Invalid"},
854
    {14, "Full FT on all labels"},
855
    {15, "Invalid"},
856
    {0, NULL}
857
};
858
859
static const true_false_string tlv_ft_r = {
860
    "LSR has preserved state and resources for all FT-Labels",
861
    "LSR has not preserved state and resources for all FT-Labels"
862
};
863
864
static const true_false_string tlv_ft_s = {
865
    "FT Protection TLV supported on other than KeepAlive",
866
    "FT Protection TLV not supported on other than KeepAlive"
867
};
868
869
static const true_false_string tlv_ft_a = {
870
    "Treat all labels as Sequence Numbered FT Labels",
871
    "May treat some labels as FT and others as non-FT"
872
};
873
874
static const true_false_string tlv_ft_c = {
875
    "Check-Pointing procedures in use",
876
    "Check-Pointing procedures not in use"
877
};
878
879
static const true_false_string tlv_ft_l = {
880
    "Re-learn the state from the network",
881
    "Do not re-learn the state from the network"
882
};
883
884
static const value_string ldp_act_flg_vals[] = {
885
    {0, "indicates initial LSP setup"},
886
    {1, "indicates modify LSP"},
887
    {0, NULL}
888
};
889
890
static const value_string route_pinning_vals[] = {
891
    {0, "route pinning is not requested"},
892
    {1, "route pinning is requested"},
893
    {0, NULL}
894
};
895
896
static const value_string diffserv_type_vals[] = {
897
    {0, "E-LSP"},
898
    {1, "L-LSP"},
899
    {0, NULL}
900
};
901
902
static const value_string ldp_loose_vals[] = {
903
    {0, "strict hop"},
904
    {1, "loose hop"},
905
    {0, NULL}
906
};
907
908
static const true_false_string tlv_negotiable = {
909
    "Negotiable",
910
    "Not negotiable"
911
};
912
913
static const value_string freq_values[] = {
914
    {0, "Unspecified"},
915
    {1, "Frequent"},
916
    {2, "VeryFrequent"},
917
    {0, NULL}
918
};
919
920
static const true_false_string tlv_atm_dirbit = {
921
    "Bidirectional capability",
922
    "Unidirectional capability"
923
};
924
925
static const true_false_string hello_requested_vals = {
926
    "Source requests periodic hellos",
927
    "Source does not request periodic hellos"
928
};
929
930
static const true_false_string tlv_sess_advbit_vals = {
931
    "Downstream On Demand proposed",
932
    "Downstream Unsolicited proposed"
933
};
934
935
static const true_false_string tlv_sess_ldetbit_vals = {
936
    "Loop Detection Enabled",
937
    "Loop Detection Disabled"
938
};
939
940
static const true_false_string tlv_status_ebit = {
941
    "Fatal Error Notification",
942
    "Advisory Notification"
943
};
944
945
static const true_false_string tlv_status_fbit = {
946
    "Notification should be Forwarded",
947
    "Notification should NOT be Forwarded"
948
};
949
950
static const value_string tlv_status_data[] = {
951
    { 0x00000000, "Success"                                },
952
    { 0x00000001, "Bad LDP Identifier"                     },
953
    { 0x00000002, "Bad Protocol Version"                   },
954
    { 0x00000003, "Bad PDU Length"                         },
955
    { 0x00000004, "Unknown Message Type"                   },
956
    { 0x00000005, "Bad Message Length"                     },
957
    { 0x00000006, "Unknown TLV"                            },
958
    { 0x00000007, "Bad TLV Length"                         },
959
    { 0x00000008, "Malformed TLV Value"                    },
960
    { 0x00000009, "Hold Timer Expired"                     },
961
    { 0x0000000A, "Shutdown"                               },
962
    { 0x0000000B, "Loop Detected"                          },
963
    { 0x0000000C, "Unknown FEC"                            },
964
    { 0x0000000D, "No Route"                               },
965
    { 0x0000000E, "No Label Resources"                     },
966
    { 0x0000000F, "Label Resources/Available"              },
967
    { 0x00000010, "Session Rejected/No Hello"              },
968
    { 0x00000011, "Session Rejected/Parameters Advertisement Mode" },
969
    { 0x00000012, "Session Rejected/Parameters Max PDU Length" },
970
    { 0x00000013, "Session Rejected/Parameters Label Range" },
971
    { 0x00000014, "KeepAlive Timer Expired"                },
972
    { 0x00000015, "Label Request Aborted"                  },
973
    { 0x00000016, "Missing Message Parameters"             },
974
    { 0x00000017, "Unsupported Address Family"             },
975
    { 0x00000018, "Session Rejected/Bad KeepAlive Time"    },
976
    { 0x00000019, "Internal Error"                         },
977
    { 0x0000001A, "No LDP Session"                         },
978
    { 0x0000001B, "Zero FT seqnum"                         },
979
    { 0x0000001C, "Unexpected TLV / Session Not FT"        },
980
    { 0x0000001D, "Unexpected TLV / Label Not FT"          },
981
    { 0x0000001E, "Missing FT Protection TLV"              },
982
    { 0x0000001F, "FT ACK sequence error"                  },
983
    { 0x00000020, "Temporary Shutdown"                     },
984
    { 0x00000021, "FT Seq Numbers Exhausted"               },
985
    { 0x00000022, "FT Session parameters / changed"        },
986
    { 0x00000023, "Unexpected FT Cork TLV"                 },
987
    { 0x00000024, "Illegal C-Bit"                          },
988
    { 0x00000025, "Wrong C-Bit"                            },
989
    { 0x00000026, "Incompatible bit-rate"                  },
990
    { 0x00000027, "CEP-TDM mis-configuration"              },
991
    { 0x00000028, "PW Status"                              },
992
    { 0x0000002A, "Generic Misconfiguration Error"         },
993
    { 0x0000002B, "Label Withdraw PW Status Method Not Supported" },
994
    { 0x0000002C, "IP Address of CE"                       },
995
    { 0x0000002D, "Attachment Circuit bound to different remote Attachment Circuit" },
996
    { 0x0000002E, "Unsupported Capability"                 },
997
    { 0x0000002F, "End-of-LIB"                             },
998
    { 0x00000030, "Attachment Circuit bound to different PE" },
999
    { 0x00000031, "Invalid Topology ID"                    },
1000
    { 0x00000032, "Transport Connection Mismatch"          },
1001
    { 0x00000033, "Dual-Stack Noncompliance"               },
1002
    { 0x00000034, "MRT Capability negotiated without MT Capability" },
1003
    { 0x00000035, "VCCV Type Error"                        },
1004
    { 0x00000037, "Bandwidth resources unavailable"        },
1005
    { 0x00000038, "Resources Unavailable"                  },
1006
    { 0x00000039, "AII Unreachable"                        },
1007
    { 0x0000003A, "PW Loop Detected"                       },
1008
    { 0x0000003B, "Reject - unable to use the suggested tunnel/LSPs" },
1009
    { 0x0000003C, "The C-bit or S-bit unknown"             },
1010
    { 0x00000040, "LDP MP status"                          },
1011
    { 0x0000004A, "IP Address Type Mismatch"               },
1012
    { 0x0000004B, "Wrong IP Address Type"                  },
1013
    { 0x0000004C, "Session Rejected/Targeted Application Capability Mismatch" },
1014
    { 0x00010001, "Unknown ICCP RG"                        },
1015
    { 0x00010002, "ICCP Connection Count Exceeded"         },
1016
    { 0x00010003, "ICCP Application Connection Count Exceeded" },
1017
    { 0x00010004, "ICCP Application not in RG"             },
1018
    { 0x00010005, "Incompatible ICCP Protocol Version"     },
1019
    { 0x00010006, "ICCP Rejected Message"                  },
1020
    { 0x00010007, "ICCP Administratively Disabled"         },
1021
    { 0x00010010, "ICCP RG Removed"                        },
1022
    { 0x00010011, "ICCP Application Removed from RG"       },
1023
    { 0x01000001, "Unexpected Diff-Serv TLV"               },
1024
    { 0x01000002, "Unsupported PHB"                        },
1025
    { 0x01000003, "Invalid EXP<-->PHB mapping"             },
1026
    { 0x01000004, "Unsupported PSC"                        },
1027
    { 0x01000005, "Per-LSP context allocation failure"     },
1028
    { 0x04000001, "Bad Explicit Routing TLV Error"         },
1029
    { 0x04000002, "Bad Strict Node Error"                  },
1030
    { 0x04000003, "Bad Loose Node Error"                   },
1031
    { 0x04000004, "Bad Initial ER-Hop Error"               },
1032
    { 0x04000005, "Resource Unavailable"                   },
1033
    { 0x04000006, "Traffic Parameters Unavailable"         },
1034
    { 0x04000007, "LSP Preempted"                          },
1035
    { 0x04000008, "Modify Request Not Supported"           },
1036
    { 0x04000009, "Invalid SNP ID"                         },
1037
    { 0x0400000A, "Calling Party busy"                     },
1038
    { 0x0400000B, "Unavailable SNP ID"                     },
1039
    { 0x0400000C, "Invalid SNPP ID"                        },
1040
    { 0x0400000D, "Unavailable SNPP ID"                    },
1041
    { 0x0400000E, "Failed to create SNC"                   },
1042
    { 0x0400000F, "Failed to establish LC"                 },
1043
    { 0x04000010, "Invalid A End-User Name"                },
1044
    { 0x04000011, "Invalid Z End-User Name"                },
1045
    { 0x04000012, "Invalid CoS"                            },
1046
    { 0x04000013, "Unavailable CoS"                        },
1047
    { 0x04000014, "Invalid GoS"                            },
1048
    { 0x04000015, "Unavailable GoS"                        },
1049
    { 0x04000016, "Failed Security Check"                  },
1050
    { 0x04000017, "TimeOut"                                },
1051
    { 0x04000018, "Invalid Call Name"                      },
1052
    { 0x04000019, "Failed to Release SNC"                  },
1053
    { 0x0400001A, "Failed to Free LC"                      },
1054
    { 0x20000000, "Unknown VPN ID"                         },
1055
    { 0x20000001, "Illegal C-Bit"                          },
1056
    { 0x20000002, "Wrong C-Bit"                            },
1057
    { 0x20000003, "E-Tree VLAN mapping not supported"      },
1058
    { 0x20000004, "Leaf-to-Leaf PW released"               },
1059
1060
    {0, NULL}
1061
};
1062
1063
static const true_false_string tlv_upstr_sbit_vals = {
1064
    "LSR is advertising the capability to distribute and receive upstream-assigned label bindings",
1065
    "LSR is withdrawing the capability to distribute and receive upstream-assigned label bindings"
1066
};
1067
1068
14
#define PW_NOT_FORWARDING               0x00000001
1069
14
#define PW_LAC_INGRESS_RECV_FAULT       0x00000002
1070
14
#define PW_LAC_EGRESS_TRANS_FAULT       0x00000004
1071
14
#define PW_PSN_PW_INGRESS_RECV_FAULT    0x00000008
1072
14
#define PW_PSN_PW_EGRESS_TRANS_FAULT    0x00000010
1073
1074
static void
1075
dissect_subtlv_interface_parameters(tvbuff_t *tvb, unsigned offset, proto_tree *tree, int rem, int *interface_parameters_hf[]);
1076
1077
static void
1078
dissect_genpwid_fec_aai_type2_parameter(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem);
1079
1080
/* Dissect FEC TLV */
1081
1082
static void
1083
dissect_tlv_fec(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
1084
37
{
1085
37
    static int *interface_params_header_fields[] = {
1086
37
        &hf_ldp_tlv_fec_vc_intparam_length ,
1087
37
        &hf_ldp_tlv_fec_vc_intparam_mtu ,
1088
37
        &hf_ldp_tlv_fec_vc_intparam_tdmbps ,
1089
37
        &hf_ldp_tlv_fec_vc_intparam_id ,
1090
37
        &hf_ldp_tlv_fec_vc_intparam_maxcatmcells ,
1091
37
        &hf_ldp_tlv_fec_vc_intparam_desc ,
1092
37
        &hf_ldp_tlv_fec_vc_intparam_cepbytes ,
1093
37
        &hf_ldp_tlv_fec_vc_intparam_cepopt_ais ,
1094
37
        &hf_ldp_tlv_fec_vc_intparam_cepopt_une ,
1095
37
        &hf_ldp_tlv_fec_vc_intparam_cepopt_rtp ,
1096
37
        &hf_ldp_tlv_fec_vc_intparam_cepopt_ebm ,
1097
37
        &hf_ldp_tlv_fec_vc_intparam_cepopt_mah ,
1098
37
        &hf_ldp_tlv_fec_vc_intparam_cepopt_res ,
1099
37
        &hf_ldp_tlv_fec_vc_intparam_cepopt_ceptype ,
1100
37
        &hf_ldp_tlv_fec_vc_intparam_cepopt_t3 ,
1101
37
        &hf_ldp_tlv_fec_vc_intparam_cepopt_e3 ,
1102
37
        &hf_ldp_tlv_fec_vc_intparam_vlanid ,
1103
37
        &hf_ldp_tlv_fec_vc_intparam_dlcilen ,
1104
37
        &hf_ldp_tlv_fec_vc_intparam_fcslen ,
1105
37
        &hf_ldp_tlv_fec_vc_intparam_tdmopt_r ,
1106
37
        &hf_ldp_tlv_fec_vc_intparam_tdmopt_d ,
1107
37
        &hf_ldp_tlv_fec_vc_intparam_tdmopt_f ,
1108
37
        &hf_ldp_tlv_fec_vc_intparam_tdmopt_res1 ,
1109
37
        &hf_ldp_tlv_fec_vc_intparam_tdmopt_pt ,
1110
37
        &hf_ldp_tlv_fec_vc_intparam_tdmopt_res2 ,
1111
37
        &hf_ldp_tlv_fec_vc_intparam_tdmopt_freq ,
1112
37
        &hf_ldp_tlv_fec_vc_intparam_tdmopt_ssrc ,
1113
37
        &hf_ldp_tlv_fec_vc_intparam_vccv_cctype_cw ,
1114
37
        &hf_ldp_tlv_fec_vc_intparam_vccv_cctype_mplsra ,
1115
37
        &hf_ldp_tlv_fec_vc_intparam_vccv_cctype_ttl1 ,
1116
37
        &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_icmpping ,
1117
37
        &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_lspping ,
1118
37
        &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd1,
1119
37
        &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd2,
1120
37
        &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd3,
1121
37
        &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd4,
1122
37
        &hf_ldp_tlv_fec_vc_intparam_flowlabel_t,
1123
37
        &hf_ldp_tlv_fec_vc_intparam_flowlabel_r,
1124
37
        &hf_ldp_tlv_fec_vc_intparam_flowlabel_res,
1125
37
    };
1126
1127
37
    proto_tree *ti, *ti2, *val_tree, *fec_tree=NULL;
1128
37
    proto_tree *agi_tree=NULL, *saii_tree=NULL, *taii_tree=NULL;
1129
37
    uint16_t    family, ix=1, ax;
1130
37
    uint16_t    op_length = tvb_get_bits16(tvb, ((offset+8)*8), 16, ENC_BIG_ENDIAN);
1131
37
    uint8_t     addr_size=0, *addr, implemented, prefix_len_octets, prefix_len, host_len, vc_len;
1132
37
    uint8_t     intparam_len, aai_type = 0;
1133
37
    uint32_t    pwid_len, agi_aii_len;
1134
37
    const char *str;
1135
37
    uint8_t gen_fec_id_len = 0;
1136
37
    address_type addr_type;
1137
37
    address      addr_str;
1138
1139
37
    val_tree=proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "FEC Elements");
1140
1141
52
    while (rem > 0){
1142
34
        switch (tvb_get_uint8(tvb, offset)) {
1143
6
        case WILDCARD_FEC:
1144
11
        case CRLSP_FEC:
1145
11
            fec_tree = proto_tree_add_subtree_format(val_tree, tvb, offset, 1,
1146
11
                                        ett_ldp_fec, NULL, "FEC Element %u", ix);
1147
11
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_wc,tvb, offset, 1, ENC_BIG_ENDIAN);
1148
11
            rem -= 1;
1149
11
            offset += 1;
1150
11
            break;
1151
1152
3
        case PREFIX_FEC:
1153
3
            if ( rem < 4 ){/*not enough*/
1154
0
                proto_tree_add_expert_format(val_tree, pinfo, &ei_ldp_tlv_fec, tvb, offset, rem, "Error in FEC Element %u", ix);
1155
0
                return;
1156
0
            }
1157
3
            family=tvb_get_ntohs(tvb, offset+1);
1158
3
            prefix_len=tvb_get_uint8(tvb, offset+3);
1159
3
            prefix_len_octets=(prefix_len+7)/8;
1160
1161
3
            implemented=1;
1162
3
            switch(family) {
1163
0
            case AFNUM_INET: /*IPv4*/
1164
0
                addr_size=4;
1165
0
                addr_type = AT_IPv4;
1166
0
                break;
1167
0
            case AFNUM_INET6: /*IPv6*/
1168
0
                addr_size=16;
1169
0
                addr_type = AT_IPv6;
1170
0
                break;
1171
3
            default:
1172
3
                implemented=0;
1173
3
                break;
1174
3
            }
1175
1176
3
            if ( !implemented ) {
1177
3
                uint16_t noctets;
1178
1179
3
                noctets= rem>4+prefix_len_octets?4+prefix_len_octets:rem;
1180
3
                proto_tree_add_expert(val_tree, pinfo, &ei_ldp_address_family_not_implemented, tvb, offset, noctets);
1181
3
                offset+=noctets;
1182
3
                rem-=noctets;
1183
3
                break;
1184
3
            }
1185
1186
0
            if ( rem < 4+MIN(addr_size, prefix_len_octets) ){
1187
0
                proto_tree_add_expert_format(val_tree, pinfo, &ei_ldp_tlv_fec, tvb, offset, rem, "Error in FEC Element %u", ix);
1188
0
                return;
1189
0
            }
1190
1191
            /*Add a subtree for this*/
1192
0
            fec_tree = proto_tree_add_subtree_format(val_tree, tvb, offset, 4+MIN(addr_size, prefix_len_octets),
1193
0
                                            ett_ldp_fec, NULL, "FEC Element %u", ix);
1194
0
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_wc, tvb, offset, 1, ENC_BIG_ENDIAN);
1195
0
            offset += 1;
1196
1197
0
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_af, tvb, offset, 2, ENC_BIG_ENDIAN);
1198
0
            offset += 2;
1199
1200
0
            ti = proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_len, tvb, offset, 1, ENC_BIG_ENDIAN);
1201
0
            offset += 1;
1202
1203
1204
0
            if ( addr_size < prefix_len_octets) {
1205
0
                offset+=addr_size;
1206
0
                rem-=addr_size;
1207
0
                expert_add_info_format(pinfo, ti, &ei_ldp_tlv_fec_len,
1208
0
                                    "Invalid prefix %u length for family %s",
1209
0
                                    prefix_len, val_to_str_const(family, afn_vals, "Unknown Family"));
1210
0
                break;
1211
0
            }
1212
1213
0
            addr=(uint8_t *)wmem_alloc0(pinfo->pool, addr_size);
1214
1215
0
            for(ax=0; ax+1 <= prefix_len_octets; ax++)
1216
0
                addr[ax]=tvb_get_uint8(tvb, offset+ax);
1217
0
            if ( prefix_len % 8 )
1218
0
                addr[ax-1] = addr[ax-1]&(0xFF<<(8-prefix_len%8));
1219
1220
0
            set_address(&addr_str, addr_type, addr_size, addr);
1221
0
            str = address_to_str(pinfo->pool, &addr_str);
1222
0
            proto_tree_add_string_format(fec_tree, hf_ldp_tlv_fec_pfval, tvb, offset, prefix_len_octets,
1223
0
                                         str, "Prefix: %s", str);
1224
1225
0
            offset += prefix_len_octets;
1226
0
            rem -= 4+prefix_len_octets;
1227
0
            break;
1228
1229
0
        case HOST_FEC:
1230
0
            if ( rem < 4 ){/*not enough*/
1231
0
                proto_tree_add_expert_format(val_tree, pinfo, &ei_ldp_tlv_fec, tvb, offset, rem, "Error in FEC Element %u", ix);
1232
0
                return;
1233
0
            }
1234
0
            family=tvb_get_ntohs(tvb, offset+1);
1235
0
            host_len=tvb_get_uint8(tvb, offset+3);
1236
1237
0
            implemented=1;
1238
0
            switch(family) {
1239
0
            case AFNUM_INET: /*IPv4*/
1240
0
                addr_size=4;
1241
0
                addr_type = AT_IPv4;
1242
0
                break;
1243
0
            case AFNUM_INET6: /*IPv6*/
1244
0
                addr_size=16;
1245
0
                addr_type = AT_IPv6;
1246
0
                break;
1247
0
            default:
1248
0
                implemented=0;
1249
0
                break;
1250
0
            }
1251
1252
0
            if ( !implemented ) {
1253
0
                uint16_t noctets;
1254
1255
0
                noctets= rem>4+host_len?4+host_len:rem;
1256
0
                proto_tree_add_expert(val_tree, pinfo, &ei_ldp_address_family_not_implemented, tvb, offset, noctets);
1257
0
                offset+=noctets;
1258
0
                rem-=noctets;
1259
0
                break;
1260
0
            }
1261
1262
0
            if ( rem < 4+addr_size ){
1263
0
                proto_tree_add_expert_format(val_tree, pinfo, &ei_ldp_tlv_fec, tvb, offset, rem, "Error in FEC Element %u", ix);
1264
0
                return;
1265
0
            }
1266
1267
            /*Add a subtree for this*/
1268
0
            fec_tree = proto_tree_add_subtree_format(val_tree, tvb, offset, 4+addr_size, ett_ldp_fec, NULL, "FEC Element %u", ix);
1269
0
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_wc, tvb, offset, 1, ENC_BIG_ENDIAN);
1270
0
            offset += 1;
1271
1272
0
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_af, tvb, offset, 2, ENC_BIG_ENDIAN);
1273
0
            offset += 2;
1274
1275
0
            ti = proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_len, tvb, offset, 1, ENC_BIG_ENDIAN);
1276
0
            offset += 1;
1277
1278
1279
0
            if ( addr_size != host_len) {
1280
0
                offset+=addr_size;
1281
0
                rem-=addr_size;
1282
0
                expert_add_info_format(pinfo, ti, &ei_ldp_tlv_fec_len,
1283
0
                                    "Invalid address length %u length for family %s",
1284
0
                                    host_len, val_to_str_const(family, afn_vals, "Unknown Family"));
1285
0
                break;
1286
0
            }
1287
1288
0
            addr=(uint8_t *)wmem_alloc0(pinfo->pool, addr_size);
1289
1290
0
            for(ax=0; ax+1 <= host_len; ax++)
1291
0
                addr[ax]=tvb_get_uint8(tvb, offset+ax);
1292
1293
0
            set_address(&addr_str, addr_type, addr_size, addr);
1294
0
            str = address_to_str(pinfo->pool, &addr_str);
1295
0
            proto_tree_add_string_format(fec_tree, hf_ldp_tlv_fec_hoval, tvb, offset, host_len,
1296
0
                                         str, "Address: %s", str);
1297
1298
0
            offset += host_len;
1299
0
            rem -= 4+host_len;
1300
0
            break;
1301
1302
0
        case TYPED_WILDCARD_FEC:
1303
0
            if ( rem < 8 ){/*not enough bytes for a minimal TYPED_WILDCARD_FEC*/
1304
0
                proto_tree_add_expert_format(val_tree, pinfo, &ei_ldp_tlv_fec, tvb, offset, rem, "Error in FEC Element %u", ix);
1305
0
                return;
1306
0
            }
1307
0
            vc_len = tvb_get_uint8 (tvb, offset+3);
1308
1309
1310
0
            fec_tree = proto_tree_add_subtree_format(val_tree, tvb, offset, 8+vc_len, ett_ldp_fec, &ti, "FEC Element %u", ix);
1311
0
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_wc, tvb, offset, 1, ENC_BIG_ENDIAN);
1312
0
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_vc_controlword, tvb, offset+1, 1, ENC_BIG_ENDIAN);
1313
0
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_vc_vctype, tvb, offset+1, 2, ENC_BIG_ENDIAN);
1314
0
            ti2 = proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_vc_infolength, tvb, offset+3,1,ENC_BIG_ENDIAN);
1315
0
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_vc_groupid,tvb, offset +4, 4, ENC_BIG_ENDIAN);
1316
0
            rem -=8;
1317
0
            offset +=8;
1318
1319
0
            if ( (vc_len > 3) && ( rem > 3 ) ) { /* there is enough room for vcid */
1320
0
                proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_vc_vcid,tvb, offset, 4, ENC_BIG_ENDIAN);
1321
0
                proto_item_append_text (ti," VCID: %u",tvb_get_ntohl(tvb,offset));
1322
1323
0
            } else {
1324
0
                expert_add_info(pinfo, ti2, &ei_ldp_tlv_fec_vc_infolength);
1325
0
                return;
1326
0
            }
1327
0
            rem -= 4;
1328
0
            vc_len -= 4;
1329
0
            offset += 4;
1330
1331
0
            while ( (vc_len > 1) && (rem > 1) ) {   /* enough to include id and length */
1332
0
                intparam_len = tvb_get_uint8(tvb, offset+1);
1333
0
                if (intparam_len < 2){ /* At least Type and Len, protect against len = 0 */
1334
0
                    proto_tree_add_expert(fec_tree, pinfo, &ei_ldp_malformed_interface_parameter, tvb, offset +1, 1);
1335
0
                    return;
1336
0
                }
1337
1338
0
                if ( (vc_len -intparam_len) <0 && (rem -intparam_len) <0 ) { /* error condition */
1339
0
                    proto_tree_add_expert(fec_tree, pinfo, &ei_ldp_malformed_data, tvb, offset +2, MIN(vc_len,rem));
1340
0
                    return;
1341
0
                }
1342
0
                dissect_subtlv_interface_parameters(tvb, offset, fec_tree, intparam_len, interface_params_header_fields);
1343
1344
0
                rem -= intparam_len;
1345
0
                vc_len -= intparam_len;
1346
0
                offset += intparam_len;
1347
0
            }
1348
0
            break;
1349
1350
1
        case P2MP_PW_UPSTREAM_FEC:
1351
1
        {
1352
            /* Ref: RFC 4447 */
1353
1
            if ( rem < 4 ){/*not enough bytes for a minimal TYPED_WILDCARD_FEC*/
1354
0
                proto_tree_add_expert_format(val_tree, pinfo, &ei_ldp_tlv_fec, tvb, offset, rem, "Error in FEC Element %u", ix);
1355
0
                return;
1356
0
            }
1357
1
            vc_len = tvb_get_uint8 (tvb, offset+3);
1358
1359
            /* Add the FEC to the tree */
1360
1
            fec_tree = proto_tree_add_subtree_format(val_tree, tvb, offset, 8+vc_len, ett_ldp_fec, NULL, "FEC Element %u", ix);
1361
1
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_wc, tvb, offset, 1, ENC_BIG_ENDIAN);
1362
1
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_vc_controlword, tvb, offset+1, 1, ENC_BIG_ENDIAN);
1363
1
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_vc_vctype, tvb, offset+1, 2, ENC_BIG_ENDIAN);
1364
1
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_vc_infolength, tvb, offset+3,1,ENC_BIG_ENDIAN);
1365
1
            rem -= 4;
1366
1
            offset += 4;
1367
1368
1
            if ( (vc_len > 1) && ( rem > 1 ) ) { /* there is enough room for AGI */
1369
1
                gen_fec_id_len = tvb_get_uint8 (tvb, offset+1);
1370
                /* Add AGI to the tree */
1371
1
                agi_tree = proto_tree_add_subtree_format(fec_tree, tvb, offset, 2 + gen_fec_id_len, ett_ldp_gen_agi, NULL, "AGI");
1372
1
                proto_tree_add_item(agi_tree, hf_ldp_tlv_fec_gen_agi_type,tvb, offset, 1, ENC_BIG_ENDIAN);
1373
1
                proto_tree_add_item(agi_tree, hf_ldp_tlv_fec_gen_agi_length,tvb, offset + 1, 1, ENC_BIG_ENDIAN);
1374
1
                if ( gen_fec_id_len > 0)
1375
1
                {
1376
1
                    proto_tree_add_item(agi_tree, hf_ldp_tlv_fec_gen_agi_value, tvb, offset+2, gen_fec_id_len , ENC_NA );
1377
1
                }
1378
1
                rem -= 2 + gen_fec_id_len;
1379
1
                vc_len -= 2 + gen_fec_id_len;
1380
1
                offset += 2 + gen_fec_id_len;
1381
1382
1
            } else {
1383
0
                proto_tree_add_expert_format(fec_tree, pinfo, &ei_ldp_tlv_fec_vc_infolength, tvb, offset, 2 +vc_len, "Generalized FEC: AGI size format error");
1384
0
                return;
1385
0
            }
1386
1387
1
            if ( (vc_len > 1) && ( rem > 1 ) ) { /* there is enough room for SAII */
1388
1
                gen_fec_id_len = tvb_get_uint8 (tvb, offset+1);
1389
                /* Add SAII to the tree */
1390
1
                aai_type = tvb_get_uint8(tvb, offset);
1391
1
                if ( aai_type == 2 && gen_fec_id_len != 12)
1392
0
                {
1393
                    /* According to RFC 5003, for Type 2 AAI, the length should be 12 bytes */
1394
0
                    proto_tree_add_expert_format(fec_tree, pinfo, &ei_ldp_tlv_fec_vc_infolength, tvb, offset, 2 + gen_fec_id_len, "Generalized FEC: SAII size format error");
1395
0
                }
1396
1
                else
1397
1
                {
1398
1
                    saii_tree = proto_tree_add_subtree(fec_tree, tvb, offset, 2 + gen_fec_id_len, ett_ldp_gen_saii, NULL, "SAII");
1399
1
                    proto_tree_add_item(saii_tree, hf_ldp_tlv_fec_gen_saii_type,tvb, offset, 1, ENC_BIG_ENDIAN);
1400
1
                    proto_tree_add_item(saii_tree, hf_ldp_tlv_fec_gen_saii_length,tvb, offset + 1, 1, ENC_BIG_ENDIAN);
1401
1
                    if ( gen_fec_id_len > 0)
1402
1
                    {
1403
                        /* Get the AAI Type. */
1404
                        /* If it is  Type 2 (RFC 5003), then the length is 12 bytes, */
1405
                        /* and the following fields exist. */
1406
                        /*    0                   1                   2                   3    */
1407
                        /*    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1  */
1408
                        /*   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
1409
                        /*   |  AII Type=02  |    Length     |        Global ID              | */
1410
                        /*   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
1411
                        /*   |       Global ID (contd.)      |        Prefix                 | */
1412
                        /*   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
1413
                        /*   |       Prefix (contd.)         |        AC ID                  | */
1414
                        /*   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
1415
                        /*   |      AC ID                    | */
1416
                        /*   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
1417
1418
1
                        if ( aai_type == 2)
1419
0
                        {
1420
0
                            dissect_genpwid_fec_aai_type2_parameter(tvb, pinfo, offset +2, saii_tree, gen_fec_id_len);
1421
0
                        }
1422
1
                        else
1423
1
                        {
1424
1
                            proto_tree_add_item(saii_tree,
1425
1
                                                hf_ldp_tlv_fec_gen_saii_value,
1426
1
                                                tvb,
1427
1
                                                offset+2,
1428
1
                                                gen_fec_id_len ,
1429
1
                                                ENC_NA );
1430
1
                        }
1431
1
                    }
1432
1
                }
1433
1
                rem -= 2 + gen_fec_id_len;
1434
1
                vc_len -= 2 + gen_fec_id_len;
1435
1
                offset += 2 + gen_fec_id_len;
1436
1437
1
            } else {
1438
0
                proto_tree_add_expert_format(fec_tree, pinfo, &ei_ldp_tlv_fec_vc_infolength, tvb, offset, 2 + vc_len, "Generalized FEC: SAII size format error");
1439
0
                return;
1440
0
            }
1441
1442
1
            if ( (vc_len > 1) && ( rem > 1 ) ) { /* there is enough room for TAII */
1443
0
                gen_fec_id_len = tvb_get_uint8 (tvb, offset+1);
1444
                /* Add TAII to the tree */
1445
0
                aai_type = tvb_get_uint8(tvb, offset);
1446
0
                if ( aai_type == 2 && gen_fec_id_len != 12)
1447
0
                {
1448
                    /* According to RFC 5003, for Type 2 AAI, the length should be 12 bytes */
1449
0
                    proto_tree_add_expert_format(fec_tree, pinfo, &ei_ldp_tlv_fec_vc_infolength, tvb, offset, 2 + gen_fec_id_len, "Generalized FEC: TAII size format error");
1450
0
                }
1451
0
                else
1452
0
                {
1453
0
                    taii_tree = proto_tree_add_subtree(fec_tree, tvb, offset, 2 + gen_fec_id_len, ett_ldp_gen_taii, NULL, "TAII");
1454
0
                    proto_tree_add_item(taii_tree, hf_ldp_tlv_fec_gen_taii_type,tvb, offset, 1, ENC_BIG_ENDIAN);
1455
0
                    proto_tree_add_item(taii_tree, hf_ldp_tlv_fec_gen_taii_length,tvb, offset + 1, 1, ENC_BIG_ENDIAN);
1456
0
                    if ( gen_fec_id_len > 0)
1457
0
                    {
1458
                        /* Get the AAI Type. */
1459
                        /* If it is  Type 2 (RFC 5003), then the length is 12 bytes, */
1460
                        /* and the following fields exist. */
1461
                        /*    0                   1                   2                   3    */
1462
                        /*    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1  */
1463
                        /*   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
1464
                        /*   |  AII Type=02  |    Length     |        Global ID              | */
1465
                        /*   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
1466
                        /*   |       Global ID (contd.)      |        Prefix                 | */
1467
                        /*   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
1468
                        /*   |       Prefix (contd.)         |        AC ID                  | */
1469
                        /*   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
1470
                        /*   |      AC ID                    | */
1471
                        /*   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
1472
1473
0
                        if ( aai_type == 2)
1474
0
                        {
1475
0
                            dissect_genpwid_fec_aai_type2_parameter(tvb, pinfo, offset +2, taii_tree, gen_fec_id_len);
1476
0
                        }
1477
0
                        else
1478
0
                        {
1479
0
                            proto_tree_add_item(taii_tree, hf_ldp_tlv_fec_gen_taii_value, tvb, offset+2, gen_fec_id_len , ENC_NA);
1480
0
                        }
1481
0
                    }
1482
0
                }
1483
0
                rem -= 2 + gen_fec_id_len;
1484
                /*vc_len -= 2 + gen_fec_id_len;*/
1485
0
                offset += 2 + gen_fec_id_len;
1486
1487
1488
1
            } else {
1489
1
                proto_tree_add_expert_format(fec_tree, pinfo, &ei_ldp_tlv_fec_vc_infolength, tvb, offset, 2 +vc_len, "Generalized FEC: TAII size format error");
1490
1
                return;
1491
1
            }
1492
1493
0
            break;
1494
1
        }
1495
0
        case P2MP_FEC:
1496
1
        case MP2MP_FEC_UP:
1497
4
        case MP2MP_FEC_DOWN:
1498
6
        case HSMP_UPSTREAM:
1499
7
        case HSMP_DOWNSTREAM:
1500
7
        {
1501
7
            if (rem < 4 ){/*not enough*/
1502
0
                proto_item* inv_length;
1503
0
                inv_length = proto_tree_add_item(val_tree, hf_ldp_tlv_inv_length, tvb, offset, rem, ENC_BIG_ENDIAN);
1504
0
                expert_add_info(pinfo, inv_length, &ei_ldp_inv_length);
1505
0
                return;
1506
0
            }
1507
1508
7
            fec_tree = proto_tree_add_subtree_format(val_tree, tvb, offset, 4+tvb_get_uint8 (tvb, offset+1),
1509
7
                                                            ett_ldp_fec, NULL, "FEC Element %u", ix);
1510
7
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_wc, tvb, offset, 1, ENC_BIG_ENDIAN);
1511
7
            offset += 1;
1512
1513
7
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_af, tvb, offset, 2, ENC_BIG_ENDIAN);
1514
7
            offset += 2;
1515
7
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_len, tvb, offset, 1, ENC_BIG_ENDIAN);
1516
7
            offset += 1;
1517
1518
7
            proto_tree_add_item(fec_tree, hf_ldp_tlv_ldp_p2mp_rtnodeaddr, tvb,offset, 4, ENC_BIG_ENDIAN);
1519
7
            proto_tree_add_item(fec_tree, hf_ldp_tlv_ldp_p2mp_oplength, tvb,offset + 4, 2, ENC_BIG_ENDIAN);
1520
7
            proto_tree_add_item(fec_tree, hf_ldp_tlv_ldp_p2mp_opvalue, tvb,offset + 6, op_length, ENC_NA);
1521
1522
7
            offset = offset + 6 + op_length;
1523
7
            rem = rem - 10 - op_length;
1524
1525
7
            break;
1526
7
        }
1527
1528
0
        case PWID_FEC_ELEMENT:
1529
0
        {
1530
0
            if (rem < 8 ){/*not enough*/
1531
0
                proto_item* inv_length;
1532
0
                inv_length = proto_tree_add_item(val_tree, hf_ldp_tlv_inv_length, tvb, offset, rem, ENC_BIG_ENDIAN);
1533
0
                expert_add_info(pinfo, inv_length, &ei_ldp_inv_length);
1534
0
                return;
1535
0
            }
1536
1537
0
            fec_tree = proto_tree_add_subtree_format(val_tree, tvb, offset, 8+tvb_get_uint8 (tvb, offset+3),
1538
0
                                                            ett_ldp_fec, NULL, "FEC Element %u", ix);
1539
0
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_wc, tvb, offset, 1, ENC_BIG_ENDIAN);
1540
0
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_pw_controlword, tvb, offset+1, 1, ENC_BIG_ENDIAN);
1541
0
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_pw_pwtype, tvb, offset+1, 2, ENC_BIG_ENDIAN);
1542
0
            proto_tree_add_item_ret_uint(fec_tree, hf_ldp_tlv_fec_pw_infolength, tvb, offset+3,1,ENC_BIG_ENDIAN, &pwid_len);
1543
0
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_pw_groupid,tvb, offset +4, 4, ENC_BIG_ENDIAN);
1544
0
            rem -=8;
1545
0
            offset +=8;
1546
1547
0
            if ( (pwid_len > 3) && ( rem > 3 ) ) { /* there is enough room for pwid */
1548
0
                proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_pw_pwid,tvb, offset, 4, ENC_BIG_ENDIAN);
1549
0
                rem -=4;
1550
0
                offset +=4;
1551
1552
0
            }
1553
1554
0
            while ( (pwid_len > 1) && (rem > 1) ) {   /* enough to include id and length */
1555
0
                intparam_len = tvb_get_uint8(tvb, offset+1);
1556
0
                if (intparam_len < 2){ /* At least Type and Len, protect against len = 0 */
1557
0
                    proto_tree_add_expert(fec_tree, pinfo, &ei_ldp_malformed_interface_parameter, tvb, offset +1, 1);
1558
0
                    return;
1559
0
                }
1560
1561
0
                if ( ((uint32_t)intparam_len > pwid_len) && (rem -intparam_len) <0 ) { /* error condition */
1562
0
                    proto_tree_add_expert(fec_tree, pinfo, &ei_ldp_malformed_data, tvb, offset +2, MIN(pwid_len,(uint32_t)rem));
1563
0
                    return;
1564
0
                }
1565
0
                dissect_subtlv_interface_parameters(tvb, offset, fec_tree, intparam_len, interface_params_header_fields);
1566
1567
0
                rem -= intparam_len;
1568
0
                pwid_len -= intparam_len;
1569
0
                offset += intparam_len;
1570
0
            }
1571
1572
0
            break;
1573
0
        }
1574
1575
0
        case GENERALIZED_PWID_FEC:
1576
0
        {
1577
0
            if (rem < 4 ){/*not enough*/
1578
0
                proto_item* inv_length;
1579
0
                inv_length = proto_tree_add_item(val_tree, hf_ldp_tlv_inv_length, tvb, offset, rem, ENC_BIG_ENDIAN);
1580
0
                expert_add_info(pinfo, inv_length, &ei_ldp_inv_length);
1581
0
                return;
1582
0
            }
1583
1584
0
            fec_tree = proto_tree_add_subtree_format(val_tree, tvb, offset, 4+tvb_get_uint8 (tvb, offset+3),
1585
0
                                                            ett_ldp_fec, NULL, "FEC Element %u", ix);
1586
0
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_wc, tvb, offset, 1, ENC_BIG_ENDIAN);
1587
0
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_pw_controlword, tvb, offset+1, 1, ENC_BIG_ENDIAN);
1588
0
            proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_pw_pwtype, tvb, offset+1, 2, ENC_BIG_ENDIAN);
1589
0
            proto_tree_add_item_ret_uint(fec_tree, hf_ldp_tlv_fec_pw_infolength, tvb, offset+3,1,ENC_BIG_ENDIAN, &pwid_len);
1590
0
            rem -= 4;
1591
0
            offset += 4;
1592
0
            if ( (pwid_len > 5) && ( rem > 5 ) ) { /* there is enough room for AGI/AII data */
1593
0
                proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_gen_agi_type,tvb, offset, 1, ENC_BIG_ENDIAN);
1594
0
                rem -= 1;
1595
0
                offset += 1;
1596
0
                proto_tree_add_item_ret_uint(fec_tree, hf_ldp_tlv_fec_gen_agi_length, tvb, offset,1,ENC_BIG_ENDIAN, &agi_aii_len);
1597
0
                rem -= 1;
1598
0
                offset += 1;
1599
0
                if ( agi_aii_len > 0)
1600
0
                {
1601
0
                    proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_gen_agi_value, tvb, offset, agi_aii_len , ENC_NA );
1602
0
                    rem -= agi_aii_len;
1603
0
                    offset += agi_aii_len;
1604
0
                }
1605
0
                proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_gen_saii_type,tvb, offset, 1, ENC_BIG_ENDIAN);
1606
0
                rem -= 1;
1607
0
                offset += 1;
1608
0
                proto_tree_add_item_ret_uint(fec_tree, hf_ldp_tlv_fec_gen_saii_length, tvb, offset,1,ENC_BIG_ENDIAN, &agi_aii_len);
1609
0
                rem -= 1;
1610
0
                offset += 1;
1611
0
                if ( agi_aii_len > 0)
1612
0
                {
1613
0
                    proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_gen_saii_value, tvb, offset, agi_aii_len , ENC_NA );
1614
0
                    rem -= agi_aii_len;
1615
0
                    offset += agi_aii_len;
1616
0
                }
1617
0
                proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_gen_taii_type,tvb, offset, 1, ENC_BIG_ENDIAN);
1618
0
                rem -= 1;
1619
0
                offset += 1;
1620
0
                proto_tree_add_item_ret_uint(fec_tree, hf_ldp_tlv_fec_gen_taii_length, tvb, offset,1,ENC_BIG_ENDIAN, &agi_aii_len);
1621
0
                rem -= 1;
1622
0
                offset += 1;
1623
0
                if ( agi_aii_len > 0)
1624
0
                {
1625
0
                    proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_gen_taii_value, tvb, offset, agi_aii_len , ENC_NA );
1626
0
                    rem -= agi_aii_len;
1627
0
                    offset += agi_aii_len;
1628
0
                }
1629
0
            }
1630
0
            break;
1631
0
        }
1632
1633
12
        default:  /* Unknown */
1634
            /* XXX - do all FEC's have a length that's a multiple of 4? */
1635
            /* Hmmm, don't think so. Will check. RJS. */
1636
            /* If we don't know its structure, we have to exit */
1637
12
            fec_tree = proto_tree_add_subtree_format(val_tree, tvb, offset, 4, ett_ldp_fec, NULL, "FEC Element %u", ix);
1638
12
            proto_tree_add_expert(fec_tree, pinfo, &ei_ldp_tlv_fec_type, tvb, offset, rem);
1639
12
            return;
1640
34
        }
1641
15
        ix++;
1642
15
    }
1643
37
}
1644
1645
/* Dissect Address List TLV */
1646
1647
static void
1648
dissect_tlv_address_list(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
1649
24
{
1650
24
    proto_tree *val_tree;
1651
24
    uint16_t    family, ix;
1652
24
    uint8_t     addr_size, *addr;
1653
24
    const char *str;
1654
24
    address_type addr_type;
1655
24
    address      addr_str;
1656
1657
24
    if ( rem < 2 ) {
1658
9
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
1659
9
                            "Error processing Address List TLV: length is %d, should be >= 2",
1660
9
                            rem);
1661
9
        return;
1662
9
    }
1663
1664
15
    family=tvb_get_ntohs(tvb, offset);
1665
15
    proto_tree_add_item(tree, hf_ldp_tlv_addrl_addr_family, tvb,
1666
15
                        offset, 2, ENC_BIG_ENDIAN);
1667
15
    switch(family) {
1668
3
    case AFNUM_INET: /*IPv4*/
1669
3
        addr_size=4;
1670
3
        addr_type = AT_IPv4;
1671
3
        break;
1672
0
    case AFNUM_INET6: /*IPv6*/
1673
0
        addr_size=16;
1674
0
        addr_type = AT_IPv6;
1675
0
        break;
1676
12
    default:
1677
12
        proto_tree_add_expert(tree, pinfo, &ei_ldp_address_family_not_implemented, tvb, offset+2, rem-2);
1678
12
        return;
1679
15
    }
1680
1681
3
    offset+=2; rem-=2;
1682
3
    val_tree=proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "Addresses");
1683
1684
3
    addr=(uint8_t *)wmem_alloc(pinfo->pool, addr_size);
1685
1686
32
    for(ix=1; rem >= addr_size; ix++, offset += addr_size,
1687
29
            rem -= addr_size) {
1688
29
        if ( (tvb_memcpy(tvb, addr, offset, addr_size))
1689
29
             == NULL)
1690
0
            break;
1691
1692
29
        set_address(&addr_str, addr_type, addr_size, addr);
1693
29
        str = address_to_str(pinfo->pool, &addr_str);
1694
29
        proto_tree_add_string_format(val_tree,
1695
29
                                     hf_ldp_tlv_addrl_addr, tvb, offset, addr_size, str,
1696
29
                                     "Address %u: %s", ix, str);
1697
29
    }
1698
3
    if (rem)
1699
2
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem, "Error processing TLV: Extra data at end of address list");
1700
3
}
1701
1702
/* Dissect Path Vector TLV */
1703
1704
static void
1705
dissect_tlv_path_vector(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
1706
6
{
1707
6
    proto_tree *val_tree;
1708
6
    uint8_t     ix;
1709
6
    uint32_t addr;
1710
1711
6
    val_tree=proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "LSR IDs");
1712
1713
195
    for(ix=1; rem >= 4; ix++, offset += 4, rem -= 4) {
1714
189
        addr = tvb_get_ipv4(tvb, offset);
1715
189
        proto_tree_add_ipv4_format(val_tree,
1716
189
                                   hf_ldp_tlv_pv_lsrid, tvb, offset, 4,
1717
189
                                   addr, "LSR Id %u: %s", ix,
1718
189
                                   tvb_ip_to_str(pinfo->pool, tvb, offset));
1719
189
    }
1720
6
    if (rem)
1721
1
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem, "Error processing TLV: Extra data at end of path vector");
1722
6
}
1723
1724
/* Dissect ATM Label TLV */
1725
1726
static void
1727
dissect_tlv_atm_label(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
1728
4
{
1729
4
    proto_tree *val_tree;
1730
1731
4
    if (rem != 4){
1732
4
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem, "Error processing ATM Label TLV: length is %d, should be 4", rem);
1733
4
        return;
1734
4
    }
1735
0
    val_tree=proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "ATM Label");
1736
1737
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_atm_label_vbits, tvb, offset, 1, ENC_BIG_ENDIAN);
1738
1739
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_atm_label_vpi, tvb, offset, 2, ENC_BIG_ENDIAN);
1740
1741
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_atm_label_vci, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1742
0
}
1743
1744
/* Dissect FRAME RELAY Label TLV */
1745
1746
static void
1747
dissect_tlv_frame_label(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
1748
5
{
1749
5
    proto_tree *val_tree;
1750
5
    uint8_t     len;
1751
1752
5
    if (rem != 4){
1753
5
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
1754
5
                            "Error processing Frame Relay Label TLV: length is %d, should be 4",
1755
5
                            rem);
1756
5
        return;
1757
5
    }
1758
0
    val_tree=proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "Frame Relay Label");
1759
1760
0
    len=(uint8_t)(tvb_get_ntohs(tvb, offset)>>7) & 0x03;
1761
0
    proto_tree_add_uint_format_value(val_tree, hf_ldp_tlv_fr_label_len, tvb, offset, 2, len,
1762
0
                               "%s (%u)", val_to_str_const(len, tlv_fr_len_vals, "Unknown Length"), len);
1763
1764
0
    proto_tree_add_item(val_tree,
1765
0
                               hf_ldp_tlv_fr_label_dlci, tvb, offset+1, 3, ENC_BIG_ENDIAN);
1766
0
}
1767
1768
/* Dissect STATUS TLV */
1769
1770
static void
1771
dissect_tlv_status(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
1772
2
{
1773
2
    proto_tree *val_tree;
1774
2
    uint32_t    data;
1775
1776
2
    if (rem != 10){
1777
2
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
1778
2
                            "Error processing Status TLV: length is %d, should be 10",
1779
2
                            rem);
1780
2
        return;
1781
2
    }
1782
1783
0
    val_tree=proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "Status");
1784
1785
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_status_ebit, tvb, offset, 1, ENC_BIG_ENDIAN);
1786
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_status_fbit, tvb, offset, 1, ENC_BIG_ENDIAN);
1787
1788
0
    data=tvb_get_ntohl(tvb, offset)&0x3FFFFFFF;
1789
0
    proto_tree_add_uint_format_value(val_tree, hf_ldp_tlv_status_data, tvb, offset, 4,
1790
0
                               data, "%s (0x%X)", val_to_str_const(data, tlv_status_data, "Unknown Status Data"), data);
1791
1792
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_status_msg_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1793
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_status_msg_type, tvb, offset+8, 2, ENC_BIG_ENDIAN);
1794
0
}
1795
1796
/* Dissect Returned PDU TLV */
1797
1798
static void
1799
dissect_tlv_returned_pdu(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
1800
2
{
1801
2
    proto_tree *val_tree;
1802
1803
2
    if (rem < 10){
1804
1
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
1805
1
                            "Error processing Returned PDU TLV: length is %d, should be >= 10",
1806
1
                            rem);
1807
1
        return;
1808
1
    }
1809
1
    val_tree=proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "Returned PDU");
1810
1811
1
    proto_tree_add_item(val_tree, hf_ldp_tlv_returned_version, tvb, offset, 2, ENC_BIG_ENDIAN);
1812
1
    proto_tree_add_item(val_tree, hf_ldp_tlv_returned_pdu_len, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1813
1
    proto_tree_add_item(val_tree, hf_ldp_tlv_returned_lsr, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1814
1
    proto_tree_add_item(val_tree, hf_ldp_tlv_returned_ls_id, tvb, offset+8, 2, ENC_BIG_ENDIAN);
1815
1
    offset += 10;
1816
1
    rem -= 10;
1817
1818
1
    if ( rem > 0 ) {
1819
        /*XXX - dissect returned pdu data*/
1820
1
        proto_tree_add_item(val_tree, hf_ldp_returned_pdu_data, tvb, offset, rem, ENC_NA);
1821
1
    }
1822
1
}
1823
1824
/* Dissect Returned MESSAGE TLV */
1825
1826
static void
1827
dissect_tlv_returned_message(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
1828
3
{
1829
3
    proto_tree *val_tree;
1830
3
    uint16_t    type;
1831
1832
3
    if (rem < 4) {
1833
0
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
1834
0
                            "Error processing Returned Message TLV: length is %d, should be >= 4",
1835
0
                            rem);
1836
0
        return;
1837
0
    }
1838
3
    val_tree=proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "Returned Message");
1839
1840
3
    proto_tree_add_item(val_tree, hf_ldp_tlv_returned_msg_ubit, tvb, offset, 1, ENC_BIG_ENDIAN);
1841
1842
3
    type=tvb_get_ntohs(tvb, offset)&0x7FFF;
1843
    /*chk for vendor-private*/
1844
3
    if (type>=LDP_VENDOR_PRIVATE_START && type<=LDP_VENDOR_PRIVATE_END){
1845
0
        proto_tree_add_uint_format(val_tree, hf_ldp_tlv_returned_msg_type, tvb, offset, 2,
1846
0
                                   type, "Message Type: Vendor Private (0x%X)", type);
1847
        /*chk for experimental*/
1848
3
    } else if (type>=LDP_EXPERIMENTAL_MESSAGE_START && type<=LDP_EXPERIMENTAL_MESSAGE_END){
1849
0
        proto_tree_add_uint_format(val_tree, hf_ldp_tlv_returned_msg_type, tvb, offset, 2,
1850
0
                                   type, "Message Type: Experimental (0x%X)", type);
1851
3
    } else {
1852
3
        proto_tree_add_uint_format(val_tree, hf_ldp_tlv_returned_msg_type, tvb, offset, 2,
1853
3
                                   type, "Message Type: %s (0x%X)", val_to_str_const(type, ldp_message_types,"Unknown Message Type"), type);
1854
3
    }
1855
1856
3
    proto_tree_add_item(val_tree, hf_ldp_tlv_returned_msg_len, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1857
3
    offset += 4;
1858
3
    rem    -= 4;
1859
1860
3
    if ( rem >= 4  ) { /*have msg_id*/
1861
3
        proto_tree_add_item(val_tree, hf_ldp_tlv_returned_msg_id, tvb, offset, 4, ENC_BIG_ENDIAN);
1862
3
        offset += 4;
1863
3
        rem -= 4;
1864
3
    }
1865
1866
3
    if ( rem > 0 ) {
1867
        /*XXX - dissect returned msg parameters*/
1868
2
        proto_tree_add_item(val_tree, hf_ldp_returned_message_parameters, tvb, offset, rem, ENC_NA);
1869
2
    }
1870
3
}
1871
1872
/* Dissect the common hello params */
1873
1874
static void
1875
#if 0
1876
dissect_tlv_common_hello_parms(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
1877
#else
1878
dissect_tlv_common_hello_parms(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree)
1879
#endif
1880
11
{
1881
#if 0
1882
    proto_tree *ti;
1883
#endif
1884
11
    proto_tree *val_tree;
1885
11
    proto_item *gtsm_flag_item;
1886
11
    uint16_t gtsm_flag_buffer;
1887
#if 0
1888
    ti = proto_tree_add_item(tree, hf_ldp_tlv_value, tvb, offset, rem, ENC_NA);
1889
    val_tree = proto_item_add_subtree(ti, ett_ldp_tlv_val);
1890
#else
1891
11
    val_tree=tree;
1892
11
#endif
1893
11
    proto_tree_add_item(val_tree, hf_ldp_tlv_val_hold, tvb, offset, 2, ENC_BIG_ENDIAN);
1894
11
    proto_tree_add_item(val_tree, hf_ldp_tlv_val_target, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1895
11
    proto_tree_add_item(val_tree, hf_ldp_tlv_val_request, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1896
11
    gtsm_flag_item = proto_tree_add_item(val_tree, hf_ldp_tlv_val_gtsm_flag, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1897
1898
11
    gtsm_flag_buffer = tvb_get_bits16(tvb, ((offset+2)*8), 16, ENC_BIG_ENDIAN);
1899
1900
11
    if ( gtsm_flag_buffer & 0x2000 ) {
1901
4
        if ( gtsm_flag_buffer & 0x8000 ) {
1902
3
            expert_add_info(pinfo, gtsm_flag_item, &ei_ldp_dtsm_and_target);
1903
3
        } else {
1904
1
            expert_add_info(pinfo, gtsm_flag_item, &ei_ldp_gtsm_supported);
1905
1
        }
1906
7
    } else {
1907
7
        if ( gtsm_flag_buffer & 0x8000 ) {
1908
0
                expert_add_info(pinfo, gtsm_flag_item, &ei_ldp_gtsm_not_supported_basic_discovery);
1909
7
        } else {
1910
7
                expert_add_info(pinfo, gtsm_flag_item, &ei_ldp_gtsm_not_supported);
1911
7
        }
1912
7
    }
1913
1914
11
    proto_tree_add_item(val_tree, hf_ldp_tlv_val_res, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1915
11
}
1916
1917
/* Dissect MAC TLV */
1918
1919
static void
1920
dissect_tlv_mac(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
1921
19
{
1922
19
    proto_tree   *val_tree;
1923
1924
19
    val_tree=proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "MAC addresses");
1925
1926
288
    for(; rem >= 6; offset += 6, rem -= 6) {
1927
269
        proto_tree_add_item(val_tree, hf_ldp_tlv_mac, tvb, offset, 6, ENC_NA);
1928
269
    }
1929
19
    if (rem)
1930
11
        proto_tree_add_expert_format(val_tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem, "Error processing TLV: Extra data at end of path vector");
1931
19
}
1932
1933
1934
1935
/* Dissect the common session params */
1936
1937
static void
1938
dissect_tlv_common_session_parms(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
1939
5
{
1940
5
    proto_tree *val_tree;
1941
1942
5
    if ( rem != 14) { /*length of Comm Sess Parms tlv*/
1943
5
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem, "Error processing Common Session Parameters TLV: length is %d, should be 14", rem);
1944
5
        return;
1945
5
    }
1946
0
    val_tree=proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "Parameters");
1947
1948
    /*Protocol Version*/
1949
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_sess_ver, tvb,offset, 2, ENC_BIG_ENDIAN);
1950
1951
    /*KeepAlive Time*/
1952
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_sess_ka, tvb,offset + 2, 2, ENC_BIG_ENDIAN);
1953
1954
    /*A bit*/
1955
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_sess_advbit,tvb, offset + 4, 1, ENC_BIG_ENDIAN);
1956
1957
    /*D bit*/
1958
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_sess_ldetbit,tvb, offset + 4, 1, ENC_BIG_ENDIAN);
1959
1960
    /*Path Vector Limit*/
1961
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_sess_pvlim,tvb, offset + 5, 1, ENC_BIG_ENDIAN);
1962
1963
    /*Max PDU Length*/
1964
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_sess_mxpdu,tvb, offset + 6, 2, ENC_BIG_ENDIAN);
1965
1966
    /*Rx LSR*/
1967
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_sess_rxlsr,tvb, offset + 8, 4, ENC_BIG_ENDIAN);
1968
1969
    /*Rx LS*/
1970
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_sess_rxls,tvb, offset + 12, 2, ENC_BIG_ENDIAN);
1971
0
}
1972
1973
/* Dissect the atm session params */
1974
1975
static void
1976
dissect_tlv_atm_session_parms(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
1977
0
{
1978
0
    proto_tree *val_tree, *lbl_tree;
1979
0
    uint8_t     numlr, ix;
1980
1981
0
    if (rem < 4) {
1982
0
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
1983
0
                            "Error processing ATM Parameters TLV: length is %d, should be >= 4",
1984
0
                            rem);
1985
0
        return;
1986
0
    }
1987
1988
0
    val_tree=proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "ATM Parameters");
1989
1990
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_sess_atm_merge,tvb, offset, 1, ENC_BIG_ENDIAN);
1991
1992
    /*get the number of label ranges*/
1993
0
    numlr=(tvb_get_uint8(tvb, offset)>>2) & 0x0F;
1994
0
    proto_tree_add_uint_format(val_tree, hf_ldp_tlv_sess_atm_lr,
1995
0
                               tvb, offset, 1, numlr, "Number of Label Range components: %u",
1996
0
                               numlr);
1997
1998
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_sess_atm_dir,tvb, offset, 1, ENC_BIG_ENDIAN);
1999
2000
    /*move into range components*/
2001
0
    offset += 4;
2002
0
    rem    -= 4;
2003
0
    val_tree=proto_tree_add_subtree(val_tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "ATM Label Range Components");
2004
2005
    /*now dissect ranges*/
2006
0
    for(ix=1; numlr > 0 && rem >= 8; ix++, rem-=8, numlr--) {
2007
0
        lbl_tree=proto_tree_add_subtree_format(val_tree, tvb, offset, 8,
2008
0
                               ett_ldp_tlv_val, NULL, "ATM Label Range Component %u", ix);
2009
2010
0
        proto_tree_add_item(lbl_tree,
2011
0
                                   hf_ldp_tlv_sess_atm_minvpi,
2012
0
                                   tvb, offset, 2,
2013
0
                                   ENC_BIG_ENDIAN);
2014
0
        proto_tree_add_item(lbl_tree,
2015
0
                                   hf_ldp_tlv_sess_atm_maxvpi,
2016
0
                                   tvb, (offset+4), 2, ENC_BIG_ENDIAN);
2017
2018
0
        proto_tree_add_item(lbl_tree,
2019
0
                                   hf_ldp_tlv_sess_atm_minvci,
2020
0
                                   tvb, offset+2, 2, ENC_BIG_ENDIAN);
2021
0
        proto_tree_add_item(lbl_tree,
2022
0
                                   hf_ldp_tlv_sess_atm_maxvci,
2023
0
                                   tvb, offset+6, 2, ENC_BIG_ENDIAN);
2024
2025
0
        offset += 8;
2026
0
    }
2027
0
    if( rem || numlr)
2028
0
        proto_tree_add_expert_format(val_tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
2029
0
                            "Error processing TLV: Extra data at end of TLV");
2030
0
}
2031
2032
/* Dissect the frame relay session params */
2033
2034
static void
2035
dissect_tlv_frame_relay_session_parms(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2036
5
{
2037
5
    proto_tree *val_tree, *lbl_tree;
2038
5
    uint8_t     numlr, ix, len;
2039
2040
5
    if(rem < 4) {
2041
1
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
2042
1
                            "Error processing Frame Relay Parameters TLV: length is %d, should be >= 4",
2043
1
                            rem);
2044
1
        return;
2045
1
    }
2046
2047
4
    val_tree=proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "Frame Relay Parameters");
2048
2049
4
    proto_tree_add_item(val_tree, hf_ldp_tlv_sess_fr_merge,
2050
4
                        tvb, offset, 1, ENC_BIG_ENDIAN);
2051
2052
    /*get the number of label ranges*/
2053
4
    numlr=(tvb_get_uint8(tvb, offset)>>2) & 0x0F;
2054
4
    proto_tree_add_uint_format(val_tree, hf_ldp_tlv_sess_fr_lr,
2055
4
                               tvb, offset, 1, numlr, "Number of Label Range components: %u",
2056
4
                               numlr);
2057
2058
4
    proto_tree_add_item(val_tree, hf_ldp_tlv_sess_fr_dir,
2059
4
                        tvb, offset, 1, ENC_BIG_ENDIAN);
2060
2061
    /*move into range components*/
2062
4
    offset += 4;
2063
4
    rem    -= 4;
2064
4
    val_tree=proto_tree_add_subtree(val_tree, tvb, offset, rem, ett_ldp_tlv_val, NULL,
2065
4
                             "Frame Relay Label Range Components");
2066
2067
    /*now dissect ranges*/
2068
28
    for(ix=1; numlr > 0 && rem >= 8; ix++, rem-=8, numlr--) {
2069
24
        lbl_tree=proto_tree_add_subtree_format(val_tree, tvb, offset, 8,
2070
24
                               ett_ldp_tlv_val, NULL, "Frame Relay Label Range Component %u", ix);
2071
2072
24
        len=(uint8_t)(tvb_get_ntohs(tvb, offset)>>7) & 0x03;
2073
24
        proto_tree_add_uint_format_value(lbl_tree, hf_ldp_tlv_sess_fr_len, tvb, offset, 2, len,
2074
24
                                   "%s (%u)", val_to_str_const(len, tlv_fr_len_vals, "Unknown Length"), len);
2075
2076
24
        proto_tree_add_item(lbl_tree, hf_ldp_tlv_sess_fr_mindlci, tvb, offset+1, 3, ENC_BIG_ENDIAN);
2077
24
        proto_tree_add_item(lbl_tree, hf_ldp_tlv_sess_fr_maxdlci, tvb, offset+5, 3, ENC_BIG_ENDIAN);
2078
2079
24
        offset += 8;
2080
24
    }
2081
2082
4
    if( rem || numlr)
2083
4
        proto_tree_add_expert_format(val_tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
2084
4
                            "Error processing TLV: Extra data at end of TLV");
2085
4
}
2086
2087
/* Dissect the Fault Tolerant (FT) Session TLV */
2088
2089
static void
2090
dissect_tlv_ft_session(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2091
0
{
2092
0
    proto_tree *ti, *val_tree, *flags_tree;
2093
0
    uint16_t flags;
2094
2095
0
    if(rem != 12){
2096
        /* error, length must be 12 bytes */
2097
0
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
2098
0
                            "Error processing FT Session TLV: length is %d, should be 12",
2099
0
                            rem);
2100
0
        return;
2101
0
    }
2102
2103
0
    val_tree=proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "FT Session Parameters");
2104
2105
    /* Flags */
2106
0
    ti = proto_tree_add_item(val_tree, hf_ldp_tlv_ft_sess_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
2107
0
    flags_tree = proto_item_add_subtree(ti,  ett_ldp_tlv_ft_flags);
2108
2109
0
    flags = tvb_get_ntohs(tvb, offset);
2110
0
    proto_item_append_text(ti, " (%s%s)", (flags & 0x8000) ? "R, " : "",
2111
0
                           val_to_str_const(flags & 0xF, tlv_ft_flags, "Invalid"));
2112
0
    proto_tree_add_item(flags_tree, hf_ldp_tlv_ft_sess_flag_r, tvb, offset, 2, ENC_BIG_ENDIAN);
2113
0
    proto_tree_add_item(flags_tree, hf_ldp_tlv_ft_sess_flag_res, tvb, offset, 2, ENC_BIG_ENDIAN);
2114
0
    proto_tree_add_item(flags_tree, hf_ldp_tlv_ft_sess_flag_s, tvb, offset, 2, ENC_BIG_ENDIAN);
2115
0
    proto_tree_add_item(flags_tree, hf_ldp_tlv_ft_sess_flag_a, tvb, offset, 2, ENC_BIG_ENDIAN);
2116
0
    proto_tree_add_item(flags_tree, hf_ldp_tlv_ft_sess_flag_c, tvb, offset, 2, ENC_BIG_ENDIAN);
2117
0
    proto_tree_add_item(flags_tree, hf_ldp_tlv_ft_sess_flag_l, tvb, offset, 2, ENC_BIG_ENDIAN);
2118
2119
    /* Reserved */
2120
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_ft_sess_res, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
2121
2122
    /* FT Reconnect TO */
2123
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_ft_sess_reconn_to, tvb, offset + 4,
2124
0
                        4, ENC_BIG_ENDIAN);
2125
2126
    /* Recovery Time */
2127
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_ft_sess_recovery_time, tvb, offset + 8,
2128
0
                        4, ENC_BIG_ENDIAN);
2129
0
}
2130
2131
static void
2132
dissect_tlv_lspid(tvbuff_t *tvb, packet_info *pinfo, unsigned offset,proto_tree *tree, int rem)
2133
1
{
2134
1
    proto_tree *val_tree;
2135
2136
1
    if(rem != 8) {
2137
1
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
2138
1
                            "Error processing LSP ID TLV: length is %d, should be 8",
2139
1
                            rem);
2140
1
        return;
2141
1
    }
2142
2143
0
    val_tree=proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "LSP ID");
2144
2145
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_lspid_act_flg,
2146
0
                        tvb, offset, 2, ENC_BIG_ENDIAN);
2147
0
    offset += 2;
2148
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_lspid_cr_lsp,
2149
0
                        tvb, offset, 2, ENC_BIG_ENDIAN);
2150
0
    offset += 2;
2151
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_lspid_ldpid,
2152
0
                        tvb, offset, 4, ENC_BIG_ENDIAN);
2153
0
}
2154
2155
static void
2156
dissect_tlv_er_hop_ipv4(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2157
2
{
2158
2
    proto_tree *val_tree;
2159
2160
2
    if(rem != 8) {
2161
2
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
2162
2
                            "Error processing ER HOP IPv4 TLV: length is %d, should be 8",
2163
2
                            rem);
2164
2
        return;
2165
2
    }
2166
0
    val_tree=proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "ER HOP IPv4");
2167
2168
0
    if(val_tree != NULL) {
2169
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_er_hop_loose,
2170
0
                            tvb, offset, 3, ENC_BIG_ENDIAN);
2171
0
        offset += 3;
2172
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_er_hop_prelen,
2173
0
                            tvb, offset, 1, ENC_BIG_ENDIAN);
2174
0
        offset ++;
2175
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_er_hop_prefix4,
2176
0
                            tvb, offset, 4, ENC_BIG_ENDIAN);
2177
0
    }
2178
0
}
2179
2180
static void
2181
dissect_tlv_er_hop_ipv6(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2182
1
{
2183
1
    proto_tree *val_tree;
2184
2185
1
    if(rem != 20) {
2186
1
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
2187
1
                            "Error processing ER HOP IPv6 TLV: length is %d, should be 20",
2188
1
                            rem);
2189
1
        return;
2190
1
    }
2191
0
    val_tree = proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "ER HOP IPv6");
2192
2193
0
    if(val_tree != NULL) {
2194
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_er_hop_loose,
2195
0
                            tvb, offset, 3, ENC_BIG_ENDIAN);
2196
0
        offset += 3;
2197
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_er_hop_prelen,
2198
0
                            tvb, offset, 1, ENC_BIG_ENDIAN);
2199
0
        offset ++;
2200
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_er_hop_prefix6,
2201
0
                            tvb, offset, 16, ENC_NA);
2202
0
    }
2203
0
}
2204
2205
static void
2206
dissect_tlv_er_hop_as(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2207
0
{
2208
0
    proto_tree *val_tree;
2209
2210
0
    if(rem != 4) {
2211
0
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
2212
0
                            "Error processing ER HOP AS TLV: length is %d, should be 4",
2213
0
                            rem);
2214
0
        return;
2215
0
    }
2216
0
    val_tree = proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "ER HOP AS");
2217
2218
0
    if(val_tree != NULL) {
2219
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_er_hop_loose,
2220
0
                            tvb, offset, 2, ENC_BIG_ENDIAN);
2221
0
        offset += 2;
2222
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_er_hop_as,
2223
0
                            tvb, offset, 2, ENC_BIG_ENDIAN);
2224
0
    }
2225
0
}
2226
2227
static void
2228
dissect_tlv_er_hop_lspid(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2229
0
{
2230
0
    proto_tree *val_tree;
2231
2232
0
    if(rem != 8) {
2233
0
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
2234
0
                            "Error processing ER HOP LSPID TLV: length is %d, should be 8",
2235
0
                            rem);
2236
0
        return;
2237
0
    }
2238
0
    val_tree = proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "ER HOP LSPID");
2239
2240
0
    if(val_tree != NULL) {
2241
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_er_hop_loose,
2242
0
                            tvb, offset, 2, ENC_BIG_ENDIAN);
2243
0
        offset += 2;
2244
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_er_hop_cr_lsp,
2245
0
                            tvb, offset, 2, ENC_BIG_ENDIAN);
2246
0
        offset += 2;
2247
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_er_hop_ldpid,
2248
0
                            tvb, offset, 4, ENC_BIG_ENDIAN);
2249
0
    }
2250
0
}
2251
2252
static void
2253
dissect_tlv_traffic(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2254
0
{
2255
0
    proto_tree *val_tree;
2256
0
    uint8_t val_8;
2257
0
    float   val_f;
2258
0
    proto_item *pi;
2259
2260
0
    if(rem != 24) {
2261
0
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
2262
0
                            "Error processing Traffic Parameters TLV: length is %d, should be 24",
2263
0
                            rem);
2264
0
        return;
2265
0
    }
2266
0
    val_tree = proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "Traffic parameters");
2267
2268
0
    if(val_tree != NULL) {
2269
        /* flags */
2270
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_flags_reserv, tvb, offset, 1, ENC_BIG_ENDIAN);
2271
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_flags_weight, tvb, offset, 1, ENC_BIG_ENDIAN);
2272
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_flags_ebs, tvb, offset, 1, ENC_BIG_ENDIAN);
2273
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_flags_cbs, tvb, offset, 1, ENC_BIG_ENDIAN);
2274
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_flags_cdr, tvb, offset, 1, ENC_BIG_ENDIAN);
2275
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_flags_pbs, tvb, offset, 1, ENC_BIG_ENDIAN);
2276
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_flags_pdr, tvb, offset, 1, ENC_BIG_ENDIAN);
2277
2278
0
        offset ++;
2279
        /* frequency */
2280
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_frequency, tvb, offset, 1, ENC_BIG_ENDIAN);
2281
0
        offset ++;
2282
2283
        /* reserver byte */
2284
0
        offset ++;
2285
2286
        /* weight */
2287
0
        pi = proto_tree_add_item(val_tree, hf_ldp_tlv_weight, tvb, offset, 1, ENC_BIG_ENDIAN);
2288
0
        val_8 = tvb_get_uint8(tvb, offset);
2289
0
        if (val_8 == 0)
2290
0
            proto_item_set_text(pi, "Weight: Not applicable");
2291
0
        offset ++;
2292
2293
        /* PDR */
2294
0
        val_f = tvb_get_ntohieee_float (tvb, offset);
2295
0
        proto_tree_add_double_format_value(val_tree, hf_ldp_tlv_pdr, tvb, offset,
2296
0
                                     4, val_f, "%.10g Bps", val_f);
2297
0
        offset += 4;
2298
        /* PBS */
2299
0
        val_f = tvb_get_ntohieee_float (tvb, offset);
2300
0
        proto_tree_add_double_format_value(val_tree, hf_ldp_tlv_pbs, tvb, offset,
2301
0
                                     4, val_f, "%.10g Bytes", val_f);
2302
0
        offset += 4;
2303
2304
        /* CDR */
2305
0
        val_f = tvb_get_ntohieee_float (tvb, offset);
2306
0
        proto_tree_add_double_format_value(val_tree, hf_ldp_tlv_cdr, tvb, offset,
2307
0
                                     4, val_f, "%.10g Bps", val_f);
2308
0
        offset += 4;
2309
2310
        /* CBS */
2311
0
        val_f = tvb_get_ntohieee_float (tvb, offset);
2312
0
        proto_tree_add_double_format_value(val_tree, hf_ldp_tlv_cbs, tvb, offset,
2313
0
                                     4, val_f, "%.10g Bytes", val_f);
2314
0
        offset += 4;
2315
2316
        /* EBS */
2317
0
        val_f = tvb_get_ntohieee_float (tvb, offset);
2318
0
        proto_tree_add_double_format_value(val_tree, hf_ldp_tlv_ebs, tvb, offset,
2319
0
                                     4, val_f, "%.10g Bytes", val_f);
2320
2321
0
    }
2322
0
}
2323
2324
static void
2325
dissect_tlv_route_pinning(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2326
2
{
2327
2
    proto_tree *val_tree;
2328
2329
2
    if(rem != 4) {
2330
2
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
2331
2
                            "Error processing Route Pinning TLV: length is %d, should be 4",
2332
2
                            rem);
2333
2
        return;
2334
2
    }
2335
0
    val_tree = proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "Route Pinning");
2336
2337
0
    if(val_tree != NULL) {
2338
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_route_pinning,
2339
0
                            tvb, offset, 4, ENC_BIG_ENDIAN);
2340
0
    }
2341
0
}
2342
2343
2344
static void
2345
dissect_tlv_resource_class(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2346
0
{
2347
0
    proto_tree *val_tree;
2348
2349
0
    if(rem != 4) {
2350
0
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
2351
0
                            "Error processing Resource Class TLV: length is %d, should be 4",
2352
0
                            rem);
2353
0
        return;
2354
0
    }
2355
0
    val_tree = proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "Resource Class");
2356
2357
0
    if(val_tree != NULL) {
2358
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_resource_class,
2359
0
                            tvb, offset, 4, ENC_BIG_ENDIAN);
2360
0
    }
2361
0
}
2362
2363
2364
static void
2365
dissect_tlv_preemption(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2366
0
{
2367
0
    proto_tree *val_tree;
2368
2369
0
    if(rem != 4) {
2370
0
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
2371
0
                            "Error processing Preemption TLV: length is %d, should be 4",
2372
0
                            rem);
2373
0
        return;
2374
0
    }
2375
0
    val_tree = proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "Preemption");
2376
2377
0
    if(val_tree != NULL) {
2378
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_set_prio,
2379
0
                            tvb, offset, 1, ENC_BIG_ENDIAN);
2380
0
        offset += 1;
2381
0
        proto_tree_add_item(val_tree, hf_ldp_tlv_hold_prio,
2382
0
                            tvb, offset, 1, ENC_BIG_ENDIAN);
2383
0
    }
2384
0
}
2385
2386
2387
static void
2388
dissect_tlv_diffserv(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2389
5
{
2390
5
    static int *hfindexes[] = {
2391
5
        &hf_ldp_tlv_diffserv_map,
2392
5
        &hf_ldp_tlv_diffserv_map_exp,
2393
5
        &hf_ldp_tlv_diffserv_phbid,
2394
5
        &hf_ldp_tlv_diffserv_phbid_dscp,
2395
5
        &hf_ldp_tlv_diffserv_phbid_code,
2396
5
        &hf_ldp_tlv_diffserv_phbid_bit14,
2397
5
        &hf_ldp_tlv_diffserv_phbid_bit15
2398
5
    };
2399
5
    static int *etts[] = {
2400
5
        &ett_ldp_diffserv_map,
2401
5
        &ett_ldp_diffserv_map_phbid
2402
5
    };
2403
5
    int type, mapnb, count;
2404
2405
5
    if (rem < 4) {
2406
1
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
2407
1
                            "Error processing Diff-Serv TLV: length is %d, should be >= 4", rem);
2408
1
        return;
2409
1
    }
2410
4
    proto_tree_add_uint(tree, hf_ldp_tlv_diffserv_type, tvb, offset, 1,
2411
4
                        type = tvb_get_uint8(tvb, offset));
2412
4
    type = (type >> 7) + 1;
2413
4
    if (type == 1) {
2414
        /* E-LSP */
2415
3
        offset += 3;
2416
3
        proto_tree_add_uint(tree, hf_ldp_tlv_diffserv_mapnb, tvb, offset,
2417
3
                            1, mapnb = tvb_get_uint8(tvb, offset) & 15);
2418
3
        offset += 1;
2419
18
        for (count = 0; count < mapnb; count++) {
2420
15
            dissect_diffserv_mpls_common(tvb, tree, type, offset, hfindexes, etts);
2421
15
            offset += 4;
2422
15
        }
2423
3
    }
2424
1
    else if (type == 2) {
2425
        /* L-LSP */
2426
1
        dissect_diffserv_mpls_common(tvb, tree, type, offset + 2, hfindexes, etts);
2427
1
    }
2428
4
}
2429
2430
2431
static int
2432
dissect_tlv(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem);
2433
2434
static void
2435
// NOLINTNEXTLINE(misc-no-recursion)
2436
dissect_tlv_er(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2437
0
{
2438
0
    proto_tree *val_tree;
2439
0
    int len;
2440
2441
0
    val_tree = proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "Explicit route");
2442
2443
0
    if(val_tree != NULL) {
2444
0
        while (rem > 0) {
2445
0
            len = dissect_tlv (tvb, pinfo, offset, val_tree, rem);
2446
0
            offset += len;
2447
0
            rem -= len;
2448
0
        }
2449
0
    }
2450
0
}
2451
2452
2453
static void
2454
dissect_tlv_pw_status(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem);
2455
2456
static void
2457
dissect_tlv_pw_grouping(tvbuff_t *tvb, unsigned offset, proto_tree *tree, int rem);
2458
2459
/* Dissect Upstream Label Assignment Capability TLV */
2460
static void
2461
dissect_tlv_upstrm_lbl_ass_cap(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2462
1
{
2463
1
    proto_tree *val_tree;
2464
2465
1
    if ( rem != 1)
2466
1
    {
2467
1
        proto_item* inv_length;
2468
1
        inv_length = proto_tree_add_item(tree, hf_ldp_tlv_inv_length, tvb, offset, rem, ENC_BIG_ENDIAN);
2469
1
        expert_add_info(pinfo, inv_length, &ei_ldp_inv_length);
2470
1
        return;
2471
1
    }
2472
2473
    /*State bit*/
2474
0
    val_tree = proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "State Bit");
2475
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_upstr_sbit, tvb,offset, 1, ENC_BIG_ENDIAN);
2476
0
}
2477
/*Dissect Upstream Assigned Label Request TLV*/
2478
static void
2479
dissect_tlv_upstrm_ass_lbl_req(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2480
0
{
2481
0
    if ( rem != 4)
2482
0
    {
2483
0
        proto_item* inv_length;
2484
0
        inv_length = proto_tree_add_item(tree, hf_ldp_tlv_inv_length, tvb, offset, rem, ENC_BIG_ENDIAN);
2485
0
        expert_add_info(pinfo, inv_length, &ei_ldp_inv_length);
2486
0
        return;
2487
0
    }
2488
2489
    /*Reserved Bits*/
2490
0
    proto_tree_add_item(tree, hf_ldp_tlv_upstr_lbl_req_resvbit, tvb,offset, 4, ENC_BIG_ENDIAN);
2491
0
}
2492
2493
/*Dissect Upstream Assigned Label TLV*/
2494
static void
2495
dissect_tlv_upstrm_ass_lbl(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2496
0
{
2497
0
    proto_tree *val_tree;
2498
2499
0
    if ( rem != 8)
2500
0
    {
2501
0
        proto_item* inv_length;
2502
0
        inv_length = proto_tree_add_item(tree, hf_ldp_tlv_inv_length, tvb, offset, rem, ENC_BIG_ENDIAN);
2503
0
        expert_add_info(pinfo, inv_length, &ei_ldp_inv_length);
2504
0
        return;
2505
0
    }
2506
    /*Value Field starts here*/
2507
0
    val_tree = proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "Upstream-Assigned Label");
2508
2509
    /*Reserved bits*/
2510
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_upstr_lbl_resvbit, tvb,offset, 4, ENC_BIG_ENDIAN);
2511
2512
    /*The Upstream Label*/
2513
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_upstr_ass_lbl, tvb,offset + 4, 4, ENC_BIG_ENDIAN);
2514
0
}
2515
/*Dissect IPv4 Interface ID TLV*/
2516
static void
2517
// NOLINTNEXTLINE(misc-no-recursion)
2518
dissect_tlv_ipv4_interface_id(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2519
0
{
2520
0
    proto_tree *val_tree, *sub_tree;
2521
2522
0
    val_tree = proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "IPv4 Interface ID");
2523
2524
    /*Dissect IPv4 Next/Previous Hop Address*/
2525
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_ipv4_intID_hop_addr, tvb,offset, 4, ENC_BIG_ENDIAN);
2526
2527
    /*Dissect Logical Interface ID*/
2528
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_logical_intID, tvb,offset + 4, 4, ENC_BIG_ENDIAN);
2529
2530
0
    sub_tree = proto_tree_add_subtree(val_tree, tvb, offset + 8, rem, ett_ldp_sub_tlv, NULL, "Sub TLV");
2531
2532
0
    if(rem != 20 && rem != 24 && rem != 28 && rem != 29)
2533
0
    {
2534
        /*rem = 20 >> Length of IP Multicast Tunnel TLV
2535
          rem = 29 >> Length of LDP P2MP LSV TLV
2536
          rem = 24 >> Length of RSVP-TE P2MP LSP TLV
2537
          rem = 28 >> Length of MPLS Context Label TLV*/
2538
2539
0
        proto_item* inv_length;
2540
0
        inv_length = proto_tree_add_item(val_tree, hf_ldp_tlv_inv_length, tvb, offset, rem, ENC_BIG_ENDIAN);
2541
0
        expert_add_info(pinfo, inv_length, &ei_ldp_inv_length);
2542
0
    }
2543
0
    else
2544
0
    {
2545
0
        rem = rem - 8;
2546
0
        dissect_tlv(tvb, pinfo, offset + 8, sub_tree, rem);
2547
0
    }
2548
0
}
2549
/*Dissect IP Multicast Tunnel TLV*/
2550
static void
2551
dissect_tlv_ip_multicast_tunnel(tvbuff_t *tvb, unsigned offset, proto_tree *tree, int rem)
2552
1
{
2553
1
    proto_tree *val_tree;
2554
2555
1
    val_tree = proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "IP Multicast Label");
2556
2557
1
    proto_tree_add_item(val_tree, hf_ldp_tlv_ip_multicast_srcaddr, tvb,offset, 4, ENC_BIG_ENDIAN);
2558
1
    proto_tree_add_item(val_tree, hf_ldp_tlv_ip_multicast_mltcstaddr, tvb,offset + 4, 4, ENC_BIG_ENDIAN);
2559
1
}
2560
2561
static void
2562
// NOLINTNEXTLINE(misc-no-recursion)
2563
dissect_tlv_mpls_context_lbl(tvbuff_t *tvb,packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2564
1
{
2565
1
    proto_tree *val_tree;
2566
2567
1
    proto_tree_add_item(tree, hf_ldp_tlv_ip_mpls_context_srcaddr, tvb,offset, 4, ENC_BIG_ENDIAN);
2568
1
    val_tree = proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_tlv_val, NULL, "MPLS Context Label");
2569
1
    dissect_tlv(tvb, pinfo, offset + 4, val_tree, rem);
2570
1
}
2571
2572
static void
2573
dissect_tlv_ldp_p2mp_lsp(tvbuff_t *tvb, unsigned offset, proto_tree *tree)
2574
1
{
2575
1
    uint32_t addr_length, opcode_length;
2576
2577
1
    proto_tree_add_item(tree, hf_ldp_tlv_ldp_p2mp_lsptype, tvb, offset, 1, ENC_BIG_ENDIAN);
2578
1
    proto_tree_add_item(tree, hf_ldp_tlv_ldp_p2mp_addrfam, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
2579
1
    proto_tree_add_item_ret_uint(tree, hf_ldp_tlv_ldp_p2mp_addrlen, tvb, offset + 3, 1, ENC_BIG_ENDIAN, &addr_length);
2580
1
    proto_tree_add_item(tree, hf_ldp_tlv_ldp_p2mp_rtnodeaddr, tvb, offset + 4, addr_length, ENC_BIG_ENDIAN);
2581
1
    proto_tree_add_item_ret_uint(tree, hf_ldp_tlv_ldp_p2mp_oplength, tvb,offset + 4 + addr_length, 2, ENC_BIG_ENDIAN, &opcode_length);
2582
1
    proto_tree_add_item(tree, hf_ldp_tlv_ldp_p2mp_opvalue, tvb, offset + 4 + addr_length + 2, opcode_length, ENC_NA);
2583
1
}
2584
2585
static void
2586
dissect_tlv_rsvp_te_p2mp_lsp(tvbuff_t *tvb, unsigned offset, proto_tree *tree)
2587
0
{
2588
2589
0
    proto_tree_add_item(tree, hf_ldp_tlv_rsvp_te_p2mp_id, tvb,offset, 4, ENC_BIG_ENDIAN);
2590
0
    proto_tree_add_item(tree, hf_ldp_tlv_must_be_zero, tvb,offset + 4, 2, ENC_BIG_ENDIAN);
2591
0
    proto_tree_add_item(tree, hf_ldp_tlv_tunnel_id, tvb,offset + 6, 2, ENC_BIG_ENDIAN);
2592
0
    proto_tree_add_item(tree, hf_ldp_tlv_ext_tunnel_id, tvb,offset + 8, 4, ENC_BIG_ENDIAN);
2593
0
}
2594
2595
/* Dissect a TLV and return the number of bytes consumed ... */
2596
2597
static int
2598
// NOLINTNEXTLINE(misc-no-recursion)
2599
dissect_tlv(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
2600
970
{
2601
970
    uint16_t type, typebak;
2602
970
    int length;
2603
2604
970
    length=tvb_reported_length_remaining(tvb, offset);
2605
970
    rem=MIN(rem, length);
2606
2607
970
    if( rem < 4 ) {/*chk for minimum header*/
2608
25
        if (tree) {
2609
25
            proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
2610
25
                                "Error processing TLV: length is %d, should be >= 4",
2611
25
                                rem);
2612
25
        }
2613
25
        return rem;
2614
25
    }
2615
945
    type = tvb_get_ntohs(tvb, offset) & 0x3FFF;
2616
2617
945
    length = tvb_get_ntohs(tvb, offset + 2);
2618
945
    rem -= 4; /*do not count header*/
2619
945
    length = MIN(length, rem);  /* Don't go haywire if a problem ... */
2620
2621
945
    increment_dissection_depth(pinfo);
2622
2623
945
    if (tree) {
2624
941
        proto_tree *tlv_tree;
2625
        /*chk for vendor-private*/
2626
941
        if(type>=TLV_VENDOR_PRIVATE_START && type<=TLV_VENDOR_PRIVATE_END){
2627
8
            typebak=type;               /*keep type*/
2628
8
            type=TLV_VENDOR_PRIVATE_START;
2629
8
            tlv_tree = proto_tree_add_subtree(tree, tvb, offset, length + 4, ett_ldp_tlv, NULL, "Vendor Private TLV");
2630
            /*chk for experimental*/
2631
933
        } else if(type>=TLV_EXPERIMENTAL_START && type<=TLV_EXPERIMENTAL_END){
2632
25
            typebak=type;               /*keep type*/
2633
25
            type=TLV_EXPERIMENTAL_START;
2634
25
            tlv_tree = proto_tree_add_subtree(tree, tvb, offset, length + 4, ett_ldp_tlv, NULL, "Experimental TLV");
2635
908
        } else {
2636
908
            typebak=0;
2637
908
            tlv_tree = proto_tree_add_subtree(tree, tvb, offset, length + 4, ett_ldp_tlv, NULL,
2638
908
                                     val_to_str(type, tlv_type_names, "Unknown TLV type (0x%04X)"));
2639
908
        }
2640
2641
941
        proto_tree_add_item(tlv_tree, hf_ldp_tlv_unknown, tvb, offset, 1, ENC_BIG_ENDIAN);
2642
2643
941
        switch (type) {
2644
8
        case TLV_VENDOR_PRIVATE_START:
2645
8
            proto_tree_add_uint_format_value(tlv_tree, hf_ldp_tlv_type, tvb, offset, 2,
2646
8
                                       typebak, "Vendor Private (0x%X)", typebak);
2647
8
            break;
2648
25
        case TLV_EXPERIMENTAL_START:
2649
25
            proto_tree_add_uint_format_value(tlv_tree, hf_ldp_tlv_type, tvb, offset, 2,
2650
25
                                       typebak, "Experimental (0x%X)", typebak);
2651
25
            break;
2652
908
        default:
2653
908
            proto_tree_add_uint_format(tlv_tree, hf_ldp_tlv_type, tvb, offset, 2,
2654
908
                                       type, "TLV Type: %s (0x%X)", val_to_str_const(type, tlv_type_names, "Unknown TLV type"), type );
2655
941
        }
2656
2657
941
        proto_tree_add_item(tlv_tree, hf_ldp_tlv_len, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
2658
2659
941
        switch (type) {
2660
2661
37
        case TLV_FEC:
2662
37
            dissect_tlv_fec(tvb, pinfo, offset + 4, tlv_tree, length);
2663
37
            break;
2664
2665
24
        case TLV_ADDRESS_LIST:
2666
24
            dissect_tlv_address_list(tvb, pinfo, offset + 4, tlv_tree, length);
2667
24
            break;
2668
2669
2
        case TLV_HOP_COUNT:
2670
2
            if( length != 1 ) /*error, only one byte*/
2671
2
                proto_tree_add_expert_format(tlv_tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset + 4,length,
2672
2
                                    "Error processing Hop Count TLV: length is %d, should be 1",
2673
2
                                    length);
2674
0
            else
2675
0
                proto_tree_add_item(tlv_tree, hf_ldp_tlv_hc_value, tvb,offset + 4, length, ENC_BIG_ENDIAN);
2676
2
            break;
2677
2678
6
        case TLV_PATH_VECTOR:
2679
6
            dissect_tlv_path_vector(tvb, pinfo, offset + 4, tlv_tree, length);
2680
6
            break;
2681
2682
5
        case TLV_GENERIC_LABEL:
2683
5
            if( length != 4 ) /*error, need only label*/
2684
5
                proto_tree_add_expert_format(tlv_tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset + 4, length,
2685
5
                                    "Error processing Generic Label TLV: length is %d, should be 4",
2686
5
                                    length);
2687
0
            else {
2688
0
                uint32_t label=tvb_get_ntohl(tvb, offset+4) & 0x000FFFFF;
2689
2690
0
                proto_tree_add_uint(tlv_tree, hf_ldp_tlv_generic_label,
2691
0
                                           tvb, offset+4, length, label);
2692
0
            }
2693
5
            break;
2694
2695
4
        case TLV_ATM_LABEL:
2696
4
            dissect_tlv_atm_label(tvb, pinfo, offset + 4, tlv_tree, length);
2697
4
            break;
2698
2699
5
        case TLV_FRAME_RELAY_LABEL:
2700
5
            dissect_tlv_frame_label(tvb, pinfo, offset + 4, tlv_tree, length);
2701
5
            break;
2702
2703
2
        case TLV_FT_PROTECTION:
2704
2
            if( length != 4 ) /* Length must be 4 bytes */
2705
2
                proto_tree_add_expert_format(tlv_tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset + 4, length,
2706
2
                                    "Error processing FT Protection TLV: length is %d, should be 4",
2707
2
                                    length);
2708
0
            else
2709
0
                proto_tree_add_item(tlv_tree, hf_ldp_tlv_ft_protect_sequence_num, tvb,
2710
0
                                    offset + 4,length, ENC_BIG_ENDIAN);
2711
2
            break;
2712
2713
2
        case TLV_ENTROPY_LABEL_CAPA:
2714
2
            if( length != 0 ) /* Length must be 0 bytes */
2715
2
                proto_tree_add_expert_format(tlv_tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset + 4, length,
2716
2
                                    "Error processing Entropy Label Capability TLV: length is %d, should be 0",
2717
2
                                    length);
2718
2
            break;
2719
2720
2
        case TLV_STATUS:
2721
2
            dissect_tlv_status(tvb, pinfo, offset + 4, tlv_tree, length);
2722
2
            break;
2723
2724
1
        case TLV_EXTENDED_STATUS:
2725
1
            if( length != 4 ) /*error, need only status_code(uint32_t)*/
2726
1
                proto_tree_add_expert_format(tlv_tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset + 4, length,
2727
1
                                    "Error processing Extended Status TLV: length is %d, should be 4",
2728
1
                                    length);
2729
0
            else {
2730
0
                proto_tree_add_item(tlv_tree, hf_ldp_tlv_extstatus_data, tvb, offset + 4, length, ENC_BIG_ENDIAN);
2731
0
            }
2732
1
            break;
2733
2734
2
        case TLV_RETURNED_PDU:
2735
2
            dissect_tlv_returned_pdu(tvb, pinfo, offset + 4, tlv_tree, length);
2736
2
            break;
2737
2738
3
        case TLV_RETURNED_MESSAGE:
2739
3
            dissect_tlv_returned_message(tvb, pinfo, offset + 4, tlv_tree, length);
2740
3
            break;
2741
2742
11
        case TLV_COMMON_HELLO_PARAMS:
2743
#if 0
2744
            dissect_tlv_common_hello_parms(tvb, pinfo, offset + 4, tlv_tree, length);
2745
#else
2746
11
            dissect_tlv_common_hello_parms(tvb, pinfo, offset + 4, tlv_tree);
2747
11
#endif
2748
11
            break;
2749
2750
2
        case TLV_IPV4_TRANSPORT_ADDRESS:
2751
2
            if( length != 4 ) /*error, need only ipv4*/
2752
1
                proto_tree_add_expert_format(tlv_tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset + 4, length,
2753
1
                                    "Error processing IPv4 Transport Address TLV: length is %d, should be 4",
2754
1
                                    length);
2755
1
            else {
2756
1
                proto_tree_add_item(tlv_tree, hf_ldp_tlv_ipv4_taddr, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
2757
1
            }
2758
2
            break;
2759
2760
1
        case TLV_CONFIGURATION_SEQUENCE_NUMBER:
2761
1
            if( length != 4 ) /*error, need only seq_num(uint32_t)*/
2762
1
                proto_tree_add_expert_format(tlv_tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset + 4, length,
2763
1
                                    "Error processing Configuration Sequence Number TLV: length is %d, should be 4",
2764
1
                                    length);
2765
0
            else {
2766
0
                proto_tree_add_item(tlv_tree, hf_ldp_tlv_config_seqno, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
2767
0
            }
2768
1
            break;
2769
2770
0
        case TLV_IPV6_TRANSPORT_ADDRESS:
2771
0
            if( length != 16 ) /*error, need only ipv6*/
2772
0
                proto_tree_add_expert_format(tlv_tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset + 4, length,
2773
0
                                    "Error processing IPv6 Transport Address TLV: length is %d, should be 16",
2774
0
                                    length);
2775
0
            else {
2776
0
                proto_tree_add_item(tlv_tree, hf_ldp_tlv_ipv6_taddr, tvb, offset + 4, 16, ENC_NA);
2777
0
            }
2778
0
            break;
2779
2780
19
        case TLV_MAC: /* draft-lasserre-vkompella-ppvpn-vpls-02.txt */
2781
19
            dissect_tlv_mac(tvb, pinfo, offset + 4, tlv_tree, length);
2782
19
            break;
2783
2784
5
        case TLV_COMMON_SESSION_PARAMS:
2785
5
            dissect_tlv_common_session_parms(tvb, pinfo, offset + 4, tlv_tree, length);
2786
5
            break;
2787
2788
0
        case TLV_ATM_SESSION_PARAMS:
2789
0
            dissect_tlv_atm_session_parms(tvb, pinfo, offset + 4, tlv_tree, length);
2790
0
            break;
2791
2792
5
        case TLV_FRAME_RELAY_SESSION_PARAMS:
2793
5
            dissect_tlv_frame_relay_session_parms(tvb, pinfo, offset + 4, tlv_tree, length);
2794
5
            break;
2795
2796
0
        case TLV_FT_SESSION:
2797
            /* Used in RFC3478 LDP Graceful Restart */
2798
0
            dissect_tlv_ft_session(tvb, pinfo, offset + 4, tlv_tree, length);
2799
0
            break;
2800
2801
0
        case TLV_FT_ACK:
2802
0
            if( length != 4 ) /* Length must be 4 bytes */
2803
0
                proto_tree_add_expert_format(tlv_tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset + 4, length,
2804
0
                                    "Error processing FT ACK TLV: length is %d, should be 4",
2805
0
                                    length);
2806
0
            else
2807
0
                proto_tree_add_item(tlv_tree, hf_ldp_tlv_ft_ack_sequence_num, tvb,
2808
0
                                    offset + 4,length, ENC_BIG_ENDIAN);
2809
0
            break;
2810
2811
1
        case TLV_FT_CORK:
2812
1
            if( length != 0 ) /* Length must be 0 bytes */
2813
1
                proto_tree_add_expert_format(tlv_tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset + 4, length,
2814
1
                                    "Error processing FT Cork TLV: length is %d, should be 0",
2815
1
                                    length);
2816
1
            break;
2817
2818
4
        case TLV_LABEL_REQUEST_MESSAGE_ID:
2819
4
            if( length != 4 ) /*error, need only one msgid*/
2820
4
                proto_tree_add_expert_format(tlv_tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset + 4, length,
2821
4
                                    "Error processing Label Request Message ID TLV: length is %d, should be 4",
2822
4
                                    length);
2823
0
            else
2824
0
                proto_tree_add_item(tlv_tree, hf_ldp_tlv_lbl_req_msg_id, tvb,offset + 4,length, ENC_BIG_ENDIAN);
2825
4
            break;
2826
2827
1
        case TLV_LSPID:
2828
1
            dissect_tlv_lspid(tvb, pinfo, offset + 4, tlv_tree, length);
2829
1
            break;
2830
2831
0
        case TLV_ER_HOP:
2832
0
            dissect_tlv_er(tvb, pinfo, offset + 4, tlv_tree, length);
2833
0
            break;
2834
2835
2
        case TLV_IPV4_PREFIX_ER_HOP:
2836
2
            dissect_tlv_er_hop_ipv4(tvb, pinfo, offset + 4, tlv_tree, length);
2837
2
            break;
2838
2839
1
        case TLV_IPV6_PREFIX_ER_HOP:
2840
1
            dissect_tlv_er_hop_ipv6(tvb, pinfo, offset +4, tlv_tree, length);
2841
1
            break;
2842
2843
0
        case TLV_AUTONOMOUS_SYSTEM_NUMBER_ER_HOP:
2844
0
            dissect_tlv_er_hop_as(tvb, pinfo, offset + 4, tlv_tree, length);
2845
0
            break;
2846
2847
0
        case TLV_LSP_ID_ER_HOP:
2848
0
            dissect_tlv_er_hop_lspid(tvb, pinfo, offset +4, tlv_tree, length);
2849
0
            break;
2850
2851
0
        case TLV_TRAFFIC_PARAMS:
2852
0
            dissect_tlv_traffic(tvb, pinfo, offset +4, tlv_tree, length);
2853
0
            break;
2854
2855
0
        case TLV_PREEMPTION:
2856
0
            dissect_tlv_preemption(tvb, pinfo, offset +4, tlv_tree, length);
2857
0
            break;
2858
2859
0
        case TLV_RESOURCE_CLASS:
2860
0
            dissect_tlv_resource_class(tvb, pinfo, offset +4, tlv_tree, length);
2861
0
            break;
2862
2863
2
        case TLV_ROUTE_PINNING:
2864
2
            dissect_tlv_route_pinning(tvb, pinfo, offset +4, tlv_tree, length);
2865
2
            break;
2866
2867
5
        case TLV_DIFF_SERV:
2868
5
            dissect_tlv_diffserv(tvb, pinfo, offset +4, tlv_tree, length);
2869
5
            break;
2870
2871
1
        case TLV_HSMP_LSP_CAPA_PARAM:
2872
1
            dissect_tlv_upstrm_lbl_ass_cap(tvb, pinfo, offset + 4, tlv_tree, length);
2873
1
            break;
2874
2875
8
        case TLV_VENDOR_PRIVATE_START:
2876
8
            if( length < 4 ) /*error, at least Vendor ID*/
2877
3
                proto_tree_add_expert_format(tlv_tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset + 4, length,
2878
3
                                    "Error processing Vendor Private Start TLV: length is %d, should be >= 4",
2879
3
                                    length);
2880
5
            else {
2881
5
                proto_tree_add_item(tlv_tree, hf_ldp_tlv_vendor_id, tvb,offset + 4, 4, ENC_BIG_ENDIAN);
2882
5
                if( length > 4 )  /*have data*/
2883
5
                    proto_tree_add_item(tlv_tree, hf_ldp_data, tvb, offset + 8, length-4, ENC_NA);
2884
5
            }
2885
8
            break;
2886
2887
25
        case TLV_EXPERIMENTAL_START:
2888
25
            if( length < 4 ) /*error, at least Experiment ID*/
2889
2
                proto_tree_add_expert_format(tlv_tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset + 4, length,
2890
2
                                    "Error processing Experimental Start TLV: length is %d, should be >= 4",
2891
2
                                    length);
2892
23
            else {
2893
23
                proto_tree_add_item(tlv_tree, hf_ldp_tlv_experiment_id, tvb,offset + 4, 4, ENC_BIG_ENDIAN);
2894
23
                if( length > 4 )  /*have data*/
2895
23
                    proto_tree_add_item(tlv_tree, hf_ldp_data, tvb, offset + 8, length-4, ENC_NA);
2896
23
            }
2897
25
            break;
2898
2899
0
        case TLV_PW_STATUS:
2900
0
        {
2901
            /* Ref: RFC 4447  and 4446*/
2902
0
            dissect_tlv_pw_status(tvb, pinfo, offset +4, tlv_tree, length);
2903
0
            break;
2904
0
        }
2905
0
        case TLV_PW_INTERFACE_PARAMS:
2906
0
        {
2907
            /* Ref: RFC 4447 */
2908
0
            static int *interface_params_header_fields[] = {
2909
0
                &hf_ldp_tlv_intparam_length ,
2910
0
                &hf_ldp_tlv_intparam_mtu ,
2911
0
                &hf_ldp_tlv_intparam_tdmbps ,
2912
0
                &hf_ldp_tlv_intparam_id ,
2913
0
                &hf_ldp_tlv_intparam_maxcatmcells ,
2914
0
                &hf_ldp_tlv_intparam_desc ,
2915
0
                &hf_ldp_tlv_intparam_cepbytes ,
2916
0
                &hf_ldp_tlv_intparam_cepopt_ais ,
2917
0
                &hf_ldp_tlv_intparam_cepopt_une ,
2918
0
                &hf_ldp_tlv_intparam_cepopt_rtp ,
2919
0
                &hf_ldp_tlv_intparam_cepopt_ebm ,
2920
0
                &hf_ldp_tlv_intparam_cepopt_mah ,
2921
0
                &hf_ldp_tlv_intparam_cepopt_res ,
2922
0
                &hf_ldp_tlv_intparam_cepopt_ceptype ,
2923
0
                &hf_ldp_tlv_intparam_cepopt_t3 ,
2924
0
                &hf_ldp_tlv_intparam_cepopt_e3 ,
2925
0
                &hf_ldp_tlv_intparam_vlanid ,
2926
0
                &hf_ldp_tlv_intparam_dlcilen ,
2927
0
                &hf_ldp_tlv_intparam_fcslen ,
2928
0
                &hf_ldp_tlv_intparam_tdmopt_r ,
2929
0
                &hf_ldp_tlv_intparam_tdmopt_d ,
2930
0
                &hf_ldp_tlv_intparam_tdmopt_f ,
2931
0
                &hf_ldp_tlv_intparam_tdmopt_res1 ,
2932
0
                &hf_ldp_tlv_intparam_tdmopt_pt ,
2933
0
                &hf_ldp_tlv_intparam_tdmopt_res2 ,
2934
0
                &hf_ldp_tlv_intparam_tdmopt_freq ,
2935
0
                &hf_ldp_tlv_intparam_tdmopt_ssrc ,
2936
0
                &hf_ldp_tlv_intparam_vccv_cctype_cw ,
2937
0
                &hf_ldp_tlv_intparam_vccv_cctype_mplsra ,
2938
0
                &hf_ldp_tlv_intparam_vccv_cctype_ttl1 ,
2939
0
                &hf_ldp_tlv_intparam_vccv_cvtype_icmpping ,
2940
0
                &hf_ldp_tlv_intparam_vccv_cvtype_lspping ,
2941
0
                &hf_ldp_tlv_intparam_vccv_cvtype_bfd,
2942
0
                &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd2,
2943
0
                &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd3,
2944
0
                &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd4,
2945
0
                &hf_ldp_tlv_fec_vc_intparam_flowlabel_t,
2946
0
                &hf_ldp_tlv_fec_vc_intparam_flowlabel_r,
2947
0
                &hf_ldp_tlv_fec_vc_intparam_flowlabel_res
2948
0
            };
2949
0
            int vc_len = length;
2950
0
            offset += 4;
2951
0
            while ( (vc_len > 1) && (rem > 1) ) {       /* enough to include id and length */
2952
0
                int intparam_len = tvb_get_uint8(tvb, offset+1);
2953
0
                if (intparam_len < 2){ /* At least Type and Len, protect against len = 0 */
2954
0
                    proto_tree_add_expert(tlv_tree, pinfo, &ei_ldp_malformed_interface_parameter, tvb, offset +1, 1);
2955
0
                    break;
2956
0
                }
2957
2958
0
                if ( (vc_len -intparam_len) <0 && (rem -intparam_len) <0 ) { /* error condition */
2959
0
                    proto_tree_add_expert(tlv_tree, pinfo, &ei_ldp_malformed_data, tvb, offset +2, MIN(vc_len,rem));
2960
0
                    break;
2961
0
                }
2962
0
                dissect_subtlv_interface_parameters(tvb, offset, tlv_tree, intparam_len, interface_params_header_fields);
2963
2964
0
                rem -= intparam_len;
2965
0
                vc_len -= intparam_len;
2966
0
                offset += intparam_len;
2967
0
            }
2968
0
            break;
2969
0
        }
2970
0
        case TLV_PW_GROUP_ID:
2971
0
        {
2972
            /* Ref: RFC 4447 */
2973
0
            dissect_tlv_pw_grouping(tvb, offset +4, tlv_tree, length);
2974
0
            break;
2975
0
        }
2976
0
        case TLV_LDP_UPSTREAM_LABEL_ASSIGNMENT_CAPA:
2977
0
            dissect_tlv_upstrm_lbl_ass_cap(tvb, pinfo, offset + 4, tlv_tree, length);
2978
0
            break;
2979
0
        case TLV_LDP_UPSTREAM_ASSIGNED_LABEL_REQUEST:
2980
0
            dissect_tlv_upstrm_ass_lbl_req(tvb, pinfo, offset + 4, tlv_tree, length);
2981
0
            break;
2982
0
        case TLV_LDP_UPSTREAM_ASSIGNED_LABEL:
2983
0
            dissect_tlv_upstrm_ass_lbl(tvb, pinfo, offset + 4, tlv_tree, length);
2984
0
            break;
2985
0
        case TLV_IPV4_INTERFACE_ID:
2986
0
            dissect_tlv_ipv4_interface_id(tvb, pinfo, offset + 4, tlv_tree, length);
2987
            /*dissect_tlv_ipv4_interface_id(tvb, offset + 4, tlv_tree, length);*/
2988
0
            break;
2989
1
        case TLV_IP_MULTICAST_TUNNEL:
2990
1
            dissect_tlv_ip_multicast_tunnel(tvb, offset + 4, tlv_tree, rem);
2991
1
            break;
2992
1
        case TLV_MPLS_CONTEXT_LBL:
2993
1
            dissect_tlv_mpls_context_lbl(tvb, pinfo, offset + 4, tlv_tree, rem);
2994
1
            break;
2995
1
        case TLV_LDP_P2MP_LSP:
2996
1
            dissect_tlv_ldp_p2mp_lsp(tvb, offset + 4, tlv_tree);
2997
1
            break;
2998
0
        case TLV_RSVP_TE_P2MP_LSP:
2999
0
            dissect_tlv_rsvp_te_p2mp_lsp(tvb, offset + 4, tlv_tree);
3000
0
            break;
3001
750
        default:
3002
750
            proto_tree_add_item(tlv_tree, hf_ldp_tlv_value, tvb, offset + 4, length, ENC_NA);
3003
750
            break;
3004
941
        }
3005
941
    }
3006
3007
866
    decrement_dissection_depth(pinfo);
3008
866
    return length + 4;  /* Length of the value field + header */
3009
945
}
3010
3011
3012
/* Dissect a Message and return the number of bytes consumed ... */
3013
3014
static int
3015
dissect_msg(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree)
3016
315
{
3017
315
    uint16_t    type, typebak;
3018
315
    uint8_t     extra=0;
3019
315
    int length, rem, ao=0, co;
3020
315
    proto_tree *msg_tree = NULL;
3021
3022
315
    rem=tvb_reported_length_remaining(tvb, offset);
3023
3024
315
    if( rem < 8 ) {/*chk for minimum header = type + length + msg_id*/
3025
3
        col_append_str(pinfo->cinfo, COL_INFO, "Bad Message");
3026
3
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_inv_length, tvb, offset, rem,
3027
3
                                "Error processing Message: length is %d, should be >= 8",
3028
3
                                rem);
3029
3
        return rem;
3030
3
    }
3031
312
    type = tvb_get_ntohs(tvb, offset) & 0x7FFF;
3032
3033
    /*chk for vendor-private*/
3034
312
    if(type>=LDP_VENDOR_PRIVATE_START && type<=LDP_VENDOR_PRIVATE_END){
3035
4
        typebak=type;           /*keep type*/
3036
4
        type=LDP_VENDOR_PRIVATE_START;
3037
4
        extra=4;
3038
        /*chk for experimental*/
3039
308
    } else if(type>=LDP_EXPERIMENTAL_MESSAGE_START && type<=LDP_EXPERIMENTAL_MESSAGE_END){
3040
8
        typebak=type;           /*keep type*/
3041
8
        type=LDP_EXPERIMENTAL_MESSAGE_START;
3042
8
        extra=4;
3043
300
    } else {
3044
300
        typebak=0;
3045
300
        extra=0;
3046
300
    }
3047
3048
312
    if( (length = tvb_get_ntohs(tvb, offset + 2)) < (4+extra) ) {/*not enough data for type*/
3049
36
        col_append_str(pinfo->cinfo, COL_INFO, "Bad Message Length ");
3050
36
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_inv_length, tvb, offset, rem,
3051
36
                                "Error processing Message Length: length is %d, should be >= %u",
3052
36
                                length, 4+extra);
3053
36
        return rem;
3054
36
    }
3055
276
    rem -= 4;
3056
276
    length = MIN(length, rem);  /* Don't go haywire if a problem ... */
3057
3058
276
    switch (type) {
3059
4
    case LDP_VENDOR_PRIVATE_START:
3060
4
        col_append_fstr(pinfo->cinfo, COL_INFO, "Vendor-Private Message (0x%04X) ", typebak);
3061
4
        break;
3062
3
    case LDP_EXPERIMENTAL_MESSAGE_START:
3063
3
        col_append_fstr(pinfo->cinfo, COL_INFO, "Experimental Message (0x%04X) ", typebak);
3064
3
        break;
3065
267
    default:
3066
267
        col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, ldp_message_types, "Unknown Message (0x%04X)"));
3067
276
    }
3068
3069
274
    if (tree) {
3070
3071
274
        switch (type) {
3072
4
        case LDP_VENDOR_PRIVATE_START:
3073
4
            msg_tree = proto_tree_add_subtree(tree, tvb, offset, length + 4, ett_ldp_message, NULL, "Vendor-Private Message");
3074
4
            break;
3075
3
        case LDP_EXPERIMENTAL_MESSAGE_START:
3076
3
            msg_tree = proto_tree_add_subtree(tree, tvb, offset, length + 4, ett_ldp_message, NULL, "Experimental Message");
3077
3
            break;
3078
267
        default:
3079
267
            msg_tree = proto_tree_add_subtree(tree, tvb, offset, length + 4, ett_ldp_message, NULL,
3080
267
                                     val_to_str(type, ldp_message_types, "Unknown Message type (0x%04X)"));
3081
274
        }
3082
3083
274
        proto_tree_add_item(msg_tree, hf_ldp_msg_ubit, tvb, offset, 1, ENC_BIG_ENDIAN);
3084
3085
274
        switch (type) {
3086
4
        case LDP_VENDOR_PRIVATE_START:
3087
4
            proto_tree_add_uint_format_value(msg_tree, hf_ldp_msg_type, tvb, offset, 2,
3088
4
                                       typebak, "Vendor Private (0x%X)", typebak);
3089
4
            break;
3090
3
        case LDP_EXPERIMENTAL_MESSAGE_START:
3091
3
            proto_tree_add_uint_format_value(msg_tree, hf_ldp_msg_type, tvb, offset, 2,
3092
3
                                       typebak, "Experimental (0x%X)", typebak);
3093
3
            break;
3094
267
        default:
3095
267
            proto_tree_add_uint_format(msg_tree, hf_ldp_msg_type, tvb, offset, 2,
3096
267
                                       type, "Message Type: %s (0x%X)", val_to_str_const(type, ldp_message_types,"Unknown Message Type"), type);
3097
274
        }
3098
3099
274
        proto_tree_add_item(msg_tree, hf_ldp_msg_len, tvb, offset+2, 2, ENC_BIG_ENDIAN);
3100
274
        proto_tree_add_item(msg_tree, hf_ldp_msg_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
3101
274
        if(extra){
3102
7
            proto_tree_add_item(msg_tree, (type == LDP_VENDOR_PRIVATE_START) ?
3103
4
                hf_ldp_msg_vendor_id : hf_ldp_msg_experiment_id, tvb, offset+8,
3104
7
                extra, ENC_BIG_ENDIAN);
3105
7
        }
3106
274
    }
3107
3108
274
    offset += (8+extra);
3109
274
    length -= (4+extra);
3110
3111
274
    if (tree) {
3112
1.24k
        while ( (length-ao) > 0 ) {
3113
969
            co = dissect_tlv(tvb, pinfo, offset, msg_tree, length-ao);
3114
969
            offset += co;
3115
969
            ao += co;
3116
969
        }
3117
274
    }
3118
3119
274
    return length+8+extra;
3120
274
}
3121
3122
/* Dissect a PDU */
3123
static void
3124
dissect_ldp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3125
556
{
3126
556
    int offset = 0, co;
3127
556
    int rem, length;
3128
556
    proto_tree *ti=NULL, *pdu_tree = NULL;
3129
3130
556
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "LDP");
3131
3132
556
    col_clear(pinfo->cinfo, COL_INFO);
3133
3134
556
    if (tree) {
3135
556
        ti=proto_tree_add_item(tree, proto_ldp, tvb, 0, -1, ENC_NA);
3136
556
        pdu_tree = proto_item_add_subtree(ti, ett_ldp);
3137
3138
556
        proto_tree_add_item(pdu_tree, hf_ldp_version, tvb, offset, 2, ENC_BIG_ENDIAN);
3139
556
    }
3140
3141
556
    length = tvb_get_ntohs(tvb, offset+2);
3142
556
    if (tree) {
3143
555
        proto_tree_add_uint(pdu_tree, hf_ldp_pdu_len, tvb, offset+2, 2, length);
3144
555
    }
3145
3146
556
    length += 4;        /* add the version and type sizes */
3147
556
    rem = tvb_reported_length_remaining(tvb, offset);
3148
556
    if (length < rem)
3149
1
        tvb_set_reported_length(tvb, length);
3150
3151
556
    if (tree) {
3152
555
        proto_tree_add_item(pdu_tree, hf_ldp_lsr, tvb, offset+4, 4, ENC_BIG_ENDIAN);
3153
555
        proto_tree_add_item(pdu_tree, hf_ldp_ls_id, tvb, offset+8, 2, ENC_BIG_ENDIAN);
3154
555
    }
3155
556
    offset += 10;
3156
3157
871
    while ( tvb_reported_length_remaining(tvb, offset) > 0 ) {
3158
315
        co = dissect_msg(tvb, offset, pinfo, pdu_tree);
3159
315
        offset += co;
3160
315
    }
3161
556
}
3162
3163
static int
3164
dissect_ldp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
3165
74
{
3166
    /*
3167
     * Make sure the first PDU has a version number of 1;
3168
     * if not, reject this, so we don't get confused by
3169
     * packets that happen to be going to or from the
3170
     * LDP port but that aren't LDP packets.
3171
     */
3172
74
    if (tvb_captured_length(tvb) < 2) {
3173
        /*
3174
         * Not enough information to tell.
3175
         */
3176
0
        return 0;
3177
0
    }
3178
74
    if (tvb_get_ntohs(tvb, 0) != 1) {
3179
        /*
3180
         * Not version 1.
3181
         */
3182
13
        return 0;
3183
13
    }
3184
3185
61
    dissect_ldp_pdu(tvb, pinfo, tree);
3186
3187
    /*
3188
     * XXX - return minimum of this and the length of the PDU?
3189
     */
3190
61
    return tvb_captured_length(tvb);
3191
74
}
3192
3193
static void
3194
dissect_tlv_pw_status(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
3195
0
{
3196
0
    proto_tree *ti, *val_tree;
3197
3198
0
    if(rem != 4){
3199
0
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_tlv_fec_len, tvb, offset, rem,
3200
0
                            "Error processing PW Status TLV: length is %d, should be 4",
3201
0
                            rem);
3202
0
        return;
3203
0
    }
3204
3205
0
    ti = proto_tree_add_item(tree, hf_ldp_tlv_pw_status_data, tvb, offset, rem, ENC_BIG_ENDIAN);
3206
3207
0
    val_tree=proto_item_add_subtree(ti, ett_ldp_tlv_val);
3208
    /* Display the bits 0-4 if they are set or not set */
3209
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_pw_not_forwarding, tvb, offset, 4, ENC_BIG_ENDIAN);
3210
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_pw_lac_ingress_recv_fault, tvb, offset, 4, ENC_BIG_ENDIAN);
3211
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_pw_lac_egress_recv_fault, tvb, offset, 4, ENC_BIG_ENDIAN);
3212
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_pw_psn_pw_ingress_recv_fault, tvb, offset, 4, ENC_BIG_ENDIAN);
3213
0
    proto_tree_add_item(val_tree, hf_ldp_tlv_pw_psn_pw_egress_recv_fault, tvb, offset, 4, ENC_BIG_ENDIAN);
3214
0
}
3215
3216
static void
3217
dissect_tlv_pw_grouping(tvbuff_t *tvb, unsigned offset, proto_tree *tree, int rem _U_)
3218
0
{
3219
0
    proto_tree_add_item(tree,hf_ldp_tlv_pw_grouping_value,tvb,offset,4,ENC_BIG_ENDIAN);
3220
0
}
3221
3222
static void
3223
dissect_subtlv_interface_parameters(tvbuff_t *tvb, unsigned offset, proto_tree *tree, int rem, int *interface_parameters_hf[])
3224
0
{
3225
#if 0
3226
    static int interface_parameters_hf[] = {
3227
         0 - hf_ldp_tlv_fec_vc_intparam_length ,
3228
         1 - hf_ldp_tlv_fec_vc_intparam_mtu ,
3229
         2 - hf_ldp_tlv_fec_vc_intparam_tdmbps ,
3230
         3 - hf_ldp_tlv_fec_vc_intparam_id ,
3231
         4 - hf_ldp_tlv_fec_vc_intparam_maxcatmcells ,
3232
         5 - hf_ldp_tlv_fec_vc_intparam_desc ,
3233
         6 - hf_ldp_tlv_fec_vc_intparam_cepbytes ,
3234
         7 - hf_ldp_tlv_fec_vc_intparam_cepopt_ais ,
3235
         8 - hf_ldp_tlv_fec_vc_intparam_cepopt_une ,
3236
         9 - hf_ldp_tlv_fec_vc_intparam_cepopt_rtp ,
3237
        10 - hf_ldp_tlv_fec_vc_intparam_cepopt_ebm ,
3238
        11 - hf_ldp_tlv_fec_vc_intparam_cepopt_mah ,
3239
        12 - hf_ldp_tlv_fec_vc_intparam_cepopt_res ,
3240
        13 - hf_ldp_tlv_fec_vc_intparam_cepopt_ceptype ,
3241
        14 - hf_ldp_tlv_fec_vc_intparam_cepopt_t3 ,
3242
        15 - hf_ldp_tlv_fec_vc_intparam_cepopt_e3 ,
3243
        16 - hf_ldp_tlv_fec_vc_intparam_vlanid ,
3244
        17 - hf_ldp_tlv_fec_vc_intparam_dlcilen ,
3245
        18 - hf_ldp_tlv_fec_vc_intparam_fcslen ,
3246
        19 - hf_ldp_tlv_fec_vc_intparam_tdmopt_r ,
3247
        20 - hf_ldp_tlv_fec_vc_intparam_tdmopt_d ,
3248
        21 - hf_ldp_tlv_fec_vc_intparam_tdmopt_f ,
3249
        22 - hf_ldp_tlv_fec_vc_intparam_tdmopt_res1 ,
3250
        23 - hf_ldp_tlv_fec_vc_intparam_tdmopt_pt ,
3251
        24 - hf_ldp_tlv_fec_vc_intparam_tdmopt_res2 ,
3252
        25 - hf_ldp_tlv_fec_vc_intparam_tdmopt_freq ,
3253
        26 - hf_ldp_tlv_fec_vc_intparam_tdmopt_ssrc ,
3254
        27 - hf_ldp_tlv_fec_vc_intparam_vccv_cctype_cw ,
3255
        28 - hf_ldp_tlv_fec_vc_intparam_vccv_cctype_mplsra ,
3256
        29 - hf_ldp_tlv_fec_vc_intparam_vccv_cctype_ttl1 ,
3257
        30 - hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_icmpping ,
3258
        31 - hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_lspping ,
3259
        32 - hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd1,
3260
        33 - hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd2,
3261
        34 - hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd3,
3262
        35 - hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd4,
3263
        36 - hf_ldp_tlv_fec_vc_intparam_flowlabel_t,
3264
        37 - hf_ldp_tlv_fec_vc_intparam_flowlabel_r,
3265
        38 - hf_ldp_tlv_fec_vc_intparam_flowlabel_res
3266
    };
3267
#endif
3268
0
    proto_tree *ti;
3269
0
    proto_tree *cepopt_tree=NULL, *vccvtype_tree=NULL;
3270
0
    proto_tree *vcintparam_tree = proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_fec_vc_interfaceparam, &ti, "Interface Parameter");
3271
3272
0
    uint8_t intparam_len = rem;
3273
0
    proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[3],tvb,offset,1,ENC_BIG_ENDIAN);
3274
0
    proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[0],tvb, offset+1, 1, ENC_BIG_ENDIAN);
3275
3276
0
    switch (tvb_get_uint8(tvb, offset)) {
3277
0
    case FEC_VC_INTERFACEPARAM_MTU:
3278
0
        proto_item_append_text(ti,": MTU %u", tvb_get_ntohs(tvb,offset+2));
3279
0
        proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[1],tvb, offset+2, 2, ENC_BIG_ENDIAN);
3280
0
        break;
3281
0
    case FEC_VC_INTERFACEPARAM_TDMBPS:
3282
        /* RFC 4842 RFC 5287 */
3283
0
        proto_item_append_text(ti,": BPS %u", tvb_get_ntohl(tvb,offset+2));
3284
0
        proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[2],tvb, offset+2, 4, ENC_BIG_ENDIAN);
3285
0
        break;
3286
0
    case FEC_VC_INTERFACEPARAM_MAXCATMCELLS:
3287
0
        proto_item_append_text(ti,": Max ATM Concat Cells %u", tvb_get_ntohs(tvb,offset+2));
3288
0
        proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[4],tvb, offset+2, 2, ENC_BIG_ENDIAN);
3289
0
        break;
3290
0
    case FEC_VC_INTERFACEPARAM_DESCRIPTION:
3291
0
        proto_item_append_text(ti,": Description");
3292
0
        proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[5],tvb, offset+2, (intparam_len -2), ENC_ASCII|ENC_NA);
3293
0
        break;
3294
0
    case FEC_VC_INTERFACEPARAM_CEPBYTES:
3295
0
        proto_item_append_text(ti,": CEP/TDM Payload Bytes %u", tvb_get_ntohs(tvb,offset+2));
3296
0
        proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[6],tvb, offset+2, 2, ENC_BIG_ENDIAN);
3297
0
        break;
3298
0
    case FEC_VC_INTERFACEPARAM_CEPOPTIONS:
3299
        /* RFC 4842 */
3300
0
        proto_item_append_text(ti,": CEP Options");
3301
0
        cepopt_tree = proto_tree_add_subtree(vcintparam_tree, tvb, offset + 2, 2, ett_ldp_fec_vc_interfaceparam_cepopt, NULL, "CEP Options");
3302
0
        proto_tree_add_item(cepopt_tree, *interface_parameters_hf[7], tvb, offset + 2, 2, ENC_BIG_ENDIAN);
3303
0
        proto_tree_add_item(cepopt_tree, *interface_parameters_hf[8], tvb, offset + 2, 2, ENC_BIG_ENDIAN);
3304
0
        proto_tree_add_item(cepopt_tree, *interface_parameters_hf[9], tvb, offset + 2, 2, ENC_BIG_ENDIAN);
3305
0
        proto_tree_add_item(cepopt_tree, *interface_parameters_hf[10], tvb, offset + 2, 2, ENC_BIG_ENDIAN);
3306
0
        proto_tree_add_item(cepopt_tree, *interface_parameters_hf[11], tvb, offset + 2, 2, ENC_BIG_ENDIAN);
3307
0
        proto_tree_add_item(cepopt_tree, *interface_parameters_hf[12], tvb, offset + 2, 2, ENC_BIG_ENDIAN);
3308
0
        proto_tree_add_item(cepopt_tree, *interface_parameters_hf[13], tvb, offset + 2, 2, ENC_BIG_ENDIAN);
3309
0
        proto_tree_add_item(cepopt_tree, *interface_parameters_hf[14], tvb, offset + 2, 2, ENC_BIG_ENDIAN);
3310
0
        proto_tree_add_item(cepopt_tree, *interface_parameters_hf[15], tvb, offset + 2, 2, ENC_BIG_ENDIAN);
3311
0
        break;
3312
0
    case FEC_VC_INTERFACEPARAM_VLANID:
3313
0
        proto_item_append_text(ti,": VLAN Id %u", tvb_get_ntohs(tvb,offset+2));
3314
0
        proto_tree_add_item(vcintparam_tree, *interface_parameters_hf[16], tvb, offset+2, 2, ENC_BIG_ENDIAN);
3315
0
        break;
3316
0
    case FEC_VC_INTERFACEPARAM_FRDLCILEN:
3317
0
        proto_item_append_text(ti,": DLCI Length %u", tvb_get_ntohs(tvb,offset+2));
3318
0
        proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[17], tvb, offset+2, 2, ENC_BIG_ENDIAN);
3319
0
        break;
3320
0
    case FEC_VC_INTERFACEPARAM_FRAGIND:
3321
        /* RFC 4623 */
3322
0
        proto_item_append_text(ti,": Fragmentation");
3323
0
        break;
3324
0
    case FEC_VC_INTERFACEPARAM_FCSRETENT:
3325
        /* RFC 4446 RFC 4720 */
3326
0
        proto_item_append_text(ti,": FCS retention, FCS Length %u Bytes", tvb_get_ntohs(tvb,offset+2));
3327
0
        proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[18], tvb, offset+2, 2, ENC_BIG_ENDIAN);
3328
0
        break;
3329
0
    case FEC_VC_INTERFACEPARAM_TDMOPTION:
3330
        /* RFC 5287 */
3331
0
        proto_item_append_text(ti,": TDM Options");
3332
0
        proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[19], tvb, offset+2, 2, ENC_BIG_ENDIAN);
3333
0
        proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[20], tvb, offset+2, 2, ENC_BIG_ENDIAN);
3334
0
        proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[21], tvb, offset+2, 2, ENC_BIG_ENDIAN);
3335
0
        proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[22], tvb, offset+2, 2, ENC_BIG_ENDIAN);
3336
0
        if (intparam_len >= 8){
3337
0
            proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[23], tvb, offset+4, 1, ENC_BIG_ENDIAN);
3338
0
            proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[24], tvb, offset+5, 1, ENC_BIG_ENDIAN);
3339
0
            proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[25], tvb, offset+6, 2, ENC_BIG_ENDIAN);
3340
0
        }
3341
0
        if (intparam_len >= 12){
3342
0
            proto_tree_add_item(vcintparam_tree,*interface_parameters_hf[26], tvb, offset+8, 4, ENC_BIG_ENDIAN);
3343
0
        }
3344
0
        break;
3345
0
    case FEC_VC_INTERFACEPARAM_VCCV:
3346
        /* RFC 4446 RFC 5085 */
3347
0
        proto_item_append_text(ti,": VCCV");
3348
0
        vccvtype_tree = proto_tree_add_subtree(vcintparam_tree, tvb, offset + 2, 1, ett_ldp_fec_vc_interfaceparam_vccvtype, NULL, "CC Type");
3349
0
        proto_tree_add_item(vccvtype_tree, *interface_parameters_hf[27], tvb, offset+2, 1, ENC_BIG_ENDIAN);
3350
0
        proto_tree_add_item(vccvtype_tree, *interface_parameters_hf[28], tvb, offset+2, 1, ENC_BIG_ENDIAN);
3351
0
        proto_tree_add_item(vccvtype_tree, *interface_parameters_hf[29], tvb, offset+2, 1, ENC_BIG_ENDIAN);
3352
0
        vccvtype_tree = proto_tree_add_subtree(vcintparam_tree, tvb, offset + 3, 1, ett_ldp_fec_vc_interfaceparam_vccvtype, NULL, "CV Type");
3353
0
        proto_tree_add_item(vccvtype_tree, *interface_parameters_hf[30], tvb, offset+3, 1, ENC_BIG_ENDIAN);
3354
0
        proto_tree_add_item(vccvtype_tree, *interface_parameters_hf[31], tvb, offset+3, 1, ENC_BIG_ENDIAN);
3355
0
        proto_tree_add_item(vccvtype_tree, *interface_parameters_hf[32], tvb, offset+3, 1, ENC_BIG_ENDIAN);
3356
0
        break;
3357
0
    case FEC_VC_INTERFACEPARAM_FLOWLABEL:
3358
0
        proto_item_append_text(ti,": Flow Label for Pseudowire");
3359
0
        proto_tree_add_item(vcintparam_tree, *interface_parameters_hf[36], tvb, offset+2, 1, ENC_BIG_ENDIAN);
3360
0
        proto_tree_add_item(vcintparam_tree, *interface_parameters_hf[37], tvb, offset+2, 1, ENC_BIG_ENDIAN);
3361
0
        proto_tree_add_item(vcintparam_tree, *interface_parameters_hf[38], tvb, offset+2, 2, ENC_BIG_ENDIAN);
3362
0
        break;
3363
0
    default: /* unknown */
3364
0
        proto_item_append_text(ti," unknown");
3365
0
        proto_tree_add_item(vcintparam_tree, hf_ldp_unknown_data, tvb, offset+2, (intparam_len -2), ENC_NA);
3366
3367
0
        break;
3368
0
    }
3369
0
}
3370
3371
static void
3372
dissect_genpwid_fec_aai_type2_parameter(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree, int rem)
3373
0
{
3374
0
    proto_tree *aai_param_tree = proto_tree_add_subtree(tree, tvb, offset, rem, ett_ldp_gen_aai_type2, NULL, "AAI");
3375
    /* check if the remaining length is 12 bytes or not... */
3376
0
    if ( rem != 12)
3377
0
    {
3378
0
        proto_tree_add_expert_format(tree, pinfo, &ei_ldp_inv_length, tvb, offset, rem,
3379
0
                            "Error processing AAI Parameter: length is %d, should be 12 bytes for Type 2.",
3380
0
                            rem);
3381
0
        return;
3382
3383
0
    }
3384
3385
0
    proto_tree_add_item(aai_param_tree,hf_ldp_tlv_fec_gen_aai_globalid,tvb,offset,4,ENC_BIG_ENDIAN);
3386
0
    proto_tree_add_item(aai_param_tree,hf_ldp_tlv_fec_gen_aai_prefix,tvb, offset+4, 4, ENC_BIG_ENDIAN);
3387
0
    proto_tree_add_item(aai_param_tree,hf_ldp_tlv_fec_gen_aai_ac_id,tvb, offset+4, 4, ENC_BIG_ENDIAN);
3388
0
}
3389
3390
static int
3391
dissect_ldp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
3392
116
{
3393
116
    volatile bool       first = true;
3394
116
    volatile int        offset = 0;
3395
116
    int                 length_remaining;
3396
116
    uint16_t            plen;
3397
116
    int                 length;
3398
116
    tvbuff_t *volatile  next_tvb;
3399
615
    while (tvb_reported_length_remaining(tvb, offset) != 0) {
3400
512
        length_remaining = tvb_captured_length_remaining(tvb, offset);
3401
3402
        /*
3403
         * Make sure the first PDU has a version number of 1;
3404
         * if not, reject this, so we don't get confused by
3405
         * packets that happen to be going to or from the
3406
         * LDP port but that aren't LDP packets.
3407
         *
3408
         * XXX - this means we can't handle an LDP PDU of which
3409
         * only one byte appears in a TCP segment.  If that's
3410
         * a problem, we'll either have to completely punt on
3411
         * rejecting non-LDP packets, or will have to assume
3412
         * that if we have only one byte, it's an LDP packet.
3413
         */
3414
512
        if (first) {
3415
116
            if (length_remaining < 2) {
3416
                /*
3417
                 * Not enough information to tell.
3418
                 */
3419
2
                return 0;
3420
2
            }
3421
114
            if (tvb_get_ntohs(tvb, offset) != 1) {
3422
                /*
3423
                 * Not version 1.
3424
                 */
3425
11
                return 0;
3426
11
            }
3427
103
            first = false;
3428
103
        }
3429
3430
        /*
3431
         * Can we do reassembly?
3432
         */
3433
499
        if (ldp_desegment && pinfo->can_desegment) {
3434
            /*
3435
             * Yes - is the LDP header split across segment
3436
             * boundaries?
3437
             */
3438
0
            if (length_remaining < 4) {
3439
                /*
3440
                 * Yes.  Tell the TCP dissector where the data for this message
3441
                 * starts in the data it handed us and that we need "some more
3442
                 * data."  Don't tell it exactly how many bytes we need because
3443
                 * if/when we ask for even more (after the header) that will
3444
                 * break reassembly.
3445
                 */
3446
0
                pinfo->desegment_offset = offset;
3447
0
                pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT;
3448
0
                return -((int32_t) pinfo->desegment_len);
3449
0
            }
3450
0
        }
3451
3452
        /*
3453
         * Get the length of the rest of the LDP packet.
3454
         * XXX - check for a version of 1 first?
3455
         */
3456
499
        plen = tvb_get_ntohs(tvb, offset + 2);
3457
3458
        /*
3459
         * Can we do reassembly?
3460
         */
3461
499
        if (ldp_desegment && pinfo->can_desegment) {
3462
            /*
3463
             * Yes - is the LDP packet split across segment
3464
             * boundaries?
3465
             */
3466
0
            if (length_remaining < plen + 4) {
3467
                /*
3468
                 * Yes.  Tell the TCP dissector where the
3469
                 * data for this message starts in the data
3470
                 * it handed us, and how many more bytes we
3471
                 * need, and return.
3472
                 */
3473
0
                pinfo->desegment_offset = offset;
3474
0
                pinfo->desegment_len = (plen + 4) - length_remaining;
3475
0
                return -((int32_t) pinfo->desegment_len);
3476
0
            }
3477
0
        }
3478
3479
        /*
3480
         * Construct a tvbuff containing the amount of the payload
3481
         * we have available.  Make its reported length the
3482
         * amount of data in the DNS-over-TCP packet.
3483
         *
3484
         * XXX - if reassembly isn't enabled. the subdissector
3485
         * will throw a BoundsError exception, rather than a
3486
         * ReportedBoundsError exception.  We really want
3487
         * a tvbuff where the length is "length", the reported
3488
         * length is "plen + 4", and the "if the snapshot length
3489
         * were infinite" length is the minimum of the
3490
         * reported length of the tvbuff handed to us and "plen+4",
3491
         * with a new type of exception thrown if the offset is
3492
         * within the reported length but beyond that third length,
3493
         * with that exception getting the "Unreassembled Packet"
3494
         * error.
3495
         */
3496
499
        length = length_remaining;
3497
499
        if (length > plen + 4)
3498
396
            length = plen + 4;
3499
499
        next_tvb = tvb_new_subset_length_caplen(tvb, offset, length, plen + 4);
3500
3501
        /*
3502
         * Dissect the LDP packet.
3503
         *
3504
         * If it gets an error that means there's no point in
3505
         * dissecting any more PDUs, rethrow the exception in
3506
         * question.
3507
         *
3508
         * If it gets any other error, report it and continue, as that
3509
         * means that PDU got an error, but that doesn't mean we should
3510
         * stop dissecting PDUs within this frame or chunk of reassembled
3511
         * data.
3512
         */
3513
499
        TRY {
3514
495
            dissect_ldp_pdu(next_tvb, pinfo, tree);
3515
495
        }
3516
499
        CATCH_NONFATAL_ERRORS {
3517
387
            show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE);
3518
387
        }
3519
499
        ENDTRY;
3520
3521
        /*
3522
         * Skip the LDP header and the payload.
3523
         */
3524
499
        offset += plen + 4;
3525
499
    }
3526
103
    return tvb_captured_length(tvb);
3527
116
}
3528
3529
/* Register all the bits needed with the filtering engine */
3530
3531
void
3532
proto_register_ldp(void)
3533
14
{
3534
14
    static hf_register_info hf[] = {
3535
#if 0
3536
        { &hf_ldp_req,
3537
          /* Change the following to the type you need */
3538
          { "Request", "ldp.req", FT_BOOLEAN, BASE_NONE,
3539
            NULL, 0x0, NULL, HFILL }},
3540
#endif
3541
3542
#if 0
3543
        { &hf_ldp_rsp,
3544
          { "Response", "ldp.rsp", FT_BOOLEAN, BASE_NONE,
3545
            NULL, 0x0, NULL, HFILL }},
3546
#endif
3547
3548
14
        { &hf_ldp_version,
3549
14
          { "Version", "ldp.hdr.version", FT_UINT16, BASE_DEC,
3550
14
            NULL, 0x0, "LDP Version Number", HFILL }},
3551
3552
14
        { &hf_ldp_pdu_len,
3553
14
          { "PDU Length", "ldp.hdr.pdu_len", FT_UINT16, BASE_DEC,
3554
14
            NULL, 0x0, "LDP PDU Length", HFILL }},
3555
3556
14
        { &hf_ldp_lsr,
3557
14
          { "LSR ID", "ldp.hdr.ldpid.lsr", FT_IPv4, BASE_NONE,
3558
14
            NULL, 0x0, "LDP Label Space Router ID", HFILL }},
3559
3560
14
        { &hf_ldp_ls_id,
3561
14
          { "Label Space ID", "ldp.hdr.ldpid.lsid", FT_UINT16, BASE_DEC,
3562
14
            NULL, 0, "LDP Label Space ID", HFILL }},
3563
3564
14
        { &hf_ldp_msg_ubit,
3565
14
          { "U bit", "ldp.msg.ubit", FT_BOOLEAN, 8,
3566
14
            TFS(&ldp_message_ubit), 0x80, "Unknown Message Bit", HFILL }},
3567
3568
14
        { &hf_ldp_msg_type,
3569
14
          { "Message Type", "ldp.msg.type", FT_UINT16, BASE_HEX,
3570
14
            VALS(ldp_message_types), 0x7FFF, "LDP message type", HFILL }},
3571
3572
14
        { &hf_ldp_msg_len,
3573
14
          { "Message Length", "ldp.msg.len", FT_UINT16, BASE_DEC,
3574
14
            NULL, 0x0, "LDP Message Length (excluding message type and len)", HFILL }},
3575
3576
14
        { &hf_ldp_msg_id,
3577
14
          { "Message ID", "ldp.msg.id", FT_UINT32, BASE_HEX,
3578
14
            NULL, 0x0, "LDP Message ID", HFILL }},
3579
3580
14
        { &hf_ldp_msg_vendor_id,
3581
14
          { "Vendor ID", "ldp.msg.vendor.id", FT_UINT32, BASE_HEX,
3582
14
            NULL, 0x0, "LDP Vendor-private Message ID", HFILL }},
3583
3584
14
        { &hf_ldp_msg_experiment_id,
3585
14
          { "Experiment ID", "ldp.msg.experiment.id", FT_UINT32, BASE_HEX,
3586
14
            NULL, 0x0, "LDP Experimental Message ID", HFILL }},
3587
3588
14
        { &hf_ldp_tlv_unknown,
3589
14
          { "TLV Unknown bits", "ldp.msg.tlv.unknown", FT_UINT8, BASE_HEX,
3590
14
            VALS(tlv_unknown_vals), 0xC0, "TLV Unknown bits Field", HFILL }},
3591
3592
14
        { &hf_ldp_tlv_type,
3593
14
          { "TLV Type", "ldp.msg.tlv.type", FT_UINT16, BASE_HEX,
3594
14
            VALS(tlv_type_names), 0x3FFF, "TLV Type Field", HFILL }},
3595
3596
14
        { &hf_ldp_tlv_len,
3597
14
          { "TLV Length", "ldp.msg.tlv.len", FT_UINT16, BASE_DEC,
3598
14
            NULL, 0x0, "TLV Length Field", HFILL }},
3599
3600
14
        { &hf_ldp_tlv_value,
3601
14
          { "TLV Value", "ldp.msg.tlv.value", FT_BYTES, BASE_NONE,
3602
14
            NULL, 0x0, "TLV Value Bytes", HFILL }},
3603
3604
14
        { &hf_ldp_tlv_val_hold,
3605
14
          { "Hold Time", "ldp.msg.tlv.hello.hold", FT_UINT16, BASE_DEC,
3606
14
            NULL, 0x0, "Hello Common Parameters Hold Time", HFILL }},
3607
3608
14
        { &hf_ldp_tlv_val_target,
3609
14
          { "Targeted Hello", "ldp.msg.tlv.hello.targeted", FT_BOOLEAN, 16,
3610
14
            TFS(&hello_targeted_vals), 0x8000, "Hello Common Parameters Targeted Bit", HFILL }},
3611
3612
14
        { &hf_ldp_tlv_val_request,
3613
14
          { "Hello Requested", "ldp.msg.tlv.hello.requested", FT_BOOLEAN, 16,
3614
14
            TFS(&hello_requested_vals), 0x4000, "Hello Common Parameters Hello Requested Bit", HFILL }},
3615
3616
14
        { &hf_ldp_tlv_val_gtsm_flag,
3617
14
          { "GTSM Flag", "ldp.msg.tlv.hello.gtsm", FT_BOOLEAN, 16,
3618
14
            TFS(&tfs_set_notset), 0x2000, "Hello Common Parameters GTSM bit", HFILL }},
3619
3620
14
        { &hf_ldp_tlv_val_res,
3621
14
          { "Reserved", "ldp.msg.tlv.hello.res", FT_UINT16, BASE_HEX,
3622
14
            NULL, 0x1FFF, "Hello Common Parameters Reserved Field", HFILL }},
3623
3624
14
        { &hf_ldp_tlv_ipv4_taddr,
3625
14
          { "IPv4 Transport Address", "ldp.msg.tlv.ipv4.taddr", FT_IPv4, BASE_NONE,
3626
14
            NULL, 0x0, NULL, HFILL }},
3627
3628
14
        { &hf_ldp_tlv_config_seqno,
3629
14
          { "Configuration Sequence Number", "ldp.msg.tlv.hello.cnf_seqno", FT_UINT32, BASE_DEC,
3630
14
            NULL, 0x0, "Hello Configuration Sequence Number", HFILL }},
3631
3632
14
        { &hf_ldp_tlv_ipv6_taddr,
3633
14
          { "IPv6 Transport Address", "ldp.msg.tlv.ipv6.taddr", FT_IPv6, BASE_NONE,
3634
14
            NULL, 0x0, NULL, HFILL }},
3635
3636
14
        { &hf_ldp_tlv_fec_wc,
3637
14
          { "FEC Element Type", "ldp.msg.tlv.fec.type", FT_UINT8, BASE_DEC,
3638
14
            VALS(fec_types_vals), 0x0, "Forwarding Equivalence Class Element Types", HFILL }},
3639
3640
14
        { &hf_ldp_tlv_fec_af,
3641
14
          { "FEC Element Address Type", "ldp.msg.tlv.fec.af", FT_UINT16, BASE_DEC,
3642
14
            VALS(afn_vals), 0x0, "Forwarding Equivalence Class Element Address Family", HFILL }},
3643
3644
14
        { &hf_ldp_tlv_fec_len,
3645
14
          { "FEC Element Length", "ldp.msg.tlv.fec.len", FT_UINT8, BASE_DEC,
3646
14
            NULL, 0x0, "Forwarding Equivalence Class Element Length", HFILL }},
3647
3648
14
        { &hf_ldp_tlv_fec_pfval,
3649
14
          { "FEC Element Prefix Value", "ldp.msg.tlv.fec.pfval", FT_STRING, BASE_NONE,
3650
14
            NULL, 0x0, "Forwarding Equivalence Class Element Prefix", HFILL }},
3651
3652
14
        { &hf_ldp_tlv_fec_hoval,
3653
14
          { "FEC Element Host Address Value", "ldp.msg.tlv.fec.hoval", FT_STRING, BASE_NONE,
3654
14
            NULL, 0x0, "Forwarding Equivalence Class Element Address", HFILL }},
3655
3656
14
        { &hf_ldp_tlv_addrl_addr_family,
3657
14
          { "Address Family", "ldp.msg.tlv.addrl.addr_family", FT_UINT16, BASE_DEC,
3658
14
            VALS(afn_vals), 0x0, "Address Family List", HFILL }},
3659
3660
14
        { &hf_ldp_tlv_addrl_addr,
3661
14
          { "Address", "ldp.msg.tlv.addrl.addr", FT_STRING, BASE_NONE,
3662
14
            NULL, 0x0, NULL, HFILL }},
3663
3664
14
        { &hf_ldp_tlv_hc_value,
3665
14
          { "Hop Count Value", "ldp.msg.tlv.hc.value", FT_UINT8, BASE_DEC,
3666
14
            NULL, 0x0, NULL, HFILL }},
3667
3668
14
        { &hf_ldp_tlv_pv_lsrid,
3669
14
          { "LSR Id", "ldp.msg.tlv.pv.lsrid", FT_IPv4, BASE_NONE,
3670
14
            NULL, 0x0, "Path Vector LSR Id", HFILL }},
3671
3672
14
        { &hf_ldp_tlv_sess_ver,
3673
14
          { "Session Protocol Version", "ldp.msg.tlv.sess.ver", FT_UINT16, BASE_DEC,
3674
14
            NULL, 0x0, "Common Session Parameters Protocol Version", HFILL }},
3675
3676
14
        { &hf_ldp_tlv_sess_ka,
3677
14
          { "Session KeepAlive Time", "ldp.msg.tlv.sess.ka", FT_UINT16, BASE_DEC,
3678
14
            NULL, 0x0, "Common Session Parameters KeepAlive Time", HFILL }},
3679
3680
14
        { &hf_ldp_tlv_sess_advbit,
3681
14
          { "Session Label Advertisement Discipline", "ldp.msg.tlv.sess.advbit", FT_BOOLEAN, 8,
3682
14
            TFS(&tlv_sess_advbit_vals), 0x80, "Common Session Parameters Label Advertisement Discipline", HFILL }},
3683
3684
14
        { &hf_ldp_tlv_sess_ldetbit,
3685
14
          { "Session Loop Detection", "ldp.msg.tlv.sess.ldetbit", FT_BOOLEAN, 8,
3686
14
            TFS(&tlv_sess_ldetbit_vals), 0x40, "Common Session Parameters Loop Detection", HFILL }},
3687
3688
14
        { &hf_ldp_tlv_sess_pvlim,
3689
14
          { "Session Path Vector Limit", "ldp.msg.tlv.sess.pvlim", FT_UINT8, BASE_DEC,
3690
14
            NULL, 0x0, "Common Session Parameters Path Vector Limit", HFILL }},
3691
3692
14
        { &hf_ldp_tlv_sess_mxpdu,
3693
14
          { "Session Max PDU Length", "ldp.msg.tlv.sess.mxpdu", FT_UINT16, BASE_DEC,
3694
14
            NULL, 0x0, "Common Session Parameters Max PDU Length", HFILL }},
3695
3696
14
        { &hf_ldp_tlv_sess_rxlsr,
3697
14
          { "Session Receiver LSR Identifier", "ldp.msg.tlv.sess.rxlsr", FT_IPv4, BASE_NONE,
3698
14
            NULL, 0x0, "Common Session Parameters LSR Identifier", HFILL }},
3699
3700
14
        { &hf_ldp_tlv_sess_rxls,
3701
14
          { "Session Receiver Label Space Identifier", "ldp.msg.tlv.sess.rxls", FT_UINT16, BASE_DEC,
3702
14
            NULL, 0x0, "Common Session Parameters Receiver Label Space Identifier", HFILL }},
3703
3704
14
        { &hf_ldp_tlv_sess_atm_merge,
3705
14
          { "Session ATM Merge Parameter", "ldp.msg.tlv.sess.atm.merge", FT_UINT8, BASE_DEC,
3706
14
            VALS(tlv_atm_merge_vals), 0xC0, "Merge ATM Session Parameters", HFILL }},
3707
3708
14
        { &hf_ldp_tlv_sess_atm_lr,
3709
14
          { "Number of ATM Label Ranges", "ldp.msg.tlv.sess.atm.lr", FT_UINT8, BASE_DEC,
3710
14
            NULL, 0x3C, NULL, HFILL }},
3711
3712
14
        { &hf_ldp_tlv_sess_atm_dir,
3713
14
          { "Directionality", "ldp.msg.tlv.sess.atm.dir", FT_BOOLEAN, 8,
3714
14
            TFS(&tlv_atm_dirbit), 0x02, "Label Directionality", HFILL }},
3715
3716
14
        { &hf_ldp_tlv_sess_atm_minvpi,
3717
14
          { "Minimum VPI", "ldp.msg.tlv.sess.atm.minvpi", FT_UINT16, BASE_DEC,
3718
14
            NULL, 0x0FFF, NULL, HFILL }},
3719
3720
14
        { &hf_ldp_tlv_sess_atm_minvci,
3721
14
          { "Minimum VCI", "ldp.msg.tlv.sess.atm.minvci", FT_UINT16, BASE_DEC,
3722
14
            NULL, 0x0, NULL, HFILL }},
3723
3724
14
        { &hf_ldp_tlv_sess_atm_maxvpi,
3725
14
          { "Maximum VPI", "ldp.msg.tlv.sess.atm.maxvpi", FT_UINT16, BASE_DEC,
3726
14
            NULL, 0x0FFF, NULL, HFILL }},
3727
3728
14
        { &hf_ldp_tlv_sess_atm_maxvci,
3729
14
          { "Maximum VCI", "ldp.msg.tlv.sess.atm.maxvci", FT_UINT16, BASE_DEC,
3730
14
            NULL, 0x0, NULL, HFILL }},
3731
3732
14
        { &hf_ldp_tlv_sess_fr_merge,
3733
14
          { "Session Frame Relay Merge Parameter", "ldp.msg.tlv.sess.fr.merge", FT_UINT8, BASE_DEC,
3734
14
            VALS(tlv_fr_merge_vals), 0xC0, "Merge Frame Relay Session Parameters", HFILL }},
3735
3736
14
        { &hf_ldp_tlv_sess_fr_lr,
3737
14
          { "Number of Frame Relay Label Ranges", "ldp.msg.tlv.sess.fr.lr", FT_UINT8, BASE_DEC,
3738
14
            NULL, 0x3C, NULL, HFILL }},
3739
3740
14
        { &hf_ldp_tlv_sess_fr_dir,
3741
14
          { "Directionality", "ldp.msg.tlv.sess.fr.dir", FT_BOOLEAN, 8,
3742
14
            TFS(&tlv_atm_dirbit), 0x02, "Label Directionality", HFILL }},
3743
3744
14
        { &hf_ldp_tlv_sess_fr_len,
3745
14
          { "Number of DLCI bits", "ldp.msg.tlv.sess.fr.len", FT_UINT16, BASE_DEC,
3746
14
            VALS(tlv_fr_len_vals), 0x0180, NULL, HFILL }},
3747
3748
14
        { &hf_ldp_tlv_sess_fr_mindlci,
3749
14
          { "Minimum DLCI", "ldp.msg.tlv.sess.fr.mindlci", FT_UINT24, BASE_DEC,
3750
14
            NULL, 0x7FFFFF, NULL, HFILL }},
3751
3752
14
        { &hf_ldp_tlv_sess_fr_maxdlci,
3753
14
          { "Maximum DLCI", "ldp.msg.tlv.sess.fr.maxdlci", FT_UINT24, BASE_DEC,
3754
14
            NULL, 0x7FFFFF, NULL, HFILL }},
3755
3756
14
        { &hf_ldp_tlv_ft_sess_flags,
3757
14
          { "Flags", "ldp.msg.tlv.ft_sess.flags", FT_UINT16, BASE_HEX,
3758
14
            NULL, 0x0, "FT Session Flags", HFILL }},
3759
3760
14
        { &hf_ldp_tlv_ft_sess_flag_r,
3761
14
          { "R bit", "ldp.msg.tlv.ft_sess.flag_r", FT_BOOLEAN, 16,
3762
14
            TFS(&tlv_ft_r), 0x8000, "FT Reconnect Flag", HFILL }},
3763
3764
14
        { &hf_ldp_tlv_ft_sess_flag_res,
3765
14
          { "Reserved", "ldp.msg.tlv.ft_sess.flag_res", FT_UINT16, BASE_HEX,
3766
14
            NULL, 0x7FF0, "Reserved bits", HFILL }},
3767
3768
14
        { &hf_ldp_tlv_ft_sess_flag_s,
3769
14
          { "S bit", "ldp.msg.tlv.ft_sess.flag_s", FT_BOOLEAN, 16,
3770
14
            TFS(&tlv_ft_s), 0x8, "Save State Flag", HFILL }},
3771
3772
14
        { &hf_ldp_tlv_ft_sess_flag_a,
3773
14
          { "A bit", "ldp.msg.tlv.ft_sess.flag_a", FT_BOOLEAN, 16,
3774
14
            TFS(&tlv_ft_a), 0x4, "All-Label protection Required", HFILL }},
3775
3776
14
        { &hf_ldp_tlv_ft_sess_flag_c,
3777
14
          { "C bit", "ldp.msg.tlv.ft_sess.flag_c", FT_BOOLEAN, 16,
3778
14
            TFS(&tlv_ft_c), 0x2, "Check-Pointing Flag", HFILL }},
3779
3780
14
        { &hf_ldp_tlv_ft_sess_flag_l,
3781
14
          { "L bit", "ldp.msg.tlv.ft_sess.flag_l", FT_BOOLEAN, 16,
3782
14
            TFS(&tlv_ft_l), 0x1, "Learn From network Flag", HFILL }},
3783
3784
14
        { &hf_ldp_tlv_ft_sess_res,
3785
14
          { "Reserved", "ldp.msg.tlv.ft_sess.res", FT_UINT16, BASE_HEX,
3786
14
            NULL, 0x0, NULL, HFILL }},
3787
3788
14
        { &hf_ldp_tlv_ft_sess_reconn_to,
3789
14
          { "Reconnect Timeout", "ldp.msg.tlv.ft_sess.reconn_to", FT_UINT32, BASE_DEC,
3790
14
            NULL, 0x0, "FT Reconnect Timeout", HFILL }},
3791
3792
14
        { &hf_ldp_tlv_ft_sess_recovery_time,
3793
14
          { "Recovery Time", "ldp.msg.tlv.ft_sess.recovery_time", FT_UINT32, BASE_DEC,
3794
14
            NULL, 0x0, NULL, HFILL }},
3795
3796
14
        { &hf_ldp_tlv_ft_ack_sequence_num,
3797
14
          { "FT ACK Sequence Number", "ldp.msg.tlv.ft_ack.sequence_num", FT_UINT32, BASE_HEX,
3798
14
            NULL, 0x0, NULL, HFILL }},
3799
3800
14
        { &hf_ldp_tlv_lbl_req_msg_id,
3801
14
          { "Label Request Message ID", "ldp.msg.tlv.lbl_req_msg_id", FT_UINT32, BASE_HEX,
3802
14
            NULL, 0x0, "Label Request Message to be aborted", HFILL }},
3803
3804
14
        { &hf_ldp_tlv_vendor_id,
3805
14
          { "Vendor ID", "ldp.msg.tlv.vendor_id", FT_UINT32, BASE_HEX,
3806
14
            NULL, 0, "IEEE 802 Assigned Vendor ID", HFILL }},
3807
3808
14
        { &hf_ldp_tlv_experiment_id,
3809
14
          { "Experiment ID", "ldp.msg.tlv.experiment_id", FT_UINT32, BASE_HEX,
3810
14
            NULL, 0, NULL, HFILL }},
3811
3812
14
        { &hf_ldp_tlv_generic_label,
3813
14
          { "Generic Label", "ldp.msg.tlv.generic.label", FT_UINT32, BASE_DEC_HEX,
3814
14
            NULL, 0x000FFFFF, NULL, HFILL }},
3815
3816
14
        { &hf_ldp_tlv_atm_label_vbits,
3817
14
          { "V-bits", "ldp.msg.tlv.atm.label.vbits", FT_UINT8, BASE_HEX,
3818
14
            VALS(tlv_atm_vbits_vals), 0x30, "ATM Label V Bits", HFILL }},
3819
3820
14
        { &hf_ldp_tlv_atm_label_vpi,
3821
14
          { "VPI", "ldp.msg.tlv.atm.label.vpi", FT_UINT16, BASE_DEC,
3822
14
            NULL, 0x0FFF, "ATM Label VPI", HFILL }},
3823
3824
14
        { &hf_ldp_tlv_atm_label_vci,
3825
14
          { "VCI", "ldp.msg.tlv.atm.label.vci", FT_UINT16, BASE_DEC,
3826
14
            NULL, 0, "ATM Label VCI", HFILL }},
3827
3828
14
        { &hf_ldp_tlv_fr_label_len,
3829
14
          { "Number of DLCI bits", "ldp.msg.tlv.fr.label.len", FT_UINT16, BASE_DEC,
3830
14
            VALS(tlv_fr_len_vals), 0x0180, NULL, HFILL }},
3831
3832
14
        { &hf_ldp_tlv_fr_label_dlci,
3833
14
          { "DLCI", "ldp.msg.tlv.fr.label.dlci", FT_UINT24, BASE_DEC,
3834
14
            NULL, 0x7FFFFF, "FRAME RELAY Label DLCI", HFILL }},
3835
3836
14
        { &hf_ldp_tlv_ft_protect_sequence_num,
3837
14
          { "FT Sequence Number", "ldp.msg.tlv.ft_protect.sequence_num", FT_UINT32, BASE_HEX,
3838
14
            NULL, 0x0, NULL, HFILL }},
3839
3840
14
        { &hf_ldp_tlv_status_ebit,
3841
14
          { "E Bit", "ldp.msg.tlv.status.ebit", FT_BOOLEAN, 8,
3842
14
            TFS(&tlv_status_ebit), 0x80, "Fatal Error Bit", HFILL }},
3843
3844
14
        { &hf_ldp_tlv_status_fbit,
3845
14
          { "F Bit", "ldp.msg.tlv.status.fbit", FT_BOOLEAN, 8,
3846
14
            TFS(&tlv_status_fbit), 0x40, "Forward Bit", HFILL }},
3847
3848
14
        { &hf_ldp_tlv_status_data,
3849
14
          { "Status Data", "ldp.msg.tlv.status.data", FT_UINT32, BASE_HEX,
3850
14
            VALS(tlv_status_data), 0x3FFFFFFF, NULL, HFILL }},
3851
3852
14
        { &hf_ldp_tlv_status_msg_id,
3853
14
          { "Message ID", "ldp.msg.tlv.status.msg.id", FT_UINT32, BASE_HEX,
3854
14
            NULL, 0x0, "Identifies peer message to which Status TLV refers", HFILL }},
3855
3856
14
        { &hf_ldp_tlv_status_msg_type,
3857
14
          { "Message Type", "ldp.msg.tlv.status.msg.type", FT_UINT16, BASE_HEX,
3858
14
            VALS(ldp_message_types), 0x0, "Type of peer message to which Status TLV refers", HFILL }},
3859
3860
14
        { &hf_ldp_tlv_extstatus_data,
3861
14
          { "Extended Status Data", "ldp.msg.tlv.extstatus.data", FT_UINT32, BASE_HEX,
3862
14
            NULL, 0x0, NULL, HFILL }},
3863
3864
14
        { &hf_ldp_tlv_returned_version,
3865
14
          { "Returned PDU Version", "ldp.msg.tlv.returned.version", FT_UINT16, BASE_DEC,
3866
14
            NULL, 0x0, "LDP Version Number", HFILL }},
3867
3868
14
        { &hf_ldp_tlv_returned_pdu_len,
3869
14
          { "Returned PDU Length", "ldp.msg.tlv.returned.pdu_len", FT_UINT16, BASE_DEC,
3870
14
            NULL, 0x0, "LDP PDU Length", HFILL }},
3871
3872
14
        { &hf_ldp_tlv_returned_lsr,
3873
14
          { "Returned PDU LSR ID", "ldp.msg.tlv.returned.ldpid.lsr", FT_IPv4, BASE_NONE,
3874
14
            NULL, 0x0, "LDP Label Space Router ID", HFILL }},
3875
3876
14
        { &hf_ldp_tlv_returned_ls_id,
3877
14
          { "Returned PDU Label Space ID", "ldp.msg.tlv.returned.ldpid.lsid", FT_UINT16, BASE_HEX,
3878
14
            NULL, 0x0, "LDP Label Space ID", HFILL }},
3879
3880
14
        { &hf_ldp_tlv_returned_msg_ubit,
3881
14
          { "Returned Message Unknown bit", "ldp.msg.tlv.returned.msg.ubit", FT_BOOLEAN, 8,
3882
14
            TFS(&ldp_message_ubit), 0x80, NULL, HFILL }},
3883
3884
14
        { &hf_ldp_tlv_returned_msg_type,
3885
14
          { "Returned Message Type", "ldp.msg.tlv.returned.msg.type", FT_UINT16, BASE_HEX,
3886
14
            VALS(ldp_message_types), 0x7FFF, "LDP message type", HFILL }},
3887
3888
14
        { &hf_ldp_tlv_returned_msg_len,
3889
14
          { "Returned Message Length", "ldp.msg.tlv.returned.msg.len", FT_UINT16, BASE_DEC,
3890
14
            NULL, 0x0, "LDP Message Length (excluding message type and len)", HFILL }},
3891
3892
14
        { &hf_ldp_tlv_returned_msg_id,
3893
14
          { "Returned Message ID", "ldp.msg.tlv.returned.msg.id", FT_UINT32, BASE_HEX,
3894
14
            NULL, 0x0, "LDP Message ID", HFILL }},
3895
3896
14
        { &hf_ldp_tlv_mac,
3897
14
          { "MAC address", "ldp.msg.tlv.mac", FT_ETHER, BASE_NONE,
3898
14
            NULL, 0x0, NULL, HFILL}},
3899
3900
14
        { &hf_ldp_tlv_fec_vc_controlword,
3901
14
          { "C-bit", "ldp.msg.tlv.fec.vc.controlword", FT_BOOLEAN, 8,
3902
14
            TFS(&fec_vc_cbit), 0x80, "Control Word Present", HFILL }},
3903
3904
14
        { &hf_ldp_tlv_fec_vc_vctype,
3905
14
          { "VC Type", "ldp.msg.tlv.fec.vc.vctype", FT_UINT16, BASE_HEX,
3906
14
            VALS(fec_vc_types_vals), 0x7FFF, "Virtual Circuit Type", HFILL }},
3907
3908
14
        { &hf_ldp_tlv_fec_vc_infolength,
3909
14
          { "VC Info Length", "ldp.msg.tlv.fec.vc.infolength", FT_UINT8, BASE_DEC,
3910
14
            NULL, 0x0, "VC FEC Info Length", HFILL }},
3911
3912
14
        { &hf_ldp_tlv_fec_vc_groupid,
3913
14
          { "Group ID", "ldp.msg.tlv.fec.vc.groupid", FT_UINT32, BASE_DEC,
3914
14
            NULL, 0x0, "VC FEC Group ID", HFILL }},
3915
3916
14
        { &hf_ldp_tlv_fec_vc_vcid,
3917
14
          { "VC ID", "ldp.msg.tlv.fec.vc.vcid", FT_UINT32, BASE_DEC,
3918
14
            NULL, 0x0, "VC FEC VCID", HFILL }},
3919
3920
14
        { &hf_ldp_tlv_fec_vc_intparam_length,
3921
14
          { "Length", "ldp.msg.tlv.fec.vc.intparam.length", FT_UINT8, BASE_DEC,
3922
14
            NULL, 0x0, "VC FEC Interface Parameter Length", HFILL }},
3923
3924
14
        { &hf_ldp_tlv_fec_vc_intparam_mtu,
3925
14
          { "MTU", "ldp.msg.tlv.fec.vc.intparam.mtu", FT_UINT16, BASE_DEC,
3926
14
            NULL, 0x0, "VC FEC Interface Parameter MTU", HFILL }},
3927
3928
14
        { &hf_ldp_tlv_fec_vc_intparam_tdmbps,
3929
14
          { "BPS", "ldp.msg.tlv.fec.vc.intparam.tdmbps", FT_UINT32, BASE_DEC,
3930
14
            NULL, 0x0, "VC FEC Interface Parameter CEP/TDM bit-rate", HFILL }},
3931
3932
14
        { &hf_ldp_tlv_fec_vc_intparam_id,
3933
14
          { "ID", "ldp.msg.tlv.fec.vc.intparam.id", FT_UINT8, BASE_HEX,
3934
14
            VALS(fec_vc_interfaceparm), 0x0, "VC FEC Interface Parameter ID", HFILL }},
3935
3936
14
        { &hf_ldp_tlv_fec_vc_intparam_maxcatmcells,
3937
14
          { "Number of Cells", "ldp.msg.tlv.fec.vc.intparam.maxatm", FT_UINT16, BASE_DEC,
3938
14
            NULL, 0x0, "VC FEC Interface Param Max ATM Concat Cells", HFILL }},
3939
3940
14
        { &hf_ldp_tlv_fec_vc_intparam_desc,
3941
14
          { "Description", "ldp.msg.tlv.fec.vc.intparam.desc", FT_STRING, BASE_NONE,
3942
14
            NULL, 0, "VC FEC Interface Description", HFILL }},
3943
3944
14
        { &hf_ldp_tlv_fec_vc_intparam_cepbytes,
3945
14
          { "Payload Bytes", "ldp.msg.tlv.fec.vc.intparam.cepbytes", FT_UINT16, BASE_DEC,
3946
14
            NULL, 0x0, "VC FEC Interface Param CEP/TDM Payload Bytes", HFILL }},
3947
3948
14
        { &hf_ldp_tlv_fec_vc_intparam_cepopt_ais,
3949
14
          { "AIS", "ldp.msg.tlv.fec.vc.intparam.cepopt_ais", FT_BOOLEAN, 16,
3950
14
            NULL, 0x8000, "VC FEC Interface Param CEP Option AIS", HFILL }},
3951
3952
14
        { &hf_ldp_tlv_fec_vc_intparam_cepopt_une,
3953
14
          { "UNE", "ldp.msg.tlv.fec.vc.intparam.cepopt_une", FT_BOOLEAN, 16,
3954
14
            NULL, 0x4000, "VC FEC Interface Param CEP Option Unequipped", HFILL }},
3955
3956
14
        { &hf_ldp_tlv_fec_vc_intparam_cepopt_rtp,
3957
14
          { "RTP", "ldp.msg.tlv.fec.vc.intparam.cepopt_rtp", FT_BOOLEAN, 16,
3958
14
            NULL, 0x2000, "VC FEC Interface Param CEP Option RTP Header", HFILL }},
3959
3960
14
        { &hf_ldp_tlv_fec_vc_intparam_cepopt_ebm,
3961
14
          { "EBM", "ldp.msg.tlv.fec.vc.intparam.cepopt_ebm", FT_BOOLEAN, 16,
3962
14
            NULL, 0x1000, "VC FEC Interface Param CEP Option EBM Header", HFILL }},
3963
3964
14
        { &hf_ldp_tlv_fec_vc_intparam_cepopt_mah,
3965
14
          { "MAH", "ldp.msg.tlv.fec.vc.intparam.cepopt_mah", FT_BOOLEAN, 16,
3966
14
            NULL, 0x0800, "VC FEC Interface Param CEP Option MPLS Adaptation header", HFILL }},
3967
3968
14
        { &hf_ldp_tlv_fec_vc_intparam_cepopt_res,
3969
14
          { "Reserved", "ldp.msg.tlv.fec.vc.intparam.cepopt_res", FT_UINT16, BASE_HEX,
3970
14
            NULL , 0x07E0, "VC FEC Interface Param CEP Option Reserved", HFILL }},
3971
3972
14
        { &hf_ldp_tlv_fec_vc_intparam_cepopt_ceptype,
3973
14
          { "CEP Type", "ldp.msg.tlv.fec.vc.intparam.cepopt_ceptype", FT_UINT16, BASE_HEX,
3974
14
            VALS(fec_vc_ceptype_vals), 0x001C, "VC FEC Interface Param CEP Option CEP Type", HFILL }},
3975
3976
14
        { &hf_ldp_tlv_fec_vc_intparam_cepopt_t3,
3977
14
          { "Async T3", "ldp.msg.tlv.fec.vc.intparam.cepopt_t3", FT_BOOLEAN, 16,
3978
14
            NULL, 0x0002, "VC FEC Interface Param CEP Option Async T3", HFILL }},
3979
3980
14
        { &hf_ldp_tlv_fec_vc_intparam_cepopt_e3,
3981
14
          { "Async E3", "ldp.msg.tlv.fec.vc.intparam.cepopt_e3", FT_BOOLEAN, 16,
3982
14
            NULL, 0x0001, "VC FEC Interface Param CEP Option Async E3", HFILL }},
3983
3984
14
        { &hf_ldp_tlv_fec_vc_intparam_vlanid,
3985
14
          { "VLAN Id", "ldp.msg.tlv.fec.vc.intparam.vlanid", FT_UINT16, BASE_DEC,
3986
14
            NULL, 0x0, "VC FEC Interface Param VLAN Id", HFILL }},
3987
3988
14
        { &hf_ldp_tlv_fec_vc_intparam_dlcilen,
3989
14
          { "DLCI Length", "ldp.msg.tlv.fec.vc.intparam.dlcilen", FT_UINT16, BASE_DEC,
3990
14
            NULL, 0x0, "VC FEC Interface Parameter Frame-Relay DLCI Length", HFILL }},
3991
3992
14
        { &hf_ldp_tlv_fec_vc_intparam_fcslen,
3993
14
          { "FCS Length", "ldp.msg.tlv.fec.vc.intparam.fcslen", FT_UINT16, BASE_DEC,
3994
14
            NULL, 0x0, "VC FEC Interface Parameter FCS Length", HFILL }},
3995
3996
14
        { &hf_ldp_tlv_fec_vc_intparam_tdmopt_r,
3997
14
          { "R Bit", "ldp.msg.tlv.fec.vc.intparam.tdmopt_r", FT_BOOLEAN, 16,
3998
14
            TFS(&fec_vc_tdmopt_r), 0x8000, "VC FEC Interface Param TDM Options RTP Header", HFILL }},
3999
4000
14
        { &hf_ldp_tlv_fec_vc_intparam_tdmopt_d,
4001
14
          { "D Bit", "ldp.msg.tlv.fec.vc.intparam.tdmopt_d", FT_BOOLEAN, 16,
4002
14
            TFS(&fec_vc_tdmopt_d), 0x4000, "VC FEC Interface Param TDM Options Dynamic Timestamp", HFILL }},
4003
4004
14
        { &hf_ldp_tlv_fec_vc_intparam_tdmopt_f,
4005
14
          { "F Bit", "ldp.msg.tlv.fec.vc.intparam.tdmopt_f", FT_BOOLEAN, 16,
4006
14
            TFS(&fec_vc_tdmopt_f), 0x2000, "VC FEC Interface Param TDM Options Flavor bit", HFILL }},
4007
4008
14
        { &hf_ldp_tlv_fec_vc_intparam_tdmopt_res1,
4009
14
          { "RSVD-1", "ldp.msg.tlv.fec.vc.intparam.tdmopt_res1", FT_UINT16, BASE_HEX,
4010
14
            NULL, 0x1FFF, "VC FEC Interface Param TDM Options Reserved", HFILL }},
4011
4012
14
        { &hf_ldp_tlv_fec_vc_intparam_tdmopt_pt,
4013
14
          { "PT", "ldp.msg.tlv.fec.vc.intparam.tdmopt_pt", FT_UINT8, BASE_DEC,
4014
14
            NULL, 0x7F, "VC FEC Interface Param TDM Options Payload Type", HFILL }},
4015
4016
14
        { &hf_ldp_tlv_fec_vc_intparam_tdmopt_res2,
4017
14
          { "RSVD-2", "ldp.msg.tlv.fec.vc.intparam.tdmopt_res2", FT_UINT8, BASE_HEX,
4018
14
            NULL, 0x00, "VC FEC Interface Param TDM Options Reserved", HFILL }},
4019
4020
14
        { &hf_ldp_tlv_fec_vc_intparam_tdmopt_freq,
4021
14
          { "FREQ", "ldp.msg.tlv.fec.vc.intparam.tdmopt_freq", FT_UINT16, BASE_DEC,
4022
14
            NULL, 0x00, "VC FEC Interface Param TDM Options Frequency", HFILL }},
4023
4024
14
        { &hf_ldp_tlv_fec_vc_intparam_tdmopt_ssrc,
4025
14
          { "SSRC", "ldp.msg.tlv.fec.vc.intparam.tdmopt_ssrc", FT_UINT32, BASE_HEX,
4026
14
            NULL, 0x00, "VC FEC Interface Param TDM Options SSRC", HFILL }},
4027
4028
14
        { &hf_ldp_tlv_fec_vc_intparam_vccv_cctype_cw,
4029
14
          { "PWE3 Control Word", "ldp.msg.tlv.fec.vc.intparam.vccv.cctype_cw", FT_BOOLEAN, 8,
4030
14
            NULL, 0x01, "VC FEC Interface Param VCCV CC Type PWE3 CW", HFILL }},
4031
4032
14
        { &hf_ldp_tlv_fec_vc_intparam_vccv_cctype_mplsra,
4033
14
          { "MPLS Router Alert", "ldp.msg.tlv.fec.vc.intparam.vccv.cctype_mplsra", FT_BOOLEAN, 8,
4034
14
            NULL, 0x02, "VC FEC Interface Param VCCV CC Type MPLS Router Alert", HFILL }},
4035
4036
14
        { &hf_ldp_tlv_fec_vc_intparam_vccv_cctype_ttl1,
4037
14
          { "MPLS Inner Label TTL = 1", "ldp.msg.tlv.fec.vc.intparam.vccv.cctype_ttl1", FT_BOOLEAN, 8,
4038
14
            NULL, 0x04, "VC FEC Interface Param VCCV CC Type Inner Label TTL 1", HFILL }},
4039
4040
14
        { &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_icmpping,
4041
14
          { "ICMP Ping", "ldp.msg.tlv.fec.vc.intparam.vccv.cvtype_icmpping", FT_BOOLEAN, 8,
4042
14
            NULL, 0x01, "VC FEC Interface Param VCCV CV Type ICMP Ping", HFILL }},
4043
4044
14
        { &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_lspping,
4045
14
          { "LSP Ping", "ldp.msg.tlv.fec.vc.intparam.vccv.cvtype_lspping", FT_BOOLEAN, 8,
4046
14
            NULL, 0x02, "VC FEC Interface Param VCCV CV Type LSP Ping", HFILL }},
4047
4048
14
        { &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd1,
4049
14
          { "BFD IP/UDP-encapsulated, for PW Fault Detection only", "ldp.msg.tlv.fec.vc.intparam.vccv.cvtype_bfd1", FT_BOOLEAN, 8,
4050
14
            NULL, 0x04, "VC FEC Interface Param VCCV CV Type BFD IP/UDP-encapsulated, for PW Fault Detection only", HFILL }},
4051
4052
14
        { &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd2,
4053
14
          { "BFD IP/UDP-encapsulated, for PW Fault Detection and AC/PW Fault Status Signaling", "ldp.msg.tlv.fec.vc.intparam.vccv.cvtype_bfd2", FT_BOOLEAN, 8,
4054
14
            NULL, 0x08, "VC FEC Interface Param VCCV CV Type BFD IP/UDP-encapsulated, for PW Fault Detection and AC/PW Fault Status Signaling", HFILL }},
4055
4056
14
        { &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd3,
4057
14
          { "BFD BFD PW-ACH-encapsulated, for PW Fault Detection only", "ldp.msg.tlv.fec.vc.intparam.vccv.cvtype_bfd3", FT_BOOLEAN, 8,
4058
14
            NULL, 0x10, "VC FEC Interface Param VCCV CV Type BFD PW-ACH-encapsulated, for PW Fault Detection only", HFILL }},
4059
4060
14
        { &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd4,
4061
14
          { "BFD BFD PW-ACH-encapsulated, for PW Fault Detection and AC/PW Fault Status Signaling", "ldp.msg.tlv.fec.vc.intparam.vccv.cvtype_bfd4", FT_BOOLEAN, 8,
4062
14
            NULL, 0x20, "VC FEC Interface Param VCCV CV Type BFD PW-ACH-encapsulated, for PW Fault Detection and AC/PW Fault Status Signaling", HFILL }},
4063
4064
14
        { &hf_ldp_tlv_fec_vc_intparam_flowlabel_t,
4065
14
          { "Flow Label Transmit bit", "ldp.msg.tlv.fec.vc.intparam.flowlabel.t", FT_UINT8, BASE_DEC, NULL, 0x80, NULL, HFILL}},
4066
4067
14
        { &hf_ldp_tlv_fec_vc_intparam_flowlabel_r,
4068
14
          { "Flow Label Receive bit", "ldp.msg.tlv.fec.vc.intparam.flowlabel.r", FT_UINT8, BASE_DEC, NULL, 0x40, NULL, HFILL}},
4069
4070
14
        { &hf_ldp_tlv_fec_vc_intparam_flowlabel_res,
4071
14
          { "Flow Label Reserved", "ldp.msg.tlv.fec.vc.intparam.flowlabel.res", FT_UINT16, BASE_HEX, NULL, 0x3FFF, NULL, HFILL}},
4072
4073
14
        { &hf_ldp_tlv_lspid_act_flg,
4074
14
          { "Action Indicator Flag", "ldp.msg.tlv.lspid.actflg", FT_UINT16, BASE_HEX,
4075
14
            VALS(ldp_act_flg_vals), 0x000F, NULL, HFILL}},
4076
4077
14
        { &hf_ldp_tlv_lspid_cr_lsp,
4078
14
          { "Local CR-LSP ID", "ldp.msg.tlv.lspid.locallspid", FT_UINT16, BASE_HEX,
4079
14
            NULL, 0x0, NULL, HFILL}},
4080
4081
14
        { &hf_ldp_tlv_lspid_ldpid,
4082
14
          { "Ingress LSR Router ID", "ldp.msg.tlv.lspid.lsrid", FT_IPv4, BASE_NONE,
4083
14
            NULL, 0x0, NULL, HFILL}},
4084
4085
14
        { &hf_ldp_tlv_er_hop_loose,
4086
14
          { "Loose route bit", "ldp.msg.tlv.er_hop.loose", FT_UINT24, BASE_HEX,
4087
14
            VALS(ldp_loose_vals), 0x800000, NULL, HFILL}},
4088
4089
14
        { &hf_ldp_tlv_er_hop_prelen,
4090
14
          { "Prefix length", "ldp.msg.tlv.er_hop.prefixlen", FT_UINT8, BASE_DEC,
4091
14
            NULL, 0x0, "Prefix len", HFILL}},
4092
4093
14
        { &hf_ldp_tlv_er_hop_prefix4,
4094
14
          { "IPv4 Address", "ldp.msg.tlv.er_hop.prefix4", FT_IPv4, BASE_NONE,
4095
14
            NULL, 0x0, NULL, HFILL}},
4096
4097
14
        { &hf_ldp_tlv_er_hop_prefix6,
4098
14
          { "IPv6 Address", "ldp.msg.tlv.er_hop.prefix6", FT_IPv6, BASE_NONE,
4099
14
            NULL, 0x0, NULL, HFILL}},
4100
4101
14
        { &hf_ldp_tlv_er_hop_as,
4102
14
          { "AS Number", "ldp.msg.tlv.er_hop.as", FT_UINT16, BASE_DEC,
4103
14
            NULL, 0x0, NULL, HFILL}},
4104
4105
14
        { &hf_ldp_tlv_er_hop_cr_lsp,
4106
14
          { "Local CR-LSP ID", "ldp.msg.tlv.er_hop.locallspid", FT_UINT16, BASE_DEC,
4107
14
            NULL, 0x0, NULL, HFILL}},
4108
4109
14
        { &hf_ldp_tlv_er_hop_ldpid,
4110
14
          { "Local CR-LSP ID", "ldp.msg.tlv.er_hop.lsrid", FT_IPv4, BASE_NONE,
4111
14
            NULL, 0x0, NULL, HFILL}},
4112
4113
14
        { &hf_ldp_tlv_flags_reserv,
4114
14
          { "Reserved", "ldp.msg.tlv.flags_reserv", FT_UINT8, BASE_HEX,
4115
14
            NULL, 0xC0, NULL, HFILL}},
4116
4117
14
        { &hf_ldp_tlv_flags_pdr,
4118
14
          { "PDR", "ldp.msg.tlv.flags_pdr", FT_BOOLEAN, 8,
4119
14
            TFS(&tlv_negotiable), 0x1, "PDR negotiability flag", HFILL}},
4120
4121
14
        { &hf_ldp_tlv_flags_pbs,
4122
14
          { "PBS", "ldp.msg.tlv.flags_pbs", FT_BOOLEAN, 8,
4123
14
            TFS(&tlv_negotiable), 0x2, "PBS negotiability flag", HFILL}},
4124
4125
14
        { &hf_ldp_tlv_flags_cdr,
4126
14
          { "CDR", "ldp.msg.tlv.flags_cdr", FT_BOOLEAN, 8,
4127
14
            TFS(&tlv_negotiable), 0x4, "CDR negotiability flag", HFILL}},
4128
4129
14
        { &hf_ldp_tlv_flags_cbs,
4130
14
          { "CBS", "ldp.msg.tlv.flags_cbs", FT_BOOLEAN, 8,
4131
14
            TFS(&tlv_negotiable), 0x8, "CBS negotiability flag", HFILL}},
4132
4133
14
        { &hf_ldp_tlv_flags_ebs,
4134
14
          { "EBS", "ldp.msg.tlv.flags_ebs", FT_BOOLEAN, 8,
4135
14
            TFS(&tlv_negotiable), 0x10, "EBS negotiability flag", HFILL}},
4136
4137
14
        { &hf_ldp_tlv_flags_weight,
4138
14
          { "Weight", "ldp.msg.tlv.flags_weight", FT_BOOLEAN, 8,
4139
14
            TFS(&tlv_negotiable), 0x20, "Weight negotiability flag", HFILL}},
4140
4141
14
        { &hf_ldp_tlv_frequency,
4142
14
          { "Frequency", "ldp.msg.tlv.frequency", FT_UINT8, BASE_DEC,
4143
14
            VALS(freq_values), 0, NULL, HFILL}},
4144
4145
14
        { &hf_ldp_tlv_weight,
4146
14
          { "Weight", "ldp.msg.tlv.weight", FT_UINT8, BASE_DEC,
4147
14
            NULL, 0, "Weight of the CR-LSP", HFILL}},
4148
4149
14
        { &hf_ldp_tlv_pdr,
4150
14
          { "PDR", "ldp.msg.tlv.pdr", FT_DOUBLE, BASE_NONE,
4151
14
            NULL, 0, "Peak Data Rate", HFILL}},
4152
4153
14
        { &hf_ldp_tlv_pbs,
4154
14
          { "PBS", "ldp.msg.tlv.pbs", FT_DOUBLE, BASE_NONE,
4155
14
            NULL, 0, "Peak Burst Size", HFILL}},
4156
4157
14
        { &hf_ldp_tlv_cdr,
4158
14
          { "CDR", "ldp.msg.tlv.cdr", FT_DOUBLE, BASE_NONE,
4159
14
            NULL, 0, "Committed Data Rate", HFILL}},
4160
4161
14
        { &hf_ldp_tlv_cbs,
4162
14
          { "CBS", "ldp.msg.tlv.cbs", FT_DOUBLE, BASE_NONE,
4163
14
            NULL, 0, "Committed Burst Size", HFILL}},
4164
4165
14
        { &hf_ldp_tlv_ebs,
4166
14
          { "EBS", "ldp.msg.tlv.ebs", FT_DOUBLE, BASE_NONE,
4167
14
            NULL, 0, "Excess Burst Size", HFILL}},
4168
4169
14
        { &hf_ldp_tlv_set_prio,
4170
14
          { "Set Prio", "ldp.msg.tlv.set_prio", FT_UINT8, BASE_DEC,
4171
14
            NULL, 0, "LSP setup priority", HFILL}},
4172
4173
14
        { &hf_ldp_tlv_hold_prio,
4174
14
          { "Hold Prio", "ldp.msg.tlv.hold_prio", FT_UINT8, BASE_DEC,
4175
14
            NULL, 0, "LSP hold priority", HFILL}},
4176
4177
14
        { &hf_ldp_tlv_route_pinning,
4178
14
          { "Route Pinning", "ldp.msg.tlv.route_pinning", FT_UINT32, BASE_DEC,
4179
14
            VALS(route_pinning_vals), 0x80000000, NULL, HFILL}},
4180
4181
14
        { &hf_ldp_tlv_resource_class,
4182
14
          { "Resource Class", "ldp.msg.tlv.resource_class", FT_UINT32, BASE_HEX,
4183
14
            NULL, 0, "Resource Class (Color)", HFILL}},
4184
4185
#if 0
4186
        { &hf_ldp_tlv_diffserv,
4187
          { "Diff-Serv TLV", "ldp.msg.tlv.diffserv", FT_NONE, BASE_NONE,
4188
            NULL, 0, "Diffserv TLV", HFILL}},
4189
#endif
4190
4191
14
        { &hf_ldp_tlv_diffserv_type,
4192
14
          { "LSP Type", "ldp.msg.tlv.diffserv.type", FT_UINT8, BASE_DEC,
4193
14
            VALS(diffserv_type_vals), 0x80, NULL, HFILL}},
4194
4195
14
        { &hf_ldp_tlv_diffserv_mapnb,
4196
14
          { "MAPnb", "ldp.msg.tlv.diffserv.mapnb", FT_UINT8, BASE_DEC,
4197
14
            NULL, 0, MAPNB_DESCRIPTION, HFILL}},
4198
4199
14
        { &hf_ldp_tlv_diffserv_map,
4200
14
          { "MAP", "ldp.msg.tlv.diffserv.map", FT_NONE, BASE_NONE,
4201
14
            NULL, 0, MAP_DESCRIPTION, HFILL}},
4202
4203
14
        { &hf_ldp_tlv_diffserv_map_exp,
4204
14
          { "EXP", "ldp.msg.tlv.diffserv.map.exp", FT_UINT8, BASE_DEC,
4205
14
            NULL, 0, EXP_DESCRIPTION, HFILL}},
4206
4207
14
        { &hf_ldp_tlv_diffserv_phbid,
4208
14
          { PHBID_DESCRIPTION, "ldp.msg.tlv.diffserv.phbid", FT_NONE, BASE_NONE,
4209
14
            NULL, 0, NULL, HFILL}},
4210
4211
14
        { &hf_ldp_tlv_diffserv_phbid_dscp,
4212
14
          { PHBID_DSCP_DESCRIPTION, "ldp.msg.tlv.diffserv.phbid.dscp", FT_UINT16, BASE_DEC,
4213
14
            NULL, PHBID_DSCP_MASK, NULL, HFILL}},
4214
4215
14
        { &hf_ldp_tlv_diffserv_phbid_code,
4216
14
          { PHBID_CODE_DESCRIPTION, "ldp.msg.tlv.diffserv.phbid.code", FT_UINT16, BASE_DEC,
4217
14
            NULL, PHBID_CODE_MASK, NULL, HFILL}},
4218
4219
14
        { &hf_ldp_tlv_diffserv_phbid_bit14,
4220
14
          { PHBID_BIT14_DESCRIPTION, "ldp.msg.tlv.diffserv.phbid.bit14", FT_UINT16, BASE_DEC,
4221
14
            VALS(phbid_bit14_vals), PHBID_BIT14_MASK, NULL, HFILL}},
4222
4223
14
        { &hf_ldp_tlv_diffserv_phbid_bit15,
4224
14
          { PHBID_BIT15_DESCRIPTION, "ldp.msg.tlv.diffserv.phbid.bit15", FT_UINT16, BASE_DEC,
4225
14
            VALS(phbid_bit15_vals), PHBID_BIT15_MASK, NULL, HFILL}},
4226
4227
14
        { &hf_ldp_tlv_fec_gen_agi_type,
4228
14
          { "AGI Type", "ldp.msg.tlv.fec.gen.agi.type", FT_UINT8, BASE_DEC,
4229
14
            NULL, 0x0, "Attachment Group Identifier Type", HFILL}},
4230
4231
14
        { &hf_ldp_tlv_fec_gen_agi_length,
4232
14
          { "AGI Length", "ldp.msg.tlv.fec.gen.agi.length", FT_UINT8, BASE_DEC,
4233
14
            NULL, 0x0, "Attachment Group Identifier Length", HFILL}},
4234
4235
14
        { &hf_ldp_tlv_fec_gen_agi_value,
4236
14
          { "AGI Value", "ldp.msg.tlv.fec.gen.agi.value", FT_BYTES, BASE_NONE,
4237
14
            NULL, 0x0, "Attachment Group Identifier Value", HFILL}},
4238
4239
14
        { &hf_ldp_tlv_fec_gen_saii_type,
4240
14
          { "SAII Type", "ldp.msg.tlv.fec.gen.saii.type", FT_UINT8, BASE_DEC,
4241
14
            NULL, 0x0, "Source Attachment Individual Identifier Type", HFILL}},
4242
4243
14
        { &hf_ldp_tlv_fec_gen_saii_length,
4244
14
          { "SAII Length", "ldp.msg.tlv.fec.gen.saii.length", FT_UINT8, BASE_DEC,
4245
14
            NULL, 0x0, "Source Attachment Individual Identifier Length", HFILL}},
4246
4247
14
        { &hf_ldp_tlv_fec_gen_saii_value,
4248
14
          { "SAII Value", "ldp.msg.tlv.fec.gen.saii.value", FT_BYTES, BASE_NONE,
4249
14
            NULL, 0x0, "Source Attachment Individual Identifier Value", HFILL}},
4250
4251
14
        { &hf_ldp_tlv_fec_gen_taii_type,
4252
14
          { "TAII Type", "ldp.msg.tlv.fec.gen.taii.type", FT_UINT8, BASE_DEC,
4253
14
            NULL, 0x0, "Target Attachment Individual Identifier Type", HFILL}},
4254
4255
14
        { &hf_ldp_tlv_fec_gen_taii_length,
4256
14
          { "TAII length", "ldp.msg.tlv.fec.gen.taii.length", FT_UINT8, BASE_DEC,
4257
14
            NULL, 0x0, "Target Attachment Individual Identifier Length", HFILL}},
4258
4259
14
        { &hf_ldp_tlv_fec_gen_taii_value,
4260
14
          { "TAII Value", "ldp.msg.tlv.fec.gen.taii.value", FT_BYTES, BASE_NONE,
4261
14
            NULL, 0x0, "Target Attachment Individual Identifier Value", HFILL}},
4262
4263
14
        { &hf_ldp_tlv_fec_gen_aai_globalid,
4264
14
          { "Global Id", "ldp.msg.tlv.fec.gen.aii.globalid", FT_UINT32, BASE_DEC,
4265
14
            NULL, 0x0, "Attachment Individual Identifier Global Id", HFILL}},
4266
4267
14
        { &hf_ldp_tlv_fec_gen_aai_prefix,
4268
14
          { "Prefix", "ldp.msg.tlv.fec.gen.aii.prefix", FT_UINT32, BASE_DEC,
4269
14
            NULL, 0x0, "Attachment Individual Identifier Prefix", HFILL}},
4270
4271
14
        { &hf_ldp_tlv_fec_gen_aai_ac_id,
4272
14
          { "Prefix", "ldp.msg.tlv.fec.gen.aii.acid", FT_UINT32, BASE_DEC,
4273
14
            NULL, 0x0, "Attachment Individual Identifier AC Id", HFILL}},
4274
4275
14
        { &hf_ldp_tlv_fec_pw_controlword,
4276
14
          { "C-bit", "ldp.msg.tlv.fec.pw.controlword", FT_BOOLEAN, 8,
4277
14
            TFS(&fec_vc_cbit), 0x80, "Control Word Present", HFILL }},
4278
4279
14
        { &hf_ldp_tlv_fec_pw_pwtype,
4280
14
          { "PW Type", "ldp.msg.tlv.fec.pw.pwtype", FT_UINT16, BASE_HEX,
4281
14
            VALS(fec_vc_types_vals), 0x7FFF, "Virtual Circuit Type", HFILL }},
4282
4283
14
        { &hf_ldp_tlv_fec_pw_infolength,
4284
14
          { "PW Info Length", "ldp.msg.tlv.fec.pw.infolength", FT_UINT8, BASE_DEC,
4285
14
            NULL, 0x0, "PW FEC Info Length", HFILL }},
4286
4287
14
        { &hf_ldp_tlv_fec_pw_groupid,
4288
14
          { "Group ID", "ldp.msg.tlv.fec.pw.groupid", FT_UINT32, BASE_DEC,
4289
14
            NULL, 0x0, "PW FEC Group ID", HFILL }},
4290
4291
14
        { &hf_ldp_tlv_fec_pw_pwid,
4292
14
          { "PW ID", "ldp.msg.tlv.fec.pw.pwid", FT_UINT32, BASE_DEC,
4293
14
            NULL, 0x0, "PW FEC PWID", HFILL }},
4294
4295
14
        { &hf_ldp_tlv_pw_status_data,
4296
14
          { "PW Status", "ldp.msg.tlv.pwstatus.code", FT_UINT32, BASE_HEX,
4297
14
            NULL, 0, NULL, HFILL }},
4298
4299
14
        { &hf_ldp_tlv_pw_not_forwarding,
4300
14
          { "Pseudowire Not Forwarding", "ldp.msg.tlv.pwstatus.code.pwnotforward", FT_BOOLEAN, 32,
4301
14
            TFS(&tfs_set_notset), PW_NOT_FORWARDING, NULL, HFILL }},
4302
4303
14
        { &hf_ldp_tlv_pw_lac_ingress_recv_fault,
4304
14
          { "Local Attachment Circuit (ingress) Receive Fault", "ldp.msg.tlv.pwstatus.code.pwlacingressrecvfault",
4305
14
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), PW_LAC_INGRESS_RECV_FAULT, NULL, HFILL }},
4306
4307
14
        { &hf_ldp_tlv_pw_lac_egress_recv_fault,
4308
14
          { "Local Attachment Circuit (egress) Transmit Fault", "ldp.msg.tlv.pwstatus.code.pwlacegresstransfault",
4309
14
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), PW_LAC_EGRESS_TRANS_FAULT, NULL, HFILL }},
4310
4311
14
        { &hf_ldp_tlv_pw_psn_pw_ingress_recv_fault,
4312
14
          { "Local PSN-facing PW (ingress) Receive Fault", "ldp.msg.tlv.pwstatus.code.pwpsnpwingressrecvfault",
4313
14
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), PW_PSN_PW_INGRESS_RECV_FAULT, NULL, HFILL }},
4314
4315
14
        { &hf_ldp_tlv_pw_psn_pw_egress_recv_fault,
4316
14
          { "Local PSN-facing PW (egress) Transmit Fault", "ldp.msg.tlv.pwstatus.code.pwpsnpwegresstransfault",
4317
14
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), PW_PSN_PW_EGRESS_TRANS_FAULT, NULL, HFILL }},
4318
4319
14
        { &hf_ldp_tlv_pw_grouping_value,
4320
14
          { "Value", "ldp.msg.tlv.pwgrouping.value",
4321
14
            FT_UINT32, BASE_DEC, NULL, 0x0,
4322
14
            "PW Grouping Value", HFILL }},
4323
4324
14
        { &hf_ldp_tlv_intparam_length,
4325
14
          { "Length", "ldp.msg.tlv.intparam.length", FT_UINT8, BASE_DEC,
4326
14
            NULL, 0x0, "VC FEC Interface Parameter Length", HFILL }},
4327
4328
14
        { &hf_ldp_tlv_intparam_mtu,
4329
14
          { "MTU", "ldp.msg.tlv.intparam.mtu", FT_UINT16, BASE_DEC,
4330
14
            NULL, 0x0, "VC FEC Interface Parameter MTU", HFILL }},
4331
4332
14
        { &hf_ldp_tlv_intparam_tdmbps,
4333
14
          { "BPS", "ldp.msg.tlv.intparam.tdmbps", FT_UINT32, BASE_DEC,
4334
14
            NULL, 0x0, "VC FEC Interface Parameter CEP/TDM bit-rate", HFILL }},
4335
4336
14
        { &hf_ldp_tlv_intparam_id,
4337
14
          { "ID", "ldp.msg.tlv.intparam.id", FT_UINT8, BASE_HEX,
4338
14
            VALS(fec_vc_interfaceparm), 0x0, "VC FEC Interface Parameter ID", HFILL }},
4339
4340
14
        { &hf_ldp_tlv_intparam_maxcatmcells,
4341
14
          { "Number of Cells", "ldp.msg.tlv.intparam.maxatm", FT_UINT16, BASE_DEC,
4342
14
            NULL, 0x0, "VC FEC Interface Param Max ATM Concat Cells", HFILL }},
4343
4344
14
        { &hf_ldp_tlv_intparam_desc,
4345
14
          { "Description", "ldp.msg.tlv.intparam.desc", FT_STRING, BASE_NONE,
4346
14
            NULL, 0, "VC FEC Interface Description", HFILL }},
4347
4348
14
        { &hf_ldp_tlv_intparam_cepbytes,
4349
14
          { "Payload Bytes", "ldp.msg.tlv.intparam.cepbytes", FT_UINT16, BASE_DEC,
4350
14
            NULL, 0x0, "VC FEC Interface Param CEP/TDM Payload Bytes", HFILL }},
4351
4352
14
        { &hf_ldp_tlv_intparam_cepopt_ais,
4353
14
          { "AIS", "ldp.msg.tlv.intparam.cepopt_ais", FT_BOOLEAN, 16,
4354
14
            NULL, 0x8000, "VC FEC Interface Param CEP Option AIS", HFILL }},
4355
4356
14
        { &hf_ldp_tlv_intparam_cepopt_une,
4357
14
          { "UNE", "ldp.msg.tlv.intparam.cepopt_une", FT_BOOLEAN, 16,
4358
14
            NULL, 0x4000, "VC FEC Interface Param CEP Option Unequipped", HFILL }},
4359
4360
14
        { &hf_ldp_tlv_intparam_cepopt_rtp,
4361
14
          { "RTP", "ldp.msg.tlv.intparam.cepopt_rtp", FT_BOOLEAN, 16,
4362
14
            NULL, 0x2000, "VC FEC Interface Param CEP Option RTP Header", HFILL }},
4363
4364
14
        { &hf_ldp_tlv_intparam_cepopt_ebm,
4365
14
          { "EBM", "ldp.msg.tlv.intparam.cepopt_ebm", FT_BOOLEAN, 16,
4366
14
            NULL, 0x1000, "VC FEC Interface Param CEP Option EBM Header", HFILL }},
4367
4368
14
        { &hf_ldp_tlv_intparam_cepopt_mah,
4369
14
          { "MAH", "ldp.msg.tlv.intparam.cepopt_mah", FT_BOOLEAN, 16,
4370
14
            NULL, 0x0800, "VC FEC Interface Param CEP Option MPLS Adaptation header", HFILL }},
4371
4372
14
        { &hf_ldp_tlv_intparam_cepopt_res,
4373
14
          { "Reserved", "ldp.msg.tlv.intparam.cepopt_res", FT_UINT16, BASE_HEX,
4374
14
            NULL , 0x07E0, "VC FEC Interface Param CEP Option Reserved", HFILL }},
4375
4376
14
        { &hf_ldp_tlv_intparam_cepopt_ceptype,
4377
14
          { "CEP Type", "ldp.msg.tlv.intparam.cepopt_ceptype", FT_UINT16, BASE_HEX,
4378
14
            VALS(fec_vc_ceptype_vals), 0x001C, "VC FEC Interface Param CEP Option CEP Type", HFILL }},
4379
4380
14
        { &hf_ldp_tlv_intparam_cepopt_t3,
4381
14
          { "Async T3", "ldp.msg.tlv.intparam.cepopt_t3", FT_BOOLEAN, 16,
4382
14
            NULL, 0x0002, "VC FEC Interface Param CEP Option Async T3", HFILL }},
4383
4384
14
        { &hf_ldp_tlv_intparam_cepopt_e3,
4385
14
          { "Async E3", "ldp.msg.tlv.intparam.cepopt_e3", FT_BOOLEAN, 16,
4386
14
            NULL, 0x0001, "VC FEC Interface Param CEP Option Async E3", HFILL }},
4387
4388
14
        { &hf_ldp_tlv_intparam_vlanid,
4389
14
          { "VLAN Id", "ldp.msg.tlv.intparam.vlanid", FT_UINT16, BASE_DEC,
4390
14
            NULL, 0x0, "VC FEC Interface Param VLAN Id", HFILL }},
4391
4392
14
        { &hf_ldp_tlv_intparam_dlcilen,
4393
14
          { "DLCI Length", "ldp.msg.tlv.intparam.dlcilen", FT_UINT16, BASE_DEC,
4394
14
            NULL, 0x0, "VC FEC Interface Parameter Frame-Relay DLCI Length", HFILL }},
4395
4396
14
        { &hf_ldp_tlv_intparam_fcslen,
4397
14
          { "FCS Length", "ldp.msg.tlv.intparam.fcslen", FT_UINT16, BASE_DEC,
4398
14
            NULL, 0x0, "VC FEC Interface Parameter FCS Length", HFILL }},
4399
4400
14
        { &hf_ldp_tlv_intparam_tdmopt_r,
4401
14
          { "R Bit", "ldp.msg.tlv.intparam.tdmopt_r", FT_BOOLEAN, 16,
4402
14
            TFS(&fec_vc_tdmopt_r), 0x8000, "VC FEC Interface Param TDM Options RTP Header", HFILL }},
4403
4404
14
        { &hf_ldp_tlv_intparam_tdmopt_d,
4405
14
          { "D Bit", "ldp.msg.tlv.intparam.tdmopt_d", FT_BOOLEAN, 16,
4406
14
            TFS(&fec_vc_tdmopt_d), 0x4000, "VC FEC Interface Param TDM Options Dynamic Timestamp", HFILL }},
4407
4408
14
        { &hf_ldp_tlv_intparam_tdmopt_f,
4409
14
          { "F Bit", "ldp.msg.tlv.intparam.tdmopt_f", FT_BOOLEAN, 16,
4410
14
            TFS(&fec_vc_tdmopt_f), 0x2000, "VC FEC Interface Param TDM Options Flavor bit", HFILL }},
4411
4412
14
        { &hf_ldp_tlv_intparam_tdmopt_res1,
4413
14
          { "RSVD-1", "ldp.msg.tlv.intparam.tdmopt_res1", FT_UINT16, BASE_HEX,
4414
14
            NULL, 0x1FFF, "VC FEC Interface Param TDM Options Reserved", HFILL }},
4415
4416
14
        { &hf_ldp_tlv_intparam_tdmopt_pt,
4417
14
          { "PT", "ldp.msg.tlv.intparam.tdmopt_pt", FT_UINT8, BASE_DEC,
4418
14
            NULL, 0x7F, "VC FEC Interface Param TDM Options Payload Type", HFILL }},
4419
4420
14
        { &hf_ldp_tlv_intparam_tdmopt_res2,
4421
14
          { "RSVD-2", "ldp.msg.tlv.intparam.tdmopt_res2", FT_UINT8, BASE_HEX,
4422
14
            NULL, 0x00, "VC FEC Interface Param TDM Options Reserved", HFILL }},
4423
4424
14
        { &hf_ldp_tlv_intparam_tdmopt_freq,
4425
14
          { "FREQ", "ldp.msg.tlv.intparam.tdmopt_freq", FT_UINT16, BASE_DEC,
4426
14
            NULL, 0x00, "VC FEC Interface Param TDM Options Frequency", HFILL }},
4427
4428
14
        { &hf_ldp_tlv_intparam_tdmopt_ssrc,
4429
14
          { "SSRC", "ldp.msg.tlv.intparam.tdmopt_ssrc", FT_UINT32, BASE_HEX,
4430
14
            NULL, 0x00, "VC FEC Interface Param TDM Options SSRC", HFILL }},
4431
4432
14
        { &hf_ldp_tlv_intparam_vccv_cctype_cw,
4433
14
          { "PWE3 Control Word", "ldp.msg.tlv.intparam.vccv.cctype_cw", FT_BOOLEAN, 8,
4434
14
            NULL, 0x01, "VC FEC Interface Param VCCV CC Type PWE3 CW", HFILL }},
4435
4436
14
        { &hf_ldp_tlv_intparam_vccv_cctype_mplsra,
4437
14
          { "MPLS Router Alert", "ldp.msg.tlv.intparam.vccv.cctype_mplsra", FT_BOOLEAN, 8,
4438
14
            NULL, 0x02, "VC FEC Interface Param VCCV CC Type MPLS Router Alert", HFILL }},
4439
4440
14
        { &hf_ldp_tlv_intparam_vccv_cctype_ttl1,
4441
14
          { "MPLS Inner Label TTL = 1", "ldp.msg.tlv.intparam.vccv.cctype_ttl1", FT_BOOLEAN, 8,
4442
14
            NULL, 0x04, "VC FEC Interface Param VCCV CC Type Inner Label TTL 1", HFILL }},
4443
4444
14
        { &hf_ldp_tlv_intparam_vccv_cvtype_icmpping,
4445
14
          { "ICMP Ping", "ldp.msg.tlv.intparam.vccv.cvtype_icmpping", FT_BOOLEAN, 8,
4446
14
            NULL, 0x01, "VC FEC Interface Param VCCV CV Type ICMP Ping", HFILL }},
4447
4448
14
        { &hf_ldp_tlv_intparam_vccv_cvtype_lspping,
4449
14
          { "LSP Ping", "ldp.msg.tlv.intparam.vccv.cvtype_lspping", FT_BOOLEAN, 8,
4450
14
            NULL, 0x02, "VC FEC Interface Param VCCV CV Type LSP Ping", HFILL }},
4451
4452
14
        { &hf_ldp_tlv_intparam_vccv_cvtype_bfd,
4453
14
          { "BFD", "ldp.msg.tlv.intparam.vccv.cvtype_bfd", FT_BOOLEAN, 8,
4454
14
            NULL, 0x04, "VC FEC Interface Param VCCV CV Type BFD", HFILL }},
4455
4456
14
        { &hf_ldp_tlv_upstr_sbit,
4457
14
          { "S-Bit", "ldp.msg.tlv.upstream.sbit", FT_BOOLEAN, 8,
4458
14
            TFS(&tlv_upstr_sbit_vals), 0x80, "Upstream Label Assignment Capability State Bit", HFILL }},
4459
4460
14
        { &hf_ldp_tlv_upstr_lbl_req_resvbit,
4461
14
          { "Reserved Bits", "ldp.msg.tlv.upstream_label_req.resvbit", FT_UINT32, BASE_HEX,
4462
14
            NULL, 0x0, NULL, HFILL }},
4463
4464
14
        { &hf_ldp_tlv_upstr_ass_lbl,
4465
14
          { "Upstream-Assigned Label", "ldp.msg.tlv.upstream.label", FT_UINT32, BASE_HEX,
4466
14
            NULL, 0x0, NULL, HFILL }},
4467
4468
14
        { &hf_ldp_tlv_upstr_lbl_resvbit,
4469
14
          { "Reserved Bits", "ldp.msg.tlv.upstream.resvbit", FT_UINT32, BASE_HEX,
4470
14
            NULL, 0x0, NULL, HFILL }},
4471
4472
14
        { &hf_ldp_tlv_ipv4_intID_hop_addr,
4473
14
          { "IPv4 Next/Previous Hop Address", "ldp.msg.tlv.ipv4_interface_ID.hop_addr", FT_IPv4, BASE_NONE,
4474
14
            NULL, 0x0, NULL, HFILL }},
4475
4476
14
        { &hf_ldp_tlv_logical_intID,
4477
14
          { "Logical Interface ID", "ldp.msg.tlv.interface_ID.logical_intID", FT_UINT32, BASE_HEX,
4478
14
            NULL, 0x0, NULL, HFILL }},
4479
4480
14
        { &hf_ldp_tlv_ip_multicast_srcaddr,
4481
14
          { "Source Address", "ldp.msg.tlv.ip_multicast.ipv4_srcaddr", FT_IPv4, BASE_NONE,
4482
14
            NULL, 0x0, NULL, HFILL }},
4483
4484
14
        { &hf_ldp_tlv_ip_multicast_mltcstaddr,
4485
14
          { "Multicast Group Address", "ldp.msg.tlv.ip_multicast.ipv4_maddr", FT_IPv4, BASE_NONE,
4486
14
            NULL, 0x0, NULL, HFILL }},
4487
4488
14
        { &hf_ldp_tlv_ip_mpls_context_srcaddr,
4489
14
          { "Source Address", "ldp.msg.tlv.ip_mpls_context.ipv4_srcaddr", FT_IPv4, BASE_NONE,
4490
14
            NULL, 0x0, NULL, HFILL }},
4491
4492
14
        { &hf_ldp_tlv_ldp_p2mp_lsptype,
4493
14
          { "P2MP Type", "ldp.msg.tlv.ldp_p2mp.type", FT_UINT8, BASE_HEX,
4494
14
            NULL, 0x0, "TLV Type", HFILL }},
4495
4496
14
        { &hf_ldp_tlv_ldp_p2mp_addrfam,
4497
14
          { "Address Family", "ldp.msg.tlv.ldp_p2mp.addr_family", FT_UINT16, BASE_HEX,
4498
14
            NULL, 0x0, NULL, HFILL }},
4499
4500
14
        { &hf_ldp_tlv_ldp_p2mp_addrlen,
4501
14
          { "Address Length", "ldp.msg.tlv.ldp_p2mp.addr_len", FT_UINT8, BASE_HEX,
4502
14
            NULL, 0x0, NULL, HFILL }},
4503
4504
14
        { &hf_ldp_tlv_ldp_p2mp_rtnodeaddr,
4505
14
          { "Root Node Address", "ldp.msg.tlv.ldp_p2mp.ipv4_rtnodeaddr", FT_IPv4, BASE_NONE,
4506
14
            NULL, 0x0, NULL, HFILL }},
4507
4508
14
        { &hf_ldp_tlv_ldp_p2mp_oplength,
4509
14
          { "Opaque Length", "ldp.msg.tlv.ldp_p2mp.oplength", FT_UINT16, BASE_DEC,
4510
14
            NULL, 0x0, NULL, HFILL }},
4511
4512
14
        { &hf_ldp_tlv_ldp_p2mp_opvalue,
4513
14
          { "Opaque Value", "ldp.msg.tlv.ldp_p2mp.opvalue", FT_BYTES, BASE_NONE,
4514
14
            NULL, 0x0, NULL, HFILL }},
4515
4516
14
        { &hf_ldp_tlv_rsvp_te_p2mp_id,
4517
14
          { "P2MP ID", "ldp.msg.tlv.rsvp_te_p2mp.id", FT_UINT32, BASE_HEX,
4518
14
            NULL, 0x0, NULL, HFILL }},
4519
4520
14
        { &hf_ldp_tlv_must_be_zero,
4521
14
          { "MUST be zero", "ldp.msg.tlv.rsvp_te_p2mp.zero", FT_UINT16, BASE_HEX,
4522
14
            NULL, 0x0, NULL, HFILL }},
4523
4524
14
        { &hf_ldp_tlv_tunnel_id,
4525
14
          { "Tunnel ID", "ldp.msg.tlv.rsvp_te_p2mp.tunnel_id", FT_UINT16, BASE_HEX,
4526
14
            NULL, 0x0, NULL, HFILL }},
4527
4528
14
        { &hf_ldp_tlv_ext_tunnel_id,
4529
14
          { "Extended Tunnel ID", "ldp.msg.tlv.rsvp_te_p2mp.ipv4_ext_tunnel_id", FT_IPv4, BASE_NONE,
4530
14
            NULL, 0x0, NULL, HFILL }},
4531
4532
14
        { &hf_ldp_tlv_inv_length,
4533
14
          { "Invalid length", "ldp.msg.tlv.invalid.length", FT_UINT16, BASE_HEX,
4534
14
            NULL, 0x0, NULL, HFILL }},
4535
4536
14
        { &hf_ldp_returned_pdu_data,
4537
14
          { "Returned PDU Data", "ldp.returned_pdu_data", FT_BYTES, BASE_NONE,
4538
14
            NULL, 0x0, NULL, HFILL }},
4539
4540
14
        { &hf_ldp_returned_message_parameters,
4541
14
          { "Returned Message Parameters", "ldp.returned_message_parameters", FT_BYTES, BASE_NONE,
4542
14
            NULL, 0x0, NULL, HFILL }},
4543
4544
14
        { &hf_ldp_data,
4545
14
          { "Data", "ldp.data", FT_BYTES, BASE_NONE,
4546
14
            NULL, 0x0, NULL, HFILL }},
4547
4548
14
        { &hf_ldp_unknown_data,
4549
14
          { "Unknown Data", "ldp.unknown_data", FT_BYTES, BASE_NONE,
4550
14
            NULL, 0x0, NULL, HFILL }},
4551
14
    };
4552
4553
14
    static int *ett[] = {
4554
14
        &ett_ldp,
4555
14
        &ett_ldp_header,
4556
14
        &ett_ldp_ldpid,
4557
14
        &ett_ldp_message,
4558
14
        &ett_ldp_tlv,
4559
14
        &ett_ldp_tlv_val,
4560
14
        &ett_ldp_tlv_ft_flags,
4561
14
        &ett_ldp_fec,
4562
14
        &ett_ldp_fec_vc_interfaceparam,
4563
14
        &ett_ldp_fec_vc_interfaceparam_cepopt,
4564
14
        &ett_ldp_fec_vc_interfaceparam_vccvtype,
4565
14
        &ett_ldp_diffserv_map,
4566
14
        &ett_ldp_diffserv_map_phbid,
4567
14
        &ett_ldp_gen_agi,
4568
14
        &ett_ldp_gen_saii,
4569
14
        &ett_ldp_gen_taii,
4570
14
        &ett_ldp_gen_aai_type2,
4571
14
        &ett_ldp_sub_tlv
4572
14
    };
4573
4574
14
    static ei_register_info ei[] = {
4575
14
        { &ei_ldp_dtsm_and_target, { "ldp.dtsm_and_target", PI_PROTOCOL, PI_WARN, "ERROR - Both GTSM and Target Flag are enabled.", EXPFILL }},
4576
14
        { &ei_ldp_gtsm_supported, { "ldp.gtsm_supported", PI_PROTOCOL, PI_CHAT, "GTSM is supported by the source", EXPFILL }},
4577
14
        { &ei_ldp_gtsm_not_supported_basic_discovery, { "ldp.gtsm_not_supported_basic_discovery", PI_PROTOCOL, PI_WARN, "GTSM is not supported by the source, since basic discovery is not enabled", EXPFILL }},
4578
14
        { &ei_ldp_gtsm_not_supported, { "ldp.gtsm_not_supported", PI_PROTOCOL, PI_CHAT, "GTSM is not supported by the source", EXPFILL }},
4579
14
        { &ei_ldp_inv_length, { "ldp.invalid_length", PI_MALFORMED, PI_ERROR, "Length of the packet is malformed", EXPFILL }},
4580
14
        { &ei_ldp_address_family_not_implemented, { "ldp.address_family_not_implemented", PI_UNDECODED, PI_WARN, "Support for Address Family not implemented", EXPFILL }},
4581
14
        { &ei_ldp_tlv_fec, { "ldp.msg.tlv.fec.error", PI_PROTOCOL, PI_ERROR, "Error in FEC Element", EXPFILL }},
4582
        /* N.B. this one is being used for lots of length-related and bytes-remaining conditions.. */
4583
14
        { &ei_ldp_tlv_fec_len, { "ldp.msg.tlv.fec.len.invalid", PI_PROTOCOL, PI_ERROR, "Length Error", EXPFILL }},
4584
14
        { &ei_ldp_tlv_fec_vc_infolength, { "ldp.msg.tlv.fec.vc.infolength.invalid", PI_PROTOCOL, PI_ERROR, "VC FEC size format error", EXPFILL }},
4585
14
        { &ei_ldp_malformed_interface_parameter, { "ldp.malformed_interface_parameter", PI_MALFORMED, PI_ERROR, "Malformed interface parameter", EXPFILL }},
4586
14
        { &ei_ldp_malformed_data, { "ldp.malformed_data", PI_MALFORMED, PI_ERROR, "Malformed data", EXPFILL }},
4587
14
        { &ei_ldp_tlv_fec_type, { "ldp.msg.tlv.fec.unknown", PI_PROTOCOL, PI_WARN, "Unknown FEC TLV type", EXPFILL }},
4588
4589
14
    };
4590
4591
14
    module_t *ldp_module;
4592
14
    expert_module_t* expert_ldp;
4593
4594
14
    proto_ldp = proto_register_protocol("Label Distribution Protocol", "LDP", "ldp");
4595
4596
14
    proto_register_field_array(proto_ldp, hf, array_length(hf));
4597
14
    proto_register_subtree_array(ett, array_length(ett));
4598
14
    expert_ldp = expert_register_protocol(proto_ldp);
4599
14
    expert_register_field_array(expert_ldp, ei, array_length(ei));
4600
4601
14
    ldp_handle = register_dissector("ldp", dissect_ldp, proto_ldp);
4602
14
    ldp_tcp_handle = register_dissector("ldp.tcp", dissect_ldp_tcp, proto_ldp);
4603
4604
    /* Register our configuration options for , particularly our port */
4605
4606
14
    ldp_module = prefs_register_protocol(proto_ldp, NULL);
4607
4608
14
    prefs_register_bool_preference(ldp_module, "desegment_ldp_messages",
4609
14
                                   "Reassemble LDP messages spanning multiple TCP segments",
4610
14
                                   "Whether the LDP dissector should reassemble messages spanning multiple TCP segments."
4611
14
                                   " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\""
4612
14
                                   " in the TCP protocol settings.",
4613
14
                                   &ldp_desegment);
4614
14
}
4615
4616
/* The registration hand-off routine */
4617
void
4618
proto_reg_handoff_ldp(void)
4619
14
{
4620
14
    dissector_add_uint_with_preference("tcp.port", TCP_PORT_LDP, ldp_tcp_handle);
4621
14
    dissector_add_uint_with_preference("udp.port", UDP_PORT_LDP, ldp_handle);
4622
14
}
4623
4624
/*
4625
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
4626
 *
4627
 * Local variables:
4628
 * c-basic-offset: 4
4629
 * tab-width: 8
4630
 * indent-tabs-mode: nil
4631
 * End:
4632
 *
4633
 * vi: set shiftwidth=4 tabstop=8 expandtab:
4634
 * :indentSize=4:tabSize=8:noTabs=true:
4635
 */