2 * Routines for RSVP packet disassembly
4 * (c) Copyright Ashok Narayanan <ashokn@cisco.com>
6 * $Id: packet-rsvp.c,v 1.57 2002/03/02 07:22:20 guy 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 RC2205 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>
55 #ifdef HAVE_SYS_TYPES_H
56 # include <sys/types.h>
59 #ifdef HAVE_NETINET_IN_H
60 # include <netinet/in.h>
65 #ifdef NEED_SNPRINTF_H
66 # include "snprintf.h"
69 #include <epan/tvbuff.h>
70 #include <epan/packet.h>
72 #include "ieee-float.h"
76 #include "packet-ip.h"
78 static int proto_rsvp = -1;
80 static gint ett_rsvp = -1;
81 static gint ett_rsvp_hdr = -1;
82 static gint ett_rsvp_session = -1;
83 static gint ett_rsvp_hop = -1;
84 static gint ett_rsvp_time_values = -1;
85 static gint ett_rsvp_error = -1;
86 static gint ett_rsvp_scope = -1;
87 static gint ett_rsvp_style = -1;
88 static gint ett_rsvp_confirm = -1;
89 static gint ett_rsvp_sender_template = -1;
90 static gint ett_rsvp_filter_spec = -1;
91 static gint ett_rsvp_sender_tspec = -1;
92 static gint ett_rsvp_sender_tspec_subtree = -1;
93 static gint ett_rsvp_flowspec = -1;
94 static gint ett_rsvp_flowspec_subtree = -1;
95 static gint ett_rsvp_adspec = -1;
96 static gint ett_rsvp_adspec_subtree = -1;
97 static gint ett_rsvp_integrity = -1;
98 static gint ett_rsvp_dclass = -1;
99 static gint ett_rsvp_lsp_tunnel_if_id = -1;
100 static gint ett_rsvp_policy = -1;
101 static gint ett_rsvp_label = -1;
102 static gint ett_rsvp_label_request = -1;
103 static gint ett_rsvp_session_attribute = -1;
104 static gint ett_rsvp_session_attribute_flags = -1;
105 static gint ett_rsvp_hello_obj = -1;
106 static gint ett_rsvp_explicit_route = -1;
107 static gint ett_rsvp_explicit_route_subobj = -1;
108 static gint ett_rsvp_record_route = -1;
109 static gint ett_rsvp_record_route_subobj = -1;
110 static gint ett_rsvp_hop_subobj = -1;
111 static gint ett_rsvp_admin_status = -1;
112 static gint ett_rsvp_admin_status_flags = -1;
113 static gint ett_rsvp_unknown_class = -1;
127 RSVP_MSG_RTEAR_CONFIRM=10,
128 RSVP_MSG_BUNDLE = 12,
130 RSVP_MSG_SREFRESH = 15,
132 } rsvp_message_types;
134 static value_string message_type_vals[] = {
135 {RSVP_MSG_PATH, "PATH Message. "},
136 {RSVP_MSG_RESV, "RESV Message. "},
137 {RSVP_MSG_PERR, "PATH ERROR Message. "},
138 {RSVP_MSG_RERR, "RESV ERROR Message. "},
139 {RSVP_MSG_PTEAR, "PATH TEAR Message. "},
140 {RSVP_MSG_RTEAR, "RESV TEAR Message. "},
141 {RSVP_MSG_CONFIRM, "CONFIRM Message. "},
142 {RSVP_MSG_RTEAR_CONFIRM, "RESV TEAR CONFIRM Message. "},
143 {RSVP_MSG_BUNDLE, "BUNDLE Message. "},
144 {RSVP_MSG_ACK, "ACK Message. "},
145 {RSVP_MSG_SREFRESH, "SREFRESH Message. "},
146 {RSVP_MSG_HELLO, "HELLO Message. "},
153 #define MAX_RSVP_CLASS 15
160 RSVP_CLASS_INTEGRITY,
161 RSVP_CLASS_TIME_VALUES,
166 RSVP_CLASS_FILTER_SPEC,
167 RSVP_CLASS_SENDER_TEMPLATE,
168 RSVP_CLASS_SENDER_TSPEC,
174 RSVP_CLASS_LABEL_REQUEST=19,
175 RSVP_CLASS_EXPLICIT_ROUTE,
176 RSVP_CLASS_RECORD_ROUTE,
180 RSVP_CLASS_MESSAGE_ID,
181 RSVP_CLASS_MESSAGE_ID_ACK,
182 RSVP_CLASS_MESSAGE_ID_LIST,
184 RSVP_CLASS_UPSTREAM_LABEL, /* Number is TBA */
185 RSVP_CLASS_LABEL_SET, /* Number is TBA */
187 RSVP_CLASS_SUGGESTED_LABEL = 140, /* Number is TBA */
189 RSVP_CLASS_SESSION_ATTRIBUTE = 207,
190 RSVP_CLASS_ADMIN_STATUS = 210, /* Number is TBA */
191 RSVP_CLASS_DCLASS = 225,
192 RSVP_CLASS_LSP_TUNNEL_IF_ID = 227,
195 static value_string rsvp_class_vals[] = {
196 {RSVP_CLASS_NULL, "NULL object"},
197 {RSVP_CLASS_SESSION, "SESSION object"},
198 {RSVP_CLASS_HOP, "HOP object"},
199 {RSVP_CLASS_INTEGRITY, "INTEGRITY object"},
200 {RSVP_CLASS_TIME_VALUES, "TIME VALUES object"},
201 {RSVP_CLASS_ERROR, "ERROR object"},
202 {RSVP_CLASS_SCOPE, "SCOPE object"},
203 {RSVP_CLASS_STYLE, "STYLE object"},
204 {RSVP_CLASS_FLOWSPEC, "FLOWSPEC object"},
205 {RSVP_CLASS_FILTER_SPEC, "FILTER SPEC object"},
206 {RSVP_CLASS_SENDER_TEMPLATE, "SENDER TEMPLATE object"},
207 {RSVP_CLASS_SENDER_TSPEC, "SENDER TSPEC object"},
208 {RSVP_CLASS_ADSPEC, "ADSPEC object"},
209 {RSVP_CLASS_POLICY, "POLICY object"},
210 {RSVP_CLASS_CONFIRM, "CONFIRM object"},
211 {RSVP_CLASS_LABEL, "LABEL object"},
212 {RSVP_CLASS_LABEL_REQUEST, "LABEL REQUEST object"},
213 {RSVP_CLASS_EXPLICIT_ROUTE, "EXPLICIT ROUTE object"},
214 {RSVP_CLASS_RECORD_ROUTE, "RECORD ROUTE object"},
215 {RSVP_CLASS_SESSION_ATTRIBUTE, "SESSION ATTRIBUTE object"},
216 {RSVP_CLASS_MESSAGE_ID, "MESSAGE-ID object"},
217 {RSVP_CLASS_MESSAGE_ID_ACK, "MESSAGE-ID ACK/NACK object"},
218 {RSVP_CLASS_MESSAGE_ID_LIST, "MESSAGE-ID LIST object"},
219 {RSVP_CLASS_HELLO, "HELLO object"},
220 {RSVP_CLASS_UPSTREAM_LABEL, "UPSTREAM-LABEL object"},
221 {RSVP_CLASS_LABEL_SET, "LABEL-SET object"},
222 {RSVP_CLASS_SUGGESTED_LABEL, "SUGGESTED-LABEL object"},
223 {RSVP_CLASS_DCLASS, "DCLASS object"},
224 {RSVP_CLASS_LSP_TUNNEL_IF_ID, "LSP-TUNNEL INTERFACE-ID object"},
225 {RSVP_CLASS_ADMIN_STATUS, "ADNUM-STATUS object"},
232 enum rsvp_error_types {
233 RSVP_ERROR_CONFIRM = 0,
234 RSVP_ERROR_ADMISSION,
237 RSVP_ERROR_NO_SENDER,
238 RSVP_ERROR_CONFLICT_RESV_STYLE,
239 RSVP_ERROR_UNKNOWN_RESV_STYLE,
240 RSVP_ERROR_CONFLICT_DEST_PORTS,
241 RSVP_ERROR_CONFLICT_SRC_PORTS,
242 RSVP_ERROR_PREEMPTED=12,
243 RSVP_ERROR_UNKNOWN_CLASS,
244 RSVP_ERROR_UNKNOWN_C_TYPE,
245 RSVP_ERROR_TRAFFIC = 21,
246 RSVP_ERROR_TRAFFIC_SYSTEM,
252 static value_string rsvp_error_vals[] = {
253 {RSVP_ERROR_CONFIRM, "Confirmation"},
254 {RSVP_ERROR_ADMISSION, "Admission Control Failure "},
255 {RSVP_ERROR_POLICY, "Policy Control Failure"},
256 {RSVP_ERROR_NO_PATH, "No PATH information for this RESV message"},
257 {RSVP_ERROR_NO_SENDER, "No sender information for this RESV message"},
258 {RSVP_ERROR_CONFLICT_RESV_STYLE, "Conflicting reservation styles"},
259 {RSVP_ERROR_UNKNOWN_RESV_STYLE, "Unknown reservation style"},
260 {RSVP_ERROR_CONFLICT_DEST_PORTS, "Conflicting destination ports"},
261 {RSVP_ERROR_CONFLICT_SRC_PORTS, "Conflicting source ports"},
262 {RSVP_ERROR_PREEMPTED, "Service preempted"},
263 {RSVP_ERROR_UNKNOWN_CLASS, "Unknown object class"},
264 {RSVP_ERROR_UNKNOWN_C_TYPE, "Unknown object C-type"},
265 {RSVP_ERROR_TRAFFIC, "Traffic Control Error"},
266 {RSVP_ERROR_TRAFFIC_SYSTEM, "Traffic Control System Error"},
267 {RSVP_ERROR_SYSTEM, "RSVP System Error"},
268 {RSVP_ERROR_ROUTING, "Routing Error"},
269 {RSVP_ERROR_NOTIFY, "RSVP Notify Error"},
274 * Defines the reservation style plus style-specific information that
275 * is not a FLOWSPEC or FILTER_SPEC object, in a RESV message.
277 #define RSVP_DISTINCT (1 << 3)
278 #define RSVP_SHARED (2 << 3)
279 #define RSVP_SHARING_MASK (RSVP_DISTINCT | RSVP_SHARED)
281 #define RSVP_SCOPE_WILD 1
282 #define RSVP_SCOPE_EXPLICIT 2
283 #define RSVP_SCOPE_MASK 0x07
285 #define RSVP_WF (RSVP_SHARED | RSVP_SCOPE_WILD)
286 #define RSVP_FF (RSVP_DISTINCT | RSVP_SCOPE_EXPLICIT)
287 #define RSVP_SE (RSVP_SHARED | RSVP_SCOPE_EXPLICIT)
289 static value_string style_vals[] = {
290 { RSVP_WF, "Wildcard Filter" },
291 { RSVP_FF, "Fixed Filter" },
292 { RSVP_SE, "Shared-Explicit" },
297 * Defines a desired QoS, in a RESV message.
299 enum qos_service_type {
300 QOS_QUALITATIVE = 128, /* Qualitative service */
301 QOS_NULL = 6, /* Null service (RFC2997) */
302 QOS_CONTROLLED_LOAD= 5, /* Controlled Load Service */
303 QOS_GUARANTEED = 2, /* Guaranteed service */
304 QOS_TSPEC = 1 /* Traffic specification */
307 static value_string qos_vals[] = {
308 { QOS_QUALITATIVE, "Qualitative QoS" },
309 { QOS_NULL, "Null-Service QoS" },
310 { QOS_CONTROLLED_LOAD, "Controlled-load QoS" },
311 { QOS_GUARANTEED, "Guaranteed rate QoS" },
312 { QOS_TSPEC, "Traffic specification" },
316 static value_string svc_vals[] = {
317 { 126, "Compression Hint" },
318 { 127, "Token bucket" },
319 { 128, "Null Service" },
320 { 130, "Guaranteed-rate RSpec" },
324 enum rsvp_spec_types { INTSRV = 2 };
326 enum intsrv_services {
331 INTSRV_QUALITATIVE = 128
334 static value_string intsrv_services_str[] = {
335 {INTSRV_GENERAL, "Default General Parameters"},
336 {INTSRV_GTD, "Guaranteed Rate"},
337 {INTSRV_CLOAD, "Controlled Load"},
338 {INTSRV_NULL, "Null Service"},
339 {INTSRV_QUALITATIVE, "Null Service"},
344 enum intsrv_field_name {
345 INTSRV_NON_IS_HOPS = 1, INTSRV_COMPOSED_NON_IS_HOPS,
346 INTSRV_IS_HOPS, INTSRV_COMPOSED_IS_HOPS,
347 INTSRV_PATH_BANDWIDTH, INTSRV_MIN_PATH_BANDWIDTH,
348 INTSRV_IF_LATENCY, INTSRV_PATH_LATENCY,
349 INTSRV_MTU, INTSRV_COMPOSED_MTU,
351 INTSRV_TOKEN_BUCKET_TSPEC = 127,
352 INTSRV_QUALITATIVE_TSPEC = 128,
353 INTSRV_GTD_RSPEC = 130,
355 INTSRV_DELAY = 131, /* Gtd Parameter C - Max Delay Bound - bytes */
356 INTSRV_MAX_JITTER, /* Gtd Parameter D - Max Jitter */
357 INTSRV_E2E_DELAY, /* Gtd Parameter Ctot */
358 INTSRV_E2E_MAX_JITTER, /* Gtd Parameter Dtot */
359 INTSRV_SHP_DELAY, /* Gtd Parameter Csum */
360 INTSRV_SHP_MAX_JITTER /* Gtd Parameter Dsum */
364 static value_string adspec_params[] = {
366 {6, "Path b/w estimate"},
367 {8, "Minimum path latency"},
368 {10, "Composed MTU"},
369 {133, "End-to-end composed value for C"},
370 {134, "End-to-end composed value for D"},
371 {135, "Since-last-reshaping point composed C"},
372 {136, "Since-last-reshaping point composed D"},
376 const value_string gmpls_lsp_enc_str[] = {
378 { 2, "Ethernet v2/DIX"},
381 { 5, "SDH ITU-T G.707"},
382 { 6, "SONET ANSI T1.105"},
383 { 7, "Digital Wrapper"},
384 { 8, "Lambda (photonic)"},
386 {10, "Ethernet 802.3"},
387 {11, "FiberChannel"},
391 const value_string gmpls_switching_type_str[] = {
392 { 1, "Packet-Switch Capable-1 (PSC-1)"},
393 { 2, "Packet-Switch Capable-2 (PSC-2)"},
394 { 3, "Packet-Switch Capable-3 (PSC-3)"},
395 { 4, "Packet-Switch Capable-4 (PSC-4)"},
396 { 51, "Layer-2 Switch Capable (L2SC)"},
397 {100, "Time-Division-Multiplex Capable (TDM)"},
398 {150, "Lambda-Switch Capable (LSC)"},
399 {200, "Fiber-Switch Capable (FSC)"},
403 static const value_string gmpls_gpid_str[] = {
404 { 5, "Asynchronous mapping of E3 (SONET, SDH)"},
405 { 8, "Bit synchronous mapping of E3 (SDH)"},
406 { 9, "Byte synchronous mapping of E3 (SDH)"},
407 {10, "Asynchronous mapping of DS2/T2 (SONET, SDH)"},
408 {11, "Bit synchronous mapping of DS2/T2 (SONET, SDH)"},
409 {13, "Asynchronous mapping of E1 (SONET, SDH)"},
410 {14, "Byte synchronous mapping of E1 (SONET, SDH)"},
411 {15, "Byte synchronous mapping of 31 * DS0 (SONET, SDH)"},
412 {16, "Asynchronous mapping of DS1/T1 (SONET, SDH)"},
413 {17, "Bit synchronous mapping of DS1/T1 (SONET, SDH)"},
414 {18, "Byte synchronous mapping of DS1/T1 (SONET, SDH)"},
415 {19, "VC-11 in VC-12 (SDH)"},
416 {22, "DS1 SF Asynchronous (SONET)"},
417 {23, "DS1 ESF Asynchronous (SONET)"},
418 {24, "DS3 M23 Asynchronous (SONET)"},
419 {25, "DS3 C-Bit Parity Asynchronous (SONET)"},
420 {26, "VT/LOVC (SONET, SDH)"},
421 {27, "STS SPE/HOVC (SONET, SDH)"},
422 {28, "POS - No Scrambling, 16 bit CRC (SONET, SDH)"},
423 {29, "POS - No Scrambling, 32 bit CRC (SONET, SDH)"},
424 {30, "POS - Scrambling, 16 bit CRC (SONET, SDH)"},
425 {31, "POS - Scrambling, 32 bit CRC (SONET, SDH)"},
426 {32, "ATM Mapping (SONET, SDH)"},
427 {33, "Ethernet (SDH, Lambda, Fiber)"},
428 {34, "SDH (Lambda, Fiber)"},
429 {35, "SONET (Lambda, Fiber)"},
430 {36, "Digital Wrapper (Lambda, Fiber)"},
431 {37, "Lambda (Fiber)"},
432 {38, "ETSI PDH (SDH)"},
433 {39, "ANSI PDH (SONET, SDH)"},
434 {40, "Link Access Protocol SDH: LAPS - X.85 and X.86 (SONET, SDH)"},
435 {41, "FDDI (SONET, SDH, Lambda, Fiber)"},
436 {42, "DQDB: ETSI ETS 300 216 (SONET, SDH)"},
437 {43, "FiberChannel-3 Services (FiberChannel)"},
441 /* -------------------- Stuff for MPLS/TE objects -------------------- */
443 static const value_string proto_vals[] = { {IP_PROTO_ICMP, "ICMP"},
444 {IP_PROTO_IGMP, "IGMP"},
445 {IP_PROTO_TCP, "TCP" },
446 {IP_PROTO_UDP, "UDP" },
447 {IP_PROTO_OSPF, "OSPF"},
451 enum rsvp_filter_keys {
454 RSVPF_MSG, /* Message type */
455 /* Shorthand for message types */
472 /* Does the message contain an object of this type? */
474 /* Object present shorthands */
494 RSVPF_EXPLICIT_ROUTE,
498 RSVPF_MESSAGE_ID_ACK,
499 RSVPF_MESSAGE_ID_LIST,
500 RSVPF_UPSTREAM_LABEL,
503 RSVPF_SUGGESTED_LABEL,
504 RSVPF_SESSION_ATTRIBUTE,
506 RSVPF_LSP_TUNNEL_IF_ID,
514 RSVPF_SESSION_TUNNEL_ID,
515 RSVPF_SESSION_EXT_TUNNEL_ID,
517 /* Sender template */
526 static int rsvp_filter[RSVPF_MAX];
528 static hf_register_info rsvpf_info[] = {
530 /* Message type number */
531 {&rsvp_filter[RSVPF_MSG],
532 { "Message Type", "rsvp.msg", FT_UINT8, BASE_DEC, VALS(message_type_vals), 0x0,
535 /* Message type shorthands */
536 {&rsvp_filter[RSVPF_PATH],
537 { "Path Message", "rsvp.path", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
540 {&rsvp_filter[RSVPF_HELLO],
541 { "HELLO Message", "rsvp.hello", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
544 {&rsvp_filter[RSVPF_RESV],
545 { "Resv Message", "rsvp.resv", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
548 {&rsvp_filter[RSVPF_PATHERR],
549 { "Path Error Message", "rsvp.perr", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
552 {&rsvp_filter[RSVPF_RESVERR],
553 { "Resv Error Message", "rsvp.rerr", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
556 {&rsvp_filter[RSVPF_PATHTEAR],
557 { "Path Tear Message", "rsvp.ptear", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
560 {&rsvp_filter[RSVPF_RESVTEAR],
561 { "Resv Tear Message", "rsvp.rtear", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
564 {&rsvp_filter[RSVPF_RCONFIRM],
565 { "Resv Confirm Message", "rsvp.resvconf", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
568 {&rsvp_filter[RSVPF_RTEARCONFIRM],
569 { "Resv Tear Confirm Message", "rsvp.rtearconf", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
573 {&rsvp_filter[RSVPF_OBJECT],
574 { "Object class", "rsvp.object", FT_UINT8, BASE_DEC, VALS(rsvp_class_vals), 0x0,
577 /* Object present shorthands */
578 {&rsvp_filter[RSVPF_SESSION],
579 { "SESSION", "rsvp.session", FT_NONE, BASE_NONE, NULL, 0x0,
582 {&rsvp_filter[RSVPF_HOP],
583 { "HOP", "rsvp.hop", FT_NONE, BASE_NONE, NULL, 0x0,
586 {&rsvp_filter[RSVPF_HELLO_OBJ],
587 { "HELLO Request/Ack", "rsvp.hello_obj", FT_NONE, BASE_NONE, NULL, 0x0,
590 {&rsvp_filter[RSVPF_INTEGRITY],
591 { "INTEGRITY", "rsvp.integrity", FT_NONE, BASE_NONE, NULL, 0x0,
594 {&rsvp_filter[RSVPF_TIME_VALUES],
595 { "TIME VALUES", "rsvp.time", FT_NONE, BASE_NONE, NULL, 0x0,
598 {&rsvp_filter[RSVPF_ERROR],
599 { "ERROR", "rsvp.error", FT_NONE, BASE_NONE, NULL, 0x0,
602 {&rsvp_filter[RSVPF_SCOPE],
603 { "SCOPE", "rsvp.scope", FT_NONE, BASE_NONE, NULL, 0x0,
606 {&rsvp_filter[RSVPF_STYLE],
607 { "STYLE", "rsvp.style", FT_NONE, BASE_NONE, NULL, 0x0,
610 {&rsvp_filter[RSVPF_FLOWSPEC],
611 { "FLOWSPEC", "rsvp.flowspec", FT_NONE, BASE_NONE, NULL, 0x0,
614 {&rsvp_filter[RSVPF_FILTER_SPEC],
615 { "FILTERSPEC", "rsvp.filter", FT_NONE, BASE_NONE, NULL, 0x0,
618 {&rsvp_filter[RSVPF_SENDER],
619 { "SENDER TEMPLATE", "rsvp.sender", FT_NONE, BASE_NONE, NULL, 0x0,
622 {&rsvp_filter[RSVPF_TSPEC],
623 { "SENDER TSPEC", "rsvp.tspec", FT_NONE, BASE_NONE, NULL, 0x0,
626 {&rsvp_filter[RSVPF_ADSPEC],
627 { "ADSPEC", "rsvp.adspec", FT_NONE, BASE_NONE, NULL, 0x0,
630 {&rsvp_filter[RSVPF_POLICY],
631 { "POLICY", "rsvp.policy", FT_NONE, BASE_NONE, NULL, 0x0,
634 {&rsvp_filter[RSVPF_CONFIRM],
635 { "CONFIRM", "rsvp.confirm", FT_NONE, BASE_NONE, NULL, 0x0,
638 {&rsvp_filter[RSVPF_LABEL],
639 { "LABEL", "rsvp.label", FT_NONE, BASE_NONE, NULL, 0x0,
642 {&rsvp_filter[RSVPF_UPSTREAM_LABEL],
643 { "UPSTREAM LABEL", "rsvp.upstream_label", FT_NONE, BASE_NONE, NULL, 0x0,
646 {&rsvp_filter[RSVPF_SUGGESTED_LABEL],
647 { "SUGGESTED LABEL", "rsvp.suggested_label", FT_NONE, BASE_NONE, NULL, 0x0,
650 {&rsvp_filter[RSVPF_LABEL_SET],
651 { "RESTRICTED LABEL SET", "rsvp.label_set", FT_NONE, BASE_NONE, NULL, 0x0,
654 {&rsvp_filter[RSVPF_LABEL_REQUEST],
655 { "LABEL REQUEST", "rsvp.label_request", FT_NONE, BASE_NONE, NULL, 0x0,
658 {&rsvp_filter[RSVPF_SESSION_ATTRIBUTE],
659 { "SESSION ATTRIBUTE", "rsvp.session_attribute", FT_NONE, BASE_NONE, NULL, 0x0,
662 {&rsvp_filter[RSVPF_EXPLICIT_ROUTE],
663 { "EXPLICIT ROUTE", "rsvp.explicit_route", FT_NONE, BASE_NONE, NULL, 0x0,
666 {&rsvp_filter[RSVPF_RECORD_ROUTE],
667 { "RECORD ROUTE", "rsvp.record_route", FT_NONE, BASE_NONE, NULL, 0x0,
670 {&rsvp_filter[RSVPF_MESSAGE_ID],
671 { "MESSAGE-ID", "rsvp.msgid", FT_NONE, BASE_NONE, NULL, 0x0,
674 {&rsvp_filter[RSVPF_MESSAGE_ID_ACK],
675 { "MESSAGE-ID ACK", "rsvp.ack", FT_NONE, BASE_NONE, NULL, 0x0,
678 {&rsvp_filter[RSVPF_MESSAGE_ID_LIST],
679 { "MESSAGE-ID LIST", "rsvp.msgid_list", FT_NONE, BASE_NONE, NULL, 0x0,
682 {&rsvp_filter[RSVPF_HELLO_OBJ],
683 { "HELLO", "rsvp.hello", FT_NONE, BASE_NONE, NULL, 0x0,
686 {&rsvp_filter[RSVPF_DCLASS],
687 { "DCLASS", "rsvp.dclass", FT_NONE, BASE_NONE, NULL, 0x0,
690 {&rsvp_filter[RSVPF_LSP_TUNNEL_IF_ID],
691 { "LSP INTERFACE-ID", "rsvp.lsp_tunnel_if_id", FT_NONE, BASE_NONE, NULL, 0x0,
694 {&rsvp_filter[RSVPF_ADMIN_STATUS],
695 { "ADMIN STATUS", "rsvp.admin-status", FT_NONE, BASE_NONE, NULL, 0x0,
698 {&rsvp_filter[RSVPF_UNKNOWN_OBJ],
699 { "Unknown object", "rsvp.obj_unknown", FT_NONE, BASE_NONE, NULL, 0x0,
703 {&rsvp_filter[RSVPF_SESSION_IP],
704 { "Destination address", "rsvp.session.ip", FT_IPv4, BASE_NONE, NULL, 0x0,
707 {&rsvp_filter[RSVPF_SESSION_PORT],
708 { "Port number", "rsvp.session.port", FT_UINT16, BASE_DEC, NULL, 0x0,
711 {&rsvp_filter[RSVPF_SESSION_PROTO],
712 { "Protocol", "rsvp.session.proto", FT_UINT8, BASE_DEC, VALS(proto_vals), 0x0,
715 {&rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
716 { "Tunnel ID", "rsvp.session.tunnel_id", FT_UINT16, BASE_DEC, NULL, 0x0,
719 {&rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
720 { "Extended tunnel ID", "rsvp.session.ext_tunnel_id", FT_UINT32, BASE_DEC, NULL, 0x0,
723 /* Sender template/Filterspec fields */
724 {&rsvp_filter[RSVPF_SENDER_IP],
725 { "Sender IPv4 address", "rsvp.sender.ip", FT_IPv4, BASE_NONE, NULL, 0x0,
728 {&rsvp_filter[RSVPF_SENDER_PORT],
729 { "Sender port number", "rsvp.sender.port", FT_UINT16, BASE_DEC, NULL, 0x0,
732 {&rsvp_filter[RSVPF_SENDER_LSP_ID],
733 { "Sender LSP ID", "rsvp.sender.lsp_id", FT_UINT16, BASE_DEC, NULL, 0x0,
737 static inline int rsvp_class_to_filter_num(int classnum)
740 case RSVP_CLASS_SESSION :
741 case RSVP_CLASS_HOP :
742 case RSVP_CLASS_INTEGRITY :
743 case RSVP_CLASS_TIME_VALUES :
744 case RSVP_CLASS_ERROR :
745 case RSVP_CLASS_SCOPE :
746 case RSVP_CLASS_STYLE :
747 case RSVP_CLASS_FLOWSPEC :
748 case RSVP_CLASS_FILTER_SPEC :
749 case RSVP_CLASS_SENDER_TEMPLATE :
750 case RSVP_CLASS_SENDER_TSPEC :
751 case RSVP_CLASS_ADSPEC :
752 case RSVP_CLASS_POLICY :
753 case RSVP_CLASS_CONFIRM :
754 case RSVP_CLASS_LABEL :
755 case RSVP_CLASS_UPSTREAM_LABEL :
756 case RSVP_CLASS_LABEL_SET :
757 case RSVP_CLASS_LABEL_REQUEST :
758 case RSVP_CLASS_HELLO :
759 case RSVP_CLASS_EXPLICIT_ROUTE :
760 case RSVP_CLASS_RECORD_ROUTE :
761 case RSVP_CLASS_MESSAGE_ID :
762 case RSVP_CLASS_MESSAGE_ID_ACK :
763 case RSVP_CLASS_MESSAGE_ID_LIST :
764 return classnum + RSVPF_OBJECT;
767 case RSVP_CLASS_SUGGESTED_LABEL :
768 return RSVPF_SUGGESTED_LABEL;
769 case RSVP_CLASS_ADMIN_STATUS :
770 return RSVPF_ADMIN_STATUS;
771 case RSVP_CLASS_SESSION_ATTRIBUTE :
772 return RSVPF_SESSION_ATTRIBUTE;
773 case RSVP_CLASS_DCLASS :
775 case RSVP_CLASS_LSP_TUNNEL_IF_ID :
776 return RSVPF_LSP_TUNNEL_IF_ID;
779 return RSVPF_UNKNOWN_OBJ;
784 find_rsvp_session_tempfilt(tvbuff_t *tvb, int hdr_offset, int *session_offp, int *tempfilt_offp)
786 int s_off = 0, t_off = 0;
792 len = tvb_get_ntohs(tvb, hdr_offset+6) + hdr_offset;
793 off = hdr_offset + 8;
794 for (off = hdr_offset + 8; off < len; off += tvb_get_ntohs(tvb, off)) {
795 switch(tvb_get_guint8(tvb, off+2)) {
796 case RSVP_CLASS_SESSION:
799 case RSVP_CLASS_SENDER_TEMPLATE:
800 case RSVP_CLASS_FILTER_SPEC:
809 if (session_offp) *session_offp = s_off;
810 if (tempfilt_offp) *tempfilt_offp = t_off;
813 char *summary_session (tvbuff_t *tvb, int offset)
817 switch(tvb_get_guint8(tvb, offset+3)) {
819 snprintf(buf, 80, "SESSION: IPv4, Destination %s, Protocol %d, Port %d. ",
820 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
821 tvb_get_guint8(tvb, offset+8),
822 tvb_get_ntohs(tvb, offset+10));
825 snprintf(buf, 80, "SESSION: IPv4-LSP, Destination %s, Tunnel ID %d, Ext ID %0x. ",
826 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
827 tvb_get_ntohs(tvb, offset+10),
828 tvb_get_ntohl(tvb, offset+12));
831 snprintf(buf, 80, "SESSION: Type %d. ", tvb_get_guint8(tvb, offset+3));
837 char *summary_template (tvbuff_t *tvb, int offset)
842 if (tvb_get_guint8(tvb, offset+2) == RSVP_CLASS_FILTER_SPEC)
843 objtype = "FILTERSPEC";
845 objtype = "SENDER TEMPLATE";
847 switch(tvb_get_guint8(tvb, offset+3)) {
849 snprintf(buf, 80, "%s: IPv4, Sender %s, Port %d. ", objtype,
850 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
851 tvb_get_ntohs(tvb, offset+10));
854 snprintf(buf, 80, "%s: IPv4-LSP, Tunnel Source: %s, LSP ID: %d. ", objtype,
855 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
856 tvb_get_ntohs(tvb, offset+10));
859 snprintf(buf, 80, "%s: Type %d. ", objtype, tvb_get_guint8(tvb, offset+3));
866 dissect_rsvp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
869 proto_tree *rsvp_tree = NULL, *ti, *ti2;
870 proto_tree *rsvp_header_tree;
871 proto_tree *rsvp_object_tree;
872 proto_tree *rsvp_sa_flags_tree;
873 proto_tree *rsvp_ero_subtree;
874 proto_tree *rsvp_admin_subtree;
875 proto_tree *rsvp_hop_subtree;
878 guint16 cksum, computed_cksum;
886 int session_off, tempfilt_off;
888 if (check_col(pinfo->cinfo, COL_PROTOCOL))
889 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSVP");
890 if (check_col(pinfo->cinfo, COL_INFO))
891 col_clear(pinfo->cinfo, COL_INFO);
893 ver_flags = tvb_get_guint8(tvb, offset+0);
894 message_type = tvb_get_guint8(tvb, offset+1);
895 if (check_col(pinfo->cinfo, COL_INFO)) {
896 col_add_str(pinfo->cinfo, COL_INFO,
897 val_to_str(message_type, message_type_vals, "Unknown (%u). "));
898 find_rsvp_session_tempfilt(tvb, offset, &session_off, &tempfilt_off);
900 col_append_str(pinfo->cinfo, COL_INFO, summary_session(tvb, session_off));
902 col_append_str(pinfo->cinfo, COL_INFO, summary_template(tvb, tempfilt_off));
906 msg_length = tvb_get_ntohs(tvb, offset+6);
907 ti = proto_tree_add_item(tree, proto_rsvp, tvb, offset, msg_length,
909 rsvp_tree = proto_item_add_subtree(ti, ett_rsvp);
911 ti = proto_tree_add_text(rsvp_tree, tvb, offset, 8, "RSVP Header. %s",
912 val_to_str(message_type, message_type_vals,
913 "Unknown Message (%u). "));
914 rsvp_header_tree = proto_item_add_subtree(ti, ett_rsvp_hdr);
916 proto_tree_add_text(rsvp_header_tree, tvb, offset, 1, "RSVP Version: %u",
917 (ver_flags & 0xf0)>>4);
918 proto_tree_add_text(rsvp_header_tree, tvb, offset, 1, "Flags: %02x",
920 proto_tree_add_uint(rsvp_header_tree, rsvp_filter[RSVPF_MSG], tvb,
921 offset+1, 1, message_type);
922 if (message_type <= RSVPF_RTEARCONFIRM &&
923 message_type != RSVPF_JUNK_MSG8 &&
924 message_type != RSVPF_JUNK_MSG9 ) {
925 proto_tree_add_boolean_hidden(rsvp_header_tree, rsvp_filter[RSVPF_MSG + message_type], tvb,
928 cksum = tvb_get_ntohs(tvb, offset+2);
929 if (!pinfo->fragmented && (int) tvb_length(tvb) >= msg_length) {
930 /* The packet isn't part of a fragmented datagram and isn't
931 truncated, so we can checksum it. */
932 cksum_vec[0].ptr = tvb_get_ptr(tvb, 0, msg_length);
933 cksum_vec[0].len = msg_length;
934 computed_cksum = in_cksum(&cksum_vec[0], 1);
935 if (computed_cksum == 0) {
936 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
937 "Message Checksum: 0x%04x (correct)",
940 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
941 "Message Checksum: 0x%04x (incorrect, should be 0x%04x)",
943 in_cksum_shouldbe(cksum, computed_cksum));
946 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
947 "Message Checksum: 0x%04x",
950 proto_tree_add_text(rsvp_header_tree, tvb, offset+4, 1,
952 tvb_get_guint8(tvb, offset+4));
953 proto_tree_add_text(rsvp_header_tree, tvb, offset+6, 2,
954 "Message length: %u", msg_length);
958 while (len < msg_length) {
963 obj_length = tvb_get_ntohs(tvb, offset);
964 class = tvb_get_guint8(tvb, offset+2);
965 type = tvb_get_guint8(tvb, offset+3);
966 object_type = val_to_str(class, rsvp_class_vals, "Unknown");
967 proto_tree_add_uint_hidden(rsvp_tree, rsvp_filter[RSVPF_OBJECT], tvb,
968 offset, obj_length, class);
969 ti = proto_tree_add_item(rsvp_tree, rsvp_filter[rsvp_class_to_filter_num(class)],
970 tvb, offset, obj_length, FALSE);
976 case RSVP_CLASS_SESSION :
977 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_session);
978 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
979 "Length: %u", obj_length);
980 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
981 "Class number: %u - %s",
983 mylen = obj_length - 4;
984 proto_item_set_text(ti, summary_session(tvb, offset));
988 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
990 proto_tree_add_item(rsvp_object_tree,
991 rsvp_filter[RSVPF_SESSION_IP],
992 tvb, offset2, 4, FALSE);
994 proto_tree_add_item(rsvp_object_tree,
995 rsvp_filter[RSVPF_SESSION_PROTO], tvb,
996 offset2+4, 1, FALSE);
997 proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 1,
999 tvb_get_guint8(tvb, offset2+5));
1000 proto_tree_add_item(rsvp_object_tree,
1001 rsvp_filter[RSVPF_SESSION_PORT], tvb,
1002 offset2+6, 2, FALSE);
1007 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1008 "C-type: 2 - IPv6");
1009 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1010 "Destination address: %s",
1011 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1012 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 1,
1014 tvb_get_guint8(tvb, offset2+16));
1015 proto_tree_add_text(rsvp_object_tree, tvb, offset2+17, 1,
1017 tvb_get_guint8(tvb, offset2+17));
1018 proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2,
1019 "Destination port: %u",
1020 tvb_get_ntohs(tvb, offset2+18));
1025 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1026 "C-type: 7 - IPv4 LSP");
1027 proto_tree_add_item(rsvp_object_tree,
1028 rsvp_filter[RSVPF_SESSION_IP],
1029 tvb, offset2, 4, FALSE);
1031 proto_tree_add_item(rsvp_object_tree,
1032 rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
1033 tvb, offset2+6, 2, FALSE);
1035 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
1036 "Extended Tunnel ID: %u (%s)",
1037 tvb_get_ntohl(tvb, offset2+8),
1038 ip_to_str(tvb_get_ptr(tvb, offset2+8, 4)));
1039 proto_tree_add_item_hidden(rsvp_object_tree,
1040 rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
1041 tvb, offset2+8, 4, FALSE);
1046 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1047 "C-type: Unknown (%u)",
1049 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1050 "Data (%d bytes)", mylen);
1055 case RSVP_CLASS_HOP :
1056 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_hop);
1057 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1058 "Length: %u", obj_length);
1059 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1060 "Class number: %u - %s",
1061 class, object_type);
1062 mylen = obj_length - 4;
1065 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1066 "C-type: 1 - IPv4");
1067 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1068 "Neighbor address: %s",
1069 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1070 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
1071 "Logical interface: %u",
1072 tvb_get_ntohl(tvb, offset2+4));
1073 proto_item_set_text(ti, "HOP: IPv4, %s",
1074 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1079 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1080 "C-type: 2 - IPv6");
1081 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1082 "Neighbor address: %s",
1083 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1084 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 4,
1085 "Logical interface: 0x%08x",
1086 tvb_get_ntohl(tvb, offset2+16));
1094 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1095 "C-type: 3 - IPv4 Out-Of-Band");
1096 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1097 "Neighbor address: %s",
1098 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1099 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
1100 "Logical interface: %u",
1101 tvb_get_ntohl(tvb, offset2+4));
1103 for (tlv_off = 0; tlv_off < mylen - 8; ) {
1104 tlv_type = tvb_get_ntohs(tvb, offset2+8+tlv_off);
1105 tlv_len = tvb_get_ntohs(tvb, offset2+8+tlv_off+2);
1108 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1109 offset2+8+tlv_off, 8,
1111 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)));
1113 proto_item_add_subtree(ti2, ett_rsvp_hop_subobj);
1114 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off, 2,
1116 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off+2, 2,
1118 tvb_get_ntohs(tvb, offset2+8+tlv_off+2));
1119 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off+4, 4,
1121 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)));
1122 proto_item_set_text(ti, "HOP: Out-of-band. Control IPv4: %s. Data IPv4: %s",
1123 ip_to_str(tvb_get_ptr(tvb, offset2, 4)),
1124 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)));
1128 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1129 offset2+8+tlv_off, 12,
1130 "Interface-Index TLV - %s, %d",
1131 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)),
1132 tvb_get_ntohl(tvb, offset2+8+tlv_off+8));
1134 proto_item_add_subtree(ti2, ett_rsvp_hop_subobj);
1135 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off, 2,
1136 "Type: 3 (Interface Index)");
1137 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off+2, 2,
1139 tvb_get_ntohs(tvb, offset2+8+tlv_off+2));
1140 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off+4, 4,
1142 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)));
1143 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off+8, 4,
1145 tvb_get_ntohl(tvb, offset2+8+tlv_off+8));
1146 proto_item_set_text(ti, "HOP: Out-of-band. Control IPv4: %s. Data If-Index: %s, %d",
1147 ip_to_str(tvb_get_ptr(tvb, offset2, 4)),
1148 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)),
1149 tvb_get_ntohl(tvb, offset2+8+tlv_off+8));
1153 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
1154 "Logical interface: %u",
1155 tvb_get_ntohl(tvb, offset2+4));
1163 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1164 "C-type: Unknown (%u)",
1166 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1167 "Data (%d bytes)", mylen);
1172 case RSVP_CLASS_TIME_VALUES :
1173 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_time_values);
1174 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1175 "Length: %u", obj_length);
1176 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1177 "Class number: %u - %s",
1178 class, object_type);
1179 mylen = obj_length - 4;
1182 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1184 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1185 "Refresh interval: %u ms (%u seconds)",
1186 tvb_get_ntohl(tvb, offset2),
1187 tvb_get_ntohl(tvb, offset2)/1000);
1188 proto_item_set_text(ti, "TIME VALUES: %d ms",
1189 tvb_get_ntohl(tvb, offset2));
1194 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1195 "C-type: Unknown (%u)",
1197 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1198 "Data (%d bytes)", mylen);
1204 case RSVP_CLASS_ERROR :
1205 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_error);
1206 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1207 "Length: %u", obj_length);
1208 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1209 "Class number: %u - %s",
1210 class, object_type);
1211 mylen = obj_length - 4;
1216 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1217 "C-type: 1 - IPv4");
1218 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1220 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1221 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 1,
1223 tvb_get_guint8(tvb, offset2+4));
1224 error_code = tvb_get_guint8(tvb, offset2+5);
1225 proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 1,
1226 "Error code: %u - %s", error_code,
1227 val_to_str(error_code, rsvp_error_vals, "Unknown (%d)"));
1228 proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2,
1230 tvb_get_ntohs(tvb, offset2+6));
1231 proto_item_set_text(ti, "ERROR: IPv4, Error code: %s, Value: %d, Error Node: %s",
1232 val_to_str(error_code, rsvp_error_vals, "Unknown (%d)"),
1233 tvb_get_ntohs(tvb, offset2+6),
1234 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1241 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1242 "C-type: 2 - IPv6");
1243 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1245 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1246 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 1,
1248 tvb_get_guint8(tvb, offset2+16));
1249 error_code = tvb_get_guint8(tvb, offset2+17);
1250 proto_tree_add_text(rsvp_object_tree, tvb, offset2+17, 1,
1251 "Error code: %u - %s", error_code,
1252 val_to_str(error_code, rsvp_error_vals, "Unknown"));
1253 proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2,
1255 tvb_get_ntohs(tvb, offset2+18));
1260 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1261 "C-type: Unknown (%u)",
1263 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1264 "Data (%d bytes)", mylen);
1270 case RSVP_CLASS_SCOPE :
1271 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_scope);
1272 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1273 "Length: %u", obj_length);
1274 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1275 "Class number: %u - %s",
1276 class, object_type);
1277 mylen = obj_length - 4;
1280 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1281 "C-type: 1 - IPv4");
1283 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1285 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1293 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1294 "C-type: 2 - IPv6");
1296 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1298 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1306 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1307 "C-type: Unknown (%u)",
1309 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1310 "Data (%d bytes)", mylen);
1315 case RSVP_CLASS_STYLE :
1316 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_style);
1317 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1318 "Length: %u", obj_length);
1319 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1320 "Class number: %u - %s",
1321 class, object_type);
1322 mylen = obj_length - 4;
1327 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1329 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1331 tvb_get_guint8(tvb, offset2));
1332 style = tvb_get_ntoh24(tvb, offset2+1);
1333 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1,
1334 3, "Style: 0x%06X - %s", style,
1335 val_to_str(style, style_vals, "Unknown"));
1336 proto_item_set_text(ti, "STYLE: %s (%d)",
1337 val_to_str(style, style_vals, "Unknown"),
1343 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1344 "C-type: Unknown (%u)",
1346 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1347 "Data (%d bytes)", mylen);
1353 case RSVP_CLASS_CONFIRM :
1354 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_confirm);
1355 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1356 "Length: %u", obj_length);
1357 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1358 "Class number: %u - %s",
1359 class, object_type);
1360 mylen = obj_length - 4;
1363 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1364 "C-type: 1 - IPv4");
1365 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1366 "Receiver address: %s",
1367 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1368 proto_item_set_text(ti, "CONFIRM: Receiver %s",
1369 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1374 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1375 "C-type: 2 - IPv6");
1376 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1377 "Receiver address: %s",
1378 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1383 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1384 "C-type: Unknown (%u)",
1386 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1387 "Data (%d bytes)", mylen);
1392 case RSVP_CLASS_SENDER_TEMPLATE :
1393 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_sender_template);
1394 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1395 "Length: %u", obj_length);
1396 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1397 "Class number: %u - %s",
1398 class, object_type);
1399 goto common_template;
1400 case RSVP_CLASS_FILTER_SPEC :
1401 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_filter_spec);
1402 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1403 "Length: %u", obj_length);
1404 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1405 "Class number: %u - %s",
1406 class, object_type);
1408 mylen = obj_length - 4;
1409 proto_item_set_text(ti, summary_template(tvb, offset));
1412 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1413 "C-type: 1 - IPv4");
1414 proto_tree_add_item(rsvp_object_tree,
1415 rsvp_filter[RSVPF_SENDER_IP],
1416 tvb, offset2, 4, FALSE);
1417 proto_tree_add_item(rsvp_object_tree,
1418 rsvp_filter[RSVPF_SENDER_PORT],
1419 tvb, offset2+6, 2, FALSE);
1424 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1425 "C-type: 2 - IPv6");
1426 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1427 "Source address: %s",
1428 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1429 proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2,
1431 tvb_get_ntohs(tvb, offset2+18));
1436 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1437 "C-type: 7 - IPv4 LSP");
1438 proto_tree_add_item(rsvp_object_tree,
1439 rsvp_filter[RSVPF_SENDER_IP],
1440 tvb, offset2, 4, FALSE);
1441 proto_tree_add_item(rsvp_object_tree,
1442 rsvp_filter[RSVPF_SENDER_LSP_ID],
1443 tvb, offset2+6, 2, FALSE);
1448 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1449 "C-type: Unknown (%u)",
1451 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1452 "Data (%d bytes)", mylen);
1457 case RSVP_CLASS_SENDER_TSPEC : {
1458 proto_tree *tspec_tree;
1460 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_sender_tspec);
1461 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1462 "Length: %u", obj_length);
1463 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1464 "Class number: %u - %s",
1465 class, object_type);
1466 mylen = obj_length - 4;
1468 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1469 "Message format version: %u",
1470 tvb_get_guint8(tvb, offset2)>>4);
1471 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1472 "Data length: %u words, not including header",
1473 tvb_get_ntohs(tvb, offset2+2));
1478 proto_item_set_text(ti, "SENDER TSPEC: ");
1484 guint16 param_len_processed;
1487 service_num = tvb_get_guint8(tvb, offset2);
1488 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1489 "Service header: %u - %s",
1491 val_to_str(service_num, qos_vals, "Unknown"));
1492 length = tvb_get_ntohs(tvb, offset2+2);
1493 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1494 "Length of service %u data: %u words, "
1495 "not including header",
1496 service_num, length);
1501 /* Process all known service headers as a set of parameters */
1502 param_len_processed = 0;
1503 while (param_len_processed < length) {
1504 param_id = tvb_get_guint8(tvb, offset2);
1505 param_len = tvb_get_ntohs(tvb, offset2+2) + 1;
1509 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1510 offset2, param_len*4,
1511 "Token Bucket TSpec: ");
1512 tspec_tree = proto_item_add_subtree(ti2, ett_rsvp_sender_tspec_subtree);
1514 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
1515 "Parameter %u - %s",
1517 val_to_str(param_id, svc_vals, "Unknown"));
1518 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
1519 "Parameter %u flags: 0x%02x",
1521 tvb_get_guint8(tvb, offset2+1));
1522 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
1523 "Parameter %u data length: %u words, "
1524 "not including header",
1526 tvb_get_ntohs(tvb, offset2+2));
1527 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
1528 "Token bucket rate: %ld",
1529 tvb_ieee_to_long(tvb, offset2+4));
1530 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1531 "Token bucket size: %ld",
1532 tvb_ieee_to_long(tvb, offset2+8));
1533 proto_tree_add_text(tspec_tree, tvb, offset2+12, 4,
1534 "Peak data rate: %ld",
1535 tvb_ieee_to_long(tvb, offset2+12));
1536 proto_tree_add_text(tspec_tree, tvb, offset2+16, 4,
1537 "Minimum policed unit [m]: %u",
1538 tvb_get_ntohl(tvb, offset2+16));
1539 proto_tree_add_text(tspec_tree, tvb, offset2+20, 4,
1540 "Maximum packet size [M]: %u",
1541 tvb_get_ntohl(tvb, offset2+20));
1542 proto_item_append_text(ti, "Token Bucket, %lu bytes/sec. ",
1543 tvb_ieee_to_long(tvb, offset2+4));
1544 proto_item_append_text(ti2, "Rate=%lu Burst=%lu Peak=%lu m=%u M=%u",
1545 tvb_ieee_to_long(tvb, offset2+4),
1546 tvb_ieee_to_long(tvb, offset2+8),
1547 tvb_ieee_to_long(tvb, offset2+12),
1548 tvb_get_ntohl(tvb, offset2+16),
1549 tvb_get_ntohl(tvb, offset2+20));
1553 /* Null Service (RFC2997) */
1554 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1555 offset2, param_len*4,
1556 "Null Service TSpec: ");
1557 tspec_tree = proto_item_add_subtree(ti2, ett_rsvp_sender_tspec_subtree);
1559 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
1560 "Parameter %u - %s",
1562 val_to_str(param_id, svc_vals, "Unknown"));
1563 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
1564 "Parameter %u flags: %x",
1566 tvb_get_guint8(tvb, offset2+1));
1567 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
1568 "Parameter %u data length: %u words, "
1569 "not including header",
1571 tvb_get_ntohs(tvb, offset2+2));
1572 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
1573 "Maximum packet size [M]: %u",
1574 tvb_get_ntohl(tvb, offset2+4));
1575 proto_item_append_text(ti, "Null Service. M=%u",
1576 tvb_get_ntohl(tvb, offset2+4));
1577 proto_item_append_text(ti2, "Max pkt size=%u",
1578 tvb_get_ntohl(tvb, offset2+4));
1582 /* Compression hint (RFC3006) */
1583 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1584 offset2, param_len*4,
1585 "Compression Hint: ");
1586 tspec_tree = proto_item_add_subtree(ti2, ett_rsvp_sender_tspec_subtree);
1588 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
1589 "Parameter %u - %s",
1591 val_to_str(param_id, svc_vals, "Unknown"));
1592 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
1593 "Parameter %u flags: %x",
1595 tvb_get_guint8(tvb, offset2+1));
1596 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
1597 "Parameter %u data length: %u words, "
1598 "not including header",
1600 tvb_get_ntohs(tvb, offset2+2));
1601 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
1603 tvb_get_ntohl(tvb, offset2+4));
1604 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
1605 "Compression Factor: %u",
1606 tvb_get_ntohl(tvb, offset2+8));
1607 proto_item_append_text(ti, "Compression Hint. Hint=%u, Factor=%u",
1608 tvb_get_ntohl(tvb, offset2+4),
1609 tvb_get_ntohl(tvb, offset2+8));
1610 proto_item_append_text(ti2, "Hint=%u, Factor=%u",
1611 tvb_get_ntohl(tvb, offset2+4),
1612 tvb_get_ntohl(tvb, offset2+8));
1616 proto_tree_add_text(rsvp_object_tree, tvb, offset2, param_len*4,
1617 "Unknown parameter %d, %d words",
1618 param_id, param_len);
1621 param_len_processed += param_len;
1622 offset2 += param_len*4;
1624 /* offset2 += length*4; */
1630 case RSVP_CLASS_FLOWSPEC : {
1631 proto_tree *flowspec_tree;
1633 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_flowspec);
1634 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1635 "Length: %u", obj_length);
1636 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1637 "Class number: %u - %s",
1638 class, object_type);
1639 mylen = obj_length - 4;
1641 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1642 "Message format version: %u",
1643 tvb_get_guint8(tvb, offset2)>>4);
1644 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1645 "Data length: %u words, not including header",
1646 tvb_get_ntohs(tvb, offset2+2));
1648 proto_item_set_text(ti, "FLOWSPEC: ");
1657 guint16 param_len_processed;
1659 service_num = tvb_get_guint8(tvb, offset2);
1660 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1661 "Service header: %u - %s",
1663 val_to_str(service_num, intsrv_services_str, "Unknown"));
1664 length = tvb_get_ntohs(tvb, offset2+2);
1665 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1666 "Length of service %u data: %u words, "
1667 "not including header",
1674 proto_item_append_text(ti, "%s: ",
1675 val_to_str(service_num, intsrv_services_str,
1678 /* Process all known service headers as a set of parameters */
1679 param_len_processed = 0;
1680 while (param_len_processed < length) {
1681 param_id = tvb_get_guint8(tvb, offset2);
1682 param_len = tvb_get_ntohs(tvb, offset2+2) + 1;
1686 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1687 offset2, param_len*4,
1689 flowspec_tree = proto_item_add_subtree(ti2, ett_rsvp_flowspec_subtree);
1691 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
1692 "Parameter %u - %s",
1694 val_to_str(param_id, svc_vals, "Unknown"));
1695 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
1696 "Parameter %u flags: 0x%02x",
1698 tvb_get_guint8(tvb, offset2+1));
1699 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
1700 "Parameter %u data length: %u words, "
1701 "not including header",
1703 tvb_get_ntohs(tvb, offset2+2));
1704 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
1705 "Token bucket rate: %ld",
1706 tvb_ieee_to_long(tvb, offset2+4));
1707 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
1708 "Token bucket size: %ld",
1709 tvb_ieee_to_long(tvb, offset2+8));
1710 proto_tree_add_text(flowspec_tree, tvb, offset2+12, 4,
1711 "Peak data rate: %ld",
1712 tvb_ieee_to_long(tvb, offset2+12));
1713 proto_tree_add_text(flowspec_tree, tvb, offset2+16, 4,
1714 "Minimum policed unit [m]: %u",
1715 tvb_get_ntohl(tvb, offset2+16));
1716 proto_tree_add_text(flowspec_tree, tvb, offset2+20, 4,
1717 "Maximum packet size [M]: %u",
1718 tvb_get_ntohl(tvb, offset2+20));
1719 proto_item_append_text(ti, "Token Bucket, %lu bytes/sec. ",
1720 tvb_ieee_to_long(tvb, offset2+4));
1721 proto_item_append_text(ti2, "Rate=%lu Burst=%lu Peak=%lu m=%u M=%u",
1722 tvb_ieee_to_long(tvb, offset2+4),
1723 tvb_ieee_to_long(tvb, offset2+8),
1724 tvb_ieee_to_long(tvb, offset2+12),
1725 tvb_get_ntohl(tvb, offset2+16),
1726 tvb_get_ntohl(tvb, offset2+20));
1730 /* Guaranteed-rate RSpec */
1731 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1732 offset2, param_len*4,
1733 "Guaranteed-Rate RSpec: ");
1734 flowspec_tree = proto_item_add_subtree(ti2, ett_rsvp_flowspec_subtree);
1735 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
1736 "Parameter %u - %s",
1738 val_to_str(param_id, svc_vals, "Unknown"));
1739 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
1740 "Parameter %u flags: %x",
1742 tvb_get_guint8(tvb, offset2+1));
1743 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
1744 "Parameter %u data length: %u words, "
1745 "not including header",
1747 tvb_get_ntohs(tvb, offset2+2));
1749 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
1751 tvb_ieee_to_long(tvb, offset2+4));
1752 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
1754 tvb_get_ntohl(tvb, offset2+8));
1755 proto_item_append_text(ti, "RSpec, %lu bytes/sec. ",
1756 tvb_ieee_to_long(tvb, offset2+4));
1757 proto_item_append_text(ti2, "R=%lu, s=%u",
1758 tvb_ieee_to_long(tvb, offset2+4),
1759 tvb_get_ntohl(tvb, offset2+8));
1763 /* Null Service (RFC2997) */
1764 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1765 offset2, param_len*4,
1766 "Null Service Flowspec: ");
1767 flowspec_tree = proto_item_add_subtree(ti2, ett_rsvp_flowspec_subtree);
1769 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
1770 "Parameter %u - %s",
1772 val_to_str(param_id, svc_vals, "Unknown"));
1773 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
1774 "Parameter %u flags: %x",
1776 tvb_get_guint8(tvb, offset2+1));
1777 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
1778 "Parameter %u data length: %u words, "
1779 "not including header",
1781 tvb_get_ntohs(tvb, offset2+2));
1782 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
1783 "Maximum packet size [M]: %u",
1784 tvb_get_ntohl(tvb, offset2+4));
1785 proto_item_append_text(ti, "Null Service. M=%u",
1786 tvb_get_ntohl(tvb, offset2+4));
1787 proto_item_append_text(ti2, "Max pkt size=%u",
1788 tvb_get_ntohl(tvb, offset2+4));
1792 proto_tree_add_text(rsvp_object_tree, tvb, offset2, param_len*4,
1793 "Unknown parameter %d, %d words",
1794 param_id, param_len);
1797 param_len_processed += param_len;
1798 offset2 += param_len * 4;
1801 /* offset2 += length*4; */
1807 case RSVP_CLASS_ADSPEC : {
1808 proto_tree *adspec_tree;
1810 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_adspec);
1811 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1812 "Length: %u", obj_length);
1813 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1814 "Class number: %u - %s",
1815 class, object_type);
1816 mylen = obj_length - 4;
1818 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1819 "Message format version: %u",
1820 tvb_get_guint8(tvb, offset2)>>4);
1821 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1822 "Data length: %u words, not including header",
1823 tvb_get_ntohs(tvb, offset2+2));
1832 service_num = tvb_get_guint8(tvb, offset2);
1833 str = val_to_str(service_num, intsrv_services_str, "Unknown");
1834 break_bit = tvb_get_guint8(tvb, offset2+1);
1835 length = tvb_get_ntohs(tvb, offset2+2);
1836 ti = proto_tree_add_text(rsvp_object_tree, tvb, offset2,
1839 adspec_tree = proto_item_add_subtree(ti,
1840 ett_rsvp_adspec_subtree);
1841 proto_tree_add_text(adspec_tree, tvb, offset2, 1,
1842 "Service header %u - %s",
1844 proto_tree_add_text(adspec_tree, tvb, offset2+1, 1,
1846 "Break bit set":"Break bit not set");
1847 proto_tree_add_text(adspec_tree, tvb, offset2+2, 2,
1848 "Data length: %u words, not including header",
1855 guint16 phdr_length;
1857 id = tvb_get_guint8(tvb, offset2);
1858 phdr_length = tvb_get_ntohs(tvb, offset2+2);
1859 str = match_strval(id, adspec_params);
1869 /* 32-bit unsigned integer */
1870 proto_tree_add_text(adspec_tree, tvb, offset2,
1872 "%s - %u (type %u, length %u)",
1874 tvb_get_ntohl(tvb, offset2+4),
1880 proto_tree_add_text(adspec_tree, tvb, offset2,
1882 "%s - %lu (type %u, length %u)",
1884 tvb_ieee_to_long(tvb, offset2+4),
1888 proto_tree_add_text(adspec_tree, tvb, offset2,
1890 "%s (type %u, length %u)",
1895 proto_tree_add_text(adspec_tree, tvb, offset2,
1897 "Unknown (type %u, length %u)",
1900 offset2 += (phdr_length+1)<<2;
1901 i -= (phdr_length+1)<<2;
1902 mylen -= (phdr_length+1)<<2;
1908 case RSVP_CLASS_INTEGRITY :
1909 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_integrity);
1910 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1911 "Length: %u", obj_length);
1912 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1913 "Class number: %u - %s",
1914 class, object_type);
1917 case RSVP_CLASS_POLICY :
1918 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_policy);
1919 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1920 "Length: %u", obj_length);
1921 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1922 "Class number: %u - %s",
1923 class, object_type);
1926 case RSVP_CLASS_LABEL_REQUEST :
1927 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_label_request);
1928 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1929 "Length: %u", obj_length);
1930 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1931 "Class number: %u - %s",
1932 class, object_type);
1933 mylen = obj_length - 4;
1936 unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2);
1937 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1939 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1940 "L3PID: %s (0x%04x)",
1941 val_to_str(l3pid, etype_vals, "Unknown"),
1943 proto_item_set_text(ti, "LABEL REQUEST: %s (0x%04x)",
1944 val_to_str(l3pid, etype_vals, "Unknown"),
1950 unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2);
1951 unsigned char lsp_enc = tvb_get_guint8(tvb,offset2);
1952 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1953 "C-type: 4 (Generalized Label Request)");
1954 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1955 "LSP Encoding Type: %s",
1956 val_to_str(lsp_enc, gmpls_lsp_enc_str, "Unknown (%d)"));
1957 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
1958 "Switching Type: %s",
1959 val_to_str(tvb_get_guint8(tvb,offset2+1),
1960 gmpls_switching_type_str, "Unknown (%d)"));
1961 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1962 "G-PID: %s (0x%0x)",
1963 val_to_str(l3pid, gmpls_gpid_str,
1964 val_to_str(l3pid, etype_vals,
1965 "Unknown G-PID(0x%04x)")),
1967 proto_item_set_text(ti, "LABEL REQUEST: Generalized: LSP Encoding=%s, "
1968 "Switching Type=%s, G-PID=%s ",
1969 val_to_str(lsp_enc, gmpls_lsp_enc_str, "Unknown (%d)"),
1970 val_to_str(tvb_get_guint8(tvb,offset2+1),
1971 gmpls_switching_type_str, "Unknown (%d)"),
1972 val_to_str(l3pid, gmpls_gpid_str,
1973 val_to_str(l3pid, etype_vals,
1974 "Unknown (0x%04x)")));
1979 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1980 "C-type: Unknown (%u)",
1982 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1983 "Data (%d bytes)", mylen);
1989 case RSVP_CLASS_UPSTREAM_LABEL :
1990 case RSVP_CLASS_SUGGESTED_LABEL :
1991 case RSVP_CLASS_LABEL : {
1993 name = (class==RSVP_CLASS_SUGGESTED_LABEL ? "SUGGESTED LABEL" :
1994 (class==RSVP_CLASS_UPSTREAM_LABEL ? "UPSTREAM LABEL" :
1996 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_label);
1997 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1998 "Length: %u", obj_length);
1999 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2000 "Class number: %u - %s",
2001 class, object_type);
2002 mylen = obj_length - 4;
2005 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2006 "C-type: 1 (Packet Label)");
2007 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2009 tvb_get_ntohl(tvb, offset2));
2010 proto_item_set_text(ti, "%s: %d", name,
2011 tvb_get_ntohl(tvb, offset2));
2016 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2017 "C-type: 2 (Generalized Label)");
2018 proto_item_set_text(ti, "%s: Generalized: ", name);
2019 for (i = 0; i < mylen; i += 4) {
2020 proto_tree_add_text(rsvp_object_tree, tvb, offset2+i, 4,
2021 "Generalized Label: %u",
2022 tvb_get_ntohl(tvb, offset2+i));
2024 proto_item_append_text(ti, "%d%s",
2025 tvb_get_ntohl(tvb, offset2+i),
2027 } else if (i == 16) {
2028 proto_item_append_text(ti, "...");
2035 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2036 "C-type: Unknown (%u)",
2038 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2039 "Data (%d bytes)", mylen);
2046 case RSVP_CLASS_SESSION_ATTRIBUTE :
2047 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_session_attribute);
2048 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2049 "Length: %u", obj_length);
2050 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2051 "Class number: %u - %s",
2052 class, object_type);
2053 mylen = obj_length - 4;
2059 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2060 "C-type: 7 - IPv4 LSP");
2061 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2062 "Setup priority: %u",
2063 tvb_get_guint8(tvb, offset2));
2064 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
2065 "Hold priority: %u",
2066 tvb_get_guint8(tvb, offset2+1));
2067 flags = tvb_get_guint8(tvb, offset2+2);
2068 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 1,
2069 "Flags: 0x%02x", flags);
2070 rsvp_sa_flags_tree = proto_item_add_subtree(ti2,
2071 ett_rsvp_session_attribute_flags);
2072 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
2073 decode_boolean_bitfield(flags, 0x01, 8,
2074 "Local protection desired",
2075 "Local protection not desired"));
2076 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
2077 decode_boolean_bitfield(flags, 0x02, 8,
2078 "Merging permitted",
2079 "Merging not permitted"));
2080 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
2081 decode_boolean_bitfield(flags, 0x04, 8,
2082 "Ingress node may reroute",
2083 "Ingress node may not reroute"));
2085 name_len = tvb_get_guint8(tvb, offset2+3);
2086 proto_tree_add_text(rsvp_object_tree, tvb, offset2+3, 1,
2087 "Name length: %u", name_len);
2088 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, name_len,
2091 tvb_get_ptr(tvb, offset2+4, name_len));
2093 proto_item_set_text(ti, "SESSION ATTRIBUTE: SetupPrio %d, HoldPrio %d, %s%s%s [%s]",
2094 tvb_get_guint8(tvb, offset2),
2095 tvb_get_guint8(tvb, offset2+1),
2096 flags &0x01 ? "Local Protection, " : "",
2097 flags &0x02 ? "Merging, " : "",
2098 flags &0x04 ? "May Reroute, " : "",
2099 name_len ? (char*)tvb_format_text(tvb, offset2+4, name_len) : "");
2104 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2105 "C-type: Unknown (%u)",
2107 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2108 "Data (%d bytes)", mylen);
2114 case RSVP_CLASS_EXPLICIT_ROUTE :
2115 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_explicit_route);
2116 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2117 "Length: %u", obj_length);
2118 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2119 "Class number: %u - %s",
2120 class, object_type);
2121 mylen = obj_length - 4;
2124 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2126 proto_item_set_text(ti, "EXPLICIT ROUTE: ");
2127 for (i=1, l = 0; l < mylen; i++) {
2128 j = tvb_get_guint8(tvb, offset2+l) & 0x7f;
2131 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2132 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2134 "IPv4 Subobject - %s, %s",
2135 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)),
2136 k ? "Loose" : "Strict");
2138 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2139 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2140 k ? "Loose Hop " : "Strict Hop");
2141 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2143 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2145 tvb_get_guint8(tvb, offset2+l+1));
2146 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 4,
2148 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)));
2149 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+6, 1,
2150 "Prefix length: %u",
2151 tvb_get_guint8(tvb, offset2+l+6));
2153 proto_item_append_text(ti, "IPv4 %s%s",
2154 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)),
2161 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2165 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2166 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2167 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2168 k ? "Loose Hop " : "Strict Hop");
2169 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2171 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2173 tvb_get_guint8(tvb, offset2+l+1));
2174 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 16,
2176 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2+l+2, 16)));
2177 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+18, 1,
2178 "Prefix length: %u",
2179 tvb_get_guint8(tvb, offset2+l+6));
2181 proto_item_append_text(ti, "IPv6 [...]%s", k ? " [L]":"");
2187 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2188 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2190 "Label Subobject - %d, %s",
2191 tvb_get_ntohl(tvb, offset2+l+4),
2192 k ? "Loose" : "Strict");
2194 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2195 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2196 k ? "Loose Hop " : "Strict Hop");
2197 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2199 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2201 tvb_get_guint8(tvb, offset2+l+1));
2202 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 1,
2204 tvb_get_guint8(tvb, offset2+l+2));
2205 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+3, 1,
2207 tvb_get_guint8(tvb, offset2+l+3));
2208 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+4, 4,
2210 tvb_get_ntohl(tvb, offset2+l+4));
2212 proto_item_append_text(ti, "Label %d%s",
2213 tvb_get_ntohl(tvb, offset2+l+4),
2218 case 4: /* Unnumbered Interface-ID */
2219 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2220 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2222 "Unnumbered Interface-ID - %s, %d, %s",
2223 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)),
2224 tvb_get_ntohl(tvb, offset2+l+8),
2225 k ? "Loose" : "Strict");
2227 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2228 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2229 k ? "Loose Hop " : "Strict Hop");
2230 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2231 "Type: 4 (Unnumbered Interface-ID)");
2232 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2234 tvb_get_guint8(tvb, offset2+l+1));
2235 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+4, 4,
2237 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)));
2238 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+8, 4,
2240 tvb_get_ntohl(tvb, offset2+l+8));
2242 proto_item_append_text(ti, "Unnum %s/%d%s",
2243 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)),
2244 tvb_get_ntohl(tvb, offset2+l+8),
2251 k = tvb_get_ntohs(tvb, offset2+l+2);
2252 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2254 "Autonomous System %u",
2257 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2258 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2259 "Type: 32 (Autonomous System Number)");
2260 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2262 tvb_get_guint8(tvb, offset2+l+1));
2263 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 2,
2264 "Autonomous System %u", k);
2266 proto_item_append_text(ti, "AS %d",
2267 tvb_get_ntohs(tvb, offset2+l+2));
2272 case 64: /* Path Term */
2273 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2274 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2276 "LSP Path Termination");
2278 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2279 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2280 k ? "Loose Hop " : "Strict Hop");
2281 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2282 "Type: 64 (MPLS LSP Path Termination)");
2283 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2285 tvb_get_guint8(tvb, offset2+l+1));
2287 proto_item_append_text(ti, "Path Term");
2291 default: /* Unknown subobject */
2292 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2293 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2295 tvb_get_guint8(tvb, offset2+l+1),
2296 "Unknown subobject: %d", j);
2298 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2299 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2300 k ? "Loose Hop " : "Strict Hop");
2301 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2302 "Type: %u (Unknown)", j);
2303 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2305 tvb_get_guint8(tvb, offset2+l+1));
2309 l += tvb_get_guint8(tvb, offset2+l+1);
2312 proto_item_append_text(ti, ", ");
2314 proto_item_append_text(ti, "...");
2320 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2321 "C-type: Unknown (%u)",
2323 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2324 "Data (%d bytes)", mylen);
2331 case RSVP_CLASS_RECORD_ROUTE :
2332 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_record_route);
2333 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2334 "Length: %u", obj_length);
2335 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2336 "Class number: %u - %s",
2337 class, object_type);
2338 proto_item_set_text(ti, "RECORD ROUTE: ");
2339 mylen = obj_length - 4;
2342 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2344 for (i=1, l = 0; l < mylen; i++) {
2345 j = tvb_get_guint8(tvb, offset2+l);
2348 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2350 "IPv4 Subobject - %s",
2351 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)));
2353 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2354 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2356 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2358 tvb_get_guint8(tvb, offset2+l+1));
2359 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 4,
2361 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)));
2362 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+6, 1,
2363 "Prefix length: %u",
2364 tvb_get_guint8(tvb, offset2+l+6));
2366 proto_item_append_text(ti, "IPv4 %s",
2367 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)));
2373 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2377 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2378 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2380 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2382 tvb_get_guint8(tvb, offset2+l+1));
2383 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 16,
2385 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2+l+2, 16)));
2386 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+18, 1,
2387 "Prefix length: %u",
2388 tvb_get_guint8(tvb, offset2+l+6));
2390 proto_item_append_text(ti, "IPv6 [...]");
2395 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2397 "Label Subobject - %d",
2398 tvb_get_ntohl(tvb, offset2+l+4));
2400 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2401 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2403 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2405 tvb_get_guint8(tvb, offset2+l+1));
2406 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 1,
2408 tvb_get_guint8(tvb, offset2+l+2));
2409 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+3, 1,
2411 tvb_get_guint8(tvb, offset2+l+3));
2412 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+4, 4,
2414 tvb_get_ntohl(tvb, offset2+l+4));
2416 proto_item_append_text(ti, "Label %d",
2417 tvb_get_ntohl(tvb, offset2+l+4));
2421 case 4: /* Unnumbered Interface-ID */
2422 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2424 "Unnumbered Interface-ID - %s, %d",
2425 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)),
2426 tvb_get_ntohl(tvb, offset2+l+8));
2428 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2429 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2430 "Type: 4 (Unnumbered Interface-ID)");
2431 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2433 tvb_get_guint8(tvb, offset2+l+1));
2434 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2436 tvb_get_guint8(tvb, offset2+l+2));
2437 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+4, 4,
2439 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)));
2440 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+8, 4,
2442 tvb_get_ntohl(tvb, offset2+l+8));
2444 proto_item_append_text(ti, "Unnum %s/%d",
2445 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)),
2446 tvb_get_ntohl(tvb, offset2+l+8));
2450 default: /* Unknown subobject */
2451 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2453 tvb_get_guint8(tvb, offset2+l+1),
2454 "Unknown subobject: %u",
2457 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2458 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2459 "Type: %u (Unknown)", j);
2460 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2462 tvb_get_guint8(tvb, offset2+l+1));
2466 l += tvb_get_guint8(tvb, offset2+l+1);
2469 proto_item_append_text(ti, ", ");
2471 proto_item_append_text(ti, "...");
2478 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2479 "C-type: Unknown (%u)",
2481 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2482 "Data (%d bytes)", mylen);
2488 case RSVP_CLASS_MESSAGE_ID :
2489 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_policy);
2490 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2491 "Length: %u", obj_length);
2492 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2493 "Class number: %u - %s",
2494 class, object_type);
2497 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2499 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
2500 "Flags: %d", tvb_get_guint8(tvb, offset+4));
2501 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
2502 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
2503 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
2504 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
2505 proto_item_set_text(ti, "MESSAGE-ID: %d %s",
2506 tvb_get_ntohl(tvb, offset+8),
2507 tvb_get_guint8(tvb, offset+4) & 1 ? "(Ack Desired)" : "");
2511 mylen = obj_length - 4;
2512 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2513 "C-type: Unknown (%u)",
2515 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2516 "Data (%d bytes)", mylen);
2521 case RSVP_CLASS_MESSAGE_ID_ACK :
2522 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_policy);
2523 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2524 "Length: %u", obj_length);
2525 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2526 "Class number: %u - %s",
2527 class, object_type);
2530 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2532 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
2533 "Flags: %d", tvb_get_guint8(tvb, offset+4));
2534 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
2535 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
2536 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
2537 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
2538 proto_item_set_text(ti, "MESSAGE-ID ACK: %d", tvb_get_ntohl(tvb, offset+8));
2542 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2544 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
2545 "Flags: %d", tvb_get_guint8(tvb, offset+4));
2546 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
2547 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
2548 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
2549 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
2550 proto_item_set_text(ti, "MESSAGE-ID NACK: %d", tvb_get_ntohl(tvb, offset+8));
2554 mylen = obj_length - 4;
2555 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2556 "C-type: Unknown (%u)",
2558 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2559 "Data (%d bytes)", mylen);
2564 case RSVP_CLASS_MESSAGE_ID_LIST :
2565 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_policy);
2566 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2567 "Length: %u", obj_length);
2568 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2569 "Class number: %u - %s",
2570 class, object_type);
2573 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2575 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
2576 "Flags: %d", tvb_get_guint8(tvb, offset+4));
2577 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
2578 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
2579 for (mylen = 8; mylen < obj_length; mylen += 4)
2580 proto_tree_add_text(rsvp_object_tree, tvb, offset+mylen, 4,
2581 "Message-ID: %d", tvb_get_ntohl(tvb, offset+mylen));
2582 proto_item_set_text(ti, "MESSAGE-ID LIST: %d IDs",
2583 (obj_length - 8)/4);
2587 mylen = obj_length - 4;
2588 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2589 "C-type: Unknown (%u)",
2591 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2592 "Data (%d bytes)", mylen);
2597 case RSVP_CLASS_HELLO:
2598 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_hello_obj);
2599 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2600 "Length: %u", obj_length);
2601 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2602 "Class number: %u - %s",
2603 class, object_type);
2606 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2607 "C-Type: 1 - HELLO REQUEST object");
2610 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2611 "C-Type: 2 - HELLO ACK object");
2615 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4,
2616 "Source Instance: 0x%x",tvb_get_ntohl(tvb, offset+4));
2618 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
2619 "Destination Instance: 0x%x",tvb_get_ntohl(tvb, offset+8));
2623 case RSVP_CLASS_DCLASS:
2624 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_dclass);
2625 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2626 "Length: %u", obj_length);
2627 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2628 "Class number: %u - %s",
2629 class, object_type);
2630 proto_item_set_text(ti, "DCLASS: ");
2633 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2635 for (mylen = 4; mylen < obj_length; mylen += 4) {
2636 proto_tree_add_text(rsvp_object_tree, tvb, offset+mylen+3, 1,
2638 val_to_str(tvb_get_guint8(tvb, offset+mylen+3),
2639 dscp_vals, "Unknown (%d)"));
2640 proto_item_append_text(ti, "%d%s",
2641 tvb_get_guint8(tvb, offset+mylen+3)>>2,
2642 mylen==obj_length-4 ? "" :
2644 mylen==16 ? ", ..." : "");
2649 mylen = obj_length - 4;
2650 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2651 "C-type: Unknown (%u)",
2653 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2654 "Data (%d bytes)", mylen);
2659 case RSVP_CLASS_ADMIN_STATUS: {
2661 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_admin_status);
2662 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2663 "Length: %u", obj_length);
2664 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2665 "Class number: %u - %s",
2666 class, object_type);
2667 proto_item_set_text(ti, "ADMIN STATUS: ");
2670 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2672 status = tvb_get_ntohl(tvb, offset2);
2673 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2674 "Admin Status: 0x%08x", status);
2675 rsvp_admin_subtree =
2676 proto_item_add_subtree(ti2, ett_rsvp_admin_status_flags);
2677 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 1,
2678 (status & (1<<31)) ?
2680 "R: 0. Do not reflect");
2681 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2+3, 1,
2685 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2+3, 1,
2687 "A: 1. Administratively down" :
2689 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2+3, 1,
2691 "D: 1. Deletion in progress" :
2693 proto_item_set_text(ti, "ADMIN-STATUS: %s %s %s %s",
2694 (status & (1<<31)) ? "Reflect" : "",
2695 (status & (1<<2)) ? "Testing" : "",
2696 (status & (1<<1)) ? "Admin-Down" : "",
2697 (status & (1<<0)) ? "Deleting" : "");
2701 mylen = obj_length - 4;
2702 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2703 "C-type: Unknown (%u)",
2705 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2706 "Data (%d bytes)", mylen);
2712 case RSVP_CLASS_LSP_TUNNEL_IF_ID:
2713 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_lsp_tunnel_if_id);
2714 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2715 "Length: %u", obj_length);
2716 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2717 "Class number: %u - %s",
2718 class, object_type);
2719 proto_item_set_text(ti, "LSP INTERFACE-ID: ");
2722 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2723 "C-type: 1 - IPv4");
2724 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2726 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2727 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
2728 "Interface ID: %u", tvb_get_ntohl(tvb, offset2+4));
2729 proto_item_set_text(ti, "LSP INTERFACE-ID: IPv4, Router-ID %s, Interface-ID %d",
2730 ip_to_str(tvb_get_ptr(tvb, offset2, 4)),
2731 tvb_get_ntohl(tvb, offset2+4));
2735 mylen = obj_length - 4;
2736 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2737 "C-type: Unknown (%u)",
2739 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2740 "Data (%d bytes)", mylen);
2746 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_unknown_class);
2747 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2748 "Length: %u", obj_length);
2749 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2750 "Class number: %u - %s",
2751 class, object_type);
2753 mylen = obj_length - 4;
2754 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2755 "Data (%d bytes)", mylen);
2758 case RSVP_CLASS_NULL :
2763 offset += obj_length;
2770 proto_register_rsvp(void)
2772 static gint *ett[] = {
2777 &ett_rsvp_hop_subobj,
2778 &ett_rsvp_time_values,
2783 &ett_rsvp_sender_template,
2784 &ett_rsvp_filter_spec,
2785 &ett_rsvp_sender_tspec,
2786 &ett_rsvp_sender_tspec_subtree,
2788 &ett_rsvp_flowspec_subtree,
2790 &ett_rsvp_adspec_subtree,
2791 &ett_rsvp_integrity,
2794 &ett_rsvp_label_request,
2795 &ett_rsvp_session_attribute,
2796 &ett_rsvp_session_attribute_flags,
2797 &ett_rsvp_explicit_route,
2798 &ett_rsvp_explicit_route_subobj,
2799 &ett_rsvp_record_route,
2800 &ett_rsvp_record_route_subobj,
2801 &ett_rsvp_hello_obj,
2803 &ett_rsvp_lsp_tunnel_if_id,
2804 &ett_rsvp_admin_status,
2805 &ett_rsvp_admin_status_flags,
2806 &ett_rsvp_unknown_class,
2809 proto_rsvp = proto_register_protocol("Resource ReserVation Protocol (RSVP)",
2811 proto_register_field_array(proto_rsvp, rsvpf_info, array_length(rsvpf_info));
2812 proto_register_subtree_array(ett, array_length(ett));
2816 proto_reg_handoff_rsvp(void)
2818 dissector_handle_t rsvp_handle;
2820 rsvp_handle = create_dissector_handle(dissect_rsvp, proto_rsvp);
2821 dissector_add("ip.proto", IP_PROTO_RSVP, rsvp_handle);