2 * Routines for RSVP packet disassembly
4 * (c) Copyright Ashok Narayanan <ashokn@cisco.com>
6 * $Id: packet-rsvp.c,v 1.72 2002/08/02 23:35:58 jmayer Exp $
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>
57 #ifdef NEED_SNPRINTF_H
58 # include "snprintf.h"
61 #include <epan/tvbuff.h>
62 #include <epan/packet.h>
68 #include "packet-rsvp.h"
69 #include "packet-ip.h"
70 #include "packet-frame.h"
72 static int proto_rsvp = -1;
74 static gint ett_rsvp = -1;
75 static gint ett_rsvp_hdr = -1;
76 static gint ett_rsvp_session = -1;
77 static gint ett_rsvp_hop = -1;
78 static gint ett_rsvp_time_values = -1;
79 static gint ett_rsvp_error = -1;
80 static gint ett_rsvp_scope = -1;
81 static gint ett_rsvp_style = -1;
82 static gint ett_rsvp_confirm = -1;
83 static gint ett_rsvp_sender_template = -1;
84 static gint ett_rsvp_filter_spec = -1;
85 static gint ett_rsvp_sender_tspec = -1;
86 static gint ett_rsvp_sender_tspec_subtree = -1;
87 static gint ett_rsvp_flowspec = -1;
88 static gint ett_rsvp_flowspec_subtree = -1;
89 static gint ett_rsvp_adspec = -1;
90 static gint ett_rsvp_adspec_subtree = -1;
91 static gint ett_rsvp_integrity = -1;
92 static gint ett_rsvp_integrity_flags = -1;
93 static gint ett_rsvp_dclass = -1;
94 static gint ett_rsvp_lsp_tunnel_if_id = -1;
95 static gint ett_rsvp_policy = -1;
96 static gint ett_rsvp_label = -1;
97 static gint ett_rsvp_label_request = -1;
98 static gint ett_rsvp_session_attribute = -1;
99 static gint ett_rsvp_session_attribute_flags = -1;
100 static gint ett_rsvp_hello_obj = -1;
101 static gint ett_rsvp_explicit_route = -1;
102 static gint ett_rsvp_explicit_route_subobj = -1;
103 static gint ett_rsvp_record_route = -1;
104 static gint ett_rsvp_record_route_subobj = -1;
105 static gint ett_rsvp_hop_subobj = -1;
106 static gint ett_rsvp_admin_status = -1;
107 static gint ett_rsvp_admin_status_flags = -1;
108 static gint ett_rsvp_gen_uni = -1;
109 static gint ett_rsvp_gen_uni_subobj = -1;
110 static gint ett_rsvp_bundle_compmsg = -1;
111 static gint ett_rsvp_unknown_class = -1;
113 /* Should we dissect bundle messages? */
114 static gboolean rsvp_bundle_dissect = TRUE;
117 * RSVP message types.
120 * http://www.iana.org/assignments/rsvp-parameters
123 RSVP_MSG_PATH=1, /* RFC 2205 */
124 RSVP_MSG_RESV, /* RFC 2205 */
125 RSVP_MSG_PERR, /* RFC 2205 */
126 RSVP_MSG_RERR, /* RFC 2205 */
127 RSVP_MSG_PTEAR, /* RFC 2205 */
128 RSVP_MSG_RTEAR, /* RFC 2205 */
129 RSVP_MSG_CONFIRM, /* XXX - DREQ, RFC 2745? */
130 /* 9 is DREP, RFC 2745 */
131 RSVP_MSG_RTEAR_CONFIRM=10, /* from Fred Baker at Cisco */
132 /* 11 is unassigned */
133 RSVP_MSG_BUNDLE = 12, /* RFC 2961 */
134 RSVP_MSG_ACK, /* RFC 2961 */
136 RSVP_MSG_SREFRESH = 15, /* RFC 2961 */
137 /* 16, 17, 18, 19 not listed */
138 RSVP_MSG_HELLO = 20 /* RFC 3209 */
139 /* 25 is Integrity Challenge
140 RFC 2747, RFC 3097 */
141 /* 26 is Integrity Response
142 RFC 2747, RFC 3097 */
143 /* 66 is DSBM_willing [SBM] */
144 /* 67 is I_AM_DSBM [SBM] */
145 /* [SBM] is Subnet Bandwidth
146 Manager ID from July 1997 */
147 } rsvp_message_types;
149 static value_string message_type_vals[] = {
150 {RSVP_MSG_PATH, "PATH Message. "},
151 {RSVP_MSG_RESV, "RESV Message. "},
152 {RSVP_MSG_PERR, "PATH ERROR Message. "},
153 {RSVP_MSG_RERR, "RESV ERROR Message. "},
154 {RSVP_MSG_PTEAR, "PATH TEAR Message. "},
155 {RSVP_MSG_RTEAR, "RESV TEAR Message. "},
156 {RSVP_MSG_CONFIRM, "CONFIRM Message. "},
157 {RSVP_MSG_RTEAR_CONFIRM, "RESV TEAR CONFIRM Message. "},
158 {RSVP_MSG_BUNDLE, "BUNDLE Message. "},
159 {RSVP_MSG_ACK, "ACK Message. "},
160 {RSVP_MSG_SREFRESH, "SREFRESH Message. "},
161 {RSVP_MSG_HELLO, "HELLO Message. "},
168 #define MAX_RSVP_CLASS 15
175 RSVP_CLASS_INTEGRITY,
176 RSVP_CLASS_TIME_VALUES,
181 RSVP_CLASS_FILTER_SPEC,
182 RSVP_CLASS_SENDER_TEMPLATE,
183 RSVP_CLASS_SENDER_TSPEC,
189 RSVP_CLASS_LABEL_REQUEST=19,
190 RSVP_CLASS_EXPLICIT_ROUTE,
191 RSVP_CLASS_RECORD_ROUTE,
195 RSVP_CLASS_MESSAGE_ID,
196 RSVP_CLASS_MESSAGE_ID_ACK,
197 RSVP_CLASS_MESSAGE_ID_LIST,
199 RSVP_CLASS_RECOVERY_LABEL = 34,
200 RSVP_CLASS_UPSTREAM_LABEL,
201 RSVP_CLASS_LABEL_SET,
202 RSVP_CLASS_PROTECTION,
204 RSVP_CLASS_SUGGESTED_LABEL = 129,
205 RSVP_CLASS_ACCEPTABLE_LABEL_SET,
206 RSVP_CLASS_RESTART_CAP,
208 RSVP_CLASS_NOTIFY_REQUEST = 195,
209 RSVP_CLASS_ADMIN_STATUS,
211 RSVP_CLASS_SESSION_ATTRIBUTE = 207,
212 RSVP_CLASS_GENERALIZED_UNI,
213 RSVP_CLASS_DCLASS = 225,
214 RSVP_CLASS_LSP_TUNNEL_IF_ID = 227
217 static value_string rsvp_class_vals[] = {
218 {RSVP_CLASS_NULL, "NULL object"},
219 {RSVP_CLASS_SESSION, "SESSION object"},
220 {RSVP_CLASS_HOP, "HOP object"},
221 {RSVP_CLASS_INTEGRITY, "INTEGRITY object"},
222 {RSVP_CLASS_TIME_VALUES, "TIME VALUES object"},
223 {RSVP_CLASS_ERROR, "ERROR object"},
224 {RSVP_CLASS_SCOPE, "SCOPE object"},
225 {RSVP_CLASS_STYLE, "STYLE object"},
226 {RSVP_CLASS_FLOWSPEC, "FLOWSPEC object"},
227 {RSVP_CLASS_FILTER_SPEC, "FILTER SPEC object"},
228 {RSVP_CLASS_SENDER_TEMPLATE, "SENDER TEMPLATE object"},
229 {RSVP_CLASS_SENDER_TSPEC, "SENDER TSPEC object"},
230 {RSVP_CLASS_ADSPEC, "ADSPEC object"},
231 {RSVP_CLASS_POLICY, "POLICY object"},
232 {RSVP_CLASS_CONFIRM, "CONFIRM object"},
233 {RSVP_CLASS_LABEL, "LABEL object"},
234 {RSVP_CLASS_LABEL_REQUEST, "LABEL REQUEST object"},
235 {RSVP_CLASS_EXPLICIT_ROUTE, "EXPLICIT ROUTE object"},
236 {RSVP_CLASS_RECORD_ROUTE, "RECORD ROUTE object"},
237 {RSVP_CLASS_SESSION_ATTRIBUTE, "SESSION ATTRIBUTE object"},
238 {RSVP_CLASS_MESSAGE_ID, "MESSAGE-ID object"},
239 {RSVP_CLASS_MESSAGE_ID_ACK, "MESSAGE-ID ACK/NACK object"},
240 {RSVP_CLASS_MESSAGE_ID_LIST, "MESSAGE-ID LIST object"},
241 {RSVP_CLASS_HELLO, "HELLO object"},
242 {RSVP_CLASS_RECOVERY_LABEL, "RECOVERY-LABEL object"},
243 {RSVP_CLASS_UPSTREAM_LABEL, "UPSTREAM-LABEL object"},
244 {RSVP_CLASS_LABEL_SET, "LABEL-SET object"},
245 {RSVP_CLASS_PROTECTION, "PROTECTION object"},
246 {RSVP_CLASS_SUGGESTED_LABEL, "SUGGESTED-LABEL object"},
247 {RSVP_CLASS_ACCEPTABLE_LABEL_SET, "ACCEPTABLE-LABEL-SET object"},
248 {RSVP_CLASS_RESTART_CAP, "RESTART-CAPABILITY object"},
249 {RSVP_CLASS_DCLASS, "DCLASS object"},
250 {RSVP_CLASS_LSP_TUNNEL_IF_ID, "LSP-TUNNEL INTERFACE-ID object"},
251 {RSVP_CLASS_NOTIFY_REQUEST, "NOTIFY-REQUEST object"},
252 {RSVP_CLASS_ADMIN_STATUS, "ADMIN-STATUS object"},
253 {RSVP_CLASS_GENERALIZED_UNI, "GENERALIZED-UNI object"},
260 enum rsvp_error_types {
261 RSVP_ERROR_CONFIRM = 0,
262 RSVP_ERROR_ADMISSION,
265 RSVP_ERROR_NO_SENDER,
266 RSVP_ERROR_CONFLICT_RESV_STYLE,
267 RSVP_ERROR_UNKNOWN_RESV_STYLE,
268 RSVP_ERROR_CONFLICT_DEST_PORTS,
269 RSVP_ERROR_CONFLICT_SRC_PORTS,
270 RSVP_ERROR_PREEMPTED=12,
271 RSVP_ERROR_UNKNOWN_CLASS,
272 RSVP_ERROR_UNKNOWN_C_TYPE,
273 RSVP_ERROR_TRAFFIC = 21,
274 RSVP_ERROR_TRAFFIC_SYSTEM,
280 static value_string rsvp_error_vals[] = {
281 {RSVP_ERROR_CONFIRM, "Confirmation"},
282 {RSVP_ERROR_ADMISSION, "Admission Control Failure "},
283 {RSVP_ERROR_POLICY, "Policy Control Failure"},
284 {RSVP_ERROR_NO_PATH, "No PATH information for this RESV message"},
285 {RSVP_ERROR_NO_SENDER, "No sender information for this RESV message"},
286 {RSVP_ERROR_CONFLICT_RESV_STYLE, "Conflicting reservation styles"},
287 {RSVP_ERROR_UNKNOWN_RESV_STYLE, "Unknown reservation style"},
288 {RSVP_ERROR_CONFLICT_DEST_PORTS, "Conflicting destination ports"},
289 {RSVP_ERROR_CONFLICT_SRC_PORTS, "Conflicting source ports"},
290 {RSVP_ERROR_PREEMPTED, "Service preempted"},
291 {RSVP_ERROR_UNKNOWN_CLASS, "Unknown object class"},
292 {RSVP_ERROR_UNKNOWN_C_TYPE, "Unknown object C-type"},
293 {RSVP_ERROR_TRAFFIC, "Traffic Control Error"},
294 {RSVP_ERROR_TRAFFIC_SYSTEM, "Traffic Control System Error"},
295 {RSVP_ERROR_SYSTEM, "RSVP System Error"},
296 {RSVP_ERROR_ROUTING, "Routing Error"},
297 {RSVP_ERROR_NOTIFY, "RSVP Notify Error"},
302 * Defines the reservation style plus style-specific information that
303 * is not a FLOWSPEC or FILTER_SPEC object, in a RESV message.
305 #define RSVP_DISTINCT (1 << 3)
306 #define RSVP_SHARED (2 << 3)
307 #define RSVP_SHARING_MASK (RSVP_DISTINCT | RSVP_SHARED)
309 #define RSVP_SCOPE_WILD 1
310 #define RSVP_SCOPE_EXPLICIT 2
311 #define RSVP_SCOPE_MASK 0x07
313 #define RSVP_WF (RSVP_SHARED | RSVP_SCOPE_WILD)
314 #define RSVP_FF (RSVP_DISTINCT | RSVP_SCOPE_EXPLICIT)
315 #define RSVP_SE (RSVP_SHARED | RSVP_SCOPE_EXPLICIT)
317 static value_string style_vals[] = {
318 { RSVP_WF, "Wildcard Filter" },
319 { RSVP_FF, "Fixed Filter" },
320 { RSVP_SE, "Shared-Explicit" },
325 RSVP_SESSION_TYPE_IPV4 = 1,
326 RSVP_SESSION_TYPE_IPV6,
328 RSVP_SESSION_TYPE_IPV4_LSP = 7,
329 RSVP_SESSION_TYPE_IPV6_LSP,
331 RSVP_SESSION_TYPE_IPV4_UNI = 9
335 * Defines a desired QoS, in a RESV message.
337 enum qos_service_type {
338 QOS_QUALITATIVE = 128, /* Qualitative service */
339 QOS_NULL = 6, /* Null service (RFC2997) */
340 QOS_CONTROLLED_LOAD= 5, /* Controlled Load Service */
341 QOS_GUARANTEED = 2, /* Guaranteed service */
342 QOS_TSPEC = 1 /* Traffic specification */
345 static value_string qos_vals[] = {
346 { QOS_QUALITATIVE, "Qualitative QoS" },
347 { QOS_NULL, "Null-Service QoS" },
348 { QOS_CONTROLLED_LOAD, "Controlled-load QoS" },
349 { QOS_GUARANTEED, "Guaranteed rate QoS" },
350 { QOS_TSPEC, "Traffic specification" },
354 static value_string svc_vals[] = {
355 { 126, "Compression Hint" },
356 { 127, "Token bucket" },
357 { 128, "Null Service" },
358 { 130, "Guaranteed-rate RSpec" },
362 enum rsvp_spec_types { INTSRV = 2 };
364 enum intsrv_services {
369 INTSRV_QUALITATIVE = 128
372 static value_string intsrv_services_str[] = {
373 {INTSRV_GENERAL, "Default General Parameters"},
374 {INTSRV_GTD, "Guaranteed Rate"},
375 {INTSRV_CLOAD, "Controlled Load"},
376 {INTSRV_NULL, "Null Service"},
377 {INTSRV_QUALITATIVE, "Null Service"},
382 enum intsrv_field_name {
383 INTSRV_NON_IS_HOPS = 1, INTSRV_COMPOSED_NON_IS_HOPS,
384 INTSRV_IS_HOPS, INTSRV_COMPOSED_IS_HOPS,
385 INTSRV_PATH_BANDWIDTH, INTSRV_MIN_PATH_BANDWIDTH,
386 INTSRV_IF_LATENCY, INTSRV_PATH_LATENCY,
387 INTSRV_MTU, INTSRV_COMPOSED_MTU,
389 INTSRV_TOKEN_BUCKET_TSPEC = 127,
390 INTSRV_QUALITATIVE_TSPEC = 128,
391 INTSRV_GTD_RSPEC = 130,
393 INTSRV_DELAY = 131, /* Gtd Parameter C - Max Delay Bound - bytes */
394 INTSRV_MAX_JITTER, /* Gtd Parameter D - Max Jitter */
395 INTSRV_E2E_DELAY, /* Gtd Parameter Ctot */
396 INTSRV_E2E_MAX_JITTER, /* Gtd Parameter Dtot */
397 INTSRV_SHP_DELAY, /* Gtd Parameter Csum */
398 INTSRV_SHP_MAX_JITTER /* Gtd Parameter Dsum */
402 static value_string adspec_params[] = {
404 {6, "Path b/w estimate"},
405 {8, "Minimum path latency"},
406 {10, "Composed MTU"},
407 {133, "End-to-end composed value for C"},
408 {134, "End-to-end composed value for D"},
409 {135, "Since-last-reshaping point composed C"},
410 {136, "Since-last-reshaping point composed D"},
414 const value_string gmpls_lsp_enc_str[] = {
416 { 2, "Ethernet v2/DIX"},
419 { 5, "SDH ITU-T G.707"},
420 { 6, "SONET ANSI T1.105"},
421 { 7, "Digital Wrapper"},
422 { 8, "Lambda (photonic)"},
424 {10, "Ethernet 802.3"},
425 {11, "FiberChannel"},
429 const value_string gmpls_switching_type_str[] = {
430 { 1, "Packet-Switch Capable-1 (PSC-1)"},
431 { 2, "Packet-Switch Capable-2 (PSC-2)"},
432 { 3, "Packet-Switch Capable-3 (PSC-3)"},
433 { 4, "Packet-Switch Capable-4 (PSC-4)"},
434 { 51, "Layer-2 Switch Capable (L2SC)"},
435 {100, "Time-Division-Multiplex Capable (TDM)"},
436 {150, "Lambda-Switch Capable (LSC)"},
437 {200, "Fiber-Switch Capable (FSC)"},
441 static const value_string gmpls_gpid_str[] = {
442 { 5, "Asynchronous mapping of E3 (SONET, SDH)"},
443 { 8, "Bit synchronous mapping of E3 (SDH)"},
444 { 9, "Byte synchronous mapping of E3 (SDH)"},
445 {10, "Asynchronous mapping of DS2/T2 (SONET, SDH)"},
446 {11, "Bit synchronous mapping of DS2/T2 (SONET, SDH)"},
447 {13, "Asynchronous mapping of E1 (SONET, SDH)"},
448 {14, "Byte synchronous mapping of E1 (SONET, SDH)"},
449 {15, "Byte synchronous mapping of 31 * DS0 (SONET, SDH)"},
450 {16, "Asynchronous mapping of DS1/T1 (SONET, SDH)"},
451 {17, "Bit synchronous mapping of DS1/T1 (SONET, SDH)"},
452 {18, "Byte synchronous mapping of DS1/T1 (SONET, SDH)"},
453 {19, "VC-11 in VC-12 (SDH)"},
454 {22, "DS1 SF Asynchronous (SONET)"},
455 {23, "DS1 ESF Asynchronous (SONET)"},
456 {24, "DS3 M23 Asynchronous (SONET)"},
457 {25, "DS3 C-Bit Parity Asynchronous (SONET)"},
458 {26, "VT/LOVC (SONET, SDH)"},
459 {27, "STS SPE/HOVC (SONET, SDH)"},
460 {28, "POS - No Scrambling, 16 bit CRC (SONET, SDH)"},
461 {29, "POS - No Scrambling, 32 bit CRC (SONET, SDH)"},
462 {30, "POS - Scrambling, 16 bit CRC (SONET, SDH)"},
463 {31, "POS - Scrambling, 32 bit CRC (SONET, SDH)"},
464 {32, "ATM Mapping (SONET, SDH)"},
465 {33, "Ethernet (SDH, Lambda, Fiber)"},
466 {34, "SDH (Lambda, Fiber)"},
467 {35, "SONET (Lambda, Fiber)"},
468 {36, "Digital Wrapper (Lambda, Fiber)"},
469 {37, "Lambda (Fiber)"},
470 {38, "ETSI PDH (SDH)"},
471 {39, "ANSI PDH (SONET, SDH)"},
472 {40, "Link Access Protocol SDH: LAPS - X.85 and X.86 (SONET, SDH)"},
473 {41, "FDDI (SONET, SDH, Lambda, Fiber)"},
474 {42, "DQDB: ETSI ETS 300 216 (SONET, SDH)"},
475 {43, "FiberChannel-3 Services (FiberChannel)"},
479 static const value_string gmpls_sonet_signal_type_str[] = {
480 { 1, "VT1.5 SPE / VC-11"},
481 { 2, "VT2 SPE / VC-12"},
483 { 4, "VT6 SPE / VC-2"},
484 { 5, "STS-1 SPE / VC-3"},
485 { 6, "STS-3c SPE / VC-4"},
486 { 7, "STS-1 / STM-0"},
487 { 8, "STS-3 / STM-1"},
488 { 9, "STS-12 / STM-4"},
489 {10, "STS-48 / STM-16"},
490 {11, "STS-192 / STM-64"},
491 {12, "STS-768 / STM-256"},
493 /* Extended non-SONET signal types */
496 {15, "STSG-3 / AUG-1"},
497 {16, "STSG-12 / AUG-4"},
498 {17, "STSG-48 / AUG-16"},
499 {18, "STSG-192 / AUG-64"},
500 {19, "STSG-768 / AUG-256"},
503 static const value_string ouni_guni_diversity_str[] = {
506 {3, "Shared-Risk Link Group Diverse"},
510 /* -------------------- Stuff for MPLS/TE objects -------------------- */
512 static const value_string proto_vals[] = { {IP_PROTO_ICMP, "ICMP"},
513 {IP_PROTO_IGMP, "IGMP"},
514 {IP_PROTO_TCP, "TCP" },
515 {IP_PROTO_UDP, "UDP" },
516 {IP_PROTO_OSPF, "OSPF"},
520 enum rsvp_filter_keys {
523 RSVPF_MSG, /* Message type */
524 /* Shorthand for message types */
545 /* Does the message contain an object of this type? */
547 /* Object present shorthands */
567 RSVPF_EXPLICIT_ROUTE,
571 RSVPF_MESSAGE_ID_ACK,
572 RSVPF_MESSAGE_ID_LIST,
573 RSVPF_RECOVERY_LABEL,
574 RSVPF_UPSTREAM_LABEL,
578 RSVPF_SUGGESTED_LABEL,
579 RSVPF_ACCEPTABLE_LABEL_SET,
582 RSVPF_SESSION_ATTRIBUTE,
584 RSVPF_LSP_TUNNEL_IF_ID,
585 RSVPF_NOTIFY_REQUEST,
587 RSVPF_GENERALIZED_UNI,
594 RSVPF_SESSION_TUNNEL_ID,
595 RSVPF_SESSION_EXT_TUNNEL_ID,
597 /* Sender template */
606 static int rsvp_filter[RSVPF_MAX];
608 static hf_register_info rsvpf_info[] = {
610 /* Message type number */
611 {&rsvp_filter[RSVPF_MSG],
612 { "Message Type", "rsvp.msg", FT_UINT8, BASE_DEC, VALS(message_type_vals), 0x0,
615 /* Message type shorthands */
616 {&rsvp_filter[RSVPF_PATH],
617 { "Path Message", "rsvp.path", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
620 {&rsvp_filter[RSVPF_RESV],
621 { "Resv Message", "rsvp.resv", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
624 {&rsvp_filter[RSVPF_PATHERR],
625 { "Path Error Message", "rsvp.perr", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
628 {&rsvp_filter[RSVPF_RESVERR],
629 { "Resv Error Message", "rsvp.rerr", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
632 {&rsvp_filter[RSVPF_PATHTEAR],
633 { "Path Tear Message", "rsvp.ptear", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
636 {&rsvp_filter[RSVPF_RESVTEAR],
637 { "Resv Tear Message", "rsvp.rtear", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
640 {&rsvp_filter[RSVPF_RCONFIRM],
641 { "Resv Confirm Message", "rsvp.resvconf", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
644 {&rsvp_filter[RSVPF_RTEARCONFIRM],
645 { "Resv Tear Confirm Message", "rsvp.rtearconf", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
648 {&rsvp_filter[RSVPF_BUNDLE],
649 { "Bundle Message", "rsvp.bundle", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
652 {&rsvp_filter[RSVPF_ACK],
653 { "Ack Message", "rsvp.ack", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
656 {&rsvp_filter[RSVPF_SREFRESH],
657 { "Srefresh Message", "rsvp.srefresh", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
660 {&rsvp_filter[RSVPF_HELLO],
661 { "HELLO Message", "rsvp.hello", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
665 {&rsvp_filter[RSVPF_OBJECT],
666 { "Object class", "rsvp.object", FT_UINT8, BASE_DEC, VALS(rsvp_class_vals), 0x0,
669 /* Object present shorthands */
670 {&rsvp_filter[RSVPF_SESSION],
671 { "SESSION", "rsvp.session", FT_NONE, BASE_NONE, NULL, 0x0,
674 {&rsvp_filter[RSVPF_HOP],
675 { "HOP", "rsvp.hop", FT_NONE, BASE_NONE, NULL, 0x0,
678 {&rsvp_filter[RSVPF_HELLO_OBJ],
679 { "HELLO Request/Ack", "rsvp.hello_obj", FT_NONE, BASE_NONE, NULL, 0x0,
682 {&rsvp_filter[RSVPF_INTEGRITY],
683 { "INTEGRITY", "rsvp.integrity", FT_NONE, BASE_NONE, NULL, 0x0,
686 {&rsvp_filter[RSVPF_TIME_VALUES],
687 { "TIME VALUES", "rsvp.time", FT_NONE, BASE_NONE, NULL, 0x0,
690 {&rsvp_filter[RSVPF_ERROR],
691 { "ERROR", "rsvp.error", FT_NONE, BASE_NONE, NULL, 0x0,
694 {&rsvp_filter[RSVPF_SCOPE],
695 { "SCOPE", "rsvp.scope", FT_NONE, BASE_NONE, NULL, 0x0,
698 {&rsvp_filter[RSVPF_STYLE],
699 { "STYLE", "rsvp.style", FT_NONE, BASE_NONE, NULL, 0x0,
702 {&rsvp_filter[RSVPF_FLOWSPEC],
703 { "FLOWSPEC", "rsvp.flowspec", FT_NONE, BASE_NONE, NULL, 0x0,
706 {&rsvp_filter[RSVPF_FILTER_SPEC],
707 { "FILTERSPEC", "rsvp.filter", FT_NONE, BASE_NONE, NULL, 0x0,
710 {&rsvp_filter[RSVPF_SENDER],
711 { "SENDER TEMPLATE", "rsvp.sender", FT_NONE, BASE_NONE, NULL, 0x0,
714 {&rsvp_filter[RSVPF_TSPEC],
715 { "SENDER TSPEC", "rsvp.tspec", FT_NONE, BASE_NONE, NULL, 0x0,
718 {&rsvp_filter[RSVPF_ADSPEC],
719 { "ADSPEC", "rsvp.adspec", FT_NONE, BASE_NONE, NULL, 0x0,
722 {&rsvp_filter[RSVPF_POLICY],
723 { "POLICY", "rsvp.policy", FT_NONE, BASE_NONE, NULL, 0x0,
726 {&rsvp_filter[RSVPF_CONFIRM],
727 { "CONFIRM", "rsvp.confirm", FT_NONE, BASE_NONE, NULL, 0x0,
730 {&rsvp_filter[RSVPF_LABEL],
731 { "LABEL", "rsvp.label", FT_NONE, BASE_NONE, NULL, 0x0,
734 {&rsvp_filter[RSVPF_RECOVERY_LABEL],
735 { "RECOVERY LABEL", "rsvp.recovery_label", FT_NONE, BASE_NONE, NULL, 0x0,
738 {&rsvp_filter[RSVPF_UPSTREAM_LABEL],
739 { "UPSTREAM LABEL", "rsvp.upstream_label", FT_NONE, BASE_NONE, NULL, 0x0,
742 {&rsvp_filter[RSVPF_SUGGESTED_LABEL],
743 { "SUGGESTED LABEL", "rsvp.suggested_label", FT_NONE, BASE_NONE, NULL, 0x0,
746 {&rsvp_filter[RSVPF_LABEL_SET],
747 { "RESTRICTED LABEL SET", "rsvp.label_set", FT_NONE, BASE_NONE, NULL, 0x0,
750 {&rsvp_filter[RSVPF_ACCEPTABLE_LABEL_SET],
751 { "ACCEPTABLE LABEL SET", "rsvp.acceptable_label_set", FT_NONE, BASE_NONE, NULL, 0x0,
754 {&rsvp_filter[RSVPF_PROTECTION],
755 { "PROTECTION", "rsvp.protection", FT_NONE, BASE_NONE, NULL, 0x0,
758 {&rsvp_filter[RSVPF_RESTART_CAP],
759 { "RESTART CAPABILITY", "rsvp.restart", FT_NONE, BASE_NONE, NULL, 0x0,
762 {&rsvp_filter[RSVPF_LABEL_REQUEST],
763 { "LABEL REQUEST", "rsvp.label_request", FT_NONE, BASE_NONE, NULL, 0x0,
766 {&rsvp_filter[RSVPF_SESSION_ATTRIBUTE],
767 { "SESSION ATTRIBUTE", "rsvp.session_attribute", FT_NONE, BASE_NONE, NULL, 0x0,
770 {&rsvp_filter[RSVPF_EXPLICIT_ROUTE],
771 { "EXPLICIT ROUTE", "rsvp.explicit_route", FT_NONE, BASE_NONE, NULL, 0x0,
774 {&rsvp_filter[RSVPF_RECORD_ROUTE],
775 { "RECORD ROUTE", "rsvp.record_route", FT_NONE, BASE_NONE, NULL, 0x0,
778 {&rsvp_filter[RSVPF_MESSAGE_ID],
779 { "MESSAGE-ID", "rsvp.msgid", FT_NONE, BASE_NONE, NULL, 0x0,
782 {&rsvp_filter[RSVPF_MESSAGE_ID_ACK],
783 { "MESSAGE-ID ACK", "rsvp.ack", FT_NONE, BASE_NONE, NULL, 0x0,
786 {&rsvp_filter[RSVPF_MESSAGE_ID_LIST],
787 { "MESSAGE-ID LIST", "rsvp.msgid_list", FT_NONE, BASE_NONE, NULL, 0x0,
790 {&rsvp_filter[RSVPF_HELLO_OBJ],
791 { "HELLO", "rsvp.hello", FT_NONE, BASE_NONE, NULL, 0x0,
794 {&rsvp_filter[RSVPF_DCLASS],
795 { "DCLASS", "rsvp.dclass", FT_NONE, BASE_NONE, NULL, 0x0,
798 {&rsvp_filter[RSVPF_LSP_TUNNEL_IF_ID],
799 { "LSP INTERFACE-ID", "rsvp.lsp_tunnel_if_id", FT_NONE, BASE_NONE, NULL, 0x0,
802 {&rsvp_filter[RSVPF_ADMIN_STATUS],
803 { "ADMIN STATUS", "rsvp.admin_status", FT_NONE, BASE_NONE, NULL, 0x0,
806 {&rsvp_filter[RSVPF_NOTIFY_REQUEST],
807 { "NOTIFY REQUEST", "rsvp.notify_request", FT_NONE, BASE_NONE, NULL, 0x0,
810 {&rsvp_filter[RSVPF_GENERALIZED_UNI],
811 { "GENERALIZED UNI", "rsvp.generalized_uni", FT_NONE, BASE_NONE, NULL, 0x0,
814 {&rsvp_filter[RSVPF_UNKNOWN_OBJ],
815 { "Unknown object", "rsvp.obj_unknown", FT_NONE, BASE_NONE, NULL, 0x0,
819 {&rsvp_filter[RSVPF_SESSION_IP],
820 { "Destination address", "rsvp.session.ip", FT_IPv4, BASE_NONE, NULL, 0x0,
823 {&rsvp_filter[RSVPF_SESSION_PORT],
824 { "Port number", "rsvp.session.port", FT_UINT16, BASE_DEC, NULL, 0x0,
827 {&rsvp_filter[RSVPF_SESSION_PROTO],
828 { "Protocol", "rsvp.session.proto", FT_UINT8, BASE_DEC, VALS(proto_vals), 0x0,
831 {&rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
832 { "Tunnel ID", "rsvp.session.tunnel_id", FT_UINT16, BASE_DEC, NULL, 0x0,
835 {&rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
836 { "Extended tunnel ID", "rsvp.session.ext_tunnel_id", FT_UINT32, BASE_DEC, NULL, 0x0,
839 /* Sender template/Filterspec fields */
840 {&rsvp_filter[RSVPF_SENDER_IP],
841 { "Sender IPv4 address", "rsvp.sender.ip", FT_IPv4, BASE_NONE, NULL, 0x0,
844 {&rsvp_filter[RSVPF_SENDER_PORT],
845 { "Sender port number", "rsvp.sender.port", FT_UINT16, BASE_DEC, NULL, 0x0,
848 {&rsvp_filter[RSVPF_SENDER_LSP_ID],
849 { "Sender LSP ID", "rsvp.sender.lsp_id", FT_UINT16, BASE_DEC, NULL, 0x0,
853 static inline int rsvp_class_to_filter_num(int classnum)
856 case RSVP_CLASS_SESSION :
857 case RSVP_CLASS_HOP :
858 case RSVP_CLASS_INTEGRITY :
859 case RSVP_CLASS_TIME_VALUES :
860 case RSVP_CLASS_ERROR :
861 case RSVP_CLASS_SCOPE :
862 case RSVP_CLASS_STYLE :
863 case RSVP_CLASS_FLOWSPEC :
864 case RSVP_CLASS_FILTER_SPEC :
865 case RSVP_CLASS_SENDER_TEMPLATE :
866 case RSVP_CLASS_SENDER_TSPEC :
867 case RSVP_CLASS_ADSPEC :
868 case RSVP_CLASS_POLICY :
869 case RSVP_CLASS_CONFIRM :
870 case RSVP_CLASS_LABEL :
871 case RSVP_CLASS_LABEL_REQUEST :
872 case RSVP_CLASS_HELLO :
873 case RSVP_CLASS_EXPLICIT_ROUTE :
874 case RSVP_CLASS_RECORD_ROUTE :
875 case RSVP_CLASS_MESSAGE_ID :
876 case RSVP_CLASS_MESSAGE_ID_ACK :
877 case RSVP_CLASS_MESSAGE_ID_LIST :
878 return classnum + RSVPF_OBJECT;
881 case RSVP_CLASS_RECOVERY_LABEL :
882 case RSVP_CLASS_UPSTREAM_LABEL :
883 case RSVP_CLASS_LABEL_SET :
884 case RSVP_CLASS_PROTECTION :
885 return RSVPF_RECOVERY_LABEL + (classnum - RSVP_CLASS_RECOVERY_LABEL);
887 case RSVP_CLASS_SUGGESTED_LABEL :
888 case RSVP_CLASS_ACCEPTABLE_LABEL_SET :
889 case RSVP_CLASS_RESTART_CAP :
890 return RSVPF_SUGGESTED_LABEL + (classnum - RSVP_CLASS_SUGGESTED_LABEL);
892 case RSVP_CLASS_NOTIFY_REQUEST :
893 return RSVPF_NOTIFY_REQUEST;
894 case RSVP_CLASS_ADMIN_STATUS :
895 return RSVPF_ADMIN_STATUS;
897 case RSVP_CLASS_SESSION_ATTRIBUTE :
898 return RSVPF_SESSION_ATTRIBUTE;
899 case RSVP_CLASS_GENERALIZED_UNI :
900 return RSVPF_GENERALIZED_UNI;
901 case RSVP_CLASS_DCLASS :
903 case RSVP_CLASS_LSP_TUNNEL_IF_ID :
904 return RSVPF_LSP_TUNNEL_IF_ID;
907 return RSVPF_UNKNOWN_OBJ;
912 find_rsvp_session_tempfilt(tvbuff_t *tvb, int hdr_offset, int *session_offp, int *tempfilt_offp)
914 int s_off = 0, t_off = 0;
918 if (!tvb_bytes_exist(tvb, hdr_offset+6, 2))
921 len = tvb_get_ntohs(tvb, hdr_offset+6) + hdr_offset;
922 off = hdr_offset + 8;
923 for (off = hdr_offset + 8; off < len && tvb_bytes_exist(tvb, off, 3);
925 obj_length = tvb_get_ntohs(tvb, off);
928 switch(tvb_get_guint8(tvb, off+2)) {
929 case RSVP_CLASS_SESSION:
932 case RSVP_CLASS_SENDER_TEMPLATE:
933 case RSVP_CLASS_FILTER_SPEC:
942 if (session_offp) *session_offp = s_off;
943 if (tempfilt_offp) *tempfilt_offp = t_off;
946 static char *summary_session (tvbuff_t *tvb, int offset)
950 switch(tvb_get_guint8(tvb, offset+3)) {
951 case RSVP_SESSION_TYPE_IPV4:
952 snprintf(buf, 80, "SESSION: IPv4, Destination %s, Protocol %d, Port %d. ",
953 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
954 tvb_get_guint8(tvb, offset+8),
955 tvb_get_ntohs(tvb, offset+10));
957 case RSVP_SESSION_TYPE_IPV4_LSP:
958 snprintf(buf, 80, "SESSION: IPv4-LSP, Destination %s, Tunnel ID %d, Ext ID %0x. ",
959 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
960 tvb_get_ntohs(tvb, offset+10),
961 tvb_get_ntohl(tvb, offset+12));
963 case RSVP_SESSION_TYPE_IPV4_UNI:
964 snprintf(buf, 80, "SESSION: IPv4-UNI, Destination %s, Tunnel ID %d, Ext Address %s. ",
965 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
966 tvb_get_ntohs(tvb, offset+10),
967 ip_to_str(tvb_get_ptr(tvb, offset+12, 4)));
970 snprintf(buf, 80, "SESSION: Type %d. ", tvb_get_guint8(tvb, offset+3));
976 static char *summary_template (tvbuff_t *tvb, int offset)
981 if (tvb_get_guint8(tvb, offset+2) == RSVP_CLASS_FILTER_SPEC)
982 objtype = "FILTERSPEC";
984 objtype = "SENDER TEMPLATE";
986 switch(tvb_get_guint8(tvb, offset+3)) {
988 snprintf(buf, 80, "%s: IPv4, Sender %s, Port %d. ", objtype,
989 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
990 tvb_get_ntohs(tvb, offset+10));
993 snprintf(buf, 80, "%s: IPv4-LSP, Tunnel Source: %s, LSP ID: %d. ", objtype,
994 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
995 tvb_get_ntohs(tvb, offset+10));
998 snprintf(buf, 80, "%s: Type %d. ", objtype, tvb_get_guint8(tvb, offset+3));
1004 /*------------------------------------------------------------------------------
1006 *------------------------------------------------------------------------------*/
1008 dissect_rsvp_session (proto_tree *ti, tvbuff_t *tvb,
1009 int offset, int obj_length,
1010 int class, int type,
1013 int offset2 = offset + 4;
1014 proto_tree *rsvp_object_tree;
1016 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_session);
1017 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1018 "Length: %u", obj_length);
1019 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1020 "Class number: %u - %s",
1022 proto_item_set_text(ti, summary_session(tvb, offset));
1025 case RSVP_SESSION_TYPE_IPV4:
1026 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1027 "C-type: 1 - IPv4");
1028 proto_tree_add_item(rsvp_object_tree,
1029 rsvp_filter[RSVPF_SESSION_IP],
1030 tvb, offset2, 4, FALSE);
1032 proto_tree_add_item(rsvp_object_tree,
1033 rsvp_filter[RSVPF_SESSION_PROTO], tvb,
1034 offset2+4, 1, FALSE);
1035 proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 1,
1037 tvb_get_guint8(tvb, offset2+5));
1038 proto_tree_add_item(rsvp_object_tree,
1039 rsvp_filter[RSVPF_SESSION_PORT], tvb,
1040 offset2+6, 2, FALSE);
1043 case RSVP_SESSION_TYPE_IPV6:
1044 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1045 "C-type: 2 - IPv6");
1046 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1047 "Destination address: %s",
1048 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1049 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 1,
1051 tvb_get_guint8(tvb, offset2+16));
1052 proto_tree_add_text(rsvp_object_tree, tvb, offset2+17, 1,
1054 tvb_get_guint8(tvb, offset2+17));
1055 proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2,
1056 "Destination port: %u",
1057 tvb_get_ntohs(tvb, offset2+18));
1060 case RSVP_SESSION_TYPE_IPV4_LSP:
1061 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1062 "C-type: 7 - IPv4 LSP");
1063 proto_tree_add_item(rsvp_object_tree,
1064 rsvp_filter[RSVPF_SESSION_IP],
1065 tvb, offset2, 4, FALSE);
1067 proto_tree_add_item(rsvp_object_tree,
1068 rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
1069 tvb, offset2+6, 2, FALSE);
1071 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
1072 "Extended Tunnel ID: %u (%s)",
1073 tvb_get_ntohl(tvb, offset2+8),
1074 ip_to_str(tvb_get_ptr(tvb, offset2+8, 4)));
1075 proto_tree_add_item_hidden(rsvp_object_tree,
1076 rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
1077 tvb, offset2+8, 4, FALSE);
1080 case RSVP_SESSION_TYPE_IPV4_UNI:
1081 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1082 "C-type: 9 - IPv4 UNI");
1083 proto_tree_add_item(rsvp_object_tree,
1084 rsvp_filter[RSVPF_SESSION_IP],
1085 tvb, offset2, 4, FALSE);
1087 proto_tree_add_item(rsvp_object_tree,
1088 rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
1089 tvb, offset2+6, 2, FALSE);
1091 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
1092 "Extended IPv4 Address: %s",
1093 ip_to_str(tvb_get_ptr(tvb, offset2+8, 4)));
1094 proto_tree_add_item_hidden(rsvp_object_tree,
1095 rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
1096 tvb, offset2+8, 4, FALSE);
1100 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1101 "C-type: Unknown (%u)",
1103 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length-4,
1104 "Data (%d bytes)", obj_length-4);
1108 /*------------------------------------------------------------------------------
1110 *------------------------------------------------------------------------------*/
1112 dissect_rsvp_hop (proto_tree *ti, tvbuff_t *tvb,
1113 int offset, int obj_length,
1114 int class, int type,
1117 int offset2 = offset + 4;
1118 proto_tree *rsvp_object_tree;
1119 proto_tree *rsvp_hop_subtree, *ti2;
1121 rsvp_object_tree= proto_item_add_subtree(ti, ett_rsvp_hop);
1123 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1124 "Length: %u", obj_length);
1125 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1126 "Class number: %u - %s",
1130 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1131 "C-type: 1 - IPv4");
1132 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1133 "Neighbor address: %s",
1134 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1135 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
1136 "Logical interface: %u",
1137 tvb_get_ntohl(tvb, offset2+4));
1138 proto_item_set_text(ti, "HOP: IPv4, %s",
1139 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1143 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1144 "C-type: 2 - IPv6");
1145 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1146 "Neighbor address: %s",
1147 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1148 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 4,
1149 "Logical interface: 0x%08x",
1150 tvb_get_ntohl(tvb, offset2+16));
1158 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1159 "C-type: 3 - IPv4 Out-Of-Band");
1160 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1161 "Neighbor address: %s",
1162 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1163 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
1164 "Logical interface: %u",
1165 tvb_get_ntohl(tvb, offset2+4));
1167 proto_item_set_text(ti, "HOP: Out-of-band. Control IPv4: %s. ",
1168 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1170 for (tlv_off = 0; tlv_off < obj_length - 12; ) {
1171 tlv_type = tvb_get_ntohs(tvb, offset2+8+tlv_off);
1172 tlv_len = tvb_get_ntohs(tvb, offset2+8+tlv_off+2);
1175 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1176 offset2+8+tlv_off, 8,
1178 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)));
1180 proto_item_add_subtree(ti2, ett_rsvp_hop_subobj);
1181 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off, 2,
1183 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off+2, 2,
1185 tvb_get_ntohs(tvb, offset2+8+tlv_off+2));
1186 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off+4, 4,
1188 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)));
1189 proto_item_append_text(ti, "Data IPv4: %s. ",
1190 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)));
1197 ifindex_name = " Forward";
1200 ifindex_name = " Reverse";
1202 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1203 offset2+8+tlv_off, 12,
1204 "Interface-Index%s TLV - %s, %d",
1206 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)),
1207 tvb_get_ntohl(tvb, offset2+8+tlv_off+8));
1209 proto_item_add_subtree(ti2, ett_rsvp_hop_subobj);
1210 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off, 2,
1211 "Type: %d (Interface Index%s)", tlv_type, ifindex_name);
1212 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off+2, 2,
1214 tvb_get_ntohs(tvb, offset2+8+tlv_off+2));
1215 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off+4, 4,
1217 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)));
1218 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off+8, 4,
1220 tvb_get_ntohl(tvb, offset2+8+tlv_off+8));
1221 proto_item_append_text(ti, "Data If-Index%s: %s, %d. ", ifindex_name,
1222 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)),
1223 tvb_get_ntohl(tvb, offset2+8+tlv_off+8));
1227 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
1228 "Logical interface: %u",
1229 tvb_get_ntohl(tvb, offset2+4));
1237 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1238 "C-type: Unknown (%u)",
1240 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
1241 "Data (%d bytes)", obj_length - 4);
1245 /*------------------------------------------------------------------------------
1247 *------------------------------------------------------------------------------*/
1249 dissect_rsvp_time_values (proto_tree *ti, tvbuff_t *tvb,
1250 int offset, int obj_length,
1251 int class, int type,
1254 int offset2 = offset + 4;
1255 proto_tree *rsvp_object_tree;
1257 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_time_values);
1258 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1259 "Length: %u", obj_length);
1260 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1261 "Class number: %u - %s",
1265 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1267 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1268 "Refresh interval: %u ms (%u seconds)",
1269 tvb_get_ntohl(tvb, offset2),
1270 tvb_get_ntohl(tvb, offset2)/1000);
1271 proto_item_set_text(ti, "TIME VALUES: %d ms",
1272 tvb_get_ntohl(tvb, offset2));
1276 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1277 "C-type: Unknown (%u)",
1279 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
1280 "Data (%d bytes)", obj_length - 4);
1285 /*------------------------------------------------------------------------------
1287 *------------------------------------------------------------------------------*/
1289 dissect_rsvp_error (proto_tree *ti, tvbuff_t *tvb,
1290 int offset, int obj_length,
1291 int class, int type,
1294 int offset2 = offset + 4;
1295 proto_tree *rsvp_object_tree;
1297 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_error);
1298 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1299 "Length: %u", obj_length);
1300 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1301 "Class number: %u - %s",
1307 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1308 "C-type: 1 - IPv4");
1309 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1311 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1312 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 1,
1314 tvb_get_guint8(tvb, offset2+4));
1315 error_code = tvb_get_guint8(tvb, offset2+5);
1316 proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 1,
1317 "Error code: %u - %s", error_code,
1318 val_to_str(error_code, rsvp_error_vals, "Unknown (%d)"));
1319 proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2,
1321 tvb_get_ntohs(tvb, offset2+6));
1322 proto_item_set_text(ti, "ERROR: IPv4, Error code: %s, Value: %d, Error Node: %s",
1323 val_to_str(error_code, rsvp_error_vals, "Unknown (%d)"),
1324 tvb_get_ntohs(tvb, offset2+6),
1325 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1332 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1333 "C-type: 2 - IPv6");
1334 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1336 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1337 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 1,
1339 tvb_get_guint8(tvb, offset2+16));
1340 error_code = tvb_get_guint8(tvb, offset2+17);
1341 proto_tree_add_text(rsvp_object_tree, tvb, offset2+17, 1,
1342 "Error code: %u - %s", error_code,
1343 val_to_str(error_code, rsvp_error_vals, "Unknown"));
1344 proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2,
1346 tvb_get_ntohs(tvb, offset2+18));
1351 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1352 "C-type: Unknown (%u)",
1354 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
1355 "Data (%d bytes)", obj_length - 4);
1359 /*------------------------------------------------------------------------------
1361 *------------------------------------------------------------------------------*/
1363 dissect_rsvp_scope (proto_tree *ti, tvbuff_t *tvb,
1364 int offset, int obj_length,
1365 int class, int type,
1368 int offset2 = offset + 4;
1369 proto_tree *rsvp_object_tree;
1372 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_scope);
1373 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1374 "Length: %u", obj_length);
1375 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1376 "Class number: %u - %s",
1378 mylen = obj_length - 4;
1381 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1382 "C-type: 1 - IPv4");
1384 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1386 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1394 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1395 "C-type: 2 - IPv6");
1397 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1399 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1407 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1408 "C-type: Unknown (%u)",
1410 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1411 "Data (%d bytes)", mylen);
1415 /*------------------------------------------------------------------------------
1417 *------------------------------------------------------------------------------*/
1419 dissect_rsvp_style (proto_tree *ti, tvbuff_t *tvb,
1420 int offset, int obj_length,
1421 int class, int type,
1424 int offset2 = offset + 4;
1425 proto_tree *rsvp_object_tree;
1427 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_style);
1428 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1429 "Length: %u", obj_length);
1430 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1431 "Class number: %u - %s",
1437 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1439 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1441 tvb_get_guint8(tvb, offset2));
1442 style = tvb_get_ntoh24(tvb, offset2+1);
1443 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1,
1444 3, "Style: 0x%06X - %s", style,
1445 val_to_str(style, style_vals, "Unknown"));
1446 proto_item_set_text(ti, "STYLE: %s (%d)",
1447 val_to_str(style, style_vals, "Unknown"),
1453 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1454 "C-type: Unknown (%u)",
1456 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
1457 "Data (%d bytes)", obj_length - 4);
1462 /*------------------------------------------------------------------------------
1464 *------------------------------------------------------------------------------*/
1466 dissect_rsvp_confirm (proto_tree *ti, tvbuff_t *tvb,
1467 int offset, int obj_length,
1468 int class, int type,
1471 int offset2 = offset + 4;
1472 proto_tree *rsvp_object_tree;
1474 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_confirm);
1475 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1476 "Length: %u", obj_length);
1477 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1478 "Class number: %u - %s",
1482 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1483 "C-type: 1 - IPv4");
1484 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1485 "Receiver address: %s",
1486 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1487 proto_item_set_text(ti, "CONFIRM: Receiver %s",
1488 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1493 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1494 "C-type: 2 - IPv6");
1495 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1496 "Receiver address: %s",
1497 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1502 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1503 "C-type: Unknown (%u)",
1505 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
1506 "Data (%d bytes)", obj_length - 4);
1510 /*------------------------------------------------------------------------------
1511 * SENDER TEMPLATE and FILTERSPEC
1512 *------------------------------------------------------------------------------*/
1514 dissect_rsvp_template_filter (proto_tree *ti, tvbuff_t *tvb,
1515 int offset, int obj_length,
1516 int class, int type,
1519 int offset2 = offset + 4;
1520 proto_tree *rsvp_object_tree;
1523 case RSVP_CLASS_SENDER_TEMPLATE :
1524 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_sender_template);
1525 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1526 "Length: %u", obj_length);
1527 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1528 "Class number: %u - %s",
1533 case RSVP_CLASS_FILTER_SPEC :
1534 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_filter_spec);
1535 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1536 "Length: %u", obj_length);
1537 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1538 "Class number: %u - %s",
1543 proto_item_set_text(ti, summary_template(tvb, offset));
1546 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1547 "C-type: 1 - IPv4");
1548 proto_tree_add_item(rsvp_object_tree,
1549 rsvp_filter[RSVPF_SENDER_IP],
1550 tvb, offset2, 4, FALSE);
1551 proto_tree_add_item(rsvp_object_tree,
1552 rsvp_filter[RSVPF_SENDER_PORT],
1553 tvb, offset2+6, 2, FALSE);
1557 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1558 "C-type: 2 - IPv6");
1559 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1560 "Source address: %s",
1561 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1562 proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2,
1564 tvb_get_ntohs(tvb, offset2+18));
1568 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1569 "C-type: 7 - IPv4 LSP");
1570 proto_tree_add_item(rsvp_object_tree,
1571 rsvp_filter[RSVPF_SENDER_IP],
1572 tvb, offset2, 4, FALSE);
1573 proto_tree_add_item(rsvp_object_tree,
1574 rsvp_filter[RSVPF_SENDER_LSP_ID],
1575 tvb, offset2+6, 2, FALSE);
1579 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1580 "C-type: Unknown (%u)",
1582 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
1583 "Data (%d bytes)", obj_length - 4);
1587 /*------------------------------------------------------------------------------
1589 *------------------------------------------------------------------------------*/
1591 dissect_rsvp_tspec (proto_tree *ti, tvbuff_t *tvb,
1592 int offset, int obj_length,
1593 int class, int type,
1596 int offset2 = offset + 4;
1597 proto_tree *rsvp_object_tree;
1599 proto_tree *tspec_tree, *ti2;
1602 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_sender_tspec);
1603 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1604 "Length: %u", obj_length);
1605 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1606 "Class number: %u - %s",
1608 mylen = obj_length - 4;
1612 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1613 "C-type: 1 - Integrated Services");
1614 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1615 "Message format version: %u",
1616 tvb_get_guint8(tvb, offset2)>>4);
1617 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1618 "Data length: %u words, not including header",
1619 tvb_get_ntohs(tvb, offset2+2));
1624 proto_item_set_text(ti, "SENDER TSPEC: IntServ: ");
1630 guint16 param_len_processed;
1633 service_num = tvb_get_guint8(tvb, offset2);
1634 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1635 "Service header: %u - %s",
1637 val_to_str(service_num, qos_vals, "Unknown"));
1638 length = tvb_get_ntohs(tvb, offset2+2);
1639 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1640 "Length of service %u data: %u words, "
1641 "not including header",
1642 service_num, length);
1647 /* Process all known service headers as a set of parameters */
1648 param_len_processed = 0;
1649 while (param_len_processed < length) {
1650 param_id = tvb_get_guint8(tvb, offset2);
1651 param_len = tvb_get_ntohs(tvb, offset2+2) + 1;
1655 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1656 offset2, param_len*4,
1657 "Token Bucket TSpec: ");
1658 tspec_tree = proto_item_add_subtree(ti2, ett_rsvp_sender_tspec_subtree);
1660 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
1661 "Parameter %u - %s",
1663 val_to_str(param_id, svc_vals, "Unknown"));
1664 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
1665 "Parameter %u flags: 0x%02x",
1667 tvb_get_guint8(tvb, offset2+1));
1668 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
1669 "Parameter %u data length: %u words, "
1670 "not including header",
1672 tvb_get_ntohs(tvb, offset2+2));
1673 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
1674 "Token bucket rate: %.10g",
1675 tvb_get_ntohieee_float(tvb, offset2+4));
1676 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1677 "Token bucket size: %.10g",
1678 tvb_get_ntohieee_float(tvb, offset2+8));
1679 proto_tree_add_text(tspec_tree, tvb, offset2+12, 4,
1680 "Peak data rate: %.10g",
1681 tvb_get_ntohieee_float(tvb, offset2+12));
1682 proto_tree_add_text(tspec_tree, tvb, offset2+16, 4,
1683 "Minimum policed unit [m]: %u",
1684 tvb_get_ntohl(tvb, offset2+16));
1685 proto_tree_add_text(tspec_tree, tvb, offset2+20, 4,
1686 "Maximum packet size [M]: %u",
1687 tvb_get_ntohl(tvb, offset2+20));
1688 proto_item_append_text(ti, "Token Bucket, %.10g bytes/sec. ",
1689 tvb_get_ntohieee_float(tvb, offset2+4));
1690 proto_item_append_text(ti2, "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u",
1691 tvb_get_ntohieee_float(tvb, offset2+4),
1692 tvb_get_ntohieee_float(tvb, offset2+8),
1693 tvb_get_ntohieee_float(tvb, offset2+12),
1694 tvb_get_ntohl(tvb, offset2+16),
1695 tvb_get_ntohl(tvb, offset2+20));
1699 /* Null Service (RFC2997) */
1700 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1701 offset2, param_len*4,
1702 "Null Service TSpec: ");
1703 tspec_tree = proto_item_add_subtree(ti2, ett_rsvp_sender_tspec_subtree);
1705 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
1706 "Parameter %u - %s",
1708 val_to_str(param_id, svc_vals, "Unknown"));
1709 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
1710 "Parameter %u flags: %x",
1712 tvb_get_guint8(tvb, offset2+1));
1713 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
1714 "Parameter %u data length: %u words, "
1715 "not including header",
1717 tvb_get_ntohs(tvb, offset2+2));
1718 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
1719 "Maximum packet size [M]: %u",
1720 tvb_get_ntohl(tvb, offset2+4));
1721 proto_item_append_text(ti, "Null Service. M=%u",
1722 tvb_get_ntohl(tvb, offset2+4));
1723 proto_item_append_text(ti2, "Max pkt size=%u",
1724 tvb_get_ntohl(tvb, offset2+4));
1728 /* Compression hint (RFC3006) */
1729 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1730 offset2, param_len*4,
1731 "Compression Hint: ");
1732 tspec_tree = proto_item_add_subtree(ti2, ett_rsvp_sender_tspec_subtree);
1734 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
1735 "Parameter %u - %s",
1737 val_to_str(param_id, svc_vals, "Unknown"));
1738 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
1739 "Parameter %u flags: %x",
1741 tvb_get_guint8(tvb, offset2+1));
1742 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
1743 "Parameter %u data length: %u words, "
1744 "not including header",
1746 tvb_get_ntohs(tvb, offset2+2));
1747 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
1749 tvb_get_ntohl(tvb, offset2+4));
1750 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
1751 "Compression Factor: %u",
1752 tvb_get_ntohl(tvb, offset2+8));
1753 proto_item_append_text(ti, "Compression Hint. Hint=%u, Factor=%u",
1754 tvb_get_ntohl(tvb, offset2+4),
1755 tvb_get_ntohl(tvb, offset2+8));
1756 proto_item_append_text(ti2, "Hint=%u, Factor=%u",
1757 tvb_get_ntohl(tvb, offset2+4),
1758 tvb_get_ntohl(tvb, offset2+8));
1762 proto_tree_add_text(rsvp_object_tree, tvb, offset2, param_len*4,
1763 "Unknown parameter %d, %d words",
1764 param_id, param_len);
1767 param_len_processed += param_len;
1768 offset2 += param_len*4;
1774 case 4: /* SONET/SDH Tspec */
1775 proto_item_set_text(ti, "SENDER TSPEC: SONET/SDH: ");
1777 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1778 "C-type: 4 - SONET/SDH");
1779 signal_type = tvb_get_guint8(tvb, offset2);
1780 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1781 "Signal Type: %d - %s", signal_type,
1782 val_to_str(signal_type,
1783 gmpls_sonet_signal_type_str, "Unknown"));
1784 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
1785 "Requested Concatenation (RCC): %d", tvb_get_guint8(tvb, offset2+1));
1786 tspec_tree = proto_item_add_subtree(ti2, ett_rsvp_sender_tspec_subtree);
1787 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
1788 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x01, 8,
1789 "Standard contiguous concatenation",
1790 "No standard contiguous concatenation"));
1791 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
1792 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x02, 8,
1793 "Arbitrary contiguous concatenation",
1794 "No arbitrary contiguous concatenation"));
1795 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1796 "Number of Contiguous Components (NCC): %d", tvb_get_ntohs(tvb, offset2+2));
1797 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2,
1798 "Number of Virtual Components (NVC): %d", tvb_get_ntohs(tvb, offset2+4));
1799 proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2,
1800 "Multiplier (MT): %d", tvb_get_ntohs(tvb, offset2+6));
1801 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
1802 "Transparency (T): 0x%0x", tvb_get_ntohl(tvb, offset2+8));
1803 tspec_tree = proto_item_add_subtree(ti2, ett_rsvp_sender_tspec_subtree);
1804 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1805 decode_boolean_bitfield(tvb_get_ntohl(tvb, offset2+8), 0x0001, 32,
1806 "Section/Regenerator Section layer transparency",
1807 "No Section/Regenerator Section layer transparency"));
1808 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1809 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0002, 32,
1810 "Line/Multiplex Section layer transparency",
1811 "No Line/Multiplex Section layer transparency"));
1812 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1813 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0004, 32,
1815 "No J0 transparency"));
1816 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1817 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0008, 32,
1818 "SOH/RSOH DCC transparency",
1819 "No SOH/RSOH DCC transparency"));
1820 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1821 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0010, 32,
1822 "LOH/MSOH DCC transparency",
1823 "No LOH/MSOH DCC transparency"));
1824 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1825 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0020, 32,
1826 "LOH/MSOH Extended DCC transparency",
1827 "No LOH/MSOH Extended DCC transparency"));
1828 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1829 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0040, 32,
1830 "K1/K2 transparency",
1831 "No K1/K2 transparency"));
1832 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1833 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0080, 32,
1835 "No E1 transparency"));
1836 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1837 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0100, 32,
1839 "No F1 transparency"));
1840 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1841 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0200, 32,
1843 "No E2 transparency"));
1844 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1845 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0400, 32,
1847 "No B1 transparency"));
1848 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1849 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0800, 32,
1851 "No B2 transparency"));
1852 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1853 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x1000, 32,
1855 "No M0 transparency"));
1856 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1857 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x2000, 32,
1859 "No M1 transparency"));
1860 proto_tree_add_text(rsvp_object_tree, tvb, offset2+12, 4,
1861 "Profile (P): %d", tvb_get_ntohl(tvb, offset2+12));
1863 proto_item_append_text(ti, "Signal [%s], RCC %d, NCC %d, NVC %d, MT %d, Transparency %d, Profile %d",
1864 val_to_str(signal_type, gmpls_sonet_signal_type_str, "Unknown"),
1865 tvb_get_guint8(tvb, offset2+1), tvb_get_ntohs(tvb, offset2+2),
1866 tvb_get_ntohs(tvb, offset2+4), tvb_get_ntohs(tvb, offset2+6),
1867 tvb_get_ntohl(tvb, offset2+8), tvb_get_ntohl(tvb, offset2+12));
1870 default: /* Unknown TSpec */
1871 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1872 "C-type: Unknown (%u)",
1874 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
1875 "Data (%d bytes)", obj_length - 4);
1881 /*------------------------------------------------------------------------------
1883 *------------------------------------------------------------------------------*/
1885 dissect_rsvp_flowspec (proto_tree *ti, tvbuff_t *tvb,
1886 int offset, int obj_length,
1887 int class, int type,
1890 int offset2 = offset + 4;
1891 proto_tree *rsvp_object_tree;
1892 int mylen, signal_type;
1893 proto_tree *flowspec_tree, *ti2;
1895 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_flowspec);
1896 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1897 "Length: %u", obj_length);
1898 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1899 "Class number: %u - %s",
1901 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1902 "C-type: %u", type);
1903 mylen = obj_length - 4;
1908 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1909 "Message format version: %u",
1910 tvb_get_guint8(tvb, offset2)>>4);
1911 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1912 "Data length: %u words, not including header",
1913 tvb_get_ntohs(tvb, offset2+2));
1915 proto_item_set_text(ti, "FLOWSPEC: ");
1924 guint16 param_len_processed;
1926 service_num = tvb_get_guint8(tvb, offset2);
1927 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1928 "Service header: %u - %s",
1930 val_to_str(service_num, intsrv_services_str, "Unknown"));
1931 length = tvb_get_ntohs(tvb, offset2+2);
1932 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1933 "Length of service %u data: %u words, "
1934 "not including header",
1941 proto_item_append_text(ti, "%s: ",
1942 val_to_str(service_num, intsrv_services_str,
1945 /* Process all known service headers as a set of parameters */
1946 param_len_processed = 0;
1947 while (param_len_processed < length) {
1948 param_id = tvb_get_guint8(tvb, offset2);
1949 param_len = tvb_get_ntohs(tvb, offset2+2) + 1;
1953 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1954 offset2, param_len*4,
1956 flowspec_tree = proto_item_add_subtree(ti2, ett_rsvp_flowspec_subtree);
1958 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
1959 "Parameter %u - %s",
1961 val_to_str(param_id, svc_vals, "Unknown"));
1962 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
1963 "Parameter %u flags: 0x%02x",
1965 tvb_get_guint8(tvb, offset2+1));
1966 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
1967 "Parameter %u data length: %u words, "
1968 "not including header",
1970 tvb_get_ntohs(tvb, offset2+2));
1971 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
1972 "Token bucket rate: %.10g",
1973 tvb_get_ntohieee_float(tvb, offset2+4));
1974 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
1975 "Token bucket size: %.10g",
1976 tvb_get_ntohieee_float(tvb, offset2+8));
1977 proto_tree_add_text(flowspec_tree, tvb, offset2+12, 4,
1978 "Peak data rate: %.10g",
1979 tvb_get_ntohieee_float(tvb, offset2+12));
1980 proto_tree_add_text(flowspec_tree, tvb, offset2+16, 4,
1981 "Minimum policed unit [m]: %u",
1982 tvb_get_ntohl(tvb, offset2+16));
1983 proto_tree_add_text(flowspec_tree, tvb, offset2+20, 4,
1984 "Maximum packet size [M]: %u",
1985 tvb_get_ntohl(tvb, offset2+20));
1986 proto_item_append_text(ti, "Token Bucket, %.10g bytes/sec. ",
1987 tvb_get_ntohieee_float(tvb, offset2+4));
1988 proto_item_append_text(ti2, "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u",
1989 tvb_get_ntohieee_float(tvb, offset2+4),
1990 tvb_get_ntohieee_float(tvb, offset2+8),
1991 tvb_get_ntohieee_float(tvb, offset2+12),
1992 tvb_get_ntohl(tvb, offset2+16),
1993 tvb_get_ntohl(tvb, offset2+20));
1997 /* Guaranteed-rate RSpec */
1998 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1999 offset2, param_len*4,
2000 "Guaranteed-Rate RSpec: ");
2001 flowspec_tree = proto_item_add_subtree(ti2, ett_rsvp_flowspec_subtree);
2002 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
2003 "Parameter %u - %s",
2005 val_to_str(param_id, svc_vals, "Unknown"));
2006 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
2007 "Parameter %u flags: %x",
2009 tvb_get_guint8(tvb, offset2+1));
2010 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
2011 "Parameter %u data length: %u words, "
2012 "not including header",
2014 tvb_get_ntohs(tvb, offset2+2));
2016 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
2018 tvb_get_ntohieee_float(tvb, offset2+4));
2019 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2021 tvb_get_ntohl(tvb, offset2+8));
2022 proto_item_append_text(ti, "RSpec, %.10g bytes/sec. ",
2023 tvb_get_ntohieee_float(tvb, offset2+4));
2024 proto_item_append_text(ti2, "R=%.10g, s=%u",
2025 tvb_get_ntohieee_float(tvb, offset2+4),
2026 tvb_get_ntohl(tvb, offset2+8));
2030 /* Null Service (RFC2997) */
2031 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2032 offset2, param_len*4,
2033 "Null Service Flowspec: ");
2034 flowspec_tree = proto_item_add_subtree(ti2, ett_rsvp_flowspec_subtree);
2036 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
2037 "Parameter %u - %s",
2039 val_to_str(param_id, svc_vals, "Unknown"));
2040 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
2041 "Parameter %u flags: %x",
2043 tvb_get_guint8(tvb, offset2+1));
2044 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
2045 "Parameter %u data length: %u words, "
2046 "not including header",
2048 tvb_get_ntohs(tvb, offset2+2));
2049 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
2050 "Maximum packet size [M]: %u",
2051 tvb_get_ntohl(tvb, offset2+4));
2052 proto_item_append_text(ti, "Null Service. M=%u",
2053 tvb_get_ntohl(tvb, offset2+4));
2054 proto_item_append_text(ti2, "Max pkt size=%u",
2055 tvb_get_ntohl(tvb, offset2+4));
2059 proto_tree_add_text(rsvp_object_tree, tvb, offset2, param_len*4,
2060 "Unknown parameter %d, %d words",
2061 param_id, param_len);
2064 param_len_processed += param_len;
2065 offset2 += param_len * 4;
2068 /* offset2 += length*4; */
2074 proto_item_set_text(ti, "FLOWSPEC: SONET/SDH: ");
2076 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2077 "C-type: 4 - SONET/SDH");
2078 signal_type = tvb_get_guint8(tvb, offset2);
2079 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2080 "Signal Type: %d - %s", signal_type,
2081 val_to_str(signal_type,
2082 gmpls_sonet_signal_type_str, "Unknown"));
2083 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
2084 "Requested Concatenation (RCC): %d", tvb_get_guint8(tvb, offset2+1));
2085 flowspec_tree = proto_item_add_subtree(ti2, ett_rsvp_flowspec_subtree);
2086 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
2087 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x01, 8,
2088 "Standard contiguous concatenation",
2089 "No standard contiguous concatenation"));
2090 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
2091 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+1), 0x02, 8,
2092 "Arbitrary contiguous concatenation",
2093 "No arbitrary contiguous concatenation"));
2094 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2095 "Number of Contiguous Components (NCC): %d", tvb_get_ntohs(tvb, offset2+2));
2096 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 2,
2097 "Number of Virtual Components (NVC): %d", tvb_get_ntohs(tvb, offset2+4));
2098 proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2,
2099 "Multiplier (MT): %d", tvb_get_ntohs(tvb, offset2+6));
2100 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
2101 "Transparency (T): 0x%0x", tvb_get_ntohl(tvb, offset2+8));
2102 flowspec_tree = proto_item_add_subtree(ti2, ett_rsvp_flowspec_subtree);
2103 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2104 decode_boolean_bitfield(tvb_get_ntohl(tvb, offset2+8), 0x0001, 32,
2105 "Section/Regenerator Section layer transparency",
2106 "No Section/Regenerator Section layer transparency"));
2107 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2108 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0002, 32,
2109 "Line/Multiplex Section layer transparency",
2110 "No Line/Multiplex Section layer transparency"));
2111 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2112 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0004, 32,
2114 "No J0 transparency"));
2115 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2116 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0008, 32,
2117 "SOH/RSOH DCC transparency",
2118 "No SOH/RSOH DCC transparency"));
2119 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2120 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0010, 32,
2121 "LOH/MSOH DCC transparency",
2122 "No LOH/MSOH DCC transparency"));
2123 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2124 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0020, 32,
2125 "LOH/MSOH Extended DCC transparency",
2126 "No LOH/MSOH Extended DCC transparency"));
2127 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2128 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0040, 32,
2129 "K1/K2 transparency",
2130 "No K1/K2 transparency"));
2131 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2132 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0080, 32,
2134 "No E1 transparency"));
2135 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2136 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0100, 32,
2138 "No F1 transparency"));
2139 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2140 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0200, 32,
2142 "No E2 transparency"));
2143 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2144 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0400, 32,
2146 "No B1 transparency"));
2147 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2148 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x0800, 32,
2150 "No B2 transparency"));
2151 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2152 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x1000, 32,
2154 "No M0 transparency"));
2155 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
2156 decode_boolean_bitfield(tvb_get_guint8(tvb, offset2+8), 0x2000, 32,
2158 "No M1 transparency"));
2159 proto_tree_add_text(rsvp_object_tree, tvb, offset2+12, 4,
2160 "Profile (P): %d", tvb_get_ntohl(tvb, offset2+12));
2162 proto_item_append_text(ti, "Signal [%s], RCC %d, NCC %d, NVC %d, MT %d, Transparency %d, Profile %d",
2163 val_to_str(signal_type, gmpls_sonet_signal_type_str, "Unknown"),
2164 tvb_get_guint8(tvb, offset2+1), tvb_get_ntohs(tvb, offset2+2),
2165 tvb_get_ntohs(tvb, offset2+4), tvb_get_ntohs(tvb, offset2+6),
2166 tvb_get_ntohl(tvb, offset2+8), tvb_get_ntohl(tvb, offset2+12));
2176 /*------------------------------------------------------------------------------
2178 *------------------------------------------------------------------------------*/
2180 dissect_rsvp_adspec (proto_tree *ti, tvbuff_t *tvb,
2181 int offset, int obj_length,
2182 int class, int type,
2185 int offset2 = offset + 4;
2186 proto_tree *rsvp_object_tree;
2188 proto_tree *adspec_tree;
2190 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_adspec);
2191 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2192 "Length: %u", obj_length);
2193 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2194 "Class number: %u - %s",
2196 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2197 "C-type: %u", type);
2198 mylen = obj_length - 4;
2200 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2201 "Message format version: %u",
2202 tvb_get_guint8(tvb, offset2)>>4);
2203 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2204 "Data length: %u words, not including header",
2205 tvb_get_ntohs(tvb, offset2+2));
2214 service_num = tvb_get_guint8(tvb, offset2);
2215 str = val_to_str(service_num, intsrv_services_str, "Unknown");
2216 break_bit = tvb_get_guint8(tvb, offset2+1);
2217 length = tvb_get_ntohs(tvb, offset2+2);
2218 ti = proto_tree_add_text(rsvp_object_tree, tvb, offset2,
2221 adspec_tree = proto_item_add_subtree(ti,
2222 ett_rsvp_adspec_subtree);
2223 proto_tree_add_text(adspec_tree, tvb, offset2, 1,
2224 "Service header %u - %s",
2226 proto_tree_add_text(adspec_tree, tvb, offset2+1, 1,
2228 "Break bit set":"Break bit not set");
2229 proto_tree_add_text(adspec_tree, tvb, offset2+2, 2,
2230 "Data length: %u words, not including header",
2237 guint16 phdr_length;
2239 id = tvb_get_guint8(tvb, offset2);
2240 phdr_length = tvb_get_ntohs(tvb, offset2+2);
2241 str = match_strval(id, adspec_params);
2251 /* 32-bit unsigned integer */
2252 proto_tree_add_text(adspec_tree, tvb, offset2,
2254 "%s - %u (type %u, length %u)",
2256 tvb_get_ntohl(tvb, offset2+4),
2262 proto_tree_add_text(adspec_tree, tvb, offset2,
2264 "%s - %.10g (type %u, length %u)",
2266 tvb_get_ntohieee_float(tvb, offset2+4),
2270 proto_tree_add_text(adspec_tree, tvb, offset2,
2272 "%s (type %u, length %u)",
2277 proto_tree_add_text(adspec_tree, tvb, offset2,
2279 "Unknown (type %u, length %u)",
2282 offset2 += (phdr_length+1)<<2;
2283 i -= (phdr_length+1)<<2;
2284 mylen -= (phdr_length+1)<<2;
2289 /*------------------------------------------------------------------------------
2291 *------------------------------------------------------------------------------*/
2293 dissect_rsvp_integrity (proto_tree *ti, tvbuff_t *tvb,
2294 int offset, int obj_length,
2295 int class, int type,
2298 int offset2 = offset + 4;
2299 proto_tree *rsvp_object_tree;
2300 proto_tree *ti2, *rsvp_integ_flags_tree;
2302 guint64 sequence_number;
2304 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_integrity);
2305 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2306 "Length: %u", obj_length);
2307 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2308 "Class number: %u - %s",
2310 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2311 "C-type: %u", type);
2312 flags = tvb_get_guint8(tvb, offset2);
2313 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2314 "Flags: 0x%02x", flags);
2315 rsvp_integ_flags_tree = proto_item_add_subtree(ti2, ett_rsvp_integrity_flags);
2316 proto_tree_add_text(rsvp_integ_flags_tree, tvb, offset2, 1,
2317 decode_boolean_bitfield(flags, 0x01, 8, "Handshake capable", "Handshake not capable"));
2318 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 6,
2319 "Key Identifier: %s", tvb_bytes_to_str(tvb, offset2+2, 6));
2320 sequence_number = tvb_get_ntohl(tvb, offset2+8);
2321 sequence_number <<= 32;
2322 sequence_number = tvb_get_ntohl(tvb, offset2+12);
2323 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 8,
2324 "Sequence Number: %llu", sequence_number);
2325 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, obj_length - 20,
2326 "Hash: %s", tvb_bytes_to_str(tvb, offset2+16, obj_length - 20));
2329 /*------------------------------------------------------------------------------
2331 *------------------------------------------------------------------------------*/
2333 dissect_rsvp_policy (proto_tree *ti, tvbuff_t *tvb,
2334 int offset, int obj_length,
2335 int class, int type,
2338 int offset2 = offset + 4;
2339 proto_tree *rsvp_object_tree;
2341 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_policy);
2342 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2343 "Length: %u", obj_length);
2344 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2345 "Class number: %u - %s",
2347 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2348 "C-type: %u", type);
2349 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2350 "Data (%d bytes)", obj_length - 4);
2353 /*------------------------------------------------------------------------------
2355 *------------------------------------------------------------------------------*/
2357 dissect_rsvp_label_request (proto_tree *ti, tvbuff_t *tvb,
2358 int offset, int obj_length,
2359 int class, int type,
2362 int offset2 = offset + 4;
2363 proto_tree *rsvp_object_tree;
2365 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_label_request);
2366 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2367 "Length: %u", obj_length);
2368 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2369 "Class number: %u - %s",
2373 unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2);
2374 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2376 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2377 "L3PID: %s (0x%04x)",
2378 val_to_str(l3pid, etype_vals, "Unknown"),
2380 proto_item_set_text(ti, "LABEL REQUEST: %s (0x%04x)",
2381 val_to_str(l3pid, etype_vals, "Unknown"),
2387 unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2);
2388 unsigned char lsp_enc = tvb_get_guint8(tvb,offset2);
2389 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2390 "C-type: 4 (Generalized Label Request)");
2391 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2392 "LSP Encoding Type: %s",
2393 val_to_str(lsp_enc, gmpls_lsp_enc_str, "Unknown (%d)"));
2394 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
2395 "Switching Type: %s",
2396 val_to_str(tvb_get_guint8(tvb,offset2+1),
2397 gmpls_switching_type_str, "Unknown (%d)"));
2398 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2399 "G-PID: %s (0x%0x)",
2400 val_to_str(l3pid, gmpls_gpid_str,
2401 val_to_str(l3pid, etype_vals,
2402 "Unknown G-PID(0x%04x)")),
2404 proto_item_set_text(ti, "LABEL REQUEST: Generalized: LSP Encoding=%s, "
2405 "Switching Type=%s, G-PID=%s ",
2406 val_to_str(lsp_enc, gmpls_lsp_enc_str, "Unknown (%d)"),
2407 val_to_str(tvb_get_guint8(tvb,offset2+1),
2408 gmpls_switching_type_str, "Unknown (%d)"),
2409 val_to_str(l3pid, gmpls_gpid_str,
2410 val_to_str(l3pid, etype_vals,
2411 "Unknown (0x%04x)")));
2416 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2417 "C-type: Unknown (%u)",
2419 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2420 "Data (%d bytes)", obj_length - 4);
2426 /*------------------------------------------------------------------------------
2428 *------------------------------------------------------------------------------*/
2430 dissect_rsvp_label (proto_tree *ti, tvbuff_t *tvb,
2431 int offset, int obj_length,
2432 int class, int type,
2435 int offset2 = offset + 4;
2436 proto_tree *rsvp_object_tree;
2440 name = (class==RSVP_CLASS_SUGGESTED_LABEL ? "SUGGESTED LABEL":
2441 (class==RSVP_CLASS_UPSTREAM_LABEL ? "UPSTREAM LABEL":
2443 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_label);
2444 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2445 "Length: %u", obj_length);
2446 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2447 "Class number: %u - %s",
2449 mylen = obj_length - 4;
2452 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2453 "C-type: 1 (Packet Label)");
2454 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2456 tvb_get_ntohl(tvb, offset2));
2457 proto_item_set_text(ti, "%s: %d", name,
2458 tvb_get_ntohl(tvb, offset2));
2462 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2463 "C-type: 2 (Generalized Label)");
2464 proto_item_set_text(ti, "%s: Generalized: ", name);
2465 for (i = 0; i < mylen; i += 4) {
2466 proto_tree_add_text(rsvp_object_tree, tvb, offset2+i, 4,
2467 "Generalized Label: %u",
2468 tvb_get_ntohl(tvb, offset2+i));
2470 proto_item_append_text(ti, "%d%s",
2471 tvb_get_ntohl(tvb, offset2+i),
2473 } else if (i == 16) {
2474 proto_item_append_text(ti, "...");
2480 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2481 "C-type: Unknown (%u)",
2483 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2484 "Data (%d bytes)", mylen);
2489 /*------------------------------------------------------------------------------
2491 *------------------------------------------------------------------------------*/
2493 dissect_rsvp_session_attribute (proto_tree *ti, tvbuff_t *tvb,
2494 int offset, int obj_length,
2495 int class, int type,
2498 int offset2 = offset + 4;
2499 proto_tree *rsvp_object_tree;
2502 proto_tree *ti2, *rsvp_sa_flags_tree;
2504 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_session_attribute);
2505 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2506 "Length: %u", obj_length);
2507 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2508 "Class number: %u - %s",
2513 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2514 "C-type: 7 - IPv4 LSP");
2515 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2516 "Setup priority: %u",
2517 tvb_get_guint8(tvb, offset2));
2518 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
2519 "Hold priority: %u",
2520 tvb_get_guint8(tvb, offset2+1));
2521 flags = tvb_get_guint8(tvb, offset2+2);
2522 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 1,
2523 "Flags: 0x%02x", flags);
2524 rsvp_sa_flags_tree = proto_item_add_subtree(ti2,
2525 ett_rsvp_session_attribute_flags);
2526 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
2527 decode_boolean_bitfield(flags, 0x01, 8,
2528 "Local protection desired",
2529 "Local protection not desired"));
2530 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
2531 decode_boolean_bitfield(flags, 0x02, 8,
2532 "Merging permitted",
2533 "Merging not permitted"));
2534 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
2535 decode_boolean_bitfield(flags, 0x04, 8,
2536 "Ingress node may reroute",
2537 "Ingress node may not reroute"));
2539 name_len = tvb_get_guint8(tvb, offset2+3);
2540 proto_tree_add_text(rsvp_object_tree, tvb, offset2+3, 1,
2541 "Name length: %u", name_len);
2542 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, name_len,
2545 tvb_get_ptr(tvb, offset2+4, name_len));
2547 proto_item_set_text(ti, "SESSION ATTRIBUTE: SetupPrio %d, HoldPrio %d, %s%s%s [%s]",
2548 tvb_get_guint8(tvb, offset2),
2549 tvb_get_guint8(tvb, offset2+1),
2550 flags &0x01 ? "Local Protection, " : "",
2551 flags &0x02 ? "Merging, " : "",
2552 flags &0x04 ? "May Reroute, " : "",
2553 name_len ? (char*)tvb_format_text(tvb, offset2+4, name_len) : "");
2557 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2558 "C-type: Unknown (%u)",
2560 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
2561 "Data (%d bytes)", obj_length - 4);
2566 /*------------------------------------------------------------------------------
2567 * EXPLICIT ROUTE OBJECT
2568 *------------------------------------------------------------------------------*/
2570 dissect_rsvp_explicit_route (proto_tree *ti, tvbuff_t *tvb,
2571 int offset, int obj_length,
2572 int class, int type,
2575 int offset2 = offset + 4;
2576 proto_tree *rsvp_object_tree;
2577 int mylen, i, j, k, l;
2578 proto_tree *ti2, *rsvp_ero_subtree;
2580 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_explicit_route);
2581 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2582 "Length: %u", obj_length);
2583 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2584 "Class number: %u - %s",
2586 mylen = obj_length - 4;
2589 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2591 proto_item_set_text(ti, "EXPLICIT ROUTE: ");
2592 for (i=1, l = 0; l < mylen; i++) {
2593 j = tvb_get_guint8(tvb, offset2+l) & 0x7f;
2596 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2597 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2599 "IPv4 Subobject - %s, %s",
2600 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)),
2601 k ? "Loose" : "Strict");
2603 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2604 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2605 k ? "Loose Hop " : "Strict Hop");
2606 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2608 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2610 tvb_get_guint8(tvb, offset2+l+1));
2611 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 4,
2613 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)));
2614 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+6, 1,
2615 "Prefix length: %u",
2616 tvb_get_guint8(tvb, offset2+l+6));
2618 proto_item_append_text(ti, "IPv4 %s%s",
2619 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)),
2626 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2630 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2631 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2632 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2633 k ? "Loose Hop " : "Strict Hop");
2634 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2636 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2638 tvb_get_guint8(tvb, offset2+l+1));
2639 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 16,
2641 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2+l+2, 16)));
2642 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+18, 1,
2643 "Prefix length: %u",
2644 tvb_get_guint8(tvb, offset2+l+6));
2646 proto_item_append_text(ti, "IPv6 [...]%s", k ? " [L]":"");
2652 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2653 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2655 "Label Subobject - %d, %s",
2656 tvb_get_ntohl(tvb, offset2+l+4),
2657 k ? "Loose" : "Strict");
2659 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2660 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2661 k ? "Loose Hop " : "Strict Hop");
2662 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2664 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2666 tvb_get_guint8(tvb, offset2+l+1));
2667 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 1,
2669 tvb_get_guint8(tvb, offset2+l+2));
2670 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+3, 1,
2672 tvb_get_guint8(tvb, offset2+l+3));
2673 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+4, 4,
2675 tvb_get_ntohl(tvb, offset2+l+4));
2677 proto_item_append_text(ti, "Label %d%s",
2678 tvb_get_ntohl(tvb, offset2+l+4),
2683 case 4: /* Unnumbered Interface-ID */
2684 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2685 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2687 "Unnumbered Interface-ID - %s, %d, %s",
2688 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)),
2689 tvb_get_ntohl(tvb, offset2+l+8),
2690 k ? "Loose" : "Strict");
2692 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2693 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2694 k ? "Loose Hop " : "Strict Hop");
2695 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2696 "Type: 4 (Unnumbered Interface-ID)");
2697 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2699 tvb_get_guint8(tvb, offset2+l+1));
2700 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+4, 4,
2702 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)));
2703 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+8, 4,
2705 tvb_get_ntohl(tvb, offset2+l+8));
2707 proto_item_append_text(ti, "Unnum %s/%d%s",
2708 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)),
2709 tvb_get_ntohl(tvb, offset2+l+8),
2716 k = tvb_get_ntohs(tvb, offset2+l+2);
2717 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2719 "Autonomous System %u",
2722 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2723 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2724 "Type: 32 (Autonomous System Number)");
2725 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2727 tvb_get_guint8(tvb, offset2+l+1));
2728 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 2,
2729 "Autonomous System %u", k);
2731 proto_item_append_text(ti, "AS %d",
2732 tvb_get_ntohs(tvb, offset2+l+2));
2737 case 64: /* Path Term */
2738 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2739 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2741 "LSP Path Termination");
2743 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2744 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2745 k ? "Loose Hop " : "Strict Hop");
2746 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2747 "Type: 64 (MPLS LSP Path Termination)");
2748 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2750 tvb_get_guint8(tvb, offset2+l+1));
2752 proto_item_append_text(ti, "Path Term");
2756 default: /* Unknown subobject */
2757 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2758 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2760 tvb_get_guint8(tvb, offset2+l+1),
2761 "Unknown subobject: %d", j);
2763 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2764 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2765 k ? "Loose Hop " : "Strict Hop");
2766 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2767 "Type: %u (Unknown)", j);
2768 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2770 tvb_get_guint8(tvb, offset2+l+1));
2774 l += tvb_get_guint8(tvb, offset2+l+1);
2777 proto_item_append_text(ti, ", ");
2779 proto_item_append_text(ti, "...");
2785 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2786 "C-type: Unknown (%u)",
2788 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2789 "Data (%d bytes)", mylen);
2794 /*------------------------------------------------------------------------------
2795 * RECORD ROUTE OBJECT
2796 *------------------------------------------------------------------------------*/
2798 dissect_rsvp_record_route (proto_tree *ti, tvbuff_t *tvb,
2799 int offset, int obj_length,
2800 int class, int type,
2803 int offset2 = offset + 4;
2804 proto_tree *rsvp_object_tree;
2806 proto_tree *ti2, *rsvp_rro_subtree;
2808 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_record_route);
2809 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2810 "Length: %u", obj_length);
2811 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2812 "Class number: %u - %s",
2814 proto_item_set_text(ti, "RECORD ROUTE: ");
2815 mylen = obj_length - 4;
2818 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2820 for (i=1, l = 0; l < mylen; i++) {
2821 j = tvb_get_guint8(tvb, offset2+l);
2824 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2826 "IPv4 Subobject - %s",
2827 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)));
2829 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2830 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l, 1,
2832 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l+1, 1,
2834 tvb_get_guint8(tvb, offset2+l+1));
2835 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l+2, 4,
2837 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)));
2838 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l+6, 1,
2839 "Prefix length: %u",
2840 tvb_get_guint8(tvb, offset2+l+6));
2842 proto_item_append_text(ti, "IPv4 %s",
2843 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)));
2849 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2853 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2854 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l, 1,
2856 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l+1, 1,
2858 tvb_get_guint8(tvb, offset2+l+1));
2859 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l+2, 16,
2861 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2+l+2, 16)));
2862 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l+18, 1,
2863 "Prefix length: %u",
2864 tvb_get_guint8(tvb, offset2+l+6));
2866 proto_item_append_text(ti, "IPv6 [...]");
2871 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2873 "Label Subobject - %d",
2874 tvb_get_ntohl(tvb, offset2+l+4));
2876 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2877 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l, 1,
2879 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l+1, 1,
2881 tvb_get_guint8(tvb, offset2+l+1));
2882 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l+2, 1,
2884 tvb_get_guint8(tvb, offset2+l+2));
2885 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l+3, 1,
2887 tvb_get_guint8(tvb, offset2+l+3));
2888 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l+4, 4,
2890 tvb_get_ntohl(tvb, offset2+l+4));
2892 proto_item_append_text(ti, "Label %d",
2893 tvb_get_ntohl(tvb, offset2+l+4));
2897 case 4: /* Unnumbered Interface-ID */
2898 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2900 "Unnumbered Interface-ID - %s, %d",
2901 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)),
2902 tvb_get_ntohl(tvb, offset2+l+8));
2904 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2905 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l, 1,
2906 "Type: 4 (Unnumbered Interface-ID)");
2907 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l+1, 1,
2909 tvb_get_guint8(tvb, offset2+l+1));
2910 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l+1, 1,
2912 tvb_get_guint8(tvb, offset2+l+2));
2913 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l+4, 4,
2915 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)));
2916 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l+8, 4,
2918 tvb_get_ntohl(tvb, offset2+l+8));
2920 proto_item_append_text(ti, "Unnum %s/%d",
2921 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)),
2922 tvb_get_ntohl(tvb, offset2+l+8));
2926 default: /* Unknown subobject */
2927 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2929 tvb_get_guint8(tvb, offset2+l+1),
2930 "Unknown subobject: %u",
2933 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2934 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l, 1,
2935 "Type: %u (Unknown)", j);
2936 proto_tree_add_text(rsvp_rro_subtree, tvb, offset2+l+1, 1,
2938 tvb_get_guint8(tvb, offset2+l+1));
2942 l += tvb_get_guint8(tvb, offset2+l+1);
2945 proto_item_append_text(ti, ", ");
2947 proto_item_append_text(ti, "...");
2954 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2955 "C-type: Unknown (%u)",
2957 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2958 "Data (%d bytes)", mylen);
2964 /*------------------------------------------------------------------------------
2966 *------------------------------------------------------------------------------*/
2968 dissect_rsvp_message_id (proto_tree *ti, tvbuff_t *tvb,
2969 int offset, int obj_length,
2970 int class, int type,
2973 int offset2 = offset + 4;
2974 proto_tree *rsvp_object_tree;
2976 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_policy);
2977 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2978 "Length: %u", obj_length);
2979 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2980 "Class number: %u - %s",
2984 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2986 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
2987 "Flags: %d", tvb_get_guint8(tvb, offset+4));
2988 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
2989 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
2990 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
2991 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
2992 proto_item_set_text(ti, "MESSAGE-ID: %d %s",
2993 tvb_get_ntohl(tvb, offset+8),
2994 tvb_get_guint8(tvb, offset+4) & 1 ? "(Ack Desired)" : "");
2998 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2999 "C-type: Unknown (%u)",
3001 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3002 "Data (%d bytes)", obj_length - 4);
3007 /*------------------------------------------------------------------------------
3009 *------------------------------------------------------------------------------*/
3011 dissect_rsvp_message_id_ack (proto_tree *ti, tvbuff_t *tvb,
3012 int offset, int obj_length,
3013 int class, int type,
3016 int offset2 = offset + 4;
3017 proto_tree *rsvp_object_tree;
3019 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_policy);
3020 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3021 "Length: %u", obj_length);
3022 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3023 "Class number: %u - %s",
3027 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3029 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
3030 "Flags: %d", tvb_get_guint8(tvb, offset+4));
3031 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
3032 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
3033 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
3034 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
3035 proto_item_set_text(ti, "MESSAGE-ID ACK: %d", tvb_get_ntohl(tvb, offset+8));
3039 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3041 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
3042 "Flags: %d", tvb_get_guint8(tvb, offset+4));
3043 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
3044 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
3045 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
3046 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
3047 proto_item_set_text(ti, "MESSAGE-ID NACK: %d", tvb_get_ntohl(tvb, offset+8));
3051 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3052 "C-type: Unknown (%u)",
3054 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3055 "Data (%d bytes)", obj_length - 4);
3060 /*------------------------------------------------------------------------------
3062 *------------------------------------------------------------------------------*/
3064 dissect_rsvp_message_id_list (proto_tree *ti, tvbuff_t *tvb,
3065 int offset, int obj_length,
3066 int class, int type,
3069 int offset2 = offset + 4;
3070 proto_tree *rsvp_object_tree;
3073 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_policy);
3074 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3075 "Length: %u", obj_length);
3076 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3077 "Class number: %u - %s",
3081 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3083 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
3084 "Flags: %d", tvb_get_guint8(tvb, offset+4));
3085 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
3086 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
3087 for (mylen = 8; mylen < obj_length; mylen += 4)
3088 proto_tree_add_text(rsvp_object_tree, tvb, offset+mylen, 4,
3089 "Message-ID: %d", tvb_get_ntohl(tvb, offset+mylen));
3090 proto_item_set_text(ti, "MESSAGE-ID LIST: %d IDs",
3091 (obj_length - 8)/4);
3095 mylen = obj_length - 4;
3096 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3097 "C-type: Unknown (%u)",
3099 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3100 "Data (%d bytes)", obj_length - 4);
3105 /*------------------------------------------------------------------------------
3107 *------------------------------------------------------------------------------*/
3109 dissect_rsvp_hello (proto_tree *ti, tvbuff_t *tvb,
3110 int offset, int obj_length,
3111 int class, int type,
3114 proto_tree *rsvp_object_tree;
3116 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_hello_obj);
3117 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3118 "Length: %u", obj_length);
3119 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3120 "Class number: %u - %s",
3125 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3126 "C-Type: 1 - HELLO %s object",
3127 type==1 ? "REQUEST" : "ACK");
3128 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4,
3129 "Source Instance: 0x%x",tvb_get_ntohl(tvb, offset+4));
3130 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
3131 "Destination Instance: 0x%x",tvb_get_ntohl(tvb, offset+8));
3134 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3135 "C-Type: %d - UNKNOWN", type);
3140 /*------------------------------------------------------------------------------
3142 *------------------------------------------------------------------------------*/
3144 dissect_rsvp_dclass (proto_tree *ti, tvbuff_t *tvb,
3145 int offset, int obj_length,
3146 int class, int type,
3149 int offset2 = offset + 4;
3150 proto_tree *rsvp_object_tree;
3153 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_dclass);
3154 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3155 "Length: %u", obj_length);
3156 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3157 "Class number: %u - %s",
3159 proto_item_set_text(ti, "DCLASS: ");
3162 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3164 for (mylen = 4; mylen < obj_length; mylen += 4) {
3165 proto_tree_add_text(rsvp_object_tree, tvb, offset+mylen+3, 1,
3167 val_to_str(tvb_get_guint8(tvb, offset+mylen+3),
3168 dscp_vals, "Unknown (%d)"));
3169 proto_item_append_text(ti, "%d%s",
3170 tvb_get_guint8(tvb, offset+mylen+3)>>2,
3171 mylen==obj_length-4 ? "":
3173 mylen==16 ? ", ..." : "");
3178 mylen = obj_length - 4;
3179 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3180 "C-type: Unknown (%u)",
3182 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
3183 "Data (%d bytes)", mylen);
3188 /*------------------------------------------------------------------------------
3189 * ADMINISTRATIVE STATUS
3190 *------------------------------------------------------------------------------*/
3192 dissect_rsvp_admin_status (proto_tree *ti, tvbuff_t *tvb,
3193 int offset, int obj_length,
3194 int class, int type,
3197 int offset2 = offset + 4;
3198 proto_tree *rsvp_object_tree;
3199 proto_tree *ti2, *rsvp_admin_subtree;
3202 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_admin_status);
3203 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3204 "Length: %u", obj_length);
3205 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3206 "Class number: %u - %s",
3208 proto_item_set_text(ti, "ADMIN STATUS: ");
3211 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3213 status = tvb_get_ntohl(tvb, offset2);
3214 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
3215 "Admin Status: 0x%08x", status);
3216 rsvp_admin_subtree =
3217 proto_item_add_subtree(ti2, ett_rsvp_admin_status_flags);
3218 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 4,
3219 decode_boolean_bitfield(status, 0x80000000, 32,
3221 "R: Do not reflect"));
3222 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 4,
3223 decode_boolean_bitfield(status, 0x04, 32,
3226 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 4,
3227 decode_boolean_bitfield(status, 0x02, 32,
3228 "A: Administratively Down",
3230 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 4,
3231 decode_boolean_bitfield(status, 0x01, 32,
3232 "D: Delete In Progress",
3234 proto_item_set_text(ti, "ADMIN-STATUS: %s %s %s %s",
3235 (status & (1<<31)) ? "Reflect" : "",
3236 (status & (1<<2)) ? "Testing" : "",
3237 (status & (1<<1)) ? "Admin-Down" : "",
3238 (status & (1<<0)) ? "Deleting" : "");
3242 mylen = obj_length - 4;
3243 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3244 "C-type: Unknown (%u)",
3246 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3247 "Data (%d bytes)", obj_length - 4);
3252 /*------------------------------------------------------------------------------
3253 * LSP TUNNEL INTERFACE ID
3254 *------------------------------------------------------------------------------*/
3256 dissect_rsvp_lsp_tunnel_if_id (proto_tree *ti, tvbuff_t *tvb,
3257 int offset, int obj_length,
3258 int class, int type,
3261 int offset2 = offset + 4;
3262 proto_tree *rsvp_object_tree;
3264 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_lsp_tunnel_if_id);
3265 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3266 "Length: %u", obj_length);
3267 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3268 "Class number: %u - %s",
3270 proto_item_set_text(ti, "LSP INTERFACE-ID: ");
3273 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3274 "C-type: 1 - IPv4");
3275 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
3277 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
3278 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
3279 "Interface ID: %u", tvb_get_ntohl(tvb, offset2+4));
3280 proto_item_set_text(ti, "LSP INTERFACE-ID: IPv4, Router-ID %s, Interface-ID %d",
3281 ip_to_str(tvb_get_ptr(tvb, offset2, 4)),
3282 tvb_get_ntohl(tvb, offset2+4));
3286 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3287 "C-type: Unknown (%u)",
3289 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3290 "Data (%d bytes)", obj_length - 4);
3295 /*------------------------------------------------------------------------------
3297 *------------------------------------------------------------------------------*/
3299 dissect_rsvp_gen_uni (proto_tree *ti, tvbuff_t *tvb,
3300 int offset, int obj_length,
3301 int class, int type,
3304 int offset2 = offset + 4;
3305 proto_tree *rsvp_object_tree;
3306 int mylen, i, j, k, l, m;
3307 proto_tree *ti2, *rsvp_gen_uni_subtree;
3308 int s_len, s_class, s_type;
3310 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_gen_uni);
3311 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3312 "Length: %u", obj_length);
3313 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3314 "Class number: %u - %s",
3316 proto_item_set_text(ti, "GENERALIZED UNI: ");
3318 mylen = obj_length - 4;
3322 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3324 for (i=1, l = 0; l < mylen; i++) {
3325 j = tvb_get_guint8(tvb, offset2+l+2);
3328 case 2: /* We do source and destination TNA together */
3329 c = (j==1) ? "Source" : "Destination";
3330 k = tvb_get_guint8(tvb, offset2+l+3);
3333 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3335 "%s IPv4 TNA - %s", c,
3336 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)));
3337 rsvp_gen_uni_subtree =
3338 proto_item_add_subtree(ti2, ett_rsvp_gen_uni_subobj);
3339 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
3340 "Class: %d (%s)", j, c);
3341 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
3343 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
3345 tvb_get_ntohs(tvb, offset2+l));
3346 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 4,
3348 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)));
3350 proto_item_append_text(ti, "%s IPv4 %s", c,
3351 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)));
3356 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3359 rsvp_gen_uni_subtree =
3360 proto_item_add_subtree(ti2, ett_rsvp_gen_uni_subobj);
3361 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
3362 "Class: %d (%s)", j, c);
3363 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
3365 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
3367 tvb_get_ntohs(tvb, offset2+l));
3368 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 4,
3371 proto_item_append_text(ti, "%s IPv6", c);
3376 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3377 offset2+l, tvb_get_ntohs(tvb, offset2+l),
3379 rsvp_gen_uni_subtree =
3380 proto_item_add_subtree(ti2, ett_rsvp_gen_uni_subobj);
3381 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
3382 "Class: %d (%s)", j, c);
3383 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
3385 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
3387 tvb_get_ntohs(tvb, offset2+l));
3388 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4,
3389 tvb_get_ntohs(tvb, offset2+l)-4,
3392 proto_item_append_text(ti, "%s NSAP", c);
3397 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3398 offset2+l, tvb_get_ntohs(tvb, offset2+l),
3399 "%s UNKNOWN TNA", c);
3400 rsvp_gen_uni_subtree =
3401 proto_item_add_subtree(ti2, ett_rsvp_gen_uni_subobj);
3402 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
3403 "Class: %d (%s)", j, c);
3404 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
3405 "Type: %d (UNKNOWN)", j);
3406 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
3408 tvb_get_ntohs(tvb, offset2+l));
3409 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4,
3410 tvb_get_ntohs(tvb, offset2+l)-4,
3413 proto_item_append_text(ti, "%s UNKNOWN", c);
3419 case 3: /* Diversity subobject */
3420 k = tvb_get_guint8(tvb, offset2+l+3);
3424 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3425 offset2+l, tvb_get_ntohs(tvb, offset2+l),
3426 "Diversity Subobject");
3427 rsvp_gen_uni_subtree =
3428 proto_item_add_subtree(ti2, ett_rsvp_gen_uni_subobj);
3429 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
3430 "Class: %d (Diversity)", j);
3431 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
3432 "Type: %d", tvb_get_guint8(tvb, offset2+l+3));
3433 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
3435 tvb_get_ntohs(tvb, offset2+l));
3436 m = tvb_get_guint8(tvb, offset2+l+4) >> 4;
3437 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1,
3438 "Diversity: %d - %s", m,
3439 val_to_str(m, ouni_guni_diversity_str, "Unknown"));
3440 s_len = tvb_get_ntohs(tvb, offset2+l+8);
3441 s_class = tvb_get_guint8(tvb, offset2+l+10);
3442 s_type = tvb_get_guint8(tvb, offset2+l+11);
3443 ti2 = proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+8,
3445 dissect_rsvp_session(ti2, tvb, offset2+l+8, s_len, s_class, s_type,
3446 val_to_str(s_class, rsvp_class_vals, "Unknown"));
3448 s_len = tvb_get_ntohs(tvb, offset2+l+8);
3449 s_class = tvb_get_guint8(tvb, offset2+l+10);
3450 s_type = tvb_get_guint8(tvb, offset2+l+11);
3451 ti2 = proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+8,
3453 dissect_rsvp_template_filter(ti2, tvb, offset2+l+8, s_len, s_class, s_type,
3454 val_to_str(s_class, rsvp_class_vals, "Unknown"));
3457 proto_item_append_text(ti, "Diversity");
3464 case 4: /* Egress Label */
3465 k = tvb_get_guint8(tvb, offset2+l+3);
3469 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3470 offset2+l, tvb_get_ntohs(tvb, offset2+l),
3471 "Egress Label Subobject");
3472 rsvp_gen_uni_subtree =
3473 proto_item_add_subtree(ti2, ett_rsvp_gen_uni_subobj);
3474 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
3475 "Class: %d (Egress Label)", j);
3476 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
3477 "Type: %d", tvb_get_guint8(tvb, offset2+l+3));
3478 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
3480 tvb_get_ntohs(tvb, offset2+l));
3481 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1,
3483 decode_boolean_bitfield(
3484 tvb_get_guint8(tvb, offset2+l+4), 0x80, 8,
3485 "U: 1 - Upstream label/port ID",
3486 "U: 0 - Downstream label/port ID"));
3487 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+7, 1,
3488 "Label type: %u", tvb_get_guint8(tvb, offset2+l+7));
3489 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+8, 4,
3490 "Logical Port ID: %u", tvb_get_ntohl(tvb, offset2+l+8));
3491 proto_item_append_text(ti2, ": %s, Label type %d, Port ID %d, Label ",
3492 tvb_get_guint8(tvb, offset2+l+4) & 0x80 ?
3493 "Upstream" : "Downstream",
3494 tvb_get_guint8(tvb, offset2+l+7),
3495 tvb_get_ntohl(tvb, offset2+l+8));
3496 for (j=12; j < tvb_get_ntohs(tvb, offset2+l); j+=4) {
3497 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+8, 4,
3498 "Label: %u", tvb_get_ntohl(tvb, offset2+l+j));
3499 proto_item_append_text(ti2, "%u ", tvb_get_ntohl(tvb, offset2+l+j));
3502 proto_item_append_text(ti, "Egress Label");
3508 case 5: /* Service Level */
3509 k = tvb_get_guint8(tvb, offset2+l+3);
3513 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3514 offset2+l, tvb_get_ntohs(tvb, offset2+l),
3515 "Service Level Subobject");
3516 rsvp_gen_uni_subtree =
3517 proto_item_add_subtree(ti2, ett_rsvp_gen_uni_subobj);
3518 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+2, 1,
3519 "Class: %d (Egress Label)", j);
3520 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+3, 1,
3521 "Type: %d", tvb_get_guint8(tvb, offset2+l+3));
3522 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 2,
3524 tvb_get_ntohs(tvb, offset2+l));
3525 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+4, 1,
3526 "Service Level: %u", tvb_get_guint8(tvb, offset2+l+4));
3527 proto_item_append_text(ti2, ": %u", tvb_get_guint8(tvb, offset2+l+4));
3529 proto_item_append_text(ti, "Service Level %d", tvb_get_guint8(tvb, offset2+l+4));
3535 default: /* Unknown subobject */
3536 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
3538 tvb_get_ntohs(tvb, offset2+l),
3539 "Unknown subobject: %u",
3541 rsvp_gen_uni_subtree =
3542 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
3543 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l, 1,
3544 "Type: %u (Unknown)", j);
3545 proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+1, 1,
3547 tvb_get_guint8(tvb, offset2+l+1));
3551 l += tvb_get_guint8(tvb, offset2+l+1);
3554 proto_item_append_text(ti, ", ");
3556 proto_item_append_text(ti, "...");
3563 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
3564 "C-type: Unknown (%u)",
3566 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
3567 "Data (%d bytes)", mylen);
3572 /*------------------------------------------------------------------------------
3573 * Dissect a single RSVP message in a tree
3574 *------------------------------------------------------------------------------*/
3576 dissect_rsvp_msg_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
3579 proto_tree *rsvp_tree = NULL;
3580 proto_tree *rsvp_header_tree;
3581 proto_tree *rsvp_object_tree;
3583 guint16 cksum, computed_cksum;
3588 guint8 message_type;
3589 int session_off, tempfilt_off;
3596 ver_flags = tvb_get_guint8(tvb, 0);
3597 msg_length = tvb_get_ntohs(tvb, 6);
3598 message_type = tvb_get_guint8(tvb, 1);
3600 ti = proto_tree_add_item(tree, proto_rsvp, tvb, offset, msg_length,
3602 rsvp_tree = proto_item_add_subtree(ti, tree_mode);
3603 proto_item_append_text(rsvp_tree, ": ");
3604 proto_item_append_text(rsvp_tree, val_to_str(message_type, message_type_vals,
3606 find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off);
3608 proto_item_append_text(rsvp_tree, summary_session(tvb, session_off));
3610 proto_item_append_text(rsvp_tree, summary_template(tvb, tempfilt_off));
3612 ti = proto_tree_add_text(rsvp_tree, tvb, offset, 8, "RSVP Header. %s",
3613 val_to_str(message_type, message_type_vals,
3614 "Unknown Message (%u). "));
3615 rsvp_header_tree = proto_item_add_subtree(ti, ett_rsvp_hdr);
3617 proto_tree_add_text(rsvp_header_tree, tvb, offset, 1, "RSVP Version: %u",
3618 (ver_flags & 0xf0)>>4);
3619 proto_tree_add_text(rsvp_header_tree, tvb, offset, 1, "Flags: %02x",
3621 proto_tree_add_uint(rsvp_header_tree, rsvp_filter[RSVPF_MSG], tvb,
3622 offset+1, 1, message_type);
3623 switch (RSVPF_MSG + message_type) {
3629 case RSVPF_PATHTEAR:
3630 case RSVPF_RESVTEAR:
3631 case RSVPF_RCONFIRM:
3632 case RSVPF_RTEARCONFIRM:
3635 case RSVPF_SREFRESH:
3637 proto_tree_add_boolean_hidden(rsvp_header_tree, rsvp_filter[RSVPF_MSG + message_type], tvb,
3642 proto_tree_add_protocol_format(rsvp_header_tree, proto_malformed, tvb, offset+1, 1,
3643 "Invalid message type: %u", message_type);
3647 cksum = tvb_get_ntohs(tvb, offset+2);
3648 if (!pinfo->fragmented && (int) tvb_length(tvb) >= msg_length) {
3649 /* The packet isn't part of a fragmented datagram and isn't
3650 truncated, so we can checksum it. */
3651 cksum_vec[0].ptr = tvb_get_ptr(tvb, 0, msg_length);
3652 cksum_vec[0].len = msg_length;
3653 computed_cksum = in_cksum(&cksum_vec[0], 1);
3654 if (computed_cksum == 0) {
3655 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
3656 "Message Checksum: 0x%04x (correct)",
3659 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
3660 "Message Checksum: 0x%04x (incorrect, should be 0x%04x)",
3662 in_cksum_shouldbe(cksum, computed_cksum));
3665 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
3666 "Message Checksum: 0x%04x",
3669 proto_tree_add_text(rsvp_header_tree, tvb, offset+4, 1,
3671 tvb_get_guint8(tvb, offset+4));
3672 proto_tree_add_text(rsvp_header_tree, tvb, offset+6, 2,
3673 "Message length: %u", msg_length);
3678 if (message_type == RSVP_MSG_BUNDLE) {
3679 /* Bundle message. Dissect component messages */
3680 if (rsvp_bundle_dissect) {
3682 while (len < msg_length) {
3685 sub_len = tvb_get_ntohs(tvb, len+6);
3686 tvb_sub = tvb_new_subset(tvb, len, sub_len, sub_len);
3687 dissect_rsvp_msg_tree(tvb_sub, pinfo, rsvp_tree, ett_rsvp_bundle_compmsg);
3691 proto_tree_add_text(rsvp_tree, tvb, offset, msg_length - len,
3692 "Bundle Component Messages Not Dissected");
3697 while (len < msg_length) {
3702 obj_length = tvb_get_ntohs(tvb, offset);
3703 class = tvb_get_guint8(tvb, offset+2);
3704 type = tvb_get_guint8(tvb, offset+3);
3705 type_str = val_to_str(class, rsvp_class_vals, "Unknown");
3706 proto_tree_add_uint_hidden(rsvp_tree, rsvp_filter[RSVPF_OBJECT], tvb,
3707 offset, obj_length, class);
3708 ti = proto_tree_add_item(rsvp_tree, rsvp_filter[rsvp_class_to_filter_num(class)],
3709 tvb, offset, obj_length, FALSE);
3715 case RSVP_CLASS_SESSION:
3716 dissect_rsvp_session(ti, tvb, offset, obj_length, class, type, type_str);
3719 case RSVP_CLASS_HOP:
3720 dissect_rsvp_hop(ti, tvb, offset, obj_length, class, type, type_str);
3723 case RSVP_CLASS_TIME_VALUES:
3724 dissect_rsvp_time_values(ti, tvb, offset, obj_length, class, type, type_str);
3727 case RSVP_CLASS_ERROR:
3728 dissect_rsvp_error(ti, tvb, offset, obj_length, class, type, type_str);
3731 case RSVP_CLASS_SCOPE:
3732 dissect_rsvp_scope(ti, tvb, offset, obj_length, class, type, type_str);
3735 case RSVP_CLASS_STYLE:
3736 dissect_rsvp_style(ti, tvb, offset, obj_length, class, type, type_str);
3739 case RSVP_CLASS_CONFIRM:
3740 dissect_rsvp_confirm(ti, tvb, offset, obj_length, class, type, type_str);
3743 case RSVP_CLASS_SENDER_TEMPLATE:
3744 case RSVP_CLASS_FILTER_SPEC:
3745 dissect_rsvp_template_filter(ti, tvb, offset, obj_length, class, type, type_str);
3748 case RSVP_CLASS_SENDER_TSPEC:
3749 dissect_rsvp_tspec(ti, tvb, offset, obj_length, class, type, type_str);
3752 case RSVP_CLASS_FLOWSPEC:
3753 dissect_rsvp_flowspec(ti, tvb, offset, obj_length, class, type, type_str);
3756 case RSVP_CLASS_ADSPEC:
3757 dissect_rsvp_adspec(ti, tvb, offset, obj_length, class, type, type_str);
3760 case RSVP_CLASS_INTEGRITY:
3761 dissect_rsvp_integrity(ti, tvb, offset, obj_length, class, type, type_str);
3764 case RSVP_CLASS_POLICY:
3765 dissect_rsvp_policy(ti, tvb, offset, obj_length, class, type, type_str);
3768 case RSVP_CLASS_LABEL_REQUEST:
3769 dissect_rsvp_label_request(ti, tvb, offset, obj_length, class, type, type_str);
3772 case RSVP_CLASS_UPSTREAM_LABEL:
3773 case RSVP_CLASS_SUGGESTED_LABEL:
3774 case RSVP_CLASS_LABEL:
3775 dissect_rsvp_label(ti, tvb, offset, obj_length, class, type, type_str);
3778 case RSVP_CLASS_SESSION_ATTRIBUTE:
3779 dissect_rsvp_session_attribute(ti, tvb, offset, obj_length, class, type, type_str);
3782 case RSVP_CLASS_EXPLICIT_ROUTE:
3783 dissect_rsvp_explicit_route(ti, tvb, offset, obj_length, class, type, type_str);
3786 case RSVP_CLASS_RECORD_ROUTE:
3787 dissect_rsvp_record_route(ti, tvb, offset, obj_length, class, type, type_str);
3790 case RSVP_CLASS_MESSAGE_ID:
3791 dissect_rsvp_message_id(ti, tvb, offset, obj_length, class, type, type_str);
3794 case RSVP_CLASS_MESSAGE_ID_ACK:
3795 dissect_rsvp_message_id_ack(ti, tvb, offset, obj_length, class, type, type_str);
3798 case RSVP_CLASS_MESSAGE_ID_LIST:
3799 dissect_rsvp_message_id_list(ti, tvb, offset, obj_length, class, type, type_str);
3802 case RSVP_CLASS_HELLO:
3803 dissect_rsvp_hello(ti, tvb, offset, obj_length, class, type, type_str);
3806 case RSVP_CLASS_DCLASS:
3807 dissect_rsvp_dclass(ti, tvb, offset, obj_length, class, type, type_str);
3810 case RSVP_CLASS_ADMIN_STATUS:
3811 dissect_rsvp_admin_status(ti, tvb, offset, obj_length, class, type, type_str);
3814 case RSVP_CLASS_LSP_TUNNEL_IF_ID:
3815 dissect_rsvp_lsp_tunnel_if_id(ti, tvb, offset, obj_length, class, type, type_str);
3818 case RSVP_CLASS_GENERALIZED_UNI:
3819 dissect_rsvp_gen_uni(ti, tvb, offset, obj_length, class, type, type_str);
3822 case RSVP_CLASS_NULL:
3824 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_unknown_class);
3825 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
3826 "Length: %u", obj_length);
3827 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
3828 "Class number: %u - %s",
3830 proto_tree_add_text(rsvp_object_tree, tvb, offset2, obj_length - 4,
3831 "Data (%d bytes)", obj_length - 4);
3835 if (obj_length == 0)
3837 offset += obj_length;
3842 /*------------------------------------------------------------------------------
3844 *------------------------------------------------------------------------------*/
3846 dissect_rsvp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3849 guint8 message_type;
3851 int session_off, tempfilt_off;
3853 if (check_col(pinfo->cinfo, COL_PROTOCOL))
3854 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSVP");
3855 if (check_col(pinfo->cinfo, COL_INFO))
3856 col_clear(pinfo->cinfo, COL_INFO);
3858 ver_flags = tvb_get_guint8(tvb, 0);
3859 message_type = tvb_get_guint8(tvb, 1);
3860 msg_length = tvb_get_ntohs(tvb, 6);
3862 if (check_col(pinfo->cinfo, COL_INFO)) {
3863 col_add_str(pinfo->cinfo, COL_INFO,
3864 val_to_str(message_type, message_type_vals, "Unknown (%u). "));
3865 find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off);
3867 col_append_str(pinfo->cinfo, COL_INFO, summary_session(tvb, session_off));
3869 col_append_str(pinfo->cinfo, COL_INFO, summary_template(tvb, tempfilt_off));
3872 if (check_col(pinfo->cinfo, COL_INFO)) {
3873 col_add_str(pinfo->cinfo, COL_INFO,
3874 val_to_str(message_type, message_type_vals, "Unknown (%u). "));
3875 if (message_type == RSVP_MSG_BUNDLE) {
3876 col_add_str(pinfo->cinfo, COL_INFO,
3877 rsvp_bundle_dissect ?
3878 "Component Messages Dissected" :
3879 "Component Messages Not Dissected");
3881 find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off);
3883 col_append_str(pinfo->cinfo, COL_INFO, summary_session(tvb, session_off));
3885 col_append_str(pinfo->cinfo, COL_INFO, summary_template(tvb, tempfilt_off));
3890 dissect_rsvp_msg_tree(tvb, pinfo, tree, ett_rsvp);
3895 register_rsvp_prefs (void)
3897 module_t *rsvp_module;
3899 rsvp_module = prefs_register_protocol(proto_rsvp, NULL);
3900 prefs_register_bool_preference(
3901 rsvp_module, "rsvp_process_bundle",
3902 "Dissect sub-messages in BUNDLE message",
3903 "Specifies whether Ethereal should decode and display sub-messages within BUNDLE messages",
3904 &rsvp_bundle_dissect);
3908 proto_register_rsvp(void)
3910 static gint *ett[] = {
3915 &ett_rsvp_hop_subobj,
3916 &ett_rsvp_time_values,
3921 &ett_rsvp_sender_template,
3922 &ett_rsvp_filter_spec,
3923 &ett_rsvp_sender_tspec,
3924 &ett_rsvp_sender_tspec_subtree,
3926 &ett_rsvp_flowspec_subtree,
3928 &ett_rsvp_adspec_subtree,
3929 &ett_rsvp_integrity,
3930 &ett_rsvp_integrity_flags,
3933 &ett_rsvp_label_request,
3934 &ett_rsvp_session_attribute,
3935 &ett_rsvp_session_attribute_flags,
3936 &ett_rsvp_explicit_route,
3937 &ett_rsvp_explicit_route_subobj,
3938 &ett_rsvp_record_route,
3939 &ett_rsvp_record_route_subobj,
3940 &ett_rsvp_hello_obj,
3942 &ett_rsvp_lsp_tunnel_if_id,
3943 &ett_rsvp_admin_status,
3944 &ett_rsvp_admin_status_flags,
3946 &ett_rsvp_gen_uni_subobj,
3947 &ett_rsvp_bundle_compmsg,
3948 &ett_rsvp_unknown_class,
3951 proto_rsvp = proto_register_protocol("Resource ReserVation Protocol (RSVP)",
3953 proto_register_field_array(proto_rsvp, rsvpf_info, array_length(rsvpf_info));
3954 proto_register_subtree_array(ett, array_length(ett));
3955 register_rsvp_prefs();
3959 proto_reg_handoff_rsvp(void)
3961 dissector_handle_t rsvp_handle;
3963 rsvp_handle = create_dissector_handle(dissect_rsvp, proto_rsvp);
3964 dissector_add("ip.proto", IP_PROTO_RSVP, rsvp_handle);