2 * Routines for RSVP packet disassembly
4 * (c) Copyright Ashok Narayanan <ashokn@cisco.com>
8 * Ethereal - Network traffic analyzer
9 * By Gerald Combs <gerald@ethereal.com>
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>
65 #ifdef NEED_SNPRINTF_H
66 # include "snprintf.h"
69 #include <epan/tvbuff.h>
70 #include <epan/packet.h>
72 #include <epan/in_cksum.h>
74 #include <epan/ipproto.h>
76 #include "packet-rsvp.h"
77 #include "packet-ip.h"
78 #include "packet-frame.h"
79 #include "packet-diffserv-mpls-common.h"
81 static int proto_rsvp = -1;
84 * The list of tree types
117 TT_SESSION_ATTRIBUTE,
118 TT_SESSION_ATTRIBUTE_FLAGS,
121 TT_EXPLICIT_ROUTE_SUBOBJ,
123 TT_RECORD_ROUTE_SUBOBJ,
124 TT_RECORD_ROUTE_SUBOBJ_FLAGS,
126 TT_ADMIN_STATUS_FLAGS,
134 TT_FAST_REROUTE_FLAGS,
138 TT_DIFFSERV_MAP_PHBID,
143 static gint ett_treelist[TT_MAX];
144 static gint *ett_tree[TT_MAX];
145 #define TREE(X) ett_treelist[(X)]
147 /* Should we dissect bundle messages? */
148 static gboolean rsvp_bundle_dissect = TRUE;
151 * RSVP message types.
154 * http://www.iana.org/assignments/rsvp-parameters
157 RSVP_MSG_PATH=1, /* RFC 2205 */
158 RSVP_MSG_RESV, /* RFC 2205 */
159 RSVP_MSG_PERR, /* RFC 2205 */
160 RSVP_MSG_RERR, /* RFC 2205 */
161 RSVP_MSG_PTEAR, /* RFC 2205 */
162 RSVP_MSG_RTEAR, /* RFC 2205 */
163 RSVP_MSG_CONFIRM, /* XXX - DREQ, RFC 2745? */
164 /* 9 is DREP, RFC 2745 */
165 RSVP_MSG_RTEAR_CONFIRM=10, /* from Fred Baker at Cisco */
166 /* 11 is unassigned */
167 RSVP_MSG_BUNDLE = 12, /* RFC 2961 */
168 RSVP_MSG_ACK, /* RFC 2961 */
170 RSVP_MSG_SREFRESH = 15, /* RFC 2961 */
171 /* 16, 17, 18, 19 not listed */
172 RSVP_MSG_HELLO = 20 /* RFC 3209 */
173 /* 25 is Integrity Challenge
174 RFC 2747, RFC 3097 */
175 /* 26 is Integrity Response
176 RFC 2747, RFC 3097 */
177 /* 66 is DSBM_willing [SBM] */
178 /* 67 is I_AM_DSBM [SBM] */
179 /* [SBM] is Subnet Bandwidth
180 Manager ID from July 1997 */
181 } rsvp_message_types;
183 static value_string message_type_vals[] = {
184 {RSVP_MSG_PATH, "PATH Message. "},
185 {RSVP_MSG_RESV, "RESV Message. "},
186 {RSVP_MSG_PERR, "PATH ERROR Message. "},
187 {RSVP_MSG_RERR, "RESV ERROR Message. "},
188 {RSVP_MSG_PTEAR, "PATH TEAR Message. "},
189 {RSVP_MSG_RTEAR, "RESV TEAR Message. "},
190 {RSVP_MSG_CONFIRM, "CONFIRM Message. "},
191 {RSVP_MSG_RTEAR_CONFIRM, "RESV TEAR CONFIRM Message. "},
192 {RSVP_MSG_BUNDLE, "BUNDLE Message. "},
193 {RSVP_MSG_ACK, "ACK Message. "},
194 {RSVP_MSG_SREFRESH, "SREFRESH Message. "},
195 {RSVP_MSG_HELLO, "HELLO Message. "},
202 #define MAX_RSVP_CLASS 15
209 RSVP_CLASS_INTEGRITY,
210 RSVP_CLASS_TIME_VALUES,
215 RSVP_CLASS_FILTER_SPEC,
216 RSVP_CLASS_SENDER_TEMPLATE,
217 RSVP_CLASS_SENDER_TSPEC,
223 RSVP_CLASS_LABEL_REQUEST=19,
224 RSVP_CLASS_EXPLICIT_ROUTE,
225 RSVP_CLASS_RECORD_ROUTE,
229 RSVP_CLASS_MESSAGE_ID,
230 RSVP_CLASS_MESSAGE_ID_ACK,
231 RSVP_CLASS_MESSAGE_ID_LIST,
233 RSVP_CLASS_RECOVERY_LABEL = 34,
234 RSVP_CLASS_UPSTREAM_LABEL,
235 RSVP_CLASS_LABEL_SET,
236 RSVP_CLASS_PROTECTION,
238 RSVP_CLASS_DETOUR = 63,
240 RSVP_CLASS_DIFFSERV = 65,
242 RSVP_CLASS_SUGGESTED_LABEL = 129,
243 RSVP_CLASS_ACCEPTABLE_LABEL_SET,
244 RSVP_CLASS_RESTART_CAP,
246 RSVP_CLASS_NOTIFY_REQUEST = 195,
247 RSVP_CLASS_ADMIN_STATUS,
249 RSVP_CLASS_FAST_REROUTE = 205,
250 RSVP_CLASS_SESSION_ATTRIBUTE = 207,
251 RSVP_CLASS_DCLASS = 225,
252 RSVP_CLASS_LSP_TUNNEL_IF_ID = 227,
253 RSVP_CLASS_GENERALIZED_UNI = 229,
258 static value_string rsvp_class_vals[] = {
259 {RSVP_CLASS_NULL, "NULL object"},
260 {RSVP_CLASS_SESSION, "SESSION object"},
261 {RSVP_CLASS_HOP, "HOP object"},
262 {RSVP_CLASS_INTEGRITY, "INTEGRITY object"},
263 {RSVP_CLASS_TIME_VALUES, "TIME VALUES object"},
264 {RSVP_CLASS_ERROR, "ERROR object"},
265 {RSVP_CLASS_SCOPE, "SCOPE object"},
266 {RSVP_CLASS_STYLE, "STYLE object"},
267 {RSVP_CLASS_FLOWSPEC, "FLOWSPEC object"},
268 {RSVP_CLASS_FILTER_SPEC, "FILTER SPEC object"},
269 {RSVP_CLASS_SENDER_TEMPLATE, "SENDER TEMPLATE object"},
270 {RSVP_CLASS_SENDER_TSPEC, "SENDER TSPEC object"},
271 {RSVP_CLASS_ADSPEC, "ADSPEC object"},
272 {RSVP_CLASS_POLICY, "POLICY object"},
273 {RSVP_CLASS_CONFIRM, "CONFIRM object"},
274 {RSVP_CLASS_LABEL, "LABEL object"},
275 {RSVP_CLASS_LABEL_REQUEST, "LABEL REQUEST object"},
276 {RSVP_CLASS_EXPLICIT_ROUTE, "EXPLICIT ROUTE object"},
277 {RSVP_CLASS_RECORD_ROUTE, "RECORD ROUTE object"},
278 {RSVP_CLASS_SESSION_ATTRIBUTE, "SESSION ATTRIBUTE object"},
279 {RSVP_CLASS_MESSAGE_ID, "MESSAGE-ID object"},
280 {RSVP_CLASS_MESSAGE_ID_ACK, "MESSAGE-ID ACK/NACK object"},
281 {RSVP_CLASS_MESSAGE_ID_LIST, "MESSAGE-ID LIST object"},
282 {RSVP_CLASS_HELLO, "HELLO object"},
283 {RSVP_CLASS_RECOVERY_LABEL, "RECOVERY-LABEL object"},
284 {RSVP_CLASS_UPSTREAM_LABEL, "UPSTREAM-LABEL object"},
285 {RSVP_CLASS_LABEL_SET, "LABEL-SET object"},
286 {RSVP_CLASS_PROTECTION, "PROTECTION object"},
287 {RSVP_CLASS_DIFFSERV, "DIFFSERV object"},
288 {RSVP_CLASS_SUGGESTED_LABEL, "SUGGESTED-LABEL object"},
289 {RSVP_CLASS_ACCEPTABLE_LABEL_SET, "ACCEPTABLE-LABEL-SET object"},
290 {RSVP_CLASS_RESTART_CAP, "RESTART-CAPABILITY object"},
291 {RSVP_CLASS_DCLASS, "DCLASS object"},
292 {RSVP_CLASS_LSP_TUNNEL_IF_ID, "LSP-TUNNEL INTERFACE-ID object"},
293 {RSVP_CLASS_NOTIFY_REQUEST, "NOTIFY-REQUEST object"},
294 {RSVP_CLASS_ADMIN_STATUS, "ADMIN-STATUS object"},
295 {RSVP_CLASS_GENERALIZED_UNI, "GENERALIZED-UNI object"},
296 {RSVP_CLASS_CALL_ID, "CALL-ID object"},
297 {RSVP_CLASS_DETOUR, "DETOUR object"},
298 {RSVP_CLASS_FAST_REROUTE, "FAST-REROUTE object"},
305 enum rsvp_error_types {
306 RSVP_ERROR_CONFIRM = 0,
307 RSVP_ERROR_ADMISSION,
310 RSVP_ERROR_NO_SENDER,
311 RSVP_ERROR_CONFLICT_RESV_STYLE,
312 RSVP_ERROR_UNKNOWN_RESV_STYLE,
313 RSVP_ERROR_CONFLICT_DEST_PORTS,
314 RSVP_ERROR_CONFLICT_SRC_PORTS,
315 RSVP_ERROR_PREEMPTED=12,
316 RSVP_ERROR_UNKNOWN_CLASS,
317 RSVP_ERROR_UNKNOWN_C_TYPE,
318 RSVP_ERROR_TRAFFIC = 21,
319 RSVP_ERROR_TRAFFIC_SYSTEM,
323 RSVP_ERROR_DIFFSERV = 27
327 RSVP_AC_ERROR_DELAY_BOUND_ERROR = 1,
328 RSVP_AC_ERROR_BANDWITH_UNAVAILABLE,
329 RSVP_AC_ERROR_LARGE_MTU
333 RSVP_TRAFFIC_CONTROL_ERROR_SERVICE_CONFLICT = 1,
334 RSVP_TRAFFIC_CONTROL_ERROR_SERVIEC_UNSUPPORTED,
335 RSVP_TRAFFIC_CONTROL_ERROR_BAD_FLOWSPEC,
336 RSVP_TRAFFIC_CONTROL_ERROR_BAD_TSPEC,
337 RSVP_TRAFFIC_CONTROL_ERROR_BAD_ADSPEC
341 RSVP_ROUTING_ERROR_BAD_ERO = 1,
342 RSVP_ROUTING_ERROR_BAD_STRICT,
343 RSVP_ROUTING_ERROR_BAD_LOOSE,
344 RSVP_ROUTING_ERROR_BAD_INITIAL_SUBOBJ,
345 RSVP_ROUTING_ERROR_NO_ROUTE,
346 RSVP_ROUTING_ERROR_UNACCEPTABLE_LABEL,
347 RSVP_ROUTING_ERROR_RRO_LOOP,
348 RSVP_ROUTING_ERROR_NON_RSVP_CAPABLE_ROUTER,
349 RSVP_ROUTING_ERROR_LABEL_ALLOC_FAIL,
350 RSVP_ROUTING_ERROR_UNSUPPORTED_L3PID
354 RSVP_NOTIFY_ERROR_RRO_TOO_LARGE = 1,
355 RSVP_NOTIFY_ERROR_RRO_NOTIFICATION,
356 RSVP_NOTIFY_ERROR_RRO_TUNNEL_LOCAL_REPAIRED
360 RSVP_DIFFSERV_ERROR_UNEXPECTED_DIFFSERVOBJ = 1,
361 RSVP_DIFFSERV_ERROR_UNSUPPORTED_PHB,
362 RSVP_DIFFSERV_ERROR_INVALID_EXP_PHB_MAPPING,
363 RSVP_DIFFSERV_ERROR_UNSUPPORTED_PSC,
364 RSVP_DIFFSERV_ERROR_PERLSP_CONTEXT_ALLOC_FAIL
367 static value_string rsvp_error_codes[] = {
368 {RSVP_ERROR_CONFIRM, "Confirmation"},
369 {RSVP_ERROR_ADMISSION, "Admission Control Failure "},
370 {RSVP_ERROR_POLICY, "Policy Control Failure"},
371 {RSVP_ERROR_NO_PATH, "No PATH information for this RESV message"},
372 {RSVP_ERROR_NO_SENDER, "No sender information for this RESV message"},
373 {RSVP_ERROR_CONFLICT_RESV_STYLE, "Conflicting reservation styles"},
374 {RSVP_ERROR_UNKNOWN_RESV_STYLE, "Unknown reservation style"},
375 {RSVP_ERROR_CONFLICT_DEST_PORTS, "Conflicting destination ports"},
376 {RSVP_ERROR_CONFLICT_SRC_PORTS, "Conflicting source ports"},
377 {RSVP_ERROR_PREEMPTED, "Service preempted"},
378 {RSVP_ERROR_UNKNOWN_CLASS, "Unknown object class"},
379 {RSVP_ERROR_UNKNOWN_C_TYPE, "Unknown object C-type"},
380 {RSVP_ERROR_TRAFFIC, "Traffic Control Error"},
381 {RSVP_ERROR_TRAFFIC_SYSTEM, "Traffic Control System Error"},
382 {RSVP_ERROR_SYSTEM, "RSVP System Error"},
383 {RSVP_ERROR_ROUTING, "Routing Error"},
384 {RSVP_ERROR_NOTIFY, "RSVP Notify Error"},
385 {RSVP_ERROR_DIFFSERV, "RSVP Diff-Serv Error"},
389 static value_string rsvp_admission_control_error_vals[] = {
390 {RSVP_AC_ERROR_DELAY_BOUND_ERROR, "Delay bound cannot be met"},
391 {RSVP_AC_ERROR_BANDWITH_UNAVAILABLE, "Requested bandwidth unavailable"},
392 {RSVP_AC_ERROR_LARGE_MTU, "MTU in flowspec larger than interface MTU"},
396 static value_string rsvp_traffic_control_error_vals[] = {
397 {RSVP_TRAFFIC_CONTROL_ERROR_SERVICE_CONFLICT, "Service conflict"},
398 {RSVP_TRAFFIC_CONTROL_ERROR_SERVIEC_UNSUPPORTED, "Service unsupported"},
399 {RSVP_TRAFFIC_CONTROL_ERROR_BAD_FLOWSPEC, "Bad Flowspec value"},
400 {RSVP_TRAFFIC_CONTROL_ERROR_BAD_TSPEC, "Bad Tspec value"},
401 {RSVP_TRAFFIC_CONTROL_ERROR_BAD_ADSPEC, "Bad Adspec value"},
405 static value_string rsvp_routing_error_vals[] = {
406 {RSVP_ROUTING_ERROR_BAD_ERO, "Bad EXPLICIT_ROUTE object"},
407 {RSVP_ROUTING_ERROR_BAD_STRICT, "Bad strict node"},
408 {RSVP_ROUTING_ERROR_BAD_LOOSE, "Bad loose node"},
409 {RSVP_ROUTING_ERROR_BAD_INITIAL_SUBOBJ, "Bad initial subobject"},
410 {RSVP_ROUTING_ERROR_NO_ROUTE, "No route available toward destination"},
411 {RSVP_ROUTING_ERROR_UNACCEPTABLE_LABEL, "Unacceptable label value"},
412 {RSVP_ROUTING_ERROR_RRO_LOOP, "RRO indicated routing loops"},
413 {RSVP_ROUTING_ERROR_NON_RSVP_CAPABLE_ROUTER, "non-RSVP-capable router stands in the path"},
414 {RSVP_ROUTING_ERROR_LABEL_ALLOC_FAIL, "MPLS label allocation failure"},
415 {RSVP_ROUTING_ERROR_UNSUPPORTED_L3PID, "Unsupported L3PID"},
419 static value_string rsvp_notify_error_vals[] = {
420 {RSVP_NOTIFY_ERROR_RRO_TOO_LARGE, "RRO too large for MTU"},
421 {RSVP_NOTIFY_ERROR_RRO_NOTIFICATION, "RRO Notification"},
422 {RSVP_NOTIFY_ERROR_RRO_TUNNEL_LOCAL_REPAIRED, "Tunnel locally repaired"},
426 static value_string rsvp_diffserv_error_vals[] = {
427 {RSVP_DIFFSERV_ERROR_UNEXPECTED_DIFFSERVOBJ, "Unexpected DIFFSERV object"},
428 {RSVP_DIFFSERV_ERROR_UNSUPPORTED_PHB, "Unsupported PHB"},
429 {RSVP_DIFFSERV_ERROR_INVALID_EXP_PHB_MAPPING, "Invalid `EXP<->PHB mapping'"},
430 {RSVP_DIFFSERV_ERROR_UNSUPPORTED_PSC, "Unsupported PSC"},
431 {RSVP_DIFFSERV_ERROR_PERLSP_CONTEXT_ALLOC_FAIL, "Per-LSP context allocation failure"},
436 * Defines the reservation style plus style-specific information that
437 * is not a FLOWSPEC or FILTER_SPEC object, in a RESV message.
439 #define RSVP_DISTINCT (1 << 3)
440 #define RSVP_SHARED (2 << 3)
441 #define RSVP_SHARING_MASK (RSVP_DISTINCT | RSVP_SHARED)
443 #define RSVP_SCOPE_WILD 1
444 #define RSVP_SCOPE_EXPLICIT 2
445 #define RSVP_SCOPE_MASK 0x07
447 #define RSVP_WF (RSVP_SHARED | RSVP_SCOPE_WILD)
448 #define RSVP_FF (RSVP_DISTINCT | RSVP_SCOPE_EXPLICIT)
449 #define RSVP_SE (RSVP_SHARED | RSVP_SCOPE_EXPLICIT)
451 static value_string style_vals[] = {
452 { RSVP_WF, "Wildcard Filter" },
453 { RSVP_FF, "Fixed Filter" },
454 { RSVP_SE, "Shared-Explicit" },
459 RSVP_SESSION_TYPE_IPV4 = 1,
460 RSVP_SESSION_TYPE_IPV6,
462 RSVP_SESSION_TYPE_IPV4_LSP = 7,
463 RSVP_SESSION_TYPE_IPV6_LSP,
465 RSVP_SESSION_TYPE_IPV4_UNI = 11,
466 RSVP_SESSION_TYPE_IPV4_E_NNI = 15
470 * Defines a desired QoS, in a RESV message.
472 enum qos_service_type {
473 QOS_QUALITATIVE = 128, /* Qualitative service */
474 QOS_NULL = 6, /* Null service (RFC2997) */
475 QOS_CONTROLLED_LOAD= 5, /* Controlled Load Service */
476 QOS_GUARANTEED = 2, /* Guaranteed service */
477 QOS_TSPEC = 1 /* Traffic specification */
480 static value_string qos_vals[] = {
481 { QOS_QUALITATIVE, "Qualitative QoS" },
482 { QOS_NULL, "Null-Service QoS" },
483 { QOS_CONTROLLED_LOAD, "Controlled-load QoS" },
484 { QOS_GUARANTEED, "Guaranteed rate QoS" },
485 { QOS_TSPEC, "Traffic specification" },
489 static value_string svc_vals[] = {
490 { 126, "Compression Hint" },
491 { 127, "Token bucket" },
492 { 128, "Null Service" },
493 { 130, "Guaranteed-rate RSpec" },
497 enum rsvp_spec_types { INTSRV = 2 };
499 enum intsrv_services {
504 INTSRV_QUALITATIVE = 128
507 static value_string intsrv_services_str[] = {
508 {INTSRV_GENERAL, "Default General Parameters"},
509 {INTSRV_GTD, "Guaranteed Rate"},
510 {INTSRV_CLOAD, "Controlled Load"},
511 {INTSRV_NULL, "Null Service"},
512 {INTSRV_QUALITATIVE, "Null Service"},
517 enum intsrv_field_name {
518 INTSRV_NON_IS_HOPS = 1, INTSRV_COMPOSED_NON_IS_HOPS,
519 INTSRV_IS_HOPS, INTSRV_COMPOSED_IS_HOPS,
520 INTSRV_PATH_BANDWIDTH, INTSRV_MIN_PATH_BANDWIDTH,
521 INTSRV_IF_LATENCY, INTSRV_PATH_LATENCY,
522 INTSRV_MTU, INTSRV_COMPOSED_MTU,
524 INTSRV_TOKEN_BUCKET_TSPEC = 127,
525 INTSRV_QUALITATIVE_TSPEC = 128,
526 INTSRV_GTD_RSPEC = 130,
528 INTSRV_DELAY = 131, /* Gtd Parameter C - Max Delay Bound - bytes */
529 INTSRV_MAX_JITTER, /* Gtd Parameter D - Max Jitter */
530 INTSRV_E2E_DELAY, /* Gtd Parameter Ctot */
531 INTSRV_E2E_MAX_JITTER, /* Gtd Parameter Dtot */
532 INTSRV_SHP_DELAY, /* Gtd Parameter Csum */
533 INTSRV_SHP_MAX_JITTER /* Gtd Parameter Dsum */
537 static value_string adspec_params[] = {
539 {6, "Path b/w estimate"},
540 {8, "Minimum path latency"},
541 {10, "Composed MTU"},
542 {133, "End-to-end composed value for C"},
543 {134, "End-to-end composed value for D"},
544 {135, "Since-last-reshaping point composed C"},
545 {136, "Since-last-reshaping point composed D"},
549 const value_string gmpls_lsp_enc_str[] = {
551 { 2, "Ethernet v2/DIX"},
554 { 7, "Digital Wrapper"},
555 { 8, "Lambda (photonic)"},
557 {11, "FiberChannel"},
561 const value_string gmpls_switching_type_str[] = {
562 { 1, "Packet-Switch Capable-1 (PSC-1)"},
563 { 2, "Packet-Switch Capable-2 (PSC-2)"},
564 { 3, "Packet-Switch Capable-3 (PSC-3)"},
565 { 4, "Packet-Switch Capable-4 (PSC-4)"},
566 { 51, "Layer-2 Switch Capable (L2SC)"},
567 {100, "Time-Division-Multiplex Capable (TDM)"},
568 {150, "Lambda-Switch Capable (LSC)"},
569 {200, "Fiber-Switch Capable (FSC)"},
573 const value_string gmpls_protection_cap_str[] = {
574 { 1, "Extra Traffic"},
577 { 8, "Dedicated 1:1"},
578 {16, "Dedicated 1+1"},
585 static const value_string gmpls_gpid_str[] = {
586 { 5, "Asynchronous mapping of E3 (SDH)"},
587 { 8, "Bit synchronous mapping of E3 (SDH)"},
588 { 9, "Byte synchronous mapping of E3 (SDH)"},
589 {10, "Asynchronous mapping of DS2/T2 (SDH)"},
590 {11, "Bit synchronous mapping of DS2/T2 (SONET, SDH)"},
591 {13, "Asynchronous mapping of E1 (SONET, SDH)"},
592 {14, "Byte synchronous mapping of E1 (SONET, SDH)"},
593 {15, "Byte synchronous mapping of 31 * DS0 (SONET, SDH)"},
594 {16, "Asynchronous mapping of DS1/T1 (SONET, SDH)"},
595 {17, "Bit synchronous mapping of DS1/T1 (SONET, SDH)"},
596 {18, "Byte synchronous mapping of DS1/T1 (SONET, SDH)"},
597 {19, "VC-11 in VC-12 (SDH)"},
598 {22, "DS1 SF Asynchronous (SONET)"},
599 {23, "DS1 ESF Asynchronous (SONET)"},
600 {24, "DS3 M23 Asynchronous (SONET)"},
601 {25, "DS3 C-Bit Parity Asynchronous (SONET)"},
602 {26, "VT/LOVC (SONET, SDH)"},
603 {27, "STS SPE/HOVC (SONET, SDH)"},
604 {28, "POS - No Scrambling, 16 bit CRC (SONET, SDH)"},
605 {29, "POS - No Scrambling, 32 bit CRC (SONET, SDH)"},
606 {30, "POS - Scrambling, 16 bit CRC (SONET, SDH)"},
607 {31, "POS - Scrambling, 32 bit CRC (SONET, SDH)"},
608 {32, "ATM Mapping (SONET, SDH)"},
609 {33, "Ethernet (SDH, Lambda, Fiber)"},
610 {34, "SDH (Lambda, Fiber)"},
611 {35, "SONET (Lambda, Fiber)"},
612 {36, "Digital Wrapper (Lambda, Fiber)"},
613 {37, "Lambda (Fiber)"},
614 {38, "ETSI PDH (SDH)"},
615 {39, "ANSI PDH (SONET, SDH)"},
616 {40, "Link Access Protocol SDH: LAPS - X.85 and X.86 (SONET, SDH)"},
617 {41, "FDDI (SONET, SDH, Lambda, Fiber)"},
618 {42, "DQDB: ETSI ETS 300 216 (SONET, SDH)"},
619 {43, "FiberChannel-3 Services (FiberChannel)"},
621 {45, "Ethernet V2/DIX (only)"},
622 {46, "Ethernet 802.3 (only)"},
626 const value_string gmpls_sonet_signal_type_str[] = {
627 { 1, "VT1.5 SPE / VC-11"},
628 { 2, "VT2 SPE / VC-12"},
630 { 4, "VT6 SPE / VC-2"},
631 { 5, "STS-1 SPE / VC-3"},
632 { 6, "STS-3c SPE / VC-4"},
633 { 7, "STS-1 / STM-0 (transp)"},
634 { 8, "STS-3 / STM-1 (transp)"},
635 { 9, "STS-12 / STM-4 (transp)"},
636 {10, "STS-48 / STM-16 (transp)"},
637 {11, "STS-192 / STM-64 (transp)"},
638 {12, "STS-768 / STM-256 (transp)"},
640 /* Extended non-SONET signal types */
643 {15, "STSG-3 / AUG-1"},
644 {16, "STSG-12 / AUG-4"},
645 {17, "STSG-48 / AUG-16"},
646 {18, "STSG-192 / AUG-64"},
647 {19, "STSG-768 / AUG-256"},
649 /* Other SONEt signal types */
650 {21, "STS-12c SPE / VC-4-4c"},
651 {22, "STS-48c SPE / VC-4-16c"},
652 {23, "STS-192c SPE / VC-4-64c"},
655 static const value_string ouni_guni_diversity_str[] = {
658 {3, "Shared-Risk Link Group Diverse"},
662 /* -------------------- Stuff for MPLS/TE objects -------------------- */
664 static const value_string proto_vals[] = { {IP_PROTO_ICMP, "ICMP"},
665 {IP_PROTO_IGMP, "IGMP"},
666 {IP_PROTO_TCP, "TCP" },
667 {IP_PROTO_UDP, "UDP" },
668 {IP_PROTO_OSPF, "OSPF"},
672 enum rsvp_filter_keys {
675 RSVPF_MSG, /* Message type */
676 /* Shorthand for message types */
697 /* Does the message contain an object of this type? */
699 /* Object present shorthands */
719 RSVPF_EXPLICIT_ROUTE,
723 RSVPF_MESSAGE_ID_ACK,
724 RSVPF_MESSAGE_ID_LIST,
725 RSVPF_RECOVERY_LABEL,
726 RSVPF_UPSTREAM_LABEL,
731 RSVPF_SUGGESTED_LABEL,
732 RSVPF_ACCEPTABLE_LABEL_SET,
735 RSVPF_SESSION_ATTRIBUTE,
737 RSVPF_LSP_TUNNEL_IF_ID,
738 RSVPF_NOTIFY_REQUEST,
740 RSVPF_GENERALIZED_UNI,
748 RSVPF_SESSION_TUNNEL_ID,
749 RSVPF_SESSION_EXT_TUNNEL_ID,
751 /* Sender template */
756 /* Diffserv object */
757 RSVPF_DIFFSERV_MAPNB,
759 RSVPF_DIFFSERV_MAP_EXP,
760 RSVPF_DIFFSERV_PHBID,
761 RSVPF_DIFFSERV_PHBID_DSCP,
762 RSVPF_DIFFSERV_PHBID_CODE,
763 RSVPF_DIFFSERV_PHBID_BIT14,
764 RSVPF_DIFFSERV_PHBID_BIT15,
770 static int rsvp_filter[RSVPF_MAX];
772 static hf_register_info rsvpf_info[] = {
774 /* Message type number */
775 {&rsvp_filter[RSVPF_MSG],
776 { "Message Type", "rsvp.msg", FT_UINT8, BASE_DEC, VALS(message_type_vals), 0x0,
779 /* Message type shorthands */
780 {&rsvp_filter[RSVPF_PATH],
781 { "Path Message", "rsvp.path", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
784 {&rsvp_filter[RSVPF_RESV],
785 { "Resv Message", "rsvp.resv", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
788 {&rsvp_filter[RSVPF_PATHERR],
789 { "Path Error Message", "rsvp.perr", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
792 {&rsvp_filter[RSVPF_RESVERR],
793 { "Resv Error Message", "rsvp.rerr", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
796 {&rsvp_filter[RSVPF_PATHTEAR],
797 { "Path Tear Message", "rsvp.ptear", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
800 {&rsvp_filter[RSVPF_RESVTEAR],
801 { "Resv Tear Message", "rsvp.rtear", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
804 {&rsvp_filter[RSVPF_RCONFIRM],
805 { "Resv Confirm Message", "rsvp.resvconf", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
808 {&rsvp_filter[RSVPF_RTEARCONFIRM],
809 { "Resv Tear Confirm Message", "rsvp.rtearconf", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
812 {&rsvp_filter[RSVPF_BUNDLE],
813 { "Bundle Message", "rsvp.bundle", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
816 {&rsvp_filter[RSVPF_ACK],
817 { "Ack Message", "rsvp.ack", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
820 {&rsvp_filter[RSVPF_SREFRESH],
821 { "Srefresh Message", "rsvp.srefresh", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
824 {&rsvp_filter[RSVPF_HELLO],
825 { "HELLO Message", "rsvp.hello", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
829 {&rsvp_filter[RSVPF_OBJECT],
830 { "Object class", "rsvp.object", FT_UINT8, BASE_DEC, VALS(rsvp_class_vals), 0x0,
833 /* Object present shorthands */
834 {&rsvp_filter[RSVPF_SESSION],
835 { "SESSION", "rsvp.session", FT_NONE, BASE_NONE, NULL, 0x0,
838 {&rsvp_filter[RSVPF_HOP],
839 { "HOP", "rsvp.hop", FT_NONE, BASE_NONE, NULL, 0x0,
842 {&rsvp_filter[RSVPF_HELLO_OBJ],
843 { "HELLO Request/Ack", "rsvp.hello_obj", FT_NONE, BASE_NONE, NULL, 0x0,
846 {&rsvp_filter[RSVPF_INTEGRITY],
847 { "INTEGRITY", "rsvp.integrity", FT_NONE, BASE_NONE, NULL, 0x0,
850 {&rsvp_filter[RSVPF_TIME_VALUES],
851 { "TIME VALUES", "rsvp.time", FT_NONE, BASE_NONE, NULL, 0x0,
854 {&rsvp_filter[RSVPF_ERROR],
855 { "ERROR", "rsvp.error", FT_NONE, BASE_NONE, NULL, 0x0,
858 {&rsvp_filter[RSVPF_SCOPE],
859 { "SCOPE", "rsvp.scope", FT_NONE, BASE_NONE, NULL, 0x0,
862 {&rsvp_filter[RSVPF_STYLE],
863 { "STYLE", "rsvp.style", FT_NONE, BASE_NONE, NULL, 0x0,
866 {&rsvp_filter[RSVPF_FLOWSPEC],
867 { "FLOWSPEC", "rsvp.flowspec", FT_NONE, BASE_NONE, NULL, 0x0,
870 {&rsvp_filter[RSVPF_FILTER_SPEC],
871 { "FILTERSPEC", "rsvp.filter", FT_NONE, BASE_NONE, NULL, 0x0,
874 {&rsvp_filter[RSVPF_SENDER],
875 { "SENDER TEMPLATE", "rsvp.sender", FT_NONE, BASE_NONE, NULL, 0x0,
878 {&rsvp_filter[RSVPF_TSPEC],
879 { "SENDER TSPEC", "rsvp.tspec", FT_NONE, BASE_NONE, NULL, 0x0,
882 {&rsvp_filter[RSVPF_ADSPEC],
883 { "ADSPEC", "rsvp.adspec", FT_NONE, BASE_NONE, NULL, 0x0,
886 {&rsvp_filter[RSVPF_POLICY],
887 { "POLICY", "rsvp.policy", FT_NONE, BASE_NONE, NULL, 0x0,
890 {&rsvp_filter[RSVPF_CONFIRM],
891 { "CONFIRM", "rsvp.confirm", FT_NONE, BASE_NONE, NULL, 0x0,
894 {&rsvp_filter[RSVPF_LABEL],
895 { "LABEL", "rsvp.label", FT_NONE, BASE_NONE, NULL, 0x0,
898 {&rsvp_filter[RSVPF_RECOVERY_LABEL],
899 { "RECOVERY LABEL", "rsvp.recovery_label", FT_NONE, BASE_NONE, NULL, 0x0,
902 {&rsvp_filter[RSVPF_UPSTREAM_LABEL],
903 { "UPSTREAM LABEL", "rsvp.upstream_label", FT_NONE, BASE_NONE, NULL, 0x0,
906 {&rsvp_filter[RSVPF_SUGGESTED_LABEL],
907 { "SUGGESTED LABEL", "rsvp.suggested_label", FT_NONE, BASE_NONE, NULL, 0x0,
910 {&rsvp_filter[RSVPF_LABEL_SET],
911 { "LABEL SET", "rsvp.label_set", FT_NONE, BASE_NONE, NULL, 0x0,
914 {&rsvp_filter[RSVPF_ACCEPTABLE_LABEL_SET],
915 { "ACCEPTABLE LABEL SET", "rsvp.acceptable_label_set", FT_NONE, BASE_NONE, NULL, 0x0,
918 {&rsvp_filter[RSVPF_PROTECTION],
919 { "PROTECTION", "rsvp.protection", FT_NONE, BASE_NONE, NULL, 0x0,
922 {&rsvp_filter[RSVPF_DIFFSERV],
923 { "DIFFSERV", "rsvp.diffserv", FT_NONE, BASE_NONE, NULL, 0x0,
926 {&rsvp_filter[RSVPF_RESTART_CAP],
927 { "RESTART CAPABILITY", "rsvp.restart", FT_NONE, BASE_NONE, NULL, 0x0,
930 {&rsvp_filter[RSVPF_LABEL_REQUEST],
931 { "LABEL REQUEST", "rsvp.label_request", FT_NONE, BASE_NONE, NULL, 0x0,
934 {&rsvp_filter[RSVPF_SESSION_ATTRIBUTE],
935 { "SESSION ATTRIBUTE", "rsvp.session_attribute", FT_NONE, BASE_NONE, NULL, 0x0,
938 {&rsvp_filter[RSVPF_EXPLICIT_ROUTE],
939 { "EXPLICIT ROUTE", "rsvp.explicit_route", FT_NONE, BASE_NONE, NULL, 0x0,
942 {&rsvp_filter[RSVPF_RECORD_ROUTE],
943 { "RECORD ROUTE", "rsvp.record_route", FT_NONE, BASE_NONE, NULL, 0x0,
946 {&rsvp_filter[RSVPF_MESSAGE_ID],
947 { "MESSAGE-ID", "rsvp.msgid", FT_NONE, BASE_NONE, NULL, 0x0,
950 {&rsvp_filter[RSVPF_MESSAGE_ID_ACK],
951 { "MESSAGE-ID ACK", "rsvp.ack", FT_NONE, BASE_NONE, NULL, 0x0,
954 {&rsvp_filter[RSVPF_MESSAGE_ID_LIST],
955 { "MESSAGE-ID LIST", "rsvp.msgid_list", FT_NONE, BASE_NONE, NULL, 0x0,
958 {&rsvp_filter[RSVPF_DCLASS],
959 { "DCLASS", "rsvp.dclass", FT_NONE, BASE_NONE, NULL, 0x0,
962 {&rsvp_filter[RSVPF_LSP_TUNNEL_IF_ID],
963 { "LSP INTERFACE-ID", "rsvp.lsp_tunnel_if_id", FT_NONE, BASE_NONE, NULL, 0x0,
966 {&rsvp_filter[RSVPF_ADMIN_STATUS],
967 { "ADMIN STATUS", "rsvp.admin_status", FT_NONE, BASE_NONE, NULL, 0x0,
970 {&rsvp_filter[RSVPF_NOTIFY_REQUEST],
971 { "NOTIFY REQUEST", "rsvp.notify_request", FT_NONE, BASE_NONE, NULL, 0x0,
974 {&rsvp_filter[RSVPF_GENERALIZED_UNI],
975 { "GENERALIZED UNI", "rsvp.generalized_uni", FT_NONE, BASE_NONE, NULL, 0x0,
978 {&rsvp_filter[RSVPF_CALL_ID],
979 { "CALL ID", "rsvp.call_id", FT_NONE, BASE_NONE, NULL, 0x0,
982 {&rsvp_filter[RSVPF_UNKNOWN_OBJ],
983 { "Unknown object", "rsvp.obj_unknown", FT_NONE, BASE_NONE, NULL, 0x0,
987 {&rsvp_filter[RSVPF_SESSION_IP],
988 { "Destination address", "rsvp.session.ip", FT_IPv4, BASE_NONE, NULL, 0x0,
991 {&rsvp_filter[RSVPF_SESSION_PORT],
992 { "Port number", "rsvp.session.port", FT_UINT16, BASE_DEC, NULL, 0x0,
995 {&rsvp_filter[RSVPF_SESSION_PROTO],
996 { "Protocol", "rsvp.session.proto", FT_UINT8, BASE_DEC, VALS(proto_vals), 0x0,
999 {&rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
1000 { "Tunnel ID", "rsvp.session.tunnel_id", FT_UINT16, BASE_DEC, NULL, 0x0,
1003 {&rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
1004 { "Extended tunnel ID", "rsvp.session.ext_tunnel_id", FT_UINT32, BASE_DEC, NULL, 0x0,
1007 /* Sender template/Filterspec fields */
1008 {&rsvp_filter[RSVPF_SENDER_IP],
1009 { "Sender IPv4 address", "rsvp.sender.ip", FT_IPv4, BASE_NONE, NULL, 0x0,
1012 {&rsvp_filter[RSVPF_SENDER_PORT],
1013 { "Sender port number", "rsvp.sender.port", FT_UINT16, BASE_DEC, NULL, 0x0,
1016 {&rsvp_filter[RSVPF_SENDER_LSP_ID],
1017 { "Sender LSP ID", "rsvp.sender.lsp_id", FT_UINT16, BASE_DEC, NULL, 0x0,
1020 /* Diffserv object fields */
1021 {&rsvp_filter[RSVPF_DIFFSERV_MAPNB],
1022 { "MAPnb", "rsvp.diffserv.mapnb", FT_UINT8, BASE_DEC, NULL, 0x0,
1023 MAPNB_DESCRIPTION, HFILL }},
1025 {&rsvp_filter[RSVPF_DIFFSERV_MAP],
1026 { "MAP", "rsvp.diffserv.map", FT_NONE, BASE_NONE, NULL, 0x0,
1027 MAP_DESCRIPTION, HFILL }},
1029 {&rsvp_filter[RSVPF_DIFFSERV_MAP_EXP],
1030 { "EXP", "rsvp.diffserv.map.exp", FT_UINT8, BASE_DEC, NULL, 0x0,
1031 EXP_DESCRIPTION, HFILL }},
1033 {&rsvp_filter[RSVPF_DIFFSERV_PHBID],
1034 { "PHBID", "rsvp.diffserv.phbid", FT_NONE, BASE_NONE, NULL, 0x0,
1035 PHBID_DESCRIPTION, HFILL }},
1037 {&rsvp_filter[RSVPF_DIFFSERV_PHBID_DSCP],
1038 { PHBID_DSCP_DESCRIPTION, "rsvp.diffserv.phbid.dscp", FT_UINT16,
1039 BASE_DEC, NULL, PHBID_DSCP_MASK, "DSCP", HFILL }},
1041 {&rsvp_filter[RSVPF_DIFFSERV_PHBID_CODE],
1042 { PHBID_CODE_DESCRIPTION, "rsvp.diffserv.phbid.code", FT_UINT16,
1043 BASE_DEC, NULL, PHBID_CODE_MASK, "PHB id code", HFILL }},
1045 {&rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT14],
1046 { PHBID_BIT14_DESCRIPTION, "rsvp.diffserv.phbid.bit14", FT_UINT16,
1047 BASE_DEC, VALS(phbid_bit14_vals), PHBID_BIT14_MASK, "Bit 14", HFILL }},
1049 {&rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT15],
1050 { PHBID_BIT15_DESCRIPTION, "rsvp.diffserv.phbid.bit15", FT_UINT16,
1051 BASE_DEC, VALS(phbid_bit15_vals), PHBID_BIT15_MASK, "Bit 15", HFILL }}
1055 static inline int rsvp_class_to_filter_num(int classnum)
1058 case RSVP_CLASS_SESSION :
1059 case RSVP_CLASS_HOP :
1060 case RSVP_CLASS_INTEGRITY :
1061 case RSVP_CLASS_TIME_VALUES :
1062 case RSVP_CLASS_ERROR :
1063 case RSVP_CLASS_SCOPE :
1064 case RSVP_CLASS_STYLE :
1065 case RSVP_CLASS_FLOWSPEC :
1066 case RSVP_CLASS_FILTER_SPEC :
1067 case RSVP_CLASS_SENDER_TEMPLATE :
1068 case RSVP_CLASS_SENDER_TSPEC :
1069 case RSVP_CLASS_ADSPEC :
1070 case RSVP_CLASS_POLICY :
1071 case RSVP_CLASS_CONFIRM :
1072 case RSVP_CLASS_LABEL :
1073 case RSVP_CLASS_LABEL_REQUEST :
1074 case RSVP_CLASS_HELLO :
1075 case RSVP_CLASS_EXPLICIT_ROUTE :
1076 case RSVP_CLASS_RECORD_ROUTE :
1077 case RSVP_CLASS_MESSAGE_ID :
1078 case RSVP_CLASS_MESSAGE_ID_ACK :
1079 case RSVP_CLASS_MESSAGE_ID_LIST :
1080 return classnum + RSVPF_OBJECT;
1083 case RSVP_CLASS_RECOVERY_LABEL :
1084 case RSVP_CLASS_UPSTREAM_LABEL :
1085 case RSVP_CLASS_LABEL_SET :
1086 case RSVP_CLASS_PROTECTION :
1087 return RSVPF_RECOVERY_LABEL + (classnum - RSVP_CLASS_RECOVERY_LABEL);
1089 case RSVP_CLASS_SUGGESTED_LABEL :
1090 case RSVP_CLASS_ACCEPTABLE_LABEL_SET :
1091 case RSVP_CLASS_RESTART_CAP :
1092 return RSVPF_SUGGESTED_LABEL + (classnum - RSVP_CLASS_SUGGESTED_LABEL);
1094 case RSVP_CLASS_DIFFSERV :
1095 return RSVPF_DIFFSERV;
1097 case RSVP_CLASS_NOTIFY_REQUEST :
1098 return RSVPF_NOTIFY_REQUEST;
1099 case RSVP_CLASS_ADMIN_STATUS :
1100 return RSVPF_ADMIN_STATUS;
1102 case RSVP_CLASS_SESSION_ATTRIBUTE :
1103 return RSVPF_SESSION_ATTRIBUTE;
1104 case RSVP_CLASS_GENERALIZED_UNI :
1105 return RSVPF_GENERALIZED_UNI;
1106 case RSVP_CLASS_CALL_ID :
1107 return RSVPF_CALL_ID;
1108 case RSVP_CLASS_DCLASS :
1109 return RSVPF_DCLASS;
1110 case RSVP_CLASS_LSP_TUNNEL_IF_ID :
1111 return RSVPF_LSP_TUNNEL_IF_ID;
1114 return RSVPF_UNKNOWN_OBJ;
1119 find_rsvp_session_tempfilt(tvbuff_t *tvb, int hdr_offset, int *session_offp, int *tempfilt_offp)
1121 int s_off = 0, t_off = 0;
1125 if (!tvb_bytes_exist(tvb, hdr_offset+6, 2))
1128 len = tvb_get_ntohs(tvb, hdr_offset+6) + hdr_offset;
1129 off = hdr_offset + 8;
1130 for (off = hdr_offset + 8; off < len && tvb_bytes_exist(tvb, off, 3);
1131 off += obj_length) {
1132 obj_length = tvb_get_ntohs(tvb, off);
1133 if (obj_length == 0)
1135 switch(tvb_get_guint8(tvb, off+2)) {
1136 case RSVP_CLASS_SESSION:
1139 case RSVP_CLASS_SENDER_TEMPLATE:
1140 case RSVP_CLASS_FILTER_SPEC:
1149 if (session_offp) *session_offp = s_off;
1150 if (tempfilt_offp) *tempfilt_offp = t_off;
1153 static char *summary_session (tvbuff_t *tvb, int offset)
1155 static char buf[100];
1157 switch(tvb_get_guint8(tvb, offset+3)) {
1158 case RSVP_SESSION_TYPE_IPV4:
1159 snprintf(buf, 100, "SESSION: IPv4, Destination %s, Protocol %d, Port %d. ",
1160 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1161 tvb_get_guint8(tvb, offset+8),
1162 tvb_get_ntohs(tvb, offset+10));
1164 case RSVP_SESSION_TYPE_IPV4_LSP:
1165 snprintf(buf, 100, "SESSION: IPv4-LSP, Destination %s, Tunnel ID %d, Ext ID %0x. ",
1166 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1167 tvb_get_ntohs(tvb, offset+10),
1168 tvb_get_ntohl(tvb, offset+12));
1170 case RSVP_SESSION_TYPE_IPV4_UNI:
1171 snprintf(buf, 100, "SESSION: IPv4-UNI, Destination %s, Tunnel ID %d, Ext Address %s. ",
1172 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1173 tvb_get_ntohs(tvb, offset+10),
1174 ip_to_str(tvb_get_ptr(tvb, offset+12, 4)));
1176 case RSVP_SESSION_TYPE_IPV4_E_NNI:
1177 snprintf(buf, 100, "SESSION: IPv4-E-NNI, Destination %s, Tunnel ID %d, Ext Address %s. ",
1178 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1179 tvb_get_ntohs(tvb, offset+10),
1180 ip_to_str(tvb_get_ptr(tvb, offset+12, 4)));
1183 snprintf(buf, 100, "SESSION: Type %d. ", tvb_get_guint8(tvb, offset+3));
1189 static char *summary_template (tvbuff_t *tvb, int offset)
1191 static char buf[80];
1194 if (tvb_get_guint8(tvb, offset+2) == RSVP_CLASS_FILTER_SPEC)
1195 objtype = "FILTERSPEC";
1197 objtype = "SENDER TEMPLATE";
1199 switch(tvb_get_guint8(tvb, offset+3)) {
1201 snprintf(buf, 80, "%s: IPv4, Sender %s, Port %d. ", objtype,
1202 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1203 tvb_get_ntohs(tvb, offset+10));
1206 snprintf(buf, 80, "%s: IPv4-LSP, Tunnel Source: %s, LSP ID: %d. ", objtype,
1207 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
1208 tvb_get_ntohs(tvb, offset+10));
1211 snprintf(buf, 80, "%s: Type %d. ", objtype, tvb_get_guint8(tvb, offset+3));
1217 /*------------------------------------------------------------------------------
1219 *------------------------------------------------------------------------------*/
1221 dissect_rsvp_session (proto_tree *ti, tvbuff_t *tvb,
1222 int offset, int obj_length,
1223 int class, int type,
1226 int offset2 = offset + 4;
1227 proto_tree *rsvp_object_tree;
1229 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_SESSION));
1230 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1231 "Length: %u", obj_length);
1232 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1233 "Class number: %u - %s",
1235 proto_item_set_text(ti, summary_session(tvb, offset));
1238 case RSVP_SESSION_TYPE_IPV4:
1239 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1240 "C-type: 1 - IPv4");
1241 proto_tree_add_item(rsvp_object_tree,
1242 rsvp_filter[RSVPF_SESSION_IP],
1243 tvb, offset2, 4, FALSE);
1245 proto_tree_add_item(rsvp_object_tree,
1246 rsvp_filter[RSVPF_SESSION_PROTO], tvb,
1247 offset2+4, 1, FALSE);
1248 proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 1,
1250 tvb_get_guint8(tvb, offset2+5));
1251 proto_tree_add_item(rsvp_object_tree,
1252 rsvp_filter[RSVPF_SESSION_PORT], tvb,
1253 offset2+6, 2, FALSE);
1256 case RSVP_SESSION_TYPE_IPV6:
1257 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1258 "C-type: 2 - IPv6");
1259 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1260 "Destination address: %s",
1261 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1262 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 1,
1264 tvb_get_guint8(tvb, offset2+16));
1265 proto_tree_add_text(rsvp_object_tree, tvb, offset2+17, 1,
1267 tvb_get_guint8(tvb, offset2+17));
1268 proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2,
1269 "Destination port: %u",
1270 tvb_get_ntohs(tvb, offset2+18));
1273 case RSVP_SESSION_TYPE_IPV4_LSP:
1274 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1275 "C-type: 7 - IPv4 LSP");
1276 proto_tree_add_item(rsvp_object_tree,
1277 rsvp_filter[RSVPF_SESSION_IP],
1278 tvb, offset2, 4, FALSE);
1280 proto_tree_add_item(rsvp_object_tree,
1281 rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
1282 tvb, offset2+6, 2, FALSE);
1284 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
1285 "Extended Tunnel ID: %u (%s)",
1286 tvb_get_ntohl(tvb, offset2+8),
1287 ip_to_str(tvb_get_ptr(tvb, offset2+8, 4)));
1288 proto_tree_add_item_hidden(rsvp_object_tree,
1289 rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
1290 tvb, offset2+8, 4, FALSE);
1293 case RSVP_SESSION_TYPE_IPV4_UNI:
1294 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1295 "C-type: 11 - IPv4 UNI");
1296 proto_tree_add_item(rsvp_object_tree,
1297 rsvp_filter[RSVPF_SESSION_IP],
1298 tvb, offset2, 4, FALSE);
1300 proto_tree_add_item(rsvp_object_tree,
1301 rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
1302 tvb, offset2+6, 2, FALSE);
1304 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
1305 "Extended IPv4 Address: %s",
1306 ip_to_str(tvb_get_ptr(tvb, offset2+8, 4)));
1307 proto_tree_add_item_hidden(rsvp_object_tree,
1308 rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
1309 tvb, offset2+8, 4, FALSE);
1312 case RSVP_SESSION_TYPE_IPV4_E_NNI:
1313 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1314 "C-type: 15 - IPv4 E-NNI");
1315 proto_tree_add_item(rsvp_object_tree,
1316 rsvp_filter[RSVPF_SESSION_IP],
1317 tvb, offset2, 4, FALSE);
1319 proto_tree_add_item(rsvp_object_tree,
1320 rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
1321 tvb, offset2+6, 2, FALSE);
1323 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
1324 "Extended IPv4 Address: %s",
1325 ip_to_str(tvb_get_ptr(tvb, offset2+8, 4)));
1326 proto_tree_add_item_hidden(rsvp_object_tree,
1327 rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
1328 tvb, offset2+8, 4, FALSE);
1332 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1333 "C-type: Unknown (%u)",
1335 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length-4,
1336 "Data (%d bytes)", obj_length-4);
1341 /*------------------------------------------------------------------------------
1342 * TLVs for HOP, ERROR and other IF_ID extended objects
1343 *------------------------------------------------------------------------------*/
1345 dissect_rsvp_ifid_tlv (proto_tree *ti, proto_tree *rsvp_object_tree,
1346 tvbuff_t *tvb, int offset, int obj_length,
1353 proto_tree *rsvp_ifid_subtree, *ti2;
1354 int offset2 = offset + 4;
1356 for (tlv_off = 0; tlv_off < obj_length - 12; ) {
1357 tlv_type = tvb_get_ntohs(tvb, offset+tlv_off);
1358 tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2);
1361 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1364 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)));
1366 rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type);
1367 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2,
1369 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2,
1371 tvb_get_ntohs(tvb, offset+tlv_off+2));
1372 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4,
1374 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)));
1375 proto_item_append_text(ti, "Data IPv4: %s. ",
1376 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)));
1383 ifindex_name = " Forward";
1386 ifindex_name = " Reverse";
1388 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1390 "Interface-Index%s TLV - %s, %d",
1392 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)),
1393 tvb_get_ntohl(tvb, offset+tlv_off+8));
1394 rsvp_ifid_subtree = proto_item_add_subtree(ti2, subtree_type);
1395 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off, 2,
1396 "Type: %d (Interface Index%s)", tlv_type, ifindex_name);
1397 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+2, 2,
1399 tvb_get_ntohs(tvb, offset+tlv_off+2));
1400 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+4, 4,
1402 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)));
1403 proto_tree_add_text(rsvp_ifid_subtree, tvb, offset+tlv_off+8, 4,
1405 tvb_get_ntohl(tvb, offset+tlv_off+8));
1406 proto_item_append_text(ti, "Data If-Index%s: %s, %d. ", ifindex_name,
1407 ip_to_str(tvb_get_ptr(tvb, offset+tlv_off+4, 4)),
1408 tvb_get_ntohl(tvb, offset+tlv_off+8));
1412 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
1413 "Logical interface: %u",
1414 tvb_get_ntohl(tvb, offset2+4));
1420 /*------------------------------------------------------------------------------
1422 *------------------------------------------------------------------------------*/
1424 dissect_rsvp_hop (proto_tree *ti, tvbuff_t *tvb,
1425 int offset, int obj_length,
1426 int class, int type,
1429 int offset2 = offset + 4;
1430 proto_tree *rsvp_object_tree;
1432 rsvp_object_tree= proto_item_add_subtree(ti, TREE(TT_HOP));
1434 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1435 "Length: %u", obj_length);
1436 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1437 "Class number: %u - %s",
1441 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1442 "C-type: 1 - IPv4");
1443 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1444 "Neighbor address: %s",
1445 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1446 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
1447 "Logical interface: %u",
1448 tvb_get_ntohl(tvb, offset2+4));
1449 proto_item_set_text(ti, "HOP: IPv4, %s",
1450 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1454 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1455 "C-type: 2 - IPv6");
1456 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1457 "Neighbor address: %s",
1458 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1459 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 4,
1460 "Logical interface: 0x%08x",
1461 tvb_get_ntohl(tvb, offset2+16));
1465 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1466 "C-type: 3 - IPv4 IF-ID");
1467 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1468 "Neighbor address: %s",
1469 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1470 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
1471 "Logical interface: %u",
1472 tvb_get_ntohl(tvb, offset2+4));
1474 proto_item_set_text(ti, "HOP: IPv4 IF-ID. Control IPv4: %s. ",
1475 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1477 dissect_rsvp_ifid_tlv(ti, rsvp_object_tree, tvb, offset+12, obj_length,
1478 TREE(TT_HOP_SUBOBJ));
1483 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1484 "C-type: Unknown (%u)",
1486 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
1487 "Data (%d bytes)", obj_length - 4);
1491 /*------------------------------------------------------------------------------
1493 *------------------------------------------------------------------------------*/
1495 dissect_rsvp_time_values (proto_tree *ti, tvbuff_t *tvb,
1496 int offset, int obj_length,
1497 int class, int type,
1500 int offset2 = offset + 4;
1501 proto_tree *rsvp_object_tree;
1503 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_TIME_VALUES));
1504 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1505 "Length: %u", obj_length);
1506 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1507 "Class number: %u - %s",
1511 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1513 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1514 "Refresh interval: %u ms (%u seconds)",
1515 tvb_get_ntohl(tvb, offset2),
1516 tvb_get_ntohl(tvb, offset2)/1000);
1517 proto_item_set_text(ti, "TIME VALUES: %d ms",
1518 tvb_get_ntohl(tvb, offset2));
1522 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1523 "C-type: Unknown (%u)",
1525 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
1526 "Data (%d bytes)", obj_length - 4);
1531 /*------------------------------------------------------------------------------
1532 * Error value field in ERROR object
1533 *------------------------------------------------------------------------------*/
1535 dissect_rsvp_error_value (proto_tree *ti, tvbuff_t *tvb,
1536 int offset, guint8 error_code)
1539 value_string *rsvp_error_vals = NULL;
1541 error_val = tvb_get_ntohs(tvb, offset);
1542 switch (error_code) {
1543 case RSVP_ERROR_ADMISSION:
1544 rsvp_error_vals = rsvp_admission_control_error_vals;
1546 case RSVP_ERROR_TRAFFIC:
1547 rsvp_error_vals = rsvp_traffic_control_error_vals;
1549 case RSVP_ERROR_ROUTING:
1550 rsvp_error_vals = rsvp_routing_error_vals;
1552 case RSVP_ERROR_NOTIFY:
1553 rsvp_error_vals = rsvp_notify_error_vals;
1555 case RSVP_ERROR_DIFFSERV:
1556 rsvp_error_vals = rsvp_diffserv_error_vals;
1558 switch (error_code) {
1559 case RSVP_ERROR_ADMISSION:
1560 case RSVP_ERROR_TRAFFIC:
1561 case RSVP_ERROR_NOTIFY:
1562 case RSVP_ERROR_ROUTING:
1563 case RSVP_ERROR_DIFFSERV:
1564 if ((error_val & 0xc0) == 0) {
1565 proto_tree_add_text(ti, tvb, offset, 2,
1566 "Error value: %u - %s", error_val,
1567 val_to_str(error_val, rsvp_error_vals, "Unknown (%d)"));
1571 proto_tree_add_text(ti, tvb, offset, 2,
1572 "Error value: %u", error_val);
1577 /*------------------------------------------------------------------------------
1579 *------------------------------------------------------------------------------*/
1581 dissect_rsvp_error (proto_tree *ti, tvbuff_t *tvb,
1582 int offset, int obj_length,
1583 int class, int type,
1586 int offset2 = offset + 4;
1587 proto_tree *rsvp_object_tree;
1589 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_ERROR));
1590 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1591 "Length: %u", obj_length);
1592 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1593 "Class number: %u - %s",
1600 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1601 "C-type: 1 - IPv4");
1602 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1604 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1605 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 1,
1607 tvb_get_guint8(tvb, offset2+4));
1608 error_code = tvb_get_guint8(tvb, offset2+5);
1609 proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 1,
1610 "Error code: %u - %s", error_code,
1611 val_to_str(error_code, rsvp_error_codes, "Unknown (%d)"));
1612 error_val = dissect_rsvp_error_value(rsvp_object_tree, tvb, offset2+6, error_code);
1613 proto_item_set_text(ti, "ERROR: IPv4, Error code: %s, Value: %d, Error Node: %s",
1614 val_to_str(error_code, rsvp_error_codes, "Unknown (%d)"),
1615 error_val, ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1623 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1624 "C-type: 2 - IPv6");
1625 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1627 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1628 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 1,
1630 tvb_get_guint8(tvb, offset2+16));
1631 error_code = tvb_get_guint8(tvb, offset2+17);
1632 proto_tree_add_text(rsvp_object_tree, tvb, offset2+17, 1,
1633 "Error code: %u - %s",
1635 val_to_str(error_code, rsvp_error_codes, "Unknown"));
1636 error_val = dissect_rsvp_error_value(ti, tvb, offset2+18, error_code);
1644 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1645 "C-type: 3 - IPv4 IF-ID");
1646 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1648 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1649 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 1,
1651 tvb_get_guint8(tvb, offset2+4));
1652 error_code = tvb_get_guint8(tvb, offset2+5);
1653 proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 1,
1654 "Error code: %u - %s", error_code,
1655 val_to_str(error_code, rsvp_error_codes, "Unknown (%d)"));
1656 error_val = dissect_rsvp_error_value(ti, tvb, offset2+6, error_code);
1657 proto_item_set_text(ti, "ERROR: IPv4 IF-ID, Error code: %s, Value: %d, Control Node: %s. ",
1658 val_to_str(error_code, rsvp_error_codes, "Unknown (%d)"),
1659 error_val, ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1660 dissect_rsvp_ifid_tlv(ti, rsvp_object_tree, tvb, offset+12, obj_length,
1661 TREE(TT_ERROR_SUBOBJ));
1666 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1667 "C-type: Unknown (%u)",
1669 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
1670 "Data (%d bytes)", obj_length - 4);
1674 /*------------------------------------------------------------------------------
1676 *------------------------------------------------------------------------------*/
1678 dissect_rsvp_scope (proto_tree *ti, tvbuff_t *tvb,
1679 int offset, int obj_length,
1680 int class, int type,
1683 int offset2 = offset + 4;
1684 proto_tree *rsvp_object_tree;
1687 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_SCOPE));
1688 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1689 "Length: %u", obj_length);
1690 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1691 "Class number: %u - %s",
1693 mylen = obj_length - 4;
1696 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1697 "C-type: 1 - IPv4");
1699 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1701 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1709 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1710 "C-type: 2 - IPv6");
1712 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1714 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1722 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1723 "C-type: Unknown (%u)",
1725 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1726 "Data (%d bytes)", mylen);
1730 /*------------------------------------------------------------------------------
1732 *------------------------------------------------------------------------------*/
1734 dissect_rsvp_style (proto_tree *ti, tvbuff_t *tvb,
1735 int offset, int obj_length,
1736 int class, int type,
1739 int offset2 = offset + 4;
1740 proto_tree *rsvp_object_tree;
1742 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_STYLE));
1743 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1744 "Length: %u", obj_length);
1745 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1746 "Class number: %u - %s",
1752 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1754 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1756 tvb_get_guint8(tvb, offset2));
1757 style = tvb_get_ntoh24(tvb, offset2+1);
1758 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1,
1759 3, "Style: 0x%06X - %s", style,
1760 val_to_str(style, style_vals, "Unknown"));
1761 proto_item_set_text(ti, "STYLE: %s (%d)",
1762 val_to_str(style, style_vals, "Unknown"),
1768 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1769 "C-type: Unknown (%u)",
1771 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
1772 "Data (%d bytes)", obj_length - 4);
1777 /*------------------------------------------------------------------------------
1779 *------------------------------------------------------------------------------*/
1781 dissect_rsvp_confirm (proto_tree *ti, tvbuff_t *tvb,
1782 int offset, int obj_length,
1783 int class, int type,
1786 int offset2 = offset + 4;
1787 proto_tree *rsvp_object_tree;
1789 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_CONFIRM));
1790 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1791 "Length: %u", obj_length);
1792 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1793 "Class number: %u - %s",
1797 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1798 "C-type: 1 - IPv4");
1799 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1800 "Receiver address: %s",
1801 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1802 proto_item_set_text(ti, "CONFIRM: Receiver %s",
1803 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1808 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1809 "C-type: 2 - IPv6");
1810 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1811 "Receiver address: %s",
1812 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1817 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1818 "C-type: Unknown (%u)",
1820 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
1821 "Data (%d bytes)", obj_length - 4);
1825 /*------------------------------------------------------------------------------
1826 * SENDER TEMPLATE and FILTERSPEC
1827 *------------------------------------------------------------------------------*/
1829 dissect_rsvp_template_filter (proto_tree *ti, tvbuff_t *tvb,
1830 int offset, int obj_length,
1831 int class, int type,
1834 int offset2 = offset + 4;
1835 proto_tree *rsvp_object_tree;
1838 case RSVP_CLASS_SENDER_TEMPLATE :
1839 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_SENDER_TEMPLATE));
1840 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1841 "Length: %u", obj_length);
1842 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1843 "Class number: %u - %s",
1848 case RSVP_CLASS_FILTER_SPEC :
1849 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_FILTER_SPEC));
1850 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1851 "Length: %u", obj_length);
1852 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1853 "Class number: %u - %s",
1858 proto_item_set_text(ti, summary_template(tvb, offset));
1861 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1862 "C-type: 1 - IPv4");
1863 proto_tree_add_item(rsvp_object_tree,
1864 rsvp_filter[RSVPF_SENDER_IP],
1865 tvb, offset2, 4, FALSE);
1866 proto_tree_add_item(rsvp_object_tree,
1867 rsvp_filter[RSVPF_SENDER_PORT],
1868 tvb, offset2+6, 2, FALSE);
1872 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1873 "C-type: 2 - IPv6");
1874 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1875 "Source address: %s",
1876 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1877 proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2,
1879 tvb_get_ntohs(tvb, offset2+18));
1883 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1884 "C-type: 7 - IPv4 LSP");
1885 proto_tree_add_item(rsvp_object_tree,
1886 rsvp_filter[RSVPF_SENDER_IP],
1887 tvb, offset2, 4, FALSE);
1888 proto_tree_add_item(rsvp_object_tree,
1889 rsvp_filter[RSVPF_SENDER_LSP_ID],
1890 tvb, offset2+6, 2, FALSE);
1894 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1895 "C-type: Unknown (%u)",
1897 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
1898 "Data (%d bytes)", obj_length - 4);
1902 /*------------------------------------------------------------------------------
1904 *------------------------------------------------------------------------------*/
1906 dissect_rsvp_tspec (proto_tree *ti, tvbuff_t *tvb,
1907 int offset, int obj_length,
1908 int class, int type,
1911 int offset2 = offset + 4;
1912 proto_tree *rsvp_object_tree;
1914 proto_tree *tspec_tree, *ti2;
1917 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_TSPEC));
1918 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1919 "Length: %u", obj_length);
1920 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1921 "Class number: %u - %s",
1923 mylen = obj_length - 4;
1927 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1928 "C-type: 1 - Integrated Services");
1929 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1930 "Message format version: %u",
1931 tvb_get_guint8(tvb, offset2)>>4);
1932 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1933 "Data length: %u words, not including header",
1934 tvb_get_ntohs(tvb, offset2+2));
1939 proto_item_set_text(ti, "SENDER TSPEC: IntServ: ");
1945 guint16 param_len_processed;
1948 service_num = tvb_get_guint8(tvb, offset2);
1949 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1950 "Service header: %u - %s",
1952 val_to_str(service_num, qos_vals, "Unknown"));
1953 length = tvb_get_ntohs(tvb, offset2+2);
1954 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1955 "Length of service %u data: %u words, "
1956 "not including header",
1957 service_num, length);
1962 /* Process all known service headers as a set of parameters */
1963 param_len_processed = 0;
1964 while (param_len_processed < length) {
1965 param_id = tvb_get_guint8(tvb, offset2);
1966 param_len = tvb_get_ntohs(tvb, offset2+2) + 1;
1970 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1971 offset2, param_len*4,
1972 "Token Bucket TSpec: ");
1973 tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE));
1975 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
1976 "Parameter %u - %s",
1978 val_to_str(param_id, svc_vals, "Unknown"));
1979 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
1980 "Parameter %u flags: 0x%02x",
1982 tvb_get_guint8(tvb, offset2+1));
1983 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
1984 "Parameter %u data length: %u words, "
1985 "not including header",
1987 tvb_get_ntohs(tvb, offset2+2));
1988 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
1989 "Token bucket rate: %.10g",
1990 tvb_get_ntohieee_float(tvb, offset2+4));
1991 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1992 "Token bucket size: %.10g",
1993 tvb_get_ntohieee_float(tvb, offset2+8));
1994 proto_tree_add_text(tspec_tree, tvb, offset2+12, 4,
1995 "Peak data rate: %.10g",
1996 tvb_get_ntohieee_float(tvb, offset2+12));
1997 proto_tree_add_text(tspec_tree, tvb, offset2+16, 4,
1998 "Minimum policed unit [m]: %u",
1999 tvb_get_ntohl(tvb, offset2+16));
2000 proto_tree_add_text(tspec_tree, tvb, offset2+20, 4,
2001 "Maximum packet size [M]: %u",
2002 tvb_get_ntohl(tvb, offset2+20));
2003 proto_item_append_text(ti, "Token Bucket, %.10g bytes/sec. ",
2004 tvb_get_ntohieee_float(tvb, offset2+4));
2005 proto_item_append_text(ti2, "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u",
2006 tvb_get_ntohieee_float(tvb, offset2+4),
2007 tvb_get_ntohieee_float(tvb, offset2+8),
2008 tvb_get_ntohieee_float(tvb, offset2+12),
2009 tvb_get_ntohl(tvb, offset2+16),
2010 tvb_get_ntohl(tvb, offset2+20));
2014 /* Null Service (RFC2997) */
2015 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2016 offset2, param_len*4,
2017 "Null Service TSpec: ");
2018 tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE));
2020 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
2021 "Parameter %u - %s",
2023 val_to_str(param_id, svc_vals, "Unknown"));
2024 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
2025 "Parameter %u flags: %x",
2027 tvb_get_guint8(tvb, offset2+1));
2028 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
2029 "Parameter %u data length: %u words, "
2030 "not including header",
2032 tvb_get_ntohs(tvb, offset2+2));
2033 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
2034 "Maximum packet size [M]: %u",
2035 tvb_get_ntohl(tvb, offset2+4));
2036 proto_item_append_text(ti, "Null Service. M=%u",
2037 tvb_get_ntohl(tvb, offset2+4));
2038 proto_item_append_text(ti2, "Max pkt size=%u",
2039 tvb_get_ntohl(tvb, offset2+4));
2043 /* Compression hint (RFC3006) */
2044 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2045 offset2, param_len*4,
2046 "Compression Hint: ");
2047 tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE));
2049 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
2050 "Parameter %u - %s",
2052 val_to_str(param_id, svc_vals, "Unknown"));
2053 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
2054 "Parameter %u flags: %x",
2056 tvb_get_guint8(tvb, offset2+1));
2057 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
2058 "Parameter %u data length: %u words, "
2059 "not including header",
2061 tvb_get_ntohs(tvb, offset2+2));
2062 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
2064 tvb_get_ntohl(tvb, offset2+4));
2065 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
2066 "Compression Factor: %u",
2067 tvb_get_ntohl(tvb, offset2+8));
2068 proto_item_append_text(ti, "Compression Hint. Hint=%u, Factor=%u",
2069 tvb_get_ntohl(tvb, offset2+4),
2070 tvb_get_ntohl(tvb, offset2+8));
2071 proto_item_append_text(ti2, "Hint=%u, Factor=%u",
2072 tvb_get_ntohl(tvb, offset2+4),
2073 tvb_get_ntohl(tvb, offset2+8));
2077 proto_tree_add_text(rsvp_object_tree, tvb, offset2, param_len*4,
2078 "Unknown parameter %d, %d words",
2079 param_id, param_len);
2082 param_len_processed += param_len;
2083 offset2 += param_len*4;
2089 case 4: /* SONET/SDH Tspec */
2090 proto_item_set_text(ti, "SENDER TSPEC: SONET/SDH: ");
2092 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2093 "C-type: 4 - SONET/SDH");
2094 signal_type = tvb_get_guint8(tvb, offset2);
2095 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2096 "Signal Type: %d - %s", signal_type,
2097 val_to_str(signal_type,
2098 gmpls_sonet_signal_type_str, "Unknown"));
2099 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
2100 "Requested Concatenation (RCC): %d", tvb_get_guint8(tvb, offset2+1));
2101 tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE));
2102 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
2103 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x01, 8,
2104 "Standard contiguous concatenation",
2105 "No standard contiguous concatenation"));
2106 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
2107 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x02, 8,
2108 "Arbitrary contiguous concatenation",
2109 "No arbitrary contiguous concatenation"));
2110 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2111 "Number of Contiguous Components (NCC): %d", tvb_get_ntohs(tvb, offset2+2));
2112 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2,
2113 "Number of Virtual Components (NVC): %d", tvb_get_ntohs(tvb, offset2+4));
2114 proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2,
2115 "Multiplier (MT): %d", tvb_get_ntohs(tvb, offset2+6));
2116 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
2117 "Transparency (T): 0x%0x", tvb_get_ntohl(tvb, offset2+8));
2118 tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE));
2119 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2120 decode_boolean_bitfield(tvb_get_ntohl(tvb, offset2+8), 0x0001, 32,
2121 "Section/Regenerator Section layer transparency",
2122 "No Section/Regenerator Section layer transparency"));
2123 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2124 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0002, 32,
2125 "Line/Multiplex Section layer transparency",
2126 "No Line/Multiplex Section layer transparency"));
2127 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2128 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0004, 32,
2130 "No J0 transparency"));
2131 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2132 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0008, 32,
2133 "SOH/RSOH DCC transparency",
2134 "No SOH/RSOH DCC transparency"));
2135 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2136 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0010, 32,
2137 "LOH/MSOH DCC transparency",
2138 "No LOH/MSOH DCC transparency"));
2139 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2140 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0020, 32,
2141 "LOH/MSOH Extended DCC transparency",
2142 "No LOH/MSOH Extended DCC transparency"));
2143 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2144 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0040, 32,
2145 "K1/K2 transparency",
2146 "No K1/K2 transparency"));
2147 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2148 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0080, 32,
2150 "No E1 transparency"));
2151 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2152 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0100, 32,
2154 "No F1 transparency"));
2155 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2156 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0200, 32,
2158 "No E2 transparency"));
2159 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2160 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0400, 32,
2162 "No B1 transparency"));
2163 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2164 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0800, 32,
2166 "No B2 transparency"));
2167 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2168 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x1000, 32,
2170 "No M0 transparency"));
2171 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
2172 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x2000, 32,
2174 "No M1 transparency"));
2175 proto_tree_add_text(rsvp_object_tree, tvb, offset2+12, 4,
2176 "Profile (P): %d", tvb_get_ntohl(tvb, offset2+12));
2178 proto_item_append_text(ti, "Signal [%s], RCC %d, NCC %d, NVC %d, MT %d, Transparency %d, Profile %d",
2179 val_to_str(signal_type, gmpls_sonet_signal_type_str, "Unknown"),
2180 tvb_get_guint8(tvb, offset2+1), tvb_get_ntohs(tvb, offset2+2),
2181 tvb_get_ntohs(tvb, offset2+4), tvb_get_ntohs(tvb, offset2+6),
2182 tvb_get_ntohl(tvb, offset2+8), tvb_get_ntohl(tvb, offset2+12));
2185 default: /* Unknown TSpec */
2186 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2187 "C-type: Unknown (%u)",
2189 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2190 "Data (%d bytes)", obj_length - 4);
2196 /*------------------------------------------------------------------------------
2198 *------------------------------------------------------------------------------*/
2200 dissect_rsvp_flowspec (proto_tree *ti, tvbuff_t *tvb,
2201 int offset, int obj_length,
2202 int class, int type,
2205 int offset2 = offset + 4;
2206 proto_tree *rsvp_object_tree;
2207 int mylen, signal_type;
2208 proto_tree *flowspec_tree, *ti2;
2210 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_FLOWSPEC));
2211 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2212 "Length: %u", obj_length);
2213 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2214 "Class number: %u - %s",
2216 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2217 "C-type: %u", type);
2218 mylen = obj_length - 4;
2223 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2224 "Message format version: %u",
2225 tvb_get_guint8(tvb, offset2)>>4);
2226 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2227 "Data length: %u words, not including header",
2228 tvb_get_ntohs(tvb, offset2+2));
2230 proto_item_set_text(ti, "FLOWSPEC: ");
2239 guint16 param_len_processed;
2241 service_num = tvb_get_guint8(tvb, offset2);
2242 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2243 "Service header: %u - %s",
2245 val_to_str(service_num, intsrv_services_str, "Unknown"));
2246 length = tvb_get_ntohs(tvb, offset2+2);
2247 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2248 "Length of service %u data: %u words, "
2249 "not including header",
2256 proto_item_append_text(ti, "%s: ",
2257 val_to_str(service_num, intsrv_services_str,
2260 /* Process all known service headers as a set of parameters */
2261 param_len_processed = 0;
2262 while (param_len_processed < length) {
2263 param_id = tvb_get_guint8(tvb, offset2);
2264 param_len = tvb_get_ntohs(tvb, offset2+2) + 1;
2268 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2269 offset2, param_len*4,
2271 flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE));
2273 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
2274 "Parameter %u - %s",
2276 val_to_str(param_id, svc_vals, "Unknown"));
2277 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
2278 "Parameter %u flags: 0x%02x",
2280 tvb_get_guint8(tvb, offset2+1));
2281 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
2282 "Parameter %u data length: %u words, "
2283 "not including header",
2285 tvb_get_ntohs(tvb, offset2+2));
2286 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
2287 "Token bucket rate: %.10g",
2288 tvb_get_ntohieee_float(tvb, offset2+4));
2289 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2290 "Token bucket size: %.10g",
2291 tvb_get_ntohieee_float(tvb, offset2+8));
2292 proto_tree_add_text(flowspec_tree, tvb, offset2+12, 4,
2293 "Peak data rate: %.10g",
2294 tvb_get_ntohieee_float(tvb, offset2+12));
2295 proto_tree_add_text(flowspec_tree, tvb, offset2+16, 4,
2296 "Minimum policed unit [m]: %u",
2297 tvb_get_ntohl(tvb, offset2+16));
2298 proto_tree_add_text(flowspec_tree, tvb, offset2+20, 4,
2299 "Maximum packet size [M]: %u",
2300 tvb_get_ntohl(tvb, offset2+20));
2301 proto_item_append_text(ti, "Token Bucket, %.10g bytes/sec. ",
2302 tvb_get_ntohieee_float(tvb, offset2+4));
2303 proto_item_append_text(ti2, "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u",
2304 tvb_get_ntohieee_float(tvb, offset2+4),
2305 tvb_get_ntohieee_float(tvb, offset2+8),
2306 tvb_get_ntohieee_float(tvb, offset2+12),
2307 tvb_get_ntohl(tvb, offset2+16),
2308 tvb_get_ntohl(tvb, offset2+20));
2312 /* Guaranteed-rate RSpec */
2313 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2314 offset2, param_len*4,
2315 "Guaranteed-Rate RSpec: ");
2316 flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE));
2317 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
2318 "Parameter %u - %s",
2320 val_to_str(param_id, svc_vals, "Unknown"));
2321 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
2322 "Parameter %u flags: %x",
2324 tvb_get_guint8(tvb, offset2+1));
2325 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
2326 "Parameter %u data length: %u words, "
2327 "not including header",
2329 tvb_get_ntohs(tvb, offset2+2));
2331 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
2333 tvb_get_ntohieee_float(tvb, offset2+4));
2334 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2336 tvb_get_ntohl(tvb, offset2+8));
2337 proto_item_append_text(ti, "RSpec, %.10g bytes/sec. ",
2338 tvb_get_ntohieee_float(tvb, offset2+4));
2339 proto_item_append_text(ti2, "R=%.10g, s=%u",
2340 tvb_get_ntohieee_float(tvb, offset2+4),
2341 tvb_get_ntohl(tvb, offset2+8));
2345 /* Null Service (RFC2997) */
2346 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2347 offset2, param_len*4,
2348 "Null Service Flowspec: ");
2349 flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE));
2351 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
2352 "Parameter %u - %s",
2354 val_to_str(param_id, svc_vals, "Unknown"));
2355 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
2356 "Parameter %u flags: %x",
2358 tvb_get_guint8(tvb, offset2+1));
2359 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
2360 "Parameter %u data length: %u words, "
2361 "not including header",
2363 tvb_get_ntohs(tvb, offset2+2));
2364 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
2365 "Maximum packet size [M]: %u",
2366 tvb_get_ntohl(tvb, offset2+4));
2367 proto_item_append_text(ti, "Null Service. M=%u",
2368 tvb_get_ntohl(tvb, offset2+4));
2369 proto_item_append_text(ti2, "Max pkt size=%u",
2370 tvb_get_ntohl(tvb, offset2+4));
2374 proto_tree_add_text(rsvp_object_tree, tvb, offset2, param_len*4,
2375 "Unknown parameter %d, %d words",
2376 param_id, param_len);
2379 param_len_processed += param_len;
2380 offset2 += param_len * 4;
2383 /* offset2 += length*4; */
2389 proto_item_set_text(ti, "FLOWSPEC: SONET/SDH: ");
2391 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2392 "C-type: 4 - SONET/SDH");
2393 signal_type = tvb_get_guint8(tvb, offset2);
2394 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2395 "Signal Type: %d - %s", signal_type,
2396 val_to_str(signal_type,
2397 gmpls_sonet_signal_type_str, "Unknown"));
2398 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
2399 "Requested Concatenation (RCC): %d", tvb_get_guint8(tvb, offset2+1));
2400 flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE));
2401 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
2402 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x01, 8,
2403 "Standard contiguous concatenation",
2404 "No standard contiguous concatenation"));
2405 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
2406 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x02, 8,
2407 "Arbitrary contiguous concatenation",
2408 "No arbitrary contiguous concatenation"));
2409 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2410 "Number of Contiguous Components (NCC): %d", tvb_get_ntohs(tvb, offset2+2));
2411 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2,
2412 "Number of Virtual Components (NVC): %d", tvb_get_ntohs(tvb, offset2+4));
2413 proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2,
2414 "Multiplier (MT): %d", tvb_get_ntohs(tvb, offset2+6));
2415 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
2416 "Transparency (T): 0x%0x", tvb_get_ntohl(tvb, offset2+8));
2417 flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE));
2418 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2419 decode_boolean_bitfield(tvb_get_ntohl(tvb, offset2+8), 0x0001, 32,
2420 "Section/Regenerator Section layer transparency",
2421 "No Section/Regenerator Section layer transparency"));
2422 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2423 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0002, 32,
2424 "Line/Multiplex Section layer transparency",
2425 "No Line/Multiplex Section layer transparency"));
2426 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2427 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0004, 32,
2429 "No J0 transparency"));
2430 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2431 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0008, 32,
2432 "SOH/RSOH DCC transparency",
2433 "No SOH/RSOH DCC transparency"));
2434 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2435 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0010, 32,
2436 "LOH/MSOH DCC transparency",
2437 "No LOH/MSOH DCC transparency"));
2438 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2439 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0020, 32,
2440 "LOH/MSOH Extended DCC transparency",
2441 "No LOH/MSOH Extended DCC transparency"));
2442 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2443 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0040, 32,
2444 "K1/K2 transparency",
2445 "No K1/K2 transparency"));
2446 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2447 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0080, 32,
2449 "No E1 transparency"));
2450 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2451 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0100, 32,
2453 "No F1 transparency"));
2454 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2455 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0200, 32,
2457 "No E2 transparency"));
2458 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2459 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0400, 32,
2461 "No B1 transparency"));
2462 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2463 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0800, 32,
2465 "No B2 transparency"));
2466 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2467 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x1000, 32,
2469 "No M0 transparency"));
2470 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2471 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x2000, 32,
2473 "No M1 transparency"));
2474 proto_tree_add_text(rsvp_object_tree, tvb, offset2+12, 4,
2475 "Profile (P): %d", tvb_get_ntohl(tvb, offset2+12));
2477 proto_item_append_text(ti, "Signal [%s], RCC %d, NCC %d, NVC %d, MT %d, Transparency %d, Profile %d",
2478 val_to_str(signal_type, gmpls_sonet_signal_type_str, "Unknown"),
2479 tvb_get_guint8(tvb, offset2+1), tvb_get_ntohs(tvb, offset2+2),
2480 tvb_get_ntohs(tvb, offset2+4), tvb_get_ntohs(tvb, offset2+6),
2481 tvb_get_ntohl(tvb, offset2+8), tvb_get_ntohl(tvb, offset2+12));
2491 /*------------------------------------------------------------------------------
2493 *------------------------------------------------------------------------------*/
2495 dissect_rsvp_adspec (proto_tree *ti, tvbuff_t *tvb,
2496 int offset, int obj_length,
2497 int class, int type,
2500 int offset2 = offset + 4;
2501 proto_tree *rsvp_object_tree;
2503 proto_tree *adspec_tree;
2505 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_ADSPEC));
2506 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2507 "Length: %u", obj_length);
2508 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2509 "Class number: %u - %s",
2511 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2512 "C-type: %u", type);
2513 mylen = obj_length - 4;
2515 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2516 "Message format version: %u",
2517 tvb_get_guint8(tvb, offset2)>>4);
2518 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2519 "Data length: %u words, not including header",
2520 tvb_get_ntohs(tvb, offset2+2));
2529 service_num = tvb_get_guint8(tvb, offset2);
2530 str = val_to_str(service_num, intsrv_services_str, "Unknown");
2531 break_bit = tvb_get_guint8(tvb, offset2+1);
2532 length = tvb_get_ntohs(tvb, offset2+2);
2533 ti = proto_tree_add_text(rsvp_object_tree, tvb, offset2,
2536 adspec_tree = proto_item_add_subtree(ti,
2537 TREE(TT_ADSPEC_SUBTREE));
2538 proto_tree_add_text(adspec_tree, tvb, offset2, 1,
2539 "Service header %u - %s",
2541 proto_tree_add_text(adspec_tree, tvb, offset2+1, 1,
2543 "Break bit set":"Break bit not set");
2544 proto_tree_add_text(adspec_tree, tvb, offset2+2, 2,
2545 "Data length: %u words, not including header",
2552 guint16 phdr_length;
2554 id = tvb_get_guint8(tvb, offset2);
2555 phdr_length = tvb_get_ntohs(tvb, offset2+2);
2556 str = match_strval(id, adspec_params);
2566 /* 32-bit unsigned integer */
2567 proto_tree_add_text(adspec_tree, tvb, offset2,
2569 "%s - %u (type %u, length %u)",
2571 tvb_get_ntohl(tvb, offset2+4),
2577 proto_tree_add_text(adspec_tree, tvb, offset2,
2579 "%s - %.10g (type %u, length %u)",
2581 tvb_get_ntohieee_float(tvb, offset2+4),
2585 proto_tree_add_text(adspec_tree, tvb, offset2,
2587 "%s (type %u, length %u)",
2592 proto_tree_add_text(adspec_tree, tvb, offset2,
2594 "Unknown (type %u, length %u)",
2597 offset2 += (phdr_length+1)<<2;
2598 i -= (phdr_length+1)<<2;
2599 mylen -= (phdr_length+1)<<2;
2604 /*------------------------------------------------------------------------------
2606 *------------------------------------------------------------------------------*/
2608 dissect_rsvp_integrity (proto_tree *ti, tvbuff_t *tvb,
2609 int offset, int obj_length,
2610 int class, int type,
2613 int offset2 = offset + 4;
2614 proto_tree *rsvp_object_tree;
2615 proto_tree *ti2, *rsvp_integ_flags_tree;
2618 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_INTEGRITY));
2619 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2620 "Length: %u", obj_length);
2621 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2622 "Class number: %u - %s",
2624 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2625 "C-type: %u", type);
2626 flags = tvb_get_guint8(tvb, offset2);
2627 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2628 "Flags: 0x%02x", flags);
2629 rsvp_integ_flags_tree = proto_item_add_subtree(ti2, TREE(TT_INTEGRITY_FLAGS));
2630 proto_tree_add_text(rsvp_integ_flags_tree, tvb, offset2, 1,
2631 decode_boolean_bitfield(flags, 0x01, 8, "Handshake capable", "Handshake not capable"));
2632 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 6,
2633 "Key Identifier: %s", tvb_bytes_to_str(tvb, offset2+2, 6));
2634 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 8,
2635 "Sequence Number: %" PRIu64, tvb_get_ntoh64(tvb, offset2+8));
2636 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, obj_length - 20,
2637 "Hash: %s", tvb_bytes_to_str(tvb, offset2+16, obj_length - 20));
2640 /*------------------------------------------------------------------------------
2642 *------------------------------------------------------------------------------*/
2644 dissect_rsvp_policy (proto_tree *ti, tvbuff_t *tvb,
2645 int offset, int obj_length,
2646 int class, int type,
2649 int offset2 = offset + 4;
2650 proto_tree *rsvp_object_tree;
2652 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_POLICY));
2653 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2654 "Length: %u", obj_length);
2655 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2656 "Class number: %u - %s",
2658 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2659 "C-type: %u", type);
2660 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2661 "Data (%d bytes)", obj_length - 4);
2664 /*------------------------------------------------------------------------------
2666 *------------------------------------------------------------------------------*/
2668 dissect_rsvp_label_request (proto_tree *ti, tvbuff_t *tvb,
2669 int offset, int obj_length,
2670 int class, int type,
2673 int offset2 = offset + 4;
2674 proto_tree *rsvp_object_tree;
2676 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_LABEL_REQUEST));
2677 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2678 "Length: %u", obj_length);
2679 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2680 "Class number: %u - %s",
2684 unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2);
2685 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2687 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2688 "L3PID: %s (0x%04x)",
2689 val_to_str(l3pid, etype_vals, "Unknown"),
2691 proto_item_set_text(ti, "LABEL REQUEST: Basic: L3PID: %s (0x%04x)",
2692 val_to_str(l3pid, etype_vals, "Unknown"),
2698 unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2);
2699 unsigned short min_vpi, min_vci, max_vpi, max_vci;
2700 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2701 "C-type: 2 (Label Request with ATM label Range)");
2702 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2703 "L3PID: %s (0x%04x)",
2704 val_to_str(l3pid, etype_vals, "Unknown"),
2706 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 1,
2707 "M: %s Merge in Data Plane",
2708 (tvb_get_guint8(tvb, offset2+4) & 0x80) ?
2709 "1: Can" : "0: Cannot");
2710 min_vpi = tvb_get_ntohs(tvb, offset2+4) & 0x7f;
2711 min_vci = tvb_get_ntohs(tvb, offset2+6);
2712 max_vpi = tvb_get_ntohs(tvb, offset2+8) & 0x7f;
2713 max_vci = tvb_get_ntohs(tvb, offset2+10);
2714 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2,
2715 "Min VPI: %d", min_vpi);
2716 proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2,
2717 "Min VCI: %d", min_vci);
2718 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 2,
2719 "Max VPI: %d", max_vpi);
2720 proto_tree_add_text(rsvp_object_tree, tvb, offset2+10, 2,
2721 "Max VCI: %d", max_vci);
2722 proto_item_set_text(ti, "LABEL REQUEST: ATM: L3PID: %s (0x%04x). VPI/VCI: Min: %d/%d, Max: %d/%d. %s Merge. ",
2723 val_to_str(l3pid, etype_vals, "Unknown"), l3pid,
2724 min_vpi, min_vci, max_vpi, max_vci,
2725 (tvb_get_guint8(tvb, offset2+4) & 0x80) ? "Can" : "Cannot");
2730 guint16 l3pid = tvb_get_ntohs(tvb, offset2+2);
2731 guint32 min_dlci, max_dlci, dlci_len, dlci_len_code;
2732 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2733 "C-type: 2 (Label Request with ATM label Range)");
2734 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2735 "L3PID: %s (0x%04x)",
2736 val_to_str(l3pid, etype_vals, "Unknown"),
2738 dlci_len_code = (tvb_get_ntohs(tvb, offset2+4) & 0x0180) >> 7;
2739 min_dlci = tvb_get_ntohl(tvb, offset2+4) & 0x7fffff;
2740 max_dlci = tvb_get_ntohl(tvb, offset2+8) & 0x7fffff;
2741 switch(dlci_len_code) {
2754 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2,
2755 "DLCI Length: %s (%d)",
2756 dlci_len==10 ? "10 bits" :
2757 dlci_len==23 ? "23 bits" :
2758 "INVALID", dlci_len_code);
2759 proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 3,
2760 "Min DLCI: %d", min_dlci);
2761 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 2,
2762 "Max DLCI: %d", max_dlci);
2763 proto_item_set_text(ti, "LABEL REQUEST: Frame: L3PID: %s (0x%04x). DLCI Len: %s. Min DLCI: %d. Max DLCI: %d",
2764 val_to_str(l3pid, etype_vals, "Unknown"), l3pid,
2765 dlci_len==10 ? "10 bits" :
2766 dlci_len==23 ? "23 bits" :
2767 "INVALID", min_dlci, max_dlci);
2771 unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2);
2772 unsigned char lsp_enc = tvb_get_guint8(tvb,offset2);
2773 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2774 "C-type: 4 (Generalized Label Request)");
2775 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2776 "LSP Encoding Type: %s",
2777 val_to_str(lsp_enc, gmpls_lsp_enc_str, "Unknown (%d)"));
2778 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
2779 "Switching Type: %s",
2780 val_to_str(tvb_get_guint8(tvb,offset2+1),
2781 gmpls_switching_type_str, "Unknown (%d)"));
2782 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2783 "G-PID: %s (0x%0x)",
2784 val_to_str(l3pid, gmpls_gpid_str,
2785 val_to_str(l3pid, etype_vals,
2786 "Unknown G-PID(0x%04x)")),
2788 proto_item_set_text(ti, "LABEL REQUEST: Generalized: LSP Encoding=%s, "
2789 "Switching Type=%s, G-PID=%s ",
2790 val_to_str(lsp_enc, gmpls_lsp_enc_str, "Unknown (%d)"),
2791 val_to_str(tvb_get_guint8(tvb,offset2+1),
2792 gmpls_switching_type_str, "Unknown (%d)"),
2793 val_to_str(l3pid, gmpls_gpid_str,
2794 val_to_str(l3pid, etype_vals,
2795 "Unknown (0x%04x)")));
2800 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2801 "C-type: Unknown (%u)",
2803 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2804 "Data (%d bytes)", obj_length - 4);
2810 /*------------------------------------------------------------------------------
2812 *------------------------------------------------------------------------------*/
2814 dissect_rsvp_label (proto_tree *ti, tvbuff_t *tvb,
2815 int offset, int obj_length,
2816 int class, int type,
2819 int offset2 = offset + 4;
2820 proto_tree *rsvp_object_tree;
2824 name = (class==RSVP_CLASS_SUGGESTED_LABEL ? "SUGGESTED LABEL":
2825 (class==RSVP_CLASS_UPSTREAM_LABEL ? "UPSTREAM LABEL":
2827 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_LABEL));
2828 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2829 "Length: %u", obj_length);
2830 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2831 "Class number: %u - %s",
2833 mylen = obj_length - 4;
2836 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2837 "C-type: 1 (Packet Label)");
2838 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2840 tvb_get_ntohl(tvb, offset2));
2841 proto_item_set_text(ti, "%s: %d", name,
2842 tvb_get_ntohl(tvb, offset2));
2846 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2847 "C-type: 2 (Generalized Label)");
2848 proto_item_set_text(ti, "%s: Generalized: ", name);
2849 for (i = 0; i < mylen; i += 4) {
2850 proto_tree_add_text(rsvp_object_tree, tvb, offset2+i, 4,
2851 "Generalized Label: %u",
2852 tvb_get_ntohl(tvb, offset2+i));
2854 proto_item_append_text(ti, "%d%s",
2855 tvb_get_ntohl(tvb, offset2+i),
2857 } else if (i == 16) {
2858 proto_item_append_text(ti, "...");
2864 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2865 "C-type: Unknown (%u)",
2867 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2868 "Data (%d bytes)", mylen);
2873 /*------------------------------------------------------------------------------
2875 *------------------------------------------------------------------------------*/
2877 dissect_rsvp_label_set (proto_tree *ti, tvbuff_t *tvb,
2878 int offset, int obj_length,
2879 int class, int type,
2882 int offset2 = offset + 8;
2883 proto_tree *rsvp_object_tree;
2887 static value_string action_type_vals[] = {
2888 {0, "Inclusive list"},
2889 {1, "Exclusive list"},
2890 {2, "Inclusive range"},
2891 {3, "Exclusive range"},
2895 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_LABEL_SET));
2896 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2897 "Length: %u", obj_length);
2898 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2899 "Class number: %u - %s",
2901 len = obj_length - 8;
2902 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1, "C-type: %u", type);
2903 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1, "Action: %s",
2904 val_to_str(tvb_get_guint8(tvb, offset+4),
2905 action_type_vals, "Unknown (%u)"));
2906 label_type = tvb_get_guint8 (tvb, offset+7);
2907 proto_tree_add_text(rsvp_object_tree, tvb, offset+7, 1, "Label type: %s",
2908 label_type==1 ? "Packet Label" : "Generalized Label");
2910 for (i = 0; i < len/4; i++) {
2911 proto_tree_add_text(rsvp_object_tree, tvb, offset2+i*4, 4,
2912 "Subchannel %u: %u", i+1,
2913 tvb_get_ntohl(tvb, offset2+i*4));
2917 /*------------------------------------------------------------------------------
2919 *------------------------------------------------------------------------------*/
2921 dissect_rsvp_session_attribute (proto_tree *ti, tvbuff_t *tvb,
2922 int offset, int obj_length,
2923 int class, int type,
2926 int offset2 = offset + 4;
2927 proto_tree *rsvp_object_tree;
2930 proto_tree *ti2, *rsvp_sa_flags_tree;
2932 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_SESSION_ATTRIBUTE));
2933 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2934 "Length: %u", obj_length);
2935 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2936 "Class number: %u - %s",
2942 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2943 "C-type: %u - IPv4 LSP (%sResource Affinities)",
2944 type, (type == 1) ? "" : "No ");
2947 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2948 "Exclude-Any: 0x%0x", tvb_get_ntohl(tvb, offset2));
2949 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
2950 "Include-Any: 0x%0x", tvb_get_ntohl(tvb, offset2+4));
2951 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
2952 "Include-All: 0x%0x", tvb_get_ntohl(tvb, offset2+8));
2953 offset2 = offset2+12;
2956 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2957 "Setup priority: %u",
2958 tvb_get_guint8(tvb, offset2));
2959 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
2960 "Hold priority: %u",
2961 tvb_get_guint8(tvb, offset2+1));
2962 flags = tvb_get_guint8(tvb, offset2+2);
2963 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 1,
2964 "Flags: 0x%02x", flags);
2965 rsvp_sa_flags_tree = proto_item_add_subtree(ti2,
2966 TREE(TT_SESSION_ATTRIBUTE_FLAGS));
2967 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
2968 decode_boolean_bitfield(flags, 0x01, 8,
2969 "Local protection desired",
2970 "Local protection not desired"));
2971 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
2972 decode_boolean_bitfield(flags, 0x02, 8,
2973 "Label recording desired",
2974 "Label recording not desired"));
2975 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
2976 decode_boolean_bitfield(flags, 0x04, 8,
2978 "SE style not desired"));
2979 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
2980 decode_boolean_bitfield(flags, 0x08, 8,
2981 "Bandwidth protection desired",
2982 "Bandwidth protection not desired"));
2983 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
2984 decode_boolean_bitfield(flags, 0x10, 8,
2985 "Node protection desired",
2986 "Node protection not desired"));
2988 name_len = tvb_get_guint8(tvb, offset2+3);
2989 proto_tree_add_text(rsvp_object_tree, tvb, offset2+3, 1,
2990 "Name length: %u", name_len);
2991 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, name_len,
2993 tvb_format_text(tvb, offset2+4, name_len));
2995 proto_item_set_text(ti, "SESSION ATTRIBUTE: SetupPrio %d, HoldPrio %d, %s%s%s%s%s [%s]",
2996 tvb_get_guint8(tvb, offset2),
2997 tvb_get_guint8(tvb, offset2+1),
2998 flags &0x01 ? "Local Protection, " : "",
2999 flags &0x02 ? "Label Recording, " : "",
3000 flags &0x04 ? "SE Style, " : "",
3001 flags &0x08 ? "Bandwidth Protection, " : "",
3002 flags &0x10 ? "Node Protection, " : "",
3003 name_len ? tvb_format_text(tvb, offset2+4, name_len) : "");
3007 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3008 "C-type: Unknown (%u)",
3010 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3011 "Data (%d bytes)", obj_length - 4);
3016 /*------------------------------------------------------------------------------
3017 * EXPLICIT ROUTE AND RECORD ROUTE SUBOBJECTS
3018 *------------------------------------------------------------------------------*/
3020 dissect_rsvp_ero_rro_subobjects (proto_tree *ti, proto_tree *rsvp_object_tree,
3022 int offset, int obj_length, int class)
3024 int i, j, k, l, flags;
3025 proto_tree *ti2, *rsvp_ro_subtree, *rsvp_rro_flags_subtree;
3029 case RSVP_CLASS_EXPLICIT_ROUTE:
3030 tree_type = TREE(TT_EXPLICIT_ROUTE_SUBOBJ);
3032 case RSVP_CLASS_RECORD_ROUTE:
3033 tree_type = TREE(TT_RECORD_ROUTE_SUBOBJ);
3040 for (i=1, l = 0; l < obj_length - 4; i++) {
3041 j = tvb_get_guint8(tvb, offset+l) & 0x7f;
3044 k = tvb_get_guint8(tvb, offset+l) & 0x80;
3045 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3047 "IPv4 Subobject - %s%s",
3048 ip_to_str(tvb_get_ptr(tvb, offset+l+2, 4)),
3049 class == RSVP_CLASS_EXPLICIT_ROUTE ?
3050 (k ? ", Loose" : ", Strict") : "");
3052 proto_item_add_subtree(ti2, tree_type);
3053 if (class == RSVP_CLASS_EXPLICIT_ROUTE)
3054 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3055 k ? "Loose Hop " : "Strict Hop");
3056 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3058 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
3060 tvb_get_guint8(tvb, offset+l+1));
3061 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 4,
3063 ip_to_str(tvb_get_ptr(tvb, offset+l+2, 4)));
3064 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+6, 1,
3065 "Prefix length: %u",
3066 tvb_get_guint8(tvb, offset+l+6));
3068 proto_item_append_text(ti, "IPv4 %s%s",
3069 ip_to_str(tvb_get_ptr(tvb, offset+l+2, 4)),
3072 if (class == RSVP_CLASS_RECORD_ROUTE) {
3073 flags = tvb_get_guint8(tvb, offset+l+7);
3075 proto_item_append_text(ti, " (Node-id)");
3076 proto_item_append_text(ti2, " (Node-id)");
3078 if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available");
3079 if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use");
3080 if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail");
3081 if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop");
3082 ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+7, 1,
3083 "Flags: 0x%02x", flags);
3084 rsvp_rro_flags_subtree =
3085 proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS));
3086 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1,
3087 decode_boolean_bitfield(flags, 0x01, 8,
3088 "Local Protection Available",
3089 "Local Protection Not Available"));
3090 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1,
3091 decode_boolean_bitfield(flags, 0x02, 8,
3092 "Local Protection In Use",
3093 "Local Protection Not In Use"));
3094 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1,
3095 decode_boolean_bitfield(flags, 0x04, 8,
3096 "Bandwidth Protection Available",
3097 "Bandwidth Protection Not Available"));
3098 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1,
3099 decode_boolean_bitfield(flags, 0x08, 8,
3100 "Node Protection Available",
3101 "Node Protection Not Available"));
3102 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+7, 1,
3103 decode_boolean_bitfield(flags, 0x10, 8,
3104 "Address Specifies a Node-id Address",
3105 "Address Doesn't Specify a Node-id Address"));
3111 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3115 proto_item_add_subtree(ti2, tree_type);
3116 k = tvb_get_guint8(tvb, offset+l) & 0x80;
3117 if (class == RSVP_CLASS_EXPLICIT_ROUTE)
3118 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3119 k ? "Loose Hop " : "Strict Hop");
3120 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3122 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
3124 tvb_get_guint8(tvb, offset+l+1));
3125 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 16,
3127 ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset+l+2, 16)));
3128 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+18, 1,
3129 "Prefix length: %u",
3130 tvb_get_guint8(tvb, offset+l+18));
3132 proto_item_append_text(ti, "IPv6 [...]%s", k ? " [L]":"");
3134 if (class == RSVP_CLASS_RECORD_ROUTE) {
3135 flags = tvb_get_guint8(tvb, offset+l+19);
3137 proto_item_append_text(ti, " (Node-id)");
3138 proto_item_append_text(ti2, " (Node-id)");
3140 if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available");
3141 if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use");
3142 if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail");
3143 if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop");
3144 ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+19, 1,
3145 "Flags: 0x%02x", flags);
3146 rsvp_rro_flags_subtree =
3147 proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS));
3148 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1,
3149 decode_boolean_bitfield(flags, 0x01, 8,
3150 "Local Protection Available",
3151 "Local Protection Not Available"));
3152 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1,
3153 decode_boolean_bitfield(flags, 0x02, 8,
3154 "Local Protection In Use",
3155 "Local Protection Not In Use"));
3156 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1,
3157 decode_boolean_bitfield(flags, 0x04, 8,
3158 "Backup Tunnel Has Bandwidth",
3159 "Backup Tunnel Does Not Have Bandwidth"));
3160 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1,
3161 decode_boolean_bitfield(flags, 0x08, 8,
3162 "Backup Tunnel Goes To Next-Next-Hop",
3163 "Backup Tunnel Goes To Next-Hop"));
3164 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+19, 1,
3165 decode_boolean_bitfield(flags, 0x10, 8,
3166 "Address Specifies a Node-id Address",
3167 "Address Doesn't Specify a Node-id Address"));
3173 k = tvb_get_guint8(tvb, offset+l) & 0x80;
3174 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3176 "Label Subobject - %d, %s",
3177 tvb_get_ntohl(tvb, offset+l+4),
3178 class == RSVP_CLASS_EXPLICIT_ROUTE ?
3179 (k ? "Loose" : "Strict") : "");
3181 proto_item_add_subtree(ti2, tree_type);
3182 if (class == RSVP_CLASS_EXPLICIT_ROUTE)
3183 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3184 k ? "Loose Hop " : "Strict Hop");
3185 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3187 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
3189 tvb_get_guint8(tvb, offset+l+1));
3190 if (class == RSVP_CLASS_RECORD_ROUTE) {
3191 flags = tvb_get_guint8(tvb, offset+l+2);
3192 if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available");
3193 if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use");
3194 if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail");
3195 if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop");
3196 ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 1,
3197 "Flags: 0x%02x", flags);
3198 rsvp_rro_flags_subtree =
3199 proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS));
3200 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1,
3201 decode_boolean_bitfield(flags, 0x01, 8,
3202 "Local Protection Available",
3203 "Local Protection Not Available"));
3204 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1,
3205 decode_boolean_bitfield(flags, 0x02, 8,
3206 "Local Protection In Use",
3207 "Local Protection Not In Use"));
3208 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1,
3209 decode_boolean_bitfield(flags, 0x04, 8,
3210 "Backup Tunnel Has Bandwidth",
3211 "Backup Tunnel Does Not Have Bandwidth"));
3212 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1,
3213 decode_boolean_bitfield(flags, 0x08, 8,
3214 "Backup Tunnel Goes To Next-Next-Hop",
3215 "Backup Tunnel Goes To Next-Hop"));
3217 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+3, 1,
3219 tvb_get_guint8(tvb, offset+l+3));
3220 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+4, 4,
3222 tvb_get_ntohl(tvb, offset+l+4));
3224 proto_item_append_text(ti, "Label %d%s",
3225 tvb_get_ntohl(tvb, offset+l+4),
3230 case 4: /* Unnumbered Interface-ID */
3231 k = tvb_get_guint8(tvb, offset+l) & 0x80;
3232 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3234 "Unnumbered Interface-ID - %s, %d, %s",
3235 ip_to_str(tvb_get_ptr(tvb, offset+l+4, 4)),
3236 tvb_get_ntohl(tvb, offset+l+8),
3237 class == RSVP_CLASS_EXPLICIT_ROUTE ?
3238 (k ? "Loose" : "Strict") : "");
3240 proto_item_add_subtree(ti2, tree_type);
3241 if (class == RSVP_CLASS_EXPLICIT_ROUTE)
3242 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3243 k ? "Loose Hop " : "Strict Hop");
3244 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3245 "Type: 4 (Unnumbered Interface-ID)");
3246 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
3248 tvb_get_guint8(tvb, offset+l+1));
3249 if (class == RSVP_CLASS_RECORD_ROUTE) {
3250 flags = tvb_get_guint8(tvb, offset+l+2);
3251 if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available");
3252 if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use");
3253 if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail");
3254 if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop");
3255 ti2 = proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 1,
3256 "Flags: 0x%02x", flags);
3257 rsvp_rro_flags_subtree =
3258 proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS));
3259 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1,
3260 decode_boolean_bitfield(flags, 0x01, 8,
3261 "Local Protection Available",
3262 "Local Protection Not Available"));
3263 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1,
3264 decode_boolean_bitfield(flags, 0x02, 8,
3265 "Local Protection In Use",
3266 "Local Protection Not In Use"));
3267 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1,
3268 decode_boolean_bitfield(flags, 0x04, 8,
3269 "Backup Tunnel Has Bandwidth",
3270 "Backup Tunnel Does Not Have Bandwidth"));
3271 proto_tree_add_text(rsvp_rro_flags_subtree, tvb, offset+l+2, 1,
3272 decode_boolean_bitfield(flags, 0x08, 8,
3273 "Backup Tunnel Goes To Next-Next-Hop",
3274 "Backup Tunnel Goes To Next-Hop"));
3276 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+4, 4,
3278 ip_to_str(tvb_get_ptr(tvb, offset+l+4, 4)));
3279 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+8, 4,
3281 tvb_get_ntohl(tvb, offset+l+8));
3283 proto_item_append_text(ti, "Unnum %s/%d%s",
3284 ip_to_str(tvb_get_ptr(tvb, offset+l+4, 4)),
3285 tvb_get_ntohl(tvb, offset+l+8),
3292 if (class == RSVP_CLASS_RECORD_ROUTE) goto defaultsub;
3293 k = tvb_get_ntohs(tvb, offset+l+2);
3294 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3296 "Autonomous System %u",
3299 proto_item_add_subtree(ti2, tree_type);
3300 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3301 "Type: 32 (Autonomous System Number)");
3302 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
3304 tvb_get_guint8(tvb, offset+l+1));
3305 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+2, 2,
3306 "Autonomous System %u", k);
3308 proto_item_append_text(ti, "AS %d",
3309 tvb_get_ntohs(tvb, offset+l+2));
3314 default: /* Unknown subobject */
3316 k = tvb_get_guint8(tvb, offset+l) & 0x80;
3317 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3319 tvb_get_guint8(tvb, offset+l+1),
3320 "Unknown subobject: %d", j);
3322 proto_item_add_subtree(ti2, tree_type);
3323 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3324 k ? "Loose Hop " : "Strict Hop");
3325 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l, 1,
3326 "Type: %u (Unknown)", j);
3327 proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
3329 tvb_get_guint8(tvb, offset+l+1));
3333 l += tvb_get_guint8(tvb, offset+l+1);
3334 if (l < obj_length - 4) {
3336 proto_item_append_text(ti, ", ");
3338 proto_item_append_text(ti, "...");
3343 /*------------------------------------------------------------------------------
3344 * EXPLICIT ROUTE OBJECT
3345 *------------------------------------------------------------------------------*/
3347 dissect_rsvp_explicit_route (proto_tree *ti, tvbuff_t *tvb,
3348 int offset, int obj_length,
3349 int class, int type,
3352 /* int offset2 = offset + 4; */
3353 proto_tree *rsvp_object_tree;
3354 /* int mylen, i, j, k, l; */
3355 /* proto_tree *ti2, *rsvp_ero_subtree; */
3357 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_EXPLICIT_ROUTE));
3358 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3359 "Length: %u", obj_length);
3360 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3361 "Class number: %u - %s",
3363 /* mylen = obj_length - 4; */
3366 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3368 proto_item_set_text(ti, "EXPLICIT ROUTE: ");
3370 dissect_rsvp_ero_rro_subobjects(ti, rsvp_object_tree, tvb,
3371 offset + 4, obj_length, class);
3375 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3376 "C-type: Unknown (%u)",
3378 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4,
3379 "Data (%d bytes)", obj_length - 4);
3384 /*------------------------------------------------------------------------------
3385 * RECORD ROUTE OBJECT
3386 *------------------------------------------------------------------------------*/
3388 dissect_rsvp_record_route (proto_tree *ti, tvbuff_t *tvb,
3389 int offset, int obj_length,
3390 int class, int type,
3393 /* int offset2 = offset + 4; */
3394 proto_tree *rsvp_object_tree;
3395 /* int mylen, i, j, l; */
3396 /* proto_tree *ti2, *rsvp_rro_subtree; */
3398 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_RECORD_ROUTE));
3399 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3400 "Length: %u", obj_length);
3401 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3402 "Class number: %u - %s",
3404 proto_item_set_text(ti, "RECORD ROUTE: ");
3405 /* mylen = obj_length - 4; */
3408 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3411 dissect_rsvp_ero_rro_subobjects(ti, rsvp_object_tree, tvb,
3412 offset + 4, obj_length, class);
3416 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3417 "C-type: Unknown (%u)",
3419 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4,
3420 "Data (%d bytes)", obj_length - 4);
3425 /*------------------------------------------------------------------------------
3427 *------------------------------------------------------------------------------*/
3429 dissect_rsvp_message_id (proto_tree *ti, tvbuff_t *tvb,
3430 int offset, int obj_length,
3431 int class, int type,
3434 int offset2 = offset + 4;
3435 proto_tree *rsvp_object_tree;
3437 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_MESSAGE_ID));
3438 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3439 "Length: %u", obj_length);
3440 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3441 "Class number: %u - %s",
3445 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3447 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
3448 "Flags: %d", tvb_get_guint8(tvb, offset+4));
3449 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
3450 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
3451 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
3452 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
3453 proto_item_set_text(ti, "MESSAGE-ID: %d %s",
3454 tvb_get_ntohl(tvb, offset+8),
3455 tvb_get_guint8(tvb, offset+4) & 1 ? "(Ack Desired)" : "");
3459 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3460 "C-type: Unknown (%u)",
3462 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3463 "Data (%d bytes)", obj_length - 4);
3468 /*------------------------------------------------------------------------------
3470 *------------------------------------------------------------------------------*/
3472 dissect_rsvp_message_id_ack (proto_tree *ti, tvbuff_t *tvb,
3473 int offset, int obj_length,
3474 int class, int type,
3477 int offset2 = offset + 4;
3478 proto_tree *rsvp_object_tree;
3480 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_MESSAGE_ID_ACK));
3481 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3482 "Length: %u", obj_length);
3483 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3484 "Class number: %u - %s",
3488 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3490 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
3491 "Flags: %d", tvb_get_guint8(tvb, offset+4));
3492 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
3493 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
3494 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
3495 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
3496 proto_item_set_text(ti, "MESSAGE-ID ACK: %d", tvb_get_ntohl(tvb, offset+8));
3500 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3502 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
3503 "Flags: %d", tvb_get_guint8(tvb, offset+4));
3504 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
3505 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
3506 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
3507 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
3508 proto_item_set_text(ti, "MESSAGE-ID NACK: %d", tvb_get_ntohl(tvb, offset+8));
3512 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3513 "C-type: Unknown (%u)",
3515 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3516 "Data (%d bytes)", obj_length - 4);
3521 /*------------------------------------------------------------------------------
3523 *------------------------------------------------------------------------------*/
3525 dissect_rsvp_message_id_list (proto_tree *ti, tvbuff_t *tvb,
3526 int offset, int obj_length,
3527 int class, int type,
3530 int offset2 = offset + 4;
3531 proto_tree *rsvp_object_tree;
3534 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_MESSAGE_ID_LIST));
3535 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3536 "Length: %u", obj_length);
3537 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3538 "Class number: %u - %s",
3542 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3544 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
3545 "Flags: %d", tvb_get_guint8(tvb, offset+4));
3546 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
3547 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
3548 for (mylen = 8; mylen < obj_length; mylen += 4)
3549 proto_tree_add_text(rsvp_object_tree, tvb, offset+mylen, 4,
3550 "Message-ID: %d", tvb_get_ntohl(tvb, offset+mylen));
3551 proto_item_set_text(ti, "MESSAGE-ID LIST: %d IDs",
3552 (obj_length - 8)/4);
3556 mylen = obj_length - 4;
3557 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3558 "C-type: Unknown (%u)",
3560 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3561 "Data (%d bytes)", obj_length - 4);
3566 /*------------------------------------------------------------------------------
3568 *------------------------------------------------------------------------------*/
3570 dissect_rsvp_hello (proto_tree *ti, tvbuff_t *tvb,
3571 int offset, int obj_length,
3572 int class, int type,
3575 proto_tree *rsvp_object_tree;
3577 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_HELLO_OBJ));
3578 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3579 "Length: %u", obj_length);
3580 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3581 "Class number: %u - %s",
3586 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3587 "C-Type: 1 - HELLO %s object",
3588 type==1 ? "REQUEST" : "ACK");
3589 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4,
3590 "Source Instance: 0x%x",tvb_get_ntohl(tvb, offset+4));
3591 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
3592 "Destination Instance: 0x%x",tvb_get_ntohl(tvb, offset+8));
3593 proto_item_append_text(ti, ": %s. Src Instance: 0x%0x. Dest Instance: 0x%0x. ",
3594 type==1 ? "REQUEST" : "ACK",
3595 tvb_get_ntohl(tvb, offset+4),
3596 tvb_get_ntohl(tvb, offset+8));
3599 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3600 "C-Type: %d - UNKNOWN", type);
3605 /*------------------------------------------------------------------------------
3607 *------------------------------------------------------------------------------*/
3609 dissect_rsvp_dclass (proto_tree *ti, tvbuff_t *tvb,
3610 int offset, int obj_length,
3611 int class, int type,
3614 int offset2 = offset + 4;
3615 proto_tree *rsvp_object_tree;
3618 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_DCLASS));
3619 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3620 "Length: %u", obj_length);
3621 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3622 "Class number: %u - %s",
3624 proto_item_set_text(ti, "DCLASS: ");
3627 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3629 for (mylen = 4; mylen < obj_length; mylen += 4) {
3630 proto_tree_add_text(rsvp_object_tree, tvb, offset+mylen+3, 1,
3632 val_to_str(tvb_get_guint8(tvb, offset+mylen+3),
3633 dscp_vals, "Unknown (%d)"));
3634 proto_item_append_text(ti, "%d%s",
3635 tvb_get_guint8(tvb, offset+mylen+3)>>2,
3636 mylen==obj_length-4 ? "":
3638 mylen==16 ? ", ..." : "");
3643 mylen = obj_length - 4;
3644 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3645 "C-type: Unknown (%u)",
3647 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
3648 "Data (%d bytes)", mylen);
3653 /*------------------------------------------------------------------------------
3654 * ADMINISTRATIVE STATUS
3655 *------------------------------------------------------------------------------*/
3657 dissect_rsvp_admin_status (proto_tree *ti, tvbuff_t *tvb,
3658 int offset, int obj_length,
3659 int class, int type,
3662 int offset2 = offset + 4;
3663 proto_tree *rsvp_object_tree;
3664 proto_tree *ti2, *rsvp_admin_subtree;
3667 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_ADMIN_STATUS));
3668 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3669 "Length: %u", obj_length);
3670 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3671 "Class number: %u - %s",
3673 proto_item_set_text(ti, "ADMIN STATUS: ");
3676 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3678 status = tvb_get_ntohl(tvb, offset2);
3679 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
3680 "Admin Status: 0x%08x", status);
3681 rsvp_admin_subtree =
3682 proto_item_add_subtree(ti2, TREE(TT_ADMIN_STATUS_FLAGS));
3683 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 4,
3684 decode_boolean_bitfield(status, 0x80000000, 32,
3686 "R: Do not reflect"));
3687 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 4,
3688 decode_boolean_bitfield(status, 0x04, 32,
3691 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 4,
3692 decode_boolean_bitfield(status, 0x02, 32,
3693 "A: Administratively Down",
3695 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 4,
3696 decode_boolean_bitfield(status, 0x01, 32,
3697 "D: Delete In Progress",
3699 proto_item_set_text(ti, "ADMIN-STATUS: %s %s %s %s",
3700 (status & (1<<31)) ? "Reflect" : "",
3701 (status & (1<<2)) ? "Testing" : "",
3702 (status & (1<<1)) ? "Admin-Down" : "",
3703 (status & (1<<0)) ? "Deleting" : "");
3707 mylen = obj_length - 4;
3708 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3709 "C-type: Unknown (%u)",
3711 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3712 "Data (%d bytes)", obj_length - 4);
3717 /*------------------------------------------------------------------------------
3718 * LSP TUNNEL INTERFACE ID
3719 *------------------------------------------------------------------------------*/
3721 dissect_rsvp_lsp_tunnel_if_id (proto_tree *ti, tvbuff_t *tvb,
3722 int offset, int obj_length,
3723 int class, int type,
3726 int offset2 = offset + 4;
3727 proto_tree *rsvp_object_tree;
3729 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_LSP_TUNNEL_IF_ID));
3730 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3731 "Length: %u", obj_length);
3732 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3733 "Class number: %u - %s",
3735 proto_item_set_text(ti, "LSP INTERFACE-ID: ");
3738 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3739 "C-type: 1 - IPv4");
3740 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
3742 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
3743 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
3744 "Interface ID: %u", tvb_get_ntohl(tvb, offset2+4));
3745 proto_item_set_text(ti, "LSP INTERFACE-ID: IPv4, Router-ID %s, Interface-ID %d",
3746 ip_to_str(tvb_get_ptr(tvb, offset2, 4)),
3747 tvb_get_ntohl(tvb, offset2+4));
3751 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3752 "C-type: Unknown (%u)",
3754 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3755 "Data (%d bytes)", obj_length - 4);
3760 /*------------------------------------------------------------------------------
3762 *------------------------------------------------------------------------------*/
3764 dissect_rsvp_gen_uni (proto_tree *ti, tvbuff_t *tvb,
3765 int offset, int obj_length,
3766 int class, int type,
3769 int offset2 = offset + 4;
3770 proto_tree *rsvp_object_tree;
3771 int mylen, i, j, k, l, m;
3772 proto_tree *ti2, *rsvp_gen_uni_subtree;
3773 int s_len, s_class, s_type;
3775 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_GEN_UNI));
3776 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3777 "Length: %u", obj_length);
3778 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3779 "Class number: %u - %s",
3781 proto_item_set_text(ti, "GENERALIZED UNI: ");
3783 mylen = obj_length - 4;
3787 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3789 for (i=1, l = 0; l < mylen; i++) {
3790 j = tvb_get_guint8(tvb, offset2+l+2);
3793 case 2: /* We do source and destination TNA together */
3794 c = (j==1) ? "Source" : "Destination";
3795 k = tvb_get_guint8(tvb, offset2+l+3);
3798 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3800 "%s IPv4 TNA - %s", c,
3801 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)));
3802 rsvp_gen_uni_subtree =
3803 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
3804 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
3805 "Class: %d (%s)", j, c);
3806 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
3808 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
3810 tvb_get_ntohs(tvb, offset2+l));
3811 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 4,
3813 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)));
3815 proto_item_append_text(ti, "%s IPv4 %s", c,
3816 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)));
3821 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3824 rsvp_gen_uni_subtree =
3825 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
3826 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
3827 "Class: %d (%s)", j, c);
3828 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
3830 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
3832 tvb_get_ntohs(tvb, offset2+l));
3833 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 4,
3836 proto_item_append_text(ti, "%s IPv6", c);
3841 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3842 offset2+l, tvb_get_ntohs(tvb, offset2+l),
3844 rsvp_gen_uni_subtree =
3845 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
3846 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
3847 "Class: %d (%s)", j, c);
3848 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
3850 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
3852 tvb_get_ntohs(tvb, offset2+l));
3853 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4,
3854 tvb_get_ntohs(tvb, offset2+l)-4,
3857 proto_item_append_text(ti, "%s NSAP", c);
3862 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3863 offset2+l, tvb_get_ntohs(tvb, offset2+l),
3864 "%s UNKNOWN TNA", c);
3865 rsvp_gen_uni_subtree =
3866 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
3867 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
3868 "Class: %d (%s)", j, c);
3869 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
3870 "Type: %d (UNKNOWN)", j);
3871 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
3873 tvb_get_ntohs(tvb, offset2+l));
3874 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4,
3875 tvb_get_ntohs(tvb, offset2+l)-4,
3878 proto_item_append_text(ti, "%s UNKNOWN", c);
3884 case 3: /* Diversity subobject */
3885 k = tvb_get_guint8(tvb, offset2+l+3);
3889 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3890 offset2+l, tvb_get_ntohs(tvb, offset2+l),
3891 "Diversity Subobject");
3892 rsvp_gen_uni_subtree =
3893 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
3894 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
3895 "Class: %d (Diversity)", j);
3896 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
3897 "Type: %d", tvb_get_guint8(tvb, offset2+l+3));
3898 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
3900 tvb_get_ntohs(tvb, offset2+l));
3901 m = tvb_get_guint8(tvb, offset2+l+4) >> 4;
3902 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1,
3903 "Diversity: %d - %s", m,
3904 val_to_str(m, ouni_guni_diversity_str, "Unknown"));
3905 s_len = tvb_get_ntohs(tvb, offset2+l+8);
3906 s_class = tvb_get_guint8(tvb, offset2+l+10);
3907 s_type = tvb_get_guint8(tvb, offset2+l+11);
3908 ti2 = proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+8,
3910 dissect_rsvp_session(ti2, tvb, offset2+l+8, s_len, s_class, s_type,
3911 val_to_str(s_class, rsvp_class_vals, "Unknown"));
3913 s_len = tvb_get_ntohs(tvb, offset2+l+8);
3914 s_class = tvb_get_guint8(tvb, offset2+l+10);
3915 s_type = tvb_get_guint8(tvb, offset2+l+11);
3916 ti2 = proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+8,
3918 dissect_rsvp_template_filter(ti2, tvb, offset2+l+8, s_len, s_class, s_type,
3919 val_to_str(s_class, rsvp_class_vals, "Unknown"));
3922 proto_item_append_text(ti, "Diversity");
3929 case 4: /* Egress Label */
3930 k = tvb_get_guint8(tvb, offset2+l+3);
3931 if (k == 1) /* Egress label sub-type */
3932 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3933 offset2+l, tvb_get_ntohs(tvb, offset2+l),
3934 "Egress Label Subobject");
3935 else if (k == 2) /* SPC_label sub-type (see G.7713.2) */
3936 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3937 offset2+l, tvb_get_ntohs(tvb, offset2+l),
3938 "SPC Label Subobject");
3940 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3941 offset2+l, tvb_get_ntohs(tvb, offset2+l),
3942 "Unknown Label Subobject");
3943 rsvp_gen_uni_subtree = proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
3944 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
3945 "Class: %d (Egress/SPC Label)", j);
3946 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
3948 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
3950 tvb_get_ntohs(tvb, offset2+l));
3951 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1,
3953 decode_boolean_bitfield(
3954 tvb_get_guint8(tvb, offset2+l+4), 0x80, 8,
3955 "U: 1 - Upstream label/port ID",
3956 "U: 0 - Downstream label/port ID"));
3957 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+7, 1,
3958 "Label type: %u", tvb_get_guint8(tvb, offset2+l+7));
3959 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+8, 4,
3960 "Logical Port ID: %u", tvb_get_ntohl(tvb, offset2+l+8));
3961 proto_item_append_text(ti2, ": %s, Label type %d, Port ID %d, Label ",
3962 tvb_get_guint8(tvb, offset2+l+4) & 0x80 ?
3963 "Upstream" : "Downstream",
3964 tvb_get_guint8(tvb, offset2+l+7),
3965 tvb_get_ntohl(tvb, offset2+l+8));
3966 for (j=12; j < tvb_get_ntohs(tvb, offset2+l); j+=4) {
3967 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+8, 4,
3968 "Label: %u", tvb_get_ntohl(tvb, offset2+l+j));
3969 proto_item_append_text(ti2, "%u ", tvb_get_ntohl(tvb, offset2+l+j));
3973 proto_item_append_text(ti, "Egress Label");
3975 proto_item_append_text(ti, "SPC Label");
3979 case 5: /* Service Level */
3980 k = tvb_get_guint8(tvb, offset2+l+3);
3984 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3985 offset2+l, tvb_get_ntohs(tvb, offset2+l),
3986 "Service Level Subobject");
3987 rsvp_gen_uni_subtree =
3988 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
3989 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
3990 "Class: %d (Egress Label)", j);
3991 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
3992 "Type: %d", tvb_get_guint8(tvb, offset2+l+3));
3993 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
3995 tvb_get_ntohs(tvb, offset2+l));
3996 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1,
3997 "Service Level: %u", tvb_get_guint8(tvb, offset2+l+4));
3998 proto_item_append_text(ti2, ": %u", tvb_get_guint8(tvb, offset2+l+4));
4000 proto_item_append_text(ti, "Service Level %d", tvb_get_guint8(tvb, offset2+l+4));
4006 default: /* Unknown subobject */
4007 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
4009 tvb_get_ntohs(tvb, offset2+l),
4010 "Unknown subobject: %u",
4012 rsvp_gen_uni_subtree =
4013 proto_item_add_subtree(ti2, TREE(TT_GEN_UNI_SUBOBJ));
4014 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 1,
4015 "Type: %u (Unknown)", j);
4016 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+1, 1,
4018 tvb_get_guint8(tvb, offset2+l+1));
4022 l += tvb_get_guint8(tvb, offset2+l+1);
4025 proto_item_append_text(ti, ", ");
4027 proto_item_append_text(ti, "...");
4034 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4035 "C-type: Unknown (%u)",
4037 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
4038 "Data (%d bytes)", mylen);
4043 /*------------------------------------------------------------------------------
4045 *------------------------------------------------------------------------------*/
4047 dissect_rsvp_call_id (proto_tree *ti, tvbuff_t *tvb,
4048 int offset, int obj_length,
4049 int class, int c_type,
4054 int offset2 = offset + 4;
4055 int offset3, offset4, len;
4056 proto_tree *rsvp_object_tree;
4058 static value_string address_type_vals[] = {
4063 {0x7f, "0x7f (Vendor-defined)"},
4067 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_CALL_ID));
4068 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
4069 "Length: %u", obj_length);
4070 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
4071 "Class number: %u - %s",
4073 proto_item_set_text(ti, "CALL-ID");
4074 type = tvb_get_guint8 (tvb, offset2);
4079 offset3 = offset2 + 4;
4080 len = obj_length - 16;
4081 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4082 "C-type: 1 (operator specific)");
4083 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, "Address type: %s",
4084 val_to_str(type, address_type_vals, "Unknown (%u)"));
4085 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 3, "Reserved: %u",
4086 tvb_get_ntoh24(tvb, offset2+1));
4089 offset3 = offset2 + 16;
4090 len = obj_length - 28;
4091 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4092 "C-type: 2 (globally unique)");
4093 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, "Address type: %s",
4094 val_to_str(type, address_type_vals, "Unknown (%u)"));
4095 str = tvb_get_string (tvb, offset2 + 1, 3);
4096 proto_tree_add_text(rsvp_object_tree, tvb, offset2 + 1, 3,
4097 "International Segment: %s", str);
4099 str = tvb_get_string (tvb, offset2 + 4, 12);
4100 proto_tree_add_text(rsvp_object_tree, tvb, offset2 + 4, 12,
4101 "National Segment: %s", str);
4107 offset4 = offset3 + 4;
4108 proto_tree_add_text(rsvp_object_tree, tvb, offset3, 4, "Source Transport Network addr: %s",
4109 ip_to_str(tvb_get_ptr(tvb, offset3, 4)));
4113 offset4 = offset3 + 16;
4114 proto_tree_add_text(rsvp_object_tree, tvb, offset3, 16, "Source Transport Network addr: %s",
4115 ip6_to_str((const struct e_in6_addr *) tvb_get_ptr(tvb, offset3, 16)));
4119 offset4 = offset3 + 20;
4120 proto_tree_add_text(rsvp_object_tree, tvb, offset3, 20, "Source Transport Network addr: %s",
4121 tvb_bytes_to_str(tvb, offset3, 20));
4125 offset4 = offset3 + 6;
4126 proto_tree_add_text(rsvp_object_tree, tvb, offset3, 6, "Source Transport Network addr: %s",
4127 tvb_bytes_to_str(tvb, offset3, 6));
4131 offset4 = offset3 + len;
4132 proto_tree_add_text(rsvp_object_tree, tvb, offset3, len, "Source Transport Network addr: %s",
4133 tvb_bytes_to_str(tvb, offset3, len));
4137 offset4 = offset3 + len;
4138 proto_tree_add_text(rsvp_object_tree, tvb, offset3, len, "Unknow Transport Network type: %d",
4142 proto_tree_add_text(rsvp_object_tree, tvb, offset4, 8, "Local Identifier: %s",
4143 tvb_bytes_to_str(tvb, offset4, 8));
4147 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4148 "C-type: Unknown (%u)", type);
4149 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
4150 "Data (%d bytes)", obj_length - 4);
4155 /*------------------------------------------------------------------------------
4156 * RESTART CAPABILITY
4157 *------------------------------------------------------------------------------*/
4159 dissect_rsvp_restart_cap (proto_tree *ti, tvbuff_t *tvb,
4160 int offset, int obj_length,
4161 int class, int type,
4164 int offset2 = offset + 4;
4165 proto_tree *rsvp_object_tree;
4167 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_RESTART_CAP));
4168 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
4169 "Length: %u", obj_length);
4170 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
4171 "Class number: %u - %s",
4173 proto_item_set_text(ti, "RESTART CAPABILITY: ");
4176 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4178 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
4179 "Restart Time: %d ms",
4180 tvb_get_ntohl(tvb, offset2));
4181 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
4182 "Recovery Time: %d ms",
4183 tvb_get_ntohl(tvb, offset2+4));
4184 proto_item_append_text(ti, "Restart Time: %d ms. Recovery Time: %d ms.",
4185 tvb_get_ntohl(tvb, offset2), tvb_get_ntohl(tvb, offset2+4));
4189 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4190 "C-type: Unknown (%u)",
4192 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
4193 "Data (%d bytes)", obj_length - 4);
4198 /*------------------------------------------------------------------------------
4199 * PROTECTION INFORMATION
4200 *------------------------------------------------------------------------------*/
4202 dissect_rsvp_protection_info (proto_tree *ti, tvbuff_t *tvb,
4203 int offset, int obj_length,
4204 int class, int type,
4207 int offset2 = offset + 4;
4208 proto_tree *rsvp_object_tree;
4210 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_PROTECTION_INFO));
4211 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
4212 "Length: %u", obj_length);
4213 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
4214 "Class number: %u - %s",
4216 proto_item_set_text(ti, "PROTECTION_INFO: ");
4219 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4220 "C-type: 1 - IPv4");
4221 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
4223 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
4224 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
4225 "Interface ID: %u", tvb_get_ntohl(tvb, offset2+4));
4226 proto_item_append_text(ti, "Router-ID %s, Interface-ID %d",
4227 ip_to_str(tvb_get_ptr(tvb, offset2, 4)),
4228 tvb_get_ntohl(tvb, offset2+4));
4232 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4233 "C-type: Unknown (%u)",
4235 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
4236 "Data (%d bytes)", obj_length - 4);
4241 /*------------------------------------------------------------------------------
4243 *------------------------------------------------------------------------------*/
4245 dissect_rsvp_fast_reroute (proto_tree *ti, tvbuff_t *tvb,
4246 int offset, int obj_length,
4247 int class, int type,
4250 proto_tree *rsvp_object_tree;
4252 proto_tree *ti2, *rsvp_frr_flags_tree;
4254 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_FAST_REROUTE));
4255 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
4256 "Length: %u", obj_length);
4257 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
4258 "Class number: %u - %s",
4260 proto_item_set_text(ti, "FAST_REROUTE: ");
4264 if ((type==1 && obj_length!=24) || (type==7 && obj_length!=20)) {
4265 proto_tree_add_text(rsvp_object_tree, tvb, offset, obj_length,
4266 "<<<Invalid length: cannot decode>>>");
4267 proto_item_append_text(ti, "Invalid length");
4270 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4271 "C-type: %u", type);
4272 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
4273 "Setup Priority: %d", tvb_get_guint8(tvb, offset+4));
4274 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 1,
4275 "Hold Priority: %d", tvb_get_guint8(tvb, offset+5));
4276 proto_tree_add_text(rsvp_object_tree, tvb, offset+6, 1,
4277 "Hop Limit: %d", tvb_get_guint8(tvb, offset+6));
4279 flags = tvb_get_guint8(tvb, offset+7);
4280 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset+7, 1,
4281 "Flags: 0x%02x", flags);
4282 rsvp_frr_flags_tree = proto_item_add_subtree(ti2,
4283 TREE(TT_FAST_REROUTE_FLAGS));
4284 proto_tree_add_text(rsvp_frr_flags_tree, tvb, offset+7, 1,
4285 decode_boolean_bitfield(flags, 0x01, 8,
4286 "One-to-One Backup desired",
4287 "One-to-One Backup not desired"));
4288 proto_tree_add_text(rsvp_frr_flags_tree, tvb, offset+7, 1,
4289 decode_boolean_bitfield(flags, 0x02, 8,
4290 "Facility Backup desired",
4291 "Facility Backup not desired"));
4292 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
4293 "Bandwidth: %.10g", tvb_get_ntohieee_float(tvb, offset+8));
4294 proto_tree_add_text(rsvp_object_tree, tvb, offset+12, 4,
4295 "Exclude-Any: 0x%0x", tvb_get_ntohl(tvb, offset+12));
4296 proto_tree_add_text(rsvp_object_tree, tvb, offset+16, 4,
4297 "Include-Any: 0x%0x", tvb_get_ntohl(tvb, offset+16));
4299 proto_tree_add_text(rsvp_object_tree, tvb, offset+20, 4,
4300 "Include-All: 0x%0x", tvb_get_ntohl(tvb, offset+20));
4303 proto_item_append_text(ti, "%s%s",
4304 flags &0x01 ? "One-to-One Backup, " : "",
4305 flags &0x02 ? "Facility Backup" : "");
4309 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4310 "C-type: Unknown (%u)",
4312 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4,
4313 "Data (%d bytes)", obj_length - 4);
4318 /*------------------------------------------------------------------------------
4320 *------------------------------------------------------------------------------*/
4322 dissect_rsvp_detour (proto_tree *ti, tvbuff_t *tvb,
4323 int offset, int obj_length,
4324 int class, int type,
4327 proto_tree *rsvp_object_tree;
4328 int remaining_length, count;
4331 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_DETOUR));
4332 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
4333 "Length: %u", obj_length);
4334 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
4335 "Class number: %u - %s",
4337 proto_item_set_text(ti, "DETOUR: ");
4341 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4342 "C-type: %u", type);
4343 for (remaining_length = obj_length - 4, count = 1;
4344 remaining_length > 0; remaining_length -= 8, count++) {
4345 if (remaining_length < 8) {
4346 proto_tree_add_text(rsvp_object_tree, tvb, offset+remaining_length,
4347 obj_length-remaining_length,
4348 "<<<Invalid length: cannot decode>>>");
4349 proto_item_append_text(ti, "Invalid length");
4353 proto_tree_add_text(rsvp_object_tree, tvb, offset+(4*iter), 4,
4354 "PLR ID %d: %s", count,
4355 ip_to_str(tvb_get_ptr(tvb, offset+(4*iter), 4)));
4357 proto_tree_add_text(rsvp_object_tree, tvb, offset+(4*iter), 4,
4358 "Avoid Node ID %d: %s", count,
4359 ip_to_str(tvb_get_ptr(tvb, offset+(4*iter), 4)));
4364 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
4365 "C-type: Unknown (%u)",
4367 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, obj_length - 4,
4368 "Data (%d bytes)", obj_length - 4);
4373 /*------------------------------------------------------------------------------
4375 *------------------------------------------------------------------------------*/
4377 dissect_rsvp_diffserv (proto_tree *ti, tvbuff_t *tvb,
4378 int offset, int obj_length,
4379 int class, int type,
4383 proto_tree *rsvp_object_tree;
4385 int *hfindexes[] = {
4386 &rsvp_filter[RSVPF_DIFFSERV_MAP],
4387 &rsvp_filter[RSVPF_DIFFSERV_MAP_EXP],
4388 &rsvp_filter[RSVPF_DIFFSERV_PHBID],
4389 &rsvp_filter[RSVPF_DIFFSERV_PHBID_DSCP],
4390 &rsvp_filter[RSVPF_DIFFSERV_PHBID_CODE],
4391 &rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT14],
4392 &rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT15]
4395 &TREE(TT_DIFFSERV_MAP),
4396 &TREE(TT_DIFFSERV_MAP_PHBID)
4399 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_DIFFSERV));
4400 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
4401 "Length: %u", obj_length);
4402 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
4403 "Class number: %u - %s",
4405 proto_item_set_text(ti, "DIFFSERV: ");
4409 proto_tree_add_text(rsvp_object_tree, tvb, offset, 1,
4410 "C-type: 1 - E-LSP");
4411 proto_tree_add_uint(rsvp_object_tree, rsvp_filter[RSVPF_DIFFSERV_MAPNB],
4413 mapnb = tvb_get_guint8(tvb, offset + 4) & 15);
4414 proto_item_append_text(ti, "E-LSP, %u MAP%s", mapnb,
4415 (mapnb == 0) ? "" : "s");
4418 for (count = 0; count < mapnb; count++) {
4419 dissect_diffserv_mpls_common(tvb, rsvp_object_tree, type,
4420 offset, hfindexes, etts);
4425 proto_item_append_text(ti, "L-LSP");
4426 proto_tree_add_text(rsvp_object_tree, tvb, offset, 1,
4427 "C-type: 2 - L-LSP");
4428 dissect_diffserv_mpls_common(tvb, rsvp_object_tree, type,
4429 offset + 3, hfindexes, etts);
4432 proto_tree_add_text(rsvp_object_tree, tvb, offset, 1,
4433 "C-type: Unknown (%u)", type);
4434 proto_tree_add_text(rsvp_object_tree, tvb, offset + 1, obj_length - 4,
4435 "Data (%d bytes)", obj_length - 4);
4439 /*------------------------------------------------------------------------------
4440 * Dissect a single RSVP message in a tree
4441 *------------------------------------------------------------------------------*/
4443 dissect_rsvp_msg_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
4446 proto_tree *rsvp_tree = NULL;
4447 proto_tree *rsvp_header_tree;
4448 proto_tree *rsvp_object_tree;
4450 guint16 cksum, computed_cksum;
4455 guint8 message_type;
4456 int session_off, tempfilt_off;
4463 ver_flags = tvb_get_guint8(tvb, 0);
4464 msg_length = tvb_get_ntohs(tvb, 6);
4465 message_type = tvb_get_guint8(tvb, 1);
4467 ti = proto_tree_add_item(tree, proto_rsvp, tvb, offset, msg_length,
4469 rsvp_tree = proto_item_add_subtree(ti, tree_mode);
4470 proto_item_append_text(rsvp_tree, ": ");
4471 proto_item_append_text(rsvp_tree, val_to_str(message_type, message_type_vals,
4473 find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off);
4475 proto_item_append_text(rsvp_tree, summary_session(tvb, session_off));
4477 proto_item_append_text(rsvp_tree, summary_template(tvb, tempfilt_off));
4479 ti = proto_tree_add_text(rsvp_tree, tvb, offset, 8, "RSVP Header. %s",
4480 val_to_str(message_type, message_type_vals,
4481 "Unknown Message (%u). "));
4482 rsvp_header_tree = proto_item_add_subtree(ti, TREE(TT_HDR));
4484 proto_tree_add_text(rsvp_header_tree, tvb, offset, 1, "RSVP Version: %u",
4485 (ver_flags & 0xf0)>>4);
4486 proto_tree_add_text(rsvp_header_tree, tvb, offset, 1, "Flags: %02x",
4488 proto_tree_add_uint(rsvp_header_tree, rsvp_filter[RSVPF_MSG], tvb,
4489 offset+1, 1, message_type);
4490 switch (RSVPF_MSG + message_type) {
4496 case RSVPF_PATHTEAR:
4497 case RSVPF_RESVTEAR:
4498 case RSVPF_RCONFIRM:
4499 case RSVPF_RTEARCONFIRM:
4502 case RSVPF_SREFRESH:
4504 proto_tree_add_boolean_hidden(rsvp_header_tree, rsvp_filter[RSVPF_MSG + message_type], tvb,
4509 proto_tree_add_protocol_format(rsvp_header_tree, proto_malformed, tvb, offset+1, 1,
4510 "Invalid message type: %u", message_type);
4514 cksum = tvb_get_ntohs(tvb, offset+2);
4515 if (!pinfo->fragmented && (int) tvb_length(tvb) >= msg_length) {
4516 /* The packet isn't part of a fragmented datagram and isn't
4517 truncated, so we can checksum it. */
4518 cksum_vec[0].ptr = tvb_get_ptr(tvb, 0, msg_length);
4519 cksum_vec[0].len = msg_length;
4520 computed_cksum = in_cksum(&cksum_vec[0], 1);
4521 if (computed_cksum == 0) {
4522 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
4523 "Message Checksum: 0x%04x (correct)",
4526 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
4527 "Message Checksum: 0x%04x (incorrect, should be 0x%04x)",
4529 in_cksum_shouldbe(cksum, computed_cksum));
4532 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
4533 "Message Checksum: 0x%04x",
4536 proto_tree_add_text(rsvp_header_tree, tvb, offset+4, 1,
4538 tvb_get_guint8(tvb, offset+4));
4539 proto_tree_add_text(rsvp_header_tree, tvb, offset+6, 2,
4540 "Message length: %u", msg_length);
4545 if (message_type == RSVP_MSG_BUNDLE) {
4546 /* Bundle message. Dissect component messages */
4547 if (rsvp_bundle_dissect) {
4549 while (len < msg_length) {
4552 sub_len = tvb_get_ntohs(tvb, len+6);
4553 tvb_sub = tvb_new_subset(tvb, len, sub_len, sub_len);
4554 dissect_rsvp_msg_tree(tvb_sub, pinfo, rsvp_tree, TREE(TT_BUNDLE_COMPMSG));
4558 proto_tree_add_text(rsvp_tree, tvb, offset, msg_length - len,
4559 "Bundle Component Messages Not Dissected");
4564 while (len < msg_length) {
4569 obj_length = tvb_get_ntohs(tvb, offset);
4570 class = tvb_get_guint8(tvb, offset+2);
4571 type = tvb_get_guint8(tvb, offset+3);
4572 type_str = val_to_str(class, rsvp_class_vals, "Unknown");
4573 proto_tree_add_uint_hidden(rsvp_tree, rsvp_filter[RSVPF_OBJECT], tvb,
4574 offset, obj_length, class);
4575 ti = proto_tree_add_item(rsvp_tree, rsvp_filter[rsvp_class_to_filter_num(class)],
4576 tvb, offset, obj_length, FALSE);
4582 case RSVP_CLASS_SESSION:
4583 dissect_rsvp_session(ti, tvb, offset, obj_length, class, type, type_str);
4586 case RSVP_CLASS_HOP:
4587 dissect_rsvp_hop(ti, tvb, offset, obj_length, class, type, type_str);
4590 case RSVP_CLASS_TIME_VALUES:
4591 dissect_rsvp_time_values(ti, tvb, offset, obj_length, class, type, type_str);
4594 case RSVP_CLASS_ERROR:
4595 dissect_rsvp_error(ti, tvb, offset, obj_length, class, type, type_str);
4598 case RSVP_CLASS_SCOPE:
4599 dissect_rsvp_scope(ti, tvb, offset, obj_length, class, type, type_str);
4602 case RSVP_CLASS_STYLE:
4603 dissect_rsvp_style(ti, tvb, offset, obj_length, class, type, type_str);
4606 case RSVP_CLASS_CONFIRM:
4607 dissect_rsvp_confirm(ti, tvb, offset, obj_length, class, type, type_str);
4610 case RSVP_CLASS_SENDER_TEMPLATE:
4611 case RSVP_CLASS_FILTER_SPEC:
4612 dissect_rsvp_template_filter(ti, tvb, offset, obj_length, class, type, type_str);
4615 case RSVP_CLASS_SENDER_TSPEC:
4616 dissect_rsvp_tspec(ti, tvb, offset, obj_length, class, type, type_str);
4619 case RSVP_CLASS_FLOWSPEC:
4620 dissect_rsvp_flowspec(ti, tvb, offset, obj_length, class, type, type_str);
4623 case RSVP_CLASS_ADSPEC:
4624 dissect_rsvp_adspec(ti, tvb, offset, obj_length, class, type, type_str);
4627 case RSVP_CLASS_INTEGRITY:
4628 dissect_rsvp_integrity(ti, tvb, offset, obj_length, class, type, type_str);
4631 case RSVP_CLASS_POLICY:
4632 dissect_rsvp_policy(ti, tvb, offset, obj_length, class, type, type_str);
4635 case RSVP_CLASS_LABEL_REQUEST:
4636 dissect_rsvp_label_request(ti, tvb, offset, obj_length, class, type, type_str);
4639 case RSVP_CLASS_UPSTREAM_LABEL:
4640 case RSVP_CLASS_SUGGESTED_LABEL:
4641 case RSVP_CLASS_LABEL:
4642 dissect_rsvp_label(ti, tvb, offset, obj_length, class, type, type_str);
4645 case RSVP_CLASS_LABEL_SET:
4646 dissect_rsvp_label_set(ti, tvb, offset, obj_length, class, type, type_str);
4649 case RSVP_CLASS_SESSION_ATTRIBUTE:
4650 dissect_rsvp_session_attribute(ti, tvb, offset, obj_length, class, type, type_str);
4653 case RSVP_CLASS_EXPLICIT_ROUTE:
4654 dissect_rsvp_explicit_route(ti, tvb, offset, obj_length, class, type, type_str);
4657 case RSVP_CLASS_RECORD_ROUTE:
4658 dissect_rsvp_record_route(ti, tvb, offset, obj_length, class, type, type_str);
4661 case RSVP_CLASS_MESSAGE_ID:
4662 dissect_rsvp_message_id(ti, tvb, offset, obj_length, class, type, type_str);
4665 case RSVP_CLASS_MESSAGE_ID_ACK:
4666 dissect_rsvp_message_id_ack(ti, tvb, offset, obj_length, class, type, type_str);
4669 case RSVP_CLASS_MESSAGE_ID_LIST:
4670 dissect_rsvp_message_id_list(ti, tvb, offset, obj_length, class, type, type_str);
4673 case RSVP_CLASS_HELLO:
4674 dissect_rsvp_hello(ti, tvb, offset, obj_length, class, type, type_str);
4677 case RSVP_CLASS_DCLASS:
4678 dissect_rsvp_dclass(ti, tvb, offset, obj_length, class, type, type_str);
4681 case RSVP_CLASS_ADMIN_STATUS:
4682 dissect_rsvp_admin_status(ti, tvb, offset, obj_length, class, type, type_str);
4685 case RSVP_CLASS_LSP_TUNNEL_IF_ID:
4686 dissect_rsvp_lsp_tunnel_if_id(ti, tvb, offset, obj_length, class, type, type_str);
4689 case RSVP_CLASS_GENERALIZED_UNI:
4690 dissect_rsvp_gen_uni(ti, tvb, offset, obj_length, class, type, type_str);
4693 case RSVP_CLASS_CALL_ID:
4694 dissect_rsvp_call_id(ti, tvb, offset, obj_length, class, type, type_str);
4697 case RSVP_CLASS_RESTART_CAP:
4698 dissect_rsvp_restart_cap(ti, tvb, offset, obj_length, class, type, type_str);
4701 case RSVP_CLASS_PROTECTION:
4702 dissect_rsvp_protection_info(ti, tvb, offset, obj_length, class, type, type_str);
4705 case RSVP_CLASS_FAST_REROUTE:
4706 dissect_rsvp_fast_reroute(ti, tvb, offset, obj_length, class, type, type_str);
4709 case RSVP_CLASS_DETOUR:
4710 dissect_rsvp_detour(ti, tvb, offset, obj_length, class, type, type_str);
4713 case RSVP_CLASS_DIFFSERV:
4714 dissect_rsvp_diffserv(ti, tvb, offset, obj_length, class, type, type_str);
4717 case RSVP_CLASS_NULL:
4719 rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_UNKNOWN_CLASS));
4720 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
4721 "Length: %u", obj_length);
4722 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
4723 "Class number: %u - %s",
4725 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
4726 "Data (%d bytes)", obj_length - 4);
4730 if (obj_length == 0)
4732 offset += obj_length;
4737 /*------------------------------------------------------------------------------
4739 *------------------------------------------------------------------------------*/
4741 dissect_rsvp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
4744 guint8 message_type;
4746 int session_off, tempfilt_off;
4748 if (check_col(pinfo->cinfo, COL_PROTOCOL))
4749 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSVP");
4750 if (check_col(pinfo->cinfo, COL_INFO))
4751 col_clear(pinfo->cinfo, COL_INFO);
4753 ver_flags = tvb_get_guint8(tvb, 0);
4754 message_type = tvb_get_guint8(tvb, 1);
4755 msg_length = tvb_get_ntohs(tvb, 6);
4757 if (check_col(pinfo->cinfo, COL_INFO)) {
4758 col_add_str(pinfo->cinfo, COL_INFO,
4759 val_to_str(message_type, message_type_vals, "Unknown (%u). "));
4760 find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off);
4762 col_append_str(pinfo->cinfo, COL_INFO, summary_session(tvb, session_off));
4764 col_append_str(pinfo->cinfo, COL_INFO, summary_template(tvb, tempfilt_off));
4767 if (check_col(pinfo->cinfo, COL_INFO)) {
4768 col_add_str(pinfo->cinfo, COL_INFO,
4769 val_to_str(message_type, message_type_vals, "Unknown (%u). "));
4770 if (message_type == RSVP_MSG_BUNDLE) {
4771 col_add_str(pinfo->cinfo, COL_INFO,
4772 rsvp_bundle_dissect ?
4773 "Component Messages Dissected" :
4774 "Component Messages Not Dissected");
4776 find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off);
4778 col_append_str(pinfo->cinfo, COL_INFO, summary_session(tvb, session_off));
4780 col_append_str(pinfo->cinfo, COL_INFO, summary_template(tvb, tempfilt_off));
4785 dissect_rsvp_msg_tree(tvb, pinfo, tree, TREE(TT_RSVP));
4790 register_rsvp_prefs (void)
4792 module_t *rsvp_module;
4794 rsvp_module = prefs_register_protocol(proto_rsvp, NULL);
4795 prefs_register_bool_preference(
4796 rsvp_module, "process_bundle",
4797 "Dissect sub-messages in BUNDLE message",
4798 "Specifies whether Ethereal should decode and display sub-messages within BUNDLE messages",
4799 &rsvp_bundle_dissect);
4803 proto_register_rsvp(void)
4807 /* Build the tree array */
4808 for (i=0; i<TT_MAX; i++)
4809 ett_tree[i] = &(ett_treelist[i]);
4811 proto_rsvp = proto_register_protocol("Resource ReserVation Protocol (RSVP)",
4813 proto_register_field_array(proto_rsvp, rsvpf_info, array_length(rsvpf_info));
4814 proto_register_subtree_array(ett_tree, array_length(ett_tree));
4815 register_rsvp_prefs();
4819 proto_reg_handoff_rsvp(void)
4821 dissector_handle_t rsvp_handle;
4823 rsvp_handle = create_dissector_handle(dissect_rsvp, proto_rsvp);
4824 dissector_add("ip.proto", IP_PROTO_RSVP, rsvp_handle);