2 * Routines for RSVP packet disassembly
4 * (c) Copyright Ashok Narayanan <ashokn@cisco.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 * This module defines routines to disassemble RSVP packets, as defined in
31 * RFC 2205. All objects from RFC2205 are supported, in IPv4 and IPv6 mode.
32 * In addition, the Integrated Services traffic specification objects
33 * defined in RFC2210 are also supported.
35 * IPv6 support is not completely tested
37 * Mar 3, 2000: Added support for MPLS/TE objects, as defined in
38 * <draft-ietf-mpls-rsvp-lsp-tunnel-04.txt>
40 * May 6, 2004: Added support for E-NNI objects, as defined in
41 * <OIF-E-NNI-01.0> (Roberto Morro)
42 * <roberto.morro[AT]tilab.com>
44 * May 6, 2004: Modified some UNI objects, as defined in
45 * <OIF2003.249.09> (Roberto Morro)
46 * <roberto.morro[AT]tilab.com>
48 * June 2, 2005: Modified more UNI objects to show correct TNA
49 * addresses; Fixed LSP interface ID subobject (Richard Rabbat)
50 * <richard[AT]us.fujitsu.com>
52 * July 25, 2005: improved ERROR and LABEL_SET objects dissector;
53 * new ASSOCIATION object dissector (Roberto Morro)
54 * <roberto.morro[AT]tilab.com>
56 * August 22, 2005: added support for tapping and conversations.
57 * (Manu Pathak) <mapathak[AT]cisco.com>
59 * July 4, 2006: added support for RFC4124; new CLASSTYPE object dissector
60 * (FF) <francesco.fondelli[AT]gmail.com>
62 * June 9, 2007: added support for draft-ietf-ccamp-ethernet-traffic-parameters-02
63 * and draft-ietf-ccamp-lsp-hierarchy-bis-02; added support for NOTIFY_REQUEST
64 * and RECOVERY_LABEL objects (Roberto Morro) * <roberto.morro[AT]tilab.com>
83 #include <epan/tvbuff.h>
84 #include <epan/packet.h>
86 #include <epan/in_cksum.h>
87 #include <epan/etypes.h>
88 #include <epan/ipproto.h>
89 #include <epan/conversation.h>
91 #include <epan/emem.h>
93 #include "packet-rsvp.h"
94 #include "packet-ip.h"
95 #include "packet-frame.h"
96 #include "packet-diffserv-mpls-common.h"
98 /* RSVP over UDP encapsulation */
99 #define UDP_PORT_PRSVP 3455
101 static int proto_rsvp = -1;
103 static dissector_table_t rsvp_dissector_table;
104 static dissector_handle_t data_handle;
106 static int rsvp_tap = -1;
109 * All RSVP packets belonging to a particular flow belong to the same
110 * conversation. The following structure definitions are for auxillary
111 * structures which have all the relevant flow information to make up the
112 * RSVP five-tuple. Note that the values of the five-tuple are determined
113 * from the session object and sender template/filter spec for PATH/RESV
115 * Update rsvp_request_equal() when you add stuff here. You might also
116 * have to update rsvp_request_hash().
117 * TODO: Support for IPv6 conversations.
120 typedef struct rsvp_session_ipv4_info {
123 guint16 udp_dest_port;
124 } rsvp_session_ipv4_info;
126 typedef struct rsvp_session_ipv6_info {
127 /* not supported yet */
130 } rsvp_session_ipv6_info;
132 typedef struct rsvp_session_ipv4_lsp_info {
134 guint16 udp_dest_port;
135 guint32 ext_tunnel_id;
136 } rsvp_session_ipv4_lsp_info;
138 typedef struct rsvp_session_agg_ipv4_info {
141 } rsvp_session_agg_ipv4_info;
143 typedef struct rsvp_session_ipv4_uni_info {
145 guint16 udp_dest_port;
146 guint32 ext_tunnel_id;
147 } rsvp_session_ipv4_uni_info;
149 typedef struct rsvp_session_ipv4_enni_info {
151 guint16 udp_dest_port;
152 guint32 ext_tunnel_id;
153 } rsvp_session_ipv4_enni_info;
155 typedef struct rsvp_template_filter_info {
157 guint16 udp_source_port;
158 } rsvp_template_filter_info;
161 * The actual request key consists of a union of the various session objects
162 * (which are uniquely identified based on the session type), and the
163 * source_info structure, which has the information derived from the sender
164 * template or the filter spec.
165 * The request key is populated by copying the information from the
166 * rsvp_conversation_info structure (rsvph), which in turn is populated when
167 * the session, filter and sender template objects are dissected.
169 struct rsvp_request_key {
170 guint32 session_type;
172 union { /* differentiated by session_type field */
173 rsvp_session_ipv4_info session_ipv4;
174 rsvp_session_ipv6_info session_ipv6;
175 rsvp_session_ipv4_lsp_info session_ipv4_lsp;
176 rsvp_session_agg_ipv4_info session_agg_ipv4;
177 rsvp_session_ipv4_uni_info session_ipv4_uni;
178 rsvp_session_ipv4_enni_info session_ipv4_enni;
181 rsvp_template_filter_info source_info;
182 guint32 conversation;
186 * At present, there is nothing particularly important that we need to
187 * store for the request value for each rsvp_request_key, so we just
188 * store the unique 32-bit identifier internally allocated for the key
189 * (and stored in the conversation attribute of rsvp_request_key above.
190 * If this changes in the future, then other stuff can be added here.
192 struct rsvp_request_val {
197 * Initialize the conversation related data structures.
199 static GHashTable *rsvp_request_hash = NULL;
202 * The list of tree types
230 TT_LSP_TUNNEL_IF_ID_SUBTREE,
238 TT_SESSION_ATTRIBUTE,
239 TT_SESSION_ATTRIBUTE_FLAGS,
242 TT_EXPLICIT_ROUTE_SUBOBJ,
244 TT_RECORD_ROUTE_SUBOBJ,
245 TT_RECORD_ROUTE_SUBOBJ_FLAGS,
247 TT_ADMIN_STATUS_FLAGS,
256 TT_FAST_REROUTE_FLAGS,
260 TT_DIFFSERV_MAP_PHBID,
266 static gint ett_treelist[TT_MAX];
267 static gint *ett_tree[TT_MAX];
268 #define TREE(X) ett_treelist[(X)]
270 /* Should we dissect bundle messages? */
271 static gboolean rsvp_bundle_dissect = TRUE;
274 * RSVP message types.
277 * http://www.iana.org/assignments/rsvp-parameters
280 RSVP_MSG_PATH=1, /* RFC 2205 */
281 RSVP_MSG_RESV, /* RFC 2205 */
282 RSVP_MSG_PERR, /* RFC 2205 */
283 RSVP_MSG_RERR, /* RFC 2205 */
284 RSVP_MSG_PTEAR, /* RFC 2205 */
285 RSVP_MSG_RTEAR, /* RFC 2205 */
286 RSVP_MSG_CONFIRM, /* XXX - DREQ, RFC 2745? */
287 /* 9 is DREP, RFC 2745 */
288 RSVP_MSG_RTEAR_CONFIRM=10, /* from Fred Baker at Cisco */
289 /* 11 is unassigned */
290 RSVP_MSG_BUNDLE = 12, /* RFC 2961 */
291 RSVP_MSG_ACK, /* RFC 2961 */
293 RSVP_MSG_SREFRESH = 15, /* RFC 2961 */
294 /* 16, 17, 18, 19 not listed */
295 RSVP_MSG_HELLO = 20, /* RFC 3209 */
296 RSVP_MSG_NOTIFY /* [RFC3473] */
297 /* 25 is Integrity Challenge RFC 2747, RFC 3097 */
298 /* 26 is Integrity Response RFC 2747, RFC 3097 */
299 /* 66 is DSBM_willing [SBM] */
300 /* 67 is I_AM_DSBM [SBM] */
301 /* [SBM] is Subnet Bandwidth Manager ID from July 1997 */
302 } rsvp_message_types;
304 static const value_string message_type_vals[] = {
305 {RSVP_MSG_PATH, "PATH Message. "},
306 {RSVP_MSG_RESV, "RESV Message. "},
307 {RSVP_MSG_PERR, "PATH ERROR Message. "},
308 {RSVP_MSG_RERR, "RESV ERROR Message. "},
309 {RSVP_MSG_PTEAR, "PATH TEAR Message. "},
310 {RSVP_MSG_RTEAR, "RESV TEAR Message. "},
311 {RSVP_MSG_CONFIRM, "CONFIRM Message. "},
312 {RSVP_MSG_RTEAR_CONFIRM, "RESV TEAR CONFIRM Message. "},
313 {RSVP_MSG_BUNDLE, "BUNDLE Message. "},
314 {RSVP_MSG_ACK, "ACK Message. "},
315 {RSVP_MSG_SREFRESH, "SREFRESH Message. "},
316 {RSVP_MSG_HELLO, "HELLO Message. "},
317 {RSVP_MSG_NOTIFY, "NOTIFY Message. "},
324 #define MAX_RSVP_CLASS 15
331 RSVP_CLASS_INTEGRITY,
332 RSVP_CLASS_TIME_VALUES,
337 RSVP_CLASS_FILTER_SPEC,
338 RSVP_CLASS_SENDER_TEMPLATE,
339 RSVP_CLASS_SENDER_TSPEC,
344 RSVP_CLASS_HOP_COUNT,
345 RSVP_CLASS_STRICT_SOURCE_ROUTE,
346 RSVP_CLASS_LABEL_REQUEST=19,
347 RSVP_CLASS_EXPLICIT_ROUTE,
348 RSVP_CLASS_RECORD_ROUTE,
352 RSVP_CLASS_MESSAGE_ID,
353 RSVP_CLASS_MESSAGE_ID_ACK,
354 RSVP_CLASS_MESSAGE_ID_LIST,
356 /* 26-29 Unassigned */
358 RSVP_CLASS_DIAGNOSTIC = 30,
360 RSVP_CLASS_DIAG_RESPONSE,
361 RSVP_CLASS_DIAG_SELECT,
362 RSVP_CLASS_RECOVERY_LABEL,
363 RSVP_CLASS_UPSTREAM_LABEL,
364 RSVP_CLASS_LABEL_SET,
365 RSVP_CLASS_PROTECTION,
367 /* 38-41 Unassigned */
368 RSVP_CLASS_DSBM_IP_ADDRESS = 42,
369 RSVP_CLASS_SBM_PRIORITY,
370 RSVP_CLASS_DSBM_TIMER_INTERVALS,
373 /* 46-62 Unassigned */
375 RSVP_CLASS_DETOUR = 63,
376 RSVP_CLASS_CHALLENGE,
378 RSVP_CLASS_CLASSTYPE, /* FF: RFC4124 */
379 RSVP_CLASS_LSP_REQUIRED_ATTRIBUTES,
381 /* 68-127 Unassigned */
383 RSVP_CLASS_NODE_CHAR = 128,
384 RSVP_CLASS_SUGGESTED_LABEL,
385 RSVP_CLASS_ACCEPTABLE_LABEL_SET,
386 RSVP_CLASS_RESTART_CAP,
388 /* 132-160 Unassigned */
390 /* 166-191 Unassigned */
392 RSVP_CLASS_SESSION_ASSOC = 192,
393 RSVP_CLASS_LSP_TUNNEL_IF_ID,
395 RSVP_CLASS_NOTIFY_REQUEST = 195,
396 RSVP_CLASS_ADMIN_STATUS,
397 RSVP_CLASS_LSP_ATTRIBUTES,
398 /* IANA has this as 198 ALARM_SPEC ??? */
399 RSVP_CLASS_ASSOCIATION = 198,
401 /* 199-204 Unassigned */
402 RSVP_CLASS_FAST_REROUTE = 205,
404 RSVP_CLASS_SESSION_ATTRIBUTE = 207,
405 /* 208-223 Unassigned */
407 Class Numbers 224-255 are assigned by IANA using FCFS allocation.
408 RSVP will silently ignore, but FORWARD an object with a Class Number
409 in this range that it does not understand.
412 RSVP_CLASS_DCLASS = 225,
413 RSVP_CLASS_PACKETCABLE_EXTENSIONS,
414 RSVP_CLASS_ATM_SERVICECLASS,
416 RSVP_CLASS_GENERALIZED_UNI,
418 RSVP_CLASS_3GPP2_OBJECT
419 /* 232-254 Unassigned */
424 static const value_string rsvp_class_vals[] = {
425 {RSVP_CLASS_NULL, "NULL object"},
426 {RSVP_CLASS_SESSION, "SESSION object"},
427 {RSVP_CLASS_HOP, "HOP object"},
428 {RSVP_CLASS_INTEGRITY, "INTEGRITY object"},
429 {RSVP_CLASS_TIME_VALUES, "TIME VALUES object"},
430 {RSVP_CLASS_ERROR, "ERROR object"},
431 {RSVP_CLASS_SCOPE, "SCOPE object"},
432 {RSVP_CLASS_STYLE, "STYLE object"},
433 {RSVP_CLASS_FLOWSPEC, "FLOWSPEC object"},
434 {RSVP_CLASS_FILTER_SPEC, "FILTER SPEC object"},
435 {RSVP_CLASS_SENDER_TEMPLATE, "SENDER TEMPLATE object"},
436 {RSVP_CLASS_SENDER_TSPEC, "SENDER TSPEC object"},
437 {RSVP_CLASS_ADSPEC, "ADSPEC object"},
438 {RSVP_CLASS_POLICY, "POLICY object"},
439 {RSVP_CLASS_CONFIRM, "CONFIRM object"},
440 {RSVP_CLASS_LABEL, "LABEL object"},
441 {RSVP_CLASS_HOP_COUNT, "HOP_COUNT object"},
442 {RSVP_CLASS_STRICT_SOURCE_ROUTE, "STRICT_SOURCE_ROUTE object"},
443 {RSVP_CLASS_LABEL_REQUEST, "LABEL REQUEST object"},
444 {RSVP_CLASS_EXPLICIT_ROUTE, "EXPLICIT ROUTE object"},
445 {RSVP_CLASS_RECORD_ROUTE, "RECORD ROUTE object"},
446 {RSVP_CLASS_SESSION_ATTRIBUTE, "SESSION ATTRIBUTE object"},
447 {RSVP_CLASS_MESSAGE_ID, "MESSAGE-ID object"},
448 {RSVP_CLASS_MESSAGE_ID_ACK, "MESSAGE-ID ACK/NACK object"},
449 {RSVP_CLASS_MESSAGE_ID_LIST, "MESSAGE-ID LIST object"},
450 {RSVP_CLASS_HELLO, "HELLO object"},
451 {RSVP_CLASS_RECOVERY_LABEL, "RECOVERY-LABEL object"},
452 {RSVP_CLASS_UPSTREAM_LABEL, "UPSTREAM-LABEL object"},
453 {RSVP_CLASS_LABEL_SET, "LABEL-SET object"},
454 {RSVP_CLASS_PROTECTION, "PROTECTION object"},
455 {RSVP_CLASS_DIFFSERV, "DIFFSERV object"},
456 {RSVP_CLASS_CLASSTYPE, "CLASSTYPE object"},
457 {RSVP_CLASS_SUGGESTED_LABEL, "SUGGESTED-LABEL object"},
458 {RSVP_CLASS_ACCEPTABLE_LABEL_SET, "ACCEPTABLE-LABEL-SET object"},
459 {RSVP_CLASS_RESTART_CAP, "RESTART-CAPABILITY object"},
460 {RSVP_CLASS_DCLASS, "DCLASS object"},
461 {RSVP_CLASS_LSP_TUNNEL_IF_ID, "LSP-TUNNEL INTERFACE-ID object"},
462 {RSVP_CLASS_NOTIFY_REQUEST, "NOTIFY-REQUEST object"},
463 {RSVP_CLASS_ADMIN_STATUS, "ADMIN-STATUS object"},
464 {RSVP_CLASS_ASSOCIATION, "ASSOCIATION object"},
465 {RSVP_CLASS_GENERALIZED_UNI, "GENERALIZED-UNI object"},
466 {RSVP_CLASS_CALL_ID, "CALL-ID object"},
467 {RSVP_CLASS_DETOUR, "DETOUR object"},
468 {RSVP_CLASS_FAST_REROUTE, "FAST-REROUTE object"},
475 enum rsvp_error_types {
476 RSVP_ERROR_CONFIRM = 0,
477 RSVP_ERROR_ADMISSION,
480 RSVP_ERROR_NO_SENDER,
481 RSVP_ERROR_CONFLICT_RESV_STYLE,
482 RSVP_ERROR_UNKNOWN_RESV_STYLE,
483 RSVP_ERROR_CONFLICT_DEST_PORTS,
484 RSVP_ERROR_CONFLICT_SRC_PORTS,
485 RSVP_ERROR_PREEMPTED=12,
486 RSVP_ERROR_UNKNOWN_CLASS,
487 RSVP_ERROR_UNKNOWN_C_TYPE,
488 RSVP_ERROR_TRAFFIC = 21,
489 RSVP_ERROR_TRAFFIC_SYSTEM, /* 22 */
490 RSVP_ERROR_SYSTEM, /* 23 */
491 RSVP_ERROR_ROUTING, /* 24 */
492 RSVP_ERROR_NOTIFY, /* 25 */
493 RSVP_ERROR_DIFFSERV = 27,
494 RSVP_ERROR_DSTE = 28 /* FF: RFC4124 */
495 /*missing (11-2006) :
496 - 29 : Unknown Attributes TLV , RFC4420
497 - 30 : Unknown Attributes Bit RFC4420
498 - 31 : Alarms RFC-ietf-ccamp-gmpls-alarm-spec-06.txt
503 RSVP_AC_ERROR_DELAY_BOUND_ERROR = 1,
504 RSVP_AC_ERROR_BANDWITH_UNAVAILABLE,
505 RSVP_AC_ERROR_LARGE_MTU
509 RSVP_TRAFFIC_CONTROL_ERROR_SERVICE_CONFLICT = 1,
510 RSVP_TRAFFIC_CONTROL_ERROR_SERVIEC_UNSUPPORTED,
511 RSVP_TRAFFIC_CONTROL_ERROR_BAD_FLOWSPEC,
512 RSVP_TRAFFIC_CONTROL_ERROR_BAD_TSPEC,
513 RSVP_TRAFFIC_CONTROL_ERROR_BAD_ADSPEC
517 RSVP_ROUTING_ERROR_BAD_ERO = 1,
518 RSVP_ROUTING_ERROR_BAD_STRICT,
519 RSVP_ROUTING_ERROR_BAD_LOOSE,
520 RSVP_ROUTING_ERROR_BAD_INITIAL_SUBOBJ,
521 RSVP_ROUTING_ERROR_NO_ROUTE,
522 RSVP_ROUTING_ERROR_UNACCEPTABLE_LABEL,
523 RSVP_ROUTING_ERROR_RRO_LOOP,
524 RSVP_ROUTING_ERROR_NON_RSVP_CAPABLE_ROUTER,
525 RSVP_ROUTING_ERROR_LABEL_ALLOC_FAIL,
526 RSVP_ROUTING_ERROR_UNSUPPORTED_L3PID
530 RSVP_NOTIFY_ERROR_RRO_TOO_LARGE = 1,
531 RSVP_NOTIFY_ERROR_RRO_NOTIFICATION,
532 RSVP_NOTIFY_ERROR_RRO_TUNNEL_LOCAL_REPAIRED,
533 RSVP_NOTIFY_ERROR_RRO_CC_ACTIVE_STATE, /* RFC3473*/
534 RSVP_NOTIFY_ERROR_RRO_CC_DEGRADED_STATE, /* RFC3473*/
535 RSVP_NOTIFY_ERROR_LSP_FAILURE, /* Private */
536 RSVP_NOTIFY_ERROR_LSP_RECOVERED,/* Private */
537 RSVP_NOTIFY_ERROR_LSP_LOCAL_FAILURE/* Private */
542 RSVP_DIFFSERV_ERROR_UNEXPECTED_DIFFSERVOBJ = 1,
543 RSVP_DIFFSERV_ERROR_UNSUPPORTED_PHB,
544 RSVP_DIFFSERV_ERROR_INVALID_EXP_PHB_MAPPING,
545 RSVP_DIFFSERV_ERROR_UNSUPPORTED_PSC,
546 RSVP_DIFFSERV_ERROR_PERLSP_CONTEXT_ALLOC_FAIL
551 RSVP_DSTE_ERROR_UNEXPECTED_CLASSTYPEOBJ = 1,
552 RSVP_DSTE_ERROR_UNSUPPORTED_CLASSTYPE,
553 RSVP_DSTE_ERROR_INVALID_CLASSTYPE_VALUE,
554 RSVP_DSTE_ERROR_CT_SETUP_PRIO_NOT_CONFIGURED,
555 RSVP_DSTE_ERROR_CT_HOLDING_PRIO_NOT_CONFIGURED,
556 RSVP_DSTE_ERROR_CT_SETUP_PRIO_AND_CT_HOLDING_PRIO_NOT_CONFIGURED,
557 RSVP_DSTE_ERROR_INCONSISTENCY_PSC_CT,
558 RSVP_DSTE_ERROR_INCONSISTENCY_PHB_CT
561 static const value_string rsvp_error_codes[] = {
562 {RSVP_ERROR_CONFIRM, "Confirmation"},
563 {RSVP_ERROR_ADMISSION, "Admission Control Failure "},
564 {RSVP_ERROR_POLICY, "Policy Control Failure"},
565 {RSVP_ERROR_NO_PATH, "No PATH information for this RESV message"},
566 {RSVP_ERROR_NO_SENDER, "No sender information for this RESV message"},
567 {RSVP_ERROR_CONFLICT_RESV_STYLE, "Conflicting reservation styles"},
568 {RSVP_ERROR_UNKNOWN_RESV_STYLE, "Unknown reservation style"},
569 {RSVP_ERROR_CONFLICT_DEST_PORTS, "Conflicting destination ports"},
570 {RSVP_ERROR_CONFLICT_SRC_PORTS, "Conflicting source ports"},
571 {RSVP_ERROR_PREEMPTED, "Service preempted"},
572 {RSVP_ERROR_UNKNOWN_CLASS, "Unknown object class"},
573 {RSVP_ERROR_UNKNOWN_C_TYPE, "Unknown object C-type"},
574 {RSVP_ERROR_TRAFFIC, "Traffic Control Error"},
575 {RSVP_ERROR_TRAFFIC_SYSTEM, "Traffic Control System Error"},
576 {RSVP_ERROR_SYSTEM, "RSVP System Error"},
577 {RSVP_ERROR_ROUTING, "Routing Error"},
578 {RSVP_ERROR_NOTIFY, "RSVP Notify Error"},
579 {RSVP_ERROR_DIFFSERV, "RSVP Diff-Serv Error"},
580 {RSVP_ERROR_DSTE, "RSVP DiffServ-aware TE Error"},
584 static const value_string rsvp_admission_control_error_vals[] = {
585 {RSVP_AC_ERROR_DELAY_BOUND_ERROR, "Delay bound cannot be met"},
586 {RSVP_AC_ERROR_BANDWITH_UNAVAILABLE, "Requested bandwidth unavailable"},
587 {RSVP_AC_ERROR_LARGE_MTU, "MTU in flowspec larger than interface MTU"},
591 static const value_string rsvp_traffic_control_error_vals[] = {
592 {RSVP_TRAFFIC_CONTROL_ERROR_SERVICE_CONFLICT, "Service conflict"},
593 {RSVP_TRAFFIC_CONTROL_ERROR_SERVIEC_UNSUPPORTED, "Service unsupported"},
594 {RSVP_TRAFFIC_CONTROL_ERROR_BAD_FLOWSPEC, "Bad Flowspec value"},
595 {RSVP_TRAFFIC_CONTROL_ERROR_BAD_TSPEC, "Bad Tspec value"},
596 {RSVP_TRAFFIC_CONTROL_ERROR_BAD_ADSPEC, "Bad Adspec value"},
600 static const value_string rsvp_routing_error_vals[] = {
601 {RSVP_ROUTING_ERROR_BAD_ERO, "Bad EXPLICIT_ROUTE object"},
602 {RSVP_ROUTING_ERROR_BAD_STRICT, "Bad strict node"},
603 {RSVP_ROUTING_ERROR_BAD_LOOSE, "Bad loose node"},
604 {RSVP_ROUTING_ERROR_BAD_INITIAL_SUBOBJ, "Bad initial subobject"},
605 {RSVP_ROUTING_ERROR_NO_ROUTE, "No route available toward destination"},
606 {RSVP_ROUTING_ERROR_UNACCEPTABLE_LABEL, "Unacceptable label value"},
607 {RSVP_ROUTING_ERROR_RRO_LOOP, "RRO indicated routing loops"},
608 {RSVP_ROUTING_ERROR_NON_RSVP_CAPABLE_ROUTER, "non-RSVP-capable router stands in the path"},
609 {RSVP_ROUTING_ERROR_LABEL_ALLOC_FAIL, "MPLS label allocation failure"},
610 {RSVP_ROUTING_ERROR_UNSUPPORTED_L3PID, "Unsupported L3PID"},
614 static const value_string rsvp_notify_error_vals[] = {
615 {RSVP_NOTIFY_ERROR_RRO_TOO_LARGE, "RRO too large for MTU"},
616 {RSVP_NOTIFY_ERROR_RRO_NOTIFICATION, "RRO Notification"},
617 {RSVP_NOTIFY_ERROR_RRO_TUNNEL_LOCAL_REPAIRED, "Tunnel locally repaired"},
618 {RSVP_NOTIFY_ERROR_RRO_CC_ACTIVE_STATE, "Control Channel Active State"},/* RFC3473*/
619 {RSVP_NOTIFY_ERROR_RRO_CC_DEGRADED_STATE,"Control Channel Degraded State"}, /* RFC3473*/
620 {RSVP_NOTIFY_ERROR_LSP_FAILURE, "Private : LSP Failure"},/* Private */
621 {RSVP_NOTIFY_ERROR_LSP_RECOVERED,"Private : LSP recovered"},/* Private */
622 {RSVP_NOTIFY_ERROR_LSP_LOCAL_FAILURE,"Private : LSP Local Failure"},/* Private */
626 static const value_string rsvp_diffserv_error_vals[] = {
627 {RSVP_DIFFSERV_ERROR_UNEXPECTED_DIFFSERVOBJ, "Unexpected DIFFSERV object"},
628 {RSVP_DIFFSERV_ERROR_UNSUPPORTED_PHB, "Unsupported PHB"},
629 {RSVP_DIFFSERV_ERROR_INVALID_EXP_PHB_MAPPING, "Invalid `EXP<->PHB mapping'"},
630 {RSVP_DIFFSERV_ERROR_UNSUPPORTED_PSC, "Unsupported PSC"},
631 {RSVP_DIFFSERV_ERROR_PERLSP_CONTEXT_ALLOC_FAIL, "Per-LSP context allocation failure"},
636 static const value_string rsvp_diffserv_aware_te_error_vals[] = {
637 {RSVP_DSTE_ERROR_UNEXPECTED_CLASSTYPEOBJ, "Unexpected CLASSTYPE object"},
638 {RSVP_DSTE_ERROR_UNSUPPORTED_CLASSTYPE, "Unsupported Class-Type"},
639 {RSVP_DSTE_ERROR_INVALID_CLASSTYPE_VALUE, "Invalid Class-Type value"},
640 {RSVP_DSTE_ERROR_CT_SETUP_PRIO_NOT_CONFIGURED, "CT and setup priority do not form a configured TE-Class"},
641 {RSVP_DSTE_ERROR_CT_HOLDING_PRIO_NOT_CONFIGURED, "CT and holding priority do not form a configured TE-Class"},
642 {RSVP_DSTE_ERROR_CT_SETUP_PRIO_AND_CT_HOLDING_PRIO_NOT_CONFIGURED,
643 "CT and setup priority do not form a configured TE-Class AND CT and holding priority do not form a configured TE-Class"},
644 {RSVP_DSTE_ERROR_INCONSISTENCY_PSC_CT, "Inconsistency between signaled PSC and signaled CT"},
645 {RSVP_DSTE_ERROR_INCONSISTENCY_PHB_CT, "Inconsistency between signaled PHBs and signaled CT"},
650 * Defines the reservation style plus style-specific information that
651 * is not a FLOWSPEC or FILTER_SPEC object, in a RESV message.
653 #define RSVP_DISTINCT (1 << 3)
654 #define RSVP_SHARED (2 << 3)
655 #define RSVP_SHARING_MASK (RSVP_DISTINCT | RSVP_SHARED)
657 #define RSVP_SCOPE_WILD 1
658 #define RSVP_SCOPE_EXPLICIT 2
659 #define RSVP_SCOPE_MASK 0x07
661 #define RSVP_WF (RSVP_SHARED | RSVP_SCOPE_WILD)
662 #define RSVP_FF (RSVP_DISTINCT | RSVP_SCOPE_EXPLICIT)
663 #define RSVP_SE (RSVP_SHARED | RSVP_SCOPE_EXPLICIT)
665 static const value_string style_vals[] = {
666 { RSVP_WF, "Wildcard Filter" },
667 { RSVP_FF, "Fixed Filter" },
668 { RSVP_SE, "Shared-Explicit" },
673 RSVP_SESSION_TYPE_IPV4 = 1,
674 RSVP_SESSION_TYPE_IPV6,
676 RSVP_SESSION_TYPE_IPV4_LSP = 7,
677 RSVP_SESSION_TYPE_IPV6_LSP,
679 RSVP_SESSION_TYPE_AGGREGATE_IPV4 = 9,
680 RSVP_SESSION_TYPE_AGGREGATE_IPV6,
682 RSVP_SESSION_TYPE_IPV4_UNI = 11,
683 RSVP_SESSION_TYPE_IPV4_E_NNI = 15
687 * Defines a desired QoS, in a RESV message.
689 enum qos_service_type {
690 QOS_QUALITATIVE = 128, /* Qualitative service */
691 QOS_NULL = 6, /* Null service (RFC2997) */
692 QOS_CONTROLLED_LOAD= 5, /* Controlled Load Service */
693 QOS_GUARANTEED = 2, /* Guaranteed service */
694 QOS_TSPEC = 1 /* Traffic specification */
697 static const value_string qos_vals[] = {
698 { QOS_QUALITATIVE, "Qualitative QoS" },
699 { QOS_NULL, "Null-Service QoS" },
700 { QOS_CONTROLLED_LOAD, "Controlled-load QoS" },
701 { QOS_GUARANTEED, "Guaranteed rate QoS" },
702 { QOS_TSPEC, "Traffic specification" },
706 static const value_string svc_vals[] = {
707 { 126, "Compression Hint" },
708 { 127, "Token bucket" },
709 { 128, "Null Service" },
710 { 130, "Guaranteed-rate RSpec" },
714 enum rsvp_spec_types { INTSRV = 2 };
716 enum intsrv_services {
721 INTSRV_QUALITATIVE = 128
724 static const value_string intsrv_services_str[] = {
725 {INTSRV_GENERAL, "Default General Parameters"},
726 {INTSRV_GTD, "Guaranteed Rate"},
727 {INTSRV_CLOAD, "Controlled Load"},
728 {INTSRV_NULL, "Null Service"},
729 {INTSRV_QUALITATIVE, "Null Service"},
734 enum intsrv_field_name {
735 INTSRV_NON_IS_HOPS = 1, INTSRV_COMPOSED_NON_IS_HOPS,
736 INTSRV_IS_HOPS, INTSRV_COMPOSED_IS_HOPS,
737 INTSRV_PATH_BANDWIDTH, INTSRV_MIN_PATH_BANDWIDTH,
738 INTSRV_IF_LATENCY, INTSRV_PATH_LATENCY,
739 INTSRV_MTU, INTSRV_COMPOSED_MTU,
741 INTSRV_TOKEN_BUCKET_TSPEC = 127,
742 INTSRV_QUALITATIVE_TSPEC = 128,
743 INTSRV_GTD_RSPEC = 130,
745 INTSRV_DELAY = 131, /* Gtd Parameter C - Max Delay Bound - bytes */
746 INTSRV_MAX_JITTER, /* Gtd Parameter D - Max Jitter */
747 INTSRV_E2E_DELAY, /* Gtd Parameter Ctot */
748 INTSRV_E2E_MAX_JITTER, /* Gtd Parameter Dtot */
749 INTSRV_SHP_DELAY, /* Gtd Parameter Csum */
750 INTSRV_SHP_MAX_JITTER /* Gtd Parameter Dsum */
754 static const value_string adspec_params[] = {
756 {6, "Path b/w estimate"},
757 {8, "Minimum path latency"},
758 {10, "Composed MTU"},
759 {133, "End-to-end composed value for C"},
760 {134, "End-to-end composed value for D"},
761 {135, "Since-last-reshaping point composed C"},
762 {136, "Since-last-reshaping point composed D"},
766 const value_string gmpls_lsp_enc_str[] = {
768 { 2, "Ethernet v2/DIX"},
771 { 6, "VCAT"}, /* provisional value */
772 { 7, "Digital Wrapper"},
773 { 8, "Lambda (photonic)"},
775 {11, "FiberChannel"},
779 const value_string gmpls_switching_type_str[] = {
780 { 1, "Packet-Switch Capable-1 (PSC-1)"},
781 { 2, "Packet-Switch Capable-2 (PSC-2)"},
782 { 3, "Packet-Switch Capable-3 (PSC-3)"},
783 { 4, "Packet-Switch Capable-4 (PSC-4)"},
784 { 51, "Layer-2 Switch Capable (L2SC)"},
785 {100, "Time-Division-Multiplex Capable (TDM)"},
786 {150, "Lambda-Switch Capable (LSC)"},
787 {200, "Fiber-Switch Capable (FSC)"},
791 const value_string gmpls_protection_cap_str[] = {
792 { 1, "Extra Traffic"},
795 { 8, "Dedicated 1:1"},
796 {16, "Dedicated 1+1"},
803 static const value_string gmpls_gpid_str[] = {
804 { 5, "Asynchronous mapping of E3 (SDH)"},
805 { 8, "Bit synchronous mapping of E3 (SDH)"},
806 { 9, "Byte synchronous mapping of E3 (SDH)"},
807 {10, "Asynchronous mapping of DS2/T2 (SDH)"},
808 {11, "Bit synchronous mapping of DS2/T2 (SONET, SDH)"},
809 {13, "Asynchronous mapping of E1 (SONET, SDH)"},
810 {14, "Byte synchronous mapping of E1 (SONET, SDH)"},
811 {15, "Byte synchronous mapping of 31 * DS0 (SONET, SDH)"},
812 {16, "Asynchronous mapping of DS1/T1 (SONET, SDH)"},
813 {17, "Bit synchronous mapping of DS1/T1 (SONET, SDH)"},
814 {18, "Byte synchronous mapping of DS1/T1 (SONET, SDH)"},
815 {19, "VC-11 in VC-12 (SDH)"},
816 {22, "DS1 SF Asynchronous (SONET)"},
817 {23, "DS1 ESF Asynchronous (SONET)"},
818 {24, "DS3 M23 Asynchronous (SONET)"},
819 {25, "DS3 C-Bit Parity Asynchronous (SONET)"},
820 {26, "VT/LOVC (SONET, SDH)"},
821 {27, "STS SPE/HOVC (SONET, SDH)"},
822 {28, "POS - No Scrambling, 16 bit CRC (SONET, SDH)"},
823 {29, "POS - No Scrambling, 32 bit CRC (SONET, SDH)"},
824 {30, "POS - Scrambling, 16 bit CRC (SONET, SDH)"},
825 {31, "POS - Scrambling, 32 bit CRC (SONET, SDH)"},
826 {32, "ATM Mapping (SONET, SDH)"},
827 {33, "Ethernet (SDH, Lambda, Fiber)"},
828 {34, "SDH (Lambda, Fiber)"},
829 {35, "SONET (Lambda, Fiber)"},
830 {36, "Digital Wrapper (Lambda, Fiber)"},
831 {37, "Lambda (Fiber)"},
832 {38, "ETSI PDH (SDH)"},
833 {39, "ANSI PDH (SONET, SDH)"},
834 {40, "Link Access Protocol SDH: LAPS - X.85 and X.86 (SONET, SDH)"},
835 {41, "FDDI (SONET, SDH, Lambda, Fiber)"},
836 {42, "DQDB: ETSI ETS 300 216 (SONET, SDH)"},
837 {43, "FiberChannel-3 Services (FiberChannel)"},
839 {45, "Ethernet V2/DIX (only)"},
840 {46, "Ethernet 802.3 (only)"},
844 const value_string gmpls_sonet_signal_type_str[] = {
845 { 1, "VT1.5 SPE / VC-11"},
846 { 2, "VT2 SPE / VC-12"},
848 { 4, "VT6 SPE / VC-2"},
849 { 5, "STS-1 SPE / VC-3"},
850 { 6, "STS-3c SPE / VC-4"},
851 { 7, "STS-1 / STM-0 (transp)"},
852 { 8, "STS-3 / STM-1 (transp)"},
853 { 9, "STS-12 / STM-4 (transp)"},
854 {10, "STS-48 / STM-16 (transp)"},
855 {11, "STS-192 / STM-64 (transp)"},
856 {12, "STS-768 / STM-256 (transp)"},
858 /* Extended non-SONET signal types */
861 {15, "STSG-3 / AUG-1"},
862 {16, "STSG-12 / AUG-4"},
863 {17, "STSG-48 / AUG-16"},
864 {18, "STSG-192 / AUG-64"},
865 {19, "STSG-768 / AUG-256"},
867 /* Other SONEt signal types */
868 {21, "STS-12c SPE / VC-4-4c"},
869 {22, "STS-48c SPE / VC-4-16c"},
870 {23, "STS-192c SPE / VC-4-64c"},
874 static const value_string ouni_guni_diversity_str[] = {
877 {3, "Shared-Risk Link Group Diverse"},
882 /* -------------------- Stuff for MPLS/TE objects -------------------- */
884 static const value_string proto_vals[] = { {IP_PROTO_ICMP, "ICMP"},
885 {IP_PROTO_IGMP, "IGMP"},
886 {IP_PROTO_TCP, "TCP" },
887 {IP_PROTO_UDP, "UDP" },
888 {IP_PROTO_OSPF, "OSPF"},
892 enum rsvp_filter_keys {
895 RSVPF_MSG, /* Message type */
896 /* Shorthand for message types */
918 /* Does the message contain an object of this type? */
920 /* Object present shorthands */
940 RSVPF_EXPLICIT_ROUTE,
944 RSVPF_MESSAGE_ID_ACK,
945 RSVPF_MESSAGE_ID_LIST,
946 RSVPF_RECOVERY_LABEL,
947 RSVPF_UPSTREAM_LABEL,
953 RSVPF_SUGGESTED_LABEL,
954 RSVPF_ACCEPTABLE_LABEL_SET,
957 RSVPF_SESSION_ATTRIBUTE,
959 RSVPF_LSP_TUNNEL_IF_ID,
960 RSVPF_NOTIFY_REQUEST,
963 RSVPF_GENERALIZED_UNI,
971 RSVPF_SESSION_TUNNEL_ID,
972 RSVPF_SESSION_EXT_TUNNEL_ID,
974 /* Sender template */
979 /* Diffserv object */
980 RSVPF_DIFFSERV_MAPNB,
982 RSVPF_DIFFSERV_MAP_EXP,
983 RSVPF_DIFFSERV_PHBID,
984 RSVPF_DIFFSERV_PHBID_DSCP,
985 RSVPF_DIFFSERV_PHBID_CODE,
986 RSVPF_DIFFSERV_PHBID_BIT14,
987 RSVPF_DIFFSERV_PHBID_BIT15,
989 /* Diffserv-aware TE object */
990 RSVPF_DSTE_CLASSTYPE,
992 /* Generalized UNI object */
999 RSVPF_CALL_ID_SRC_ADDR_IPV4,
1000 RSVPF_CALL_ID_SRC_ADDR_IPV6,
1006 static int rsvp_filter[RSVPF_MAX];
1008 static hf_register_info rsvpf_info[] = {
1010 /* Message type number */
1011 {&rsvp_filter[RSVPF_MSG],
1012 { "Message Type", "rsvp.msg", FT_UINT8, BASE_DEC, VALS(message_type_vals), 0x0,
1015 /* Message type shorthands */
1016 {&rsvp_filter[RSVPF_PATH],
1017 { "Path Message", "rsvp.path", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1020 {&rsvp_filter[RSVPF_RESV],
1021 { "Resv Message", "rsvp.resv", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1024 {&rsvp_filter[RSVPF_PATHERR],
1025 { "Path Error Message", "rsvp.perr", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1028 {&rsvp_filter[RSVPF_RESVERR],
1029 { "Resv Error Message", "rsvp.rerr", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1032 {&rsvp_filter[RSVPF_PATHTEAR],
1033 { "Path Tear Message", "rsvp.ptear", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1036 {&rsvp_filter[RSVPF_RESVTEAR],
1037 { "Resv Tear Message", "rsvp.rtear", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1040 {&rsvp_filter[RSVPF_RCONFIRM],
1041 { "Resv Confirm Message", "rsvp.resvconf", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1044 {&rsvp_filter[RSVPF_RTEARCONFIRM],
1045 { "Resv Tear Confirm Message", "rsvp.rtearconf", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1048 {&rsvp_filter[RSVPF_BUNDLE],
1049 { "Bundle Message", "rsvp.bundle", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1052 {&rsvp_filter[RSVPF_ACK],
1053 { "Ack Message", "rsvp.ack", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1056 {&rsvp_filter[RSVPF_SREFRESH],
1057 { "Srefresh Message", "rsvp.srefresh", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1060 {&rsvp_filter[RSVPF_HELLO],
1061 { "HELLO Message", "rsvp.hello", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1065 {&rsvp_filter[RSVPF_OBJECT],
1066 { "Object class", "rsvp.object", FT_UINT8, BASE_DEC, VALS(rsvp_class_vals), 0x0,
1069 {&rsvp_filter[RSVPF_NOTIFY],
1070 { "Notify Message", "rsvp.notify", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1073 /* Object present shorthands */
1074 {&rsvp_filter[RSVPF_SESSION],
1075 { "SESSION", "rsvp.session", FT_NONE, BASE_NONE, NULL, 0x0,
1078 {&rsvp_filter[RSVPF_HOP],
1079 { "HOP", "rsvp.hop", FT_NONE, BASE_NONE, NULL, 0x0,
1082 {&rsvp_filter[RSVPF_HELLO_OBJ],
1083 { "HELLO Request/Ack", "rsvp.hello_obj", FT_NONE, BASE_NONE, NULL, 0x0,
1086 {&rsvp_filter[RSVPF_INTEGRITY],
1087 { "INTEGRITY", "rsvp.integrity", FT_NONE, BASE_NONE, NULL, 0x0,
1090 {&rsvp_filter[RSVPF_TIME_VALUES],
1091 { "TIME VALUES", "rsvp.time", FT_NONE, BASE_NONE, NULL, 0x0,
1094 {&rsvp_filter[RSVPF_ERROR],
1095 { "ERROR", "rsvp.error", FT_NONE, BASE_NONE, NULL, 0x0,
1098 {&rsvp_filter[RSVPF_SCOPE],
1099 { "SCOPE", "rsvp.scope", FT_NONE, BASE_NONE, NULL, 0x0,
1102 {&rsvp_filter[RSVPF_STYLE],
1103 { "STYLE", "rsvp.style", FT_NONE, BASE_NONE, NULL, 0x0,
1106 {&rsvp_filter[RSVPF_FLOWSPEC],
1107 { "FLOWSPEC", "rsvp.flowspec", FT_NONE, BASE_NONE, NULL, 0x0,
1110 {&rsvp_filter[RSVPF_FILTER_SPEC],
1111 { "FILTERSPEC", "rsvp.filter", FT_NONE, BASE_NONE, NULL, 0x0,
1114 {&rsvp_filter[RSVPF_SENDER],
1115 { "SENDER TEMPLATE", "rsvp.sender", FT_NONE, BASE_NONE, NULL, 0x0,
1118 {&rsvp_filter[RSVPF_TSPEC],
1119 { "SENDER TSPEC", "rsvp.tspec", FT_NONE, BASE_NONE, NULL, 0x0,
1122 {&rsvp_filter[RSVPF_ADSPEC],
1123 { "ADSPEC", "rsvp.adspec", FT_NONE, BASE_NONE, NULL, 0x0,
1126 {&rsvp_filter[RSVPF_POLICY],
1127 { "POLICY", "rsvp.policy", FT_NONE, BASE_NONE, NULL, 0x0,
1130 {&rsvp_filter[RSVPF_CONFIRM],
1131 { "CONFIRM", "rsvp.confirm", FT_NONE, BASE_NONE, NULL, 0x0,
1134 {&rsvp_filter[RSVPF_LABEL],
1135 { "LABEL", "rsvp.label", FT_NONE, BASE_NONE, NULL, 0x0,
1138 {&rsvp_filter[RSVPF_RECOVERY_LABEL],
1139 { "RECOVERY LABEL", "rsvp.recovery_label", FT_NONE, BASE_NONE, NULL, 0x0,
1142 {&rsvp_filter[RSVPF_UPSTREAM_LABEL],
1143 { "UPSTREAM LABEL", "rsvp.upstream_label", FT_NONE, BASE_NONE, NULL, 0x0,
1146 {&rsvp_filter[RSVPF_SUGGESTED_LABEL],
1147 { "SUGGESTED LABEL", "rsvp.suggested_label", FT_NONE, BASE_NONE, NULL, 0x0,
1150 {&rsvp_filter[RSVPF_LABEL_SET],
1151 { "LABEL SET", "rsvp.label_set", FT_NONE, BASE_NONE, NULL, 0x0,
1154 {&rsvp_filter[RSVPF_ACCEPTABLE_LABEL_SET],
1155 { "ACCEPTABLE LABEL SET", "rsvp.acceptable_label_set", FT_NONE, BASE_NONE, NULL, 0x0,
1158 {&rsvp_filter[RSVPF_PROTECTION],
1159 { "PROTECTION", "rsvp.protection", FT_NONE, BASE_NONE, NULL, 0x0,
1162 {&rsvp_filter[RSVPF_DIFFSERV],
1163 { "DIFFSERV", "rsvp.diffserv", FT_NONE, BASE_NONE, NULL, 0x0,
1166 {&rsvp_filter[RSVPF_DSTE],
1167 { "CLASSTYPE", "rsvp.dste", FT_NONE, BASE_NONE, NULL, 0x0,
1170 {&rsvp_filter[RSVPF_RESTART_CAP],
1171 { "RESTART CAPABILITY", "rsvp.restart", FT_NONE, BASE_NONE, NULL, 0x0,
1174 {&rsvp_filter[RSVPF_LABEL_REQUEST],
1175 { "LABEL REQUEST", "rsvp.label_request", FT_NONE, BASE_NONE, NULL, 0x0,
1178 {&rsvp_filter[RSVPF_SESSION_ATTRIBUTE],
1179 { "SESSION ATTRIBUTE", "rsvp.session_attribute", FT_NONE, BASE_NONE, NULL, 0x0,
1182 {&rsvp_filter[RSVPF_EXPLICIT_ROUTE],
1183 { "EXPLICIT ROUTE", "rsvp.explicit_route", FT_NONE, BASE_NONE, NULL, 0x0,
1186 {&rsvp_filter[RSVPF_RECORD_ROUTE],
1187 { "RECORD ROUTE", "rsvp.record_route", FT_NONE, BASE_NONE, NULL, 0x0,
1190 {&rsvp_filter[RSVPF_MESSAGE_ID],
1191 { "MESSAGE-ID", "rsvp.msgid", FT_NONE, BASE_NONE, NULL, 0x0,
1194 {&rsvp_filter[RSVPF_MESSAGE_ID_ACK],
1195 { "MESSAGE-ID ACK", "rsvp.ack", FT_NONE, BASE_NONE, NULL, 0x0,
1198 {&rsvp_filter[RSVPF_MESSAGE_ID_LIST],
1199 { "MESSAGE-ID LIST", "rsvp.msgid_list", FT_NONE, BASE_NONE, NULL, 0x0,
1202 {&rsvp_filter[RSVPF_DCLASS],
1203 { "DCLASS", "rsvp.dclass", FT_NONE, BASE_NONE, NULL, 0x0,
1206 {&rsvp_filter[RSVPF_LSP_TUNNEL_IF_ID],
1207 { "LSP INTERFACE-ID", "rsvp.lsp_tunnel_if_id", FT_NONE, BASE_NONE, NULL, 0x0,
1210 {&rsvp_filter[RSVPF_ADMIN_STATUS],
1211 { "ADMIN STATUS", "rsvp.admin_status", FT_NONE, BASE_NONE, NULL, 0x0,
1214 {&rsvp_filter[RSVPF_ASSOCIATION],
1215 { "ASSOCIATION", "rsvp.association", FT_NONE, BASE_NONE, NULL, 0x0,
1218 {&rsvp_filter[RSVPF_NOTIFY_REQUEST],
1219 { "NOTIFY REQUEST", "rsvp.notify_request", FT_NONE, BASE_NONE, NULL, 0x0,
1222 {&rsvp_filter[RSVPF_GENERALIZED_UNI],
1223 { "GENERALIZED UNI", "rsvp.generalized_uni", FT_NONE, BASE_NONE, NULL, 0x0,
1226 {&rsvp_filter[RSVPF_CALL_ID],
1227 { "CALL ID", "rsvp.call_id", FT_NONE, BASE_NONE, NULL, 0x0,
1230 {&rsvp_filter[RSVPF_UNKNOWN_OBJ],
1231 { "Unknown object", "rsvp.obj_unknown", FT_NONE, BASE_NONE, NULL, 0x0,
1234 /* Session fields */
1235 {&rsvp_filter[RSVPF_SESSION_IP],
1236 { "Destination address", "rsvp.session.ip", FT_IPv4, BASE_NONE, NULL, 0x0,
1239 {&rsvp_filter[RSVPF_SESSION_PORT],
1240 { "Port number", "rsvp.session.port", FT_UINT16, BASE_DEC, NULL, 0x0,
1243 {&rsvp_filter[RSVPF_SESSION_PROTO],
1244 { "Protocol", "rsvp.session.proto", FT_UINT8, BASE_DEC, VALS(proto_vals), 0x0,
1247 {&rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
1248 { "Tunnel ID", "rsvp.session.tunnel_id", FT_UINT16, BASE_DEC, NULL, 0x0,
1251 {&rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
1252 { "Extended tunnel ID", "rsvp.session.ext_tunnel_id", FT_UINT32, BASE_DEC, NULL, 0x0,
1255 /* Sender template/Filterspec fields */
1256 {&rsvp_filter[RSVPF_SENDER_IP],
1257 { "Sender IPv4 address", "rsvp.sender.ip", FT_IPv4, BASE_NONE, NULL, 0x0,
1260 {&rsvp_filter[RSVPF_SENDER_PORT],
1261 { "Sender port number", "rsvp.sender.port", FT_UINT16, BASE_DEC, NULL, 0x0,
1264 {&rsvp_filter[RSVPF_SENDER_LSP_ID],
1265 { "Sender LSP ID", "rsvp.sender.lsp_id", FT_UINT16, BASE_DEC, NULL, 0x0,
1268 /* Diffserv object fields */
1269 {&rsvp_filter[RSVPF_DIFFSERV_MAPNB],
1270 { "MAPnb", "rsvp.diffserv.mapnb", FT_UINT8, BASE_DEC, NULL, 0x0,
1271 MAPNB_DESCRIPTION, HFILL }},
1273 {&rsvp_filter[RSVPF_DIFFSERV_MAP],
1274 { "MAP", "rsvp.diffserv.map", FT_NONE, BASE_NONE, NULL, 0x0,
1275 MAP_DESCRIPTION, HFILL }},
1277 {&rsvp_filter[RSVPF_DIFFSERV_MAP_EXP],
1278 { "EXP", "rsvp.diffserv.map.exp", FT_UINT8, BASE_DEC, NULL, 0x0,
1279 EXP_DESCRIPTION, HFILL }},
1281 {&rsvp_filter[RSVPF_DIFFSERV_PHBID],
1282 { "PHBID", "rsvp.diffserv.phbid", FT_NONE, BASE_NONE, NULL, 0x0,
1283 PHBID_DESCRIPTION, HFILL }},
1285 {&rsvp_filter[RSVPF_DIFFSERV_PHBID_DSCP],
1286 { PHBID_DSCP_DESCRIPTION, "rsvp.diffserv.phbid.dscp", FT_UINT16,
1287 BASE_DEC, NULL, PHBID_DSCP_MASK, "DSCP", HFILL }},
1289 {&rsvp_filter[RSVPF_DIFFSERV_PHBID_CODE],
1290 { PHBID_CODE_DESCRIPTION, "rsvp.diffserv.phbid.code", FT_UINT16,
1291 BASE_DEC, NULL, PHBID_CODE_MASK, "PHB id code", HFILL }},
1293 {&rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT14],
1294 { PHBID_BIT14_DESCRIPTION, "rsvp.diffserv.phbid.bit14", FT_UINT16,
1295 BASE_DEC, VALS(phbid_bit14_vals), PHBID_BIT14_MASK, "Bit 14", HFILL }},
1297 {&rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT15],
1298 { PHBID_BIT15_DESCRIPTION, "rsvp.diffserv.phbid.bit15", FT_UINT16,
1299 BASE_DEC, VALS(phbid_bit15_vals), PHBID_BIT15_MASK, "Bit 15", HFILL }},
1301 /* Diffserv-aware TE object field */
1302 {&rsvp_filter[RSVPF_DSTE_CLASSTYPE],
1303 { "CT", "rsvp.dste.classtype", FT_UINT8, BASE_DEC, NULL, 0x0,
1306 /* Generalized UNI object field */
1307 {&rsvp_filter[RSVPF_GUNI_SRC_IPV4],
1308 { "Source TNA", "rsvp.guni.srctna.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0,
1311 {&rsvp_filter[RSVPF_GUNI_DST_IPV4],
1312 { "Destination TNA", "rsvp.guni.dsttna.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0,
1315 {&rsvp_filter[RSVPF_GUNI_SRC_IPV6],
1316 { "Source TNA", "rsvp.guni.srctna.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0,
1319 {&rsvp_filter[RSVPF_GUNI_DST_IPV6],
1320 { "Destination TNA", "rsvp.guni.dsttna.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0,
1323 /* Generalized UNI object field */
1324 {&rsvp_filter[RSVPF_CALL_ID_SRC_ADDR_IPV4],
1325 { "Source Transport Network Address", "rsvp.callid.srcaddr.ipv4", FT_IPv4,
1326 BASE_NONE, NULL, 0x0, "", HFILL }},
1328 {&rsvp_filter[RSVPF_CALL_ID_SRC_ADDR_IPV6],
1329 { "Source Transport Network Address", "rsvp.callid.srcaddr.ipv6", FT_IPv6,
1330 BASE_NONE, NULL, 0x0, "", HFILL }}
1333 /* RSVP Conversation related Hash functions */
1336 * Compare two RSVP request keys to see if they are equal. Return 1 if they
1338 * Two RSVP request keys are equal if and only if they have the exactly the
1339 * same internal conversation identifier, session type, and matching values in
1340 * the session info and source info structures.
1343 rsvp_equal (gconstpointer k1, gconstpointer k2)
1345 const struct rsvp_request_key *key1 = (const struct rsvp_request_key*) k1;
1346 const struct rsvp_request_key *key2 = (const struct rsvp_request_key*) k2;
1348 if (key1->conversation != key2->conversation) {
1352 if (key1->session_type != key2->session_type) {
1356 switch (key1->session_type) {
1357 case RSVP_SESSION_TYPE_IPV4:
1358 if (ADDRESSES_EQUAL(&key1->u.session_ipv4.destination,
1359 &key2->u.session_ipv4.destination) == FALSE)
1362 if (key1->u.session_ipv4.protocol != key2->u.session_ipv4.protocol)
1365 if (key1->u.session_ipv4.udp_dest_port != key2->u.session_ipv4.udp_dest_port)
1370 case RSVP_SESSION_TYPE_IPV6:
1371 /* this is not supported yet for conversations */
1374 case RSVP_SESSION_TYPE_IPV4_LSP:
1375 if (ADDRESSES_EQUAL(&key1->u.session_ipv4_lsp.destination,
1376 &key2->u.session_ipv4_lsp.destination) == FALSE)
1379 if (key1->u.session_ipv4_lsp.udp_dest_port !=
1380 key2->u.session_ipv4_lsp.udp_dest_port)
1384 if (key1->u.session_ipv4_lsp.ext_tunnel_id !=
1385 key2->u.session_ipv4_lsp.ext_tunnel_id)
1390 case RSVP_SESSION_TYPE_AGGREGATE_IPV4:
1391 if (ADDRESSES_EQUAL(&key1->u.session_agg_ipv4.destination,
1392 &key2->u.session_agg_ipv4.destination) == FALSE)
1395 if (key1->u.session_agg_ipv4.dscp != key2->u.session_agg_ipv4.dscp)
1400 case RSVP_SESSION_TYPE_AGGREGATE_IPV6:
1401 /* this is not supported yet for conversations */
1404 case RSVP_SESSION_TYPE_IPV4_UNI:
1405 if (ADDRESSES_EQUAL(&key1->u.session_ipv4_uni.destination,
1406 &key2->u.session_ipv4_uni.destination) == FALSE)
1409 if (key1->u.session_ipv4_uni.udp_dest_port !=
1410 key2->u.session_ipv4_uni.udp_dest_port)
1414 if (key1->u.session_ipv4_uni.ext_tunnel_id !=
1415 key2->u.session_ipv4_uni.ext_tunnel_id)
1420 case RSVP_SESSION_TYPE_IPV4_E_NNI:
1421 if (ADDRESSES_EQUAL(&key1->u.session_ipv4_enni.destination,
1422 &key2->u.session_ipv4_enni.destination) == FALSE)
1425 if (key1->u.session_ipv4_enni.udp_dest_port !=
1426 key2->u.session_ipv4_enni.udp_dest_port)
1430 if (key1->u.session_ipv4_enni.ext_tunnel_id !=
1431 key2->u.session_ipv4_enni.ext_tunnel_id)
1437 /* This should never happen. */
1441 if (ADDRESSES_EQUAL(&key1->source_info.source,
1442 &key2->source_info.source) == FALSE)
1445 if (key1->source_info.udp_source_port != key2->source_info.udp_source_port)
1448 /* If we get here, the two keys are equal. */
1453 * Calculate a hash key for the supplied RSVP request. The internally allocated
1454 * conversation-id is unique, so we just use that.
1457 rsvp_hash (gconstpointer k)
1459 const struct rsvp_request_key *key = (const struct rsvp_request_key*) k;
1460 return key->conversation;
1464 * Conversation specific initialization code that deletes any unused memory that
1465 * might need to be freed, and allocates the memory for the various conversation
1469 rsvp_init_protocol (void)
1471 if (rsvp_request_hash)
1472 g_hash_table_destroy(rsvp_request_hash);
1474 rsvp_request_hash = g_hash_table_new(rsvp_hash, rsvp_equal);
1477 static inline int rsvp_class_to_filter_num(int classnum)
1480 case RSVP_CLASS_SESSION :
1481 case RSVP_CLASS_HOP :
1482 case RSVP_CLASS_INTEGRITY :
1483 case RSVP_CLASS_TIME_VALUES :
1484 case RSVP_CLASS_ERROR :
1485 case RSVP_CLASS_SCOPE :
1486 case RSVP_CLASS_STYLE :
1487 case RSVP_CLASS_FLOWSPEC :
1488 case RSVP_CLASS_FILTER_SPEC :
1489 case RSVP_CLASS_SENDER_TEMPLATE :
1490 case RSVP_CLASS_SENDER_TSPEC :
1491 case RSVP_CLASS_ADSPEC :
1492 case RSVP_CLASS_POLICY :
1493 case RSVP_CLASS_CONFIRM :
1494 case RSVP_CLASS_LABEL :
1495 case RSVP_CLASS_LABEL_REQUEST :
1496 case RSVP_CLASS_HELLO :
1497 case RSVP_CLASS_EXPLICIT_ROUTE :
1498 case RSVP_CLASS_RECORD_ROUTE :
1499 case RSVP_CLASS_MESSAGE_ID :
1500 case RSVP_CLASS_MESSAGE_ID_ACK :
1501 case RSVP_CLASS_MESSAGE_ID_LIST :
1502 return classnum + RSVPF_OBJECT;
1505 case RSVP_CLASS_RECOVERY_LABEL :
1506 case RSVP_CLASS_UPSTREAM_LABEL :
1507 case RSVP_CLASS_LABEL_SET :
1508 case RSVP_CLASS_PROTECTION :
1509 return RSVPF_RECOVERY_LABEL + (classnum - RSVP_CLASS_RECOVERY_LABEL);
1511 case RSVP_CLASS_SUGGESTED_LABEL :
1512 case RSVP_CLASS_ACCEPTABLE_LABEL_SET :
1513 case RSVP_CLASS_RESTART_CAP :
1514 return RSVPF_SUGGESTED_LABEL + (classnum - RSVP_CLASS_SUGGESTED_LABEL);
1516 case RSVP_CLASS_DIFFSERV :
1517 return RSVPF_DIFFSERV;
1519 case RSVP_CLASS_CLASSTYPE :
1522 case RSVP_CLASS_NOTIFY_REQUEST :
1523 return RSVPF_NOTIFY_REQUEST;
1524 case RSVP_CLASS_ADMIN_STATUS :
1525 return RSVPF_ADMIN_STATUS;
1526 case RSVP_CLASS_ASSOCIATION :
1527 return RSVPF_ASSOCIATION;
1529 case RSVP_CLASS_SESSION_ATTRIBUTE :
1530 return RSVPF_SESSION_ATTRIBUTE;
1531 case RSVP_CLASS_GENERALIZED_UNI :
1532 return RSVPF_GENERALIZED_UNI;
1533 case RSVP_CLASS_CALL_ID :
1534 return RSVPF_CALL_ID;
1535 case RSVP_CLASS_DCLASS :
1536 return RSVPF_DCLASS;
1537 case RSVP_CLASS_LSP_TUNNEL_IF_ID :
1538 return RSVPF_LSP_TUNNEL_IF_ID;
1541 return RSVPF_UNKNOWN_OBJ;
1545 static inline int rsvp_class_to_tree_type(int classnum)
1548 case RSVP_CLASS_SESSION :
1550 case RSVP_CLASS_HOP :
1552 case RSVP_CLASS_INTEGRITY :
1553 return TT_INTEGRITY;
1554 case RSVP_CLASS_TIME_VALUES :
1555 return TT_TIME_VALUES;
1556 case RSVP_CLASS_ERROR :
1558 case RSVP_CLASS_SCOPE :
1560 case RSVP_CLASS_STYLE :
1562 case RSVP_CLASS_FLOWSPEC :
1564 case RSVP_CLASS_FILTER_SPEC :
1565 return TT_FILTER_SPEC;
1566 case RSVP_CLASS_SENDER_TEMPLATE :
1567 return TT_SENDER_TEMPLATE;
1568 case RSVP_CLASS_SENDER_TSPEC :
1570 case RSVP_CLASS_ADSPEC :
1572 case RSVP_CLASS_POLICY :
1574 case RSVP_CLASS_CONFIRM :
1576 case RSVP_CLASS_RECOVERY_LABEL :
1577 case RSVP_CLASS_UPSTREAM_LABEL :
1578 case RSVP_CLASS_SUGGESTED_LABEL :
1579 case RSVP_CLASS_LABEL :
1581 case RSVP_CLASS_LABEL_REQUEST :
1582 return TT_LABEL_REQUEST;
1583 case RSVP_CLASS_HELLO :
1584 return TT_HELLO_OBJ;
1585 case RSVP_CLASS_EXPLICIT_ROUTE :
1586 return TT_EXPLICIT_ROUTE;
1587 case RSVP_CLASS_RECORD_ROUTE :
1588 return TT_RECORD_ROUTE;
1589 case RSVP_CLASS_MESSAGE_ID :
1590 return TT_MESSAGE_ID;
1591 case RSVP_CLASS_MESSAGE_ID_ACK :
1592 return TT_MESSAGE_ID_ACK;
1593 case RSVP_CLASS_MESSAGE_ID_LIST :
1594 return TT_MESSAGE_ID_LIST;
1595 case RSVP_CLASS_LABEL_SET :
1596 return TT_LABEL_SET;
1597 case RSVP_CLASS_PROTECTION :
1598 return TT_PROTECTION_INFO;
1599 case RSVP_CLASS_ACCEPTABLE_LABEL_SET :
1600 return TT_UNKNOWN_CLASS;
1601 case RSVP_CLASS_RESTART_CAP :
1602 return TT_RESTART_CAP;
1603 case RSVP_CLASS_DIFFSERV :
1605 case RSVP_CLASS_CLASSTYPE:
1606 return TT_CLASSTYPE;
1607 case RSVP_CLASS_NOTIFY_REQUEST :
1608 return TT_UNKNOWN_CLASS;
1609 case RSVP_CLASS_ADMIN_STATUS :
1610 return TT_ADMIN_STATUS;
1611 case RSVP_CLASS_ASSOCIATION :
1612 return TT_ASSOCIATION;
1613 case RSVP_CLASS_SESSION_ATTRIBUTE :
1614 return TT_SESSION_ATTRIBUTE;
1615 case RSVP_CLASS_GENERALIZED_UNI :
1617 case RSVP_CLASS_CALL_ID :
1619 case RSVP_CLASS_DCLASS :
1621 case RSVP_CLASS_LSP_TUNNEL_IF_ID :
1622 return TT_LSP_TUNNEL_IF_ID;
1624 return TT_UNKNOWN_CLASS;
1629 find_rsvp_session_tempfilt(tvbuff_t *tvb, int hdr_offset, int *session_offp, int *tempfilt_offp)
1631 int s_off = 0, t_off = 0;
1635 if (!tvb_bytes_exist(tvb, hdr_offset+6, 2))
1638 len = tvb_get_ntohs(tvb, hdr_offset+6) + hdr_offset;
1639 off = hdr_offset + 8;
1640 for (off = hdr_offset + 8; off < len && tvb_bytes_exist(tvb, off, 3);
1641 off += obj_length) {
1642 obj_length = tvb_get_ntohs(tvb, off);
1643 if (obj_length == 0)
1645 switch(tvb_get_guint8(tvb, off+2)) {
1646 case RSVP_CLASS_SESSION:
1649 case RSVP_CLASS_SENDER_TEMPLATE:
1650 case RSVP_CLASS_FILTER_SPEC:
1659 if (session_offp) *session_offp = s_off;
1660 if (tempfilt_offp) *tempfilt_offp = t_off;
1663 static char *summary_session (tvbuff_t *tvb, int offset)
1665 static char buf[100];
1667 switch(tvb_get_guint8(tvb, offset+3)) {
1668 case RSVP_SESSION_TYPE_IPV4:
1669 g_snprintf(buf, 100, "SESSION: IPv4, Destination %s, Protocol %d, Port %d. ",
1670 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1671 tvb_get_guint8(tvb, offset+8),
1672 tvb_get_ntohs(tvb, offset+10));
1674 case RSVP_SESSION_TYPE_IPV4_LSP:
1675 g_snprintf(buf, 100, "SESSION: IPv4-LSP, Destination %s, Tunnel ID %d, Ext ID %0x. ",
1676 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1677 tvb_get_ntohs(tvb, offset+10),
1678 tvb_get_ntohl(tvb, offset+12));
1680 case RSVP_SESSION_TYPE_AGGREGATE_IPV4:
1681 g_snprintf(buf, 100, "SESSION: IPv4-Aggregate, Destination %s, DSCP %d. ",
1682 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1683 tvb_get_guint8(tvb, offset+11));
1685 case RSVP_SESSION_TYPE_IPV4_UNI:
1686 g_snprintf(buf, 100, "SESSION: IPv4-UNI, Destination %s, Tunnel ID %d, Ext Address %s. ",
1687 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1688 tvb_get_ntohs(tvb, offset+10),
1689 ip_to_str(tvb_get_ptr(tvb, offset+12, 4)));
1691 case RSVP_SESSION_TYPE_IPV4_E_NNI:
1692 g_snprintf(buf, 100, "SESSION: IPv4-E-NNI, Destination %s, Tunnel ID %d, Ext Address %s. ",
1693 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1694 tvb_get_ntohs(tvb, offset+10),
1695 ip_to_str(tvb_get_ptr(tvb, offset+12, 4)));
1698 g_snprintf(buf, 100, "SESSION: Type %d. ", tvb_get_guint8(tvb, offset+3));
1704 static char *summary_template (tvbuff_t *tvb, int offset)
1706 static char buf[80];
1707 const char *objtype;
1709 if (tvb_get_guint8(tvb, offset+2) == RSVP_CLASS_FILTER_SPEC)
1710 objtype = "FILTERSPEC";
1712 objtype = "SENDER TEMPLATE";
1714 switch(tvb_get_guint8(tvb, offset+3)) {
1716 g_snprintf(buf, 80, "%s: IPv4, Sender %s, Port %d. ", objtype,
1717 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1718 tvb_get_ntohs(tvb, offset+10));
1721 g_snprintf(buf, 80, "%s: IPv4-LSP, Tunnel Source: %s, LSP ID: %d. ", objtype,
1722 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1723 tvb_get_ntohs(tvb, offset+10));
1726 g_snprintf(buf, 80, "%s: IPv4-Aggregate, Aggregator %s. ", objtype,
1727 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)));
1730 g_snprintf(buf, 80, "%s: Type %d. ", objtype, tvb_get_guint8(tvb, offset+3));
1736 /*------------------------------------------------------------------------------
1738 *------------------------------------------------------------------------------*/
1740 dissect_rsvp_session (proto_item *ti, proto_tree *rsvp_object_tree,
1742 int offset, int obj_length,
1743 int class _U_, int type,
1744 rsvp_conversation_info *rsvph)
1746 proto_item *hidden_item;
1747 int offset2 = offset + 4;
1749 proto_item_set_text(ti, "%s", summary_session(tvb, offset));
1752 case RSVP_SESSION_TYPE_IPV4:
1753 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1754 "C-type: 1 - IPv4");
1755 proto_tree_add_item(rsvp_object_tree,
1756 rsvp_filter[RSVPF_SESSION_IP],
1757 tvb, offset2, 4, FALSE);
1759 proto_tree_add_item(rsvp_object_tree,
1760 rsvp_filter[RSVPF_SESSION_PROTO], tvb,
1761 offset2+4, 1, FALSE);
1762 proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 1,
1764 tvb_get_guint8(tvb, offset2+5));
1765 proto_tree_add_item(rsvp_object_tree,
1766 rsvp_filter[RSVPF_SESSION_PORT], tvb,
1767 offset2+6, 2, FALSE);
1770 * Save this information to build the conversation request key
1773 rsvph->session_type = RSVP_SESSION_TYPE_IPV4;
1774 SET_ADDRESS(&rsvph->destination, AT_IPv4, 4,
1775 tvb_get_ptr(tvb, offset2, 4));
1776 rsvph->protocol = tvb_get_guint8(tvb, offset2+4);
1777 rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6);
1781 case RSVP_SESSION_TYPE_IPV6:
1782 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1783 "C-type: 2 - IPv6");
1784 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1785 "Destination address: %s",
1786 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1787 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 1,
1789 tvb_get_guint8(tvb, offset2+16));
1790 proto_tree_add_text(rsvp_object_tree, tvb, offset2+17, 1,
1792 tvb_get_guint8(tvb, offset2+17));
1793 proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2,
1794 "Destination port: %u",
1795 tvb_get_ntohs(tvb, offset2+18));
1797 * Save this information to build the conversation request key
1798 * later. IPv6 conversatiuon support is not implemented yet, so only
1799 * the session type is stored.
1801 rsvph->session_type = RSVP_SESSION_TYPE_IPV6;
1805 case RSVP_SESSION_TYPE_IPV4_LSP:
1806 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1807 "C-type: 7 - IPv4 LSP");
1808 proto_tree_add_item(rsvp_object_tree,
1809 rsvp_filter[RSVPF_SESSION_IP],
1810 tvb, offset2, 4, FALSE);
1812 proto_tree_add_item(rsvp_object_tree,
1813 rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
1814 tvb, offset2+6, 2, FALSE);
1816 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
1817 "Extended Tunnel ID: %u (%s)",
1818 tvb_get_ntohl(tvb, offset2+8),
1819 ip_to_str(tvb_get_ptr(tvb, offset2+8, 4)));
1820 hidden_item = proto_tree_add_item(rsvp_object_tree,
1821 rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
1822 tvb, offset2+8, 4, FALSE);
1823 PROTO_ITEM_SET_HIDDEN(hidden_item);
1826 * Save this information to build the conversation request key
1829 rsvph->session_type = RSVP_SESSION_TYPE_IPV4_LSP;
1830 SET_ADDRESS(&rsvph->destination, AT_IPv4, 4,
1831 tvb_get_ptr(tvb, offset2, 4));
1832 rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6);
1833 rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8);
1836 case RSVP_SESSION_TYPE_AGGREGATE_IPV4:
1837 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1838 "C-type: 9 - IPv4 Aggregate");
1839 proto_tree_add_item(rsvp_object_tree,
1840 rsvp_filter[RSVPF_SESSION_IP],
1841 tvb, offset2, 4, FALSE);
1843 proto_tree_add_text(rsvp_object_tree, tvb, offset2+7, 1,
1845 tvb_get_guint8(tvb, offset2+7),
1846 val_to_str(tvb_get_guint8(tvb, offset2+7),
1847 dscp_vals, "Unknown (%d)"));
1849 * Save this information to build the conversation request key
1852 rsvph->session_type = RSVP_SESSION_TYPE_AGGREGATE_IPV4;
1853 SET_ADDRESS(&rsvph->destination, AT_IPv4, 4,
1854 tvb_get_ptr(tvb, offset2, 4));
1855 rsvph->dscp = tvb_get_guint8(tvb, offset2+7);
1856 rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8);
1859 case RSVP_SESSION_TYPE_IPV4_UNI:
1860 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1861 "C-type: 11 - IPv4 UNI");
1862 proto_tree_add_item(rsvp_object_tree,
1863 rsvp_filter[RSVPF_SESSION_IP],
1864 tvb, offset2, 4, FALSE);
1866 proto_tree_add_item(rsvp_object_tree,
1867 rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
1868 tvb, offset2+6, 2, FALSE);
1870 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
1871 "Extended IPv4 Address: %s",
1872 ip_to_str(tvb_get_ptr(tvb, offset2+8, 4)));
1873 hidden_item = proto_tree_add_item(rsvp_object_tree,
1874 rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
1875 tvb, offset2+8, 4, FALSE);
1876 PROTO_ITEM_SET_HIDDEN(hidden_item);
1879 * Save this information to build the conversation request key
1882 rsvph->session_type = RSVP_SESSION_TYPE_IPV4_UNI;
1883 SET_ADDRESS(&rsvph->destination, AT_IPv4, 4,
1884 tvb_get_ptr(tvb, offset2, 4));
1885 rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6);
1886 rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8);
1890 case RSVP_SESSION_TYPE_IPV4_E_NNI:
1891 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1892 "C-type: 15 - IPv4 E-NNI");
1893 proto_tree_add_item(rsvp_object_tree,
1894 rsvp_filter[RSVPF_SESSION_IP],
1895 tvb, offset2, 4, FALSE);
1897 proto_tree_add_item(rsvp_object_tree,
1898 rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
1899 tvb, offset2+6, 2, FALSE);
1901 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
1902 "Extended IPv4 Address: %s",
1903 ip_to_str(tvb_get_ptr(tvb, offset2+8, 4)));
1904 hidden_item = proto_tree_add_item(rsvp_object_tree,
1905 rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
1906 tvb, offset2+8, 4, FALSE);
1907 PROTO_ITEM_SET_HIDDEN(hidden_item);
1910 * Save this information to build the conversation request key
1913 rsvph->session_type = RSVP_SESSION_TYPE_IPV4_E_NNI;
1914 SET_ADDRESS(&rsvph->destination, AT_IPv4, 4,
1915 tvb_get_ptr(tvb, offset2, 4));
1916 rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6);
1917 rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8);
1922 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1923 "C-type: Unknown (%u)",
1925 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length-4,
1926 "Data (%d bytes)", obj_length-4);
1931 /*------------------------------------------------------------------------------
1932 * TLVs for HOP, ERROR and other IF_ID extended objects
1933 *------------------------------------------------------------------------------*/
1935 dissect_rsvp_ifid_tlv (proto_tree *ti, proto_tree *rsvp_object_tree,
1936 tvbuff_t *tvb, int offset, int obj_length,
1942 const char *ifindex_name;
1943 proto_tree *rsvp_ifid_subtree, *ti2;
1944 int offset2 = offset + 4;
1946 for (tlv_off = 0; tlv_off < obj_length - 12; ) {
1947 tlv_type = tvb_get_ntohs(tvb, offset+tlv_off);
1948 tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2);
1951 proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off+2, 2,
1952 "Invalid length (0)");
1957 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1960 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)));
1962 rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type);
1963 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2,
1965 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2,
1967 tvb_get_ntohs(tvb, offset+tlv_off+2));
1968 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4,
1970 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)));
1971 proto_item_append_text(ti, "Data IPv4: %s. ",
1972 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)));
1979 ifindex_name = " Forward";
1982 ifindex_name = " Reverse";
1984 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1986 "Interface-Index%s TLV - %s, %d",
1988 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)),
1989 tvb_get_ntohl(tvb, offset+tlv_off+8));
1990 rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type);
1991 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2,
1992 "Type: %d (Interface Index%s)", tlv_type, ifindex_name);
1993 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2,
1995 tvb_get_ntohs(tvb, offset+tlv_off+2));
1996 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4,
1998 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)));
1999 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+8, 4,
2001 tvb_get_ntohl(tvb, offset+tlv_off+8));
2002 proto_item_append_text(ti, "Data If-Index%s: %s, %d. ", ifindex_name,
2003 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)),
2004 tvb_get_ntohl(tvb, offset+tlv_off+8));
2008 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
2009 "Logical interface: %u",
2010 tvb_get_ntohl(tvb, offset2+4));
2016 /*------------------------------------------------------------------------------
2018 *------------------------------------------------------------------------------*/
2020 dissect_rsvp_hop (proto_item *ti, proto_tree *rsvp_object_tree,
2022 int offset, int obj_length,
2023 int class _U_, int type)
2025 int offset2 = offset + 4;
2029 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2030 "C-type: 1 - IPv4");
2031 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2032 "Neighbor address: %s",
2033 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2034 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
2035 "Logical interface: %u",
2036 tvb_get_ntohl(tvb, offset2+4));
2037 proto_item_set_text(ti, "HOP: IPv4, %s",
2038 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2042 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2043 "C-type: 2 - IPv6");
2044 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
2045 "Neighbor address: %s",
2046 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
2047 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 4,
2048 "Logical interface: 0x%08x",
2049 tvb_get_ntohl(tvb, offset2+16));
2053 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2054 "C-type: 3 - IPv4 IF-ID");
2055 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2056 "Neighbor address: %s",
2057 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2058 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
2059 "Logical interface: %u",
2060 tvb_get_ntohl(tvb, offset2+4));
2062 proto_item_set_text(ti, "HOP: IPv4 IF-ID. Control IPv4: %s. ",
2063 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2065 dissect_rsvp_ifid_tlv(ti, rsvp_object_tree, tvb, offset+12, obj_length,
2066 TREE(TT_HOP_SUBOBJ));
2071 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2072 "C-type: Unknown (%u)",
2074 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2075 "Data (%d bytes)", obj_length - 4);
2079 /*------------------------------------------------------------------------------
2081 *------------------------------------------------------------------------------*/
2083 dissect_rsvp_time_values (proto_item *ti, proto_tree *rsvp_object_tree,
2085 int offset, int obj_length,
2086 int class _U_, int type)
2088 int offset2 = offset + 4;
2092 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2094 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2095 "Refresh interval: %u ms (%u seconds)",
2096 tvb_get_ntohl(tvb, offset2),
2097 tvb_get_ntohl(tvb, offset2)/1000);
2098 proto_item_set_text(ti, "TIME VALUES: %d ms",
2099 tvb_get_ntohl(tvb, offset2));
2103 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2104 "C-type: Unknown (%u)",
2106 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2107 "Data (%d bytes)", obj_length - 4);
2112 /*------------------------------------------------------------------------------
2113 * Error value field in ERROR object
2114 *------------------------------------------------------------------------------*/
2116 dissect_rsvp_error_value (proto_tree *ti, tvbuff_t *tvb,
2117 int offset, guint8 error_code)
2120 const value_string *rsvp_error_vals = NULL;
2122 error_val = tvb_get_ntohs(tvb, offset);
2123 switch (error_code) {
2124 case RSVP_ERROR_ADMISSION:
2125 rsvp_error_vals = rsvp_admission_control_error_vals;
2127 case RSVP_ERROR_TRAFFIC:
2128 rsvp_error_vals = rsvp_traffic_control_error_vals;
2130 case RSVP_ERROR_ROUTING:
2131 rsvp_error_vals = rsvp_routing_error_vals;
2133 case RSVP_ERROR_NOTIFY:
2134 rsvp_error_vals = rsvp_notify_error_vals;
2136 case RSVP_ERROR_DIFFSERV:
2137 rsvp_error_vals = rsvp_diffserv_error_vals;
2139 case RSVP_ERROR_DSTE:
2140 rsvp_error_vals = rsvp_diffserv_aware_te_error_vals;
2143 switch (error_code) {
2144 case RSVP_ERROR_ADMISSION:
2145 case RSVP_ERROR_TRAFFIC:
2146 case RSVP_ERROR_NOTIFY:
2147 case RSVP_ERROR_ROUTING:
2148 case RSVP_ERROR_DIFFSERV:
2149 case RSVP_ERROR_DSTE:
2150 if ((error_val & 0xc0) == 0) {
2151 proto_tree_add_text(ti, tvb, offset, 2,
2152 "Error value: %u - %s", error_val,
2153 val_to_str(error_val, rsvp_error_vals, "Unknown (%d)"));
2157 proto_tree_add_text(ti, tvb, offset, 2,
2158 "Error value: %u", error_val);
2163 /*------------------------------------------------------------------------------
2165 *------------------------------------------------------------------------------*/
2167 dissect_rsvp_error (proto_item *ti, proto_tree *rsvp_object_tree,
2169 int offset, int obj_length,
2170 int class _U_, int type)
2172 int offset2 = offset + 4;
2177 proto_tree *ti2, *rsvp_error_subtree;
2181 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2182 "C-type: 1 - IPv4");
2183 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2185 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2186 offset3 = offset2+4;
2191 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2192 "C-type: 2 - IPv6");
2193 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
2195 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
2196 offset3 = offset2+16;
2201 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2202 "C-type: 3 - IPv4 IF-ID");
2203 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2205 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2206 offset3 = offset2+4;
2211 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2212 "C-type: Unknown (%u)",
2214 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2215 "Data (%d bytes)", obj_length - 4);
2219 error_flags = tvb_get_guint8(tvb, offset3);
2220 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset3, 1,
2221 "Flags: 0x%02x", error_flags);
2222 rsvp_error_subtree = proto_item_add_subtree(ti2, TREE(TT_ERROR_FLAGS));
2223 proto_tree_add_text(rsvp_error_subtree, tvb, offset3, 1,
2224 decode_boolean_bitfield(error_flags, 0x04, 8,
2225 "Path State Removed",
2227 proto_tree_add_text(rsvp_error_subtree, tvb, offset3, 1,
2228 decode_boolean_bitfield(error_flags, 0x02, 8,
2231 proto_tree_add_text(rsvp_error_subtree, tvb, offset3, 1,
2232 decode_boolean_bitfield(error_flags, 0x01, 8,
2235 proto_item_append_text(ti2, " %s %s %s",
2236 (error_flags & (1<<2)) ? "Path-State-Removed" : "",
2237 (error_flags & (1<<1)) ? "NotGuilty" : "",
2238 (error_flags & (1<<0)) ? "InPlace" : "");
2239 error_code = tvb_get_guint8(tvb, offset3+1);
2240 proto_tree_add_text(rsvp_object_tree, tvb, offset3+1, 1,
2241 "Error code: %u - %s", error_code,
2242 val_to_str(error_code, rsvp_error_codes, "Unknown (%d)"));
2243 error_val = dissect_rsvp_error_value(rsvp_object_tree, tvb, offset3+2, error_code);
2247 proto_item_set_text(ti, "ERROR: IPv4, Error code: %s, Value: %d, Error Node: %s",
2248 val_to_str(error_code, rsvp_error_codes, "Unknown (%d)"),
2249 error_val, ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2252 proto_item_set_text(ti, "ERROR: IPv4 IF-ID, Error code: %s, Value: %d, Control Node: %s. ",
2253 val_to_str(error_code, rsvp_error_codes, "Unknown (%d)"),
2254 error_val, ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2255 dissect_rsvp_ifid_tlv(ti, rsvp_object_tree, tvb, offset+12, obj_length,
2256 TREE(TT_ERROR_SUBOBJ));
2261 /*------------------------------------------------------------------------------
2263 *------------------------------------------------------------------------------*/
2265 dissect_rsvp_scope (proto_item *ti _U_, proto_tree *rsvp_object_tree,
2267 int offset, int obj_length,
2268 int class _U_, int type)
2270 int offset2 = offset + 4;
2273 mylen = obj_length - 4;
2276 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2277 "C-type: 1 - IPv4");
2279 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2281 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2289 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2290 "C-type: 2 - IPv6");
2292 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
2294 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
2302 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2303 "C-type: Unknown (%u)",
2305 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2306 "Data (%d bytes)", mylen);
2310 /*------------------------------------------------------------------------------
2312 *------------------------------------------------------------------------------*/
2314 dissect_rsvp_style (proto_item *ti, proto_tree *rsvp_object_tree,
2316 int offset, int obj_length,
2317 int class _U_, int type)
2319 int offset2 = offset + 4;
2325 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2327 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2329 tvb_get_guint8(tvb, offset2));
2330 style = tvb_get_ntoh24(tvb, offset2+1);
2331 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1,
2332 3, "Style: 0x%06X - %s", style,
2333 val_to_str(style, style_vals, "Unknown"));
2334 proto_item_set_text(ti, "STYLE: %s (%d)",
2335 val_to_str(style, style_vals, "Unknown"),
2341 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2342 "C-type: Unknown (%u)",
2344 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2345 "Data (%d bytes)", obj_length - 4);
2350 /*------------------------------------------------------------------------------
2352 *------------------------------------------------------------------------------*/
2354 dissect_rsvp_confirm (proto_item *ti, proto_tree *rsvp_object_tree,
2356 int offset, int obj_length,
2357 int class _U_, int type)
2359 int offset2 = offset + 4;
2363 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2364 "C-type: 1 - IPv4");
2365 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2366 "Receiver address: %s",
2367 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2368 proto_item_set_text(ti, "CONFIRM: Receiver %s",
2369 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2374 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2375 "C-type: 2 - IPv6");
2376 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
2377 "Receiver address: %s",
2378 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
2383 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2384 "C-type: Unknown (%u)",
2386 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2387 "Data (%d bytes)", obj_length - 4);
2391 /*------------------------------------------------------------------------------
2392 * SENDER TEMPLATE and FILTERSPEC
2393 *------------------------------------------------------------------------------*/
2395 dissect_rsvp_template_filter (proto_item *ti, proto_tree *rsvp_object_tree,
2397 int offset, int obj_length,
2398 int class _U_, int type,
2399 rsvp_conversation_info *rsvph)
2401 int offset2 = offset + 4;
2403 proto_item_set_text(ti, "%s", summary_template(tvb, offset));
2406 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2407 "C-type: 1 - IPv4");
2408 proto_tree_add_item(rsvp_object_tree,
2409 rsvp_filter[RSVPF_SENDER_IP],
2410 tvb, offset2, 4, FALSE);
2411 proto_tree_add_item(rsvp_object_tree,
2412 rsvp_filter[RSVPF_SENDER_PORT],
2413 tvb, offset2+6, 2, FALSE);
2416 * Save this information to build the conversation request key later.
2418 SET_ADDRESS(&rsvph->source, AT_IPv4, 4, tvb_get_ptr(tvb, offset2, 4));
2419 rsvph->udp_source_port = tvb_get_ntohs(tvb, offset2+6);
2423 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2424 "C-type: 2 - IPv6");
2425 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
2426 "Source address: %s",
2427 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
2428 proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2,
2430 tvb_get_ntohs(tvb, offset2+18));
2434 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2435 "C-type: 7 - IPv4 LSP");
2436 proto_tree_add_item(rsvp_object_tree,
2437 rsvp_filter[RSVPF_SENDER_IP],
2438 tvb, offset2, 4, FALSE);
2439 proto_tree_add_item(rsvp_object_tree,
2440 rsvp_filter[RSVPF_SENDER_LSP_ID],
2441 tvb, offset2+6, 2, FALSE);
2444 * Save this information to build the conversation request key later.
2446 SET_ADDRESS(&rsvph->source, AT_IPv4, 4, tvb_get_ptr(tvb, offset2, 4));
2447 rsvph->udp_source_port = tvb_get_ntohs(tvb, offset2+6);
2451 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2452 "C-type: 9 - IPv4 Aggregate");
2453 proto_tree_add_item(rsvp_object_tree,
2454 rsvp_filter[RSVPF_SENDER_IP],
2455 tvb, offset2, 4, FALSE);
2458 * Save this information to build the conversation request key later.
2460 SET_ADDRESS(&rsvph->source, AT_IPv4, 4, tvb_get_ptr(tvb, offset2, 4));
2464 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2465 "C-type: Unknown (%u)",
2467 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2468 "Data (%d bytes)", obj_length - 4);
2472 /*------------------------------------------------------------------------------
2473 * TLVs for Ethernet SENDER TSPEC and FLOWSPEC
2474 * draft-ietf-ccamp-ethernet-traffic-parameters-02
2475 *------------------------------------------------------------------------------*/
2477 dissect_rsvp_eth_tspec_tlv(proto_item *ti, proto_tree *rsvp_object_tree,
2478 tvbuff_t *tvb, int offset, int tlv_length,
2485 proto_tree *rsvp_ethspec_subtree, *ethspec_profile_subtree, *ti2, *ti3;
2487 for (tlv_off = 0; tlv_off < tlv_length; ) {
2488 tlv_type = tvb_get_ntohs(tvb, offset+tlv_off);
2489 tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2);
2491 if (tlv_len == 0 || tlv_off+tlv_len > tlv_length) {
2492 proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off+2, 2,
2498 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2499 offset+tlv_off, tlv_len,
2501 rsvp_ethspec_subtree = proto_item_add_subtree(ti2, subtree_type);
2502 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off, 2,
2503 "Type: 128 (RESERVED)");
2504 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+2, 2,
2505 "Length: %u", tlv_len);
2509 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2510 offset+tlv_off, tlv_len,
2511 "Ethernet Bandwidth Profile TLV: CIR=%.10g, CBS=%.10g, "
2512 "EIR=%.10g, EBS=%.10g",
2513 tvb_get_ntohieee_float(tvb, offset+tlv_off+8),
2514 tvb_get_ntohieee_float(tvb, offset+tlv_off+12),
2515 tvb_get_ntohieee_float(tvb, offset+tlv_off+16),
2516 tvb_get_ntohieee_float(tvb, offset+tlv_off+20));
2517 rsvp_ethspec_subtree = proto_item_add_subtree(ti2, subtree_type);
2518 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off, 2,
2519 "Type: %d - Ethernet Bandwidth Profile", tlv_type);
2520 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+2, 2,
2521 "Length: %u", tlv_len);
2522 profile = tvb_get_guint8(tvb, offset+tlv_off+4);
2523 ti3 = proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+4, 1,
2524 "Profile: 0x%02x", profile);
2525 ethspec_profile_subtree = proto_item_add_subtree(ti3, TREE(TT_ETHSPEC_SUBTREE));
2526 proto_tree_add_text(ethspec_profile_subtree, tvb, offset+tlv_off+4, 1,
2527 decode_boolean_bitfield(profile, 0x02, 8,
2528 "Color Mode (CM) set",
2529 "Color Mode (CM) NOT set"));
2530 proto_tree_add_text(ethspec_profile_subtree, tvb, offset+tlv_off+4, 1,
2531 decode_boolean_bitfield(profile, 0x01, 8,
2532 "Coupling Flag (CF) set",
2533 "Coupling Flag (CF) NOT set"));
2534 proto_item_append_text(ti3, " %s %s",
2535 (profile & (1<<1)) ? "CM" : "",
2536 (profile & (1<<0)) ? "CF" : "");
2537 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+5, 1,
2538 "Index: %x", tvb_get_guint8(tvb, offset+tlv_off+5));
2539 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+6, 2,
2540 "Reserved: %x", tvb_get_ntohs(tvb, offset+tlv_off+6));
2541 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+8, 4, "CIR: %.10g",
2542 tvb_get_ntohieee_float(tvb, offset+tlv_off+8));
2543 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+12, 4, "CBS: %.10g",
2544 tvb_get_ntohieee_float(tvb, offset+tlv_off+12));
2545 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+16, 4, "EIR: %.10g",
2546 tvb_get_ntohieee_float(tvb, offset+tlv_off+16));
2547 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+20, 4, "EBS: %.10g",
2548 tvb_get_ntohieee_float(tvb, offset+tlv_off+20));
2550 proto_item_append_text(ti, "ETH profile: CIR=%.10g, CBS=%.10g, EIR=%.10g, "
2552 tvb_get_ntohieee_float(tvb, offset+tlv_off+8),
2553 tvb_get_ntohieee_float(tvb, offset+tlv_off+12),
2554 tvb_get_ntohieee_float(tvb, offset+tlv_off+16),
2555 tvb_get_ntohieee_float(tvb, offset+tlv_off+20));
2559 proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off, 2,
2560 "Unknown TLV: %u", tlv_type);
2566 /*------------------------------------------------------------------------------
2568 *------------------------------------------------------------------------------*/
2570 dissect_rsvp_tspec (proto_item *ti, proto_tree *rsvp_object_tree,
2572 int offset, int obj_length,
2573 int class _U_, int type)
2575 int offset2 = offset + 4;
2577 proto_tree *tspec_tree, *ti2;
2579 guint16 switch_gran;
2581 mylen = obj_length - 4;
2585 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2586 "C-type: 2 - Integrated Services");
2587 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2588 "Message format version: %u",
2589 tvb_get_guint8(tvb, offset2)>>4);
2590 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2591 "Data length: %u words, not including header",
2592 tvb_get_ntohs(tvb, offset2+2));
2597 proto_item_set_text(ti, "SENDER TSPEC: IntServ: ");
2603 guint param_len_processed;
2606 service_num = tvb_get_guint8(tvb, offset2);
2607 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2608 "Service header: %u - %s",
2610 val_to_str(service_num, qos_vals, "Unknown"));
2611 length = tvb_get_ntohs(tvb, offset2+2);
2612 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2613 "Length of service %u data: %u words, "
2614 "not including header",
2615 service_num, length);
2620 /* Process all known service headers as a set of parameters */
2621 param_len_processed = 0;
2622 while (param_len_processed < length) {
2623 param_id = tvb_get_guint8(tvb, offset2);
2624 param_len = tvb_get_ntohs(tvb, offset2+2) + 1;
2626 THROW(ReportedBoundsError);
2630 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2631 offset2, param_len*4,
2632 "Token Bucket TSpec: ");
2633 tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE));
2635 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
2636 "Parameter %u - %s",
2638 val_to_str(param_id, svc_vals, "Unknown"));
2639 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
2640 "Parameter %u flags: 0x%02x",
2642 tvb_get_guint8(tvb, offset2+1));
2643 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
2644 "Parameter %u data length: %u words, "
2645 "not including header",
2647 tvb_get_ntohs(tvb, offset2+2));
2648 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
2649 "Token bucket rate: %.10g",
2650 tvb_get_ntohieee_float(tvb, offset2+4));
2651 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2652 "Token bucket size: %.10g",
2653 tvb_get_ntohieee_float(tvb, offset2+8));
2654 proto_tree_add_text(tspec_tree, tvb, offset2+12, 4,
2655 "Peak data rate: %.10g",
2656 tvb_get_ntohieee_float(tvb, offset2+12));
2657 proto_tree_add_text(tspec_tree, tvb, offset2+16, 4,
2658 "Minimum policed unit [m]: %u",
2659 tvb_get_ntohl(tvb, offset2+16));
2660 proto_tree_add_text(tspec_tree, tvb, offset2+20, 4,
2661 "Maximum packet size [M]: %u",
2662 tvb_get_ntohl(tvb, offset2+20));
2663 proto_item_append_text(ti, "Token Bucket, %.10g bytes/sec. ",
2664 tvb_get_ntohieee_float(tvb, offset2+4));
2665 proto_item_append_text(ti2, "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u",
2666 tvb_get_ntohieee_float(tvb, offset2+4),
2667 tvb_get_ntohieee_float(tvb, offset2+8),
2668 tvb_get_ntohieee_float(tvb, offset2+12),
2669 tvb_get_ntohl(tvb, offset2+16),
2670 tvb_get_ntohl(tvb, offset2+20));
2674 /* Null Service (RFC2997) */
2675 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2676 offset2, param_len*4,
2677 "Null Service TSpec: ");
2678 tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE));
2680 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
2681 "Parameter %u - %s",
2683 val_to_str(param_id, svc_vals, "Unknown"));
2684 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
2685 "Parameter %u flags: %x",
2687 tvb_get_guint8(tvb, offset2+1));
2688 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
2689 "Parameter %u data length: %u words, "
2690 "not including header",
2692 tvb_get_ntohs(tvb, offset2+2));
2693 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
2694 "Maximum packet size [M]: %u",
2695 tvb_get_ntohl(tvb, offset2+4));
2696 proto_item_append_text(ti, "Null Service. M=%u",
2697 tvb_get_ntohl(tvb, offset2+4));
2698 proto_item_append_text(ti2, "Max pkt size=%u",
2699 tvb_get_ntohl(tvb, offset2+4));
2703 /* Compression hint (RFC3006) */
2704 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2705 offset2, param_len*4,
2706 "Compression Hint: ");
2707 tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE));
2709 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
2710 "Parameter %u - %s",
2712 val_to_str(param_id, svc_vals, "Unknown"));
2713 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
2714 "Parameter %u flags: %x",
2716 tvb_get_guint8(tvb, offset2+1));
2717 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
2718 "Parameter %u data length: %u words, "
2719 "not including header",
2721 tvb_get_ntohs(tvb, offset2+2));
2722 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
2724 tvb_get_ntohl(tvb, offset2+4));
2725 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
2726 "Compression Factor: %u",
2727 tvb_get_ntohl(tvb, offset2+8));
2728 proto_item_append_text(ti, "Compression Hint. Hint=%u, Factor=%u",
2729 tvb_get_ntohl(tvb, offset2+4),
2730 tvb_get_ntohl(tvb, offset2+8));
2731 proto_item_append_text(ti2, "Hint=%u, Factor=%u",
2732 tvb_get_ntohl(tvb, offset2+4),
2733 tvb_get_ntohl(tvb, offset2+8));
2737 proto_tree_add_text(rsvp_object_tree, tvb, offset2, param_len*4,
2738 "Unknown parameter %d, %d words",
2739 param_id, param_len);
2742 param_len_processed += param_len;
2743 offset2 += param_len*4;
2749 case 4: /* SONET/SDH Tspec */
2750 proto_item_set_text(ti, "SENDER TSPEC: SONET/SDH: ");
2752 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2753 "C-type: 4 - SONET/SDH");
2754 signal_type = tvb_get_guint8(tvb, offset2);
2755 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2756 "Signal Type: %d - %s", signal_type,
2757 val_to_str(signal_type,
2758 gmpls_sonet_signal_type_str, "Unknown"));
2759 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
2760 "Requested Concatenation (RCC): %d", tvb_get_guint8(tvb, offset2+1));
2761 tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE));
2762 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
2763 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x01, 8,
2764 "Standard contiguous concatenation",
2765 "No standard contiguous concatenation"));
2766 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
2767 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x02, 8,
2768 "Arbitrary contiguous concatenation",
2769 "No arbitrary contiguous concatenation"));
2770 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2771 "Number of Contiguous Components (NCC): %d", tvb_get_ntohs(tvb, offset2+2));
2772 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2,
2773 "Number of Virtual Components (NVC): %d", tvb_get_ntohs(tvb, offset2+4));
2774 proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2,
2775 "Multiplier (MT): %d", tvb_get_ntohs(tvb, offset2+6));
2776 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
2777 "Transparency (T): 0x%0x", tvb_get_ntohl(tvb, offset2+8));
2778 tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE));
2779 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2780 decode_boolean_bitfield(tvb_get_ntohl(tvb, offset2+8), 0x0001, 32,
2781 "Section/Regenerator Section layer transparency",
2782 "No Section/Regenerator Section layer transparency"));
2783 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2784 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0002, 32,
2785 "Line/Multiplex Section layer transparency",
2786 "No Line/Multiplex Section layer transparency"));
2787 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2788 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0004, 32,
2790 "No J0 transparency"));
2791 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2792 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0008, 32,
2793 "SOH/RSOH DCC transparency",
2794 "No SOH/RSOH DCC transparency"));
2795 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2796 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0010, 32,
2797 "LOH/MSOH DCC transparency",
2798 "No LOH/MSOH DCC transparency"));
2799 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2800 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0020, 32,
2801 "LOH/MSOH Extended DCC transparency",
2802 "No LOH/MSOH Extended DCC transparency"));
2803 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2804 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0040, 32,
2805 "K1/K2 transparency",
2806 "No K1/K2 transparency"));
2807 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2808 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0080, 32,
2810 "No E1 transparency"));
2811 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2812 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0100, 32,
2814 "No F1 transparency"));
2815 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2816 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0200, 32,
2818 "No E2 transparency"));
2819 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2820 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0400, 32,
2822 "No B1 transparency"));
2823 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2824 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0800, 32,
2826 "No B2 transparency"));
2827 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2828 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x1000, 32,
2830 "No M0 transparency"));
2831 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2832 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x2000, 32,
2834 "No M1 transparency"));
2835 proto_tree_add_text(rsvp_object_tree, tvb, offset2+12, 4,
2836 "Profile (P): %d", tvb_get_ntohl(tvb, offset2+12));
2838 proto_item_append_text(ti, "Signal [%s], RCC %d, NCC %d, NVC %d, MT %d, Transparency %d, Profile %d",
2839 val_to_str(signal_type, gmpls_sonet_signal_type_str, "Unknown"),
2840 tvb_get_guint8(tvb, offset2+1), tvb_get_ntohs(tvb, offset2+2),
2841 tvb_get_ntohs(tvb, offset2+4), tvb_get_ntohs(tvb, offset2+6),
2842 tvb_get_ntohl(tvb, offset2+8), tvb_get_ntohl(tvb, offset2+12));
2845 case 6: /* Ethernet TSPEC draft-ietf-ccamp-ethernet-traffic-parameters-02 */
2846 proto_item_set_text(ti, "SENDER TSPEC: Ethernet: ");
2847 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2848 "C-type: 6 - Ethernet");
2849 switch_gran = tvb_get_ntohs(tvb, offset2);
2850 if (switch_gran == 1)
2851 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2,
2852 "Switching granularity: 1 - Ethernet port");
2853 else if (switch_gran == 2)
2854 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2,
2855 "Switching granularity: 2 - Ethernet frame");
2857 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2,
2858 "Switching granularity: %u - ???", switch_gran);
2860 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2861 "MTU: %u", tvb_get_ntohs(tvb, offset2+2));
2863 dissect_rsvp_eth_tspec_tlv(ti, rsvp_object_tree, tvb, offset+8, obj_length-8,
2864 TREE(TT_TSPEC_SUBTREE));
2867 default: /* Unknown TSpec */
2868 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2869 "C-type: Unknown (%u)",
2871 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2872 "Data (%d bytes)", obj_length - 4);
2878 /*------------------------------------------------------------------------------
2880 *------------------------------------------------------------------------------*/
2882 dissect_rsvp_flowspec (proto_item *ti, proto_tree *rsvp_object_tree,
2884 int offset, int obj_length,
2885 int class _U_, int type)
2887 int offset2 = offset + 4;
2888 int mylen, signal_type;
2889 proto_tree *flowspec_tree, *ti2;
2891 guint16 switch_gran;
2893 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2894 "C-type: %u", type);
2895 mylen = obj_length - 4;
2901 item = proto_tree_add_text(rsvp_object_tree, tvb, 0, 0,
2902 "Object length %u < 8", obj_length);
2903 PROTO_ITEM_SET_GENERATED(item);
2906 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2907 "Message format version: %u",
2908 tvb_get_guint8(tvb, offset2)>>4);
2909 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2910 "Data length: %u words, not including header",
2911 tvb_get_ntohs(tvb, offset2+2));
2913 proto_item_set_text(ti, "FLOWSPEC: ");
2922 guint param_len_processed;
2925 item = proto_tree_add_text(rsvp_object_tree, tvb, 0, 0,
2926 "Object length %u not large enough",
2928 PROTO_ITEM_SET_GENERATED(item);
2931 service_num = tvb_get_guint8(tvb, offset2);
2932 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2933 "Service header: %u - %s",
2935 val_to_str(service_num, intsrv_services_str, "Unknown"));
2936 length = tvb_get_ntohs(tvb, offset2+2);
2937 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2938 "Length of service %u data: %u words, "
2939 "not including header",
2946 proto_item_append_text(ti, "%s: ",
2947 val_to_str(service_num, intsrv_services_str,
2950 /* Process all known service headers as a set of parameters */
2951 param_len_processed = 0;
2952 while (param_len_processed < length) {
2953 param_id = tvb_get_guint8(tvb, offset2);
2954 param_len = tvb_get_ntohs(tvb, offset2+2) + 1;
2956 THROW(ReportedBoundsError);
2960 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2961 offset2, param_len*4,
2963 flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE));
2965 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
2966 "Parameter %u - %s",
2968 val_to_str(param_id, svc_vals, "Unknown"));
2969 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
2970 "Parameter %u flags: 0x%02x",
2972 tvb_get_guint8(tvb, offset2+1));
2973 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
2974 "Parameter %u data length: %u words, "
2975 "not including header",
2977 tvb_get_ntohs(tvb, offset2+2));
2978 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
2979 "Token bucket rate: %.10g",
2980 tvb_get_ntohieee_float(tvb, offset2+4));
2981 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2982 "Token bucket size: %.10g",
2983 tvb_get_ntohieee_float(tvb, offset2+8));
2984 proto_tree_add_text(flowspec_tree, tvb, offset2+12, 4,
2985 "Peak data rate: %.10g",
2986 tvb_get_ntohieee_float(tvb, offset2+12));
2987 proto_tree_add_text(flowspec_tree, tvb, offset2+16, 4,
2988 "Minimum policed unit [m]: %u",
2989 tvb_get_ntohl(tvb, offset2+16));
2990 proto_tree_add_text(flowspec_tree, tvb, offset2+20, 4,
2991 "Maximum packet size [M]: %u",
2992 tvb_get_ntohl(tvb, offset2+20));
2993 proto_item_append_text(ti, "Token Bucket, %.10g bytes/sec. ",
2994 tvb_get_ntohieee_float(tvb, offset2+4));
2995 proto_item_append_text(ti2, "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u",
2996 tvb_get_ntohieee_float(tvb, offset2+4),
2997 tvb_get_ntohieee_float(tvb, offset2+8),
2998 tvb_get_ntohieee_float(tvb, offset2+12),
2999 tvb_get_ntohl(tvb, offset2+16),
3000 tvb_get_ntohl(tvb, offset2+20));
3004 /* Guaranteed-rate RSpec */
3005 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3006 offset2, param_len*4,
3007 "Guaranteed-Rate RSpec: ");
3008 flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE));
3009 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
3010 "Parameter %u - %s",
3012 val_to_str(param_id, svc_vals, "Unknown"));
3013 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
3014 "Parameter %u flags: %x",
3016 tvb_get_guint8(tvb, offset2+1));
3017 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
3018 "Parameter %u data length: %u words, "
3019 "not including header",
3021 tvb_get_ntohs(tvb, offset2+2));
3023 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
3025 tvb_get_ntohieee_float(tvb, offset2+4));
3026 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
3028 tvb_get_ntohl(tvb, offset2+8));
3029 proto_item_append_text(ti, "RSpec, %.10g bytes/sec. ",
3030 tvb_get_ntohieee_float(tvb, offset2+4));
3031 proto_item_append_text(ti2, "R=%.10g, s=%u",
3032 tvb_get_ntohieee_float(tvb, offset2+4),
3033 tvb_get_ntohl(tvb, offset2+8));
3037 /* Null Service (RFC2997) */
3038 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3039 offset2, param_len*4,
3040 "Null Service Flowspec: ");
3041 flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE));
3043 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
3044 "Parameter %u - %s",
3046 val_to_str(param_id, svc_vals, "Unknown"));
3047 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
3048 "Parameter %u flags: %x",
3050 tvb_get_guint8(tvb, offset2+1));
3051 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
3052 "Parameter %u data length: %u words, "
3053 "not including header",
3055 tvb_get_ntohs(tvb, offset2+2));
3056 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
3057 "Maximum packet size [M]: %u",
3058 tvb_get_ntohl(tvb, offset2+4));
3059 proto_item_append_text(ti, "Null Service. M=%u",
3060 tvb_get_ntohl(tvb, offset2+4));
3061 proto_item_append_text(ti2, "Max pkt size=%u",
3062 tvb_get_ntohl(tvb, offset2+4));
3066 proto_tree_add_text(rsvp_object_tree, tvb, offset2, param_len*4,
3067 "Unknown parameter %d, %d words",
3068 param_id, param_len);
3071 param_len_processed += param_len;
3072 offset2 += param_len * 4;
3075 /* offset2 += length*4; */
3081 proto_item_set_text(ti, "FLOWSPEC: SONET/SDH: ");
3083 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3084 "C-type: 4 - SONET/SDH");
3085 signal_type = tvb_get_guint8(tvb, offset2);
3086 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
3087 "Signal Type: %d - %s", signal_type,
3088 val_to_str(signal_type,
3089 gmpls_sonet_signal_type_str, "Unknown"));
3090 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
3091 "Requested Concatenation (RCC): %d", tvb_get_guint8(tvb, offset2+1));
3092 flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE));
3093 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
3094 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x01, 8,
3095 "Standard contiguous concatenation",
3096 "No standard contiguous concatenation"));
3097 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
3098 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x02, 8,
3099 "Arbitrary contiguous concatenation",
3100 "No arbitrary contiguous concatenation"));
3101 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
3102 "Number of Contiguous Components (NCC): %d", tvb_get_ntohs(tvb, offset2+2));
3103 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2,
3104 "Number of Virtual Components (NVC): %d", tvb_get_ntohs(tvb, offset2+4));
3105 proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2,
3106 "Multiplier (MT): %d", tvb_get_ntohs(tvb, offset2+6));
3107 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
3108 "Transparency (T): 0x%0x", tvb_get_ntohl(tvb, offset2+8));
3109 flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE));
3110 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
3111 decode_boolean_bitfield(tvb_get_ntohl(tvb, offset2+8), 0x0001, 32,
3112 "Section/Regenerator Section layer transparency",
3113 "No Section/Regenerator Section layer transparency"));
3114 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
3115 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0002, 32,
3116 "Line/Multiplex Section layer transparency",
3117 "No Line/Multiplex Section layer transparency"));
3118 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
3119 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0004, 32,
3121 "No J0 transparency"));
3122 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
3123 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0008, 32,
3124 "SOH/RSOH DCC transparency",
3125 "No SOH/RSOH DCC transparency"));
3126 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
3127 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0010, 32,
3128 "LOH/MSOH DCC transparency",
3129 "No LOH/MSOH DCC transparency"));
3130 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
3131 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0020, 32,
3132 "LOH/MSOH Extended DCC transparency",
3133 "No LOH/MSOH Extended DCC transparency"));
3134 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
3135 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0040, 32,
3136 "K1/K2 transparency",
3137 "No K1/K2 transparency"));
3138 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
3139 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0080, 32,
3141 "No E1 transparency"));
3142 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
3143 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0100, 32,
3145 "No F1 transparency"));
3146 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
3147 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0200, 32,
3149 "No E2 transparency"));
3150 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
3151 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0400, 32,
3153 "No B1 transparency"));
3154 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
3155 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0800, 32,
3157 "No B2 transparency"));
3158 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
3159 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x1000, 32,
3161 "No M0 transparency"));
3162 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
3163 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x2000, 32,
3165 "No M1 transparency"));
3166 proto_tree_add_text(rsvp_object_tree, tvb, offset2+12, 4,
3167 "Profile (P): %d", tvb_get_ntohl(tvb, offset2+12));
3169 proto_item_append_text(ti, "Signal [%s], RCC %d, NCC %d, NVC %d, MT %d, Transparency %d, Profile %d",
3170 val_to_str(signal_type, gmpls_sonet_signal_type_str, "Unknown"),
3171 tvb_get_guint8(tvb, offset2+1), tvb_get_ntohs(tvb, offset2+2),
3172 tvb_get_ntohs(tvb, offset2+4), tvb_get_ntohs(tvb, offset2+6),
3173 tvb_get_ntohl(tvb, offset2+8), tvb_get_ntohl(tvb, offset2+12));
3176 case 6: /* Ethernet FLOWSPEC draft-ietf-ccamp-ethernet-traffic-parameters-02 */
3177 proto_item_set_text(ti, "FLOWSPEC: Ethernet: ");
3178 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3179 "C-type: 6 - Ethernet");
3180 switch_gran = tvb_get_ntohs(tvb, offset2);
3181 if (switch_gran == 1)
3182 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2,
3183 "Switching granularity: 1 - Ethernet port");
3184 else if (switch_gran == 2)
3185 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2,
3186 "Switching granularity: 2 - Ethernet frame");
3188 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2,
3189 "Switching granularity: %u - ???", switch_gran);
3191 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
3192 "MTU: %u", tvb_get_ntohs(tvb, offset2+2));
3194 dissect_rsvp_eth_tspec_tlv(ti, rsvp_object_tree, tvb, offset+8, obj_length-8,
3195 TREE(TT_FLOWSPEC_SUBTREE));
3205 /*------------------------------------------------------------------------------
3207 *------------------------------------------------------------------------------*/
3209 dissect_rsvp_adspec (proto_item *ti, proto_tree *rsvp_object_tree,
3211 int offset, int obj_length,
3212 int class _U_, int type)
3214 int offset2 = offset + 4;
3216 proto_tree *adspec_tree;
3218 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3219 "C-type: %u", type);
3220 mylen = obj_length - 4;
3222 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
3223 "Message format version: %u",
3224 tvb_get_guint8(tvb, offset2)>>4);
3225 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
3226 "Data length: %u words, not including header",
3227 tvb_get_ntohs(tvb, offset2+2));
3236 service_num = tvb_get_guint8(tvb, offset2);
3237 str = val_to_str(service_num, intsrv_services_str, "Unknown");
3238 break_bit = tvb_get_guint8(tvb, offset2+1);
3239 length = tvb_get_ntohs(tvb, offset2+2);
3240 ti = proto_tree_add_text(rsvp_object_tree, tvb, offset2,
3243 adspec_tree = proto_item_add_subtree(ti,
3244 TREE(TT_ADSPEC_SUBTREE));
3245 proto_tree_add_text(adspec_tree, tvb, offset2, 1,
3246 "Service header %u - %s",
3248 proto_tree_add_text(adspec_tree, tvb, offset2+1, 1,
3250 "Break bit set":"Break bit not set");
3251 proto_tree_add_text(adspec_tree, tvb, offset2+2, 2,
3252 "Data length: %u words, not including header",
3261 id = tvb_get_guint8(tvb, offset2);
3262 phdr_length = tvb_get_ntohs(tvb, offset2+2);
3263 str = match_strval(id, adspec_params);
3273 /* 32-bit unsigned integer */
3274 proto_tree_add_text(adspec_tree, tvb, offset2,
3276 "%s - %u (type %u, length %u)",
3278 tvb_get_ntohl(tvb, offset2+4),
3284 proto_tree_add_text(adspec_tree, tvb, offset2,
3286 "%s - %.10g (type %u, length %u)",
3288 tvb_get_ntohieee_float(tvb, offset2+4),
3292 proto_tree_add_text(adspec_tree, tvb, offset2,
3294 "%s (type %u, length %u)",
3299 proto_tree_add_text(adspec_tree, tvb, offset2,
3301 "Unknown (type %u, length %u)",
3304 offset2 += (phdr_length+1)<<2;
3305 i -= (phdr_length+1)<<2;
3306 mylen -= (phdr_length+1)<<2;
3311 /*------------------------------------------------------------------------------
3313 *------------------------------------------------------------------------------*/
3315 dissect_rsvp_integrity (proto_item *ti _U_, proto_tree *rsvp_object_tree,
3317 int offset, int obj_length,
3318 int class _U_, int type)
3320 int offset2 = offset + 4;
3321 proto_tree *ti2, *rsvp_integ_flags_tree;
3324 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3325 "C-type: %u", type);
3326 flags = tvb_get_guint8(tvb, offset2);
3327 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
3328 "Flags: 0x%02x", flags);
3329 rsvp_integ_flags_tree = proto_item_add_subtree(ti2, TREE(TT_INTEGRITY_FLAGS));
3330 proto_tree_add_text(rsvp_integ_flags_tree, tvb, offset2, 1,
3331 decode_boolean_bitfield(flags, 0x01, 8, "Handshake capable", "Handshake not capable"));
3332 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 6,
3333 "Key Identifier: %s", tvb_bytes_to_str(tvb, offset2+2, 6));
3334 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 8,
3335 "Sequence Number: %" G_GINT64_MODIFIER "u", tvb_get_ntoh64(tvb, offset2+8));
3336 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, obj_length - 20,
3337 "Hash: %s", tvb_bytes_to_str(tvb, offset2+16, obj_length - 20));
3340 /*------------------------------------------------------------------------------
3342 *------------------------------------------------------------------------------*/
3344 dissect_rsvp_policy (proto_item *ti _U_, proto_tree *rsvp_object_tree,
3346 int offset, int obj_length,
3347 int class _U_, int type)
3349 int offset2 = offset + 4;
3351 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3352 "C-type: %u", type);
3353 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3354 "Data (%d bytes)", obj_length - 4);
3357 /*------------------------------------------------------------------------------
3359 *------------------------------------------------------------------------------*/
3361 dissect_rsvp_label_request (proto_item *ti, proto_tree *rsvp_object_tree,
3363 int offset, int obj_length,
3364 int class _U_, int type)
3366 int offset2 = offset + 4;
3370 unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2);
3371 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3373 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
3374 "L3PID: %s (0x%04x)",
3375 val_to_str(l3pid, etype_vals, "Unknown"),
3377 proto_item_set_text(ti, "LABEL REQUEST: Basic: L3PID: %s (0x%04x)",
3378 val_to_str(l3pid, etype_vals, "Unknown"),
3384 unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2);
3385 unsigned short min_vpi, min_vci, max_vpi, max_vci;
3386 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3387 "C-type: 2 (Label Request with ATM label Range)");
3388 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
3389 "L3PID: %s (0x%04x)",
3390 val_to_str(l3pid, etype_vals, "Unknown"),
3392 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 1,
3393 "M: %s Merge in Data Plane",
3394 (tvb_get_guint8(tvb, offset2+4) & 0x80) ?
3395 "1: Can" : "0: Cannot");
3396 min_vpi = tvb_get_ntohs(tvb, offset2+4) & 0x7f;
3397 min_vci = tvb_get_ntohs(tvb, offset2+6);
3398 max_vpi = tvb_get_ntohs(tvb, offset2+8) & 0x7f;
3399 max_vci = tvb_get_ntohs(tvb, offset2+10);
3400 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2,
3401 "Min VPI: %d", min_vpi);
3402 proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2,
3403 "Min VCI: %d", min_vci);
3404 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 2,
3405 "Max VPI: %d", max_vpi);
3406 proto_tree_add_text(rsvp_object_tree, tvb, offset2+10, 2,
3407 "Max VCI: %d", max_vci);
3408 proto_item_set_text(ti, "LABEL REQUEST: ATM: L3PID: %s (0x%04x). VPI/VCI: Min: %d/%d, Max: %d/%d. %s Merge. ",
3409 val_to_str(l3pid, etype_vals, "Unknown"), l3pid,
3410 min_vpi, min_vci, max_vpi, max_vci,
3411 (tvb_get_guint8(tvb, offset2+4) & 0x80) ? "Can" : "Cannot");
3416 guint16 l3pid = tvb_get_ntohs(tvb, offset2+2);
3417 guint32 min_dlci, max_dlci, dlci_len, dlci_len_code;
3418 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3419 "C-type: 2 (Label Request with ATM label Range)");
3420 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
3421 "L3PID: %s (0x%04x)",
3422 val_to_str(l3pid, etype_vals, "Unknown"),
3424 dlci_len_code = (tvb_get_ntohs(tvb, offset2+4) & 0x0180) >> 7;
3425 min_dlci = tvb_get_ntohl(tvb, offset2+4) & 0x7fffff;
3426 max_dlci = tvb_get_ntohl(tvb, offset2+8) & 0x7fffff;
3427 switch(dlci_len_code) {
3440 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2,
3441 "DLCI Length: %s (%d)",
3442 dlci_len==10 ? "10 bits" :
3443 dlci_len==23 ? "23 bits" :
3444 "INVALID", dlci_len_code);
3445 proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 3,
3446 "Min DLCI: %d", min_dlci);
3447 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 2,
3448 "Max DLCI: %d", max_dlci);
3449 proto_item_set_text(ti, "LABEL REQUEST: Frame: L3PID: %s (0x%04x). DLCI Len: %s. Min DLCI: %d. Max DLCI: %d",
3450 val_to_str(l3pid, etype_vals, "Unknown"), l3pid,
3451 dlci_len==10 ? "10 bits" :
3452 dlci_len==23 ? "23 bits" :
3453 "INVALID", min_dlci, max_dlci);
3457 unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2);
3458 unsigned char lsp_enc = tvb_get_guint8(tvb,offset2);
3459 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3460 "C-type: 4 (Generalized Label Request)");
3461 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
3462 "LSP Encoding Type: %s",
3463 val_to_str(lsp_enc, gmpls_lsp_enc_str, "Unknown (%d)"));
3464 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
3465 "Switching Type: %s",
3466 val_to_str(tvb_get_guint8(tvb,offset2+1),
3467 gmpls_switching_type_str, "Unknown (%d)"));
3468 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
3469 "G-PID: %s (0x%0x)",
3470 val_to_str(l3pid, gmpls_gpid_str,
3471 val_to_str(l3pid, etype_vals,
3472 "Unknown G-PID(0x%04x)")),
3474 proto_item_set_text(ti, "LABEL REQUEST: Generalized: LSP Encoding=%s, "
3475 "Switching Type=%s, G-PID=%s ",
3476 val_to_str(lsp_enc, gmpls_lsp_enc_str, "Unknown (%d)"),
3477 val_to_str(tvb_get_guint8(tvb,offset2+1),
3478 gmpls_switching_type_str, "Unknown (%d)"),
3479 val_to_str(l3pid, gmpls_gpid_str,
3480 val_to_str(l3pid, etype_vals,
3481 "Unknown (0x%04x)")));
3486 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3487 "C-type: Unknown (%u)",
3489 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3490 "Data (%d bytes)", obj_length - 4);
3496 /*------------------------------------------------------------------------------
3498 *------------------------------------------------------------------------------*/
3500 dissect_rsvp_label (proto_tree *ti, proto_tree *rsvp_object_tree,
3502 int offset, int obj_length,
3503 int class, int type)
3505 int offset2 = offset + 4;
3509 name = (class==RSVP_CLASS_SUGGESTED_LABEL ? "SUGGESTED LABEL":
3510 (class==RSVP_CLASS_UPSTREAM_LABEL ? "UPSTREAM LABEL":
3511 (class==RSVP_CLASS_RECOVERY_LABEL ? "RECOVERY LABEL":
3513 mylen = obj_length - 4;
3516 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3517 "C-type: 1 (Packet Label)");
3518 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
3520 tvb_get_ntohl(tvb, offset2));
3521 proto_item_set_text(ti, "%s: %u", name,
3522 tvb_get_ntohl(tvb, offset2));
3526 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3527 "C-type: 2 (Generalized Label)");
3528 proto_item_set_text(ti, "%s: Generalized: ", name);
3529 for (i = 0; i < mylen; i += 4) {
3530 proto_tree_add_text(rsvp_object_tree, tvb, offset2+i, 4,
3531 "Generalized Label: %u (0x%x)",
3532 tvb_get_ntohl(tvb, offset2+i),
3533 tvb_get_ntohl(tvb, offset2+i));
3535 proto_item_append_text(ti, "0x%x%s",
3536 tvb_get_ntohl(tvb, offset2+i),
3538 } else if (i == 16) {
3539 proto_item_append_text(ti, "...");
3545 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3546 "C-type: Unknown (%u)",
3548 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
3549 "Data (%d bytes)", mylen);
3554 /*------------------------------------------------------------------------------
3556 *------------------------------------------------------------------------------*/
3558 dissect_rsvp_label_set (proto_item *ti, proto_tree *rsvp_object_tree,
3560 int offset, int obj_length,
3561 int class _U_, int type)
3563 int offset2 = offset + 8;
3567 static const value_string action_type_vals[] = {
3568 {0, "Inclusive list"},
3569 {1, "Exclusive list"},
3570 {2, "Inclusive range"},
3571 {3, "Exclusive range"},
3575 len = obj_length - 8;
3576 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, "C-type: %u", type);
3577 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1, "Action: %s",
3578 val_to_str(tvb_get_guint8(tvb, offset+4),
3579 action_type_vals, "Unknown (%u)"));
3580 proto_item_append_text(ti, ": %s",
3581 val_to_str(tvb_get_guint8(tvb, offset+4),
3582 action_type_vals, "Unknown (%u)"));
3583 label_type = tvb_get_guint8 (tvb, offset+7);
3584 proto_tree_add_text(rsvp_object_tree, tvb, offset+7, 1, "Label type: %s",
3585 label_type==1 ? "Packet Label" : "Generalized Label");
3586 proto_item_append_text(ti, ", %s",
3587 label_type==1 ? "Packet Label: " : "Generalized Label: ");
3589 for (i = 0; i < len/4; i++) {
3590 proto_tree_add_text(rsvp_object_tree, tvb, offset2+i*4, 4,
3591 "Subchannel %u: %u (0x%x)", i+1,
3592 tvb_get_ntohl(tvb, offset2+i*4),
3593 tvb_get_ntohl(tvb, offset2+i*4));
3597 proto_item_append_text(ti, ", ");
3599 proto_item_append_text(ti, "%u",
3600 tvb_get_ntohl(tvb, offset2+i*4));
3605 /*------------------------------------------------------------------------------
3607 *------------------------------------------------------------------------------*/
3609 dissect_rsvp_session_attribute (proto_item *ti, proto_tree *rsvp_object_tree,
3611 int offset, int obj_length,
3612 int class _U_, int type)
3614 int offset2 = offset + 4;
3617 proto_tree *ti2, *rsvp_sa_flags_tree;
3623 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3624 "C-type: %u - IPv4 LSP (%sResource Affinities)",
3625 type, (type == 1) ? "" : "No ");
3628 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
3629 "Exclude-Any: 0x%0x", tvb_get_ntohl(tvb, offset2));
3630 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
3631 "Include-Any: 0x%0x", tvb_get_ntohl(tvb, offset2+4));
3632 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
3633 "Include-All: 0x%0x", tvb_get_ntohl(tvb, offset2+8));
3634 offset2 = offset2+12;
3637 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
3638 "Setup priority: %u",
3639 tvb_get_guint8(tvb, offset2));
3640 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
3641 "Hold priority: %u",
3642 tvb_get_guint8(tvb, offset2+1));
3643 flags = tvb_get_guint8(tvb, offset2+2);
3644 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 1,
3645 "Flags: 0x%02x", flags);
3646 rsvp_sa_flags_tree = proto_item_add_subtree(ti2,
3647 TREE(TT_SESSION_ATTRIBUTE_FLAGS));
3648 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
3649 decode_boolean_bitfield(flags, 0x01, 8,
3650 "Local protection desired",
3651 "Local protection not desired"));
3652 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
3653 decode_boolean_bitfield(flags, 0x02, 8,
3654 "Label recording desired",
3655 "Label recording not desired"));
3656 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
3657 decode_boolean_bitfield(flags, 0x04, 8,
3659 "SE style not desired"));
3660 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
3661 decode_boolean_bitfield(flags, 0x08, 8,
3662 "Bandwidth protection desired",
3663 "Bandwidth protection not desired"));
3664 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
3665 decode_boolean_bitfield(flags, 0x10, 8,
3666 "Node protection desired",
3667 "Node protection not desired"));
3669 name_len = tvb_get_guint8(tvb, offset2+3);
3670 proto_tree_add_text(rsvp_object_tree, tvb, offset2+3, 1,
3671 "Name length: %u", name_len);
3672 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, name_len,
3674 tvb_format_text(tvb, offset2+4, name_len));
3676 proto_item_set_text(ti, "SESSION ATTRIBUTE: SetupPrio %d, HoldPrio %d, %s%s%s%s%s [%s]",
3677 tvb_get_guint8(tvb, offset2),
3678 tvb_get_guint8(tvb, offset2+1),
3679 flags &0x01 ? "Local Protection, " : "",
3680 flags &0x02 ? "Label Recording, " : "",
3681 flags &0x04 ? "SE Style, " : "",
3682 flags &0x08 ? "Bandwidth Protection, " : "",
3683 flags &0x10 ? "Node Protection, " : "",
3684 name_len ? tvb_format_text(tvb, offset2+4, name_len) : "");
3688 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3689 "C-type: Unknown (%u)",
3691 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3692 "Data (%d bytes)", obj_length - 4);
3697 /*------------------------------------------------------------------------------
3698 * EXPLICIT ROUTE AND RECORD ROUTE SUBOBJECTS
3699 *------------------------------------------------------------------------------*/
3701 dissect_rsvp_ero_rro_subobjects (proto_tree *ti, proto_tree *rsvp_object_tree,
3703 int offset, int obj_length, int class)
3705 int i, j, k, l, flags;
3706 proto_tree *ti2, *rsvp_ro_subtree, *rsvp_rro_flags_subtree;
3710 case RSVP_CLASS_EXPLICIT_ROUTE:
3711 tree_type = TREE(TT_EXPLICIT_ROUTE_SUBOBJ);
3713 case RSVP_CLASS_RECORD_ROUTE:
3714 tree_type = TREE(TT_RECORD_ROUTE_SUBOBJ);
3721 for (i=1, l = 0; l < obj_length - 4; i++) {
3722 j = tvb_get_guint8(tvb, offset+l) & 0x7f;
3725 k = tvb_get_guint8(tvb, offset+l) & 0x80;
3726 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3728 "IPv4 Subobject - %s%s",
3729 ip_to_str(tvb_get_ptr(tvb, offset+l+2, 4)),
3730 class == RSVP_CLASS_EXPLICIT_ROUTE ?
3731 (k ? ", Loose" : ", Strict") : "");
3733 proto_item_add_subtree(ti2, tree_type);
3734 if (class == RSVP_CLASS_EXPLICIT_ROUTE)
3735 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3736 k ? "Loose Hop " : "Strict Hop");
3737 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3739 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
3741 tvb_get_guint8(tvb, offset+l+1));
3742 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 4,
3744 ip_to_str(tvb_get_ptr(tvb, offset+l+2, 4)));
3745 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+6, 1,
3746 "Prefix length: %u",
3747 tvb_get_guint8(tvb, offset+l+6));
3749 proto_item_append_text(ti, "IPv4 %s%s",
3750 ip_to_str(tvb_get_ptr(tvb, offset+l+2, 4)),
3753 if (class == RSVP_CLASS_RECORD_ROUTE) {
3754 flags = tvb_get_guint8(tvb, offset+l+7);
3756 proto_item_append_text(ti, " (Node-id)");
3757 proto_item_append_text(ti2, " (Node-id)");
3759 if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available");
3760 if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use");
3761 if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail");
3762 if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop");
3763 ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+7, 1,
3764 "Flags: 0x%02x", flags);
3765 rsvp_rro_flags_subtree =
3766 proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS));
3767 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1,
3768 decode_boolean_bitfield(flags, 0x01, 8,
3769 "Local Protection Available",
3770 "Local Protection Not Available"));
3771 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1,
3772 decode_boolean_bitfield(flags, 0x02, 8,
3773 "Local Protection In Use",
3774 "Local Protection Not In Use"));
3775 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1,
3776 decode_boolean_bitfield(flags, 0x04, 8,
3777 "Bandwidth Protection Available",
3778 "Bandwidth Protection Not Available"));
3779 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1,
3780 decode_boolean_bitfield(flags, 0x08, 8,
3781 "Node Protection Available",
3782 "Node Protection Not Available"));
3783 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1,
3784 decode_boolean_bitfield(flags, 0x10, 8,
3785 "Address Specifies a Node-id Address",
3786 "Address Doesn't Specify a Node-id Address"));
3792 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3796 proto_item_add_subtree(ti2, tree_type);
3797 k = tvb_get_guint8(tvb, offset+l) & 0x80;
3798 if (class == RSVP_CLASS_EXPLICIT_ROUTE)
3799 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3800 k ? "Loose Hop " : "Strict Hop");
3801 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3803 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
3805 tvb_get_guint8(tvb, offset+l+1));
3806 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 16,
3808 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset+l+2, 16)));
3809 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+18, 1,
3810 "Prefix length: %u",
3811 tvb_get_guint8(tvb, offset+l+18));
3813 proto_item_append_text(ti, "IPv6 [...]%s", k ? " [L]":"");
3815 if (class == RSVP_CLASS_RECORD_ROUTE) {
3816 flags = tvb_get_guint8(tvb, offset+l+19);
3818 proto_item_append_text(ti, " (Node-id)");
3819 proto_item_append_text(ti2, " (Node-id)");
3821 if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available");
3822 if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use");
3823 if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail");
3824 if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop");
3825 ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+19, 1,
3826 "Flags: 0x%02x", flags);
3827 rsvp_rro_flags_subtree =
3828 proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS));
3829 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1,
3830 decode_boolean_bitfield(flags, 0x01, 8,
3831 "Local Protection Available",
3832 "Local Protection Not Available"));
3833 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1,
3834 decode_boolean_bitfield(flags, 0x02, 8,
3835 "Local Protection In Use",
3836 "Local Protection Not In Use"));
3837 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1,
3838 decode_boolean_bitfield(flags, 0x04, 8,
3839 "Backup Tunnel Has Bandwidth",
3840 "Backup Tunnel Does Not Have Bandwidth"));
3841 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1,
3842 decode_boolean_bitfield(flags, 0x08, 8,
3843 "Backup Tunnel Goes To Next-Next-Hop",
3844 "Backup Tunnel Goes To Next-Hop"));
3845 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1,
3846 decode_boolean_bitfield(flags, 0x10, 8,
3847 "Address Specifies a Node-id Address",
3848 "Address Doesn't Specify a Node-id Address"));
3854 k = tvb_get_guint8(tvb, offset+l) & 0x80;
3855 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3857 "Label Subobject - %d, %s",
3858 tvb_get_ntohl(tvb, offset+l+4),
3859 class == RSVP_CLASS_EXPLICIT_ROUTE ?
3860 (k ? "Loose" : "Strict") : "");
3862 proto_item_add_subtree(ti2, tree_type);
3863 if (class == RSVP_CLASS_EXPLICIT_ROUTE)
3864 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3865 k ? "Loose Hop " : "Strict Hop");
3866 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3868 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
3870 tvb_get_guint8(tvb, offset+l+1));
3871 if (class == RSVP_CLASS_RECORD_ROUTE) {
3872 flags = tvb_get_guint8(tvb, offset+l+2);
3873 if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available");
3874 if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use");
3875 if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail");
3876 if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop");
3877 ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 1,
3878 "Flags: 0x%02x", flags);
3879 rsvp_rro_flags_subtree =
3880 proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS));
3881 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1,
3882 decode_boolean_bitfield(flags, 0x01, 8,
3883 "Local Protection Available",
3884 "Local Protection Not Available"));
3885 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1,
3886 decode_boolean_bitfield(flags, 0x02, 8,
3887 "Local Protection In Use",
3888 "Local Protection Not In Use"));
3889 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1,
3890 decode_boolean_bitfield(flags, 0x04, 8,
3891 "Backup Tunnel Has Bandwidth",
3892 "Backup Tunnel Does Not Have Bandwidth"));
3893 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1,
3894 decode_boolean_bitfield(flags, 0x08, 8,
3895 "Backup Tunnel Goes To Next-Next-Hop",
3896 "Backup Tunnel Goes To Next-Hop"));
3898 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+3, 1,
3900 tvb_get_guint8(tvb, offset+l+3));
3901 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+4, 4,
3903 tvb_get_ntohl(tvb, offset+l+4));
3905 proto_item_append_text(ti, "Label %d%s",
3906 tvb_get_ntohl(tvb, offset+l+4),
3911 case 4: /* Unnumbered Interface-ID */
3912 k = tvb_get_guint8(tvb, offset+l) & 0x80;
3913 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3915 "Unnumbered Interface-ID - %s, %d, %s",
3916 ip_to_str(tvb_get_ptr(tvb, offset+l+4, 4)),
3917 tvb_get_ntohl(tvb, offset+l+8),
3918 class == RSVP_CLASS_EXPLICIT_ROUTE ?
3919 (k ? "Loose" : "Strict") : "");
3921 proto_item_add_subtree(ti2, tree_type);
3922 if (class == RSVP_CLASS_EXPLICIT_ROUTE)
3923 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3924 k ? "Loose Hop " : "Strict Hop");
3925 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3926 "Type: 4 (Unnumbered Interface-ID)");
3927 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
3929 tvb_get_guint8(tvb, offset+l+1));
3930 if (class == RSVP_CLASS_RECORD_ROUTE) {
3931 flags = tvb_get_guint8(tvb, offset+l+2);
3932 if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available");
3933 if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use");
3934 if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail");
3935 if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop");
3936 ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 1,
3937 "Flags: 0x%02x", flags);
3938 rsvp_rro_flags_subtree =
3939 proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS));
3940 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1,
3941 decode_boolean_bitfield(flags, 0x01, 8,
3942 "Local Protection Available",
3943 "Local Protection Not Available"));
3944 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1,
3945 decode_boolean_bitfield(flags, 0x02, 8,
3946 "Local Protection In Use",
3947 "Local Protection Not In Use"));
3948 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1,
3949 decode_boolean_bitfield(flags, 0x04, 8,
3950 "Backup Tunnel Has Bandwidth",
3951 "Backup Tunnel Does Not Have Bandwidth"));
3952 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1,
3953 decode_boolean_bitfield(flags, 0x08, 8,
3954 "Backup Tunnel Goes To Next-Next-Hop",
3955 "Backup Tunnel Goes To Next-Hop"));
3957 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+4, 4,
3959 ip_to_str(tvb_get_ptr(tvb, offset+l+4, 4)));
3960 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+8, 4,
3962 tvb_get_ntohl(tvb, offset+l+8));
3964 proto_item_append_text(ti, "Unnum %s/%d%s",
3965 ip_to_str(tvb_get_ptr(tvb, offset+l+4, 4)),
3966 tvb_get_ntohl(tvb, offset+l+8),
3973 if (class == RSVP_CLASS_RECORD_ROUTE) goto defaultsub;
3974 k = tvb_get_ntohs(tvb, offset+l+2);
3975 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3977 "Autonomous System %u",
3980 proto_item_add_subtree(ti2, tree_type);
3981 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3982 "Type: 32 (Autonomous System Number)");
3983 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
3985 tvb_get_guint8(tvb, offset+l+1));
3986 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 2,
3987 "Autonomous System %u", k);
3989 proto_item_append_text(ti, "AS %d",
3990 tvb_get_ntohs(tvb, offset+l+2));
3995 default: /* Unknown subobject */
3997 k = tvb_get_guint8(tvb, offset+l) & 0x80;
3998 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4000 tvb_get_guint8(tvb, offset+l+1),
4001 "Unknown subobject: %d", j);
4003 proto_item_add_subtree(ti2, tree_type);
4004 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
4005 k ? "Loose Hop " : "Strict Hop");
4006 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
4007 "Type: %u (Unknown)", j);
4008 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
4010 tvb_get_guint8(tvb, offset+l+1));
4014 if (tvb_get_guint8(tvb, offset+l+1) < 1) {
4015 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
4016 "Invalid length: %u", tvb_get_guint8(tvb, offset+l+1));
4019 l += tvb_get_guint8(tvb, offset+l+1);
4020 if (l < obj_length - 4) {
4022 proto_item_append_text(ti, ", ");
4024 proto_item_append_text(ti, "...");
4029 /*------------------------------------------------------------------------------
4030 * EXPLICIT ROUTE OBJECT
4031 *------------------------------------------------------------------------------*/
4033 dissect_rsvp_explicit_route (proto_item *ti, proto_tree *rsvp_object_tree,
4035 int offset, int obj_length,
4036 int class, int type)
4038 /* int offset2 = offset + 4; */
4039 /* int mylen, i, j, k, l; */
4040 /* proto_tree *ti2, *rsvp_ero_subtree; */
4042 /* mylen = obj_length - 4; */
4045 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4047 proto_item_set_text(ti, "EXPLICIT ROUTE: ");
4049 dissect_rsvp_ero_rro_subobjects(ti, rsvp_object_tree, tvb,
4050 offset + 4, obj_length, class);
4054 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4055 "C-type: Unknown (%u)",
4057 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4,
4058 "Data (%d bytes)", obj_length - 4);
4063 /*------------------------------------------------------------------------------
4064 * RECORD ROUTE OBJECT
4065 *------------------------------------------------------------------------------*/
4067 dissect_rsvp_record_route (proto_item *ti, proto_tree *rsvp_object_tree,
4069 int offset, int obj_length,
4070 int class, int type)
4072 /* int offset2 = offset + 4; */
4073 /* int mylen, i, j, l; */
4074 /* proto_tree *ti2, *rsvp_rro_subtree; */
4076 proto_item_set_text(ti, "RECORD ROUTE: ");
4077 /* mylen = obj_length - 4; */
4080 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4083 dissect_rsvp_ero_rro_subobjects(ti, rsvp_object_tree, tvb,
4084 offset + 4, obj_length, class);
4088 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4089 "C-type: Unknown (%u)",
4091 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4,
4092 "Data (%d bytes)", obj_length - 4);
4097 /*------------------------------------------------------------------------------
4099 *------------------------------------------------------------------------------*/
4101 dissect_rsvp_message_id (proto_tree *ti, proto_tree *rsvp_object_tree,
4103 int offset, int obj_length,
4104 int class _U_, int type)
4106 int offset2 = offset + 4;
4110 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4112 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
4113 "Flags: %d", tvb_get_guint8(tvb, offset+4));
4114 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
4115 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
4116 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4117 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
4118 proto_item_set_text(ti, "MESSAGE-ID: %d %s",
4119 tvb_get_ntohl(tvb, offset+8),
4120 tvb_get_guint8(tvb, offset+4) & 1 ? "(Ack Desired)" : "");
4124 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4125 "C-type: Unknown (%u)",
4127 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
4128 "Data (%d bytes)", obj_length - 4);
4133 /*------------------------------------------------------------------------------
4135 *------------------------------------------------------------------------------*/
4137 dissect_rsvp_message_id_ack (proto_tree *ti, proto_tree *rsvp_object_tree,
4139 int offset, int obj_length,
4140 int class _U_, int type)
4142 int offset2 = offset + 4;
4146 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4148 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
4149 "Flags: %d", tvb_get_guint8(tvb, offset+4));
4150 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
4151 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
4152 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4153 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
4154 proto_item_set_text(ti, "MESSAGE-ID ACK: %d", tvb_get_ntohl(tvb, offset+8));
4158 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4160 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
4161 "Flags: %d", tvb_get_guint8(tvb, offset+4));
4162 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
4163 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
4164 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4165 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
4166 proto_item_set_text(ti, "MESSAGE-ID NACK: %d", tvb_get_ntohl(tvb, offset+8));
4170 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4171 "C-type: Unknown (%u)",
4173 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
4174 "Data (%d bytes)", obj_length - 4);
4179 /*------------------------------------------------------------------------------
4181 *------------------------------------------------------------------------------*/
4183 dissect_rsvp_message_id_list (proto_tree *ti, proto_tree *rsvp_object_tree,
4185 int offset, int obj_length,
4186 int class _U_, int type)
4188 int offset2 = offset + 4;
4193 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4195 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
4196 "Flags: %d", tvb_get_guint8(tvb, offset+4));
4197 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
4198 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
4199 for (mylen = 8; mylen < obj_length; mylen += 4)
4200 proto_tree_add_text(rsvp_object_tree, tvb, offset+mylen, 4,
4201 "Message-ID: %d", tvb_get_ntohl(tvb, offset+mylen));
4202 proto_item_set_text(ti, "MESSAGE-ID LIST: %d IDs",
4203 (obj_length - 8)/4);
4207 mylen = obj_length - 4;
4208 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4209 "C-type: Unknown (%u)",
4211 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
4212 "Data (%d bytes)", obj_length - 4);
4217 /*------------------------------------------------------------------------------
4219 *------------------------------------------------------------------------------*/
4221 dissect_rsvp_hello (proto_tree *ti, proto_tree *rsvp_object_tree,
4223 int offset, int obj_length _U_,
4224 int class _U_, int type)
4229 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4230 "C-Type: %d - HELLO %s object",
4231 tvb_get_guint8 (tvb, offset+3),
4232 type==1 ? "REQUEST" : "ACK");
4233 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4,
4234 "Source Instance: 0x%x",tvb_get_ntohl(tvb, offset+4));
4235 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4236 "Destination Instance: 0x%x",tvb_get_ntohl(tvb, offset+8));
4237 proto_item_append_text(ti, ": %s. Src Instance: 0x%0x. Dest Instance: 0x%0x. ",
4238 type==1 ? "REQUEST" : "ACK",
4239 tvb_get_ntohl(tvb, offset+4),
4240 tvb_get_ntohl(tvb, offset+8));
4243 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4244 "C-Type: %d - UNKNOWN", type);
4249 /*------------------------------------------------------------------------------
4251 *------------------------------------------------------------------------------*/
4253 dissect_rsvp_dclass (proto_tree *ti, proto_tree *rsvp_object_tree,
4255 int offset, int obj_length,
4256 int class _U_, int type)
4258 int offset2 = offset + 4;
4261 proto_item_set_text(ti, "DCLASS: ");
4264 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4266 for (mylen = 4; mylen < obj_length; mylen += 4) {
4267 proto_tree_add_text(rsvp_object_tree, tvb, offset+mylen+3, 1,
4269 val_to_str(tvb_get_guint8(tvb, offset+mylen+3),
4270 dscp_vals, "Unknown (%d)"));
4271 proto_item_append_text(ti, "%d%s",
4272 tvb_get_guint8(tvb, offset+mylen+3)>>2,
4273 mylen==obj_length-4 ? "":
4275 mylen==16 ? ", ..." : "");
4280 mylen = obj_length - 4;
4281 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4282 "C-type: Unknown (%u)",
4284 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
4285 "Data (%d bytes)", mylen);
4290 /*------------------------------------------------------------------------------
4291 * ADMINISTRATIVE STATUS
4292 *------------------------------------------------------------------------------*/
4294 dissect_rsvp_admin_status (proto_tree *ti, proto_tree *rsvp_object_tree,
4296 int offset, int obj_length,
4297 int class _U_, int type)
4299 int offset2 = offset + 4;
4300 proto_tree *ti2, *rsvp_admin_subtree;
4304 proto_item_set_text(ti, "ADMIN STATUS: ");
4307 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4309 status = tvb_get_ntohl(tvb, offset2);
4310 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
4311 "Admin Status: 0x%08x", status);
4312 rsvp_admin_subtree =
4313 proto_item_add_subtree(ti2, TREE(TT_ADMIN_STATUS_FLAGS));
4314 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 4,
4315 decode_boolean_bitfield(status, 0x80000000, 32,
4317 "R: Do not reflect"));
4318 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 4,
4319 decode_boolean_bitfield(status, 0x04, 32,
4322 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 4,
4323 decode_boolean_bitfield(status, 0x02, 32,
4324 "A: Administratively Down",
4326 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 4,
4327 decode_boolean_bitfield(status, 0x01, 32,
4328 "D: Delete In Progress",
4330 proto_item_set_text(ti, "ADMIN-STATUS: %s %s %s %s",
4331 (status & (1<<31)) ? "Reflect" : "",
4332 (status & (1<<2)) ? "Testing" : "",
4333 (status & (1<<1)) ? "Admin-Down" : "",
4334 (status & (1<<0)) ? "Deleting" : "");
4338 mylen = obj_length - 4;
4339 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4340 "C-type: Unknown (%u)",
4342 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
4343 "Data (%d bytes)", obj_length - 4);
4348 /*------------------------------------------------------------------------------
4350 *------------------------------------------------------------------------------*/
4352 dissect_rsvp_association (proto_tree *ti, proto_tree *rsvp_object_tree,
4354 int offset, int obj_length,
4355 int class _U_, int type)
4357 guint16 association_type;
4358 guint16 association_id;
4359 static const value_string association_type_vals[] = {
4365 proto_item_set_text(ti, "ASSOCIATION ");
4366 association_type = tvb_get_ntohs (tvb, offset + 4);
4367 association_id = tvb_get_ntohs (tvb, offset + 6);
4370 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4371 "C-type: 1 (IPv4)");
4372 proto_item_append_text(ti, "(IPv4): ");
4373 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 2,
4374 "Association type: %s",
4375 val_to_str(association_type, association_type_vals, "Unknown (%u)"));
4376 proto_item_append_text(ti, "%s. ",
4377 val_to_str(association_type, association_type_vals, "Unknown (%u)"));
4378 proto_tree_add_text(rsvp_object_tree, tvb, offset+6, 2,
4379 "Association ID: %u", association_id);
4380 proto_item_append_text(ti, "ID: %u. ", association_id);
4381 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4382 "Association source: %s", ip_to_str(tvb_get_ptr(tvb, offset+8, 4)));
4383 proto_item_append_text(ti, "Src: %s", ip_to_str(tvb_get_ptr(tvb, offset+8, 4)));
4387 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4388 "C-type: 2 (IPv6)");
4389 proto_item_append_text(ti, "(IPv6): ");
4390 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 2,
4391 "Association type: %s",
4392 val_to_str(association_type, association_type_vals, "Unknown (%u)"));
4393 proto_item_append_text(ti, "%s. ",
4394 val_to_str(association_type, association_type_vals, "Unknown (%u)"));
4395 proto_tree_add_text(rsvp_object_tree, tvb, offset+6, 2,
4396 "Association ID: %u", association_id);
4397 proto_item_append_text(ti, "ID: %u. ", association_id);
4398 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 16,
4399 "Association source: %s", ip6_to_str((const struct e_in6_addr *)
4400 tvb_get_ptr(tvb, offset+8, 16)));
4401 proto_item_append_text(ti, "Src: %s", ip6_to_str((const struct e_in6_addr *)
4402 tvb_get_ptr(tvb, offset+8, 16)));
4406 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4407 "C-type: Unknown (%u)", type);
4408 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4,
4409 "Data (%d bytes)", obj_length - 4);
4414 /*------------------------------------------------------------------------------
4415 * TLVs for LSP TUNNEL IF ID object
4416 * draft-ietf-ccamp-lsp-hierarchy-bis-02
4417 *------------------------------------------------------------------------------*/
4419 dissect_rsvp_lsp_tunnel_if_id_tlv(proto_tree *rsvp_object_tree,
4420 tvbuff_t *tvb, int offset, int tlv_length,
4426 proto_tree *ti, *rsvp_lsp_tunnel_if_id_subtree;
4428 for (tlv_off = 0; tlv_off < tlv_length; ) {
4429 tlv_type = tvb_get_ntohs(tvb, offset+tlv_off);
4430 tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2);
4432 if (tlv_len == 0 || tlv_off+tlv_len > tlv_length) {
4433 proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off+2, 2,
4439 ti = proto_tree_add_text(rsvp_object_tree, tvb,
4440 offset+tlv_off, tlv_len,
4441 "Unnumbered component link identifier: %u",
4442 tvb_get_ntohl(tvb, offset+tlv_off+4));
4443 rsvp_lsp_tunnel_if_id_subtree = proto_item_add_subtree(ti, subtree_type);
4444 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off, 2,
4445 "Type: 1 (Unnumbered component link identifier)");
4446 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+2, 2,
4447 "Length: %u", tlv_len);
4448 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+4, 4,
4449 "Component link identifier: %u",
4450 tvb_get_ntohl(tvb, offset+tlv_off+4));
4454 ti = proto_tree_add_text(rsvp_object_tree, tvb,
4455 offset+tlv_off, tlv_len,
4456 "IPv4 component link identifier: %s",
4457 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)));
4458 rsvp_lsp_tunnel_if_id_subtree = proto_item_add_subtree(ti, subtree_type);
4459 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off, 2,
4460 "Type: 2 (IPv4 component link identifier)");
4461 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+2, 2,
4462 "Length: %u", tlv_len);
4463 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+4, 4,
4464 "Component link identifier: %s",
4465 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)));
4468 case 32769: /* oif-p0040.002.09 demo spec */
4469 ti = proto_tree_add_text(rsvp_object_tree, tvb,
4470 offset+tlv_off, tlv_len,
4471 "Targeted client layer: ");
4472 rsvp_lsp_tunnel_if_id_subtree = proto_item_add_subtree(ti, subtree_type);
4473 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off, 2,
4474 "Type: 32769 (Targeted client layer)");
4475 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+2, 2,
4476 "Length: %u", tlv_len);
4477 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+4, 1,
4478 "LSP Encoding Type: %s",
4479 val_to_str(tvb_get_guint8(tvb,offset+tlv_off+4),
4480 gmpls_lsp_enc_str, "Unknown (%d)"));
4481 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+5, 1,
4482 "Switching Type: %s",
4483 val_to_str(tvb_get_guint8(tvb,offset+tlv_off+5),
4484 gmpls_switching_type_str, "Unknown (%d)"));
4485 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+6, 1,
4487 val_to_str(tvb_get_guint8(tvb,offset+tlv_off+6),
4488 gmpls_sonet_signal_type_str, "Unknown (%d)"));
4489 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+8, 8,
4490 "Sub Interface/Connection ID: %" G_GINT64_MODIFIER "u (0x%s)",
4491 tvb_get_ntoh64(tvb, offset+tlv_off+8),
4492 tvb_bytes_to_str(tvb, offset+tlv_off+8, 8));
4493 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+16, 4,
4495 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+16, 4)));
4496 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+20, 4,
4497 "SC PC SCN Address: %s",
4498 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+20, 4)));
4499 proto_item_append_text(ti, "LSP Encoding=%s, Switching Type=%s, Signal Type=%s",
4500 val_to_str(tvb_get_guint8(tvb,offset+tlv_off+4),
4501 gmpls_lsp_enc_str, "Unknown (%d)"),
4502 val_to_str(tvb_get_guint8(tvb,offset+tlv_off+5),
4503 gmpls_switching_type_str, "Unknown (%d)"),
4504 val_to_str(tvb_get_guint8(tvb,offset+tlv_off+6),
4505 gmpls_sonet_signal_type_str, "Unknown (%d)"));
4509 proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off, 2,
4510 "Unknown TLV: %u", tlv_type);
4516 /*------------------------------------------------------------------------------
4517 * LSP TUNNEL INTERFACE ID
4518 *------------------------------------------------------------------------------*/
4520 dissect_rsvp_lsp_tunnel_if_id (proto_tree *ti, proto_tree *rsvp_object_tree,
4522 int offset, int obj_length,
4523 int class _U_, int type)
4527 static const value_string lsp_tunnel_if_id_action_str[] = {
4528 {0, "LSP is FA (MPLS-TE topology advertisement only)"},
4529 {1, "LSP is RA (IP network advertisement only)"},
4530 {2, "LSP is RA (both IP and MPLS-TE topology advertisement)"},
4531 {3, "LSP is to be used as a virtual local link"},
4535 proto_item_set_text(ti, "LSP INTERFACE-ID: ");
4538 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4539 "C-type: 1 - Unnumbered interface");
4540 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4,
4542 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)));
4543 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4544 "Interface ID: %u", tvb_get_ntohl(tvb, offset+8));
4545 proto_item_set_text(ti, "LSP INTERFACE-ID: Unnumbered, Router-ID %s, Interface-ID %d",
4546 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
4547 tvb_get_ntohl(tvb, offset+8));
4551 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4552 "C-type: 2 - IPv4");
4553 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4,
4554 "IPv4 interface address: %s",
4555 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)));
4556 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4557 "Target IGP instance: %s",
4558 ip_to_str(tvb_get_ptr(tvb, offset+8, 4)));
4559 proto_item_set_text(ti, "LSP INTERFACE-ID: IPv4, interface address %s,"
4561 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
4562 ip_to_str(tvb_get_ptr(tvb, offset+8, 4)));
4563 action = tvb_get_guint8(tvb, offset+12);
4565 proto_tree_add_text(rsvp_object_tree, tvb, offset+12, 1, "Action: %d - %s",
4567 val_to_str(action, lsp_tunnel_if_id_action_str, "Unknown"));
4568 dissect_rsvp_lsp_tunnel_if_id_tlv(rsvp_object_tree, tvb, offset+16, obj_length-16,
4569 TREE(TT_LSP_TUNNEL_IF_ID_SUBTREE));
4573 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4574 "C-type: 3 - IPv6");
4575 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 16,
4576 "IPv6 interface address: %s",
4577 ip6_to_str((const struct e_in6_addr *)
4578 tvb_get_ptr(tvb, offset+4, 16)));
4579 proto_tree_add_text(rsvp_object_tree, tvb, offset+20, 4,
4580 "Target IGP instance: %s",
4581 ip_to_str(tvb_get_ptr(tvb, offset+20, 4)));
4582 proto_item_set_text(ti, "LSP INTERFACE-ID: IPv6, interface address %s,"
4584 ip6_to_str((const struct e_in6_addr *)
4585 tvb_get_ptr(tvb, offset+4, 16)),
4586 ip_to_str(tvb_get_ptr(tvb, offset+20, 4)));
4587 action = tvb_get_guint8(tvb, offset+24);
4589 proto_tree_add_text(rsvp_object_tree, tvb, offset+24, 1, "Action: %d - %s",
4591 val_to_str(action, lsp_tunnel_if_id_action_str, "Unknown"));
4592 dissect_rsvp_lsp_tunnel_if_id_tlv(rsvp_object_tree, tvb, offset+28, obj_length-28,
4593 TREE(TT_LSP_TUNNEL_IF_ID_SUBTREE));
4597 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4598 "C-type: 4 - Unnumbered interface with target");
4599 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4,
4601 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)));
4602 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4603 "Interface ID: %u", tvb_get_ntohl(tvb, offset+8));
4604 proto_tree_add_text(rsvp_object_tree, tvb, offset+12, 4,
4605 "Target IGP instance: %s",
4606 ip_to_str(tvb_get_ptr(tvb, offset+12, 4)));
4607 proto_item_set_text(ti, "LSP INTERFACE-ID: Unnumbered with target, Router-ID %s,"
4608 " Interface-ID %d, IGP instance %s",
4609 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
4610 tvb_get_ntohl(tvb, offset+8),
4611 ip_to_str(tvb_get_ptr(tvb, offset+12, 4)));
4612 action = tvb_get_guint8(tvb, offset+16);
4614 proto_tree_add_text(rsvp_object_tree, tvb, offset+16, 1, "Action: %d - %s",
4616 val_to_str(action, lsp_tunnel_if_id_action_str, "Unknown"));
4617 dissect_rsvp_lsp_tunnel_if_id_tlv(rsvp_object_tree, tvb, offset+20, obj_length-20,
4618 TREE(TT_LSP_TUNNEL_IF_ID_SUBTREE));
4622 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4623 "C-type: Unknown (%u)",
4625 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length-4,
4626 "Data (%d bytes)", obj_length-4);
4631 /*------------------------------------------------------------------------------
4633 *------------------------------------------------------------------------------*/
4635 dissect_rsvp_notify_request (proto_item *ti, proto_tree *rsvp_object_tree,
4637 int offset, int obj_length,
4638 int class _U_, int type)
4640 int offset2 = offset + 4;
4644 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4645 "C-type: 1 - IPv4");
4646 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
4647 "Notify node address: %s",
4648 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
4649 proto_item_append_text(ti, ": Notify node: %s",
4650 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
4655 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4656 "C-type: 2 - IPv6");
4657 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
4658 "Notify node address: %s",
4659 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
4660 proto_item_append_text(ti, ": Notify node: %s",
4661 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
4666 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4667 "C-type: Unknown (%u)",
4669 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
4670 "Data (%d bytes)", obj_length - 4);
4674 /*------------------------------------------------------------------------------
4676 *------------------------------------------------------------------------------*/
4678 dissect_rsvp_gen_uni (proto_tree *ti, proto_tree *rsvp_object_tree,
4680 int offset, int obj_length,
4681 int class _U_, int type,
4682 rsvp_conversation_info *rsvph)
4684 int offset2 = offset + 4;
4685 int mylen, i, j, k, l, m;
4687 proto_tree *rsvp_gen_uni_subtree, *rsvp_session_subtree, *rsvp_template_subtree;
4688 int s_len, s_class, s_type;
4691 proto_item_set_text(ti, "GENERALIZED UNI: ");
4693 mylen = obj_length - 4;
4697 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4699 for (i=1, l = 0; l < mylen; i++) {
4700 j = tvb_get_guint8(tvb, offset2+l+2);
4703 case 2: /* We do source and destination TNA together */
4704 c = (j==1) ? "Source" : "Destination";
4705 k = tvb_get_guint8(tvb, offset2+l+3);
4708 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4710 "%s IPv4 TNA: %s", c,
4711 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)));
4712 rsvp_gen_uni_subtree =
4713 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4714 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
4715 "Class: %d (%s)", j, c);
4716 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
4718 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
4720 tvb_get_ntohs(tvb, offset2+l));
4722 proto_tree_add_item(rsvp_gen_uni_subtree, rsvp_filter[RSVPF_GUNI_SRC_IPV4],
4723 tvb, offset2+l+4, 4, FALSE);
4725 proto_tree_add_item(rsvp_gen_uni_subtree, rsvp_filter[RSVPF_GUNI_DST_IPV4],
4726 tvb, offset2+l+4, 4, FALSE);
4728 proto_item_append_text(ti, "%s IPv4 TNA: %s", c,
4729 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)));
4734 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4737 rsvp_gen_uni_subtree =
4738 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4739 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
4740 "Class: %d (%s)", j, c);
4741 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
4743 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
4745 tvb_get_ntohs(tvb, offset2+l));
4747 proto_tree_add_item(rsvp_gen_uni_subtree, rsvp_filter[RSVPF_GUNI_SRC_IPV6],
4748 tvb, offset2+l+4, 16, FALSE);
4750 proto_tree_add_item(rsvp_gen_uni_subtree, rsvp_filter[RSVPF_GUNI_DST_IPV6],
4751 tvb, offset2+l+4, 16, FALSE);
4753 proto_item_append_text(ti, "%s IPv6 %s", c,
4754 ip6_to_str((const struct e_in6_addr *)
4755 tvb_get_ptr(tvb, offset2+l+4, 16)));
4760 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4761 offset2+l, tvb_get_ntohs(tvb, offset2+l),
4763 rsvp_gen_uni_subtree =
4764 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4765 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
4766 "Class: %d (%s)", j, c);
4767 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
4769 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
4771 tvb_get_ntohs(tvb, offset2+l));
4772 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4,
4773 tvb_get_ntohs(tvb, offset2+l)-4,
4776 proto_item_append_text(ti, "%s NSAP", c);
4781 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4782 offset2+l, tvb_get_ntohs(tvb, offset2+l),
4783 "%s UNKNOWN TNA", c);
4784 rsvp_gen_uni_subtree =
4785 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4786 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
4787 "Class: %d (%s)", j, c);
4788 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
4789 "Type: %d (UNKNOWN)", j);
4790 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
4792 tvb_get_ntohs(tvb, offset2+l));
4793 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4,
4794 tvb_get_ntohs(tvb, offset2+l)-4,
4797 proto_item_append_text(ti, "%s UNKNOWN", c);
4803 case 3: /* Diversity subobject */
4804 k = tvb_get_guint8(tvb, offset2+l+3);
4808 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4809 offset2+l, tvb_get_ntohs(tvb, offset2+l),
4810 "Diversity Subobject");
4811 rsvp_gen_uni_subtree =
4812 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4813 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
4814 "Class: %d (Diversity)", j);
4815 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
4816 "Type: %d", tvb_get_guint8(tvb, offset2+l+3));
4817 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
4819 tvb_get_ntohs(tvb, offset2+l));
4820 m = tvb_get_guint8(tvb, offset2+l+4) >> 4;
4821 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1,
4822 "Diversity: %d - %s", m,
4823 val_to_str(m, ouni_guni_diversity_str, "Unknown"));
4824 s_len = tvb_get_ntohs(tvb, offset2+l+8);
4825 s_class = tvb_get_guint8(tvb, offset2+l+10);
4826 s_type = tvb_get_guint8(tvb, offset2+l+11);
4827 ti2 = proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+8,
4829 rsvp_session_subtree =
4830 proto_item_add_subtree(ti2, TREE(rsvp_class_to_tree_type(s_class)));
4832 proto_tree_add_text(rsvp_object_tree, tvb, offset2+l+8, 2,
4833 "Length: %u (bogus, must be >= 4)", s_len);
4836 proto_tree_add_text(rsvp_session_subtree, tvb, offset2+l+8, 2,
4837 "Length: %u", s_len);
4838 proto_tree_add_uint(rsvp_session_subtree, rsvp_filter[RSVPF_OBJECT], tvb,
4839 offset2+8+l+10, 1, s_class);
4840 dissect_rsvp_session(ti2, rsvp_session_subtree, tvb, offset2+l+8,
4841 s_len, s_class, s_type, rsvph);
4842 offset3 = offset2 + s_len;
4843 s_len = tvb_get_ntohs(tvb, offset3+l+8);
4844 s_class = tvb_get_guint8(tvb, offset3+l+10);
4845 s_type = tvb_get_guint8(tvb, offset3+l+11);
4846 ti2 = proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset3+l+8,
4848 rsvp_template_subtree =
4849 proto_item_add_subtree(ti2, TREE(rsvp_class_to_tree_type(s_class)));
4851 proto_tree_add_text(rsvp_object_tree, tvb, offset3+l+8, 2,
4852 "Length: %u (bogus, must be >= 4)", s_len);
4855 proto_tree_add_text(rsvp_template_subtree, tvb, offset3+l+8, 2,
4856 "Length: %u", s_len);
4857 proto_tree_add_uint(rsvp_template_subtree, rsvp_filter[RSVPF_OBJECT], tvb,
4858 offset3+8+l+10, 1, s_class);
4859 dissect_rsvp_template_filter(ti2, rsvp_template_subtree, tvb, offset3+l+8,
4860 s_len, s_class, s_type, rsvph);
4863 proto_item_append_text(ti, "Diversity");
4870 case 4: /* Egress Label */
4871 k = tvb_get_guint8(tvb, offset2+l+3);
4872 if (k == 1) /* Egress label sub-type */
4873 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4874 offset2+l, tvb_get_ntohs(tvb, offset2+l),
4875 "Egress Label Subobject");
4876 else if (k == 2) /* SPC_label sub-type (see G.7713.2) */
4877 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4878 offset2+l, tvb_get_ntohs(tvb, offset2+l),
4879 "SPC Label Subobject");
4881 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4882 offset2+l, tvb_get_ntohs(tvb, offset2+l),
4883 "Unknown Label Subobject");
4884 rsvp_gen_uni_subtree = proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4885 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
4886 "Class: %d (Egress/SPC Label)", j);
4887 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
4889 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
4891 tvb_get_ntohs(tvb, offset2+l));
4892 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1,
4894 decode_boolean_bitfield(
4895 tvb_get_guint8(tvb, offset2+l+4), 0x80, 8,
4896 "U: 1 - Upstream label/port ID",
4897 "U: 0 - Downstream label/port ID"));
4898 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+7, 1,
4899 "Label type: %u", tvb_get_guint8(tvb, offset2+l+7));
4900 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+8, 4,
4901 "Logical Port ID: %u", tvb_get_ntohl(tvb, offset2+l+8));
4902 proto_item_append_text(ti2, ": %s, Label type %d, Port ID %d, Label ",
4903 tvb_get_guint8(tvb, offset2+l+4) & 0x80 ?
4904 "Upstream" : "Downstream",
4905 tvb_get_guint8(tvb, offset2+l+7),
4906 tvb_get_ntohl(tvb, offset2+l+8));
4907 for (j=12; j < tvb_get_ntohs(tvb, offset2+l); j+=4) {
4908 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+j, 4,
4909 "Label: %u", tvb_get_ntohl(tvb, offset2+l+j));
4910 proto_item_append_text(ti2, "%u ", tvb_get_ntohl(tvb, offset2+l+j));
4914 proto_item_append_text(ti, "Egress Label");
4916 proto_item_append_text(ti, "SPC Label");
4920 case 5: /* Service Level */
4921 k = tvb_get_guint8(tvb, offset2+l+3);
4925 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4926 offset2+l, tvb_get_ntohs(tvb, offset2+l),
4927 "Service Level Subobject");
4928 rsvp_gen_uni_subtree =
4929 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4930 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
4931 "Class: %d (Egress Label)", j);
4932 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
4933 "Type: %d", tvb_get_guint8(tvb, offset2+l+3));
4934 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
4936 tvb_get_ntohs(tvb, offset2+l));
4937 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1,
4938 "Service Level: %u", tvb_get_guint8(tvb, offset2+l+4));
4939 proto_item_append_text(ti2, ": %u", tvb_get_guint8(tvb, offset2+l+4));
4941 proto_item_append_text(ti, "Service Level %d", tvb_get_guint8(tvb, offset2+l+4));
4947 default: /* Unknown subobject */
4948 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4950 tvb_get_ntohs(tvb, offset2+l),
4951 "Unknown subobject: %u",
4953 rsvp_gen_uni_subtree =
4954 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4955 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 1,
4956 "Type: %u (Unknown)", j);
4957 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+1, 1,
4959 tvb_get_guint8(tvb, offset2+l+1));
4963 if (tvb_get_guint8(tvb, offset2+l+1) < 1) {
4964 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+1, 1,
4965 "Invalid length: %u", tvb_get_guint8(tvb, offset2+l+1));
4968 l += tvb_get_guint8(tvb, offset2+l+1);
4971 proto_item_append_text(ti, ", ");
4973 proto_item_append_text(ti, "...");
4980 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4981 "C-type: Unknown (%u)",
4983 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
4984 "Data (%d bytes)", mylen);
4989 /*------------------------------------------------------------------------------
4991 *------------------------------------------------------------------------------*/
4993 dissect_rsvp_call_id (proto_tree *ti, proto_tree *rsvp_object_tree,
4995 int offset, int obj_length,
4996 int class _U_, int c_type)
5000 int offset2 = offset + 4;
5001 int offset3, offset4, len;
5003 static const value_string address_type_vals[] = {
5008 {0x7f, "0x7f (Vendor-defined)"},
5012 proto_item_set_text(ti, "CALL-ID: ");
5013 type = tvb_get_guint8 (tvb, offset2);
5016 proto_item_append_text(ti,"Empty");
5017 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5018 "C-type: Empty (%u)", type);
5019 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length-4,
5020 "Data (%d bytes)", obj_length-4);
5025 offset3 = offset2 + 4;
5026 len = obj_length - 16;
5027 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5028 "C-type: 1 (operator specific)");
5029 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, "Address type: %s",
5030 val_to_str(type, address_type_vals, "Unknown (%u)"));
5031 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 3, "Reserved: %u",
5032 tvb_get_ntoh24(tvb, offset2+1));
5033 proto_item_append_text(ti, "Operator-Specific. Addr Type: %s. ",
5034 val_to_str(type, address_type_vals, "Unknown (%u)"));
5037 offset3 = offset2 + 16;
5038 len = obj_length - 28;
5039 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5040 "C-type: 2 (globally unique)");
5041 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, "Address type: %s",
5042 val_to_str(type, address_type_vals, "Unknown (%u)"));
5043 str = tvb_get_ephemeral_string (tvb, offset2 + 1, 3);
5044 proto_tree_add_text(rsvp_object_tree, tvb, offset2 + 1, 3,
5045 "International Segment: %s", str);
5046 proto_item_append_text(ti, "Globally-Unique. Addr Type: %s. Intl Segment: %s. ",
5047 val_to_str(type, address_type_vals, "Unknown (%u)"), str);
5048 str = tvb_get_ephemeral_string (tvb, offset2 + 4, 12);
5049 proto_tree_add_text(rsvp_object_tree, tvb, offset2 + 4, 12,
5050 "National Segment: %s", str);
5051 proto_item_append_text(ti, "Natl Segment: %s. ", str);
5056 offset4 = offset3 + 4;
5057 proto_tree_add_item(rsvp_object_tree, rsvp_filter[RSVPF_CALL_ID_SRC_ADDR_IPV4],
5058 tvb, offset3, 4, FALSE);
5059 proto_item_append_text(ti, "Src: %s. ", ip_to_str(tvb_get_ptr(tvb, offset3, 4)));
5063 offset4 = offset3 + 16;
5064 proto_tree_add_item(rsvp_object_tree, rsvp_filter[RSVPF_CALL_ID_SRC_ADDR_IPV6],
5065 tvb, offset3, 16, FALSE);
5066 proto_item_append_text(ti, "Src: %s. ",
5067 ip6_to_str((const struct e_in6_addr *) tvb_get_ptr(tvb, offset3, 16)));
5071 offset4 = offset3 + 20;
5072 proto_tree_add_text(rsvp_object_tree, tvb, offset3, 20, "Source Transport Network addr: %s",
5073 tvb_bytes_to_str(tvb, offset3, 20));
5074 proto_item_append_text(ti, "Src: %s. ", tvb_bytes_to_str(tvb, offset3, 20));
5078 offset4 = offset3 + 6;
5079 proto_tree_add_text(rsvp_object_tree, tvb, offset3, 6, "Source Transport Network addr: %s",
5080 tvb_bytes_to_str(tvb, offset3, 6));
5081 proto_item_append_text(ti, "Src: %s. ", tvb_bytes_to_str(tvb, offset3, 6));
5085 offset4 = offset3 + len;
5086 proto_tree_add_text(rsvp_object_tree, tvb, offset3, len, "Source Transport Network addr: %s",
5087 tvb_bytes_to_str(tvb, offset3, len));
5088 proto_item_append_text(ti, "Src: %s. ", tvb_bytes_to_str(tvb, offset3, len));
5092 offset4 = offset3 + len;
5093 proto_tree_add_text(rsvp_object_tree, tvb, offset3, len, "Unknown Transport Network type: %d",
5097 proto_tree_add_text(rsvp_object_tree, tvb, offset4, 8, "Local Identifier: %s",
5098 tvb_bytes_to_str(tvb, offset4, 8));
5099 proto_item_append_text(ti, "Local ID: %s. ", tvb_bytes_to_str(tvb, offset4, 8));
5103 proto_item_append_text(ti, " Unknown");
5104 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5105 "C-type: Unknown (%u)", type);
5106 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
5107 "Data (%d bytes)", obj_length - 4);
5112 /*------------------------------------------------------------------------------
5113 * RESTART CAPABILITY
5114 *------------------------------------------------------------------------------*/
5116 dissect_rsvp_restart_cap (proto_tree *ti, proto_tree *rsvp_object_tree,
5118 int offset, int obj_length,
5119 int class _U_, int type)
5121 int offset2 = offset + 4;
5123 proto_item_set_text(ti, "RESTART CAPABILITY: ");
5126 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5128 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
5129 "Restart Time: %d ms",
5130 tvb_get_ntohl(tvb, offset2));
5131 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
5132 "Recovery Time: %d ms",
5133 tvb_get_ntohl(tvb, offset2+4));
5134 proto_item_append_text(ti, "Restart Time: %d ms. Recovery Time: %d ms.",
5135 tvb_get_ntohl(tvb, offset2), tvb_get_ntohl(tvb, offset2+4));
5139 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5140 "C-type: Unknown (%u)",
5142 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
5143 "Data (%d bytes)", obj_length - 4);
5148 /*------------------------------------------------------------------------------
5149 * PROTECTION INFORMATION
5150 *------------------------------------------------------------------------------*/
5152 dissect_rsvp_protection_info (proto_tree *ti, proto_tree *rsvp_object_tree,
5154 int offset, int obj_length,
5155 int class _U_, int type)
5158 proto_tree *ti2, *rsvp_pi_flags_tree;
5159 int offset2 = offset + 4;
5161 proto_item_set_text(ti, "PROTECTION_INFO: ");
5164 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5165 "C-type: 1 - Protection");
5166 flag = tvb_get_guint8(tvb, offset2);
5167 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
5168 "Secondary LSP: %s",
5169 decode_boolean_bitfield(flag, 0x80, 8, "Yes", "No"));
5171 flags = tvb_get_guint8(tvb, offset2+3);
5172 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+3, 1,
5173 "Link Flags: 0x%02x", flags);
5174 rsvp_pi_flags_tree = proto_item_add_subtree(ti2,
5175 TREE(TT_PROTECTION_INFO));
5176 proto_tree_add_text(rsvp_pi_flags_tree, tvb, offset2+3, 1,
5177 decode_boolean_bitfield(flags, 0x01, 8,
5178 "Extra Traffic desired",
5179 "Extra Traffic not desired"));
5180 proto_tree_add_text(rsvp_pi_flags_tree, tvb, offset2+3, 1,
5181 decode_boolean_bitfield(flags, 0x02, 8,
5182 "Unprotected desired",
5183 "Unprotected not desired"));
5184 proto_tree_add_text(rsvp_pi_flags_tree, tvb, offset2+3, 1,
5185 decode_boolean_bitfield(flags, 0x04, 8,
5187 "Shared not desired"));
5188 proto_tree_add_text(rsvp_pi_flags_tree, tvb, offset2+3, 1,
5189 decode_boolean_bitfield(flags, 0x08, 8,
5190 "Dedicated 1:1 desired",
5191 "Dedicated 1:1 not desired"));
5192 proto_tree_add_text(rsvp_pi_flags_tree, tvb, offset2+3, 1,
5193 decode_boolean_bitfield(flags, 0x10, 8,
5194 "Dedicated 1+1 desired",
5195 "Dedicated 1+1 not desired"));
5196 proto_tree_add_text(rsvp_pi_flags_tree, tvb, offset2+3, 1,
5197 decode_boolean_bitfield(flags, 0x20, 8,
5199 "Enhanced not desired"));
5200 proto_item_append_text(ti, "%s%s%s%s%s%s%s.",
5201 flag &0x80 ? "SecondaryLSP " : "",
5202 flags &0x01 ? "ExtraTraffic " : "",
5203 flags &0x02 ? "Unprotected " : "",
5204 flags &0x04 ? "Shared " : "",
5205 flags &0x08 ? "Dedicated1:1 " : "",
5206 flags &0x10 ? "Dedicated1+1 " : "",
5207 flags &0x20 ? "Enhanced " : "");
5211 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5212 "C-type: Unknown (%u)",
5214 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
5215 "Data (%d bytes)", obj_length - 4);
5220 /*------------------------------------------------------------------------------
5222 *------------------------------------------------------------------------------*/
5224 dissect_rsvp_fast_reroute (proto_tree *ti, proto_tree *rsvp_object_tree,
5226 int offset, int obj_length,
5227 int class _U_, int type)
5230 proto_tree *ti2, *rsvp_frr_flags_tree;
5232 proto_item_set_text(ti, "FAST_REROUTE: ");
5236 if ((type==1 && obj_length!=24) || (type==7 && obj_length!=20)) {
5237 proto_tree_add_text(rsvp_object_tree, tvb, offset, obj_length,
5238 "<<<Invalid length: cannot decode>>>");
5239 proto_item_append_text(ti, "Invalid length");
5242 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5243 "C-type: %u", type);
5244 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
5245 "Setup Priority: %d", tvb_get_guint8(tvb, offset+4));
5246 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 1,
5247 "Hold Priority: %d", tvb_get_guint8(tvb, offset+5));
5248 proto_tree_add_text(rsvp_object_tree, tvb, offset+6, 1,
5249 "Hop Limit: %d", tvb_get_guint8(tvb, offset+6));
5251 flags = tvb_get_guint8(tvb, offset+7);
5252 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset+7, 1,
5253 "Flags: 0x%02x", flags);
5254 rsvp_frr_flags_tree = proto_item_add_subtree(ti2,
5255 TREE(TT_FAST_REROUTE_FLAGS));
5256 proto_tree_add_text(rsvp_frr_flags_tree, tvb, offset+7, 1,
5257 decode_boolean_bitfield(flags, 0x01, 8,
5258 "One-to-One Backup desired",
5259 "One-to-One Backup not desired"));
5260 proto_tree_add_text(rsvp_frr_flags_tree, tvb, offset+7, 1,
5261 decode_boolean_bitfield(flags, 0x02, 8,
5262 "Facility Backup desired",
5263 "Facility Backup not desired"));
5264 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
5265 "Bandwidth: %.10g", tvb_get_ntohieee_float(tvb, offset+8));
5266 proto_tree_add_text(rsvp_object_tree, tvb, offset+12, 4,
5267 "Include-Any: 0x%0x", tvb_get_ntohl(tvb, offset+12));
5268 proto_tree_add_text(rsvp_object_tree, tvb, offset+16, 4,
5269 "Exclude-Any: 0x%0x", tvb_get_ntohl(tvb, offset+16));
5271 proto_tree_add_text(rsvp_object_tree, tvb, offset+20, 4,
5272 "Include-All: 0x%0x", tvb_get_ntohl(tvb, offset+20));
5275 proto_item_append_text(ti, "%s%s",
5276 flags &0x01 ? "One-to-One Backup, " : "",
5277 flags &0x02 ? "Facility Backup" : "");
5281 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5282 "C-type: Unknown (%u)",
5284 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4,
5285 "Data (%d bytes)", obj_length - 4);
5290 /*------------------------------------------------------------------------------
5292 *------------------------------------------------------------------------------*/
5294 dissect_rsvp_detour (proto_tree *ti, proto_tree *rsvp_object_tree,
5296 int offset, int obj_length,
5297 int class _U_, int type)
5299 int remaining_length, count;
5302 proto_item_set_text(ti, "DETOUR: ");
5306 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5307 "C-type: %u", type);
5308 for (remaining_length = obj_length - 4, count = 1;
5309 remaining_length > 0; remaining_length -= 8, count++) {
5310 if (remaining_length < 8) {
5311 proto_tree_add_text(rsvp_object_tree, tvb, offset+remaining_length,
5312 obj_length-remaining_length,
5313 "<<<Invalid length: cannot decode>>>");
5314 proto_item_append_text(ti, "Invalid length");
5318 proto_tree_add_text(rsvp_object_tree, tvb, offset+(4*iter), 4,
5319 "PLR ID %d: %s", count,
5320 ip_to_str(tvb_get_ptr(tvb, offset+(4*iter), 4)));
5322 proto_tree_add_text(rsvp_object_tree, tvb, offset+(4*iter), 4,
5323 "Avoid Node ID %d: %s", count,
5324 ip_to_str(tvb_get_ptr(tvb, offset+(4*iter), 4)));
5329 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5330 "C-type: Unknown (%u)",
5332 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4,
5333 "Data (%d bytes)", obj_length - 4);
5338 /*------------------------------------------------------------------------------
5340 *------------------------------------------------------------------------------*/
5342 dissect_rsvp_diffserv (proto_tree *ti, proto_tree *rsvp_object_tree,
5344 int offset, int obj_length,
5345 int class _U_, int type)
5348 int *hfindexes[] = {
5349 &rsvp_filter[RSVPF_DIFFSERV_MAP],
5350 &rsvp_filter[RSVPF_DIFFSERV_MAP_EXP],
5351 &rsvp_filter[RSVPF_DIFFSERV_PHBID],
5352 &rsvp_filter[RSVPF_DIFFSERV_PHBID_DSCP],
5353 &rsvp_filter[RSVPF_DIFFSERV_PHBID_CODE],
5354 &rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT14],
5355 &rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT15]
5358 &TREE(TT_DIFFSERV_MAP),
5359 &TREE(TT_DIFFSERV_MAP_PHBID)
5362 proto_item_set_text(ti, "DIFFSERV: ");
5366 proto_tree_add_text(rsvp_object_tree, tvb, offset, 1,
5367 "C-type: 1 - E-LSP");
5368 proto_tree_add_uint(rsvp_object_tree, rsvp_filter[RSVPF_DIFFSERV_MAPNB],
5370 mapnb = tvb_get_guint8(tvb, offset + 4) & 15);
5371 proto_item_append_text(ti, "E-LSP, %u MAP%s", mapnb,
5372 (mapnb == 0) ? "" : "s");
5375 for (count = 0; count < mapnb; count++) {
5376 dissect_diffserv_mpls_common(tvb, rsvp_object_tree, type,
5377 offset, hfindexes, etts);
5382 proto_item_append_text(ti, "L-LSP");
5383 proto_tree_add_text(rsvp_object_tree, tvb, offset, 1,
5384 "C-type: 2 - L-LSP");
5385 dissect_diffserv_mpls_common(tvb, rsvp_object_tree, type,
5386 offset + 3, hfindexes, etts);
5389 proto_tree_add_text(rsvp_object_tree, tvb, offset, 1,
5390 "C-type: Unknown (%u)", type);
5391 proto_tree_add_text(rsvp_object_tree, tvb, offset + 1, obj_length - 4,
5392 "Data (%d bytes)", obj_length - 4);
5396 /*------------------------------------------------------------------------------
5398 *------------------------------------------------------------------------------*/
5400 dissect_rsvp_diffserv_aware_te(proto_tree *ti, proto_tree *rsvp_object_tree,
5402 int offset, int obj_length,
5403 int class _U_, int type)
5405 proto_item *hidden_item;
5406 int offset2 = offset + 4;
5409 hidden_item = proto_tree_add_item(rsvp_object_tree,
5410 rsvp_filter[RSVPF_DSTE],
5411 tvb, offset, 8, FALSE);
5412 PROTO_ITEM_SET_HIDDEN(hidden_item);
5416 ct = tvb_get_guint8(tvb, offset2+3);
5417 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, "C-type: 1");
5418 proto_tree_add_item(rsvp_object_tree,
5419 rsvp_filter[RSVPF_DSTE_CLASSTYPE],
5420 tvb, offset2+3, 1, FALSE);
5421 proto_item_set_text(ti, "CLASSTYPE: CT %u", ct);
5424 proto_item_set_text(ti, "CLASSTYPE: (Unknown C-type)");
5425 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5426 "C-type: Unknown (%u)", type);
5427 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
5428 "Data (%d bytes)", obj_length - 4);
5433 /*------------------------------------------------------------------------------
5434 * Dissect a single RSVP message in a tree
5435 *------------------------------------------------------------------------------*/
5437 dissect_rsvp_msg_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
5438 int tree_mode, rsvp_conversation_info *rsvph)
5440 proto_tree *rsvp_tree = NULL;
5441 proto_tree *rsvp_header_tree;
5442 proto_tree *rsvp_object_tree;
5444 proto_item *hidden_item;
5445 guint16 cksum, computed_cksum;
5450 guint8 message_type;
5451 int session_off, tempfilt_off;
5458 ver_flags = tvb_get_guint8(tvb, 0);
5459 msg_length = tvb_get_ntohs(tvb, 6);
5460 message_type = tvb_get_guint8(tvb, 1);
5462 ti = proto_tree_add_item(tree, proto_rsvp, tvb, offset, msg_length,
5464 rsvp_tree = proto_item_add_subtree(ti, tree_mode);
5465 if (pinfo->ipproto == IP_PROTO_RSVPE2EI)
5466 proto_item_append_text(rsvp_tree, " (E2E-IGNORE)");
5467 proto_item_append_text(rsvp_tree, ": ");
5468 proto_item_append_text(rsvp_tree, val_to_str(message_type, message_type_vals,
5470 find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off);
5472 proto_item_append_text(rsvp_tree, summary_session(tvb, session_off));
5474 proto_item_append_text(rsvp_tree, summary_template(tvb, tempfilt_off));
5476 ti = proto_tree_add_text(rsvp_tree, tvb, offset, 8, "RSVP Header. %s",
5477 val_to_str(message_type, message_type_vals,
5478 "Unknown Message (%u). "));
5479 if (pinfo->ipproto == IP_PROTO_RSVPE2EI)
5480 proto_item_append_text(ti, " (E2E-IGNORE)");
5481 rsvp_header_tree = proto_item_add_subtree(ti, TREE(TT_HDR));
5483 proto_tree_add_text(rsvp_header_tree, tvb, offset, 1, "RSVP Version: %u",
5484 (ver_flags & 0xf0)>>4);
5485 proto_tree_add_text(rsvp_header_tree, tvb, offset, 1, "Flags: %02x",
5487 proto_tree_add_uint(rsvp_header_tree, rsvp_filter[RSVPF_MSG], tvb,
5488 offset+1, 1, message_type);
5489 switch (RSVPF_MSG + message_type) {
5495 case RSVPF_PATHTEAR:
5496 case RSVPF_RESVTEAR:
5497 case RSVPF_RCONFIRM:
5498 case RSVPF_RTEARCONFIRM:
5501 case RSVPF_SREFRESH:
5504 hidden_item = proto_tree_add_boolean(rsvp_header_tree, rsvp_filter[RSVPF_MSG + message_type], tvb,
5506 PROTO_ITEM_SET_HIDDEN(hidden_item);
5510 proto_tree_add_protocol_format(rsvp_header_tree, proto_malformed, tvb, offset+1, 1,
5511 "Invalid message type: %u", message_type);
5515 cksum = tvb_get_ntohs(tvb, offset+2);
5516 if (!pinfo->fragmented && (int) tvb_length(tvb) >= msg_length) {
5517 /* The packet isn't part of a fragmented datagram and isn't
5518 truncated, so we can checksum it. */
5519 cksum_vec[0].ptr = tvb_get_ptr(tvb, 0, msg_length);
5520 cksum_vec[0].len = msg_length;
5521 computed_cksum = in_cksum(&cksum_vec[0], 1);
5522 if (computed_cksum == 0) {
5523 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
5524 "Message Checksum: 0x%04x [correct]",
5527 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
5528 "Message Checksum: 0x%04x [incorrect, should be 0x%04x]",
5530 in_cksum_shouldbe(cksum, computed_cksum));
5533 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
5534 "Message Checksum: 0x%04x",
5537 proto_tree_add_text(rsvp_header_tree, tvb, offset+4, 1,
5539 tvb_get_guint8(tvb, offset+4));
5540 proto_tree_add_text(rsvp_header_tree, tvb, offset+6, 2,
5541 "Message length: %u", msg_length);
5546 if (message_type == RSVP_MSG_BUNDLE) {
5547 /* Bundle message. Dissect component messages */
5548 if (rsvp_bundle_dissect) {
5550 while (len < msg_length) {
5553 sub_len = tvb_get_ntohs(tvb, len+6);
5554 tvb_sub = tvb_new_subset(tvb, len, sub_len, sub_len);
5555 dissect_rsvp_msg_tree(tvb_sub, pinfo, rsvp_tree, TREE(TT_BUNDLE_COMPMSG), rsvph);
5559 proto_tree_add_text(rsvp_tree, tvb, offset, msg_length - len,
5560 "Bundle Component Messages Not Dissected");
5565 while (len < msg_length) {
5569 obj_length = tvb_get_ntohs(tvb, offset);
5570 class = tvb_get_guint8(tvb, offset+2);
5571 type = tvb_get_guint8(tvb, offset+3);
5572 ti = proto_tree_add_item(rsvp_tree, rsvp_filter[rsvp_class_to_filter_num(class)],
5573 tvb, offset, obj_length, FALSE);
5574 rsvp_object_tree = proto_item_add_subtree(ti, TREE(rsvp_class_to_tree_type(class)));
5575 if (obj_length < 4) {
5576 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
5577 "Length: %u (bogus, must be >= 4)", obj_length);
5580 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
5581 "Length: %u", obj_length);
5582 proto_tree_add_uint(rsvp_object_tree, rsvp_filter[RSVPF_OBJECT], tvb,
5583 offset+2, 1, class);
5589 case RSVP_CLASS_SESSION:
5590 dissect_rsvp_session(ti, rsvp_object_tree, tvb, offset, obj_length, class, type, rsvph);
5593 case RSVP_CLASS_HOP:
5594 dissect_rsvp_hop(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5597 case RSVP_CLASS_TIME_VALUES:
5598 dissect_rsvp_time_values(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5601 case RSVP_CLASS_ERROR:
5602 dissect_rsvp_error(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5605 case RSVP_CLASS_SCOPE:
5606 dissect_rsvp_scope(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5609 case RSVP_CLASS_STYLE:
5610 dissect_rsvp_style(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5613 case RSVP_CLASS_CONFIRM:
5614 dissect_rsvp_confirm(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5617 case RSVP_CLASS_SENDER_TEMPLATE:
5618 case RSVP_CLASS_FILTER_SPEC:
5619 dissect_rsvp_template_filter(ti, rsvp_object_tree, tvb, offset, obj_length, class, type, rsvph);
5622 case RSVP_CLASS_SENDER_TSPEC:
5623 dissect_rsvp_tspec(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5626 case RSVP_CLASS_FLOWSPEC:
5627 dissect_rsvp_flowspec(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5630 case RSVP_CLASS_ADSPEC:
5631 dissect_rsvp_adspec(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5634 case RSVP_CLASS_INTEGRITY:
5635 dissect_rsvp_integrity(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5638 case RSVP_CLASS_POLICY:
5639 dissect_rsvp_policy(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5642 case RSVP_CLASS_LABEL_REQUEST:
5643 dissect_rsvp_label_request(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5646 case RSVP_CLASS_RECOVERY_LABEL:
5647 case RSVP_CLASS_UPSTREAM_LABEL:
5648 case RSVP_CLASS_SUGGESTED_LABEL:
5649 case RSVP_CLASS_LABEL:
5650 dissect_rsvp_label(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5653 case RSVP_CLASS_LABEL_SET:
5654 dissect_rsvp_label_set(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5657 case RSVP_CLASS_SESSION_ATTRIBUTE:
5658 dissect_rsvp_session_attribute(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5661 case RSVP_CLASS_EXPLICIT_ROUTE:
5662 dissect_rsvp_explicit_route(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5665 case RSVP_CLASS_RECORD_ROUTE:
5666 dissect_rsvp_record_route(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5669 case RSVP_CLASS_MESSAGE_ID:
5670 dissect_rsvp_message_id(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5673 case RSVP_CLASS_MESSAGE_ID_ACK:
5674 dissect_rsvp_message_id_ack(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5677 case RSVP_CLASS_MESSAGE_ID_LIST:
5678 dissect_rsvp_message_id_list(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5681 case RSVP_CLASS_HELLO:
5682 dissect_rsvp_hello(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5685 case RSVP_CLASS_DCLASS:
5686 dissect_rsvp_dclass(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5689 case RSVP_CLASS_ADMIN_STATUS:
5690 dissect_rsvp_admin_status(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5693 case RSVP_CLASS_ASSOCIATION:
5694 dissect_rsvp_association(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5697 case RSVP_CLASS_LSP_TUNNEL_IF_ID:
5698 dissect_rsvp_lsp_tunnel_if_id(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5701 case RSVP_CLASS_NOTIFY_REQUEST:
5702 dissect_rsvp_notify_request(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5705 case RSVP_CLASS_GENERALIZED_UNI:
5706 dissect_rsvp_gen_uni(ti, rsvp_object_tree, tvb, offset, obj_length, class, type, rsvph);
5709 case RSVP_CLASS_CALL_ID:
5710 dissect_rsvp_call_id(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5713 case RSVP_CLASS_RESTART_CAP:
5714 dissect_rsvp_restart_cap(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5717 case RSVP_CLASS_PROTECTION:
5718 dissect_rsvp_protection_info(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5721 case RSVP_CLASS_FAST_REROUTE:
5722 dissect_rsvp_fast_reroute(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5725 case RSVP_CLASS_DETOUR:
5726 dissect_rsvp_detour(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5729 case RSVP_CLASS_DIFFSERV:
5730 dissect_rsvp_diffserv(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5733 case RSVP_CLASS_CLASSTYPE:
5734 dissect_rsvp_diffserv_aware_te(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5737 case RSVP_CLASS_NULL:
5739 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
5740 "Data (%d bytes)", obj_length - 4);
5744 offset += obj_length;
5749 /*------------------------------------------------------------------------------
5751 *------------------------------------------------------------------------------*/
5753 dissect_rsvp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
5756 guint8 message_type;
5758 int session_off, tempfilt_off;
5759 rsvp_conversation_info *rsvph;
5762 conversation_t *conversation;
5763 struct rsvp_request_key request_key, *new_request_key;
5764 struct rsvp_request_val *request_val = NULL;
5766 if (check_col(pinfo->cinfo, COL_PROTOCOL))
5767 col_set_str(pinfo->cinfo, COL_PROTOCOL,
5768 (pinfo->ipproto == IP_PROTO_RSVPE2EI) ? "RSVP-E2EI" : "RSVP");
5769 if (check_col(pinfo->cinfo, COL_INFO))
5770 col_clear(pinfo->cinfo, COL_INFO);
5772 ver_flags = tvb_get_guint8(tvb, 0);
5773 message_type = tvb_get_guint8(tvb, 1);
5774 msg_length = tvb_get_ntohs(tvb, 6);
5776 rsvph = ep_alloc(sizeof(rsvp_conversation_info));
5777 rsvph->session_type = 0;
5779 /* Copy over the source and destination addresses from the pinfo strucutre */
5780 SET_ADDRESS(&rsvph->source, pinfo->src.type, pinfo->src.len, pinfo->src.data);
5781 SET_ADDRESS(&rsvph->destination, pinfo->dst.type, pinfo->dst.len, pinfo->dst.data);
5783 if (check_col(pinfo->cinfo, COL_INFO)) {
5784 col_add_str(pinfo->cinfo, COL_INFO,
5785 val_to_str(message_type, message_type_vals, "Unknown (%u). "));
5786 find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off);
5788 col_append_str(pinfo->cinfo, COL_INFO, summary_session(tvb, session_off));
5790 col_append_str(pinfo->cinfo, COL_INFO, summary_template(tvb, tempfilt_off));
5793 if (check_col(pinfo->cinfo, COL_INFO)) {
5794 col_add_str(pinfo->cinfo, COL_INFO,
5795 val_to_str(message_type, message_type_vals, "Unknown (%u). "));
5796 if (message_type == RSVP_MSG_BUNDLE) {
5797 col_set_str(pinfo->cinfo, COL_INFO,
5798 rsvp_bundle_dissect ?
5799 "Component Messages Dissected" :
5800 "Component Messages Not Dissected");
5802 find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off);
5804 col_append_str(pinfo->cinfo, COL_INFO, summary_session(tvb, session_off));
5806 col_append_str(pinfo->cinfo, COL_INFO, summary_template(tvb, tempfilt_off));
5811 dissect_rsvp_msg_tree(tvb, pinfo, tree, TREE(TT_RSVP), rsvph);
5814 /* Find out what conversation this packet is part of. */
5815 conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
5816 pinfo->ptype, pinfo->srcport,
5817 pinfo->destport, 0);
5819 if (conversation == NULL) {
5820 /* Not part of any conversation; create a new one. */
5822 conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst,
5823 pinfo->ptype, pinfo->srcport,
5824 pinfo->destport, 0);
5827 /* Now build the request key */
5828 request_key.conversation = conversation->index;
5829 request_key.session_type = rsvph->session_type;
5831 switch (request_key.session_type) {
5832 case RSVP_SESSION_TYPE_IPV4:
5833 SET_ADDRESS(&request_key.u.session_ipv4.destination,
5834 rsvph->destination.type, rsvph->destination.len,
5835 rsvph->destination.data);
5836 request_key.u.session_ipv4.protocol = rsvph->protocol;
5837 request_key.u.session_ipv4.udp_dest_port = rsvph->udp_dest_port;
5840 case RSVP_SESSION_TYPE_IPV6:
5841 /* Not supported yet */
5844 case RSVP_SESSION_TYPE_IPV4_LSP:
5845 SET_ADDRESS(&request_key.u.session_ipv4_lsp.destination,
5846 rsvph->destination.type, rsvph->destination.len,
5847 rsvph->destination.data);
5848 request_key.u.session_ipv4_lsp.udp_dest_port = rsvph->udp_dest_port;
5849 request_key.u.session_ipv4_lsp.ext_tunnel_id = rsvph->ext_tunnel_id;
5852 case RSVP_SESSION_TYPE_AGGREGATE_IPV4:
5853 SET_ADDRESS(&request_key.u.session_agg_ipv4.destination,
5854 rsvph->destination.type, rsvph->destination.len,
5855 rsvph->destination.data);
5856 request_key.u.session_agg_ipv4.dscp = rsvph->dscp;
5859 case RSVP_SESSION_TYPE_IPV4_UNI:
5860 SET_ADDRESS(&request_key.u.session_ipv4_uni.destination,
5861 rsvph->destination.type, rsvph->destination.len,
5862 rsvph->destination.data);
5863 request_key.u.session_ipv4_uni.udp_dest_port = rsvph->udp_dest_port;
5864 request_key.u.session_ipv4_uni.ext_tunnel_id = rsvph->ext_tunnel_id;
5867 case RSVP_SESSION_TYPE_IPV4_E_NNI:
5868 SET_ADDRESS(&request_key.u.session_ipv4_enni.destination,
5869 rsvph->destination.type, rsvph->destination.len,
5870 rsvph->destination.data);
5871 request_key.u.session_ipv4_enni.udp_dest_port = rsvph->udp_dest_port;
5872 request_key.u.session_ipv4_enni.ext_tunnel_id = rsvph->ext_tunnel_id;
5875 /* This should never happen. */
5877 proto_tree_add_text(tree, tvb, 0, 0, "Unknown session type");
5882 SET_ADDRESS(&request_key.source_info.source,
5883 rsvph->source.type, rsvph->source.len, rsvph->source.data);
5884 request_key.source_info.udp_source_port = rsvph->udp_source_port;
5886 /* See if a request with this key already exists */
5888 (struct rsvp_request_val *) g_hash_table_lookup(rsvp_request_hash,
5891 /* If not, insert the new request key into the hash table */
5893 new_request_key = se_alloc(sizeof(struct rsvp_request_key));
5894 *new_request_key = request_key;
5896 request_val = se_alloc(sizeof(struct rsvp_request_val));
5897 request_val->value = conversation->index;
5899 g_hash_table_insert(rsvp_request_hash, new_request_key, request_val);
5902 tap_queue_packet(rsvp_tap, pinfo, rsvph);
5906 register_rsvp_prefs (void)
5908 module_t *rsvp_module;
5910 rsvp_module = prefs_register_protocol(proto_rsvp, NULL);
5911 prefs_register_bool_preference(
5912 rsvp_module, "process_bundle",
5913 "Dissect sub-messages in BUNDLE message",
5914 "Specifies whether Wireshark should decode and display sub-messages within BUNDLE messages",
5915 &rsvp_bundle_dissect);
5919 proto_register_rsvp(void)
5923 /* Build the tree array */
5924 for (i=0; i<TT_MAX; i++)
5925 ett_tree[i] = &(ett_treelist[i]);
5927 proto_rsvp = proto_register_protocol("Resource ReserVation Protocol (RSVP)",
5929 proto_register_field_array(proto_rsvp, rsvpf_info, array_length(rsvpf_info));
5930 proto_register_subtree_array(ett_tree, array_length(ett_tree));
5931 register_rsvp_prefs();
5933 rsvp_dissector_table = register_dissector_table("rsvp.proto", "RSVP Protocol",
5934 FT_UINT8, BASE_DEC);
5936 /* Initialization routine for RSVP conversations */
5937 register_init_routine(&rsvp_init_protocol);
5941 proto_reg_handoff_rsvp(void)
5943 dissector_handle_t rsvp_handle;
5945 rsvp_handle = create_dissector_handle(dissect_rsvp, proto_rsvp);
5946 dissector_add("ip.proto", IP_PROTO_RSVP, rsvp_handle);
5947 dissector_add("ip.proto", IP_PROTO_RSVPE2EI, rsvp_handle);
5948 dissector_add("udp.port", UDP_PORT_PRSVP, rsvp_handle);
5949 data_handle = find_dissector("data");
5950 rsvp_tap = register_tap("rsvp");