HACK: 2nd try to match RowsetProperties
[wireshark-wip.git] / epan / dissectors / packet-pcep.c
blobfdcc797c6fa2d732de9d0fa73fd82a15df66f1f4
1 /* packet-pcep.c
2 * Routines for PCEP packet disassembly
3 * draft-ietf-pce-pcep-09
4 * draft-ietf-pce-pcep-xro-02
5 * See also RFC 4655, RFC 4657, RFC 5520, RFC 5521, RFC 5440 and RFC 5541
7 * (c) Copyright 2007 Silvia Cristina Tejedor <silviacristina.tejedor@gmail.com>
9 * $Id$
11 * Wireshark - Network traffic analyzer
12 * By Gerald Combs <gerald@wireshark.org>
13 * Copyright 1998 Gerald Combs
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 * Added support of "A Set of Monitoring Tools for Path Computation Element
30 * (PCE)-Based Architecture" (RFC 5886)
31 * (c) Copyright 2012 Svetoslav Duhovnikov <duhovnikov[AT]gmail.com>
34 #include "config.h"
36 #include <epan/packet.h>
37 #include <epan/to_str.h>
38 #include <epan/expert.h>
39 #include "packet-tcp.h"
41 /*differents types of objects*/
42 #define PCEP_OPEN_OBJ 1
43 #define PCEP_RP_OBJ 2
44 #define PCEP_NO_PATH_OBJ 3
45 #define PCEP_END_POINT_OBJ 4
46 #define PCEP_BANDWIDTH_OBJ 5
47 #define PCEP_METRIC_OBJ 6
48 #define PCEP_EXPLICIT_ROUTE_OBJ 7
49 #define PCEP_RECORD_ROUTE_OBJ 8
50 #define PCEP_LSPA_OBJ 9
51 #define PCEP_IRO_OBJ 10
52 #define PCEP_SVEC_OBJ 11
53 #define PCEP_NOTIFICATION_OBJ 12
54 #define PCEP_PCEP_ERROR_OBJ 13
55 #define PCEP_LOAD_BALANCING_OBJ 14
56 #define PCEP_CLOSE_OBJ 15
57 #define PCEP_PATH_KEY_OBJ 16
58 #define PCEP_XRO_OBJ 17
59 #define PCEP_OBJ_MONITORING 19
60 #define PCEP_OBJ_PCC_ID_REQ 20
61 #define PCEP_OF_OBJ 21
62 #define PCEP_OBJ_PCE_ID 25
63 #define PCEP_OBJ_PROC_TIME 26
64 #define PCEP_OBJ_OVERLOAD 27
66 /*Subobjects of EXPLICIT ROUTE Object*/
67 #define PCEP_SUB_IPv4 1
68 #define PCEP_SUB_IPv6 2
69 #define PCEP_SUB_LABEL_CONTROL 3
70 #define PCEP_SUB_UNNUMB_INTERFACE_ID 4
71 #define PCEP_SUB_AUTONOMOUS_SYS_NUM 32
72 #define PCEP_SUB_EXRS 33
73 #define PCEP_SUB_SRLG 34
74 #define PCEP_SUB_PKSv4 64
75 #define PCEP_SUB_PKSv6 65
77 /*Possible values of the NI in the NO-PATH object*/
78 #define NO_SATISFYING 0
79 #define CHAIN_BROKEN 1
81 /*Possible values of L in the ERO and IRO objects */
82 #define STRICT_HOP 0
83 #define LOOSE_HOP 1
85 /*Possible values of U in the ERO and RRO objects */
86 #define DOWNSTREAM_LABEL 0
87 #define UPSTREAM_LABEL 1
89 /*Possible values of Notification Type */
90 #define NOT_REQ_CANCEL 1
91 #define PCEP_CONGESTION 2
93 /*Possible values of Notification Value for NT=1*/
94 #define NOTI_PCC_CANCEL_REQ 1
95 #define NOTI_PCE_CANCEL_REQ 2
97 /*Possible values of Notification Value for NT=2*/
98 #define NOTI_PCE_CONGEST 1
99 #define NOTI_PCE_NO_CONGEST 2
101 /*Possible types of errors */
102 #define ESTABLISH_FAILURE 1
103 #define CAP_NOT_SUPPORTED 2
104 #define UNKNOWN_OBJ 3
105 #define NOT_SUPP_OBJ 4
106 #define POLICY_VIOLATION 5
107 #define MANDATORY_OBJ_MIS 6
108 #define SYNCH_PCREQ_MIS 7
109 #define UNKNOWN_REQ_REF 8
110 #define ATTEMPT_2_SESSION 9
111 #define INVALID_OBJ 10
112 #define UNRECO_EXRS_SUBOBJ 11
113 #define DIFFSERV_TE_ERROR 12
114 #define BRPC_FAILURE 13
115 #define GCO_ERROR 15
116 #define P2MP_CAPABILITY_ERROR 16
117 #define P2MP_END_POINTS_ERROR 17
118 #define P2MP_FRAGMENT_ERROR 18
120 /*Different values of Reason in the CLOSE object */
121 #define NO_EXP_PROV 1
122 #define DEADTIME_PROV 2
123 #define RECEP_MALFORM_MSG 3
125 /*Different values of Attribute in the XRO object */
126 #define ATTR_INTERFACE 0
127 #define ATTR_NODE 1
128 #define ATTR_SRLG 2
130 /*Mask for the flags of HEADER of Messages*/
131 #define PCEP_HDR_MSG_RESERVED 0x1f
133 /*Mask for the type of HEADER of Objects*/
134 #define MASK_OBJ_TYPE 0xF0
136 /*Mask for the flags of HEADER of Objects*/
137 #define PCEP_HDR_OBJ_RESERVED 0x0C
138 #define PCEP_HDR_OBJ_P 0x02
139 #define PCEP_HDR_OBJ_I 0x01
141 /*Mask for the flags of OPEN Object*/
142 #define PCEP_OPEN_RES 0x1F
144 /*Mask for the flags of RP Object*/
145 #define PCEP_RP_PRI 0x000007
146 #define PCEP_RP_R 0x000008
147 #define PCEP_RP_B 0x000010
148 #define PCEP_RP_O 0x000020
149 #define PCEP_RP_V 0x000040
150 #define PCEP_RP_S 0x000080
151 #define PCEP_RP_P 0x000100
152 #define PCEP_RP_D 0x000200
153 #define PCEP_RP_M 0x000400
154 #define PCEP_RP_E 0x000800
155 #define PCEP_RP_N 0x001000
156 #define PCEP_RP_F 0x002000
157 #define PCEP_RP_RESERVED 0xFFC000
159 /*Mask for the flags of NO PATH Object*/
160 #define PCEP_NO_PATH_C 0x8000
162 /*Mask for the flags of METRIC Object*/
163 #define PCEP_METRIC_B 0x01
164 #define PCEP_METRIC_C 0x02
166 /*Mask for the flags of LSPA Object*/
167 #define PCEP_LSPA_L 0x01
169 /* Mask to differentiate the value of L and Type (Explicit Object)*/
170 #define Mask_L 0x80
171 #define Mask_Type 0x7f
173 /* RFC 5440 */
174 #define TCP_PORT_PCEP 4189
176 #define IPv4 1
177 #define IPv6 2
179 /*Mask for the flags os SVEC Object*/
180 #define PCEP_SVEC_L 0x000001
181 #define PCEP_SVEC_N 0x000002
182 #define PCEP_SVEC_S 0x000004
184 /*Mask for the flags of XRO Object*/
185 #define PCEP_XRO_F 0x0001
187 /*Mask for the flags of MONITORING Object*/
188 #define PCEP_OBJ_MONITORING_FLAGS_L 0x000001
189 #define PCEP_OBJ_MONITORING_FLAGS_G 0x000002
190 #define PCEP_OBJ_MONITORING_FLAGS_P 0x000004
191 #define PCEP_OBJ_MONITORING_FLAGS_C 0x000008
192 #define PCEP_OBJ_MONITORING_FLAGS_I 0x000010
193 #define PCEP_OBJ_MONITORING_FLAGS_RESERVED 0xFFFFE0
195 /*Define types for PCC-ID-REQ Object*/
196 #define PCEP_OBJ_PCC_ID_REQ_IPv4 1
197 #define PCEP_OBJ_PCC_ID_REQ_IPv6 2
199 /*Define types for PCE-ID Object*/
200 #define PCEP_OBJ_PCE_ID_IPv4 1
201 #define PCEP_OBJ_PCE_ID_IPv6 2
203 /*Mask for the flags of PROC-TIME Object*/
204 #define PCEP_OBJ_PROC_TIME_FLAGS_E 0x0001
205 #define PCEP_OBJ_PROC_TIME_FLAGS_RESERVED 0xFFFE
207 /*Mask for the flags of IPv4, IPv6 and UNnumbered InterfaceID Subobjects of RRO Object*/
208 #define PCEP_SUB_LPA 0x01
209 #define PCEP_SUB_LPU 0x02
211 /*Mask for the flags of Label SubObject*/
212 #define PCEP_SUB_LABEL_GL 0x01
215 static int proto_pcep = -1;
217 static gint hf_pcep_hdr_msg_flags_reserved= -1;
218 static gint hf_pcep_hdr_obj_flags_reserved= -1;
219 static gint hf_pcep_hdr_obj_flags_p= -1;
220 static gint hf_pcep_hdr_obj_flags_i= -1;
221 static gint hf_pcep_open_flags_res = -1;
222 static gint hf_pcep_rp_flags_pri = -1;
223 static gint hf_pcep_rp_flags_r = -1;
224 static gint hf_pcep_rp_flags_b = -1;
225 static gint hf_pcep_rp_flags_o = -1;
226 static gint hf_pcep_rp_flags_v = -1;
227 static gint hf_pcep_rp_flags_s = -1;
228 static gint hf_pcep_rp_flags_p = -1;
229 static gint hf_pcep_rp_flags_d = -1;
230 static gint hf_pcep_rp_flags_m = -1;
231 static gint hf_pcep_rp_flags_e = -1;
232 static gint hf_pcep_rp_flags_n = -1;
233 static gint hf_pcep_rp_flags_f = -1;
234 static gint hf_pcep_rp_flags_reserved = -1;
235 static gint hf_pcep_no_path_flags_c = -1;
236 static gint hf_pcep_metric_flags_c = -1;
237 static gint hf_pcep_metric_flags_b = -1;
238 static gint hf_pcep_lspa_flags_l = -1;
239 static gint hf_pcep_svec_flags_l = -1;
240 static gint hf_pcep_svec_flags_n = -1;
241 static gint hf_pcep_svec_flags_s = -1;
242 static gint hf_pcep_xro_flags_f = -1;
243 static gint hf_pcep_obj_monitoring_flags_reserved = -1;
244 static gint hf_pcep_obj_monitoring_flags_l= -1;
245 static gint hf_pcep_obj_monitoring_flags_g= -1;
246 static gint hf_pcep_obj_monitoring_flags_p= -1;
247 static gint hf_pcep_obj_monitoring_flags_c= -1;
248 static gint hf_pcep_obj_monitoring_flags_i= -1;
249 static gint hf_pcep_obj_monitoring_monitoring_id_number = -1;
250 static gint hf_pcep_obj_pcc_id_req_ipv4 = -1;
251 static gint hf_pcep_obj_pcc_id_req_ipv6 = -1;
252 static gint hf_pcep_obj_pce_id_ipv4 = -1;
253 static gint hf_pcep_obj_pce_id_ipv6 = -1;
254 static gint hf_pcep_obj_proc_time_flags_reserved = -1;
255 static gint hf_pcep_obj_proc_time_flags_e = -1;
256 static gint hf_pcep_obj_proc_time_cur_proc_time = -1;
257 static gint hf_pcep_obj_proc_time_min_proc_time = -1;
258 static gint hf_pcep_obj_proc_time_max_proc_time = -1;
259 static gint hf_pcep_obj_proc_time_ave_proc_time = -1;
260 static gint hf_pcep_obj_proc_time_var_proc_time = -1;
261 static gint hf_pcep_obj_overload_duration = -1;
262 static gint pcep_subobj_flags_lpa= -1;
263 static gint pcep_subobj_flags_lpu= -1;
264 static gint pcep_subobj_label_flags_gl= -1;
265 static gint hf_pcep_no_path_tlvs_pce = -1;
266 static gint hf_pcep_no_path_tlvs_unk_dest = -1;
267 static gint hf_pcep_no_path_tlvs_unk_src = -1;
268 static gint hf_PCEPF_MSG = -1;
269 static gint hf_PCEPF_OBJECT_CLASS = -1;
270 static gint hf_PCEPF_OBJ_OPEN = -1;
271 static gint hf_PCEPF_OBJ_RP = -1;
272 static gint hf_PCEPF_OBJ_NO_PATH = -1;
273 static gint hf_PCEPF_OBJ_END_POINT = -1;
274 static gint hf_PCEPF_OBJ_BANDWIDTH = -1;
275 static gint hf_PCEPF_OBJ_METRIC = -1;
276 static gint hf_PCEPF_OBJ_EXPLICIT_ROUTE = -1;
277 static gint hf_PCEPF_OBJ_RECORD_ROUTE = -1;
278 static gint hf_PCEPF_OBJ_LSPA = -1;
279 static gint hf_PCEPF_OBJ_IRO = -1;
280 static gint hf_PCEPF_OBJ_SVEC = -1;
281 static gint hf_PCEPF_OBJ_NOTIFICATION = -1;
282 static gint hf_PCEPF_OBJ_UNKNOWN_TYPE = -1;
283 static gint hf_PCEPF_NOTI_TYPE = -1;
284 static gint hf_PCEPF_NOTI_VAL1 = -1;
285 static gint hf_PCEPF_NOTI_VAL2 = -1;
286 static gint hf_PCEPF_OBJ_PCEP_ERROR = -1;
287 static gint hf_PCEPF_ERROR_TYPE = -1;
288 static gint hf_PCEPF_OBJ_LOAD_BALANCING = -1;
289 static gint hf_PCEPF_OBJ_CLOSE = -1;
290 static gint hf_PCEPF_OBJ_PATH_KEY = -1;
291 static gint hf_PCEPF_OBJ_XRO = -1;
292 static gint hf_PCEPF_OBJ_MONITORING = -1;
293 static gint hf_PCEPF_OBJ_PCC_ID_REQ = -1;
294 static gint hf_PCEPF_OBJ_OF = -1;
295 static gint hf_PCEPF_OBJ_PCE_ID = -1;
296 static gint hf_PCEPF_OBJ_PROC_TIME = -1;
297 static gint hf_PCEPF_OBJ_OVERLOAD = -1;
298 static gint hf_PCEPF_SUBOBJ = -1;
299 static gint hf_PCEPF_SUBOBJ_7F = -1;
300 static gint hf_PCEPF_SUBOBJ_IPv4 = -1;
301 static gint hf_PCEPF_SUBOBJ_IPv6 = -1;
302 static gint hf_PCEPF_SUBOBJ_LABEL_CONTROL = -1;
303 static gint hf_PCEPF_SUBOBJ_UNNUM_INTERFACEID = -1;
304 static gint hf_PCEPF_SUBOBJ_AUTONOMOUS_SYS_NUM = -1;
305 static gint hf_PCEPF_SUBOBJ_SRLG = -1;
306 static gint hf_PCEPF_SUBOBJ_EXRS = -1;
307 static gint hf_PCEPF_SUBOBJ_PKSv4 = -1;
308 static gint hf_PCEPF_SUBOBJ_PKSv6 = -1;
309 static gint hf_PCEPF_SUBOBJ_XRO = -1;
310 #if 0
311 static gint hf_PCEPF_SUB_XRO_ATTRIB = -1;
312 #endif
314 /* Generated from convert_proto_tree_add_text.pl */
315 static int hf_pcep_xro_obj_flags = -1;
316 static int hf_pcep_open_obj_keepalive = -1;
317 static int hf_pcep_request_id = -1;
318 static int hf_pcep_lspa_obj_reserved = -1;
319 static int hf_pcep_rp_obj_reserved = -1;
320 static int hf_pcep_svec_obj_reserved = -1;
321 static int hf_pcep_rp_obj_flags = -1;
322 static int hf_pcep_lspa_obj_exclude_any = -1;
323 static int hf_pcep_subobj_srlg_attribute = -1;
324 static int hf_pcep_end_point_obj_destination_ipv4_address = -1;
325 static int hf_pcep_subobj_unnumb_interfaceID_reserved_xroobj = -1;
326 static int hf_pcep_balancing_obj_flags = -1;
327 static int hf_pcep_subobj_unnumb_interfaceID_reserved = -1;
328 static int hf_pcep_lspa_obj_setup_priority = -1;
329 static int hf_pcep_svec_obj_request_id_number = -1;
330 static int hf_pcep_end_point_obj_source_ipv4_address = -1;
331 static int hf_pcep_open_obj_sid = -1;
332 static int hf_pcep_subobj_ipv6_padding = -1;
333 static int hf_pcep_notification_obj_reserved = -1;
334 static int hf_pcep_close_obj_reason = -1;
335 static int hf_pcep_subobj_ipv4_attribute = -1;
336 static int hf_pcep_obj_overload_flags = -1;
337 static int hf_pcep_balancing_obj_maximum_number_of_te_lsps = -1;
338 static int hf_pcep_subobj_exrs_reserved = -1;
339 static int hf_pcep_subobj_label_control_length = -1;
340 static int hf_pcep_subobj_ipv4_length = -1;
341 static int hf_pcep_subobj_ipv6_ipv6 = -1;
342 static int hf_pcep_lspa_obj_holding_priority = -1;
343 static int hf_pcep_rp_obj_requested_id_number = -1;
344 static int hf_pcep_subobj_pksv6_path_key = -1;
345 static int hf_pcep_subobj_unnumb_interfaceID_router_id = -1;
346 static int hf_pcep_subobj_pksv6_pce_id = -1;
347 static int hf_pcep_tlv_padding = -1;
348 static int hf_pcep_subobj_unnumb_interfaceID_flags = -1;
349 static int hf_pcep_subobj_unnumb_interfaceID_length = -1;
350 static int hf_pcep_obj_proc_time_reserved = -1;
351 static int hf_pcep_object_type = -1;
352 static int hf_pcep_subobj_pksv4_length = -1;
353 static int hf_pcep_subobj_ipv6_prefix_length = -1;
354 static int hf_pcep_subobj_ipv6_length = -1;
355 static int hf_pcep_flags = -1;
356 static int hf_pcep_no_path_obj_reserved = -1;
357 static int hf_pcep_subobj_unnumb_interfaceID_interface_id = -1;
358 static int hf_pcep_close_obj_flags = -1;
359 static int hf_pcep_error_obj_flags = -1;
360 static int hf_pcep_metric_obj_flags = -1;
361 static int hf_pcep_subobj_autonomous_sys_num_reserved = -1;
362 static int hf_pcep_subobj_pksv4_path_key = -1;
363 static int hf_pcep_subobj_label_control_flags = -1;
364 static int hf_pcep_notification_obj_value = -1;
365 static int hf_pcep_subobj_label_control_label = -1;
366 static int hf_pcep_metric_obj_metric_value = -1;
367 static int hf_pcep_no_path_obj_flags = -1;
368 static int hf_pcep_obj_monitoring_reserved = -1;
369 static int hf_pcep_obj_of_code = -1;
370 static int hf_pcep_subobj_label_control_u = -1;
371 static int hf_pcep_subobj_autonomous_sys_num_length = -1;
372 static int hf_pcep_message_length = -1;
373 static int hf_pcep_subobj_ipv4_prefix_length = -1;
374 static int hf_pcep_xro_obj_reserved = -1;
375 static int hf_pcep_subobj_pksv4_pce_id = -1;
376 static int hf_pcep_subobj_pksv6_length = -1;
377 static int hf_pcep_end_point_obj_destination_ipv6_address = -1;
378 static int hf_pcep_subobj_autonomous_sys_num_as_number = -1;
379 static int hf_pcep_notification_obj_flags = -1;
380 static int hf_pcep_subobj_unnumb_interfaceID_attribute = -1;
381 static int hf_pcep_object_length = -1;
382 static int hf_pcep_tlv_data = -1;
383 static int hf_pcep_balancing_obj_reserved = -1;
384 static int hf_pcep_subobj_ipv4_flags = -1;
385 static int hf_pcep_subobj_ipv6_attribute = -1;
386 static int hf_pcep_subobj_srlg_id = -1;
387 static int hf_pcep_balancing_obj_minimum_bandwidth = -1;
388 static int hf_pcep_subobj_unnumb_interfaceID_reserved_rrobj = -1;
389 static int hf_pcep_error_obj_reserved = -1;
390 static int hf_pcep_obj_overload_reserved = -1;
391 static int hf_pcep_notification_obj_type = -1;
392 static int hf_pcep_subobj_ipv6_flags = -1;
393 static int hf_pcep_obj_monitoring_flags = -1;
394 static int hf_pcep_subobj_exrs_length = -1;
395 static int hf_pcep_obj_proc_time_flags = -1;
396 static int hf_pcep_subobj_label_control_reserved = -1;
397 static int hf_pcep_version = -1;
398 static int hf_pcep_lspa_obj_flags = -1;
399 static int hf_pcep_subobj_ipv4_ipv4 = -1;
400 static int hf_pcep_tlv_type = -1;
401 static int hf_pcep_subobj_autonomous_sys_num_optional_as_number_high_octets = -1;
402 static int hf_pcep_open_obj_deadtime = -1;
403 static int hf_pcep_bandwidth = -1;
404 static int hf_pcep_tlv_length = -1;
405 static int hf_pcep_subobj_srlg_reserved = -1;
406 static int hf_pcep_metric_obj_type = -1;
407 static int hf_pcep_metric_obj_reserved = -1;
408 static int hf_pcep_svec_obj_flags = -1;
409 static int hf_pcep_open_obj_pcep_version = -1;
410 static int hf_pcep_open_obj_flags = -1;
411 static int hf_pcep_end_point_obj_source_ipv6_address = -1;
412 static int hf_pcep_lspa_obj_include_any = -1;
413 static int hf_pcep_lspa_obj_include_all = -1;
414 static int hf_pcep_subobj_ipv4_padding = -1;
415 static int hf_pcep_subobj_srlg_length = -1;
416 static int hf_pcep_subobj_autonomous_sys_num_attribute = -1;
417 static int hf_pcep_close_obj_reserved = -1;
418 static int hf_pcep_subobj_label_control_c_type = -1;
419 static int hf_pcep_subobj_iro_autonomous_sys_num_l = -1;
420 static int hf_pcep_subobj_autonomous_sys_num_x = -1;
421 static int hf_pcep_subobj_label_control_l = -1;
422 static int hf_pcep_subobj_exrs_l = -1;
423 static int hf_pcep_subobj_unnumb_interfaceID_x = -1;
424 static int hf_pcep_subobj_autonomous_sys_num_l = -1;
425 static int hf_pcep_subobj_pksv6_l = -1;
426 static int hf_pcep_subobj_srlg_x = -1;
427 static int hf_pcep_subobj_ipv4_x = -1;
428 static int hf_pcep_subobj_iro_unnumb_interfaceID_l = -1;
429 static int hf_pcep_subobj_exrs_type = -1;
430 static int hf_pcep_subobj_ipv4_l = -1;
431 static int hf_pcep_of_code = -1;
432 static int hf_pcep_subobj_ipv6_x = -1;
433 static int hf_pcep_no_path_obj_nature_of_issue = -1;
434 static int hf_pcep_subobj_ipv6_l = -1;
435 static int hf_pcep_subobj_pksv4_l = -1;
436 static int hf_pcep_subobj_iro_ipv6_l = -1;
437 static int hf_pcep_subobj_unnumb_interfaceID_l = -1;
438 static int hf_pcep_subobj_iro_ipv4_l = -1;
440 static gint ett_pcep = -1;
441 static gint ett_pcep_hdr = -1;
442 static gint ett_pcep_obj_open = -1;
443 static gint ett_pcep_obj_request_parameters = -1;
444 static gint ett_pcep_obj_no_path = -1;
445 static gint ett_pcep_obj_end_point = -1;
446 static gint ett_pcep_obj_bandwidth = -1;
447 static gint ett_pcep_obj_metric = -1;
448 static gint ett_pcep_obj_explicit_route = -1;
449 static gint ett_pcep_obj_record_route = -1;
450 static gint ett_pcep_obj_lspa = -1;
451 static gint ett_pcep_obj_iro = -1;
452 static gint ett_pcep_obj_svec = -1;
453 static gint ett_pcep_obj_notification = -1;
454 static gint ett_pcep_obj_error = -1;
455 static gint ett_pcep_obj_load_balancing = -1;
456 static gint ett_pcep_obj_close = -1;
457 static gint ett_pcep_obj_path_key = -1;
458 static gint ett_pcep_obj_xro = -1;
459 static gint ett_pcep_obj_monitoring = -1;
460 static gint ett_pcep_obj_pcc_id_req = -1;
461 static gint ett_pcep_obj_of = -1;
462 static gint ett_pcep_obj_pce_id = -1;
463 static gint ett_pcep_obj_proc_time = -1;
464 static gint ett_pcep_obj_overload = -1;
465 static gint ett_pcep_obj_unknown = -1;
467 /* Generated from convert_proto_tree_add_text.pl */
468 static expert_field ei_pcep_pcep_object_body_non_defined = EI_INIT;
469 static expert_field ei_pcep_non_defined_object = EI_INIT;
470 static expert_field ei_pcep_object_length = EI_INIT;
471 static expert_field ei_pcep_subobject_bad_length = EI_INIT;
472 static expert_field ei_pcep_non_defined_subobject = EI_INIT;
473 static expert_field ei_pcep_unknown_type_object = EI_INIT;
475 /* PCEP message types.*/
476 typedef enum {
477 PCEP_MSG_NO_VALID,
478 PCEP_MSG_OPEN,
479 PCEP_MSG_KEEPALIVE,
480 PCEP_MSG_PATH_COMPUTATION_REQUEST,
481 PCEP_MSG_PATH_COMPUTATION_REPLY,
482 PCEP_MSG_NOTIFICATION,
483 PCEP_MSG_ERROR,
484 PCEP_MSG_CLOSE,
485 PCEP_MSG_PATH_COMPUTATION_MONITORING_REQUEST,
486 PCEP_MSG_PATH_COMPUTATION_MONITORING_REPLY
487 } pcep_message_types;
489 static const value_string message_type_vals[] = {
490 {PCEP_MSG_OPEN, "OPEN MESSAGE" },
491 {PCEP_MSG_KEEPALIVE, "KEEPALIVE MESSAGE" },
492 {PCEP_MSG_PATH_COMPUTATION_REQUEST, "PATH COMPUTATION REQUEST MESSAGE" },
493 {PCEP_MSG_PATH_COMPUTATION_REPLY, "PATH COMPUTATION REPLY MESSAGE" },
494 {PCEP_MSG_NOTIFICATION, "NOTIFICATION MESSAGE" },
495 {PCEP_MSG_ERROR, "ERROR MESSAGE" },
496 {PCEP_MSG_CLOSE, "CLOSE MESSAGE" },
497 {PCEP_MSG_PATH_COMPUTATION_MONITORING_REQUEST, "PATH COMPUTATION MONITORING REQUEST MESSAGE" },
498 {PCEP_MSG_PATH_COMPUTATION_MONITORING_REPLY, "PATH COMPUTATION MONITORING REPLY MESSAGE" },
499 {0, NULL }
502 static const value_string pcep_class_vals[] = {
503 {PCEP_OPEN_OBJ, "OPEN OBJECT" },
504 {PCEP_RP_OBJ, "RP OBJECT" },
505 {PCEP_NO_PATH_OBJ, "NO-PATH OBJECT" },
506 {PCEP_END_POINT_OBJ, "END-POINT OBJECT" },
507 {PCEP_BANDWIDTH_OBJ, "BANDWIDTH OBJECT" },
508 {PCEP_METRIC_OBJ, "METRIC OBJECT" },
509 {PCEP_EXPLICIT_ROUTE_OBJ, "EXPLICIT ROUTE OBJECT (ERO)" },
510 {PCEP_RECORD_ROUTE_OBJ, "RECORD ROUTE OBJECT (RRO)" },
511 {PCEP_LSPA_OBJ, "LSPA OBJECT" },
512 {PCEP_IRO_OBJ, "IRO OBJECT" },
513 {PCEP_SVEC_OBJ, "SVEC OBJECT" },
514 {PCEP_NOTIFICATION_OBJ, "NOTIFICATION OBJECT" },
515 {PCEP_PCEP_ERROR_OBJ, "PCEP ERROR OBJECT" },
516 {PCEP_LOAD_BALANCING_OBJ, "LOAD BALANCING OBJECT" },
517 {PCEP_CLOSE_OBJ, "CLOSE OBJECT" },
518 {PCEP_PATH_KEY_OBJ, "PATH-KEY OBJECT" },
519 {PCEP_XRO_OBJ, "EXCLUDE ROUTE OBJECT (XRO)" },
520 {PCEP_OBJ_MONITORING, "MONITORING OBJECT" },
521 {PCEP_OBJ_PCC_ID_REQ, "PCC-ID-REQ OBJECT" },
522 {PCEP_OF_OBJ, "OBJECTIVE FUNCTION OBJECT (OF)"},
523 {PCEP_OBJ_PCE_ID, "PCE-ID OBJECT" },
524 {PCEP_OBJ_PROC_TIME, "PROC-TIME OBJECT" },
525 {PCEP_OBJ_OVERLOAD, "OVERLOAD OBJECT" },
526 {0, NULL }
529 static const value_string pcep_subobj_vals[] = {
530 {PCEP_SUB_IPv4, "SUBOBJECT IPv4" },
531 {PCEP_SUB_IPv6, "SUBOBJECT IPv6" },
532 {PCEP_SUB_LABEL_CONTROL, "SUBOBJECT LABEL" },
533 {PCEP_SUB_UNNUMB_INTERFACE_ID, "SUBOBJECT UNNUMBERED INTERFACE-ID" },
534 {PCEP_SUB_AUTONOMOUS_SYS_NUM, "SUBOBJECT AUTONOMOUS SYSTEM NUMBER" },
535 {PCEP_SUB_SRLG, "SUBOBJECT SRLG" },
536 {PCEP_SUB_PKSv4, "SUBOBJECT PATH KEY (IPv4)" },
537 {PCEP_SUB_PKSv6, "SUBOBJECT PATH KEY (IPv6)" },
538 {0, NULL }
542 static const value_string pcep_subobj_xro_vals[] = {
543 {PCEP_SUB_IPv4, "SUBOBJECT IPv4" },
544 {PCEP_SUB_IPv6, "SUBOBJECT IPv6" },
545 {PCEP_SUB_UNNUMB_INTERFACE_ID, "SUBOBJECT UNNUMBERED INTERFACE-ID" },
546 {PCEP_SUB_AUTONOMOUS_SYS_NUM, "SUBOBJECT AUTONOMOUS SYSTEM NUMBER" },
547 {PCEP_SUB_SRLG, "SUBOBJECT SRLG" },
548 {0, NULL }
551 /*In the NO-PATH Object the two different possibilities that NI can have*/
552 static const value_string pcep_no_path_obj_vals[] = {
553 {NO_SATISFYING, "No path satisfying the set of constraints could be found" },
554 {CHAIN_BROKEN, "PCEP Chain Broken" },
555 {0, NULL }
558 /*Different values of "Type (T)" in the METRIC Obj */
559 static const value_string pcep_metric_obj_vals[] = {
560 {0, "not defined" },
561 {1, "IGP Metric" },
562 {2, "TE Metric" },
563 {3, "Hop Counts" },
564 {4, "Aggregate bandwidth consumption" },
565 {5, "Load of the most loaded link" },
566 {6, "Cumulative IGP cost" },
567 {7, "Cumulative TE cost" },
568 {8, "P2MP IGM metric" },
569 {9, "P2MP TE metric" },
570 {10, "P2MP hop count metric" },
571 {0, NULL }
574 /*Different values for (L) in the ERO and IRO Objs */
575 static const value_string pcep_route_l_obj_vals[] = {
576 {STRICT_HOP, "Strict Hop" },
577 {LOOSE_HOP, "Loose Hop" },
578 {0, NULL }
581 /*Different values of the direction of the label (U) in the ERO and RRO Objs */
582 static const value_string pcep_route_u_obj_vals[] = {
583 {DOWNSTREAM_LABEL, "Downstream Label" },
584 {UPSTREAM_LABEL, "Upstream Label" },
585 {0, NULL }
588 /*Values of Notification type*/
589 static const value_string pcep_notification_types_vals[] = {
590 {NOT_REQ_CANCEL, "Pending Request Cancelled" },
591 {PCEP_CONGESTION, "PCE Congestion" },
592 {0, NULL }
595 /*Values of Notification value for Notification Type=1*/
596 static const value_string pcep_notification_values1_vals[] = {
597 {NOTI_PCC_CANCEL_REQ, "PCC Cancels a set of Pending Request (s)" },
598 {NOTI_PCE_CANCEL_REQ, "PCE Cancels a set of Pending Request (s)" },
599 {0, NULL }
602 /*Values of Notification value for Notification Type=2*/
603 static const value_string pcep_notification_values2_vals[] = {
604 {NOTI_PCE_CONGEST, "PCE in Congested State" },
605 {NOTI_PCE_NO_CONGEST, "PCE no Longer in Congested state" },
606 {0, NULL }
610 /* PCEP TLVs */
611 static const value_string pcep_tlvs_vals[] = {
612 {1, "NO-PATH-VECTOR TLV" },
613 {2, "OVERLOAD-DURATION TLV" },
614 {3, "REQ-MISSING TLV" },
615 {4, "OF-list TLV" },
616 {5, "Order TLV" },
617 {6, "P2MP Capable" },
618 {0, NULL }
622 /*Values of Objective Functions*/
623 static const value_string pcep_of_vals[] = {
624 {1, "Minimum Cost Path" },
625 {2, "Minimum Load Path" },
626 {3, "Maximum residual Bandwidth Path" },
627 {4, "Minimize aggregate Bandwidth Consumption" },
628 {5, "Minimize the Load of the most loaded Link" },
629 {6, "Minimize the Cumulative Cost of a set of paths"},
630 {0, NULL }
634 /*Values of different types of errors*/
635 static const value_string pcep_error_types_obj_vals[] = {
636 {ESTABLISH_FAILURE, "PCEP Session Establishment Failure" },
637 {CAP_NOT_SUPPORTED, "Capability non supported" },
638 {UNKNOWN_OBJ, "Unknown Object" },
639 {NOT_SUPP_OBJ, "Not Supported Object" },
640 {POLICY_VIOLATION, "Policy Violation" },
641 {MANDATORY_OBJ_MIS, "Mandatory Object Missing" },
642 {SYNCH_PCREQ_MIS, "Synchronized Path Computation Request Missing" },
643 {UNKNOWN_REQ_REF, "Unknown Request Reference" },
644 {ATTEMPT_2_SESSION, "Attempt to Establish a Second PCEP Session" },
645 {INVALID_OBJ, "Reception of an invalid object" },
646 {UNRECO_EXRS_SUBOBJ, "Unrecognized EXRS Subobject" },
647 {DIFFSERV_TE_ERROR, "Differsv-aware TE error" },
648 {BRPC_FAILURE, "BRPC procedure completion failure" },
649 {GCO_ERROR, "Global Concurrent Optimization error" },
650 {P2MP_CAPABILITY_ERROR, "P2PM capability error" },
651 {P2MP_END_POINTS_ERROR, "P2PM END-POINTS error" },
652 {P2MP_FRAGMENT_ERROR, "P2PM Fragmentation error" },
653 {0, NULL }
656 /*Error values for error type 1*/
657 static const value_string pcep_error_value_1_vals[] = {
658 {1, "Reception of an invalid Open msg or a non Open msg"},
659 {2, "No Open Message received before the expiration of the OpenWait Timer "},
660 {3, "Unacceptable and non Negotiable session characteristics"},
661 {4, "Unacceptable but Negotiable session characteristics"},
662 {5, "Reception of a second Open Message with still Unacceptable Session characteristics"},
663 {6, "Reception of a PCEPrr message proposing unacceptable session characteristics"},
664 {7, "NO Keepalive or PCEPrr message received before the expiration of the Keepwait timer supported"},
665 {8, "PCEP version not supported"},
666 {0, NULL}
669 /*Error values for error type 3*/
670 static const value_string pcep_error_value_3_vals[] = {
671 {1, "Unrecognized object class"},
672 {2, "Unrecognized object type"},
673 {0, NULL}
676 /*Error values for error type 4*/
677 static const value_string pcep_error_value_4_vals[] = {
678 {1, "Not supported object class"},
679 {2, "Not supported object type"},
680 {4, "Not supported parameter"},
681 {0, NULL}
684 /*Error values for error type 5*/
685 static const value_string pcep_error_value_5_vals[] = {
686 {1, "C bit of the METRIC object set (Request Rejected)"},
687 {2, "O bit of the RP object set (Request Rejected)"},
688 {3, "Objective Function not allowed (Request Rejected)"},
689 {4, "OF bit of the RP object set (Request Rejected)"},
690 {5, "Global concurrent optimization not allowed"},
691 {6, "Monitoring message supported but rejected due to policy violation"},
692 {7, "P2MP path computation is not allowed"},
693 {0, NULL}
697 /*Error values for error type 6*/
698 static const value_string pcep_error_value_6_vals[] = {
699 {1, "RP object missing"},
700 {2, "RRO object missing for a reoptimization request (R bit of the RP Object set)"},
701 {3, "END-POINTS object missing"},
702 {4, "MONITORINS object missing"},
703 {0, NULL}
706 /*Error values for error type 10*/
707 static const value_string pcep_error_value_10_vals[] = {
708 {1, "Reception of an object with P flag not set although the P-flag must be set"},
709 {0, NULL}
712 /*Error values for error type 12*/
713 static const value_string pcep_error_value_12_vals[] = {
714 {1, "Unsupported class-type"},
715 {2, "Invalid class-type"},
716 {3, "Class-type ans setup priority do not form a configured TE-class"},
717 {0, NULL}
720 /*Error values for error type 13*/
721 static const value_string pcep_error_value_13_vals[] = {
722 {1, "BRPC procedure not supported by one or more PCEs along the domain path"},
723 {0, NULL}
726 /*Error values for error type 15*/
727 static const value_string pcep_error_value_15_vals[] = {
728 {1, "Insufficient memory"},
729 {2, "Global concurrent optimization not supported"},
730 {0, NULL}
733 /*Error values for error type 16*/
734 static const value_string pcep_error_value_16_vals[] = {
735 {1, "The PCE cannot satisfy the request due to insufficient memory"},
736 {2, "The PCE is not capable of P2MP computation"},
737 {0, NULL}
740 /*Error values for error type 17*/
741 static const value_string pcep_error_value_17_vals[] = {
742 {1, "The PCE cannot satisfy the request due to no END-POINTS with leaf type 2"},
743 {2, "The PCE cannot satisfy the request due to no END-POINTS with leaf type 3"},
744 {3, "The PCE cannot satisfy the request due to no END-POINTS with leaf type 4"},
745 {4, "The PCE cannot satisfy the request due to inconsistent END-POINTS"},
746 {0, NULL}
749 /*Error values for error type 18*/
750 static const value_string pcep_error_value_18_vals[] = {
751 {1, "Fragmented request failure"},
752 {0, NULL}
755 static const value_string pcep_close_reason_obj_vals[] = {
756 {0, "Not defined" },
757 {NO_EXP_PROV, "No Explanation Provided" },
758 {DEADTIME_PROV, "Deadtime Expired" },
759 {RECEP_MALFORM_MSG, "Reception of a Malformed PCEP Message" },
760 {0, NULL }
763 static const value_string pcep_xro_attribute_obj_vals[] = {
764 {ATTR_INTERFACE, "Interface" },
765 {ATTR_NODE, "Node" },
766 {ATTR_SRLG, "SRLG" },
767 {0, NULL }
771 #define OBJ_HDR_LEN 4 /* length of object header */
773 static void
774 dissect_pcep_tlvs(proto_tree *pcep_obj, tvbuff_t *tvb, int offset, gint length, gint ett_pcep_obj)
776 proto_tree *tlv;
777 proto_item *ti;
778 guint16 tlv_length, tlv_type, of_code;
779 int i, j;
780 int padding = 0;
782 for (j = 0; j < length; j += 4 + tlv_length + padding){
783 tlv_type = tvb_get_ntohs(tvb, offset+j);
784 tlv_length = tvb_get_ntohs(tvb, offset + j + 2);
785 ti = proto_tree_add_text(pcep_obj, tvb, offset + j, tlv_length+4, "%s", val_to_str(tlv_type, pcep_tlvs_vals, "Unknown TLV (%u). "));
786 tlv = proto_item_add_subtree(ti, ett_pcep_obj);
787 proto_tree_add_item(tlv, hf_pcep_tlv_type, tvb, offset + j, 2, ENC_BIG_ENDIAN);
788 proto_tree_add_item(tlv, hf_pcep_tlv_length, tvb, offset + 2 + j, 2, ENC_BIG_ENDIAN);
789 switch (tlv_type)
791 case 1: /* NO-PATH TLV */
792 proto_tree_add_item(tlv, hf_pcep_no_path_tlvs_pce, tvb, offset+4+j, tlv_length, ENC_BIG_ENDIAN);
793 proto_tree_add_item(tlv, hf_pcep_no_path_tlvs_unk_dest, tvb, offset+4+j, tlv_length, ENC_BIG_ENDIAN);
794 proto_tree_add_item(tlv, hf_pcep_no_path_tlvs_unk_src, tvb, offset+4+j, tlv_length, ENC_BIG_ENDIAN);
795 break;
797 case 3: /* REQ-MISSING TLV */
798 proto_tree_add_item(tlv, hf_pcep_request_id, tvb, offset+4+j, tlv_length, ENC_BIG_ENDIAN);
799 break;
801 case 4: /* OF TLV */
802 for (i=0; i<tlv_length/2; i++) {
803 of_code = tvb_get_ntohs(tvb, offset+4+j+i*2);
804 proto_tree_add_uint_format(tlv, hf_pcep_of_code, tvb, offset+4+j+i*2, 2, of_code, "OF-Code #%d: %s (%u)",
805 i+1, val_to_str_const(of_code, pcep_of_vals, "Unknown"), of_code);
807 break;
809 default:
810 proto_tree_add_item(tlv, hf_pcep_tlv_data, tvb, offset+4+j, tlv_length, ENC_NA);
813 padding = (4 - (tlv_length % 4)) % 4;
814 if (padding != 0){
815 proto_tree_add_item(tlv, hf_pcep_tlv_padding, tvb, offset+4+j+tlv_length, padding, ENC_NA);
820 /*------------------------------------------------------------------------------
821 *SUBOBJECTS
822 *------------------------------------------------------------------------------*/
823 static void
824 dissect_subobj_ipv4(proto_tree *pcep_subobj_tree, packet_info *pinfo, tvbuff_t *tvb, int offset, int obj_class, gint ett_pcep_obj, guint length)
826 proto_tree *pcep_subobj_ipv4;
827 proto_tree *pcep_subobj_ipv4_flags;
828 proto_item *ti;
829 guint8 prefix_length;
831 ti = proto_tree_add_item(pcep_subobj_tree, hf_PCEPF_SUBOBJ_IPv4, tvb, offset, length, ENC_NA);
832 pcep_subobj_ipv4 = proto_item_add_subtree(ti, ett_pcep_obj);
834 if (length != 8) {
835 expert_add_info_format(pinfo, ti, &ei_pcep_subobject_bad_length, "Bad IPv4 subobject: length %u != 8", length);
836 return;
839 prefix_length = tvb_get_guint8(tvb, offset+6);
840 proto_item_append_text(ti, ": %s/%u", tvb_ip_to_str(tvb, offset+2),
841 prefix_length);
843 switch(obj_class){
845 case PCEP_EXPLICIT_ROUTE_OBJ:
846 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_l, tvb, offset, 1, ENC_NA);
847 proto_tree_add_item(pcep_subobj_ipv4, hf_PCEPF_SUBOBJ_7F, tvb, offset, 1, ENC_NA);
848 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_length, tvb, offset+1, 1, ENC_NA);
849 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_ipv4, tvb, offset+2, 4, ENC_BIG_ENDIAN);
850 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_prefix_length, tvb, offset+6, 1, ENC_NA);
851 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_padding, tvb, offset+7, 1, ENC_NA);
852 break;
854 case PCEP_RECORD_ROUTE_OBJ:
855 proto_tree_add_item(pcep_subobj_ipv4, hf_PCEPF_SUBOBJ, tvb, offset, 1, ENC_NA);
856 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_length, tvb, offset+1, 1, ENC_NA);
857 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_ipv4, tvb, offset+2, 4, ENC_BIG_ENDIAN);
858 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_prefix_length, tvb, offset+6, 1, ENC_NA);
859 ti = proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_flags, tvb, offset+7, 1, ENC_NA);
860 pcep_subobj_ipv4_flags = proto_item_add_subtree(ti, ett_pcep_obj);
861 proto_tree_add_item(pcep_subobj_ipv4_flags, pcep_subobj_flags_lpa, tvb, offset+7, 1, ENC_NA);
862 proto_tree_add_item(pcep_subobj_ipv4_flags, pcep_subobj_flags_lpu, tvb, offset+7, 1, ENC_NA);
863 break;
865 case PCEP_IRO_OBJ:
866 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_iro_ipv4_l, tvb, offset, 1, ENC_NA);
867 proto_tree_add_item(pcep_subobj_ipv4, hf_PCEPF_SUBOBJ_7F, tvb, offset, 1, ENC_NA);
868 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_length, tvb, offset+1, 1, ENC_NA);
869 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_ipv4, tvb, offset+2, 4, ENC_BIG_ENDIAN);
870 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_prefix_length, tvb, offset+6, 1, ENC_NA);
871 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_padding, tvb, offset+7, 1, ENC_NA);
872 break;
874 case PCEP_XRO_OBJ:
875 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_x, tvb, offset, 1, ENC_NA);
876 proto_tree_add_item(pcep_subobj_ipv4, hf_PCEPF_SUBOBJ_XRO, tvb, offset, 1, ENC_NA);
877 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_length, tvb, offset+1, 1, ENC_NA);
878 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_ipv4, tvb, offset+2, 4, ENC_BIG_ENDIAN);
879 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_prefix_length, tvb, offset+6, 1, ENC_NA);
880 proto_tree_add_item(pcep_subobj_ipv4, hf_pcep_subobj_ipv4_attribute, tvb, offset+7, 1, ENC_NA);
881 break;
883 default:
884 expert_add_info_format(pinfo, ti, &ei_pcep_non_defined_subobject, "Non defined subobject for this object");
885 break;
889 static void
890 dissect_subobj_ipv6(proto_tree *pcep_subobj_tree, packet_info *pinfo, tvbuff_t *tvb, int offset, int obj_class, gint ett_pcep_obj, guint length)
892 proto_tree *pcep_subobj_ipv6;
893 proto_tree *pcep_subobj_ipv6_flags;
894 proto_item *ti;
895 guint8 prefix_length;
897 ti = proto_tree_add_item(pcep_subobj_tree, hf_PCEPF_SUBOBJ_IPv6, tvb, offset, length, ENC_NA);
898 pcep_subobj_ipv6 = proto_item_add_subtree(ti, ett_pcep_obj);
900 if (length != 20) {
901 expert_add_info_format(pinfo, ti, &ei_pcep_subobject_bad_length, "Bad IPv6 subobject: length %u != 20", length);
902 return;
905 prefix_length = tvb_get_guint8(tvb, offset+18);
906 proto_item_append_text(ti, ": %s/%u", tvb_ip6_to_str(tvb, offset+2),
907 prefix_length);
909 switch(obj_class){
910 case PCEP_EXPLICIT_ROUTE_OBJ:
911 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_l, tvb, offset, 1, ENC_NA);
912 proto_tree_add_item(pcep_subobj_ipv6, hf_PCEPF_SUBOBJ_7F, tvb, offset, 1, ENC_NA);
913 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_length, tvb, offset+1, 1, ENC_NA);
914 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_ipv6, tvb, offset+2, 16, ENC_NA);
915 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_prefix_length, tvb, offset+18, 1, ENC_NA);
916 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_padding, tvb, offset+19, 1, ENC_NA);
917 break;
919 case PCEP_RECORD_ROUTE_OBJ:
920 proto_tree_add_item(pcep_subobj_ipv6, hf_PCEPF_SUBOBJ, tvb, offset, 1, ENC_NA);
921 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_length, tvb, offset+1, 1, ENC_NA);
922 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_ipv6, tvb, offset+2, 16, ENC_NA);
923 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_prefix_length, tvb, offset+18, 1, ENC_NA);
924 ti = proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_flags, tvb, offset+19, 1, ENC_NA);
925 pcep_subobj_ipv6_flags = proto_item_add_subtree(ti, ett_pcep_obj);
926 proto_tree_add_item(pcep_subobj_ipv6_flags, pcep_subobj_flags_lpa, tvb, offset+19, 1, ENC_NA);
927 proto_tree_add_item(pcep_subobj_ipv6_flags, pcep_subobj_flags_lpu, tvb, offset+19, 1, ENC_NA);
928 break;
930 case PCEP_IRO_OBJ:
931 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_iro_ipv6_l, tvb, offset, 1, ENC_NA);
932 proto_tree_add_item(pcep_subobj_ipv6, hf_PCEPF_SUBOBJ_7F, tvb, offset, 1, ENC_NA);
933 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_length, tvb, offset+1, 1, ENC_NA);
934 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_ipv6, tvb, offset+2, 16, ENC_NA);
935 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_prefix_length, tvb, offset+18, 1, ENC_NA);
936 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_padding, tvb, offset+19, 1, ENC_NA);
937 break;
939 case PCEP_XRO_OBJ:
940 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_x, tvb, offset, 1, ENC_NA);
941 proto_tree_add_item(pcep_subobj_ipv6, hf_PCEPF_SUBOBJ_XRO, tvb, offset, 1, ENC_NA);
942 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_length, tvb, offset+1, 1, ENC_NA);
943 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_ipv6, tvb, offset+2, 16, ENC_NA);
944 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_prefix_length, tvb, offset+18, 1, ENC_NA);
945 proto_tree_add_item(pcep_subobj_ipv6, hf_pcep_subobj_ipv6_attribute, tvb, offset+19, 1, ENC_NA);
946 break;
948 default:
949 expert_add_info_format(pinfo, ti, &ei_pcep_non_defined_subobject, "Non defined subobject for this object");
950 break;
955 static void
956 dissect_subobj_label_control(proto_tree *pcep_subobj_tree, packet_info *pinfo, tvbuff_t *tvb, int offset, int obj_class, gint ett_pcep_obj, guint length)
958 proto_tree *pcep_subobj_label_control;
959 proto_tree *pcep_subobj_label_flags;
960 proto_item *ti;
962 ti = proto_tree_add_item(pcep_subobj_tree, hf_PCEPF_SUBOBJ_LABEL_CONTROL, tvb, offset, length, ENC_NA);
963 pcep_subobj_label_control = proto_item_add_subtree(ti, ett_pcep_obj);
965 if (length < 5) {
966 expert_add_info_format(pinfo, ti, &ei_pcep_subobject_bad_length, "Bad label control subobject: length %u < 5", length);
967 return;
970 switch(obj_class){
972 case PCEP_EXPLICIT_ROUTE_OBJ:
973 proto_tree_add_item(pcep_subobj_label_control, hf_pcep_subobj_label_control_l, tvb, offset, 1, ENC_NA);
974 proto_tree_add_item(pcep_subobj_label_control, hf_PCEPF_SUBOBJ_7F, tvb, offset, 1, ENC_NA);
975 proto_tree_add_item(pcep_subobj_label_control, hf_pcep_subobj_label_control_length, tvb, offset+1, 1, ENC_NA);
976 proto_tree_add_item(pcep_subobj_label_control, hf_pcep_subobj_label_control_u, tvb, offset+2, 1, ENC_NA);
977 proto_tree_add_item(pcep_subobj_label_control, hf_pcep_subobj_label_control_reserved, tvb, offset+2, 1, ENC_NA);
978 proto_tree_add_item(pcep_subobj_label_control, hf_pcep_subobj_label_control_c_type, tvb, offset+3, 1, ENC_NA);
979 proto_tree_add_item(pcep_subobj_label_control, hf_pcep_subobj_label_control_label, tvb, offset+4, length-4, ENC_NA);
980 break;
982 case PCEP_RECORD_ROUTE_OBJ:
983 proto_tree_add_item(pcep_subobj_label_control, hf_PCEPF_SUBOBJ, tvb, offset, 1, ENC_NA);
984 proto_tree_add_item(pcep_subobj_label_control, hf_pcep_subobj_label_control_length, tvb, offset+1, 1, ENC_NA);
985 proto_tree_add_item(pcep_subobj_label_control, hf_pcep_subobj_label_control_u, tvb, offset+2, 1, ENC_NA);
987 ti = proto_tree_add_item(pcep_subobj_label_control, hf_pcep_subobj_label_control_flags, tvb, offset+2, 1, ENC_NA);
988 pcep_subobj_label_flags = proto_item_add_subtree(ti, ett_pcep_obj);
989 proto_tree_add_item(pcep_subobj_label_flags, pcep_subobj_label_flags_gl, tvb, offset+2, 1, ENC_NA);
990 proto_tree_add_item(pcep_subobj_label_control, hf_pcep_subobj_label_control_c_type, tvb, offset+3, 1, ENC_NA);
991 proto_tree_add_item(pcep_subobj_label_control, hf_pcep_subobj_label_control_label, tvb, offset+4, length-4, ENC_NA);
992 break;
994 default:
995 expert_add_info_format(pinfo, ti, &ei_pcep_non_defined_subobject, "Non defined subobject for this object");
996 break;
1000 static void
1001 dissect_subobj_unnumb_interfaceID(proto_tree *pcep_subobj_tree, packet_info *pinfo, tvbuff_t *tvb, int offset, int obj_class, gint ett_pcep_obj, guint length)
1003 proto_tree *pcep_subobj_unnumb_interfaceID;
1004 proto_tree *pcep_subobj_unnumb_interfaceID_flags;
1005 proto_item *ti;
1006 guint32 router_ID;
1007 guint32 interface_ID;
1008 guint16 reserved_flags;
1010 ti = proto_tree_add_item(pcep_subobj_tree, hf_PCEPF_SUBOBJ_UNNUM_INTERFACEID, tvb, offset, length, ENC_NA);
1011 pcep_subobj_unnumb_interfaceID = proto_item_add_subtree(ti, ett_pcep_obj);
1013 if (length != 12) {
1014 expert_add_info_format(pinfo, ti, &ei_pcep_subobject_bad_length, "Bad unnumbered interface ID subobject: length %u != 12", length);
1015 return;
1018 reserved_flags = tvb_get_ntohs(tvb, offset+2);
1019 router_ID = tvb_get_ipv4(tvb, offset+4);
1020 interface_ID = tvb_get_ntohl(tvb, offset+8);
1021 proto_item_append_text(ti, ": %s:%u", ip_to_str ((guint8 *) &router_ID),
1022 interface_ID);
1024 switch(obj_class){
1026 case PCEP_EXPLICIT_ROUTE_OBJ:
1027 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_pcep_subobj_unnumb_interfaceID_l, tvb, offset, 1, ENC_NA);
1028 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_PCEPF_SUBOBJ_7F, tvb, offset, 1, ENC_NA);
1029 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_pcep_subobj_unnumb_interfaceID_length, tvb, offset+1, 1, ENC_NA);
1030 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_pcep_subobj_unnumb_interfaceID_reserved, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1031 break;
1033 case PCEP_RECORD_ROUTE_OBJ:
1034 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_PCEPF_SUBOBJ, tvb, offset, 1, ENC_NA);
1035 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_pcep_subobj_unnumb_interfaceID_length, tvb, offset+1, 1, ENC_NA);
1037 ti = proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_pcep_subobj_unnumb_interfaceID_flags, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1038 pcep_subobj_unnumb_interfaceID_flags = proto_item_add_subtree(ti, ett_pcep_obj);
1039 proto_tree_add_boolean(pcep_subobj_unnumb_interfaceID_flags, pcep_subobj_flags_lpa, tvb, offset+2, 1, (reserved_flags & 0xff00)>>8);
1040 proto_tree_add_boolean(pcep_subobj_unnumb_interfaceID_flags, pcep_subobj_flags_lpu, tvb, offset+2, 1, (reserved_flags & 0xff00)>>8);
1042 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_pcep_subobj_unnumb_interfaceID_reserved_rrobj, tvb, offset+3, 1, ENC_NA);
1043 break;
1045 case PCEP_IRO_OBJ:
1046 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_pcep_subobj_iro_unnumb_interfaceID_l, tvb, offset, 1, ENC_NA);
1047 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_PCEPF_SUBOBJ_7F, tvb, offset, 1, ENC_NA);
1048 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_pcep_subobj_unnumb_interfaceID_length, tvb, offset+1, 1, ENC_NA);
1049 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_pcep_subobj_unnumb_interfaceID_reserved, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1050 break;
1052 case PCEP_XRO_OBJ:
1053 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_pcep_subobj_unnumb_interfaceID_x, tvb, offset, 1, ENC_NA);
1054 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_PCEPF_SUBOBJ_XRO, tvb, offset, 1, ENC_NA);
1055 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_pcep_subobj_unnumb_interfaceID_reserved_xroobj, tvb, offset+2, 1, ENC_NA);
1056 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_pcep_subobj_unnumb_interfaceID_attribute, tvb, offset+3, 1, ENC_NA);
1057 break;
1059 default:
1060 expert_add_info_format(pinfo, ti, &ei_pcep_non_defined_subobject, "Non defined subobject for this object");
1061 break;
1064 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_pcep_subobj_unnumb_interfaceID_router_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1065 proto_tree_add_item(pcep_subobj_unnumb_interfaceID, hf_pcep_subobj_unnumb_interfaceID_interface_id, tvb, offset+8, 4, ENC_BIG_ENDIAN);
1068 static void
1069 dissect_subobj_autonomous_sys_num(proto_tree *pcep_subobj_tree, packet_info *pinfo, tvbuff_t *tvb, int offset, int obj_class, guint ett_pcep_obj, guint length)
1071 proto_tree *pcep_subobj_autonomous_sys_num;
1072 proto_item *ti;
1074 if(obj_class == PCEP_XRO_OBJ){
1075 ti = proto_tree_add_item(pcep_subobj_tree, hf_PCEPF_SUBOBJ_AUTONOMOUS_SYS_NUM, tvb, offset, length, ENC_NA);
1076 pcep_subobj_autonomous_sys_num = proto_item_add_subtree(ti, ett_pcep_obj);
1077 if (length != 8) {
1078 expert_add_info_format(pinfo, ti, &ei_pcep_subobject_bad_length, "Bad autonomous system number subobject: length %u != 8", length);
1079 return;
1082 proto_tree_add_item(pcep_subobj_autonomous_sys_num, hf_pcep_subobj_autonomous_sys_num_x, tvb, offset, 1, ENC_NA);
1083 proto_tree_add_item(pcep_subobj_autonomous_sys_num, hf_PCEPF_SUBOBJ_XRO, tvb, offset, 1, ENC_NA);
1084 proto_tree_add_item(pcep_subobj_autonomous_sys_num, hf_pcep_subobj_autonomous_sys_num_length, tvb, offset+1, 1, ENC_NA);
1086 proto_tree_add_item(pcep_subobj_autonomous_sys_num, hf_pcep_subobj_autonomous_sys_num_reserved, tvb, offset+2, 1, ENC_NA);
1087 proto_tree_add_item(pcep_subobj_autonomous_sys_num, hf_pcep_subobj_autonomous_sys_num_attribute, tvb, offset+3, 1, ENC_NA);
1088 proto_tree_add_item(pcep_subobj_autonomous_sys_num, hf_pcep_subobj_autonomous_sys_num_optional_as_number_high_octets, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1089 proto_tree_add_item(pcep_subobj_autonomous_sys_num, hf_pcep_subobj_autonomous_sys_num_as_number, tvb, offset+6, 2, ENC_BIG_ENDIAN);
1090 } else {
1091 ti = proto_tree_add_item(pcep_subobj_tree, hf_PCEPF_SUBOBJ_AUTONOMOUS_SYS_NUM, tvb, offset, length, ENC_NA);
1092 pcep_subobj_autonomous_sys_num = proto_item_add_subtree(ti, ett_pcep_obj);
1094 if (length != 4) {
1095 expert_add_info_format(pinfo, ti, &ei_pcep_subobject_bad_length, "Bad autonomous system number subobject: length %u != 4", length);
1096 return;
1099 if(obj_class == PCEP_IRO_OBJ)
1100 proto_tree_add_item(pcep_subobj_autonomous_sys_num, hf_pcep_subobj_iro_autonomous_sys_num_l, tvb, offset, 1, ENC_NA);
1101 else
1102 proto_tree_add_item(pcep_subobj_autonomous_sys_num, hf_pcep_subobj_autonomous_sys_num_l, tvb, offset, 1, ENC_NA);
1103 proto_tree_add_item(pcep_subobj_autonomous_sys_num, hf_PCEPF_SUBOBJ_7F, tvb, offset, 1, ENC_NA);
1104 proto_tree_add_item(pcep_subobj_autonomous_sys_num, hf_pcep_subobj_autonomous_sys_num_length, tvb, offset+1, 1, ENC_NA);
1105 proto_tree_add_item(pcep_subobj_autonomous_sys_num, hf_pcep_subobj_autonomous_sys_num_as_number, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1109 static void
1110 dissect_subobj_srlg(proto_tree *pcep_subobj_tree, packet_info *pinfo, tvbuff_t *tvb, int offset, guint ett_pcep_obj, guint length)
1112 proto_tree *pcep_subobj_srlg;
1113 proto_item *ti;
1115 ti = proto_tree_add_item(pcep_subobj_tree, hf_PCEPF_SUBOBJ_SRLG, tvb, offset, length, ENC_NA);
1116 pcep_subobj_srlg = proto_item_add_subtree(ti, ett_pcep_obj);
1118 if (length != 8) {
1119 expert_add_info_format(pinfo, ti, &ei_pcep_subobject_bad_length, "Bad SRLG subobject: length %u != 8", length);
1120 return;
1123 proto_tree_add_item(pcep_subobj_srlg, hf_pcep_subobj_srlg_x, tvb, offset, 1, ENC_NA);
1124 proto_tree_add_item(pcep_subobj_srlg, hf_PCEPF_SUBOBJ_XRO, tvb, offset, 1, ENC_NA);
1125 proto_tree_add_item(pcep_subobj_srlg, hf_pcep_subobj_srlg_length, tvb, offset+1, 1, ENC_NA);
1127 proto_tree_add_item(pcep_subobj_srlg, hf_pcep_subobj_srlg_id, tvb, offset+2, 4, ENC_BIG_ENDIAN);
1128 proto_tree_add_item(pcep_subobj_srlg, hf_pcep_subobj_srlg_reserved, tvb, offset+6, 1, ENC_NA);
1129 proto_tree_add_item(pcep_subobj_srlg, hf_pcep_subobj_srlg_attribute, tvb, offset+7, 1, ENC_NA);
1132 static void
1133 dissect_subobj_exrs(proto_tree *pcep_subobj_tree, packet_info *pinfo, tvbuff_t *tvb, int offset, int obj_class, guint ett_pcep_obj, guint type_iro, guint length)
1135 proto_tree *pcep_subobj_exrs;
1136 proto_item *ti;
1137 guint8 l_type;
1138 guint8 length2;
1139 guint type_exrs;
1140 guint offset_exrs = 0;
1142 ti = proto_tree_add_item(pcep_subobj_tree, hf_PCEPF_SUBOBJ_EXRS, tvb, offset, length, ENC_NA);
1143 pcep_subobj_exrs = proto_item_add_subtree(ti, ett_pcep_obj);
1145 if (length < 4) {
1146 expert_add_info_format(pinfo, ti, &ei_pcep_subobject_bad_length, "Bad EXRS subobject: length %u < 4", length);
1147 return;
1150 proto_tree_add_item(pcep_subobj_exrs, hf_pcep_subobj_exrs_l, tvb, offset, 1, ENC_NA);
1151 proto_tree_add_item(pcep_subobj_exrs, hf_pcep_subobj_exrs_type, tvb, offset, 1, ENC_NA);
1152 proto_tree_add_item(pcep_subobj_exrs, hf_pcep_subobj_exrs_length, tvb, offset+1, 1, ENC_NA);
1154 proto_tree_add_item(pcep_subobj_exrs, hf_pcep_subobj_exrs_reserved, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1156 offset += 4;
1158 while(offset_exrs<length-4){
1160 l_type = tvb_get_guint8(tvb, offset);
1161 length2 = tvb_get_guint8(tvb, offset+1);
1163 if (length2 < 2) {
1164 expert_add_info_format(pinfo, ti, &ei_pcep_subobject_bad_length, "Bad packet: subobject length %u < 2", length2);
1165 break;
1168 type_exrs = (l_type & Mask_Type);
1170 if(type_iro==PCEP_SUB_EXRS)
1171 obj_class = PCEP_XRO_OBJ;
1173 switch(type_exrs) {
1175 case PCEP_SUB_IPv4:
1176 dissect_subobj_ipv4(pcep_subobj_exrs, pinfo, tvb, offset, obj_class, ett_pcep_obj, length2);
1177 break;
1178 case PCEP_SUB_IPv6:
1179 dissect_subobj_ipv6(pcep_subobj_exrs, pinfo, tvb, offset, obj_class, ett_pcep_obj, length2);
1180 break;
1181 case PCEP_SUB_UNNUMB_INTERFACE_ID:
1182 dissect_subobj_unnumb_interfaceID(pcep_subobj_exrs, pinfo, tvb, offset, obj_class, ett_pcep_obj, length2);
1183 break;
1184 case PCEP_SUB_AUTONOMOUS_SYS_NUM:
1185 dissect_subobj_autonomous_sys_num(pcep_subobj_exrs, pinfo, tvb, offset, obj_class, ett_pcep_obj, length2);
1186 break;
1187 case PCEP_SUB_SRLG:
1188 dissect_subobj_srlg(pcep_subobj_exrs, pinfo, tvb, offset, ett_pcep_obj, length2);
1189 break;
1190 default:
1191 proto_tree_add_expert_format(pcep_subobj_exrs, pinfo, &ei_pcep_non_defined_subobject, tvb, offset+2, length-2, "Non defined subobject (%d)", type_exrs);
1192 break;
1194 offset_exrs += length2;
1195 offset += length2;
1199 static void
1200 dissect_subobj_pksv4(proto_tree *pcep_subobj_tree, packet_info *pinfo, tvbuff_t *tvb, int offset, gint ett_pcep_obj, guint length)
1202 proto_tree *pcep_subobj_pksv4;
1203 proto_item *ti;
1204 guint16 path_key;
1206 ti = proto_tree_add_item(pcep_subobj_tree, hf_PCEPF_SUBOBJ_PKSv4, tvb, offset, length, ENC_NA);
1207 pcep_subobj_pksv4 = proto_item_add_subtree(ti, ett_pcep_obj);
1209 if (length != 8) {
1210 expert_add_info_format(pinfo, ti, &ei_pcep_subobject_bad_length, "Bad path key subobject: length %u != 8", length);
1211 return;
1214 path_key = tvb_get_ntohs(tvb, offset+2);
1215 proto_item_append_text(ti, ": %s, Path Key %u", tvb_ip_to_str(tvb, offset+4), path_key);
1216 proto_tree_add_item(pcep_subobj_pksv4, hf_pcep_subobj_pksv4_l, tvb, offset, 1, ENC_NA);
1217 proto_tree_add_item(pcep_subobj_pksv4, hf_PCEPF_SUBOBJ_7F, tvb, offset, 1, ENC_NA);
1218 proto_tree_add_item(pcep_subobj_pksv4, hf_pcep_subobj_pksv4_length, tvb, offset+1, 1, ENC_NA);
1219 proto_tree_add_item(pcep_subobj_pksv4, hf_pcep_subobj_pksv4_path_key, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1220 proto_tree_add_item(pcep_subobj_pksv4, hf_pcep_subobj_pksv4_pce_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1223 static void
1224 dissect_subobj_pksv6(proto_tree *pcep_subobj_tree, packet_info *pinfo, tvbuff_t *tvb, int offset, gint ett_pcep_obj, guint length)
1226 proto_tree *pcep_subobj_pksv6;
1227 proto_item *ti;
1228 guint16 path_key;
1230 ti = proto_tree_add_item(pcep_subobj_tree, hf_PCEPF_SUBOBJ_PKSv6, tvb, offset, length, ENC_NA);
1231 pcep_subobj_pksv6 = proto_item_add_subtree(ti, ett_pcep_obj);
1233 if (length != 20) {
1234 expert_add_info_format(pinfo, ti, &ei_pcep_subobject_bad_length, "Bad path key subobject: length %u != 20", length);
1235 return;
1238 path_key = tvb_get_ntohs(tvb, offset+2);
1239 proto_item_append_text(ti, ": %s, Path Key %u", tvb_ip6_to_str(tvb, offset+4), path_key);
1241 proto_tree_add_item(pcep_subobj_pksv6, hf_pcep_subobj_pksv6_l, tvb, offset, 1, ENC_NA);
1242 proto_tree_add_item(pcep_subobj_pksv6, hf_PCEPF_SUBOBJ_7F, tvb, offset, 1, ENC_NA);
1243 proto_tree_add_item(pcep_subobj_pksv6, hf_pcep_subobj_pksv6_length, tvb, offset+1, 1, ENC_NA);
1244 proto_tree_add_item(pcep_subobj_pksv6, hf_pcep_subobj_pksv6_path_key, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1245 proto_tree_add_item(pcep_subobj_pksv6, hf_pcep_subobj_pksv6_pce_id, tvb, offset+4, 4, ENC_NA);
1248 /*------------------------------------------------------------------------------
1249 * OPEN OBJECT
1250 *------------------------------------------------------------------------------*/
1251 #define OPEN_OBJ_MIN_LEN 4
1253 static void
1254 dissect_pcep_open_obj (proto_tree *pcep_object_tree, packet_info *pinfo, tvbuff_t *tvb, int offset2, int obj_length)
1256 proto_tree *pcep_open_obj_flags;
1257 proto_item *ti;
1259 if (obj_length < OBJ_HDR_LEN+OPEN_OBJ_MIN_LEN) {
1260 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad OPEN object length %u, should be >= %u", obj_length, OBJ_HDR_LEN+OPEN_OBJ_MIN_LEN);
1261 return;
1264 proto_tree_add_item(pcep_object_tree, hf_pcep_open_obj_pcep_version, tvb, offset2, 1, ENC_NA);
1266 ti = proto_tree_add_item(pcep_object_tree, hf_pcep_open_obj_flags, tvb, offset2, 1, ENC_NA);
1267 pcep_open_obj_flags = proto_item_add_subtree(ti, ett_pcep_obj_open);
1268 proto_tree_add_item(pcep_open_obj_flags, hf_pcep_open_flags_res, tvb, offset2, 1, ENC_NA);
1270 proto_tree_add_item(pcep_object_tree, hf_pcep_open_obj_keepalive, tvb, offset2+1, 1, ENC_NA);
1271 proto_tree_add_item(pcep_object_tree, hf_pcep_open_obj_deadtime, tvb, offset2+2, 1, ENC_NA);
1272 proto_tree_add_item(pcep_object_tree, hf_pcep_open_obj_sid, tvb, offset2+3, 1, ENC_NA);
1274 /*it's suppose that obj_length is a valid date. The object can have optional TLV(s)*/
1275 offset2 += OPEN_OBJ_MIN_LEN;
1276 obj_length -= OBJ_HDR_LEN+OPEN_OBJ_MIN_LEN;
1277 dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_open);
1280 /*------------------------------------------------------------------------------
1281 * RP OBJECT
1282 *------------------------------------------------------------------------------*/
1283 #define RP_OBJ_MIN_LEN 8
1285 static void
1286 dissect_pcep_rp_obj(proto_tree *pcep_object_tree, packet_info *pinfo,
1287 tvbuff_t *tvb, int offset2, int obj_length)
1289 proto_tree *pcep_rp_obj_flags;
1290 proto_item *ti;
1292 if (obj_length < OBJ_HDR_LEN+RP_OBJ_MIN_LEN) {
1293 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad RP object length %u, should be >= %u", obj_length, OBJ_HDR_LEN+RP_OBJ_MIN_LEN);
1294 return;
1297 proto_tree_add_item(pcep_object_tree, hf_pcep_rp_obj_reserved, tvb, offset2, 1, ENC_NA);
1299 ti = proto_tree_add_item(pcep_object_tree, hf_pcep_rp_obj_flags, tvb, offset2+1, 3, ENC_BIG_ENDIAN);
1300 pcep_rp_obj_flags = proto_item_add_subtree(ti, ett_pcep_obj_request_parameters);
1302 proto_tree_add_item(pcep_rp_obj_flags, hf_pcep_rp_flags_reserved, tvb, offset2+1, 3, ENC_BIG_ENDIAN);
1303 proto_tree_add_item(pcep_rp_obj_flags, hf_pcep_rp_flags_f, tvb, offset2+1, 3, ENC_BIG_ENDIAN);
1304 proto_tree_add_item(pcep_rp_obj_flags, hf_pcep_rp_flags_n, tvb, offset2+1, 3, ENC_BIG_ENDIAN);
1305 proto_tree_add_item(pcep_rp_obj_flags, hf_pcep_rp_flags_e, tvb, offset2+1, 3, ENC_BIG_ENDIAN);
1306 proto_tree_add_item(pcep_rp_obj_flags, hf_pcep_rp_flags_m, tvb, offset2+1, 3, ENC_BIG_ENDIAN);
1307 proto_tree_add_item(pcep_rp_obj_flags, hf_pcep_rp_flags_d, tvb, offset2+1, 3, ENC_BIG_ENDIAN);
1308 proto_tree_add_item(pcep_rp_obj_flags, hf_pcep_rp_flags_p, tvb, offset2+1, 3, ENC_BIG_ENDIAN);
1309 proto_tree_add_item(pcep_rp_obj_flags, hf_pcep_rp_flags_s, tvb, offset2+1, 3, ENC_BIG_ENDIAN);
1310 proto_tree_add_item(pcep_rp_obj_flags, hf_pcep_rp_flags_v, tvb, offset2+1, 3, ENC_BIG_ENDIAN);
1311 proto_tree_add_item(pcep_rp_obj_flags, hf_pcep_rp_flags_o, tvb, offset2+1, 3, ENC_BIG_ENDIAN);
1312 proto_tree_add_item(pcep_rp_obj_flags, hf_pcep_rp_flags_b, tvb, offset2+1, 3, ENC_BIG_ENDIAN);
1313 proto_tree_add_item(pcep_rp_obj_flags, hf_pcep_rp_flags_r, tvb, offset2+1, 3, ENC_BIG_ENDIAN);
1314 proto_tree_add_item(pcep_rp_obj_flags, hf_pcep_rp_flags_pri, tvb, offset2+1, 3, ENC_BIG_ENDIAN);
1316 proto_tree_add_item(pcep_object_tree, hf_pcep_rp_obj_requested_id_number, tvb, offset2+4, 4, ENC_BIG_ENDIAN);
1318 /*it's suppose that obj_length is a valid date. The object can have optional TLV(s)*/
1319 offset2 += RP_OBJ_MIN_LEN;
1320 obj_length -= OBJ_HDR_LEN+RP_OBJ_MIN_LEN;
1321 dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_request_parameters);
1324 /*------------------------------------------------------------------------------
1325 * NO PATH OBJECT
1326 *------------------------------------------------------------------------------*/
1327 #define NO_PATH_OBJ_MIN_LEN 4
1329 static void
1330 dissect_pcep_no_path_obj(proto_tree *pcep_object_tree, packet_info *pinfo,
1331 tvbuff_t *tvb, int offset2, int obj_length)
1333 proto_tree *pcep_no_path_obj_flags;
1334 proto_item *ti;
1336 if (obj_length < OBJ_HDR_LEN+NO_PATH_OBJ_MIN_LEN) {
1337 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad NO-PATH object length %u, should be >= %u", obj_length, OBJ_HDR_LEN+NO_PATH_OBJ_MIN_LEN);
1338 return;
1341 proto_tree_add_item(pcep_object_tree, hf_pcep_no_path_obj_nature_of_issue, tvb, offset2, 1, ENC_NA);
1343 ti = proto_tree_add_item(pcep_object_tree, hf_pcep_no_path_obj_flags, tvb, offset2+1, 2, ENC_BIG_ENDIAN);
1344 pcep_no_path_obj_flags = proto_item_add_subtree(ti, ett_pcep_obj_no_path);
1345 proto_tree_add_item(pcep_no_path_obj_flags, hf_pcep_no_path_flags_c, tvb, offset2+1, 2, ENC_BIG_ENDIAN);
1347 proto_tree_add_item(pcep_object_tree, hf_pcep_no_path_obj_reserved, tvb, offset2+3, 1, ENC_NA);
1349 /*it's suppose that obj_length is a valid date. The object can have optional TLV(s)*/
1350 offset2 += NO_PATH_OBJ_MIN_LEN;
1351 obj_length -= OBJ_HDR_LEN+NO_PATH_OBJ_MIN_LEN;
1352 dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_no_path);
1355 /*------------------------------------------------------------------------------
1356 * END POINT OBJECT
1357 *------------------------------------------------------------------------------*/
1358 #define END_POINT_IPV4_OBJ_LEN 8
1359 #define END_POINT_IPV6_OBJ_LEN 32
1361 static void
1362 dissect_pcep_end_point_obj(proto_tree *pcep_object_tree, packet_info *pinfo,
1363 tvbuff_t *tvb, int offset2, int obj_length, int type)
1365 switch(type)
1367 case IPv4:
1368 if (obj_length != OBJ_HDR_LEN+END_POINT_IPV4_OBJ_LEN) {
1369 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad IPv4 END-POINTS object length %u, should be %u", obj_length, OBJ_HDR_LEN+END_POINT_IPV4_OBJ_LEN);
1370 return;
1373 proto_tree_add_item(pcep_object_tree, hf_pcep_end_point_obj_source_ipv4_address, tvb, offset2, 4, ENC_BIG_ENDIAN);
1374 proto_tree_add_item(pcep_object_tree, hf_pcep_end_point_obj_destination_ipv4_address, tvb, offset2+4, 4, ENC_BIG_ENDIAN);
1375 break;
1377 case IPv6:
1378 if (obj_length != OBJ_HDR_LEN+END_POINT_IPV6_OBJ_LEN) {
1379 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad IPv6 END-POINTS object length %u, should be %u", obj_length, OBJ_HDR_LEN+END_POINT_IPV6_OBJ_LEN);
1380 return;
1383 proto_tree_add_item(pcep_object_tree, hf_pcep_end_point_obj_source_ipv6_address, tvb, offset2, 16, ENC_NA);
1384 proto_tree_add_item(pcep_object_tree, hf_pcep_end_point_obj_destination_ipv6_address, tvb, offset2+16, 16, ENC_NA);
1385 break;
1387 default:
1388 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_unknown_type_object, tvb, offset2, obj_length-OBJ_HDR_LEN, "UNKNOWN Type Object (%u)", type);
1389 break;
1395 /*------------------------------------------------------------------------------
1396 * BANDWIDTH OBJECT
1397 *------------------------------------------------------------------------------*/
1398 #define BANDWIDTH_OBJ_LEN 4
1400 static void
1401 dissect_pcep_bandwidth_obj(proto_tree *pcep_object_tree, packet_info *pinfo, tvbuff_t *tvb, int offset2, int obj_length)
1403 if (obj_length != OBJ_HDR_LEN+BANDWIDTH_OBJ_LEN) {
1404 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad BANDWIDTH object length %u, should be %u", obj_length, OBJ_HDR_LEN+BANDWIDTH_OBJ_LEN);
1405 return;
1408 proto_tree_add_item(pcep_object_tree, hf_pcep_bandwidth, tvb, offset2, 4, ENC_BIG_ENDIAN);
1411 /*------------------------------------------------------------------------------
1412 * METRIC OBJECT
1413 *------------------------------------------------------------------------------*/
1414 #define METRIC_OBJ_LEN 8
1416 static void
1417 dissect_pcep_metric_obj(proto_tree *pcep_object_tree, packet_info *pinfo,
1418 tvbuff_t *tvb, int offset2, int obj_length)
1420 proto_tree *pcep_metric_obj_flags;
1421 proto_item *ti;
1423 if (obj_length != OBJ_HDR_LEN+METRIC_OBJ_LEN) {
1424 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad METRIC object length %u, should be %u", obj_length, OBJ_HDR_LEN+METRIC_OBJ_LEN);
1425 return;
1428 proto_tree_add_item(pcep_object_tree, hf_pcep_metric_obj_reserved, tvb, offset2, 2, ENC_BIG_ENDIAN);
1430 ti = proto_tree_add_item(pcep_object_tree, hf_pcep_metric_obj_flags, tvb, offset2+2, 1, ENC_NA);
1431 pcep_metric_obj_flags = proto_item_add_subtree(ti, ett_pcep_obj_metric);
1432 proto_tree_add_item(pcep_metric_obj_flags, hf_pcep_metric_flags_c, tvb, offset2+2, 1, ENC_NA);
1433 proto_tree_add_item(pcep_metric_obj_flags, hf_pcep_metric_flags_b, tvb, offset2+2, 1, ENC_NA);
1435 proto_tree_add_item(pcep_object_tree, hf_pcep_metric_obj_type, tvb, offset2+3, 1, ENC_NA);
1436 proto_tree_add_item(pcep_object_tree, hf_pcep_metric_obj_metric_value, tvb, offset2+4, 4, ENC_BIG_ENDIAN);
1439 /*------------------------------------------------------------------------------
1440 * EXPLICIT ROUTE OBJECT (ERO)
1441 *------------------------------------------------------------------------------*/
1442 static void
1443 dissect_pcep_explicit_route_obj(proto_tree *pcep_object_tree, packet_info *pinfo,
1444 tvbuff_t *tvb, int offset2, int obj_length, int obj_class)
1446 guint8 l_type;
1447 guint8 length;
1448 guint type_exp_route;
1449 guint body_obj_len;
1451 body_obj_len = obj_length - OBJ_HDR_LEN;
1453 while(body_obj_len){
1454 if (body_obj_len < 2) {
1455 expert_add_info_format(pinfo, pcep_object_tree, &ei_pcep_subobject_bad_length, "Bad ERO object: subobject goes past end of object");
1456 break;
1459 l_type = tvb_get_guint8(tvb, offset2);
1460 length = tvb_get_guint8(tvb, offset2+1);
1462 if (length < 2) {
1463 expert_add_info_format(pinfo, pcep_object_tree, &ei_pcep_subobject_bad_length, "Bad ERO object: subobject length %u < 2", length);
1464 break;
1467 type_exp_route = (l_type & Mask_Type);
1468 if (body_obj_len <length) {
1469 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, length, "Bad ERO object: subobject length %u > remaining length %u", length, body_obj_len);
1470 break;
1473 switch(type_exp_route) {
1475 case PCEP_SUB_IPv4:
1476 dissect_subobj_ipv4(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_explicit_route, length);
1477 break;
1478 case PCEP_SUB_IPv6:
1479 dissect_subobj_ipv6(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_explicit_route, length);
1480 break;
1481 case PCEP_SUB_LABEL_CONTROL:
1482 dissect_subobj_label_control(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_explicit_route, length);
1483 break;
1484 case PCEP_SUB_UNNUMB_INTERFACE_ID:
1485 dissect_subobj_unnumb_interfaceID(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_explicit_route, length);
1486 break;
1487 case PCEP_SUB_AUTONOMOUS_SYS_NUM:
1488 dissect_subobj_autonomous_sys_num(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_explicit_route, length);
1489 break;
1490 case PCEP_SUB_PKSv4:
1491 dissect_subobj_pksv4(pcep_object_tree, pinfo, tvb, offset2, ett_pcep_obj_explicit_route, length);
1492 break;
1493 default:
1494 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_non_defined_subobject, tvb, offset2, length, "Non defined subobject (%d)", type_exp_route);
1495 break;
1497 offset2 += length;
1498 body_obj_len -= length;
1502 /*------------------------------------------------------------------------------
1503 * RECORD ROUTE OBJECT (RRO)
1504 *------------------------------------------------------------------------------*/
1505 static void
1506 dissect_pcep_record_route_obj(proto_tree *pcep_object_tree, packet_info *pinfo, tvbuff_t *tvb, int offset2, int obj_length, int obj_class)
1508 guint8 type;
1509 guint8 length;
1510 guint body_obj_len;
1512 body_obj_len = obj_length - OBJ_HDR_LEN;
1514 while(body_obj_len){
1515 if (body_obj_len < 2) {
1516 expert_add_info_format(pinfo, pcep_object_tree, &ei_pcep_subobject_bad_length, "Bad RRO object: subobject goes past end of object");
1517 break;
1520 type = tvb_get_guint8(tvb, offset2);
1521 length = tvb_get_guint8(tvb, offset2+1);
1523 if (length < 2) {
1524 expert_add_info_format(pinfo, pcep_object_tree, &ei_pcep_subobject_bad_length, "Bad RRO object: subobject length %u < 2", length);
1525 break;
1528 if (body_obj_len <length) {
1529 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, length, "Bad RRO subobject: subobject length %u > remaining length %u", length, body_obj_len);
1530 break;
1533 switch(type) {
1535 case PCEP_SUB_IPv4:
1536 dissect_subobj_ipv4(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_record_route, length);
1537 break;
1538 case PCEP_SUB_IPv6:
1539 dissect_subobj_ipv6(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_record_route, length);
1540 break;
1541 case PCEP_SUB_LABEL_CONTROL:
1542 dissect_subobj_label_control(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_record_route, length);
1543 break;
1544 case PCEP_SUB_UNNUMB_INTERFACE_ID:
1545 dissect_subobj_unnumb_interfaceID(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_record_route, length);
1546 break;
1547 default:
1548 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_non_defined_subobject, tvb, offset2, length, "Non defined subobject (%d)", type);
1549 break;
1551 offset2 += length;
1552 body_obj_len -= length;
1556 /*------------------------------------------------------------------------------
1557 * LSPA OBJECT
1558 *------------------------------------------------------------------------------*/
1559 #define LSPA_OBJ_MIN_LEN 16
1561 static void
1562 dissect_pcep_lspa_obj(proto_tree *pcep_object_tree, packet_info *pinfo, tvbuff_t *tvb, int offset2, int obj_length)
1564 proto_tree *pcep_lspa_obj_flags;
1565 proto_item *ti;
1567 if (obj_length < OBJ_HDR_LEN+LSPA_OBJ_MIN_LEN) {
1568 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad LSPA object length %u, should be >= %u", obj_length, OBJ_HDR_LEN+LSPA_OBJ_MIN_LEN);
1569 return;
1572 proto_tree_add_item(pcep_object_tree, hf_pcep_lspa_obj_exclude_any, tvb, offset2, 4, ENC_BIG_ENDIAN);
1573 proto_tree_add_item(pcep_object_tree, hf_pcep_lspa_obj_include_any, tvb, offset2+4, 4, ENC_BIG_ENDIAN);
1574 proto_tree_add_item(pcep_object_tree, hf_pcep_lspa_obj_include_all, tvb, offset2+8, 4, ENC_BIG_ENDIAN);
1575 proto_tree_add_item(pcep_object_tree, hf_pcep_lspa_obj_setup_priority, tvb, offset2+12, 1, ENC_NA);
1576 proto_tree_add_item(pcep_object_tree, hf_pcep_lspa_obj_holding_priority, tvb, offset2+13, 1, ENC_NA);
1578 ti = proto_tree_add_item(pcep_object_tree, hf_pcep_lspa_obj_flags, tvb, offset2+14, 1, ENC_NA);
1579 pcep_lspa_obj_flags = proto_item_add_subtree(ti, ett_pcep_obj_metric);
1580 proto_tree_add_item(pcep_lspa_obj_flags, hf_pcep_lspa_flags_l, tvb, offset2+14, 1, ENC_NA);
1582 proto_tree_add_item(pcep_object_tree, hf_pcep_lspa_obj_reserved, tvb, offset2+15, 1, ENC_NA);
1584 /*it's suppose that obj_length is a valid date. The object can have optional TLV(s)*/
1585 offset2 += LSPA_OBJ_MIN_LEN;
1586 obj_length -= OBJ_HDR_LEN+LSPA_OBJ_MIN_LEN;
1587 dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_lspa);
1590 /*------------------------------------------------------------------------------
1591 * INCLUDE ROUTE OBJECT (IRO)
1592 *------------------------------------------------------------------------------*/
1593 static void
1594 dissect_pcep_iro_obj(proto_tree *pcep_object_tree, packet_info *pinfo,
1595 tvbuff_t *tvb, int offset2, int obj_length, int obj_class)
1597 guint8 l_type;
1598 guint8 length;
1599 int type_iro;
1600 guint body_obj_len;
1602 body_obj_len = obj_length - OBJ_HDR_LEN;
1604 while(body_obj_len){
1605 if (body_obj_len < 2) {
1606 expert_add_info_format(pinfo, pcep_object_tree, &ei_pcep_subobject_bad_length, "Bad IRO object: subobject goes past end of object");
1607 break;
1610 l_type = tvb_get_guint8(tvb, offset2);
1611 length = tvb_get_guint8(tvb, offset2+1);
1613 if (length < 2) {
1614 expert_add_info_format(pinfo, pcep_object_tree, &ei_pcep_subobject_bad_length, "Bad IRO object: subobject length %u < 2", length);
1615 break;
1618 type_iro = (l_type & Mask_Type);
1620 if (body_obj_len <length) {
1621 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, length, "Bad IRO object: subobject length %u > remaining length %u", length, body_obj_len);
1622 break;
1625 switch(type_iro) {
1627 case PCEP_SUB_IPv4:
1628 dissect_subobj_ipv4(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_iro, length);
1629 break;
1630 case PCEP_SUB_IPv6:
1631 dissect_subobj_ipv6(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_iro, length);
1632 break;
1633 case PCEP_SUB_UNNUMB_INTERFACE_ID:
1634 dissect_subobj_unnumb_interfaceID(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_iro, length);
1635 break;
1636 case PCEP_SUB_AUTONOMOUS_SYS_NUM:
1637 dissect_subobj_autonomous_sys_num(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_iro, length);
1638 break;
1639 case PCEP_SUB_EXRS:
1640 dissect_subobj_exrs(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_iro, type_iro, length);
1641 break;
1642 default:
1643 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_non_defined_subobject, tvb, offset2, length, "Non defined subobject (%d)", type_iro);
1644 break;
1646 offset2 += length;
1647 body_obj_len -= length;
1651 /*------------------------------------------------------------------------------
1652 * SVEC OBJECT
1653 *------------------------------------------------------------------------------*/
1654 #define SVEC_OBJ_MIN_LEN 4
1656 static void
1657 dissect_pcep_svec_obj(proto_tree *pcep_object_tree, packet_info *pinfo,
1658 tvbuff_t *tvb, int offset2, int obj_length)
1660 proto_item *ti;
1661 proto_tree *pcep_svec_flags_obj;
1662 int m = 1;
1663 int i = 0;
1664 guint32 requestID;
1666 if (obj_length < OBJ_HDR_LEN+SVEC_OBJ_MIN_LEN) {
1667 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad SVEC object length %u, should be >= %u", obj_length, OBJ_HDR_LEN+SVEC_OBJ_MIN_LEN);
1668 return;
1671 proto_tree_add_item(pcep_object_tree, hf_pcep_svec_obj_reserved, tvb, offset2, 1, ENC_NA);
1673 ti = proto_tree_add_item(pcep_object_tree, hf_pcep_svec_obj_flags, tvb, offset2+1, 3, ENC_BIG_ENDIAN);
1674 pcep_svec_flags_obj = proto_item_add_subtree(ti, ett_pcep_obj_svec);
1675 proto_tree_add_item(pcep_svec_flags_obj, hf_pcep_svec_flags_l, tvb, offset2 + 1, 3, ENC_BIG_ENDIAN);
1676 proto_tree_add_item(pcep_svec_flags_obj, hf_pcep_svec_flags_n, tvb, offset2 + 1, 3, ENC_BIG_ENDIAN);
1677 proto_tree_add_item(pcep_svec_flags_obj, hf_pcep_svec_flags_s, tvb, offset2 + 1, 3, ENC_BIG_ENDIAN);
1679 for ( i=4 ; i<(obj_length-OBJ_HDR_LEN) ; ){
1680 requestID = tvb_get_ntohl(tvb, offset2+i);
1681 proto_tree_add_uint_format(pcep_object_tree, hf_pcep_svec_obj_request_id_number, tvb, offset2+i, 4, requestID,
1682 "Request-ID-Number %u: 0x%x", m++, requestID);
1683 i += 4;
1687 /*------------------------------------------------------------------------------
1688 * NOTIFICATION OBJECT
1689 *------------------------------------------------------------------------------*/
1690 #define NOTIFICATION_OBJ_MIN_LEN 4
1692 static void
1693 dissect_pcep_notification_obj(proto_tree *pcep_object_tree, packet_info *pinfo, tvbuff_t *tvb, int offset2, int obj_length)
1695 guint8 nt;
1697 if (obj_length < OBJ_HDR_LEN+NOTIFICATION_OBJ_MIN_LEN) {
1698 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad NOTIFICATION object length %u, should be >= %u", obj_length, OBJ_HDR_LEN+NOTIFICATION_OBJ_MIN_LEN);
1699 return;
1702 proto_tree_add_item(pcep_object_tree, hf_pcep_notification_obj_reserved, tvb, offset2, 1, ENC_NA);
1704 proto_tree_add_item(pcep_object_tree, hf_pcep_notification_obj_flags, tvb, offset2+1, 1, ENC_NA);
1706 nt = tvb_get_guint8(tvb, offset2+2);
1707 proto_tree_add_item(pcep_object_tree, hf_PCEPF_NOTI_TYPE, tvb, offset2+2, 1, ENC_NA);
1709 switch(nt){
1711 case 1:
1712 proto_tree_add_item(pcep_object_tree, hf_PCEPF_NOTI_VAL1, tvb, offset2+2, 1, ENC_NA);
1713 break;
1715 case 2:
1716 proto_tree_add_item(pcep_object_tree, hf_PCEPF_NOTI_VAL2, tvb, offset2+2, 1, ENC_NA);
1717 break;
1719 default:
1720 proto_tree_add_item(pcep_object_tree, hf_pcep_notification_obj_type, tvb, offset2+2, 1, ENC_NA);
1721 break;
1724 proto_tree_add_item(pcep_object_tree, hf_pcep_notification_obj_value, tvb, offset2+3, 1, ENC_NA);
1726 /*it's suppose that obj_length is a valid date. The object can have optional TLV(s)*/
1727 offset2 += NOTIFICATION_OBJ_MIN_LEN;
1728 obj_length -= OBJ_HDR_LEN+NOTIFICATION_OBJ_MIN_LEN;
1729 dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_notification);
1732 /*------------------------------------------------------------------------------
1733 * ERROR OBJECT
1734 *------------------------------------------------------------------------------*/
1735 #define ERROR_OBJ_MIN_LEN 4
1737 static void
1738 dissect_pcep_error_obj(proto_tree *pcep_object_tree, packet_info *pinfo, tvbuff_t *tvb, int offset2, int obj_length)
1740 guint8 error_type;
1741 guint8 error_value;
1742 const gchar *err_str = "Unassigned";
1744 if (obj_length < OBJ_HDR_LEN+ERROR_OBJ_MIN_LEN) {
1745 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad ERROR object length %u, should be >= %u", obj_length, OBJ_HDR_LEN+ERROR_OBJ_MIN_LEN);
1746 return;
1749 proto_tree_add_item(pcep_object_tree, hf_pcep_error_obj_reserved, tvb, offset2, 1, ENC_NA);
1750 proto_tree_add_item(pcep_object_tree, hf_pcep_error_obj_flags, tvb, offset2+1, 1, ENC_NA);
1752 error_type = tvb_get_guint8(tvb, offset2+2);
1753 error_value = tvb_get_guint8(tvb, offset2+3);
1754 proto_tree_add_item(pcep_object_tree, hf_PCEPF_ERROR_TYPE, tvb, offset2+2, 1, ENC_NA);
1756 switch (error_type){
1757 case ESTABLISH_FAILURE:
1758 err_str = val_to_str_const(error_value, pcep_error_value_1_vals, "Unknown");
1759 break;
1760 case CAP_NOT_SUPPORTED:
1761 break;
1762 case UNKNOWN_OBJ:
1763 err_str = val_to_str_const(error_value, pcep_error_value_3_vals, "Unknown");
1764 break;
1765 case NOT_SUPP_OBJ:
1766 err_str = val_to_str_const(error_value, pcep_error_value_4_vals, "Unknown");
1767 break;
1768 case POLICY_VIOLATION:
1769 err_str = val_to_str_const(error_value, pcep_error_value_5_vals, "Unknown");
1770 break;
1771 case MANDATORY_OBJ_MIS:
1772 err_str = val_to_str_const(error_value, pcep_error_value_6_vals, "Unknown");
1773 break;
1774 case SYNCH_PCREQ_MIS:
1775 break;
1776 case UNKNOWN_REQ_REF:
1777 break;
1778 case ATTEMPT_2_SESSION:
1779 break;
1780 case INVALID_OBJ:
1781 err_str = val_to_str_const(error_value, pcep_error_value_10_vals, "Unknown");
1782 break;
1783 case UNRECO_EXRS_SUBOBJ:
1784 break;
1785 case DIFFSERV_TE_ERROR:
1786 err_str = val_to_str_const(error_value, pcep_error_value_12_vals, "Unknown");
1787 break;
1788 case BRPC_FAILURE:
1789 err_str = val_to_str_const(error_value, pcep_error_value_13_vals, "Unknown");
1790 break;
1791 case GCO_ERROR:
1792 err_str = val_to_str_const(error_value, pcep_error_value_15_vals, "Unknown");
1793 break;
1794 case P2MP_CAPABILITY_ERROR:
1795 err_str = val_to_str_const(error_value, pcep_error_value_16_vals, "Unknown");
1796 break;
1797 case P2MP_END_POINTS_ERROR:
1798 err_str = val_to_str_const(error_value, pcep_error_value_17_vals, "Unknown");
1799 break;
1800 case P2MP_FRAGMENT_ERROR:
1801 err_str = val_to_str_const(error_value, pcep_error_value_18_vals, "Unknown");
1802 break;
1803 default:
1804 proto_tree_add_text(pcep_object_tree, tvb, offset2+2, 1, "Error-Type: %u Non defined Error-Value", error_type);
1806 proto_tree_add_text(pcep_object_tree, tvb, offset2+3, 1, "Error-Value: %s (%u)", err_str, error_value);
1808 /*it's suppose that obj_length is a valid date. The object can have optional TLV(s)*/
1809 offset2 += ERROR_OBJ_MIN_LEN;
1810 obj_length -= OBJ_HDR_LEN+ERROR_OBJ_MIN_LEN;
1811 dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_error);
1815 /*------------------------------------------------------------------------------
1816 * LOAD-BALANCING OBJECT
1817 *------------------------------------------------------------------------------*/
1818 #define LOAD_BALANCING_OBJ_LEN 8
1820 static void
1821 dissect_pcep_balancing_obj(proto_tree *pcep_object_tree, packet_info *pinfo, tvbuff_t *tvb, int offset2, int obj_length)
1823 if (obj_length != OBJ_HDR_LEN+LOAD_BALANCING_OBJ_LEN) {
1824 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad LOAD-BALANCING object length %u, should be %u", obj_length, OBJ_HDR_LEN+LOAD_BALANCING_OBJ_LEN);
1825 return;
1828 proto_tree_add_item(pcep_object_tree, hf_pcep_balancing_obj_reserved, tvb, offset2, 2, ENC_BIG_ENDIAN);
1829 proto_tree_add_item(pcep_object_tree, hf_pcep_balancing_obj_flags, tvb, offset2+2, 1, ENC_NA);
1830 proto_tree_add_item(pcep_object_tree, hf_pcep_balancing_obj_maximum_number_of_te_lsps, tvb, offset2+3, 1, ENC_NA);
1831 proto_tree_add_item(pcep_object_tree, hf_pcep_balancing_obj_minimum_bandwidth, tvb, offset2+4, 4, ENC_BIG_ENDIAN);
1834 /*------------------------------------------------------------------------------
1835 * CLOSE OBJECT
1836 *------------------------------------------------------------------------------*/
1837 #define CLOSE_OBJ_MIN_LEN 4
1839 static void
1840 dissect_pcep_close_obj(proto_tree *pcep_object_tree, packet_info *pinfo, tvbuff_t *tvb, int offset2, int obj_length)
1842 if (obj_length < OBJ_HDR_LEN+CLOSE_OBJ_MIN_LEN) {
1843 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad CLOSE object length %u, should be >= %u", obj_length, OBJ_HDR_LEN+CLOSE_OBJ_MIN_LEN);
1844 return;
1847 proto_tree_add_item(pcep_object_tree, hf_pcep_close_obj_reserved, tvb, offset2, 2, ENC_BIG_ENDIAN);
1848 proto_tree_add_item(pcep_object_tree, hf_pcep_close_obj_flags, tvb, offset2+2, 1, ENC_NA);
1849 proto_tree_add_item(pcep_object_tree, hf_pcep_close_obj_reason, tvb, offset2+3, 1, ENC_NA);
1851 /*it's suppose that obj_length is a valid date. The object can have optional TLV(s)*/
1852 offset2 += CLOSE_OBJ_MIN_LEN;
1853 obj_length -= OBJ_HDR_LEN+CLOSE_OBJ_MIN_LEN;
1854 dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_load_balancing);
1857 /*------------------------------------------------------------------------------
1858 * PATH-KEY OBJECT
1859 *------------------------------------------------------------------------------*/
1860 static void
1861 dissect_pcep_path_key_obj(proto_tree *pcep_object_tree, packet_info *pinfo,
1862 tvbuff_t *tvb, int offset2, int obj_length)
1864 guint8 l_type;
1865 guint8 length;
1866 guint type_exp_route;
1867 guint body_obj_len;
1869 body_obj_len = obj_length - OBJ_HDR_LEN;
1871 while(body_obj_len){
1872 if (body_obj_len < 2) {
1873 expert_add_info_format(pinfo, pcep_object_tree, &ei_pcep_subobject_bad_length, "Bad PATH-KEY object: subobject goes past end of object");
1874 break;
1877 l_type = tvb_get_guint8(tvb, offset2);
1878 length = tvb_get_guint8(tvb, offset2+1);
1880 if (length < 2) {
1881 expert_add_info_format(pinfo, pcep_object_tree, &ei_pcep_subobject_bad_length, "Bad PATH-KEY object: subobject length %u < 2", length);
1882 break;
1885 type_exp_route = (l_type & Mask_Type);
1886 if (body_obj_len <length) {
1887 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, length, "Bad PATH-KEY object: subobject length %u > remaining length %u", length, body_obj_len);
1888 break;
1891 switch(type_exp_route) {
1892 case PCEP_SUB_PKSv4:
1893 dissect_subobj_pksv4(pcep_object_tree, pinfo, tvb, offset2, ett_pcep_obj_explicit_route, length);
1894 break;
1895 default:
1896 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_non_defined_subobject, tvb, offset2, length, "Non defined subobject (%d)", type_exp_route);
1897 break;
1899 offset2 += length;
1900 body_obj_len -= length;
1904 /*------------------------------------------------------------------------------
1905 * XRO OBJECT
1906 *------------------------------------------------------------------------------*/
1907 #define XRO_OBJ_MIN_LEN 4
1909 static void
1910 dissect_pcep_xro_obj(proto_tree *pcep_object_tree, packet_info *pinfo, tvbuff_t *tvb, int offset2, int obj_length, int obj_class)
1912 proto_tree *pcep_xro_flags_obj;
1913 proto_item *ti;
1914 guint8 x_type;
1915 guint8 length;
1916 guint type_xro;
1917 guint body_obj_len;
1919 body_obj_len = obj_length - OBJ_HDR_LEN;
1921 if (obj_length < OBJ_HDR_LEN+XRO_OBJ_MIN_LEN) {
1922 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad XRO object length %u, should be >= %u", obj_length, OBJ_HDR_LEN+XRO_OBJ_MIN_LEN);
1923 return;
1926 proto_tree_add_item(pcep_object_tree, hf_pcep_xro_obj_reserved, tvb, offset2, 2, ENC_BIG_ENDIAN);
1928 ti = proto_tree_add_item(pcep_object_tree, hf_pcep_xro_obj_flags, tvb, offset2+2, 2, ENC_BIG_ENDIAN);
1929 pcep_xro_flags_obj = proto_item_add_subtree(ti, ett_pcep_obj_xro);
1930 proto_tree_add_item(pcep_xro_flags_obj, hf_pcep_xro_flags_f, tvb, offset2 + 2, 2, ENC_BIG_ENDIAN);
1932 offset2 += XRO_OBJ_MIN_LEN;
1933 body_obj_len -= XRO_OBJ_MIN_LEN;
1935 while(body_obj_len >= 2){
1936 if (body_obj_len < 2) {
1937 expert_add_info_format(pinfo, pcep_object_tree, &ei_pcep_subobject_bad_length, "Bad XRO object: subobject goes past end of object");
1938 break;
1941 x_type = tvb_get_guint8(tvb, offset2);
1942 length = tvb_get_guint8(tvb, offset2+1);
1944 if (length < 2) {
1945 expert_add_info_format(pinfo, pcep_object_tree, &ei_pcep_subobject_bad_length, "Bad XRO object: object length %u < 2", length);
1946 break;
1949 type_xro = (x_type & Mask_Type);
1951 if (body_obj_len <length) {
1952 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, length, "Bad XRO object: object length %u > remaining length %u", length, body_obj_len);
1953 break;
1956 switch(type_xro) {
1958 case PCEP_SUB_IPv4:
1959 dissect_subobj_ipv4(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_xro, length);
1960 break;
1961 case PCEP_SUB_IPv6:
1962 dissect_subobj_ipv6(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_xro, length);
1963 break;
1964 case PCEP_SUB_UNNUMB_INTERFACE_ID:
1965 dissect_subobj_unnumb_interfaceID(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_xro, length);
1966 break;
1967 case PCEP_SUB_AUTONOMOUS_SYS_NUM:
1968 dissect_subobj_autonomous_sys_num(pcep_object_tree, pinfo, tvb, offset2, obj_class, ett_pcep_obj_xro, length);
1969 break;
1970 case PCEP_SUB_SRLG:
1971 dissect_subobj_srlg(pcep_object_tree, pinfo, tvb, offset2, ett_pcep_obj_xro, length);
1972 break;
1973 case PCEP_SUB_PKSv4:
1974 dissect_subobj_pksv4(pcep_object_tree, pinfo, tvb, offset2, ett_pcep_obj_xro, length);
1975 break;
1976 case PCEP_SUB_PKSv6:
1977 dissect_subobj_pksv6(pcep_object_tree, pinfo, tvb, offset2, ett_pcep_obj_xro, length);
1978 break;
1979 default:
1980 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_non_defined_subobject, tvb, offset2-4, length, "Non defined subobject (%d)", type_xro);
1981 break;
1983 offset2 += length;
1984 body_obj_len -= length;
1988 /*------------------------------------------------------------------------------
1989 * MONITORING OBJECT
1990 *------------------------------------------------------------------------------*/
1991 #define OBJ_MONITORING_MIN_LEN 8
1993 static void
1994 dissect_pcep_obj_monitoring(proto_tree *pcep_object_tree, packet_info *pinfo, tvbuff_t *tvb, int offset2, int obj_length)
1996 proto_item *ti;
1997 proto_tree *monitoring_flags;
1999 if (obj_length < OBJ_HDR_LEN + OBJ_MONITORING_MIN_LEN) {
2000 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad MONITORING object length %u, should be >= %u", obj_length, OBJ_HDR_LEN + OBJ_MONITORING_MIN_LEN);
2001 return;
2004 proto_tree_add_item(pcep_object_tree, hf_pcep_obj_monitoring_reserved, tvb, offset2, 1, ENC_NA);
2005 ti = proto_tree_add_item(pcep_object_tree, hf_pcep_obj_monitoring_flags, tvb, offset2+1, 3, ENC_BIG_ENDIAN);
2006 monitoring_flags = proto_item_add_subtree(ti, ett_pcep_obj_monitoring);
2007 proto_tree_add_item(monitoring_flags, hf_pcep_obj_monitoring_flags_reserved, tvb, offset2 + 1, 3, ENC_BIG_ENDIAN);
2008 proto_tree_add_item(monitoring_flags, hf_pcep_obj_monitoring_flags_i, tvb, offset2 + 1, 3, ENC_BIG_ENDIAN);
2009 proto_tree_add_item(monitoring_flags, hf_pcep_obj_monitoring_flags_c, tvb, offset2 + 1, 3, ENC_BIG_ENDIAN);
2010 proto_tree_add_item(monitoring_flags, hf_pcep_obj_monitoring_flags_p, tvb, offset2 + 1, 3, ENC_BIG_ENDIAN);
2011 proto_tree_add_item(monitoring_flags, hf_pcep_obj_monitoring_flags_g, tvb, offset2 + 1, 3, ENC_BIG_ENDIAN);
2012 proto_tree_add_item(monitoring_flags, hf_pcep_obj_monitoring_flags_l, tvb, offset2 + 1, 3, ENC_BIG_ENDIAN);
2013 proto_tree_add_item(pcep_object_tree, hf_pcep_obj_monitoring_monitoring_id_number, tvb, offset2 + 4, 4, ENC_BIG_ENDIAN);
2015 /* The object can have optional TLV(s)*/
2016 offset2 += OBJ_MONITORING_MIN_LEN;
2017 obj_length -= OBJ_HDR_LEN + OBJ_MONITORING_MIN_LEN;
2018 dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_monitoring);
2021 /*------------------------------------------------------------------------------
2022 * PCC-ID-REQ OBJECT
2023 *------------------------------------------------------------------------------*/
2024 #define OBJ_PCC_ID_REQ_IPV4_LEN 4
2025 #define OBJ_PCC_ID_REQ_IPV6_LEN 16
2027 static void
2028 dissect_pcep_obj_pcc_id_req(proto_tree *pcep_object_tree, packet_info *pinfo, tvbuff_t *tvb, int offset2, int obj_length, int type)
2030 switch(type)
2032 case PCEP_OBJ_PCC_ID_REQ_IPv4:
2033 if (obj_length != OBJ_HDR_LEN + OBJ_PCC_ID_REQ_IPV4_LEN) {
2034 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad IPv4 PCC-ID-REQ object length %u, should be %u", obj_length, OBJ_HDR_LEN + OBJ_PCC_ID_REQ_IPV4_LEN);
2035 return;
2037 proto_tree_add_item(pcep_object_tree, hf_pcep_obj_pcc_id_req_ipv4, tvb, offset2, 4, ENC_BIG_ENDIAN);
2038 break;
2040 case PCEP_OBJ_PCC_ID_REQ_IPv6:
2041 if (obj_length != OBJ_HDR_LEN + OBJ_PCC_ID_REQ_IPV6_LEN) {
2042 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad IPv6 PCC-ID-REQ object length %u, should be %u", obj_length, OBJ_HDR_LEN + OBJ_PCC_ID_REQ_IPV6_LEN);
2043 return;
2045 proto_tree_add_item(pcep_object_tree, hf_pcep_obj_pcc_id_req_ipv6, tvb, offset2, 16, ENC_NA);
2046 break;
2048 default:
2049 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_non_defined_subobject, tvb, offset2, obj_length - OBJ_HDR_LEN, "UNKNOWN Type Object (%u)", type);
2050 break;
2054 /*------------------------------------------------------------------------------
2055 * OF OBJECT
2056 *------------------------------------------------------------------------------*/
2057 #define OF_OBJ_MIN_LEN 4
2059 static void
2060 dissect_pcep_of_obj(proto_tree *pcep_object_tree, packet_info *pinfo, tvbuff_t *tvb, int offset2, int obj_length)
2062 if (obj_length < OBJ_HDR_LEN+OF_OBJ_MIN_LEN) {
2063 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad OF object length %u, should be >= %u", obj_length, OBJ_HDR_LEN+OF_OBJ_MIN_LEN);
2064 return;
2067 proto_tree_add_item(pcep_object_tree, hf_pcep_obj_of_code, tvb, offset2, 2, ENC_BIG_ENDIAN);
2069 /*The object can have optional TLV(s)*/
2070 offset2 += OPEN_OBJ_MIN_LEN;
2071 obj_length -= OBJ_HDR_LEN+OF_OBJ_MIN_LEN;
2072 dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_open);
2075 /*------------------------------------------------------------------------------
2076 * PCE-ID OBJECT
2077 *------------------------------------------------------------------------------*/
2078 #define OBJ_PCE_ID_IPV4_LEN 4
2079 #define OBJ_PCE_ID_IPV6_LEN 16
2081 static void
2082 dissect_pcep_obj_pce_id(proto_tree *pcep_object_tree, packet_info *pinfo, tvbuff_t *tvb, int offset2, int obj_length, int type)
2084 switch(type)
2086 case PCEP_OBJ_PCE_ID_IPv4:
2087 if (obj_length != OBJ_HDR_LEN + OBJ_PCE_ID_IPV4_LEN) {
2088 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad IPv4 PCE-ID object length %u, should be %u", obj_length, OBJ_HDR_LEN + OBJ_PCE_ID_IPV4_LEN);
2089 return;
2091 proto_tree_add_item(pcep_object_tree, hf_pcep_obj_pce_id_ipv4, tvb, offset2, 4, ENC_BIG_ENDIAN);
2092 break;
2094 case PCEP_OBJ_PCE_ID_IPv6:
2095 if (obj_length != OBJ_HDR_LEN + OBJ_PCE_ID_IPV6_LEN) {
2096 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad IPv6 PCE-ID object length %u, should be %u", obj_length, OBJ_HDR_LEN + OBJ_PCE_ID_IPV6_LEN);
2097 return;
2099 proto_tree_add_item(pcep_object_tree, hf_pcep_obj_pce_id_ipv6, tvb, offset2, 16, ENC_NA);
2100 break;
2102 default:
2103 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_non_defined_subobject, tvb, offset2, obj_length - OBJ_HDR_LEN, "UNKNOWN Type Object (%u)", type);
2104 break;
2108 /*------------------------------------------------------------------------------
2109 * PROC-TIME OBJECT
2110 *------------------------------------------------------------------------------*/
2111 #define OBJ_PROC_TIME_LEN 24
2113 static void
2114 dissect_pcep_obj_proc_time(proto_tree *pcep_object_tree, packet_info *pinfo, tvbuff_t *tvb, int offset2, int obj_length)
2116 proto_item *ti;
2117 proto_tree *proc_time_flags;
2119 if (obj_length != OBJ_HDR_LEN + OBJ_PROC_TIME_LEN) {
2120 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad PROC-TIME object length %u, should be %u", obj_length, OBJ_HDR_LEN + OBJ_PROC_TIME_LEN);
2121 return;
2124 proto_tree_add_item(pcep_object_tree, hf_pcep_obj_proc_time_reserved, tvb, offset2, 2, ENC_BIG_ENDIAN);
2125 ti = proto_tree_add_item(pcep_object_tree, hf_pcep_obj_proc_time_flags, tvb, offset2 + 2, 2, ENC_BIG_ENDIAN);
2126 proc_time_flags = proto_item_add_subtree(ti, ett_pcep_obj_proc_time);
2127 proto_tree_add_item(proc_time_flags, hf_pcep_obj_proc_time_flags_reserved, tvb, offset2 + 2, 2, ENC_BIG_ENDIAN);
2128 proto_tree_add_item(proc_time_flags, hf_pcep_obj_proc_time_flags_e, tvb, offset2 + 2, 2, ENC_BIG_ENDIAN);
2129 proto_tree_add_item(pcep_object_tree, hf_pcep_obj_proc_time_cur_proc_time, tvb, offset2 + 4, 4, ENC_BIG_ENDIAN);
2130 proto_tree_add_item(pcep_object_tree, hf_pcep_obj_proc_time_min_proc_time, tvb, offset2 + 8, 4, ENC_BIG_ENDIAN);
2131 proto_tree_add_item(pcep_object_tree, hf_pcep_obj_proc_time_max_proc_time, tvb, offset2 + 12, 4, ENC_BIG_ENDIAN);
2132 proto_tree_add_item(pcep_object_tree, hf_pcep_obj_proc_time_ave_proc_time, tvb, offset2 + 16, 4, ENC_BIG_ENDIAN);
2133 proto_tree_add_item(pcep_object_tree, hf_pcep_obj_proc_time_var_proc_time, tvb, offset2 + 20, 4, ENC_BIG_ENDIAN);
2136 /*------------------------------------------------------------------------------
2137 * OVERLOAD OBJECT
2138 *------------------------------------------------------------------------------*/
2139 #define OBJ_OVERLOAD_LEN 4
2141 static void
2142 dissect_pcep_obj_overload(proto_tree *pcep_object_tree, packet_info *pinfo, tvbuff_t *tvb, int offset2, int obj_length)
2144 if (obj_length != OBJ_HDR_LEN + OBJ_OVERLOAD_LEN) {
2145 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_subobject_bad_length, tvb, offset2, obj_length, "Bad OVERLOAD object length %u, should be %u", obj_length, OBJ_HDR_LEN + OBJ_OVERLOAD_LEN);
2146 return;
2148 proto_tree_add_item(pcep_object_tree, hf_pcep_obj_overload_flags, tvb, offset2, 1, ENC_NA);
2149 proto_tree_add_item(pcep_object_tree, hf_pcep_obj_overload_reserved, tvb, offset2 + 1, 1, ENC_NA);
2150 proto_tree_add_item(pcep_object_tree, hf_pcep_obj_overload_duration, tvb, offset2 + 2, 2, ENC_BIG_ENDIAN);
2154 /*------------------------------------------------------------------------------*/
2155 /* Dissect in Objects */
2156 /*------------------------------------------------------------------------------*/
2157 static void
2158 dissect_pcep_obj_tree(proto_tree *pcep_tree, packet_info *pinfo, tvbuff_t *tvb, int len, int offset, int msg_length)
2160 guint8 obj_class;
2161 guint8 ot_res_p_i;
2162 guint16 obj_length;
2163 int type;
2164 proto_tree *pcep_object_tree;
2165 proto_item *pcep_object_item;
2166 proto_tree *pcep_header_obj_flags;
2167 proto_item *ti;
2169 while (len < msg_length) {
2170 obj_class = tvb_get_guint8(tvb, offset);
2171 switch (obj_class) {
2173 case PCEP_OPEN_OBJ:
2174 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_OPEN, tvb, offset, -1, ENC_NA);
2175 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_open);
2176 break;
2178 case PCEP_RP_OBJ:
2179 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_RP, tvb, offset, -1, ENC_NA);
2180 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_request_parameters);
2181 break;
2183 case PCEP_NO_PATH_OBJ:
2184 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_NO_PATH, tvb, offset, -1, ENC_NA);
2185 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_no_path);
2186 break;
2188 case PCEP_END_POINT_OBJ:
2189 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_END_POINT, tvb, offset, -1, ENC_NA);
2190 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_end_point);
2191 break;
2193 case PCEP_BANDWIDTH_OBJ:
2194 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_BANDWIDTH, tvb, offset, -1, ENC_NA);
2195 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_bandwidth);
2196 break;
2198 case PCEP_METRIC_OBJ:
2199 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_METRIC, tvb, offset, -1, ENC_NA);
2200 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_metric);
2201 break;
2203 case PCEP_EXPLICIT_ROUTE_OBJ:
2204 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_EXPLICIT_ROUTE, tvb, offset, -1, ENC_NA);
2205 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_explicit_route);
2206 break;
2208 case PCEP_RECORD_ROUTE_OBJ:
2209 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_RECORD_ROUTE, tvb, offset, -1, ENC_NA);
2210 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_record_route);
2211 break;
2213 case PCEP_LSPA_OBJ:
2214 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_LSPA, tvb, offset, -1, ENC_NA);
2215 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_lspa);
2216 break;
2218 case PCEP_IRO_OBJ:
2219 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_IRO, tvb, offset, -1, ENC_NA);
2220 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_iro);
2221 break;
2223 case PCEP_SVEC_OBJ:
2224 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_SVEC, tvb, offset, -1, ENC_NA);
2225 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_svec);
2226 break;
2228 case PCEP_NOTIFICATION_OBJ:
2229 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_NOTIFICATION, tvb, offset, -1, ENC_NA);
2230 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_notification);
2231 break;
2233 case PCEP_PCEP_ERROR_OBJ:
2234 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_PCEP_ERROR, tvb, offset, -1, ENC_NA);
2235 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_error);
2236 break;
2238 case PCEP_LOAD_BALANCING_OBJ:
2239 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_LOAD_BALANCING, tvb, offset, -1, ENC_NA);
2240 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_load_balancing);
2241 break;
2243 case PCEP_CLOSE_OBJ:
2244 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_CLOSE, tvb, offset, -1, ENC_NA);
2245 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_close);
2246 break;
2248 case PCEP_PATH_KEY_OBJ:
2249 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_PATH_KEY, tvb, offset, -1, ENC_NA);
2250 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_path_key);
2251 break;
2253 case PCEP_XRO_OBJ:
2254 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_XRO, tvb, offset, -1, ENC_NA);
2255 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_xro);
2256 break;
2258 case PCEP_OBJ_MONITORING:
2259 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_MONITORING, tvb, offset, -1, ENC_NA);
2260 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_monitoring);
2261 break;
2263 case PCEP_OBJ_PCC_ID_REQ:
2264 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_PCC_ID_REQ, tvb, offset, -1, ENC_NA);
2265 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_pcc_id_req);
2266 break;
2268 case PCEP_OF_OBJ:
2269 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_OF, tvb, offset, -1, ENC_NA);
2270 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_of);
2271 break;
2273 case PCEP_OBJ_PCE_ID:
2274 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_PCE_ID, tvb, offset, -1, ENC_NA);
2275 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_pce_id);
2276 break;
2278 case PCEP_OBJ_PROC_TIME:
2279 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_PROC_TIME, tvb, offset, -1, ENC_NA);
2280 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_proc_time);
2281 break;
2283 case PCEP_OBJ_OVERLOAD:
2284 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_OVERLOAD, tvb, offset, -1, ENC_NA);
2285 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_overload);
2286 break;
2288 default:
2289 pcep_object_item = proto_tree_add_item(pcep_tree, hf_PCEPF_OBJ_UNKNOWN_TYPE, tvb, offset, -1, ENC_NA);
2290 pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_unknown);
2291 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_non_defined_object, tvb, offset, -1, "Unknown object (%u)", obj_class);
2292 break;
2295 proto_tree_add_uint(pcep_object_tree, hf_PCEPF_OBJECT_CLASS, tvb, offset, 1, obj_class);
2296 proto_tree_add_item(pcep_object_tree, hf_pcep_object_type, tvb, offset+1, 1, ENC_NA);
2298 ot_res_p_i = tvb_get_guint8(tvb, offset+1);
2299 type = (ot_res_p_i & MASK_OBJ_TYPE)>>4;
2300 ti = proto_tree_add_text(pcep_object_tree, tvb, offset+1, 1, "Flags");
2301 pcep_header_obj_flags = proto_item_add_subtree(ti, ett_pcep_hdr);
2302 proto_tree_add_item(pcep_header_obj_flags, hf_pcep_hdr_obj_flags_reserved, tvb, offset+1, 1, ENC_NA);
2303 proto_tree_add_item(pcep_header_obj_flags, hf_pcep_hdr_obj_flags_p, tvb, offset+1, 1, ENC_NA);
2304 proto_tree_add_item(pcep_header_obj_flags, hf_pcep_hdr_obj_flags_i, tvb, offset+1, 1, ENC_NA);
2306 proto_tree_add_item(pcep_object_tree, hf_pcep_object_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);
2308 obj_length = tvb_get_ntohs(tvb, offset+2);
2309 proto_item_set_len(pcep_object_item, obj_length);
2310 if (obj_length < 4) {
2311 expert_add_info_format(pinfo, pcep_object_tree, &ei_pcep_object_length, "Object Length: %u (bogus, must be >= 4)", obj_length);
2312 break;
2315 switch(obj_class) {
2317 case PCEP_OPEN_OBJ:
2318 dissect_pcep_open_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length);
2319 break;
2321 case PCEP_RP_OBJ:
2322 dissect_pcep_rp_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length);
2323 break;
2325 case PCEP_NO_PATH_OBJ:
2326 dissect_pcep_no_path_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length);
2327 break;
2329 case PCEP_END_POINT_OBJ:
2330 dissect_pcep_end_point_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length, type);
2331 break;
2333 case PCEP_BANDWIDTH_OBJ:
2334 dissect_pcep_bandwidth_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length);
2335 break;
2337 case PCEP_METRIC_OBJ:
2338 dissect_pcep_metric_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length);
2339 break;
2341 case PCEP_EXPLICIT_ROUTE_OBJ:
2342 dissect_pcep_explicit_route_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length, obj_class);
2343 break;
2345 case PCEP_RECORD_ROUTE_OBJ:
2346 dissect_pcep_record_route_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length, obj_class);
2347 break;
2349 case PCEP_LSPA_OBJ:
2350 dissect_pcep_lspa_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length);
2351 break;
2353 case PCEP_IRO_OBJ:
2354 dissect_pcep_iro_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length, obj_class);
2355 break;
2357 case PCEP_SVEC_OBJ:
2358 dissect_pcep_svec_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length);
2359 break;
2361 case PCEP_NOTIFICATION_OBJ:
2362 dissect_pcep_notification_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length);
2363 break;
2365 case PCEP_PCEP_ERROR_OBJ:
2366 dissect_pcep_error_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length);
2367 break;
2369 case PCEP_LOAD_BALANCING_OBJ:
2370 dissect_pcep_balancing_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length);
2371 break;
2373 case PCEP_CLOSE_OBJ:
2374 dissect_pcep_close_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length);
2375 break;
2377 case PCEP_PATH_KEY_OBJ:
2378 dissect_pcep_path_key_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length);
2379 break;
2381 case PCEP_XRO_OBJ:
2382 dissect_pcep_xro_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length, obj_class);
2383 break;
2385 case PCEP_OBJ_MONITORING:
2386 dissect_pcep_obj_monitoring(pcep_object_tree, pinfo, tvb, offset+4, obj_length);
2387 break;
2389 case PCEP_OBJ_PCC_ID_REQ:
2390 dissect_pcep_obj_pcc_id_req(pcep_object_tree, pinfo, tvb, offset+4, obj_length, type);
2391 break;
2393 case PCEP_OF_OBJ:
2394 dissect_pcep_of_obj(pcep_object_tree, pinfo, tvb, offset+4, obj_length);
2395 break;
2397 case PCEP_OBJ_PCE_ID:
2398 dissect_pcep_obj_pce_id(pcep_object_tree, pinfo, tvb, offset+4, obj_length, type);
2399 break;
2401 case PCEP_OBJ_PROC_TIME:
2402 dissect_pcep_obj_proc_time(pcep_object_tree, pinfo, tvb, offset+4, obj_length);
2403 break;
2405 case PCEP_OBJ_OVERLOAD:
2406 dissect_pcep_obj_overload(pcep_object_tree, pinfo, tvb, offset+4, obj_length);
2407 break;
2409 default:
2410 proto_tree_add_expert_format(pcep_object_tree, pinfo, &ei_pcep_pcep_object_body_non_defined, tvb, offset+4, obj_length-OBJ_HDR_LEN, "PCEP Object BODY non defined (%u)", type);
2411 break;
2414 offset += obj_length;
2415 len += obj_length;
2420 /*------------------------------------------------------------------------------
2421 * Dissect a single PCEP message in a tree
2422 *------------------------------------------------------------------------------*/
2423 static void
2424 dissect_pcep_msg_tree(tvbuff_t *tvb, proto_tree *tree, guint tree_mode, packet_info *pinfo)
2426 proto_tree *pcep_tree, *pcep_header_tree, *pcep_header_msg_flags;
2427 proto_item *ti;
2429 int offset = 0;
2430 int len=0;
2431 guint8 message_type;
2432 guint16 msg_length;
2434 message_type = tvb_get_guint8(tvb, 1);
2435 msg_length = tvb_get_ntohs(tvb, 2);
2437 col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(message_type, message_type_vals, "Unknown Message (%u). "));
2439 ti = proto_tree_add_item(tree, proto_pcep, tvb, offset, msg_length, ENC_NA);
2440 pcep_tree = proto_item_add_subtree(ti, tree_mode);
2442 ti = proto_tree_add_text(pcep_tree, tvb, offset, 4, "%s Header", val_to_str(message_type, message_type_vals, "Unknown Message (%u). "));
2443 pcep_header_tree = proto_item_add_subtree(ti, ett_pcep_hdr);
2445 proto_tree_add_item(pcep_header_tree, hf_pcep_version, tvb, offset, 1, ENC_NA);
2447 ti = proto_tree_add_item(pcep_header_tree, hf_pcep_flags, tvb, offset, 1, ENC_NA);
2448 pcep_header_msg_flags = proto_item_add_subtree(ti, ett_pcep_hdr);
2449 proto_tree_add_item(pcep_header_msg_flags, hf_pcep_hdr_msg_flags_reserved, tvb, offset, 1, ENC_NA);
2450 proto_tree_add_item(pcep_header_tree, hf_PCEPF_MSG, tvb, offset+1, 1, ENC_NA);
2451 proto_tree_add_item(pcep_header_tree, hf_pcep_message_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);
2453 offset = 4;
2454 len = 4;
2456 dissect_pcep_obj_tree(pcep_tree, pinfo, tvb, len, offset, msg_length);
2460 static guint
2461 get_pcep_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
2463 guint16 plen;
2465 /* Get the length of the PCEP packet.*/
2466 plen = tvb_get_ntohs(tvb, offset+2);
2468 return plen;
2471 static int
2472 dissect_pcep_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2475 /* Set up structures needed to add the protocol subtree and manage it */
2477 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PCEP");
2479 /* Clear out stuff in the info column */
2480 col_clear(pinfo->cinfo, COL_INFO);
2482 dissect_pcep_msg_tree(tvb, tree, ett_pcep, pinfo);
2483 return tvb_length(tvb);
2486 static int
2487 dissect_pcep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
2489 tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 4, get_pcep_message_len,
2490 dissect_pcep_pdu, data);
2491 return tvb_length(tvb);
2494 /*Register the protocol with wireshark*/
2495 void
2496 proto_register_pcep(void){
2498 static hf_register_info pcepf_info[] = {
2500 /* Message type number */
2501 {&hf_PCEPF_MSG,
2502 { "Message Type", "pcep.msg", FT_UINT8, BASE_DEC, VALS(message_type_vals), 0x0,
2503 NULL, HFILL }},
2504 {&hf_pcep_hdr_msg_flags_reserved,
2505 { "Reserved Flags", "pcep.hdr.msg.flags.reserved", FT_BOOLEAN, 8, TFS(&tfs_set_notset), PCEP_HDR_MSG_RESERVED,
2506 NULL, HFILL }},
2508 /*Object header*/
2509 {&hf_pcep_hdr_obj_flags_reserved,
2510 { "Reserved Flags", "pcep.hdr.obj.flags.reserved", FT_BOOLEAN, 4, TFS(&tfs_set_notset), PCEP_HDR_OBJ_RESERVED,
2511 NULL, HFILL }},
2512 {&hf_pcep_hdr_obj_flags_p,
2513 { "Processing-Rule (P)", "pcep.hdr.obj.flags.p", FT_BOOLEAN, 4, TFS(&tfs_set_notset), PCEP_HDR_OBJ_P,
2514 NULL, HFILL }},
2515 {&hf_pcep_hdr_obj_flags_i,
2516 { "Ignore (I)", "pcep.hdr.obj.flags.i", FT_BOOLEAN, 4, TFS(&tfs_set_notset), PCEP_HDR_OBJ_I,
2517 NULL, HFILL }},
2518 /* Object class */
2519 {&hf_PCEPF_OBJECT_CLASS,
2520 { "Object Class", "pcep.object", FT_UINT32, BASE_DEC, VALS(pcep_class_vals), 0x0,
2521 NULL, HFILL }},
2523 /* Object types */
2524 {&hf_PCEPF_OBJ_OPEN,
2525 { "OPEN object", "pcep.obj.open", FT_NONE, BASE_NONE, NULL, 0x0,
2526 NULL, HFILL }},
2527 {&hf_pcep_open_flags_res,
2528 { "Reserved Flags", "pcep.open.flags.res", FT_BOOLEAN, 8, TFS(&tfs_set_notset), PCEP_OPEN_RES,
2529 NULL, HFILL }},
2530 {&hf_PCEPF_OBJ_RP,
2531 { "RP object", "pcep.obj.rp", FT_NONE, BASE_NONE, NULL, 0x0,
2532 NULL, HFILL }},
2533 {&hf_pcep_rp_flags_reserved,
2534 { "Reserved Flags", "pcep.rp.flags.reserved", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_RESERVED,
2535 NULL, HFILL }},
2536 {&hf_pcep_rp_flags_pri,
2537 { "(PRI) Priority", "pcep.rp.flags.pri", FT_BOOLEAN, 24, TFS(&tfs_on_off), PCEP_RP_PRI,
2538 NULL, HFILL }},
2539 {&hf_pcep_rp_flags_r,
2540 { "(R) Reoptimization", "pcep.rp.flags.r", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_R,
2541 NULL, HFILL }},
2542 {&hf_pcep_rp_flags_b,
2543 { "(B) Bi-directional", "pcep.rp.flags.b", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_B,
2544 NULL, HFILL }},
2545 {&hf_pcep_rp_flags_o,
2546 { "(L) Strict/Loose", "pcep.rp.flags.o", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_O,
2547 NULL, HFILL }},
2548 {&hf_pcep_rp_flags_v,
2549 { "(V) VSPT", "pcep.rp.flags.v", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_V,
2550 NULL, HFILL }},
2551 {&hf_pcep_rp_flags_s,
2552 { "(S) Supply OF on response", "pcep.rp.flags.s", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_S,
2553 NULL, HFILL }},
2554 {&hf_pcep_rp_flags_p,
2555 { "(P) Path Key", "pcep.rp.flags.p", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_P,
2556 NULL, HFILL }},
2557 {&hf_pcep_rp_flags_d,
2558 { "(D) Report the request order", "pcep.rp.flags.d", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_D,
2559 NULL, HFILL }},
2560 {&hf_pcep_rp_flags_m,
2561 { "(M) Make-before-break", "pcep.rp.flags.m", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_M,
2562 NULL, HFILL }},
2563 {&hf_pcep_rp_flags_e,
2564 { "(E) ERO-compression", "pcep.rp.flags.e", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_E,
2565 NULL, HFILL }},
2566 {&hf_pcep_rp_flags_n,
2567 { "(N) P2MP", "pcep.rp.flags.n", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_N,
2568 NULL, HFILL }},
2569 {&hf_pcep_rp_flags_f,
2570 { "(F) Fragmentation", "pcep.rp.flags.f", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_F,
2571 NULL, HFILL }},
2572 {&hf_PCEPF_OBJ_NO_PATH,
2573 { "NO-PATH object", "pcep.obj.nopath", FT_NONE, BASE_NONE, NULL, 0x0,
2574 NULL, HFILL }},
2575 {&hf_pcep_no_path_flags_c,
2576 { "C", "pcep.no.path.flags.c", FT_BOOLEAN, 16, TFS(&tfs_set_notset), PCEP_NO_PATH_C,
2577 NULL, HFILL }},
2578 {&hf_PCEPF_OBJ_END_POINT,
2579 { "END-POINT object", "pcep.obj.endpoint", FT_NONE, BASE_NONE, NULL, 0x0,
2580 NULL, HFILL }},
2581 {&hf_PCEPF_OBJ_BANDWIDTH,
2582 { "BANDWIDTH object", "pcep.obj.bandwidth", FT_NONE, BASE_NONE, NULL, 0x0,
2583 NULL, HFILL }},
2584 {&hf_PCEPF_OBJ_METRIC,
2585 { "METRIC object", "pcep.obj.metric", FT_NONE, BASE_NONE, NULL, 0x0,
2586 NULL, HFILL }},
2587 {&hf_pcep_metric_flags_c,
2588 { "(C) Cost", "pcep.metric.flags.c", FT_BOOLEAN, 8, TFS(&tfs_set_notset), PCEP_METRIC_C,
2589 NULL, HFILL }},
2590 {&hf_pcep_metric_flags_b,
2591 { "(B) Bound", "pcep.metric.flags.b", FT_BOOLEAN, 8, TFS(&tfs_set_notset), PCEP_METRIC_B,
2592 NULL, HFILL }},
2593 {&hf_PCEPF_OBJ_EXPLICIT_ROUTE,
2594 { "EXPLICIT ROUTE object (ERO)", "pcep.obj.ero", FT_NONE, BASE_NONE, NULL, 0x0,
2595 NULL, HFILL }},
2596 {&hf_PCEPF_OBJ_RECORD_ROUTE,
2597 { "RECORD ROUTE object (RRO)", "pcep.obj.rro", FT_NONE, BASE_NONE, NULL, 0x0,
2598 NULL, HFILL }},
2599 {&hf_PCEPF_OBJ_LSPA,
2600 { "LSPA object", "pcep.obj.lspa", FT_NONE, BASE_NONE, NULL, 0x0,
2601 NULL, HFILL }},
2602 {&hf_pcep_lspa_flags_l,
2603 { "Local Protection Desired (L)", "pcep.lspa.flags.l", FT_BOOLEAN, 8, TFS(&tfs_set_notset), PCEP_LSPA_L,
2604 NULL, HFILL }},
2605 {&hf_PCEPF_OBJ_IRO,
2606 { "IRO object", "pcep.obj.iro", FT_NONE, BASE_NONE, NULL, 0x0,
2607 NULL, HFILL }},
2608 {&hf_PCEPF_OBJ_SVEC,
2609 { "SVEC object", "pcep.obj.svec", FT_NONE, BASE_NONE, NULL, 0x0,
2610 NULL, HFILL }},
2612 {&hf_pcep_svec_flags_l,
2613 { "Link diverse (L)", "pcep.svec.flags.l", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_SVEC_L,
2614 NULL, HFILL }},
2616 {&hf_pcep_svec_flags_n,
2617 { "Node diverse (N)", "pcep.svec.flags.n", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_SVEC_N,
2618 NULL, HFILL }},
2620 {&hf_pcep_svec_flags_s,
2621 { "SRLG diverse (S)", "pcep.svec.flags.s", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_SVEC_S,
2622 NULL, HFILL }},
2624 {&hf_PCEPF_OBJ_NOTIFICATION,
2625 { "NOTIFICATION object", "pcep.obj.notification", FT_NONE, BASE_NONE, NULL, 0x0,
2626 NULL, HFILL }},
2628 {&hf_PCEPF_NOTI_TYPE,
2629 { "Notification Value", "pcep.notification.value1", FT_UINT32, BASE_DEC, VALS(pcep_notification_types_vals), 0x0,
2630 NULL, HFILL }},
2631 {&hf_PCEPF_NOTI_VAL1,
2632 { "Notification Type", "pcep.notification.type2", FT_UINT32, BASE_DEC, VALS(pcep_notification_values1_vals), 0x0,
2633 NULL, HFILL }},
2634 {&hf_PCEPF_NOTI_VAL2,
2635 { "Notification Type", "pcep.notification.type", FT_UINT32, BASE_DEC, VALS(pcep_notification_values2_vals), 0x0,
2636 NULL, HFILL }},
2638 {&hf_PCEPF_OBJ_PCEP_ERROR,
2639 { "ERROR object", "pcep.obj.error", FT_NONE, BASE_NONE, NULL, 0x0,
2640 NULL, HFILL }},
2641 {&hf_PCEPF_ERROR_TYPE,
2642 { "Error-Type", "pcep.error.type", FT_UINT8, BASE_DEC, VALS(pcep_error_types_obj_vals), 0x0,
2643 NULL, HFILL }},
2644 {&hf_PCEPF_OBJ_LOAD_BALANCING,
2645 { "LOAD BALANCING object", "pcep.obj.loadbalancing", FT_NONE, BASE_NONE, NULL, 0x0,
2646 NULL, HFILL }},
2647 {&hf_PCEPF_OBJ_CLOSE,
2648 { "CLOSE object", "pcep.obj.close", FT_NONE, BASE_NONE, NULL, 0x0,
2649 NULL, HFILL }},
2650 {&hf_PCEPF_OBJ_PATH_KEY,
2651 { "PATH-KEY object", "pcep.obj.path_key", FT_NONE, BASE_NONE, NULL, 0x0,
2652 NULL, HFILL }},
2653 {&hf_PCEPF_OBJ_XRO,
2654 { "EXCLUDE ROUTE object (XRO)", "pcep.obj.xro", FT_NONE, BASE_NONE, NULL, 0x0,
2655 NULL, HFILL }},
2657 {&hf_PCEPF_OBJ_MONITORING,
2658 { "MONITORING object", "pcep.obj.monitoring", FT_NONE, BASE_NONE, NULL, 0x0,
2659 NULL, HFILL }},
2660 {&hf_pcep_obj_monitoring_flags_reserved,
2661 { "Reserved Flags", "pcep.obj.monitoring.flags.reserved", FT_BOOLEAN, 24, TFS(&tfs_set_notset),
2662 PCEP_OBJ_MONITORING_FLAGS_RESERVED, NULL, HFILL }},
2663 {&hf_pcep_obj_monitoring_flags_l,
2664 { "Liveness (L)", "pcep.obj.monitoring.flags.l", FT_BOOLEAN, 24, TFS(&tfs_set_notset),
2665 PCEP_OBJ_MONITORING_FLAGS_L, NULL, HFILL }},
2666 {&hf_pcep_obj_monitoring_flags_g,
2667 { "General (G)", "pcep.obj.monitoring.flags.g", FT_BOOLEAN, 24, TFS(&tfs_set_notset),
2668 PCEP_OBJ_MONITORING_FLAGS_G, NULL, HFILL }},
2669 {&hf_pcep_obj_monitoring_flags_p,
2670 { "Processing Time (P)", "pcep.obj.monitoring.flags.p", FT_BOOLEAN, 24, TFS(&tfs_set_notset),
2671 PCEP_OBJ_MONITORING_FLAGS_P, NULL, HFILL }},
2672 {&hf_pcep_obj_monitoring_flags_c,
2673 { "Overload (C)", "pcep.obj.monitoring.flags.c", FT_BOOLEAN, 24, TFS(&tfs_set_notset),
2674 PCEP_OBJ_MONITORING_FLAGS_C, NULL, HFILL }},
2675 {&hf_pcep_obj_monitoring_flags_i,
2676 { "Incomplete (I)", "pcep.obj.monitoring.flags.i", FT_BOOLEAN, 24, TFS(&tfs_set_notset),
2677 PCEP_OBJ_MONITORING_FLAGS_I, NULL, HFILL }},
2678 { &hf_pcep_obj_monitoring_monitoring_id_number,
2679 { "Monitoring ID Number", "pcep.obj.monitoring.monidnumber", FT_UINT32, BASE_DEC,
2680 NULL, 0x0, NULL, HFILL }},
2682 {&hf_PCEPF_OBJ_PCC_ID_REQ,
2683 { "PCC-ID-REQ object", "pcep.obj.pccidreq", FT_NONE, BASE_NONE, NULL, 0x0,
2684 NULL, HFILL }},
2685 { &hf_pcep_obj_pcc_id_req_ipv4,
2686 { "IPv4 address", "pcep.obj.pccidreq.ipv4", FT_IPv4, BASE_NONE,
2687 NULL, 0x0, NULL, HFILL }},
2688 { &hf_pcep_obj_pcc_id_req_ipv6,
2689 { "IPv6 address", "pcep.obj.pccidreq.ipv6", FT_IPv6, BASE_NONE,
2690 NULL, 0x0, NULL, HFILL }},
2692 {&hf_PCEPF_OBJ_OF,
2693 { "OBJECTIVE FUNCTION object (OF)", "pcep.obj.of", FT_NONE, BASE_NONE, NULL, 0x0,
2694 NULL, HFILL }},
2696 {&hf_PCEPF_OBJ_PCE_ID,
2697 { "PCE-ID object", "pcep.obj.pceid", FT_NONE, BASE_NONE, NULL, 0x0,
2698 NULL, HFILL }},
2699 { &hf_pcep_obj_pce_id_ipv4,
2700 { "IPv4 address", "pcep.obj.pceid.ipv4", FT_IPv4, BASE_NONE,
2701 NULL, 0x0, NULL, HFILL }},
2702 { &hf_pcep_obj_pce_id_ipv6,
2703 { "IPv6 address", "pcep.obj.pceid.ipv6", FT_IPv6, BASE_NONE,
2704 NULL, 0x0, NULL, HFILL }},
2706 {&hf_PCEPF_OBJ_PROC_TIME,
2707 { "PROC-TIME object", "pcep.obj.proctime", FT_NONE, BASE_NONE, NULL, 0x0,
2708 NULL, HFILL }},
2709 {&hf_pcep_obj_proc_time_flags_reserved,
2710 { "Reserved Flags", "pcep.obj.proctime.flags.reserved", FT_BOOLEAN, 16, TFS(&tfs_set_notset),
2711 PCEP_OBJ_PROC_TIME_FLAGS_RESERVED, NULL, HFILL }},
2712 {&hf_pcep_obj_proc_time_flags_e,
2713 { "Estimated (E)", "pcep.obj.proctime.flags.e", FT_BOOLEAN, 16, TFS(&tfs_set_notset),
2714 PCEP_OBJ_PROC_TIME_FLAGS_E, NULL, HFILL }},
2715 { &hf_pcep_obj_proc_time_cur_proc_time,
2716 { "Current processing time", "pcep.obj.proctime.curproctime", FT_UINT32, BASE_DEC,
2717 NULL, 0x0, NULL, HFILL }},
2718 { &hf_pcep_obj_proc_time_min_proc_time,
2719 { "Minimum processing time", "pcep.obj.proctime.minproctime", FT_UINT32, BASE_DEC,
2720 NULL, 0x0, NULL, HFILL }},
2721 { &hf_pcep_obj_proc_time_max_proc_time,
2722 { "Maximum processing time", "pcep.obj.proctime.maxproctime", FT_UINT32, BASE_DEC,
2723 NULL, 0x0, NULL, HFILL }},
2724 { &hf_pcep_obj_proc_time_ave_proc_time,
2725 { "Average processing time", "pcep.obj.proctime.aveproctime", FT_UINT32, BASE_DEC,
2726 NULL, 0x0, NULL, HFILL }},
2727 { &hf_pcep_obj_proc_time_var_proc_time,
2728 { "Variance processing time", "pcep.obj.proctime.varproctime", FT_UINT32, BASE_DEC,
2729 NULL, 0x0, NULL, HFILL }},
2731 {&hf_PCEPF_OBJ_OVERLOAD,
2732 { "OVERLOAD object", "pcep.obj.overload", FT_NONE, BASE_NONE, NULL, 0x0,
2733 NULL, HFILL }},
2734 { &hf_pcep_obj_overload_duration,
2735 { "Overload Duration", "pcep.obj.overload.duration", FT_UINT16, BASE_DEC,
2736 NULL, 0x0, NULL, HFILL }},
2738 {&hf_PCEPF_OBJ_UNKNOWN_TYPE,
2739 { "Unknown object", "pcep.obj.unknown", FT_NONE, BASE_NONE, NULL, 0x0,
2740 NULL, HFILL }},
2742 /*Subobjects*/
2743 {&hf_PCEPF_SUBOBJ,
2744 { "Type", "pcep.subobj", FT_UINT8, BASE_DEC, VALS(pcep_subobj_vals), 0,
2745 NULL, HFILL }},
2746 {&hf_PCEPF_SUBOBJ_7F,
2747 { "Type", "pcep.subobj", FT_UINT8, BASE_DEC, VALS(pcep_subobj_vals), 0x7F,
2748 NULL, HFILL }},
2750 {&hf_PCEPF_SUBOBJ_IPv4,
2751 { "SUBOBJECT: IPv4 Prefix", "pcep.subobj.ipv4", FT_NONE, BASE_NONE, NULL, 0x0,
2752 NULL, HFILL }},
2753 {&hf_PCEPF_SUBOBJ_IPv6,
2754 { "SUBOBJECT: IPv6 Prefix", "pcep.subobj.ipv6", FT_NONE, BASE_NONE, NULL, 0x0,
2755 NULL, HFILL }},
2756 {&hf_PCEPF_SUBOBJ_LABEL_CONTROL,
2757 { "SUBOBJECT: Label Control", "pcep.subobj.label.control", FT_NONE, BASE_NONE, NULL, 0x0,
2758 NULL, HFILL }},
2759 {&hf_PCEPF_SUBOBJ_UNNUM_INTERFACEID,
2760 { "SUBOBJECT: Unnumbered Interface ID", "pcep.subobj.unnum.interfaceid", FT_NONE, BASE_NONE, NULL, 0x0,
2761 NULL, HFILL }},
2762 {&hf_PCEPF_SUBOBJ_AUTONOMOUS_SYS_NUM,
2763 { "SUBOBJECT: Autonomous System Number", "pcep.subobj.autonomous.sys.num", FT_NONE, BASE_NONE, NULL, 0x0,
2764 NULL, HFILL }},
2765 {&hf_PCEPF_SUBOBJ_SRLG,
2766 { "SUBOBJECT: SRLG", "pcep.subobj.srlg", FT_NONE, BASE_NONE, NULL, 0x0,
2767 NULL, HFILL }},
2768 {&hf_PCEPF_SUBOBJ_EXRS,
2769 { "SUBOBJECT: EXRS", "pcep.subobj.exrs", FT_NONE, BASE_NONE, NULL, 0x0,
2770 NULL, HFILL }},
2771 {&hf_PCEPF_SUBOBJ_PKSv4,
2772 { "SUBOBJECT: Path Key (IPv4)", "pcep.subobj.path_key.ipv4", FT_NONE, BASE_NONE, NULL, 0x0,
2773 NULL, HFILL }},
2774 {&hf_PCEPF_SUBOBJ_PKSv6,
2775 { "SUBOBJECT: Path Key (IPv6)", "pcep.subobj.path_key.ipv6", FT_NONE, BASE_NONE, NULL, 0x0,
2776 NULL, HFILL }},
2777 {&hf_PCEPF_SUBOBJ_XRO,
2778 { "Type", "pcep.subobj.label", FT_UINT32, BASE_DEC, VALS(pcep_subobj_xro_vals), 0x7F,
2779 NULL, HFILL }},
2780 {&hf_pcep_xro_flags_f,
2781 { "Fail (F)", "pcep.xro.flags.f", FT_BOOLEAN, 16, TFS(&tfs_set_notset), PCEP_XRO_F,
2782 NULL, HFILL }},
2783 #if 0
2784 {&hf_PCEPF_SUB_XRO_ATTRIB,
2785 { "Attribute", "pcep.xro.sub.attribute", FT_UINT32, BASE_DEC, VALS(pcep_xro_attribute_obj_vals), 0x0,
2786 NULL, HFILL }},
2787 #endif
2788 {&pcep_subobj_flags_lpa,
2789 { "Local Protection Available", "pcep.subobj.flags.lpa", FT_BOOLEAN, 8, TFS(&tfs_set_notset), PCEP_SUB_LPA,
2790 NULL, HFILL }},
2791 {&pcep_subobj_flags_lpu,
2792 { "Local protection in Use", "pcep.subobj.flags.lpu", FT_BOOLEAN, 8, TFS(&tfs_set_notset), PCEP_SUB_LPU,
2793 NULL, HFILL }},
2794 {&pcep_subobj_label_flags_gl,
2795 { "Global Label", "pcep.subobj.label.flags.gl", FT_BOOLEAN, 8, TFS(&tfs_set_notset), PCEP_SUB_LABEL_GL,
2796 NULL, HFILL }},
2797 {&hf_pcep_no_path_tlvs_pce,
2798 { "PCE currently unavailable", "pcep.no_path_tlvs.pce", FT_BOOLEAN, 32, TFS(&tfs_true_false), 0x0001,
2799 NULL, HFILL }},
2800 {&hf_pcep_no_path_tlvs_unk_dest,
2801 { "Unknown destination", "pcep.no_path_tlvs.unk_dest", FT_BOOLEAN, 32, TFS(&tfs_true_false), 0x0002,
2802 NULL, HFILL }},
2803 {&hf_pcep_no_path_tlvs_unk_src,
2804 { "Unknown source", "pcep.no_path_tlvs.unk_src", FT_BOOLEAN, 32, TFS(&tfs_true_false), 0x0004,
2805 NULL, HFILL }},
2807 /* Generated from convert_proto_tree_add_text.pl */
2808 { &hf_pcep_tlv_type, { "Type", "pcep.tlv.type", FT_UINT16, BASE_DEC, VALS(pcep_tlvs_vals), 0x0, NULL, HFILL }},
2809 { &hf_pcep_tlv_length, { "Length", "pcep.tlv.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2810 { &hf_pcep_request_id, { "Request-ID", "pcep.request_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2811 { &hf_pcep_tlv_data, { "Data", "pcep.tlv.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2812 { &hf_pcep_tlv_padding, { "Padding", "pcep.tlv.padding", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2813 { &hf_pcep_subobj_ipv4_length, { "Length", "pcep.subobj.ipv4.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2814 { &hf_pcep_subobj_ipv4_ipv4, { "IPv4 Address", "pcep.subobj.ipv4.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2815 { &hf_pcep_subobj_ipv4_prefix_length, { "Prefix Length", "pcep.subobj.ipv4.prefix_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2816 { &hf_pcep_subobj_ipv4_padding, { "Padding", "pcep.subobj.ipv4.padding", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2817 { &hf_pcep_subobj_ipv4_flags, { "Flags", "pcep.subobj.ipv4.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2818 { &hf_pcep_subobj_ipv4_attribute, { "Attribute", "pcep.subobj.ipv4.attribute", FT_UINT8, BASE_DEC, VALS(pcep_xro_attribute_obj_vals), 0x0, NULL, HFILL }},
2819 { &hf_pcep_subobj_ipv6_length, { "Length", "pcep.subobj.ipv6.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2820 { &hf_pcep_subobj_ipv6_ipv6, { "IPv6 Address", "pcep.subobj.ipv6.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2821 { &hf_pcep_subobj_ipv6_prefix_length, { "Prefix Length", "pcep.subobj.ipv6.prefix_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2822 { &hf_pcep_subobj_ipv6_padding, { "Padding", "pcep.subobj.ipv6.padding", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2823 { &hf_pcep_subobj_ipv6_flags, { "Flags", "pcep.subobj.ipv6.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2824 { &hf_pcep_subobj_ipv6_attribute, { "Attribute", "pcep.attribute", FT_UINT8, BASE_DEC, VALS(pcep_xro_attribute_obj_vals), 0x0, NULL, HFILL }},
2825 { &hf_pcep_subobj_label_control_length, { "Length", "pcep.subobj.label_control.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2826 { &hf_pcep_subobj_label_control_u, { "U", "pcep.subobj.label_control.u", FT_UINT8, BASE_DEC, VALS(pcep_route_u_obj_vals), 0x80, NULL, HFILL }},
2827 { &hf_pcep_subobj_label_control_reserved, { "Reserved", "pcep.subobj.label_control.reserved", FT_UINT8, BASE_DEC, NULL, 0x7F, NULL, HFILL }},
2828 { &hf_pcep_subobj_label_control_c_type, { "C-Type", "pcep.subobj.label_control.c_type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2829 { &hf_pcep_subobj_label_control_label, { "Label", "pcep.subobj.label_control.label", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2830 { &hf_pcep_subobj_label_control_flags, { "Flags", "pcep.subobj.label_control.flags", FT_UINT8, BASE_HEX, NULL, 0x7F, NULL, HFILL }},
2831 { &hf_pcep_subobj_unnumb_interfaceID_length, { "Length", "pcep.subobj.unnumb_interfaceID.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2832 { &hf_pcep_subobj_unnumb_interfaceID_reserved, { "Reserved", "pcep.subobj.unnumb_interfaceID.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2833 { &hf_pcep_subobj_unnumb_interfaceID_flags, { "Flags", "pcep.subobj.unnumb_interfaceID.flags", FT_UINT16, BASE_HEX, NULL, 0xFF00, NULL, HFILL }},
2834 { &hf_pcep_subobj_unnumb_interfaceID_reserved_rrobj, { "Reserved", "pcep.subobj.unnumb_interfaceID.reserved", FT_UINT16, BASE_HEX, NULL, 0x00FF, NULL, HFILL }},
2835 { &hf_pcep_subobj_unnumb_interfaceID_reserved_xroobj, { "Reserved", "pcep.subobj.unnumb_interfaceID.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2836 { &hf_pcep_subobj_unnumb_interfaceID_attribute, { "Attribute", "pcep.subobj.unnumb_interfaceID.attribute", FT_UINT8, BASE_DEC, VALS(pcep_xro_attribute_obj_vals), 0x0, NULL, HFILL }},
2837 { &hf_pcep_subobj_unnumb_interfaceID_router_id, { "Router ID", "pcep.subobj.unnumb_interfaceID.router_id", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2838 { &hf_pcep_subobj_unnumb_interfaceID_interface_id, { "Interface ID", "pcep.subobj.unnumb_interfaceID.interface_id", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL }},
2839 { &hf_pcep_subobj_autonomous_sys_num_length, { "Length", "pcep.subobj.autonomous_sys_num.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2840 { &hf_pcep_subobj_autonomous_sys_num_reserved, { "Reserved", "pcep.subobj.autonomous_sys_num.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2841 { &hf_pcep_subobj_autonomous_sys_num_attribute, { "Attribute", "pcep.subobj.autonomous_sys_num.attribute", FT_UINT8, BASE_DEC, VALS(pcep_xro_attribute_obj_vals), 0x0, NULL, HFILL }},
2842 { &hf_pcep_subobj_autonomous_sys_num_optional_as_number_high_octets, { "Optional AS Number High Octets", "pcep.subobj.autonomous_sys_num.optional_as_number_high_octets", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2843 { &hf_pcep_subobj_autonomous_sys_num_as_number, { "AS Number", "pcep.subobj.autonomous_sys_num.as_number", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2844 { &hf_pcep_subobj_srlg_length, { "Length", "pcep.subobj.srlg.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2845 { &hf_pcep_subobj_srlg_id, { "SRLG ID", "pcep.subobj.srlg.id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2846 { &hf_pcep_subobj_srlg_reserved, { "Reserved", "pcep.subobj.srlg.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2847 { &hf_pcep_subobj_srlg_attribute, { "Attribute", "pcep.subobj.srlg.attribute", FT_UINT8, BASE_DEC, VALS(pcep_xro_attribute_obj_vals), 0x0, NULL, HFILL }},
2848 { &hf_pcep_subobj_exrs_length, { "Length", "pcep.subobj.exrs.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2849 { &hf_pcep_subobj_exrs_reserved, { "Reserved", "pcep.subobj.exrs.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2850 { &hf_pcep_subobj_pksv4_length, { "Length", "pcep.subobj.pksv4.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2851 { &hf_pcep_subobj_pksv4_path_key, { "Path Key", "pcep.subobj.pksv4.path_key", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL }},
2852 { &hf_pcep_subobj_pksv4_pce_id, { "PCE ID", "pcep.subobj.pksv4.pce_id", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2853 { &hf_pcep_subobj_pksv6_length, { "Length", "pcep.subobj.pksv6.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2854 { &hf_pcep_subobj_pksv6_path_key, { "Path Key", "pcep.subobj.pksv6.path_key", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL }},
2855 { &hf_pcep_subobj_pksv6_pce_id, { "PCE ID", "pcep.subobj.pksv6.pce_id", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2856 { &hf_pcep_open_obj_pcep_version, { "PCEP Version", "pcep.obj.open.pcep_version", FT_UINT8, BASE_DEC, NULL, 0xE0, NULL, HFILL }},
2857 { &hf_pcep_open_obj_flags, { "Flags", "pcep.obj.open.flags", FT_UINT8, BASE_HEX, NULL, 0x1F, NULL, HFILL }},
2858 { &hf_pcep_open_obj_keepalive, { "Keepalive", "pcep.obj.open.keepalive", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2859 { &hf_pcep_open_obj_deadtime, { "Deadtime", "pcep.obj.open.deadtime", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2860 { &hf_pcep_open_obj_sid, { "SID", "pcep.obj.open.sid", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2861 { &hf_pcep_rp_obj_reserved, { "Reserved", "pcep.obj.rp.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2862 { &hf_pcep_rp_obj_flags, { "Flags", "pcep.obj.rp.flags", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2863 { &hf_pcep_rp_obj_requested_id_number, { "Requested ID Number", "pcep.obj.rp.requested_id_number", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2864 { &hf_pcep_no_path_obj_flags, { "Flags", "pcep.obj.no_path.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2865 { &hf_pcep_no_path_obj_reserved, { "Reserved", "pcep.obj.no_path.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2866 { &hf_pcep_end_point_obj_source_ipv4_address, { "Source IPv4 Address", "pcep.obj.end_point.source_ipv4_address", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2867 { &hf_pcep_end_point_obj_destination_ipv4_address, { "Destination IPv4 Address", "pcep.obj.end_point.destination_ipv4_address", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2868 { &hf_pcep_end_point_obj_source_ipv6_address, { "Source IPv6 Address", "pcep.obj.end_point.source_ipv6_address", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2869 { &hf_pcep_end_point_obj_destination_ipv6_address, { "Destination IPv6 Address", "pcep.obj.end_point.destination_ipv6_address", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2870 { &hf_pcep_bandwidth, { "Bandwidth", "pcep.bandwidth", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2871 { &hf_pcep_metric_obj_reserved, { "Reserved", "pcep.obj.metric.reserved", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2872 { &hf_pcep_metric_obj_flags, { "Flags", "pcep.obj.metric.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2873 { &hf_pcep_metric_obj_type, { "Type", "pcep.obj.metric.type", FT_UINT8, BASE_DEC, VALS(pcep_metric_obj_vals), 0x0, NULL, HFILL }},
2874 { &hf_pcep_metric_obj_metric_value, { "Metric Value", "pcep.obj.metric.metric_value", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2875 { &hf_pcep_lspa_obj_exclude_any, { "Exclude-Any", "pcep.obj.lspa.exclude_any", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2876 { &hf_pcep_lspa_obj_include_any, { "Include-Any", "pcep.obj.lspa.include_any", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2877 { &hf_pcep_lspa_obj_include_all, { "Include-All", "pcep.obj.lspa.include_all", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2878 { &hf_pcep_lspa_obj_setup_priority, { "Setup Priority", "pcep.obj.lspa.setup_priority", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2879 { &hf_pcep_lspa_obj_holding_priority, { "Holding Priority", "pcep.obj.lspa.holding_priority", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2880 { &hf_pcep_lspa_obj_flags, { "Flags", "pcep.obj.lspa.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2881 { &hf_pcep_lspa_obj_reserved, { "Reserved", "pcep.obj.lspa.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2882 { &hf_pcep_svec_obj_reserved, { "Reserved", "pcep.obj.svec.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2883 { &hf_pcep_svec_obj_flags, { "Flags", "pcep.obj.svec.flags", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2884 { &hf_pcep_svec_obj_request_id_number, { "Request-ID-Number", "pcep.obj.svec.request_id_number", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2885 { &hf_pcep_notification_obj_reserved, { "Reserved", "pcep.obj.notification.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2886 { &hf_pcep_notification_obj_flags, { "Flags", "pcep.obj.notification.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2887 { &hf_pcep_notification_obj_type, { "Notification Type", "pcep.obj.notification.type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2888 { &hf_pcep_notification_obj_value, { "Notification Value", "pcep.obj.notification.value", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2889 { &hf_pcep_error_obj_reserved, { "Reserved", "pcep.obj.error.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2890 { &hf_pcep_error_obj_flags, { "Flags", "pcep.obj.error.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2891 { &hf_pcep_balancing_obj_reserved, { "Reserved", "pcep.obj.balancing.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2892 { &hf_pcep_balancing_obj_flags, { "Flags", "pcep.obj.balancing.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2893 { &hf_pcep_balancing_obj_maximum_number_of_te_lsps, { "Maximum Number of TE LSPs", "pcep.obj.balancing.maximum_number_of_te_lsps", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2894 { &hf_pcep_balancing_obj_minimum_bandwidth, { "Minimum Bandwidth", "pcep.obj.balancing.minimum_bandwidth", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2895 { &hf_pcep_close_obj_reserved, { "Reserved", "pcep.obj.close.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2896 { &hf_pcep_close_obj_flags, { "Flags", "pcep.obj.close.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2897 { &hf_pcep_close_obj_reason, { "Reason", "pcep.obj.close.reason", FT_UINT8, BASE_DEC, VALS(pcep_close_reason_obj_vals), 0x0, NULL, HFILL }},
2898 { &hf_pcep_xro_obj_reserved, { "Reserved", "pcep.obj.xro.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2899 { &hf_pcep_xro_obj_flags, { "Flags", "pcep.obj.xro.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2900 { &hf_pcep_obj_monitoring_reserved, { "Reserved", "pcep.obj.monitoring.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2901 { &hf_pcep_obj_monitoring_flags, { "Flags", "pcep.obj.monitoring.flags", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2902 { &hf_pcep_obj_of_code, { "OF-Code", "pcep.obj.of.code", FT_UINT16, BASE_DEC, VALS(pcep_of_vals), 0x0, NULL, HFILL }},
2903 { &hf_pcep_obj_proc_time_reserved, { "Reserved", "pcep.obj.proc_time.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2904 { &hf_pcep_obj_proc_time_flags, { "Flags", "pcep.obj.proc_time.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2905 { &hf_pcep_obj_overload_flags, { "Flags", "pcep.obj.overload.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2906 { &hf_pcep_obj_overload_reserved, { "Reserved", "pcep.obj.overload.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2907 { &hf_pcep_object_type, { "Object Type", "pcep.object_type", FT_UINT8, BASE_DEC, NULL, MASK_OBJ_TYPE, NULL, HFILL }},
2908 { &hf_pcep_object_length, { "Object Length", "pcep.object_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2909 { &hf_pcep_version, { "PCEP Version", "pcep.version", FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
2910 { &hf_pcep_flags, { "Flags", "pcep.flags", FT_UINT8, BASE_HEX, NULL, 0x1F, NULL, HFILL }},
2911 { &hf_pcep_message_length, { "Message length", "pcep.msg_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2912 { &hf_pcep_of_code, { "OF-Code", "pcep.of_code", FT_UINT16, BASE_DEC, VALS(pcep_of_vals), 0x0, NULL, HFILL }},
2913 { &hf_pcep_subobj_ipv4_l, { "L", "pcep.subobj.ipv4.l", FT_UINT8, BASE_DEC, VALS(pcep_route_l_obj_vals), Mask_L, NULL, HFILL }},
2914 { &hf_pcep_subobj_iro_ipv4_l, { "L", "pcep.iro.subobj.ipv4.l", FT_UINT8, BASE_HEX, NULL, Mask_L, NULL, HFILL }},
2915 { &hf_pcep_subobj_ipv4_x, { "X", "pcep.subobj.ipv4.x", FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL }},
2916 { &hf_pcep_subobj_ipv6_l, { "L", "pcep.subobj.ipv6.l", FT_UINT8, BASE_DEC, VALS(pcep_route_l_obj_vals), Mask_L, NULL, HFILL }},
2917 { &hf_pcep_subobj_iro_ipv6_l, { "L", "pcep.iro.subobj.ipv6.l", FT_UINT8, BASE_HEX, NULL, Mask_L, NULL, HFILL }},
2918 { &hf_pcep_subobj_ipv6_x, { "X", "pcep.subobj.ipv6.x", FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL }},
2919 { &hf_pcep_subobj_label_control_l, { "L", "pcep.subobj.label_control.l", FT_UINT8, BASE_DEC, VALS(pcep_route_l_obj_vals), Mask_L, NULL, HFILL }},
2920 { &hf_pcep_subobj_unnumb_interfaceID_l, { "L", "pcep.subobj.unnumb_interfaceID.l", FT_UINT8, BASE_DEC, VALS(pcep_route_l_obj_vals), Mask_L, NULL, HFILL }},
2921 { &hf_pcep_subobj_iro_unnumb_interfaceID_l, { "L", "pcep.iro.subobj.unnumb_interfaceID.l", FT_UINT8, BASE_HEX, NULL, Mask_L, NULL, HFILL }},
2922 { &hf_pcep_subobj_unnumb_interfaceID_x, { "X", "pcep.subobj.unnumb_interfaceID.x", FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL }},
2923 { &hf_pcep_subobj_autonomous_sys_num_x, { "X", "pcep.subobj.autonomous_sys_num.x", FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL }},
2924 { &hf_pcep_subobj_iro_autonomous_sys_num_l, { "L", "pcep.iro.subobj.autonomous_sys_num.l", FT_UINT8, BASE_HEX, NULL, Mask_L, NULL, HFILL }},
2925 { &hf_pcep_subobj_autonomous_sys_num_l, { "L", "pcep.subobj.autonomous_sys_num.l", FT_UINT8, BASE_DEC, VALS(pcep_route_l_obj_vals), Mask_L, NULL, HFILL }},
2926 { &hf_pcep_subobj_srlg_x, { "X", "pcep.subobj.srlg.x", FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL }},
2927 { &hf_pcep_subobj_exrs_l, { "L", "pcep.subobj.exrs.l", FT_UINT8, BASE_DEC, VALS(pcep_route_l_obj_vals), Mask_L, NULL, HFILL }},
2928 { &hf_pcep_subobj_exrs_type, { "Type", "pcep.subobj.exrs.type", FT_UINT8, BASE_DEC, NULL, 0x7F, NULL, HFILL }},
2929 { &hf_pcep_subobj_pksv4_l, { "L", "pcep.subobj.pksv4.l", FT_UINT8, BASE_DEC, VALS(pcep_route_l_obj_vals), 0x0, NULL, HFILL }},
2930 { &hf_pcep_subobj_pksv6_l, { "L", "pcep.subobj.pksv6.l", FT_UINT8, BASE_DEC, VALS(pcep_route_l_obj_vals), 0x0, NULL, HFILL }},
2931 { &hf_pcep_no_path_obj_nature_of_issue, { "Nature of Issue", "pcep.obj.no_path.nature_of_issue", FT_UINT8, BASE_DEC, VALS(pcep_no_path_obj_vals), 0x0, NULL, HFILL }},
2935 static gint *ett[] = {
2936 &ett_pcep,
2937 &ett_pcep_hdr,
2938 &ett_pcep_obj_open,
2939 &ett_pcep_obj_request_parameters,
2940 &ett_pcep_obj_no_path,
2941 &ett_pcep_obj_end_point,
2942 &ett_pcep_obj_bandwidth,
2943 &ett_pcep_obj_metric,
2944 &ett_pcep_obj_explicit_route,
2945 &ett_pcep_obj_record_route,
2946 &ett_pcep_obj_lspa,
2947 &ett_pcep_obj_iro,
2948 &ett_pcep_obj_svec,
2949 &ett_pcep_obj_notification,
2950 &ett_pcep_obj_error,
2951 &ett_pcep_obj_load_balancing,
2952 &ett_pcep_obj_close,
2953 &ett_pcep_obj_path_key,
2954 &ett_pcep_obj_xro,
2955 &ett_pcep_obj_monitoring,
2956 &ett_pcep_obj_pcc_id_req,
2957 &ett_pcep_obj_of,
2958 &ett_pcep_obj_pce_id,
2959 &ett_pcep_obj_proc_time,
2960 &ett_pcep_obj_overload,
2961 &ett_pcep_obj_unknown
2964 static ei_register_info ei[] = {
2965 /* Generated from convert_proto_tree_add_text.pl */
2966 { &ei_pcep_subobject_bad_length, { "pcep.subobject_bad_length", PI_MALFORMED, PI_WARN, "Bad subobject length", EXPFILL }},
2967 { &ei_pcep_non_defined_subobject, { "pcep.non_defined_subobject", PI_PROTOCOL, PI_WARN, "Non defined subobject for this object", EXPFILL }},
2968 { &ei_pcep_non_defined_object, { "pcep.unknown_object", PI_PROTOCOL, PI_WARN, "Unknown object", EXPFILL }},
2969 { &ei_pcep_object_length, { "pcep.object_length.bad", PI_MALFORMED, PI_WARN, "Object Length bogus", EXPFILL }},
2970 { &ei_pcep_pcep_object_body_non_defined, { "pcep.object_body_non_defined", PI_PROTOCOL, PI_WARN, "PCEP Object BODY non defined", EXPFILL }},
2971 { &ei_pcep_unknown_type_object, { "pcep.unknown_type_object", PI_PROTOCOL, PI_WARN, "UNKNOWN Type Object", EXPFILL }},
2974 expert_module_t* expert_pcep;
2976 /*Register the protocol name and description*/
2977 proto_pcep = proto_register_protocol (
2978 "Path Computation Element communication Protocol", "PCEP", "pcep");
2980 /* Required function calls to register the header fields and subtrees used */
2981 proto_register_field_array(proto_pcep, pcepf_info, array_length(pcepf_info));
2982 proto_register_subtree_array(ett, array_length(ett));
2983 expert_pcep = expert_register_protocol(proto_pcep);
2984 expert_register_field_array(expert_pcep, ei, array_length(ei));
2987 /*Dissector Handoff*/
2988 void
2989 proto_reg_handoff_pcep(void)
2991 dissector_handle_t pcep_handle;
2993 pcep_handle = new_create_dissector_handle(dissect_pcep, proto_pcep);
2994 dissector_add_uint("tcp.port", TCP_PORT_PCEP, pcep_handle);
2998 * Editor modelines
3000 * Local Variables:
3001 * c-basic-offset: 4
3002 * tab-width: 8
3003 * indent-tabs-mode: nil
3004 * End:
3006 * ex: set shiftwidth=4 tabstop=8 expandtab:
3007 * :indentSize=4:tabSize=8:noTabs=true: