2007-12-28 23:08:48 +00:00
|
|
|
/* packet-pcep.c
|
2007-12-28 23:05:22 +00:00
|
|
|
* Routines for PCEP packet disassembly
|
2007-12-28 03:06:30 +00:00
|
|
|
* draft-ietf-pce-pcep-09
|
|
|
|
* draft-ietf-pce-pcep-xro-02
|
2011-09-17 03:58:41 +00:00
|
|
|
* See also RFC 4655, RFC 4657, RFC 5520, RFC 5521, RFC 5440 and RFC 5541
|
2007-12-23 14:19:48 +00:00
|
|
|
*
|
2011-01-15 03:25:43 +00:00
|
|
|
* (c) Copyright 2007 Silvia Cristina Tejedor <silviacristina.tejedor@gmail.com>
|
2007-12-23 14:19:48 +00:00
|
|
|
*
|
2011-01-15 03:25:43 +00:00
|
|
|
* $Id$
|
2007-12-23 14:19:48 +00:00
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2012-03-30 22:36:02 +00:00
|
|
|
*
|
|
|
|
* Added support of "A Set of Monitoring Tools for Path Computation Element
|
|
|
|
* (PCE)-Based Architecture" (RFC 5886)
|
|
|
|
* (c) Copyright 2012 Svetoslav Duhovnikov <duhovnikov[AT]gmail.com>
|
2007-12-23 14:19:48 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <epan/packet.h>
|
|
|
|
#include <epan/dissectors/packet-tcp.h>
|
|
|
|
|
|
|
|
/*differents types of objects*/
|
2007-12-28 23:05:22 +00:00
|
|
|
#define PCEP_OPEN_OBJ 1
|
|
|
|
#define PCEP_RP_OBJ 2
|
|
|
|
#define PCEP_NO_PATH_OBJ 3
|
|
|
|
#define PCEP_END_POINT_OBJ 4
|
|
|
|
#define PCEP_BANDWIDTH_OBJ 5
|
|
|
|
#define PCEP_METRIC_OBJ 6
|
|
|
|
#define PCEP_EXPLICIT_ROUTE_OBJ 7
|
|
|
|
#define PCEP_RECORD_ROUTE_OBJ 8
|
|
|
|
#define PCEP_LSPA_OBJ 9
|
|
|
|
#define PCEP_IRO_OBJ 10
|
|
|
|
#define PCEP_SVEC_OBJ 11
|
|
|
|
#define PCEP_NOTIFICATION_OBJ 12
|
|
|
|
#define PCEP_PCEP_ERROR_OBJ 13
|
|
|
|
#define PCEP_LOAD_BALANCING_OBJ 14
|
|
|
|
#define PCEP_CLOSE_OBJ 15
|
2011-02-03 20:14:38 +00:00
|
|
|
#define PCEP_PATH_KEY_OBJ 16
|
2007-12-28 23:05:22 +00:00
|
|
|
#define PCEP_XRO_OBJ 17
|
2012-03-30 22:36:02 +00:00
|
|
|
#define PCEP_OBJ_MONITORING 19
|
|
|
|
#define PCEP_OBJ_PCC_ID_REQ 20
|
2011-02-03 20:14:38 +00:00
|
|
|
#define PCEP_OF_OBJ 21
|
2012-03-30 22:36:02 +00:00
|
|
|
#define PCEP_OBJ_PCE_ID 25
|
|
|
|
#define PCEP_OBJ_PROC_TIME 26
|
|
|
|
#define PCEP_OBJ_OVERLOAD 27
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
/*Subobjects of EXPLICIT ROUTE Object*/
|
2007-12-28 23:05:22 +00:00
|
|
|
#define PCEP_SUB_IPv4 1
|
2011-01-15 03:25:43 +00:00
|
|
|
#define PCEP_SUB_IPv6 2
|
|
|
|
#define PCEP_SUB_LABEL_CONTROL 3
|
2007-12-28 23:05:22 +00:00
|
|
|
#define PCEP_SUB_UNNUMB_INTERFACE_ID 4
|
|
|
|
#define PCEP_SUB_AUTONOMOUS_SYS_NUM 32
|
|
|
|
#define PCEP_SUB_EXRS 33
|
2011-09-17 03:58:41 +00:00
|
|
|
#define PCEP_SUB_SRLG 34
|
2011-02-03 20:14:38 +00:00
|
|
|
#define PCEP_SUB_PKSv4 64
|
|
|
|
#define PCEP_SUB_PKSv6 65
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
/*Possible values of the NI in the NO-PATH object*/
|
|
|
|
#define NO_SATISFYING 0
|
|
|
|
#define CHAIN_BROKEN 1
|
|
|
|
|
|
|
|
/*Possible values of L in the ERO and IRO objects */
|
|
|
|
#define STRICT_HOP 0
|
|
|
|
#define LOOSE_HOP 1
|
|
|
|
|
|
|
|
/*Possible values of U in the ERO and RRO objects */
|
|
|
|
#define DOWNSTREAM_LABEL 0
|
|
|
|
#define UPSTREAM_LABEL 1
|
|
|
|
|
|
|
|
/*Possible values of Notification Type */
|
|
|
|
#define NOT_REQ_CANCEL 1
|
2007-12-28 23:05:22 +00:00
|
|
|
#define PCEP_CONGESTION 2
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
/*Possible values of Notification Value for NT=1*/
|
2011-01-15 03:25:43 +00:00
|
|
|
#define NOTI_PCC_CANCEL_REQ 1
|
2007-12-23 14:19:48 +00:00
|
|
|
#define NOTI_PCE_CANCEL_REQ 2
|
|
|
|
|
|
|
|
/*Possible values of Notification Value for NT=2*/
|
2011-01-15 03:25:43 +00:00
|
|
|
#define NOTI_PCE_CONGEST 1
|
2007-12-23 14:19:48 +00:00
|
|
|
#define NOTI_PCE_NO_CONGEST 2
|
|
|
|
|
|
|
|
/*Possible types of errors */
|
|
|
|
#define ESTABLISH_FAILURE 1
|
|
|
|
#define CAP_NOT_SUPPORTED 2
|
2011-01-15 03:25:43 +00:00
|
|
|
#define UNKNOWN_OBJ 3
|
2007-12-23 14:19:48 +00:00
|
|
|
#define NOT_SUPP_OBJ 4
|
|
|
|
#define POLICY_VIOLATION 5
|
2011-01-15 03:25:43 +00:00
|
|
|
#define MANDATORY_OBJ_MIS 6
|
|
|
|
#define SYNCH_PCREQ_MIS 7
|
2007-12-23 14:19:48 +00:00
|
|
|
#define UNKNOWN_REQ_REF 8
|
|
|
|
#define ATTEMPT_2_SESSION 9
|
2011-02-03 20:14:38 +00:00
|
|
|
#define INVALID_OBJ 10
|
|
|
|
#define UNRECO_EXRS_SUBOBJ 11
|
|
|
|
#define DIFFSERV_TE_ERROR 12
|
|
|
|
#define BRPC_FAILURE 13
|
|
|
|
#define GCO_ERROR 15
|
|
|
|
#define P2MP_CAPABILITY_ERROR 16
|
|
|
|
#define P2MP_END_POINTS_ERROR 17
|
|
|
|
#define P2MP_FRAGMENT_ERROR 18
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
/*Different values of Reason in the CLOSE object */
|
|
|
|
#define NO_EXP_PROV 1
|
|
|
|
#define DEADTIME_PROV 2
|
2011-01-15 03:25:43 +00:00
|
|
|
#define RECEP_MALFORM_MSG 3
|
2007-12-23 14:19:48 +00:00
|
|
|
|
2007-12-24 16:27:27 +00:00
|
|
|
/*Different values of Attribute in the XRO object */
|
|
|
|
#define ATTR_INTERFACE 0
|
|
|
|
#define ATTR_NODE 1
|
|
|
|
#define ATTR_SRLG 2
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
/*Mask for the flags of HEADER of Messages*/
|
2007-12-28 23:05:22 +00:00
|
|
|
#define PCEP_HDR_MSG_RESERVED 0x1f
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
/*Mask for the type of HEADER of Objects*/
|
|
|
|
#define MASK_OBJ_TYPE 0xF0
|
|
|
|
|
|
|
|
/*Mask for the flags of HEADER of Objects*/
|
2007-12-28 23:05:22 +00:00
|
|
|
#define PCEP_HDR_OBJ_RESERVED 0x0C
|
|
|
|
#define PCEP_HDR_OBJ_P 0x02
|
|
|
|
#define PCEP_HDR_OBJ_I 0x01
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
/*Mask for the flags of OPEN Object*/
|
2007-12-28 23:05:22 +00:00
|
|
|
#define PCEP_OPEN_RES 0x1F
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
/*Mask for the flags of RP Object*/
|
2007-12-28 23:05:22 +00:00
|
|
|
#define PCEP_RP_PRI 0x000007
|
|
|
|
#define PCEP_RP_R 0x000008
|
|
|
|
#define PCEP_RP_B 0x000010
|
|
|
|
#define PCEP_RP_O 0x000020
|
2011-02-03 20:14:38 +00:00
|
|
|
#define PCEP_RP_V 0x000040
|
|
|
|
#define PCEP_RP_S 0x000080
|
|
|
|
#define PCEP_RP_P 0x000100
|
|
|
|
#define PCEP_RP_D 0x000200
|
|
|
|
#define PCEP_RP_M 0x000400
|
|
|
|
#define PCEP_RP_E 0x000800
|
|
|
|
#define PCEP_RP_N 0x001000
|
|
|
|
#define PCEP_RP_F 0x002000
|
|
|
|
#define PCEP_RP_RESERVED 0xFFC000
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
/*Mask for the flags of NO PATH Object*/
|
2007-12-28 23:05:22 +00:00
|
|
|
#define PCEP_NO_PATH_C 0x8000
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
/*Mask for the flags of METRIC Object*/
|
2011-02-03 20:14:38 +00:00
|
|
|
#define PCEP_METRIC_B 0x01
|
|
|
|
#define PCEP_METRIC_C 0x02
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
/*Mask for the flags of LSPA Object*/
|
2007-12-28 23:05:22 +00:00
|
|
|
#define PCEP_LSPA_L 0x01
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
/* Mask to differentiate the value of L and Type (Explicit Object)*/
|
|
|
|
#define Mask_L 0x80
|
|
|
|
#define Mask_Type 0x7f
|
|
|
|
|
2011-02-18 20:48:49 +00:00
|
|
|
/* RFC 5440 */
|
|
|
|
#define TCP_PORT_PCEP 4189
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
#define IPv4 1
|
|
|
|
#define IPv6 2
|
|
|
|
|
|
|
|
/*Mask for the flags os SVEC Object*/
|
2007-12-28 23:05:22 +00:00
|
|
|
#define PCEP_SVEC_L 0x000001
|
|
|
|
#define PCEP_SVEC_N 0x000002
|
|
|
|
#define PCEP_SVEC_S 0x000004
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
/*Mask for the flags of XRO Object*/
|
2007-12-28 23:05:22 +00:00
|
|
|
#define PCEP_XRO_F 0x0001
|
2007-12-23 14:19:48 +00:00
|
|
|
|
2012-03-30 22:36:02 +00:00
|
|
|
/*Mask for the flags of MONITORING Object*/
|
|
|
|
#define PCEP_OBJ_MONITORING_FLAGS_L 0x000001
|
|
|
|
#define PCEP_OBJ_MONITORING_FLAGS_G 0x000002
|
|
|
|
#define PCEP_OBJ_MONITORING_FLAGS_P 0x000004
|
|
|
|
#define PCEP_OBJ_MONITORING_FLAGS_C 0x000008
|
|
|
|
#define PCEP_OBJ_MONITORING_FLAGS_I 0x000010
|
|
|
|
#define PCEP_OBJ_MONITORING_FLAGS_RESERVED 0xFFFFE0
|
|
|
|
|
|
|
|
/*Define types for PCC-ID-REQ Object*/
|
|
|
|
#define PCEP_OBJ_PCC_ID_REQ_IPv4 1
|
|
|
|
#define PCEP_OBJ_PCC_ID_REQ_IPv6 2
|
|
|
|
|
|
|
|
/*Define types for PCE-ID Object*/
|
|
|
|
#define PCEP_OBJ_PCE_ID_IPv4 1
|
|
|
|
#define PCEP_OBJ_PCE_ID_IPv6 2
|
|
|
|
|
|
|
|
/*Mask for the flags of PROC-TIME Object*/
|
|
|
|
#define PCEP_OBJ_PROC_TIME_FLAGS_E 0x0001
|
|
|
|
#define PCEP_OBJ_PROC_TIME_FLAGS_RESERVED 0xFFFE
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
/*Mask for the flags of IPv4, IPv6 and UNnumbered InterfaceID Subobjects of RRO Object*/
|
2007-12-28 23:05:22 +00:00
|
|
|
#define PCEP_SUB_LPA 0x01
|
|
|
|
#define PCEP_SUB_LPU 0x02
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
/*Mask for the flags of Label SubObject*/
|
2007-12-28 23:05:22 +00:00
|
|
|
#define PCEP_SUB_LABEL_GL 0x01
|
|
|
|
|
|
|
|
|
|
|
|
static int proto_pcep = -1;
|
|
|
|
static gint ett_pcep = -1;
|
|
|
|
static gint ett_pcep_hdr = -1;
|
|
|
|
static gint pcep_hdr_msg_flags_reserved= -1;
|
|
|
|
static gint pcep_hdr_obj_flags_reserved= -1;
|
|
|
|
static gint pcep_hdr_obj_flags_p= -1;
|
|
|
|
static gint pcep_hdr_obj_flags_i= -1;
|
|
|
|
static gint ett_pcep_obj_open = -1;
|
|
|
|
static gint pcep_open_flags_res = -1;
|
|
|
|
static gint ett_pcep_obj_request_parameters = -1;
|
|
|
|
static gint pcep_rp_flags_pri = -1;
|
|
|
|
static gint pcep_rp_flags_r = -1;
|
|
|
|
static gint pcep_rp_flags_b = -1;
|
|
|
|
static gint pcep_rp_flags_o = -1;
|
2011-02-03 20:14:38 +00:00
|
|
|
static gint pcep_rp_flags_v = -1;
|
|
|
|
static gint pcep_rp_flags_s = -1;
|
|
|
|
static gint pcep_rp_flags_p = -1;
|
|
|
|
static gint pcep_rp_flags_d = -1;
|
|
|
|
static gint pcep_rp_flags_m = -1;
|
|
|
|
static gint pcep_rp_flags_e = -1;
|
|
|
|
static gint pcep_rp_flags_n = -1;
|
|
|
|
static gint pcep_rp_flags_f = -1;
|
2007-12-28 23:05:22 +00:00
|
|
|
static gint pcep_rp_flags_reserved = -1;
|
|
|
|
static gint ett_pcep_obj_no_path = -1;
|
|
|
|
static gint pcep_no_path_flags_c = -1;
|
|
|
|
static gint ett_pcep_obj_end_point = -1;
|
|
|
|
static gint ett_pcep_obj_bandwidth = -1;
|
|
|
|
static gint ett_pcep_obj_metric = -1;
|
|
|
|
static gint pcep_metric_flags_c = -1;
|
|
|
|
static gint pcep_metric_flags_b = -1;
|
|
|
|
static gint ett_pcep_obj_explicit_route = -1;
|
|
|
|
static gint ett_pcep_obj_record_route = -1;
|
|
|
|
static gint ett_pcep_obj_lspa = -1;
|
|
|
|
static gint pcep_lspa_flags_l= -1;
|
|
|
|
static gint ett_pcep_obj_iro = -1;
|
|
|
|
static gint ett_pcep_obj_svec = -1;
|
|
|
|
static gint pcep_svec_flags_l= -1;
|
|
|
|
static gint pcep_svec_flags_n= -1;
|
|
|
|
static gint pcep_svec_flags_s= -1;
|
|
|
|
static gint ett_pcep_obj_notification = -1;
|
|
|
|
static gint ett_pcep_obj_error = -1;
|
|
|
|
static gint ett_pcep_obj_load_balancing = -1;
|
|
|
|
static gint ett_pcep_obj_close = -1;
|
2011-02-03 20:14:38 +00:00
|
|
|
static gint ett_pcep_obj_path_key = -1;
|
2007-12-28 23:05:22 +00:00
|
|
|
static gint ett_pcep_obj_xro = -1;
|
|
|
|
static gint pcep_xro_flags_f= -1;
|
2012-03-30 22:36:02 +00:00
|
|
|
static gint ett_pcep_obj_monitoring = -1;
|
|
|
|
static gint pcep_obj_monitoring_flags_reserved = -1;
|
|
|
|
static gint pcep_obj_monitoring_flags_l= -1;
|
|
|
|
static gint pcep_obj_monitoring_flags_g= -1;
|
|
|
|
static gint pcep_obj_monitoring_flags_p= -1;
|
|
|
|
static gint pcep_obj_monitoring_flags_c= -1;
|
|
|
|
static gint pcep_obj_monitoring_flags_i= -1;
|
|
|
|
static gint pcep_obj_monitoring_monitoring_id_number = -1;
|
|
|
|
static gint ett_pcep_obj_pcc_id_req = -1;
|
|
|
|
static gint pcep_obj_pcc_id_req_ipv4 = -1;
|
|
|
|
static gint pcep_obj_pcc_id_req_ipv6 = -1;
|
2011-10-18 01:27:01 +00:00
|
|
|
static gint ett_pcep_obj_of = -1;
|
2012-03-30 22:36:02 +00:00
|
|
|
static gint ett_pcep_obj_pce_id = -1;
|
|
|
|
static gint pcep_obj_pce_id_ipv4 = -1;
|
|
|
|
static gint pcep_obj_pce_id_ipv6 = -1;
|
|
|
|
static gint ett_pcep_obj_proc_time = -1;
|
|
|
|
static gint pcep_obj_proc_time_flags_reserved = -1;
|
|
|
|
static gint pcep_obj_proc_time_flags_e = -1;
|
|
|
|
static gint pcep_obj_proc_time_cur_proc_time = -1;
|
|
|
|
static gint pcep_obj_proc_time_min_proc_time = -1;
|
|
|
|
static gint pcep_obj_proc_time_max_proc_time = -1;
|
|
|
|
static gint pcep_obj_proc_time_ave_proc_time = -1;
|
|
|
|
static gint pcep_obj_proc_time_var_proc_time = -1;
|
|
|
|
static gint ett_pcep_obj_overload = -1;
|
|
|
|
static gint pcep_obj_overload_duration = -1;
|
2007-12-28 23:05:22 +00:00
|
|
|
static gint pcep_subobj_flags_lpa= -1;
|
|
|
|
static gint pcep_subobj_flags_lpu= -1;
|
|
|
|
static gint pcep_subobj_label_flags_gl= -1;
|
|
|
|
static gint ett_pcep_obj_unknown = -1;
|
2012-09-25 01:00:41 +00:00
|
|
|
static gint hf_pcep_no_path_tlvs_pce = -1;
|
|
|
|
static gint hf_pcep_no_path_tlvs_unk_dest = -1;
|
|
|
|
static gint hf_pcep_no_path_tlvs_unk_src = -1;
|
2007-12-28 23:05:22 +00:00
|
|
|
|
|
|
|
/* PCEP message types.*/
|
2007-12-23 14:19:48 +00:00
|
|
|
typedef enum {
|
2007-12-28 23:05:22 +00:00
|
|
|
PCEP_MSG_NO_VALID,
|
|
|
|
PCEP_MSG_OPEN,
|
2011-01-15 03:25:43 +00:00
|
|
|
PCEP_MSG_KEEPALIVE,
|
2007-12-28 23:05:22 +00:00
|
|
|
PCEP_MSG_PATH_COMPUTATION_REQUEST,
|
2011-01-15 03:25:43 +00:00
|
|
|
PCEP_MSG_PATH_COMPUTATION_REPLY,
|
|
|
|
PCEP_MSG_NOTIFICATION,
|
|
|
|
PCEP_MSG_ERROR,
|
2012-03-30 22:36:02 +00:00
|
|
|
PCEP_MSG_CLOSE,
|
|
|
|
PCEP_MSG_PATH_COMPUTATION_MONITORING_REQUEST,
|
|
|
|
PCEP_MSG_PATH_COMPUTATION_MONITORING_REPLY
|
2007-12-28 23:05:22 +00:00
|
|
|
} pcep_message_types;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
static const value_string message_type_vals[] = {
|
2007-12-28 23:05:22 +00:00
|
|
|
{PCEP_MSG_OPEN, "OPEN MESSAGE" },
|
|
|
|
{PCEP_MSG_KEEPALIVE, "KEEPALIVE MESSAGE" },
|
|
|
|
{PCEP_MSG_PATH_COMPUTATION_REQUEST, "PATH COMPUTATION REQUEST MESSAGE" },
|
|
|
|
{PCEP_MSG_PATH_COMPUTATION_REPLY, "PATH COMPUTATION REPLY MESSAGE" },
|
|
|
|
{PCEP_MSG_NOTIFICATION, "NOTIFICATION MESSAGE" },
|
2011-01-15 03:25:43 +00:00
|
|
|
{PCEP_MSG_ERROR, "ERROR MESSAGE" },
|
2007-12-28 23:05:22 +00:00
|
|
|
{PCEP_MSG_CLOSE, "CLOSE MESSAGE" },
|
2012-03-30 22:36:02 +00:00
|
|
|
{PCEP_MSG_PATH_COMPUTATION_MONITORING_REQUEST, "PATH COMPUTATION MONITORING REQUEST MESSAGE" },
|
|
|
|
{PCEP_MSG_PATH_COMPUTATION_MONITORING_REPLY, "PATH COMPUTATION MONITORING REPLY MESSAGE" },
|
2007-12-23 14:19:48 +00:00
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
static const value_string pcep_class_vals[] = {
|
|
|
|
{PCEP_OPEN_OBJ, "OPEN OBJECT" },
|
|
|
|
{PCEP_RP_OBJ, "RP OBJECT" },
|
|
|
|
{PCEP_NO_PATH_OBJ, "NO-PATH OBJECT" },
|
|
|
|
{PCEP_END_POINT_OBJ, "END-POINT OBJECT" },
|
|
|
|
{PCEP_BANDWIDTH_OBJ, "BANDWIDTH OBJECT" },
|
2011-01-15 03:25:43 +00:00
|
|
|
{PCEP_METRIC_OBJ, "METRIC OBJECT" },
|
|
|
|
{PCEP_EXPLICIT_ROUTE_OBJ, "EXPLICIT ROUTE OBJECT (ERO)" },
|
|
|
|
{PCEP_RECORD_ROUTE_OBJ, "RECORD ROUTE OBJECT (RRO)" },
|
2007-12-28 23:05:22 +00:00
|
|
|
{PCEP_LSPA_OBJ, "LSPA OBJECT" },
|
|
|
|
{PCEP_IRO_OBJ, "IRO OBJECT" },
|
|
|
|
{PCEP_SVEC_OBJ, "SVEC OBJECT" },
|
|
|
|
{PCEP_NOTIFICATION_OBJ, "NOTIFICATION OBJECT" },
|
|
|
|
{PCEP_PCEP_ERROR_OBJ, "PCEP ERROR OBJECT" },
|
|
|
|
{PCEP_LOAD_BALANCING_OBJ, "LOAD BALANCING OBJECT" },
|
|
|
|
{PCEP_CLOSE_OBJ, "CLOSE OBJECT" },
|
2011-02-03 20:14:38 +00:00
|
|
|
{PCEP_PATH_KEY_OBJ, "PATH-KEY OBJECT" },
|
2007-12-28 23:05:22 +00:00
|
|
|
{PCEP_XRO_OBJ, "EXCLUDE ROUTE OBJECT (XRO)" },
|
2012-03-30 22:36:02 +00:00
|
|
|
{PCEP_OBJ_MONITORING, "MONITORING OBJECT" },
|
|
|
|
{PCEP_OBJ_PCC_ID_REQ, "PCC-ID-REQ OBJECT" },
|
2011-02-03 20:14:38 +00:00
|
|
|
{PCEP_OF_OBJ, "OBJECTIVE FUNCTION OBJECT (OF)"},
|
2012-03-30 22:36:02 +00:00
|
|
|
{PCEP_OBJ_PCE_ID, "PCE-ID OBJECT" },
|
|
|
|
{PCEP_OBJ_PROC_TIME, "PROC-TIME OBJECT" },
|
|
|
|
{PCEP_OBJ_OVERLOAD, "OVERLOAD OBJECT" },
|
2007-12-23 14:19:48 +00:00
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
static const value_string pcep_subobj_vals[] = {
|
|
|
|
{PCEP_SUB_IPv4, "SUBOBJECT IPv4" },
|
|
|
|
{PCEP_SUB_IPv6, "SUBOBJECT IPv6" },
|
|
|
|
{PCEP_SUB_LABEL_CONTROL, "SUBOBJECT LABEL" },
|
|
|
|
{PCEP_SUB_UNNUMB_INTERFACE_ID, "SUBOBJECT UNNUMBERED INTERFACE-ID" },
|
|
|
|
{PCEP_SUB_AUTONOMOUS_SYS_NUM, "SUBOBJECT AUTONOMOUS SYSTEM NUMBER" },
|
2011-09-17 03:58:41 +00:00
|
|
|
{PCEP_SUB_SRLG, "SUBOBJECT SRLG" },
|
2011-02-03 20:14:38 +00:00
|
|
|
{PCEP_SUB_PKSv4, "SUBOBJECT PATH KEY (IPv4)" },
|
|
|
|
{PCEP_SUB_PKSv6, "SUBOBJECT PATH KEY (IPv6)" },
|
2007-12-23 14:19:48 +00:00
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
static const value_string pcep_subobj_xro_vals[] = {
|
|
|
|
{PCEP_SUB_IPv4, "SUBOBJECT IPv4" },
|
|
|
|
{PCEP_SUB_IPv6, "SUBOBJECT IPv6" },
|
2011-09-17 03:58:41 +00:00
|
|
|
{PCEP_SUB_UNNUMB_INTERFACE_ID, "SUBOBJECT UNNUMBERED INTERFACE-ID" },
|
|
|
|
{PCEP_SUB_AUTONOMOUS_SYS_NUM, "SUBOBJECT AUTONOMOUS SYSTEM NUMBER" },
|
2007-12-28 23:05:22 +00:00
|
|
|
{PCEP_SUB_SRLG, "SUBOBJECT SRLG" },
|
2007-12-23 14:19:48 +00:00
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
/*In the NO-PATH Object the two different possibilities that NI can have*/
|
2007-12-28 23:05:22 +00:00
|
|
|
static const value_string pcep_no_path_obj_vals[] = {
|
2007-12-23 14:19:48 +00:00
|
|
|
{NO_SATISFYING, "Nature of Issue: No path satisfying the set of constraints could be found (0x0)" },
|
2007-12-28 23:05:22 +00:00
|
|
|
{CHAIN_BROKEN, "Nature of Issue: PCEP Chain Broken (0x1)" },
|
2007-12-23 14:19:48 +00:00
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
/*Different values of "Type (T)" in the METRIC Obj */
|
2007-12-28 23:05:22 +00:00
|
|
|
static const value_string pcep_metric_obj_vals[] = {
|
2011-02-03 20:14:38 +00:00
|
|
|
{0, "not defined" },
|
|
|
|
{1, "IGP Metric" },
|
|
|
|
{2, "TE Metric" },
|
|
|
|
{3, "Hop Counts" },
|
|
|
|
{4, "Aggregate bandwidth consumption" },
|
|
|
|
{5, "Load of the most loaded link" },
|
|
|
|
{6, "Cumulative IGP cost" },
|
|
|
|
{7, "Cumulative TE cost" },
|
|
|
|
{8, "P2MP IGM metric" },
|
|
|
|
{9, "P2MP TE metric" },
|
|
|
|
{10, "P2MP hop count metric" },
|
|
|
|
{0, NULL }
|
2007-12-23 14:19:48 +00:00
|
|
|
};
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
/*Different values for (L) in the ERO and IRO Objs */
|
2007-12-28 23:05:22 +00:00
|
|
|
static const value_string pcep_route_l_obj_vals[] = {
|
2011-02-03 20:14:38 +00:00
|
|
|
{STRICT_HOP, "L=0 Strict Hop" },
|
|
|
|
{LOOSE_HOP, "L=1 Loose Hop" },
|
|
|
|
{0, NULL }
|
2007-12-23 14:19:48 +00:00
|
|
|
};
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
/*Different values of the direction of the label (U) in the ERO and RRO Objs */
|
2007-12-28 23:05:22 +00:00
|
|
|
static const value_string pcep_route_u_obj_vals[] = {
|
2011-02-03 20:14:38 +00:00
|
|
|
{DOWNSTREAM_LABEL, "U=0 Downstream Label" },
|
|
|
|
{UPSTREAM_LABEL, "U=1 Upstream Label" },
|
|
|
|
{0, NULL }
|
2007-12-23 14:19:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*Values of Notification type*/
|
2007-12-28 23:05:22 +00:00
|
|
|
static const value_string pcep_notification_types_vals[] = {
|
2007-12-23 14:19:48 +00:00
|
|
|
{NOT_REQ_CANCEL, "Pending Request Cancelled" },
|
2007-12-28 23:05:22 +00:00
|
|
|
{PCEP_CONGESTION, "PCE Congestion" },
|
2011-10-18 01:27:01 +00:00
|
|
|
{0, NULL }
|
2007-12-23 14:19:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*Values of Notification value for Notification Type=1*/
|
2007-12-28 23:05:22 +00:00
|
|
|
static const value_string pcep_notification_values1_vals[] = {
|
2007-12-23 14:19:48 +00:00
|
|
|
{NOTI_PCC_CANCEL_REQ, "PCC Cancels a set of Pending Request (s)" },
|
|
|
|
{NOTI_PCE_CANCEL_REQ, "PCE Cancels a set of Pending Request (s)" },
|
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/*Values of Notification value for Notification Type=2*/
|
2007-12-28 23:05:22 +00:00
|
|
|
static const value_string pcep_notification_values2_vals[] = {
|
|
|
|
{NOTI_PCE_CONGEST, "PCE in Congested State" },
|
2007-12-23 14:19:48 +00:00
|
|
|
{NOTI_PCE_NO_CONGEST, "PCE no Longer in Congested state" },
|
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-02-03 20:14:38 +00:00
|
|
|
/* PCEP TLVs */
|
|
|
|
static const value_string pcep_tlvs_vals[] = {
|
|
|
|
{1, "NO-PATH-VECTOR TLV" },
|
|
|
|
{2, "OVERLOAD-DURATION TLV" },
|
|
|
|
{3, "REQ-MISSING TLV" },
|
|
|
|
{4, "OF-list TLV" },
|
|
|
|
{5, "Order TLV" },
|
|
|
|
{6, "P2MP Capable" },
|
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*Values of Objective Functions*/
|
|
|
|
static const value_string pcep_of_vals[] = {
|
|
|
|
{1, "Minimum Cost Path" },
|
|
|
|
{2, "Minimum Load Path" },
|
|
|
|
{3, "Maximum residual Bandwidth Path" },
|
|
|
|
{4, "Minimize aggregate Bandwidth Consumption" },
|
|
|
|
{5, "Minimize the Load of the most loaded Link" },
|
|
|
|
{6, "Minimize the Cumulative Cost of a set of paths"},
|
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
/*Values of different types of errors*/
|
2007-12-28 23:05:22 +00:00
|
|
|
static const value_string pcep_error_types_obj_vals[] = {
|
2011-02-03 20:14:38 +00:00
|
|
|
{ESTABLISH_FAILURE, "PCEP Session Establishment Failure" },
|
|
|
|
{CAP_NOT_SUPPORTED, "Capability non supported" },
|
|
|
|
{UNKNOWN_OBJ, "Unknown Object" },
|
|
|
|
{NOT_SUPP_OBJ, "Not Supported Object" },
|
|
|
|
{POLICY_VIOLATION, "Policy Violation" },
|
|
|
|
{MANDATORY_OBJ_MIS, "Mandatory Object Missing" },
|
|
|
|
{SYNCH_PCREQ_MIS, "Synchronized Path Computation Request Missing" },
|
|
|
|
{UNKNOWN_REQ_REF, "Unknown Request Reference" },
|
|
|
|
{ATTEMPT_2_SESSION, "Attempt to Establish a Second PCEP Session" },
|
|
|
|
{INVALID_OBJ, "Reception of an invalid object" },
|
|
|
|
{UNRECO_EXRS_SUBOBJ, "Unrecognized EXRS Subobject" },
|
|
|
|
{DIFFSERV_TE_ERROR, "Differsv-aware TE error" },
|
|
|
|
{BRPC_FAILURE, "BRPC procedure completion failure" },
|
|
|
|
{GCO_ERROR, "Global Concurrent Optimization error" },
|
|
|
|
{P2MP_CAPABILITY_ERROR, "P2PM capability error" },
|
|
|
|
{P2MP_END_POINTS_ERROR, "P2PM END-POINTS error" },
|
|
|
|
{P2MP_FRAGMENT_ERROR, "P2PM Fragmentation error" },
|
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/*Error values for error type 1*/
|
|
|
|
static const value_string pcep_error_value_1_vals[] = {
|
|
|
|
{1, "Reception of an invalid Open msg or a non Open msg"},
|
|
|
|
{2, "No Open Message received before the expiration of the OpenWait Timer "},
|
|
|
|
{3, "Unacceptable and non Negotiable session characteristics"},
|
|
|
|
{4, "Unacceptable but Negotiable session characteristics"},
|
|
|
|
{5, "Reception of a second Open Message with still Unacceptable Session characteristics"},
|
|
|
|
{6, "Reception of a PCEPrr message proposing unacceptable session characteristics"},
|
|
|
|
{7, "NO Keepalive or PCEPrr message received before the expiration of the Keepwait timer supported"},
|
|
|
|
{8, "PCEP version not supported"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*Error values for error type 3*/
|
|
|
|
static const value_string pcep_error_value_3_vals[] = {
|
|
|
|
{1, "Unrecognized object class"},
|
|
|
|
{2, "Unrecognized object type"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*Error values for error type 4*/
|
|
|
|
static const value_string pcep_error_value_4_vals[] = {
|
|
|
|
{1, "Not supported object class"},
|
|
|
|
{2, "Not supported object type"},
|
|
|
|
{4, "Not supported parameter"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*Error values for error type 5*/
|
|
|
|
static const value_string pcep_error_value_5_vals[] = {
|
|
|
|
{1, "C bit of the METRIC object set (Request Rejected)"},
|
|
|
|
{2, "O bit of the RP object set (Request Rejected)"},
|
|
|
|
{3, "Objective Function not allowed (Request Rejected)"},
|
|
|
|
{4, "OF bit of the RP object set (Request Rejected)"},
|
|
|
|
{5, "Global concurrent optimization not allowed"},
|
|
|
|
{6, "Monitoring message supported but rejected due to policy violation"},
|
|
|
|
{7, "P2MP path computation is not allowed"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*Error values for error type 6*/
|
|
|
|
static const value_string pcep_error_value_6_vals[] = {
|
|
|
|
{1, "RP object missing"},
|
|
|
|
{2, "RRO object missing for a reoptimization request (R bit of the RP Object set)"},
|
|
|
|
{3, "END-POINTS object missing"},
|
|
|
|
{4, "MONITORINS object missing"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*Error values for error type 10*/
|
|
|
|
static const value_string pcep_error_value_10_vals[] = {
|
|
|
|
{1, "Reception of an object with P flag not set although the P-flag must be set"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*Error values for error type 12*/
|
|
|
|
static const value_string pcep_error_value_12_vals[] = {
|
|
|
|
{1, "Unsupported class-type"},
|
|
|
|
{2, "Invalid class-type"},
|
|
|
|
{3, "Class-type ans setup priority do not form a configured TE-class"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*Error values for error type 13*/
|
|
|
|
static const value_string pcep_error_value_13_vals[] = {
|
|
|
|
{1, "BRPC procedure not supported by one or more PCEs along the domain path"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*Error values for error type 15*/
|
|
|
|
static const value_string pcep_error_value_15_vals[] = {
|
|
|
|
{1, "Insufficient memory"},
|
|
|
|
{2, "Global concurrent optimization not supported"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*Error values for error type 16*/
|
|
|
|
static const value_string pcep_error_value_16_vals[] = {
|
|
|
|
{1, "The PCE cannot satisfy the request due to insufficient memory"},
|
|
|
|
{2, "The PCE is not capable of P2MP computation"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*Error values for error type 17*/
|
|
|
|
static const value_string pcep_error_value_17_vals[] = {
|
|
|
|
{1, "The PCE cannot satisfy the request due to no END-POINTS with leaf type 2"},
|
|
|
|
{2, "The PCE cannot satisfy the request due to no END-POINTS with leaf type 3"},
|
|
|
|
{3, "The PCE cannot satisfy the request due to no END-POINTS with leaf type 4"},
|
|
|
|
{4, "The PCE cannot satisfy the request due to inconsistent END-POINTS"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*Error values for error type 18*/
|
|
|
|
static const value_string pcep_error_value_18_vals[] = {
|
|
|
|
{1, "Fragmented request failure"},
|
|
|
|
{0, NULL}
|
2007-12-23 14:19:48 +00:00
|
|
|
};
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
static const value_string pcep_close_reason_obj_vals[] = {
|
2011-02-03 20:14:38 +00:00
|
|
|
{0, "Not defined" },
|
|
|
|
{NO_EXP_PROV, "No Explanation Provided" },
|
|
|
|
{DEADTIME_PROV, "Deadtime Expired" },
|
|
|
|
{RECEP_MALFORM_MSG, "Reception of a Malformed PCEP Message" },
|
2007-12-23 14:19:48 +00:00
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
2008-12-17 00:08:38 +00:00
|
|
|
static const value_string pcep_xro_attribute_obj_vals[] = {
|
2011-02-03 20:14:38 +00:00
|
|
|
{ATTR_INTERFACE, "Interface" },
|
|
|
|
{ATTR_NODE, "Node" },
|
|
|
|
{ATTR_SRLG, "SRLG" },
|
|
|
|
{0, NULL }
|
2007-12-23 14:19:48 +00:00
|
|
|
};
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
/* The PCEP filtering keys */
|
|
|
|
enum pcep_filter_keys{
|
|
|
|
|
|
|
|
PCEPF_MSG,
|
|
|
|
|
|
|
|
PCEPF_OPEN,
|
|
|
|
PCEPF_KEEPALIVE,
|
|
|
|
PCEPF_PATH_COMPUTATION_REQUEST,
|
|
|
|
PCEPF_PATH_COMPUTATION_REPLY,
|
|
|
|
PCEPF_NOTIFICATION,
|
|
|
|
PCEPF_ERROR,
|
2011-01-15 03:25:43 +00:00
|
|
|
PCEPF_CLOSE,
|
2012-03-30 22:36:02 +00:00
|
|
|
PCEPF_PATH_COMPUTATION_MONITORING_REQUEST,
|
|
|
|
PCEPF_PATH_COMPUTATION_MONITORING_REPLY,
|
2007-12-28 23:05:22 +00:00
|
|
|
|
|
|
|
PCEPF_OBJECT_CLASS,
|
|
|
|
PCEPF_OBJ_OPEN,
|
|
|
|
PCEPF_OBJ_RP,
|
|
|
|
PCEPF_OBJ_NO_PATH,
|
|
|
|
PCEPF_OBJ_END_POINT,
|
|
|
|
PCEPF_OBJ_BANDWIDTH,
|
|
|
|
PCEPF_OBJ_METRIC,
|
|
|
|
PCEPF_OBJ_EXPLICIT_ROUTE,
|
|
|
|
PCEPF_OBJ_RECORD_ROUTE,
|
|
|
|
PCEPF_OBJ_LSPA,
|
|
|
|
PCEPF_OBJ_IRO,
|
|
|
|
PCEPF_OBJ_SVEC,
|
|
|
|
PCEPF_OBJ_NOTIFICATION,
|
|
|
|
PCEPF_NOTI_TYPE,
|
|
|
|
PCEPF_NOTI_VAL1,
|
|
|
|
PCEPF_NOTI_VAL2,
|
|
|
|
PCEPF_OBJ_PCEP_ERROR,
|
|
|
|
PCEPF_ERROR_TYPE,
|
|
|
|
PCEPF_OBJ_LOAD_BALANCING,
|
|
|
|
PCEPF_OBJ_CLOSE,
|
2011-02-03 20:14:38 +00:00
|
|
|
PCEPF_OBJ_PATH_KEY,
|
2007-12-28 23:05:22 +00:00
|
|
|
PCEPF_OBJ_XRO,
|
2012-03-30 22:36:02 +00:00
|
|
|
PCEPF_OBJ_MONITORING,
|
|
|
|
PCEPF_OBJ_PCC_ID_REQ,
|
2011-10-18 01:27:01 +00:00
|
|
|
PCEPF_OBJ_OF,
|
2012-03-30 22:36:02 +00:00
|
|
|
PCEPF_OBJ_PCE_ID,
|
|
|
|
PCEPF_OBJ_PROC_TIME,
|
|
|
|
PCEPF_OBJ_OVERLOAD,
|
2007-12-28 23:05:22 +00:00
|
|
|
PCEPF_SUBOBJ,
|
|
|
|
PCEPF_SUBOBJ_IPv4,
|
|
|
|
PCEPF_SUBOBJ_IPv6,
|
|
|
|
PCEPF_SUBOBJ_LABEL_CONTROL,
|
|
|
|
PCEPF_SUBOBJ_UNNUM_INTERFACEID,
|
|
|
|
PCEPF_SUBOBJ_AUTONOMOUS_SYS_NUM,
|
|
|
|
PCEPF_SUBOBJ_SRLG,
|
|
|
|
PCEPF_SUBOBJ_EXRS,
|
2011-02-03 20:14:38 +00:00
|
|
|
PCEPF_SUBOBJ_PKSv4,
|
|
|
|
PCEPF_SUBOBJ_PKSv6,
|
2007-12-28 23:05:22 +00:00
|
|
|
PCEPF_SUBOBJ_XRO,
|
2008-12-17 00:08:38 +00:00
|
|
|
PCEPF_SUB_XRO_ATTRIB,
|
2007-12-28 23:05:22 +00:00
|
|
|
|
|
|
|
PCEPF_MAX
|
2007-12-23 14:19:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*Registering data structures*/
|
|
|
|
|
|
|
|
static gint *ett[] = {
|
2007-12-28 23:05:22 +00:00
|
|
|
&ett_pcep,
|
|
|
|
&ett_pcep_hdr,
|
|
|
|
&ett_pcep_obj_open,
|
|
|
|
&ett_pcep_obj_request_parameters,
|
|
|
|
&ett_pcep_obj_no_path,
|
|
|
|
&ett_pcep_obj_end_point,
|
|
|
|
&ett_pcep_obj_bandwidth,
|
|
|
|
&ett_pcep_obj_metric,
|
|
|
|
&ett_pcep_obj_explicit_route,
|
|
|
|
&ett_pcep_obj_record_route,
|
|
|
|
&ett_pcep_obj_lspa,
|
|
|
|
&ett_pcep_obj_iro,
|
|
|
|
&ett_pcep_obj_svec,
|
|
|
|
&ett_pcep_obj_notification,
|
|
|
|
&ett_pcep_obj_error,
|
|
|
|
&ett_pcep_obj_load_balancing,
|
2011-01-15 03:25:43 +00:00
|
|
|
&ett_pcep_obj_close,
|
2011-02-03 20:14:38 +00:00
|
|
|
&ett_pcep_obj_path_key,
|
2007-12-28 23:05:22 +00:00
|
|
|
&ett_pcep_obj_xro,
|
2012-03-30 22:36:02 +00:00
|
|
|
&ett_pcep_obj_monitoring,
|
|
|
|
&ett_pcep_obj_pcc_id_req,
|
2011-10-18 01:27:01 +00:00
|
|
|
&ett_pcep_obj_of,
|
2012-03-30 22:36:02 +00:00
|
|
|
&ett_pcep_obj_pce_id,
|
|
|
|
&ett_pcep_obj_proc_time,
|
|
|
|
&ett_pcep_obj_overload,
|
2007-12-28 23:05:22 +00:00
|
|
|
&ett_pcep_obj_unknown
|
2007-12-23 14:19:48 +00:00
|
|
|
};
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
/*Registering data structures*/
|
2007-12-23 14:19:48 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
static int pcep_filter[PCEPF_MAX];
|
2007-12-23 14:19:48 +00:00
|
|
|
|
2007-12-28 03:06:30 +00:00
|
|
|
#define OBJ_HDR_LEN 4 /* length of object header */
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_tlvs(proto_tree *pcep_obj, tvbuff_t *tvb, int offset, gint length, gint ett_pcep_obj)
|
2007-12-28 03:06:30 +00:00
|
|
|
{
|
2007-12-23 14:19:48 +00:00
|
|
|
proto_tree *tlv;
|
2007-12-28 11:23:23 +00:00
|
|
|
proto_item *ti;
|
2007-12-28 03:06:30 +00:00
|
|
|
guint16 tlv_length;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint16 tlv_type;
|
2011-02-03 20:14:38 +00:00
|
|
|
int i, j;
|
2007-12-28 03:06:30 +00:00
|
|
|
int padding = 0;
|
|
|
|
|
|
|
|
for (j = 0; j < length; j += 4 + tlv_length + padding){
|
|
|
|
tlv_type = tvb_get_ntohs(tvb, offset+j);
|
|
|
|
tlv_length = tvb_get_ntohs(tvb, offset + j + 2);
|
2011-02-03 20:14:38 +00:00
|
|
|
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). "));
|
2007-12-28 23:05:22 +00:00
|
|
|
tlv = proto_item_add_subtree(ti, ett_pcep_obj);
|
2007-12-28 03:06:30 +00:00
|
|
|
proto_tree_add_text(tlv, tvb, offset + j, 2, "Type: %u", tlv_type);
|
|
|
|
proto_tree_add_text(tlv, tvb, offset + 2 + j, 2, "Length: %u", tlv_length);
|
2011-02-03 20:14:38 +00:00
|
|
|
switch (tlv_type)
|
|
|
|
{
|
2012-09-25 01:00:41 +00:00
|
|
|
case 1: /* NO-PATH TLV */
|
|
|
|
proto_tree_add_item(tlv, hf_pcep_no_path_tlvs_pce, tvb, offset+4+j, tlv_length, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(tlv, hf_pcep_no_path_tlvs_unk_dest, tvb, offset+4+j, tlv_length, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(tlv, hf_pcep_no_path_tlvs_unk_src, tvb, offset+4+j, tlv_length, ENC_BIG_ENDIAN);
|
2011-02-03 20:14:38 +00:00
|
|
|
break;
|
|
|
|
|
2012-09-25 01:00:41 +00:00
|
|
|
case 3: /* REQ-MISSING TLV */
|
2011-02-03 20:14:38 +00:00
|
|
|
proto_tree_add_text(tlv, tvb, offset+4+j, tlv_length, "Request-ID: %u", tvb_get_ntohl(tvb, offset+4+j));
|
|
|
|
break;
|
|
|
|
|
2012-09-25 01:00:41 +00:00
|
|
|
case 4: /* OF TLV */
|
2011-02-03 20:14:38 +00:00
|
|
|
for (i=0; i<tlv_length/2; i++)
|
|
|
|
proto_tree_add_text(tlv, tvb, offset+4+j+i*2, 2, "OF-Code #%d: %s (%u)",
|
2012-08-10 22:55:02 +00:00
|
|
|
i+1, val_to_str_const(tvb_get_ntohs(tvb, offset+4+j+i*2), pcep_of_vals, "Unknown"),
|
2011-02-03 20:14:38 +00:00
|
|
|
tvb_get_ntohs(tvb, offset+4+j+i*2));
|
|
|
|
break;
|
|
|
|
|
2012-09-25 01:00:41 +00:00
|
|
|
default:
|
2011-02-03 22:04:19 +00:00
|
|
|
proto_tree_add_text(tlv, tvb, offset+4+j, tlv_length, "Data: %s",
|
2011-02-09 22:37:26 +00:00
|
|
|
tvb_bytes_to_str_punct(tvb, (offset) + 4 + j, tlv_length, ' '));
|
2011-02-03 20:14:38 +00:00
|
|
|
}
|
|
|
|
|
2007-12-28 03:06:30 +00:00
|
|
|
padding = (4 - (tlv_length % 4)) % 4;
|
|
|
|
if (padding != 0){
|
2011-01-15 03:25:43 +00:00
|
|
|
proto_tree_add_text(tlv, tvb, offset+4+j+tlv_length, padding, "Padding: %s",
|
2011-02-09 22:37:26 +00:00
|
|
|
tvb_bytes_to_str_punct(tvb, (offset) + 4 + j + tlv_length, padding, ' '));
|
2011-01-15 03:25:43 +00:00
|
|
|
}
|
2007-12-28 03:06:30 +00:00
|
|
|
}
|
|
|
|
}
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
*SUBOBJECTS
|
|
|
|
*------------------------------------------------------------------------------*/
|
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_subobj_ipv4(proto_tree *pcep_subobj_tree, tvbuff_t *tvb, int offset, int obj_class, gint ett_pcep_obj, guint l_and_or_type, guint length)
|
2007-12-28 03:06:30 +00:00
|
|
|
{
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_subobj_ipv4;
|
|
|
|
proto_tree *pcep_subobj_ipv4_flags;
|
2007-12-28 11:23:23 +00:00
|
|
|
proto_item *ti;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint8 prefix_length;
|
|
|
|
guint8 resvd;
|
|
|
|
guint l;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2011-10-19 15:04:44 +00:00
|
|
|
ti = proto_tree_add_item(pcep_subobj_tree, pcep_filter[PCEPF_SUBOBJ_IPv4], tvb, offset, length, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_subobj_ipv4 = proto_item_add_subtree(ti, ett_pcep_obj);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
if (length != 8) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset, length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad IPv4 subobject: length %u != 8", length);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-02-03 20:14:38 +00:00
|
|
|
prefix_length = tvb_get_guint8(tvb, offset+6);
|
|
|
|
resvd = tvb_get_guint8(tvb, offset+7);
|
|
|
|
proto_item_append_text(ti, ": %s/%u", tvb_ip_to_str(tvb, offset+2),
|
|
|
|
prefix_length);
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
switch(obj_class){
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_EXPLICIT_ROUTE_OBJ:
|
2007-12-28 03:06:30 +00:00
|
|
|
l = (l_and_or_type& Mask_L)>>7;
|
2008-10-31 15:34:00 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset, 1, "%s",val_to_str(l, pcep_route_l_obj_vals, "Unknown Object (%u). "));
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_uint(pcep_subobj_ipv4, pcep_filter[PCEPF_SUBOBJ], tvb, offset, 1, (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+1, 1, "Length: %u", length);
|
2011-02-03 20:14:38 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+2, 4, "IPv4 Address: %s", tvb_ip_to_str(tvb, offset+2));
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+6, 1, "Prefix Length: %u", prefix_length);
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+7, 1, "Padding: 0x%02x", resvd);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_RECORD_ROUTE_OBJ:
|
|
|
|
proto_tree_add_uint(pcep_subobj_ipv4, pcep_filter[PCEPF_SUBOBJ], tvb, offset, 1, l_and_or_type);
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+1, 1, "Length: %u", length);
|
2011-02-03 20:14:38 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+2, 4, "IPv4 Address: %s", tvb_ip_to_str(tvb, offset+2));
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+6, 1, "Prefix Length: %u", prefix_length);
|
|
|
|
ti = proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+7, 1, "Flags: 0x%02x ", resvd);
|
|
|
|
pcep_subobj_ipv4_flags = proto_item_add_subtree(ti, ett_pcep_obj);
|
|
|
|
proto_tree_add_boolean(pcep_subobj_ipv4_flags, pcep_subobj_flags_lpa, tvb, offset+7, 1, resvd);
|
|
|
|
proto_tree_add_boolean(pcep_subobj_ipv4_flags, pcep_subobj_flags_lpu, tvb, offset+7, 1, resvd);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_IRO_OBJ:
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset, 1, "l: %x", (l_and_or_type & 0x80)>>7);
|
|
|
|
proto_tree_add_uint(pcep_subobj_ipv4, pcep_filter[PCEPF_SUBOBJ], tvb, offset, 1, (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+1, 1, "Length: %u", length);
|
2011-02-03 20:14:38 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+2, 4, "IPv4 Address: %s", tvb_ip_to_str(tvb, offset+2));
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+6, 1, "Prefix Length: %u", prefix_length);
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+7, 1, "Padding: 0x%02x", resvd);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_XRO_OBJ:
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset, 1, "X: %x", (l_and_or_type & 0x01)>>7);
|
|
|
|
proto_tree_add_uint(pcep_subobj_ipv4, pcep_filter[PCEPF_SUBOBJ_XRO], tvb, offset, 1, (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset, 1, "Type: %u", (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+1, 1, "Length: %u", length);
|
2011-02-03 20:14:38 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+2, 4, "IPv4 Address: %s", tvb_ip_to_str(tvb, offset+2));
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+6, 1, "Prefix Length: %u", prefix_length);
|
2012-08-10 22:55:02 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+7, 1, "Attribute: %s (%u)",val_to_str_const(resvd, pcep_xro_attribute_obj_vals, "Unknown"), resvd);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
default:
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset, 8, "Non defined subobject for this object");
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_subobj_ipv6(proto_tree *pcep_subobj_tree, tvbuff_t *tvb, int offset, int obj_class, gint ett_pcep_obj, guint l_and_or_type, guint length)
|
2007-12-28 03:06:30 +00:00
|
|
|
{
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_subobj_ipv6;
|
|
|
|
proto_tree *pcep_subobj_ipv6_flags;
|
2007-12-28 11:23:23 +00:00
|
|
|
proto_item *ti;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint8 prefix_length;
|
|
|
|
guint8 resv;
|
|
|
|
int l;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2011-10-19 15:04:44 +00:00
|
|
|
ti = proto_tree_add_item(pcep_subobj_tree, pcep_filter[PCEPF_SUBOBJ_IPv6], tvb, offset, length, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_subobj_ipv6 = proto_item_add_subtree(ti, ett_pcep_obj);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
if (length != 20) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset, length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad IPv6 subobject: length %u != 20", length);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-02-03 20:14:38 +00:00
|
|
|
prefix_length = tvb_get_guint8(tvb, offset+18);
|
|
|
|
resv = tvb_get_guint8(tvb, offset+19);
|
|
|
|
proto_item_append_text(ti, ": %s/%u", tvb_ip6_to_str(tvb, offset+2),
|
|
|
|
prefix_length);
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
switch(obj_class){
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_EXPLICIT_ROUTE_OBJ:
|
2007-12-28 03:06:30 +00:00
|
|
|
l = (l_and_or_type& Mask_L)>>7;
|
2008-10-31 15:34:00 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset, 1, "%s",val_to_str(l, pcep_route_l_obj_vals, "Unknown Object (%u). "));
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_uint(pcep_subobj_ipv6, pcep_filter[PCEPF_SUBOBJ], tvb, offset, 1, (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+1, 1, "Length: %u", length);
|
2011-01-15 03:25:43 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+2, 16, "IPv6 Address: %s", tvb_ip6_to_str(tvb, offset+2));
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+18, 1, "Prefix Length: %u", prefix_length);
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+19, 1, "Padding: 0x%02x", resv);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_RECORD_ROUTE_OBJ:
|
|
|
|
proto_tree_add_uint(pcep_subobj_ipv6, pcep_filter[PCEPF_SUBOBJ], tvb, offset, 1, l_and_or_type);
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+1, 1, "Length: %u", length);
|
2011-01-15 03:25:43 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+2, 16, "IPv6 Address: %s", tvb_ip6_to_str(tvb, offset+2));
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+18, 1, "Prefix Length: %u", prefix_length);
|
|
|
|
ti = proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+19, 1, "Flags: 0x%02x ", resv);
|
|
|
|
pcep_subobj_ipv6_flags = proto_item_add_subtree(ti, ett_pcep_obj);
|
|
|
|
proto_tree_add_boolean(pcep_subobj_ipv6_flags, pcep_subobj_flags_lpa, tvb, offset+19, 1, resv);
|
|
|
|
proto_tree_add_boolean(pcep_subobj_ipv6_flags, pcep_subobj_flags_lpu, tvb, offset+19, 1, resv);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_IRO_OBJ:
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset, 1, "l: %x", (l_and_or_type & 0x80)>>7);
|
|
|
|
proto_tree_add_uint(pcep_subobj_ipv6, pcep_filter[PCEPF_SUBOBJ], tvb, offset, 1, (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+1, 1, "Length: %u", length);
|
2011-01-15 03:25:43 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+2, 16, "IPv6 Address: %s", tvb_ip6_to_str(tvb, offset+2));
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+18, 1, "Prefix Length: %u", prefix_length);
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+19, 1, "Padding: 0x%02x", resv);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_XRO_OBJ:
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset, 1, "X: %x", (l_and_or_type & 0x01)>>7);
|
|
|
|
proto_tree_add_uint(pcep_subobj_ipv6, pcep_filter[PCEPF_SUBOBJ_XRO], tvb, offset, 1, (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+1, 1, "Length: %u", length);
|
2011-01-15 03:25:43 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+2, 16, "IPv6 Address: %s", tvb_ip6_to_str(tvb, offset+2));
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+18, 1, "Prefix Length: %u", prefix_length);
|
2012-08-10 22:55:02 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+19, 1, "Attribute: %s (%u)", val_to_str_const(resv, pcep_xro_attribute_obj_vals, "Unknown"), resv);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
default:
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset, 20, "Non defined subobject for this object");
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2011-01-15 03:25:43 +00:00
|
|
|
}
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-12-28 03:06:30 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_subobj_label_control(proto_tree *pcep_subobj_tree, tvbuff_t *tvb, int offset, int obj_class, gint ett_pcep_obj, guint l_and_or_type, guint length)
|
2007-12-28 03:06:30 +00:00
|
|
|
{
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_subobj_label_control;
|
|
|
|
proto_tree *pcep_subobj_label_flags;
|
2007-12-28 11:23:23 +00:00
|
|
|
proto_item *ti;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint8 u_reserved;
|
|
|
|
guint8 c_type;
|
|
|
|
int l;
|
|
|
|
int u;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2011-10-19 15:04:44 +00:00
|
|
|
ti = proto_tree_add_item(pcep_subobj_tree, pcep_filter[PCEPF_SUBOBJ_LABEL_CONTROL], tvb, offset, length, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_subobj_label_control = proto_item_add_subtree(ti, ett_pcep_obj);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
if (length < 5) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_label_control, tvb, offset, length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad label control subobject: length %u < 5", length);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-02-03 20:14:38 +00:00
|
|
|
u_reserved = tvb_get_guint8(tvb, offset+2);
|
|
|
|
c_type = tvb_get_guint8(tvb, offset+3);
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
switch(obj_class){
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_EXPLICIT_ROUTE_OBJ:
|
2007-12-28 03:06:30 +00:00
|
|
|
l = (l_and_or_type& Mask_L)>>7;
|
2008-10-31 15:34:00 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_label_control, tvb, offset, 1, "%s", val_to_str(l, pcep_route_l_obj_vals, "Unknown Object (%u). "));
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_uint(pcep_subobj_label_control, pcep_filter[PCEPF_SUBOBJ], tvb, offset, 1, (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_label_control, tvb, offset+1, 1, "Length: %u", length);
|
2007-12-28 03:06:30 +00:00
|
|
|
u = (u_reserved & 0x80)>>7;
|
2008-10-31 15:34:00 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_label_control, tvb, offset+2, 1, "%s", val_to_str(u, pcep_route_u_obj_vals, "Unknown Object (%u). "));
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_label_control, tvb, offset+2, 1, "Reserved: %u", (u_reserved & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_label_control, tvb, offset+3, 1, "C-Type: %u", c_type);
|
2011-01-15 03:25:43 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_label_control, tvb, offset+4, length-4, "Label: %s",
|
2011-02-09 22:37:26 +00:00
|
|
|
tvb_bytes_to_str_punct(tvb, offset+4, length-4, ' '));
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
case PCEP_RECORD_ROUTE_OBJ:
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_uint(pcep_subobj_label_control, pcep_filter[PCEPF_SUBOBJ], tvb, offset, 1, l_and_or_type);
|
|
|
|
proto_tree_add_text(pcep_subobj_label_control, tvb, offset+1, 1, "Length: %u", length);
|
2007-12-28 03:06:30 +00:00
|
|
|
u = (u_reserved & 0x80)>>7;
|
2008-10-31 15:34:00 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_label_control, tvb, offset+2, 1, "%s", val_to_str(u, pcep_route_u_obj_vals, "Unknown Object (%u). "));
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
ti = proto_tree_add_text(pcep_subobj_label_control, tvb, offset+2, 1, "Flags: 0x%02x ", (u_reserved & 0x7f));
|
|
|
|
pcep_subobj_label_flags = proto_item_add_subtree(ti, ett_pcep_obj);
|
|
|
|
proto_tree_add_boolean(pcep_subobj_label_flags, pcep_subobj_label_flags_gl, tvb, offset+2, 1, (u_reserved & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_label_control, tvb, offset+3, 1, "C-Type: %u", c_type);
|
2011-01-15 03:25:43 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_label_control, tvb, offset+4, length-4, "Label: %s",
|
2011-02-09 22:37:26 +00:00
|
|
|
tvb_bytes_to_str_punct(tvb, offset+4, length-4, ' '));
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
default:
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_label_control, tvb, offset, length, "Non defined subobject for this object");
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2011-01-15 03:25:43 +00:00
|
|
|
}
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_subobj_unnumb_interfaceID(proto_tree *pcep_subobj_tree, tvbuff_t *tvb, int offset, int obj_class, gint ett_pcep_obj, guint l_and_or_type, guint length)
|
2007-12-28 03:06:30 +00:00
|
|
|
{
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_subobj_unnumb_interfaceID;
|
|
|
|
proto_tree *pcep_subobj_unnumb_interfaceID_flags;
|
2007-12-28 11:23:23 +00:00
|
|
|
proto_item *ti;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint32 router_ID;
|
|
|
|
guint32 interface_ID;
|
2007-12-28 03:06:30 +00:00
|
|
|
guint16 reserved_flags;
|
2007-12-23 14:19:48 +00:00
|
|
|
int l;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2011-10-19 15:04:44 +00:00
|
|
|
ti = proto_tree_add_item(pcep_subobj_tree, pcep_filter[PCEPF_SUBOBJ_UNNUM_INTERFACEID], tvb, offset, length, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_subobj_unnumb_interfaceID = proto_item_add_subtree(ti, ett_pcep_obj);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
if (length != 12) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset, length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad unnumbered interface ID subobject: length %u != 12", length);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-02-03 20:14:38 +00:00
|
|
|
reserved_flags = tvb_get_ntohs(tvb, offset+2);
|
|
|
|
router_ID = tvb_get_ipv4(tvb, offset+4);
|
|
|
|
interface_ID = tvb_get_ntohl(tvb, offset+8);
|
|
|
|
proto_item_append_text(ti, ": %s:%u", ip_to_str ((guint8 *) &router_ID),
|
|
|
|
interface_ID);
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
switch(obj_class){
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_EXPLICIT_ROUTE_OBJ:
|
2007-12-28 03:06:30 +00:00
|
|
|
l = (l_and_or_type& Mask_L)>>7;
|
2008-10-31 15:34:00 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset, 1, "%s", val_to_str(l, pcep_route_l_obj_vals, "Unknown Object (%u). "));
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_uint(pcep_subobj_unnumb_interfaceID, pcep_filter[PCEPF_SUBOBJ], tvb, offset, 1, (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset+1, 1, "Length: %u", length);
|
|
|
|
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset+2, 2, "Reserved: 0x%04x", reserved_flags);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_RECORD_ROUTE_OBJ:
|
|
|
|
proto_tree_add_uint(pcep_subobj_unnumb_interfaceID, pcep_filter[PCEPF_SUBOBJ], tvb, offset, 1, l_and_or_type);
|
|
|
|
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset+1, 1, "Length: %u", length);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
ti = proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset+2, 2, "Flags: 0x%02x ", (reserved_flags & 0xff00)>>8);
|
|
|
|
pcep_subobj_unnumb_interfaceID_flags = proto_item_add_subtree(ti, ett_pcep_obj);
|
|
|
|
proto_tree_add_boolean(pcep_subobj_unnumb_interfaceID_flags, pcep_subobj_flags_lpa, tvb, offset+2, 1, (reserved_flags & 0xff00)>>8);
|
|
|
|
proto_tree_add_boolean(pcep_subobj_unnumb_interfaceID_flags, pcep_subobj_flags_lpu, tvb, offset+2, 1, (reserved_flags & 0xff00)>>8);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset+3, 1, "Reserved: 0x%02x", (reserved_flags & 0x00ff));
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_IRO_OBJ:
|
|
|
|
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset, 1, "l: %x", (l_and_or_type & 0x80)>>7);
|
|
|
|
proto_tree_add_uint(pcep_subobj_unnumb_interfaceID, pcep_filter[PCEPF_SUBOBJ], tvb, offset, 1, (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset+1, 1, "Length: %u", length);
|
|
|
|
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset+2, 2, "Reserved: 0x%04x", reserved_flags);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_XRO_OBJ:
|
|
|
|
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset, 1, "X: %x", (l_and_or_type & 0x01)>>7);
|
|
|
|
proto_tree_add_uint(pcep_subobj_unnumb_interfaceID, pcep_filter[PCEPF_SUBOBJ_XRO], tvb, offset, 1, (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset+2, 1, "Reserved: 0x%02x", (reserved_flags & 0xff00)>>4);
|
2012-08-10 22:55:02 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset+3, 1, "Attribute: %s (%u)", val_to_str_const(reserved_flags & 0x00ff, pcep_xro_attribute_obj_vals, "Unknown"), reserved_flags & 0x00ff);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
default:
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset, 12, "Non defined subobject for this object");
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2011-01-15 03:25:43 +00:00
|
|
|
}
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2011-02-03 20:14:38 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset+4, 4, "Router ID: %s", ip_to_str((guint8 *) &router_ID));
|
|
|
|
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset+8, 4, "Interface ID: %d (0x%08x)", interface_ID, interface_ID);
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_subobj_autonomous_sys_num(proto_tree *pcep_subobj_tree, tvbuff_t *tvb, int offset, int obj_class, guint ett_pcep_obj, guint l_and_or_type, guint length)
|
2007-12-28 03:06:30 +00:00
|
|
|
{
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_subobj_autonomous_sys_num;
|
2007-12-28 11:23:23 +00:00
|
|
|
proto_item *ti;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint16 AS_number;
|
|
|
|
guint8 reserved;
|
|
|
|
guint8 attribute;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
int l;
|
|
|
|
l = (l_and_or_type& Mask_L)>>7;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
if(obj_class == PCEP_XRO_OBJ){
|
2007-12-28 03:06:30 +00:00
|
|
|
reserved = tvb_get_guint8(tvb, offset+2);
|
|
|
|
attribute = tvb_get_guint8(tvb, offset+3);
|
|
|
|
AS_number = tvb_get_ntohs(tvb, offset+6);
|
2007-12-23 14:19:48 +00:00
|
|
|
|
2011-10-19 15:04:44 +00:00
|
|
|
ti = proto_tree_add_item(pcep_subobj_tree, pcep_filter[PCEPF_SUBOBJ_AUTONOMOUS_SYS_NUM], tvb, offset, length, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_subobj_autonomous_sys_num = proto_item_add_subtree(ti, ett_pcep_obj);
|
2007-12-28 03:06:30 +00:00
|
|
|
if (length != 8) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset, length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad autonomous system number subobject: length %u != 8", length);
|
|
|
|
return;
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset, 1, "X: %x", (l_and_or_type & 0x01)>>7);
|
|
|
|
proto_tree_add_uint(pcep_subobj_autonomous_sys_num, pcep_filter[PCEPF_SUBOBJ_XRO], tvb, offset, 1, (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset+1, 1, "Length: %u", length);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset+2, 1, "Reserved: 0x%02x", reserved);
|
2012-08-10 22:55:02 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset+3, 1, "Attribute: %s (%u)", val_to_str_const(attribute, pcep_xro_attribute_obj_vals, "Unknown"), attribute);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset+4, 2, "Optional AS Number High Octets: 0x%04x", AS_number);
|
|
|
|
proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset+6, 2, "AS Number: 0x%04x", AS_number);
|
2007-12-28 03:06:30 +00:00
|
|
|
} else {
|
|
|
|
AS_number = tvb_get_ntohs(tvb, offset+2);
|
|
|
|
|
2011-10-19 15:04:44 +00:00
|
|
|
ti = proto_tree_add_item(pcep_subobj_tree, pcep_filter[PCEPF_SUBOBJ_AUTONOMOUS_SYS_NUM], tvb, offset, length, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_subobj_autonomous_sys_num = proto_item_add_subtree(ti, ett_pcep_obj);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
if (length != 4) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset, length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad autonomous system number subobject: length %u != 4", length);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
if(obj_class == PCEP_IRO_OBJ)
|
|
|
|
proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset, 1, "l: %x", (l_and_or_type & 0x80)>>7);
|
2011-01-15 03:25:43 +00:00
|
|
|
else
|
2008-10-31 15:34:00 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset, 1, "%s", val_to_str(l, pcep_route_l_obj_vals, "Unknown Object (%u). "));
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_uint(pcep_subobj_autonomous_sys_num, pcep_filter[PCEPF_SUBOBJ], tvb, offset, 1, (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset+1, 1, "Length: %u", length);
|
|
|
|
proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset+2, 2, "AS Number: 0x%04x", AS_number);
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_subobj_srlg(proto_tree *pcep_subobj_tree, tvbuff_t *tvb, int offset, guint ett_pcep_obj, guint l_and_or_type, guint length)
|
2007-12-28 03:06:30 +00:00
|
|
|
{
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_subobj_srlg;
|
2007-12-28 11:23:23 +00:00
|
|
|
proto_item *ti;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint32 srlg_id;
|
|
|
|
guint8 reserved;
|
|
|
|
guint8 attribute;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
srlg_id = tvb_get_ntohl(tvb, offset+2);
|
|
|
|
reserved = tvb_get_guint8(tvb, offset+6);
|
|
|
|
attribute = tvb_get_guint8(tvb, offset+7);
|
|
|
|
|
2011-10-19 15:04:44 +00:00
|
|
|
ti = proto_tree_add_item(pcep_subobj_tree, pcep_filter[PCEPF_SUBOBJ_SRLG], tvb, offset, length, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_subobj_srlg = proto_item_add_subtree(ti, ett_pcep_obj);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
if (length != 8) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_srlg, tvb, offset, length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad SRLG subobject: length %u != 8", length);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_srlg, tvb, offset, 1, "X: %x", (l_and_or_type & 0x01)>>7);
|
|
|
|
proto_tree_add_uint(pcep_subobj_srlg, pcep_filter[PCEPF_SUBOBJ_XRO], tvb, offset, 1, (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_srlg, tvb, offset+1, 1, "Length: %u", length);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_srlg, tvb, offset+2, 4, "SRLG ID: 0x%08x", srlg_id);
|
|
|
|
proto_tree_add_text(pcep_subobj_srlg, tvb, offset+6, 1, "Reserved: 0x%02x", reserved);
|
2012-08-10 22:55:02 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_srlg, tvb, offset+7, 1, "Attribute: %s (%u)", val_to_str_const(attribute, pcep_xro_attribute_obj_vals, "Unknown"), attribute);
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_subobj_exrs(proto_tree *pcep_subobj_tree, tvbuff_t *tvb, int offset, int obj_class, guint ett_pcep_obj, guint type_iro, guint l_and_or_type, guint length)
|
2007-12-28 03:06:30 +00:00
|
|
|
{
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_subobj_exrs;
|
2007-12-28 11:23:23 +00:00
|
|
|
proto_item *ti;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint16 reserved;
|
|
|
|
guint8 l_type;
|
2007-12-28 03:06:30 +00:00
|
|
|
guint8 length2;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint type_exrs;
|
|
|
|
guint offset_exrs = 0;
|
|
|
|
guint l;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2011-10-19 15:04:44 +00:00
|
|
|
ti = proto_tree_add_item(pcep_subobj_tree, pcep_filter[PCEPF_SUBOBJ_EXRS], tvb, offset, length, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_subobj_exrs = proto_item_add_subtree(ti, ett_pcep_obj);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
if (length < 4) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_exrs, tvb, offset, length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad EXRS subobject: length %u < 4", length);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
l = (l_and_or_type& Mask_L)>>7;
|
2008-10-31 15:34:00 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_exrs, tvb, offset, 1, "%s", val_to_str(l, pcep_route_l_obj_vals, "Unknown Object (%u). "));
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_exrs, tvb, offset, 1, "Type: %u", (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_exrs, tvb, offset+1, 1, "Length: %u", length);
|
2007-12-27 12:00:45 +00:00
|
|
|
|
2007-12-28 03:06:30 +00:00
|
|
|
reserved = tvb_get_ntohs(tvb, offset+2);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_exrs, tvb, offset+2, 2, "Reserved: 0x%04x", reserved);
|
2007-12-27 12:00:45 +00:00
|
|
|
|
2007-12-28 03:06:30 +00:00
|
|
|
offset += 4;
|
2007-12-23 14:19:48 +00:00
|
|
|
|
2007-12-28 03:06:30 +00:00
|
|
|
while(offset_exrs<length-4){
|
|
|
|
|
|
|
|
l_type = tvb_get_guint8(tvb, offset);
|
|
|
|
length2 = tvb_get_guint8(tvb, offset+1);
|
2007-12-23 14:19:48 +00:00
|
|
|
|
2007-12-28 03:06:30 +00:00
|
|
|
if (length2 < 2) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_exrs, tvb, offset, 0,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad packet: subobject length %u < 2",
|
|
|
|
length2);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
type_exrs = (l_type & Mask_Type);
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
if(type_iro==PCEP_SUB_EXRS)
|
|
|
|
obj_class = PCEP_XRO_OBJ;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
switch(type_exrs) {
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_IPv4:
|
|
|
|
dissect_subobj_ipv4(pcep_subobj_exrs, tvb, offset, obj_class, ett_pcep_obj, l_type, length2);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_IPv6:
|
|
|
|
dissect_subobj_ipv6(pcep_subobj_exrs, tvb, offset, obj_class, ett_pcep_obj, l_type, length2);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2011-09-17 03:58:41 +00:00
|
|
|
case PCEP_SUB_UNNUMB_INTERFACE_ID:
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_subobj_unnumb_interfaceID(pcep_subobj_exrs, tvb, offset, obj_class, ett_pcep_obj, l_type, length2);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2011-09-17 03:58:41 +00:00
|
|
|
case PCEP_SUB_AUTONOMOUS_SYS_NUM:
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_subobj_autonomous_sys_num(pcep_subobj_exrs, tvb, offset, obj_class, ett_pcep_obj, l_type, length2);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_SRLG:
|
|
|
|
dissect_subobj_srlg(pcep_subobj_exrs, tvb, offset, ett_pcep_obj, l_type, length2);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
default:
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_subobj_exrs, tvb, offset+2, length-2,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Non defined subobject (%d)", type_exrs);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
offset_exrs += length2;
|
|
|
|
offset += length2;
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-03 20:14:38 +00:00
|
|
|
static void
|
|
|
|
dissect_subobj_pksv4(proto_tree *pcep_subobj_tree, tvbuff_t *tvb, int offset, gint ett_pcep_obj, guint l_and_or_type, guint length)
|
|
|
|
{
|
|
|
|
proto_tree *pcep_subobj_pksv4;
|
|
|
|
proto_item *ti;
|
|
|
|
guint16 path_key;
|
|
|
|
int l;
|
|
|
|
|
2011-10-19 15:04:44 +00:00
|
|
|
ti = proto_tree_add_item(pcep_subobj_tree, pcep_filter[PCEPF_SUBOBJ_PKSv4], tvb, offset, length, ENC_NA);
|
2011-02-03 20:14:38 +00:00
|
|
|
pcep_subobj_pksv4 = proto_item_add_subtree(ti, ett_pcep_obj);
|
|
|
|
|
|
|
|
if (length != 8) {
|
|
|
|
proto_tree_add_text(pcep_subobj_pksv4, tvb, offset, length,
|
|
|
|
"Bad path key subobject: length %u != 8", length);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
path_key = tvb_get_ntohs(tvb, offset+2);
|
|
|
|
proto_item_append_text(ti, ": %s, Path Key %u", tvb_ip_to_str(tvb, offset+4), path_key);
|
|
|
|
l = (l_and_or_type& Mask_L)>>7;
|
|
|
|
proto_tree_add_text(pcep_subobj_pksv4, tvb, offset, 1, "%s", val_to_str(l, pcep_route_l_obj_vals, "Unknown Object (%u). "));
|
|
|
|
proto_tree_add_uint(pcep_subobj_pksv4, pcep_filter[PCEPF_SUBOBJ], tvb, offset, 1, (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_pksv4, tvb, offset+1, 1, "Length: %u", length);
|
|
|
|
proto_tree_add_text(pcep_subobj_pksv4, tvb, offset+2, 2, "Path Key: %d (0x%04x)", path_key, path_key);
|
|
|
|
proto_tree_add_text(pcep_subobj_pksv4, tvb, offset+4, 4, "PCE ID: %s", tvb_ip_to_str(tvb, offset+4));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_subobj_pksv6(proto_tree *pcep_subobj_tree, tvbuff_t *tvb, int offset, gint ett_pcep_obj, guint l_and_or_type, guint length)
|
|
|
|
{
|
|
|
|
proto_tree *pcep_subobj_pksv6;
|
|
|
|
proto_item *ti;
|
|
|
|
guint16 path_key;
|
|
|
|
int l;
|
|
|
|
|
2011-10-19 15:04:44 +00:00
|
|
|
ti = proto_tree_add_item(pcep_subobj_tree, pcep_filter[PCEPF_SUBOBJ_PKSv6], tvb, offset, length, ENC_NA);
|
2011-02-03 20:14:38 +00:00
|
|
|
pcep_subobj_pksv6 = proto_item_add_subtree(ti, ett_pcep_obj);
|
|
|
|
|
|
|
|
if (length != 20) {
|
|
|
|
proto_tree_add_text(pcep_subobj_pksv6, tvb, offset, length,
|
|
|
|
"Bad path key subobject: length %u != 20", length);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
path_key = tvb_get_ntohs(tvb, offset+2);
|
|
|
|
proto_item_append_text(ti, ": %s, Path Key %u", tvb_ip6_to_str(tvb, offset+4), path_key);
|
|
|
|
l = (l_and_or_type& Mask_L)>>7;
|
|
|
|
proto_tree_add_text(pcep_subobj_pksv6, tvb, offset, 1, "%s", val_to_str(l, pcep_route_l_obj_vals, "Unknown Object (%u). "));
|
|
|
|
proto_tree_add_uint(pcep_subobj_pksv6, pcep_filter[PCEPF_SUBOBJ], tvb, offset, 1, (l_and_or_type & 0x7f));
|
|
|
|
proto_tree_add_text(pcep_subobj_pksv6, tvb, offset+1, 1, "Length: %u", length);
|
|
|
|
proto_tree_add_text(pcep_subobj_pksv6, tvb, offset+2, 2, "Path Key: %d (0x%04x)", path_key, path_key);
|
|
|
|
proto_tree_add_text(pcep_subobj_pksv6, tvb, offset+4, 4, "PCE ID: %s", tvb_ip6_to_str(tvb, offset+4));
|
|
|
|
}
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
* OPEN OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
2007-12-28 03:06:30 +00:00
|
|
|
#define OPEN_OBJ_MIN_LEN 4
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_open_obj (proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2, int obj_length)
|
2007-12-23 14:19:48 +00:00
|
|
|
{
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_open_obj_flags;
|
2007-12-28 11:23:23 +00:00
|
|
|
proto_item *ti;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint8 version_flags;
|
|
|
|
guint8 keepalive;
|
|
|
|
guint8 deadtimer;
|
|
|
|
guint8 SID;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
if (obj_length < OBJ_HDR_LEN+OPEN_OBJ_MIN_LEN) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad OPEN object length %u, should be >= %u", obj_length,
|
|
|
|
OBJ_HDR_LEN+OPEN_OBJ_MIN_LEN);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
version_flags = tvb_get_guint8(tvb, offset2);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 1, "PCEP Version: %u", (version_flags & 0xe0)>>5);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
ti = proto_tree_add_text(pcep_object_tree, tvb, offset2, 1, "Flags: 0x%02x", version_flags & 0x1f);
|
|
|
|
pcep_open_obj_flags = proto_item_add_subtree(ti, ett_pcep_obj_open);
|
|
|
|
proto_tree_add_boolean(pcep_open_obj_flags, pcep_open_flags_res, tvb, offset2, 1, version_flags & 0x1f);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
keepalive = tvb_get_guint8(tvb, offset2+1);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+1, 1, "Keepalive: %u", keepalive);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
deadtimer = tvb_get_guint8(tvb, offset2+2);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+2, 1, "Deadtime: %u", deadtimer);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
SID = tvb_get_guint8(tvb, offset2+3);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+3, 1, "SID: %u", SID);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2013-02-26 01:06:19 +00:00
|
|
|
/*it's suppose that obj_length is a valid date. The object can have optional TLV(s)*/
|
2007-12-28 03:06:30 +00:00
|
|
|
offset2 += OPEN_OBJ_MIN_LEN;
|
|
|
|
obj_length -= OBJ_HDR_LEN+OPEN_OBJ_MIN_LEN;
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_open);
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
* RP OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
2007-12-28 03:06:30 +00:00
|
|
|
#define RP_OBJ_MIN_LEN 8
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_rp_obj(proto_tree *pcep_object_tree,
|
2007-12-28 03:06:30 +00:00
|
|
|
tvbuff_t *tvb, int offset2, int obj_length)
|
2011-01-15 03:25:43 +00:00
|
|
|
{
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_rp_obj_flags;
|
2007-12-28 11:23:23 +00:00
|
|
|
proto_item *ti;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint8 reserved;
|
|
|
|
guint32 flags;
|
|
|
|
guint32 requested_id_number;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
if (obj_length < OBJ_HDR_LEN+RP_OBJ_MIN_LEN) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad RP object length %u, should be >= %u", obj_length,
|
|
|
|
OBJ_HDR_LEN+RP_OBJ_MIN_LEN);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
reserved = tvb_get_guint8(tvb, offset2);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 1, "Reserved: 0x%02x", reserved);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
flags = tvb_get_ntoh24(tvb, offset2+1);
|
2007-12-28 23:05:22 +00:00
|
|
|
ti = proto_tree_add_text(pcep_object_tree, tvb, offset2+1, 3, "Flags: 0x%06x ", flags);
|
|
|
|
pcep_rp_obj_flags = proto_item_add_subtree(ti, ett_pcep_obj_request_parameters);
|
2007-12-23 14:19:48 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_boolean(pcep_rp_obj_flags, pcep_rp_flags_reserved, tvb, offset2+1, 3, flags);
|
2011-02-03 20:14:38 +00:00
|
|
|
proto_tree_add_boolean(pcep_rp_obj_flags, pcep_rp_flags_f, tvb, offset2+1, 3, flags);
|
|
|
|
proto_tree_add_boolean(pcep_rp_obj_flags, pcep_rp_flags_n, tvb, offset2+1, 3, flags);
|
|
|
|
proto_tree_add_boolean(pcep_rp_obj_flags, pcep_rp_flags_e, tvb, offset2+1, 3, flags);
|
|
|
|
proto_tree_add_boolean(pcep_rp_obj_flags, pcep_rp_flags_m, tvb, offset2+1, 3, flags);
|
|
|
|
proto_tree_add_boolean(pcep_rp_obj_flags, pcep_rp_flags_d, tvb, offset2+1, 3, flags);
|
|
|
|
proto_tree_add_boolean(pcep_rp_obj_flags, pcep_rp_flags_p, tvb, offset2+1, 3, flags);
|
|
|
|
proto_tree_add_boolean(pcep_rp_obj_flags, pcep_rp_flags_s, tvb, offset2+1, 3, flags);
|
|
|
|
proto_tree_add_boolean(pcep_rp_obj_flags, pcep_rp_flags_v, tvb, offset2+1, 3, flags);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_boolean(pcep_rp_obj_flags, pcep_rp_flags_o, tvb, offset2+1, 3, flags);
|
|
|
|
proto_tree_add_boolean(pcep_rp_obj_flags, pcep_rp_flags_b, tvb, offset2+1, 3, flags);
|
|
|
|
proto_tree_add_boolean(pcep_rp_obj_flags, pcep_rp_flags_r, tvb, offset2+1, 3, flags);
|
|
|
|
proto_tree_add_boolean(pcep_rp_obj_flags, pcep_rp_flags_pri, tvb, offset2+1, 3, flags);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
requested_id_number = tvb_get_ntohl(tvb, offset2+4);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+4, 4, "Requested ID Number: 0x%08x", requested_id_number);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2013-02-26 01:06:19 +00:00
|
|
|
/*it's suppose that obj_length is a valid date. The object can have optional TLV(s)*/
|
2007-12-28 03:06:30 +00:00
|
|
|
offset2 += RP_OBJ_MIN_LEN;
|
|
|
|
obj_length -= OBJ_HDR_LEN+RP_OBJ_MIN_LEN;
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_request_parameters);
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
* NO PATH OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
2007-12-28 03:06:30 +00:00
|
|
|
#define NO_PATH_OBJ_MIN_LEN 4
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_no_path_obj(proto_tree *pcep_object_tree,
|
2007-12-28 03:06:30 +00:00
|
|
|
tvbuff_t *tvb, int offset2, int obj_length)
|
2011-01-15 03:25:43 +00:00
|
|
|
{
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_no_path_obj_flags;
|
2007-12-28 11:23:23 +00:00
|
|
|
proto_item *ti;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint8 ni;
|
|
|
|
guint16 flags;
|
|
|
|
guint8 reserved;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
if (obj_length < OBJ_HDR_LEN+NO_PATH_OBJ_MIN_LEN) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad NO-PATH object length %u, should be >= %u", obj_length,
|
|
|
|
OBJ_HDR_LEN+NO_PATH_OBJ_MIN_LEN);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ni = tvb_get_guint8(tvb, offset2);
|
2008-10-31 15:34:00 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 1, "%s", val_to_str(ni, pcep_no_path_obj_vals, "Unknown Object (%u). "));
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
flags = tvb_get_ntohs(tvb, offset2+1);
|
2007-12-28 23:05:22 +00:00
|
|
|
ti = proto_tree_add_text(pcep_object_tree, tvb, offset2+1, 2, "Flags: 0x%04x", flags);
|
|
|
|
pcep_no_path_obj_flags = proto_item_add_subtree(ti, ett_pcep_obj_no_path);
|
|
|
|
proto_tree_add_boolean(pcep_no_path_obj_flags, pcep_no_path_flags_c, tvb, offset2+1, 2, flags);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
reserved = tvb_get_guint8(tvb, offset2+3);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+3, 1, "Reserved: 0x%02x", reserved);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2013-02-26 01:06:19 +00:00
|
|
|
/*it's suppose that obj_length is a valid date. The object can have optional TLV(s)*/
|
2007-12-28 03:06:30 +00:00
|
|
|
offset2 += NO_PATH_OBJ_MIN_LEN;
|
|
|
|
obj_length -= OBJ_HDR_LEN+NO_PATH_OBJ_MIN_LEN;
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_no_path);
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
* END POINT OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
2007-12-28 03:06:30 +00:00
|
|
|
#define END_POINT_IPV4_OBJ_LEN 8
|
|
|
|
#define END_POINT_IPV6_OBJ_LEN 32
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_end_point_obj(proto_tree *pcep_object_tree,
|
2007-12-28 03:06:30 +00:00
|
|
|
tvbuff_t *tvb, int offset2, int obj_length, int type)
|
2007-12-23 14:19:48 +00:00
|
|
|
{
|
|
|
|
switch(type)
|
|
|
|
{
|
2011-01-15 03:25:43 +00:00
|
|
|
case IPv4:
|
2007-12-28 03:06:30 +00:00
|
|
|
if (obj_length != OBJ_HDR_LEN+END_POINT_IPV4_OBJ_LEN) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad IPv4 END-POINTS object length %u, should be %u", obj_length,
|
|
|
|
OBJ_HDR_LEN+END_POINT_IPV4_OBJ_LEN);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-02-03 20:14:38 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 4, "Source IPv4 Address: %s", tvb_ip_to_str(tvb, offset2));
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+4, 4, "Destination IPv4 Address: %s", tvb_ip_to_str(tvb, offset2+4));
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case IPv6:
|
|
|
|
if (obj_length != OBJ_HDR_LEN+END_POINT_IPV6_OBJ_LEN) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad IPv6 END-POINTS object length %u, should be %u", obj_length,
|
|
|
|
OBJ_HDR_LEN+END_POINT_IPV6_OBJ_LEN);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 16, "Source IPv6 Address: %s",
|
2011-01-15 03:25:43 +00:00
|
|
|
tvb_ip6_to_str(tvb, offset2));
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+16, 16, "Destination IPv6 Address: %s",
|
2011-01-15 03:25:43 +00:00
|
|
|
tvb_ip6_to_str(tvb, offset2+16));
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
default:
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length-OBJ_HDR_LEN, "UNKNOWN Type Object (%u)", type);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
2011-01-15 03:25:43 +00:00
|
|
|
}
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
* BANDWIDTH OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
2007-12-28 03:06:30 +00:00
|
|
|
#define BANDWIDTH_OBJ_LEN 4
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_bandwidth_obj(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2, int obj_length)
|
2011-01-15 03:25:43 +00:00
|
|
|
{
|
2011-02-03 20:14:38 +00:00
|
|
|
gfloat bandwidth;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
if (obj_length != OBJ_HDR_LEN+BANDWIDTH_OBJ_LEN) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad BANDWIDTH object length %u, should be %u", obj_length,
|
|
|
|
OBJ_HDR_LEN+BANDWIDTH_OBJ_LEN);
|
|
|
|
return;
|
|
|
|
}
|
2011-01-15 03:25:43 +00:00
|
|
|
|
2011-02-03 20:14:38 +00:00
|
|
|
bandwidth = tvb_get_ntohieee_float(tvb, offset2);
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 4, "Bandwidth: %f", bandwidth);
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
* METRIC OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
2007-12-28 03:06:30 +00:00
|
|
|
#define METRIC_OBJ_LEN 8
|
|
|
|
|
2011-02-03 22:04:19 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_metric_obj(proto_tree *pcep_object_tree,
|
2007-12-28 03:06:30 +00:00
|
|
|
tvbuff_t *tvb, int offset2, int obj_length)
|
2011-01-15 03:25:43 +00:00
|
|
|
{
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_metric_obj_flags;
|
2007-12-28 11:23:23 +00:00
|
|
|
proto_item *ti;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint16 reserved;
|
2007-12-28 03:06:30 +00:00
|
|
|
guint8 flags;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint8 metric_type;
|
2011-02-03 20:14:38 +00:00
|
|
|
gfloat metric_value;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
if (obj_length != OBJ_HDR_LEN+METRIC_OBJ_LEN) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad METRIC object length %u, should be %u", obj_length,
|
|
|
|
OBJ_HDR_LEN+METRIC_OBJ_LEN);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
reserved = tvb_get_ntohs(tvb, offset2);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 2, "Reserved: %u", reserved);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
flags = tvb_get_guint8(tvb, offset2+2);
|
2007-12-28 23:05:22 +00:00
|
|
|
ti = proto_tree_add_text(pcep_object_tree, tvb, offset2+2, 1, "Flags: 0x%02x", flags);
|
|
|
|
pcep_metric_obj_flags = proto_item_add_subtree(ti, ett_pcep_obj_metric);
|
|
|
|
proto_tree_add_boolean(pcep_metric_obj_flags, pcep_metric_flags_c, tvb, offset2+2, 1, flags);
|
|
|
|
proto_tree_add_boolean(pcep_metric_obj_flags, pcep_metric_flags_b, tvb, offset2+2, 1, flags);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
metric_type = tvb_get_guint8(tvb, offset2+3);
|
2012-08-10 22:55:02 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+3, 1, "Type: %s (T=%u)", val_to_str_const(metric_type, pcep_metric_obj_vals, "Unknown"), metric_type);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2011-02-03 20:14:38 +00:00
|
|
|
metric_value = tvb_get_ntohieee_float(tvb, offset2+4);
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+4, 4, "Metric Value: %f", metric_value);
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
* EXPLICIT ROUTE OBJECT (ERO)
|
|
|
|
*------------------------------------------------------------------------------*/
|
2011-01-15 03:25:43 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_explicit_route_obj(proto_tree *pcep_object_tree,
|
2007-12-28 03:06:30 +00:00
|
|
|
tvbuff_t *tvb, int offset2, int obj_length, int obj_class)
|
2007-12-28 11:23:23 +00:00
|
|
|
{
|
2007-12-23 14:19:48 +00:00
|
|
|
guint8 l_type;
|
|
|
|
guint8 length;
|
|
|
|
guint type_exp_route;
|
|
|
|
guint body_obj_len;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
body_obj_len = obj_length - OBJ_HDR_LEN;
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
while(body_obj_len){
|
2007-12-28 03:06:30 +00:00
|
|
|
if (body_obj_len < 2) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 0,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad ERO object: subobject goes past end of object");
|
|
|
|
break;
|
|
|
|
}
|
2007-12-23 14:19:48 +00:00
|
|
|
|
2007-12-28 03:06:30 +00:00
|
|
|
l_type = tvb_get_guint8(tvb, offset2);
|
|
|
|
length = tvb_get_guint8(tvb, offset2+1);
|
|
|
|
|
|
|
|
if (length < 2) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 0,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad ERO object: subobject length %u < 2",
|
|
|
|
length);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
type_exp_route = (l_type & Mask_Type);
|
|
|
|
if (body_obj_len <length) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad ERO object: subobject length %u > remaining length %u",
|
|
|
|
length, body_obj_len);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch(type_exp_route) {
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_IPv4:
|
|
|
|
dissect_subobj_ipv4(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_explicit_route, l_type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_IPv6:
|
|
|
|
dissect_subobj_ipv6(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_explicit_route, l_type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_LABEL_CONTROL:
|
|
|
|
dissect_subobj_label_control(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_explicit_route, l_type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_UNNUMB_INTERFACE_ID:
|
|
|
|
dissect_subobj_unnumb_interfaceID(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_explicit_route, l_type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_AUTONOMOUS_SYS_NUM:
|
|
|
|
dissect_subobj_autonomous_sys_num(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_explicit_route, l_type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2011-02-03 20:14:38 +00:00
|
|
|
case PCEP_SUB_PKSv4:
|
|
|
|
dissect_subobj_pksv4(pcep_object_tree, tvb, offset2, ett_pcep_obj_explicit_route, l_type, length);
|
|
|
|
break;
|
2007-12-28 03:06:30 +00:00
|
|
|
default:
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, length, "Non defined subobject (%d)", type_exp_route);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2011-01-15 03:25:43 +00:00
|
|
|
}
|
2007-12-28 03:06:30 +00:00
|
|
|
offset2 += length;
|
|
|
|
body_obj_len -= length;
|
2011-01-15 03:25:43 +00:00
|
|
|
}
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
* RECORD ROUTE OBJECT (RRO)
|
|
|
|
*------------------------------------------------------------------------------*/
|
2011-01-15 03:25:43 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_record_route_obj(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2, int obj_length, int obj_class)
|
2007-12-23 14:19:48 +00:00
|
|
|
{
|
|
|
|
guint8 type;
|
|
|
|
guint8 length;
|
2007-12-28 03:06:30 +00:00
|
|
|
guint body_obj_len;
|
|
|
|
|
|
|
|
body_obj_len = obj_length - OBJ_HDR_LEN;
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
while(body_obj_len){
|
2007-12-28 03:06:30 +00:00
|
|
|
if (body_obj_len < 2) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 0,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad RRO object: subobject goes past end of object");
|
|
|
|
break;
|
|
|
|
}
|
2007-12-23 14:19:48 +00:00
|
|
|
|
2007-12-28 03:06:30 +00:00
|
|
|
type = tvb_get_guint8(tvb, offset2);
|
|
|
|
length = tvb_get_guint8(tvb, offset2+1);
|
|
|
|
|
|
|
|
if (length < 2) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 0,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad RRO object: subobject length %u < 2",
|
|
|
|
length);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (body_obj_len <length) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad RRO subobject: subobject length %u > remaining length %u",
|
|
|
|
length, body_obj_len);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch(type) {
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_IPv4:
|
|
|
|
dissect_subobj_ipv4(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_record_route, type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_IPv6:
|
|
|
|
dissect_subobj_ipv6(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_record_route, type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_LABEL_CONTROL:
|
|
|
|
dissect_subobj_label_control(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_record_route, type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_UNNUMB_INTERFACE_ID:
|
|
|
|
dissect_subobj_unnumb_interfaceID(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_record_route, type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
default:
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, length, "Non defined subobject (%d)", type);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
offset2 += length;
|
|
|
|
body_obj_len -= length;
|
2011-01-15 03:25:43 +00:00
|
|
|
}
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
* LSPA OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
2007-12-28 03:06:30 +00:00
|
|
|
#define LSPA_OBJ_MIN_LEN 16
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_lspa_obj(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2, int obj_length)
|
2011-01-15 03:25:43 +00:00
|
|
|
{
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_lspa_obj_flags;
|
2007-12-28 11:23:23 +00:00
|
|
|
proto_item *ti;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint32 exclude_any;
|
|
|
|
guint32 include_any;
|
|
|
|
guint32 include_all;
|
|
|
|
guint8 setup_prio;
|
|
|
|
guint8 holding_prio;
|
|
|
|
guint8 flags;
|
|
|
|
guint8 reserved;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
if (obj_length < OBJ_HDR_LEN+LSPA_OBJ_MIN_LEN) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad LSPA object length %u, should be >= %u", obj_length,
|
|
|
|
OBJ_HDR_LEN+LSPA_OBJ_MIN_LEN);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
exclude_any = tvb_get_ntohl(tvb, offset2);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 4, "Exclude-Any: 0x%08x", exclude_any);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
include_any = tvb_get_ntohl(tvb, offset2+4);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+4, 4, "Include-Any: 0x%08x", include_any);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
include_all = tvb_get_ntohl(tvb, offset2+8);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+8, 4, "Include-All: 0x%08x", include_all);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
setup_prio = tvb_get_guint8(tvb, offset2+12);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+12, 1, "Setup Priority: %u", setup_prio);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
holding_prio = tvb_get_guint8(tvb, offset2+13);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+13, 1, "Holding Priority: %u", holding_prio);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
flags = tvb_get_guint8(tvb, offset2+14);
|
2007-12-28 23:05:22 +00:00
|
|
|
ti = proto_tree_add_text(pcep_object_tree, tvb, offset2+14, 1, "Flags: 0x%02x", flags);
|
|
|
|
pcep_lspa_obj_flags = proto_item_add_subtree(ti, ett_pcep_obj_metric);
|
|
|
|
proto_tree_add_boolean(pcep_lspa_obj_flags, pcep_lspa_flags_l, tvb, offset2+14, 1, flags);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
reserved = tvb_get_guint8(tvb, offset2+15);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+15, 1, "Reserved: 0x%02x", reserved);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2013-02-26 01:06:19 +00:00
|
|
|
/*it's suppose that obj_length is a valid date. The object can have optional TLV(s)*/
|
2007-12-28 03:06:30 +00:00
|
|
|
offset2 += LSPA_OBJ_MIN_LEN;
|
|
|
|
obj_length -= OBJ_HDR_LEN+LSPA_OBJ_MIN_LEN;
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_lspa);
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
* INCLUDE ROUTE OBJECT (IRO)
|
|
|
|
*------------------------------------------------------------------------------*/
|
2011-01-15 03:25:43 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_iro_obj(proto_tree *pcep_object_tree,
|
2007-12-28 03:06:30 +00:00
|
|
|
tvbuff_t *tvb, int offset2, int obj_length, int obj_class)
|
2011-01-15 03:25:43 +00:00
|
|
|
{
|
2007-12-23 14:19:48 +00:00
|
|
|
guint8 l_type;
|
|
|
|
guint8 length;
|
|
|
|
int type_iro;
|
2007-12-28 03:06:30 +00:00
|
|
|
guint body_obj_len;
|
|
|
|
|
|
|
|
body_obj_len = obj_length - OBJ_HDR_LEN;
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
while(body_obj_len){
|
2007-12-28 03:06:30 +00:00
|
|
|
if (body_obj_len < 2) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 0,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad IRO object: subobject goes past end of object");
|
|
|
|
break;
|
|
|
|
}
|
2007-12-23 14:19:48 +00:00
|
|
|
|
2007-12-28 03:06:30 +00:00
|
|
|
l_type = tvb_get_guint8(tvb, offset2);
|
|
|
|
length = tvb_get_guint8(tvb, offset2+1);
|
|
|
|
|
|
|
|
if (length < 2) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 0,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad IRO object: subobject length %u < 2",
|
|
|
|
length);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
type_iro = (l_type & Mask_Type);
|
|
|
|
|
|
|
|
if (body_obj_len <length) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad IRO object: subobject length %u > remaining length %u",
|
|
|
|
length, body_obj_len);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch(type_iro) {
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_IPv4:
|
|
|
|
dissect_subobj_ipv4(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_iro, l_type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_IPv6:
|
|
|
|
dissect_subobj_ipv6(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_iro, l_type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_UNNUMB_INTERFACE_ID:
|
|
|
|
dissect_subobj_unnumb_interfaceID(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_iro, l_type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_AUTONOMOUS_SYS_NUM:
|
|
|
|
dissect_subobj_autonomous_sys_num(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_iro, l_type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_EXRS:
|
|
|
|
dissect_subobj_exrs(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_iro, type_iro, l_type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
default:
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, length, "Non defined subobject (%d)", type_iro);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2011-01-15 03:25:43 +00:00
|
|
|
}
|
2007-12-28 03:06:30 +00:00
|
|
|
offset2 += length;
|
|
|
|
body_obj_len -= length;
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
2007-12-28 03:06:30 +00:00
|
|
|
}
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
2011-01-15 03:25:43 +00:00
|
|
|
* SVEC OBJECT
|
2007-12-23 14:19:48 +00:00
|
|
|
*------------------------------------------------------------------------------*/
|
2007-12-28 03:06:30 +00:00
|
|
|
#define SVEC_OBJ_MIN_LEN 4
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_svec_obj(proto_tree *pcep_object_tree,
|
2007-12-28 03:06:30 +00:00
|
|
|
tvbuff_t *tvb, int offset2, int obj_length)
|
2007-12-23 14:19:48 +00:00
|
|
|
{
|
2007-12-28 11:23:23 +00:00
|
|
|
proto_item *ti;
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_svec_flags_obj;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint8 reserved;
|
|
|
|
guint32 flags;
|
|
|
|
int m = 1;
|
|
|
|
int i = 0;
|
|
|
|
|
2007-12-28 03:06:30 +00:00
|
|
|
if (obj_length < OBJ_HDR_LEN+SVEC_OBJ_MIN_LEN) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad SVEC object length %u, should be >= %u", obj_length,
|
|
|
|
OBJ_HDR_LEN+SVEC_OBJ_MIN_LEN);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
reserved = tvb_get_guint8(tvb, offset2);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 1, "Reserved: 0x%02x", reserved);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
flags = tvb_get_ntoh24(tvb, offset2+1);
|
2007-12-28 23:05:22 +00:00
|
|
|
ti = proto_tree_add_text(pcep_object_tree, tvb, offset2+1, 3, "Flags: 0x%06x", flags);
|
|
|
|
pcep_svec_flags_obj = proto_item_add_subtree(ti, ett_pcep_obj_svec);
|
|
|
|
proto_tree_add_boolean(pcep_svec_flags_obj, pcep_svec_flags_l, tvb, offset2 + 1, 3, flags);
|
|
|
|
proto_tree_add_boolean(pcep_svec_flags_obj, pcep_svec_flags_n, tvb, offset2 + 1, 3, flags);
|
|
|
|
proto_tree_add_boolean(pcep_svec_flags_obj, pcep_svec_flags_s, tvb, offset2 + 1, 3, flags);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
for ( i=4 ; i<(obj_length-OBJ_HDR_LEN) ; ){
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+i, 4, "Request-ID-Number %u: 0x%s", m,
|
2011-02-09 22:37:26 +00:00
|
|
|
tvb_bytes_to_str_punct(tvb, offset2+i, 4, ' '));
|
2007-12-28 03:06:30 +00:00
|
|
|
i += 4;
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
2011-01-15 03:25:43 +00:00
|
|
|
* NOTIFICATION OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
2007-12-28 03:06:30 +00:00
|
|
|
#define NOTIFICATION_OBJ_MIN_LEN 4
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_notification_obj(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2, int obj_length)
|
2011-01-15 03:25:43 +00:00
|
|
|
{
|
2007-12-23 14:19:48 +00:00
|
|
|
guint8 reserved;
|
|
|
|
guint8 flags;
|
|
|
|
guint8 nt;
|
|
|
|
guint8 nv;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
if (obj_length < OBJ_HDR_LEN+NOTIFICATION_OBJ_MIN_LEN) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad NOTIFICATION object length %u, should be >= %u", obj_length,
|
|
|
|
OBJ_HDR_LEN+NOTIFICATION_OBJ_MIN_LEN);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
reserved = tvb_get_guint8(tvb, offset2);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 1, "Reserved: 0x%02x", reserved);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
flags = tvb_get_guint8(tvb, offset2+1);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+1, 1, "Flags: 0x%02x", flags);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
nt = tvb_get_guint8(tvb, offset2+2);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_uint(pcep_object_tree, pcep_filter[PCEPF_NOTI_TYPE], tvb, offset2+2, 1, nt);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
switch(nt){
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
case 1:
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_uint(pcep_object_tree, pcep_filter[PCEPF_NOTI_VAL1], tvb, offset2+2, 1, nt);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
case 2:
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_uint(pcep_object_tree, pcep_filter[PCEPF_NOTI_VAL2], tvb, offset2+2, 1, nt);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
default:
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+2, 1, "Notification Type: %u", nt);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
nv = tvb_get_guint8(tvb, offset2+3);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+3, 1, "Notification Value: 0x%02x", nv);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2013-02-26 01:06:19 +00:00
|
|
|
/*it's suppose that obj_length is a valid date. The object can have optional TLV(s)*/
|
2007-12-28 03:06:30 +00:00
|
|
|
offset2 += NOTIFICATION_OBJ_MIN_LEN;
|
|
|
|
obj_length -= OBJ_HDR_LEN+NOTIFICATION_OBJ_MIN_LEN;
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_notification);
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
2011-01-15 03:25:43 +00:00
|
|
|
* ERROR OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
2007-12-28 03:06:30 +00:00
|
|
|
#define ERROR_OBJ_MIN_LEN 4
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_error_obj(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2, int obj_length)
|
2011-01-15 03:25:43 +00:00
|
|
|
{
|
2007-12-23 14:19:48 +00:00
|
|
|
guint8 reserved;
|
|
|
|
guint8 flags;
|
|
|
|
guint8 error_type;
|
|
|
|
guint8 error_value;
|
2011-02-03 20:14:38 +00:00
|
|
|
const gchar *err_str;
|
|
|
|
const gchar *default_str = "Unassigned";
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
if (obj_length < OBJ_HDR_LEN+ERROR_OBJ_MIN_LEN) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad ERROR object length %u, should be >= %u", obj_length,
|
|
|
|
OBJ_HDR_LEN+ERROR_OBJ_MIN_LEN);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
reserved = tvb_get_guint8(tvb, offset2);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 1, "Reserved: 0x%02x", reserved);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
flags = tvb_get_guint8(tvb, offset2+1);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+1, 1, "Flags: 0x%02x", flags);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
error_type = tvb_get_guint8(tvb, offset2+2);
|
|
|
|
error_value = tvb_get_guint8(tvb, offset2+3);
|
2011-02-03 20:14:38 +00:00
|
|
|
proto_tree_add_uint(pcep_object_tree, pcep_filter[PCEPF_ERROR_TYPE], tvb, offset2+2, 1, error_type);
|
|
|
|
|
|
|
|
err_str = default_str;
|
|
|
|
switch (error_type){
|
2007-12-23 14:19:48 +00:00
|
|
|
case ESTABLISH_FAILURE:
|
2012-08-10 22:55:02 +00:00
|
|
|
err_str = val_to_str_const(error_value, pcep_error_value_1_vals, "Unknown");
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
case CAP_NOT_SUPPORTED:
|
|
|
|
break;
|
|
|
|
case UNKNOWN_OBJ:
|
2012-08-10 22:55:02 +00:00
|
|
|
err_str = val_to_str_const(error_value, pcep_error_value_3_vals, "Unknown");
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
case NOT_SUPP_OBJ:
|
2012-08-10 22:55:02 +00:00
|
|
|
err_str = val_to_str_const(error_value, pcep_error_value_4_vals, "Unknown");
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-23 14:19:48 +00:00
|
|
|
case POLICY_VIOLATION:
|
2012-08-10 22:55:02 +00:00
|
|
|
err_str = val_to_str_const(error_value, pcep_error_value_5_vals, "Unknown");
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
2011-01-15 03:25:43 +00:00
|
|
|
case MANDATORY_OBJ_MIS:
|
2012-08-10 22:55:02 +00:00
|
|
|
err_str = val_to_str_const(error_value, pcep_error_value_6_vals, "Unknown");
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
case SYNCH_PCREQ_MIS:
|
|
|
|
break;
|
2011-01-15 03:25:43 +00:00
|
|
|
case UNKNOWN_REQ_REF:
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
case ATTEMPT_2_SESSION:
|
|
|
|
break;
|
2011-02-03 20:14:38 +00:00
|
|
|
case INVALID_OBJ:
|
2012-08-10 22:55:02 +00:00
|
|
|
err_str = val_to_str_const(error_value, pcep_error_value_10_vals, "Unknown");
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-23 14:19:48 +00:00
|
|
|
case UNRECO_EXRS_SUBOBJ:
|
|
|
|
break;
|
2011-02-03 20:14:38 +00:00
|
|
|
case DIFFSERV_TE_ERROR:
|
2012-08-10 22:55:02 +00:00
|
|
|
err_str = val_to_str_const(error_value, pcep_error_value_12_vals, "Unknown");
|
2011-02-03 20:14:38 +00:00
|
|
|
break;
|
|
|
|
case BRPC_FAILURE:
|
2012-08-10 22:55:02 +00:00
|
|
|
err_str = val_to_str_const(error_value, pcep_error_value_13_vals, "Unknown");
|
2011-02-03 20:14:38 +00:00
|
|
|
break;
|
|
|
|
case GCO_ERROR:
|
2012-08-10 22:55:02 +00:00
|
|
|
err_str = val_to_str_const(error_value, pcep_error_value_15_vals, "Unknown");
|
2011-02-03 20:14:38 +00:00
|
|
|
break;
|
|
|
|
case P2MP_CAPABILITY_ERROR:
|
2012-08-10 22:55:02 +00:00
|
|
|
err_str = val_to_str_const(error_value, pcep_error_value_16_vals, "Unknown");
|
2011-02-03 20:14:38 +00:00
|
|
|
break;
|
|
|
|
case P2MP_END_POINTS_ERROR:
|
2012-08-10 22:55:02 +00:00
|
|
|
err_str = val_to_str_const(error_value, pcep_error_value_17_vals, "Unknown");
|
2011-02-03 20:14:38 +00:00
|
|
|
break;
|
|
|
|
case P2MP_FRAGMENT_ERROR:
|
2012-08-10 22:55:02 +00:00
|
|
|
err_str = val_to_str_const(error_value, pcep_error_value_18_vals, "Unknown");
|
2011-02-03 20:14:38 +00:00
|
|
|
break;
|
2007-12-23 14:19:48 +00:00
|
|
|
default:
|
2011-02-03 20:14:38 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+2, 1, "Error-Type: %u Non defined Error-Value", error_type);
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
2011-02-03 20:14:38 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+3, 1, "Error-Value: %s (%u)", err_str, error_value);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2013-02-26 01:06:19 +00:00
|
|
|
/*it's suppose that obj_length is a valid date. The object can have optional TLV(s)*/
|
2007-12-28 03:06:30 +00:00
|
|
|
offset2 += ERROR_OBJ_MIN_LEN;
|
|
|
|
obj_length -= OBJ_HDR_LEN+ERROR_OBJ_MIN_LEN;
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_error);
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
2011-01-15 03:25:43 +00:00
|
|
|
* LOAD-BALANCING OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
2007-12-29 00:57:51 +00:00
|
|
|
#define LOAD_BALANCING_OBJ_LEN 8
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_balancing_obj(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2, int obj_length)
|
2011-01-15 03:25:43 +00:00
|
|
|
{
|
2007-12-23 14:19:48 +00:00
|
|
|
guint16 reserved;
|
|
|
|
guint8 flags;
|
|
|
|
guint8 max_LSP;
|
|
|
|
guint32 min_bandwidth;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-29 00:57:51 +00:00
|
|
|
if (obj_length != OBJ_HDR_LEN+LOAD_BALANCING_OBJ_LEN) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
2007-12-29 00:57:51 +00:00
|
|
|
"Bad LOAD-BALANCING object length %u, should be %u", obj_length,
|
|
|
|
OBJ_HDR_LEN+LOAD_BALANCING_OBJ_LEN);
|
2007-12-28 03:06:30 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
reserved = tvb_get_ntohs(tvb, offset2);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 2, "Reserved: 0x%04x", reserved);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
flags = tvb_get_guint8(tvb, offset2+2);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+2, 1, "Flags: 0x%02x", flags);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
max_LSP = tvb_get_guint8(tvb, offset2+3);
|
2008-12-20 00:09:02 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+3, 1, "Maximum Number of TE LSPs: 0x%02x", max_LSP);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
min_bandwidth = tvb_get_ntohl(tvb, offset2+4);
|
2008-12-20 00:09:02 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+4, 4, "Minimum Bandwidth: 0x%08x", min_bandwidth);
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
2011-01-15 03:25:43 +00:00
|
|
|
* CLOSE OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
2007-12-28 03:06:30 +00:00
|
|
|
#define CLOSE_OBJ_MIN_LEN 4
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_close_obj(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2, int obj_length)
|
2007-12-23 14:19:48 +00:00
|
|
|
{
|
|
|
|
guint16 reserved;
|
|
|
|
guint8 flags;
|
|
|
|
guint8 reason;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
if (obj_length < OBJ_HDR_LEN+CLOSE_OBJ_MIN_LEN) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad CLOSE object length %u, should be >= %u", obj_length,
|
|
|
|
OBJ_HDR_LEN+CLOSE_OBJ_MIN_LEN);
|
|
|
|
return;
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
2007-12-28 03:06:30 +00:00
|
|
|
reserved = tvb_get_ntohs(tvb, offset2);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 2, "Reserved: 0x%04x", reserved);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
flags = tvb_get_guint8(tvb, offset2+2);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+2, 1, "Flags: 0x%02x", flags);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
reason = tvb_get_guint8(tvb, offset2+3);
|
2012-08-10 22:55:02 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2+3, 1, "Reason: %s (%u)", val_to_str_const(reason, pcep_close_reason_obj_vals, "Unknown"), reason);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2013-02-26 01:06:19 +00:00
|
|
|
/*it's suppose that obj_length is a valid date. The object can have optional TLV(s)*/
|
2007-12-28 03:06:30 +00:00
|
|
|
offset2 += CLOSE_OBJ_MIN_LEN;
|
|
|
|
obj_length -= OBJ_HDR_LEN+CLOSE_OBJ_MIN_LEN;
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_load_balancing);
|
2007-12-28 03:06:30 +00:00
|
|
|
}
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
/*------------------------------------------------------------------------------
|
2011-02-03 20:14:38 +00:00
|
|
|
* PATH-KEY OBJECT
|
2011-01-15 03:25:43 +00:00
|
|
|
*------------------------------------------------------------------------------*/
|
2011-02-03 22:04:19 +00:00
|
|
|
static void
|
2011-02-03 20:14:38 +00:00
|
|
|
dissect_pcep_path_key_obj(proto_tree *pcep_object_tree,
|
|
|
|
tvbuff_t *tvb, int offset2, int obj_length)
|
|
|
|
{
|
|
|
|
guint8 l_type;
|
|
|
|
guint8 length;
|
|
|
|
guint type_exp_route;
|
|
|
|
guint body_obj_len;
|
|
|
|
|
|
|
|
body_obj_len = obj_length - OBJ_HDR_LEN;
|
|
|
|
|
|
|
|
while(body_obj_len){
|
|
|
|
if (body_obj_len < 2) {
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 0,
|
|
|
|
"Bad PATH-KEY object: subobject goes past end of object");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
l_type = tvb_get_guint8(tvb, offset2);
|
|
|
|
length = tvb_get_guint8(tvb, offset2+1);
|
|
|
|
|
|
|
|
if (length < 2) {
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 0,
|
|
|
|
"Bad PATH-KEY object: subobject length %u < 2",
|
|
|
|
length);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
type_exp_route = (l_type & Mask_Type);
|
|
|
|
if (body_obj_len <length) {
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, length,
|
|
|
|
"Bad PATH-KEY object: subobject length %u > remaining length %u",
|
|
|
|
length, body_obj_len);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch(type_exp_route) {
|
|
|
|
case PCEP_SUB_PKSv4:
|
|
|
|
dissect_subobj_pksv4(pcep_object_tree, tvb, offset2, ett_pcep_obj_explicit_route, l_type, length);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, length, "Non defined subobject (%d)", type_exp_route);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
offset2 += length;
|
|
|
|
body_obj_len -= length;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
2011-02-03 22:04:19 +00:00
|
|
|
* XRO OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
2007-12-28 03:06:30 +00:00
|
|
|
#define XRO_OBJ_MIN_LEN 4
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_xro_obj(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2, int obj_length, int obj_class)
|
2007-12-23 14:19:48 +00:00
|
|
|
{
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_xro_flags_obj;
|
2007-12-28 11:23:23 +00:00
|
|
|
proto_item *ti;
|
2007-12-23 14:19:48 +00:00
|
|
|
guint16 reserved;
|
|
|
|
guint16 flags;
|
|
|
|
guint8 x_type;
|
|
|
|
guint8 length;
|
|
|
|
guint type_xro;
|
2007-12-28 03:06:30 +00:00
|
|
|
guint body_obj_len;
|
|
|
|
|
|
|
|
body_obj_len = obj_length - OBJ_HDR_LEN;
|
|
|
|
|
|
|
|
if (obj_length < OBJ_HDR_LEN+XRO_OBJ_MIN_LEN) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad XRO object length %u, should be >= %u", obj_length,
|
|
|
|
OBJ_HDR_LEN+XRO_OBJ_MIN_LEN);
|
|
|
|
return;
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
reserved = tvb_get_ntohs(tvb, offset2);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 2, "Reserved: 0x%04x", reserved);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
flags = tvb_get_ntohs(tvb, offset2+2);
|
2007-12-28 23:05:22 +00:00
|
|
|
ti = proto_tree_add_text(pcep_object_tree, tvb, offset2+2, 2, "Flags: 0x%04x ", flags);
|
|
|
|
pcep_xro_flags_obj = proto_item_add_subtree(ti, ett_pcep_obj_xro);
|
|
|
|
proto_tree_add_boolean(pcep_xro_flags_obj, pcep_xro_flags_f, tvb, offset2 + 2, 2, flags);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
offset2 += XRO_OBJ_MIN_LEN;
|
|
|
|
body_obj_len -= XRO_OBJ_MIN_LEN;
|
|
|
|
|
|
|
|
while(body_obj_len >= 2){
|
|
|
|
if (body_obj_len < 2) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 0,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad XRO object: subobject goes past end of object");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
x_type = tvb_get_guint8(tvb, offset2);
|
|
|
|
length = tvb_get_guint8(tvb, offset2+1);
|
|
|
|
|
|
|
|
if (length < 2) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 0,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad XRO object: object length %u < 2", length);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
type_xro = (x_type & Mask_Type);
|
|
|
|
|
|
|
|
if (body_obj_len <length) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, length,
|
2007-12-28 03:06:30 +00:00
|
|
|
"Bad XRO object: object length %u > remaining length %u",
|
|
|
|
length, body_obj_len);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch(type_xro) {
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_IPv4:
|
|
|
|
dissect_subobj_ipv4(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_xro, x_type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_IPv6:
|
|
|
|
dissect_subobj_ipv6(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_xro, x_type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2011-09-17 03:58:41 +00:00
|
|
|
case PCEP_SUB_UNNUMB_INTERFACE_ID:
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_subobj_unnumb_interfaceID(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_xro, x_type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2011-09-17 03:58:41 +00:00
|
|
|
case PCEP_SUB_AUTONOMOUS_SYS_NUM:
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_subobj_autonomous_sys_num(pcep_object_tree, tvb, offset2, obj_class, ett_pcep_obj_xro, x_type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SUB_SRLG:
|
|
|
|
dissect_subobj_srlg(pcep_object_tree, tvb, offset2, ett_pcep_obj_xro, x_type, length);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
2011-02-03 20:14:38 +00:00
|
|
|
case PCEP_SUB_PKSv4:
|
|
|
|
dissect_subobj_pksv4(pcep_object_tree, tvb, offset2, ett_pcep_obj_xro, x_type, length);
|
|
|
|
break;
|
|
|
|
case PCEP_SUB_PKSv6:
|
|
|
|
dissect_subobj_pksv6(pcep_object_tree, tvb, offset2, ett_pcep_obj_xro, x_type, length);
|
|
|
|
break;
|
2007-12-28 03:06:30 +00:00
|
|
|
default:
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2-4, length, "Non defined subobject (%d)", type_xro);
|
2007-12-28 03:06:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
offset2 += length;
|
|
|
|
body_obj_len -= length;
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-30 22:36:02 +00:00
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
* MONITORING OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
|
|
|
#define OBJ_MONITORING_MIN_LEN 8
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_pcep_obj_monitoring(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2, int obj_length)
|
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *monitoring_flags;
|
|
|
|
|
|
|
|
if (obj_length < OBJ_HDR_LEN + OBJ_MONITORING_MIN_LEN) {
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
|
|
|
"Bad MONITORING object length %u, should be >= %u", obj_length,
|
|
|
|
OBJ_HDR_LEN + OBJ_MONITORING_MIN_LEN);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 1, "Reserved: 0x%02x", tvb_get_guint8(tvb, offset2));
|
|
|
|
ti = proto_tree_add_text(pcep_object_tree, tvb, offset2+1, 3, "Flags: 0x%06x", tvb_get_ntoh24(tvb, offset2+1));
|
|
|
|
monitoring_flags = proto_item_add_subtree(ti, ett_pcep_obj_monitoring);
|
|
|
|
proto_tree_add_item(monitoring_flags, pcep_obj_monitoring_flags_reserved, tvb, offset2 + 1, 3, ENC_NA);
|
|
|
|
proto_tree_add_item(monitoring_flags, pcep_obj_monitoring_flags_i, tvb, offset2 + 1, 3, ENC_NA);
|
|
|
|
proto_tree_add_item(monitoring_flags, pcep_obj_monitoring_flags_c, tvb, offset2 + 1, 3, ENC_NA);
|
|
|
|
proto_tree_add_item(monitoring_flags, pcep_obj_monitoring_flags_p, tvb, offset2 + 1, 3, ENC_NA);
|
|
|
|
proto_tree_add_item(monitoring_flags, pcep_obj_monitoring_flags_g, tvb, offset2 + 1, 3, ENC_NA);
|
|
|
|
proto_tree_add_item(monitoring_flags, pcep_obj_monitoring_flags_l, tvb, offset2 + 1, 3, ENC_NA);
|
|
|
|
proto_tree_add_item(pcep_object_tree, pcep_obj_monitoring_monitoring_id_number, tvb, offset2 + 4, 4, ENC_NA);
|
|
|
|
|
|
|
|
/* The object can have optional TLV(s)*/
|
|
|
|
offset2 += OBJ_MONITORING_MIN_LEN;
|
|
|
|
obj_length -= OBJ_HDR_LEN + OBJ_MONITORING_MIN_LEN;
|
|
|
|
dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_monitoring);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
* PCC-ID-REQ OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
|
|
|
#define OBJ_PCC_ID_REQ_IPV4_LEN 4
|
|
|
|
#define OBJ_PCC_ID_REQ_IPV6_LEN 16
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_pcep_obj_pcc_id_req(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2, int obj_length, int type)
|
|
|
|
{
|
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case PCEP_OBJ_PCC_ID_REQ_IPv4:
|
|
|
|
if (obj_length != OBJ_HDR_LEN + OBJ_PCC_ID_REQ_IPV4_LEN) {
|
|
|
|
proto_tree_add_text(pcep_object_tree, 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);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
proto_tree_add_item(pcep_object_tree, pcep_obj_pcc_id_req_ipv4, tvb, offset2, 4, ENC_NA);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PCEP_OBJ_PCC_ID_REQ_IPv6:
|
|
|
|
if (obj_length != OBJ_HDR_LEN + OBJ_PCC_ID_REQ_IPV6_LEN) {
|
|
|
|
proto_tree_add_text(pcep_object_tree, 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);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
proto_tree_add_item(pcep_object_tree, pcep_obj_pcc_id_req_ipv6, tvb, offset2, 16, ENC_NA);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length - OBJ_HDR_LEN, "UNKNOWN Type Object (%u)", type);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-03 20:14:38 +00:00
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
* OF OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
|
|
|
#define OF_OBJ_MIN_LEN 4
|
|
|
|
|
2011-02-03 22:04:19 +00:00
|
|
|
static void
|
2011-02-03 20:14:38 +00:00
|
|
|
dissect_pcep_of_obj(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2, int obj_length)
|
2011-02-03 22:04:19 +00:00
|
|
|
{
|
|
|
|
guint16 of_code;
|
2011-02-03 20:14:38 +00:00
|
|
|
|
|
|
|
if (obj_length < OBJ_HDR_LEN+OF_OBJ_MIN_LEN) {
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
|
|
|
"Bad OF object length %u, should be >= %u", obj_length,
|
|
|
|
OBJ_HDR_LEN+OF_OBJ_MIN_LEN);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
of_code = tvb_get_ntohs(tvb, offset2);
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 2, "OF-Code: %s (%u)",
|
2012-08-10 22:55:02 +00:00
|
|
|
val_to_str_const(of_code, pcep_of_vals, "Unknown"), of_code);
|
2011-02-03 20:14:38 +00:00
|
|
|
|
|
|
|
/*The object can have optional TLV(s)*/
|
|
|
|
offset2 += OPEN_OBJ_MIN_LEN;
|
|
|
|
obj_length -= OBJ_HDR_LEN+OF_OBJ_MIN_LEN;
|
|
|
|
dissect_pcep_tlvs(pcep_object_tree, tvb, offset2, obj_length, ett_pcep_obj_open);
|
|
|
|
}
|
|
|
|
|
2012-03-30 22:36:02 +00:00
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
* PCE-ID OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
|
|
|
#define OBJ_PCE_ID_IPV4_LEN 4
|
|
|
|
#define OBJ_PCE_ID_IPV6_LEN 16
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_pcep_obj_pce_id(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2, int obj_length, int type)
|
|
|
|
{
|
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case PCEP_OBJ_PCE_ID_IPv4:
|
|
|
|
if (obj_length != OBJ_HDR_LEN + OBJ_PCE_ID_IPV4_LEN) {
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
|
|
|
"Bad IPv4 PCE-ID object length %u, should be %u", obj_length,
|
|
|
|
OBJ_HDR_LEN + OBJ_PCE_ID_IPV4_LEN);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
proto_tree_add_item(pcep_object_tree, pcep_obj_pce_id_ipv4, tvb, offset2, 4, ENC_NA);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PCEP_OBJ_PCE_ID_IPv6:
|
|
|
|
if (obj_length != OBJ_HDR_LEN + OBJ_PCE_ID_IPV6_LEN) {
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
|
|
|
"Bad IPv6 PCE-ID object length %u, should be %u", obj_length,
|
|
|
|
OBJ_HDR_LEN + OBJ_PCE_ID_IPV6_LEN);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
proto_tree_add_item(pcep_object_tree, pcep_obj_pce_id_ipv6, tvb, offset2, 16, ENC_NA);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length - OBJ_HDR_LEN, "UNKNOWN Type Object (%u)", type);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
* PROC-TIME OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
|
|
|
#define OBJ_PROC_TIME_LEN 24
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_pcep_obj_proc_time(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2, int obj_length)
|
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *proc_time_flags;
|
|
|
|
|
|
|
|
if (obj_length != OBJ_HDR_LEN + OBJ_PROC_TIME_LEN) {
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
|
|
|
"Bad PROC-TIME object length %u, should be %u", obj_length,
|
|
|
|
OBJ_HDR_LEN + OBJ_PROC_TIME_LEN);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 2, "Reserved: 0x%04x", tvb_get_ntohs(tvb, offset2));
|
|
|
|
ti = proto_tree_add_text(pcep_object_tree, tvb, offset2 + 2, 2, "Flags: 0x%04x ", tvb_get_ntohs(tvb, offset2 + 2));
|
|
|
|
proc_time_flags = proto_item_add_subtree(ti, ett_pcep_obj_proc_time);
|
|
|
|
proto_tree_add_item(proc_time_flags, pcep_obj_proc_time_flags_reserved, tvb, offset2 + 2, 2, ENC_NA);
|
|
|
|
proto_tree_add_item(proc_time_flags, pcep_obj_proc_time_flags_e, tvb, offset2 + 2, 2, ENC_NA);
|
|
|
|
proto_tree_add_item(pcep_object_tree, pcep_obj_proc_time_cur_proc_time, tvb, offset2 + 4, 4, ENC_NA);
|
|
|
|
proto_tree_add_item(pcep_object_tree, pcep_obj_proc_time_min_proc_time, tvb, offset2 + 8, 4, ENC_NA);
|
|
|
|
proto_tree_add_item(pcep_object_tree, pcep_obj_proc_time_max_proc_time, tvb, offset2 + 12, 4, ENC_NA);
|
|
|
|
proto_tree_add_item(pcep_object_tree, pcep_obj_proc_time_ave_proc_time, tvb, offset2 + 16, 4, ENC_NA);
|
|
|
|
proto_tree_add_item(pcep_object_tree, pcep_obj_proc_time_var_proc_time, tvb, offset2 + 20, 4, ENC_NA);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
|
|
|
* OVERLOAD OBJECT
|
|
|
|
*------------------------------------------------------------------------------*/
|
|
|
|
#define OBJ_OVERLOAD_LEN 4
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_pcep_obj_overload(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2, int obj_length)
|
|
|
|
{
|
|
|
|
if (obj_length != OBJ_HDR_LEN + OBJ_OVERLOAD_LEN) {
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, obj_length,
|
|
|
|
"Bad OVERLOAD object length %u, should be %u", obj_length,
|
|
|
|
OBJ_HDR_LEN + OBJ_OVERLOAD_LEN);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2, 1, "Flags: 0x%02x", tvb_get_guint8(tvb, offset2));
|
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset2 + 1, 1, "Reserved: 0x%02x", tvb_get_guint8(tvb, offset2 + 1));
|
|
|
|
proto_tree_add_item(pcep_object_tree, pcep_obj_overload_duration, tvb, offset2 + 2, 2, ENC_NA);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
/*------------------------------------------------------------------------------*/
|
2007-12-23 14:19:48 +00:00
|
|
|
/* Dissect in Objects */
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
static void
|
2011-01-15 03:25:43 +00:00
|
|
|
dissect_pcep_obj_tree(proto_tree *pcep_tree, tvbuff_t *tvb, int len, int offset, int msg_length)
|
|
|
|
{
|
2007-12-28 03:06:30 +00:00
|
|
|
guint8 obj_class;
|
|
|
|
guint8 ot_res_p_i;
|
|
|
|
guint16 obj_length;
|
|
|
|
int type;
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_object_tree;
|
|
|
|
proto_item *pcep_object_item;
|
|
|
|
proto_tree *pcep_header_obj_flags;
|
2007-12-28 11:23:23 +00:00
|
|
|
proto_item *ti;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
while (len < msg_length) {
|
|
|
|
obj_class = tvb_get_guint8(tvb, offset);
|
2007-12-28 11:23:23 +00:00
|
|
|
switch (obj_class) {
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_OPEN_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_OPEN], tvb, offset, -1, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_open);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_RP_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_RP], tvb, offset, -1, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_request_parameters);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_NO_PATH_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_NO_PATH], tvb, offset, -1, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_no_path);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_END_POINT_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_END_POINT], tvb, offset, -1, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_end_point);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_BANDWIDTH_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_BANDWIDTH], tvb, offset, -1, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_bandwidth);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_METRIC_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_METRIC], tvb, offset, -1, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_metric);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_EXPLICIT_ROUTE_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_EXPLICIT_ROUTE], tvb, offset, -1, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_explicit_route);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_RECORD_ROUTE_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_RECORD_ROUTE], tvb, offset, -1, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_record_route);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_LSPA_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_LSPA], tvb, offset, -1, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_lspa);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_IRO_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_IRO], tvb, offset, -1, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_iro);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SVEC_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_SVEC], tvb, offset, -1, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_svec);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_NOTIFICATION_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_NOTIFICATION], tvb, offset, -1, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_notification);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_PCEP_ERROR_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_PCEP_ERROR], tvb, offset, -1, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_error);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_LOAD_BALANCING_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_LOAD_BALANCING], tvb, offset, -1, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_load_balancing);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_CLOSE_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_CLOSE], tvb, offset, -1, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_close);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
|
2011-02-03 20:14:38 +00:00
|
|
|
case PCEP_PATH_KEY_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_PATH_KEY], tvb, offset, -1, ENC_NA);
|
2011-02-03 20:14:38 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_path_key);
|
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_XRO_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_XRO], tvb, offset, -1, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_xro);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
|
2012-03-30 22:36:02 +00:00
|
|
|
case PCEP_OBJ_MONITORING:
|
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_MONITORING], tvb, offset, -1, ENC_NA);
|
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_monitoring);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PCEP_OBJ_PCC_ID_REQ:
|
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_PCC_ID_REQ], tvb, offset, -1, ENC_NA);
|
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_pcc_id_req);
|
|
|
|
break;
|
|
|
|
|
2011-10-18 01:27:01 +00:00
|
|
|
case PCEP_OF_OBJ:
|
2011-10-19 15:04:44 +00:00
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_OF], tvb, offset, -1, ENC_NA);
|
2011-10-18 01:27:01 +00:00
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_of);
|
|
|
|
break;
|
|
|
|
|
2012-03-30 22:36:02 +00:00
|
|
|
case PCEP_OBJ_PCE_ID:
|
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_PCE_ID], tvb, offset, -1, ENC_NA);
|
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_pce_id);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PCEP_OBJ_PROC_TIME:
|
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_PROC_TIME], tvb, offset, -1, ENC_NA);
|
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_proc_time);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PCEP_OBJ_OVERLOAD:
|
|
|
|
pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_OVERLOAD], tvb, offset, -1, ENC_NA);
|
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_overload);
|
|
|
|
break;
|
|
|
|
|
2007-12-28 11:23:23 +00:00
|
|
|
default:
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_object_item = proto_tree_add_text(pcep_tree, tvb, offset, -1, "Unknown object (%u)", obj_class);
|
|
|
|
pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_unknown);
|
2007-12-28 11:23:23 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_uint(pcep_object_tree, pcep_filter[PCEPF_OBJECT_CLASS], tvb, offset, 1, obj_class);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
ot_res_p_i = tvb_get_guint8(tvb, offset+1);
|
|
|
|
type = (ot_res_p_i & MASK_OBJ_TYPE)>>4;
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset+1, 1, "Object Type: %u", type);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
ti = proto_tree_add_text(pcep_object_tree, tvb, offset+1, 1, "Flags");
|
|
|
|
pcep_header_obj_flags = proto_item_add_subtree(ti, ett_pcep_hdr);
|
|
|
|
proto_tree_add_boolean(pcep_header_obj_flags, pcep_hdr_obj_flags_reserved, tvb, offset+1, 1, ot_res_p_i);
|
|
|
|
proto_tree_add_boolean(pcep_header_obj_flags, pcep_hdr_obj_flags_p, tvb, offset+1, 1, ot_res_p_i);
|
|
|
|
proto_tree_add_boolean(pcep_header_obj_flags, pcep_hdr_obj_flags_i, tvb, offset+1, 1, ot_res_p_i);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
|
|
|
obj_length = tvb_get_ntohs(tvb, offset+2);
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_item_set_len(pcep_object_item, obj_length);
|
2007-12-23 14:19:48 +00:00
|
|
|
if (obj_length < 4) {
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset+2, 2, "Object Length: %u (bogus, must be >= 4)", obj_length);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
}
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset+2, 2, "Object Length: %u", obj_length);
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
switch(obj_class) {
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_OPEN_OBJ:
|
|
|
|
dissect_pcep_open_obj(pcep_object_tree, tvb, offset+4, obj_length);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_RP_OBJ:
|
|
|
|
dissect_pcep_rp_obj(pcep_object_tree, tvb, offset+4, obj_length);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_NO_PATH_OBJ:
|
|
|
|
dissect_pcep_no_path_obj(pcep_object_tree, tvb, offset+4, obj_length);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_END_POINT_OBJ:
|
|
|
|
dissect_pcep_end_point_obj(pcep_object_tree, tvb, offset+4, obj_length, type);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_BANDWIDTH_OBJ:
|
|
|
|
dissect_pcep_bandwidth_obj(pcep_object_tree, tvb, offset+4, obj_length);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_METRIC_OBJ:
|
|
|
|
dissect_pcep_metric_obj(pcep_object_tree, tvb, offset+4, obj_length);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_EXPLICIT_ROUTE_OBJ:
|
|
|
|
dissect_pcep_explicit_route_obj(pcep_object_tree, tvb, offset+4, obj_length, obj_class);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_RECORD_ROUTE_OBJ:
|
|
|
|
dissect_pcep_record_route_obj(pcep_object_tree, tvb, offset+4, obj_length, obj_class);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_LSPA_OBJ:
|
|
|
|
dissect_pcep_lspa_obj(pcep_object_tree, tvb, offset+4, obj_length);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_IRO_OBJ:
|
|
|
|
dissect_pcep_iro_obj(pcep_object_tree, tvb, offset+4, obj_length, obj_class);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_SVEC_OBJ:
|
|
|
|
dissect_pcep_svec_obj(pcep_object_tree, tvb, offset+4, obj_length);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_NOTIFICATION_OBJ:
|
|
|
|
dissect_pcep_notification_obj(pcep_object_tree, tvb, offset+4, obj_length);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_PCEP_ERROR_OBJ:
|
|
|
|
dissect_pcep_error_obj(pcep_object_tree, tvb, offset+4, obj_length);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_LOAD_BALANCING_OBJ:
|
|
|
|
dissect_pcep_balancing_obj(pcep_object_tree, tvb, offset+4, obj_length);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_CLOSE_OBJ:
|
|
|
|
dissect_pcep_close_obj(pcep_object_tree, tvb, offset+4, obj_length);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2011-02-03 20:14:38 +00:00
|
|
|
case PCEP_PATH_KEY_OBJ:
|
|
|
|
dissect_pcep_path_key_obj(pcep_object_tree, tvb, offset+4, obj_length);
|
|
|
|
break;
|
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEP_XRO_OBJ:
|
|
|
|
dissect_pcep_xro_obj(pcep_object_tree, tvb, offset+4, obj_length, obj_class);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2012-03-30 22:36:02 +00:00
|
|
|
case PCEP_OBJ_MONITORING:
|
|
|
|
dissect_pcep_obj_monitoring(pcep_object_tree, tvb, offset+4, obj_length);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PCEP_OBJ_PCC_ID_REQ:
|
|
|
|
dissect_pcep_obj_pcc_id_req(pcep_object_tree, tvb, offset+4, obj_length, type);
|
|
|
|
break;
|
|
|
|
|
2011-02-03 20:14:38 +00:00
|
|
|
case PCEP_OF_OBJ:
|
|
|
|
dissect_pcep_of_obj(pcep_object_tree, tvb, offset+4, obj_length);
|
|
|
|
break;
|
|
|
|
|
2012-03-30 22:36:02 +00:00
|
|
|
case PCEP_OBJ_PCE_ID:
|
|
|
|
dissect_pcep_obj_pce_id(pcep_object_tree, tvb, offset+4, obj_length, type);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PCEP_OBJ_PROC_TIME:
|
|
|
|
dissect_pcep_obj_proc_time(pcep_object_tree, tvb, offset+4, obj_length);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PCEP_OBJ_OVERLOAD:
|
|
|
|
dissect_pcep_obj_overload(pcep_object_tree, tvb, offset+4, obj_length);
|
|
|
|
break;
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
default:
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_object_tree, tvb, offset+4, obj_length-OBJ_HDR_LEN, "PCEP Object BODY non defined (%u)", type);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2007-12-28 03:06:30 +00:00
|
|
|
offset += obj_length;
|
|
|
|
len += obj_length;
|
2011-01-15 03:25:43 +00:00
|
|
|
}
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------
|
2007-12-28 23:05:22 +00:00
|
|
|
* Dissect a single PCEP message in a tree
|
2007-12-23 14:19:48 +00:00
|
|
|
*------------------------------------------------------------------------------*/
|
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_msg_tree(tvbuff_t *tvb, proto_tree *tree, guint tree_mode, packet_info *pinfo)
|
2007-12-23 14:19:48 +00:00
|
|
|
{
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_tree = NULL;
|
|
|
|
proto_tree *pcep_header_tree;
|
2007-12-23 14:19:48 +00:00
|
|
|
proto_tree *ti;
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree *pcep_header_msg_flags;
|
2008-05-14 01:47:41 +00:00
|
|
|
proto_item *hidden_item;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
int offset = 0;
|
|
|
|
int len=0;
|
|
|
|
guint8 ver_flags;
|
|
|
|
guint8 message_type;
|
2007-12-28 03:06:30 +00:00
|
|
|
guint16 msg_length;
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
ver_flags = tvb_get_guint8(tvb, 0);
|
|
|
|
message_type = tvb_get_guint8(tvb, 1);
|
|
|
|
msg_length = tvb_get_ntohs(tvb, 2);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2013-06-14 01:56:28 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(message_type, message_type_vals, "Unknown Message (%u). "));
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2011-10-21 02:10:19 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_pcep, tvb, offset, msg_length, ENC_NA);
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_tree = proto_item_add_subtree(ti, tree_mode);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
ti = proto_tree_add_text(pcep_tree, tvb, offset, 4, "%s Header", val_to_str(message_type, message_type_vals, "Unknown Message (%u). "));
|
2007-12-23 14:19:48 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_header_tree = proto_item_add_subtree(ti, ett_pcep_hdr);
|
2007-12-23 14:19:48 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_tree_add_text(pcep_header_tree, tvb, offset, 1, "PCEP Version: %x", (ver_flags & 0x20)>>5);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
ti = proto_tree_add_text(pcep_header_tree, tvb, offset, 1, "Flags: 0x%02x", ver_flags & 0x1f);
|
|
|
|
pcep_header_msg_flags = proto_item_add_subtree(ti, ett_pcep_hdr);
|
|
|
|
proto_tree_add_boolean(pcep_header_msg_flags, pcep_hdr_msg_flags_reserved, tvb, offset, 1, (ver_flags & 0x1f));
|
|
|
|
proto_tree_add_uint(pcep_header_tree, pcep_filter[PCEPF_MSG], tvb, offset+1, 1, message_type);
|
|
|
|
proto_tree_add_text(pcep_header_tree, tvb, offset+2, 2, "Message length: %u", msg_length);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
switch (PCEPF_MSG + message_type) {
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
case PCEPF_OPEN:
|
|
|
|
case PCEPF_KEEPALIVE:
|
|
|
|
case PCEPF_PATH_COMPUTATION_REQUEST:
|
|
|
|
case PCEPF_PATH_COMPUTATION_REPLY:
|
|
|
|
case PCEPF_NOTIFICATION:
|
|
|
|
case PCEPF_ERROR:
|
|
|
|
case PCEPF_CLOSE:
|
2012-03-30 22:36:02 +00:00
|
|
|
case PCEPF_PATH_COMPUTATION_MONITORING_REQUEST:
|
|
|
|
case PCEPF_PATH_COMPUTATION_MONITORING_REPLY:
|
2008-05-14 01:47:41 +00:00
|
|
|
hidden_item = proto_tree_add_boolean(pcep_header_tree, pcep_filter[PCEPF_MSG + message_type], tvb, offset+1, 1, 1);
|
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
2007-12-23 14:19:48 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
offset = 4;
|
|
|
|
len = 4;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_obj_tree(pcep_tree, tvb, len, offset, msg_length);
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static guint
|
2007-12-28 23:05:22 +00:00
|
|
|
get_pcep_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
2007-12-23 14:19:48 +00:00
|
|
|
{
|
2007-12-28 03:06:30 +00:00
|
|
|
guint16 plen;
|
2007-12-23 14:19:48 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
/* Get the length of the PCEP packet.*/
|
2007-12-28 03:06:30 +00:00
|
|
|
plen = tvb_get_ntohs(tvb, offset+2);
|
2007-12-23 14:19:48 +00:00
|
|
|
|
2007-12-28 03:06:30 +00:00
|
|
|
return plen;
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
2007-12-23 14:19:48 +00:00
|
|
|
{
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
/* Set up structures needed to add the protocol subtree and manage it */
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PCEP");
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
/* Clear out stuff in the info column */
|
2009-08-09 07:36:13 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-29 00:55:01 +00:00
|
|
|
dissect_pcep_msg_tree(tvb, tree, ett_pcep, pinfo);
|
2007-12-28 03:06:30 +00:00
|
|
|
}
|
2007-12-23 14:19:48 +00:00
|
|
|
|
|
|
|
static void
|
2007-12-28 23:05:22 +00:00
|
|
|
dissect_pcep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
2007-12-23 14:19:48 +00:00
|
|
|
{
|
2007-12-28 23:05:22 +00:00
|
|
|
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 4, get_pcep_message_len,
|
|
|
|
dissect_pcep_pdu);
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|
|
|
|
|
2007-12-29 00:55:01 +00:00
|
|
|
/*Register the protocol with wireshark*/
|
2007-12-23 14:19:48 +00:00
|
|
|
void
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_register_pcep(void){
|
2007-12-23 14:19:48 +00:00
|
|
|
|
2009-06-22 04:58:08 +00:00
|
|
|
static hf_register_info pcepf_info[] = {
|
|
|
|
|
|
|
|
/* Message type number */
|
|
|
|
{&pcep_filter[PCEPF_MSG],
|
|
|
|
{ "Message Type", "pcep.msg", FT_UINT8, BASE_DEC, VALS(message_type_vals), 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_hdr_msg_flags_reserved,
|
|
|
|
{ "Reserved Flags", "pcep.hdr.msg.flags.reserved", FT_BOOLEAN, 8, TFS(&tfs_set_notset), PCEP_HDR_MSG_RESERVED,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_OPEN],
|
|
|
|
{ "Open Message", "pcep.msg.open", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_KEEPALIVE],
|
|
|
|
{ "Keepalive Message", "pcep.msg.keepalive", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_PATH_COMPUTATION_REQUEST],
|
|
|
|
{ "Path Computation Request Message", "pcep.msg.path.computation.request", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_PATH_COMPUTATION_REPLY],
|
|
|
|
{ "Path Computation Reply Mesagge", "pcep.msg.path.computation.reply", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_NOTIFICATION],
|
|
|
|
{ "Notification Message", "pcep.msg.notification", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_ERROR],
|
|
|
|
{ "Error Message", "pcep.msg.error", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_CLOSE],
|
|
|
|
{ "Close Message", "pcep.msg.close", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2012-03-30 22:36:02 +00:00
|
|
|
{&pcep_filter[PCEPF_PATH_COMPUTATION_MONITORING_REQUEST],
|
|
|
|
{ "Path Computation Monitoring Request Message", "pcep.msg.path.computation.monitoring.request", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{&pcep_filter[PCEPF_PATH_COMPUTATION_MONITORING_REPLY],
|
|
|
|
{ "Path Computation Monitoring Reply Mesagge", "pcep.msg.path.computation.monitoring.reply", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
|
|
|
|
/*Object header*/
|
|
|
|
{&pcep_hdr_obj_flags_reserved,
|
|
|
|
{ "Reserved Flags", "pcep.hdr.obj.flags.reserved", FT_BOOLEAN, 4, TFS(&tfs_set_notset), PCEP_HDR_OBJ_RESERVED,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_hdr_obj_flags_p,
|
|
|
|
{ "Processing-Rule (P)", "pcep.hdr.obj.flags.p", FT_BOOLEAN, 4, TFS(&tfs_set_notset), PCEP_HDR_OBJ_P,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_hdr_obj_flags_i,
|
|
|
|
{ "Ignore (I)", "pcep.hdr.obj.flags.i", FT_BOOLEAN, 4, TFS(&tfs_set_notset), PCEP_HDR_OBJ_I,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
/* Object class */
|
|
|
|
{&pcep_filter[PCEPF_OBJECT_CLASS],
|
|
|
|
{ "Object Class", "pcep.object", FT_UINT32, BASE_DEC, VALS(pcep_class_vals), 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
|
|
|
|
/* Object types */
|
|
|
|
{&pcep_filter[PCEPF_OBJ_OPEN],
|
|
|
|
{ "OPEN object", "pcep.obj.open", FT_NONE, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_open_flags_res,
|
|
|
|
{ "Reserved Flags", "pcep.open.flags.res", FT_BOOLEAN, 8, TFS(&tfs_set_notset), PCEP_OPEN_RES,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_OBJ_RP],
|
|
|
|
{ "RP object", "pcep.obj.rp", FT_NONE, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_rp_flags_reserved,
|
|
|
|
{ "Reserved Flags", "pcep.rp.flags.reserved", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_RESERVED,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_rp_flags_pri,
|
2011-02-03 20:14:38 +00:00
|
|
|
{ "(PRI) Priority", "pcep.rp.flags.pri", FT_BOOLEAN, 24, TFS(&tfs_on_off), PCEP_RP_PRI,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_rp_flags_r,
|
2011-02-03 20:14:38 +00:00
|
|
|
{ "(R) Reoptimization", "pcep.rp.flags.r", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_R,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_rp_flags_b,
|
2011-02-03 20:14:38 +00:00
|
|
|
{ "(B) Bi-directional", "pcep.rp.flags.b", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_B,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_rp_flags_o,
|
2011-02-03 20:14:38 +00:00
|
|
|
{ "(L) Strict/Loose", "pcep.rp.flags.o", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_O,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{&pcep_rp_flags_v,
|
|
|
|
{ "(V) VSPT", "pcep.rp.flags.v", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_V,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{&pcep_rp_flags_s,
|
|
|
|
{ "(S) Supply OF on response", "pcep.rp.flags.s", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_S,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{&pcep_rp_flags_p,
|
|
|
|
{ "(P) Path Key", "pcep.rp.flags.p", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_P,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{&pcep_rp_flags_d,
|
|
|
|
{ "(D) Report the request order", "pcep.rp.flags.d", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_D,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{&pcep_rp_flags_m,
|
|
|
|
{ "(M) Make-before-break", "pcep.rp.flags.m", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_M,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{&pcep_rp_flags_e,
|
|
|
|
{ "(E) ERO-compression", "pcep.rp.flags.e", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_E,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{&pcep_rp_flags_n,
|
|
|
|
{ "(N) P2MP", "pcep.rp.flags.n", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_N,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{&pcep_rp_flags_f,
|
|
|
|
{ "(F) Fragmentation", "pcep.rp.flags.f", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_RP_F,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_OBJ_NO_PATH],
|
|
|
|
{ "NO-PATH object", "pcep.obj.nopath", FT_NONE, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_no_path_flags_c,
|
|
|
|
{ "C", "pcep.no.path.flags.c", FT_BOOLEAN, 16, TFS(&tfs_set_notset), PCEP_NO_PATH_C,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_OBJ_END_POINT],
|
|
|
|
{ "END-POINT object", "pcep.obj.endpoint", FT_NONE, BASE_NONE, NULL, 0x0,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_OBJ_BANDWIDTH],
|
|
|
|
{ "BANDWIDTH object", "pcep.obj.bandwidth", FT_NONE, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_OBJ_METRIC],
|
|
|
|
{ "METRIC object", "pcep.obj.metric", FT_NONE, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_metric_flags_c,
|
2011-02-03 20:14:38 +00:00
|
|
|
{ "(C) Cost", "pcep.metric.flags.c", FT_BOOLEAN, 8, TFS(&tfs_set_notset), PCEP_METRIC_C,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_metric_flags_b,
|
2011-02-03 20:14:38 +00:00
|
|
|
{ "(B) Bound", "pcep.metric.flags.b", FT_BOOLEAN, 8, TFS(&tfs_set_notset), PCEP_METRIC_B,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_OBJ_EXPLICIT_ROUTE],
|
|
|
|
{ "EXPLICIT ROUTE object (ERO)", "pcep.obj.ero", FT_NONE, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_OBJ_RECORD_ROUTE],
|
|
|
|
{ "RECORD ROUTE object (RRO)", "pcep.obj.rro", FT_NONE, BASE_NONE, NULL, 0x0,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_OBJ_LSPA],
|
|
|
|
{ "LSPA object", "pcep.obj.lspa", FT_NONE, BASE_NONE, NULL, 0x0,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_lspa_flags_l,
|
|
|
|
{ "Local Protection Desired (L)", "pcep.lspa.flags.l", FT_BOOLEAN, 8, TFS(&tfs_set_notset), PCEP_LSPA_L,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_OBJ_IRO],
|
|
|
|
{ "IRO object", "pcep.obj.iro", FT_NONE, BASE_NONE, NULL, 0x0,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_OBJ_SVEC],
|
|
|
|
{ "SVEC object", "pcep.obj.svec", FT_NONE, BASE_NONE, NULL, 0x0,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
|
|
|
|
{&pcep_svec_flags_l,
|
|
|
|
{ "Link diverse (L)", "pcep.svec.flags.l", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_SVEC_L,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
|
|
|
|
{&pcep_svec_flags_n,
|
|
|
|
{ "Node diverse (N)", "pcep.svec.flags.n", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_SVEC_N,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
|
|
|
|
{&pcep_svec_flags_s,
|
|
|
|
{ "SRLG diverse (S)", "pcep.svec.flags.s", FT_BOOLEAN, 24, TFS(&tfs_set_notset), PCEP_SVEC_S,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
|
|
|
|
{&pcep_filter[PCEPF_OBJ_NOTIFICATION],
|
|
|
|
{ "NOTIFICATION object", "pcep.obj.notification", FT_NONE, BASE_NONE, NULL, 0x0,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
|
|
|
|
{&pcep_filter[PCEPF_NOTI_TYPE],
|
|
|
|
{ "Notification Value", "pcep.notification.value1", FT_UINT32, BASE_DEC, VALS(pcep_notification_types_vals), 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_NOTI_VAL1],
|
|
|
|
{ "Notification Type", "pcep.notification.type2", FT_UINT32, BASE_DEC, VALS(pcep_notification_values1_vals), 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_NOTI_VAL2],
|
|
|
|
{ "Notification Type", "pcep.notification.type", FT_UINT32, BASE_DEC, VALS(pcep_notification_values2_vals), 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
|
|
|
|
{&pcep_filter[PCEPF_OBJ_PCEP_ERROR],
|
|
|
|
{ "ERROR object", "pcep.obj.error", FT_NONE, BASE_NONE, NULL, 0x0,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_ERROR_TYPE],
|
|
|
|
{ "Error-Type", "pcep.error.type", FT_UINT8, BASE_DEC, VALS(pcep_error_types_obj_vals), 0x0,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_OBJ_LOAD_BALANCING],
|
|
|
|
{ "LOAD BALANCING object", "pcep.obj.loadbalancing", FT_NONE, BASE_NONE, NULL, 0x0,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_OBJ_CLOSE],
|
|
|
|
{ "CLOSE object", "pcep.obj.close", FT_NONE, BASE_NONE, NULL, 0x0,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2011-02-03 20:14:38 +00:00
|
|
|
{&pcep_filter[PCEPF_OBJ_PATH_KEY],
|
|
|
|
{ "PATH-KEY object", "pcep.obj.path_key", FT_NONE, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_OBJ_XRO],
|
|
|
|
{ "EXCLUDE ROUTE object (XRO)", "pcep.obj.xro", FT_NONE, BASE_NONE, NULL, 0x0,
|
2011-10-18 01:27:01 +00:00
|
|
|
NULL, HFILL }},
|
2012-03-30 22:36:02 +00:00
|
|
|
|
|
|
|
{&pcep_filter[PCEPF_OBJ_MONITORING],
|
|
|
|
{ "MONITORING object", "pcep.obj.monitoring", FT_NONE, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{&pcep_obj_monitoring_flags_reserved,
|
|
|
|
{ "Reserved Flags", "pcep.obj.monitoring.flags.reserved", FT_BOOLEAN, 24, TFS(&tfs_set_notset),
|
|
|
|
PCEP_OBJ_MONITORING_FLAGS_RESERVED, NULL, HFILL }},
|
|
|
|
{&pcep_obj_monitoring_flags_l,
|
|
|
|
{ "Liveness (L)", "pcep.obj.monitoring.flags.l", FT_BOOLEAN, 24, TFS(&tfs_set_notset),
|
|
|
|
PCEP_OBJ_MONITORING_FLAGS_L, NULL, HFILL }},
|
|
|
|
{&pcep_obj_monitoring_flags_g,
|
|
|
|
{ "General (G)", "pcep.obj.monitoring.flags.g", FT_BOOLEAN, 24, TFS(&tfs_set_notset),
|
|
|
|
PCEP_OBJ_MONITORING_FLAGS_G, NULL, HFILL }},
|
|
|
|
{&pcep_obj_monitoring_flags_p,
|
|
|
|
{ "Processing Time (P)", "pcep.obj.monitoring.flags.p", FT_BOOLEAN, 24, TFS(&tfs_set_notset),
|
|
|
|
PCEP_OBJ_MONITORING_FLAGS_P, NULL, HFILL }},
|
|
|
|
{&pcep_obj_monitoring_flags_c,
|
|
|
|
{ "Overload (C)", "pcep.obj.monitoring.flags.c", FT_BOOLEAN, 24, TFS(&tfs_set_notset),
|
|
|
|
PCEP_OBJ_MONITORING_FLAGS_C, NULL, HFILL }},
|
|
|
|
{&pcep_obj_monitoring_flags_i,
|
|
|
|
{ "Incomplete (I)", "pcep.obj.monitoring.flags.i", FT_BOOLEAN, 24, TFS(&tfs_set_notset),
|
|
|
|
PCEP_OBJ_MONITORING_FLAGS_I, NULL, HFILL }},
|
|
|
|
{ &pcep_obj_monitoring_monitoring_id_number,
|
|
|
|
{ "Monitoring ID Number", "pcep.obj.monitoring.monidnumber", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
{&pcep_filter[PCEPF_OBJ_PCC_ID_REQ],
|
|
|
|
{ "PCC-ID-REQ object", "pcep.obj.pccidreq", FT_NONE, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &pcep_obj_pcc_id_req_ipv4,
|
|
|
|
{ "IPv4 address", "pcep.obj.pccidreq.ipv4", FT_IPv4, BASE_NONE,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
|
|
|
{ &pcep_obj_pcc_id_req_ipv6,
|
|
|
|
{ "IPv6 address", "pcep.obj.pccidreq.ipv6", FT_IPv6, BASE_NONE,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
|
|
|
|
2011-10-18 01:27:01 +00:00
|
|
|
{&pcep_filter[PCEPF_OBJ_OF],
|
|
|
|
{ "OBJECTIVE FUNCTION object (OF)", "pcep.obj.of", FT_NONE, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
|
2012-03-30 22:36:02 +00:00
|
|
|
{&pcep_filter[PCEPF_OBJ_PCE_ID],
|
|
|
|
{ "PCE-ID object", "pcep.obj.pceid", FT_NONE, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &pcep_obj_pce_id_ipv4,
|
|
|
|
{ "IPv4 address", "pcep.obj.pceid.ipv4", FT_IPv4, BASE_NONE,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
|
|
|
{ &pcep_obj_pce_id_ipv6,
|
|
|
|
{ "IPv6 address", "pcep.obj.pceid.ipv6", FT_IPv6, BASE_NONE,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
{&pcep_filter[PCEPF_OBJ_PROC_TIME],
|
|
|
|
{ "PROC-TIME object", "pcep.obj.proctime", FT_NONE, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{&pcep_obj_proc_time_flags_reserved,
|
|
|
|
{ "Reserved Flags", "pcep.obj.proctime.flags.reserved", FT_BOOLEAN, 16, TFS(&tfs_set_notset),
|
|
|
|
PCEP_OBJ_PROC_TIME_FLAGS_RESERVED, NULL, HFILL }},
|
|
|
|
{&pcep_obj_proc_time_flags_e,
|
|
|
|
{ "Estimated (E)", "pcep.obj.proctime.flags.e", FT_BOOLEAN, 16, TFS(&tfs_set_notset),
|
|
|
|
PCEP_OBJ_PROC_TIME_FLAGS_E, NULL, HFILL }},
|
|
|
|
{ &pcep_obj_proc_time_cur_proc_time,
|
|
|
|
{ "Current processing time", "pcep.obj.proctime.curproctime", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
|
|
|
{ &pcep_obj_proc_time_min_proc_time,
|
|
|
|
{ "Minimum processing time", "pcep.obj.proctime.minproctime", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
|
|
|
{ &pcep_obj_proc_time_max_proc_time,
|
|
|
|
{ "Maximum processing time", "pcep.obj.proctime.maxproctime", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
|
|
|
{ &pcep_obj_proc_time_ave_proc_time,
|
|
|
|
{ "Average processing time", "pcep.obj.proctime.aveproctime", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
|
|
|
{ &pcep_obj_proc_time_var_proc_time,
|
|
|
|
{ "Variance processing time", "pcep.obj.proctime.varproctime", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
{&pcep_filter[PCEPF_OBJ_OVERLOAD],
|
|
|
|
{ "OVERLOAD object", "pcep.obj.overload", FT_NONE, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &pcep_obj_overload_duration,
|
|
|
|
{ "Overload Duration", "pcep.obj.overload.duration", FT_UINT16, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
|
|
|
|
2011-01-15 03:25:43 +00:00
|
|
|
/*Subobjects*/
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_SUBOBJ],
|
|
|
|
{ "Type", "pcep.subobj", FT_UINT8, BASE_DEC, VALS(pcep_subobj_vals), 0x0,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
|
|
|
|
{&pcep_filter[PCEPF_SUBOBJ_IPv4],
|
|
|
|
{ "SUBOBJECT: IPv4 Prefix", "pcep.subobj.ipv4", FT_NONE, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_SUBOBJ_IPv6],
|
|
|
|
{ "SUBOBJECT: IPv6 Prefix", "pcep.subobj.ipv6", FT_NONE, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_SUBOBJ_LABEL_CONTROL],
|
|
|
|
{ "SUBOBJECT: Label Control", "pcep.subobj.label.control", FT_NONE, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_SUBOBJ_UNNUM_INTERFACEID],
|
|
|
|
{ "SUBOBJECT: Unnumbered Interface ID", "pcep.subobj.unnum.interfaceid", FT_NONE, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_SUBOBJ_AUTONOMOUS_SYS_NUM],
|
|
|
|
{ "SUBOBJECT: Autonomous System Number", "pcep.subobj.autonomous.sys.num", FT_NONE, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_SUBOBJ_SRLG],
|
|
|
|
{ "SUBOBJECT: SRLG", "pcep.subobj.srlg", FT_NONE, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_SUBOBJ_EXRS],
|
|
|
|
{ "SUBOBJECT: EXRS", "pcep.subobj.exrs", FT_NONE, BASE_NONE, NULL, 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2011-02-03 20:14:38 +00:00
|
|
|
{&pcep_filter[PCEPF_SUBOBJ_PKSv4],
|
|
|
|
{ "SUBOBJECT: Path Key (IPv4)", "pcep.subobj.path_key.ipv4", FT_NONE, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{&pcep_filter[PCEPF_SUBOBJ_PKSv6],
|
|
|
|
{ "SUBOBJECT: Path Key (IPv6)", "pcep.subobj.path_key.ipv6", FT_NONE, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_SUBOBJ_XRO],
|
|
|
|
{ "Type", "pcep.subobj.label", FT_UINT32, BASE_DEC, VALS(pcep_subobj_xro_vals), 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_xro_flags_f,
|
|
|
|
{ "Fail (F)", "pcep.xro.flags.f", FT_BOOLEAN, 16, TFS(&tfs_set_notset), PCEP_XRO_F,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_filter[PCEPF_SUB_XRO_ATTRIB],
|
|
|
|
{ "Attribute", "pcep.xro.sub.attribute", FT_UINT32, BASE_DEC, VALS(pcep_xro_attribute_obj_vals), 0x0,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
|
|
|
|
{&pcep_subobj_flags_lpa,
|
|
|
|
{ "Local Protection Available", "pcep.subobj.flags.lpa", FT_BOOLEAN, 8, TFS(&tfs_set_notset), PCEP_SUB_LPA,
|
2009-06-22 18:23:58 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_subobj_flags_lpu,
|
|
|
|
{ "Local protection in Use", "pcep.subobj.flags.lpu", FT_BOOLEAN, 8, TFS(&tfs_set_notset), PCEP_SUB_LPU,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
{&pcep_subobj_label_flags_gl,
|
|
|
|
{ "Global Label", "pcep.subobj.label.flags.gl", FT_BOOLEAN, 8, TFS(&tfs_set_notset), PCEP_SUB_LABEL_GL,
|
2011-01-15 03:25:43 +00:00
|
|
|
NULL, HFILL }},
|
2012-09-25 01:00:41 +00:00
|
|
|
{&hf_pcep_no_path_tlvs_pce,
|
|
|
|
{ "PCE currently unavailable", "pcep.no_path_tlvs.pce", FT_BOOLEAN, 32, TFS(&tfs_true_false), 0x0001,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{&hf_pcep_no_path_tlvs_unk_dest,
|
|
|
|
{ "Unknown destination", "pcep.no_path_tlvs.unk_dest", FT_BOOLEAN, 32, TFS(&tfs_true_false), 0x0002,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{&hf_pcep_no_path_tlvs_unk_src,
|
|
|
|
{ "Unknown source", "pcep.no_path_tlvs.unk_src", FT_BOOLEAN, 32, TFS(&tfs_true_false), 0x0004,
|
|
|
|
NULL, HFILL }},
|
2009-06-22 04:58:08 +00:00
|
|
|
};
|
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
/*Register the protocol name and description*/
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_pcep = proto_register_protocol (
|
|
|
|
"Path Computation Element communication Protocol", /* name*/
|
|
|
|
"PCEP", /* short name */
|
|
|
|
"pcep" /* abbrev*/);
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-23 14:19:48 +00:00
|
|
|
/* Required function calls to register the header fields and subtrees used */
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_register_field_array(proto_pcep, pcepf_info, array_length(pcepf_info));
|
2007-12-23 14:19:48 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
/*Dissector Handoff*/
|
|
|
|
void
|
2007-12-28 23:05:22 +00:00
|
|
|
proto_reg_handoff_pcep(void)
|
2007-12-23 14:19:48 +00:00
|
|
|
{
|
2007-12-28 23:05:22 +00:00
|
|
|
dissector_handle_t pcep_handle;
|
2007-12-28 03:06:30 +00:00
|
|
|
|
2007-12-28 23:05:22 +00:00
|
|
|
pcep_handle = create_dissector_handle(dissect_pcep, proto_pcep);
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("tcp.port", TCP_PORT_PCEP, pcep_handle);
|
2007-12-23 14:19:48 +00:00
|
|
|
}
|