diff --git a/epan/dissectors/packet-rsvp.c b/epan/dissectors/packet-rsvp.c index 2fe616059e..32692d9d94 100644 --- a/epan/dissectors/packet-rsvp.c +++ b/epan/dissectors/packet-rsvp.c @@ -191,12 +191,12 @@ struct rsvp_request_key { guint32 session_type; union { /* differentiated by session_type field */ - rsvp_session_ipv4_info session_ipv4; - rsvp_session_ipv6_info session_ipv6; - rsvp_session_ipv4_lsp_info session_ipv4_lsp; - rsvp_session_agg_ipv4_info session_agg_ipv4; - rsvp_session_ipv4_uni_info session_ipv4_uni; - rsvp_session_ipv4_enni_info session_ipv4_enni; + rsvp_session_ipv4_info session_ipv4; + rsvp_session_ipv6_info session_ipv6; + rsvp_session_ipv4_lsp_info session_ipv4_lsp; + rsvp_session_agg_ipv4_info session_agg_ipv4; + rsvp_session_ipv4_uni_info session_ipv4_uni; + rsvp_session_ipv4_enni_info session_ipv4_enni; } u; rsvp_template_filter_info source_info; @@ -315,49 +315,50 @@ static guint rsvp_generalized_label_option = 1; * RSVP message types. * See * - * http://www.iana.org/assignments/rsvp-parameters + * http://www.iana.org/assignments/rsvp-parameters */ typedef enum { - RSVP_MSG_PATH=1, /* RFC 2205 */ - RSVP_MSG_RESV, /* RFC 2205 */ - RSVP_MSG_PERR, /* RFC 2205 */ - RSVP_MSG_RERR, /* RFC 2205 */ - RSVP_MSG_PTEAR, /* RFC 2205 */ - RSVP_MSG_RTEAR, /* RFC 2205 */ - RSVP_MSG_CONFIRM, /* XXX - DREQ, RFC 2745? */ - /* 9 is DREP, RFC 2745 */ - RSVP_MSG_RTEAR_CONFIRM=10, /* from Fred Baker at Cisco */ - /* 11 is unassigned */ - RSVP_MSG_BUNDLE = 12, /* RFC 2961 */ - RSVP_MSG_ACK, /* RFC 2961 */ - /* 14 is reserved */ - RSVP_MSG_SREFRESH = 15, /* RFC 2961 */ - /* 16, 17, 18, 19 not listed */ - RSVP_MSG_HELLO = 20, /* RFC 3209 */ - RSVP_MSG_NOTIFY /* [RFC3473] */ - /* 25 is Integrity Challenge RFC 2747, RFC 3097 */ - /* 26 is Integrity Response RFC 2747, RFC 3097 */ - /* 66 is DSBM_willing [SBM] */ - /* 67 is I_AM_DSBM [SBM] */ - /* [SBM] is Subnet Bandwidth Manager ID from July 1997 */ + RSVP_MSG_PATH = 1, /* RFC 2205 */ + RSVP_MSG_RESV, /* RFC 2205 */ + RSVP_MSG_PERR, /* RFC 2205 */ + RSVP_MSG_RERR, /* RFC 2205 */ + RSVP_MSG_PTEAR, /* RFC 2205 */ + RSVP_MSG_RTEAR, /* RFC 2205 */ + RSVP_MSG_CONFIRM, /* XXX - DREQ, RFC 2745? */ + /* 9 is DREP, RFC 2745 */ + RSVP_MSG_RTEAR_CONFIRM = 10, /* from Fred Baker at Cisco */ + /* 11 is unassigned */ + RSVP_MSG_BUNDLE = 12, /* RFC 2961 */ + RSVP_MSG_ACK, /* RFC 2961 */ + /* 14 is reserved */ + RSVP_MSG_SREFRESH = 15, /* RFC 2961 */ + /* 16, 17, 18, 19 not listed */ + RSVP_MSG_HELLO = 20, /* RFC 3209 */ + RSVP_MSG_NOTIFY /* [RFC3473] */ + /* 25 is Integrity Challenge RFC 2747, RFC 3097 */ + /* 26 is Integrity Response RFC 2747, RFC 3097 */ + /* 66 is DSBM_willing [SBM] */ + /* 67 is I_AM_DSBM [SBM] */ + /* [SBM] is Subnet Bandwidth Manager ID from July 1997 */ } rsvp_message_types; static const value_string message_type_vals[] = { - { RSVP_MSG_PATH, "PATH Message. "}, - { RSVP_MSG_RESV, "RESV Message. "}, - { RSVP_MSG_PERR, "PATH ERROR Message. "}, - { RSVP_MSG_RERR, "RESV ERROR Message. "}, - { RSVP_MSG_PTEAR, "PATH TEAR Message. "}, - { RSVP_MSG_RTEAR, "RESV TEAR Message. "}, - { RSVP_MSG_CONFIRM, "CONFIRM Message. "}, - { RSVP_MSG_RTEAR_CONFIRM, "RESV TEAR CONFIRM Message. "}, - { RSVP_MSG_BUNDLE, "BUNDLE Message. "}, - { RSVP_MSG_ACK, "ACK Message. "}, - { RSVP_MSG_SREFRESH, "SREFRESH Message. "}, - { RSVP_MSG_HELLO, "HELLO Message. "}, - { RSVP_MSG_NOTIFY, "NOTIFY Message. "}, + { RSVP_MSG_PATH, "PATH Message. "}, + { RSVP_MSG_RESV, "RESV Message. "}, + { RSVP_MSG_PERR, "PATH ERROR Message. "}, + { RSVP_MSG_RERR, "RESV ERROR Message. "}, + { RSVP_MSG_PTEAR, "PATH TEAR Message. "}, + { RSVP_MSG_RTEAR, "RESV TEAR Message. "}, + { RSVP_MSG_CONFIRM, "CONFIRM Message. "}, + { RSVP_MSG_RTEAR_CONFIRM, "RESV TEAR CONFIRM Message. "}, + { RSVP_MSG_BUNDLE, "BUNDLE Message. "}, + { RSVP_MSG_ACK, "ACK Message. "}, + { RSVP_MSG_SREFRESH, "SREFRESH Message. "}, + { RSVP_MSG_HELLO, "HELLO Message. "}, + { RSVP_MSG_NOTIFY, "NOTIFY Message. "}, { 0, NULL} }; +static value_string_ext message_type_vals_ext = VALUE_STRING_EXT_INIT(message_type_vals); /* * FF: please keep this list in sync with @@ -365,10 +366,10 @@ static const value_string message_type_vals[] = { * Registry Name: 'Class' */ enum rsvp_classes { - RSVP_CLASS_NULL=0, + RSVP_CLASS_NULL = 0, RSVP_CLASS_SESSION, - RSVP_CLASS_HOP=3, + RSVP_CLASS_HOP = 3, RSVP_CLASS_INTEGRITY, RSVP_CLASS_TIME_VALUES, RSVP_CLASS_ERROR, @@ -384,7 +385,7 @@ enum rsvp_classes { RSVP_CLASS_LABEL, RSVP_CLASS_HOP_COUNT, RSVP_CLASS_STRICT_SOURCE_ROUTE, - RSVP_CLASS_LABEL_REQUEST=19, + RSVP_CLASS_LABEL_REQUEST = 19, RSVP_CLASS_EXPLICIT_ROUTE, RSVP_CLASS_RECORD_ROUTE, @@ -396,7 +397,7 @@ enum rsvp_classes { /* 26-29 Unassigned */ - RSVP_CLASS_DIAGNOSTIC = 30, + RSVP_CLASS_DIAGNOSTIC = 30, RSVP_CLASS_ROUTE, RSVP_CLASS_DIAG_RESPONSE, RSVP_CLASS_DIAG_SELECT, @@ -406,14 +407,14 @@ enum rsvp_classes { RSVP_CLASS_PROTECTION, /* 38-41 Unassigned */ - RSVP_CLASS_DSBM_IP_ADDRESS = 42, + RSVP_CLASS_DSBM_IP_ADDRESS = 42, RSVP_CLASS_SBM_PRIORITY, RSVP_CLASS_DSBM_TIMER_INTERVALS, RSVP_CLASS_SBM_INFO, /* 46-62 Unassigned */ - RSVP_CLASS_DETOUR = 63, + RSVP_CLASS_DETOUR = 63, RSVP_CLASS_CHALLENGE, RSVP_CLASS_DIFFSERV, RSVP_CLASS_CLASSTYPE, /* FF: RFC4124 */ @@ -421,12 +422,12 @@ enum rsvp_classes { /* 68-123 Unassigned */ - RSVP_CLASS_VENDOR_PRIVATE_1=124, - RSVP_CLASS_VENDOR_PRIVATE_2=125, - RSVP_CLASS_VENDOR_PRIVATE_3=126, - RSVP_CLASS_VENDOR_PRIVATE_4=127, + RSVP_CLASS_VENDOR_PRIVATE_1 = 124, + RSVP_CLASS_VENDOR_PRIVATE_2 = 125, + RSVP_CLASS_VENDOR_PRIVATE_3 = 126, + RSVP_CLASS_VENDOR_PRIVATE_4 = 127, - RSVP_CLASS_NODE_CHAR = 128, + RSVP_CLASS_NODE_CHAR = 128, RSVP_CLASS_SUGGESTED_LABEL, RSVP_CLASS_ACCEPTABLE_LABEL_SET, RSVP_CLASS_RESTART_CAP, @@ -435,22 +436,22 @@ enum rsvp_classes { /* 166-187 Unassigned */ - RSVP_CLASS_VENDOR_PRIVATE_5=188, - RSVP_CLASS_VENDOR_PRIVATE_6=189, - RSVP_CLASS_VENDOR_PRIVATE_7=190, - RSVP_CLASS_VENDOR_PRIVATE_8=191, + RSVP_CLASS_VENDOR_PRIVATE_5 = 188, + RSVP_CLASS_VENDOR_PRIVATE_6 = 189, + RSVP_CLASS_VENDOR_PRIVATE_7 = 190, + RSVP_CLASS_VENDOR_PRIVATE_8 = 191, - RSVP_CLASS_SESSION_ASSOC = 192, + RSVP_CLASS_SESSION_ASSOC = 192, RSVP_CLASS_LSP_TUNNEL_IF_ID, /* 194 Unassigned */ - RSVP_CLASS_NOTIFY_REQUEST = 195, + RSVP_CLASS_NOTIFY_REQUEST = 195, RSVP_CLASS_ADMIN_STATUS, RSVP_CLASS_LSP_ATTRIBUTES, RSVP_CLASS_ALARM_SPEC, RSVP_CLASS_ASSOCIATION, /* 203-204 Unassigned */ - RSVP_CLASS_FAST_REROUTE = 205, + RSVP_CLASS_FAST_REROUTE = 205, /* 206 Unassigned */ RSVP_CLASS_SESSION_ATTRIBUTE = 207, /* 208-223 Unassigned */ @@ -460,7 +461,7 @@ enum rsvp_classes { in this range that it does not understand. */ /* 224 Unassigned */ - RSVP_CLASS_DCLASS = 225, + RSVP_CLASS_DCLASS = 225, RSVP_CLASS_PACKETCABLE_EXTENSIONS, RSVP_CLASS_ATM_SERVICECLASS, RSVP_CLASS_CALL_OPS, @@ -470,10 +471,10 @@ enum rsvp_classes { /* 232-251 Unassigned */ - RSVP_CLASS_VENDOR_PRIVATE_9=252, - RSVP_CLASS_VENDOR_PRIVATE_10=253, - RSVP_CLASS_VENDOR_PRIVATE_11=254, - RSVP_CLASS_VENDOR_PRIVATE_12=255 + RSVP_CLASS_VENDOR_PRIVATE_9 = 252, + RSVP_CLASS_VENDOR_PRIVATE_10 = 253, + RSVP_CLASS_VENDOR_PRIVATE_11 = 254, + RSVP_CLASS_VENDOR_PRIVATE_12 = 255 }; static const value_string rsvp_class_vals[] = { @@ -548,12 +549,13 @@ static const value_string rsvp_class_vals[] = { "forward if unknown)"}, { 0, NULL} }; +static value_string_ext rsvp_class_vals_ext = VALUE_STRING_EXT_INIT(rsvp_class_vals); /* * RSVP error values */ enum rsvp_error_types { - RSVP_ERROR_CONFIRM = 0, + RSVP_ERROR_CONFIRM = 0, RSVP_ERROR_ADMISSION, RSVP_ERROR_POLICY, RSVP_ERROR_NO_PATH, @@ -562,10 +564,10 @@ enum rsvp_error_types { RSVP_ERROR_UNKNOWN_RESV_STYLE, RSVP_ERROR_CONFLICT_DEST_PORTS, RSVP_ERROR_CONFLICT_SRC_PORTS, - RSVP_ERROR_PREEMPTED=12, + RSVP_ERROR_PREEMPTED =12, RSVP_ERROR_UNKNOWN_CLASS, RSVP_ERROR_UNKNOWN_C_TYPE, - RSVP_ERROR_TRAFFIC = 21, + RSVP_ERROR_TRAFFIC = 21, RSVP_ERROR_TRAFFIC_SYSTEM, RSVP_ERROR_SYSTEM, RSVP_ERROR_ROUTING, @@ -608,6 +610,7 @@ static const value_string rsvp_error_codes[] = { { RSVP_ERROR_USER_ERROR_SPEC, "User error spec"}, { 0, NULL} }; +static value_string_ext rsvp_error_codes_ext = VALUE_STRING_EXT_INIT(rsvp_error_codes); static const value_string rsvp_admission_control_error_vals[] = { { 1, "Delay bound cannot be met"}, @@ -617,6 +620,7 @@ static const value_string rsvp_admission_control_error_vals[] = { { 5, "Bad Association Type"}, { 0, NULL} }; +static value_string_ext rsvp_admission_control_error_vals_ext = VALUE_STRING_EXT_INIT(rsvp_admission_control_error_vals); static const value_string rsvp_policy_control_error_vals[] = { { 0, "Information reporting"}, @@ -647,6 +651,7 @@ static const value_string rsvp_policy_control_error_vals[] = { { 104, "Inter-domain explicit route rejected"}, { 0, NULL} }; +static value_string_ext rsvp_policy_control_error_vals_ext = VALUE_STRING_EXT_INIT(rsvp_policy_control_error_vals); static const value_string rsvp_traffic_control_error_vals[] = { { 1, "Service conflict"}, @@ -656,6 +661,7 @@ static const value_string rsvp_traffic_control_error_vals[] = { { 5, "Bad Adspec value"}, { 0, NULL} }; +static value_string_ext rsvp_traffic_control_error_vals_ext = VALUE_STRING_EXT_INIT(rsvp_traffic_control_error_vals); static const value_string rsvp_routing_error_vals[] = { { 1, "Bad EXPLICIT_ROUTE object"}, @@ -707,6 +713,7 @@ static const value_string rsvp_routing_error_vals[] = { { 106, "Invalid SPC interface ID/label (ASON)"}, { 0, NULL} }; +static value_string_ext rsvp_routing_error_vals_ext = VALUE_STRING_EXT_INIT(rsvp_routing_error_vals); static const value_string rsvp_notify_error_vals[] = { { 1, "RRO too large for MTU"}, @@ -722,6 +729,7 @@ static const value_string rsvp_notify_error_vals[] = { { 11, "LSP Local Failure"}, { 0, NULL} }; +static value_string_ext rsvp_notify_error_vals_ext = VALUE_STRING_EXT_INIT(rsvp_notify_error_vals); static const value_string rsvp_diffserv_error_vals[] = { { 1, "Unexpected DIFFSERV object"}, @@ -731,6 +739,7 @@ static const value_string rsvp_diffserv_error_vals[] = { { 5, "Per-LSP context allocation failure"}, { 0, NULL} }; +static value_string_ext rsvp_diffserv_error_vals_ext = VALUE_STRING_EXT_INIT(rsvp_diffserv_error_vals); /* FF: RFC4124 */ static const value_string rsvp_diffserv_aware_te_error_vals[] = { @@ -744,6 +753,7 @@ static const value_string rsvp_diffserv_aware_te_error_vals[] = { { 8, "Inconsistency between signaled PHBs and signaled CT"}, { 0, NULL} }; +static value_string_ext rsvp_diffserv_aware_te_error_vals_ext = VALUE_STRING_EXT_INIT(rsvp_diffserv_aware_te_error_vals); static const value_string rsvp_call_mgmt_error_vals[] = { { 1, "Call ID Contention"}, @@ -752,22 +762,23 @@ static const value_string rsvp_call_mgmt_error_vals[] = { { 4, "Duplicate Call"}, { 0, NULL} }; +static value_string_ext rsvp_call_mgmt_error_vals_ext = VALUE_STRING_EXT_INIT(rsvp_call_mgmt_error_vals); /* * Defines the reservation style plus style-specific information that * is not a FLOWSPEC or FILTER_SPEC object, in a RESV message. */ #define RSVP_DISTINCT (1 << 3) -#define RSVP_SHARED (2 << 3) +#define RSVP_SHARED (2 << 3) #define RSVP_SHARING_MASK (RSVP_DISTINCT | RSVP_SHARED) -#define RSVP_SCOPE_WILD 1 +#define RSVP_SCOPE_WILD 1 #define RSVP_SCOPE_EXPLICIT 2 -#define RSVP_SCOPE_MASK 0x07 +#define RSVP_SCOPE_MASK 0x07 -#define RSVP_WF (RSVP_SHARED | RSVP_SCOPE_WILD) +#define RSVP_WF (RSVP_SHARED | RSVP_SCOPE_WILD) #define RSVP_FF (RSVP_DISTINCT | RSVP_SCOPE_EXPLICIT) -#define RSVP_SE (RSVP_SHARED | RSVP_SCOPE_EXPLICIT) +#define RSVP_SE (RSVP_SHARED | RSVP_SCOPE_EXPLICIT) static const value_string style_vals[] = { { RSVP_WF, "Wildcard Filter" }, @@ -796,17 +807,17 @@ enum { enum qos_service_type { QOS_QUALITATIVE = 128, /* Qualitative service */ QOS_NULL = 6, /* Null service (RFC2997) */ - QOS_CONTROLLED_LOAD= 5, /* Controlled Load Service */ - QOS_GUARANTEED = 2, /* Guaranteed service */ - QOS_TSPEC = 1 /* Traffic specification */ + QOS_CONTROLLED_LOAD= 5, /* Controlled Load Service */ + QOS_GUARANTEED = 2, /* Guaranteed service */ + QOS_TSPEC = 1 /* Traffic specification */ }; static const value_string qos_vals[] = { - { QOS_QUALITATIVE, "Qualitative QoS" }, - { QOS_NULL, "Null-Service QoS" }, + { QOS_QUALITATIVE, "Qualitative QoS" }, + { QOS_NULL, "Null-Service QoS" }, { QOS_CONTROLLED_LOAD, "Controlled-load QoS" }, - { QOS_GUARANTEED, "Guaranteed rate QoS" }, - { QOS_TSPEC, "Traffic specification" }, + { QOS_GUARANTEED, "Guaranteed rate QoS" }, + { QOS_TSPEC, "Traffic specification" }, { 0, NULL } }; @@ -817,14 +828,15 @@ static const value_string svc_vals[] = { { 130, "Guaranteed-rate RSpec" }, { 0, NULL } }; +static value_string_ext svc_vals_ext = VALUE_STRING_EXT_INIT(svc_vals); enum rsvp_spec_types { INTSRV = 2 }; enum intsrv_services { - INTSRV_GENERAL = 1, - INTSRV_GTD = 2, - INTSRV_CLOAD = 5, - INTSRV_NULL = 6, + INTSRV_GENERAL = 1, + INTSRV_GTD = 2, + INTSRV_CLOAD = 5, + INTSRV_NULL = 6, INTSRV_QUALITATIVE = 128 }; @@ -836,25 +848,31 @@ static const value_string intsrv_services_str[] = { { INTSRV_QUALITATIVE, "Null Service"}, { 0, NULL } }; +static value_string_ext intsrv_services_str_ext = VALUE_STRING_EXT_INIT(intsrv_services_str); #if 0 enum intsrv_field_name { - INTSRV_NON_IS_HOPS = 1, INTSRV_COMPOSED_NON_IS_HOPS, - INTSRV_IS_HOPS, INTSRV_COMPOSED_IS_HOPS, - INTSRV_PATH_BANDWIDTH, INTSRV_MIN_PATH_BANDWIDTH, - INTSRV_IF_LATENCY, INTSRV_PATH_LATENCY, - INTSRV_MTU, INTSRV_COMPOSED_MTU, + INTSRV_NON_IS_HOPS = 1, + INTSRV_COMPOSED_NON_IS_HOPS, + INTSRV_IS_HOPS, + INTSRV_COMPOSED_IS_HOPS, + INTSRV_PATH_BANDWIDTH, + INTSRV_MIN_PATH_BANDWIDTH, + INTSRV_IF_LATENCY, + INTSRV_PATH_LATENCY, + INTSRV_MTU, + INTSRV_COMPOSED_MTU, - INTSRV_TOKEN_BUCKET_TSPEC = 127, - INTSRV_QUALITATIVE_TSPEC = 128, - INTSRV_GTD_RSPEC = 130, + INTSRV_TOKEN_BUCKET_TSPEC = 127, + INTSRV_QUALITATIVE_TSPEC = 128, + INTSRV_GTD_RSPEC = 130, - INTSRV_DELAY = 131, /* Gtd Parameter C - Max Delay Bound - bytes */ - INTSRV_MAX_JITTER, /* Gtd Parameter D - Max Jitter */ - INTSRV_E2E_DELAY, /* Gtd Parameter Ctot */ - INTSRV_E2E_MAX_JITTER, /* Gtd Parameter Dtot */ - INTSRV_SHP_DELAY, /* Gtd Parameter Csum */ - INTSRV_SHP_MAX_JITTER /* Gtd Parameter Dsum */ + INTSRV_DELAY = 131, /* Gtd Parameter C - Max Delay Bound - bytes */ + INTSRV_MAX_JITTER, /* Gtd Parameter D - Max Jitter */ + INTSRV_E2E_DELAY, /* Gtd Parameter Ctot */ + INTSRV_E2E_MAX_JITTER, /* Gtd Parameter Dtot */ + INTSRV_SHP_DELAY, /* Gtd Parameter Csum */ + INTSRV_SHP_MAX_JITTER /* Gtd Parameter Dsum */ }; #endif @@ -869,6 +887,7 @@ static const value_string adspec_params[] = { { 136, "Since-last-reshaping point composed D"}, { 0, NULL } }; +static value_string_ext adspec_params_ext = VALUE_STRING_EXT_INIT(adspec_params); /* * FF: please keep this list in sync with @@ -1030,6 +1049,7 @@ const value_string gmpls_sonet_signal_type_str[] = { { 23, "STS-192c SPE / VC-4-64c"}, { 0, NULL} }; +static value_string_ext gmpls_sonet_signal_type_str_ext = VALUE_STRING_EXT_INIT(gmpls_sonet_signal_type_str); static const value_string ouni_guni_diversity_str[] = { { 1, "Node Diverse"}, @@ -1055,12 +1075,14 @@ static const range_string gmpls_g709_signal_type_rvals[] = { /* -------------------- Stuff for MPLS/TE objects -------------------- */ -static const value_string proto_vals[] = { { IP_PROTO_ICMP, "ICMP"}, - { IP_PROTO_IGMP, "IGMP"}, - { IP_PROTO_TCP, "TCP" }, - { IP_PROTO_UDP, "UDP" }, - { IP_PROTO_OSPF, "OSPF"}, - { 0, NULL } }; +static const value_string proto_vals[] = { + { IP_PROTO_ICMP, "ICMP"}, + { IP_PROTO_IGMP, "IGMP"}, + { IP_PROTO_TCP, "TCP" }, + { IP_PROTO_UDP, "UDP" }, + { IP_PROTO_OSPF, "OSPF"}, + { 0, NULL } +}; /* Filter keys */ enum hf_rsvp_filter_keys { @@ -1202,110 +1224,110 @@ static int hf_rsvp_filter[RSVPF_MAX] = { -1 }; * the session info and source info structures. */ static gint -rsvp_equal (gconstpointer k1, gconstpointer k2) +rsvp_equal(gconstpointer k1, gconstpointer k2) { const struct rsvp_request_key *key1 = (const struct rsvp_request_key*) k1; const struct rsvp_request_key *key2 = (const struct rsvp_request_key*) k2; if (key1->conversation != key2->conversation) { - return 0; + return 0; } if (key1->session_type != key2->session_type) { - return 0; + return 0; } switch (key1->session_type) { case RSVP_SESSION_TYPE_IPV4: - if (ADDRESSES_EQUAL(&key1->u.session_ipv4.destination, - &key2->u.session_ipv4.destination) == FALSE) - return 0; + if (ADDRESSES_EQUAL(&key1->u.session_ipv4.destination, + &key2->u.session_ipv4.destination) == FALSE) + return 0; - if (key1->u.session_ipv4.protocol != key2->u.session_ipv4.protocol) - return 0; + if (key1->u.session_ipv4.protocol != key2->u.session_ipv4.protocol) + return 0; - if (key1->u.session_ipv4.udp_dest_port != key2->u.session_ipv4.udp_dest_port) - return 0; + if (key1->u.session_ipv4.udp_dest_port != key2->u.session_ipv4.udp_dest_port) + return 0; - break; + break; case RSVP_SESSION_TYPE_IPV6: - /* this is not supported yet for conversations */ - break; + /* this is not supported yet for conversations */ + break; case RSVP_SESSION_TYPE_IPV4_LSP: - if (ADDRESSES_EQUAL(&key1->u.session_ipv4_lsp.destination, - &key2->u.session_ipv4_lsp.destination) == FALSE) - return 0; + if (ADDRESSES_EQUAL(&key1->u.session_ipv4_lsp.destination, + &key2->u.session_ipv4_lsp.destination) == FALSE) + return 0; - if (key1->u.session_ipv4_lsp.udp_dest_port != - key2->u.session_ipv4_lsp.udp_dest_port) - return 0; + if (key1->u.session_ipv4_lsp.udp_dest_port != + key2->u.session_ipv4_lsp.udp_dest_port) + return 0; - if (key1->u.session_ipv4_lsp.ext_tunnel_id != - key2->u.session_ipv4_lsp.ext_tunnel_id) - return 0; + if (key1->u.session_ipv4_lsp.ext_tunnel_id != + key2->u.session_ipv4_lsp.ext_tunnel_id) + return 0; - break; + break; case RSVP_SESSION_TYPE_AGGREGATE_IPV4: - if (ADDRESSES_EQUAL(&key1->u.session_agg_ipv4.destination, - &key2->u.session_agg_ipv4.destination) == FALSE) - return 0; + if (ADDRESSES_EQUAL(&key1->u.session_agg_ipv4.destination, + &key2->u.session_agg_ipv4.destination) == FALSE) + return 0; - if (key1->u.session_agg_ipv4.dscp != key2->u.session_agg_ipv4.dscp) - return 0; + if (key1->u.session_agg_ipv4.dscp != key2->u.session_agg_ipv4.dscp) + return 0; - break; + break; case RSVP_SESSION_TYPE_AGGREGATE_IPV6: - /* this is not supported yet for conversations */ - break; + /* this is not supported yet for conversations */ + break; case RSVP_SESSION_TYPE_IPV4_UNI: - if (ADDRESSES_EQUAL(&key1->u.session_ipv4_uni.destination, - &key2->u.session_ipv4_uni.destination) == FALSE) - return 0; + if (ADDRESSES_EQUAL(&key1->u.session_ipv4_uni.destination, + &key2->u.session_ipv4_uni.destination) == FALSE) + return 0; - if (key1->u.session_ipv4_uni.udp_dest_port != - key2->u.session_ipv4_uni.udp_dest_port) - return 0; + if (key1->u.session_ipv4_uni.udp_dest_port != + key2->u.session_ipv4_uni.udp_dest_port) + return 0; - if (key1->u.session_ipv4_uni.ext_tunnel_id != - key2->u.session_ipv4_uni.ext_tunnel_id) - return 0; + if (key1->u.session_ipv4_uni.ext_tunnel_id != + key2->u.session_ipv4_uni.ext_tunnel_id) + return 0; - break; + break; case RSVP_SESSION_TYPE_IPV4_E_NNI: - if (ADDRESSES_EQUAL(&key1->u.session_ipv4_enni.destination, - &key2->u.session_ipv4_enni.destination) == FALSE) - return 0; + if (ADDRESSES_EQUAL(&key1->u.session_ipv4_enni.destination, + &key2->u.session_ipv4_enni.destination) == FALSE) + return 0; - if (key1->u.session_ipv4_enni.udp_dest_port != - key2->u.session_ipv4_enni.udp_dest_port) - return 0; + if (key1->u.session_ipv4_enni.udp_dest_port != + key2->u.session_ipv4_enni.udp_dest_port) + return 0; - if (key1->u.session_ipv4_enni.ext_tunnel_id != - key2->u.session_ipv4_enni.ext_tunnel_id) - return 0; + if (key1->u.session_ipv4_enni.ext_tunnel_id != + key2->u.session_ipv4_enni.ext_tunnel_id) + return 0; - break; + break; default: - /* This should never happen. */ - break; + /* This should never happen. */ + break; } if (ADDRESSES_EQUAL(&key1->source_info.source, - &key2->source_info.source) == FALSE) - return 0; + &key2->source_info.source) == FALSE) + return 0; if (key1->source_info.udp_source_port != key2->source_info.udp_source_port) - return 0; + return 0; /* If we get here, the two keys are equal. */ return 1; @@ -1316,7 +1338,7 @@ rsvp_equal (gconstpointer k1, gconstpointer k2) * conversation-id is unique, so we just use that. */ static guint -rsvp_hash (gconstpointer k) +rsvp_hash(gconstpointer k) { const struct rsvp_request_key *key = (const struct rsvp_request_key*) k; return key->conversation; @@ -1328,10 +1350,10 @@ rsvp_hash (gconstpointer k) * hash tables. */ static void -rsvp_init_protocol (void) +rsvp_init_protocol(void) { if (rsvp_request_hash) - g_hash_table_destroy(rsvp_request_hash); + g_hash_table_destroy(rsvp_request_hash); rsvp_request_hash = g_hash_table_new(rsvp_hash, rsvp_equal); } @@ -1362,45 +1384,45 @@ rsvp_class_to_filter_num(int classnum) case RSVP_CLASS_MESSAGE_ID : case RSVP_CLASS_MESSAGE_ID_ACK : case RSVP_CLASS_MESSAGE_ID_LIST : - return classnum + RSVPF_OBJECT; - break; + return classnum + RSVPF_OBJECT; + break; case RSVP_CLASS_RECOVERY_LABEL : case RSVP_CLASS_UPSTREAM_LABEL : case RSVP_CLASS_LABEL_SET : case RSVP_CLASS_PROTECTION : - return RSVPF_RECOVERY_LABEL + (classnum - RSVP_CLASS_RECOVERY_LABEL); + return RSVPF_RECOVERY_LABEL + (classnum - RSVP_CLASS_RECOVERY_LABEL); case RSVP_CLASS_SUGGESTED_LABEL : case RSVP_CLASS_ACCEPTABLE_LABEL_SET : case RSVP_CLASS_RESTART_CAP : - return RSVPF_SUGGESTED_LABEL + (classnum - RSVP_CLASS_SUGGESTED_LABEL); + return RSVPF_SUGGESTED_LABEL + (classnum - RSVP_CLASS_SUGGESTED_LABEL); case RSVP_CLASS_DIFFSERV : - return RSVPF_DIFFSERV; + return RSVPF_DIFFSERV; case RSVP_CLASS_CLASSTYPE : - return RSVPF_DSTE; + return RSVPF_DSTE; case RSVP_CLASS_NOTIFY_REQUEST : - return RSVPF_NOTIFY_REQUEST; + return RSVPF_NOTIFY_REQUEST; case RSVP_CLASS_ADMIN_STATUS : - return RSVPF_ADMIN_STATUS; + return RSVPF_ADMIN_STATUS; case RSVP_CLASS_LSP_ATTRIBUTES : - return RSVPF_LSP_ATTRIBUTES; + return RSVPF_LSP_ATTRIBUTES; case RSVP_CLASS_ASSOCIATION : - return RSVPF_ASSOCIATION; + return RSVPF_ASSOCIATION; case RSVP_CLASS_SESSION_ATTRIBUTE : - return RSVPF_SESSION_ATTRIBUTE; + return RSVPF_SESSION_ATTRIBUTE; case RSVP_CLASS_GENERALIZED_UNI : - return RSVPF_GENERALIZED_UNI; + return RSVPF_GENERALIZED_UNI; case RSVP_CLASS_CALL_ID : - return RSVPF_CALL_ID; + return RSVPF_CALL_ID; case RSVP_CLASS_DCLASS : - return RSVPF_DCLASS; + return RSVPF_DCLASS; case RSVP_CLASS_LSP_TUNNEL_IF_ID : - return RSVPF_LSP_TUNNEL_IF_ID; + return RSVPF_LSP_TUNNEL_IF_ID; case RSVP_CLASS_VENDOR_PRIVATE_1: case RSVP_CLASS_VENDOR_PRIVATE_2: @@ -1417,7 +1439,7 @@ rsvp_class_to_filter_num(int classnum) return RSVPF_PRIVATE_OBJ; default: - return RSVPF_UNKNOWN_OBJ; + return RSVPF_UNKNOWN_OBJ; } } @@ -1426,83 +1448,83 @@ rsvp_class_to_tree_type(int classnum) { switch(classnum) { case RSVP_CLASS_SESSION : - return TT_SESSION; + return TT_SESSION; case RSVP_CLASS_HOP : - return TT_HOP; + return TT_HOP; case RSVP_CLASS_INTEGRITY : - return TT_INTEGRITY; + return TT_INTEGRITY; case RSVP_CLASS_TIME_VALUES : - return TT_TIME_VALUES; + return TT_TIME_VALUES; case RSVP_CLASS_ERROR : - return TT_ERROR; + return TT_ERROR; case RSVP_CLASS_SCOPE : - return TT_SCOPE; + return TT_SCOPE; case RSVP_CLASS_STYLE : - return TT_STYLE; + return TT_STYLE; case RSVP_CLASS_FLOWSPEC : - return TT_FLOWSPEC; + return TT_FLOWSPEC; case RSVP_CLASS_FILTER_SPEC : - return TT_FILTER_SPEC; + return TT_FILTER_SPEC; case RSVP_CLASS_SENDER_TEMPLATE : - return TT_SENDER_TEMPLATE; + return TT_SENDER_TEMPLATE; case RSVP_CLASS_SENDER_TSPEC : - return TT_TSPEC; + return TT_TSPEC; case RSVP_CLASS_ADSPEC : - return TT_ADSPEC; + return TT_ADSPEC; case RSVP_CLASS_POLICY : - return TT_POLICY; + return TT_POLICY; case RSVP_CLASS_CONFIRM : - return TT_CONFIRM; + return TT_CONFIRM; case RSVP_CLASS_RECOVERY_LABEL : case RSVP_CLASS_UPSTREAM_LABEL : case RSVP_CLASS_SUGGESTED_LABEL : case RSVP_CLASS_LABEL : - return TT_LABEL; + return TT_LABEL; case RSVP_CLASS_LABEL_REQUEST : - return TT_LABEL_REQUEST; + return TT_LABEL_REQUEST; case RSVP_CLASS_HELLO : - return TT_HELLO_OBJ; + return TT_HELLO_OBJ; case RSVP_CLASS_EXPLICIT_ROUTE : - return TT_EXPLICIT_ROUTE; + return TT_EXPLICIT_ROUTE; case RSVP_CLASS_RECORD_ROUTE : - return TT_RECORD_ROUTE; + return TT_RECORD_ROUTE; case RSVP_CLASS_MESSAGE_ID : - return TT_MESSAGE_ID; + return TT_MESSAGE_ID; case RSVP_CLASS_MESSAGE_ID_ACK : - return TT_MESSAGE_ID_ACK; + return TT_MESSAGE_ID_ACK; case RSVP_CLASS_MESSAGE_ID_LIST : - return TT_MESSAGE_ID_LIST; + return TT_MESSAGE_ID_LIST; case RSVP_CLASS_LABEL_SET : - return TT_LABEL_SET; + return TT_LABEL_SET; case RSVP_CLASS_PROTECTION : - return TT_PROTECTION_INFO; + return TT_PROTECTION_INFO; case RSVP_CLASS_ACCEPTABLE_LABEL_SET : - return TT_UNKNOWN_CLASS; + return TT_UNKNOWN_CLASS; case RSVP_CLASS_RESTART_CAP : - return TT_RESTART_CAP; + return TT_RESTART_CAP; case RSVP_CLASS_DIFFSERV : - return TT_DIFFSERV; + return TT_DIFFSERV; case RSVP_CLASS_CLASSTYPE: - return TT_CLASSTYPE; + return TT_CLASSTYPE; case RSVP_CLASS_NOTIFY_REQUEST : - return TT_UNKNOWN_CLASS; + return TT_UNKNOWN_CLASS; case RSVP_CLASS_ADMIN_STATUS : - return TT_ADMIN_STATUS; + return TT_ADMIN_STATUS; case RSVP_CLASS_LSP_ATTRIBUTES : case RSVP_CLASS_LSP_REQUIRED_ATTRIBUTES : - return TT_LSP_ATTRIBUTES; + return TT_LSP_ATTRIBUTES; case RSVP_CLASS_ASSOCIATION : - return TT_ASSOCIATION; + return TT_ASSOCIATION; case RSVP_CLASS_SESSION_ATTRIBUTE : - return TT_SESSION_ATTRIBUTE; + return TT_SESSION_ATTRIBUTE; case RSVP_CLASS_GENERALIZED_UNI : - return TT_GEN_UNI; + return TT_GEN_UNI; case RSVP_CLASS_CALL_ID : - return TT_CALL_ID; + return TT_CALL_ID; case RSVP_CLASS_DCLASS : - return TT_DCLASS; + return TT_DCLASS; case RSVP_CLASS_LSP_TUNNEL_IF_ID : - return TT_LSP_TUNNEL_IF_ID; + return TT_LSP_TUNNEL_IF_ID; case RSVP_CLASS_VENDOR_PRIVATE_1: case RSVP_CLASS_VENDOR_PRIVATE_2: case RSVP_CLASS_VENDOR_PRIVATE_3: @@ -1517,310 +1539,308 @@ rsvp_class_to_tree_type(int classnum) case RSVP_CLASS_VENDOR_PRIVATE_12: return TT_PRIVATE_CLASS; default: - return TT_UNKNOWN_CLASS; + return TT_UNKNOWN_CLASS; } } static void find_rsvp_session_tempfilt(tvbuff_t *tvb, int hdr_offset, int *session_offp, int *tempfilt_offp) { - int s_off = 0, t_off = 0; - int len, off; + int s_off = 0, t_off = 0; + int len, off; guint obj_length; if (!tvb_bytes_exist(tvb, hdr_offset+6, 2)) - goto done; + goto done; len = tvb_get_ntohs(tvb, hdr_offset+6) + hdr_offset; off = hdr_offset + 8; - for (off = hdr_offset + 8; off < len && tvb_bytes_exist(tvb, off, 3); off += obj_length) { - obj_length = tvb_get_ntohs(tvb, off); - if (obj_length == 0) - break; - switch(tvb_get_guint8(tvb, off+2)) { - case RSVP_CLASS_SESSION: - s_off = off; - break; - case RSVP_CLASS_SENDER_TEMPLATE: - case RSVP_CLASS_FILTER_SPEC: - t_off = off; - break; - default: - break; - } + for (off = hdr_offset + 8; (off < len) && tvb_bytes_exist(tvb, off, 3); off += obj_length) { + obj_length = tvb_get_ntohs(tvb, off); + if (obj_length == 0) + break; + switch(tvb_get_guint8(tvb, off+2)) { + case RSVP_CLASS_SESSION: + s_off = off; + break; + case RSVP_CLASS_SENDER_TEMPLATE: + case RSVP_CLASS_FILTER_SPEC: + t_off = off; + break; + default: + break; + } } done: - if (session_offp) *session_offp = s_off; + if (session_offp) *session_offp = s_off; if (tempfilt_offp) *tempfilt_offp = t_off; } static char * -summary_session (tvbuff_t *tvb, int offset) +summary_session(tvbuff_t *tvb, int offset) { - static char buf[100]; - switch(tvb_get_guint8(tvb, offset+3)) { case RSVP_SESSION_TYPE_IPV4: - g_snprintf(buf, 100, "SESSION: IPv4, Destination %s, Protocol %d, Port %d. ", - tvb_ip_to_str(tvb, offset+4), - tvb_get_guint8(tvb, offset+8), - tvb_get_ntohs(tvb, offset+10)); - break; + return ep_strdup_printf("SESSION: IPv4, Destination %s, Protocol %d, Port %d. ", + tvb_ip_to_str(tvb, offset+4), + tvb_get_guint8(tvb, offset+8), + tvb_get_ntohs(tvb, offset+10)); + break; case RSVP_SESSION_TYPE_IPV4_LSP: - g_snprintf(buf, 100, "SESSION: IPv4-LSP, Destination %s, Tunnel ID %d, Ext ID %0x. ", - tvb_ip_to_str(tvb, offset+4), - tvb_get_ntohs(tvb, offset+10), - tvb_get_ntohl(tvb, offset+12)); - break; + return ep_strdup_printf("SESSION: IPv4-LSP, Destination %s, Tunnel ID %d, Ext ID %0x. ", + tvb_ip_to_str(tvb, offset+4), + tvb_get_ntohs(tvb, offset+10), + tvb_get_ntohl(tvb, offset+12)); + break; case RSVP_SESSION_TYPE_AGGREGATE_IPV4: - g_snprintf(buf, 100, "SESSION: IPv4-Aggregate, Destination %s, DSCP %d. ", - tvb_ip_to_str(tvb, offset+4), - tvb_get_guint8(tvb, offset+11)); - break; + return ep_strdup_printf("SESSION: IPv4-Aggregate, Destination %s, DSCP %d. ", + tvb_ip_to_str(tvb, offset+4), + tvb_get_guint8(tvb, offset+11)); + break; case RSVP_SESSION_TYPE_IPV4_UNI: - g_snprintf(buf, 100, "SESSION: IPv4-UNI, Destination %s, Tunnel ID %d, Ext Address %s. ", - tvb_ip_to_str(tvb, offset+4), - tvb_get_ntohs(tvb, offset+10), - tvb_ip_to_str(tvb, offset+12)); - break; + return ep_strdup_printf("SESSION: IPv4-UNI, Destination %s, Tunnel ID %d, Ext Address %s. ", + tvb_ip_to_str(tvb, offset+4), + tvb_get_ntohs(tvb, offset+10), + tvb_ip_to_str(tvb, offset+12)); + break; case RSVP_SESSION_TYPE_IPV4_E_NNI: - g_snprintf(buf, 100, "SESSION: IPv4-E-NNI, Destination %s, Tunnel ID %d, Ext Address %s. ", - tvb_ip_to_str(tvb, offset+4), - tvb_get_ntohs(tvb, offset+10), - tvb_ip_to_str(tvb, offset+12)); - break; + return ep_strdup_printf("SESSION: IPv4-E-NNI, Destination %s, Tunnel ID %d, Ext Address %s. ", + tvb_ip_to_str(tvb, offset+4), + tvb_get_ntohs(tvb, offset+10), + tvb_ip_to_str(tvb, offset+12)); + break; default: - g_snprintf(buf, 100, "SESSION: Type %d. ", tvb_get_guint8(tvb, offset+3)); + return ep_strdup_printf("SESSION: Type %d. ", tvb_get_guint8(tvb, offset+3)); + break; } - - return buf; + DISSECTOR_ASSERT_NOT_REACHED(); } static char * -summary_template (tvbuff_t *tvb, int offset) +summary_template(tvbuff_t *tvb, int offset) { - static char buf[80]; const char *objtype; if (tvb_get_guint8(tvb, offset+2) == RSVP_CLASS_FILTER_SPEC) - objtype = "FILTERSPEC"; + objtype = "FILTERSPEC"; else - objtype = "SENDER TEMPLATE"; + objtype = "SENDER TEMPLATE"; switch(tvb_get_guint8(tvb, offset+3)) { case 1: - g_snprintf(buf, 80, "%s: IPv4, Sender %s, Port %d. ", objtype, - tvb_ip_to_str(tvb, offset+4), - tvb_get_ntohs(tvb, offset+10)); - break; + return ep_strdup_printf("%s: IPv4, Sender %s, Port %d. ", objtype, + tvb_ip_to_str(tvb, offset+4), + tvb_get_ntohs(tvb, offset+10)); + break; case 7: - g_snprintf(buf, 80, "%s: IPv4-LSP, Tunnel Source: %s, LSP ID: %d. ", objtype, - tvb_ip_to_str(tvb, offset+4), - tvb_get_ntohs(tvb, offset+10)); - break; + return ep_strdup_printf("%s: IPv4-LSP, Tunnel Source: %s, LSP ID: %d. ", objtype, + tvb_ip_to_str(tvb, offset+4), + tvb_get_ntohs(tvb, offset+10)); + break; case 9: - g_snprintf(buf, 80, "%s: IPv4-Aggregate, Aggregator %s. ", objtype, - tvb_ip_to_str(tvb, offset+4)); - break; + return ep_strdup_printf("%s: IPv4-Aggregate, Aggregator %s. ", objtype, + tvb_ip_to_str(tvb, offset+4)); + break; default: - g_snprintf(buf, 80, "%s: Type %d. ", objtype, tvb_get_guint8(tvb, offset+3)); + return ep_strdup_printf("%s: Type %d. ", objtype, tvb_get_guint8(tvb, offset+3)); + break; } - - return buf; + DISSECTOR_ASSERT_NOT_REACHED(); } /*------------------------------------------------------------------------------ * SESSION *------------------------------------------------------------------------------*/ static void -dissect_rsvp_session (proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type, - rsvp_conversation_info *rsvph) +dissect_rsvp_session(proto_item *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type, + rsvp_conversation_info *rsvph) { proto_item *hidden_item; - int offset2 = offset + 4; + int offset2 = offset + 4; proto_item_set_text(ti, "%s", summary_session(tvb, offset)); switch(type) { case RSVP_SESSION_TYPE_IPV4: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1 - IPv4"); - proto_tree_add_item(rsvp_object_tree, + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1 - IPv4"); + proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_IP], - tvb, offset2, 4, ENC_BIG_ENDIAN); + tvb, offset2, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SESSION_PROTO], tvb, - offset2+4, 1, ENC_BIG_ENDIAN); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 1, - "Flags: %x", - tvb_get_guint8(tvb, offset2+5)); - proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SESSION_PORT], tvb, - offset2+6, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SESSION_PROTO], tvb, + offset2+4, 1, ENC_BIG_ENDIAN); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 1, + "Flags: %x", + tvb_get_guint8(tvb, offset2+5)); + proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SESSION_PORT], tvb, + offset2+6, 2, ENC_BIG_ENDIAN); - /* - * Save this information to build the conversation request key - * later. - */ - rsvph->session_type = RSVP_SESSION_TYPE_IPV4; - SET_ADDRESS(&rsvph->destination, AT_IPv4, 4, + /* + * Save this information to build the conversation request key + * later. + */ + rsvph->session_type = RSVP_SESSION_TYPE_IPV4; + SET_ADDRESS(&rsvph->destination, AT_IPv4, 4, tvb_get_ptr(tvb, offset2, 4)); - rsvph->protocol = tvb_get_guint8(tvb, offset2+4); - rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); + rsvph->protocol = tvb_get_guint8(tvb, offset2+4); + rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); - break; + break; case RSVP_SESSION_TYPE_IPV6: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 2 - IPv6"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16, - "Destination address: %s", - tvb_ip6_to_str(tvb, offset2)); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 1, - "Protocol: %u", - tvb_get_guint8(tvb, offset2+16)); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+17, 1, - "Flags: %x", - tvb_get_guint8(tvb, offset2+17)); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2, - "Destination port: %u", - tvb_get_ntohs(tvb, offset2+18)); - /* - * Save this information to build the conversation request key - * later. IPv6 conversatiuon support is not implemented yet, so only - * the session type is stored. - */ - rsvph->session_type = RSVP_SESSION_TYPE_IPV6; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 2 - IPv6"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16, + "Destination address: %s", + tvb_ip6_to_str(tvb, offset2)); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 1, + "Protocol: %u", + tvb_get_guint8(tvb, offset2+16)); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+17, 1, + "Flags: %x", + tvb_get_guint8(tvb, offset2+17)); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2, + "Destination port: %u", + tvb_get_ntohs(tvb, offset2+18)); + /* + * Save this information to build the conversation request key + * later. IPv6 conversatiuon support is not implemented yet, so only + * the session type is stored. + */ + rsvph->session_type = RSVP_SESSION_TYPE_IPV6; - break; + break; case RSVP_SESSION_TYPE_IPV4_LSP: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 7 - IPv4 LSP"); - proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SESSION_IP], - tvb, offset2, 4, ENC_BIG_ENDIAN); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 7 - IPv4 LSP"); + proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SESSION_IP], + tvb, offset2, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SESSION_TUNNEL_ID], - tvb, offset2+6, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SESSION_TUNNEL_ID], + tvb, offset2+6, 2, ENC_BIG_ENDIAN); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4, - "Extended Tunnel ID: %u (%s)", - tvb_get_ntohl(tvb, offset2+8), - tvb_ip_to_str(tvb, offset2+8)); - hidden_item = proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID], - tvb, offset2+8, 4, ENC_BIG_ENDIAN); - PROTO_ITEM_SET_HIDDEN(hidden_item); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4, + "Extended Tunnel ID: %u (%s)", + tvb_get_ntohl(tvb, offset2+8), + tvb_ip_to_str(tvb, offset2+8)); + hidden_item = proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID], + tvb, offset2+8, 4, ENC_BIG_ENDIAN); + PROTO_ITEM_SET_HIDDEN(hidden_item); - /* - * Save this information to build the conversation request key - * later. - */ - rsvph->session_type = RSVP_SESSION_TYPE_IPV4_LSP; - SET_ADDRESS(&rsvph->destination, AT_IPv4, 4, - tvb_get_ptr(tvb, offset2, 4)); - rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); - rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); - break; + /* + * Save this information to build the conversation request key + * later. + */ + rsvph->session_type = RSVP_SESSION_TYPE_IPV4_LSP; + SET_ADDRESS(&rsvph->destination, AT_IPv4, 4, + tvb_get_ptr(tvb, offset2, 4)); + rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); + rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); + break; case RSVP_SESSION_TYPE_AGGREGATE_IPV4: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 9 - IPv4 Aggregate"); - proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SESSION_IP], - tvb, offset2, 4, ENC_BIG_ENDIAN); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 9 - IPv4 Aggregate"); + proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SESSION_IP], + tvb, offset2, 4, ENC_BIG_ENDIAN); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+7, 1, - "DSCP: %u (%s)", - tvb_get_guint8(tvb, offset2+7), - val_to_str(tvb_get_guint8(tvb, offset2+7), - dscp_vals, "Unknown (%d)")); - /* - * Save this information to build the conversation request key - * later. - */ - rsvph->session_type = RSVP_SESSION_TYPE_AGGREGATE_IPV4; - SET_ADDRESS(&rsvph->destination, AT_IPv4, 4, - tvb_get_ptr(tvb, offset2, 4)); - rsvph->dscp = tvb_get_guint8(tvb, offset2+7); - rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset2+7, 1, + "DSCP: %u (%s)", + tvb_get_guint8(tvb, offset2+7), + val_to_str_ext(tvb_get_guint8(tvb, offset2+7), + &dscp_vals_ext, "Unknown (%d)")); + /* + * Save this information to build the conversation request key + * later. + */ + rsvph->session_type = RSVP_SESSION_TYPE_AGGREGATE_IPV4; + SET_ADDRESS(&rsvph->destination, AT_IPv4, 4, + tvb_get_ptr(tvb, offset2, 4)); + rsvph->dscp = tvb_get_guint8(tvb, offset2+7); + rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); + break; case RSVP_SESSION_TYPE_IPV4_UNI: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 11 - IPv4 UNI"); - proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SESSION_IP], - tvb, offset2, 4, ENC_BIG_ENDIAN); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 11 - IPv4 UNI"); + proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SESSION_IP], + tvb, offset2, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SESSION_TUNNEL_ID], - tvb, offset2+6, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SESSION_TUNNEL_ID], + tvb, offset2+6, 2, ENC_BIG_ENDIAN); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4, - "Extended IPv4 Address: %s", - tvb_ip_to_str(tvb, offset2+8)); - hidden_item = proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID], - tvb, offset2+8, 4, ENC_BIG_ENDIAN); - PROTO_ITEM_SET_HIDDEN(hidden_item); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4, + "Extended IPv4 Address: %s", + tvb_ip_to_str(tvb, offset2+8)); + hidden_item = proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID], + tvb, offset2+8, 4, ENC_BIG_ENDIAN); + PROTO_ITEM_SET_HIDDEN(hidden_item); - /* - * Save this information to build the conversation request key - * later. - */ - rsvph->session_type = RSVP_SESSION_TYPE_IPV4_UNI; - SET_ADDRESS(&rsvph->destination, AT_IPv4, 4, - tvb_get_ptr(tvb, offset2, 4)); - rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); - rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); + /* + * Save this information to build the conversation request key + * later. + */ + rsvph->session_type = RSVP_SESSION_TYPE_IPV4_UNI; + SET_ADDRESS(&rsvph->destination, AT_IPv4, 4, + tvb_get_ptr(tvb, offset2, 4)); + rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); + rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); - break; + break; case RSVP_SESSION_TYPE_IPV4_E_NNI: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 15 - IPv4 E-NNI"); - proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SESSION_IP], - tvb, offset2, 4, ENC_BIG_ENDIAN); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 15 - IPv4 E-NNI"); + proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SESSION_IP], + tvb, offset2, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SESSION_TUNNEL_ID], - tvb, offset2+6, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SESSION_TUNNEL_ID], + tvb, offset2+6, 2, ENC_BIG_ENDIAN); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4, - "Extended IPv4 Address: %s", - tvb_ip_to_str(tvb, offset2+8)); - hidden_item = proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID], - tvb, offset2+8, 4, ENC_BIG_ENDIAN); - PROTO_ITEM_SET_HIDDEN(hidden_item); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4, + "Extended IPv4 Address: %s", + tvb_ip_to_str(tvb, offset2+8)); + hidden_item = proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID], + tvb, offset2+8, 4, ENC_BIG_ENDIAN); + PROTO_ITEM_SET_HIDDEN(hidden_item); - /* - * Save this information to build the conversation request key - * later. - */ - rsvph->session_type = RSVP_SESSION_TYPE_IPV4_E_NNI; - SET_ADDRESS(&rsvph->destination, AT_IPv4, 4, - tvb_get_ptr(tvb, offset2, 4)); - rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); - rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); + /* + * Save this information to build the conversation request key + * later. + */ + rsvph->session_type = RSVP_SESSION_TYPE_IPV4_E_NNI; + SET_ADDRESS(&rsvph->destination, AT_IPv4, 4, + tvb_get_ptr(tvb, offset2, 4)); + rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); + rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); - break; + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length-4, - "Data (%d bytes)", obj_length-4); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length-4, + "Data (%d bytes)", obj_length-4); + break; } } @@ -1829,265 +1849,265 @@ dissect_rsvp_session (proto_item *ti, proto_tree *rsvp_object_tree, * (TODO: TLV type 12, 13, 25) *------------------------------------------------------------------------------*/ static void -dissect_rsvp_ifid_tlv (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, int offset, int length, - int subtree_type) +dissect_rsvp_ifid_tlv(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, int offset, int length, + int subtree_type) { - int tlv_off, padding; - guint16 tlv_type; - int tlv_len; - guint8 isis_len; + int tlv_off, padding; + guint16 tlv_type; + int tlv_len; + guint8 isis_len; const char *tlv_name; - proto_tree *rsvp_ifid_subtree = NULL, *ti2; + proto_tree *rsvp_ifid_subtree, *ti2; for (tlv_off = 0; tlv_off < length; ) { - tlv_type = tvb_get_ntohs(tvb, offset+tlv_off); - tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2); + tlv_type = tvb_get_ntohs(tvb, offset+tlv_off); + tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2); - if (tlv_len == 0 || tlv_off+tlv_len > length) { - proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off+2, 2, - "Invalid TLV length"); + if ((tlv_len == 0) || (tlv_off+tlv_len > length)) { + proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off+2, 2, + "Invalid TLV length"); return; - } - switch(tlv_type) { - case 1: /* IPv4 */ - tlv_name = ""; - goto ifid_ipv4; - case 14: /* PREVIOUS_HOP_IPV4 */ - tlv_name = "Previous-Hop "; - goto ifid_ipv4; - case 16: /* INCOMING_IPV4 */ - tlv_name = "Incoming "; - ifid_ipv4: - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+tlv_off, tlv_len, - "%sIPv4 TLV - %s", tlv_name, - tvb_ip_to_str(tvb, offset+tlv_off+4)); + } + switch(tlv_type) { + case 1: /* IPv4 */ + tlv_name = ""; + goto ifid_ipv4; + case 14: /* PREVIOUS_HOP_IPV4 */ + tlv_name = "Previous-Hop "; + goto ifid_ipv4; + case 16: /* INCOMING_IPV4 */ + tlv_name = "Incoming "; + ifid_ipv4: + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+tlv_off, tlv_len, + "%sIPv4 TLV - %s", tlv_name, + tvb_ip_to_str(tvb, offset+tlv_off+4)); - rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, - "Type: %d (%sIPv4)", tlv_type, tlv_name); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, - "Length: %u", - tvb_get_ntohs(tvb, offset+tlv_off+2)); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4, - "IPv4 address: %s", - tvb_ip_to_str(tvb, offset+tlv_off+4)); - proto_item_append_text(ti, "%sIPv4: %s. ", tlv_name, - tvb_ip_to_str(tvb, offset+tlv_off+4)); - break; + rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, + "Type: %d (%sIPv4)", tlv_type, tlv_name); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, + "Length: %u", + tvb_get_ntohs(tvb, offset+tlv_off+2)); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4, + "IPv4 address: %s", + tvb_ip_to_str(tvb, offset+tlv_off+4)); + proto_item_append_text(ti, "%sIPv4: %s. ", tlv_name, + tvb_ip_to_str(tvb, offset+tlv_off+4)); + break; - case 2: /* IPv6 */ - tlv_name = ""; - goto ifid_ipv6; - case 15: /* PREVIOUS_HOP_IPV6 */ - tlv_name = "Previous-Hop "; - goto ifid_ipv6; - case 17: /* INCOMING_IPV6 */ - tlv_name = "Incoming "; - ifid_ipv6: - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+tlv_off, tlv_len, - "%sIPv6 TLV - %s", tlv_name, - tvb_ip6_to_str(tvb, offset+tlv_off+4)); + case 2: /* IPv6 */ + tlv_name = ""; + goto ifid_ipv6; + case 15: /* PREVIOUS_HOP_IPV6 */ + tlv_name = "Previous-Hop "; + goto ifid_ipv6; + case 17: /* INCOMING_IPV6 */ + tlv_name = "Incoming "; + ifid_ipv6: + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+tlv_off, tlv_len, + "%sIPv6 TLV - %s", tlv_name, + tvb_ip6_to_str(tvb, offset+tlv_off+4)); - rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, - "Type: %d (%sIPv6)", tlv_type, tlv_name); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, - "Length: %u", - tvb_get_ntohs(tvb, offset+tlv_off+2)); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4, - "IPv6 address: %s", - tvb_ip6_to_str(tvb, offset+tlv_off+4)); - proto_item_append_text(ti, "%sIPv6: %s. ", tlv_name, - tvb_ip6_to_str(tvb, offset+tlv_off+4)); - break; + rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, + "Type: %d (%sIPv6)", tlv_type, tlv_name); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, + "Length: %u", + tvb_get_ntohs(tvb, offset+tlv_off+2)); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4, + "IPv6 address: %s", + tvb_ip6_to_str(tvb, offset+tlv_off+4)); + proto_item_append_text(ti, "%sIPv6: %s. ", tlv_name, + tvb_ip6_to_str(tvb, offset+tlv_off+4)); + break; - case 3: /* IF_INDEX */ - tlv_name = ""; - goto ifid_ifindex; - case 4: /* COMPONENT_IF_DOWNSTREAM */ - tlv_name = " Forward"; - goto ifid_ifindex; - case 5: /* COMPONENT_IF_UPSTREAM */ - tlv_name = " Reverse"; - goto ifid_ifindex; - case 18: /* INCOMING_IF_INDEX */ - tlv_name = " Incoming"; - ifid_ifindex: - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+tlv_off, tlv_len, - "Interface-Index%s TLV - %s, %d", - tlv_name, - tvb_ip_to_str(tvb, offset+tlv_off+4), - tvb_get_ntohl(tvb, offset+tlv_off+8)); - rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, - "Type: %d (Interface Index%s)", tlv_type, tlv_name); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, - "Length: %u", - tvb_get_ntohs(tvb, offset+tlv_off+2)); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4, - "IPv4 address: %s", - tvb_ip_to_str(tvb, offset+tlv_off+4)); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+8, 4, - "Interface-ID: %d (0x%0x)", - tvb_get_ntohl(tvb, offset+tlv_off+8), - tvb_get_ntohl(tvb, offset+tlv_off+8)); - proto_item_append_text(ti, "Data If-Index%s: %s, %d. ", tlv_name, - tvb_ip_to_str(tvb, offset+tlv_off+4), - tvb_get_ntohl(tvb, offset+tlv_off+8)); - break; + case 3: /* IF_INDEX */ + tlv_name = ""; + goto ifid_ifindex; + case 4: /* COMPONENT_IF_DOWNSTREAM */ + tlv_name = " Forward"; + goto ifid_ifindex; + case 5: /* COMPONENT_IF_UPSTREAM */ + tlv_name = " Reverse"; + goto ifid_ifindex; + case 18: /* INCOMING_IF_INDEX */ + tlv_name = " Incoming"; + ifid_ifindex: + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+tlv_off, tlv_len, + "Interface-Index%s TLV - %s, %d", + tlv_name, + tvb_ip_to_str(tvb, offset+tlv_off+4), + tvb_get_ntohl(tvb, offset+tlv_off+8)); + rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, + "Type: %d (Interface Index%s)", tlv_type, tlv_name); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, + "Length: %u", + tvb_get_ntohs(tvb, offset+tlv_off+2)); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4, + "IPv4 address: %s", + tvb_ip_to_str(tvb, offset+tlv_off+4)); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+8, 4, + "Interface-ID: %d (0x%0x)", + tvb_get_ntohl(tvb, offset+tlv_off+8), + tvb_get_ntohl(tvb, offset+tlv_off+8)); + proto_item_append_text(ti, "Data If-Index%s: %s, %d. ", tlv_name, + tvb_ip_to_str(tvb, offset+tlv_off+4), + tvb_get_ntohl(tvb, offset+tlv_off+8)); + break; - case 6: /* DOWNSTREAM_LABEL */ - tlv_name = "Downstream"; - goto ifid_label; - case 7: /* UPSTREAM_LABEL */ - tlv_name = "Upstream"; - goto ifid_label; - case 19: /* INCOMING_DOWN_LABEL */ - tlv_name = "Incoming-Downstream"; - goto ifid_label; - case 20: /* INCOMING_UP_LABEL */ - tlv_name = "Incoming-Upstream"; - ifid_label: - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+tlv_off, tlv_len, - "%s-Label TLV - %u", tlv_name, - tvb_get_ntohl(tvb, offset+tlv_off+4)); - rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, - "Type: %d (%s-Label)", tlv_type, tlv_name); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, - "Length: %u", - tvb_get_ntohs(tvb, offset+tlv_off+2)); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4, - "Label: %u", - tvb_get_ntohl(tvb, offset+tlv_off+4)); - proto_item_append_text(ti, "%s-Label: %u. ", tlv_name, - tvb_get_ntohl(tvb, offset+tlv_off+4)); - break; + case 6: /* DOWNSTREAM_LABEL */ + tlv_name = "Downstream"; + goto ifid_label; + case 7: /* UPSTREAM_LABEL */ + tlv_name = "Upstream"; + goto ifid_label; + case 19: /* INCOMING_DOWN_LABEL */ + tlv_name = "Incoming-Downstream"; + goto ifid_label; + case 20: /* INCOMING_UP_LABEL */ + tlv_name = "Incoming-Upstream"; + ifid_label: + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+tlv_off, tlv_len, + "%s-Label TLV - %u", tlv_name, + tvb_get_ntohl(tvb, offset+tlv_off+4)); + rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, + "Type: %d (%s-Label)", tlv_type, tlv_name); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, + "Length: %u", + tvb_get_ntohs(tvb, offset+tlv_off+2)); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4, + "Label: %u", + tvb_get_ntohl(tvb, offset+tlv_off+4)); + proto_item_append_text(ti, "%s-Label: %u. ", tlv_name, + tvb_get_ntohl(tvb, offset+tlv_off+4)); + break; - case 8: /* NODE_ID */ - tlv_name = ""; - goto ifid_nodeid; - case 21: /* REPORTING_NODE_ID */ - tlv_name = "Reporting-"; - ifid_nodeid: - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+tlv_off, tlv_len, - "%sNode-ID TLV - %s", tlv_name, - tvb_ip_to_str(tvb, offset+tlv_off+4)); - rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, - "Type: %d (%sNode-ID)", tlv_type, tlv_name); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, - "Length: %u", - tvb_get_ntohs(tvb, offset+tlv_off+2)); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4, - "Node ID: %s", - tvb_ip_to_str(tvb, offset+tlv_off+4)); - proto_item_append_text(ti, "%sNode-ID: %s. ", tlv_name, - tvb_ip_to_str(tvb, offset+tlv_off+4)); - break; + case 8: /* NODE_ID */ + tlv_name = ""; + goto ifid_nodeid; + case 21: /* REPORTING_NODE_ID */ + tlv_name = "Reporting-"; + ifid_nodeid: + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+tlv_off, tlv_len, + "%sNode-ID TLV - %s", tlv_name, + tvb_ip_to_str(tvb, offset+tlv_off+4)); + rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, + "Type: %d (%sNode-ID)", tlv_type, tlv_name); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, + "Length: %u", + tvb_get_ntohs(tvb, offset+tlv_off+2)); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4, + "Node ID: %s", + tvb_ip_to_str(tvb, offset+tlv_off+4)); + proto_item_append_text(ti, "%sNode-ID: %s. ", tlv_name, + tvb_ip_to_str(tvb, offset+tlv_off+4)); + break; - case 9: /* OSPF_AREA */ - tlv_name = ""; - goto ifid_ospf; - case 22: /* REPORTING_OSPF_AREA */ - tlv_name = "Reporting-"; - ifid_ospf: - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+tlv_off, tlv_len, - "%sOSPF-Area TLV - %u", tlv_name, - tvb_get_ntohl(tvb, offset+tlv_off+4)); - rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, - "Type: %d (%sOSPF-Area)", tlv_type, tlv_name); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, - "Length: %u", - tvb_get_ntohs(tvb, offset+tlv_off+2)); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4, - "Area: %u", - tvb_get_ntohl(tvb, offset+tlv_off+4)); - proto_item_append_text(ti, "%sOSPF-Area: %u. ", tlv_name, - tvb_get_ntohl(tvb, offset+tlv_off+4)); - break; + case 9: /* OSPF_AREA */ + tlv_name = ""; + goto ifid_ospf; + case 22: /* REPORTING_OSPF_AREA */ + tlv_name = "Reporting-"; + ifid_ospf: + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+tlv_off, tlv_len, + "%sOSPF-Area TLV - %u", tlv_name, + tvb_get_ntohl(tvb, offset+tlv_off+4)); + rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, + "Type: %d (%sOSPF-Area)", tlv_type, tlv_name); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, + "Length: %u", + tvb_get_ntohs(tvb, offset+tlv_off+2)); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4, + "Area: %u", + tvb_get_ntohl(tvb, offset+tlv_off+4)); + proto_item_append_text(ti, "%sOSPF-Area: %u. ", tlv_name, + tvb_get_ntohl(tvb, offset+tlv_off+4)); + break; - case 10: /* ISIS_AREA */ - tlv_name = ""; - goto ifid_isis; - case 23: /* REPORTING_ISIS_AREA */ - tlv_name = "Reporting-"; - ifid_isis: - isis_len = tvb_get_guint8(tvb, offset+tlv_off+4); - if (isis_len < 2 || isis_len > 11) - { - proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, - "%sISIS-Area TLV - Invalid Length field", tlv_name); - break; - } - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+tlv_off, tlv_len, - "%sISIS-Area TLV - %s", tlv_name, - print_nsap_net(tvb_get_ptr(tvb, offset+tlv_off+5, isis_len), - isis_len)); - rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, - "Type: %d (%sISIS-Area)", tlv_type, tlv_name); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, - "Length: %u", - tvb_get_ntohs(tvb, offset+tlv_off+2)); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4, - "IS-IS Area Identifier: %s", - print_nsap_net(tvb_get_ptr(tvb, offset+tlv_off+5, isis_len), isis_len)); - proto_item_append_text(ti, "%sISIS-Area: %s. ", tlv_name, - print_nsap_net(tvb_get_ptr(tvb, offset+tlv_off+5, isis_len), isis_len)); - break; + case 10: /* ISIS_AREA */ + tlv_name = ""; + goto ifid_isis; + case 23: /* REPORTING_ISIS_AREA */ + tlv_name = "Reporting-"; + ifid_isis: + isis_len = tvb_get_guint8(tvb, offset+tlv_off+4); + if ((isis_len < 2) || (isis_len > 11)) + { + proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, + "%sISIS-Area TLV - Invalid Length field", tlv_name); + break; + } + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+tlv_off, tlv_len, + "%sISIS-Area TLV - %s", tlv_name, + print_nsap_net(tvb_get_ptr(tvb, offset+tlv_off+5, isis_len), + isis_len)); + rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, + "Type: %d (%sISIS-Area)", tlv_type, tlv_name); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, + "Length: %u", + tvb_get_ntohs(tvb, offset+tlv_off+2)); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4, + "IS-IS Area Identifier: %s", + print_nsap_net(tvb_get_ptr(tvb, offset+tlv_off+5, isis_len), isis_len)); + proto_item_append_text(ti, "%sISIS-Area: %s. ", tlv_name, + print_nsap_net(tvb_get_ptr(tvb, offset+tlv_off+5, isis_len), isis_len)); + break; - case 11: /* AUTONOMOUS_SYSTEM */ - tlv_name = ""; - goto ifid_as; - case 24: /* REPORTING_AUTONOMOUS_SYSTEM */ - tlv_name = "Reporting-"; - ifid_as: - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+tlv_off, tlv_len, - "%sAS TLV - %u", tlv_name, - tvb_get_ntohl(tvb, offset+tlv_off+4)); - rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, - "Type: %d (%sAS)", tlv_type, tlv_name); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, - "Length: %u", - tvb_get_ntohs(tvb, offset+tlv_off+2)); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4, - "Autonomous System: %u", - tvb_get_ntohl(tvb, offset+tlv_off+4)); - proto_item_append_text(ti, "%sAS: %u. ", tlv_name, - tvb_get_ntohl(tvb, offset+tlv_off+4)); - break; + case 11: /* AUTONOMOUS_SYSTEM */ + tlv_name = ""; + goto ifid_as; + case 24: /* REPORTING_AUTONOMOUS_SYSTEM */ + tlv_name = "Reporting-"; + ifid_as: + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+tlv_off, tlv_len, + "%sAS TLV - %u", tlv_name, + tvb_get_ntohl(tvb, offset+tlv_off+4)); + rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, + "Type: %d (%sAS)", tlv_type, tlv_name); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, + "Length: %u", + tvb_get_ntohs(tvb, offset+tlv_off+2)); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4, + "Autonomous System: %u", + tvb_get_ntohl(tvb, offset+tlv_off+4)); + proto_item_append_text(ti, "%sAS: %u. ", tlv_name, + tvb_get_ntohl(tvb, offset+tlv_off+4)); + break; - case 26: /* NODE_EXCLUSIONS */ - tlv_name = "Node"; - goto ifid_ex; - case 27: /* LINK_EXCLUSIONS */ - tlv_name = "Link"; - ifid_ex: - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+tlv_off, tlv_len, - "%s-Exclusions TLV - ", tlv_name); - rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, - "Type: %d (%s-Exclusions)", tlv_type, tlv_name); - proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, - "Length: %u", - tvb_get_ntohs(tvb, offset+tlv_off+2)); - dissect_rsvp_ifid_tlv(ti2, rsvp_ifid_subtree, tvb, offset+tlv_off+4, - tlv_len-4, TREE(TT_HOP_SUBOBJ)); - break; + case 26: /* NODE_EXCLUSIONS */ + tlv_name = "Node"; + goto ifid_ex; + case 27: /* LINK_EXCLUSIONS */ + tlv_name = "Link"; + ifid_ex: + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+tlv_off, tlv_len, + "%s-Exclusions TLV - ", tlv_name); + rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2, + "Type: %d (%s-Exclusions)", tlv_type, tlv_name); + proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2, + "Length: %u", + tvb_get_ntohs(tvb, offset+tlv_off+2)); + dissect_rsvp_ifid_tlv(ti2, rsvp_ifid_subtree, tvb, offset+tlv_off+4, + tlv_len-4, TREE(TT_HOP_SUBOBJ)); + break; case 516: /* FF: ERROR_STRING TLV, RFC 4783 */ ti2 = @@ -2143,62 +2163,63 @@ dissect_rsvp_ifid_tlv (proto_tree *ti, proto_tree *rsvp_object_tree, * HOP *------------------------------------------------------------------------------*/ static void -dissect_rsvp_hop (proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_hop(proto_item *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { int offset2 = offset + 4; switch(type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1 - IPv4"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, - "Neighbor address: %s", - tvb_ip_to_str(tvb, offset2)); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4, - "Logical interface: %u", - tvb_get_ntohl(tvb, offset2+4)); - proto_item_set_text(ti, "HOP: IPv4, %s", - tvb_ip_to_str(tvb, offset2)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1 - IPv4"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, + "Neighbor address: %s", + tvb_ip_to_str(tvb, offset2)); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4, + "Logical interface: %u", + tvb_get_ntohl(tvb, offset2+4)); + proto_item_set_text(ti, "HOP: IPv4, %s", + tvb_ip_to_str(tvb, offset2)); + break; case 2: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 2 - IPv6"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16, - "Neighbor address: %s", - tvb_ip6_to_str(tvb, offset2)); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 4, - "Logical interface: 0x%08x", - tvb_get_ntohl(tvb, offset2+16)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 2 - IPv6"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16, + "Neighbor address: %s", + tvb_ip6_to_str(tvb, offset2)); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 4, + "Logical interface: 0x%08x", + tvb_get_ntohl(tvb, offset2+16)); + break; case 3: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 3 - IPv4 IF-ID"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, - "Neighbor address: %s", - tvb_ip_to_str(tvb, offset2)); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4, - "Logical interface: %u", - tvb_get_ntohl(tvb, offset2+4)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 3 - IPv4 IF-ID"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, + "Neighbor address: %s", + tvb_ip_to_str(tvb, offset2)); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4, + "Logical interface: %u", + tvb_get_ntohl(tvb, offset2+4)); - proto_item_set_text(ti, "HOP: IPv4 IF-ID. Control IPv4: %s. ", - tvb_ip_to_str(tvb, offset2)); + proto_item_set_text(ti, "HOP: IPv4 IF-ID. Control IPv4: %s. ", + tvb_ip_to_str(tvb, offset2)); - dissect_rsvp_ifid_tlv(ti, rsvp_object_tree, tvb, offset+12, obj_length-12, - TREE(TT_HOP_SUBOBJ)); + dissect_rsvp_ifid_tlv(ti, rsvp_object_tree, tvb, offset+12, obj_length-12, + TREE(TT_HOP_SUBOBJ)); - break; + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -2206,32 +2227,32 @@ dissect_rsvp_hop (proto_item *ti, proto_tree *rsvp_object_tree, * TIME VALUES *------------------------------------------------------------------------------*/ static void -dissect_rsvp_time_values (proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_time_values(proto_item *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { int offset2 = offset + 4; switch(type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, - "Refresh interval: %u ms (%u seconds)", - tvb_get_ntohl(tvb, offset2), - tvb_get_ntohl(tvb, offset2)/1000); - proto_item_set_text(ti, "TIME VALUES: %d ms", - tvb_get_ntohl(tvb, offset2)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, + "Refresh interval: %u ms (%u seconds)", + tvb_get_ntohl(tvb, offset2), + tvb_get_ntohl(tvb, offset2)/1000); + proto_item_set_text(ti, "TIME VALUES: %d ms", + tvb_get_ntohl(tvb, offset2)); + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -2239,78 +2260,80 @@ dissect_rsvp_time_values (proto_item *ti, proto_tree *rsvp_object_tree, * Error value field in ERROR object *------------------------------------------------------------------------------*/ static guint16 -dissect_rsvp_error_value (proto_tree *ti, tvbuff_t *tvb, - int offset, guint8 error_code) +dissect_rsvp_error_value(proto_tree *ti, tvbuff_t *tvb, + int offset, guint8 error_code) { - guint16 error_val; - guint8 error_class, error_ctype; - const value_string *rsvp_error_vals = NULL; + guint16 error_val; + guint8 error_class, error_ctype; + value_string_ext *rsvp_error_vals_ext_p; error_val = tvb_get_ntohs(tvb, offset); switch (error_code) { case RSVP_ERROR_ADMISSION: - rsvp_error_vals = rsvp_admission_control_error_vals; - break; + rsvp_error_vals_ext_p = &rsvp_admission_control_error_vals_ext; + break; case RSVP_ERROR_POLICY: - rsvp_error_vals = rsvp_policy_control_error_vals; - break; + rsvp_error_vals_ext_p = &rsvp_policy_control_error_vals_ext; + break; case RSVP_ERROR_TRAFFIC: - rsvp_error_vals = rsvp_traffic_control_error_vals; - break; + rsvp_error_vals_ext_p = &rsvp_traffic_control_error_vals_ext; + break; case RSVP_ERROR_ROUTING: - rsvp_error_vals = rsvp_routing_error_vals; - break; + rsvp_error_vals_ext_p = &rsvp_routing_error_vals_ext; + break; case RSVP_ERROR_NOTIFY: - rsvp_error_vals = rsvp_notify_error_vals; - break; + rsvp_error_vals_ext_p = &rsvp_notify_error_vals_ext; + break; case RSVP_ERROR_DIFFSERV: - rsvp_error_vals = rsvp_diffserv_error_vals; - break; + rsvp_error_vals_ext_p = &rsvp_diffserv_error_vals_ext; + break; case RSVP_ERROR_DSTE: - rsvp_error_vals = rsvp_diffserv_aware_te_error_vals; - break; + rsvp_error_vals_ext_p = &rsvp_diffserv_aware_te_error_vals_ext; + break; case RSVP_ERROR_CALL_MGMT: - rsvp_error_vals = rsvp_call_mgmt_error_vals; + rsvp_error_vals_ext_p = &rsvp_call_mgmt_error_vals_ext; break; } + switch (error_code) { case RSVP_ERROR_ADMISSION: case RSVP_ERROR_TRAFFIC: - if ((error_val & 0xc0) == 0) { - proto_tree_add_text(ti, tvb, offset, 2, - "Error value: %u - %s", error_val, - val_to_str(error_val, rsvp_error_vals, "Unknown (%d)")); + if ((error_val & 0xc0) == 0) { + proto_tree_add_text(ti, tvb, offset, 2, + "Error value: %u - %s", error_val, + val_to_str_ext(error_val, rsvp_error_vals_ext_p, "Unknown (%d)")); } else if ((error_val & 0xc0) == 0x80) { - proto_tree_add_text(ti, tvb, offset, 2, - "Error value: %u - Organization specific subcode (%u)", error_val, - error_val); + proto_tree_add_text(ti, tvb, offset, 2, + "Error value: %u - Organization specific subcode (%u)", error_val, + error_val); } else if ((error_val & 0xc0) == 0xc0) { - proto_tree_add_text(ti, tvb, offset, 2, - "Error value: %u - Service specific subcode (%u)", error_val, - error_val); + proto_tree_add_text(ti, tvb, offset, 2, + "Error value: %u - Service specific subcode (%u)", error_val, + error_val); } - break; + break; case RSVP_ERROR_UNKNOWN_CLASS: case RSVP_ERROR_UNKNOWN_C_TYPE: - error_class = error_val / 256; + error_class = error_val / 256; error_ctype = error_val % 256; - proto_tree_add_text(ti, tvb, offset, 2, "Class: %u (%s) - CType: %u", - error_class, val_to_str (error_class, rsvp_class_vals, "Unknown"), - error_ctype); - break; + proto_tree_add_text(ti, tvb, offset, 2, "Class: %u (%s) - CType: %u", + error_class, val_to_str_ext_const(error_class, &rsvp_class_vals_ext, "Unknown"), + error_ctype); + break; case RSVP_ERROR_POLICY: case RSVP_ERROR_NOTIFY: case RSVP_ERROR_ROUTING: case RSVP_ERROR_DIFFSERV: case RSVP_ERROR_DSTE: case RSVP_ERROR_CALL_MGMT: - proto_tree_add_text(ti, tvb, offset, 2, "Error value: %u - %s", error_val, - val_to_str(error_val, rsvp_error_vals, "Unknown (%d)")); - break; + proto_tree_add_text(ti, tvb, offset, 2, "Error value: %u - %s", error_val, + val_to_str_ext(error_val, rsvp_error_vals_ext_p, "Unknown (%d)")); + break; default: - proto_tree_add_text(ti, tvb, offset, 2, "Error value: %u", error_val); + proto_tree_add_text(ti, tvb, offset, 2, "Error value: %u", error_val); + break; } return error_val; } @@ -2319,97 +2342,97 @@ dissect_rsvp_error_value (proto_tree *ti, tvbuff_t *tvb, * ERROR *------------------------------------------------------------------------------*/ static void -dissect_rsvp_error (proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_error(proto_item *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { - int offset2 = offset + 4; - int offset3; - guint8 error_flags; - guint8 error_code; - guint16 error_val; + int offset2 = offset + 4; + int offset3; + guint8 error_flags; + guint8 error_code; + guint16 error_val; proto_tree *ti2, *rsvp_error_subtree; switch(type) { case 1: { - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1 - IPv4"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, - "Error node: %s", - tvb_ip_to_str(tvb, offset2)); - offset3 = offset2+4; - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1 - IPv4"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, + "Error node: %s", + tvb_ip_to_str(tvb, offset2)); + offset3 = offset2+4; + break; } case 2: { - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 2 - IPv6"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16, - "Error node: %s", - tvb_ip6_to_str(tvb, offset2)); - offset3 = offset2+16; - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 2 - IPv6"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16, + "Error node: %s", + tvb_ip6_to_str(tvb, offset2)); + offset3 = offset2+16; + break; } case 3: { - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 3 - IPv4 IF-ID"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, - "Error node: %s", - tvb_ip_to_str(tvb, offset2)); - offset3 = offset2+4; - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 3 - IPv4 IF-ID"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, + "Error node: %s", + tvb_ip_to_str(tvb, offset2)); + offset3 = offset2+4; + break; } default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - return; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + return; } error_flags = tvb_get_guint8(tvb, offset3); ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset3, 1, - "Flags: 0x%02x", error_flags); + "Flags: 0x%02x", error_flags); rsvp_error_subtree = proto_item_add_subtree(ti2, TREE(TT_ERROR_FLAGS)); proto_tree_add_text(rsvp_error_subtree, tvb, offset3, 1, "%s", - decode_boolean_bitfield(error_flags, 0x04, 8, - "Path State Removed", - "")); + decode_boolean_bitfield(error_flags, 0x04, 8, + "Path State Removed", + "")); proto_tree_add_text(rsvp_error_subtree, tvb, offset3, 1, "%s", - decode_boolean_bitfield(error_flags, 0x02, 8, - "NotGuilty", - "")); + decode_boolean_bitfield(error_flags, 0x02, 8, + "NotGuilty", + "")); proto_tree_add_text(rsvp_error_subtree, tvb, offset3, 1, "%s", - decode_boolean_bitfield(error_flags, 0x01, 8, - "InPlace", - "")); + decode_boolean_bitfield(error_flags, 0x01, 8, + "InPlace", + "")); proto_item_append_text(ti2, " %s %s %s", - (error_flags & (1<<2)) ? "Path-State-Removed" : "", - (error_flags & (1<<1)) ? "NotGuilty" : "", - (error_flags & (1<<0)) ? "InPlace" : ""); + (error_flags & (1<<2)) ? "Path-State-Removed" : "", + (error_flags & (1<<1)) ? "NotGuilty" : "", + (error_flags & (1<<0)) ? "InPlace" : ""); error_code = tvb_get_guint8(tvb, offset3+1); proto_tree_add_text(rsvp_object_tree, tvb, offset3+1, 1, - "Error code: %u - %s", error_code, - val_to_str(error_code, rsvp_error_codes, "Unknown (%d)")); + "Error code: %u - %s", error_code, + val_to_str_ext(error_code, &rsvp_error_codes_ext, "Unknown (%d)")); error_val = dissect_rsvp_error_value(rsvp_object_tree, tvb, offset3+2, error_code); switch (type) { case 1: - proto_item_set_text(ti, "ERROR: IPv4, Error code: %s, Value: %d, Error Node: %s", - val_to_str(error_code, rsvp_error_codes, "Unknown (%d)"), - error_val, tvb_ip_to_str(tvb, offset2)); - break; + proto_item_set_text(ti, "ERROR: IPv4, Error code: %s, Value: %d, Error Node: %s", + val_to_str_ext(error_code, &rsvp_error_codes_ext, "Unknown (%d)"), + error_val, tvb_ip_to_str(tvb, offset2)); + break; case 3: - proto_item_set_text(ti, "ERROR: IPv4 IF-ID, Error code: %s, Value: %d, Control Node: %s. ", - val_to_str(error_code, rsvp_error_codes, "Unknown (%d)"), - error_val, tvb_ip_to_str(tvb, offset2)); - dissect_rsvp_ifid_tlv(ti, rsvp_object_tree, tvb, offset+12, obj_length-12, - TREE(TT_ERROR_SUBOBJ)); - break; + proto_item_set_text(ti, "ERROR: IPv4 IF-ID, Error code: %s, Value: %d, Control Node: %s. ", + val_to_str_ext(error_code, &rsvp_error_codes_ext, "Unknown (%d)"), + error_val, tvb_ip_to_str(tvb, offset2)); + dissect_rsvp_ifid_tlv(ti, rsvp_object_tree, tvb, offset+12, obj_length-12, + TREE(TT_ERROR_SUBOBJ)); + break; } } @@ -2417,10 +2440,10 @@ dissect_rsvp_error (proto_item *ti, proto_tree *rsvp_object_tree, * SCOPE *------------------------------------------------------------------------------*/ static void -dissect_rsvp_scope (proto_item *ti _U_, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_scope(proto_item *ti _U_, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { int offset2 = offset + 4; int mylen; @@ -2428,37 +2451,38 @@ dissect_rsvp_scope (proto_item *ti _U_, proto_tree *rsvp_object_tree, mylen = obj_length - 4; switch(type) { case 1: { - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1 - IPv4"); - while (mylen > 0) { - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, - "IPv4 Address: %s", - tvb_ip_to_str(tvb, offset2)); - offset2 += 4; - mylen -= 4; - } - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1 - IPv4"); + while (mylen > 0) { + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, + "IPv4 Address: %s", + tvb_ip_to_str(tvb, offset2)); + offset2 += 4; + mylen -= 4; + } + break; } case 2: { - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 2 - IPv6"); - while (mylen > 0) { - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16, - "IPv6 Address: %s", - tvb_ip6_to_str(tvb, offset2)); - offset2 += 16; - mylen -= 16; - } - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 2 - IPv6"); + while (mylen > 0) { + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16, + "IPv6 Address: %s", + tvb_ip6_to_str(tvb, offset2)); + offset2 += 16; + mylen -= 16; + } + break; } default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen, - "Data (%d bytes)", mylen); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen, + "Data (%d bytes)", mylen); + break; } } @@ -2466,39 +2490,39 @@ dissect_rsvp_scope (proto_item *ti _U_, proto_tree *rsvp_object_tree, * STYLE *------------------------------------------------------------------------------*/ static void -dissect_rsvp_style (proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_style(proto_item *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { int offset2 = offset + 4; switch(type) { case 1: { - guint32 style; + guint32 style; - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, - "Flags: 0x%02x", - tvb_get_guint8(tvb, offset2)); - style = tvb_get_ntoh24(tvb, offset2+1); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, - 3, "Style: 0x%06X - %s", style, - val_to_str(style, style_vals, "Unknown")); - proto_item_set_text(ti, "STYLE: %s (%d)", - val_to_str(style, style_vals, "Unknown"), - style); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, + "Flags: 0x%02x", + tvb_get_guint8(tvb, offset2)); + style = tvb_get_ntoh24(tvb, offset2+1); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, + 3, "Style: 0x%06X - %s", style, + val_to_str_const(style, style_vals, "Unknown")); + proto_item_set_text(ti, "STYLE: %s (%d)", + val_to_str_const(style, style_vals, "Unknown"), + style); + break; } default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -2506,40 +2530,41 @@ dissect_rsvp_style (proto_item *ti, proto_tree *rsvp_object_tree, * CONFIRM *------------------------------------------------------------------------------*/ static void -dissect_rsvp_confirm (proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_confirm(proto_item *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { int offset2 = offset + 4; switch(type) { case 1: { - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1 - IPv4"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, - "Receiver address: %s", - tvb_ip_to_str(tvb, offset2)); - proto_item_set_text(ti, "CONFIRM: Receiver %s", - tvb_ip_to_str(tvb, offset2)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1 - IPv4"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, + "Receiver address: %s", + tvb_ip_to_str(tvb, offset2)); + proto_item_set_text(ti, "CONFIRM: Receiver %s", + tvb_ip_to_str(tvb, offset2)); + break; } case 2: { - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 2 - IPv6"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16, - "Receiver address: %s", - tvb_ip6_to_str(tvb, offset2)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 2 - IPv6"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16, + "Receiver address: %s", + tvb_ip6_to_str(tvb, offset2)); + break; } default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -2547,81 +2572,82 @@ dissect_rsvp_confirm (proto_item *ti, proto_tree *rsvp_object_tree, * SENDER TEMPLATE and FILTERSPEC *------------------------------------------------------------------------------*/ static void -dissect_rsvp_template_filter (proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type, - rsvp_conversation_info *rsvph) +dissect_rsvp_template_filter(proto_item *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type, + rsvp_conversation_info *rsvph) { int offset2 = offset + 4; proto_item_set_text(ti, "%s", summary_template(tvb, offset)); switch(type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1 - IPv4"); - proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SENDER_IP], - tvb, offset2, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SENDER_PORT], - tvb, offset2+6, 2, ENC_BIG_ENDIAN); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1 - IPv4"); + proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SENDER_IP], + tvb, offset2, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SENDER_PORT], + tvb, offset2+6, 2, ENC_BIG_ENDIAN); - /* - * Save this information to build the conversation request key later. - */ - SET_ADDRESS(&rsvph->source, AT_IPv4, 4, tvb_get_ptr(tvb, offset2, 4)); - rsvph->udp_source_port = tvb_get_ntohs(tvb, offset2+6); - break; + /* + * Save this information to build the conversation request key later. + */ + SET_ADDRESS(&rsvph->source, AT_IPv4, 4, tvb_get_ptr(tvb, offset2, 4)); + rsvph->udp_source_port = tvb_get_ntohs(tvb, offset2+6); + break; case 2: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 2 - IPv6"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16, - "Source address: %s", - tvb_ip6_to_str(tvb, offset2)); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2, - "Source port: %u", - tvb_get_ntohs(tvb, offset2+18)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 2 - IPv6"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16, + "Source address: %s", + tvb_ip6_to_str(tvb, offset2)); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2, + "Source port: %u", + tvb_get_ntohs(tvb, offset2+18)); + break; case 7: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 7 - IPv4 LSP"); - proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SENDER_IP], - tvb, offset2, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SENDER_LSP_ID], - tvb, offset2+6, 2, ENC_BIG_ENDIAN); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 7 - IPv4 LSP"); + proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SENDER_IP], + tvb, offset2, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SENDER_LSP_ID], + tvb, offset2+6, 2, ENC_BIG_ENDIAN); - /* - * Save this information to build the conversation request key later. - */ - SET_ADDRESS(&rsvph->source, AT_IPv4, 4, tvb_get_ptr(tvb, offset2, 4)); - rsvph->udp_source_port = tvb_get_ntohs(tvb, offset2+6); - break; + /* + * Save this information to build the conversation request key later. + */ + SET_ADDRESS(&rsvph->source, AT_IPv4, 4, tvb_get_ptr(tvb, offset2, 4)); + rsvph->udp_source_port = tvb_get_ntohs(tvb, offset2+6); + break; case 9: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 9 - IPv4 Aggregate"); - proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_SENDER_IP], - tvb, offset2, 4, ENC_BIG_ENDIAN); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 9 - IPv4 Aggregate"); + proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_SENDER_IP], + tvb, offset2, 4, ENC_BIG_ENDIAN); - /* - * Save this information to build the conversation request key later. - */ - SET_ADDRESS(&rsvph->source, AT_IPv4, 4, tvb_get_ptr(tvb, offset2, 4)); - break; + /* + * Save this information to build the conversation request key later. + */ + SET_ADDRESS(&rsvph->source, AT_IPv4, 4, tvb_get_ptr(tvb, offset2, 4)); + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - } + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; + } } /*------------------------------------------------------------------------------ @@ -2629,94 +2655,95 @@ dissect_rsvp_template_filter (proto_item *ti, proto_tree *rsvp_object_tree, *------------------------------------------------------------------------------*/ static void dissect_rsvp_eth_tspec_tlv(proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, int offset, int tlv_length, - int subtree_type) + tvbuff_t *tvb, int offset, int tlv_length, + int subtree_type) { - int tlv_off; - guint16 tlv_type; - int tlv_len; - guint8 profile; + int tlv_off; + guint16 tlv_type; + int tlv_len; + guint8 profile; proto_tree *rsvp_ethspec_subtree, *ethspec_profile_subtree, *ti2, *ti3; for (tlv_off = 0; tlv_off < tlv_length; ) { - tlv_type = tvb_get_ntohs(tvb, offset+tlv_off); - tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2); + tlv_type = tvb_get_ntohs(tvb, offset+tlv_off); + tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2); - if (tlv_len == 0 || tlv_off+tlv_len > tlv_length) { - proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off+2, 2, - "Invalid length"); - return; - } - switch(tlv_type) { - case 0: - case 1: - case 255: - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+tlv_off, tlv_len, - "RESERVED (RFC6003)"); - rsvp_ethspec_subtree = proto_item_add_subtree(ti2, subtree_type); - proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off, 2, - "Type: %u (RESERVED)", tlv_type); - proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+2, 2, - "Length: %u", tlv_len); - break; + if ((tlv_len == 0) || (tlv_off+tlv_len > tlv_length)) { + proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off+2, 2, + "Invalid length"); + return; + } + switch(tlv_type) { + case 0: + case 1: + case 255: + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+tlv_off, tlv_len, + "RESERVED (RFC6003)"); + rsvp_ethspec_subtree = proto_item_add_subtree(ti2, subtree_type); + proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off, 2, + "Type: %u (RESERVED)", tlv_type); + proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+2, 2, + "Length: %u", tlv_len); + break; - case 2: - case 129: /* OIF demo 2009 */ - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+tlv_off, tlv_len, - "Ethernet Bandwidth Profile TLV: CIR=%.10g, CBS=%.10g, " - "EIR=%.10g, EBS=%.10g", - tvb_get_ntohieee_float(tvb, offset+tlv_off+8), - tvb_get_ntohieee_float(tvb, offset+tlv_off+12), - tvb_get_ntohieee_float(tvb, offset+tlv_off+16), - tvb_get_ntohieee_float(tvb, offset+tlv_off+20)); - rsvp_ethspec_subtree = proto_item_add_subtree(ti2, subtree_type); - proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off, 2, - "Type: %u - Ethernet Bandwidth Profile", tlv_type); - proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+2, 2, - "Length: %u", tlv_len); - profile = tvb_get_guint8(tvb, offset+tlv_off+4); - ti3 = proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+4, 1, - "Profile: 0x%02x", profile); - ethspec_profile_subtree = proto_item_add_subtree(ti3, TREE(TT_ETHSPEC_SUBTREE)); - proto_tree_add_text(ethspec_profile_subtree, tvb, offset+tlv_off+4, 1, "%s", - decode_boolean_bitfield(profile, 0x02, 8, - "Color Mode (CM) set", - "Color Mode (CM) NOT set")); - proto_tree_add_text(ethspec_profile_subtree, tvb, offset+tlv_off+4, 1, "%s", - decode_boolean_bitfield(profile, 0x01, 8, - "Coupling Flag (CF) set", - "Coupling Flag (CF) NOT set")); - proto_item_append_text(ti3, " %s %s", - (profile & (1<<1)) ? "CM" : "", - (profile & (1<<0)) ? "CF" : ""); - proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+5, 1, - "Index: %x", tvb_get_guint8(tvb, offset+tlv_off+5)); - proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+6, 2, - "Reserved: %x", tvb_get_ntohs(tvb, offset+tlv_off+6)); - proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+8, 4, "CIR: %.10g", - tvb_get_ntohieee_float(tvb, offset+tlv_off+8)); - proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+12, 4, "CBS: %.10g", - tvb_get_ntohieee_float(tvb, offset+tlv_off+12)); - proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+16, 4, "EIR: %.10g", - tvb_get_ntohieee_float(tvb, offset+tlv_off+16)); - proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+20, 4, "EBS: %.10g", - tvb_get_ntohieee_float(tvb, offset+tlv_off+20)); + case 2: + case 129: /* OIF demo 2009 */ + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+tlv_off, tlv_len, + "Ethernet Bandwidth Profile TLV: CIR=%.10g, CBS=%.10g, " + "EIR=%.10g, EBS=%.10g", + tvb_get_ntohieee_float(tvb, offset+tlv_off+8), + tvb_get_ntohieee_float(tvb, offset+tlv_off+12), + tvb_get_ntohieee_float(tvb, offset+tlv_off+16), + tvb_get_ntohieee_float(tvb, offset+tlv_off+20)); + rsvp_ethspec_subtree = proto_item_add_subtree(ti2, subtree_type); + proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off, 2, + "Type: %u - Ethernet Bandwidth Profile", tlv_type); + proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+2, 2, + "Length: %u", tlv_len); + profile = tvb_get_guint8(tvb, offset+tlv_off+4); + ti3 = proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+4, 1, + "Profile: 0x%02x", profile); + ethspec_profile_subtree = proto_item_add_subtree(ti3, TREE(TT_ETHSPEC_SUBTREE)); + proto_tree_add_text(ethspec_profile_subtree, tvb, offset+tlv_off+4, 1, "%s", + decode_boolean_bitfield(profile, 0x02, 8, + "Color Mode (CM) set", + "Color Mode (CM) NOT set")); + proto_tree_add_text(ethspec_profile_subtree, tvb, offset+tlv_off+4, 1, "%s", + decode_boolean_bitfield(profile, 0x01, 8, + "Coupling Flag (CF) set", + "Coupling Flag (CF) NOT set")); + proto_item_append_text(ti3, " %s %s", + (profile & (1<<1)) ? "CM" : "", + (profile & (1<<0)) ? "CF" : ""); + proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+5, 1, + "Index: %x", tvb_get_guint8(tvb, offset+tlv_off+5)); + proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+6, 2, + "Reserved: %x", tvb_get_ntohs(tvb, offset+tlv_off+6)); + proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+8, 4, "CIR: %.10g", + tvb_get_ntohieee_float(tvb, offset+tlv_off+8)); + proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+12, 4, "CBS: %.10g", + tvb_get_ntohieee_float(tvb, offset+tlv_off+12)); + proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+16, 4, "EIR: %.10g", + tvb_get_ntohieee_float(tvb, offset+tlv_off+16)); + proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+20, 4, "EBS: %.10g", + tvb_get_ntohieee_float(tvb, offset+tlv_off+20)); - proto_item_append_text(ti, "ETH profile: CIR=%.10g, CBS=%.10g, EIR=%.10g, " - "EBS=%.10g", - tvb_get_ntohieee_float(tvb, offset+tlv_off+8), - tvb_get_ntohieee_float(tvb, offset+tlv_off+12), - tvb_get_ntohieee_float(tvb, offset+tlv_off+16), - tvb_get_ntohieee_float(tvb, offset+tlv_off+20)); - break; + proto_item_append_text(ti, "ETH profile: CIR=%.10g, CBS=%.10g, EIR=%.10g, " + "EBS=%.10g", + tvb_get_ntohieee_float(tvb, offset+tlv_off+8), + tvb_get_ntohieee_float(tvb, offset+tlv_off+12), + tvb_get_ntohieee_float(tvb, offset+tlv_off+16), + tvb_get_ntohieee_float(tvb, offset+tlv_off+20)); + break; - default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off, 2, - "Unknown TLV: %u", tlv_type); - } - tlv_off += tlv_len; + default: + proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off, 2, + "Unknown TLV: %u", tlv_type); + break; + } + tlv_off += tlv_len; } } @@ -2724,280 +2751,280 @@ dissect_rsvp_eth_tspec_tlv(proto_item *ti, proto_tree *rsvp_object_tree, * SENDER TSPEC *------------------------------------------------------------------------------*/ static void -dissect_rsvp_tspec (proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_tspec(proto_item *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { - int offset2 = offset + 4; - int mylen; + int offset2 = offset + 4; + int mylen; proto_tree *tspec_tree, *ti2; - guint8 signal_type; - guint16 switch_gran; + guint8 signal_type; + guint16 switch_gran; mylen = obj_length - 4; switch(type) { case 2: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 2 - Integrated Services"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, - "Message format version: %u", - tvb_get_guint8(tvb, offset2)>>4); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, - "Data length: %u words, not including header", - tvb_get_ntohs(tvb, offset2+2)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 2 - Integrated Services"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, + "Message format version: %u", + tvb_get_guint8(tvb, offset2)>>4); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, + "Data length: %u words, not including header", + tvb_get_ntohs(tvb, offset2+2)); - mylen -= 4; - offset2 += 4; + mylen -= 4; + offset2 += 4; - proto_item_set_text(ti, "SENDER TSPEC: IntServ, "); + proto_item_set_text(ti, "SENDER TSPEC: IntServ, "); - while (mylen > 0) { - guint8 service_num; - guint8 param_id; - guint param_len; - guint param_len_processed; - guint length; + while (mylen > 0) { + guint8 service_num; + guint8 param_id; + guint param_len; + guint param_len_processed; + guint length; - service_num = tvb_get_guint8(tvb, offset2); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, - "Service header: %u - %s", - service_num, - val_to_str(service_num, qos_vals, "Unknown")); - length = tvb_get_ntohs(tvb, offset2+2); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, - "Length of service %u data: %u words, " - "not including header", - service_num, length); + service_num = tvb_get_guint8(tvb, offset2); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, + "Service header: %u - %s", + service_num, + val_to_str_const(service_num, qos_vals, "Unknown")); + length = tvb_get_ntohs(tvb, offset2+2); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, + "Length of service %u data: %u words, " + "not including header", + service_num, length); - mylen -= 4; - offset2 += 4; + mylen -= 4; + offset2 += 4; - /* Process all known service headers as a set of parameters */ - param_len_processed = 0; - while (param_len_processed < length) { - param_id = tvb_get_guint8(tvb, offset2); - param_len = tvb_get_ntohs(tvb, offset2+2) + 1; - if (param_len < 1) - THROW(ReportedBoundsError); - switch(param_id) { - case 127: - /* Token Bucket */ - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset2, param_len*4, - "Token Bucket TSpec: "); - tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE)); + /* Process all known service headers as a set of parameters */ + param_len_processed = 0; + while (param_len_processed < length) { + param_id = tvb_get_guint8(tvb, offset2); + param_len = tvb_get_ntohs(tvb, offset2+2) + 1; + if (param_len < 1) + THROW(ReportedBoundsError); + switch(param_id) { + case 127: + /* Token Bucket */ + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset2, param_len*4, + "Token Bucket TSpec: "); + tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE)); - proto_tree_add_text(tspec_tree, tvb, offset2, 1, - "Parameter %u - %s", - param_id, - val_to_str(param_id, svc_vals, "Unknown")); - proto_tree_add_text(tspec_tree, tvb, offset2+1, 1, - "Parameter %u flags: 0x%02x", - param_id, - tvb_get_guint8(tvb, offset2+1)); - proto_tree_add_text(tspec_tree, tvb, offset2+2, 2, - "Parameter %u data length: %u words, " - "not including header", - param_id, - tvb_get_ntohs(tvb, offset2+2)); - proto_tree_add_text(tspec_tree, tvb, offset2+4, 4, - "Token bucket rate: %.10g", - tvb_get_ntohieee_float(tvb, offset2+4)); - proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, - "Token bucket size: %.10g", - tvb_get_ntohieee_float(tvb, offset2+8)); - proto_tree_add_text(tspec_tree, tvb, offset2+12, 4, - "Peak data rate: %.10g", - tvb_get_ntohieee_float(tvb, offset2+12)); - proto_tree_add_text(tspec_tree, tvb, offset2+16, 4, - "Minimum policed unit [m]: %u", - tvb_get_ntohl(tvb, offset2+16)); - proto_tree_add_text(tspec_tree, tvb, offset2+20, 4, - "Maximum packet size [M]: %u", - tvb_get_ntohl(tvb, offset2+20)); - proto_item_append_text(ti, "Token Bucket, %.10g bytes/sec. ", - tvb_get_ntohieee_float(tvb, offset2+4)); - proto_item_append_text(ti2, "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u", - tvb_get_ntohieee_float(tvb, offset2+4), - tvb_get_ntohieee_float(tvb, offset2+8), - tvb_get_ntohieee_float(tvb, offset2+12), - tvb_get_ntohl(tvb, offset2+16), - tvb_get_ntohl(tvb, offset2+20)); - break; + proto_tree_add_text(tspec_tree, tvb, offset2, 1, + "Parameter %u - %s", + param_id, + val_to_str_ext_const(param_id, &svc_vals_ext, "Unknown")); + proto_tree_add_text(tspec_tree, tvb, offset2+1, 1, + "Parameter %u flags: 0x%02x", + param_id, + tvb_get_guint8(tvb, offset2+1)); + proto_tree_add_text(tspec_tree, tvb, offset2+2, 2, + "Parameter %u data length: %u words, " + "not including header", + param_id, + tvb_get_ntohs(tvb, offset2+2)); + proto_tree_add_text(tspec_tree, tvb, offset2+4, 4, + "Token bucket rate: %.10g", + tvb_get_ntohieee_float(tvb, offset2+4)); + proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, + "Token bucket size: %.10g", + tvb_get_ntohieee_float(tvb, offset2+8)); + proto_tree_add_text(tspec_tree, tvb, offset2+12, 4, + "Peak data rate: %.10g", + tvb_get_ntohieee_float(tvb, offset2+12)); + proto_tree_add_text(tspec_tree, tvb, offset2+16, 4, + "Minimum policed unit [m]: %u", + tvb_get_ntohl(tvb, offset2+16)); + proto_tree_add_text(tspec_tree, tvb, offset2+20, 4, + "Maximum packet size [M]: %u", + tvb_get_ntohl(tvb, offset2+20)); + proto_item_append_text(ti, "Token Bucket, %.10g bytes/sec. ", + tvb_get_ntohieee_float(tvb, offset2+4)); + proto_item_append_text(ti2, "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u", + tvb_get_ntohieee_float(tvb, offset2+4), + tvb_get_ntohieee_float(tvb, offset2+8), + tvb_get_ntohieee_float(tvb, offset2+12), + tvb_get_ntohl(tvb, offset2+16), + tvb_get_ntohl(tvb, offset2+20)); + break; - case 128: - /* Null Service (RFC2997) */ - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset2, param_len*4, - "Null Service TSpec: "); - tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE)); + case 128: + /* Null Service (RFC2997) */ + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset2, param_len*4, + "Null Service TSpec: "); + tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE)); - proto_tree_add_text(tspec_tree, tvb, offset2, 1, - "Parameter %u - %s", - param_id, - val_to_str(param_id, svc_vals, "Unknown")); - proto_tree_add_text(tspec_tree, tvb, offset2+1, 1, - "Parameter %u flags: %x", - param_id, - tvb_get_guint8(tvb, offset2+1)); - proto_tree_add_text(tspec_tree, tvb, offset2+2, 2, - "Parameter %u data length: %u words, " - "not including header", - param_id, - tvb_get_ntohs(tvb, offset2+2)); - proto_tree_add_text(tspec_tree, tvb, offset2+4, 4, - "Maximum packet size [M]: %u", - tvb_get_ntohl(tvb, offset2+4)); - proto_item_append_text(ti, "Null Service. M=%u", - tvb_get_ntohl(tvb, offset2+4)); - proto_item_append_text(ti2, "Max pkt size=%u", - tvb_get_ntohl(tvb, offset2+4)); - break; + proto_tree_add_text(tspec_tree, tvb, offset2, 1, + "Parameter %u - %s", + param_id, + val_to_str_ext_const(param_id, &svc_vals_ext, "Unknown")); + proto_tree_add_text(tspec_tree, tvb, offset2+1, 1, + "Parameter %u flags: %x", + param_id, + tvb_get_guint8(tvb, offset2+1)); + proto_tree_add_text(tspec_tree, tvb, offset2+2, 2, + "Parameter %u data length: %u words, " + "not including header", + param_id, + tvb_get_ntohs(tvb, offset2+2)); + proto_tree_add_text(tspec_tree, tvb, offset2+4, 4, + "Maximum packet size [M]: %u", + tvb_get_ntohl(tvb, offset2+4)); + proto_item_append_text(ti, "Null Service. M=%u", + tvb_get_ntohl(tvb, offset2+4)); + proto_item_append_text(ti2, "Max pkt size=%u", + tvb_get_ntohl(tvb, offset2+4)); + break; - case 126: - /* Compression hint (RFC3006) */ - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset2, param_len*4, - "Compression Hint: "); - tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE)); + case 126: + /* Compression hint (RFC3006) */ + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset2, param_len*4, + "Compression Hint: "); + tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE)); - proto_tree_add_text(tspec_tree, tvb, offset2, 1, - "Parameter %u - %s", - param_id, - val_to_str(param_id, svc_vals, "Unknown")); - proto_tree_add_text(tspec_tree, tvb, offset2+1, 1, - "Parameter %u flags: %x", - param_id, - tvb_get_guint8(tvb, offset2+1)); - proto_tree_add_text(tspec_tree, tvb, offset2+2, 2, - "Parameter %u data length: %u words, " - "not including header", - param_id, - tvb_get_ntohs(tvb, offset2+2)); - proto_tree_add_text(tspec_tree, tvb, offset2+4, 4, - "Hint: %u", - tvb_get_ntohl(tvb, offset2+4)); - proto_tree_add_text(tspec_tree, tvb, offset2+4, 4, - "Compression Factor: %u", - tvb_get_ntohl(tvb, offset2+8)); - proto_item_append_text(ti, "Compression Hint. Hint=%u, Factor=%u", - tvb_get_ntohl(tvb, offset2+4), - tvb_get_ntohl(tvb, offset2+8)); - proto_item_append_text(ti2, "Hint=%u, Factor=%u", - tvb_get_ntohl(tvb, offset2+4), - tvb_get_ntohl(tvb, offset2+8)); - break; + proto_tree_add_text(tspec_tree, tvb, offset2, 1, + "Parameter %u - %s", + param_id, + val_to_str_ext_const(param_id, &svc_vals_ext, "Unknown")); + proto_tree_add_text(tspec_tree, tvb, offset2+1, 1, + "Parameter %u flags: %x", + param_id, + tvb_get_guint8(tvb, offset2+1)); + proto_tree_add_text(tspec_tree, tvb, offset2+2, 2, + "Parameter %u data length: %u words, " + "not including header", + param_id, + tvb_get_ntohs(tvb, offset2+2)); + proto_tree_add_text(tspec_tree, tvb, offset2+4, 4, + "Hint: %u", + tvb_get_ntohl(tvb, offset2+4)); + proto_tree_add_text(tspec_tree, tvb, offset2+4, 4, + "Compression Factor: %u", + tvb_get_ntohl(tvb, offset2+8)); + proto_item_append_text(ti, "Compression Hint. Hint=%u, Factor=%u", + tvb_get_ntohl(tvb, offset2+4), + tvb_get_ntohl(tvb, offset2+8)); + proto_item_append_text(ti2, "Hint=%u, Factor=%u", + tvb_get_ntohl(tvb, offset2+4), + tvb_get_ntohl(tvb, offset2+8)); + break; - default: - proto_tree_add_text(rsvp_object_tree, tvb, offset2, param_len*4, - "Unknown parameter %d, %d words", - param_id, param_len); - break; - } - param_len_processed += param_len; - offset2 += param_len*4; - } - mylen -= length*4; - } - break; + default: + proto_tree_add_text(rsvp_object_tree, tvb, offset2, param_len*4, + "Unknown parameter %d, %d words", + param_id, param_len); + break; + } + param_len_processed += param_len; + offset2 += param_len*4; + } + mylen -= length*4; + } + break; case 4: /* SONET/SDH Tspec */ - proto_item_set_text(ti, "SENDER TSPEC: SONET/SDH, "); + proto_item_set_text(ti, "SENDER TSPEC: SONET/SDH, "); - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 4 - SONET/SDH"); - signal_type = tvb_get_guint8(tvb, offset2); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, - "Signal Type: %d - %s", signal_type, - val_to_str(signal_type, - gmpls_sonet_signal_type_str, "Unknown")); - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1, - "Requested Concatenation (RCC): %d", tvb_get_guint8(tvb, offset2+1)); - tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE)); - proto_tree_add_text(tspec_tree, tvb, offset2+1, 1, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x01, 8, - "Standard contiguous concatenation", - "No standard contiguous concatenation")); - proto_tree_add_text(tspec_tree, tvb, offset2+1, 1, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x02, 8, - "Arbitrary contiguous concatenation", - "No arbitrary contiguous concatenation")); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, - "Number of Contiguous Components (NCC): %d", tvb_get_ntohs(tvb, offset2+2)); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2, - "Number of Virtual Components (NVC): %d", tvb_get_ntohs(tvb, offset2+4)); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2, - "Multiplier (MT): %d", tvb_get_ntohs(tvb, offset2+6)); - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4, - "Transparency (T): 0x%0x", tvb_get_ntohl(tvb, offset2+8)); - tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE)); - proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_ntohl(tvb, offset2+8), 0x0001, 32, - "Section/Regenerator Section layer transparency", - "No Section/Regenerator Section layer transparency")); - proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0002, 32, - "Line/Multiplex Section layer transparency", - "No Line/Multiplex Section layer transparency")); - proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0004, 32, - "J0 transparency", - "No J0 transparency")); - proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0008, 32, - "SOH/RSOH DCC transparency", - "No SOH/RSOH DCC transparency")); - proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0010, 32, - "LOH/MSOH DCC transparency", - "No LOH/MSOH DCC transparency")); - proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0020, 32, - "LOH/MSOH Extended DCC transparency", - "No LOH/MSOH Extended DCC transparency")); - proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0040, 32, - "K1/K2 transparency", - "No K1/K2 transparency")); - proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0080, 32, - "E1 transparency", - "No E1 transparency")); - proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0100, 32, - "F1 transparency", - "No F1 transparency")); - proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0200, 32, - "E2 transparency", - "No E2 transparency")); - proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0400, 32, - "B1 transparency", - "No B1 transparency")); - proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0800, 32, - "B2 transparency", - "No B2 transparency")); - proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x1000, 32, - "M0 transparency", - "No M0 transparency")); - proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x2000, 32, - "M1 transparency", - "No M1 transparency")); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+12, 4, - "Profile (P): %d", tvb_get_ntohl(tvb, offset2+12)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 4 - SONET/SDH"); + signal_type = tvb_get_guint8(tvb, offset2); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, + "Signal Type: %d - %s", signal_type, + val_to_str_ext_const(signal_type, + &gmpls_sonet_signal_type_str_ext, "Unknown")); + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1, + "Requested Concatenation (RCC): %d", tvb_get_guint8(tvb, offset2+1)); + tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE)); + proto_tree_add_text(tspec_tree, tvb, offset2+1, 1, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x01, 8, + "Standard contiguous concatenation", + "No standard contiguous concatenation")); + proto_tree_add_text(tspec_tree, tvb, offset2+1, 1, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x02, 8, + "Arbitrary contiguous concatenation", + "No arbitrary contiguous concatenation")); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, + "Number of Contiguous Components (NCC): %d", tvb_get_ntohs(tvb, offset2+2)); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2, + "Number of Virtual Components (NVC): %d", tvb_get_ntohs(tvb, offset2+4)); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2, + "Multiplier (MT): %d", tvb_get_ntohs(tvb, offset2+6)); + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4, + "Transparency (T): 0x%0x", tvb_get_ntohl(tvb, offset2+8)); + tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE)); + proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_ntohl(tvb, offset2+8), 0x0001, 32, + "Section/Regenerator Section layer transparency", + "No Section/Regenerator Section layer transparency")); + proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0002, 32, + "Line/Multiplex Section layer transparency", + "No Line/Multiplex Section layer transparency")); + proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0004, 32, + "J0 transparency", + "No J0 transparency")); + proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0008, 32, + "SOH/RSOH DCC transparency", + "No SOH/RSOH DCC transparency")); + proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0010, 32, + "LOH/MSOH DCC transparency", + "No LOH/MSOH DCC transparency")); + proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0020, 32, + "LOH/MSOH Extended DCC transparency", + "No LOH/MSOH Extended DCC transparency")); + proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0040, 32, + "K1/K2 transparency", + "No K1/K2 transparency")); + proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0080, 32, + "E1 transparency", + "No E1 transparency")); + proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0100, 32, + "F1 transparency", + "No F1 transparency")); + proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0200, 32, + "E2 transparency", + "No E2 transparency")); + proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0400, 32, + "B1 transparency", + "No B1 transparency")); + proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0800, 32, + "B2 transparency", + "No B2 transparency")); + proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x1000, 32, + "M0 transparency", + "No M0 transparency")); + proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x2000, 32, + "M1 transparency", + "No M1 transparency")); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+12, 4, + "Profile (P): %d", tvb_get_ntohl(tvb, offset2+12)); - proto_item_append_text(ti, "Signal [%s], RCC %d, NCC %d, NVC %d, MT %d, Transparency %d, Profile %d", - val_to_str(signal_type, gmpls_sonet_signal_type_str, "Unknown"), - tvb_get_guint8(tvb, offset2+1), tvb_get_ntohs(tvb, offset2+2), - tvb_get_ntohs(tvb, offset2+4), tvb_get_ntohs(tvb, offset2+6), - tvb_get_ntohl(tvb, offset2+8), tvb_get_ntohl(tvb, offset2+12)); - break; + proto_item_append_text(ti, "Signal [%s], RCC %d, NCC %d, NVC %d, MT %d, Transparency %d, Profile %d", + val_to_str_ext_const(signal_type, &gmpls_sonet_signal_type_str_ext, "Unknown"), + tvb_get_guint8(tvb, offset2+1), tvb_get_ntohs(tvb, offset2+2), + tvb_get_ntohs(tvb, offset2+4), tvb_get_ntohs(tvb, offset2+6), + tvb_get_ntohl(tvb, offset2+8), tvb_get_ntohl(tvb, offset2+12)); + break; case 5: /* FF: G.709 TSPEC, RFC 4328 */ proto_item_set_text(ti, "SENDER TSPEC: G.709, "); @@ -3030,37 +3057,37 @@ dissect_rsvp_tspec (proto_item *ti, proto_tree *rsvp_object_tree, break; case 6: /* Ethernet TSPEC (RFC6003) */ - proto_item_set_text(ti, "SENDER TSPEC: Ethernet, "); - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 6 - Ethernet"); + proto_item_set_text(ti, "SENDER TSPEC: Ethernet, "); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 6 - Ethernet"); switch_gran = tvb_get_ntohs(tvb, offset2); if (switch_gran == 0) - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2, - "Switching granularity: 0 - Provided in signaling"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2, + "Switching granularity: 0 - Provided in signaling"); else if (switch_gran == 1) - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2, - "Switching granularity: 1 - Ethernet port"); - else if (switch_gran == 2) - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2, - "Switching granularity: 2 - Ethernet frame"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2, + "Switching granularity: 1 - Ethernet port"); + else if (switch_gran == 2) + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2, + "Switching granularity: 2 - Ethernet frame"); else - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2, - "Switching granularity: %u - ???", switch_gran); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2, + "Switching granularity: %u - ???", switch_gran); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, - "MTU: %u", tvb_get_ntohs(tvb, offset2+2)); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, + "MTU: %u", tvb_get_ntohs(tvb, offset2+2)); - dissect_rsvp_eth_tspec_tlv(ti, rsvp_object_tree, tvb, offset+8, obj_length-8, - TREE(TT_TSPEC_SUBTREE)); + dissect_rsvp_eth_tspec_tlv(ti, rsvp_object_tree, tvb, offset+8, obj_length-8, + TREE(TT_TSPEC_SUBTREE)); break; default: /* Unknown TSpec */ - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -3069,299 +3096,299 @@ dissect_rsvp_tspec (proto_item *ti, proto_tree *rsvp_object_tree, * FLOWSPEC *------------------------------------------------------------------------------*/ static void -dissect_rsvp_flowspec (proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_flowspec(proto_item *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { - int offset2 = offset + 4; - int mylen, signal_type; + int offset2 = offset + 4; + int mylen, signal_type; proto_tree *flowspec_tree, *ti2; proto_item *item; - guint16 switch_gran; + guint16 switch_gran; proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: %u", type); + "C-type: %u", type); mylen = obj_length - 4; switch(type) { case 2: - if (mylen < 4) { - item = proto_tree_add_text(rsvp_object_tree, tvb, 0, 0, - "Object length %u < 8", obj_length); - PROTO_ITEM_SET_GENERATED(item); - return; - } - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, - "Message format version: %u", - tvb_get_guint8(tvb, offset2)>>4); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, - "Data length: %u words, not including header", - tvb_get_ntohs(tvb, offset2+2)); + if (mylen < 4) { + item = proto_tree_add_text(rsvp_object_tree, tvb, 0, 0, + "Object length %u < 8", obj_length); + PROTO_ITEM_SET_GENERATED(item); + return; + } + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, + "Message format version: %u", + tvb_get_guint8(tvb, offset2)>>4); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, + "Data length: %u words, not including header", + tvb_get_ntohs(tvb, offset2+2)); - proto_item_set_text(ti, "FLOWSPEC: "); + proto_item_set_text(ti, "FLOWSPEC: "); - mylen -= 4; - offset2+= 4; - while (mylen > 0) { - guint8 service_num; - guint length; - guint8 param_id; - guint param_len; - guint param_len_processed; + mylen -= 4; + offset2+= 4; + while (mylen > 0) { + guint8 service_num; + guint length; + guint8 param_id; + guint param_len; + guint param_len_processed; - if (mylen < 4) { - item = proto_tree_add_text(rsvp_object_tree, tvb, 0, 0, - "Object length %u not large enough", - obj_length); - PROTO_ITEM_SET_GENERATED(item); - return; - } - service_num = tvb_get_guint8(tvb, offset2); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, - "Service header: %u - %s", - service_num, - val_to_str(service_num, intsrv_services_str, "Unknown")); - length = tvb_get_ntohs(tvb, offset2+2); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, - "Length of service %u data: %u words, " - "not including header", - service_num, - length); + if (mylen < 4) { + item = proto_tree_add_text(rsvp_object_tree, tvb, 0, 0, + "Object length %u not large enough", + obj_length); + PROTO_ITEM_SET_GENERATED(item); + return; + } + service_num = tvb_get_guint8(tvb, offset2); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, + "Service header: %u - %s", + service_num, + val_to_str_ext_const(service_num, &intsrv_services_str_ext, "Unknown")); + length = tvb_get_ntohs(tvb, offset2+2); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, + "Length of service %u data: %u words, " + "not including header", + service_num, + length); - mylen -= 4; - offset2 += 4; + mylen -= 4; + offset2 += 4; - proto_item_append_text(ti, "%s: ", - val_to_str(service_num, intsrv_services_str, - "Unknown (%d)")); + proto_item_append_text(ti, "%s: ", + val_to_str_ext(service_num, &intsrv_services_str_ext, + "Unknown (%d)")); - /* Process all known service headers as a set of parameters */ - param_len_processed = 0; - while (param_len_processed < length) { - param_id = tvb_get_guint8(tvb, offset2); - param_len = tvb_get_ntohs(tvb, offset2+2) + 1; - if (param_len < 1) - THROW(ReportedBoundsError); - switch(param_id) { - case 127: - /* Token Bucket */ - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset2, param_len*4, - "Token Bucket: "); - flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE)); + /* Process all known service headers as a set of parameters */ + param_len_processed = 0; + while (param_len_processed < length) { + param_id = tvb_get_guint8(tvb, offset2); + param_len = tvb_get_ntohs(tvb, offset2+2) + 1; + if (param_len < 1) + THROW(ReportedBoundsError); + switch(param_id) { + case 127: + /* Token Bucket */ + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset2, param_len*4, + "Token Bucket: "); + flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE)); - proto_tree_add_text(flowspec_tree, tvb, offset2, 1, - "Parameter %u - %s", - param_id, - val_to_str(param_id, svc_vals, "Unknown")); - proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1, - "Parameter %u flags: 0x%02x", - param_id, - tvb_get_guint8(tvb, offset2+1)); - proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2, - "Parameter %u data length: %u words, " - "not including header", - param_id, - tvb_get_ntohs(tvb, offset2+2)); - proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4, - "Token bucket rate: %.10g", - tvb_get_ntohieee_float(tvb, offset2+4)); - proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, - "Token bucket size: %.10g", - tvb_get_ntohieee_float(tvb, offset2+8)); - proto_tree_add_text(flowspec_tree, tvb, offset2+12, 4, - "Peak data rate: %.10g", - tvb_get_ntohieee_float(tvb, offset2+12)); - proto_tree_add_text(flowspec_tree, tvb, offset2+16, 4, - "Minimum policed unit [m]: %u", - tvb_get_ntohl(tvb, offset2+16)); - proto_tree_add_text(flowspec_tree, tvb, offset2+20, 4, - "Maximum packet size [M]: %u", - tvb_get_ntohl(tvb, offset2+20)); - proto_item_append_text(ti, "Token Bucket, %.10g bytes/sec. ", - tvb_get_ntohieee_float(tvb, offset2+4)); - proto_item_append_text(ti2, "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u", - tvb_get_ntohieee_float(tvb, offset2+4), - tvb_get_ntohieee_float(tvb, offset2+8), - tvb_get_ntohieee_float(tvb, offset2+12), - tvb_get_ntohl(tvb, offset2+16), - tvb_get_ntohl(tvb, offset2+20)); - break; + proto_tree_add_text(flowspec_tree, tvb, offset2, 1, + "Parameter %u - %s", + param_id, + val_to_str_ext_const(param_id, &svc_vals_ext, "Unknown")); + proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1, + "Parameter %u flags: 0x%02x", + param_id, + tvb_get_guint8(tvb, offset2+1)); + proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2, + "Parameter %u data length: %u words, " + "not including header", + param_id, + tvb_get_ntohs(tvb, offset2+2)); + proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4, + "Token bucket rate: %.10g", + tvb_get_ntohieee_float(tvb, offset2+4)); + proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, + "Token bucket size: %.10g", + tvb_get_ntohieee_float(tvb, offset2+8)); + proto_tree_add_text(flowspec_tree, tvb, offset2+12, 4, + "Peak data rate: %.10g", + tvb_get_ntohieee_float(tvb, offset2+12)); + proto_tree_add_text(flowspec_tree, tvb, offset2+16, 4, + "Minimum policed unit [m]: %u", + tvb_get_ntohl(tvb, offset2+16)); + proto_tree_add_text(flowspec_tree, tvb, offset2+20, 4, + "Maximum packet size [M]: %u", + tvb_get_ntohl(tvb, offset2+20)); + proto_item_append_text(ti, "Token Bucket, %.10g bytes/sec. ", + tvb_get_ntohieee_float(tvb, offset2+4)); + proto_item_append_text(ti2, "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u", + tvb_get_ntohieee_float(tvb, offset2+4), + tvb_get_ntohieee_float(tvb, offset2+8), + tvb_get_ntohieee_float(tvb, offset2+12), + tvb_get_ntohl(tvb, offset2+16), + tvb_get_ntohl(tvb, offset2+20)); + break; - case 130: - /* Guaranteed-rate RSpec */ - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset2, param_len*4, - "Guaranteed-Rate RSpec: "); - flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE)); - proto_tree_add_text(flowspec_tree, tvb, offset2, 1, - "Parameter %u - %s", - param_id, - val_to_str(param_id, svc_vals, "Unknown")); - proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1, - "Parameter %u flags: %x", - param_id, - tvb_get_guint8(tvb, offset2+1)); - proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2, - "Parameter %u data length: %u words, " - "not including header", - param_id, - tvb_get_ntohs(tvb, offset2+2)); + case 130: + /* Guaranteed-rate RSpec */ + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset2, param_len*4, + "Guaranteed-Rate RSpec: "); + flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE)); + proto_tree_add_text(flowspec_tree, tvb, offset2, 1, + "Parameter %u - %s", + param_id, + val_to_str_ext_const(param_id, &svc_vals_ext, "Unknown")); + proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1, + "Parameter %u flags: %x", + param_id, + tvb_get_guint8(tvb, offset2+1)); + proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2, + "Parameter %u data length: %u words, " + "not including header", + param_id, + tvb_get_ntohs(tvb, offset2+2)); - proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4, - "Rate: %.10g", - tvb_get_ntohieee_float(tvb, offset2+4)); - proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, - "Slack term: %u", - tvb_get_ntohl(tvb, offset2+8)); - proto_item_append_text(ti, "RSpec, %.10g bytes/sec. ", - tvb_get_ntohieee_float(tvb, offset2+4)); - proto_item_append_text(ti2, "R=%.10g, s=%u", - tvb_get_ntohieee_float(tvb, offset2+4), - tvb_get_ntohl(tvb, offset2+8)); - break; + proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4, + "Rate: %.10g", + tvb_get_ntohieee_float(tvb, offset2+4)); + proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, + "Slack term: %u", + tvb_get_ntohl(tvb, offset2+8)); + proto_item_append_text(ti, "RSpec, %.10g bytes/sec. ", + tvb_get_ntohieee_float(tvb, offset2+4)); + proto_item_append_text(ti2, "R=%.10g, s=%u", + tvb_get_ntohieee_float(tvb, offset2+4), + tvb_get_ntohl(tvb, offset2+8)); + break; - case 128: - /* Null Service (RFC2997) */ - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset2, param_len*4, - "Null Service Flowspec: "); - flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE)); + case 128: + /* Null Service (RFC2997) */ + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset2, param_len*4, + "Null Service Flowspec: "); + flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE)); - proto_tree_add_text(flowspec_tree, tvb, offset2, 1, - "Parameter %u - %s", - param_id, - val_to_str(param_id, svc_vals, "Unknown")); - proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1, - "Parameter %u flags: %x", - param_id, - tvb_get_guint8(tvb, offset2+1)); - proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2, - "Parameter %u data length: %u words, " - "not including header", - param_id, - tvb_get_ntohs(tvb, offset2+2)); - proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4, - "Maximum packet size [M]: %u", - tvb_get_ntohl(tvb, offset2+4)); - proto_item_append_text(ti, "Null Service. M=%u", - tvb_get_ntohl(tvb, offset2+4)); - proto_item_append_text(ti2, "Max pkt size=%u", - tvb_get_ntohl(tvb, offset2+4)); - break; + proto_tree_add_text(flowspec_tree, tvb, offset2, 1, + "Parameter %u - %s", + param_id, + val_to_str_ext_const(param_id, &svc_vals_ext, "Unknown")); + proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1, + "Parameter %u flags: %x", + param_id, + tvb_get_guint8(tvb, offset2+1)); + proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2, + "Parameter %u data length: %u words, " + "not including header", + param_id, + tvb_get_ntohs(tvb, offset2+2)); + proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4, + "Maximum packet size [M]: %u", + tvb_get_ntohl(tvb, offset2+4)); + proto_item_append_text(ti, "Null Service. M=%u", + tvb_get_ntohl(tvb, offset2+4)); + proto_item_append_text(ti2, "Max pkt size=%u", + tvb_get_ntohl(tvb, offset2+4)); + break; - default: - proto_tree_add_text(rsvp_object_tree, tvb, offset2, param_len*4, - "Unknown parameter %d, %d words", - param_id, param_len); - break; - } - param_len_processed += param_len; - offset2 += param_len * 4; - } + default: + proto_tree_add_text(rsvp_object_tree, tvb, offset2, param_len*4, + "Unknown parameter %d, %d words", + param_id, param_len); + break; + } + param_len_processed += param_len; + offset2 += param_len * 4; + } - /* offset2 += length*4; */ - mylen -= length*4; - } - break; + /* offset2 += length*4; */ + mylen -= length*4; + } + break; case 4: - proto_item_set_text(ti, "FLOWSPEC: SONET/SDH, "); + proto_item_set_text(ti, "FLOWSPEC: SONET/SDH, "); - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 4 - SONET/SDH"); - signal_type = tvb_get_guint8(tvb, offset2); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, - "Signal Type: %d - %s", signal_type, - val_to_str(signal_type, - gmpls_sonet_signal_type_str, "Unknown")); - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1, - "Requested Concatenation (RCC): %d", tvb_get_guint8(tvb, offset2+1)); - flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE)); - proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x01, 8, - "Standard contiguous concatenation", - "No standard contiguous concatenation")); - proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x02, 8, - "Arbitrary contiguous concatenation", - "No arbitrary contiguous concatenation")); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, - "Number of Contiguous Components (NCC): %d", tvb_get_ntohs(tvb, offset2+2)); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2, - "Number of Virtual Components (NVC): %d", tvb_get_ntohs(tvb, offset2+4)); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2, - "Multiplier (MT): %d", tvb_get_ntohs(tvb, offset2+6)); - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4, - "Transparency (T): 0x%0x", tvb_get_ntohl(tvb, offset2+8)); - flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE)); - proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_ntohl(tvb, offset2+8), 0x0001, 32, - "Section/Regenerator Section layer transparency", - "No Section/Regenerator Section layer transparency")); - proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0002, 32, - "Line/Multiplex Section layer transparency", - "No Line/Multiplex Section layer transparency")); - proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0004, 32, - "J0 transparency", - "No J0 transparency")); - proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0008, 32, - "SOH/RSOH DCC transparency", - "No SOH/RSOH DCC transparency")); - proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0010, 32, - "LOH/MSOH DCC transparency", - "No LOH/MSOH DCC transparency")); - proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0020, 32, - "LOH/MSOH Extended DCC transparency", - "No LOH/MSOH Extended DCC transparency")); - proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0040, 32, - "K1/K2 transparency", - "No K1/K2 transparency")); - proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0080, 32, - "E1 transparency", - "No E1 transparency")); - proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0100, 32, - "F1 transparency", - "No F1 transparency")); - proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0200, 32, - "E2 transparency", - "No E2 transparency")); - proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0400, 32, - "B1 transparency", - "No B1 transparency")); - proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0800, 32, - "B2 transparency", - "No B2 transparency")); - proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x1000, 32, - "M0 transparency", - "No M0 transparency")); - proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", - decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x2000, 32, - "M1 transparency", - "No M1 transparency")); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+12, 4, - "Profile (P): %d", tvb_get_ntohl(tvb, offset2+12)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 4 - SONET/SDH"); + signal_type = tvb_get_guint8(tvb, offset2); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, + "Signal Type: %d - %s", signal_type, + val_to_str_ext_const(signal_type, + &gmpls_sonet_signal_type_str_ext, "Unknown")); + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1, + "Requested Concatenation (RCC): %d", tvb_get_guint8(tvb, offset2+1)); + flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE)); + proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x01, 8, + "Standard contiguous concatenation", + "No standard contiguous concatenation")); + proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x02, 8, + "Arbitrary contiguous concatenation", + "No arbitrary contiguous concatenation")); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, + "Number of Contiguous Components (NCC): %d", tvb_get_ntohs(tvb, offset2+2)); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2, + "Number of Virtual Components (NVC): %d", tvb_get_ntohs(tvb, offset2+4)); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2, + "Multiplier (MT): %d", tvb_get_ntohs(tvb, offset2+6)); + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4, + "Transparency (T): 0x%0x", tvb_get_ntohl(tvb, offset2+8)); + flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE)); + proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_ntohl(tvb, offset2+8), 0x0001, 32, + "Section/Regenerator Section layer transparency", + "No Section/Regenerator Section layer transparency")); + proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0002, 32, + "Line/Multiplex Section layer transparency", + "No Line/Multiplex Section layer transparency")); + proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0004, 32, + "J0 transparency", + "No J0 transparency")); + proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0008, 32, + "SOH/RSOH DCC transparency", + "No SOH/RSOH DCC transparency")); + proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0010, 32, + "LOH/MSOH DCC transparency", + "No LOH/MSOH DCC transparency")); + proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0020, 32, + "LOH/MSOH Extended DCC transparency", + "No LOH/MSOH Extended DCC transparency")); + proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0040, 32, + "K1/K2 transparency", + "No K1/K2 transparency")); + proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0080, 32, + "E1 transparency", + "No E1 transparency")); + proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0100, 32, + "F1 transparency", + "No F1 transparency")); + proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0200, 32, + "E2 transparency", + "No E2 transparency")); + proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0400, 32, + "B1 transparency", + "No B1 transparency")); + proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0800, 32, + "B2 transparency", + "No B2 transparency")); + proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x1000, 32, + "M0 transparency", + "No M0 transparency")); + proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s", + decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x2000, 32, + "M1 transparency", + "No M1 transparency")); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+12, 4, + "Profile (P): %d", tvb_get_ntohl(tvb, offset2+12)); - proto_item_append_text(ti, "Signal [%s], RCC %d, NCC %d, NVC %d, MT %d, Transparency %d, Profile %d", - val_to_str(signal_type, gmpls_sonet_signal_type_str, "Unknown"), - tvb_get_guint8(tvb, offset2+1), tvb_get_ntohs(tvb, offset2+2), - tvb_get_ntohs(tvb, offset2+4), tvb_get_ntohs(tvb, offset2+6), - tvb_get_ntohl(tvb, offset2+8), tvb_get_ntohl(tvb, offset2+12)); - break; + proto_item_append_text(ti, "Signal [%s], RCC %d, NCC %d, NVC %d, MT %d, Transparency %d, Profile %d", + val_to_str_ext_const(signal_type, &gmpls_sonet_signal_type_str_ext, "Unknown"), + tvb_get_guint8(tvb, offset2+1), tvb_get_ntohs(tvb, offset2+2), + tvb_get_ntohs(tvb, offset2+4), tvb_get_ntohs(tvb, offset2+6), + tvb_get_ntohl(tvb, offset2+8), tvb_get_ntohl(tvb, offset2+12)); + break; case 5: /* FF: G.709 FLOWSPEC, RFC 4328 */ proto_item_set_text(ti, "FLOWSPEC: G.709, "); @@ -3394,9 +3421,9 @@ dissect_rsvp_flowspec (proto_item *ti, proto_tree *rsvp_object_tree, break; case 6: /* Ethernet FLOWSPEC (RFC6003) */ - proto_item_set_text(ti, "FLOWSPEC: Ethernet, "); - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 6 - Ethernet"); + proto_item_set_text(ti, "FLOWSPEC: Ethernet, "); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 6 - Ethernet"); switch_gran = tvb_get_ntohs(tvb, offset2); if (switch_gran == 0) proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2, @@ -3404,22 +3431,22 @@ dissect_rsvp_flowspec (proto_item *ti, proto_tree *rsvp_object_tree, else if (switch_gran == 1) proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2, "Switching granularity: 1 - Ethernet port"); - else if (switch_gran == 2) + else if (switch_gran == 2) proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2, "Switching granularity: 2 - Ethernet frame"); else proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2, "Switching granularity: %u - ???", switch_gran); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, - "MTU: %u", tvb_get_ntohs(tvb, offset2+2)); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, + "MTU: %u", tvb_get_ntohs(tvb, offset2+2)); - dissect_rsvp_eth_tspec_tlv(ti, rsvp_object_tree, tvb, offset+8, obj_length-8, - TREE(TT_FLOWSPEC_SUBTREE)); + dissect_rsvp_eth_tspec_tlv(ti, rsvp_object_tree, tvb, offset+8, obj_length-8, + TREE(TT_FLOWSPEC_SUBTREE)); break; default: - break; + break; } } @@ -3427,105 +3454,106 @@ dissect_rsvp_flowspec (proto_item *ti, proto_tree *rsvp_object_tree, * ADSPEC *------------------------------------------------------------------------------*/ static void -dissect_rsvp_adspec (proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_adspec(proto_item *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { - int offset2 = offset + 4; - int mylen, i; + int offset2 = offset + 4; + int mylen, i; proto_tree *adspec_tree; proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: %u", type); + "C-type: %u", type); mylen = obj_length - 4; proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, - "Message format version: %u", - tvb_get_guint8(tvb, offset2)>>4); + "Message format version: %u", + tvb_get_guint8(tvb, offset2)>>4); proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, - "Data length: %u words, not including header", - tvb_get_ntohs(tvb, offset2+2)); + "Data length: %u words, not including header", + tvb_get_ntohs(tvb, offset2+2)); mylen -= 4; offset2 += 4; while (mylen > 0) { - guint8 service_num; - guint8 break_bit; - guint length; - const char *str; + guint8 service_num; + guint8 break_bit; + guint length; + const char *str; - service_num = tvb_get_guint8(tvb, offset2); - str = val_to_str(service_num, intsrv_services_str, "Unknown"); - break_bit = tvb_get_guint8(tvb, offset2+1); - length = tvb_get_ntohs(tvb, offset2+2); - ti = proto_tree_add_text(rsvp_object_tree, tvb, offset2, - (length+1)*4, "%s", - str); - adspec_tree = proto_item_add_subtree(ti, - TREE(TT_ADSPEC_SUBTREE)); - proto_tree_add_text(adspec_tree, tvb, offset2, 1, - "Service header %u - %s", - service_num, str); - proto_tree_add_text(adspec_tree, tvb, offset2+1, 1, - (break_bit&0x80)? - "Break bit set":"Break bit not set"); - proto_tree_add_text(adspec_tree, tvb, offset2+2, 2, - "Data length: %u words, not including header", - length); - mylen -= 4; - offset2 += 4; - i = length*4; - while (i > 0) { - guint8 id; - guint phdr_length; + service_num = tvb_get_guint8(tvb, offset2); + str = val_to_str_ext_const(service_num, &intsrv_services_str_ext, "Unknown"); + break_bit = tvb_get_guint8(tvb, offset2+1); + length = tvb_get_ntohs(tvb, offset2+2); + ti = proto_tree_add_text(rsvp_object_tree, tvb, offset2, + (length+1)*4, "%s", + str); + adspec_tree = proto_item_add_subtree(ti, + TREE(TT_ADSPEC_SUBTREE)); + proto_tree_add_text(adspec_tree, tvb, offset2, 1, + "Service header %u - %s", + service_num, str); + proto_tree_add_text(adspec_tree, tvb, offset2+1, 1, + (break_bit&0x80)? + "Break bit set":"Break bit not set"); + proto_tree_add_text(adspec_tree, tvb, offset2+2, 2, + "Data length: %u words, not including header", + length); + mylen -= 4; + offset2 += 4; + i = length*4; + while (i > 0) { + guint8 id; + guint phdr_length; - id = tvb_get_guint8(tvb, offset2); - phdr_length = tvb_get_ntohs(tvb, offset2+2); - str = match_strval(id, adspec_params); - if (str) { - switch(id) { - case 4: - case 8: - case 10: - case 133: - case 134: - case 135: - case 136: - /* 32-bit unsigned integer */ - proto_tree_add_text(adspec_tree, tvb, offset2, - (phdr_length+1)<<2, - "%s - %u (type %u, length %u)", - str, - tvb_get_ntohl(tvb, offset2+4), - id, phdr_length); - break; + id = tvb_get_guint8(tvb, offset2); + phdr_length = tvb_get_ntohs(tvb, offset2+2); + str = match_strval_ext(id, &adspec_params_ext); + if (str) { + switch(id) { + case 4: + case 8: + case 10: + case 133: + case 134: + case 135: + case 136: + /* 32-bit unsigned integer */ + proto_tree_add_text(adspec_tree, tvb, offset2, + (phdr_length+1)<<2, + "%s - %u (type %u, length %u)", + str, + tvb_get_ntohl(tvb, offset2+4), + id, phdr_length); + break; - case 6: - /* IEEE float */ - proto_tree_add_text(adspec_tree, tvb, offset2, - (phdr_length+1)<<2, - "%s - %.10g (type %u, length %u)", - str, - tvb_get_ntohieee_float(tvb, offset2+4), - id, phdr_length); - break; - default: - proto_tree_add_text(adspec_tree, tvb, offset2, - (phdr_length+1)<<2, - "%s (type %u, length %u)", - str, - id, phdr_length); - } - } else { - proto_tree_add_text(adspec_tree, tvb, offset2, - (phdr_length+1)<<2, - "Unknown (type %u, length %u)", - id, phdr_length); - } - offset2 += (phdr_length+1)<<2; - i -= (phdr_length+1)<<2; - mylen -= (phdr_length+1)<<2; - } + case 6: + /* IEEE float */ + proto_tree_add_text(adspec_tree, tvb, offset2, + (phdr_length+1)<<2, + "%s - %.10g (type %u, length %u)", + str, + tvb_get_ntohieee_float(tvb, offset2+4), + id, phdr_length); + break; + default: + proto_tree_add_text(adspec_tree, tvb, offset2, + (phdr_length+1)<<2, + "%s (type %u, length %u)", + str, + id, phdr_length); + break; + } + } else { + proto_tree_add_text(adspec_tree, tvb, offset2, + (phdr_length+1)<<2, + "Unknown (type %u, length %u)", + id, phdr_length); + } + offset2 += (phdr_length+1)<<2; + i -= (phdr_length+1)<<2; + mylen -= (phdr_length+1)<<2; + } } } @@ -3533,59 +3561,59 @@ dissect_rsvp_adspec (proto_item *ti, proto_tree *rsvp_object_tree, * INTEGRITY *------------------------------------------------------------------------------*/ static void -dissect_rsvp_integrity (proto_item *ti _U_, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_integrity(proto_item *ti _U_, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { - int offset2 = offset + 4; + int offset2 = offset + 4; proto_tree *ti2, *rsvp_integ_flags_tree; - int flags; + int flags; proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: %u", type); + "C-type: %u", type); flags = tvb_get_guint8(tvb, offset2); ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, - "Flags: 0x%02x", flags); + "Flags: 0x%02x", flags); rsvp_integ_flags_tree = proto_item_add_subtree(ti2, TREE(TT_INTEGRITY_FLAGS)); proto_tree_add_text(rsvp_integ_flags_tree, tvb, offset2, 1, "%s", - decode_boolean_bitfield(flags, 0x01, 8, "Handshake capable", "Handshake not capable")); + decode_boolean_bitfield(flags, 0x01, 8, "Handshake capable", "Handshake not capable")); proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 6, - "Key Identifier: %s", tvb_bytes_to_str(tvb, offset2+2, 6)); + "Key Identifier: %s", tvb_bytes_to_str(tvb, offset2+2, 6)); proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 8, - "Sequence Number: %" G_GINT64_MODIFIER "u", tvb_get_ntoh64(tvb, offset2+8)); + "Sequence Number: %" G_GINT64_MODIFIER "u", tvb_get_ntoh64(tvb, offset2+8)); proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, obj_length - 20, - "Hash: %s", tvb_bytes_to_str(tvb, offset2+16, obj_length - 20)); + "Hash: %s", tvb_bytes_to_str(tvb, offset2+16, obj_length - 20)); } /*------------------------------------------------------------------------------ * POLICY *------------------------------------------------------------------------------*/ static void -dissect_rsvp_policy (proto_item *ti _U_, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_policy(proto_item *ti _U_, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { int offset2 = offset + 4; proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: %u", type); + "C-type: %u", type); proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); + "Data (%d bytes)", obj_length - 4); } /*------------------------------------------------------------------------------ * LABEL_REQUEST *------------------------------------------------------------------------------*/ static void -dissect_rsvp_label_request (proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_label_request(proto_item *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { int offset2 = offset + 4; - const value_string lab_req_type_str[] = { + static const value_string lab_req_type_str[] = { { 1, ""}, { 2, "(Label Request with ATM label Range)"}, { 3, "(Label Request with Frame-Relay label Range)"}, @@ -3593,127 +3621,128 @@ dissect_rsvp_label_request (proto_item *ti, proto_tree *rsvp_object_tree, { 5, "(Generalized Channel_set Label Request)"}, { 0, NULL } }; + static value_string_ext lab_req_type_str_ext = VALUE_STRING_EXT_INIT(lab_req_type_str); proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: %d %s", type, - val_to_str(type, lab_req_type_str, "Unknown")); + "C-type: %d %s", type, + val_to_str_ext_const(type, &lab_req_type_str_ext, "Unknown")); switch(type) { case 1: { - unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, - "L3PID: %s (0x%04x)", - val_to_str(l3pid, etype_vals, "Unknown"), - l3pid); - proto_item_set_text(ti, "LABEL REQUEST: Basic: L3PID: %s (0x%04x)", - val_to_str(l3pid, etype_vals, "Unknown"), - l3pid); - break; + unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, + "L3PID: %s (0x%04x)", + val_to_str_const(l3pid, etype_vals, "Unknown"), + l3pid); + proto_item_set_text(ti, "LABEL REQUEST: Basic: L3PID: %s (0x%04x)", + val_to_str_const(l3pid, etype_vals, "Unknown"), + l3pid); + break; } case 2: { - unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2); - unsigned short min_vpi, min_vci, max_vpi, max_vci; - proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, - "L3PID: %s (0x%04x)", - val_to_str(l3pid, etype_vals, "Unknown"), - l3pid); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 1, - "M: %s Merge in Data Plane", - (tvb_get_guint8(tvb, offset2+4) & 0x80) ? - "1: Can" : "0: Cannot"); - min_vpi = tvb_get_ntohs(tvb, offset2+4) & 0x7f; - min_vci = tvb_get_ntohs(tvb, offset2+6); - max_vpi = tvb_get_ntohs(tvb, offset2+8) & 0x7f; - max_vci = tvb_get_ntohs(tvb, offset2+10); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2, - "Min VPI: %d", min_vpi); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2, - "Min VCI: %d", min_vci); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 2, - "Max VPI: %d", max_vpi); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+10, 2, - "Max VCI: %d", max_vci); - proto_item_set_text(ti, "LABEL REQUEST: ATM: L3PID: %s (0x%04x). VPI/VCI: Min: %d/%d, Max: %d/%d. %s Merge. ", - val_to_str(l3pid, etype_vals, "Unknown"), l3pid, - min_vpi, min_vci, max_vpi, max_vci, - (tvb_get_guint8(tvb, offset2+4) & 0x80) ? "Can" : "Cannot"); - break; + unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2); + unsigned short min_vpi, min_vci, max_vpi, max_vci; + proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, + "L3PID: %s (0x%04x)", + val_to_str_const(l3pid, etype_vals, "Unknown"), + l3pid); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 1, + "M: %s Merge in Data Plane", + (tvb_get_guint8(tvb, offset2+4) & 0x80) ? + "1: Can" : "0: Cannot"); + min_vpi = tvb_get_ntohs(tvb, offset2+4) & 0x7f; + min_vci = tvb_get_ntohs(tvb, offset2+6); + max_vpi = tvb_get_ntohs(tvb, offset2+8) & 0x7f; + max_vci = tvb_get_ntohs(tvb, offset2+10); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2, + "Min VPI: %d", min_vpi); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2, + "Min VCI: %d", min_vci); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 2, + "Max VPI: %d", max_vpi); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+10, 2, + "Max VCI: %d", max_vci); + proto_item_set_text(ti, "LABEL REQUEST: ATM: L3PID: %s (0x%04x). VPI/VCI: Min: %d/%d, Max: %d/%d. %s Merge. ", + val_to_str_const(l3pid, etype_vals, "Unknown"), l3pid, + min_vpi, min_vci, max_vpi, max_vci, + (tvb_get_guint8(tvb, offset2+4) & 0x80) ? "Can" : "Cannot"); + break; } case 3: { - guint16 l3pid = tvb_get_ntohs(tvb, offset2+2); - guint32 min_dlci, max_dlci, dlci_len, dlci_len_code; - proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, - "L3PID: %s (0x%04x)", - val_to_str(l3pid, etype_vals, "Unknown"), - l3pid); - dlci_len_code = (tvb_get_ntohs(tvb, offset2+4) & 0x0180) >> 7; - min_dlci = tvb_get_ntohl(tvb, offset2+4) & 0x7fffff; - max_dlci = tvb_get_ntohl(tvb, offset2+8) & 0x7fffff; - switch(dlci_len_code) { - case 0: - /* 10-bit DLCIs */ - dlci_len = 10; - min_dlci &= 0x3ff; - max_dlci &= 0x3ff; - break; - case 2: - dlci_len = 23; - break; - default: - dlci_len = 0; - min_dlci = 0; - max_dlci = 0; - } - proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2, - "DLCI Length: %s (%d)", - dlci_len==10 ? "10 bits" : - dlci_len==23 ? "23 bits" : - "INVALID", dlci_len_code); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 3, - "Min DLCI: %d", min_dlci); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 2, - "Max DLCI: %d", max_dlci); - proto_item_set_text(ti, "LABEL REQUEST: Frame: L3PID: %s (0x%04x). DLCI Len: %s. Min DLCI: %d. Max DLCI: %d", - val_to_str(l3pid, etype_vals, "Unknown"), l3pid, - dlci_len==10 ? "10 bits" : - dlci_len==23 ? "23 bits" : - "INVALID", min_dlci, max_dlci); - break; + guint16 l3pid = tvb_get_ntohs(tvb, offset2+2); + guint32 min_dlci, max_dlci, dlci_len, dlci_len_code; + proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, + "L3PID: %s (0x%04x)", + val_to_str_const(l3pid, etype_vals, "Unknown"), + l3pid); + dlci_len_code = (tvb_get_ntohs(tvb, offset2+4) & 0x0180) >> 7; + min_dlci = tvb_get_ntohl(tvb, offset2+4) & 0x7fffff; + max_dlci = tvb_get_ntohl(tvb, offset2+8) & 0x7fffff; + switch(dlci_len_code) { + case 0: + /* 10-bit DLCIs */ + dlci_len = 10; + min_dlci &= 0x3ff; + max_dlci &= 0x3ff; + break; + case 2: + dlci_len = 23; + break; + default: + dlci_len = 0; + min_dlci = 0; + max_dlci = 0; + break; + } + proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2, + "DLCI Length: %s (%d)", + (dlci_len==10) ? "10 bits" : + (dlci_len==23) ? "23 bits" : + "INVALID", dlci_len_code); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 3, + "Min DLCI: %d", min_dlci); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 2, + "Max DLCI: %d", max_dlci); + proto_item_set_text(ti, "LABEL REQUEST: Frame: L3PID: %s (0x%04x). DLCI Len: %s. Min DLCI: %d. Max DLCI: %d", + val_to_str_const(l3pid, etype_vals, "Unknown"), l3pid, + (dlci_len==10) ? "10 bits" : + (dlci_len==23) ? "23 bits" : + "INVALID", min_dlci, max_dlci); + break; } case 4: case 5: { - unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2); - unsigned char lsp_enc = tvb_get_guint8(tvb,offset2); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, - "LSP Encoding Type: %s", - rval_to_str(lsp_enc, gmpls_lsp_enc_rvals, "Unknown (%d)")); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1, - "Switching Type: %s", - rval_to_str(tvb_get_guint8(tvb,offset2+1), - gmpls_switching_type_rvals, "Unknown (%d)")); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, - "G-PID: %s (0x%0x)", - rval_to_str(l3pid, gmpls_gpid_rvals, - val_to_str(l3pid, etype_vals, - "Unknown G-PID(0x%04x)")), - l3pid); - proto_item_set_text(ti, "LABEL REQUEST: Generalized: LSP Encoding=%s, " - "Switching Type=%s, G-PID=%s ", - rval_to_str(lsp_enc, gmpls_lsp_enc_rvals, "Unknown (%d)"), - rval_to_str(tvb_get_guint8(tvb,offset2+1), - gmpls_switching_type_rvals, "Unknown (%d)"), - rval_to_str(l3pid, gmpls_gpid_rvals, - val_to_str(l3pid, etype_vals, - "Unknown (0x%04x)"))); - break; + unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2); + unsigned char lsp_enc = tvb_get_guint8(tvb,offset2); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, + "LSP Encoding Type: %s", + rval_to_str(lsp_enc, gmpls_lsp_enc_rvals, "Unknown (%d)")); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1, + "Switching Type: %s", + rval_to_str(tvb_get_guint8(tvb,offset2+1), + gmpls_switching_type_rvals, "Unknown (%d)")); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2, + "G-PID: %s (0x%0x)", + rval_to_str(l3pid, gmpls_gpid_rvals, + val_to_str(l3pid, etype_vals, + "Unknown G-PID(0x%04x)")), + l3pid); + proto_item_set_text(ti, "LABEL REQUEST: Generalized: LSP Encoding=%s, " + "Switching Type=%s, G-PID=%s ", + rval_to_str(lsp_enc, gmpls_lsp_enc_rvals, "Unknown (%d)"), + rval_to_str(tvb_get_guint8(tvb,offset2+1), + gmpls_switching_type_rvals, "Unknown (%d)"), + rval_to_str(l3pid, gmpls_gpid_rvals, + val_to_str(l3pid, etype_vals, + "Unknown (0x%04x)"))); + break; } - default: { - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; - } + default: + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } /* switch(type) */ } @@ -3735,9 +3764,9 @@ dissect_glabel_lambda(proto_tree *ti _U_, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset) { - float freq = 0.0; + float freq = 0.0; guint32 wavelength = 0; - float cs_thz = 0.0; + float cs_thz = 0.0; guint8 grid = ((tvb_get_guint8(tvb, offset) & 0xE0) >> 5); guint8 cs = ((tvb_get_guint8(tvb, offset) & 0x1E) >> 1); @@ -3884,8 +3913,8 @@ dissect_glabel_sdh(proto_tree *ti _U_, proto_tree *rsvp_object_tree, */ static void dissect_glabel_g709(proto_tree *ti _U_, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset) + tvbuff_t *tvb, + int offset) { guint8 t2 = ((tvb_get_guint8(tvb, offset + 3) & 0x0E) >> 1); guint8 t1 = ((tvb_get_guint8(tvb, offset + 3) & 0x01) >> 0); @@ -3907,35 +3936,35 @@ dissect_glabel_g709(proto_tree *ti _U_, proto_tree *rsvp_object_tree, } static void -dissect_rsvp_label (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class, int type) +dissect_rsvp_label(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class, int type) { - int offset2 = offset + 4; - int mylen, i; + int offset2 = offset + 4; + int mylen, i; const char *name; name = (rsvp_class==RSVP_CLASS_SUGGESTED_LABEL ? "SUGGESTED LABEL": - (rsvp_class==RSVP_CLASS_UPSTREAM_LABEL ? "UPSTREAM LABEL": - (rsvp_class==RSVP_CLASS_RECOVERY_LABEL ? "RECOVERY LABEL": - "LABEL"))); + (rsvp_class==RSVP_CLASS_UPSTREAM_LABEL ? "UPSTREAM LABEL": + (rsvp_class==RSVP_CLASS_RECOVERY_LABEL ? "RECOVERY LABEL": + "LABEL"))); mylen = obj_length - 4; switch(type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1 (Packet Label)"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, - "Label: %u", - tvb_get_ntohl(tvb, offset2)); - proto_item_set_text(ti, "%s: %u", name, - tvb_get_ntohl(tvb, offset2)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1 (Packet Label)"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, + "Label: %u", + tvb_get_ntohl(tvb, offset2)); + proto_item_set_text(ti, "%s: %u", name, + tvb_get_ntohl(tvb, offset2)); + break; case 2: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 2 (Generalized Label)"); - if (rsvp_generalized_label_option == 1) { + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 2 (Generalized Label)"); + if (rsvp_generalized_label_option == 1) { /* FF: no generalized label interpretation */ proto_item_set_text(ti, "%s: Generalized: ", name); for (i = 0; i < mylen; i += 4) { @@ -3951,43 +3980,43 @@ dissect_rsvp_label (proto_tree *ti, proto_tree *rsvp_object_tree, proto_item_append_text(ti, "..."); } } - } else if (rsvp_generalized_label_option == 2) { + } else if (rsvp_generalized_label_option == 2) { dissect_glabel_sdh(ti, rsvp_object_tree, tvb, offset2); - } else if (rsvp_generalized_label_option == 4) { + } else if (rsvp_generalized_label_option == 4) { dissect_glabel_g709(ti, rsvp_object_tree, tvb, offset2); - } else if (rsvp_generalized_label_option == 3) { + } else if (rsvp_generalized_label_option == 3) { dissect_glabel_lambda(ti, rsvp_object_tree, tvb, offset2); - } - break; + } + break; case 4: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 4 (Generalized Channel_set)"); - proto_item_append_text(ti, ": Generalized Channel_set"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen, - "Data (%d bytes)", mylen); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 4 (Generalized Channel_set)"); + proto_item_append_text(ti, ": Generalized Channel_set"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen, + "Data (%d bytes)", mylen); + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen, - "Data (%d bytes)", mylen); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen, + "Data (%d bytes)", mylen); + break; } } /*------------------------------------------------------------------------------ * LABEL_SET *------------------------------------------------------------------------------*/ static void -dissect_rsvp_label_set (proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_label_set(proto_item *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { - int offset2 = offset + 8; + int offset2 = offset + 8; guint8 label_type; - int len, i; + int len, i; static const value_string action_type_vals[] = { { 0, "Inclusive list"}, @@ -3996,34 +4025,35 @@ dissect_rsvp_label_set (proto_item *ti, proto_tree *rsvp_object_tree, { 3, "Exclusive range"}, { 0, NULL} }; + static value_string_ext action_type_vals_ext = VALUE_STRING_EXT_INIT(action_type_vals); len = obj_length - 8; proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, "C-type: %u", type); proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1, "Action: %s", - val_to_str(tvb_get_guint8(tvb, offset+4), - action_type_vals, "Unknown (%u)")); + val_to_str_ext(tvb_get_guint8(tvb, offset+4), + &action_type_vals_ext, "Unknown (%u)")); proto_item_append_text(ti, ": %s", - val_to_str(tvb_get_guint8(tvb, offset+4), - action_type_vals, "Unknown (%u)")); + val_to_str_ext(tvb_get_guint8(tvb, offset+4), + &action_type_vals_ext, "Unknown (%u)")); label_type = tvb_get_guint8 (tvb, offset+7); proto_tree_add_text(rsvp_object_tree, tvb, offset+7, 1, "Label type: %s", - label_type==1 ? "Packet Label" : "Generalized Label"); + (label_type == 1) ? "Packet Label" : "Generalized Label"); proto_item_append_text(ti, ", %s", - label_type==1 ? "Packet Label: " : "Generalized Label: "); + (label_type == 1) ? "Packet Label: " : "Generalized Label: "); for (i = 0; i < len/4; i++) { - proto_tree_add_text(rsvp_object_tree, tvb, offset2+i*4, 4, - "Subchannel %u: %u (0x%x)", i+1, - tvb_get_ntohl(tvb, offset2+i*4), - tvb_get_ntohl(tvb, offset2+i*4)); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+i*4, 4, + "Subchannel %u: %u (0x%x)", i+1, + tvb_get_ntohl(tvb, offset2+i*4), + tvb_get_ntohl(tvb, offset2+i*4)); - if (i<5) { + if (i<5) { if (i!=0) proto_item_append_text(ti, ", "); proto_item_append_text(ti, "%u", tvb_get_ntohl(tvb, offset2+i*4)); - } + } } } @@ -4031,91 +4061,91 @@ dissect_rsvp_label_set (proto_item *ti, proto_tree *rsvp_object_tree, * SESSION ATTRIBUTE *------------------------------------------------------------------------------*/ static void -dissect_rsvp_session_attribute (proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_session_attribute(proto_item *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { - int offset2 = offset + 4; - guint8 flags; - guint8 name_len; + int offset2 = offset + 4; + guint8 flags; + guint8 name_len; proto_tree *ti2, *rsvp_sa_flags_tree; switch(type) { case 1: case 7: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: %u - IPv4 LSP (%sResource Affinities)", + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: %u - IPv4 LSP (%sResource Affinities)", type, (type == 1) ? "" : "No "); if (type == 1) { proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, - "Exclude-Any: 0x%0x", tvb_get_ntohl(tvb, offset2)); + "Exclude-Any: 0x%0x", tvb_get_ntohl(tvb, offset2)); proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4, - "Include-Any: 0x%0x", tvb_get_ntohl(tvb, offset2+4)); + "Include-Any: 0x%0x", tvb_get_ntohl(tvb, offset2+4)); proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4, - "Include-All: 0x%0x", tvb_get_ntohl(tvb, offset2+8)); + "Include-All: 0x%0x", tvb_get_ntohl(tvb, offset2+8)); offset2 = offset2+12; } - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, - "Setup priority: %u", - tvb_get_guint8(tvb, offset2)); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1, - "Hold priority: %u", - tvb_get_guint8(tvb, offset2+1)); - flags = tvb_get_guint8(tvb, offset2+2); - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 1, - "Flags: 0x%02x", flags); - rsvp_sa_flags_tree = proto_item_add_subtree(ti2, - TREE(TT_SESSION_ATTRIBUTE_FLAGS)); - proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1, "%s", - decode_boolean_bitfield(flags, 0x01, 8, - "Local protection desired", - "Local protection not desired")); - proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1, "%s", - decode_boolean_bitfield(flags, 0x02, 8, - "Label recording desired", - "Label recording not desired")); - proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1, "%s", - decode_boolean_bitfield(flags, 0x04, 8, - "SE style desired", - "SE style not desired")); - proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1, "%s", - decode_boolean_bitfield(flags, 0x08, 8, - "Bandwidth protection desired", - "Bandwidth protection not desired")); - proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1, "%s", - decode_boolean_bitfield(flags, 0x10, 8, - "Node protection desired", - "Node protection not desired")); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, + "Setup priority: %u", + tvb_get_guint8(tvb, offset2)); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1, + "Hold priority: %u", + tvb_get_guint8(tvb, offset2+1)); + flags = tvb_get_guint8(tvb, offset2+2); + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 1, + "Flags: 0x%02x", flags); + rsvp_sa_flags_tree = proto_item_add_subtree(ti2, + TREE(TT_SESSION_ATTRIBUTE_FLAGS)); + proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1, "%s", + decode_boolean_bitfield(flags, 0x01, 8, + "Local protection desired", + "Local protection not desired")); + proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1, "%s", + decode_boolean_bitfield(flags, 0x02, 8, + "Label recording desired", + "Label recording not desired")); + proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1, "%s", + decode_boolean_bitfield(flags, 0x04, 8, + "SE style desired", + "SE style not desired")); + proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1, "%s", + decode_boolean_bitfield(flags, 0x08, 8, + "Bandwidth protection desired", + "Bandwidth protection not desired")); + proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1, "%s", + decode_boolean_bitfield(flags, 0x10, 8, + "Node protection desired", + "Node protection not desired")); - name_len = tvb_get_guint8(tvb, offset2+3); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+3, 1, - "Name length: %u", name_len); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, name_len, - "Name: %s", - tvb_format_text(tvb, offset2+4, name_len)); + name_len = tvb_get_guint8(tvb, offset2+3); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+3, 1, + "Name length: %u", name_len); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, name_len, + "Name: %s", + tvb_format_text(tvb, offset2+4, name_len)); - proto_item_set_text(ti, "SESSION ATTRIBUTE: SetupPrio %d, HoldPrio %d, %s%s%s%s%s [%s]", - tvb_get_guint8(tvb, offset2), - tvb_get_guint8(tvb, offset2+1), - flags &0x01 ? "Local Protection, " : "", - flags &0x02 ? "Label Recording, " : "", - flags &0x04 ? "SE Style, " : "", - flags &0x08 ? "Bandwidth Protection, " : "", - flags &0x10 ? "Node Protection, " : "", - name_len ? tvb_format_text(tvb, offset2+4, name_len) : ""); - break; + proto_item_set_text(ti, "SESSION ATTRIBUTE: SetupPrio %d, HoldPrio %d, %s%s%s%s%s [%s]", + tvb_get_guint8(tvb, offset2), + tvb_get_guint8(tvb, offset2+1), + flags &0x01 ? "Local Protection, " : "", + flags &0x02 ? "Label Recording, " : "", + flags &0x04 ? "SE Style, " : "", + flags &0x08 ? "Bandwidth Protection, " : "", + flags &0x10 ? "Node Protection, " : "", + name_len ? tvb_format_text(tvb, offset2+4, name_len) : ""); + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -4123,13 +4153,13 @@ dissect_rsvp_session_attribute (proto_item *ti, proto_tree *rsvp_object_tree, * EXPLICIT ROUTE AND RECORD ROUTE SUBOBJECTS *------------------------------------------------------------------------------*/ static void -dissect_rsvp_ero_rro_subobjects (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, int rsvp_class) +dissect_rsvp_ero_rro_subobjects(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, int rsvp_class) { - int i, j, k, l, flags; + int i, j, k, l, flags; proto_tree *ti2, *rsvp_ro_subtree, *rsvp_rro_flags_subtree; - int tree_type; + int tree_type; switch(rsvp_class) { case RSVP_CLASS_EXPLICIT_ROUTE: @@ -4144,425 +4174,424 @@ dissect_rsvp_ero_rro_subobjects (proto_tree *ti, proto_tree *rsvp_object_tree, } for (i=1, l = 0; l < obj_length - 4; i++) { - j = tvb_get_guint8(tvb, offset+l) & 0x7f; - switch(j) { - case 1: /* IPv4 */ - k = tvb_get_guint8(tvb, offset+l) & 0x80; - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+l, 8, - "IPv4 Subobject - %s%s", - tvb_ip_to_str(tvb, offset+l+2), - rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE ? - (k ? ", Loose" : ", Strict") : ""); - rsvp_ro_subtree = - proto_item_add_subtree(ti2, tree_type); - if (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE) - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, - k ? "Loose Hop " : "Strict Hop"); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, - "Type: 1 (IPv4)"); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, - "Length: %u", - tvb_get_guint8(tvb, offset+l+1)); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 4, - "IPv4 hop: %s", - tvb_ip_to_str(tvb, offset+l+2)); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+6, 1, - "Prefix length: %u", - tvb_get_guint8(tvb, offset+l+6)); - if (i < 4) { - proto_item_append_text(ti, "IPv4 %s%s", - tvb_ip_to_str(tvb, offset+l+2), - k ? " [L]" : ""); - } - if (rsvp_class == RSVP_CLASS_RECORD_ROUTE) { - flags = tvb_get_guint8(tvb, offset+l+7); - if (flags&0x10) { - proto_item_append_text(ti, " (Node-id)"); - proto_item_append_text(ti2, " (Node-id)"); - } - if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available"); - if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use"); - if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail"); - if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop"); - ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+7, 1, - "Flags: 0x%02x", flags); - rsvp_rro_flags_subtree = - proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS)); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1, "%s", - decode_boolean_bitfield(flags, 0x01, 8, - "Local Protection Available", - "Local Protection Not Available")); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1, "%s", - decode_boolean_bitfield(flags, 0x02, 8, - "Local Protection In Use", - "Local Protection Not In Use")); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1, "%s", - decode_boolean_bitfield(flags, 0x04, 8, - "Bandwidth Protection Available", - "Bandwidth Protection Not Available")); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1, "%s", - decode_boolean_bitfield(flags, 0x08, 8, - "Node Protection Available", - "Node Protection Not Available")); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1, "%s", - decode_boolean_bitfield(flags, 0x10, 8, - "Address Specifies a Node-id Address", - "Address Doesn't Specify a Node-id Address")); - } + j = tvb_get_guint8(tvb, offset+l) & 0x7f; + switch(j) { + case 1: /* IPv4 */ + k = tvb_get_guint8(tvb, offset+l) & 0x80; + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+l, 8, + "IPv4 Subobject - %s%s", + tvb_ip_to_str(tvb, offset+l+2), + rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE ? + (k ? ", Loose" : ", Strict") : ""); + rsvp_ro_subtree = + proto_item_add_subtree(ti2, tree_type); + if (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE) + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, + k ? "Loose Hop " : "Strict Hop"); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, + "Type: 1 (IPv4)"); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, + "Length: %u", + tvb_get_guint8(tvb, offset+l+1)); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 4, + "IPv4 hop: %s", + tvb_ip_to_str(tvb, offset+l+2)); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+6, 1, + "Prefix length: %u", + tvb_get_guint8(tvb, offset+l+6)); + if (i < 4) { + proto_item_append_text(ti, "IPv4 %s%s", + tvb_ip_to_str(tvb, offset+l+2), + k ? " [L]" : ""); + } + if (rsvp_class == RSVP_CLASS_RECORD_ROUTE) { + flags = tvb_get_guint8(tvb, offset+l+7); + if (flags&0x10) { + proto_item_append_text(ti, " (Node-id)"); + proto_item_append_text(ti2, " (Node-id)"); + } + if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available"); + if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use"); + if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail"); + if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop"); + ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+7, 1, + "Flags: 0x%02x", flags); + rsvp_rro_flags_subtree = + proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS)); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1, "%s", + decode_boolean_bitfield(flags, 0x01, 8, + "Local Protection Available", + "Local Protection Not Available")); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1, "%s", + decode_boolean_bitfield(flags, 0x02, 8, + "Local Protection In Use", + "Local Protection Not In Use")); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1, "%s", + decode_boolean_bitfield(flags, 0x04, 8, + "Bandwidth Protection Available", + "Bandwidth Protection Not Available")); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1, "%s", + decode_boolean_bitfield(flags, 0x08, 8, + "Node Protection Available", + "Node Protection Not Available")); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1, "%s", + decode_boolean_bitfield(flags, 0x10, 8, + "Address Specifies a Node-id Address", + "Address Doesn't Specify a Node-id Address")); + } - break; + break; - case 2: /* IPv6 */ - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+l, 20, - "IPv6 Subobject"); - rsvp_ro_subtree = - proto_item_add_subtree(ti2, tree_type); - k = tvb_get_guint8(tvb, offset+l) & 0x80; - if (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE) - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, - k ? "Loose Hop " : "Strict Hop"); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, - "Type: 2 (IPv6)"); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, - "Length: %u", - tvb_get_guint8(tvb, offset+l+1)); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 16, - "IPv6 hop: %s", - tvb_ip6_to_str(tvb, offset+l+2)); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+18, 1, - "Prefix length: %u", - tvb_get_guint8(tvb, offset+l+18)); - if (i < 4) { - proto_item_append_text(ti, "IPv6 [...]%s", k ? " [L]":""); - } - if (rsvp_class == RSVP_CLASS_RECORD_ROUTE) { - flags = tvb_get_guint8(tvb, offset+l+19); - if (flags&0x10) { - proto_item_append_text(ti, " (Node-id)"); - proto_item_append_text(ti2, " (Node-id)"); - } - if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available"); - if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use"); - if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail"); - if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop"); - ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+19, 1, - "Flags: 0x%02x", flags); - rsvp_rro_flags_subtree = - proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS)); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1, "%s", - decode_boolean_bitfield(flags, 0x01, 8, - "Local Protection Available", - "Local Protection Not Available")); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1, "%s", - decode_boolean_bitfield(flags, 0x02, 8, - "Local Protection In Use", - "Local Protection Not In Use")); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1, "%s", - decode_boolean_bitfield(flags, 0x04, 8, - "Backup Tunnel Has Bandwidth", - "Backup Tunnel Does Not Have Bandwidth")); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1, "%s", - decode_boolean_bitfield(flags, 0x08, 8, - "Backup Tunnel Goes To Next-Next-Hop", - "Backup Tunnel Goes To Next-Hop")); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1, "%s", - decode_boolean_bitfield(flags, 0x10, 8, - "Address Specifies a Node-id Address", - "Address Doesn't Specify a Node-id Address")); - } + case 2: /* IPv6 */ + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+l, 20, + "IPv6 Subobject"); + rsvp_ro_subtree = + proto_item_add_subtree(ti2, tree_type); + k = tvb_get_guint8(tvb, offset+l) & 0x80; + if (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE) + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, + k ? "Loose Hop " : "Strict Hop"); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, + "Type: 2 (IPv6)"); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, + "Length: %u", + tvb_get_guint8(tvb, offset+l+1)); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 16, + "IPv6 hop: %s", + tvb_ip6_to_str(tvb, offset+l+2)); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+18, 1, + "Prefix length: %u", + tvb_get_guint8(tvb, offset+l+18)); + if (i < 4) { + proto_item_append_text(ti, "IPv6 [...]%s", k ? " [L]":""); + } + if (rsvp_class == RSVP_CLASS_RECORD_ROUTE) { + flags = tvb_get_guint8(tvb, offset+l+19); + if (flags&0x10) { + proto_item_append_text(ti, " (Node-id)"); + proto_item_append_text(ti2, " (Node-id)"); + } + if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available"); + if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use"); + if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail"); + if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop"); + ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+19, 1, + "Flags: 0x%02x", flags); + rsvp_rro_flags_subtree = + proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS)); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1, "%s", + decode_boolean_bitfield(flags, 0x01, 8, + "Local Protection Available", + "Local Protection Not Available")); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1, "%s", + decode_boolean_bitfield(flags, 0x02, 8, + "Local Protection In Use", + "Local Protection Not In Use")); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1, "%s", + decode_boolean_bitfield(flags, 0x04, 8, + "Backup Tunnel Has Bandwidth", + "Backup Tunnel Does Not Have Bandwidth")); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1, "%s", + decode_boolean_bitfield(flags, 0x08, 8, + "Backup Tunnel Goes To Next-Next-Hop", + "Backup Tunnel Goes To Next-Hop")); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1, "%s", + decode_boolean_bitfield(flags, 0x10, 8, + "Address Specifies a Node-id Address", + "Address Doesn't Specify a Node-id Address")); + } - break; + break; - case 3: /* Label */ - k = tvb_get_guint8(tvb, offset+l) & 0x80; - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+l, 8, - "Label Subobject - %d, %s", - tvb_get_ntohl(tvb, offset+l+4), - rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE ? - (k ? "Loose" : "Strict") : ""); - rsvp_ro_subtree = - proto_item_add_subtree(ti2, tree_type); - if (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE) - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, - k ? "Loose Hop " : "Strict Hop"); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, - "Type: 3 (Label)"); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, - "Length: %u", - tvb_get_guint8(tvb, offset+l+1)); - if (rsvp_class == RSVP_CLASS_RECORD_ROUTE) { - flags = tvb_get_guint8(tvb, offset+l+2); - if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available"); - if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use"); - if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail"); - if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop"); - ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 1, - "Flags: 0x%02x", flags); - rsvp_rro_flags_subtree = - proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS)); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s", - decode_boolean_bitfield(flags, 0x01, 8, - "Local Protection Available", - "Local Protection Not Available")); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s", - decode_boolean_bitfield(flags, 0x02, 8, - "Local Protection In Use", - "Local Protection Not In Use")); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s", - decode_boolean_bitfield(flags, 0x04, 8, - "Backup Tunnel Has Bandwidth", - "Backup Tunnel Does Not Have Bandwidth")); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s", - decode_boolean_bitfield(flags, 0x08, 8, - "Backup Tunnel Goes To Next-Next-Hop", - "Backup Tunnel Goes To Next-Hop")); - } - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+3, 1, - "C-Type: %u", - tvb_get_guint8(tvb, offset+l+3)); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+4, 4, - "Label: %d", - tvb_get_ntohl(tvb, offset+l+4)); - if (i < 4) { - proto_item_append_text(ti, "Label %d%s", - tvb_get_ntohl(tvb, offset+l+4), - k ? " [L]":""); - } - break; + case 3: /* Label */ + k = tvb_get_guint8(tvb, offset+l) & 0x80; + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+l, 8, + "Label Subobject - %d, %s", + tvb_get_ntohl(tvb, offset+l+4), + rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE ? + (k ? "Loose" : "Strict") : ""); + rsvp_ro_subtree = + proto_item_add_subtree(ti2, tree_type); + if (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE) + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, + k ? "Loose Hop " : "Strict Hop"); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, + "Type: 3 (Label)"); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, + "Length: %u", + tvb_get_guint8(tvb, offset+l+1)); + if (rsvp_class == RSVP_CLASS_RECORD_ROUTE) { + flags = tvb_get_guint8(tvb, offset+l+2); + if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available"); + if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use"); + if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail"); + if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop"); + ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 1, + "Flags: 0x%02x", flags); + rsvp_rro_flags_subtree = + proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS)); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s", + decode_boolean_bitfield(flags, 0x01, 8, + "Local Protection Available", + "Local Protection Not Available")); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s", + decode_boolean_bitfield(flags, 0x02, 8, + "Local Protection In Use", + "Local Protection Not In Use")); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s", + decode_boolean_bitfield(flags, 0x04, 8, + "Backup Tunnel Has Bandwidth", + "Backup Tunnel Does Not Have Bandwidth")); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s", + decode_boolean_bitfield(flags, 0x08, 8, + "Backup Tunnel Goes To Next-Next-Hop", + "Backup Tunnel Goes To Next-Hop")); + } + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+3, 1, + "C-Type: %u", + tvb_get_guint8(tvb, offset+l+3)); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+4, 4, + "Label: %d", + tvb_get_ntohl(tvb, offset+l+4)); + if (i < 4) { + proto_item_append_text(ti, "Label %d%s", + tvb_get_ntohl(tvb, offset+l+4), + k ? " [L]":""); + } + break; - case 4: /* Unnumbered Interface-ID */ - k = tvb_get_guint8(tvb, offset+l) & 0x80; - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+l, 8, - "Unnumbered Interface-ID - %s, %d, %s", - tvb_ip_to_str(tvb, offset+l+4), - tvb_get_ntohl(tvb, offset+l+8), - rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE ? - (k ? "Loose" : "Strict") : ""); - rsvp_ro_subtree = - proto_item_add_subtree(ti2, tree_type); - if (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE) - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, - k ? "Loose Hop " : "Strict Hop"); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, - "Type: 4 (Unnumbered Interface-ID)"); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, - "Length: %u", - tvb_get_guint8(tvb, offset+l+1)); - if (rsvp_class == RSVP_CLASS_RECORD_ROUTE) { - flags = tvb_get_guint8(tvb, offset+l+2); - if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available"); - if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use"); - if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail"); - if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop"); - ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 1, - "Flags: 0x%02x", flags); - rsvp_rro_flags_subtree = - proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS)); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s", - decode_boolean_bitfield(flags, 0x01, 8, - "Local Protection Available", - "Local Protection Not Available")); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s", - decode_boolean_bitfield(flags, 0x02, 8, - "Local Protection In Use", - "Local Protection Not In Use")); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s", - decode_boolean_bitfield(flags, 0x04, 8, - "Backup Tunnel Has Bandwidth", - "Backup Tunnel Does Not Have Bandwidth")); - proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s", - decode_boolean_bitfield(flags, 0x08, 8, - "Backup Tunnel Goes To Next-Next-Hop", - "Backup Tunnel Goes To Next-Hop")); - } - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+4, 4, - "Router-ID: %s", - tvb_ip_to_str(tvb, offset+l+4)); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+8, 4, - "Interface-ID: %d", - tvb_get_ntohl(tvb, offset+l+8)); - if (i < 4) { - proto_item_append_text(ti, "Unnum %s/%d%s", - tvb_ip_to_str(tvb, offset+l+4), - tvb_get_ntohl(tvb, offset+l+8), - k ? " [L]":""); - } - break; + case 4: /* Unnumbered Interface-ID */ + k = tvb_get_guint8(tvb, offset+l) & 0x80; + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+l, 8, + "Unnumbered Interface-ID - %s, %d, %s", + tvb_ip_to_str(tvb, offset+l+4), + tvb_get_ntohl(tvb, offset+l+8), + rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE ? + (k ? "Loose" : "Strict") : ""); + rsvp_ro_subtree = + proto_item_add_subtree(ti2, tree_type); + if (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE) + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, + k ? "Loose Hop " : "Strict Hop"); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, + "Type: 4 (Unnumbered Interface-ID)"); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, + "Length: %u", + tvb_get_guint8(tvb, offset+l+1)); + if (rsvp_class == RSVP_CLASS_RECORD_ROUTE) { + flags = tvb_get_guint8(tvb, offset+l+2); + if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available"); + if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use"); + if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail"); + if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop"); + ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 1, + "Flags: 0x%02x", flags); + rsvp_rro_flags_subtree = + proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS)); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s", + decode_boolean_bitfield(flags, 0x01, 8, + "Local Protection Available", + "Local Protection Not Available")); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s", + decode_boolean_bitfield(flags, 0x02, 8, + "Local Protection In Use", + "Local Protection Not In Use")); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s", + decode_boolean_bitfield(flags, 0x04, 8, + "Backup Tunnel Has Bandwidth", + "Backup Tunnel Does Not Have Bandwidth")); + proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s", + decode_boolean_bitfield(flags, 0x08, 8, + "Backup Tunnel Goes To Next-Next-Hop", + "Backup Tunnel Goes To Next-Hop")); + } + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+4, 4, + "Router-ID: %s", + tvb_ip_to_str(tvb, offset+l+4)); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+8, 4, + "Interface-ID: %d", + tvb_get_ntohl(tvb, offset+l+8)); + if (i < 4) { + proto_item_append_text(ti, "Unnum %s/%d%s", + tvb_ip_to_str(tvb, offset+l+4), + tvb_get_ntohl(tvb, offset+l+8), + k ? " [L]":""); + } + break; - case 32: /* AS */ - if (rsvp_class == RSVP_CLASS_RECORD_ROUTE) goto defaultsub; - k = tvb_get_ntohs(tvb, offset+l+2); - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+l, 4, - "Autonomous System %u", - k); - rsvp_ro_subtree = - proto_item_add_subtree(ti2, tree_type); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, - "Type: 32 (Autonomous System Number)"); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, - "Length: %u", - tvb_get_guint8(tvb, offset+l+1)); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 2, - "Autonomous System %u", k); - if (i < 4) { - proto_item_append_text(ti, "AS %d", - tvb_get_ntohs(tvb, offset+l+2)); - } - break; - - case 64: /* PKSv4 - RFC5520 */ - if (rsvp_class == RSVP_CLASS_RECORD_ROUTE) goto defaultsub; - k = tvb_get_ntohs(tvb, offset+l+2); - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+l, 8, - "Path Key subobject - %s, %u", - tvb_ip_to_str(tvb, offset+l+4), + case 32: /* AS */ + if (rsvp_class == RSVP_CLASS_RECORD_ROUTE) goto defaultsub; + k = tvb_get_ntohs(tvb, offset+l+2); + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+l, 4, + "Autonomous System %u", k); - rsvp_ro_subtree = - proto_item_add_subtree(ti2, tree_type); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, - "Type: 64 (Path Key with IPv4 PCE-ID)"); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, - "Length: %u", - tvb_get_guint8(tvb, offset+l+1)); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 2, - "Path Key: %u", k); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+4, 4, - "PCE-ID: %s", - tvb_ip_to_str(tvb, offset+l+4)); - if (i < 4) { - proto_item_append_text(ti, "Path Key %d", k); - } - break; + rsvp_ro_subtree = + proto_item_add_subtree(ti2, tree_type); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, + "Type: 32 (Autonomous System Number)"); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, + "Length: %u", + tvb_get_guint8(tvb, offset+l+1)); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 2, + "Autonomous System %u", k); + if (i < 4) { + proto_item_append_text(ti, "AS %d", + tvb_get_ntohs(tvb, offset+l+2)); + } + break; - case 65: /* PKSv6 - RFC5520 */ - if (rsvp_class == RSVP_CLASS_RECORD_ROUTE) goto defaultsub; - k = tvb_get_ntohs(tvb, offset+l+2); - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+l, 8, - "Path Key subobject - %s, %u", - tvb_ip6_to_str(tvb, offset+l+4), + case 64: /* PKSv4 - RFC5520 */ + if (rsvp_class == RSVP_CLASS_RECORD_ROUTE) goto defaultsub; + k = tvb_get_ntohs(tvb, offset+l+2); + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+l, 8, + "Path Key subobject - %s, %u", + tvb_ip_to_str(tvb, offset+l+4), k); - rsvp_ro_subtree = - proto_item_add_subtree(ti2, tree_type); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, - "Type: 65 (Path Key with IPv6 PCE-ID)"); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, - "Length: %u", - tvb_get_guint8(tvb, offset+l+1)); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 2, - "Path Key: %u", k); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+4, 4, - "PCE-ID: %s", - tvb_ip6_to_str(tvb, offset+l+4)); - if (i < 4) { - proto_item_append_text(ti, "Path Key %d", k); - } - break; + rsvp_ro_subtree = + proto_item_add_subtree(ti2, tree_type); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, + "Type: 64 (Path Key with IPv4 PCE-ID)"); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, + "Length: %u", + tvb_get_guint8(tvb, offset+l+1)); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 2, + "Path Key: %u", k); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+4, 4, + "PCE-ID: %s", + tvb_ip_to_str(tvb, offset+l+4)); + if (i < 4) { + proto_item_append_text(ti, "Path Key %d", k); + } + break; + + case 65: /* PKSv6 - RFC5520 */ + if (rsvp_class == RSVP_CLASS_RECORD_ROUTE) goto defaultsub; + k = tvb_get_ntohs(tvb, offset+l+2); + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+l, 8, + "Path Key subobject - %s, %u", + tvb_ip6_to_str(tvb, offset+l+4), + k); + rsvp_ro_subtree = + proto_item_add_subtree(ti2, tree_type); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, + "Type: 65 (Path Key with IPv6 PCE-ID)"); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, + "Length: %u", + tvb_get_guint8(tvb, offset+l+1)); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 2, + "Path Key: %u", k); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+4, 4, + "PCE-ID: %s", + tvb_ip6_to_str(tvb, offset+l+4)); + if (i < 4) { + proto_item_append_text(ti, "Path Key %d", k); + } + break; case 124: case 125: case 126: case 127: - /* - * FF: Types 124 through 127 are to be reserved for Vendor - * Private Use (see RFC 3936, Section 2.3.1) in case of - * EXPLICIT_ROUTE (aka ERO). - */ - if (rsvp_class == RSVP_CLASS_RECORD_ROUTE) - goto defaultsub; - else - goto privatesub; - break; + /* + * FF: Types 124 through 127 are to be reserved for Vendor + * Private Use (see RFC 3936, Section 2.3.1) in case of + * EXPLICIT_ROUTE (aka ERO). + */ + if (rsvp_class == RSVP_CLASS_RECORD_ROUTE) + goto defaultsub; + else + goto privatesub; + break; case 252: case 253: case 254: case 255: - /* - * FF: Types 252 through 255 are to be reserved for Vendor - * Private Use (see RFC 3936, Section 2.3.1) in case of - * RECORD_ROUTE (aka RRO). - */ - if (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE) - goto defaultsub; - else - goto privatesub; - break; + /* + * FF: Types 252 through 255 are to be reserved for Vendor + * Private Use (see RFC 3936, Section 2.3.1) in case of + * RECORD_ROUTE (aka RRO). + */ + if (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE) + goto defaultsub; + else + goto privatesub; + break; privatesub: /* Private subobject */ - /* - * FF: The first four octets of the sub-object contents of - * a Vendor Private sub-object of an EXPLICIT_ROUTE or - * RECORD_ROUTE object MUST be that vendor's SMI enterprise - * code in network octet order. - */ - { - guint8 private_so_len = tvb_get_guint8(tvb, offset+l+1); - k = tvb_get_guint8(tvb, offset+l) & 0x80; - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+l, - tvb_get_guint8(tvb, offset+l+1), - "Private Subobject: %d", j); - rsvp_ro_subtree = - proto_item_add_subtree(ti2, tree_type); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, - k ? "Loose Hop " : "Strict Hop"); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, - "Type: %u (Private)", j); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, - "Length: %u", - private_so_len); + /* + * FF: The first four octets of the sub-object contents of + * a Vendor Private sub-object of an EXPLICIT_ROUTE or + * RECORD_ROUTE object MUST be that vendor's SMI enterprise + * code in network octet order. + */ + { + guint8 private_so_len = tvb_get_guint8(tvb, offset+l+1); + k = tvb_get_guint8(tvb, offset+l) & 0x80; + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset+l, + tvb_get_guint8(tvb, offset+l+1), + "Private Subobject: %d", j); + rsvp_ro_subtree = + proto_item_add_subtree(ti2, tree_type); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, + k ? "Loose Hop " : "Strict Hop"); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, + "Type: %u (Private)", j); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, + "Length: %u", + private_so_len); - proto_tree_add_item(rsvp_ro_subtree, - hf_rsvp_filter[RSVPF_ENT_CODE], - tvb, offset+l+4, 4, ENC_BIG_ENDIAN); - if (private_so_len > 8) { - /* some private data */ - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+8, - private_so_len - 8, - "Data (%d bytes)", - private_so_len - 8); - } - } - break; + proto_tree_add_item(rsvp_ro_subtree, + hf_rsvp_filter[RSVPF_ENT_CODE], + tvb, offset+l+4, 4, ENC_BIG_ENDIAN); + if (private_so_len > 8) { + /* some private data */ + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+8, + private_so_len - 8, + "Data (%d bytes)", + private_so_len - 8); + } + } + break; - default: /* Unknown subobject */ - defaultsub: - k = tvb_get_guint8(tvb, offset+l) & 0x80; - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset+l, - tvb_get_guint8(tvb, offset+l+1), - "Unknown subobject: %d", j); - rsvp_ro_subtree = - proto_item_add_subtree(ti2, tree_type); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, - k ? "Loose Hop " : "Strict Hop"); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, - "Type: %u (Unknown)", j); - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, - "Length: %u", - tvb_get_guint8(tvb, offset+l+1)); + default: /* Unknown subobject */ + defaultsub: + k = tvb_get_guint8(tvb, offset+l) & 0x80; + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset+l, + tvb_get_guint8(tvb, offset+l+1), + "Unknown subobject: %d", j); + rsvp_ro_subtree = + proto_item_add_subtree(ti2, tree_type); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, + k ? "Loose Hop " : "Strict Hop"); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1, + "Type: %u (Unknown)", j); + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, + "Length: %u", + tvb_get_guint8(tvb, offset+l+1)); + break; + } - } - - if (tvb_get_guint8(tvb, offset+l+1) < 1) { - proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, - "Invalid length: %u", tvb_get_guint8(tvb, offset+l+1)); - return; - } - l += tvb_get_guint8(tvb, offset+l+1); - if (l < obj_length - 4) { - if (i < 4) - proto_item_append_text(ti, ", "); - else if (i==4) - proto_item_append_text(ti, "..."); - } + if (tvb_get_guint8(tvb, offset+l+1) < 1) { + proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1, + "Invalid length: %u", tvb_get_guint8(tvb, offset+l+1)); + return; + } + l += tvb_get_guint8(tvb, offset+l+1); + if (l < obj_length - 4) { + if (i < 4) + proto_item_append_text(ti, ", "); + else if (i==4) + proto_item_append_text(ti, "..."); + } } } @@ -4570,28 +4599,28 @@ dissect_rsvp_ero_rro_subobjects (proto_tree *ti, proto_tree *rsvp_object_tree, * EXPLICIT ROUTE OBJECT *------------------------------------------------------------------------------*/ static void -dissect_rsvp_explicit_route (proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class, int type) +dissect_rsvp_explicit_route(proto_item *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class, int type) { switch(type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1"); - proto_item_set_text(ti, "EXPLICIT ROUTE: "); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1"); + proto_item_set_text(ti, "EXPLICIT ROUTE: "); - dissect_rsvp_ero_rro_subobjects(ti, rsvp_object_tree, tvb, - offset + 4, obj_length, rsvp_class); - break; + dissect_rsvp_ero_rro_subobjects(ti, rsvp_object_tree, tvb, + offset + 4, obj_length, rsvp_class); + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -4599,28 +4628,28 @@ dissect_rsvp_explicit_route (proto_item *ti, proto_tree *rsvp_object_tree, * RECORD ROUTE OBJECT *------------------------------------------------------------------------------*/ static void -dissect_rsvp_record_route (proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class, int type) +dissect_rsvp_record_route(proto_item *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class, int type) { proto_item_set_text(ti, "RECORD ROUTE: "); switch(type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1"); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1"); - dissect_rsvp_ero_rro_subobjects(ti, rsvp_object_tree, tvb, - offset + 4, obj_length, rsvp_class); - break; + dissect_rsvp_ero_rro_subobjects(ti, rsvp_object_tree, tvb, + offset + 4, obj_length, rsvp_class); + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -4628,35 +4657,35 @@ dissect_rsvp_record_route (proto_item *ti, proto_tree *rsvp_object_tree, * MESSAGE ID *------------------------------------------------------------------------------*/ static void -dissect_rsvp_message_id (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_message_id(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { int offset2 = offset + 4; switch(type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1"); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1, - "Flags: %d", tvb_get_guint8(tvb, offset+4)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3, - "Epoch: %d", tvb_get_ntoh24(tvb, offset+5)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, - "Message-ID: %d", tvb_get_ntohl(tvb, offset+8)); - proto_item_set_text(ti, "MESSAGE-ID: %d %s", - tvb_get_ntohl(tvb, offset+8), - tvb_get_guint8(tvb, offset+4) & 1 ? "(Ack Desired)" : ""); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1"); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1, + "Flags: %d", tvb_get_guint8(tvb, offset+4)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3, + "Epoch: %d", tvb_get_ntoh24(tvb, offset+5)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, + "Message-ID: %d", tvb_get_ntohl(tvb, offset+8)); + proto_item_set_text(ti, "MESSAGE-ID: %d %s", + tvb_get_ntohl(tvb, offset+8), + tvb_get_guint8(tvb, offset+4) & 1 ? "(Ack Desired)" : ""); + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -4664,45 +4693,45 @@ dissect_rsvp_message_id (proto_tree *ti, proto_tree *rsvp_object_tree, * MESSAGE ID ACK *------------------------------------------------------------------------------*/ static void -dissect_rsvp_message_id_ack (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_message_id_ack(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { int offset2 = offset + 4; switch(type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1"); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1, - "Flags: %d", tvb_get_guint8(tvb, offset+4)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3, - "Epoch: %d", tvb_get_ntoh24(tvb, offset+5)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, - "Message-ID: %d", tvb_get_ntohl(tvb, offset+8)); - proto_item_set_text(ti, "MESSAGE-ID ACK: %d", tvb_get_ntohl(tvb, offset+8)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1"); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1, + "Flags: %d", tvb_get_guint8(tvb, offset+4)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3, + "Epoch: %d", tvb_get_ntoh24(tvb, offset+5)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, + "Message-ID: %d", tvb_get_ntohl(tvb, offset+8)); + proto_item_set_text(ti, "MESSAGE-ID ACK: %d", tvb_get_ntohl(tvb, offset+8)); + break; case 2: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 2"); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1, - "Flags: %d", tvb_get_guint8(tvb, offset+4)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3, - "Epoch: %d", tvb_get_ntoh24(tvb, offset+5)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, - "Message-ID: %d", tvb_get_ntohl(tvb, offset+8)); - proto_item_set_text(ti, "MESSAGE-ID NACK: %d", tvb_get_ntohl(tvb, offset+8)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 2"); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1, + "Flags: %d", tvb_get_guint8(tvb, offset+4)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3, + "Epoch: %d", tvb_get_ntoh24(tvb, offset+5)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, + "Message-ID: %d", tvb_get_ntohl(tvb, offset+8)); + proto_item_set_text(ti, "MESSAGE-ID NACK: %d", tvb_get_ntohl(tvb, offset+8)); + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -4710,37 +4739,37 @@ dissect_rsvp_message_id_ack (proto_tree *ti, proto_tree *rsvp_object_tree, * MESSAGE ID LIST *------------------------------------------------------------------------------*/ static void -dissect_rsvp_message_id_list (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_message_id_list(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { int offset2 = offset + 4; int mylen; switch(type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1"); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1, - "Flags: %d", tvb_get_guint8(tvb, offset+4)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3, - "Epoch: %d", tvb_get_ntoh24(tvb, offset+5)); - for (mylen = 8; mylen < obj_length; mylen += 4) - proto_tree_add_text(rsvp_object_tree, tvb, offset+mylen, 4, - "Message-ID: %d", tvb_get_ntohl(tvb, offset+mylen)); - proto_item_set_text(ti, "MESSAGE-ID LIST: %d IDs", - (obj_length - 8)/4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1"); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1, + "Flags: %d", tvb_get_guint8(tvb, offset+4)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3, + "Epoch: %d", tvb_get_ntoh24(tvb, offset+5)); + for (mylen = 8; mylen < obj_length; mylen += 4) + proto_tree_add_text(rsvp_object_tree, tvb, offset+mylen, 4, + "Message-ID: %d", tvb_get_ntohl(tvb, offset+mylen)); + proto_item_set_text(ti, "MESSAGE-ID LIST: %d IDs", + (obj_length - 8)/4); + break; default: - mylen = obj_length - 4; - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + mylen = obj_length - 4; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -4748,31 +4777,31 @@ dissect_rsvp_message_id_list (proto_tree *ti, proto_tree *rsvp_object_tree, * HELLO *------------------------------------------------------------------------------*/ static void -dissect_rsvp_hello (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length _U_, - int rsvp_class _U_, int type) +dissect_rsvp_hello(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length _U_, + int rsvp_class _U_, int type) { switch(type) { case 1: case 2: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-Type: %d - HELLO %s object", - tvb_get_guint8 (tvb, offset+3), - type==1 ? "REQUEST" : "ACK"); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4, - "Source Instance: 0x%x",tvb_get_ntohl(tvb, offset+4)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, - "Destination Instance: 0x%x",tvb_get_ntohl(tvb, offset+8)); - proto_item_append_text(ti, ": %s. Src Instance: 0x%0x. Dest Instance: 0x%0x. ", - type==1 ? "REQUEST" : "ACK", - tvb_get_ntohl(tvb, offset+4), - tvb_get_ntohl(tvb, offset+8)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-Type: %d - HELLO %s object", + tvb_get_guint8 (tvb, offset+3), + type==1 ? "REQUEST" : "ACK"); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4, + "Source Instance: 0x%x",tvb_get_ntohl(tvb, offset+4)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, + "Destination Instance: 0x%x",tvb_get_ntohl(tvb, offset+8)); + proto_item_append_text(ti, ": %s. Src Instance: 0x%0x. Dest Instance: 0x%0x. ", + type==1 ? "REQUEST" : "ACK", + tvb_get_ntohl(tvb, offset+4), + tvb_get_ntohl(tvb, offset+8)); + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-Type: %d - UNKNOWN", type); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-Type: %d - UNKNOWN", type); + break; }; } @@ -4780,10 +4809,10 @@ dissect_rsvp_hello (proto_tree *ti, proto_tree *rsvp_object_tree, * DCLASS *------------------------------------------------------------------------------*/ static void -dissect_rsvp_dclass (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_dclass(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { int offset2 = offset + 4; int mylen; @@ -4791,29 +4820,29 @@ dissect_rsvp_dclass (proto_tree *ti, proto_tree *rsvp_object_tree, proto_item_set_text(ti, "DCLASS: "); switch(type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1"); - for (mylen = 4; mylen < obj_length; mylen += 4) { - proto_tree_add_text(rsvp_object_tree, tvb, offset+mylen+3, 1, - "DSCP: %s", - val_to_str(tvb_get_guint8(tvb, offset+mylen+3), - dscp_vals, "Unknown (%d)")); - proto_item_append_text(ti, "%d%s", - tvb_get_guint8(tvb, offset+mylen+3)>>2, - mylen==obj_length-4 ? "": - mylen<16 ? ", ": - mylen==16 ? ", ..." : ""); - } - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1"); + for (mylen = 4; mylen < obj_length; mylen += 4) { + proto_tree_add_text(rsvp_object_tree, tvb, offset+mylen+3, 1, + "DSCP: %s", + val_to_str_ext(tvb_get_guint8(tvb, offset+mylen+3), + &dscp_vals_ext, "Unknown (%d)")); + proto_item_append_text(ti, "%d%s", + tvb_get_guint8(tvb, offset+mylen+3)>>2, + mylen==obj_length-4 ? "": + mylen<16 ? ", ": + mylen==16 ? ", ..." : ""); + } + break; default: - mylen = obj_length - 4; - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen, - "Data (%d bytes)", mylen); - break; + mylen = obj_length - 4; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen, + "Data (%d bytes)", mylen); + break; } } @@ -4821,68 +4850,68 @@ dissect_rsvp_dclass (proto_tree *ti, proto_tree *rsvp_object_tree, * ADMINISTRATIVE STATUS *------------------------------------------------------------------------------*/ static void -dissect_rsvp_admin_status (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_admin_status(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { - int offset2 = offset + 4; + int offset2 = offset + 4; proto_tree *ti2, *rsvp_admin_subtree; - guint32 status; + guint32 status; proto_item_set_text(ti, "ADMIN STATUS: "); switch(type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1"); - status = tvb_get_ntohl(tvb, offset2); - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, - "Admin Status: 0x%08x", status); - rsvp_admin_subtree = - proto_item_add_subtree(ti2, TREE(TT_ADMIN_STATUS_FLAGS)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1"); + status = tvb_get_ntohl(tvb, offset2); + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, + "Admin Status: 0x%08x", status); + rsvp_admin_subtree = + proto_item_add_subtree(ti2, TREE(TT_ADMIN_STATUS_FLAGS)); - proto_tree_add_boolean(rsvp_admin_subtree, - hf_rsvp_filter[RSVPF_ADMIN_STATUS_REFLECT], - tvb, offset2, 4, status); - proto_tree_add_boolean(rsvp_admin_subtree, - hf_rsvp_filter[RSVPF_ADMIN_STATUS_HANDOVER], - tvb, offset2, 4, status); - proto_tree_add_boolean(rsvp_admin_subtree, - hf_rsvp_filter[RSVPF_ADMIN_STATUS_LOCKOUT], - tvb, offset2, 4, status); - proto_tree_add_boolean(rsvp_admin_subtree, - hf_rsvp_filter[RSVPF_ADMIN_STATUS_INHIBIT], - tvb, offset2, 4, status); - proto_tree_add_boolean(rsvp_admin_subtree, - hf_rsvp_filter[RSVPF_ADMIN_STATUS_CALL_MGMT], - tvb, offset2, 4, status); - proto_tree_add_boolean(rsvp_admin_subtree, - hf_rsvp_filter[RSVPF_ADMIN_STATUS_TESTING], - tvb, offset2, 4, status); - proto_tree_add_boolean(rsvp_admin_subtree, - hf_rsvp_filter[RSVPF_ADMIN_STATUS_DOWN], - tvb, offset2, 4, status); - proto_tree_add_boolean(rsvp_admin_subtree, - hf_rsvp_filter[RSVPF_ADMIN_STATUS_DELETE], - tvb, offset2, 4, status); - proto_item_set_text(ti, "ADMIN-STATUS: %s%s%s%s%s%s%s%s", - (status & (1<<31)) ? "Reflect " : "", - (status & (1<<6)) ? "Handover " : "", - (status & (1<<5)) ? "Lockout " : "", - (status & (1<<4)) ? "Inhibit " : "", - (status & (1<<3)) ? "Call " : "", - (status & (1<<2)) ? "Testing " : "", - (status & (1<<1)) ? "Admin-Down " : "", - (status & (1<<0)) ? "Deleting " : ""); - break; + proto_tree_add_boolean(rsvp_admin_subtree, + hf_rsvp_filter[RSVPF_ADMIN_STATUS_REFLECT], + tvb, offset2, 4, status); + proto_tree_add_boolean(rsvp_admin_subtree, + hf_rsvp_filter[RSVPF_ADMIN_STATUS_HANDOVER], + tvb, offset2, 4, status); + proto_tree_add_boolean(rsvp_admin_subtree, + hf_rsvp_filter[RSVPF_ADMIN_STATUS_LOCKOUT], + tvb, offset2, 4, status); + proto_tree_add_boolean(rsvp_admin_subtree, + hf_rsvp_filter[RSVPF_ADMIN_STATUS_INHIBIT], + tvb, offset2, 4, status); + proto_tree_add_boolean(rsvp_admin_subtree, + hf_rsvp_filter[RSVPF_ADMIN_STATUS_CALL_MGMT], + tvb, offset2, 4, status); + proto_tree_add_boolean(rsvp_admin_subtree, + hf_rsvp_filter[RSVPF_ADMIN_STATUS_TESTING], + tvb, offset2, 4, status); + proto_tree_add_boolean(rsvp_admin_subtree, + hf_rsvp_filter[RSVPF_ADMIN_STATUS_DOWN], + tvb, offset2, 4, status); + proto_tree_add_boolean(rsvp_admin_subtree, + hf_rsvp_filter[RSVPF_ADMIN_STATUS_DELETE], + tvb, offset2, 4, status); + proto_item_set_text(ti, "ADMIN-STATUS: %s%s%s%s%s%s%s%s", + (status & (1<<31)) ? "Reflect " : "", + (status & (1<<6)) ? "Handover " : "", + (status & (1<<5)) ? "Lockout " : "", + (status & (1<<4)) ? "Inhibit " : "", + (status & (1<<3)) ? "Call " : "", + (status & (1<<2)) ? "Testing " : "", + (status & (1<<1)) ? "Admin-Down " : "", + (status & (1<<0)) ? "Deleting " : ""); + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -4890,13 +4919,13 @@ dissect_rsvp_admin_status (proto_tree *ti, proto_tree *rsvp_object_tree, * LSP ATTRIBUTES *------------------------------------------------------------------------------*/ static void -dissect_rsvp_lsp_attributes (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_lsp_attributes(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, int offset, int obj_length, + int rsvp_class _U_, int type) { - int tlv_off; - guint32 attributes; - guint16 tlv_type, tlv_len; + int tlv_off; + guint32 attributes; + guint16 tlv_type, tlv_len; proto_tree *ti2, *rsvp_lsp_attr_subtree; if (rsvp_class == RSVP_CLASS_LSP_REQUIRED_ATTRIBUTES) @@ -4906,13 +4935,13 @@ dissect_rsvp_lsp_attributes (proto_tree *ti, proto_tree *rsvp_object_tree, switch(type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1"); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1"); for (tlv_off = 4; tlv_off < obj_length-4; ) { tlv_type = tvb_get_ntohs(tvb, offset+tlv_off); tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2); - if (tlv_len == 0 || tlv_off+tlv_len > obj_length-4) { + if ((tlv_len == 0) || (tlv_off+tlv_len > (obj_length-4))) { proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off+2, 2, "Invalid length"); return; @@ -4941,7 +4970,7 @@ dissect_rsvp_lsp_attributes (proto_tree *ti, proto_tree *rsvp_object_tree, (attributes & 0x04) ? " Segment-based re-routing" : ""); break; - default: + default: proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, "Unknown TLV"); break; @@ -4951,12 +4980,12 @@ dissect_rsvp_lsp_attributes (proto_tree *ti, proto_tree *rsvp_object_tree, break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -4964,13 +4993,14 @@ dissect_rsvp_lsp_attributes (proto_tree *ti, proto_tree *rsvp_object_tree, * ASSOCIATION *------------------------------------------------------------------------------*/ static void -dissect_rsvp_association (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_association(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { guint16 association_type; guint16 association_id; + static const value_string association_type_vals[] = { { 0, "Reserved"}, { 1, "Recovery"}, @@ -4979,73 +5009,74 @@ dissect_rsvp_association (proto_tree *ti, proto_tree *rsvp_object_tree, { 4, "Inter-domain Recovery"}, { 0, NULL} }; + static value_string_ext association_type_vals_ext = VALUE_STRING_EXT_INIT(association_type_vals); proto_item_set_text(ti, "ASSOCIATION "); association_type = tvb_get_ntohs (tvb, offset + 4); association_id = tvb_get_ntohs (tvb, offset + 6); switch(type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1 (IPv4)"); - proto_item_append_text(ti, "(IPv4): "); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 2, - "Association type: %s", - val_to_str(association_type, association_type_vals, "Unknown (%u)")); - proto_item_append_text(ti, "%s. ", - val_to_str(association_type, association_type_vals, "Unknown (%u)")); - proto_tree_add_text(rsvp_object_tree, tvb, offset+6, 2, - "Association ID: %u", association_id); - proto_item_append_text(ti, "ID: %u. ", association_id); - proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, - "Association source: %s", tvb_ip_to_str(tvb, offset+8)); - proto_item_append_text(ti, "Src: %s", tvb_ip_to_str(tvb, offset+8)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1 (IPv4)"); + proto_item_append_text(ti, "(IPv4): "); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 2, + "Association type: %s", + val_to_str_ext(association_type, &association_type_vals_ext, "Unknown (%u)")); + proto_item_append_text(ti, "%s. ", + val_to_str_ext(association_type, &association_type_vals_ext, "Unknown (%u)")); + proto_tree_add_text(rsvp_object_tree, tvb, offset+6, 2, + "Association ID: %u", association_id); + proto_item_append_text(ti, "ID: %u. ", association_id); + proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, + "Association source: %s", tvb_ip_to_str(tvb, offset+8)); + proto_item_append_text(ti, "Src: %s", tvb_ip_to_str(tvb, offset+8)); + break; case 2: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 2 (IPv6)"); - proto_item_append_text(ti, "(IPv6): "); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 2, - "Association type: %s", - val_to_str(association_type, association_type_vals, "Unknown (%u)")); - proto_item_append_text(ti, "%s. ", - val_to_str(association_type, association_type_vals, "Unknown (%u)")); - proto_tree_add_text(rsvp_object_tree, tvb, offset+6, 2, - "Association ID: %u", association_id); - proto_item_append_text(ti, "ID: %u. ", association_id); - proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 16, - "Association source: %s", tvb_ip6_to_str(tvb, offset+8)); - proto_item_append_text(ti, "Src: %s", tvb_ip6_to_str(tvb, offset+8)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 2 (IPv6)"); + proto_item_append_text(ti, "(IPv6): "); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 2, + "Association type: %s", + val_to_str_ext(association_type, &association_type_vals_ext, "Unknown (%u)")); + proto_item_append_text(ti, "%s. ", + val_to_str_ext(association_type, &association_type_vals_ext, "Unknown (%u)")); + proto_tree_add_text(rsvp_object_tree, tvb, offset+6, 2, + "Association ID: %u", association_id); + proto_item_append_text(ti, "ID: %u. ", association_id); + proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 16, + "Association source: %s", tvb_ip6_to_str(tvb, offset+8)); + proto_item_append_text(ti, "Src: %s", tvb_ip6_to_str(tvb, offset+8)); + break; case 4: /* oif2008.389 */ - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 4 (Routing Area)"); - proto_item_append_text(ti, "(Routing Area): "); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 2, - "Association type: %s", - val_to_str(association_type, association_type_vals, "Unknown (%u)")); - proto_item_append_text(ti, "%s. ", - val_to_str(association_type, association_type_vals, "Unknown (%u)")); - proto_tree_add_text(rsvp_object_tree, tvb, offset+6, 2, - "Association ID: %u", association_id); - proto_item_append_text(ti, "Association ID: %u, ", association_id); - proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, - "Routing Area ID: %u", tvb_get_ntohl (tvb, offset+8)); - proto_item_append_text(ti, "Routing Area ID: %u, ", tvb_get_ntohl (tvb, offset+8)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+12, 4, - "Node ID: %s", tvb_ip_to_str(tvb, offset+12)); - proto_item_append_text(ti, "Node ID: %s", tvb_ip_to_str(tvb, offset+12)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 16, - "Padding: %s", tvb_bytes_to_str_punct(tvb, offset+16, 8, ' ')); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 4 (Routing Area)"); + proto_item_append_text(ti, "(Routing Area): "); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 2, + "Association type: %s", + val_to_str_ext(association_type, &association_type_vals_ext, "Unknown (%u)")); + proto_item_append_text(ti, "%s. ", + val_to_str_ext(association_type, &association_type_vals_ext, "Unknown (%u)")); + proto_tree_add_text(rsvp_object_tree, tvb, offset+6, 2, + "Association ID: %u", association_id); + proto_item_append_text(ti, "Association ID: %u, ", association_id); + proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, + "Routing Area ID: %u", tvb_get_ntohl (tvb, offset+8)); + proto_item_append_text(ti, "Routing Area ID: %u, ", tvb_get_ntohl (tvb, offset+8)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+12, 4, + "Node ID: %s", tvb_ip_to_str(tvb, offset+12)); + proto_item_append_text(ti, "Node ID: %s", tvb_ip_to_str(tvb, offset+12)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 16, + "Padding: %s", tvb_bytes_to_str_punct(tvb, offset+16, 8, ' ')); + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", type); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", type); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } /*------------------------------------------------------------------------------ @@ -5054,8 +5085,8 @@ dissect_rsvp_association (proto_tree *ti, proto_tree *rsvp_object_tree, *------------------------------------------------------------------------------*/ static void dissect_rsvp_lsp_tunnel_if_id_tlv(proto_tree *rsvp_object_tree, - tvbuff_t *tvb, int offset, int tlv_length, - int subtree_type) + tvbuff_t *tvb, int offset, int tlv_length, + int subtree_type) { int tlv_off; guint16 tlv_type; @@ -5063,90 +5094,91 @@ dissect_rsvp_lsp_tunnel_if_id_tlv(proto_tree *rsvp_object_tree, proto_tree *ti, *rsvp_lsp_tunnel_if_id_subtree; for (tlv_off = 0; tlv_off < tlv_length; ) { - tlv_type = tvb_get_ntohs(tvb, offset+tlv_off); - tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2); + tlv_type = tvb_get_ntohs(tvb, offset+tlv_off); + tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2); - if (tlv_len == 0 || tlv_off+tlv_len > tlv_length) { - proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off+2, 2, - "Invalid length"); - return; - } - switch(tlv_type) { - case 1: - ti = proto_tree_add_text(rsvp_object_tree, tvb, - offset+tlv_off, tlv_len, - "Unnumbered component link identifier: %u", - tvb_get_ntohl(tvb, offset+tlv_off+4)); - rsvp_lsp_tunnel_if_id_subtree = proto_item_add_subtree(ti, subtree_type); - proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off, 2, - "Type: 1 (Unnumbered component link identifier)"); - proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+2, 2, - "Length: %u", tlv_len); - proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+4, 4, - "Component link identifier: %u", - tvb_get_ntohl(tvb, offset+tlv_off+4)); - break; + if ((tlv_len == 0) || ((tlv_off+tlv_len) > tlv_length)) { + proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off+2, 2, + "Invalid length"); + return; + } + switch(tlv_type) { + case 1: + ti = proto_tree_add_text(rsvp_object_tree, tvb, + offset+tlv_off, tlv_len, + "Unnumbered component link identifier: %u", + tvb_get_ntohl(tvb, offset+tlv_off+4)); + rsvp_lsp_tunnel_if_id_subtree = proto_item_add_subtree(ti, subtree_type); + proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off, 2, + "Type: 1 (Unnumbered component link identifier)"); + proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+2, 2, + "Length: %u", tlv_len); + proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+4, 4, + "Component link identifier: %u", + tvb_get_ntohl(tvb, offset+tlv_off+4)); + break; - case 2: - ti = proto_tree_add_text(rsvp_object_tree, tvb, - offset+tlv_off, tlv_len, - "IPv4 component link identifier: %s", - tvb_ip_to_str(tvb, offset+tlv_off+4)); - rsvp_lsp_tunnel_if_id_subtree = proto_item_add_subtree(ti, subtree_type); - proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off, 2, - "Type: 2 (IPv4 component link identifier)"); - proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+2, 2, - "Length: %u", tlv_len); - proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+4, 4, - "Component link identifier: %s", - tvb_ip_to_str(tvb, offset+tlv_off+4)); - break; + case 2: + ti = proto_tree_add_text(rsvp_object_tree, tvb, + offset+tlv_off, tlv_len, + "IPv4 component link identifier: %s", + tvb_ip_to_str(tvb, offset+tlv_off+4)); + rsvp_lsp_tunnel_if_id_subtree = proto_item_add_subtree(ti, subtree_type); + proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off, 2, + "Type: 2 (IPv4 component link identifier)"); + proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+2, 2, + "Length: %u", tlv_len); + proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+4, 4, + "Component link identifier: %s", + tvb_ip_to_str(tvb, offset+tlv_off+4)); + break; - case 32769: /* oif-p0040.002.09 demo spec */ - ti = proto_tree_add_text(rsvp_object_tree, tvb, - offset+tlv_off, tlv_len, - "Targeted client layer: "); - rsvp_lsp_tunnel_if_id_subtree = proto_item_add_subtree(ti, subtree_type); - proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off, 2, - "Type: 32769 (Targeted client layer)"); - proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+2, 2, - "Length: %u", tlv_len); - proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+4, 1, - "LSP Encoding Type: %s", - rval_to_str(tvb_get_guint8(tvb,offset+tlv_off+4), - gmpls_lsp_enc_rvals, "Unknown (%d)")); - proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+5, 1, - "Switching Type: %s", - rval_to_str(tvb_get_guint8(tvb,offset+tlv_off+5), - gmpls_switching_type_rvals, "Unknown (%d)")); - proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+6, 1, - "Signal Type: %s", - val_to_str(tvb_get_guint8(tvb,offset+tlv_off+6), - gmpls_sonet_signal_type_str, "Unknown (%d)")); - proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+8, 8, - "Sub Interface/Connection ID: %" G_GINT64_MODIFIER "u (0x%s)", - tvb_get_ntoh64(tvb, offset+tlv_off+8), - tvb_bytes_to_str(tvb, offset+tlv_off+8, 8)); - proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+16, 4, - "SC PC ID: %s", - tvb_ip_to_str(tvb, offset+tlv_off+16)); - proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+20, 4, - "SC PC SCN Address: %s", - tvb_ip_to_str(tvb, offset+tlv_off+20)); - proto_item_append_text(ti, "LSP Encoding=%s, Switching Type=%s, Signal Type=%s", - rval_to_str(tvb_get_guint8(tvb,offset+tlv_off+4), - gmpls_lsp_enc_rvals, "Unknown (%d)"), - rval_to_str(tvb_get_guint8(tvb,offset+tlv_off+5), - gmpls_switching_type_rvals, "Unknown (%d)"), - val_to_str(tvb_get_guint8(tvb,offset+tlv_off+6), - gmpls_sonet_signal_type_str, "Unknown (%d)")); - break; + case 32769: /* oif-p0040.002.09 demo spec */ + ti = proto_tree_add_text(rsvp_object_tree, tvb, + offset+tlv_off, tlv_len, + "Targeted client layer: "); + rsvp_lsp_tunnel_if_id_subtree = proto_item_add_subtree(ti, subtree_type); + proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off, 2, + "Type: 32769 (Targeted client layer)"); + proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+2, 2, + "Length: %u", tlv_len); + proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+4, 1, + "LSP Encoding Type: %s", + rval_to_str(tvb_get_guint8(tvb,offset+tlv_off+4), + gmpls_lsp_enc_rvals, "Unknown (%d)")); + proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+5, 1, + "Switching Type: %s", + rval_to_str(tvb_get_guint8(tvb,offset+tlv_off+5), + gmpls_switching_type_rvals, "Unknown (%d)")); + proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+6, 1, + "Signal Type: %s", + val_to_str_ext(tvb_get_guint8(tvb,offset+tlv_off+6), + &gmpls_sonet_signal_type_str_ext, "Unknown (%d)")); + proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+8, 8, + "Sub Interface/Connection ID: %" G_GINT64_MODIFIER "u (0x%s)", + tvb_get_ntoh64(tvb, offset+tlv_off+8), + tvb_bytes_to_str(tvb, offset+tlv_off+8, 8)); + proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+16, 4, + "SC PC ID: %s", + tvb_ip_to_str(tvb, offset+tlv_off+16)); + proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+20, 4, + "SC PC SCN Address: %s", + tvb_ip_to_str(tvb, offset+tlv_off+20)); + proto_item_append_text(ti, "LSP Encoding=%s, Switching Type=%s, Signal Type=%s", + rval_to_str(tvb_get_guint8(tvb,offset+tlv_off+4), + gmpls_lsp_enc_rvals, "Unknown (%d)"), + rval_to_str(tvb_get_guint8(tvb,offset+tlv_off+5), + gmpls_switching_type_rvals, "Unknown (%d)"), + val_to_str_ext(tvb_get_guint8(tvb,offset+tlv_off+6), + &gmpls_sonet_signal_type_str_ext, "Unknown (%d)")); + break; - default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off, 2, - "Unknown TLV: %u", tlv_type); - } - tlv_off += tlv_len; + default: + proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off, 2, + "Unknown TLV: %u", tlv_type); + break; + } + tlv_off += tlv_len; } } @@ -5154,10 +5186,10 @@ dissect_rsvp_lsp_tunnel_if_id_tlv(proto_tree *rsvp_object_tree, * LSP TUNNEL INTERFACE ID *------------------------------------------------------------------------------*/ static void -dissect_rsvp_lsp_tunnel_if_id (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_lsp_tunnel_if_id(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { guint8 action; @@ -5172,94 +5204,94 @@ dissect_rsvp_lsp_tunnel_if_id (proto_tree *ti, proto_tree *rsvp_object_tree, proto_item_set_text(ti, "LSP INTERFACE-ID: "); switch(type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1 - Unnumbered interface"); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4, - "Router ID: %s", - tvb_ip_to_str(tvb, offset+4)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, - "Interface ID: %u", tvb_get_ntohl(tvb, offset+8)); - proto_item_set_text(ti, "LSP INTERFACE-ID: Unnumbered, Router-ID %s, Interface-ID %d", - tvb_ip_to_str(tvb, offset+4), - tvb_get_ntohl(tvb, offset+8)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1 - Unnumbered interface"); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4, + "Router ID: %s", + tvb_ip_to_str(tvb, offset+4)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, + "Interface ID: %u", tvb_get_ntohl(tvb, offset+8)); + proto_item_set_text(ti, "LSP INTERFACE-ID: Unnumbered, Router-ID %s, Interface-ID %d", + tvb_ip_to_str(tvb, offset+4), + tvb_get_ntohl(tvb, offset+8)); + break; case 2: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 2 - IPv4"); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4, - "IPv4 interface address: %s", - tvb_ip_to_str(tvb, offset+4)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, - "Target IGP instance: %s", - tvb_ip_to_str(tvb, offset+8)); - proto_item_set_text(ti, "LSP INTERFACE-ID: IPv4, interface address %s," - "IGP instance %s", - tvb_ip_to_str(tvb, offset+4), - tvb_ip_to_str(tvb, offset+8)); - action = tvb_get_guint8(tvb, offset+12); - action >>= 4; - proto_tree_add_text(rsvp_object_tree, tvb, offset+12, 1, "Action: %d - %s", - action, - val_to_str(action, lsp_tunnel_if_id_action_str, "Unknown")); - dissect_rsvp_lsp_tunnel_if_id_tlv(rsvp_object_tree, tvb, offset+16, obj_length-16, - TREE(TT_LSP_TUNNEL_IF_ID_SUBTREE)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 2 - IPv4"); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4, + "IPv4 interface address: %s", + tvb_ip_to_str(tvb, offset+4)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, + "Target IGP instance: %s", + tvb_ip_to_str(tvb, offset+8)); + proto_item_set_text(ti, "LSP INTERFACE-ID: IPv4, interface address %s," + "IGP instance %s", + tvb_ip_to_str(tvb, offset+4), + tvb_ip_to_str(tvb, offset+8)); + action = tvb_get_guint8(tvb, offset+12); + action >>= 4; + proto_tree_add_text(rsvp_object_tree, tvb, offset+12, 1, "Action: %d - %s", + action, + val_to_str_const(action, lsp_tunnel_if_id_action_str, "Unknown")); + dissect_rsvp_lsp_tunnel_if_id_tlv(rsvp_object_tree, tvb, offset+16, obj_length-16, + TREE(TT_LSP_TUNNEL_IF_ID_SUBTREE)); + break; case 3: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 3 - IPv6"); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 16, - "IPv6 interface address: %s", - tvb_ip6_to_str(tvb, offset+4)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+20, 4, - "Target IGP instance: %s", - tvb_ip_to_str(tvb, offset+20)); - proto_item_set_text(ti, "LSP INTERFACE-ID: IPv6, interface address %s," - "IGP instance %s", - tvb_ip6_to_str(tvb, offset+4), - tvb_ip_to_str(tvb, offset+20)); - action = tvb_get_guint8(tvb, offset+24); - action >>= 4; - proto_tree_add_text(rsvp_object_tree, tvb, offset+24, 1, "Action: %d - %s", - action, - val_to_str(action, lsp_tunnel_if_id_action_str, "Unknown")); - dissect_rsvp_lsp_tunnel_if_id_tlv(rsvp_object_tree, tvb, offset+28, obj_length-28, - TREE(TT_LSP_TUNNEL_IF_ID_SUBTREE)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 3 - IPv6"); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 16, + "IPv6 interface address: %s", + tvb_ip6_to_str(tvb, offset+4)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+20, 4, + "Target IGP instance: %s", + tvb_ip_to_str(tvb, offset+20)); + proto_item_set_text(ti, "LSP INTERFACE-ID: IPv6, interface address %s," + "IGP instance %s", + tvb_ip6_to_str(tvb, offset+4), + tvb_ip_to_str(tvb, offset+20)); + action = tvb_get_guint8(tvb, offset+24); + action >>= 4; + proto_tree_add_text(rsvp_object_tree, tvb, offset+24, 1, "Action: %d - %s", + action, + val_to_str_const(action, lsp_tunnel_if_id_action_str, "Unknown")); + dissect_rsvp_lsp_tunnel_if_id_tlv(rsvp_object_tree, tvb, offset+28, obj_length-28, + TREE(TT_LSP_TUNNEL_IF_ID_SUBTREE)); + break; case 4: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 4 - Unnumbered interface with target"); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4, - "Router ID: %s", - tvb_ip_to_str(tvb, offset+4)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, - "Interface ID: %u", tvb_get_ntohl(tvb, offset+8)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+12, 4, - "Target IGP instance: %s", - tvb_ip_to_str(tvb, offset+12)); - proto_item_set_text(ti, "LSP INTERFACE-ID: Unnumbered with target, Router-ID %s," - " Interface-ID %d, IGP instance %s", - tvb_ip_to_str(tvb, offset+4), - tvb_get_ntohl(tvb, offset+8), - tvb_ip_to_str(tvb, offset+12)); - action = tvb_get_guint8(tvb, offset+16); - action >>= 4; - proto_tree_add_text(rsvp_object_tree, tvb, offset+16, 1, "Action: %d - %s", - action, - val_to_str(action, lsp_tunnel_if_id_action_str, "Unknown")); - dissect_rsvp_lsp_tunnel_if_id_tlv(rsvp_object_tree, tvb, offset+20, obj_length-20, - TREE(TT_LSP_TUNNEL_IF_ID_SUBTREE)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 4 - Unnumbered interface with target"); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4, + "Router ID: %s", + tvb_ip_to_str(tvb, offset+4)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, + "Interface ID: %u", tvb_get_ntohl(tvb, offset+8)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+12, 4, + "Target IGP instance: %s", + tvb_ip_to_str(tvb, offset+12)); + proto_item_set_text(ti, "LSP INTERFACE-ID: Unnumbered with target, Router-ID %s," + " Interface-ID %d, IGP instance %s", + tvb_ip_to_str(tvb, offset+4), + tvb_get_ntohl(tvb, offset+8), + tvb_ip_to_str(tvb, offset+12)); + action = tvb_get_guint8(tvb, offset+16); + action >>= 4; + proto_tree_add_text(rsvp_object_tree, tvb, offset+16, 1, "Action: %d - %s", + action, + val_to_str_const(action, lsp_tunnel_if_id_action_str, "Unknown")); + dissect_rsvp_lsp_tunnel_if_id_tlv(rsvp_object_tree, tvb, offset+20, obj_length-20, + TREE(TT_LSP_TUNNEL_IF_ID_SUBTREE)); + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length-4, - "Data (%d bytes)", obj_length-4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length-4, + "Data (%d bytes)", obj_length-4); + break; } } @@ -5267,42 +5299,43 @@ dissect_rsvp_lsp_tunnel_if_id (proto_tree *ti, proto_tree *rsvp_object_tree, * NOTIFY REQUEST *------------------------------------------------------------------------------*/ static void -dissect_rsvp_notify_request (proto_item *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_notify_request(proto_item *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { int offset2 = offset + 4; switch(type) { case 1: { - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1 - IPv4"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, - "Notify node address: %s", - tvb_ip_to_str(tvb, offset2)); - proto_item_append_text(ti, ": Notify node: %s", - tvb_ip_to_str(tvb, offset2)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1 - IPv4"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, + "Notify node address: %s", + tvb_ip_to_str(tvb, offset2)); + proto_item_append_text(ti, ": Notify node: %s", + tvb_ip_to_str(tvb, offset2)); + break; } case 2: { - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 2 - IPv6"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16, - "Notify node address: %s", - tvb_ip6_to_str(tvb, offset2)); - proto_item_append_text(ti, ": Notify node: %s", - tvb_ip6_to_str(tvb, offset2)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 2 - IPv6"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16, + "Notify node address: %s", + tvb_ip6_to_str(tvb, offset2)); + proto_item_append_text(ti, ": Notify node: %s", + tvb_ip6_to_str(tvb, offset2)); + break; } default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -5310,311 +5343,311 @@ dissect_rsvp_notify_request (proto_item *ti, proto_tree *rsvp_object_tree, * GENERALIZED UNI *------------------------------------------------------------------------------*/ static void -dissect_rsvp_gen_uni (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type, - rsvp_conversation_info *rsvph) +dissect_rsvp_gen_uni(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type, + rsvp_conversation_info *rsvph) { - int offset2 = offset + 4; - int mylen, i, j, k, l, m; + int offset2 = offset + 4; + int mylen, i, j, k, l, m; proto_item *ti2; proto_tree *rsvp_gen_uni_subtree, *rsvp_session_subtree, *rsvp_template_subtree; - int s_len, s_class, s_type, sobj_len, nsap_len; - int offset3; + int s_len, s_class, s_type, sobj_len, nsap_len; + int offset3; proto_item_set_text(ti, "GENERALIZED UNI: "); mylen = obj_length - 4; switch(type) { case 1: { - const char *c; - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1"); - for (i=1, l = 0; l < mylen; i++) { - sobj_len = tvb_get_ntohs(tvb, offset2+l); - j = tvb_get_guint8(tvb, offset2+l+2); - switch(j) { - case 1: - case 2: /* We do source and destination TNA together */ - c = (j==1) ? "Source" : "Destination"; - k = tvb_get_guint8(tvb, offset2+l+3); - switch(k) { - case 1: - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset2+l, 8, - "%s IPv4 TNA: %s", c, - tvb_ip_to_str(tvb, offset2+l+4)); - rsvp_gen_uni_subtree = - proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ)); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1, - "Class: %d (%s)", j, c); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1, - "Type: 1 (IPv4)"); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2, - "Length: %u", sobj_len); - if (j==1) - proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_filter[RSVPF_GUNI_SRC_IPV4], - tvb, offset2+l+4, 4, ENC_BIG_ENDIAN); - else - proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_filter[RSVPF_GUNI_DST_IPV4], - tvb, offset2+l+4, 4, ENC_BIG_ENDIAN); - if (i < 4) { - proto_item_append_text(ti, "%s IPv4 TNA: %s", c, - tvb_ip_to_str(tvb, offset2+l+4)); - } - break; + const char *c; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1"); + for (i=1, l = 0; l < mylen; i++) { + sobj_len = tvb_get_ntohs(tvb, offset2+l); + j = tvb_get_guint8(tvb, offset2+l+2); + switch(j) { + case 1: + case 2: /* We do source and destination TNA together */ + c = (j==1) ? "Source" : "Destination"; + k = tvb_get_guint8(tvb, offset2+l+3); + switch(k) { + case 1: + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset2+l, 8, + "%s IPv4 TNA: %s", c, + tvb_ip_to_str(tvb, offset2+l+4)); + rsvp_gen_uni_subtree = + proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ)); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1, + "Class: %d (%s)", j, c); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1, + "Type: 1 (IPv4)"); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2, + "Length: %u", sobj_len); + if (j==1) + proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_filter[RSVPF_GUNI_SRC_IPV4], + tvb, offset2+l+4, 4, ENC_BIG_ENDIAN); + else + proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_filter[RSVPF_GUNI_DST_IPV4], + tvb, offset2+l+4, 4, ENC_BIG_ENDIAN); + if (i < 4) { + proto_item_append_text(ti, "%s IPv4 TNA: %s", c, + tvb_ip_to_str(tvb, offset2+l+4)); + } + break; - case 2: - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset2+l, 20, - "%s IPv6 TNA:", c); - rsvp_gen_uni_subtree = - proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ)); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1, - "Class: %d (%s)", j, c); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1, - "Type: 2 (IPv6)"); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2, - "Length: %u", sobj_len); - if (j==1) - proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_filter[RSVPF_GUNI_SRC_IPV6], - tvb, offset2+l+4, 16, ENC_NA); - else - proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_filter[RSVPF_GUNI_DST_IPV6], - tvb, offset2+l+4, 16, ENC_NA); - if (i < 4) { - proto_item_append_text(ti, "%s IPv6 TNA: %s", c, - tvb_ip6_to_str(tvb, offset2+l+4)); - } - break; + case 2: + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset2+l, 20, + "%s IPv6 TNA:", c); + rsvp_gen_uni_subtree = + proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ)); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1, + "Class: %d (%s)", j, c); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1, + "Type: 2 (IPv6)"); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2, + "Length: %u", sobj_len); + if (j==1) + proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_filter[RSVPF_GUNI_SRC_IPV6], + tvb, offset2+l+4, 16, ENC_NA); + else + proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_filter[RSVPF_GUNI_DST_IPV6], + tvb, offset2+l+4, 16, ENC_NA); + if (i < 4) { + proto_item_append_text(ti, "%s IPv6 TNA: %s", c, + tvb_ip6_to_str(tvb, offset2+l+4)); + } + break; - case 3: - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset2+l, tvb_get_ntohs(tvb, offset2+l), - "%s NSAP TNA: ", c); - rsvp_gen_uni_subtree = - proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ)); - nsap_len = tvb_get_guint8(tvb, offset2+l+4); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1, - "Class: %d (%s)", j, c); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1, - "Type: 3 (NSAP)"); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2, - "Length: %u", sobj_len); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1, - "NSAP Length: %u", nsap_len); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+5, - sobj_len-4, - "NSAP address: %s", - print_nsap_net(tvb_get_ptr(tvb, offset2+l+5, nsap_len), nsap_len)); - if (i < 4) { - proto_item_append_text(ti, "%s NSAP TNA: %s", c, - print_nsap_net(tvb_get_ptr(tvb, offset2+l+5, nsap_len), nsap_len)); - } - break; + case 3: + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset2+l, tvb_get_ntohs(tvb, offset2+l), + "%s NSAP TNA: ", c); + rsvp_gen_uni_subtree = + proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ)); + nsap_len = tvb_get_guint8(tvb, offset2+l+4); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1, + "Class: %d (%s)", j, c); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1, + "Type: 3 (NSAP)"); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2, + "Length: %u", sobj_len); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1, + "NSAP Length: %u", nsap_len); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+5, + sobj_len-4, + "NSAP address: %s", + print_nsap_net(tvb_get_ptr(tvb, offset2+l+5, nsap_len), nsap_len)); + if (i < 4) { + proto_item_append_text(ti, "%s NSAP TNA: %s", c, + print_nsap_net(tvb_get_ptr(tvb, offset2+l+5, nsap_len), nsap_len)); + } + break; - default: - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset2+l, tvb_get_ntohs(tvb, offset2+l), - "%s UNKNOWN TNA", c); - rsvp_gen_uni_subtree = - proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ)); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1, - "Class: %d (%s)", j, c); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1, - "Type: %d (UNKNOWN)", j); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2, - "Length: %u", sobj_len); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, - sobj_len-4, - "Data"); - if (i < 4) { - proto_item_append_text(ti, "%s UNKNOWN", c); - } - break; - } - break; + default: + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset2+l, tvb_get_ntohs(tvb, offset2+l), + "%s UNKNOWN TNA", c); + rsvp_gen_uni_subtree = + proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ)); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1, + "Class: %d (%s)", j, c); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1, + "Type: %d (UNKNOWN)", j); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2, + "Length: %u", sobj_len); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, + sobj_len-4, + "Data"); + if (i < 4) { + proto_item_append_text(ti, "%s UNKNOWN", c); + } + break; + } + break; - case 3: /* Diversity subobject */ - k = tvb_get_guint8(tvb, offset2+l+3); - switch(k) { - default: - case 1: - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset2+l, tvb_get_ntohs(tvb, offset2+l), - "Diversity Subobject"); - rsvp_gen_uni_subtree = - proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ)); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1, - "Class: %d (Diversity)", j); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1, - "Type: %d", tvb_get_guint8(tvb, offset2+l+3)); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2, - "Length: %u", sobj_len); - m = tvb_get_guint8(tvb, offset2+l+4) >> 4; - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1, - "Diversity: %d - %s", m, - val_to_str(m, ouni_guni_diversity_str, "Unknown")); - s_len = tvb_get_ntohs(tvb, offset2+l+8); - s_class = tvb_get_guint8(tvb, offset2+l+10); - s_type = tvb_get_guint8(tvb, offset2+l+11); - ti2 = proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+8, - s_len, "Session"); - rsvp_session_subtree = - proto_item_add_subtree(ti2, TREE(rsvp_class_to_tree_type(s_class))); - if (s_len < 4) { - proto_tree_add_text(rsvp_object_tree, tvb, offset2+l+8, 2, - "Length: %u (bogus, must be >= 4)", s_len); - break; - } - proto_tree_add_text(rsvp_session_subtree, tvb, offset2+l+8, 2, - "Length: %u", s_len); - proto_tree_add_uint(rsvp_session_subtree, hf_rsvp_filter[RSVPF_OBJECT], tvb, - offset2+8+l+10, 1, s_class); - dissect_rsvp_session(ti2, rsvp_session_subtree, tvb, offset2+l+8, - s_len, s_class, s_type, rsvph); - offset3 = offset2 + s_len; - s_len = tvb_get_ntohs(tvb, offset3+l+8); - s_class = tvb_get_guint8(tvb, offset3+l+10); - s_type = tvb_get_guint8(tvb, offset3+l+11); - ti2 = proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset3+l+8, - s_len, "Template"); - rsvp_template_subtree = - proto_item_add_subtree(ti2, TREE(rsvp_class_to_tree_type(s_class))); - if (s_len < 4) { - proto_tree_add_text(rsvp_object_tree, tvb, offset3+l+8, 2, - "Length: %u (bogus, must be >= 4)", s_len); - break; - } - proto_tree_add_text(rsvp_template_subtree, tvb, offset3+l+8, 2, - "Length: %u", s_len); - proto_tree_add_uint(rsvp_template_subtree, hf_rsvp_filter[RSVPF_OBJECT], tvb, - offset3+8+l+10, 1, s_class); - dissect_rsvp_template_filter(ti2, rsvp_template_subtree, tvb, offset3+l+8, - s_len, s_class, s_type, rsvph); + case 3: /* Diversity subobject */ + k = tvb_get_guint8(tvb, offset2+l+3); + switch(k) { + default: + case 1: + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset2+l, tvb_get_ntohs(tvb, offset2+l), + "Diversity Subobject"); + rsvp_gen_uni_subtree = + proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ)); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1, + "Class: %d (Diversity)", j); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1, + "Type: %d", tvb_get_guint8(tvb, offset2+l+3)); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2, + "Length: %u", sobj_len); + m = tvb_get_guint8(tvb, offset2+l+4) >> 4; + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1, + "Diversity: %d - %s", m, + val_to_str_const(m, ouni_guni_diversity_str, "Unknown")); + s_len = tvb_get_ntohs(tvb, offset2+l+8); + s_class = tvb_get_guint8(tvb, offset2+l+10); + s_type = tvb_get_guint8(tvb, offset2+l+11); + ti2 = proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+8, + s_len, "Session"); + rsvp_session_subtree = + proto_item_add_subtree(ti2, TREE(rsvp_class_to_tree_type(s_class))); + if (s_len < 4) { + proto_tree_add_text(rsvp_object_tree, tvb, offset2+l+8, 2, + "Length: %u (bogus, must be >= 4)", s_len); + break; + } + proto_tree_add_text(rsvp_session_subtree, tvb, offset2+l+8, 2, + "Length: %u", s_len); + proto_tree_add_uint(rsvp_session_subtree, hf_rsvp_filter[RSVPF_OBJECT], tvb, + offset2+8+l+10, 1, s_class); + dissect_rsvp_session(ti2, rsvp_session_subtree, tvb, offset2+l+8, + s_len, s_class, s_type, rsvph); + offset3 = offset2 + s_len; + s_len = tvb_get_ntohs(tvb, offset3+l+8); + s_class = tvb_get_guint8(tvb, offset3+l+10); + s_type = tvb_get_guint8(tvb, offset3+l+11); + ti2 = proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset3+l+8, + s_len, "Template"); + rsvp_template_subtree = + proto_item_add_subtree(ti2, TREE(rsvp_class_to_tree_type(s_class))); + if (s_len < 4) { + proto_tree_add_text(rsvp_object_tree, tvb, offset3+l+8, 2, + "Length: %u (bogus, must be >= 4)", s_len); + break; + } + proto_tree_add_text(rsvp_template_subtree, tvb, offset3+l+8, 2, + "Length: %u", s_len); + proto_tree_add_uint(rsvp_template_subtree, hf_rsvp_filter[RSVPF_OBJECT], tvb, + offset3+8+l+10, 1, s_class); + dissect_rsvp_template_filter(ti2, rsvp_template_subtree, tvb, offset3+l+8, + s_len, s_class, s_type, rsvph); - if (i < 4) { - proto_item_append_text(ti, "Diversity"); - } - break; + if (i < 4) { + proto_item_append_text(ti, "Diversity"); + } + break; - } - break; + } + break; - case 4: /* Egress Label */ - k = tvb_get_guint8(tvb, offset2+l+3); - if (k == 1) /* Egress label sub-type */ - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset2+l, sobj_len, - "Egress Label Subobject"); - else if (k == 2) /* SPC_label sub-type (see G.7713.2) */ - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset2+l, sobj_len, - "SPC Label Subobject"); - else - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset2+l, sobj_len, - "Unknown Label Subobject"); - rsvp_gen_uni_subtree = proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ)); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1, - "Class: %d (Egress/SPC Label)", j); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1, - "Type: %d", k); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2, - "Length: %u", sobj_len); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1, - "Direction: %s", - decode_boolean_bitfield( - tvb_get_guint8(tvb, offset2+l+4), 0x80, 8, - "U: 1 - Upstream label/port ID", - "U: 0 - Downstream label/port ID")); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+7, 1, - "Label type: %u", tvb_get_guint8(tvb, offset2+l+7)); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+8, 4, - "Logical Port ID: %u", tvb_get_ntohl(tvb, offset2+l+8)); - proto_item_append_text(ti2, ": %s, Label type %d, Port ID %d, Label ", - tvb_get_guint8(tvb, offset2+l+4) & 0x80 ? - "Upstream" : "Downstream", - tvb_get_guint8(tvb, offset2+l+7), - tvb_get_ntohl(tvb, offset2+l+8)); - for (j=12; j < sobj_len; j+=4) { - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+j, 4, - "Label: %u", tvb_get_ntohl(tvb, offset2+l+j)); - proto_item_append_text(ti2, "%u ", tvb_get_ntohl(tvb, offset2+l+j)); - } - if (i < 4) { - if (k == 1) - proto_item_append_text(ti, "Egress Label"); + case 4: /* Egress Label */ + k = tvb_get_guint8(tvb, offset2+l+3); + if (k == 1) /* Egress label sub-type */ + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset2+l, sobj_len, + "Egress Label Subobject"); + else if (k == 2) /* SPC_label sub-type (see G.7713.2) */ + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset2+l, sobj_len, + "SPC Label Subobject"); + else + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset2+l, sobj_len, + "Unknown Label Subobject"); + rsvp_gen_uni_subtree = proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ)); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1, + "Class: %d (Egress/SPC Label)", j); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1, + "Type: %d", k); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2, + "Length: %u", sobj_len); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1, + "Direction: %s", + decode_boolean_bitfield( + tvb_get_guint8(tvb, offset2+l+4), 0x80, 8, + "U: 1 - Upstream label/port ID", + "U: 0 - Downstream label/port ID")); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+7, 1, + "Label type: %u", tvb_get_guint8(tvb, offset2+l+7)); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+8, 4, + "Logical Port ID: %u", tvb_get_ntohl(tvb, offset2+l+8)); + proto_item_append_text(ti2, ": %s, Label type %d, Port ID %d, Label ", + tvb_get_guint8(tvb, offset2+l+4) & 0x80 ? + "Upstream" : "Downstream", + tvb_get_guint8(tvb, offset2+l+7), + tvb_get_ntohl(tvb, offset2+l+8)); + for (j=12; j < sobj_len; j+=4) { + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+j, 4, + "Label: %u", tvb_get_ntohl(tvb, offset2+l+j)); + proto_item_append_text(ti2, "%u ", tvb_get_ntohl(tvb, offset2+l+j)); + } + if (i < 4) { + if (k == 1) + proto_item_append_text(ti, "Egress Label"); else if (k == 2) - proto_item_append_text(ti, "SPC Label"); - } - break; + proto_item_append_text(ti, "SPC Label"); + } + break; - case 5: /* Service Level */ - k = tvb_get_guint8(tvb, offset2+l+3); - switch(k) { - default: - case 1: - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset2+l, sobj_len, - "Service Level Subobject"); - rsvp_gen_uni_subtree = - proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ)); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1, - "Class: %d (Service Level)", j); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1, - "Type: %d", tvb_get_guint8(tvb, offset2+l+3)); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2, - "Length: %u", sobj_len); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1, - "Service Level: %u", tvb_get_guint8(tvb, offset2+l+4)); - proto_item_append_text(ti2, ": %u", tvb_get_guint8(tvb, offset2+l+4)); - if (i < 4) { - proto_item_append_text(ti, "Service Level %d", tvb_get_guint8(tvb, offset2+l+4)); - } - break; - } - break; + case 5: /* Service Level */ + k = tvb_get_guint8(tvb, offset2+l+3); + switch(k) { + default: + case 1: + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset2+l, sobj_len, + "Service Level Subobject"); + rsvp_gen_uni_subtree = + proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ)); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1, + "Class: %d (Service Level)", j); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1, + "Type: %d", tvb_get_guint8(tvb, offset2+l+3)); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2, + "Length: %u", sobj_len); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1, + "Service Level: %u", tvb_get_guint8(tvb, offset2+l+4)); + proto_item_append_text(ti2, ": %u", tvb_get_guint8(tvb, offset2+l+4)); + if (i < 4) { + proto_item_append_text(ti, "Service Level %d", tvb_get_guint8(tvb, offset2+l+4)); + } + break; + } + break; - default: /* Unknown subobject */ - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, - offset2+l, sobj_len, - "Unknown subobject: %u", - j); - rsvp_gen_uni_subtree = - proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ)); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 1, - "Type: %u (Unknown)", j); - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+1, 1, - "Length: %u", - tvb_get_guint8(tvb, offset2+l+1)); + default: /* Unknown subobject */ + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, + offset2+l, sobj_len, + "Unknown subobject: %u", + j); + rsvp_gen_uni_subtree = + proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ)); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 1, + "Type: %u (Unknown)", j); + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+1, 1, + "Length: %u", + tvb_get_guint8(tvb, offset2+l+1)); + break; + } - } - - if (tvb_get_guint8(tvb, offset2+l+1) < 1) { - proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+1, 1, - "Invalid length: %u", tvb_get_guint8(tvb, offset2+l+1)); - return; - } - l += tvb_get_guint8(tvb, offset2+l+1); - if (l < mylen) { - if (i < 4) - proto_item_append_text(ti, ", "); - else if (i==4) - proto_item_append_text(ti, "..."); - } - } - break; + if (tvb_get_guint8(tvb, offset2+l+1) < 1) { + proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+1, 1, + "Invalid length: %u", tvb_get_guint8(tvb, offset2+l+1)); + return; + } + l += tvb_get_guint8(tvb, offset2+l+1); + if (l < mylen) { + if (i < 4) + proto_item_append_text(ti, ", "); + else if (i==4) + proto_item_append_text(ti, "..."); + } + } + break; } default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen, - "Data (%d bytes)", mylen); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen, + "Data (%d bytes)", mylen); + break; } } @@ -5622,15 +5655,15 @@ dissect_rsvp_gen_uni (proto_tree *ti, proto_tree *rsvp_object_tree, * CALL_ID *------------------------------------------------------------------------------*/ static void -dissect_rsvp_call_id (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int c_type) +dissect_rsvp_call_id(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int c_type) { - int type = 0; + int type = 0; const char *str; - int offset2 = offset + 4; - int offset3, offset4, len; + int offset2 = offset + 4; + int offset3, offset4, len; static const value_string address_type_vals[] = { { 1, "1 (IPv4)"}, @@ -5640,6 +5673,7 @@ dissect_rsvp_call_id (proto_tree *ti, proto_tree *rsvp_object_tree, { 0x7f, "0x7f (Vendor-defined)"}, { 0, NULL} }; + static value_string_ext address_type_vals_ext = VALUE_STRING_EXT_INIT(address_type_vals); proto_item_set_text(ti, "CALL-ID: "); switch(c_type) { @@ -5653,93 +5687,94 @@ dissect_rsvp_call_id (proto_tree *ti, proto_tree *rsvp_object_tree, break; case 1: case 2: - type = tvb_get_guint8 (tvb, offset2); - if (c_type == 1) { + type = tvb_get_guint8 (tvb, offset2); + if (c_type == 1) { offset3 = offset2 + 4; len = obj_length - 16; proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, "C-type: 1 (operator specific)"); proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, "Address type: %s", - val_to_str(type, address_type_vals, "Unknown (%u)")); + val_to_str_ext(type, &address_type_vals_ext, "Unknown (%u)")); proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 3, "Reserved: %u", tvb_get_ntoh24(tvb, offset2+1)); proto_item_append_text(ti, "Operator-Specific. Addr Type: %s. ", - val_to_str(type, address_type_vals, "Unknown (%u)")); - } - else { + val_to_str_ext(type, &address_type_vals_ext, "Unknown (%u)")); + } + else { offset3 = offset2 + 16; len = obj_length - 28; proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, "C-type: 2 (globally unique)"); proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, "Address type: %s", - val_to_str(type, address_type_vals, "Unknown (%u)")); + val_to_str_ext(type, &address_type_vals_ext, "Unknown (%u)")); str = tvb_get_ephemeral_string (tvb, offset2 + 1, 3); proto_tree_add_text(rsvp_object_tree, tvb, offset2 + 1, 3, "International Segment: %s", str); proto_item_append_text(ti, "Globally-Unique. Addr Type: %s. Intl Segment: %s. ", - val_to_str(type, address_type_vals, "Unknown (%u)"), str); + val_to_str_ext(type, &address_type_vals_ext, "Unknown (%u)"), str); str = tvb_get_ephemeral_string (tvb, offset2 + 4, 12); proto_tree_add_text(rsvp_object_tree, tvb, offset2 + 4, 12, "National Segment: %s", str); proto_item_append_text(ti, "Natl Segment: %s. ", str); - } + } - switch(type) { - case 1: + switch(type) { + case 1: offset4 = offset3 + 4; str = tvb_ip_to_str(tvb, offset3); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_CALL_ID_SRC_ADDR_IPV4], tvb, offset3, 4, ENC_BIG_ENDIAN); break; - case 2: + case 2: offset4 = offset3 + 16; str = tvb_ip6_to_str(tvb, offset3); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_CALL_ID_SRC_ADDR_IPV6], tvb, offset3, 16, ENC_NA); break; - case 3: + case 3: offset4 = offset3 + 20; str = print_nsap_net(tvb_get_ptr(tvb, offset3, 20), 20); proto_tree_add_text(rsvp_object_tree, tvb, offset3, 20, "Source Transport Network addr: %s", str); break; - case 4: + case 4: offset4 = offset3 + 6; str = tvb_ether_to_str(tvb, offset3); proto_tree_add_text(rsvp_object_tree, tvb, offset3, 6, "Source Transport Network addr: %s", str); break; - case 0x7F: + case 0x7F: offset4 = offset3 + len; str = tvb_bytes_to_str(tvb, offset3, len); proto_tree_add_text(rsvp_object_tree, tvb, offset3, len, "Source Transport Network addr: %s", str); break; - default: + default: offset4 = offset3 + len; str = "???"; proto_tree_add_text(rsvp_object_tree, tvb, offset3, len, "Unknown Transport Network type: %d", type); - } + break; + } - proto_item_append_text(ti, "Src: %s. ", str); - proto_tree_add_text(rsvp_object_tree, tvb, offset4, 8, "Local Identifier: %s", - tvb_bytes_to_str(tvb, offset4, 8)); - proto_item_append_text(ti, "Local ID: %s. ", tvb_bytes_to_str(tvb, offset4, 8)); - break; + proto_item_append_text(ti, "Src: %s. ", str); + proto_tree_add_text(rsvp_object_tree, tvb, offset4, 8, "Local Identifier: %s", + tvb_bytes_to_str(tvb, offset4, 8)); + proto_item_append_text(ti, "Local ID: %s. ", tvb_bytes_to_str(tvb, offset4, 8)); + break; default: - proto_item_append_text(ti, " Unknown"); - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", c_type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length-4, - "Data (%d bytes)", obj_length-4); - break; + proto_item_append_text(ti, " Unknown"); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", c_type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length-4, + "Data (%d bytes)", obj_length-4); + break; } } @@ -5747,35 +5782,35 @@ dissect_rsvp_call_id (proto_tree *ti, proto_tree *rsvp_object_tree, * RESTART CAPABILITY *------------------------------------------------------------------------------*/ static void -dissect_rsvp_restart_cap (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_restart_cap(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { int offset2 = offset + 4; proto_item_set_text(ti, "RESTART CAPABILITY: "); switch(type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1"); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, - "Restart Time: %d ms", - tvb_get_ntohl(tvb, offset2)); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4, - "Recovery Time: %d ms", - tvb_get_ntohl(tvb, offset2+4)); - proto_item_append_text(ti, "Restart Time: %d ms. Recovery Time: %d ms.", - tvb_get_ntohl(tvb, offset2), tvb_get_ntohl(tvb, offset2+4)); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1"); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4, + "Restart Time: %d ms", + tvb_get_ntohl(tvb, offset2)); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4, + "Recovery Time: %d ms", + tvb_get_ntohl(tvb, offset2+4)); + proto_item_append_text(ti, "Restart Time: %d ms. Recovery Time: %d ms.", + tvb_get_ntohl(tvb, offset2), tvb_get_ntohl(tvb, offset2+4)); + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -5783,215 +5818,215 @@ dissect_rsvp_restart_cap (proto_tree *ti, proto_tree *rsvp_object_tree, * PROTECTION INFORMATION *------------------------------------------------------------------------------*/ static void -dissect_rsvp_protection_info (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_protection_info(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { - guint8 flags1, flags2, lsp_flags, link_flags, seg_flags; + guint8 flags1, flags2, lsp_flags, link_flags, seg_flags; proto_tree *ti2, *ti3, *ti4, *rsvp_pi_link_flags_tree, *rsvp_pi_lsp_flags_tree, *rsvp_pi_seg_flags_tree; - int offset2 = offset + 4; + int offset2 = offset + 4; proto_item_set_text(ti, "PROTECTION_INFO: "); switch(type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: 1"); - flags1 = tvb_get_guint8(tvb, offset2); - flags1 >>= 4; - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, - "Secondary LSP: %s", - decode_boolean_bitfield(flags1, 0x08, 4, "Yes", "No")); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: 1"); + flags1 = tvb_get_guint8(tvb, offset2); + flags1 >>= 4; + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, + "Secondary LSP: %s", + decode_boolean_bitfield(flags1, 0x08, 4, "Yes", "No")); - link_flags = tvb_get_guint8(tvb, offset2+3); - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+3, 1, - "Link Flags: 0x%02x", link_flags); - rsvp_pi_link_flags_tree = proto_item_add_subtree(ti2, TREE(TT_PROTECTION_INFO_LINK)); - proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", - decode_boolean_bitfield(link_flags, 0x01, 8, - "Extra Traffic desired", - "Extra Traffic NOT desired")); - proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", - decode_boolean_bitfield(link_flags, 0x02, 8, - "Unprotected desired", - "Unprotected NOT desired")); - proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", - decode_boolean_bitfield(link_flags, 0x04, 8, - "Shared desired", - "Shared NOT desired")); - proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", - decode_boolean_bitfield(link_flags, 0x08, 8, - "Dedicated 1:1 desired", - "Dedicated 1:1 NOT desired")); - proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", - decode_boolean_bitfield(link_flags, 0x10, 8, - "Dedicated 1+1 desired", - "Dedicated 1+1 NOT desired")); - proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", - decode_boolean_bitfield(link_flags, 0x20, 8, - "Enhanced desired", - "Enhanced NOT desired")); - proto_item_append_text(ti, "%s%s%s%s%s%s%s.", - flags1&0x08 ? "SecondaryLSP ":"", - link_flags&0x01 ? "ExtraTraffic ":"", - link_flags&0x02 ? "Unprotected ":"", - link_flags&0x04 ? "Shared ":"", - link_flags&0x08 ? "Dedicated1:1 ":"", - link_flags&0x10 ? "Dedicated1+1 ":"", - link_flags&0x20 ? "Enhanced ":""); - break; + link_flags = tvb_get_guint8(tvb, offset2+3); + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+3, 1, + "Link Flags: 0x%02x", link_flags); + rsvp_pi_link_flags_tree = proto_item_add_subtree(ti2, TREE(TT_PROTECTION_INFO_LINK)); + proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", + decode_boolean_bitfield(link_flags, 0x01, 8, + "Extra Traffic desired", + "Extra Traffic NOT desired")); + proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", + decode_boolean_bitfield(link_flags, 0x02, 8, + "Unprotected desired", + "Unprotected NOT desired")); + proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", + decode_boolean_bitfield(link_flags, 0x04, 8, + "Shared desired", + "Shared NOT desired")); + proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", + decode_boolean_bitfield(link_flags, 0x08, 8, + "Dedicated 1:1 desired", + "Dedicated 1:1 NOT desired")); + proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", + decode_boolean_bitfield(link_flags, 0x10, 8, + "Dedicated 1+1 desired", + "Dedicated 1+1 NOT desired")); + proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", + decode_boolean_bitfield(link_flags, 0x20, 8, + "Enhanced desired", + "Enhanced NOT desired")); + proto_item_append_text(ti, "%s%s%s%s%s%s%s.", + flags1&0x08 ? "SecondaryLSP ":"", + link_flags&0x01 ? "ExtraTraffic ":"", + link_flags&0x02 ? "Unprotected ":"", + link_flags&0x04 ? "Shared ":"", + link_flags&0x08 ? "Dedicated1:1 ":"", + link_flags&0x10 ? "Dedicated1+1 ":"", + link_flags&0x20 ? "Enhanced ":""); + break; case 2: /* RFC4872 */ - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type:2"); - flags1 = tvb_get_guint8(tvb, offset2); - flags1 >>= 4; - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, - "Secondary LSP: %s", - decode_boolean_bitfield(flags1, 0x08, 4, "Yes", "No")); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, - "Protecting LSP: %s", - decode_boolean_bitfield(flags1, 0x04, 4, "Yes", "No")); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, - "Notification msg: %s", - decode_boolean_bitfield(flags1, 0x02, 4, "Yes", "No")); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, - "Operational LSP: %s", - decode_boolean_bitfield(flags1, 0x01, 4, "Yes", "No")); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type:2"); + flags1 = tvb_get_guint8(tvb, offset2); + flags1 >>= 4; + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, + "Secondary LSP: %s", + decode_boolean_bitfield(flags1, 0x08, 4, "Yes", "No")); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, + "Protecting LSP: %s", + decode_boolean_bitfield(flags1, 0x04, 4, "Yes", "No")); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, + "Notification msg: %s", + decode_boolean_bitfield(flags1, 0x02, 4, "Yes", "No")); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, + "Operational LSP: %s", + decode_boolean_bitfield(flags1, 0x01, 4, "Yes", "No")); - lsp_flags = tvb_get_guint8(tvb, offset2+1); - ti3 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1, - "LSP Flags: 0x%02x -%s%s%s%s%s%s", lsp_flags, - lsp_flags == 0 ? " Unprotected":"", - lsp_flags&0x01 ? " Rerouting":"", - lsp_flags&0x02 ? " Rerouting with extra-traffic":"", - lsp_flags&0x04 ? " 1:N Protection with extra-traffic":"", - lsp_flags&0x08 ? " 1+1 Unidirectional protection":"", - lsp_flags&0x10 ? " 1+1 Bidirectional protection":""); - rsvp_pi_lsp_flags_tree = proto_item_add_subtree(ti3, TREE(TT_PROTECTION_INFO_LSP)); - proto_tree_add_text(rsvp_pi_lsp_flags_tree, tvb, offset2+1, 1, "%s", - decode_boolean_bitfield(lsp_flags, 0x01, 6, - "(Full) rerouting desired", - "(Full) rerouting NOT desired")); - proto_tree_add_text(rsvp_pi_lsp_flags_tree, tvb, offset2+1, 1, "%s", - decode_boolean_bitfield(lsp_flags, 0x02, 6, - "Rerouting without extra-traffic desired", - "Rerouting without extra-traffic NOT desired")); - proto_tree_add_text(rsvp_pi_lsp_flags_tree, tvb, offset2+1, 1, "%s", - decode_boolean_bitfield(lsp_flags, 0x04, 6, - "1:N protection with extra-traffic desired", - "1:N protection with extra-traffic NOT desired")); - proto_tree_add_text(rsvp_pi_lsp_flags_tree, tvb, offset2+1, 1, "%s", - decode_boolean_bitfield(lsp_flags, 0x08, 6, - "1+1 unidirectional protection desired", - "1+1 unidirectional protection NOT desired")); - proto_tree_add_text(rsvp_pi_lsp_flags_tree, tvb, offset2+1, 1, "%s", - decode_boolean_bitfield(lsp_flags, 0x10, 6, - "1+1 bidirectional protection desired", - "1+1 bidirectional protection NOT desired")); + lsp_flags = tvb_get_guint8(tvb, offset2+1); + ti3 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1, + "LSP Flags: 0x%02x -%s%s%s%s%s%s", lsp_flags, + lsp_flags == 0 ? " Unprotected":"", + lsp_flags&0x01 ? " Rerouting":"", + lsp_flags&0x02 ? " Rerouting with extra-traffic":"", + lsp_flags&0x04 ? " 1:N Protection with extra-traffic":"", + lsp_flags&0x08 ? " 1+1 Unidirectional protection":"", + lsp_flags&0x10 ? " 1+1 Bidirectional protection":""); + rsvp_pi_lsp_flags_tree = proto_item_add_subtree(ti3, TREE(TT_PROTECTION_INFO_LSP)); + proto_tree_add_text(rsvp_pi_lsp_flags_tree, tvb, offset2+1, 1, "%s", + decode_boolean_bitfield(lsp_flags, 0x01, 6, + "(Full) rerouting desired", + "(Full) rerouting NOT desired")); + proto_tree_add_text(rsvp_pi_lsp_flags_tree, tvb, offset2+1, 1, "%s", + decode_boolean_bitfield(lsp_flags, 0x02, 6, + "Rerouting without extra-traffic desired", + "Rerouting without extra-traffic NOT desired")); + proto_tree_add_text(rsvp_pi_lsp_flags_tree, tvb, offset2+1, 1, "%s", + decode_boolean_bitfield(lsp_flags, 0x04, 6, + "1:N protection with extra-traffic desired", + "1:N protection with extra-traffic NOT desired")); + proto_tree_add_text(rsvp_pi_lsp_flags_tree, tvb, offset2+1, 1, "%s", + decode_boolean_bitfield(lsp_flags, 0x08, 6, + "1+1 unidirectional protection desired", + "1+1 unidirectional protection NOT desired")); + proto_tree_add_text(rsvp_pi_lsp_flags_tree, tvb, offset2+1, 1, "%s", + decode_boolean_bitfield(lsp_flags, 0x10, 6, + "1+1 bidirectional protection desired", + "1+1 bidirectional protection NOT desired")); - link_flags = tvb_get_guint8(tvb, offset2+3); - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+3, 1, - "Link Flags: 0x%02x -%s%s%s%s%s%s", link_flags, - link_flags&0x01 ? " ExtraTraffic":"", - link_flags&0x02 ? " Unprotected":"", - link_flags&0x04 ? " Shared":"", - link_flags&0x08 ? " Dedicated1:1":"", - link_flags&0x10 ? " Dedicated1+1":"", - link_flags&0x20 ? " Enhanced":""); - rsvp_pi_link_flags_tree = proto_item_add_subtree(ti2, - TREE(TT_PROTECTION_INFO_LINK)); - proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", - decode_boolean_bitfield(link_flags, 0x01, 8, - "Extra Traffic desired", - "Extra Traffic NOT desired")); - proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", - decode_boolean_bitfield(link_flags, 0x02, 8, - "Unprotected desired", - "Unprotected NOT desired")); - proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", - decode_boolean_bitfield(link_flags, 0x04, 8, - "Shared desired", - "Shared NOT desired")); - proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", - decode_boolean_bitfield(link_flags, 0x08, 8, - "Dedicated 1:1 desired", - "Dedicated 1:1 NOT desired")); - proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", - decode_boolean_bitfield(link_flags, 0x10, 8, - "Dedicated 1+1 desired", - "Dedicated 1+1 NOT desired")); - proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", - decode_boolean_bitfield(link_flags, 0x20, 8, - "Enhanced desired", - "Enhanced NOT desired")); + link_flags = tvb_get_guint8(tvb, offset2+3); + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+3, 1, + "Link Flags: 0x%02x -%s%s%s%s%s%s", link_flags, + link_flags&0x01 ? " ExtraTraffic":"", + link_flags&0x02 ? " Unprotected":"", + link_flags&0x04 ? " Shared":"", + link_flags&0x08 ? " Dedicated1:1":"", + link_flags&0x10 ? " Dedicated1+1":"", + link_flags&0x20 ? " Enhanced":""); + rsvp_pi_link_flags_tree = proto_item_add_subtree(ti2, + TREE(TT_PROTECTION_INFO_LINK)); + proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", + decode_boolean_bitfield(link_flags, 0x01, 8, + "Extra Traffic desired", + "Extra Traffic NOT desired")); + proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", + decode_boolean_bitfield(link_flags, 0x02, 8, + "Unprotected desired", + "Unprotected NOT desired")); + proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", + decode_boolean_bitfield(link_flags, 0x04, 8, + "Shared desired", + "Shared NOT desired")); + proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", + decode_boolean_bitfield(link_flags, 0x08, 8, + "Dedicated 1:1 desired", + "Dedicated 1:1 NOT desired")); + proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", + decode_boolean_bitfield(link_flags, 0x10, 8, + "Dedicated 1+1 desired", + "Dedicated 1+1 NOT desired")); + proto_tree_add_text(rsvp_pi_link_flags_tree, tvb, offset2+3, 1, "%s", + decode_boolean_bitfield(link_flags, 0x20, 8, + "Enhanced desired", + "Enhanced NOT desired")); - flags2 = tvb_get_guint8(tvb, offset2+4); - flags2 >>= 6; - proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 1, - "In-Place: %s", - decode_boolean_bitfield(flags2, 0x02, 2, "Yes", "No")); - proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 1, - "Required: %s", - decode_boolean_bitfield(flags2, 0x01, 2, "Yes", "No")); + flags2 = tvb_get_guint8(tvb, offset2+4); + flags2 >>= 6; + proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 1, + "In-Place: %s", + decode_boolean_bitfield(flags2, 0x02, 2, "Yes", "No")); + proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 1, + "Required: %s", + decode_boolean_bitfield(flags2, 0x01, 2, "Yes", "No")); - seg_flags = tvb_get_guint8(tvb, offset2+5); - ti4 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 1, - "Segment recovery Flags: 0x%02x - %s%s%s%s%s%s", seg_flags, - seg_flags == 0 ? " Unprotected":"", - seg_flags&0x01 ? " Rerouting":"", - seg_flags&0x02 ? " Rerouting with extra-traffic":"", - seg_flags&0x04 ? " 1:N Protection with extra-traffic":"", - seg_flags&0x08 ? " 1+1 Unidirectional protection":"", - seg_flags&0x10 ? " 1+1 Bidirectional protection":""); - rsvp_pi_seg_flags_tree = proto_item_add_subtree(ti4, TREE(TT_PROTECTION_INFO_SEG)); - proto_tree_add_text(rsvp_pi_seg_flags_tree, tvb, offset2+5, 1, "%s", - decode_boolean_bitfield(seg_flags, 0x01, 6, - "(Full) rerouting desired", - "(Full) rerouting NOT desired")); - proto_tree_add_text(rsvp_pi_seg_flags_tree, tvb, offset2+5, 1, "%s", - decode_boolean_bitfield(seg_flags, 0x02, 6, - "Rerouting without extra-traffic desired", - "Rerouting without extra-traffic NOT desired")); - proto_tree_add_text(rsvp_pi_seg_flags_tree, tvb, offset2+5, 1, "%s", - decode_boolean_bitfield(seg_flags, 0x04, 6, - "1:N protection with extra-traffic desired", - "1:N protection with extra-traffic NOT desired")); - proto_tree_add_text(rsvp_pi_seg_flags_tree, tvb, offset2+5, 1, "%s", - decode_boolean_bitfield(seg_flags, 0x08, 6, - "1+1 unidirectional protection desired", - "1+1 unidirectional protection NOT desired")); - proto_tree_add_text(rsvp_pi_seg_flags_tree, tvb, offset2+5, 1, "%s", - decode_boolean_bitfield(seg_flags, 0x10, 6, - "1+1 bidirectional protection desired", - "1+1 bidirectional protection NOT desired")); + seg_flags = tvb_get_guint8(tvb, offset2+5); + ti4 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 1, + "Segment recovery Flags: 0x%02x - %s%s%s%s%s%s", seg_flags, + seg_flags == 0 ? " Unprotected":"", + seg_flags&0x01 ? " Rerouting":"", + seg_flags&0x02 ? " Rerouting with extra-traffic":"", + seg_flags&0x04 ? " 1:N Protection with extra-traffic":"", + seg_flags&0x08 ? " 1+1 Unidirectional protection":"", + seg_flags&0x10 ? " 1+1 Bidirectional protection":""); + rsvp_pi_seg_flags_tree = proto_item_add_subtree(ti4, TREE(TT_PROTECTION_INFO_SEG)); + proto_tree_add_text(rsvp_pi_seg_flags_tree, tvb, offset2+5, 1, "%s", + decode_boolean_bitfield(seg_flags, 0x01, 6, + "(Full) rerouting desired", + "(Full) rerouting NOT desired")); + proto_tree_add_text(rsvp_pi_seg_flags_tree, tvb, offset2+5, 1, "%s", + decode_boolean_bitfield(seg_flags, 0x02, 6, + "Rerouting without extra-traffic desired", + "Rerouting without extra-traffic NOT desired")); + proto_tree_add_text(rsvp_pi_seg_flags_tree, tvb, offset2+5, 1, "%s", + decode_boolean_bitfield(seg_flags, 0x04, 6, + "1:N protection with extra-traffic desired", + "1:N protection with extra-traffic NOT desired")); + proto_tree_add_text(rsvp_pi_seg_flags_tree, tvb, offset2+5, 1, "%s", + decode_boolean_bitfield(seg_flags, 0x08, 6, + "1+1 unidirectional protection desired", + "1+1 unidirectional protection NOT desired")); + proto_tree_add_text(rsvp_pi_seg_flags_tree, tvb, offset2+5, 1, "%s", + decode_boolean_bitfield(seg_flags, 0x10, 6, + "1+1 bidirectional protection desired", + "1+1 bidirectional protection NOT desired")); - proto_item_append_text(ti, "%s%s%s%s Link:%s%s%s%s%s%s, LSP:%s%s%s%s%s%s.", - flags1&0x08 ? "SecondaryLSP ":"", - flags1&0x04 ? "ProtectingLSP ":"", - flags1&0x02 ? "Notification ":"", - flags1&0x01 ? "OperationalLSP ":"", - link_flags&0x01 ? " ExtraTraffic":"", - link_flags&0x02 ? " Unprotected":"", - link_flags&0x04 ? " Shared":"", - link_flags&0x08 ? " Dedicated1:1":"", - link_flags&0x10 ? " Dedicated1+1":"", - link_flags&0x20 ? " Enhanced":"", - lsp_flags == 0 ? " Unprotected":"", - lsp_flags&0x01 ? " Rerouting":"", - lsp_flags&0x02 ? " Rerouting with extra-traffic":"", - lsp_flags&0x04 ? " 1:N Protection with extra-traffic":"", - lsp_flags&0x08 ? " 1+1 Unidirectional protection":"", - lsp_flags&0x10 ? " 1+1 Bidirectional protection":""); - break; + proto_item_append_text(ti, "%s%s%s%s Link:%s%s%s%s%s%s, LSP:%s%s%s%s%s%s.", + flags1&0x08 ? "SecondaryLSP ":"", + flags1&0x04 ? "ProtectingLSP ":"", + flags1&0x02 ? "Notification ":"", + flags1&0x01 ? "OperationalLSP ":"", + link_flags&0x01 ? " ExtraTraffic":"", + link_flags&0x02 ? " Unprotected":"", + link_flags&0x04 ? " Shared":"", + link_flags&0x08 ? " Dedicated1:1":"", + link_flags&0x10 ? " Dedicated1+1":"", + link_flags&0x20 ? " Enhanced":"", + lsp_flags == 0 ? " Unprotected":"", + lsp_flags&0x01 ? " Rerouting":"", + lsp_flags&0x02 ? " Rerouting with extra-traffic":"", + lsp_flags&0x04 ? " 1:N Protection with extra-traffic":"", + lsp_flags&0x08 ? " 1+1 Unidirectional protection":"", + lsp_flags&0x10 ? " 1+1 Bidirectional protection":""); + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -5999,69 +6034,69 @@ dissect_rsvp_protection_info (proto_tree *ti, proto_tree *rsvp_object_tree, * FAST REROUTE *------------------------------------------------------------------------------*/ static void -dissect_rsvp_fast_reroute (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_fast_reroute(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { - guint8 flags; + guint8 flags; proto_tree *ti2, *rsvp_frr_flags_tree; proto_item_set_text(ti, "FAST_REROUTE: "); switch(type) { case 1: case 7: - if ((type==1 && obj_length!=24) || (type==7 && obj_length!=20)) { - proto_tree_add_text(rsvp_object_tree, tvb, offset, obj_length, - "<<>>"); - proto_item_append_text(ti, "Invalid length"); - break; - } - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: %u", type); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1, - "Setup Priority: %d", tvb_get_guint8(tvb, offset+4)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 1, - "Hold Priority: %d", tvb_get_guint8(tvb, offset+5)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+6, 1, - "Hop Limit: %d", tvb_get_guint8(tvb, offset+6)); + if (((type == 1) && (obj_length != 24)) || ((type == 7) && (obj_length != 20))) { + proto_tree_add_text(rsvp_object_tree, tvb, offset, obj_length, + "<<>>"); + proto_item_append_text(ti, "Invalid length"); + break; + } + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: %u", type); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1, + "Setup Priority: %d", tvb_get_guint8(tvb, offset+4)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 1, + "Hold Priority: %d", tvb_get_guint8(tvb, offset+5)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+6, 1, + "Hop Limit: %d", tvb_get_guint8(tvb, offset+6)); flags = tvb_get_guint8(tvb, offset+7); - ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset+7, 1, + ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset+7, 1, "Flags: 0x%02x", flags); rsvp_frr_flags_tree = proto_item_add_subtree(ti2, TREE(TT_FAST_REROUTE_FLAGS)); - proto_tree_add_text(rsvp_frr_flags_tree, tvb, offset+7, 1, "%s", - decode_boolean_bitfield(flags, 0x01, 8, - "One-to-One Backup desired", - "One-to-One Backup not desired")); - proto_tree_add_text(rsvp_frr_flags_tree, tvb, offset+7, 1, "%s", - decode_boolean_bitfield(flags, 0x02, 8, - "Facility Backup desired", - "Facility Backup not desired")); - proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, - "Bandwidth: %.10g", tvb_get_ntohieee_float(tvb, offset+8)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+12, 4, - "Include-Any: 0x%0x", tvb_get_ntohl(tvb, offset+12)); - proto_tree_add_text(rsvp_object_tree, tvb, offset+16, 4, - "Exclude-Any: 0x%0x", tvb_get_ntohl(tvb, offset+16)); - if (type==1) { - proto_tree_add_text(rsvp_object_tree, tvb, offset+20, 4, - "Include-All: 0x%0x", tvb_get_ntohl(tvb, offset+20)); - } + proto_tree_add_text(rsvp_frr_flags_tree, tvb, offset+7, 1, "%s", + decode_boolean_bitfield(flags, 0x01, 8, + "One-to-One Backup desired", + "One-to-One Backup not desired")); + proto_tree_add_text(rsvp_frr_flags_tree, tvb, offset+7, 1, "%s", + decode_boolean_bitfield(flags, 0x02, 8, + "Facility Backup desired", + "Facility Backup not desired")); + proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4, + "Bandwidth: %.10g", tvb_get_ntohieee_float(tvb, offset+8)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+12, 4, + "Include-Any: 0x%0x", tvb_get_ntohl(tvb, offset+12)); + proto_tree_add_text(rsvp_object_tree, tvb, offset+16, 4, + "Exclude-Any: 0x%0x", tvb_get_ntohl(tvb, offset+16)); + if (type == 1) { + proto_tree_add_text(rsvp_object_tree, tvb, offset+20, 4, + "Include-All: 0x%0x", tvb_get_ntohl(tvb, offset+20)); + } proto_item_append_text(ti, "%s%s", flags &0x01 ? "One-to-One Backup, " : "", flags &0x02 ? "Facility Backup" : ""); - break; + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -6069,10 +6104,10 @@ dissect_rsvp_fast_reroute (proto_tree *ti, proto_tree *rsvp_object_tree, * DETOUR *------------------------------------------------------------------------------*/ static void -dissect_rsvp_detour (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_detour(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { int remaining_length, count; int iter; @@ -6082,34 +6117,34 @@ dissect_rsvp_detour (proto_tree *ti, proto_tree *rsvp_object_tree, case 7: iter = 0; proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: %u", type); - for (remaining_length = obj_length - 4, count = 1; - remaining_length > 0; remaining_length -= 8, count++) { - if (remaining_length < 8) { - proto_tree_add_text(rsvp_object_tree, tvb, offset+remaining_length, - obj_length-remaining_length, - "<<>>"); - proto_item_append_text(ti, "Invalid length"); - break; - } - iter++; - proto_tree_add_text(rsvp_object_tree, tvb, offset+(4*iter), 4, - "PLR ID %d: %s", count, - tvb_ip_to_str(tvb, offset+(4*iter))); - iter++; - proto_tree_add_text(rsvp_object_tree, tvb, offset+(4*iter), 4, - "Avoid Node ID %d: %s", count, - tvb_ip_to_str(tvb, offset+(4*iter))); - } - break; + "C-type: %u", type); + for (remaining_length = obj_length - 4, count = 1; + remaining_length > 0; remaining_length -= 8, count++) { + if (remaining_length < 8) { + proto_tree_add_text(rsvp_object_tree, tvb, offset+remaining_length, + obj_length-remaining_length, + "<<>>"); + proto_item_append_text(ti, "Invalid length"); + break; + } + iter++; + proto_tree_add_text(rsvp_object_tree, tvb, offset+(4*iter), 4, + "PLR ID %d: %s", count, + tvb_ip_to_str(tvb, offset+(4*iter))); + iter++; + proto_tree_add_text(rsvp_object_tree, tvb, offset+(4*iter), 4, + "Avoid Node ID %d: %s", count, + tvb_ip_to_str(tvb, offset+(4*iter))); + } + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", - type); - proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", + type); + proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -6117,57 +6152,58 @@ dissect_rsvp_detour (proto_tree *ti, proto_tree *rsvp_object_tree, * DIFFSERV *------------------------------------------------------------------------------*/ static void -dissect_rsvp_diffserv (proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) +dissect_rsvp_diffserv(proto_tree *ti, proto_tree *rsvp_object_tree, + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { int mapnb, count; int *hfindexes[] = { - &hf_rsvp_filter[RSVPF_DIFFSERV_MAP], - &hf_rsvp_filter[RSVPF_DIFFSERV_MAP_EXP], - &hf_rsvp_filter[RSVPF_DIFFSERV_PHBID], - &hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_DSCP], - &hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_CODE], - &hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT14], - &hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT15] + &hf_rsvp_filter[RSVPF_DIFFSERV_MAP], + &hf_rsvp_filter[RSVPF_DIFFSERV_MAP_EXP], + &hf_rsvp_filter[RSVPF_DIFFSERV_PHBID], + &hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_DSCP], + &hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_CODE], + &hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT14], + &hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT15] }; gint *etts[] = { - &TREE(TT_DIFFSERV_MAP), - &TREE(TT_DIFFSERV_MAP_PHBID) + &TREE(TT_DIFFSERV_MAP), + &TREE(TT_DIFFSERV_MAP_PHBID) }; proto_item_set_text(ti, "DIFFSERV: "); offset += 3; switch (type) { case 1: - proto_tree_add_text(rsvp_object_tree, tvb, offset, 1, - "C-type: 1 - E-LSP"); - proto_tree_add_uint(rsvp_object_tree, hf_rsvp_filter[RSVPF_DIFFSERV_MAPNB], - tvb, offset + 4, 1, - mapnb = tvb_get_guint8(tvb, offset + 4) & 15); - proto_item_append_text(ti, "E-LSP, %u MAP%s", mapnb, - (mapnb == 0) ? "" : "s"); - offset += 5; + proto_tree_add_text(rsvp_object_tree, tvb, offset, 1, + "C-type: 1 - E-LSP"); + proto_tree_add_uint(rsvp_object_tree, hf_rsvp_filter[RSVPF_DIFFSERV_MAPNB], + tvb, offset + 4, 1, + mapnb = tvb_get_guint8(tvb, offset + 4) & 15); + proto_item_append_text(ti, "E-LSP, %u MAP%s", mapnb, + (mapnb == 0) ? "" : "s"); + offset += 5; - for (count = 0; count < mapnb; count++) { - dissect_diffserv_mpls_common(tvb, rsvp_object_tree, type, - offset, hfindexes, etts); - offset += 4; - } - break; + for (count = 0; count < mapnb; count++) { + dissect_diffserv_mpls_common(tvb, rsvp_object_tree, type, + offset, hfindexes, etts); + offset += 4; + } + break; case 2: - proto_item_append_text(ti, "L-LSP"); - proto_tree_add_text(rsvp_object_tree, tvb, offset, 1, - "C-type: 2 - L-LSP"); - dissect_diffserv_mpls_common(tvb, rsvp_object_tree, type, - offset + 3, hfindexes, etts); - break; + proto_item_append_text(ti, "L-LSP"); + proto_tree_add_text(rsvp_object_tree, tvb, offset, 1, + "C-type: 2 - L-LSP"); + dissect_diffserv_mpls_common(tvb, rsvp_object_tree, type, + offset + 3, hfindexes, etts); + break; default: - proto_tree_add_text(rsvp_object_tree, tvb, offset, 1, - "C-type: Unknown (%u)", type); - proto_tree_add_text(rsvp_object_tree, tvb, offset + 1, obj_length - 4, - "Data (%d bytes)", obj_length - 4); + proto_tree_add_text(rsvp_object_tree, tvb, offset, 1, + "C-type: Unknown (%u)", type); + proto_tree_add_text(rsvp_object_tree, tvb, offset + 1, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -6176,35 +6212,35 @@ dissect_rsvp_diffserv (proto_tree *ti, proto_tree *rsvp_object_tree, *------------------------------------------------------------------------------*/ static void dissect_rsvp_diffserv_aware_te(proto_tree *ti, proto_tree *rsvp_object_tree, - tvbuff_t *tvb, - int offset, int obj_length, - int rsvp_class _U_, int type) + tvbuff_t *tvb, + int offset, int obj_length, + int rsvp_class _U_, int type) { proto_item *hidden_item; - int offset2 = offset + 4; - guint8 ct = 0; + int offset2 = offset + 4; + guint8 ct = 0; hidden_item = proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_DSTE], - tvb, offset, 8, ENC_NA); + hf_rsvp_filter[RSVPF_DSTE], + tvb, offset, 8, ENC_NA); PROTO_ITEM_SET_HIDDEN(hidden_item); switch(type) { case 1: - ct = tvb_get_guint8(tvb, offset2+3); - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, "C-type: 1"); - proto_tree_add_item(rsvp_object_tree, - hf_rsvp_filter[RSVPF_DSTE_CLASSTYPE], - tvb, offset2+3, 1, ENC_BIG_ENDIAN); - proto_item_set_text(ti, "CLASSTYPE: CT %u", ct); - break; + ct = tvb_get_guint8(tvb, offset2+3); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, "C-type: 1"); + proto_tree_add_item(rsvp_object_tree, + hf_rsvp_filter[RSVPF_DSTE_CLASSTYPE], + tvb, offset2+3, 1, ENC_BIG_ENDIAN); + proto_item_set_text(ti, "CLASSTYPE: CT %u", ct); + break; default: - proto_item_set_text(ti, "CLASSTYPE: (Unknown C-type)"); - proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, - "C-type: Unknown (%u)", type); - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; + proto_item_set_text(ti, "CLASSTYPE: (Unknown C-type)"); + proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, + "C-type: Unknown (%u)", type); + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; } } @@ -6229,7 +6265,7 @@ dissect_rsvp_vendor_private_use(proto_tree *ti _U_, * Private Enterprise Codes, and the rest of the data thereafter is for * the private use of the registered enterprise. */ - proto_item *hidden_item = NULL; + proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_PRIVATE_OBJ], @@ -6249,57 +6285,57 @@ dissect_rsvp_vendor_private_use(proto_tree *ti _U_, *------------------------------------------------------------------------------*/ static void dissect_rsvp_msg_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - int tree_mode, rsvp_conversation_info *rsvph) + int tree_mode, rsvp_conversation_info *rsvph) { - proto_tree *rsvp_tree = NULL; + proto_tree *rsvp_tree; proto_tree *rsvp_header_tree; proto_tree *rsvp_object_tree; proto_tree *ti; proto_item *hidden_item; - guint16 cksum, computed_cksum; - vec_t cksum_vec[1]; - int offset = 0; - int len; - guint8 ver_flags; - guint8 message_type; - int session_off, tempfilt_off; - int msg_length; - int obj_length; - int offset2; + guint16 cksum, computed_cksum; + vec_t cksum_vec[1]; + int offset = 0; + int len; + guint8 ver_flags; + guint8 message_type; + int session_off, tempfilt_off; + int msg_length; + int obj_length; + int offset2; - offset = 0; - len = 0; - ver_flags = tvb_get_guint8(tvb, 0); - msg_length = tvb_get_ntohs(tvb, 6); + offset = 0; + len = 0; + ver_flags = tvb_get_guint8(tvb, 0); + msg_length = tvb_get_ntohs(tvb, 6); message_type = tvb_get_guint8(tvb, 1); ti = proto_tree_add_item(tree, proto_rsvp, tvb, offset, msg_length, - ENC_NA); + ENC_NA); rsvp_tree = proto_item_add_subtree(ti, tree_mode); if (pinfo->ipproto == IP_PROTO_RSVPE2EI) - proto_item_append_text(rsvp_tree, " (E2E-IGNORE)"); + proto_item_append_text(rsvp_tree, " (E2E-IGNORE)"); proto_item_append_text(rsvp_tree, ": "); - proto_item_append_text(rsvp_tree, "%s", val_to_str(message_type, message_type_vals, - "Unknown (%u). ")); + proto_item_append_text(rsvp_tree, "%s", val_to_str_ext(message_type, &message_type_vals_ext, + "Unknown (%u). ")); find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off); if (session_off) - proto_item_append_text(rsvp_tree, "%s", summary_session(tvb, session_off)); + proto_item_append_text(rsvp_tree, "%s", summary_session(tvb, session_off)); if (tempfilt_off) - proto_item_append_text(rsvp_tree, "%s", summary_template(tvb, tempfilt_off)); + proto_item_append_text(rsvp_tree, "%s", summary_template(tvb, tempfilt_off)); ti = proto_tree_add_text(rsvp_tree, tvb, offset, 8, "RSVP Header. %s", - val_to_str(message_type, message_type_vals, - "Unknown Message (%u). ")); + val_to_str_ext(message_type, &message_type_vals_ext, + "Unknown Message (%u). ")); if (pinfo->ipproto == IP_PROTO_RSVPE2EI) - proto_item_append_text(ti, " (E2E-IGNORE)"); + proto_item_append_text(ti, " (E2E-IGNORE)"); rsvp_header_tree = proto_item_add_subtree(ti, TREE(TT_HDR)); proto_tree_add_text(rsvp_header_tree, tvb, offset, 1, "RSVP Version: %u", - (ver_flags & 0xf0)>>4); + (ver_flags & 0xf0)>>4); proto_tree_add_text(rsvp_header_tree, tvb, offset, 1, "Flags: %02x", - ver_flags & 0xf); + ver_flags & 0xf); proto_tree_add_uint(rsvp_header_tree, hf_rsvp_filter[RSVPF_MSG], tvb, - offset+1, 1, message_type); + offset+1, 1, message_type); switch (RSVPF_MSG + message_type) { case RSVPF_PATH: @@ -6315,243 +6351,243 @@ dissect_rsvp_msg_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, case RSVPF_SREFRESH: case RSVPF_HELLO: case RSVPF_NOTIFY: - hidden_item = proto_tree_add_boolean(rsvp_header_tree, hf_rsvp_filter[RSVPF_MSG + message_type], tvb, - offset+1, 1, 1); - PROTO_ITEM_SET_HIDDEN(hidden_item); - break; + hidden_item = proto_tree_add_boolean(rsvp_header_tree, hf_rsvp_filter[RSVPF_MSG + message_type], tvb, + offset+1, 1, 1); + PROTO_ITEM_SET_HIDDEN(hidden_item); + break; default: - proto_tree_add_protocol_format(rsvp_header_tree, proto_malformed, tvb, offset+1, 1, - "Invalid message type: %u", message_type); - return; + proto_tree_add_protocol_format(rsvp_header_tree, proto_malformed, tvb, offset+1, 1, + "Invalid message type: %u", message_type); + return; } cksum = tvb_get_ntohs(tvb, offset+2); - if (!pinfo->fragmented && (int) tvb_length(tvb) >= msg_length) { - /* The packet isn't part of a fragmented datagram and isn't - truncated, so we can checksum it. */ - cksum_vec[0].ptr = tvb_get_ptr(tvb, 0, msg_length); - cksum_vec[0].len = msg_length; - computed_cksum = in_cksum(&cksum_vec[0], 1); - if (computed_cksum == 0) { - proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2, - "Message Checksum: 0x%04x [correct]", - cksum); - } else { - proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2, - "Message Checksum: 0x%04x [incorrect, should be 0x%04x]", - cksum, - in_cksum_shouldbe(cksum, computed_cksum)); - } + if (!pinfo->fragmented && ((int) tvb_length(tvb) >= msg_length)) { + /* The packet isn't part of a fragmented datagram and isn't + truncated, so we can checksum it. */ + cksum_vec[0].ptr = tvb_get_ptr(tvb, 0, msg_length); + cksum_vec[0].len = msg_length; + computed_cksum = in_cksum(&cksum_vec[0], 1); + if (computed_cksum == 0) { + proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2, + "Message Checksum: 0x%04x [correct]", + cksum); + } else { + proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2, + "Message Checksum: 0x%04x [incorrect, should be 0x%04x]", + cksum, + in_cksum_shouldbe(cksum, computed_cksum)); + } } else { - proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2, - "Message Checksum: 0x%04x", - cksum); + proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2, + "Message Checksum: 0x%04x", + cksum); } proto_tree_add_text(rsvp_header_tree, tvb, offset+4, 1, - "Sending TTL: %u", - tvb_get_guint8(tvb, offset+4)); + "Sending TTL: %u", + tvb_get_guint8(tvb, offset+4)); proto_tree_add_text(rsvp_header_tree, tvb, offset+6, 2, - "Message length: %u", msg_length); + "Message length: %u", msg_length); offset = 8; - len = 8; + len = 8; if (message_type == RSVP_MSG_BUNDLE) { - /* Bundle message. Dissect component messages */ - if (rsvp_bundle_dissect) { - int len2 = 8; - while (len2 < msg_length) { - gint sub_len; - tvbuff_t *tvb_sub; - sub_len = tvb_get_ntohs(tvb, len2+6); - tvb_sub = tvb_new_subset(tvb, len2, sub_len, sub_len); - dissect_rsvp_msg_tree(tvb_sub, pinfo, rsvp_tree, TREE(TT_BUNDLE_COMPMSG), rsvph); - len2 += sub_len; - } - } else { - proto_tree_add_text(rsvp_tree, tvb, offset, msg_length - len, - "Bundle Component Messages Not Dissected"); - } - return; + /* Bundle message. Dissect component messages */ + if (rsvp_bundle_dissect) { + int len2 = 8; + while (len2 < msg_length) { + gint sub_len; + tvbuff_t *tvb_sub; + sub_len = tvb_get_ntohs(tvb, len2+6); + tvb_sub = tvb_new_subset(tvb, len2, sub_len, sub_len); + dissect_rsvp_msg_tree(tvb_sub, pinfo, rsvp_tree, TREE(TT_BUNDLE_COMPMSG), rsvph); + len2 += sub_len; + } + } else { + proto_tree_add_text(rsvp_tree, tvb, offset, msg_length - len, + "Bundle Component Messages Not Dissected"); + } + return; } while (len < msg_length) { - guint8 rsvp_class; - guint8 type; + guint8 rsvp_class; + guint8 type; - obj_length = tvb_get_ntohs(tvb, offset); - rsvp_class = tvb_get_guint8(tvb, offset+2); - type = tvb_get_guint8(tvb, offset+3); - ti = proto_tree_add_item(rsvp_tree, hf_rsvp_filter[rsvp_class_to_filter_num(rsvp_class)], - tvb, offset, obj_length, ENC_BIG_ENDIAN); - rsvp_object_tree = proto_item_add_subtree(ti, TREE(rsvp_class_to_tree_type(rsvp_class))); - if (obj_length < 4) { - proto_tree_add_text(rsvp_object_tree, tvb, offset, 2, - "Length: %u (bogus, must be >= 4)", obj_length); - break; - } - proto_tree_add_text(rsvp_object_tree, tvb, offset, 2, - "Length: %u", obj_length); - proto_tree_add_uint(rsvp_object_tree, hf_rsvp_filter[RSVPF_OBJECT], tvb, - offset+2, 1, rsvp_class); + obj_length = tvb_get_ntohs(tvb, offset); + rsvp_class = tvb_get_guint8(tvb, offset+2); + type = tvb_get_guint8(tvb, offset+3); + ti = proto_tree_add_item(rsvp_tree, hf_rsvp_filter[rsvp_class_to_filter_num(rsvp_class)], + tvb, offset, obj_length, ENC_BIG_ENDIAN); + rsvp_object_tree = proto_item_add_subtree(ti, TREE(rsvp_class_to_tree_type(rsvp_class))); + if (obj_length < 4) { + proto_tree_add_text(rsvp_object_tree, tvb, offset, 2, + "Length: %u (bogus, must be >= 4)", obj_length); + break; + } + proto_tree_add_text(rsvp_object_tree, tvb, offset, 2, + "Length: %u", obj_length); + proto_tree_add_uint(rsvp_object_tree, hf_rsvp_filter[RSVPF_OBJECT], tvb, + offset+2, 1, rsvp_class); - offset2 = offset+4; + offset2 = offset+4; - switch(rsvp_class) { + switch(rsvp_class) { - case RSVP_CLASS_SESSION: - dissect_rsvp_session(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type, rsvph); - break; + case RSVP_CLASS_SESSION: + dissect_rsvp_session(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type, rsvph); + break; - case RSVP_CLASS_HOP: - dissect_rsvp_hop(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_HOP: + dissect_rsvp_hop(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_TIME_VALUES: - dissect_rsvp_time_values(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_TIME_VALUES: + dissect_rsvp_time_values(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_ERROR: - dissect_rsvp_error(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_ERROR: + dissect_rsvp_error(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_SCOPE: - dissect_rsvp_scope(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_SCOPE: + dissect_rsvp_scope(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_STYLE: - dissect_rsvp_style(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_STYLE: + dissect_rsvp_style(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_CONFIRM: - dissect_rsvp_confirm(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_CONFIRM: + dissect_rsvp_confirm(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_SENDER_TEMPLATE: - case RSVP_CLASS_FILTER_SPEC: - dissect_rsvp_template_filter(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type, rsvph); - break; + case RSVP_CLASS_SENDER_TEMPLATE: + case RSVP_CLASS_FILTER_SPEC: + dissect_rsvp_template_filter(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type, rsvph); + break; - case RSVP_CLASS_SENDER_TSPEC: - dissect_rsvp_tspec(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_SENDER_TSPEC: + dissect_rsvp_tspec(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_FLOWSPEC: - dissect_rsvp_flowspec(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_FLOWSPEC: + dissect_rsvp_flowspec(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_ADSPEC: - dissect_rsvp_adspec(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_ADSPEC: + dissect_rsvp_adspec(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_INTEGRITY: - dissect_rsvp_integrity(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_INTEGRITY: + dissect_rsvp_integrity(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_POLICY: - dissect_rsvp_policy(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_POLICY: + dissect_rsvp_policy(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_LABEL_REQUEST: - dissect_rsvp_label_request(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_LABEL_REQUEST: + dissect_rsvp_label_request(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_RECOVERY_LABEL: - case RSVP_CLASS_UPSTREAM_LABEL: - case RSVP_CLASS_SUGGESTED_LABEL: - case RSVP_CLASS_LABEL: - dissect_rsvp_label(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_RECOVERY_LABEL: + case RSVP_CLASS_UPSTREAM_LABEL: + case RSVP_CLASS_SUGGESTED_LABEL: + case RSVP_CLASS_LABEL: + dissect_rsvp_label(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_LABEL_SET: - dissect_rsvp_label_set(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_LABEL_SET: + dissect_rsvp_label_set(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_SESSION_ATTRIBUTE: - dissect_rsvp_session_attribute(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_SESSION_ATTRIBUTE: + dissect_rsvp_session_attribute(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_EXPLICIT_ROUTE: - dissect_rsvp_explicit_route(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_EXPLICIT_ROUTE: + dissect_rsvp_explicit_route(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_RECORD_ROUTE: - dissect_rsvp_record_route(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_RECORD_ROUTE: + dissect_rsvp_record_route(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_MESSAGE_ID: - dissect_rsvp_message_id(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_MESSAGE_ID: + dissect_rsvp_message_id(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_MESSAGE_ID_ACK: - dissect_rsvp_message_id_ack(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_MESSAGE_ID_ACK: + dissect_rsvp_message_id_ack(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_MESSAGE_ID_LIST: - dissect_rsvp_message_id_list(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_MESSAGE_ID_LIST: + dissect_rsvp_message_id_list(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_HELLO: - dissect_rsvp_hello(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_HELLO: + dissect_rsvp_hello(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_DCLASS: - dissect_rsvp_dclass(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_DCLASS: + dissect_rsvp_dclass(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_ADMIN_STATUS: - dissect_rsvp_admin_status(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_ADMIN_STATUS: + dissect_rsvp_admin_status(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_LSP_ATTRIBUTES: - case RSVP_CLASS_LSP_REQUIRED_ATTRIBUTES: - dissect_rsvp_lsp_attributes(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_LSP_ATTRIBUTES: + case RSVP_CLASS_LSP_REQUIRED_ATTRIBUTES: + dissect_rsvp_lsp_attributes(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_ASSOCIATION: - dissect_rsvp_association(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_ASSOCIATION: + dissect_rsvp_association(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_LSP_TUNNEL_IF_ID: - dissect_rsvp_lsp_tunnel_if_id(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_LSP_TUNNEL_IF_ID: + dissect_rsvp_lsp_tunnel_if_id(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_NOTIFY_REQUEST: - dissect_rsvp_notify_request(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_NOTIFY_REQUEST: + dissect_rsvp_notify_request(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_GENERALIZED_UNI: - dissect_rsvp_gen_uni(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type, rsvph); - break; + case RSVP_CLASS_GENERALIZED_UNI: + dissect_rsvp_gen_uni(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type, rsvph); + break; - case RSVP_CLASS_CALL_ID: - dissect_rsvp_call_id(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_CALL_ID: + dissect_rsvp_call_id(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_RESTART_CAP: - dissect_rsvp_restart_cap(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_RESTART_CAP: + dissect_rsvp_restart_cap(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_PROTECTION: - dissect_rsvp_protection_info(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_PROTECTION: + dissect_rsvp_protection_info(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_FAST_REROUTE: - dissect_rsvp_fast_reroute(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_FAST_REROUTE: + dissect_rsvp_fast_reroute(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_DETOUR: - dissect_rsvp_detour(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_DETOUR: + dissect_rsvp_detour(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_DIFFSERV: - dissect_rsvp_diffserv(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_DIFFSERV: + dissect_rsvp_diffserv(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; - case RSVP_CLASS_CLASSTYPE: - dissect_rsvp_diffserv_aware_te(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); - break; + case RSVP_CLASS_CLASSTYPE: + dissect_rsvp_diffserv_aware_te(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); + break; case RSVP_CLASS_VENDOR_PRIVATE_1: case RSVP_CLASS_VENDOR_PRIVATE_2: @@ -6568,15 +6604,15 @@ dissect_rsvp_msg_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dissect_rsvp_vendor_private_use(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; - case RSVP_CLASS_NULL: - default: - proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, - "Data (%d bytes)", obj_length - 4); - break; - } + case RSVP_CLASS_NULL: + default: + proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + break; + } - offset += obj_length; - len += obj_length; + offset += obj_length; + len += obj_length; } } @@ -6587,13 +6623,12 @@ static void dissect_rsvp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { guint8 message_type; - int session_off, tempfilt_off; - rsvp_conversation_info *rsvph; + int session_off, tempfilt_off; - - conversation_t *conversation; - struct rsvp_request_key request_key, *new_request_key; - struct rsvp_request_val *request_val = NULL; + rsvp_conversation_info *rsvph; + conversation_t *conversation; + struct rsvp_request_key request_key, *new_request_key; + struct rsvp_request_val *request_val; col_set_str(pinfo->cinfo, COL_PROTOCOL, (pinfo->ipproto == IP_PROTO_RSVPE2EI) ? "RSVP-E2EI" : "RSVP"); @@ -6608,28 +6643,20 @@ dissect_rsvp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) SET_ADDRESS(&rsvph->destination, pinfo->dst.type, pinfo->dst.len, pinfo->dst.data); col_add_str(pinfo->cinfo, COL_INFO, - val_to_str(message_type, message_type_vals, "Unknown (%u). ")); - find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off); - if (session_off) - col_append_str(pinfo->cinfo, COL_INFO, summary_session(tvb, session_off)); - if (tempfilt_off) - col_append_str(pinfo->cinfo, COL_INFO, summary_template(tvb, tempfilt_off)); + val_to_str_ext(message_type, &message_type_vals_ext, "Unknown (%u). ")); - - col_add_str(pinfo->cinfo, COL_INFO, - val_to_str(message_type, message_type_vals, "Unknown (%u). ")); - if (message_type == RSVP_MSG_BUNDLE) { - col_set_str(pinfo->cinfo, COL_INFO, - rsvp_bundle_dissect ? - "Component Messages Dissected" : - "Component Messages Not Dissected"); - } else { - find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off); - if (session_off) - col_append_str(pinfo->cinfo, COL_INFO, summary_session(tvb, session_off)); - if (tempfilt_off) - col_append_str(pinfo->cinfo, COL_INFO, summary_template(tvb, tempfilt_off)); - } + if (message_type == RSVP_MSG_BUNDLE) { + col_set_str(pinfo->cinfo, COL_INFO, + rsvp_bundle_dissect ? + "Component Messages Dissected" : + "Component Messages Not Dissected"); + } else { + find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off); + if (session_off) + col_append_str(pinfo->cinfo, COL_INFO, summary_session(tvb, session_off)); + if (tempfilt_off) + col_append_str(pinfo->cinfo, COL_INFO, summary_template(tvb, tempfilt_off)); + } if (tree) { dissect_rsvp_msg_tree(tvb, pinfo, tree, TREE(TT_RSVP), rsvph); @@ -6637,9 +6664,9 @@ dissect_rsvp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* ACK, SREFRESH and HELLO messages don't have any associated SESSION and, therefore, no conversation */ - if (message_type == RSVP_MSG_ACK || - message_type == RSVP_MSG_SREFRESH || - message_type == RSVP_MSG_HELLO) + if ((message_type == RSVP_MSG_ACK) || + (message_type == RSVP_MSG_SREFRESH) || + (message_type == RSVP_MSG_HELLO)) return; /* Find out what conversation this packet is part of. */ @@ -6652,53 +6679,53 @@ dissect_rsvp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) switch (request_key.session_type) { case RSVP_SESSION_TYPE_IPV4: - SET_ADDRESS(&request_key.u.session_ipv4.destination, - rsvph->destination.type, rsvph->destination.len, - rsvph->destination.data); - request_key.u.session_ipv4.protocol = rsvph->protocol; - request_key.u.session_ipv4.udp_dest_port = rsvph->udp_dest_port; - break; + SET_ADDRESS(&request_key.u.session_ipv4.destination, + rsvph->destination.type, rsvph->destination.len, + rsvph->destination.data); + request_key.u.session_ipv4.protocol = rsvph->protocol; + request_key.u.session_ipv4.udp_dest_port = rsvph->udp_dest_port; + break; case RSVP_SESSION_TYPE_IPV6: - /* Not supported yet */ - break; + /* Not supported yet */ + break; case RSVP_SESSION_TYPE_IPV4_LSP: - SET_ADDRESS(&request_key.u.session_ipv4_lsp.destination, - rsvph->destination.type, rsvph->destination.len, - rsvph->destination.data); - request_key.u.session_ipv4_lsp.udp_dest_port = rsvph->udp_dest_port; - request_key.u.session_ipv4_lsp.ext_tunnel_id = rsvph->ext_tunnel_id; - break; + SET_ADDRESS(&request_key.u.session_ipv4_lsp.destination, + rsvph->destination.type, rsvph->destination.len, + rsvph->destination.data); + request_key.u.session_ipv4_lsp.udp_dest_port = rsvph->udp_dest_port; + request_key.u.session_ipv4_lsp.ext_tunnel_id = rsvph->ext_tunnel_id; + break; case RSVP_SESSION_TYPE_AGGREGATE_IPV4: - SET_ADDRESS(&request_key.u.session_agg_ipv4.destination, - rsvph->destination.type, rsvph->destination.len, - rsvph->destination.data); - request_key.u.session_agg_ipv4.dscp = rsvph->dscp; - break; + SET_ADDRESS(&request_key.u.session_agg_ipv4.destination, + rsvph->destination.type, rsvph->destination.len, + rsvph->destination.data); + request_key.u.session_agg_ipv4.dscp = rsvph->dscp; + break; case RSVP_SESSION_TYPE_IPV4_UNI: - SET_ADDRESS(&request_key.u.session_ipv4_uni.destination, - rsvph->destination.type, rsvph->destination.len, - rsvph->destination.data); - request_key.u.session_ipv4_uni.udp_dest_port = rsvph->udp_dest_port; - request_key.u.session_ipv4_uni.ext_tunnel_id = rsvph->ext_tunnel_id; - break; + SET_ADDRESS(&request_key.u.session_ipv4_uni.destination, + rsvph->destination.type, rsvph->destination.len, + rsvph->destination.data); + request_key.u.session_ipv4_uni.udp_dest_port = rsvph->udp_dest_port; + request_key.u.session_ipv4_uni.ext_tunnel_id = rsvph->ext_tunnel_id; + break; case RSVP_SESSION_TYPE_IPV4_E_NNI: - SET_ADDRESS(&request_key.u.session_ipv4_enni.destination, - rsvph->destination.type, rsvph->destination.len, - rsvph->destination.data); - request_key.u.session_ipv4_enni.udp_dest_port = rsvph->udp_dest_port; - request_key.u.session_ipv4_enni.ext_tunnel_id = rsvph->ext_tunnel_id; - break; + SET_ADDRESS(&request_key.u.session_ipv4_enni.destination, + rsvph->destination.type, rsvph->destination.len, + rsvph->destination.data); + request_key.u.session_ipv4_enni.udp_dest_port = rsvph->udp_dest_port; + request_key.u.session_ipv4_enni.ext_tunnel_id = rsvph->ext_tunnel_id; + break; default: - /* This should never happen. */ + /* This should never happen. */ if (tree) { proto_tree_add_text(tree, tvb, 0, 0, "Unknown session type"); } - break; + break; } SE_COPY_ADDRESS(&request_key.source_info.source, &rsvph->source); @@ -6706,8 +6733,8 @@ dissect_rsvp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* See if a request with this key already exists */ request_val = - (struct rsvp_request_val *) g_hash_table_lookup(rsvp_request_hash, - &request_key); + (struct rsvp_request_val *) g_hash_table_lookup(rsvp_request_hash, + &request_key); /* If not, insert the new request key into the hash table */ if (!request_val) { @@ -6723,23 +6750,23 @@ dissect_rsvp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } static void -register_rsvp_prefs (void) +register_rsvp_prefs(void) { module_t *rsvp_module; rsvp_module = prefs_register_protocol(proto_rsvp, NULL); prefs_register_bool_preference( - rsvp_module, "process_bundle", - "Dissect sub-messages in BUNDLE message", - "Specifies whether Wireshark should decode and display sub-messages within BUNDLE messages", - &rsvp_bundle_dissect); + rsvp_module, "process_bundle", + "Dissect sub-messages in BUNDLE message", + "Specifies whether Wireshark should decode and display sub-messages within BUNDLE messages", + &rsvp_bundle_dissect); prefs_register_enum_preference( - rsvp_module, "generalized_label_options", - "Dissect generalized labels as", - "Specifies how Wireshark should dissect generalized labels", - (gint *)&rsvp_generalized_label_option, - rsvp_generalized_label_options, - FALSE); + rsvp_module, "generalized_label_options", + "Dissect generalized labels as", + "Specifies how Wireshark should dissect generalized labels", + (gint *)&rsvp_generalized_label_option, + rsvp_generalized_label_options, + FALSE); } void @@ -6751,374 +6778,550 @@ proto_register_rsvp(void) /* Message type number */ {&hf_rsvp_filter[RSVPF_MSG], - { "Message Type", "rsvp.msg", FT_UINT8, BASE_DEC, VALS(message_type_vals), 0x0, - NULL, HFILL }}, + { "Message Type", "rsvp.msg", + FT_UINT8, BASE_DEC | BASE_EXT_STRING, &message_type_vals_ext, 0x0, + NULL, HFILL } + }, /* Message type shorthands */ {&hf_rsvp_filter[RSVPF_PATH], - { "Path Message", "rsvp.path", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Path Message", "rsvp.path", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_RESV], - { "Resv Message", "rsvp.resv", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Resv Message", "rsvp.resv", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_PATHERR], - { "Path Error Message", "rsvp.perr", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Path Error Message", "rsvp.perr", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_RESVERR], - { "Resv Error Message", "rsvp.rerr", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Resv Error Message", "rsvp.rerr", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_PATHTEAR], - { "Path Tear Message", "rsvp.ptear", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Path Tear Message", "rsvp.ptear", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_RESVTEAR], - { "Resv Tear Message", "rsvp.rtear", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Resv Tear Message", "rsvp.rtear", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_RCONFIRM], - { "Resv Confirm Message", "rsvp.resvconf", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Resv Confirm Message", "rsvp.resvconf", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_RTEARCONFIRM], - { "Resv Tear Confirm Message", "rsvp.rtearconf", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Resv Tear Confirm Message", "rsvp.rtearconf", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_BUNDLE], - { "Bundle Message", "rsvp.bundle", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Bundle Message", "rsvp.bundle", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_ACK], - { "Ack Message", "rsvp.ack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Ack Message", "rsvp.ack", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_SREFRESH], - { "Srefresh Message", "rsvp.srefresh", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Srefresh Message", "rsvp.srefresh", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_HELLO], - { "HELLO Message", "rsvp.hello", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "HELLO Message", "rsvp.hello", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, /* Object class */ {&hf_rsvp_filter[RSVPF_OBJECT], - { "Object class", "rsvp.object", FT_UINT8, BASE_DEC, VALS(rsvp_class_vals), 0x0, - NULL, HFILL }}, + { "Object class", "rsvp.object", + FT_UINT8, BASE_DEC | BASE_EXT_STRING, &rsvp_class_vals_ext, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_NOTIFY], - { "Notify Message", "rsvp.notify", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Notify Message", "rsvp.notify", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, /* Object present shorthands */ {&hf_rsvp_filter[RSVPF_SESSION], - { "SESSION", "rsvp.session", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "SESSION", "rsvp.session", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_HOP], - { "HOP", "rsvp.hop", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "HOP", "rsvp.hop", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_HELLO_OBJ], - { "HELLO Request/Ack", "rsvp.hello_obj", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "HELLO Request/Ack", "rsvp.hello_obj", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_INTEGRITY], - { "INTEGRITY", "rsvp.integrity", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "INTEGRITY", "rsvp.integrity", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_TIME_VALUES], - { "TIME VALUES", "rsvp.time", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "TIME VALUES", "rsvp.time", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_ERROR], - { "ERROR", "rsvp.error", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "ERROR", "rsvp.error", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_SCOPE], - { "SCOPE", "rsvp.scope", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "SCOPE", "rsvp.scope", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_STYLE], - { "STYLE", "rsvp.style", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "STYLE", "rsvp.style", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_FLOWSPEC], - { "FLOWSPEC", "rsvp.flowspec", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "FLOWSPEC", "rsvp.flowspec", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_FILTER_SPEC], - { "FILTERSPEC", "rsvp.filter", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "FILTERSPEC", "rsvp.filter", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_SENDER], - { "SENDER TEMPLATE", "rsvp.sender", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "SENDER TEMPLATE", "rsvp.sender", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_TSPEC], - { "SENDER TSPEC", "rsvp.tspec", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "SENDER TSPEC", "rsvp.tspec", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_ADSPEC], - { "ADSPEC", "rsvp.adspec", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "ADSPEC", "rsvp.adspec", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_POLICY], - { "POLICY", "rsvp.policy", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "POLICY", "rsvp.policy", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_CONFIRM], - { "CONFIRM", "rsvp.confirm", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "CONFIRM", "rsvp.confirm", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_LABEL], - { "LABEL", "rsvp.label", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "LABEL", "rsvp.label", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_RECOVERY_LABEL], - { "RECOVERY LABEL", "rsvp.recovery_label", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "RECOVERY LABEL", "rsvp.recovery_label", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_UPSTREAM_LABEL], - { "UPSTREAM LABEL", "rsvp.upstream_label", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "UPSTREAM LABEL", "rsvp.upstream_label", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_SUGGESTED_LABEL], - { "SUGGESTED LABEL", "rsvp.suggested_label", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "SUGGESTED LABEL", "rsvp.suggested_label", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_LABEL_SET], - { "LABEL SET", "rsvp.label_set", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "LABEL SET", "rsvp.label_set", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_ACCEPTABLE_LABEL_SET], - { "ACCEPTABLE LABEL SET", "rsvp.acceptable_label_set", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "ACCEPTABLE LABEL SET", "rsvp.acceptable_label_set", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_PROTECTION], - { "PROTECTION", "rsvp.protection", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "PROTECTION", "rsvp.protection", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_DIFFSERV], - { "DIFFSERV", "rsvp.diffserv", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "DIFFSERV", "rsvp.diffserv", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_DSTE], - { "CLASSTYPE", "rsvp.dste", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "CLASSTYPE", "rsvp.dste", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_RESTART_CAP], - { "RESTART CAPABILITY", "rsvp.restart", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "RESTART CAPABILITY", "rsvp.restart", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_LABEL_REQUEST], - { "LABEL REQUEST", "rsvp.label_request", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "LABEL REQUEST", "rsvp.label_request", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_SESSION_ATTRIBUTE], - { "SESSION ATTRIBUTE", "rsvp.session_attribute", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "SESSION ATTRIBUTE", "rsvp.session_attribute", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_EXPLICIT_ROUTE], - { "EXPLICIT ROUTE", "rsvp.explicit_route", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "EXPLICIT ROUTE", "rsvp.explicit_route", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_RECORD_ROUTE], - { "RECORD ROUTE", "rsvp.record_route", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "RECORD ROUTE", "rsvp.record_route", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_MESSAGE_ID], - { "MESSAGE-ID", "rsvp.msgid", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "MESSAGE-ID", "rsvp.msgid", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_MESSAGE_ID_ACK], - { "MESSAGE-ID ACK", "rsvp.msgid_ack", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "MESSAGE-ID ACK", "rsvp.msgid_ack", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_MESSAGE_ID_LIST], - { "MESSAGE-ID LIST", "rsvp.msgid_list", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "MESSAGE-ID LIST", "rsvp.msgid_list", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_DCLASS], - { "DCLASS", "rsvp.dclass", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "DCLASS", "rsvp.dclass", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_LSP_TUNNEL_IF_ID], - { "LSP INTERFACE-ID", "rsvp.lsp_tunnel_if_id", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "LSP INTERFACE-ID", "rsvp.lsp_tunnel_if_id", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_ADMIN_STATUS], - { "ADMIN STATUS", "rsvp.admin_status", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "ADMIN STATUS", "rsvp.admin_status", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, - {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_REFLECT], - { "Reflect", "rsvp.admin_status.reflect", FT_BOOLEAN, 32, NULL, 0x80000000, - NULL, HFILL }}, + {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_REFLECT], + { "Reflect", "rsvp.admin_status.reflect", + FT_BOOLEAN, 32, NULL, 0x80000000, + NULL, HFILL } + }, - {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_HANDOVER], - { "Handover", "rsvp.admin_status.handover", FT_BOOLEAN, 32, NULL, 0x40, - NULL, HFILL }}, + {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_HANDOVER], + { "Handover", "rsvp.admin_status.handover", + FT_BOOLEAN, 32, NULL, 0x40, + NULL, HFILL } + }, - {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_LOCKOUT], - { "Lockout", "rsvp.admin_status.lockout", FT_BOOLEAN, 32, NULL, 0x20, - NULL, HFILL }}, + {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_LOCKOUT], + { "Lockout", "rsvp.admin_status.lockout", + FT_BOOLEAN, 32, NULL, 0x20, + NULL, HFILL } + }, - {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_INHIBIT], - { "Inhibit Alarm Communication", "rsvp.admin_status.inhibit", FT_BOOLEAN, 32, NULL, 0x10, - NULL, HFILL }}, + {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_INHIBIT], + { "Inhibit Alarm Communication", "rsvp.admin_status.inhibit", + FT_BOOLEAN, 32, NULL, 0x10, + NULL, HFILL } + }, - {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_CALL_MGMT], - { "Call Management", "rsvp.admin_status.callmgmt", FT_BOOLEAN, 32, NULL, 0x08, - NULL, HFILL }}, + {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_CALL_MGMT], + { "Call Management", "rsvp.admin_status.callmgmt", + FT_BOOLEAN, 32, NULL, 0x08, + NULL, HFILL } + }, - {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_TESTING], - { "Testing", "rsvp.admin_status.testing", FT_BOOLEAN, 32, NULL, 0x04, - NULL, HFILL }}, + {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_TESTING], + { "Testing", "rsvp.admin_status.testing", + FT_BOOLEAN, 32, NULL, 0x04, + NULL, HFILL } + }, - {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_DOWN], - { "Administratively down", "rsvp.admin_status.down", FT_BOOLEAN, 32, NULL, 0x02, - NULL, HFILL }}, + {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_DOWN], + { "Administratively down", "rsvp.admin_status.down", + FT_BOOLEAN, 32, NULL, 0x02, + NULL, HFILL } + }, - {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_DELETE], - { "Delete in progress", "rsvp.admin_status.delete", FT_BOOLEAN, 32, NULL, 0x01, - NULL, HFILL }}, + {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_DELETE], + { "Delete in progress", "rsvp.admin_status.delete", + FT_BOOLEAN, 32, NULL, 0x01, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_LSP_ATTRIBUTES], - { "LSP ATTRIBUTES", "rsvp.lsp_attributes", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "LSP ATTRIBUTES", "rsvp.lsp_attributes", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_ASSOCIATION], - { "ASSOCIATION", "rsvp.association", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "ASSOCIATION", "rsvp.association", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_NOTIFY_REQUEST], - { "NOTIFY REQUEST", "rsvp.notify_request", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "NOTIFY REQUEST", "rsvp.notify_request", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_GENERALIZED_UNI], - { "GENERALIZED UNI", "rsvp.generalized_uni", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "GENERALIZED UNI", "rsvp.generalized_uni", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_CALL_ID], - { "CALL ID", "rsvp.call_id", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "CALL ID", "rsvp.call_id", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_PRIVATE_OBJ], - { "Private object", "rsvp.obj_private", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Private object", "rsvp.obj_private", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_UNKNOWN_OBJ], - { "Unknown object", "rsvp.obj_unknown", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Unknown object", "rsvp.obj_unknown", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, /* Session fields */ {&hf_rsvp_filter[RSVPF_SESSION_IP], - { "Destination address", "rsvp.session.ip", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Destination address", "rsvp.session.ip", + FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_SESSION_PORT], - { "Port number", "rsvp.session.port", FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, + { "Port number", "rsvp.session.port", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_SESSION_PROTO], - { "Protocol", "rsvp.session.proto", FT_UINT8, BASE_DEC, VALS(proto_vals), 0x0, - NULL, HFILL }}, + { "Protocol", "rsvp.session.proto", + FT_UINT8, BASE_DEC, VALS(proto_vals), 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_SESSION_TUNNEL_ID], - { "Tunnel ID", "rsvp.session.tunnel_id", FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, + { "Tunnel ID", "rsvp.session.tunnel_id", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID], - { "Extended tunnel ID", "rsvp.session.ext_tunnel_id", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, + { "Extended tunnel ID", "rsvp.session.ext_tunnel_id", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, /* Sender template/Filterspec fields */ {&hf_rsvp_filter[RSVPF_SENDER_IP], - { "Sender IPv4 address", "rsvp.sender.ip", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Sender IPv4 address", "rsvp.sender.ip", + FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_SENDER_PORT], - { "Sender port number", "rsvp.sender.port", FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, + { "Sender port number", "rsvp.sender.port", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_SENDER_LSP_ID], - { "Sender LSP ID", "rsvp.sender.lsp_id", FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, + { "Sender LSP ID", "rsvp.sender.lsp_id", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, /* Diffserv object fields */ {&hf_rsvp_filter[RSVPF_DIFFSERV_MAPNB], - { "MAPnb", "rsvp.diffserv.mapnb", FT_UINT8, BASE_DEC, NULL, 0x0, - MAPNB_DESCRIPTION, HFILL }}, + { "MAPnb", "rsvp.diffserv.mapnb", + FT_UINT8, BASE_DEC, NULL, 0x0, + MAPNB_DESCRIPTION, HFILL } + }, {&hf_rsvp_filter[RSVPF_DIFFSERV_MAP], - { "MAP", "rsvp.diffserv.map", FT_NONE, BASE_NONE, NULL, 0x0, - MAP_DESCRIPTION, HFILL }}, + { "MAP", "rsvp.diffserv.map", + FT_NONE, BASE_NONE, NULL, 0x0, + MAP_DESCRIPTION, HFILL } + }, {&hf_rsvp_filter[RSVPF_DIFFSERV_MAP_EXP], - { "EXP", "rsvp.diffserv.map.exp", FT_UINT8, BASE_DEC, NULL, 0x0, - EXP_DESCRIPTION, HFILL }}, + { "EXP", "rsvp.diffserv.map.exp", + FT_UINT8, BASE_DEC, NULL, 0x0, + EXP_DESCRIPTION, HFILL } + }, {&hf_rsvp_filter[RSVPF_DIFFSERV_PHBID], - { PHBID_DESCRIPTION, "rsvp.diffserv.phbid", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { PHBID_DESCRIPTION, "rsvp.diffserv.phbid", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_DSCP], - { PHBID_DSCP_DESCRIPTION, "rsvp.diffserv.phbid.dscp", FT_UINT16, - BASE_DEC, NULL, PHBID_DSCP_MASK, NULL, HFILL }}, + { PHBID_DSCP_DESCRIPTION, "rsvp.diffserv.phbid.dscp", + FT_UINT16, BASE_DEC, NULL, PHBID_DSCP_MASK, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_CODE], - { PHBID_CODE_DESCRIPTION, "rsvp.diffserv.phbid.code", FT_UINT16, - BASE_DEC, NULL, PHBID_CODE_MASK, NULL, HFILL }}, + { PHBID_CODE_DESCRIPTION, "rsvp.diffserv.phbid.code", + FT_UINT16, BASE_DEC, NULL, PHBID_CODE_MASK, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT14], - { PHBID_BIT14_DESCRIPTION, "rsvp.diffserv.phbid.bit14", FT_UINT16, - BASE_DEC, VALS(phbid_bit14_vals), PHBID_BIT14_MASK, NULL, HFILL }}, + { PHBID_BIT14_DESCRIPTION, "rsvp.diffserv.phbid.bit14", + FT_UINT16, BASE_DEC, VALS(phbid_bit14_vals), PHBID_BIT14_MASK, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT15], - { PHBID_BIT15_DESCRIPTION, "rsvp.diffserv.phbid.bit15", FT_UINT16, - BASE_DEC, VALS(phbid_bit15_vals), PHBID_BIT15_MASK, NULL, HFILL }}, + { PHBID_BIT15_DESCRIPTION, "rsvp.diffserv.phbid.bit15", + FT_UINT16, BASE_DEC, VALS(phbid_bit15_vals), PHBID_BIT15_MASK, + NULL, HFILL } + }, /* Diffserv-aware TE object field */ {&hf_rsvp_filter[RSVPF_DSTE_CLASSTYPE], - { "CT", "rsvp.dste.classtype", FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, + { "CT", "rsvp.dste.classtype", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, /* Generalized UNI object field */ {&hf_rsvp_filter[RSVPF_GUNI_SRC_IPV4], - { "Source TNA", "rsvp.guni.srctna.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Source TNA", "rsvp.guni.srctna.ipv4", + FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_GUNI_DST_IPV4], - { "Destination TNA", "rsvp.guni.dsttna.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Destination TNA", "rsvp.guni.dsttna.ipv4", + FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_GUNI_SRC_IPV6], - { "Source TNA", "rsvp.guni.srctna.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Source TNA", "rsvp.guni.srctna.ipv6", + FT_IPv6, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_GUNI_DST_IPV6], - { "Destination TNA", "rsvp.guni.dsttna.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + { "Destination TNA", "rsvp.guni.dsttna.ipv6", + FT_IPv6, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, /* Generalized UNI object field */ {&hf_rsvp_filter[RSVPF_CALL_ID_SRC_ADDR_IPV4], - { "Source Transport Network Address", "rsvp.callid.srcaddr.ipv4", FT_IPv4, - BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { "Source Transport Network Address", "rsvp.callid.srcaddr.ipv4", + FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, {&hf_rsvp_filter[RSVPF_CALL_ID_SRC_ADDR_IPV6], - { "Source Transport Network Address", "rsvp.callid.srcaddr.ipv6", FT_IPv6, - BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { "Source Transport Network Address", "rsvp.callid.srcaddr.ipv6", + FT_IPv6, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, /* * FF: Vendor Private object field, please see * http://www.iana.org/assignments/enterprise-numbers */ {&hf_rsvp_filter[RSVPF_ENT_CODE], - { "Enterprise Code", - "rsvp.obj_private.enterprise", FT_UINT32, - BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0x0, - "IANA Network Management Private Enterprise Code", HFILL }} + { "Enterprise Code", "rsvp.obj_private.enterprise", + FT_UINT32, BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0x0, + "IANA Network Management Private Enterprise Code", HFILL } + } }; gint *ett_tree[TT_MAX]; @@ -7126,16 +7329,16 @@ proto_register_rsvp(void) /* Build the tree array */ for (i=0; i