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;
105 static int rsvp_tap = -1;
108 * All RSVP packets belonging to a particular flow belong to the same
109 * conversation. The following structure definitions are for auxillary
110 * structures which have all the relevant flow information to make up the
111 * RSVP five-tuple. Note that the values of the five-tuple are determined
112 * from the session object and sender template/filter spec for PATH/RESV
114 * Update rsvp_request_equal() when you add stuff here. You might also
115 * have to update rsvp_request_hash().
116 * TODO: Support for IPv6 conversations.
119 typedef struct rsvp_session_ipv4_info {
122 guint16 udp_dest_port;
123 } rsvp_session_ipv4_info;
125 typedef struct rsvp_session_ipv6_info {
126 /* not supported yet */
129 } rsvp_session_ipv6_info;
131 typedef struct rsvp_session_ipv4_lsp_info {
133 guint16 udp_dest_port;
134 guint32 ext_tunnel_id;
135 } rsvp_session_ipv4_lsp_info;
137 typedef struct rsvp_session_agg_ipv4_info {
140 } rsvp_session_agg_ipv4_info;
142 typedef struct rsvp_session_ipv4_uni_info {
144 guint16 udp_dest_port;
145 guint32 ext_tunnel_id;
146 } rsvp_session_ipv4_uni_info;
148 typedef struct rsvp_session_ipv4_enni_info {
150 guint16 udp_dest_port;
151 guint32 ext_tunnel_id;
152 } rsvp_session_ipv4_enni_info;
154 typedef struct rsvp_template_filter_info {
156 guint16 udp_source_port;
157 } rsvp_template_filter_info;
160 * The actual request key consists of a union of the various session objects
161 * (which are uniquely identified based on the session type), and the
162 * source_info structure, which has the information derived from the sender
163 * template or the filter spec.
164 * The request key is populated by copying the information from the
165 * rsvp_conversation_info structure (rsvph), which in turn is populated when
166 * the session, filter and sender template objects are dissected.
168 struct rsvp_request_key {
169 guint32 session_type;
171 union { /* differentiated by session_type field */
172 rsvp_session_ipv4_info session_ipv4;
173 rsvp_session_ipv6_info session_ipv6;
174 rsvp_session_ipv4_lsp_info session_ipv4_lsp;
175 rsvp_session_agg_ipv4_info session_agg_ipv4;
176 rsvp_session_ipv4_uni_info session_ipv4_uni;
177 rsvp_session_ipv4_enni_info session_ipv4_enni;
180 rsvp_template_filter_info source_info;
181 guint32 conversation;
185 * At present, there is nothing particularly important that we need to
186 * store for the request value for each rsvp_request_key, so we just
187 * store the unique 32-bit identifier internally allocated for the key
188 * (and stored in the conversation attribute of rsvp_request_key above.
189 * If this changes in the future, then other stuff can be added here.
191 struct rsvp_request_val {
196 * Initialize the conversation related data structures.
198 static GHashTable *rsvp_request_hash = NULL;
201 * The list of tree types
229 TT_LSP_TUNNEL_IF_ID_SUBTREE,
237 TT_SESSION_ATTRIBUTE,
238 TT_SESSION_ATTRIBUTE_FLAGS,
241 TT_EXPLICIT_ROUTE_SUBOBJ,
243 TT_RECORD_ROUTE_SUBOBJ,
244 TT_RECORD_ROUTE_SUBOBJ_FLAGS,
246 TT_ADMIN_STATUS_FLAGS,
255 TT_FAST_REROUTE_FLAGS,
259 TT_DIFFSERV_MAP_PHBID,
265 static gint ett_treelist[TT_MAX];
266 static gint *ett_tree[TT_MAX];
267 #define TREE(X) ett_treelist[(X)]
269 /* Should we dissect bundle messages? */
270 static gboolean rsvp_bundle_dissect = TRUE;
273 * RSVP message types.
276 * http://www.iana.org/assignments/rsvp-parameters
279 RSVP_MSG_PATH=1, /* RFC 2205 */
280 RSVP_MSG_RESV, /* RFC 2205 */
281 RSVP_MSG_PERR, /* RFC 2205 */
282 RSVP_MSG_RERR, /* RFC 2205 */
283 RSVP_MSG_PTEAR, /* RFC 2205 */
284 RSVP_MSG_RTEAR, /* RFC 2205 */
285 RSVP_MSG_CONFIRM, /* XXX - DREQ, RFC 2745? */
286 /* 9 is DREP, RFC 2745 */
287 RSVP_MSG_RTEAR_CONFIRM=10, /* from Fred Baker at Cisco */
288 /* 11 is unassigned */
289 RSVP_MSG_BUNDLE = 12, /* RFC 2961 */
290 RSVP_MSG_ACK, /* RFC 2961 */
292 RSVP_MSG_SREFRESH = 15, /* RFC 2961 */
293 /* 16, 17, 18, 19 not listed */
294 RSVP_MSG_HELLO = 20, /* RFC 3209 */
295 RSVP_MSG_NOTIFY /* [RFC3473] */
296 /* 25 is Integrity Challenge RFC 2747, RFC 3097 */
297 /* 26 is Integrity Response RFC 2747, RFC 3097 */
298 /* 66 is DSBM_willing [SBM] */
299 /* 67 is I_AM_DSBM [SBM] */
300 /* [SBM] is Subnet Bandwidth Manager ID from July 1997 */
301 } rsvp_message_types;
303 static const value_string message_type_vals[] = {
304 {RSVP_MSG_PATH, "PATH Message. "},
305 {RSVP_MSG_RESV, "RESV Message. "},
306 {RSVP_MSG_PERR, "PATH ERROR Message. "},
307 {RSVP_MSG_RERR, "RESV ERROR Message. "},
308 {RSVP_MSG_PTEAR, "PATH TEAR Message. "},
309 {RSVP_MSG_RTEAR, "RESV TEAR Message. "},
310 {RSVP_MSG_CONFIRM, "CONFIRM Message. "},
311 {RSVP_MSG_RTEAR_CONFIRM, "RESV TEAR CONFIRM Message. "},
312 {RSVP_MSG_BUNDLE, "BUNDLE Message. "},
313 {RSVP_MSG_ACK, "ACK Message. "},
314 {RSVP_MSG_SREFRESH, "SREFRESH Message. "},
315 {RSVP_MSG_HELLO, "HELLO Message. "},
316 {RSVP_MSG_NOTIFY, "NOTIFY Message. "},
323 #define MAX_RSVP_CLASS 15
330 RSVP_CLASS_INTEGRITY,
331 RSVP_CLASS_TIME_VALUES,
336 RSVP_CLASS_FILTER_SPEC,
337 RSVP_CLASS_SENDER_TEMPLATE,
338 RSVP_CLASS_SENDER_TSPEC,
343 RSVP_CLASS_HOP_COUNT,
344 RSVP_CLASS_STRICT_SOURCE_ROUTE,
345 RSVP_CLASS_LABEL_REQUEST=19,
346 RSVP_CLASS_EXPLICIT_ROUTE,
347 RSVP_CLASS_RECORD_ROUTE,
351 RSVP_CLASS_MESSAGE_ID,
352 RSVP_CLASS_MESSAGE_ID_ACK,
353 RSVP_CLASS_MESSAGE_ID_LIST,
355 /* 26-29 Unassigned */
357 RSVP_CLASS_DIAGNOSTIC = 30,
359 RSVP_CLASS_DIAG_RESPONSE,
360 RSVP_CLASS_DIAG_SELECT,
361 RSVP_CLASS_RECOVERY_LABEL,
362 RSVP_CLASS_UPSTREAM_LABEL,
363 RSVP_CLASS_LABEL_SET,
364 RSVP_CLASS_PROTECTION,
366 /* 38-41 Unassigned */
367 RSVP_CLASS_DSBM_IP_ADDRESS = 42,
368 RSVP_CLASS_SBM_PRIORITY,
369 RSVP_CLASS_DSBM_TIMER_INTERVALS,
372 /* 46-62 Unassigned */
374 RSVP_CLASS_DETOUR = 63,
375 RSVP_CLASS_CHALLENGE,
377 RSVP_CLASS_CLASSTYPE, /* FF: RFC4124 */
378 RSVP_CLASS_LSP_REQUIRED_ATTRIBUTES,
380 /* 68-127 Unassigned */
382 RSVP_CLASS_NODE_CHAR = 128,
383 RSVP_CLASS_SUGGESTED_LABEL,
384 RSVP_CLASS_ACCEPTABLE_LABEL_SET,
385 RSVP_CLASS_RESTART_CAP,
387 /* 132-160 Unassigned */
389 /* 166-191 Unassigned */
391 RSVP_CLASS_SESSION_ASSOC = 192,
392 RSVP_CLASS_LSP_TUNNEL_IF_ID,
394 RSVP_CLASS_NOTIFY_REQUEST = 195,
395 RSVP_CLASS_ADMIN_STATUS,
396 RSVP_CLASS_LSP_ATTRIBUTES,
397 /* IANA has this as 198 ALARM_SPEC ??? */
398 RSVP_CLASS_ASSOCIATION = 198,
400 /* 199-204 Unassigned */
401 RSVP_CLASS_FAST_REROUTE = 205,
403 RSVP_CLASS_SESSION_ATTRIBUTE = 207,
404 /* 208-223 Unassigned */
406 Class Numbers 224-255 are assigned by IANA using FCFS allocation.
407 RSVP will silently ignore, but FORWARD an object with a Class Number
408 in this range that it does not understand.
411 RSVP_CLASS_DCLASS = 225,
412 RSVP_CLASS_PACKETCABLE_EXTENSIONS,
413 RSVP_CLASS_ATM_SERVICECLASS,
415 RSVP_CLASS_GENERALIZED_UNI,
417 RSVP_CLASS_3GPP2_OBJECT
418 /* 232-254 Unassigned */
423 static const value_string rsvp_class_vals[] = {
424 {RSVP_CLASS_NULL, "NULL object"},
425 {RSVP_CLASS_SESSION, "SESSION object"},
426 {RSVP_CLASS_HOP, "HOP object"},
427 {RSVP_CLASS_INTEGRITY, "INTEGRITY object"},
428 {RSVP_CLASS_TIME_VALUES, "TIME VALUES object"},
429 {RSVP_CLASS_ERROR, "ERROR object"},
430 {RSVP_CLASS_SCOPE, "SCOPE object"},
431 {RSVP_CLASS_STYLE, "STYLE object"},
432 {RSVP_CLASS_FLOWSPEC, "FLOWSPEC object"},
433 {RSVP_CLASS_FILTER_SPEC, "FILTER SPEC object"},
434 {RSVP_CLASS_SENDER_TEMPLATE, "SENDER TEMPLATE object"},
435 {RSVP_CLASS_SENDER_TSPEC, "SENDER TSPEC object"},
436 {RSVP_CLASS_ADSPEC, "ADSPEC object"},
437 {RSVP_CLASS_POLICY, "POLICY object"},
438 {RSVP_CLASS_CONFIRM, "CONFIRM object"},
439 {RSVP_CLASS_LABEL, "LABEL object"},
440 {RSVP_CLASS_HOP_COUNT, "HOP_COUNT object"},
441 {RSVP_CLASS_STRICT_SOURCE_ROUTE, "STRICT_SOURCE_ROUTE object"},
442 {RSVP_CLASS_LABEL_REQUEST, "LABEL REQUEST object"},
443 {RSVP_CLASS_EXPLICIT_ROUTE, "EXPLICIT ROUTE object"},
444 {RSVP_CLASS_RECORD_ROUTE, "RECORD ROUTE object"},
445 {RSVP_CLASS_SESSION_ATTRIBUTE, "SESSION ATTRIBUTE object"},
446 {RSVP_CLASS_MESSAGE_ID, "MESSAGE-ID object"},
447 {RSVP_CLASS_MESSAGE_ID_ACK, "MESSAGE-ID ACK/NACK object"},
448 {RSVP_CLASS_MESSAGE_ID_LIST, "MESSAGE-ID LIST object"},
449 {RSVP_CLASS_HELLO, "HELLO object"},
450 {RSVP_CLASS_RECOVERY_LABEL, "RECOVERY-LABEL object"},
451 {RSVP_CLASS_UPSTREAM_LABEL, "UPSTREAM-LABEL object"},
452 {RSVP_CLASS_LABEL_SET, "LABEL-SET object"},
453 {RSVP_CLASS_PROTECTION, "PROTECTION object"},
454 {RSVP_CLASS_DIFFSERV, "DIFFSERV object"},
455 {RSVP_CLASS_CLASSTYPE, "CLASSTYPE object"},
456 {RSVP_CLASS_SUGGESTED_LABEL, "SUGGESTED-LABEL object"},
457 {RSVP_CLASS_ACCEPTABLE_LABEL_SET, "ACCEPTABLE-LABEL-SET object"},
458 {RSVP_CLASS_RESTART_CAP, "RESTART-CAPABILITY object"},
459 {RSVP_CLASS_DCLASS, "DCLASS object"},
460 {RSVP_CLASS_LSP_TUNNEL_IF_ID, "LSP-TUNNEL INTERFACE-ID object"},
461 {RSVP_CLASS_NOTIFY_REQUEST, "NOTIFY-REQUEST object"},
462 {RSVP_CLASS_ADMIN_STATUS, "ADMIN-STATUS object"},
463 {RSVP_CLASS_ASSOCIATION, "ASSOCIATION object"},
464 {RSVP_CLASS_GENERALIZED_UNI, "GENERALIZED-UNI object"},
465 {RSVP_CLASS_CALL_ID, "CALL-ID object"},
466 {RSVP_CLASS_DETOUR, "DETOUR object"},
467 {RSVP_CLASS_FAST_REROUTE, "FAST-REROUTE object"},
474 enum rsvp_error_types {
475 RSVP_ERROR_CONFIRM = 0,
476 RSVP_ERROR_ADMISSION,
479 RSVP_ERROR_NO_SENDER,
480 RSVP_ERROR_CONFLICT_RESV_STYLE,
481 RSVP_ERROR_UNKNOWN_RESV_STYLE,
482 RSVP_ERROR_CONFLICT_DEST_PORTS,
483 RSVP_ERROR_CONFLICT_SRC_PORTS,
484 RSVP_ERROR_PREEMPTED=12,
485 RSVP_ERROR_UNKNOWN_CLASS,
486 RSVP_ERROR_UNKNOWN_C_TYPE,
487 RSVP_ERROR_TRAFFIC = 21,
488 RSVP_ERROR_TRAFFIC_SYSTEM, /* 22 */
489 RSVP_ERROR_SYSTEM, /* 23 */
490 RSVP_ERROR_ROUTING, /* 24 */
491 RSVP_ERROR_NOTIFY, /* 25 */
492 RSVP_ERROR_DIFFSERV = 27,
493 RSVP_ERROR_DSTE = 28 /* FF: RFC4124 */
494 /*missing (11-2006) :
495 - 29 : Unknown Attributes TLV , RFC4420
496 - 30 : Unknown Attributes Bit RFC4420
497 - 31 : Alarms RFC-ietf-ccamp-gmpls-alarm-spec-06.txt
502 RSVP_AC_ERROR_DELAY_BOUND_ERROR = 1,
503 RSVP_AC_ERROR_BANDWITH_UNAVAILABLE,
504 RSVP_AC_ERROR_LARGE_MTU
508 RSVP_TRAFFIC_CONTROL_ERROR_SERVICE_CONFLICT = 1,
509 RSVP_TRAFFIC_CONTROL_ERROR_SERVIEC_UNSUPPORTED,
510 RSVP_TRAFFIC_CONTROL_ERROR_BAD_FLOWSPEC,
511 RSVP_TRAFFIC_CONTROL_ERROR_BAD_TSPEC,
512 RSVP_TRAFFIC_CONTROL_ERROR_BAD_ADSPEC
516 RSVP_ROUTING_ERROR_BAD_ERO = 1,
517 RSVP_ROUTING_ERROR_BAD_STRICT,
518 RSVP_ROUTING_ERROR_BAD_LOOSE,
519 RSVP_ROUTING_ERROR_BAD_INITIAL_SUBOBJ,
520 RSVP_ROUTING_ERROR_NO_ROUTE,
521 RSVP_ROUTING_ERROR_UNACCEPTABLE_LABEL,
522 RSVP_ROUTING_ERROR_RRO_LOOP,
523 RSVP_ROUTING_ERROR_NON_RSVP_CAPABLE_ROUTER,
524 RSVP_ROUTING_ERROR_LABEL_ALLOC_FAIL,
525 RSVP_ROUTING_ERROR_UNSUPPORTED_L3PID
529 RSVP_NOTIFY_ERROR_RRO_TOO_LARGE = 1,
530 RSVP_NOTIFY_ERROR_RRO_NOTIFICATION,
531 RSVP_NOTIFY_ERROR_RRO_TUNNEL_LOCAL_REPAIRED,
532 RSVP_NOTIFY_ERROR_RRO_CC_ACTIVE_STATE, /* RFC3473*/
533 RSVP_NOTIFY_ERROR_RRO_CC_DEGRADED_STATE, /* RFC3473*/
534 RSVP_NOTIFY_ERROR_LSP_FAILURE, /* Private */
535 RSVP_NOTIFY_ERROR_LSP_RECOVERED,/* Private */
536 RSVP_NOTIFY_ERROR_LSP_LOCAL_FAILURE/* Private */
541 RSVP_DIFFSERV_ERROR_UNEXPECTED_DIFFSERVOBJ = 1,
542 RSVP_DIFFSERV_ERROR_UNSUPPORTED_PHB,
543 RSVP_DIFFSERV_ERROR_INVALID_EXP_PHB_MAPPING,
544 RSVP_DIFFSERV_ERROR_UNSUPPORTED_PSC,
545 RSVP_DIFFSERV_ERROR_PERLSP_CONTEXT_ALLOC_FAIL
550 RSVP_DSTE_ERROR_UNEXPECTED_CLASSTYPEOBJ = 1,
551 RSVP_DSTE_ERROR_UNSUPPORTED_CLASSTYPE,
552 RSVP_DSTE_ERROR_INVALID_CLASSTYPE_VALUE,
553 RSVP_DSTE_ERROR_CT_SETUP_PRIO_NOT_CONFIGURED,
554 RSVP_DSTE_ERROR_CT_HOLDING_PRIO_NOT_CONFIGURED,
555 RSVP_DSTE_ERROR_CT_SETUP_PRIO_AND_CT_HOLDING_PRIO_NOT_CONFIGURED,
556 RSVP_DSTE_ERROR_INCONSISTENCY_PSC_CT,
557 RSVP_DSTE_ERROR_INCONSISTENCY_PHB_CT
560 static const value_string rsvp_error_codes[] = {
561 {RSVP_ERROR_CONFIRM, "Confirmation"},
562 {RSVP_ERROR_ADMISSION, "Admission Control Failure "},
563 {RSVP_ERROR_POLICY, "Policy Control Failure"},
564 {RSVP_ERROR_NO_PATH, "No PATH information for this RESV message"},
565 {RSVP_ERROR_NO_SENDER, "No sender information for this RESV message"},
566 {RSVP_ERROR_CONFLICT_RESV_STYLE, "Conflicting reservation styles"},
567 {RSVP_ERROR_UNKNOWN_RESV_STYLE, "Unknown reservation style"},
568 {RSVP_ERROR_CONFLICT_DEST_PORTS, "Conflicting destination ports"},
569 {RSVP_ERROR_CONFLICT_SRC_PORTS, "Conflicting source ports"},
570 {RSVP_ERROR_PREEMPTED, "Service preempted"},
571 {RSVP_ERROR_UNKNOWN_CLASS, "Unknown object class"},
572 {RSVP_ERROR_UNKNOWN_C_TYPE, "Unknown object C-type"},
573 {RSVP_ERROR_TRAFFIC, "Traffic Control Error"},
574 {RSVP_ERROR_TRAFFIC_SYSTEM, "Traffic Control System Error"},
575 {RSVP_ERROR_SYSTEM, "RSVP System Error"},
576 {RSVP_ERROR_ROUTING, "Routing Error"},
577 {RSVP_ERROR_NOTIFY, "RSVP Notify Error"},
578 {RSVP_ERROR_DIFFSERV, "RSVP Diff-Serv Error"},
579 {RSVP_ERROR_DSTE, "RSVP DiffServ-aware TE Error"},
583 static const value_string rsvp_admission_control_error_vals[] = {
584 {RSVP_AC_ERROR_DELAY_BOUND_ERROR, "Delay bound cannot be met"},
585 {RSVP_AC_ERROR_BANDWITH_UNAVAILABLE, "Requested bandwidth unavailable"},
586 {RSVP_AC_ERROR_LARGE_MTU, "MTU in flowspec larger than interface MTU"},
590 static const value_string rsvp_traffic_control_error_vals[] = {
591 {RSVP_TRAFFIC_CONTROL_ERROR_SERVICE_CONFLICT, "Service conflict"},
592 {RSVP_TRAFFIC_CONTROL_ERROR_SERVIEC_UNSUPPORTED, "Service unsupported"},
593 {RSVP_TRAFFIC_CONTROL_ERROR_BAD_FLOWSPEC, "Bad Flowspec value"},
594 {RSVP_TRAFFIC_CONTROL_ERROR_BAD_TSPEC, "Bad Tspec value"},
595 {RSVP_TRAFFIC_CONTROL_ERROR_BAD_ADSPEC, "Bad Adspec value"},
599 static const value_string rsvp_routing_error_vals[] = {
600 {RSVP_ROUTING_ERROR_BAD_ERO, "Bad EXPLICIT_ROUTE object"},
601 {RSVP_ROUTING_ERROR_BAD_STRICT, "Bad strict node"},
602 {RSVP_ROUTING_ERROR_BAD_LOOSE, "Bad loose node"},
603 {RSVP_ROUTING_ERROR_BAD_INITIAL_SUBOBJ, "Bad initial subobject"},
604 {RSVP_ROUTING_ERROR_NO_ROUTE, "No route available toward destination"},
605 {RSVP_ROUTING_ERROR_UNACCEPTABLE_LABEL, "Unacceptable label value"},
606 {RSVP_ROUTING_ERROR_RRO_LOOP, "RRO indicated routing loops"},
607 {RSVP_ROUTING_ERROR_NON_RSVP_CAPABLE_ROUTER, "non-RSVP-capable router stands in the path"},
608 {RSVP_ROUTING_ERROR_LABEL_ALLOC_FAIL, "MPLS label allocation failure"},
609 {RSVP_ROUTING_ERROR_UNSUPPORTED_L3PID, "Unsupported L3PID"},
613 static const value_string rsvp_notify_error_vals[] = {
614 {RSVP_NOTIFY_ERROR_RRO_TOO_LARGE, "RRO too large for MTU"},
615 {RSVP_NOTIFY_ERROR_RRO_NOTIFICATION, "RRO Notification"},
616 {RSVP_NOTIFY_ERROR_RRO_TUNNEL_LOCAL_REPAIRED, "Tunnel locally repaired"},
617 {RSVP_NOTIFY_ERROR_RRO_CC_ACTIVE_STATE, "Control Channel Active State"},/* RFC3473*/
618 {RSVP_NOTIFY_ERROR_RRO_CC_DEGRADED_STATE,"Control Channel Degraded State"}, /* RFC3473*/
619 {RSVP_NOTIFY_ERROR_LSP_FAILURE, "Private : LSP Failure"},/* Private */
620 {RSVP_NOTIFY_ERROR_LSP_RECOVERED,"Private : LSP recovered"},/* Private */
621 {RSVP_NOTIFY_ERROR_LSP_LOCAL_FAILURE,"Private : LSP Local Failure"},/* Private */
625 static const value_string rsvp_diffserv_error_vals[] = {
626 {RSVP_DIFFSERV_ERROR_UNEXPECTED_DIFFSERVOBJ, "Unexpected DIFFSERV object"},
627 {RSVP_DIFFSERV_ERROR_UNSUPPORTED_PHB, "Unsupported PHB"},
628 {RSVP_DIFFSERV_ERROR_INVALID_EXP_PHB_MAPPING, "Invalid `EXP<->PHB mapping'"},
629 {RSVP_DIFFSERV_ERROR_UNSUPPORTED_PSC, "Unsupported PSC"},
630 {RSVP_DIFFSERV_ERROR_PERLSP_CONTEXT_ALLOC_FAIL, "Per-LSP context allocation failure"},
635 static const value_string rsvp_diffserv_aware_te_error_vals[] = {
636 {RSVP_DSTE_ERROR_UNEXPECTED_CLASSTYPEOBJ, "Unexpected CLASSTYPE object"},
637 {RSVP_DSTE_ERROR_UNSUPPORTED_CLASSTYPE, "Unsupported Class-Type"},
638 {RSVP_DSTE_ERROR_INVALID_CLASSTYPE_VALUE, "Invalid Class-Type value"},
639 {RSVP_DSTE_ERROR_CT_SETUP_PRIO_NOT_CONFIGURED, "CT and setup priority do not form a configured TE-Class"},
640 {RSVP_DSTE_ERROR_CT_HOLDING_PRIO_NOT_CONFIGURED, "CT and holding priority do not form a configured TE-Class"},
641 {RSVP_DSTE_ERROR_CT_SETUP_PRIO_AND_CT_HOLDING_PRIO_NOT_CONFIGURED,
642 "CT and setup priority do not form a configured TE-Class AND CT and holding priority do not form a configured TE-Class"},
643 {RSVP_DSTE_ERROR_INCONSISTENCY_PSC_CT, "Inconsistency between signaled PSC and signaled CT"},
644 {RSVP_DSTE_ERROR_INCONSISTENCY_PHB_CT, "Inconsistency between signaled PHBs and signaled CT"},
649 * Defines the reservation style plus style-specific information that
650 * is not a FLOWSPEC or FILTER_SPEC object, in a RESV message.
652 #define RSVP_DISTINCT (1 << 3)
653 #define RSVP_SHARED (2 << 3)
654 #define RSVP_SHARING_MASK (RSVP_DISTINCT | RSVP_SHARED)
656 #define RSVP_SCOPE_WILD 1
657 #define RSVP_SCOPE_EXPLICIT 2
658 #define RSVP_SCOPE_MASK 0x07
660 #define RSVP_WF (RSVP_SHARED | RSVP_SCOPE_WILD)
661 #define RSVP_FF (RSVP_DISTINCT | RSVP_SCOPE_EXPLICIT)
662 #define RSVP_SE (RSVP_SHARED | RSVP_SCOPE_EXPLICIT)
664 static const value_string style_vals[] = {
665 { RSVP_WF, "Wildcard Filter" },
666 { RSVP_FF, "Fixed Filter" },
667 { RSVP_SE, "Shared-Explicit" },
672 RSVP_SESSION_TYPE_IPV4 = 1,
673 RSVP_SESSION_TYPE_IPV6,
675 RSVP_SESSION_TYPE_IPV4_LSP = 7,
676 RSVP_SESSION_TYPE_IPV6_LSP,
678 RSVP_SESSION_TYPE_AGGREGATE_IPV4 = 9,
679 RSVP_SESSION_TYPE_AGGREGATE_IPV6,
681 RSVP_SESSION_TYPE_IPV4_UNI = 11,
682 RSVP_SESSION_TYPE_IPV4_E_NNI = 15
686 * Defines a desired QoS, in a RESV message.
688 enum qos_service_type {
689 QOS_QUALITATIVE = 128, /* Qualitative service */
690 QOS_NULL = 6, /* Null service (RFC2997) */
691 QOS_CONTROLLED_LOAD= 5, /* Controlled Load Service */
692 QOS_GUARANTEED = 2, /* Guaranteed service */
693 QOS_TSPEC = 1 /* Traffic specification */
696 static const value_string qos_vals[] = {
697 { QOS_QUALITATIVE, "Qualitative QoS" },
698 { QOS_NULL, "Null-Service QoS" },
699 { QOS_CONTROLLED_LOAD, "Controlled-load QoS" },
700 { QOS_GUARANTEED, "Guaranteed rate QoS" },
701 { QOS_TSPEC, "Traffic specification" },
705 static const value_string svc_vals[] = {
706 { 126, "Compression Hint" },
707 { 127, "Token bucket" },
708 { 128, "Null Service" },
709 { 130, "Guaranteed-rate RSpec" },
713 enum rsvp_spec_types { INTSRV = 2 };
715 enum intsrv_services {
720 INTSRV_QUALITATIVE = 128
723 static const value_string intsrv_services_str[] = {
724 {INTSRV_GENERAL, "Default General Parameters"},
725 {INTSRV_GTD, "Guaranteed Rate"},
726 {INTSRV_CLOAD, "Controlled Load"},
727 {INTSRV_NULL, "Null Service"},
728 {INTSRV_QUALITATIVE, "Null Service"},
733 enum intsrv_field_name {
734 INTSRV_NON_IS_HOPS = 1, INTSRV_COMPOSED_NON_IS_HOPS,
735 INTSRV_IS_HOPS, INTSRV_COMPOSED_IS_HOPS,
736 INTSRV_PATH_BANDWIDTH, INTSRV_MIN_PATH_BANDWIDTH,
737 INTSRV_IF_LATENCY, INTSRV_PATH_LATENCY,
738 INTSRV_MTU, INTSRV_COMPOSED_MTU,
740 INTSRV_TOKEN_BUCKET_TSPEC = 127,
741 INTSRV_QUALITATIVE_TSPEC = 128,
742 INTSRV_GTD_RSPEC = 130,
744 INTSRV_DELAY = 131, /* Gtd Parameter C - Max Delay Bound - bytes */
745 INTSRV_MAX_JITTER, /* Gtd Parameter D - Max Jitter */
746 INTSRV_E2E_DELAY, /* Gtd Parameter Ctot */
747 INTSRV_E2E_MAX_JITTER, /* Gtd Parameter Dtot */
748 INTSRV_SHP_DELAY, /* Gtd Parameter Csum */
749 INTSRV_SHP_MAX_JITTER /* Gtd Parameter Dsum */
753 static const value_string adspec_params[] = {
755 {6, "Path b/w estimate"},
756 {8, "Minimum path latency"},
757 {10, "Composed MTU"},
758 {133, "End-to-end composed value for C"},
759 {134, "End-to-end composed value for D"},
760 {135, "Since-last-reshaping point composed C"},
761 {136, "Since-last-reshaping point composed D"},
765 const value_string gmpls_lsp_enc_str[] = {
767 { 2, "Ethernet v2/DIX"},
770 { 6, "VCAT"}, /* provisional value */
771 { 7, "Digital Wrapper"},
772 { 8, "Lambda (photonic)"},
774 {11, "FiberChannel"},
778 const value_string gmpls_switching_type_str[] = {
779 { 1, "Packet-Switch Capable-1 (PSC-1)"},
780 { 2, "Packet-Switch Capable-2 (PSC-2)"},
781 { 3, "Packet-Switch Capable-3 (PSC-3)"},
782 { 4, "Packet-Switch Capable-4 (PSC-4)"},
783 { 51, "Layer-2 Switch Capable (L2SC)"},
784 {100, "Time-Division-Multiplex Capable (TDM)"},
785 {150, "Lambda-Switch Capable (LSC)"},
786 {200, "Fiber-Switch Capable (FSC)"},
790 const value_string gmpls_protection_cap_str[] = {
791 { 1, "Extra Traffic"},
794 { 8, "Dedicated 1:1"},
795 {16, "Dedicated 1+1"},
802 static const value_string gmpls_gpid_str[] = {
803 { 5, "Asynchronous mapping of E3 (SDH)"},
804 { 8, "Bit synchronous mapping of E3 (SDH)"},
805 { 9, "Byte synchronous mapping of E3 (SDH)"},
806 {10, "Asynchronous mapping of DS2/T2 (SDH)"},
807 {11, "Bit synchronous mapping of DS2/T2 (SONET, SDH)"},
808 {13, "Asynchronous mapping of E1 (SONET, SDH)"},
809 {14, "Byte synchronous mapping of E1 (SONET, SDH)"},
810 {15, "Byte synchronous mapping of 31 * DS0 (SONET, SDH)"},
811 {16, "Asynchronous mapping of DS1/T1 (SONET, SDH)"},
812 {17, "Bit synchronous mapping of DS1/T1 (SONET, SDH)"},
813 {18, "Byte synchronous mapping of DS1/T1 (SONET, SDH)"},
814 {19, "VC-11 in VC-12 (SDH)"},
815 {22, "DS1 SF Asynchronous (SONET)"},
816 {23, "DS1 ESF Asynchronous (SONET)"},
817 {24, "DS3 M23 Asynchronous (SONET)"},
818 {25, "DS3 C-Bit Parity Asynchronous (SONET)"},
819 {26, "VT/LOVC (SONET, SDH)"},
820 {27, "STS SPE/HOVC (SONET, SDH)"},
821 {28, "POS - No Scrambling, 16 bit CRC (SONET, SDH)"},
822 {29, "POS - No Scrambling, 32 bit CRC (SONET, SDH)"},
823 {30, "POS - Scrambling, 16 bit CRC (SONET, SDH)"},
824 {31, "POS - Scrambling, 32 bit CRC (SONET, SDH)"},
825 {32, "ATM Mapping (SONET, SDH)"},
826 {33, "Ethernet (SDH, Lambda, Fiber)"},
827 {34, "SDH (Lambda, Fiber)"},
828 {35, "SONET (Lambda, Fiber)"},
829 {36, "Digital Wrapper (Lambda, Fiber)"},
830 {37, "Lambda (Fiber)"},
831 {38, "ETSI PDH (SDH)"},
832 {39, "ANSI PDH (SONET, SDH)"},
833 {40, "Link Access Protocol SDH: LAPS - X.85 and X.86 (SONET, SDH)"},
834 {41, "FDDI (SONET, SDH, Lambda, Fiber)"},
835 {42, "DQDB: ETSI ETS 300 216 (SONET, SDH)"},
836 {43, "FiberChannel-3 Services (FiberChannel)"},
838 {45, "Ethernet V2/DIX (only)"},
839 {46, "Ethernet 802.3 (only)"},
843 const value_string gmpls_sonet_signal_type_str[] = {
844 { 1, "VT1.5 SPE / VC-11"},
845 { 2, "VT2 SPE / VC-12"},
847 { 4, "VT6 SPE / VC-2"},
848 { 5, "STS-1 SPE / VC-3"},
849 { 6, "STS-3c SPE / VC-4"},
850 { 7, "STS-1 / STM-0 (transp)"},
851 { 8, "STS-3 / STM-1 (transp)"},
852 { 9, "STS-12 / STM-4 (transp)"},
853 {10, "STS-48 / STM-16 (transp)"},
854 {11, "STS-192 / STM-64 (transp)"},
855 {12, "STS-768 / STM-256 (transp)"},
857 /* Extended non-SONET signal types */
860 {15, "STSG-3 / AUG-1"},
861 {16, "STSG-12 / AUG-4"},
862 {17, "STSG-48 / AUG-16"},
863 {18, "STSG-192 / AUG-64"},
864 {19, "STSG-768 / AUG-256"},
866 /* Other SONEt signal types */
867 {21, "STS-12c SPE / VC-4-4c"},
868 {22, "STS-48c SPE / VC-4-16c"},
869 {23, "STS-192c SPE / VC-4-64c"},
873 static const value_string ouni_guni_diversity_str[] = {
876 {3, "Shared-Risk Link Group Diverse"},
881 /* -------------------- Stuff for MPLS/TE objects -------------------- */
883 static const value_string proto_vals[] = { {IP_PROTO_ICMP, "ICMP"},
884 {IP_PROTO_IGMP, "IGMP"},
885 {IP_PROTO_TCP, "TCP" },
886 {IP_PROTO_UDP, "UDP" },
887 {IP_PROTO_OSPF, "OSPF"},
891 enum rsvp_filter_keys {
894 RSVPF_MSG, /* Message type */
895 /* Shorthand for message types */
917 /* Does the message contain an object of this type? */
919 /* Object present shorthands */
939 RSVPF_EXPLICIT_ROUTE,
943 RSVPF_MESSAGE_ID_ACK,
944 RSVPF_MESSAGE_ID_LIST,
945 RSVPF_RECOVERY_LABEL,
946 RSVPF_UPSTREAM_LABEL,
952 RSVPF_SUGGESTED_LABEL,
953 RSVPF_ACCEPTABLE_LABEL_SET,
956 RSVPF_SESSION_ATTRIBUTE,
958 RSVPF_LSP_TUNNEL_IF_ID,
959 RSVPF_NOTIFY_REQUEST,
962 RSVPF_GENERALIZED_UNI,
970 RSVPF_SESSION_TUNNEL_ID,
971 RSVPF_SESSION_EXT_TUNNEL_ID,
973 /* Sender template */
978 /* Diffserv object */
979 RSVPF_DIFFSERV_MAPNB,
981 RSVPF_DIFFSERV_MAP_EXP,
982 RSVPF_DIFFSERV_PHBID,
983 RSVPF_DIFFSERV_PHBID_DSCP,
984 RSVPF_DIFFSERV_PHBID_CODE,
985 RSVPF_DIFFSERV_PHBID_BIT14,
986 RSVPF_DIFFSERV_PHBID_BIT15,
988 /* Diffserv-aware TE object */
989 RSVPF_DSTE_CLASSTYPE,
991 /* Generalized UNI object */
998 RSVPF_CALL_ID_SRC_ADDR_IPV4,
999 RSVPF_CALL_ID_SRC_ADDR_IPV6,
1005 static int rsvp_filter[RSVPF_MAX];
1007 static hf_register_info rsvpf_info[] = {
1009 /* Message type number */
1010 {&rsvp_filter[RSVPF_MSG],
1011 { "Message Type", "rsvp.msg", FT_UINT8, BASE_DEC, VALS(message_type_vals), 0x0,
1014 /* Message type shorthands */
1015 {&rsvp_filter[RSVPF_PATH],
1016 { "Path Message", "rsvp.path", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1019 {&rsvp_filter[RSVPF_RESV],
1020 { "Resv Message", "rsvp.resv", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1023 {&rsvp_filter[RSVPF_PATHERR],
1024 { "Path Error Message", "rsvp.perr", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1027 {&rsvp_filter[RSVPF_RESVERR],
1028 { "Resv Error Message", "rsvp.rerr", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1031 {&rsvp_filter[RSVPF_PATHTEAR],
1032 { "Path Tear Message", "rsvp.ptear", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1035 {&rsvp_filter[RSVPF_RESVTEAR],
1036 { "Resv Tear Message", "rsvp.rtear", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1039 {&rsvp_filter[RSVPF_RCONFIRM],
1040 { "Resv Confirm Message", "rsvp.resvconf", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1043 {&rsvp_filter[RSVPF_RTEARCONFIRM],
1044 { "Resv Tear Confirm Message", "rsvp.rtearconf", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1047 {&rsvp_filter[RSVPF_BUNDLE],
1048 { "Bundle Message", "rsvp.bundle", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1051 {&rsvp_filter[RSVPF_ACK],
1052 { "Ack Message", "rsvp.ack", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1055 {&rsvp_filter[RSVPF_SREFRESH],
1056 { "Srefresh Message", "rsvp.srefresh", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1059 {&rsvp_filter[RSVPF_HELLO],
1060 { "HELLO Message", "rsvp.hello", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1064 {&rsvp_filter[RSVPF_OBJECT],
1065 { "Object class", "rsvp.object", FT_UINT8, BASE_DEC, VALS(rsvp_class_vals), 0x0,
1068 {&rsvp_filter[RSVPF_NOTIFY],
1069 { "Notify Message", "rsvp.notify", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1072 /* Object present shorthands */
1073 {&rsvp_filter[RSVPF_SESSION],
1074 { "SESSION", "rsvp.session", FT_NONE, BASE_NONE, NULL, 0x0,
1077 {&rsvp_filter[RSVPF_HOP],
1078 { "HOP", "rsvp.hop", FT_NONE, BASE_NONE, NULL, 0x0,
1081 {&rsvp_filter[RSVPF_HELLO_OBJ],
1082 { "HELLO Request/Ack", "rsvp.hello_obj", FT_NONE, BASE_NONE, NULL, 0x0,
1085 {&rsvp_filter[RSVPF_INTEGRITY],
1086 { "INTEGRITY", "rsvp.integrity", FT_NONE, BASE_NONE, NULL, 0x0,
1089 {&rsvp_filter[RSVPF_TIME_VALUES],
1090 { "TIME VALUES", "rsvp.time", FT_NONE, BASE_NONE, NULL, 0x0,
1093 {&rsvp_filter[RSVPF_ERROR],
1094 { "ERROR", "rsvp.error", FT_NONE, BASE_NONE, NULL, 0x0,
1097 {&rsvp_filter[RSVPF_SCOPE],
1098 { "SCOPE", "rsvp.scope", FT_NONE, BASE_NONE, NULL, 0x0,
1101 {&rsvp_filter[RSVPF_STYLE],
1102 { "STYLE", "rsvp.style", FT_NONE, BASE_NONE, NULL, 0x0,
1105 {&rsvp_filter[RSVPF_FLOWSPEC],
1106 { "FLOWSPEC", "rsvp.flowspec", FT_NONE, BASE_NONE, NULL, 0x0,
1109 {&rsvp_filter[RSVPF_FILTER_SPEC],
1110 { "FILTERSPEC", "rsvp.filter", FT_NONE, BASE_NONE, NULL, 0x0,
1113 {&rsvp_filter[RSVPF_SENDER],
1114 { "SENDER TEMPLATE", "rsvp.sender", FT_NONE, BASE_NONE, NULL, 0x0,
1117 {&rsvp_filter[RSVPF_TSPEC],
1118 { "SENDER TSPEC", "rsvp.tspec", FT_NONE, BASE_NONE, NULL, 0x0,
1121 {&rsvp_filter[RSVPF_ADSPEC],
1122 { "ADSPEC", "rsvp.adspec", FT_NONE, BASE_NONE, NULL, 0x0,
1125 {&rsvp_filter[RSVPF_POLICY],
1126 { "POLICY", "rsvp.policy", FT_NONE, BASE_NONE, NULL, 0x0,
1129 {&rsvp_filter[RSVPF_CONFIRM],
1130 { "CONFIRM", "rsvp.confirm", FT_NONE, BASE_NONE, NULL, 0x0,
1133 {&rsvp_filter[RSVPF_LABEL],
1134 { "LABEL", "rsvp.label", FT_NONE, BASE_NONE, NULL, 0x0,
1137 {&rsvp_filter[RSVPF_RECOVERY_LABEL],
1138 { "RECOVERY LABEL", "rsvp.recovery_label", FT_NONE, BASE_NONE, NULL, 0x0,
1141 {&rsvp_filter[RSVPF_UPSTREAM_LABEL],
1142 { "UPSTREAM LABEL", "rsvp.upstream_label", FT_NONE, BASE_NONE, NULL, 0x0,
1145 {&rsvp_filter[RSVPF_SUGGESTED_LABEL],
1146 { "SUGGESTED LABEL", "rsvp.suggested_label", FT_NONE, BASE_NONE, NULL, 0x0,
1149 {&rsvp_filter[RSVPF_LABEL_SET],
1150 { "LABEL SET", "rsvp.label_set", FT_NONE, BASE_NONE, NULL, 0x0,
1153 {&rsvp_filter[RSVPF_ACCEPTABLE_LABEL_SET],
1154 { "ACCEPTABLE LABEL SET", "rsvp.acceptable_label_set", FT_NONE, BASE_NONE, NULL, 0x0,
1157 {&rsvp_filter[RSVPF_PROTECTION],
1158 { "PROTECTION", "rsvp.protection", FT_NONE, BASE_NONE, NULL, 0x0,
1161 {&rsvp_filter[RSVPF_DIFFSERV],
1162 { "DIFFSERV", "rsvp.diffserv", FT_NONE, BASE_NONE, NULL, 0x0,
1165 {&rsvp_filter[RSVPF_DSTE],
1166 { "CLASSTYPE", "rsvp.dste", FT_NONE, BASE_NONE, NULL, 0x0,
1169 {&rsvp_filter[RSVPF_RESTART_CAP],
1170 { "RESTART CAPABILITY", "rsvp.restart", FT_NONE, BASE_NONE, NULL, 0x0,
1173 {&rsvp_filter[RSVPF_LABEL_REQUEST],
1174 { "LABEL REQUEST", "rsvp.label_request", FT_NONE, BASE_NONE, NULL, 0x0,
1177 {&rsvp_filter[RSVPF_SESSION_ATTRIBUTE],
1178 { "SESSION ATTRIBUTE", "rsvp.session_attribute", FT_NONE, BASE_NONE, NULL, 0x0,
1181 {&rsvp_filter[RSVPF_EXPLICIT_ROUTE],
1182 { "EXPLICIT ROUTE", "rsvp.explicit_route", FT_NONE, BASE_NONE, NULL, 0x0,
1185 {&rsvp_filter[RSVPF_RECORD_ROUTE],
1186 { "RECORD ROUTE", "rsvp.record_route", FT_NONE, BASE_NONE, NULL, 0x0,
1189 {&rsvp_filter[RSVPF_MESSAGE_ID],
1190 { "MESSAGE-ID", "rsvp.msgid", FT_NONE, BASE_NONE, NULL, 0x0,
1193 {&rsvp_filter[RSVPF_MESSAGE_ID_ACK],
1194 { "MESSAGE-ID ACK", "rsvp.ack", FT_NONE, BASE_NONE, NULL, 0x0,
1197 {&rsvp_filter[RSVPF_MESSAGE_ID_LIST],
1198 { "MESSAGE-ID LIST", "rsvp.msgid_list", FT_NONE, BASE_NONE, NULL, 0x0,
1201 {&rsvp_filter[RSVPF_DCLASS],
1202 { "DCLASS", "rsvp.dclass", FT_NONE, BASE_NONE, NULL, 0x0,
1205 {&rsvp_filter[RSVPF_LSP_TUNNEL_IF_ID],
1206 { "LSP INTERFACE-ID", "rsvp.lsp_tunnel_if_id", FT_NONE, BASE_NONE, NULL, 0x0,
1209 {&rsvp_filter[RSVPF_ADMIN_STATUS],
1210 { "ADMIN STATUS", "rsvp.admin_status", FT_NONE, BASE_NONE, NULL, 0x0,
1213 {&rsvp_filter[RSVPF_ASSOCIATION],
1214 { "ASSOCIATION", "rsvp.association", FT_NONE, BASE_NONE, NULL, 0x0,
1217 {&rsvp_filter[RSVPF_NOTIFY_REQUEST],
1218 { "NOTIFY REQUEST", "rsvp.notify_request", FT_NONE, BASE_NONE, NULL, 0x0,
1221 {&rsvp_filter[RSVPF_GENERALIZED_UNI],
1222 { "GENERALIZED UNI", "rsvp.generalized_uni", FT_NONE, BASE_NONE, NULL, 0x0,
1225 {&rsvp_filter[RSVPF_CALL_ID],
1226 { "CALL ID", "rsvp.call_id", FT_NONE, BASE_NONE, NULL, 0x0,
1229 {&rsvp_filter[RSVPF_UNKNOWN_OBJ],
1230 { "Unknown object", "rsvp.obj_unknown", FT_NONE, BASE_NONE, NULL, 0x0,
1233 /* Session fields */
1234 {&rsvp_filter[RSVPF_SESSION_IP],
1235 { "Destination address", "rsvp.session.ip", FT_IPv4, BASE_NONE, NULL, 0x0,
1238 {&rsvp_filter[RSVPF_SESSION_PORT],
1239 { "Port number", "rsvp.session.port", FT_UINT16, BASE_DEC, NULL, 0x0,
1242 {&rsvp_filter[RSVPF_SESSION_PROTO],
1243 { "Protocol", "rsvp.session.proto", FT_UINT8, BASE_DEC, VALS(proto_vals), 0x0,
1246 {&rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
1247 { "Tunnel ID", "rsvp.session.tunnel_id", FT_UINT16, BASE_DEC, NULL, 0x0,
1250 {&rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
1251 { "Extended tunnel ID", "rsvp.session.ext_tunnel_id", FT_UINT32, BASE_DEC, NULL, 0x0,
1254 /* Sender template/Filterspec fields */
1255 {&rsvp_filter[RSVPF_SENDER_IP],
1256 { "Sender IPv4 address", "rsvp.sender.ip", FT_IPv4, BASE_NONE, NULL, 0x0,
1259 {&rsvp_filter[RSVPF_SENDER_PORT],
1260 { "Sender port number", "rsvp.sender.port", FT_UINT16, BASE_DEC, NULL, 0x0,
1263 {&rsvp_filter[RSVPF_SENDER_LSP_ID],
1264 { "Sender LSP ID", "rsvp.sender.lsp_id", FT_UINT16, BASE_DEC, NULL, 0x0,
1267 /* Diffserv object fields */
1268 {&rsvp_filter[RSVPF_DIFFSERV_MAPNB],
1269 { "MAPnb", "rsvp.diffserv.mapnb", FT_UINT8, BASE_DEC, NULL, 0x0,
1270 MAPNB_DESCRIPTION, HFILL }},
1272 {&rsvp_filter[RSVPF_DIFFSERV_MAP],
1273 { "MAP", "rsvp.diffserv.map", FT_NONE, BASE_NONE, NULL, 0x0,
1274 MAP_DESCRIPTION, HFILL }},
1276 {&rsvp_filter[RSVPF_DIFFSERV_MAP_EXP],
1277 { "EXP", "rsvp.diffserv.map.exp", FT_UINT8, BASE_DEC, NULL, 0x0,
1278 EXP_DESCRIPTION, HFILL }},
1280 {&rsvp_filter[RSVPF_DIFFSERV_PHBID],
1281 { "PHBID", "rsvp.diffserv.phbid", FT_NONE, BASE_NONE, NULL, 0x0,
1282 PHBID_DESCRIPTION, HFILL }},
1284 {&rsvp_filter[RSVPF_DIFFSERV_PHBID_DSCP],
1285 { PHBID_DSCP_DESCRIPTION, "rsvp.diffserv.phbid.dscp", FT_UINT16,
1286 BASE_DEC, NULL, PHBID_DSCP_MASK, "DSCP", HFILL }},
1288 {&rsvp_filter[RSVPF_DIFFSERV_PHBID_CODE],
1289 { PHBID_CODE_DESCRIPTION, "rsvp.diffserv.phbid.code", FT_UINT16,
1290 BASE_DEC, NULL, PHBID_CODE_MASK, "PHB id code", HFILL }},
1292 {&rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT14],
1293 { PHBID_BIT14_DESCRIPTION, "rsvp.diffserv.phbid.bit14", FT_UINT16,
1294 BASE_DEC, VALS(phbid_bit14_vals), PHBID_BIT14_MASK, "Bit 14", HFILL }},
1296 {&rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT15],
1297 { PHBID_BIT15_DESCRIPTION, "rsvp.diffserv.phbid.bit15", FT_UINT16,
1298 BASE_DEC, VALS(phbid_bit15_vals), PHBID_BIT15_MASK, "Bit 15", HFILL }},
1300 /* Diffserv-aware TE object field */
1301 {&rsvp_filter[RSVPF_DSTE_CLASSTYPE],
1302 { "CT", "rsvp.dste.classtype", FT_UINT8, BASE_DEC, NULL, 0x0,
1305 /* Generalized UNI object field */
1306 {&rsvp_filter[RSVPF_GUNI_SRC_IPV4],
1307 { "Source TNA", "rsvp.guni.srctna.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0,
1310 {&rsvp_filter[RSVPF_GUNI_DST_IPV4],
1311 { "Destination TNA", "rsvp.guni.dsttna.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0,
1314 {&rsvp_filter[RSVPF_GUNI_SRC_IPV6],
1315 { "Source TNA", "rsvp.guni.srctna.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0,
1318 {&rsvp_filter[RSVPF_GUNI_DST_IPV6],
1319 { "Destination TNA", "rsvp.guni.dsttna.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0,
1322 /* Generalized UNI object field */
1323 {&rsvp_filter[RSVPF_CALL_ID_SRC_ADDR_IPV4],
1324 { "Source Transport Network Address", "rsvp.callid.srcaddr.ipv4", FT_IPv4,
1325 BASE_NONE, NULL, 0x0, "", HFILL }},
1327 {&rsvp_filter[RSVPF_CALL_ID_SRC_ADDR_IPV6],
1328 { "Source Transport Network Address", "rsvp.callid.srcaddr.ipv6", FT_IPv6,
1329 BASE_NONE, NULL, 0x0, "", HFILL }}
1332 /* RSVP Conversation related Hash functions */
1335 * Compare two RSVP request keys to see if they are equal. Return 1 if they
1337 * Two RSVP request keys are equal if and only if they have the exactly the
1338 * same internal conversation identifier, session type, and matching values in
1339 * the session info and source info structures.
1342 rsvp_equal (gconstpointer k1, gconstpointer k2)
1344 const struct rsvp_request_key *key1 = (const struct rsvp_request_key*) k1;
1345 const struct rsvp_request_key *key2 = (const struct rsvp_request_key*) k2;
1347 if (key1->conversation != key2->conversation) {
1351 if (key1->session_type != key2->session_type) {
1355 switch (key1->session_type) {
1356 case RSVP_SESSION_TYPE_IPV4:
1357 if (ADDRESSES_EQUAL(&key1->u.session_ipv4.destination,
1358 &key2->u.session_ipv4.destination) == FALSE)
1361 if (key1->u.session_ipv4.protocol != key2->u.session_ipv4.protocol)
1364 if (key1->u.session_ipv4.udp_dest_port != key2->u.session_ipv4.udp_dest_port)
1369 case RSVP_SESSION_TYPE_IPV6:
1370 /* this is not supported yet for conversations */
1373 case RSVP_SESSION_TYPE_IPV4_LSP:
1374 if (ADDRESSES_EQUAL(&key1->u.session_ipv4_lsp.destination,
1375 &key2->u.session_ipv4_lsp.destination) == FALSE)
1378 if (key1->u.session_ipv4_lsp.udp_dest_port !=
1379 key2->u.session_ipv4_lsp.udp_dest_port)
1383 if (key1->u.session_ipv4_lsp.ext_tunnel_id !=
1384 key2->u.session_ipv4_lsp.ext_tunnel_id)
1389 case RSVP_SESSION_TYPE_AGGREGATE_IPV4:
1390 if (ADDRESSES_EQUAL(&key1->u.session_agg_ipv4.destination,
1391 &key2->u.session_agg_ipv4.destination) == FALSE)
1394 if (key1->u.session_agg_ipv4.dscp != key2->u.session_agg_ipv4.dscp)
1399 case RSVP_SESSION_TYPE_AGGREGATE_IPV6:
1400 /* this is not supported yet for conversations */
1403 case RSVP_SESSION_TYPE_IPV4_UNI:
1404 if (ADDRESSES_EQUAL(&key1->u.session_ipv4_uni.destination,
1405 &key2->u.session_ipv4_uni.destination) == FALSE)
1408 if (key1->u.session_ipv4_uni.udp_dest_port !=
1409 key2->u.session_ipv4_uni.udp_dest_port)
1413 if (key1->u.session_ipv4_uni.ext_tunnel_id !=
1414 key2->u.session_ipv4_uni.ext_tunnel_id)
1419 case RSVP_SESSION_TYPE_IPV4_E_NNI:
1420 if (ADDRESSES_EQUAL(&key1->u.session_ipv4_enni.destination,
1421 &key2->u.session_ipv4_enni.destination) == FALSE)
1424 if (key1->u.session_ipv4_enni.udp_dest_port !=
1425 key2->u.session_ipv4_enni.udp_dest_port)
1429 if (key1->u.session_ipv4_enni.ext_tunnel_id !=
1430 key2->u.session_ipv4_enni.ext_tunnel_id)
1436 /* This should never happen. */
1440 if (ADDRESSES_EQUAL(&key1->source_info.source,
1441 &key2->source_info.source) == FALSE)
1444 if (key1->source_info.udp_source_port != key2->source_info.udp_source_port)
1447 /* If we get here, the two keys are equal. */
1452 * Calculate a hash key for the supplied RSVP request. The internally allocated
1453 * conversation-id is unique, so we just use that.
1456 rsvp_hash (gconstpointer k)
1458 const struct rsvp_request_key *key = (const struct rsvp_request_key*) k;
1459 return key->conversation;
1463 * Conversation specific initialization code that deletes any unused memory that
1464 * might need to be freed, and allocates the memory for the various conversation
1468 rsvp_init_protocol (void)
1470 if (rsvp_request_hash)
1471 g_hash_table_destroy(rsvp_request_hash);
1473 rsvp_request_hash = g_hash_table_new(rsvp_hash, rsvp_equal);
1476 static inline int rsvp_class_to_filter_num(int classnum)
1479 case RSVP_CLASS_SESSION :
1480 case RSVP_CLASS_HOP :
1481 case RSVP_CLASS_INTEGRITY :
1482 case RSVP_CLASS_TIME_VALUES :
1483 case RSVP_CLASS_ERROR :
1484 case RSVP_CLASS_SCOPE :
1485 case RSVP_CLASS_STYLE :
1486 case RSVP_CLASS_FLOWSPEC :
1487 case RSVP_CLASS_FILTER_SPEC :
1488 case RSVP_CLASS_SENDER_TEMPLATE :
1489 case RSVP_CLASS_SENDER_TSPEC :
1490 case RSVP_CLASS_ADSPEC :
1491 case RSVP_CLASS_POLICY :
1492 case RSVP_CLASS_CONFIRM :
1493 case RSVP_CLASS_LABEL :
1494 case RSVP_CLASS_LABEL_REQUEST :
1495 case RSVP_CLASS_HELLO :
1496 case RSVP_CLASS_EXPLICIT_ROUTE :
1497 case RSVP_CLASS_RECORD_ROUTE :
1498 case RSVP_CLASS_MESSAGE_ID :
1499 case RSVP_CLASS_MESSAGE_ID_ACK :
1500 case RSVP_CLASS_MESSAGE_ID_LIST :
1501 return classnum + RSVPF_OBJECT;
1504 case RSVP_CLASS_RECOVERY_LABEL :
1505 case RSVP_CLASS_UPSTREAM_LABEL :
1506 case RSVP_CLASS_LABEL_SET :
1507 case RSVP_CLASS_PROTECTION :
1508 return RSVPF_RECOVERY_LABEL + (classnum - RSVP_CLASS_RECOVERY_LABEL);
1510 case RSVP_CLASS_SUGGESTED_LABEL :
1511 case RSVP_CLASS_ACCEPTABLE_LABEL_SET :
1512 case RSVP_CLASS_RESTART_CAP :
1513 return RSVPF_SUGGESTED_LABEL + (classnum - RSVP_CLASS_SUGGESTED_LABEL);
1515 case RSVP_CLASS_DIFFSERV :
1516 return RSVPF_DIFFSERV;
1518 case RSVP_CLASS_CLASSTYPE :
1521 case RSVP_CLASS_NOTIFY_REQUEST :
1522 return RSVPF_NOTIFY_REQUEST;
1523 case RSVP_CLASS_ADMIN_STATUS :
1524 return RSVPF_ADMIN_STATUS;
1525 case RSVP_CLASS_ASSOCIATION :
1526 return RSVPF_ASSOCIATION;
1528 case RSVP_CLASS_SESSION_ATTRIBUTE :
1529 return RSVPF_SESSION_ATTRIBUTE;
1530 case RSVP_CLASS_GENERALIZED_UNI :
1531 return RSVPF_GENERALIZED_UNI;
1532 case RSVP_CLASS_CALL_ID :
1533 return RSVPF_CALL_ID;
1534 case RSVP_CLASS_DCLASS :
1535 return RSVPF_DCLASS;
1536 case RSVP_CLASS_LSP_TUNNEL_IF_ID :
1537 return RSVPF_LSP_TUNNEL_IF_ID;
1540 return RSVPF_UNKNOWN_OBJ;
1544 static inline int rsvp_class_to_tree_type(int classnum)
1547 case RSVP_CLASS_SESSION :
1549 case RSVP_CLASS_HOP :
1551 case RSVP_CLASS_INTEGRITY :
1552 return TT_INTEGRITY;
1553 case RSVP_CLASS_TIME_VALUES :
1554 return TT_TIME_VALUES;
1555 case RSVP_CLASS_ERROR :
1557 case RSVP_CLASS_SCOPE :
1559 case RSVP_CLASS_STYLE :
1561 case RSVP_CLASS_FLOWSPEC :
1563 case RSVP_CLASS_FILTER_SPEC :
1564 return TT_FILTER_SPEC;
1565 case RSVP_CLASS_SENDER_TEMPLATE :
1566 return TT_SENDER_TEMPLATE;
1567 case RSVP_CLASS_SENDER_TSPEC :
1569 case RSVP_CLASS_ADSPEC :
1571 case RSVP_CLASS_POLICY :
1573 case RSVP_CLASS_CONFIRM :
1575 case RSVP_CLASS_RECOVERY_LABEL :
1576 case RSVP_CLASS_UPSTREAM_LABEL :
1577 case RSVP_CLASS_SUGGESTED_LABEL :
1578 case RSVP_CLASS_LABEL :
1580 case RSVP_CLASS_LABEL_REQUEST :
1581 return TT_LABEL_REQUEST;
1582 case RSVP_CLASS_HELLO :
1583 return TT_HELLO_OBJ;
1584 case RSVP_CLASS_EXPLICIT_ROUTE :
1585 return TT_EXPLICIT_ROUTE;
1586 case RSVP_CLASS_RECORD_ROUTE :
1587 return TT_RECORD_ROUTE;
1588 case RSVP_CLASS_MESSAGE_ID :
1589 return TT_MESSAGE_ID;
1590 case RSVP_CLASS_MESSAGE_ID_ACK :
1591 return TT_MESSAGE_ID_ACK;
1592 case RSVP_CLASS_MESSAGE_ID_LIST :
1593 return TT_MESSAGE_ID_LIST;
1594 case RSVP_CLASS_LABEL_SET :
1595 return TT_LABEL_SET;
1596 case RSVP_CLASS_PROTECTION :
1597 return TT_PROTECTION_INFO;
1598 case RSVP_CLASS_ACCEPTABLE_LABEL_SET :
1599 return TT_UNKNOWN_CLASS;
1600 case RSVP_CLASS_RESTART_CAP :
1601 return TT_RESTART_CAP;
1602 case RSVP_CLASS_DIFFSERV :
1604 case RSVP_CLASS_CLASSTYPE:
1605 return TT_CLASSTYPE;
1606 case RSVP_CLASS_NOTIFY_REQUEST :
1607 return TT_UNKNOWN_CLASS;
1608 case RSVP_CLASS_ADMIN_STATUS :
1609 return TT_ADMIN_STATUS;
1610 case RSVP_CLASS_ASSOCIATION :
1611 return TT_ASSOCIATION;
1612 case RSVP_CLASS_SESSION_ATTRIBUTE :
1613 return TT_SESSION_ATTRIBUTE;
1614 case RSVP_CLASS_GENERALIZED_UNI :
1616 case RSVP_CLASS_CALL_ID :
1618 case RSVP_CLASS_DCLASS :
1620 case RSVP_CLASS_LSP_TUNNEL_IF_ID :
1621 return TT_LSP_TUNNEL_IF_ID;
1623 return TT_UNKNOWN_CLASS;
1628 find_rsvp_session_tempfilt(tvbuff_t *tvb, int hdr_offset, int *session_offp, int *tempfilt_offp)
1630 int s_off = 0, t_off = 0;
1634 if (!tvb_bytes_exist(tvb, hdr_offset+6, 2))
1637 len = tvb_get_ntohs(tvb, hdr_offset+6) + hdr_offset;
1638 off = hdr_offset + 8;
1639 for (off = hdr_offset + 8; off < len && tvb_bytes_exist(tvb, off, 3);
1640 off += obj_length) {
1641 obj_length = tvb_get_ntohs(tvb, off);
1642 if (obj_length == 0)
1644 switch(tvb_get_guint8(tvb, off+2)) {
1645 case RSVP_CLASS_SESSION:
1648 case RSVP_CLASS_SENDER_TEMPLATE:
1649 case RSVP_CLASS_FILTER_SPEC:
1658 if (session_offp) *session_offp = s_off;
1659 if (tempfilt_offp) *tempfilt_offp = t_off;
1662 static char *summary_session (tvbuff_t *tvb, int offset)
1664 static char buf[100];
1666 switch(tvb_get_guint8(tvb, offset+3)) {
1667 case RSVP_SESSION_TYPE_IPV4:
1668 g_snprintf(buf, 100, "SESSION: IPv4, Destination %s, Protocol %d, Port %d. ",
1669 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1670 tvb_get_guint8(tvb, offset+8),
1671 tvb_get_ntohs(tvb, offset+10));
1673 case RSVP_SESSION_TYPE_IPV4_LSP:
1674 g_snprintf(buf, 100, "SESSION: IPv4-LSP, Destination %s, Tunnel ID %d, Ext ID %0x. ",
1675 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1676 tvb_get_ntohs(tvb, offset+10),
1677 tvb_get_ntohl(tvb, offset+12));
1679 case RSVP_SESSION_TYPE_AGGREGATE_IPV4:
1680 g_snprintf(buf, 100, "SESSION: IPv4-Aggregate, Destination %s, DSCP %d. ",
1681 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1682 tvb_get_guint8(tvb, offset+11));
1684 case RSVP_SESSION_TYPE_IPV4_UNI:
1685 g_snprintf(buf, 100, "SESSION: IPv4-UNI, Destination %s, Tunnel ID %d, Ext Address %s. ",
1686 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1687 tvb_get_ntohs(tvb, offset+10),
1688 ip_to_str(tvb_get_ptr(tvb, offset+12, 4)));
1690 case RSVP_SESSION_TYPE_IPV4_E_NNI:
1691 g_snprintf(buf, 100, "SESSION: IPv4-E-NNI, Destination %s, Tunnel ID %d, Ext Address %s. ",
1692 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1693 tvb_get_ntohs(tvb, offset+10),
1694 ip_to_str(tvb_get_ptr(tvb, offset+12, 4)));
1697 g_snprintf(buf, 100, "SESSION: Type %d. ", tvb_get_guint8(tvb, offset+3));
1703 static char *summary_template (tvbuff_t *tvb, int offset)
1705 static char buf[80];
1706 const char *objtype;
1708 if (tvb_get_guint8(tvb, offset+2) == RSVP_CLASS_FILTER_SPEC)
1709 objtype = "FILTERSPEC";
1711 objtype = "SENDER TEMPLATE";
1713 switch(tvb_get_guint8(tvb, offset+3)) {
1715 g_snprintf(buf, 80, "%s: IPv4, Sender %s, Port %d. ", objtype,
1716 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1717 tvb_get_ntohs(tvb, offset+10));
1720 g_snprintf(buf, 80, "%s: IPv4-LSP, Tunnel Source: %s, LSP ID: %d. ", objtype,
1721 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1722 tvb_get_ntohs(tvb, offset+10));
1725 g_snprintf(buf, 80, "%s: IPv4-Aggregate, Aggregator %s. ", objtype,
1726 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)));
1729 g_snprintf(buf, 80, "%s: Type %d. ", objtype, tvb_get_guint8(tvb, offset+3));
1735 /*------------------------------------------------------------------------------
1737 *------------------------------------------------------------------------------*/
1739 dissect_rsvp_session (proto_item *ti, proto_tree *rsvp_object_tree,
1741 int offset, int obj_length,
1742 int class _U_, int type,
1743 rsvp_conversation_info *rsvph)
1745 proto_item *hidden_item;
1746 int offset2 = offset + 4;
1748 proto_item_set_text(ti, "%s", summary_session(tvb, offset));
1751 case RSVP_SESSION_TYPE_IPV4:
1752 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1753 "C-type: 1 - IPv4");
1754 proto_tree_add_item(rsvp_object_tree,
1755 rsvp_filter[RSVPF_SESSION_IP],
1756 tvb, offset2, 4, FALSE);
1758 proto_tree_add_item(rsvp_object_tree,
1759 rsvp_filter[RSVPF_SESSION_PROTO], tvb,
1760 offset2+4, 1, FALSE);
1761 proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 1,
1763 tvb_get_guint8(tvb, offset2+5));
1764 proto_tree_add_item(rsvp_object_tree,
1765 rsvp_filter[RSVPF_SESSION_PORT], tvb,
1766 offset2+6, 2, FALSE);
1769 * Save this information to build the conversation request key
1772 rsvph->session_type = RSVP_SESSION_TYPE_IPV4;
1773 SET_ADDRESS(&rsvph->destination, AT_IPv4, 4,
1774 tvb_get_ptr(tvb, offset2, 4));
1775 rsvph->protocol = tvb_get_guint8(tvb, offset2+4);
1776 rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6);
1780 case RSVP_SESSION_TYPE_IPV6:
1781 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1782 "C-type: 2 - IPv6");
1783 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1784 "Destination address: %s",
1785 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1786 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 1,
1788 tvb_get_guint8(tvb, offset2+16));
1789 proto_tree_add_text(rsvp_object_tree, tvb, offset2+17, 1,
1791 tvb_get_guint8(tvb, offset2+17));
1792 proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2,
1793 "Destination port: %u",
1794 tvb_get_ntohs(tvb, offset2+18));
1796 * Save this information to build the conversation request key
1797 * later. IPv6 conversatiuon support is not implemented yet, so only
1798 * the session type is stored.
1800 rsvph->session_type = RSVP_SESSION_TYPE_IPV6;
1804 case RSVP_SESSION_TYPE_IPV4_LSP:
1805 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1806 "C-type: 7 - IPv4 LSP");
1807 proto_tree_add_item(rsvp_object_tree,
1808 rsvp_filter[RSVPF_SESSION_IP],
1809 tvb, offset2, 4, FALSE);
1811 proto_tree_add_item(rsvp_object_tree,
1812 rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
1813 tvb, offset2+6, 2, FALSE);
1815 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
1816 "Extended Tunnel ID: %u (%s)",
1817 tvb_get_ntohl(tvb, offset2+8),
1818 ip_to_str(tvb_get_ptr(tvb, offset2+8, 4)));
1819 hidden_item = proto_tree_add_item(rsvp_object_tree,
1820 rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
1821 tvb, offset2+8, 4, FALSE);
1822 PROTO_ITEM_SET_HIDDEN(hidden_item);
1825 * Save this information to build the conversation request key
1828 rsvph->session_type = RSVP_SESSION_TYPE_IPV4_LSP;
1829 SET_ADDRESS(&rsvph->destination, AT_IPv4, 4,
1830 tvb_get_ptr(tvb, offset2, 4));
1831 rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6);
1832 rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8);
1835 case RSVP_SESSION_TYPE_AGGREGATE_IPV4:
1836 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1837 "C-type: 9 - IPv4 Aggregate");
1838 proto_tree_add_item(rsvp_object_tree,
1839 rsvp_filter[RSVPF_SESSION_IP],
1840 tvb, offset2, 4, FALSE);
1842 proto_tree_add_text(rsvp_object_tree, tvb, offset2+7, 1,
1844 tvb_get_guint8(tvb, offset2+7),
1845 val_to_str(tvb_get_guint8(tvb, offset2+7),
1846 dscp_vals, "Unknown (%d)"));
1848 * Save this information to build the conversation request key
1851 rsvph->session_type = RSVP_SESSION_TYPE_AGGREGATE_IPV4;
1852 SET_ADDRESS(&rsvph->destination, AT_IPv4, 4,
1853 tvb_get_ptr(tvb, offset2, 4));
1854 rsvph->dscp = tvb_get_guint8(tvb, offset2+7);
1855 rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8);
1858 case RSVP_SESSION_TYPE_IPV4_UNI:
1859 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1860 "C-type: 11 - IPv4 UNI");
1861 proto_tree_add_item(rsvp_object_tree,
1862 rsvp_filter[RSVPF_SESSION_IP],
1863 tvb, offset2, 4, FALSE);
1865 proto_tree_add_item(rsvp_object_tree,
1866 rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
1867 tvb, offset2+6, 2, FALSE);
1869 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
1870 "Extended IPv4 Address: %s",
1871 ip_to_str(tvb_get_ptr(tvb, offset2+8, 4)));
1872 hidden_item = proto_tree_add_item(rsvp_object_tree,
1873 rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
1874 tvb, offset2+8, 4, FALSE);
1875 PROTO_ITEM_SET_HIDDEN(hidden_item);
1878 * Save this information to build the conversation request key
1881 rsvph->session_type = RSVP_SESSION_TYPE_IPV4_UNI;
1882 SET_ADDRESS(&rsvph->destination, AT_IPv4, 4,
1883 tvb_get_ptr(tvb, offset2, 4));
1884 rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6);
1885 rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8);
1889 case RSVP_SESSION_TYPE_IPV4_E_NNI:
1890 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1891 "C-type: 15 - IPv4 E-NNI");
1892 proto_tree_add_item(rsvp_object_tree,
1893 rsvp_filter[RSVPF_SESSION_IP],
1894 tvb, offset2, 4, FALSE);
1896 proto_tree_add_item(rsvp_object_tree,
1897 rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
1898 tvb, offset2+6, 2, FALSE);
1900 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
1901 "Extended IPv4 Address: %s",
1902 ip_to_str(tvb_get_ptr(tvb, offset2+8, 4)));
1903 hidden_item = proto_tree_add_item(rsvp_object_tree,
1904 rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
1905 tvb, offset2+8, 4, FALSE);
1906 PROTO_ITEM_SET_HIDDEN(hidden_item);
1909 * Save this information to build the conversation request key
1912 rsvph->session_type = RSVP_SESSION_TYPE_IPV4_E_NNI;
1913 SET_ADDRESS(&rsvph->destination, AT_IPv4, 4,
1914 tvb_get_ptr(tvb, offset2, 4));
1915 rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6);
1916 rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8);
1921 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1922 "C-type: Unknown (%u)",
1924 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length-4,
1925 "Data (%d bytes)", obj_length-4);
1930 /*------------------------------------------------------------------------------
1931 * TLVs for HOP, ERROR and other IF_ID extended objects
1932 *------------------------------------------------------------------------------*/
1934 dissect_rsvp_ifid_tlv (proto_tree *ti, proto_tree *rsvp_object_tree,
1935 tvbuff_t *tvb, int offset, int obj_length,
1941 const char *ifindex_name;
1942 proto_tree *rsvp_ifid_subtree, *ti2;
1943 int offset2 = offset + 4;
1945 for (tlv_off = 0; tlv_off < obj_length - 12; ) {
1946 tlv_type = tvb_get_ntohs(tvb, offset+tlv_off);
1947 tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2);
1950 proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off+2, 2,
1951 "Invalid length (0)");
1956 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1959 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)));
1961 rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type);
1962 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2,
1964 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2,
1966 tvb_get_ntohs(tvb, offset+tlv_off+2));
1967 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4,
1969 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)));
1970 proto_item_append_text(ti, "Data IPv4: %s. ",
1971 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)));
1978 ifindex_name = " Forward";
1981 ifindex_name = " Reverse";
1983 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1985 "Interface-Index%s TLV - %s, %d",
1987 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)),
1988 tvb_get_ntohl(tvb, offset+tlv_off+8));
1989 rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type);
1990 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2,
1991 "Type: %d (Interface Index%s)", tlv_type, ifindex_name);
1992 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2,
1994 tvb_get_ntohs(tvb, offset+tlv_off+2));
1995 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4,
1997 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)));
1998 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+8, 4,
2000 tvb_get_ntohl(tvb, offset+tlv_off+8));
2001 proto_item_append_text(ti, "Data If-Index%s: %s, %d. ", ifindex_name,
2002 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)),
2003 tvb_get_ntohl(tvb, offset+tlv_off+8));
2007 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
2008 "Logical interface: %u",
2009 tvb_get_ntohl(tvb, offset2+4));
2015 /*------------------------------------------------------------------------------
2017 *------------------------------------------------------------------------------*/
2019 dissect_rsvp_hop (proto_item *ti, proto_tree *rsvp_object_tree,
2021 int offset, int obj_length,
2022 int class _U_, int type)
2024 int offset2 = offset + 4;
2028 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2029 "C-type: 1 - IPv4");
2030 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2031 "Neighbor address: %s",
2032 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2033 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
2034 "Logical interface: %u",
2035 tvb_get_ntohl(tvb, offset2+4));
2036 proto_item_set_text(ti, "HOP: IPv4, %s",
2037 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2041 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2042 "C-type: 2 - IPv6");
2043 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
2044 "Neighbor address: %s",
2045 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
2046 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 4,
2047 "Logical interface: 0x%08x",
2048 tvb_get_ntohl(tvb, offset2+16));
2052 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2053 "C-type: 3 - IPv4 IF-ID");
2054 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2055 "Neighbor address: %s",
2056 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2057 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
2058 "Logical interface: %u",
2059 tvb_get_ntohl(tvb, offset2+4));
2061 proto_item_set_text(ti, "HOP: IPv4 IF-ID. Control IPv4: %s. ",
2062 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2064 dissect_rsvp_ifid_tlv(ti, rsvp_object_tree, tvb, offset+12, obj_length,
2065 TREE(TT_HOP_SUBOBJ));
2070 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2071 "C-type: Unknown (%u)",
2073 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2074 "Data (%d bytes)", obj_length - 4);
2078 /*------------------------------------------------------------------------------
2080 *------------------------------------------------------------------------------*/
2082 dissect_rsvp_time_values (proto_item *ti, proto_tree *rsvp_object_tree,
2084 int offset, int obj_length,
2085 int class _U_, int type)
2087 int offset2 = offset + 4;
2091 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2093 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2094 "Refresh interval: %u ms (%u seconds)",
2095 tvb_get_ntohl(tvb, offset2),
2096 tvb_get_ntohl(tvb, offset2)/1000);
2097 proto_item_set_text(ti, "TIME VALUES: %d ms",
2098 tvb_get_ntohl(tvb, offset2));
2102 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2103 "C-type: Unknown (%u)",
2105 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2106 "Data (%d bytes)", obj_length - 4);
2111 /*------------------------------------------------------------------------------
2112 * Error value field in ERROR object
2113 *------------------------------------------------------------------------------*/
2115 dissect_rsvp_error_value (proto_tree *ti, tvbuff_t *tvb,
2116 int offset, guint8 error_code)
2119 const value_string *rsvp_error_vals = NULL;
2121 error_val = tvb_get_ntohs(tvb, offset);
2122 switch (error_code) {
2123 case RSVP_ERROR_ADMISSION:
2124 rsvp_error_vals = rsvp_admission_control_error_vals;
2126 case RSVP_ERROR_TRAFFIC:
2127 rsvp_error_vals = rsvp_traffic_control_error_vals;
2129 case RSVP_ERROR_ROUTING:
2130 rsvp_error_vals = rsvp_routing_error_vals;
2132 case RSVP_ERROR_NOTIFY:
2133 rsvp_error_vals = rsvp_notify_error_vals;
2135 case RSVP_ERROR_DIFFSERV:
2136 rsvp_error_vals = rsvp_diffserv_error_vals;
2138 case RSVP_ERROR_DSTE:
2139 rsvp_error_vals = rsvp_diffserv_aware_te_error_vals;
2142 switch (error_code) {
2143 case RSVP_ERROR_ADMISSION:
2144 case RSVP_ERROR_TRAFFIC:
2145 case RSVP_ERROR_NOTIFY:
2146 case RSVP_ERROR_ROUTING:
2147 case RSVP_ERROR_DIFFSERV:
2148 case RSVP_ERROR_DSTE:
2149 if ((error_val & 0xc0) == 0) {
2150 proto_tree_add_text(ti, tvb, offset, 2,
2151 "Error value: %u - %s", error_val,
2152 val_to_str(error_val, rsvp_error_vals, "Unknown (%d)"));
2156 proto_tree_add_text(ti, tvb, offset, 2,
2157 "Error value: %u", error_val);
2162 /*------------------------------------------------------------------------------
2164 *------------------------------------------------------------------------------*/
2166 dissect_rsvp_error (proto_item *ti, proto_tree *rsvp_object_tree,
2168 int offset, int obj_length,
2169 int class _U_, int type)
2171 int offset2 = offset + 4;
2176 proto_tree *ti2, *rsvp_error_subtree;
2180 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2181 "C-type: 1 - IPv4");
2182 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2184 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2185 offset3 = offset2+4;
2190 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2191 "C-type: 2 - IPv6");
2192 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
2194 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
2195 offset3 = offset2+16;
2200 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2201 "C-type: 3 - IPv4 IF-ID");
2202 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2204 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2205 offset3 = offset2+4;
2210 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2211 "C-type: Unknown (%u)",
2213 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2214 "Data (%d bytes)", obj_length - 4);
2218 error_flags = tvb_get_guint8(tvb, offset3);
2219 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset3, 1,
2220 "Flags: 0x%02x", error_flags);
2221 rsvp_error_subtree = proto_item_add_subtree(ti2, TREE(TT_ERROR_FLAGS));
2222 proto_tree_add_text(rsvp_error_subtree, tvb, offset3, 1, "%s",
2223 decode_boolean_bitfield(error_flags, 0x04, 8,
2224 "Path State Removed",
2226 proto_tree_add_text(rsvp_error_subtree, tvb, offset3, 1, "%s",
2227 decode_boolean_bitfield(error_flags, 0x02, 8,
2230 proto_tree_add_text(rsvp_error_subtree, tvb, offset3, 1, "%s",
2231 decode_boolean_bitfield(error_flags, 0x01, 8,
2234 proto_item_append_text(ti2, " %s %s %s",
2235 (error_flags & (1<<2)) ? "Path-State-Removed" : "",
2236 (error_flags & (1<<1)) ? "NotGuilty" : "",
2237 (error_flags & (1<<0)) ? "InPlace" : "");
2238 error_code = tvb_get_guint8(tvb, offset3+1);
2239 proto_tree_add_text(rsvp_object_tree, tvb, offset3+1, 1,
2240 "Error code: %u - %s", error_code,
2241 val_to_str(error_code, rsvp_error_codes, "Unknown (%d)"));
2242 error_val = dissect_rsvp_error_value(rsvp_object_tree, tvb, offset3+2, error_code);
2246 proto_item_set_text(ti, "ERROR: IPv4, Error code: %s, Value: %d, Error Node: %s",
2247 val_to_str(error_code, rsvp_error_codes, "Unknown (%d)"),
2248 error_val, ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2251 proto_item_set_text(ti, "ERROR: IPv4 IF-ID, Error code: %s, Value: %d, Control Node: %s. ",
2252 val_to_str(error_code, rsvp_error_codes, "Unknown (%d)"),
2253 error_val, ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2254 dissect_rsvp_ifid_tlv(ti, rsvp_object_tree, tvb, offset+12, obj_length,
2255 TREE(TT_ERROR_SUBOBJ));
2260 /*------------------------------------------------------------------------------
2262 *------------------------------------------------------------------------------*/
2264 dissect_rsvp_scope (proto_item *ti _U_, proto_tree *rsvp_object_tree,
2266 int offset, int obj_length,
2267 int class _U_, int type)
2269 int offset2 = offset + 4;
2272 mylen = obj_length - 4;
2275 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2276 "C-type: 1 - IPv4");
2278 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2280 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2288 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2289 "C-type: 2 - IPv6");
2291 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
2293 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
2301 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2302 "C-type: Unknown (%u)",
2304 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2305 "Data (%d bytes)", mylen);
2309 /*------------------------------------------------------------------------------
2311 *------------------------------------------------------------------------------*/
2313 dissect_rsvp_style (proto_item *ti, proto_tree *rsvp_object_tree,
2315 int offset, int obj_length,
2316 int class _U_, int type)
2318 int offset2 = offset + 4;
2324 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2326 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2328 tvb_get_guint8(tvb, offset2));
2329 style = tvb_get_ntoh24(tvb, offset2+1);
2330 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1,
2331 3, "Style: 0x%06X - %s", style,
2332 val_to_str(style, style_vals, "Unknown"));
2333 proto_item_set_text(ti, "STYLE: %s (%d)",
2334 val_to_str(style, style_vals, "Unknown"),
2340 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2341 "C-type: Unknown (%u)",
2343 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2344 "Data (%d bytes)", obj_length - 4);
2349 /*------------------------------------------------------------------------------
2351 *------------------------------------------------------------------------------*/
2353 dissect_rsvp_confirm (proto_item *ti, proto_tree *rsvp_object_tree,
2355 int offset, int obj_length,
2356 int class _U_, int type)
2358 int offset2 = offset + 4;
2362 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2363 "C-type: 1 - IPv4");
2364 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2365 "Receiver address: %s",
2366 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2367 proto_item_set_text(ti, "CONFIRM: Receiver %s",
2368 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2373 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2374 "C-type: 2 - IPv6");
2375 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
2376 "Receiver address: %s",
2377 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
2382 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2383 "C-type: Unknown (%u)",
2385 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2386 "Data (%d bytes)", obj_length - 4);
2390 /*------------------------------------------------------------------------------
2391 * SENDER TEMPLATE and FILTERSPEC
2392 *------------------------------------------------------------------------------*/
2394 dissect_rsvp_template_filter (proto_item *ti, proto_tree *rsvp_object_tree,
2396 int offset, int obj_length,
2397 int class _U_, int type,
2398 rsvp_conversation_info *rsvph)
2400 int offset2 = offset + 4;
2402 proto_item_set_text(ti, "%s", summary_template(tvb, offset));
2405 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2406 "C-type: 1 - IPv4");
2407 proto_tree_add_item(rsvp_object_tree,
2408 rsvp_filter[RSVPF_SENDER_IP],
2409 tvb, offset2, 4, FALSE);
2410 proto_tree_add_item(rsvp_object_tree,
2411 rsvp_filter[RSVPF_SENDER_PORT],
2412 tvb, offset2+6, 2, FALSE);
2415 * Save this information to build the conversation request key later.
2417 SET_ADDRESS(&rsvph->source, AT_IPv4, 4, tvb_get_ptr(tvb, offset2, 4));
2418 rsvph->udp_source_port = tvb_get_ntohs(tvb, offset2+6);
2422 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2423 "C-type: 2 - IPv6");
2424 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
2425 "Source address: %s",
2426 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
2427 proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2,
2429 tvb_get_ntohs(tvb, offset2+18));
2433 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2434 "C-type: 7 - IPv4 LSP");
2435 proto_tree_add_item(rsvp_object_tree,
2436 rsvp_filter[RSVPF_SENDER_IP],
2437 tvb, offset2, 4, FALSE);
2438 proto_tree_add_item(rsvp_object_tree,
2439 rsvp_filter[RSVPF_SENDER_LSP_ID],
2440 tvb, offset2+6, 2, FALSE);
2443 * Save this information to build the conversation request key later.
2445 SET_ADDRESS(&rsvph->source, AT_IPv4, 4, tvb_get_ptr(tvb, offset2, 4));
2446 rsvph->udp_source_port = tvb_get_ntohs(tvb, offset2+6);
2450 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2451 "C-type: 9 - IPv4 Aggregate");
2452 proto_tree_add_item(rsvp_object_tree,
2453 rsvp_filter[RSVPF_SENDER_IP],
2454 tvb, offset2, 4, FALSE);
2457 * Save this information to build the conversation request key later.
2459 SET_ADDRESS(&rsvph->source, AT_IPv4, 4, tvb_get_ptr(tvb, offset2, 4));
2463 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2464 "C-type: Unknown (%u)",
2466 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2467 "Data (%d bytes)", obj_length - 4);
2471 /*------------------------------------------------------------------------------
2472 * TLVs for Ethernet SENDER TSPEC and FLOWSPEC
2473 * draft-ietf-ccamp-ethernet-traffic-parameters-02
2474 *------------------------------------------------------------------------------*/
2476 dissect_rsvp_eth_tspec_tlv(proto_item *ti, proto_tree *rsvp_object_tree,
2477 tvbuff_t *tvb, int offset, int tlv_length,
2484 proto_tree *rsvp_ethspec_subtree, *ethspec_profile_subtree, *ti2, *ti3;
2486 for (tlv_off = 0; tlv_off < tlv_length; ) {
2487 tlv_type = tvb_get_ntohs(tvb, offset+tlv_off);
2488 tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2);
2490 if (tlv_len == 0 || tlv_off+tlv_len > tlv_length) {
2491 proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off+2, 2,
2497 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2498 offset+tlv_off, tlv_len,
2500 rsvp_ethspec_subtree = proto_item_add_subtree(ti2, subtree_type);
2501 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off, 2,
2502 "Type: 128 (RESERVED)");
2503 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+2, 2,
2504 "Length: %u", tlv_len);
2508 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2509 offset+tlv_off, tlv_len,
2510 "Ethernet Bandwidth Profile TLV: CIR=%.10g, CBS=%.10g, "
2511 "EIR=%.10g, EBS=%.10g",
2512 tvb_get_ntohieee_float(tvb, offset+tlv_off+8),
2513 tvb_get_ntohieee_float(tvb, offset+tlv_off+12),
2514 tvb_get_ntohieee_float(tvb, offset+tlv_off+16),
2515 tvb_get_ntohieee_float(tvb, offset+tlv_off+20));
2516 rsvp_ethspec_subtree = proto_item_add_subtree(ti2, subtree_type);
2517 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off, 2,
2518 "Type: %d - Ethernet Bandwidth Profile", tlv_type);
2519 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+2, 2,
2520 "Length: %u", tlv_len);
2521 profile = tvb_get_guint8(tvb, offset+tlv_off+4);
2522 ti3 = proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+4, 1,
2523 "Profile: 0x%02x", profile);
2524 ethspec_profile_subtree = proto_item_add_subtree(ti3, TREE(TT_ETHSPEC_SUBTREE));
2525 proto_tree_add_text(ethspec_profile_subtree, tvb, offset+tlv_off+4, 1, "%s",
2526 decode_boolean_bitfield(profile, 0x02, 8,
2527 "Color Mode (CM) set",
2528 "Color Mode (CM) NOT set"));
2529 proto_tree_add_text(ethspec_profile_subtree, tvb, offset+tlv_off+4, 1, "%s",
2530 decode_boolean_bitfield(profile, 0x01, 8,
2531 "Coupling Flag (CF) set",
2532 "Coupling Flag (CF) NOT set"));
2533 proto_item_append_text(ti3, " %s %s",
2534 (profile & (1<<1)) ? "CM" : "",
2535 (profile & (1<<0)) ? "CF" : "");
2536 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+5, 1,
2537 "Index: %x", tvb_get_guint8(tvb, offset+tlv_off+5));
2538 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+6, 2,
2539 "Reserved: %x", tvb_get_ntohs(tvb, offset+tlv_off+6));
2540 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+8, 4, "CIR: %.10g",
2541 tvb_get_ntohieee_float(tvb, offset+tlv_off+8));
2542 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+12, 4, "CBS: %.10g",
2543 tvb_get_ntohieee_float(tvb, offset+tlv_off+12));
2544 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+16, 4, "EIR: %.10g",
2545 tvb_get_ntohieee_float(tvb, offset+tlv_off+16));
2546 proto_tree_add_text(rsvp_ethspec_subtree, tvb, offset+tlv_off+20, 4, "EBS: %.10g",
2547 tvb_get_ntohieee_float(tvb, offset+tlv_off+20));
2549 proto_item_append_text(ti, "ETH profile: CIR=%.10g, CBS=%.10g, EIR=%.10g, "
2551 tvb_get_ntohieee_float(tvb, offset+tlv_off+8),
2552 tvb_get_ntohieee_float(tvb, offset+tlv_off+12),
2553 tvb_get_ntohieee_float(tvb, offset+tlv_off+16),
2554 tvb_get_ntohieee_float(tvb, offset+tlv_off+20));
2558 proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off, 2,
2559 "Unknown TLV: %u", tlv_type);
2565 /*------------------------------------------------------------------------------
2567 *------------------------------------------------------------------------------*/
2569 dissect_rsvp_tspec (proto_item *ti, proto_tree *rsvp_object_tree,
2571 int offset, int obj_length,
2572 int class _U_, int type)
2574 int offset2 = offset + 4;
2576 proto_tree *tspec_tree, *ti2;
2578 guint16 switch_gran;
2580 mylen = obj_length - 4;
2584 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2585 "C-type: 2 - Integrated Services");
2586 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2587 "Message format version: %u",
2588 tvb_get_guint8(tvb, offset2)>>4);
2589 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2590 "Data length: %u words, not including header",
2591 tvb_get_ntohs(tvb, offset2+2));
2596 proto_item_set_text(ti, "SENDER TSPEC: IntServ: ");
2602 guint param_len_processed;
2605 service_num = tvb_get_guint8(tvb, offset2);
2606 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2607 "Service header: %u - %s",
2609 val_to_str(service_num, qos_vals, "Unknown"));
2610 length = tvb_get_ntohs(tvb, offset2+2);
2611 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2612 "Length of service %u data: %u words, "
2613 "not including header",
2614 service_num, length);
2619 /* Process all known service headers as a set of parameters */
2620 param_len_processed = 0;
2621 while (param_len_processed < length) {
2622 param_id = tvb_get_guint8(tvb, offset2);
2623 param_len = tvb_get_ntohs(tvb, offset2+2) + 1;
2625 THROW(ReportedBoundsError);
2629 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2630 offset2, param_len*4,
2631 "Token Bucket TSpec: ");
2632 tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE));
2634 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
2635 "Parameter %u - %s",
2637 val_to_str(param_id, svc_vals, "Unknown"));
2638 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
2639 "Parameter %u flags: 0x%02x",
2641 tvb_get_guint8(tvb, offset2+1));
2642 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
2643 "Parameter %u data length: %u words, "
2644 "not including header",
2646 tvb_get_ntohs(tvb, offset2+2));
2647 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
2648 "Token bucket rate: %.10g",
2649 tvb_get_ntohieee_float(tvb, offset2+4));
2650 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2651 "Token bucket size: %.10g",
2652 tvb_get_ntohieee_float(tvb, offset2+8));
2653 proto_tree_add_text(tspec_tree, tvb, offset2+12, 4,
2654 "Peak data rate: %.10g",
2655 tvb_get_ntohieee_float(tvb, offset2+12));
2656 proto_tree_add_text(tspec_tree, tvb, offset2+16, 4,
2657 "Minimum policed unit [m]: %u",
2658 tvb_get_ntohl(tvb, offset2+16));
2659 proto_tree_add_text(tspec_tree, tvb, offset2+20, 4,
2660 "Maximum packet size [M]: %u",
2661 tvb_get_ntohl(tvb, offset2+20));
2662 proto_item_append_text(ti, "Token Bucket, %.10g bytes/sec. ",
2663 tvb_get_ntohieee_float(tvb, offset2+4));
2664 proto_item_append_text(ti2, "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u",
2665 tvb_get_ntohieee_float(tvb, offset2+4),
2666 tvb_get_ntohieee_float(tvb, offset2+8),
2667 tvb_get_ntohieee_float(tvb, offset2+12),
2668 tvb_get_ntohl(tvb, offset2+16),
2669 tvb_get_ntohl(tvb, offset2+20));
2673 /* Null Service (RFC2997) */
2674 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2675 offset2, param_len*4,
2676 "Null Service TSpec: ");
2677 tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE));
2679 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
2680 "Parameter %u - %s",
2682 val_to_str(param_id, svc_vals, "Unknown"));
2683 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
2684 "Parameter %u flags: %x",
2686 tvb_get_guint8(tvb, offset2+1));
2687 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
2688 "Parameter %u data length: %u words, "
2689 "not including header",
2691 tvb_get_ntohs(tvb, offset2+2));
2692 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
2693 "Maximum packet size [M]: %u",
2694 tvb_get_ntohl(tvb, offset2+4));
2695 proto_item_append_text(ti, "Null Service. M=%u",
2696 tvb_get_ntohl(tvb, offset2+4));
2697 proto_item_append_text(ti2, "Max pkt size=%u",
2698 tvb_get_ntohl(tvb, offset2+4));
2702 /* Compression hint (RFC3006) */
2703 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2704 offset2, param_len*4,
2705 "Compression Hint: ");
2706 tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE));
2708 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
2709 "Parameter %u - %s",
2711 val_to_str(param_id, svc_vals, "Unknown"));
2712 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
2713 "Parameter %u flags: %x",
2715 tvb_get_guint8(tvb, offset2+1));
2716 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
2717 "Parameter %u data length: %u words, "
2718 "not including header",
2720 tvb_get_ntohs(tvb, offset2+2));
2721 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
2723 tvb_get_ntohl(tvb, offset2+4));
2724 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
2725 "Compression Factor: %u",
2726 tvb_get_ntohl(tvb, offset2+8));
2727 proto_item_append_text(ti, "Compression Hint. Hint=%u, Factor=%u",
2728 tvb_get_ntohl(tvb, offset2+4),
2729 tvb_get_ntohl(tvb, offset2+8));
2730 proto_item_append_text(ti2, "Hint=%u, Factor=%u",
2731 tvb_get_ntohl(tvb, offset2+4),
2732 tvb_get_ntohl(tvb, offset2+8));
2736 proto_tree_add_text(rsvp_object_tree, tvb, offset2, param_len*4,
2737 "Unknown parameter %d, %d words",
2738 param_id, param_len);
2741 param_len_processed += param_len;
2742 offset2 += param_len*4;
2748 case 4: /* SONET/SDH Tspec */
2749 proto_item_set_text(ti, "SENDER TSPEC: SONET/SDH: ");
2751 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2752 "C-type: 4 - SONET/SDH");
2753 signal_type = tvb_get_guint8(tvb, offset2);
2754 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2755 "Signal Type: %d - %s", signal_type,
2756 val_to_str(signal_type,
2757 gmpls_sonet_signal_type_str, "Unknown"));
2758 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
2759 "Requested Concatenation (RCC): %d", tvb_get_guint8(tvb, offset2+1));
2760 tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE));
2761 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1, "%s",
2762 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x01, 8,
2763 "Standard contiguous concatenation",
2764 "No standard contiguous concatenation"));
2765 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1, "%s",
2766 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x02, 8,
2767 "Arbitrary contiguous concatenation",
2768 "No arbitrary contiguous concatenation"));
2769 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2770 "Number of Contiguous Components (NCC): %d", tvb_get_ntohs(tvb, offset2+2));
2771 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2,
2772 "Number of Virtual Components (NVC): %d", tvb_get_ntohs(tvb, offset2+4));
2773 proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2,
2774 "Multiplier (MT): %d", tvb_get_ntohs(tvb, offset2+6));
2775 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
2776 "Transparency (T): 0x%0x", tvb_get_ntohl(tvb, offset2+8));
2777 tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE));
2778 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s",
2779 decode_boolean_bitfield(tvb_get_ntohl(tvb, offset2+8), 0x0001, 32,
2780 "Section/Regenerator Section layer transparency",
2781 "No Section/Regenerator Section layer transparency"));
2782 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s",
2783 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0002, 32,
2784 "Line/Multiplex Section layer transparency",
2785 "No Line/Multiplex Section layer transparency"));
2786 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s",
2787 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0004, 32,
2789 "No J0 transparency"));
2790 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s",
2791 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0008, 32,
2792 "SOH/RSOH DCC transparency",
2793 "No SOH/RSOH DCC transparency"));
2794 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s",
2795 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0010, 32,
2796 "LOH/MSOH DCC transparency",
2797 "No LOH/MSOH DCC transparency"));
2798 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s",
2799 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0020, 32,
2800 "LOH/MSOH Extended DCC transparency",
2801 "No LOH/MSOH Extended DCC transparency"));
2802 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s",
2803 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0040, 32,
2804 "K1/K2 transparency",
2805 "No K1/K2 transparency"));
2806 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s",
2807 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0080, 32,
2809 "No E1 transparency"));
2810 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s",
2811 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0100, 32,
2813 "No F1 transparency"));
2814 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s",
2815 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0200, 32,
2817 "No E2 transparency"));
2818 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s",
2819 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0400, 32,
2821 "No B1 transparency"));
2822 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s",
2823 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0800, 32,
2825 "No B2 transparency"));
2826 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s",
2827 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x1000, 32,
2829 "No M0 transparency"));
2830 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4, "%s",
2831 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x2000, 32,
2833 "No M1 transparency"));
2834 proto_tree_add_text(rsvp_object_tree, tvb, offset2+12, 4,
2835 "Profile (P): %d", tvb_get_ntohl(tvb, offset2+12));
2837 proto_item_append_text(ti, "Signal [%s], RCC %d, NCC %d, NVC %d, MT %d, Transparency %d, Profile %d",
2838 val_to_str(signal_type, gmpls_sonet_signal_type_str, "Unknown"),
2839 tvb_get_guint8(tvb, offset2+1), tvb_get_ntohs(tvb, offset2+2),
2840 tvb_get_ntohs(tvb, offset2+4), tvb_get_ntohs(tvb, offset2+6),
2841 tvb_get_ntohl(tvb, offset2+8), tvb_get_ntohl(tvb, offset2+12));
2844 case 6: /* Ethernet TSPEC draft-ietf-ccamp-ethernet-traffic-parameters-02 */
2845 proto_item_set_text(ti, "SENDER TSPEC: Ethernet: ");
2846 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2847 "C-type: 6 - Ethernet");
2848 switch_gran = tvb_get_ntohs(tvb, offset2);
2849 if (switch_gran == 1)
2850 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2,
2851 "Switching granularity: 1 - Ethernet port");
2852 else if (switch_gran == 2)
2853 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2,
2854 "Switching granularity: 2 - Ethernet frame");
2856 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2,
2857 "Switching granularity: %u - ???", switch_gran);
2859 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2860 "MTU: %u", tvb_get_ntohs(tvb, offset2+2));
2862 dissect_rsvp_eth_tspec_tlv(ti, rsvp_object_tree, tvb, offset+8, obj_length-8,
2863 TREE(TT_TSPEC_SUBTREE));
2866 default: /* Unknown TSpec */
2867 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2868 "C-type: Unknown (%u)",
2870 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2871 "Data (%d bytes)", obj_length - 4);
2877 /*------------------------------------------------------------------------------
2879 *------------------------------------------------------------------------------*/
2881 dissect_rsvp_flowspec (proto_item *ti, proto_tree *rsvp_object_tree,
2883 int offset, int obj_length,
2884 int class _U_, int type)
2886 int offset2 = offset + 4;
2887 int mylen, signal_type;
2888 proto_tree *flowspec_tree, *ti2;
2890 guint16 switch_gran;
2892 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2893 "C-type: %u", type);
2894 mylen = obj_length - 4;
2900 item = proto_tree_add_text(rsvp_object_tree, tvb, 0, 0,
2901 "Object length %u < 8", obj_length);
2902 PROTO_ITEM_SET_GENERATED(item);
2905 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2906 "Message format version: %u",
2907 tvb_get_guint8(tvb, offset2)>>4);
2908 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2909 "Data length: %u words, not including header",
2910 tvb_get_ntohs(tvb, offset2+2));
2912 proto_item_set_text(ti, "FLOWSPEC: ");
2921 guint param_len_processed;
2924 item = proto_tree_add_text(rsvp_object_tree, tvb, 0, 0,
2925 "Object length %u not large enough",
2927 PROTO_ITEM_SET_GENERATED(item);
2930 service_num = tvb_get_guint8(tvb, offset2);
2931 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2932 "Service header: %u - %s",
2934 val_to_str(service_num, intsrv_services_str, "Unknown"));
2935 length = tvb_get_ntohs(tvb, offset2+2);
2936 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2937 "Length of service %u data: %u words, "
2938 "not including header",
2945 proto_item_append_text(ti, "%s: ",
2946 val_to_str(service_num, intsrv_services_str,
2949 /* Process all known service headers as a set of parameters */
2950 param_len_processed = 0;
2951 while (param_len_processed < length) {
2952 param_id = tvb_get_guint8(tvb, offset2);
2953 param_len = tvb_get_ntohs(tvb, offset2+2) + 1;
2955 THROW(ReportedBoundsError);
2959 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2960 offset2, param_len*4,
2962 flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE));
2964 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
2965 "Parameter %u - %s",
2967 val_to_str(param_id, svc_vals, "Unknown"));
2968 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
2969 "Parameter %u flags: 0x%02x",
2971 tvb_get_guint8(tvb, offset2+1));
2972 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
2973 "Parameter %u data length: %u words, "
2974 "not including header",
2976 tvb_get_ntohs(tvb, offset2+2));
2977 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
2978 "Token bucket rate: %.10g",
2979 tvb_get_ntohieee_float(tvb, offset2+4));
2980 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2981 "Token bucket size: %.10g",
2982 tvb_get_ntohieee_float(tvb, offset2+8));
2983 proto_tree_add_text(flowspec_tree, tvb, offset2+12, 4,
2984 "Peak data rate: %.10g",
2985 tvb_get_ntohieee_float(tvb, offset2+12));
2986 proto_tree_add_text(flowspec_tree, tvb, offset2+16, 4,
2987 "Minimum policed unit [m]: %u",
2988 tvb_get_ntohl(tvb, offset2+16));
2989 proto_tree_add_text(flowspec_tree, tvb, offset2+20, 4,
2990 "Maximum packet size [M]: %u",
2991 tvb_get_ntohl(tvb, offset2+20));
2992 proto_item_append_text(ti, "Token Bucket, %.10g bytes/sec. ",
2993 tvb_get_ntohieee_float(tvb, offset2+4));
2994 proto_item_append_text(ti2, "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u",
2995 tvb_get_ntohieee_float(tvb, offset2+4),
2996 tvb_get_ntohieee_float(tvb, offset2+8),
2997 tvb_get_ntohieee_float(tvb, offset2+12),
2998 tvb_get_ntohl(tvb, offset2+16),
2999 tvb_get_ntohl(tvb, offset2+20));
3003 /* Guaranteed-rate RSpec */
3004 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3005 offset2, param_len*4,
3006 "Guaranteed-Rate RSpec: ");
3007 flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE));
3008 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
3009 "Parameter %u - %s",
3011 val_to_str(param_id, svc_vals, "Unknown"));
3012 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
3013 "Parameter %u flags: %x",
3015 tvb_get_guint8(tvb, offset2+1));
3016 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
3017 "Parameter %u data length: %u words, "
3018 "not including header",
3020 tvb_get_ntohs(tvb, offset2+2));
3022 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
3024 tvb_get_ntohieee_float(tvb, offset2+4));
3025 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
3027 tvb_get_ntohl(tvb, offset2+8));
3028 proto_item_append_text(ti, "RSpec, %.10g bytes/sec. ",
3029 tvb_get_ntohieee_float(tvb, offset2+4));
3030 proto_item_append_text(ti2, "R=%.10g, s=%u",
3031 tvb_get_ntohieee_float(tvb, offset2+4),
3032 tvb_get_ntohl(tvb, offset2+8));
3036 /* Null Service (RFC2997) */
3037 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3038 offset2, param_len*4,
3039 "Null Service Flowspec: ");
3040 flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE));
3042 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
3043 "Parameter %u - %s",
3045 val_to_str(param_id, svc_vals, "Unknown"));
3046 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
3047 "Parameter %u flags: %x",
3049 tvb_get_guint8(tvb, offset2+1));
3050 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
3051 "Parameter %u data length: %u words, "
3052 "not including header",
3054 tvb_get_ntohs(tvb, offset2+2));
3055 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
3056 "Maximum packet size [M]: %u",
3057 tvb_get_ntohl(tvb, offset2+4));
3058 proto_item_append_text(ti, "Null Service. M=%u",
3059 tvb_get_ntohl(tvb, offset2+4));
3060 proto_item_append_text(ti2, "Max pkt size=%u",
3061 tvb_get_ntohl(tvb, offset2+4));
3065 proto_tree_add_text(rsvp_object_tree, tvb, offset2, param_len*4,
3066 "Unknown parameter %d, %d words",
3067 param_id, param_len);
3070 param_len_processed += param_len;
3071 offset2 += param_len * 4;
3074 /* offset2 += length*4; */
3080 proto_item_set_text(ti, "FLOWSPEC: SONET/SDH: ");
3082 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3083 "C-type: 4 - SONET/SDH");
3084 signal_type = tvb_get_guint8(tvb, offset2);
3085 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
3086 "Signal Type: %d - %s", signal_type,
3087 val_to_str(signal_type,
3088 gmpls_sonet_signal_type_str, "Unknown"));
3089 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
3090 "Requested Concatenation (RCC): %d", tvb_get_guint8(tvb, offset2+1));
3091 flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE));
3092 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1, "%s",
3093 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x01, 8,
3094 "Standard contiguous concatenation",
3095 "No standard contiguous concatenation"));
3096 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1, "%s",
3097 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x02, 8,
3098 "Arbitrary contiguous concatenation",
3099 "No arbitrary contiguous concatenation"));
3100 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
3101 "Number of Contiguous Components (NCC): %d", tvb_get_ntohs(tvb, offset2+2));
3102 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2,
3103 "Number of Virtual Components (NVC): %d", tvb_get_ntohs(tvb, offset2+4));
3104 proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2,
3105 "Multiplier (MT): %d", tvb_get_ntohs(tvb, offset2+6));
3106 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
3107 "Transparency (T): 0x%0x", tvb_get_ntohl(tvb, offset2+8));
3108 flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE));
3109 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s",
3110 decode_boolean_bitfield(tvb_get_ntohl(tvb, offset2+8), 0x0001, 32,
3111 "Section/Regenerator Section layer transparency",
3112 "No Section/Regenerator Section layer transparency"));
3113 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s",
3114 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0002, 32,
3115 "Line/Multiplex Section layer transparency",
3116 "No Line/Multiplex Section layer transparency"));
3117 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s",
3118 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0004, 32,
3120 "No J0 transparency"));
3121 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s",
3122 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0008, 32,
3123 "SOH/RSOH DCC transparency",
3124 "No SOH/RSOH DCC transparency"));
3125 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s",
3126 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0010, 32,
3127 "LOH/MSOH DCC transparency",
3128 "No LOH/MSOH DCC transparency"));
3129 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s",
3130 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0020, 32,
3131 "LOH/MSOH Extended DCC transparency",
3132 "No LOH/MSOH Extended DCC transparency"));
3133 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s",
3134 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0040, 32,
3135 "K1/K2 transparency",
3136 "No K1/K2 transparency"));
3137 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s",
3138 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0080, 32,
3140 "No E1 transparency"));
3141 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s",
3142 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0100, 32,
3144 "No F1 transparency"));
3145 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s",
3146 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0200, 32,
3148 "No E2 transparency"));
3149 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s",
3150 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0400, 32,
3152 "No B1 transparency"));
3153 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s",
3154 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0800, 32,
3156 "No B2 transparency"));
3157 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s",
3158 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x1000, 32,
3160 "No M0 transparency"));
3161 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4, "%s",
3162 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x2000, 32,
3164 "No M1 transparency"));
3165 proto_tree_add_text(rsvp_object_tree, tvb, offset2+12, 4,
3166 "Profile (P): %d", tvb_get_ntohl(tvb, offset2+12));
3168 proto_item_append_text(ti, "Signal [%s], RCC %d, NCC %d, NVC %d, MT %d, Transparency %d, Profile %d",
3169 val_to_str(signal_type, gmpls_sonet_signal_type_str, "Unknown"),
3170 tvb_get_guint8(tvb, offset2+1), tvb_get_ntohs(tvb, offset2+2),
3171 tvb_get_ntohs(tvb, offset2+4), tvb_get_ntohs(tvb, offset2+6),
3172 tvb_get_ntohl(tvb, offset2+8), tvb_get_ntohl(tvb, offset2+12));
3175 case 6: /* Ethernet FLOWSPEC draft-ietf-ccamp-ethernet-traffic-parameters-02 */
3176 proto_item_set_text(ti, "FLOWSPEC: Ethernet: ");
3177 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3178 "C-type: 6 - Ethernet");
3179 switch_gran = tvb_get_ntohs(tvb, offset2);
3180 if (switch_gran == 1)
3181 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2,
3182 "Switching granularity: 1 - Ethernet port");
3183 else if (switch_gran == 2)
3184 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2,
3185 "Switching granularity: 2 - Ethernet frame");
3187 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 2,
3188 "Switching granularity: %u - ???", switch_gran);
3190 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
3191 "MTU: %u", tvb_get_ntohs(tvb, offset2+2));
3193 dissect_rsvp_eth_tspec_tlv(ti, rsvp_object_tree, tvb, offset+8, obj_length-8,
3194 TREE(TT_FLOWSPEC_SUBTREE));
3204 /*------------------------------------------------------------------------------
3206 *------------------------------------------------------------------------------*/
3208 dissect_rsvp_adspec (proto_item *ti, proto_tree *rsvp_object_tree,
3210 int offset, int obj_length,
3211 int class _U_, int type)
3213 int offset2 = offset + 4;
3215 proto_tree *adspec_tree;
3217 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3218 "C-type: %u", type);
3219 mylen = obj_length - 4;
3221 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
3222 "Message format version: %u",
3223 tvb_get_guint8(tvb, offset2)>>4);
3224 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
3225 "Data length: %u words, not including header",
3226 tvb_get_ntohs(tvb, offset2+2));
3235 service_num = tvb_get_guint8(tvb, offset2);
3236 str = val_to_str(service_num, intsrv_services_str, "Unknown");
3237 break_bit = tvb_get_guint8(tvb, offset2+1);
3238 length = tvb_get_ntohs(tvb, offset2+2);
3239 ti = proto_tree_add_text(rsvp_object_tree, tvb, offset2,
3242 adspec_tree = proto_item_add_subtree(ti,
3243 TREE(TT_ADSPEC_SUBTREE));
3244 proto_tree_add_text(adspec_tree, tvb, offset2, 1,
3245 "Service header %u - %s",
3247 proto_tree_add_text(adspec_tree, tvb, offset2+1, 1,
3249 "Break bit set":"Break bit not set");
3250 proto_tree_add_text(adspec_tree, tvb, offset2+2, 2,
3251 "Data length: %u words, not including header",
3260 id = tvb_get_guint8(tvb, offset2);
3261 phdr_length = tvb_get_ntohs(tvb, offset2+2);
3262 str = match_strval(id, adspec_params);
3272 /* 32-bit unsigned integer */
3273 proto_tree_add_text(adspec_tree, tvb, offset2,
3275 "%s - %u (type %u, length %u)",
3277 tvb_get_ntohl(tvb, offset2+4),
3283 proto_tree_add_text(adspec_tree, tvb, offset2,
3285 "%s - %.10g (type %u, length %u)",
3287 tvb_get_ntohieee_float(tvb, offset2+4),
3291 proto_tree_add_text(adspec_tree, tvb, offset2,
3293 "%s (type %u, length %u)",
3298 proto_tree_add_text(adspec_tree, tvb, offset2,
3300 "Unknown (type %u, length %u)",
3303 offset2 += (phdr_length+1)<<2;
3304 i -= (phdr_length+1)<<2;
3305 mylen -= (phdr_length+1)<<2;
3310 /*------------------------------------------------------------------------------
3312 *------------------------------------------------------------------------------*/
3314 dissect_rsvp_integrity (proto_item *ti _U_, proto_tree *rsvp_object_tree,
3316 int offset, int obj_length,
3317 int class _U_, int type)
3319 int offset2 = offset + 4;
3320 proto_tree *ti2, *rsvp_integ_flags_tree;
3323 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3324 "C-type: %u", type);
3325 flags = tvb_get_guint8(tvb, offset2);
3326 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
3327 "Flags: 0x%02x", flags);
3328 rsvp_integ_flags_tree = proto_item_add_subtree(ti2, TREE(TT_INTEGRITY_FLAGS));
3329 proto_tree_add_text(rsvp_integ_flags_tree, tvb, offset2, 1, "%s",
3330 decode_boolean_bitfield(flags, 0x01, 8, "Handshake capable", "Handshake not capable"));
3331 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 6,
3332 "Key Identifier: %s", tvb_bytes_to_str(tvb, offset2+2, 6));
3333 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 8,
3334 "Sequence Number: %" G_GINT64_MODIFIER "u", tvb_get_ntoh64(tvb, offset2+8));
3335 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, obj_length - 20,
3336 "Hash: %s", tvb_bytes_to_str(tvb, offset2+16, obj_length - 20));
3339 /*------------------------------------------------------------------------------
3341 *------------------------------------------------------------------------------*/
3343 dissect_rsvp_policy (proto_item *ti _U_, proto_tree *rsvp_object_tree,
3345 int offset, int obj_length,
3346 int class _U_, int type)
3348 int offset2 = offset + 4;
3350 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3351 "C-type: %u", type);
3352 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3353 "Data (%d bytes)", obj_length - 4);
3356 /*------------------------------------------------------------------------------
3358 *------------------------------------------------------------------------------*/
3360 dissect_rsvp_label_request (proto_item *ti, proto_tree *rsvp_object_tree,
3362 int offset, int obj_length,
3363 int class _U_, int type)
3365 int offset2 = offset + 4;
3369 unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2);
3370 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3372 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
3373 "L3PID: %s (0x%04x)",
3374 val_to_str(l3pid, etype_vals, "Unknown"),
3376 proto_item_set_text(ti, "LABEL REQUEST: Basic: L3PID: %s (0x%04x)",
3377 val_to_str(l3pid, etype_vals, "Unknown"),
3383 unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2);
3384 unsigned short min_vpi, min_vci, max_vpi, max_vci;
3385 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3386 "C-type: 2 (Label Request with ATM label Range)");
3387 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
3388 "L3PID: %s (0x%04x)",
3389 val_to_str(l3pid, etype_vals, "Unknown"),
3391 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 1,
3392 "M: %s Merge in Data Plane",
3393 (tvb_get_guint8(tvb, offset2+4) & 0x80) ?
3394 "1: Can" : "0: Cannot");
3395 min_vpi = tvb_get_ntohs(tvb, offset2+4) & 0x7f;
3396 min_vci = tvb_get_ntohs(tvb, offset2+6);
3397 max_vpi = tvb_get_ntohs(tvb, offset2+8) & 0x7f;
3398 max_vci = tvb_get_ntohs(tvb, offset2+10);
3399 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2,
3400 "Min VPI: %d", min_vpi);
3401 proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2,
3402 "Min VCI: %d", min_vci);
3403 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 2,
3404 "Max VPI: %d", max_vpi);
3405 proto_tree_add_text(rsvp_object_tree, tvb, offset2+10, 2,
3406 "Max VCI: %d", max_vci);
3407 proto_item_set_text(ti, "LABEL REQUEST: ATM: L3PID: %s (0x%04x). VPI/VCI: Min: %d/%d, Max: %d/%d. %s Merge. ",
3408 val_to_str(l3pid, etype_vals, "Unknown"), l3pid,
3409 min_vpi, min_vci, max_vpi, max_vci,
3410 (tvb_get_guint8(tvb, offset2+4) & 0x80) ? "Can" : "Cannot");
3415 guint16 l3pid = tvb_get_ntohs(tvb, offset2+2);
3416 guint32 min_dlci, max_dlci, dlci_len, dlci_len_code;
3417 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3418 "C-type: 2 (Label Request with ATM label Range)");
3419 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
3420 "L3PID: %s (0x%04x)",
3421 val_to_str(l3pid, etype_vals, "Unknown"),
3423 dlci_len_code = (tvb_get_ntohs(tvb, offset2+4) & 0x0180) >> 7;
3424 min_dlci = tvb_get_ntohl(tvb, offset2+4) & 0x7fffff;
3425 max_dlci = tvb_get_ntohl(tvb, offset2+8) & 0x7fffff;
3426 switch(dlci_len_code) {
3439 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2,
3440 "DLCI Length: %s (%d)",
3441 dlci_len==10 ? "10 bits" :
3442 dlci_len==23 ? "23 bits" :
3443 "INVALID", dlci_len_code);
3444 proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 3,
3445 "Min DLCI: %d", min_dlci);
3446 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 2,
3447 "Max DLCI: %d", max_dlci);
3448 proto_item_set_text(ti, "LABEL REQUEST: Frame: L3PID: %s (0x%04x). DLCI Len: %s. Min DLCI: %d. Max DLCI: %d",
3449 val_to_str(l3pid, etype_vals, "Unknown"), l3pid,
3450 dlci_len==10 ? "10 bits" :
3451 dlci_len==23 ? "23 bits" :
3452 "INVALID", min_dlci, max_dlci);
3456 unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2);
3457 unsigned char lsp_enc = tvb_get_guint8(tvb,offset2);
3458 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3459 "C-type: 4 (Generalized Label Request)");
3460 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
3461 "LSP Encoding Type: %s",
3462 val_to_str(lsp_enc, gmpls_lsp_enc_str, "Unknown (%d)"));
3463 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
3464 "Switching Type: %s",
3465 val_to_str(tvb_get_guint8(tvb,offset2+1),
3466 gmpls_switching_type_str, "Unknown (%d)"));
3467 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
3468 "G-PID: %s (0x%0x)",
3469 val_to_str(l3pid, gmpls_gpid_str,
3470 val_to_str(l3pid, etype_vals,
3471 "Unknown G-PID(0x%04x)")),
3473 proto_item_set_text(ti, "LABEL REQUEST: Generalized: LSP Encoding=%s, "
3474 "Switching Type=%s, G-PID=%s ",
3475 val_to_str(lsp_enc, gmpls_lsp_enc_str, "Unknown (%d)"),
3476 val_to_str(tvb_get_guint8(tvb,offset2+1),
3477 gmpls_switching_type_str, "Unknown (%d)"),
3478 val_to_str(l3pid, gmpls_gpid_str,
3479 val_to_str(l3pid, etype_vals,
3480 "Unknown (0x%04x)")));
3485 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3486 "C-type: Unknown (%u)",
3488 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3489 "Data (%d bytes)", obj_length - 4);
3495 /*------------------------------------------------------------------------------
3497 *------------------------------------------------------------------------------*/
3499 dissect_rsvp_label (proto_tree *ti, proto_tree *rsvp_object_tree,
3501 int offset, int obj_length,
3502 int class, int type)
3504 int offset2 = offset + 4;
3508 name = (class==RSVP_CLASS_SUGGESTED_LABEL ? "SUGGESTED LABEL":
3509 (class==RSVP_CLASS_UPSTREAM_LABEL ? "UPSTREAM LABEL":
3510 (class==RSVP_CLASS_RECOVERY_LABEL ? "RECOVERY LABEL":
3512 mylen = obj_length - 4;
3515 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3516 "C-type: 1 (Packet Label)");
3517 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
3519 tvb_get_ntohl(tvb, offset2));
3520 proto_item_set_text(ti, "%s: %u", name,
3521 tvb_get_ntohl(tvb, offset2));
3525 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3526 "C-type: 2 (Generalized Label)");
3527 proto_item_set_text(ti, "%s: Generalized: ", name);
3528 for (i = 0; i < mylen; i += 4) {
3529 proto_tree_add_text(rsvp_object_tree, tvb, offset2+i, 4,
3530 "Generalized Label: %u (0x%x)",
3531 tvb_get_ntohl(tvb, offset2+i),
3532 tvb_get_ntohl(tvb, offset2+i));
3534 proto_item_append_text(ti, "0x%x%s",
3535 tvb_get_ntohl(tvb, offset2+i),
3537 } else if (i == 16) {
3538 proto_item_append_text(ti, "...");
3544 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3545 "C-type: Unknown (%u)",
3547 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
3548 "Data (%d bytes)", mylen);
3553 /*------------------------------------------------------------------------------
3555 *------------------------------------------------------------------------------*/
3557 dissect_rsvp_label_set (proto_item *ti, proto_tree *rsvp_object_tree,
3559 int offset, int obj_length,
3560 int class _U_, int type)
3562 int offset2 = offset + 8;
3566 static const value_string action_type_vals[] = {
3567 {0, "Inclusive list"},
3568 {1, "Exclusive list"},
3569 {2, "Inclusive range"},
3570 {3, "Exclusive range"},
3574 len = obj_length - 8;
3575 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, "C-type: %u", type);
3576 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1, "Action: %s",
3577 val_to_str(tvb_get_guint8(tvb, offset+4),
3578 action_type_vals, "Unknown (%u)"));
3579 proto_item_append_text(ti, ": %s",
3580 val_to_str(tvb_get_guint8(tvb, offset+4),
3581 action_type_vals, "Unknown (%u)"));
3582 label_type = tvb_get_guint8 (tvb, offset+7);
3583 proto_tree_add_text(rsvp_object_tree, tvb, offset+7, 1, "Label type: %s",
3584 label_type==1 ? "Packet Label" : "Generalized Label");
3585 proto_item_append_text(ti, ", %s",
3586 label_type==1 ? "Packet Label: " : "Generalized Label: ");
3588 for (i = 0; i < len/4; i++) {
3589 proto_tree_add_text(rsvp_object_tree, tvb, offset2+i*4, 4,
3590 "Subchannel %u: %u (0x%x)", i+1,
3591 tvb_get_ntohl(tvb, offset2+i*4),
3592 tvb_get_ntohl(tvb, offset2+i*4));
3596 proto_item_append_text(ti, ", ");
3598 proto_item_append_text(ti, "%u",
3599 tvb_get_ntohl(tvb, offset2+i*4));
3604 /*------------------------------------------------------------------------------
3606 *------------------------------------------------------------------------------*/
3608 dissect_rsvp_session_attribute (proto_item *ti, proto_tree *rsvp_object_tree,
3610 int offset, int obj_length,
3611 int class _U_, int type)
3613 int offset2 = offset + 4;
3616 proto_tree *ti2, *rsvp_sa_flags_tree;
3622 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3623 "C-type: %u - IPv4 LSP (%sResource Affinities)",
3624 type, (type == 1) ? "" : "No ");
3627 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
3628 "Exclude-Any: 0x%0x", tvb_get_ntohl(tvb, offset2));
3629 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
3630 "Include-Any: 0x%0x", tvb_get_ntohl(tvb, offset2+4));
3631 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
3632 "Include-All: 0x%0x", tvb_get_ntohl(tvb, offset2+8));
3633 offset2 = offset2+12;
3636 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
3637 "Setup priority: %u",
3638 tvb_get_guint8(tvb, offset2));
3639 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
3640 "Hold priority: %u",
3641 tvb_get_guint8(tvb, offset2+1));
3642 flags = tvb_get_guint8(tvb, offset2+2);
3643 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 1,
3644 "Flags: 0x%02x", flags);
3645 rsvp_sa_flags_tree = proto_item_add_subtree(ti2,
3646 TREE(TT_SESSION_ATTRIBUTE_FLAGS));
3647 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1, "%s",
3648 decode_boolean_bitfield(flags, 0x01, 8,
3649 "Local protection desired",
3650 "Local protection not desired"));
3651 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1, "%s",
3652 decode_boolean_bitfield(flags, 0x02, 8,
3653 "Label recording desired",
3654 "Label recording not desired"));
3655 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1, "%s",
3656 decode_boolean_bitfield(flags, 0x04, 8,
3658 "SE style not desired"));
3659 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1, "%s",
3660 decode_boolean_bitfield(flags, 0x08, 8,
3661 "Bandwidth protection desired",
3662 "Bandwidth protection not desired"));
3663 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1, "%s",
3664 decode_boolean_bitfield(flags, 0x10, 8,
3665 "Node protection desired",
3666 "Node protection not desired"));
3668 name_len = tvb_get_guint8(tvb, offset2+3);
3669 proto_tree_add_text(rsvp_object_tree, tvb, offset2+3, 1,
3670 "Name length: %u", name_len);
3671 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, name_len,
3673 tvb_format_text(tvb, offset2+4, name_len));
3675 proto_item_set_text(ti, "SESSION ATTRIBUTE: SetupPrio %d, HoldPrio %d, %s%s%s%s%s [%s]",
3676 tvb_get_guint8(tvb, offset2),
3677 tvb_get_guint8(tvb, offset2+1),
3678 flags &0x01 ? "Local Protection, " : "",
3679 flags &0x02 ? "Label Recording, " : "",
3680 flags &0x04 ? "SE Style, " : "",
3681 flags &0x08 ? "Bandwidth Protection, " : "",
3682 flags &0x10 ? "Node Protection, " : "",
3683 name_len ? tvb_format_text(tvb, offset2+4, name_len) : "");
3687 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3688 "C-type: Unknown (%u)",
3690 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3691 "Data (%d bytes)", obj_length - 4);
3696 /*------------------------------------------------------------------------------
3697 * EXPLICIT ROUTE AND RECORD ROUTE SUBOBJECTS
3698 *------------------------------------------------------------------------------*/
3700 dissect_rsvp_ero_rro_subobjects (proto_tree *ti, proto_tree *rsvp_object_tree,
3702 int offset, int obj_length, int class)
3704 int i, j, k, l, flags;
3705 proto_tree *ti2, *rsvp_ro_subtree, *rsvp_rro_flags_subtree;
3709 case RSVP_CLASS_EXPLICIT_ROUTE:
3710 tree_type = TREE(TT_EXPLICIT_ROUTE_SUBOBJ);
3712 case RSVP_CLASS_RECORD_ROUTE:
3713 tree_type = TREE(TT_RECORD_ROUTE_SUBOBJ);
3720 for (i=1, l = 0; l < obj_length - 4; i++) {
3721 j = tvb_get_guint8(tvb, offset+l) & 0x7f;
3724 k = tvb_get_guint8(tvb, offset+l) & 0x80;
3725 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3727 "IPv4 Subobject - %s%s",
3728 ip_to_str(tvb_get_ptr(tvb, offset+l+2, 4)),
3729 class == RSVP_CLASS_EXPLICIT_ROUTE ?
3730 (k ? ", Loose" : ", Strict") : "");
3732 proto_item_add_subtree(ti2, tree_type);
3733 if (class == RSVP_CLASS_EXPLICIT_ROUTE)
3734 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3735 k ? "Loose Hop " : "Strict Hop");
3736 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3738 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
3740 tvb_get_guint8(tvb, offset+l+1));
3741 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 4,
3743 ip_to_str(tvb_get_ptr(tvb, offset+l+2, 4)));
3744 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+6, 1,
3745 "Prefix length: %u",
3746 tvb_get_guint8(tvb, offset+l+6));
3748 proto_item_append_text(ti, "IPv4 %s%s",
3749 ip_to_str(tvb_get_ptr(tvb, offset+l+2, 4)),
3752 if (class == RSVP_CLASS_RECORD_ROUTE) {
3753 flags = tvb_get_guint8(tvb, offset+l+7);
3755 proto_item_append_text(ti, " (Node-id)");
3756 proto_item_append_text(ti2, " (Node-id)");
3758 if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available");
3759 if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use");
3760 if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail");
3761 if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop");
3762 ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+7, 1,
3763 "Flags: 0x%02x", flags);
3764 rsvp_rro_flags_subtree =
3765 proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS));
3766 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1, "%s",
3767 decode_boolean_bitfield(flags, 0x01, 8,
3768 "Local Protection Available",
3769 "Local Protection Not Available"));
3770 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1, "%s",
3771 decode_boolean_bitfield(flags, 0x02, 8,
3772 "Local Protection In Use",
3773 "Local Protection Not In Use"));
3774 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1, "%s",
3775 decode_boolean_bitfield(flags, 0x04, 8,
3776 "Bandwidth Protection Available",
3777 "Bandwidth Protection Not Available"));
3778 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1, "%s",
3779 decode_boolean_bitfield(flags, 0x08, 8,
3780 "Node Protection Available",
3781 "Node Protection Not Available"));
3782 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1, "%s",
3783 decode_boolean_bitfield(flags, 0x10, 8,
3784 "Address Specifies a Node-id Address",
3785 "Address Doesn't Specify a Node-id Address"));
3791 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3795 proto_item_add_subtree(ti2, tree_type);
3796 k = tvb_get_guint8(tvb, offset+l) & 0x80;
3797 if (class == RSVP_CLASS_EXPLICIT_ROUTE)
3798 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3799 k ? "Loose Hop " : "Strict Hop");
3800 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3802 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
3804 tvb_get_guint8(tvb, offset+l+1));
3805 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 16,
3807 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset+l+2, 16)));
3808 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+18, 1,
3809 "Prefix length: %u",
3810 tvb_get_guint8(tvb, offset+l+18));
3812 proto_item_append_text(ti, "IPv6 [...]%s", k ? " [L]":"");
3814 if (class == RSVP_CLASS_RECORD_ROUTE) {
3815 flags = tvb_get_guint8(tvb, offset+l+19);
3817 proto_item_append_text(ti, " (Node-id)");
3818 proto_item_append_text(ti2, " (Node-id)");
3820 if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available");
3821 if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use");
3822 if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail");
3823 if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop");
3824 ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+19, 1,
3825 "Flags: 0x%02x", flags);
3826 rsvp_rro_flags_subtree =
3827 proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS));
3828 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1, "%s",
3829 decode_boolean_bitfield(flags, 0x01, 8,
3830 "Local Protection Available",
3831 "Local Protection Not Available"));
3832 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1, "%s",
3833 decode_boolean_bitfield(flags, 0x02, 8,
3834 "Local Protection In Use",
3835 "Local Protection Not In Use"));
3836 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1, "%s",
3837 decode_boolean_bitfield(flags, 0x04, 8,
3838 "Backup Tunnel Has Bandwidth",
3839 "Backup Tunnel Does Not Have Bandwidth"));
3840 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1, "%s",
3841 decode_boolean_bitfield(flags, 0x08, 8,
3842 "Backup Tunnel Goes To Next-Next-Hop",
3843 "Backup Tunnel Goes To Next-Hop"));
3844 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1, "%s",
3845 decode_boolean_bitfield(flags, 0x10, 8,
3846 "Address Specifies a Node-id Address",
3847 "Address Doesn't Specify a Node-id Address"));
3853 k = tvb_get_guint8(tvb, offset+l) & 0x80;
3854 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3856 "Label Subobject - %d, %s",
3857 tvb_get_ntohl(tvb, offset+l+4),
3858 class == RSVP_CLASS_EXPLICIT_ROUTE ?
3859 (k ? "Loose" : "Strict") : "");
3861 proto_item_add_subtree(ti2, tree_type);
3862 if (class == RSVP_CLASS_EXPLICIT_ROUTE)
3863 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3864 k ? "Loose Hop " : "Strict Hop");
3865 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3867 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
3869 tvb_get_guint8(tvb, offset+l+1));
3870 if (class == RSVP_CLASS_RECORD_ROUTE) {
3871 flags = tvb_get_guint8(tvb, offset+l+2);
3872 if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available");
3873 if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use");
3874 if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail");
3875 if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop");
3876 ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 1,
3877 "Flags: 0x%02x", flags);
3878 rsvp_rro_flags_subtree =
3879 proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS));
3880 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s",
3881 decode_boolean_bitfield(flags, 0x01, 8,
3882 "Local Protection Available",
3883 "Local Protection Not Available"));
3884 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s",
3885 decode_boolean_bitfield(flags, 0x02, 8,
3886 "Local Protection In Use",
3887 "Local Protection Not In Use"));
3888 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s",
3889 decode_boolean_bitfield(flags, 0x04, 8,
3890 "Backup Tunnel Has Bandwidth",
3891 "Backup Tunnel Does Not Have Bandwidth"));
3892 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s",
3893 decode_boolean_bitfield(flags, 0x08, 8,
3894 "Backup Tunnel Goes To Next-Next-Hop",
3895 "Backup Tunnel Goes To Next-Hop"));
3897 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+3, 1,
3899 tvb_get_guint8(tvb, offset+l+3));
3900 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+4, 4,
3902 tvb_get_ntohl(tvb, offset+l+4));
3904 proto_item_append_text(ti, "Label %d%s",
3905 tvb_get_ntohl(tvb, offset+l+4),
3910 case 4: /* Unnumbered Interface-ID */
3911 k = tvb_get_guint8(tvb, offset+l) & 0x80;
3912 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3914 "Unnumbered Interface-ID - %s, %d, %s",
3915 ip_to_str(tvb_get_ptr(tvb, offset+l+4, 4)),
3916 tvb_get_ntohl(tvb, offset+l+8),
3917 class == RSVP_CLASS_EXPLICIT_ROUTE ?
3918 (k ? "Loose" : "Strict") : "");
3920 proto_item_add_subtree(ti2, tree_type);
3921 if (class == RSVP_CLASS_EXPLICIT_ROUTE)
3922 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3923 k ? "Loose Hop " : "Strict Hop");
3924 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3925 "Type: 4 (Unnumbered Interface-ID)");
3926 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
3928 tvb_get_guint8(tvb, offset+l+1));
3929 if (class == RSVP_CLASS_RECORD_ROUTE) {
3930 flags = tvb_get_guint8(tvb, offset+l+2);
3931 if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available");
3932 if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use");
3933 if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail");
3934 if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop");
3935 ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 1,
3936 "Flags: 0x%02x", flags);
3937 rsvp_rro_flags_subtree =
3938 proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS));
3939 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s",
3940 decode_boolean_bitfield(flags, 0x01, 8,
3941 "Local Protection Available",
3942 "Local Protection Not Available"));
3943 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s",
3944 decode_boolean_bitfield(flags, 0x02, 8,
3945 "Local Protection In Use",
3946 "Local Protection Not In Use"));
3947 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s",
3948 decode_boolean_bitfield(flags, 0x04, 8,
3949 "Backup Tunnel Has Bandwidth",
3950 "Backup Tunnel Does Not Have Bandwidth"));
3951 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1, "%s",
3952 decode_boolean_bitfield(flags, 0x08, 8,
3953 "Backup Tunnel Goes To Next-Next-Hop",
3954 "Backup Tunnel Goes To Next-Hop"));
3956 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+4, 4,
3958 ip_to_str(tvb_get_ptr(tvb, offset+l+4, 4)));
3959 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+8, 4,
3961 tvb_get_ntohl(tvb, offset+l+8));
3963 proto_item_append_text(ti, "Unnum %s/%d%s",
3964 ip_to_str(tvb_get_ptr(tvb, offset+l+4, 4)),
3965 tvb_get_ntohl(tvb, offset+l+8),
3972 if (class == RSVP_CLASS_RECORD_ROUTE) goto defaultsub;
3973 k = tvb_get_ntohs(tvb, offset+l+2);
3974 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3976 "Autonomous System %u",
3979 proto_item_add_subtree(ti2, tree_type);
3980 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3981 "Type: 32 (Autonomous System Number)");
3982 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
3984 tvb_get_guint8(tvb, offset+l+1));
3985 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 2,
3986 "Autonomous System %u", k);
3988 proto_item_append_text(ti, "AS %d",
3989 tvb_get_ntohs(tvb, offset+l+2));
3994 default: /* Unknown subobject */
3996 k = tvb_get_guint8(tvb, offset+l) & 0x80;
3997 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3999 tvb_get_guint8(tvb, offset+l+1),
4000 "Unknown subobject: %d", j);
4002 proto_item_add_subtree(ti2, tree_type);
4003 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
4004 k ? "Loose Hop " : "Strict Hop");
4005 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
4006 "Type: %u (Unknown)", j);
4007 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
4009 tvb_get_guint8(tvb, offset+l+1));
4013 if (tvb_get_guint8(tvb, offset+l+1) < 1) {
4014 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
4015 "Invalid length: %u", tvb_get_guint8(tvb, offset+l+1));
4018 l += tvb_get_guint8(tvb, offset+l+1);
4019 if (l < obj_length - 4) {
4021 proto_item_append_text(ti, ", ");
4023 proto_item_append_text(ti, "...");
4028 /*------------------------------------------------------------------------------
4029 * EXPLICIT ROUTE OBJECT
4030 *------------------------------------------------------------------------------*/
4032 dissect_rsvp_explicit_route (proto_item *ti, proto_tree *rsvp_object_tree,
4034 int offset, int obj_length,
4035 int class, int type)
4037 /* int offset2 = offset + 4; */
4038 /* int mylen, i, j, k, l; */
4039 /* proto_tree *ti2, *rsvp_ero_subtree; */
4041 /* mylen = obj_length - 4; */
4044 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4046 proto_item_set_text(ti, "EXPLICIT ROUTE: ");
4048 dissect_rsvp_ero_rro_subobjects(ti, rsvp_object_tree, tvb,
4049 offset + 4, obj_length, class);
4053 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4054 "C-type: Unknown (%u)",
4056 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4,
4057 "Data (%d bytes)", obj_length - 4);
4062 /*------------------------------------------------------------------------------
4063 * RECORD ROUTE OBJECT
4064 *------------------------------------------------------------------------------*/
4066 dissect_rsvp_record_route (proto_item *ti, proto_tree *rsvp_object_tree,
4068 int offset, int obj_length,
4069 int class, int type)
4071 /* int offset2 = offset + 4; */
4072 /* int mylen, i, j, l; */
4073 /* proto_tree *ti2, *rsvp_rro_subtree; */
4075 proto_item_set_text(ti, "RECORD ROUTE: ");
4076 /* mylen = obj_length - 4; */
4079 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4082 dissect_rsvp_ero_rro_subobjects(ti, rsvp_object_tree, tvb,
4083 offset + 4, obj_length, class);
4087 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4088 "C-type: Unknown (%u)",
4090 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4,
4091 "Data (%d bytes)", obj_length - 4);
4096 /*------------------------------------------------------------------------------
4098 *------------------------------------------------------------------------------*/
4100 dissect_rsvp_message_id (proto_tree *ti, proto_tree *rsvp_object_tree,
4102 int offset, int obj_length,
4103 int class _U_, int type)
4105 int offset2 = offset + 4;
4109 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4111 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
4112 "Flags: %d", tvb_get_guint8(tvb, offset+4));
4113 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
4114 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
4115 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4116 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
4117 proto_item_set_text(ti, "MESSAGE-ID: %d %s",
4118 tvb_get_ntohl(tvb, offset+8),
4119 tvb_get_guint8(tvb, offset+4) & 1 ? "(Ack Desired)" : "");
4123 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4124 "C-type: Unknown (%u)",
4126 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
4127 "Data (%d bytes)", obj_length - 4);
4132 /*------------------------------------------------------------------------------
4134 *------------------------------------------------------------------------------*/
4136 dissect_rsvp_message_id_ack (proto_tree *ti, proto_tree *rsvp_object_tree,
4138 int offset, int obj_length,
4139 int class _U_, int type)
4141 int offset2 = offset + 4;
4145 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4147 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
4148 "Flags: %d", tvb_get_guint8(tvb, offset+4));
4149 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
4150 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
4151 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4152 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
4153 proto_item_set_text(ti, "MESSAGE-ID ACK: %d", tvb_get_ntohl(tvb, offset+8));
4157 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4159 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
4160 "Flags: %d", tvb_get_guint8(tvb, offset+4));
4161 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
4162 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
4163 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4164 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
4165 proto_item_set_text(ti, "MESSAGE-ID NACK: %d", tvb_get_ntohl(tvb, offset+8));
4169 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4170 "C-type: Unknown (%u)",
4172 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
4173 "Data (%d bytes)", obj_length - 4);
4178 /*------------------------------------------------------------------------------
4180 *------------------------------------------------------------------------------*/
4182 dissect_rsvp_message_id_list (proto_tree *ti, proto_tree *rsvp_object_tree,
4184 int offset, int obj_length,
4185 int class _U_, int type)
4187 int offset2 = offset + 4;
4192 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4194 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
4195 "Flags: %d", tvb_get_guint8(tvb, offset+4));
4196 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
4197 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
4198 for (mylen = 8; mylen < obj_length; mylen += 4)
4199 proto_tree_add_text(rsvp_object_tree, tvb, offset+mylen, 4,
4200 "Message-ID: %d", tvb_get_ntohl(tvb, offset+mylen));
4201 proto_item_set_text(ti, "MESSAGE-ID LIST: %d IDs",
4202 (obj_length - 8)/4);
4206 mylen = obj_length - 4;
4207 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4208 "C-type: Unknown (%u)",
4210 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
4211 "Data (%d bytes)", obj_length - 4);
4216 /*------------------------------------------------------------------------------
4218 *------------------------------------------------------------------------------*/
4220 dissect_rsvp_hello (proto_tree *ti, proto_tree *rsvp_object_tree,
4222 int offset, int obj_length _U_,
4223 int class _U_, int type)
4228 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4229 "C-Type: %d - HELLO %s object",
4230 tvb_get_guint8 (tvb, offset+3),
4231 type==1 ? "REQUEST" : "ACK");
4232 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4,
4233 "Source Instance: 0x%x",tvb_get_ntohl(tvb, offset+4));
4234 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4235 "Destination Instance: 0x%x",tvb_get_ntohl(tvb, offset+8));
4236 proto_item_append_text(ti, ": %s. Src Instance: 0x%0x. Dest Instance: 0x%0x. ",
4237 type==1 ? "REQUEST" : "ACK",
4238 tvb_get_ntohl(tvb, offset+4),
4239 tvb_get_ntohl(tvb, offset+8));
4242 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4243 "C-Type: %d - UNKNOWN", type);
4248 /*------------------------------------------------------------------------------
4250 *------------------------------------------------------------------------------*/
4252 dissect_rsvp_dclass (proto_tree *ti, proto_tree *rsvp_object_tree,
4254 int offset, int obj_length,
4255 int class _U_, int type)
4257 int offset2 = offset + 4;
4260 proto_item_set_text(ti, "DCLASS: ");
4263 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4265 for (mylen = 4; mylen < obj_length; mylen += 4) {
4266 proto_tree_add_text(rsvp_object_tree, tvb, offset+mylen+3, 1,
4268 val_to_str(tvb_get_guint8(tvb, offset+mylen+3),
4269 dscp_vals, "Unknown (%d)"));
4270 proto_item_append_text(ti, "%d%s",
4271 tvb_get_guint8(tvb, offset+mylen+3)>>2,
4272 mylen==obj_length-4 ? "":
4274 mylen==16 ? ", ..." : "");
4279 mylen = obj_length - 4;
4280 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4281 "C-type: Unknown (%u)",
4283 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
4284 "Data (%d bytes)", mylen);
4289 /*------------------------------------------------------------------------------
4290 * ADMINISTRATIVE STATUS
4291 *------------------------------------------------------------------------------*/
4293 dissect_rsvp_admin_status (proto_tree *ti, proto_tree *rsvp_object_tree,
4295 int offset, int obj_length,
4296 int class _U_, int type)
4298 int offset2 = offset + 4;
4299 proto_tree *ti2, *rsvp_admin_subtree;
4303 proto_item_set_text(ti, "ADMIN STATUS: ");
4306 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4308 status = tvb_get_ntohl(tvb, offset2);
4309 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
4310 "Admin Status: 0x%08x", status);
4311 rsvp_admin_subtree =
4312 proto_item_add_subtree(ti2, TREE(TT_ADMIN_STATUS_FLAGS));
4313 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 4, "%s",
4314 decode_boolean_bitfield(status, 0x80000000, 32,
4316 "R: Do not reflect"));
4317 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 4, "%s",
4318 decode_boolean_bitfield(status, 0x04, 32,
4321 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 4, "%s",
4322 decode_boolean_bitfield(status, 0x02, 32,
4323 "A: Administratively Down",
4325 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 4, "%s",
4326 decode_boolean_bitfield(status, 0x01, 32,
4327 "D: Delete In Progress",
4329 proto_item_set_text(ti, "ADMIN-STATUS: %s %s %s %s",
4330 (status & (1<<31)) ? "Reflect" : "",
4331 (status & (1<<2)) ? "Testing" : "",
4332 (status & (1<<1)) ? "Admin-Down" : "",
4333 (status & (1<<0)) ? "Deleting" : "");
4337 mylen = obj_length - 4;
4338 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4339 "C-type: Unknown (%u)",
4341 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
4342 "Data (%d bytes)", obj_length - 4);
4347 /*------------------------------------------------------------------------------
4349 *------------------------------------------------------------------------------*/
4351 dissect_rsvp_association (proto_tree *ti, proto_tree *rsvp_object_tree,
4353 int offset, int obj_length,
4354 int class _U_, int type)
4356 guint16 association_type;
4357 guint16 association_id;
4358 static const value_string association_type_vals[] = {
4364 proto_item_set_text(ti, "ASSOCIATION ");
4365 association_type = tvb_get_ntohs (tvb, offset + 4);
4366 association_id = tvb_get_ntohs (tvb, offset + 6);
4369 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4370 "C-type: 1 (IPv4)");
4371 proto_item_append_text(ti, "(IPv4): ");
4372 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 2,
4373 "Association type: %s",
4374 val_to_str(association_type, association_type_vals, "Unknown (%u)"));
4375 proto_item_append_text(ti, "%s. ",
4376 val_to_str(association_type, association_type_vals, "Unknown (%u)"));
4377 proto_tree_add_text(rsvp_object_tree, tvb, offset+6, 2,
4378 "Association ID: %u", association_id);
4379 proto_item_append_text(ti, "ID: %u. ", association_id);
4380 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4381 "Association source: %s", ip_to_str(tvb_get_ptr(tvb, offset+8, 4)));
4382 proto_item_append_text(ti, "Src: %s", ip_to_str(tvb_get_ptr(tvb, offset+8, 4)));
4386 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4387 "C-type: 2 (IPv6)");
4388 proto_item_append_text(ti, "(IPv6): ");
4389 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 2,
4390 "Association type: %s",
4391 val_to_str(association_type, association_type_vals, "Unknown (%u)"));
4392 proto_item_append_text(ti, "%s. ",
4393 val_to_str(association_type, association_type_vals, "Unknown (%u)"));
4394 proto_tree_add_text(rsvp_object_tree, tvb, offset+6, 2,
4395 "Association ID: %u", association_id);
4396 proto_item_append_text(ti, "ID: %u. ", association_id);
4397 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 16,
4398 "Association source: %s", ip6_to_str((const struct e_in6_addr *)
4399 tvb_get_ptr(tvb, offset+8, 16)));
4400 proto_item_append_text(ti, "Src: %s", ip6_to_str((const struct e_in6_addr *)
4401 tvb_get_ptr(tvb, offset+8, 16)));
4405 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4406 "C-type: Unknown (%u)", type);
4407 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4,
4408 "Data (%d bytes)", obj_length - 4);
4413 /*------------------------------------------------------------------------------
4414 * TLVs for LSP TUNNEL IF ID object
4415 * draft-ietf-ccamp-lsp-hierarchy-bis-02
4416 *------------------------------------------------------------------------------*/
4418 dissect_rsvp_lsp_tunnel_if_id_tlv(proto_tree *rsvp_object_tree,
4419 tvbuff_t *tvb, int offset, int tlv_length,
4425 proto_tree *ti, *rsvp_lsp_tunnel_if_id_subtree;
4427 for (tlv_off = 0; tlv_off < tlv_length; ) {
4428 tlv_type = tvb_get_ntohs(tvb, offset+tlv_off);
4429 tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2);
4431 if (tlv_len == 0 || tlv_off+tlv_len > tlv_length) {
4432 proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off+2, 2,
4438 ti = proto_tree_add_text(rsvp_object_tree, tvb,
4439 offset+tlv_off, tlv_len,
4440 "Unnumbered component link identifier: %u",
4441 tvb_get_ntohl(tvb, offset+tlv_off+4));
4442 rsvp_lsp_tunnel_if_id_subtree = proto_item_add_subtree(ti, subtree_type);
4443 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off, 2,
4444 "Type: 1 (Unnumbered component link identifier)");
4445 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+2, 2,
4446 "Length: %u", tlv_len);
4447 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+4, 4,
4448 "Component link identifier: %u",
4449 tvb_get_ntohl(tvb, offset+tlv_off+4));
4453 ti = proto_tree_add_text(rsvp_object_tree, tvb,
4454 offset+tlv_off, tlv_len,
4455 "IPv4 component link identifier: %s",
4456 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)));
4457 rsvp_lsp_tunnel_if_id_subtree = proto_item_add_subtree(ti, subtree_type);
4458 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off, 2,
4459 "Type: 2 (IPv4 component link identifier)");
4460 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+2, 2,
4461 "Length: %u", tlv_len);
4462 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+4, 4,
4463 "Component link identifier: %s",
4464 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)));
4467 case 32769: /* oif-p0040.002.09 demo spec */
4468 ti = proto_tree_add_text(rsvp_object_tree, tvb,
4469 offset+tlv_off, tlv_len,
4470 "Targeted client layer: ");
4471 rsvp_lsp_tunnel_if_id_subtree = proto_item_add_subtree(ti, subtree_type);
4472 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off, 2,
4473 "Type: 32769 (Targeted client layer)");
4474 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+2, 2,
4475 "Length: %u", tlv_len);
4476 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+4, 1,
4477 "LSP Encoding Type: %s",
4478 val_to_str(tvb_get_guint8(tvb,offset+tlv_off+4),
4479 gmpls_lsp_enc_str, "Unknown (%d)"));
4480 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+5, 1,
4481 "Switching Type: %s",
4482 val_to_str(tvb_get_guint8(tvb,offset+tlv_off+5),
4483 gmpls_switching_type_str, "Unknown (%d)"));
4484 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+6, 1,
4486 val_to_str(tvb_get_guint8(tvb,offset+tlv_off+6),
4487 gmpls_sonet_signal_type_str, "Unknown (%d)"));
4488 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+8, 8,
4489 "Sub Interface/Connection ID: %" G_GINT64_MODIFIER "u (0x%s)",
4490 tvb_get_ntoh64(tvb, offset+tlv_off+8),
4491 tvb_bytes_to_str(tvb, offset+tlv_off+8, 8));
4492 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+16, 4,
4494 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+16, 4)));
4495 proto_tree_add_text(rsvp_lsp_tunnel_if_id_subtree, tvb, offset+tlv_off+20, 4,
4496 "SC PC SCN Address: %s",
4497 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+20, 4)));
4498 proto_item_append_text(ti, "LSP Encoding=%s, Switching Type=%s, Signal Type=%s",
4499 val_to_str(tvb_get_guint8(tvb,offset+tlv_off+4),
4500 gmpls_lsp_enc_str, "Unknown (%d)"),
4501 val_to_str(tvb_get_guint8(tvb,offset+tlv_off+5),
4502 gmpls_switching_type_str, "Unknown (%d)"),
4503 val_to_str(tvb_get_guint8(tvb,offset+tlv_off+6),
4504 gmpls_sonet_signal_type_str, "Unknown (%d)"));
4508 proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off, 2,
4509 "Unknown TLV: %u", tlv_type);
4515 /*------------------------------------------------------------------------------
4516 * LSP TUNNEL INTERFACE ID
4517 *------------------------------------------------------------------------------*/
4519 dissect_rsvp_lsp_tunnel_if_id (proto_tree *ti, proto_tree *rsvp_object_tree,
4521 int offset, int obj_length,
4522 int class _U_, int type)
4526 static const value_string lsp_tunnel_if_id_action_str[] = {
4527 {0, "LSP is FA (MPLS-TE topology advertisement only)"},
4528 {1, "LSP is RA (IP network advertisement only)"},
4529 {2, "LSP is RA (both IP and MPLS-TE topology advertisement)"},
4530 {3, "LSP is to be used as a virtual local link"},
4534 proto_item_set_text(ti, "LSP INTERFACE-ID: ");
4537 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4538 "C-type: 1 - Unnumbered interface");
4539 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4,
4541 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)));
4542 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4543 "Interface ID: %u", tvb_get_ntohl(tvb, offset+8));
4544 proto_item_set_text(ti, "LSP INTERFACE-ID: Unnumbered, Router-ID %s, Interface-ID %d",
4545 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
4546 tvb_get_ntohl(tvb, offset+8));
4550 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4551 "C-type: 2 - IPv4");
4552 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4,
4553 "IPv4 interface address: %s",
4554 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)));
4555 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4556 "Target IGP instance: %s",
4557 ip_to_str(tvb_get_ptr(tvb, offset+8, 4)));
4558 proto_item_set_text(ti, "LSP INTERFACE-ID: IPv4, interface address %s,"
4560 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
4561 ip_to_str(tvb_get_ptr(tvb, offset+8, 4)));
4562 action = tvb_get_guint8(tvb, offset+12);
4564 proto_tree_add_text(rsvp_object_tree, tvb, offset+12, 1, "Action: %d - %s",
4566 val_to_str(action, lsp_tunnel_if_id_action_str, "Unknown"));
4567 dissect_rsvp_lsp_tunnel_if_id_tlv(rsvp_object_tree, tvb, offset+16, obj_length-16,
4568 TREE(TT_LSP_TUNNEL_IF_ID_SUBTREE));
4572 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4573 "C-type: 3 - IPv6");
4574 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 16,
4575 "IPv6 interface address: %s",
4576 ip6_to_str((const struct e_in6_addr *)
4577 tvb_get_ptr(tvb, offset+4, 16)));
4578 proto_tree_add_text(rsvp_object_tree, tvb, offset+20, 4,
4579 "Target IGP instance: %s",
4580 ip_to_str(tvb_get_ptr(tvb, offset+20, 4)));
4581 proto_item_set_text(ti, "LSP INTERFACE-ID: IPv6, interface address %s,"
4583 ip6_to_str((const struct e_in6_addr *)
4584 tvb_get_ptr(tvb, offset+4, 16)),
4585 ip_to_str(tvb_get_ptr(tvb, offset+20, 4)));
4586 action = tvb_get_guint8(tvb, offset+24);
4588 proto_tree_add_text(rsvp_object_tree, tvb, offset+24, 1, "Action: %d - %s",
4590 val_to_str(action, lsp_tunnel_if_id_action_str, "Unknown"));
4591 dissect_rsvp_lsp_tunnel_if_id_tlv(rsvp_object_tree, tvb, offset+28, obj_length-28,
4592 TREE(TT_LSP_TUNNEL_IF_ID_SUBTREE));
4596 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4597 "C-type: 4 - Unnumbered interface with target");
4598 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4,
4600 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)));
4601 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4602 "Interface ID: %u", tvb_get_ntohl(tvb, offset+8));
4603 proto_tree_add_text(rsvp_object_tree, tvb, offset+12, 4,
4604 "Target IGP instance: %s",
4605 ip_to_str(tvb_get_ptr(tvb, offset+12, 4)));
4606 proto_item_set_text(ti, "LSP INTERFACE-ID: Unnumbered with target, Router-ID %s,"
4607 " Interface-ID %d, IGP instance %s",
4608 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
4609 tvb_get_ntohl(tvb, offset+8),
4610 ip_to_str(tvb_get_ptr(tvb, offset+12, 4)));
4611 action = tvb_get_guint8(tvb, offset+16);
4613 proto_tree_add_text(rsvp_object_tree, tvb, offset+16, 1, "Action: %d - %s",
4615 val_to_str(action, lsp_tunnel_if_id_action_str, "Unknown"));
4616 dissect_rsvp_lsp_tunnel_if_id_tlv(rsvp_object_tree, tvb, offset+20, obj_length-20,
4617 TREE(TT_LSP_TUNNEL_IF_ID_SUBTREE));
4621 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4622 "C-type: Unknown (%u)",
4624 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length-4,
4625 "Data (%d bytes)", obj_length-4);
4630 /*------------------------------------------------------------------------------
4632 *------------------------------------------------------------------------------*/
4634 dissect_rsvp_notify_request (proto_item *ti, proto_tree *rsvp_object_tree,
4636 int offset, int obj_length,
4637 int class _U_, int type)
4639 int offset2 = offset + 4;
4643 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4644 "C-type: 1 - IPv4");
4645 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
4646 "Notify node address: %s",
4647 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
4648 proto_item_append_text(ti, ": Notify node: %s",
4649 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
4654 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4655 "C-type: 2 - IPv6");
4656 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
4657 "Notify node address: %s",
4658 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
4659 proto_item_append_text(ti, ": Notify node: %s",
4660 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
4665 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4666 "C-type: Unknown (%u)",
4668 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
4669 "Data (%d bytes)", obj_length - 4);
4673 /*------------------------------------------------------------------------------
4675 *------------------------------------------------------------------------------*/
4677 dissect_rsvp_gen_uni (proto_tree *ti, proto_tree *rsvp_object_tree,
4679 int offset, int obj_length,
4680 int class _U_, int type,
4681 rsvp_conversation_info *rsvph)
4683 int offset2 = offset + 4;
4684 int mylen, i, j, k, l, m;
4686 proto_tree *rsvp_gen_uni_subtree, *rsvp_session_subtree, *rsvp_template_subtree;
4687 int s_len, s_class, s_type;
4690 proto_item_set_text(ti, "GENERALIZED UNI: ");
4692 mylen = obj_length - 4;
4696 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4698 for (i=1, l = 0; l < mylen; i++) {
4699 j = tvb_get_guint8(tvb, offset2+l+2);
4702 case 2: /* We do source and destination TNA together */
4703 c = (j==1) ? "Source" : "Destination";
4704 k = tvb_get_guint8(tvb, offset2+l+3);
4707 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4709 "%s IPv4 TNA: %s", c,
4710 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)));
4711 rsvp_gen_uni_subtree =
4712 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4713 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
4714 "Class: %d (%s)", j, c);
4715 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
4717 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
4719 tvb_get_ntohs(tvb, offset2+l));
4721 proto_tree_add_item(rsvp_gen_uni_subtree, rsvp_filter[RSVPF_GUNI_SRC_IPV4],
4722 tvb, offset2+l+4, 4, FALSE);
4724 proto_tree_add_item(rsvp_gen_uni_subtree, rsvp_filter[RSVPF_GUNI_DST_IPV4],
4725 tvb, offset2+l+4, 4, FALSE);
4727 proto_item_append_text(ti, "%s IPv4 TNA: %s", c,
4728 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)));
4733 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4736 rsvp_gen_uni_subtree =
4737 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4738 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
4739 "Class: %d (%s)", j, c);
4740 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
4742 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
4744 tvb_get_ntohs(tvb, offset2+l));
4746 proto_tree_add_item(rsvp_gen_uni_subtree, rsvp_filter[RSVPF_GUNI_SRC_IPV6],
4747 tvb, offset2+l+4, 16, FALSE);
4749 proto_tree_add_item(rsvp_gen_uni_subtree, rsvp_filter[RSVPF_GUNI_DST_IPV6],
4750 tvb, offset2+l+4, 16, FALSE);
4752 proto_item_append_text(ti, "%s IPv6 %s", c,
4753 ip6_to_str((const struct e_in6_addr *)
4754 tvb_get_ptr(tvb, offset2+l+4, 16)));
4759 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4760 offset2+l, tvb_get_ntohs(tvb, offset2+l),
4762 rsvp_gen_uni_subtree =
4763 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4764 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
4765 "Class: %d (%s)", j, c);
4766 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
4768 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
4770 tvb_get_ntohs(tvb, offset2+l));
4771 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4,
4772 tvb_get_ntohs(tvb, offset2+l)-4,
4775 proto_item_append_text(ti, "%s NSAP", c);
4780 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4781 offset2+l, tvb_get_ntohs(tvb, offset2+l),
4782 "%s UNKNOWN TNA", c);
4783 rsvp_gen_uni_subtree =
4784 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4785 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
4786 "Class: %d (%s)", j, c);
4787 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
4788 "Type: %d (UNKNOWN)", j);
4789 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
4791 tvb_get_ntohs(tvb, offset2+l));
4792 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4,
4793 tvb_get_ntohs(tvb, offset2+l)-4,
4796 proto_item_append_text(ti, "%s UNKNOWN", c);
4802 case 3: /* Diversity subobject */
4803 k = tvb_get_guint8(tvb, offset2+l+3);
4807 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4808 offset2+l, tvb_get_ntohs(tvb, offset2+l),
4809 "Diversity Subobject");
4810 rsvp_gen_uni_subtree =
4811 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4812 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
4813 "Class: %d (Diversity)", j);
4814 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
4815 "Type: %d", tvb_get_guint8(tvb, offset2+l+3));
4816 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
4818 tvb_get_ntohs(tvb, offset2+l));
4819 m = tvb_get_guint8(tvb, offset2+l+4) >> 4;
4820 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1,
4821 "Diversity: %d - %s", m,
4822 val_to_str(m, ouni_guni_diversity_str, "Unknown"));
4823 s_len = tvb_get_ntohs(tvb, offset2+l+8);
4824 s_class = tvb_get_guint8(tvb, offset2+l+10);
4825 s_type = tvb_get_guint8(tvb, offset2+l+11);
4826 ti2 = proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+8,
4828 rsvp_session_subtree =
4829 proto_item_add_subtree(ti2, TREE(rsvp_class_to_tree_type(s_class)));
4831 proto_tree_add_text(rsvp_object_tree, tvb, offset2+l+8, 2,
4832 "Length: %u (bogus, must be >= 4)", s_len);
4835 proto_tree_add_text(rsvp_session_subtree, tvb, offset2+l+8, 2,
4836 "Length: %u", s_len);
4837 proto_tree_add_uint(rsvp_session_subtree, rsvp_filter[RSVPF_OBJECT], tvb,
4838 offset2+8+l+10, 1, s_class);
4839 dissect_rsvp_session(ti2, rsvp_session_subtree, tvb, offset2+l+8,
4840 s_len, s_class, s_type, rsvph);
4841 offset3 = offset2 + s_len;
4842 s_len = tvb_get_ntohs(tvb, offset3+l+8);
4843 s_class = tvb_get_guint8(tvb, offset3+l+10);
4844 s_type = tvb_get_guint8(tvb, offset3+l+11);
4845 ti2 = proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset3+l+8,
4847 rsvp_template_subtree =
4848 proto_item_add_subtree(ti2, TREE(rsvp_class_to_tree_type(s_class)));
4850 proto_tree_add_text(rsvp_object_tree, tvb, offset3+l+8, 2,
4851 "Length: %u (bogus, must be >= 4)", s_len);
4854 proto_tree_add_text(rsvp_template_subtree, tvb, offset3+l+8, 2,
4855 "Length: %u", s_len);
4856 proto_tree_add_uint(rsvp_template_subtree, rsvp_filter[RSVPF_OBJECT], tvb,
4857 offset3+8+l+10, 1, s_class);
4858 dissect_rsvp_template_filter(ti2, rsvp_template_subtree, tvb, offset3+l+8,
4859 s_len, s_class, s_type, rsvph);
4862 proto_item_append_text(ti, "Diversity");
4869 case 4: /* Egress Label */
4870 k = tvb_get_guint8(tvb, offset2+l+3);
4871 if (k == 1) /* Egress label sub-type */
4872 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4873 offset2+l, tvb_get_ntohs(tvb, offset2+l),
4874 "Egress Label Subobject");
4875 else if (k == 2) /* SPC_label sub-type (see G.7713.2) */
4876 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4877 offset2+l, tvb_get_ntohs(tvb, offset2+l),
4878 "SPC Label Subobject");
4880 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4881 offset2+l, tvb_get_ntohs(tvb, offset2+l),
4882 "Unknown Label Subobject");
4883 rsvp_gen_uni_subtree = proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4884 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
4885 "Class: %d (Egress/SPC Label)", j);
4886 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
4888 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
4890 tvb_get_ntohs(tvb, offset2+l));
4891 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1,
4893 decode_boolean_bitfield(
4894 tvb_get_guint8(tvb, offset2+l+4), 0x80, 8,
4895 "U: 1 - Upstream label/port ID",
4896 "U: 0 - Downstream label/port ID"));
4897 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+7, 1,
4898 "Label type: %u", tvb_get_guint8(tvb, offset2+l+7));
4899 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+8, 4,
4900 "Logical Port ID: %u", tvb_get_ntohl(tvb, offset2+l+8));
4901 proto_item_append_text(ti2, ": %s, Label type %d, Port ID %d, Label ",
4902 tvb_get_guint8(tvb, offset2+l+4) & 0x80 ?
4903 "Upstream" : "Downstream",
4904 tvb_get_guint8(tvb, offset2+l+7),
4905 tvb_get_ntohl(tvb, offset2+l+8));
4906 for (j=12; j < tvb_get_ntohs(tvb, offset2+l); j+=4) {
4907 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+j, 4,
4908 "Label: %u", tvb_get_ntohl(tvb, offset2+l+j));
4909 proto_item_append_text(ti2, "%u ", tvb_get_ntohl(tvb, offset2+l+j));
4913 proto_item_append_text(ti, "Egress Label");
4915 proto_item_append_text(ti, "SPC Label");
4919 case 5: /* Service Level */
4920 k = tvb_get_guint8(tvb, offset2+l+3);
4924 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4925 offset2+l, tvb_get_ntohs(tvb, offset2+l),
4926 "Service Level Subobject");
4927 rsvp_gen_uni_subtree =
4928 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4929 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
4930 "Class: %d (Egress Label)", j);
4931 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
4932 "Type: %d", tvb_get_guint8(tvb, offset2+l+3));
4933 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
4935 tvb_get_ntohs(tvb, offset2+l));
4936 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1,
4937 "Service Level: %u", tvb_get_guint8(tvb, offset2+l+4));
4938 proto_item_append_text(ti2, ": %u", tvb_get_guint8(tvb, offset2+l+4));
4940 proto_item_append_text(ti, "Service Level %d", tvb_get_guint8(tvb, offset2+l+4));
4946 default: /* Unknown subobject */
4947 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4949 tvb_get_ntohs(tvb, offset2+l),
4950 "Unknown subobject: %u",
4952 rsvp_gen_uni_subtree =
4953 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4954 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 1,
4955 "Type: %u (Unknown)", j);
4956 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+1, 1,
4958 tvb_get_guint8(tvb, offset2+l+1));
4962 if (tvb_get_guint8(tvb, offset2+l+1) < 1) {
4963 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+1, 1,
4964 "Invalid length: %u", tvb_get_guint8(tvb, offset2+l+1));
4967 l += tvb_get_guint8(tvb, offset2+l+1);
4970 proto_item_append_text(ti, ", ");
4972 proto_item_append_text(ti, "...");
4979 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4980 "C-type: Unknown (%u)",
4982 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
4983 "Data (%d bytes)", mylen);
4988 /*------------------------------------------------------------------------------
4990 *------------------------------------------------------------------------------*/
4992 dissect_rsvp_call_id (proto_tree *ti, proto_tree *rsvp_object_tree,
4994 int offset, int obj_length,
4995 int class _U_, int c_type)
4999 int offset2 = offset + 4;
5000 int offset3, offset4, len;
5002 static const value_string address_type_vals[] = {
5007 {0x7f, "0x7f (Vendor-defined)"},
5011 proto_item_set_text(ti, "CALL-ID: ");
5012 type = tvb_get_guint8 (tvb, offset2);
5015 proto_item_append_text(ti,"Empty");
5016 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5017 "C-type: Empty (%u)", type);
5018 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length-4,
5019 "Data (%d bytes)", obj_length-4);
5024 offset3 = offset2 + 4;
5025 len = obj_length - 16;
5026 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5027 "C-type: 1 (operator specific)");
5028 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, "Address type: %s",
5029 val_to_str(type, address_type_vals, "Unknown (%u)"));
5030 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 3, "Reserved: %u",
5031 tvb_get_ntoh24(tvb, offset2+1));
5032 proto_item_append_text(ti, "Operator-Specific. Addr Type: %s. ",
5033 val_to_str(type, address_type_vals, "Unknown (%u)"));
5036 offset3 = offset2 + 16;
5037 len = obj_length - 28;
5038 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5039 "C-type: 2 (globally unique)");
5040 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, "Address type: %s",
5041 val_to_str(type, address_type_vals, "Unknown (%u)"));
5042 str = tvb_get_ephemeral_string (tvb, offset2 + 1, 3);
5043 proto_tree_add_text(rsvp_object_tree, tvb, offset2 + 1, 3,
5044 "International Segment: %s", str);
5045 proto_item_append_text(ti, "Globally-Unique. Addr Type: %s. Intl Segment: %s. ",
5046 val_to_str(type, address_type_vals, "Unknown (%u)"), str);
5047 str = tvb_get_ephemeral_string (tvb, offset2 + 4, 12);
5048 proto_tree_add_text(rsvp_object_tree, tvb, offset2 + 4, 12,
5049 "National Segment: %s", str);
5050 proto_item_append_text(ti, "Natl Segment: %s. ", str);
5055 offset4 = offset3 + 4;
5056 proto_tree_add_item(rsvp_object_tree, rsvp_filter[RSVPF_CALL_ID_SRC_ADDR_IPV4],
5057 tvb, offset3, 4, FALSE);
5058 proto_item_append_text(ti, "Src: %s. ", ip_to_str(tvb_get_ptr(tvb, offset3, 4)));
5062 offset4 = offset3 + 16;
5063 proto_tree_add_item(rsvp_object_tree, rsvp_filter[RSVPF_CALL_ID_SRC_ADDR_IPV6],
5064 tvb, offset3, 16, FALSE);
5065 proto_item_append_text(ti, "Src: %s. ",
5066 ip6_to_str((const struct e_in6_addr *) tvb_get_ptr(tvb, offset3, 16)));
5070 offset4 = offset3 + 20;
5071 proto_tree_add_text(rsvp_object_tree, tvb, offset3, 20, "Source Transport Network addr: %s",
5072 tvb_bytes_to_str(tvb, offset3, 20));
5073 proto_item_append_text(ti, "Src: %s. ", tvb_bytes_to_str(tvb, offset3, 20));
5077 offset4 = offset3 + 6;
5078 proto_tree_add_text(rsvp_object_tree, tvb, offset3, 6, "Source Transport Network addr: %s",
5079 tvb_bytes_to_str(tvb, offset3, 6));
5080 proto_item_append_text(ti, "Src: %s. ", tvb_bytes_to_str(tvb, offset3, 6));
5084 offset4 = offset3 + len;
5085 proto_tree_add_text(rsvp_object_tree, tvb, offset3, len, "Source Transport Network addr: %s",
5086 tvb_bytes_to_str(tvb, offset3, len));
5087 proto_item_append_text(ti, "Src: %s. ", tvb_bytes_to_str(tvb, offset3, len));
5091 offset4 = offset3 + len;
5092 proto_tree_add_text(rsvp_object_tree, tvb, offset3, len, "Unknown Transport Network type: %d",
5096 proto_tree_add_text(rsvp_object_tree, tvb, offset4, 8, "Local Identifier: %s",
5097 tvb_bytes_to_str(tvb, offset4, 8));
5098 proto_item_append_text(ti, "Local ID: %s. ", tvb_bytes_to_str(tvb, offset4, 8));
5102 proto_item_append_text(ti, " Unknown");
5103 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5104 "C-type: Unknown (%u)", type);
5105 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
5106 "Data (%d bytes)", obj_length - 4);
5111 /*------------------------------------------------------------------------------
5112 * RESTART CAPABILITY
5113 *------------------------------------------------------------------------------*/
5115 dissect_rsvp_restart_cap (proto_tree *ti, proto_tree *rsvp_object_tree,
5117 int offset, int obj_length,
5118 int class _U_, int type)
5120 int offset2 = offset + 4;
5122 proto_item_set_text(ti, "RESTART CAPABILITY: ");
5125 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5127 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
5128 "Restart Time: %d ms",
5129 tvb_get_ntohl(tvb, offset2));
5130 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
5131 "Recovery Time: %d ms",
5132 tvb_get_ntohl(tvb, offset2+4));
5133 proto_item_append_text(ti, "Restart Time: %d ms. Recovery Time: %d ms.",
5134 tvb_get_ntohl(tvb, offset2), tvb_get_ntohl(tvb, offset2+4));
5138 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5139 "C-type: Unknown (%u)",
5141 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
5142 "Data (%d bytes)", obj_length - 4);
5147 /*------------------------------------------------------------------------------
5148 * PROTECTION INFORMATION
5149 *------------------------------------------------------------------------------*/
5151 dissect_rsvp_protection_info (proto_tree *ti, proto_tree *rsvp_object_tree,
5153 int offset, int obj_length,
5154 int class _U_, int type)
5157 proto_tree *ti2, *rsvp_pi_flags_tree;
5158 int offset2 = offset + 4;
5160 proto_item_set_text(ti, "PROTECTION_INFO: ");
5163 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5164 "C-type: 1 - Protection");
5165 flag = tvb_get_guint8(tvb, offset2);
5166 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
5167 "Secondary LSP: %s",
5168 decode_boolean_bitfield(flag, 0x80, 8, "Yes", "No"));
5170 flags = tvb_get_guint8(tvb, offset2+3);
5171 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+3, 1,
5172 "Link Flags: 0x%02x", flags);
5173 rsvp_pi_flags_tree = proto_item_add_subtree(ti2,
5174 TREE(TT_PROTECTION_INFO));
5175 proto_tree_add_text(rsvp_pi_flags_tree, tvb, offset2+3, 1, "%s",
5176 decode_boolean_bitfield(flags, 0x01, 8,
5177 "Extra Traffic desired",
5178 "Extra Traffic not desired"));
5179 proto_tree_add_text(rsvp_pi_flags_tree, tvb, offset2+3, 1, "%s",
5180 decode_boolean_bitfield(flags, 0x02, 8,
5181 "Unprotected desired",
5182 "Unprotected not desired"));
5183 proto_tree_add_text(rsvp_pi_flags_tree, tvb, offset2+3, 1, "%s",
5184 decode_boolean_bitfield(flags, 0x04, 8,
5186 "Shared not desired"));
5187 proto_tree_add_text(rsvp_pi_flags_tree, tvb, offset2+3, 1, "%s",
5188 decode_boolean_bitfield(flags, 0x08, 8,
5189 "Dedicated 1:1 desired",
5190 "Dedicated 1:1 not desired"));
5191 proto_tree_add_text(rsvp_pi_flags_tree, tvb, offset2+3, 1, "%s",
5192 decode_boolean_bitfield(flags, 0x10, 8,
5193 "Dedicated 1+1 desired",
5194 "Dedicated 1+1 not desired"));
5195 proto_tree_add_text(rsvp_pi_flags_tree, tvb, offset2+3, 1, "%s",
5196 decode_boolean_bitfield(flags, 0x20, 8,
5198 "Enhanced not desired"));
5199 proto_item_append_text(ti, "%s%s%s%s%s%s%s.",
5200 flag &0x80 ? "SecondaryLSP " : "",
5201 flags &0x01 ? "ExtraTraffic " : "",
5202 flags &0x02 ? "Unprotected " : "",
5203 flags &0x04 ? "Shared " : "",
5204 flags &0x08 ? "Dedicated1:1 " : "",
5205 flags &0x10 ? "Dedicated1+1 " : "",
5206 flags &0x20 ? "Enhanced " : "");
5210 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5211 "C-type: Unknown (%u)",
5213 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
5214 "Data (%d bytes)", obj_length - 4);
5219 /*------------------------------------------------------------------------------
5221 *------------------------------------------------------------------------------*/
5223 dissect_rsvp_fast_reroute (proto_tree *ti, proto_tree *rsvp_object_tree,
5225 int offset, int obj_length,
5226 int class _U_, int type)
5229 proto_tree *ti2, *rsvp_frr_flags_tree;
5231 proto_item_set_text(ti, "FAST_REROUTE: ");
5235 if ((type==1 && obj_length!=24) || (type==7 && obj_length!=20)) {
5236 proto_tree_add_text(rsvp_object_tree, tvb, offset, obj_length,
5237 "<<<Invalid length: cannot decode>>>");
5238 proto_item_append_text(ti, "Invalid length");
5241 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5242 "C-type: %u", type);
5243 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
5244 "Setup Priority: %d", tvb_get_guint8(tvb, offset+4));
5245 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 1,
5246 "Hold Priority: %d", tvb_get_guint8(tvb, offset+5));
5247 proto_tree_add_text(rsvp_object_tree, tvb, offset+6, 1,
5248 "Hop Limit: %d", tvb_get_guint8(tvb, offset+6));
5250 flags = tvb_get_guint8(tvb, offset+7);
5251 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset+7, 1,
5252 "Flags: 0x%02x", flags);
5253 rsvp_frr_flags_tree = proto_item_add_subtree(ti2,
5254 TREE(TT_FAST_REROUTE_FLAGS));
5255 proto_tree_add_text(rsvp_frr_flags_tree, tvb, offset+7, 1, "%s",
5256 decode_boolean_bitfield(flags, 0x01, 8,
5257 "One-to-One Backup desired",
5258 "One-to-One Backup not desired"));
5259 proto_tree_add_text(rsvp_frr_flags_tree, tvb, offset+7, 1, "%s",
5260 decode_boolean_bitfield(flags, 0x02, 8,
5261 "Facility Backup desired",
5262 "Facility Backup not desired"));
5263 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
5264 "Bandwidth: %.10g", tvb_get_ntohieee_float(tvb, offset+8));
5265 proto_tree_add_text(rsvp_object_tree, tvb, offset+12, 4,
5266 "Include-Any: 0x%0x", tvb_get_ntohl(tvb, offset+12));
5267 proto_tree_add_text(rsvp_object_tree, tvb, offset+16, 4,
5268 "Exclude-Any: 0x%0x", tvb_get_ntohl(tvb, offset+16));
5270 proto_tree_add_text(rsvp_object_tree, tvb, offset+20, 4,
5271 "Include-All: 0x%0x", tvb_get_ntohl(tvb, offset+20));
5274 proto_item_append_text(ti, "%s%s",
5275 flags &0x01 ? "One-to-One Backup, " : "",
5276 flags &0x02 ? "Facility Backup" : "");
5280 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5281 "C-type: Unknown (%u)",
5283 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4,
5284 "Data (%d bytes)", obj_length - 4);
5289 /*------------------------------------------------------------------------------
5291 *------------------------------------------------------------------------------*/
5293 dissect_rsvp_detour (proto_tree *ti, proto_tree *rsvp_object_tree,
5295 int offset, int obj_length,
5296 int class _U_, int type)
5298 int remaining_length, count;
5301 proto_item_set_text(ti, "DETOUR: ");
5305 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5306 "C-type: %u", type);
5307 for (remaining_length = obj_length - 4, count = 1;
5308 remaining_length > 0; remaining_length -= 8, count++) {
5309 if (remaining_length < 8) {
5310 proto_tree_add_text(rsvp_object_tree, tvb, offset+remaining_length,
5311 obj_length-remaining_length,
5312 "<<<Invalid length: cannot decode>>>");
5313 proto_item_append_text(ti, "Invalid length");
5317 proto_tree_add_text(rsvp_object_tree, tvb, offset+(4*iter), 4,
5318 "PLR ID %d: %s", count,
5319 ip_to_str(tvb_get_ptr(tvb, offset+(4*iter), 4)));
5321 proto_tree_add_text(rsvp_object_tree, tvb, offset+(4*iter), 4,
5322 "Avoid Node ID %d: %s", count,
5323 ip_to_str(tvb_get_ptr(tvb, offset+(4*iter), 4)));
5328 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5329 "C-type: Unknown (%u)",
5331 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4,
5332 "Data (%d bytes)", obj_length - 4);
5337 /*------------------------------------------------------------------------------
5339 *------------------------------------------------------------------------------*/
5341 dissect_rsvp_diffserv (proto_tree *ti, proto_tree *rsvp_object_tree,
5343 int offset, int obj_length,
5344 int class _U_, int type)
5347 int *hfindexes[] = {
5348 &rsvp_filter[RSVPF_DIFFSERV_MAP],
5349 &rsvp_filter[RSVPF_DIFFSERV_MAP_EXP],
5350 &rsvp_filter[RSVPF_DIFFSERV_PHBID],
5351 &rsvp_filter[RSVPF_DIFFSERV_PHBID_DSCP],
5352 &rsvp_filter[RSVPF_DIFFSERV_PHBID_CODE],
5353 &rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT14],
5354 &rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT15]
5357 &TREE(TT_DIFFSERV_MAP),
5358 &TREE(TT_DIFFSERV_MAP_PHBID)
5361 proto_item_set_text(ti, "DIFFSERV: ");
5365 proto_tree_add_text(rsvp_object_tree, tvb, offset, 1,
5366 "C-type: 1 - E-LSP");
5367 proto_tree_add_uint(rsvp_object_tree, rsvp_filter[RSVPF_DIFFSERV_MAPNB],
5369 mapnb = tvb_get_guint8(tvb, offset + 4) & 15);
5370 proto_item_append_text(ti, "E-LSP, %u MAP%s", mapnb,
5371 (mapnb == 0) ? "" : "s");
5374 for (count = 0; count < mapnb; count++) {
5375 dissect_diffserv_mpls_common(tvb, rsvp_object_tree, type,
5376 offset, hfindexes, etts);
5381 proto_item_append_text(ti, "L-LSP");
5382 proto_tree_add_text(rsvp_object_tree, tvb, offset, 1,
5383 "C-type: 2 - L-LSP");
5384 dissect_diffserv_mpls_common(tvb, rsvp_object_tree, type,
5385 offset + 3, hfindexes, etts);
5388 proto_tree_add_text(rsvp_object_tree, tvb, offset, 1,
5389 "C-type: Unknown (%u)", type);
5390 proto_tree_add_text(rsvp_object_tree, tvb, offset + 1, obj_length - 4,
5391 "Data (%d bytes)", obj_length - 4);
5395 /*------------------------------------------------------------------------------
5397 *------------------------------------------------------------------------------*/
5399 dissect_rsvp_diffserv_aware_te(proto_tree *ti, proto_tree *rsvp_object_tree,
5401 int offset, int obj_length,
5402 int class _U_, int type)
5404 proto_item *hidden_item;
5405 int offset2 = offset + 4;
5408 hidden_item = proto_tree_add_item(rsvp_object_tree,
5409 rsvp_filter[RSVPF_DSTE],
5410 tvb, offset, 8, FALSE);
5411 PROTO_ITEM_SET_HIDDEN(hidden_item);
5415 ct = tvb_get_guint8(tvb, offset2+3);
5416 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, "C-type: 1");
5417 proto_tree_add_item(rsvp_object_tree,
5418 rsvp_filter[RSVPF_DSTE_CLASSTYPE],
5419 tvb, offset2+3, 1, FALSE);
5420 proto_item_set_text(ti, "CLASSTYPE: CT %u", ct);
5423 proto_item_set_text(ti, "CLASSTYPE: (Unknown C-type)");
5424 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
5425 "C-type: Unknown (%u)", type);
5426 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
5427 "Data (%d bytes)", obj_length - 4);
5432 /*------------------------------------------------------------------------------
5433 * Dissect a single RSVP message in a tree
5434 *------------------------------------------------------------------------------*/
5436 dissect_rsvp_msg_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
5437 int tree_mode, rsvp_conversation_info *rsvph)
5439 proto_tree *rsvp_tree = NULL;
5440 proto_tree *rsvp_header_tree;
5441 proto_tree *rsvp_object_tree;
5443 proto_item *hidden_item;
5444 guint16 cksum, computed_cksum;
5449 guint8 message_type;
5450 int session_off, tempfilt_off;
5457 ver_flags = tvb_get_guint8(tvb, 0);
5458 msg_length = tvb_get_ntohs(tvb, 6);
5459 message_type = tvb_get_guint8(tvb, 1);
5461 ti = proto_tree_add_item(tree, proto_rsvp, tvb, offset, msg_length,
5463 rsvp_tree = proto_item_add_subtree(ti, tree_mode);
5464 if (pinfo->ipproto == IP_PROTO_RSVPE2EI)
5465 proto_item_append_text(rsvp_tree, " (E2E-IGNORE)");
5466 proto_item_append_text(rsvp_tree, ": ");
5467 proto_item_append_text(rsvp_tree, "%s", val_to_str(message_type, message_type_vals,
5469 find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off);
5471 proto_item_append_text(rsvp_tree, "%s", summary_session(tvb, session_off));
5473 proto_item_append_text(rsvp_tree, "%s", summary_template(tvb, tempfilt_off));
5475 ti = proto_tree_add_text(rsvp_tree, tvb, offset, 8, "RSVP Header. %s",
5476 val_to_str(message_type, message_type_vals,
5477 "Unknown Message (%u). "));
5478 if (pinfo->ipproto == IP_PROTO_RSVPE2EI)
5479 proto_item_append_text(ti, " (E2E-IGNORE)");
5480 rsvp_header_tree = proto_item_add_subtree(ti, TREE(TT_HDR));
5482 proto_tree_add_text(rsvp_header_tree, tvb, offset, 1, "RSVP Version: %u",
5483 (ver_flags & 0xf0)>>4);
5484 proto_tree_add_text(rsvp_header_tree, tvb, offset, 1, "Flags: %02x",
5486 proto_tree_add_uint(rsvp_header_tree, rsvp_filter[RSVPF_MSG], tvb,
5487 offset+1, 1, message_type);
5488 switch (RSVPF_MSG + message_type) {
5494 case RSVPF_PATHTEAR:
5495 case RSVPF_RESVTEAR:
5496 case RSVPF_RCONFIRM:
5497 case RSVPF_RTEARCONFIRM:
5500 case RSVPF_SREFRESH:
5503 hidden_item = proto_tree_add_boolean(rsvp_header_tree, rsvp_filter[RSVPF_MSG + message_type], tvb,
5505 PROTO_ITEM_SET_HIDDEN(hidden_item);
5509 proto_tree_add_protocol_format(rsvp_header_tree, proto_malformed, tvb, offset+1, 1,
5510 "Invalid message type: %u", message_type);
5514 cksum = tvb_get_ntohs(tvb, offset+2);
5515 if (!pinfo->fragmented && (int) tvb_length(tvb) >= msg_length) {
5516 /* The packet isn't part of a fragmented datagram and isn't
5517 truncated, so we can checksum it. */
5518 cksum_vec[0].ptr = tvb_get_ptr(tvb, 0, msg_length);
5519 cksum_vec[0].len = msg_length;
5520 computed_cksum = in_cksum(&cksum_vec[0], 1);
5521 if (computed_cksum == 0) {
5522 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
5523 "Message Checksum: 0x%04x [correct]",
5526 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
5527 "Message Checksum: 0x%04x [incorrect, should be 0x%04x]",
5529 in_cksum_shouldbe(cksum, computed_cksum));
5532 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
5533 "Message Checksum: 0x%04x",
5536 proto_tree_add_text(rsvp_header_tree, tvb, offset+4, 1,
5538 tvb_get_guint8(tvb, offset+4));
5539 proto_tree_add_text(rsvp_header_tree, tvb, offset+6, 2,
5540 "Message length: %u", msg_length);
5545 if (message_type == RSVP_MSG_BUNDLE) {
5546 /* Bundle message. Dissect component messages */
5547 if (rsvp_bundle_dissect) {
5549 while (len < msg_length) {
5552 sub_len = tvb_get_ntohs(tvb, len+6);
5553 tvb_sub = tvb_new_subset(tvb, len, sub_len, sub_len);
5554 dissect_rsvp_msg_tree(tvb_sub, pinfo, rsvp_tree, TREE(TT_BUNDLE_COMPMSG), rsvph);
5558 proto_tree_add_text(rsvp_tree, tvb, offset, msg_length - len,
5559 "Bundle Component Messages Not Dissected");
5564 while (len < msg_length) {
5568 obj_length = tvb_get_ntohs(tvb, offset);
5569 class = tvb_get_guint8(tvb, offset+2);
5570 type = tvb_get_guint8(tvb, offset+3);
5571 ti = proto_tree_add_item(rsvp_tree, rsvp_filter[rsvp_class_to_filter_num(class)],
5572 tvb, offset, obj_length, FALSE);
5573 rsvp_object_tree = proto_item_add_subtree(ti, TREE(rsvp_class_to_tree_type(class)));
5574 if (obj_length < 4) {
5575 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
5576 "Length: %u (bogus, must be >= 4)", obj_length);
5579 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
5580 "Length: %u", obj_length);
5581 proto_tree_add_uint(rsvp_object_tree, rsvp_filter[RSVPF_OBJECT], tvb,
5582 offset+2, 1, class);
5588 case RSVP_CLASS_SESSION:
5589 dissect_rsvp_session(ti, rsvp_object_tree, tvb, offset, obj_length, class, type, rsvph);
5592 case RSVP_CLASS_HOP:
5593 dissect_rsvp_hop(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5596 case RSVP_CLASS_TIME_VALUES:
5597 dissect_rsvp_time_values(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5600 case RSVP_CLASS_ERROR:
5601 dissect_rsvp_error(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5604 case RSVP_CLASS_SCOPE:
5605 dissect_rsvp_scope(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5608 case RSVP_CLASS_STYLE:
5609 dissect_rsvp_style(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5612 case RSVP_CLASS_CONFIRM:
5613 dissect_rsvp_confirm(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5616 case RSVP_CLASS_SENDER_TEMPLATE:
5617 case RSVP_CLASS_FILTER_SPEC:
5618 dissect_rsvp_template_filter(ti, rsvp_object_tree, tvb, offset, obj_length, class, type, rsvph);
5621 case RSVP_CLASS_SENDER_TSPEC:
5622 dissect_rsvp_tspec(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5625 case RSVP_CLASS_FLOWSPEC:
5626 dissect_rsvp_flowspec(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5629 case RSVP_CLASS_ADSPEC:
5630 dissect_rsvp_adspec(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5633 case RSVP_CLASS_INTEGRITY:
5634 dissect_rsvp_integrity(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5637 case RSVP_CLASS_POLICY:
5638 dissect_rsvp_policy(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5641 case RSVP_CLASS_LABEL_REQUEST:
5642 dissect_rsvp_label_request(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5645 case RSVP_CLASS_RECOVERY_LABEL:
5646 case RSVP_CLASS_UPSTREAM_LABEL:
5647 case RSVP_CLASS_SUGGESTED_LABEL:
5648 case RSVP_CLASS_LABEL:
5649 dissect_rsvp_label(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5652 case RSVP_CLASS_LABEL_SET:
5653 dissect_rsvp_label_set(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5656 case RSVP_CLASS_SESSION_ATTRIBUTE:
5657 dissect_rsvp_session_attribute(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5660 case RSVP_CLASS_EXPLICIT_ROUTE:
5661 dissect_rsvp_explicit_route(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5664 case RSVP_CLASS_RECORD_ROUTE:
5665 dissect_rsvp_record_route(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5668 case RSVP_CLASS_MESSAGE_ID:
5669 dissect_rsvp_message_id(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5672 case RSVP_CLASS_MESSAGE_ID_ACK:
5673 dissect_rsvp_message_id_ack(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5676 case RSVP_CLASS_MESSAGE_ID_LIST:
5677 dissect_rsvp_message_id_list(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5680 case RSVP_CLASS_HELLO:
5681 dissect_rsvp_hello(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5684 case RSVP_CLASS_DCLASS:
5685 dissect_rsvp_dclass(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5688 case RSVP_CLASS_ADMIN_STATUS:
5689 dissect_rsvp_admin_status(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5692 case RSVP_CLASS_ASSOCIATION:
5693 dissect_rsvp_association(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5696 case RSVP_CLASS_LSP_TUNNEL_IF_ID:
5697 dissect_rsvp_lsp_tunnel_if_id(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5700 case RSVP_CLASS_NOTIFY_REQUEST:
5701 dissect_rsvp_notify_request(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5704 case RSVP_CLASS_GENERALIZED_UNI:
5705 dissect_rsvp_gen_uni(ti, rsvp_object_tree, tvb, offset, obj_length, class, type, rsvph);
5708 case RSVP_CLASS_CALL_ID:
5709 dissect_rsvp_call_id(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5712 case RSVP_CLASS_RESTART_CAP:
5713 dissect_rsvp_restart_cap(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5716 case RSVP_CLASS_PROTECTION:
5717 dissect_rsvp_protection_info(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5720 case RSVP_CLASS_FAST_REROUTE:
5721 dissect_rsvp_fast_reroute(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5724 case RSVP_CLASS_DETOUR:
5725 dissect_rsvp_detour(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5728 case RSVP_CLASS_DIFFSERV:
5729 dissect_rsvp_diffserv(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5732 case RSVP_CLASS_CLASSTYPE:
5733 dissect_rsvp_diffserv_aware_te(ti, rsvp_object_tree, tvb, offset, obj_length, class, type);
5736 case RSVP_CLASS_NULL:
5738 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
5739 "Data (%d bytes)", obj_length - 4);
5743 offset += obj_length;
5748 /*------------------------------------------------------------------------------
5750 *------------------------------------------------------------------------------*/
5752 dissect_rsvp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
5755 guint8 message_type;
5757 int session_off, tempfilt_off;
5758 rsvp_conversation_info *rsvph;
5761 conversation_t *conversation;
5762 struct rsvp_request_key request_key, *new_request_key;
5763 struct rsvp_request_val *request_val = NULL;
5765 if (check_col(pinfo->cinfo, COL_PROTOCOL))
5766 col_set_str(pinfo->cinfo, COL_PROTOCOL,
5767 (pinfo->ipproto == IP_PROTO_RSVPE2EI) ? "RSVP-E2EI" : "RSVP");
5768 if (check_col(pinfo->cinfo, COL_INFO))
5769 col_clear(pinfo->cinfo, COL_INFO);
5771 ver_flags = tvb_get_guint8(tvb, 0);
5772 message_type = tvb_get_guint8(tvb, 1);
5773 msg_length = tvb_get_ntohs(tvb, 6);
5775 rsvph = ep_alloc(sizeof(rsvp_conversation_info));
5776 rsvph->session_type = 0;
5778 /* Copy over the source and destination addresses from the pinfo strucutre */
5779 SET_ADDRESS(&rsvph->source, pinfo->src.type, pinfo->src.len, pinfo->src.data);
5780 SET_ADDRESS(&rsvph->destination, pinfo->dst.type, pinfo->dst.len, pinfo->dst.data);
5782 if (check_col(pinfo->cinfo, COL_INFO)) {
5783 col_add_str(pinfo->cinfo, COL_INFO,
5784 val_to_str(message_type, message_type_vals, "Unknown (%u). "));
5785 find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off);
5787 col_append_str(pinfo->cinfo, COL_INFO, summary_session(tvb, session_off));
5789 col_append_str(pinfo->cinfo, COL_INFO, summary_template(tvb, tempfilt_off));
5792 if (check_col(pinfo->cinfo, COL_INFO)) {
5793 col_add_str(pinfo->cinfo, COL_INFO,
5794 val_to_str(message_type, message_type_vals, "Unknown (%u). "));
5795 if (message_type == RSVP_MSG_BUNDLE) {
5796 col_set_str(pinfo->cinfo, COL_INFO,
5797 rsvp_bundle_dissect ?
5798 "Component Messages Dissected" :
5799 "Component Messages Not Dissected");
5801 find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off);
5803 col_append_str(pinfo->cinfo, COL_INFO, summary_session(tvb, session_off));
5805 col_append_str(pinfo->cinfo, COL_INFO, summary_template(tvb, tempfilt_off));
5810 dissect_rsvp_msg_tree(tvb, pinfo, tree, TREE(TT_RSVP), rsvph);
5813 /* Find out what conversation this packet is part of. */
5814 conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
5815 pinfo->ptype, pinfo->srcport,
5816 pinfo->destport, 0);
5818 if (conversation == NULL) {
5819 /* Not part of any conversation; create a new one. */
5821 conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst,
5822 pinfo->ptype, pinfo->srcport,
5823 pinfo->destport, 0);
5826 /* Now build the request key */
5827 request_key.conversation = conversation->index;
5828 request_key.session_type = rsvph->session_type;
5830 switch (request_key.session_type) {
5831 case RSVP_SESSION_TYPE_IPV4:
5832 SET_ADDRESS(&request_key.u.session_ipv4.destination,
5833 rsvph->destination.type, rsvph->destination.len,
5834 rsvph->destination.data);
5835 request_key.u.session_ipv4.protocol = rsvph->protocol;
5836 request_key.u.session_ipv4.udp_dest_port = rsvph->udp_dest_port;
5839 case RSVP_SESSION_TYPE_IPV6:
5840 /* Not supported yet */
5843 case RSVP_SESSION_TYPE_IPV4_LSP:
5844 SET_ADDRESS(&request_key.u.session_ipv4_lsp.destination,
5845 rsvph->destination.type, rsvph->destination.len,
5846 rsvph->destination.data);
5847 request_key.u.session_ipv4_lsp.udp_dest_port = rsvph->udp_dest_port;
5848 request_key.u.session_ipv4_lsp.ext_tunnel_id = rsvph->ext_tunnel_id;
5851 case RSVP_SESSION_TYPE_AGGREGATE_IPV4:
5852 SET_ADDRESS(&request_key.u.session_agg_ipv4.destination,
5853 rsvph->destination.type, rsvph->destination.len,
5854 rsvph->destination.data);
5855 request_key.u.session_agg_ipv4.dscp = rsvph->dscp;
5858 case RSVP_SESSION_TYPE_IPV4_UNI:
5859 SET_ADDRESS(&request_key.u.session_ipv4_uni.destination,
5860 rsvph->destination.type, rsvph->destination.len,
5861 rsvph->destination.data);
5862 request_key.u.session_ipv4_uni.udp_dest_port = rsvph->udp_dest_port;
5863 request_key.u.session_ipv4_uni.ext_tunnel_id = rsvph->ext_tunnel_id;
5866 case RSVP_SESSION_TYPE_IPV4_E_NNI:
5867 SET_ADDRESS(&request_key.u.session_ipv4_enni.destination,
5868 rsvph->destination.type, rsvph->destination.len,
5869 rsvph->destination.data);
5870 request_key.u.session_ipv4_enni.udp_dest_port = rsvph->udp_dest_port;
5871 request_key.u.session_ipv4_enni.ext_tunnel_id = rsvph->ext_tunnel_id;
5874 /* This should never happen. */
5876 proto_tree_add_text(tree, tvb, 0, 0, "Unknown session type");
5881 SET_ADDRESS(&request_key.source_info.source,
5882 rsvph->source.type, rsvph->source.len, rsvph->source.data);
5883 request_key.source_info.udp_source_port = rsvph->udp_source_port;
5885 /* See if a request with this key already exists */
5887 (struct rsvp_request_val *) g_hash_table_lookup(rsvp_request_hash,
5890 /* If not, insert the new request key into the hash table */
5892 new_request_key = se_alloc(sizeof(struct rsvp_request_key));
5893 *new_request_key = request_key;
5895 request_val = se_alloc(sizeof(struct rsvp_request_val));
5896 request_val->value = conversation->index;
5898 g_hash_table_insert(rsvp_request_hash, new_request_key, request_val);
5901 tap_queue_packet(rsvp_tap, pinfo, rsvph);
5905 register_rsvp_prefs (void)
5907 module_t *rsvp_module;
5909 rsvp_module = prefs_register_protocol(proto_rsvp, NULL);
5910 prefs_register_bool_preference(
5911 rsvp_module, "process_bundle",
5912 "Dissect sub-messages in BUNDLE message",
5913 "Specifies whether Wireshark should decode and display sub-messages within BUNDLE messages",
5914 &rsvp_bundle_dissect);
5918 proto_register_rsvp(void)
5922 /* Build the tree array */
5923 for (i=0; i<TT_MAX; i++)
5924 ett_tree[i] = &(ett_treelist[i]);
5926 proto_rsvp = proto_register_protocol("Resource ReserVation Protocol (RSVP)",
5928 proto_register_field_array(proto_rsvp, rsvpf_info, array_length(rsvpf_info));
5929 proto_register_subtree_array(ett_tree, array_length(ett_tree));
5930 register_rsvp_prefs();
5932 rsvp_dissector_table = register_dissector_table("rsvp.proto", "RSVP Protocol",
5933 FT_UINT8, BASE_DEC);
5935 /* Initialization routine for RSVP conversations */
5936 register_init_routine(&rsvp_init_protocol);
5940 proto_reg_handoff_rsvp(void)
5942 dissector_handle_t rsvp_handle;
5944 rsvp_handle = create_dissector_handle(dissect_rsvp, proto_rsvp);
5945 dissector_add("ip.proto", IP_PROTO_RSVP, rsvp_handle);
5946 dissector_add("ip.proto", IP_PROTO_RSVPE2EI, rsvp_handle);
5947 dissector_add("udp.port", UDP_PORT_PRSVP, rsvp_handle);
5948 rsvp_tap = register_tap("rsvp");