2 * Routines for RSVP packet disassembly
4 * (c) Copyright Ashok Narayanan <ashokn@cisco.com>
6 * $Id: packet-rsvp.c,v 1.62 2002/04/25 06:34:42 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 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>
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>
75 #include "packet-rsvp.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_RECOVERY_LABEL = 34,
185 RSVP_CLASS_UPSTREAM_LABEL,
186 RSVP_CLASS_LABEL_SET,
187 RSVP_CLASS_PROTECTION,
189 RSVP_CLASS_SUGGESTED_LABEL = 129,
190 RSVP_CLASS_ACCEPTABLE_LABEL_SET,
191 RSVP_CLASS_RESTART_CAP,
193 RSVP_CLASS_NOTIFY_REQUEST = 195,
194 RSVP_CLASS_ADMIN_STATUS,
196 RSVP_CLASS_SESSION_ATTRIBUTE = 207,
197 RSVP_CLASS_DCLASS = 225,
198 RSVP_CLASS_LSP_TUNNEL_IF_ID = 227,
201 static value_string rsvp_class_vals[] = {
202 {RSVP_CLASS_NULL, "NULL object"},
203 {RSVP_CLASS_SESSION, "SESSION object"},
204 {RSVP_CLASS_HOP, "HOP object"},
205 {RSVP_CLASS_INTEGRITY, "INTEGRITY object"},
206 {RSVP_CLASS_TIME_VALUES, "TIME VALUES object"},
207 {RSVP_CLASS_ERROR, "ERROR object"},
208 {RSVP_CLASS_SCOPE, "SCOPE object"},
209 {RSVP_CLASS_STYLE, "STYLE object"},
210 {RSVP_CLASS_FLOWSPEC, "FLOWSPEC object"},
211 {RSVP_CLASS_FILTER_SPEC, "FILTER SPEC object"},
212 {RSVP_CLASS_SENDER_TEMPLATE, "SENDER TEMPLATE object"},
213 {RSVP_CLASS_SENDER_TSPEC, "SENDER TSPEC object"},
214 {RSVP_CLASS_ADSPEC, "ADSPEC object"},
215 {RSVP_CLASS_POLICY, "POLICY object"},
216 {RSVP_CLASS_CONFIRM, "CONFIRM object"},
217 {RSVP_CLASS_LABEL, "LABEL object"},
218 {RSVP_CLASS_LABEL_REQUEST, "LABEL REQUEST object"},
219 {RSVP_CLASS_EXPLICIT_ROUTE, "EXPLICIT ROUTE object"},
220 {RSVP_CLASS_RECORD_ROUTE, "RECORD ROUTE object"},
221 {RSVP_CLASS_SESSION_ATTRIBUTE, "SESSION ATTRIBUTE object"},
222 {RSVP_CLASS_MESSAGE_ID, "MESSAGE-ID object"},
223 {RSVP_CLASS_MESSAGE_ID_ACK, "MESSAGE-ID ACK/NACK object"},
224 {RSVP_CLASS_MESSAGE_ID_LIST, "MESSAGE-ID LIST object"},
225 {RSVP_CLASS_HELLO, "HELLO object"},
226 {RSVP_CLASS_RECOVERY_LABEL, "RECOVERY-LABEL object"},
227 {RSVP_CLASS_UPSTREAM_LABEL, "UPSTREAM-LABEL object"},
228 {RSVP_CLASS_LABEL_SET, "LABEL-SET object"},
229 {RSVP_CLASS_PROTECTION, "PROTECTION object"},
230 {RSVP_CLASS_SUGGESTED_LABEL, "SUGGESTED-LABEL object"},
231 {RSVP_CLASS_ACCEPTABLE_LABEL_SET, "ACCEPTABLE-LABEL-SET object"},
232 {RSVP_CLASS_RESTART_CAP, "RESTART-CAPABILITY object"},
233 {RSVP_CLASS_DCLASS, "DCLASS object"},
234 {RSVP_CLASS_LSP_TUNNEL_IF_ID, "LSP-TUNNEL INTERFACE-ID object"},
235 {RSVP_CLASS_NOTIFY_REQUEST, "NOTIFY-REQUEST object"},
236 {RSVP_CLASS_ADMIN_STATUS, "ADMIN-STATUS object"},
243 enum rsvp_error_types {
244 RSVP_ERROR_CONFIRM = 0,
245 RSVP_ERROR_ADMISSION,
248 RSVP_ERROR_NO_SENDER,
249 RSVP_ERROR_CONFLICT_RESV_STYLE,
250 RSVP_ERROR_UNKNOWN_RESV_STYLE,
251 RSVP_ERROR_CONFLICT_DEST_PORTS,
252 RSVP_ERROR_CONFLICT_SRC_PORTS,
253 RSVP_ERROR_PREEMPTED=12,
254 RSVP_ERROR_UNKNOWN_CLASS,
255 RSVP_ERROR_UNKNOWN_C_TYPE,
256 RSVP_ERROR_TRAFFIC = 21,
257 RSVP_ERROR_TRAFFIC_SYSTEM,
263 static value_string rsvp_error_vals[] = {
264 {RSVP_ERROR_CONFIRM, "Confirmation"},
265 {RSVP_ERROR_ADMISSION, "Admission Control Failure "},
266 {RSVP_ERROR_POLICY, "Policy Control Failure"},
267 {RSVP_ERROR_NO_PATH, "No PATH information for this RESV message"},
268 {RSVP_ERROR_NO_SENDER, "No sender information for this RESV message"},
269 {RSVP_ERROR_CONFLICT_RESV_STYLE, "Conflicting reservation styles"},
270 {RSVP_ERROR_UNKNOWN_RESV_STYLE, "Unknown reservation style"},
271 {RSVP_ERROR_CONFLICT_DEST_PORTS, "Conflicting destination ports"},
272 {RSVP_ERROR_CONFLICT_SRC_PORTS, "Conflicting source ports"},
273 {RSVP_ERROR_PREEMPTED, "Service preempted"},
274 {RSVP_ERROR_UNKNOWN_CLASS, "Unknown object class"},
275 {RSVP_ERROR_UNKNOWN_C_TYPE, "Unknown object C-type"},
276 {RSVP_ERROR_TRAFFIC, "Traffic Control Error"},
277 {RSVP_ERROR_TRAFFIC_SYSTEM, "Traffic Control System Error"},
278 {RSVP_ERROR_SYSTEM, "RSVP System Error"},
279 {RSVP_ERROR_ROUTING, "Routing Error"},
280 {RSVP_ERROR_NOTIFY, "RSVP Notify Error"},
285 * Defines the reservation style plus style-specific information that
286 * is not a FLOWSPEC or FILTER_SPEC object, in a RESV message.
288 #define RSVP_DISTINCT (1 << 3)
289 #define RSVP_SHARED (2 << 3)
290 #define RSVP_SHARING_MASK (RSVP_DISTINCT | RSVP_SHARED)
292 #define RSVP_SCOPE_WILD 1
293 #define RSVP_SCOPE_EXPLICIT 2
294 #define RSVP_SCOPE_MASK 0x07
296 #define RSVP_WF (RSVP_SHARED | RSVP_SCOPE_WILD)
297 #define RSVP_FF (RSVP_DISTINCT | RSVP_SCOPE_EXPLICIT)
298 #define RSVP_SE (RSVP_SHARED | RSVP_SCOPE_EXPLICIT)
300 static value_string style_vals[] = {
301 { RSVP_WF, "Wildcard Filter" },
302 { RSVP_FF, "Fixed Filter" },
303 { RSVP_SE, "Shared-Explicit" },
308 * Defines a desired QoS, in a RESV message.
310 enum qos_service_type {
311 QOS_QUALITATIVE = 128, /* Qualitative service */
312 QOS_NULL = 6, /* Null service (RFC2997) */
313 QOS_CONTROLLED_LOAD= 5, /* Controlled Load Service */
314 QOS_GUARANTEED = 2, /* Guaranteed service */
315 QOS_TSPEC = 1 /* Traffic specification */
318 static value_string qos_vals[] = {
319 { QOS_QUALITATIVE, "Qualitative QoS" },
320 { QOS_NULL, "Null-Service QoS" },
321 { QOS_CONTROLLED_LOAD, "Controlled-load QoS" },
322 { QOS_GUARANTEED, "Guaranteed rate QoS" },
323 { QOS_TSPEC, "Traffic specification" },
327 static value_string svc_vals[] = {
328 { 126, "Compression Hint" },
329 { 127, "Token bucket" },
330 { 128, "Null Service" },
331 { 130, "Guaranteed-rate RSpec" },
335 enum rsvp_spec_types { INTSRV = 2 };
337 enum intsrv_services {
342 INTSRV_QUALITATIVE = 128
345 static value_string intsrv_services_str[] = {
346 {INTSRV_GENERAL, "Default General Parameters"},
347 {INTSRV_GTD, "Guaranteed Rate"},
348 {INTSRV_CLOAD, "Controlled Load"},
349 {INTSRV_NULL, "Null Service"},
350 {INTSRV_QUALITATIVE, "Null Service"},
355 enum intsrv_field_name {
356 INTSRV_NON_IS_HOPS = 1, INTSRV_COMPOSED_NON_IS_HOPS,
357 INTSRV_IS_HOPS, INTSRV_COMPOSED_IS_HOPS,
358 INTSRV_PATH_BANDWIDTH, INTSRV_MIN_PATH_BANDWIDTH,
359 INTSRV_IF_LATENCY, INTSRV_PATH_LATENCY,
360 INTSRV_MTU, INTSRV_COMPOSED_MTU,
362 INTSRV_TOKEN_BUCKET_TSPEC = 127,
363 INTSRV_QUALITATIVE_TSPEC = 128,
364 INTSRV_GTD_RSPEC = 130,
366 INTSRV_DELAY = 131, /* Gtd Parameter C - Max Delay Bound - bytes */
367 INTSRV_MAX_JITTER, /* Gtd Parameter D - Max Jitter */
368 INTSRV_E2E_DELAY, /* Gtd Parameter Ctot */
369 INTSRV_E2E_MAX_JITTER, /* Gtd Parameter Dtot */
370 INTSRV_SHP_DELAY, /* Gtd Parameter Csum */
371 INTSRV_SHP_MAX_JITTER /* Gtd Parameter Dsum */
375 static value_string adspec_params[] = {
377 {6, "Path b/w estimate"},
378 {8, "Minimum path latency"},
379 {10, "Composed MTU"},
380 {133, "End-to-end composed value for C"},
381 {134, "End-to-end composed value for D"},
382 {135, "Since-last-reshaping point composed C"},
383 {136, "Since-last-reshaping point composed D"},
387 const value_string gmpls_lsp_enc_str[] = {
389 { 2, "Ethernet v2/DIX"},
392 { 5, "SDH ITU-T G.707"},
393 { 6, "SONET ANSI T1.105"},
394 { 7, "Digital Wrapper"},
395 { 8, "Lambda (photonic)"},
397 {10, "Ethernet 802.3"},
398 {11, "FiberChannel"},
402 const value_string gmpls_switching_type_str[] = {
403 { 1, "Packet-Switch Capable-1 (PSC-1)"},
404 { 2, "Packet-Switch Capable-2 (PSC-2)"},
405 { 3, "Packet-Switch Capable-3 (PSC-3)"},
406 { 4, "Packet-Switch Capable-4 (PSC-4)"},
407 { 51, "Layer-2 Switch Capable (L2SC)"},
408 {100, "Time-Division-Multiplex Capable (TDM)"},
409 {150, "Lambda-Switch Capable (LSC)"},
410 {200, "Fiber-Switch Capable (FSC)"},
414 static const value_string gmpls_gpid_str[] = {
415 { 5, "Asynchronous mapping of E3 (SONET, SDH)"},
416 { 8, "Bit synchronous mapping of E3 (SDH)"},
417 { 9, "Byte synchronous mapping of E3 (SDH)"},
418 {10, "Asynchronous mapping of DS2/T2 (SONET, SDH)"},
419 {11, "Bit synchronous mapping of DS2/T2 (SONET, SDH)"},
420 {13, "Asynchronous mapping of E1 (SONET, SDH)"},
421 {14, "Byte synchronous mapping of E1 (SONET, SDH)"},
422 {15, "Byte synchronous mapping of 31 * DS0 (SONET, SDH)"},
423 {16, "Asynchronous mapping of DS1/T1 (SONET, SDH)"},
424 {17, "Bit synchronous mapping of DS1/T1 (SONET, SDH)"},
425 {18, "Byte synchronous mapping of DS1/T1 (SONET, SDH)"},
426 {19, "VC-11 in VC-12 (SDH)"},
427 {22, "DS1 SF Asynchronous (SONET)"},
428 {23, "DS1 ESF Asynchronous (SONET)"},
429 {24, "DS3 M23 Asynchronous (SONET)"},
430 {25, "DS3 C-Bit Parity Asynchronous (SONET)"},
431 {26, "VT/LOVC (SONET, SDH)"},
432 {27, "STS SPE/HOVC (SONET, SDH)"},
433 {28, "POS - No Scrambling, 16 bit CRC (SONET, SDH)"},
434 {29, "POS - No Scrambling, 32 bit CRC (SONET, SDH)"},
435 {30, "POS - Scrambling, 16 bit CRC (SONET, SDH)"},
436 {31, "POS - Scrambling, 32 bit CRC (SONET, SDH)"},
437 {32, "ATM Mapping (SONET, SDH)"},
438 {33, "Ethernet (SDH, Lambda, Fiber)"},
439 {34, "SDH (Lambda, Fiber)"},
440 {35, "SONET (Lambda, Fiber)"},
441 {36, "Digital Wrapper (Lambda, Fiber)"},
442 {37, "Lambda (Fiber)"},
443 {38, "ETSI PDH (SDH)"},
444 {39, "ANSI PDH (SONET, SDH)"},
445 {40, "Link Access Protocol SDH: LAPS - X.85 and X.86 (SONET, SDH)"},
446 {41, "FDDI (SONET, SDH, Lambda, Fiber)"},
447 {42, "DQDB: ETSI ETS 300 216 (SONET, SDH)"},
448 {43, "FiberChannel-3 Services (FiberChannel)"},
452 /* -------------------- Stuff for MPLS/TE objects -------------------- */
454 static const value_string proto_vals[] = { {IP_PROTO_ICMP, "ICMP"},
455 {IP_PROTO_IGMP, "IGMP"},
456 {IP_PROTO_TCP, "TCP" },
457 {IP_PROTO_UDP, "UDP" },
458 {IP_PROTO_OSPF, "OSPF"},
462 enum rsvp_filter_keys {
465 RSVPF_MSG, /* Message type */
466 /* Shorthand for message types */
483 /* Does the message contain an object of this type? */
485 /* Object present shorthands */
505 RSVPF_EXPLICIT_ROUTE,
509 RSVPF_MESSAGE_ID_ACK,
510 RSVPF_MESSAGE_ID_LIST,
511 RSVPF_RECOVERY_LABEL,
512 RSVPF_UPSTREAM_LABEL,
516 RSVPF_SUGGESTED_LABEL,
517 RSVPF_ACCEPTABLE_LABEL_SET,
520 RSVPF_SESSION_ATTRIBUTE,
522 RSVPF_LSP_TUNNEL_IF_ID,
523 RSVPF_NOTIFY_REQUEST,
531 RSVPF_SESSION_TUNNEL_ID,
532 RSVPF_SESSION_EXT_TUNNEL_ID,
534 /* Sender template */
543 static int rsvp_filter[RSVPF_MAX];
545 static hf_register_info rsvpf_info[] = {
547 /* Message type number */
548 {&rsvp_filter[RSVPF_MSG],
549 { "Message Type", "rsvp.msg", FT_UINT8, BASE_DEC, VALS(message_type_vals), 0x0,
552 /* Message type shorthands */
553 {&rsvp_filter[RSVPF_PATH],
554 { "Path Message", "rsvp.path", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
557 {&rsvp_filter[RSVPF_HELLO],
558 { "HELLO Message", "rsvp.hello", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
561 {&rsvp_filter[RSVPF_RESV],
562 { "Resv Message", "rsvp.resv", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
565 {&rsvp_filter[RSVPF_PATHERR],
566 { "Path Error Message", "rsvp.perr", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
569 {&rsvp_filter[RSVPF_RESVERR],
570 { "Resv Error Message", "rsvp.rerr", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
573 {&rsvp_filter[RSVPF_PATHTEAR],
574 { "Path Tear Message", "rsvp.ptear", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
577 {&rsvp_filter[RSVPF_RESVTEAR],
578 { "Resv Tear Message", "rsvp.rtear", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
581 {&rsvp_filter[RSVPF_RCONFIRM],
582 { "Resv Confirm Message", "rsvp.resvconf", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
585 {&rsvp_filter[RSVPF_RTEARCONFIRM],
586 { "Resv Tear Confirm Message", "rsvp.rtearconf", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
590 {&rsvp_filter[RSVPF_OBJECT],
591 { "Object class", "rsvp.object", FT_UINT8, BASE_DEC, VALS(rsvp_class_vals), 0x0,
594 /* Object present shorthands */
595 {&rsvp_filter[RSVPF_SESSION],
596 { "SESSION", "rsvp.session", FT_NONE, BASE_NONE, NULL, 0x0,
599 {&rsvp_filter[RSVPF_HOP],
600 { "HOP", "rsvp.hop", FT_NONE, BASE_NONE, NULL, 0x0,
603 {&rsvp_filter[RSVPF_HELLO_OBJ],
604 { "HELLO Request/Ack", "rsvp.hello_obj", FT_NONE, BASE_NONE, NULL, 0x0,
607 {&rsvp_filter[RSVPF_INTEGRITY],
608 { "INTEGRITY", "rsvp.integrity", FT_NONE, BASE_NONE, NULL, 0x0,
611 {&rsvp_filter[RSVPF_TIME_VALUES],
612 { "TIME VALUES", "rsvp.time", FT_NONE, BASE_NONE, NULL, 0x0,
615 {&rsvp_filter[RSVPF_ERROR],
616 { "ERROR", "rsvp.error", FT_NONE, BASE_NONE, NULL, 0x0,
619 {&rsvp_filter[RSVPF_SCOPE],
620 { "SCOPE", "rsvp.scope", FT_NONE, BASE_NONE, NULL, 0x0,
623 {&rsvp_filter[RSVPF_STYLE],
624 { "STYLE", "rsvp.style", FT_NONE, BASE_NONE, NULL, 0x0,
627 {&rsvp_filter[RSVPF_FLOWSPEC],
628 { "FLOWSPEC", "rsvp.flowspec", FT_NONE, BASE_NONE, NULL, 0x0,
631 {&rsvp_filter[RSVPF_FILTER_SPEC],
632 { "FILTERSPEC", "rsvp.filter", FT_NONE, BASE_NONE, NULL, 0x0,
635 {&rsvp_filter[RSVPF_SENDER],
636 { "SENDER TEMPLATE", "rsvp.sender", FT_NONE, BASE_NONE, NULL, 0x0,
639 {&rsvp_filter[RSVPF_TSPEC],
640 { "SENDER TSPEC", "rsvp.tspec", FT_NONE, BASE_NONE, NULL, 0x0,
643 {&rsvp_filter[RSVPF_ADSPEC],
644 { "ADSPEC", "rsvp.adspec", FT_NONE, BASE_NONE, NULL, 0x0,
647 {&rsvp_filter[RSVPF_POLICY],
648 { "POLICY", "rsvp.policy", FT_NONE, BASE_NONE, NULL, 0x0,
651 {&rsvp_filter[RSVPF_CONFIRM],
652 { "CONFIRM", "rsvp.confirm", FT_NONE, BASE_NONE, NULL, 0x0,
655 {&rsvp_filter[RSVPF_LABEL],
656 { "LABEL", "rsvp.label", FT_NONE, BASE_NONE, NULL, 0x0,
659 {&rsvp_filter[RSVPF_RECOVERY_LABEL],
660 { "RECOVERY LABEL", "rsvp.recovery_label", FT_NONE, BASE_NONE, NULL, 0x0,
663 {&rsvp_filter[RSVPF_UPSTREAM_LABEL],
664 { "UPSTREAM LABEL", "rsvp.upstream_label", FT_NONE, BASE_NONE, NULL, 0x0,
667 {&rsvp_filter[RSVPF_SUGGESTED_LABEL],
668 { "SUGGESTED LABEL", "rsvp.suggested_label", FT_NONE, BASE_NONE, NULL, 0x0,
671 {&rsvp_filter[RSVPF_LABEL_SET],
672 { "RESTRICTED LABEL SET", "rsvp.label_set", FT_NONE, BASE_NONE, NULL, 0x0,
675 {&rsvp_filter[RSVPF_ACCEPTABLE_LABEL_SET],
676 { "ACCEPTABLE LABEL SET", "rsvp.acceptable_label_set", FT_NONE, BASE_NONE, NULL, 0x0,
679 {&rsvp_filter[RSVPF_PROTECTION],
680 { "PROTECTION", "rsvp.protection", FT_NONE, BASE_NONE, NULL, 0x0,
683 {&rsvp_filter[RSVPF_RESTART_CAP],
684 { "RESTART CAPABILITY", "rsvp.restart", FT_NONE, BASE_NONE, NULL, 0x0,
687 {&rsvp_filter[RSVPF_LABEL_REQUEST],
688 { "LABEL REQUEST", "rsvp.label_request", FT_NONE, BASE_NONE, NULL, 0x0,
691 {&rsvp_filter[RSVPF_SESSION_ATTRIBUTE],
692 { "SESSION ATTRIBUTE", "rsvp.session_attribute", FT_NONE, BASE_NONE, NULL, 0x0,
695 {&rsvp_filter[RSVPF_EXPLICIT_ROUTE],
696 { "EXPLICIT ROUTE", "rsvp.explicit_route", FT_NONE, BASE_NONE, NULL, 0x0,
699 {&rsvp_filter[RSVPF_RECORD_ROUTE],
700 { "RECORD ROUTE", "rsvp.record_route", FT_NONE, BASE_NONE, NULL, 0x0,
703 {&rsvp_filter[RSVPF_MESSAGE_ID],
704 { "MESSAGE-ID", "rsvp.msgid", FT_NONE, BASE_NONE, NULL, 0x0,
707 {&rsvp_filter[RSVPF_MESSAGE_ID_ACK],
708 { "MESSAGE-ID ACK", "rsvp.ack", FT_NONE, BASE_NONE, NULL, 0x0,
711 {&rsvp_filter[RSVPF_MESSAGE_ID_LIST],
712 { "MESSAGE-ID LIST", "rsvp.msgid_list", FT_NONE, BASE_NONE, NULL, 0x0,
715 {&rsvp_filter[RSVPF_HELLO_OBJ],
716 { "HELLO", "rsvp.hello", FT_NONE, BASE_NONE, NULL, 0x0,
719 {&rsvp_filter[RSVPF_DCLASS],
720 { "DCLASS", "rsvp.dclass", FT_NONE, BASE_NONE, NULL, 0x0,
723 {&rsvp_filter[RSVPF_LSP_TUNNEL_IF_ID],
724 { "LSP INTERFACE-ID", "rsvp.lsp_tunnel_if_id", FT_NONE, BASE_NONE, NULL, 0x0,
727 {&rsvp_filter[RSVPF_ADMIN_STATUS],
728 { "ADMIN STATUS", "rsvp.admin_status", FT_NONE, BASE_NONE, NULL, 0x0,
731 {&rsvp_filter[RSVPF_NOTIFY_REQUEST],
732 { "NOTIFY REQUEST", "rsvp.notify_request", FT_NONE, BASE_NONE, NULL, 0x0,
735 {&rsvp_filter[RSVPF_UNKNOWN_OBJ],
736 { "Unknown object", "rsvp.obj_unknown", FT_NONE, BASE_NONE, NULL, 0x0,
740 {&rsvp_filter[RSVPF_SESSION_IP],
741 { "Destination address", "rsvp.session.ip", FT_IPv4, BASE_NONE, NULL, 0x0,
744 {&rsvp_filter[RSVPF_SESSION_PORT],
745 { "Port number", "rsvp.session.port", FT_UINT16, BASE_DEC, NULL, 0x0,
748 {&rsvp_filter[RSVPF_SESSION_PROTO],
749 { "Protocol", "rsvp.session.proto", FT_UINT8, BASE_DEC, VALS(proto_vals), 0x0,
752 {&rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
753 { "Tunnel ID", "rsvp.session.tunnel_id", FT_UINT16, BASE_DEC, NULL, 0x0,
756 {&rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
757 { "Extended tunnel ID", "rsvp.session.ext_tunnel_id", FT_UINT32, BASE_DEC, NULL, 0x0,
760 /* Sender template/Filterspec fields */
761 {&rsvp_filter[RSVPF_SENDER_IP],
762 { "Sender IPv4 address", "rsvp.sender.ip", FT_IPv4, BASE_NONE, NULL, 0x0,
765 {&rsvp_filter[RSVPF_SENDER_PORT],
766 { "Sender port number", "rsvp.sender.port", FT_UINT16, BASE_DEC, NULL, 0x0,
769 {&rsvp_filter[RSVPF_SENDER_LSP_ID],
770 { "Sender LSP ID", "rsvp.sender.lsp_id", FT_UINT16, BASE_DEC, NULL, 0x0,
774 static inline int rsvp_class_to_filter_num(int classnum)
777 case RSVP_CLASS_SESSION :
778 case RSVP_CLASS_HOP :
779 case RSVP_CLASS_INTEGRITY :
780 case RSVP_CLASS_TIME_VALUES :
781 case RSVP_CLASS_ERROR :
782 case RSVP_CLASS_SCOPE :
783 case RSVP_CLASS_STYLE :
784 case RSVP_CLASS_FLOWSPEC :
785 case RSVP_CLASS_FILTER_SPEC :
786 case RSVP_CLASS_SENDER_TEMPLATE :
787 case RSVP_CLASS_SENDER_TSPEC :
788 case RSVP_CLASS_ADSPEC :
789 case RSVP_CLASS_POLICY :
790 case RSVP_CLASS_CONFIRM :
791 case RSVP_CLASS_LABEL :
792 case RSVP_CLASS_LABEL_REQUEST :
793 case RSVP_CLASS_HELLO :
794 case RSVP_CLASS_EXPLICIT_ROUTE :
795 case RSVP_CLASS_RECORD_ROUTE :
796 case RSVP_CLASS_MESSAGE_ID :
797 case RSVP_CLASS_MESSAGE_ID_ACK :
798 case RSVP_CLASS_MESSAGE_ID_LIST :
799 return classnum + RSVPF_OBJECT;
802 case RSVP_CLASS_RECOVERY_LABEL :
803 case RSVP_CLASS_UPSTREAM_LABEL :
804 case RSVP_CLASS_LABEL_SET :
805 case RSVP_CLASS_PROTECTION :
806 return RSVPF_RECOVERY_LABEL + (classnum - RSVP_CLASS_RECOVERY_LABEL);
808 case RSVP_CLASS_SUGGESTED_LABEL :
809 case RSVP_CLASS_ACCEPTABLE_LABEL_SET :
810 case RSVP_CLASS_RESTART_CAP :
811 return RSVPF_SUGGESTED_LABEL + (classnum - RSVP_CLASS_SUGGESTED_LABEL);
813 case RSVP_CLASS_NOTIFY_REQUEST :
814 case RSVP_CLASS_ADMIN_STATUS :
815 return RSVPF_NOTIFY_REQUEST + (classnum - RSVP_CLASS_NOTIFY_REQUEST);
817 case RSVP_CLASS_SESSION_ATTRIBUTE :
818 return RSVPF_SESSION_ATTRIBUTE;
819 case RSVP_CLASS_DCLASS :
821 case RSVP_CLASS_LSP_TUNNEL_IF_ID :
822 return RSVPF_LSP_TUNNEL_IF_ID;
825 return RSVPF_UNKNOWN_OBJ;
830 find_rsvp_session_tempfilt(tvbuff_t *tvb, int hdr_offset, int *session_offp, int *tempfilt_offp)
832 int s_off = 0, t_off = 0;
838 len = tvb_get_ntohs(tvb, hdr_offset+6) + hdr_offset;
839 off = hdr_offset + 8;
840 for (off = hdr_offset + 8; off < len; off += tvb_get_ntohs(tvb, off)) {
841 switch(tvb_get_guint8(tvb, off+2)) {
842 case RSVP_CLASS_SESSION:
845 case RSVP_CLASS_SENDER_TEMPLATE:
846 case RSVP_CLASS_FILTER_SPEC:
855 if (session_offp) *session_offp = s_off;
856 if (tempfilt_offp) *tempfilt_offp = t_off;
859 static char *summary_session (tvbuff_t *tvb, int offset)
863 switch(tvb_get_guint8(tvb, offset+3)) {
865 snprintf(buf, 80, "SESSION: IPv4, Destination %s, Protocol %d, Port %d. ",
866 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
867 tvb_get_guint8(tvb, offset+8),
868 tvb_get_ntohs(tvb, offset+10));
871 snprintf(buf, 80, "SESSION: IPv4-LSP, Destination %s, Tunnel ID %d, Ext ID %0x. ",
872 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
873 tvb_get_ntohs(tvb, offset+10),
874 tvb_get_ntohl(tvb, offset+12));
877 snprintf(buf, 80, "SESSION: Type %d. ", tvb_get_guint8(tvb, offset+3));
883 static char *summary_template (tvbuff_t *tvb, int offset)
888 if (tvb_get_guint8(tvb, offset+2) == RSVP_CLASS_FILTER_SPEC)
889 objtype = "FILTERSPEC";
891 objtype = "SENDER TEMPLATE";
893 switch(tvb_get_guint8(tvb, offset+3)) {
895 snprintf(buf, 80, "%s: IPv4, Sender %s, Port %d. ", objtype,
896 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
897 tvb_get_ntohs(tvb, offset+10));
900 snprintf(buf, 80, "%s: IPv4-LSP, Tunnel Source: %s, LSP ID: %d. ", objtype,
901 ip_to_str(tvb_get_ptr(tvb, offset+4, 4)),
902 tvb_get_ntohs(tvb, offset+10));
905 snprintf(buf, 80, "%s: Type %d. ", objtype, tvb_get_guint8(tvb, offset+3));
912 dissect_rsvp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
915 proto_tree *rsvp_tree = NULL, *ti, *ti2;
916 proto_tree *rsvp_header_tree;
917 proto_tree *rsvp_object_tree;
918 proto_tree *rsvp_sa_flags_tree;
919 proto_tree *rsvp_ero_subtree;
920 proto_tree *rsvp_admin_subtree;
921 proto_tree *rsvp_hop_subtree;
924 guint16 cksum, computed_cksum;
931 int session_off, tempfilt_off;
933 if (check_col(pinfo->cinfo, COL_PROTOCOL))
934 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSVP");
935 if (check_col(pinfo->cinfo, COL_INFO))
936 col_clear(pinfo->cinfo, COL_INFO);
938 ver_flags = tvb_get_guint8(tvb, offset+0);
939 message_type = tvb_get_guint8(tvb, offset+1);
940 if (check_col(pinfo->cinfo, COL_INFO)) {
941 col_add_str(pinfo->cinfo, COL_INFO,
942 val_to_str(message_type, message_type_vals, "Unknown (%u). "));
943 find_rsvp_session_tempfilt(tvb, offset, &session_off, &tempfilt_off);
945 col_append_str(pinfo->cinfo, COL_INFO, summary_session(tvb, session_off));
947 col_append_str(pinfo->cinfo, COL_INFO, summary_template(tvb, tempfilt_off));
951 msg_length = tvb_get_ntohs(tvb, offset+6);
952 ti = proto_tree_add_item(tree, proto_rsvp, tvb, offset, msg_length,
954 rsvp_tree = proto_item_add_subtree(ti, ett_rsvp);
956 ti = proto_tree_add_text(rsvp_tree, tvb, offset, 8, "RSVP Header. %s",
957 val_to_str(message_type, message_type_vals,
958 "Unknown Message (%u). "));
959 rsvp_header_tree = proto_item_add_subtree(ti, ett_rsvp_hdr);
961 proto_tree_add_text(rsvp_header_tree, tvb, offset, 1, "RSVP Version: %u",
962 (ver_flags & 0xf0)>>4);
963 proto_tree_add_text(rsvp_header_tree, tvb, offset, 1, "Flags: %02x",
965 proto_tree_add_uint(rsvp_header_tree, rsvp_filter[RSVPF_MSG], tvb,
966 offset+1, 1, message_type);
967 if (message_type <= RSVPF_RTEARCONFIRM &&
968 message_type != RSVPF_JUNK_MSG8 &&
969 message_type != RSVPF_JUNK_MSG9 ) {
970 proto_tree_add_boolean_hidden(rsvp_header_tree, rsvp_filter[RSVPF_MSG + message_type], tvb,
973 cksum = tvb_get_ntohs(tvb, offset+2);
974 if (!pinfo->fragmented && (int) tvb_length(tvb) >= msg_length) {
975 /* The packet isn't part of a fragmented datagram and isn't
976 truncated, so we can checksum it. */
977 cksum_vec[0].ptr = tvb_get_ptr(tvb, 0, msg_length);
978 cksum_vec[0].len = msg_length;
979 computed_cksum = in_cksum(&cksum_vec[0], 1);
980 if (computed_cksum == 0) {
981 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
982 "Message Checksum: 0x%04x (correct)",
985 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
986 "Message Checksum: 0x%04x (incorrect, should be 0x%04x)",
988 in_cksum_shouldbe(cksum, computed_cksum));
991 proto_tree_add_text(rsvp_header_tree, tvb, offset+2, 2,
992 "Message Checksum: 0x%04x",
995 proto_tree_add_text(rsvp_header_tree, tvb, offset+4, 1,
997 tvb_get_guint8(tvb, offset+4));
998 proto_tree_add_text(rsvp_header_tree, tvb, offset+6, 2,
999 "Message length: %u", msg_length);
1003 while (len < msg_length) {
1008 obj_length = tvb_get_ntohs(tvb, offset);
1009 class = tvb_get_guint8(tvb, offset+2);
1010 type = tvb_get_guint8(tvb, offset+3);
1011 object_type = val_to_str(class, rsvp_class_vals, "Unknown");
1012 proto_tree_add_uint_hidden(rsvp_tree, rsvp_filter[RSVPF_OBJECT], tvb,
1013 offset, obj_length, class);
1014 ti = proto_tree_add_item(rsvp_tree, rsvp_filter[rsvp_class_to_filter_num(class)],
1015 tvb, offset, obj_length, FALSE);
1021 case RSVP_CLASS_SESSION :
1022 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_session);
1023 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1024 "Length: %u", obj_length);
1025 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1026 "Class number: %u - %s",
1027 class, object_type);
1028 mylen = obj_length - 4;
1029 proto_item_set_text(ti, summary_session(tvb, offset));
1033 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1034 "C-type: 1 - IPv4");
1035 proto_tree_add_item(rsvp_object_tree,
1036 rsvp_filter[RSVPF_SESSION_IP],
1037 tvb, offset2, 4, FALSE);
1039 proto_tree_add_item(rsvp_object_tree,
1040 rsvp_filter[RSVPF_SESSION_PROTO], tvb,
1041 offset2+4, 1, FALSE);
1042 proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 1,
1044 tvb_get_guint8(tvb, offset2+5));
1045 proto_tree_add_item(rsvp_object_tree,
1046 rsvp_filter[RSVPF_SESSION_PORT], tvb,
1047 offset2+6, 2, FALSE);
1052 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1053 "C-type: 2 - IPv6");
1054 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1055 "Destination address: %s",
1056 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1057 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 1,
1059 tvb_get_guint8(tvb, offset2+16));
1060 proto_tree_add_text(rsvp_object_tree, tvb, offset2+17, 1,
1062 tvb_get_guint8(tvb, offset2+17));
1063 proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2,
1064 "Destination port: %u",
1065 tvb_get_ntohs(tvb, offset2+18));
1070 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1071 "C-type: 7 - IPv4 LSP");
1072 proto_tree_add_item(rsvp_object_tree,
1073 rsvp_filter[RSVPF_SESSION_IP],
1074 tvb, offset2, 4, FALSE);
1076 proto_tree_add_item(rsvp_object_tree,
1077 rsvp_filter[RSVPF_SESSION_TUNNEL_ID],
1078 tvb, offset2+6, 2, FALSE);
1080 proto_tree_add_text(rsvp_object_tree, tvb, offset2+8, 4,
1081 "Extended Tunnel ID: %u (%s)",
1082 tvb_get_ntohl(tvb, offset2+8),
1083 ip_to_str(tvb_get_ptr(tvb, offset2+8, 4)));
1084 proto_tree_add_item_hidden(rsvp_object_tree,
1085 rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID],
1086 tvb, offset2+8, 4, FALSE);
1091 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1092 "C-type: Unknown (%u)",
1094 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1095 "Data (%d bytes)", mylen);
1100 case RSVP_CLASS_HOP :
1101 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_hop);
1102 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1103 "Length: %u", obj_length);
1104 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1105 "Class number: %u - %s",
1106 class, object_type);
1107 mylen = obj_length - 4;
1110 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1111 "C-type: 1 - IPv4");
1112 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1113 "Neighbor address: %s",
1114 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1115 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
1116 "Logical interface: %u",
1117 tvb_get_ntohl(tvb, offset2+4));
1118 proto_item_set_text(ti, "HOP: IPv4, %s",
1119 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1124 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1125 "C-type: 2 - IPv6");
1126 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1127 "Neighbor address: %s",
1128 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1129 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 4,
1130 "Logical interface: 0x%08x",
1131 tvb_get_ntohl(tvb, offset2+16));
1139 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1140 "C-type: 3 - IPv4 Out-Of-Band");
1141 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1142 "Neighbor address: %s",
1143 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1144 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
1145 "Logical interface: %u",
1146 tvb_get_ntohl(tvb, offset2+4));
1148 for (tlv_off = 0; tlv_off < mylen - 8; ) {
1149 tlv_type = tvb_get_ntohs(tvb, offset2+8+tlv_off);
1150 tlv_len = tvb_get_ntohs(tvb, offset2+8+tlv_off+2);
1153 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1154 offset2+8+tlv_off, 8,
1156 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)));
1158 proto_item_add_subtree(ti2, ett_rsvp_hop_subobj);
1159 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off, 2,
1161 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off+2, 2,
1163 tvb_get_ntohs(tvb, offset2+8+tlv_off+2));
1164 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off+4, 4,
1166 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)));
1167 proto_item_set_text(ti, "HOP: Out-of-band. Control IPv4: %s. Data IPv4: %s",
1168 ip_to_str(tvb_get_ptr(tvb, offset2, 4)),
1169 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)));
1173 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1174 offset2+8+tlv_off, 12,
1175 "Interface-Index TLV - %s, %d",
1176 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)),
1177 tvb_get_ntohl(tvb, offset2+8+tlv_off+8));
1179 proto_item_add_subtree(ti2, ett_rsvp_hop_subobj);
1180 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off, 2,
1181 "Type: 3 (Interface Index)");
1182 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off+2, 2,
1184 tvb_get_ntohs(tvb, offset2+8+tlv_off+2));
1185 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off+4, 4,
1187 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)));
1188 proto_tree_add_text(rsvp_hop_subtree, tvb, offset2+8+tlv_off+8, 4,
1190 tvb_get_ntohl(tvb, offset2+8+tlv_off+8));
1191 proto_item_set_text(ti, "HOP: Out-of-band. Control IPv4: %s. Data If-Index: %s, %d",
1192 ip_to_str(tvb_get_ptr(tvb, offset2, 4)),
1193 ip_to_str(tvb_get_ptr(tvb, offset2+8+tlv_off+4, 4)),
1194 tvb_get_ntohl(tvb, offset2+8+tlv_off+8));
1198 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
1199 "Logical interface: %u",
1200 tvb_get_ntohl(tvb, offset2+4));
1208 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1209 "C-type: Unknown (%u)",
1211 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1212 "Data (%d bytes)", mylen);
1217 case RSVP_CLASS_TIME_VALUES :
1218 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_time_values);
1219 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1220 "Length: %u", obj_length);
1221 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1222 "Class number: %u - %s",
1223 class, object_type);
1224 mylen = obj_length - 4;
1227 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1229 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1230 "Refresh interval: %u ms (%u seconds)",
1231 tvb_get_ntohl(tvb, offset2),
1232 tvb_get_ntohl(tvb, offset2)/1000);
1233 proto_item_set_text(ti, "TIME VALUES: %d ms",
1234 tvb_get_ntohl(tvb, offset2));
1239 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1240 "C-type: Unknown (%u)",
1242 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1243 "Data (%d bytes)", mylen);
1249 case RSVP_CLASS_ERROR :
1250 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_error);
1251 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1252 "Length: %u", obj_length);
1253 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1254 "Class number: %u - %s",
1255 class, object_type);
1256 mylen = obj_length - 4;
1261 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1262 "C-type: 1 - IPv4");
1263 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1265 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1266 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 1,
1268 tvb_get_guint8(tvb, offset2+4));
1269 error_code = tvb_get_guint8(tvb, offset2+5);
1270 proto_tree_add_text(rsvp_object_tree, tvb, offset2+5, 1,
1271 "Error code: %u - %s", error_code,
1272 val_to_str(error_code, rsvp_error_vals, "Unknown (%d)"));
1273 proto_tree_add_text(rsvp_object_tree, tvb, offset2+6, 2,
1275 tvb_get_ntohs(tvb, offset2+6));
1276 proto_item_set_text(ti, "ERROR: IPv4, Error code: %s, Value: %d, Error Node: %s",
1277 val_to_str(error_code, rsvp_error_vals, "Unknown (%d)"),
1278 tvb_get_ntohs(tvb, offset2+6),
1279 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1286 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1287 "C-type: 2 - IPv6");
1288 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1290 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1291 proto_tree_add_text(rsvp_object_tree, tvb, offset2+16, 1,
1293 tvb_get_guint8(tvb, offset2+16));
1294 error_code = tvb_get_guint8(tvb, offset2+17);
1295 proto_tree_add_text(rsvp_object_tree, tvb, offset2+17, 1,
1296 "Error code: %u - %s", error_code,
1297 val_to_str(error_code, rsvp_error_vals, "Unknown"));
1298 proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2,
1300 tvb_get_ntohs(tvb, offset2+18));
1305 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1306 "C-type: Unknown (%u)",
1308 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1309 "Data (%d bytes)", mylen);
1315 case RSVP_CLASS_SCOPE :
1316 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_scope);
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;
1325 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1326 "C-type: 1 - IPv4");
1328 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1330 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1338 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1339 "C-type: 2 - IPv6");
1341 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1343 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
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, mylen,
1355 "Data (%d bytes)", mylen);
1360 case RSVP_CLASS_STYLE :
1361 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_style);
1362 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1363 "Length: %u", obj_length);
1364 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1365 "Class number: %u - %s",
1366 class, object_type);
1367 mylen = obj_length - 4;
1372 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1374 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1376 tvb_get_guint8(tvb, offset2));
1377 style = tvb_get_ntoh24(tvb, offset2+1);
1378 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1,
1379 3, "Style: 0x%06X - %s", style,
1380 val_to_str(style, style_vals, "Unknown"));
1381 proto_item_set_text(ti, "STYLE: %s (%d)",
1382 val_to_str(style, style_vals, "Unknown"),
1388 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1389 "C-type: Unknown (%u)",
1391 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1392 "Data (%d bytes)", mylen);
1398 case RSVP_CLASS_CONFIRM :
1399 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_confirm);
1400 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1401 "Length: %u", obj_length);
1402 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1403 "Class number: %u - %s",
1404 class, object_type);
1405 mylen = obj_length - 4;
1408 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1409 "C-type: 1 - IPv4");
1410 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
1411 "Receiver address: %s",
1412 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1413 proto_item_set_text(ti, "CONFIRM: Receiver %s",
1414 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
1419 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1420 "C-type: 2 - IPv6");
1421 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1422 "Receiver address: %s",
1423 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1428 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1429 "C-type: Unknown (%u)",
1431 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1432 "Data (%d bytes)", mylen);
1437 case RSVP_CLASS_SENDER_TEMPLATE :
1438 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_sender_template);
1439 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1440 "Length: %u", obj_length);
1441 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1442 "Class number: %u - %s",
1443 class, object_type);
1444 goto common_template;
1445 case RSVP_CLASS_FILTER_SPEC :
1446 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_filter_spec);
1447 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1448 "Length: %u", obj_length);
1449 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1450 "Class number: %u - %s",
1451 class, object_type);
1453 mylen = obj_length - 4;
1454 proto_item_set_text(ti, summary_template(tvb, offset));
1457 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1458 "C-type: 1 - IPv4");
1459 proto_tree_add_item(rsvp_object_tree,
1460 rsvp_filter[RSVPF_SENDER_IP],
1461 tvb, offset2, 4, FALSE);
1462 proto_tree_add_item(rsvp_object_tree,
1463 rsvp_filter[RSVPF_SENDER_PORT],
1464 tvb, offset2+6, 2, FALSE);
1469 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1470 "C-type: 2 - IPv6");
1471 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 16,
1472 "Source address: %s",
1473 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2, 16)));
1474 proto_tree_add_text(rsvp_object_tree, tvb, offset2+18, 2,
1476 tvb_get_ntohs(tvb, offset2+18));
1481 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1482 "C-type: 7 - IPv4 LSP");
1483 proto_tree_add_item(rsvp_object_tree,
1484 rsvp_filter[RSVPF_SENDER_IP],
1485 tvb, offset2, 4, FALSE);
1486 proto_tree_add_item(rsvp_object_tree,
1487 rsvp_filter[RSVPF_SENDER_LSP_ID],
1488 tvb, offset2+6, 2, FALSE);
1493 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1494 "C-type: Unknown (%u)",
1496 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
1497 "Data (%d bytes)", mylen);
1502 case RSVP_CLASS_SENDER_TSPEC : {
1503 proto_tree *tspec_tree;
1505 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_sender_tspec);
1506 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1507 "Length: %u", obj_length);
1508 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1509 "Class number: %u - %s",
1510 class, object_type);
1511 mylen = obj_length - 4;
1513 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1514 "Message format version: %u",
1515 tvb_get_guint8(tvb, offset2)>>4);
1516 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1517 "Data length: %u words, not including header",
1518 tvb_get_ntohs(tvb, offset2+2));
1523 proto_item_set_text(ti, "SENDER TSPEC: ");
1529 guint16 param_len_processed;
1532 service_num = tvb_get_guint8(tvb, offset2);
1533 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1534 "Service header: %u - %s",
1536 val_to_str(service_num, qos_vals, "Unknown"));
1537 length = tvb_get_ntohs(tvb, offset2+2);
1538 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1539 "Length of service %u data: %u words, "
1540 "not including header",
1541 service_num, length);
1546 /* Process all known service headers as a set of parameters */
1547 param_len_processed = 0;
1548 while (param_len_processed < length) {
1549 param_id = tvb_get_guint8(tvb, offset2);
1550 param_len = tvb_get_ntohs(tvb, offset2+2) + 1;
1554 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1555 offset2, param_len*4,
1556 "Token Bucket 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: 0x%02x",
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 "Token bucket rate: %.10g",
1574 tvb_get_ntohieee_float(tvb, offset2+4));
1575 proto_tree_add_text(tspec_tree, tvb, offset2+8, 4,
1576 "Token bucket size: %.10g",
1577 tvb_get_ntohieee_float(tvb, offset2+8));
1578 proto_tree_add_text(tspec_tree, tvb, offset2+12, 4,
1579 "Peak data rate: %.10g",
1580 tvb_get_ntohieee_float(tvb, offset2+12));
1581 proto_tree_add_text(tspec_tree, tvb, offset2+16, 4,
1582 "Minimum policed unit [m]: %u",
1583 tvb_get_ntohl(tvb, offset2+16));
1584 proto_tree_add_text(tspec_tree, tvb, offset2+20, 4,
1585 "Maximum packet size [M]: %u",
1586 tvb_get_ntohl(tvb, offset2+20));
1587 proto_item_append_text(ti, "Token Bucket, %.10g bytes/sec. ",
1588 tvb_get_ntohieee_float(tvb, offset2+4));
1589 proto_item_append_text(ti2, "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u",
1590 tvb_get_ntohieee_float(tvb, offset2+4),
1591 tvb_get_ntohieee_float(tvb, offset2+8),
1592 tvb_get_ntohieee_float(tvb, offset2+12),
1593 tvb_get_ntohl(tvb, offset2+16),
1594 tvb_get_ntohl(tvb, offset2+20));
1598 /* Null Service (RFC2997) */
1599 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1600 offset2, param_len*4,
1601 "Null Service TSpec: ");
1602 tspec_tree = proto_item_add_subtree(ti2, ett_rsvp_sender_tspec_subtree);
1604 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
1605 "Parameter %u - %s",
1607 val_to_str(param_id, svc_vals, "Unknown"));
1608 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
1609 "Parameter %u flags: %x",
1611 tvb_get_guint8(tvb, offset2+1));
1612 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
1613 "Parameter %u data length: %u words, "
1614 "not including header",
1616 tvb_get_ntohs(tvb, offset2+2));
1617 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
1618 "Maximum packet size [M]: %u",
1619 tvb_get_ntohl(tvb, offset2+4));
1620 proto_item_append_text(ti, "Null Service. M=%u",
1621 tvb_get_ntohl(tvb, offset2+4));
1622 proto_item_append_text(ti2, "Max pkt size=%u",
1623 tvb_get_ntohl(tvb, offset2+4));
1627 /* Compression hint (RFC3006) */
1628 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1629 offset2, param_len*4,
1630 "Compression Hint: ");
1631 tspec_tree = proto_item_add_subtree(ti2, ett_rsvp_sender_tspec_subtree);
1633 proto_tree_add_text(tspec_tree, tvb, offset2, 1,
1634 "Parameter %u - %s",
1636 val_to_str(param_id, svc_vals, "Unknown"));
1637 proto_tree_add_text(tspec_tree, tvb, offset2+1, 1,
1638 "Parameter %u flags: %x",
1640 tvb_get_guint8(tvb, offset2+1));
1641 proto_tree_add_text(tspec_tree, tvb, offset2+2, 2,
1642 "Parameter %u data length: %u words, "
1643 "not including header",
1645 tvb_get_ntohs(tvb, offset2+2));
1646 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
1648 tvb_get_ntohl(tvb, offset2+4));
1649 proto_tree_add_text(tspec_tree, tvb, offset2+4, 4,
1650 "Compression Factor: %u",
1651 tvb_get_ntohl(tvb, offset2+8));
1652 proto_item_append_text(ti, "Compression Hint. Hint=%u, Factor=%u",
1653 tvb_get_ntohl(tvb, offset2+4),
1654 tvb_get_ntohl(tvb, offset2+8));
1655 proto_item_append_text(ti2, "Hint=%u, Factor=%u",
1656 tvb_get_ntohl(tvb, offset2+4),
1657 tvb_get_ntohl(tvb, offset2+8));
1661 proto_tree_add_text(rsvp_object_tree, tvb, offset2, param_len*4,
1662 "Unknown parameter %d, %d words",
1663 param_id, param_len);
1666 param_len_processed += param_len;
1667 offset2 += param_len*4;
1669 /* offset2 += length*4; */
1675 case RSVP_CLASS_FLOWSPEC : {
1676 proto_tree *flowspec_tree;
1678 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_flowspec);
1679 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1680 "Length: %u", obj_length);
1681 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1682 "Class number: %u - %s",
1683 class, object_type);
1684 mylen = obj_length - 4;
1686 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1687 "Message format version: %u",
1688 tvb_get_guint8(tvb, offset2)>>4);
1689 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1690 "Data length: %u words, not including header",
1691 tvb_get_ntohs(tvb, offset2+2));
1693 proto_item_set_text(ti, "FLOWSPEC: ");
1702 guint16 param_len_processed;
1704 service_num = tvb_get_guint8(tvb, offset2);
1705 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1706 "Service header: %u - %s",
1708 val_to_str(service_num, intsrv_services_str, "Unknown"));
1709 length = tvb_get_ntohs(tvb, offset2+2);
1710 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1711 "Length of service %u data: %u words, "
1712 "not including header",
1719 proto_item_append_text(ti, "%s: ",
1720 val_to_str(service_num, intsrv_services_str,
1723 /* Process all known service headers as a set of parameters */
1724 param_len_processed = 0;
1725 while (param_len_processed < length) {
1726 param_id = tvb_get_guint8(tvb, offset2);
1727 param_len = tvb_get_ntohs(tvb, offset2+2) + 1;
1731 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1732 offset2, param_len*4,
1734 flowspec_tree = proto_item_add_subtree(ti2, ett_rsvp_flowspec_subtree);
1736 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
1737 "Parameter %u - %s",
1739 val_to_str(param_id, svc_vals, "Unknown"));
1740 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
1741 "Parameter %u flags: 0x%02x",
1743 tvb_get_guint8(tvb, offset2+1));
1744 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
1745 "Parameter %u data length: %u words, "
1746 "not including header",
1748 tvb_get_ntohs(tvb, offset2+2));
1749 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
1750 "Token bucket rate: %.10g",
1751 tvb_get_ntohieee_float(tvb, offset2+4));
1752 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
1753 "Token bucket size: %.10g",
1754 tvb_get_ntohieee_float(tvb, offset2+8));
1755 proto_tree_add_text(flowspec_tree, tvb, offset2+12, 4,
1756 "Peak data rate: %.10g",
1757 tvb_get_ntohieee_float(tvb, offset2+12));
1758 proto_tree_add_text(flowspec_tree, tvb, offset2+16, 4,
1759 "Minimum policed unit [m]: %u",
1760 tvb_get_ntohl(tvb, offset2+16));
1761 proto_tree_add_text(flowspec_tree, tvb, offset2+20, 4,
1762 "Maximum packet size [M]: %u",
1763 tvb_get_ntohl(tvb, offset2+20));
1764 proto_item_append_text(ti, "Token Bucket, %.10g bytes/sec. ",
1765 tvb_get_ntohieee_float(tvb, offset2+4));
1766 proto_item_append_text(ti2, "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u",
1767 tvb_get_ntohieee_float(tvb, offset2+4),
1768 tvb_get_ntohieee_float(tvb, offset2+8),
1769 tvb_get_ntohieee_float(tvb, offset2+12),
1770 tvb_get_ntohl(tvb, offset2+16),
1771 tvb_get_ntohl(tvb, offset2+20));
1775 /* Guaranteed-rate RSpec */
1776 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1777 offset2, param_len*4,
1778 "Guaranteed-Rate RSpec: ");
1779 flowspec_tree = proto_item_add_subtree(ti2, ett_rsvp_flowspec_subtree);
1780 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
1781 "Parameter %u - %s",
1783 val_to_str(param_id, svc_vals, "Unknown"));
1784 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
1785 "Parameter %u flags: %x",
1787 tvb_get_guint8(tvb, offset2+1));
1788 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
1789 "Parameter %u data length: %u words, "
1790 "not including header",
1792 tvb_get_ntohs(tvb, offset2+2));
1794 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
1796 tvb_get_ntohieee_float(tvb, offset2+4));
1797 proto_tree_add_text(flowspec_tree, tvb, offset2+8, 4,
1799 tvb_get_ntohl(tvb, offset2+8));
1800 proto_item_append_text(ti, "RSpec, %.10g bytes/sec. ",
1801 tvb_get_ntohieee_float(tvb, offset2+4));
1802 proto_item_append_text(ti2, "R=%.10g, s=%u",
1803 tvb_get_ntohieee_float(tvb, offset2+4),
1804 tvb_get_ntohl(tvb, offset2+8));
1808 /* Null Service (RFC2997) */
1809 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
1810 offset2, param_len*4,
1811 "Null Service Flowspec: ");
1812 flowspec_tree = proto_item_add_subtree(ti2, ett_rsvp_flowspec_subtree);
1814 proto_tree_add_text(flowspec_tree, tvb, offset2, 1,
1815 "Parameter %u - %s",
1817 val_to_str(param_id, svc_vals, "Unknown"));
1818 proto_tree_add_text(flowspec_tree, tvb, offset2+1, 1,
1819 "Parameter %u flags: %x",
1821 tvb_get_guint8(tvb, offset2+1));
1822 proto_tree_add_text(flowspec_tree, tvb, offset2+2, 2,
1823 "Parameter %u data length: %u words, "
1824 "not including header",
1826 tvb_get_ntohs(tvb, offset2+2));
1827 proto_tree_add_text(flowspec_tree, tvb, offset2+4, 4,
1828 "Maximum packet size [M]: %u",
1829 tvb_get_ntohl(tvb, offset2+4));
1830 proto_item_append_text(ti, "Null Service. M=%u",
1831 tvb_get_ntohl(tvb, offset2+4));
1832 proto_item_append_text(ti2, "Max pkt size=%u",
1833 tvb_get_ntohl(tvb, offset2+4));
1837 proto_tree_add_text(rsvp_object_tree, tvb, offset2, param_len*4,
1838 "Unknown parameter %d, %d words",
1839 param_id, param_len);
1842 param_len_processed += param_len;
1843 offset2 += param_len * 4;
1846 /* offset2 += length*4; */
1852 case RSVP_CLASS_ADSPEC : {
1853 proto_tree *adspec_tree;
1855 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_adspec);
1856 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1857 "Length: %u", obj_length);
1858 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1859 "Class number: %u - %s",
1860 class, object_type);
1861 mylen = obj_length - 4;
1863 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
1864 "Message format version: %u",
1865 tvb_get_guint8(tvb, offset2)>>4);
1866 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1867 "Data length: %u words, not including header",
1868 tvb_get_ntohs(tvb, offset2+2));
1877 service_num = tvb_get_guint8(tvb, offset2);
1878 str = val_to_str(service_num, intsrv_services_str, "Unknown");
1879 break_bit = tvb_get_guint8(tvb, offset2+1);
1880 length = tvb_get_ntohs(tvb, offset2+2);
1881 ti = proto_tree_add_text(rsvp_object_tree, tvb, offset2,
1884 adspec_tree = proto_item_add_subtree(ti,
1885 ett_rsvp_adspec_subtree);
1886 proto_tree_add_text(adspec_tree, tvb, offset2, 1,
1887 "Service header %u - %s",
1889 proto_tree_add_text(adspec_tree, tvb, offset2+1, 1,
1891 "Break bit set":"Break bit not set");
1892 proto_tree_add_text(adspec_tree, tvb, offset2+2, 2,
1893 "Data length: %u words, not including header",
1900 guint16 phdr_length;
1902 id = tvb_get_guint8(tvb, offset2);
1903 phdr_length = tvb_get_ntohs(tvb, offset2+2);
1904 str = match_strval(id, adspec_params);
1914 /* 32-bit unsigned integer */
1915 proto_tree_add_text(adspec_tree, tvb, offset2,
1917 "%s - %u (type %u, length %u)",
1919 tvb_get_ntohl(tvb, offset2+4),
1925 proto_tree_add_text(adspec_tree, tvb, offset2,
1927 "%s - %.10g (type %u, length %u)",
1929 tvb_get_ntohieee_float(tvb, offset2+4),
1933 proto_tree_add_text(adspec_tree, tvb, offset2,
1935 "%s (type %u, length %u)",
1940 proto_tree_add_text(adspec_tree, tvb, offset2,
1942 "Unknown (type %u, length %u)",
1945 offset2 += (phdr_length+1)<<2;
1946 i -= (phdr_length+1)<<2;
1947 mylen -= (phdr_length+1)<<2;
1953 case RSVP_CLASS_INTEGRITY :
1954 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_integrity);
1955 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1956 "Length: %u", obj_length);
1957 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1958 "Class number: %u - %s",
1959 class, object_type);
1962 case RSVP_CLASS_POLICY :
1963 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_policy);
1964 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1965 "Length: %u", obj_length);
1966 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1967 "Class number: %u - %s",
1968 class, object_type);
1971 case RSVP_CLASS_LABEL_REQUEST :
1972 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_label_request);
1973 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
1974 "Length: %u", obj_length);
1975 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
1976 "Class number: %u - %s",
1977 class, object_type);
1978 mylen = obj_length - 4;
1981 unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2);
1982 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1984 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
1985 "L3PID: %s (0x%04x)",
1986 val_to_str(l3pid, etype_vals, "Unknown"),
1988 proto_item_set_text(ti, "LABEL REQUEST: %s (0x%04x)",
1989 val_to_str(l3pid, etype_vals, "Unknown"),
1995 unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2);
1996 unsigned char lsp_enc = tvb_get_guint8(tvb,offset2);
1997 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
1998 "C-type: 4 (Generalized Label Request)");
1999 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2000 "LSP Encoding Type: %s",
2001 val_to_str(lsp_enc, gmpls_lsp_enc_str, "Unknown (%d)"));
2002 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
2003 "Switching Type: %s",
2004 val_to_str(tvb_get_guint8(tvb,offset2+1),
2005 gmpls_switching_type_str, "Unknown (%d)"));
2006 proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 2,
2007 "G-PID: %s (0x%0x)",
2008 val_to_str(l3pid, gmpls_gpid_str,
2009 val_to_str(l3pid, etype_vals,
2010 "Unknown G-PID(0x%04x)")),
2012 proto_item_set_text(ti, "LABEL REQUEST: Generalized: LSP Encoding=%s, "
2013 "Switching Type=%s, G-PID=%s ",
2014 val_to_str(lsp_enc, gmpls_lsp_enc_str, "Unknown (%d)"),
2015 val_to_str(tvb_get_guint8(tvb,offset2+1),
2016 gmpls_switching_type_str, "Unknown (%d)"),
2017 val_to_str(l3pid, gmpls_gpid_str,
2018 val_to_str(l3pid, etype_vals,
2019 "Unknown (0x%04x)")));
2024 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2025 "C-type: Unknown (%u)",
2027 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2028 "Data (%d bytes)", mylen);
2034 case RSVP_CLASS_UPSTREAM_LABEL :
2035 case RSVP_CLASS_SUGGESTED_LABEL :
2036 case RSVP_CLASS_LABEL : {
2038 name = (class==RSVP_CLASS_SUGGESTED_LABEL ? "SUGGESTED LABEL" :
2039 (class==RSVP_CLASS_UPSTREAM_LABEL ? "UPSTREAM LABEL" :
2041 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_label);
2042 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2043 "Length: %u", obj_length);
2044 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2045 "Class number: %u - %s",
2046 class, object_type);
2047 mylen = obj_length - 4;
2050 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2051 "C-type: 1 (Packet Label)");
2052 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2054 tvb_get_ntohl(tvb, offset2));
2055 proto_item_set_text(ti, "%s: %d", name,
2056 tvb_get_ntohl(tvb, offset2));
2061 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2062 "C-type: 2 (Generalized Label)");
2063 proto_item_set_text(ti, "%s: Generalized: ", name);
2064 for (i = 0; i < mylen; i += 4) {
2065 proto_tree_add_text(rsvp_object_tree, tvb, offset2+i, 4,
2066 "Generalized Label: %u",
2067 tvb_get_ntohl(tvb, offset2+i));
2069 proto_item_append_text(ti, "%d%s",
2070 tvb_get_ntohl(tvb, offset2+i),
2072 } else if (i == 16) {
2073 proto_item_append_text(ti, "...");
2080 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2081 "C-type: Unknown (%u)",
2083 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2084 "Data (%d bytes)", mylen);
2091 case RSVP_CLASS_SESSION_ATTRIBUTE :
2092 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_session_attribute);
2093 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2094 "Length: %u", obj_length);
2095 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2096 "Class number: %u - %s",
2097 class, object_type);
2098 mylen = obj_length - 4;
2104 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2105 "C-type: 7 - IPv4 LSP");
2106 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1,
2107 "Setup priority: %u",
2108 tvb_get_guint8(tvb, offset2));
2109 proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 1,
2110 "Hold priority: %u",
2111 tvb_get_guint8(tvb, offset2+1));
2112 flags = tvb_get_guint8(tvb, offset2+2);
2113 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2+2, 1,
2114 "Flags: 0x%02x", flags);
2115 rsvp_sa_flags_tree = proto_item_add_subtree(ti2,
2116 ett_rsvp_session_attribute_flags);
2117 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
2118 decode_boolean_bitfield(flags, 0x01, 8,
2119 "Local protection desired",
2120 "Local protection not desired"));
2121 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
2122 decode_boolean_bitfield(flags, 0x02, 8,
2123 "Merging permitted",
2124 "Merging not permitted"));
2125 proto_tree_add_text(rsvp_sa_flags_tree, tvb, offset2+2, 1,
2126 decode_boolean_bitfield(flags, 0x04, 8,
2127 "Ingress node may reroute",
2128 "Ingress node may not reroute"));
2130 name_len = tvb_get_guint8(tvb, offset2+3);
2131 proto_tree_add_text(rsvp_object_tree, tvb, offset2+3, 1,
2132 "Name length: %u", name_len);
2133 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, name_len,
2136 tvb_get_ptr(tvb, offset2+4, name_len));
2138 proto_item_set_text(ti, "SESSION ATTRIBUTE: SetupPrio %d, HoldPrio %d, %s%s%s [%s]",
2139 tvb_get_guint8(tvb, offset2),
2140 tvb_get_guint8(tvb, offset2+1),
2141 flags &0x01 ? "Local Protection, " : "",
2142 flags &0x02 ? "Merging, " : "",
2143 flags &0x04 ? "May Reroute, " : "",
2144 name_len ? (char*)tvb_format_text(tvb, offset2+4, name_len) : "");
2149 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2150 "C-type: Unknown (%u)",
2152 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2153 "Data (%d bytes)", mylen);
2159 case RSVP_CLASS_EXPLICIT_ROUTE :
2160 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_explicit_route);
2161 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2162 "Length: %u", obj_length);
2163 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2164 "Class number: %u - %s",
2165 class, object_type);
2166 mylen = obj_length - 4;
2169 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2171 proto_item_set_text(ti, "EXPLICIT ROUTE: ");
2172 for (i=1, l = 0; l < mylen; i++) {
2173 j = tvb_get_guint8(tvb, offset2+l) & 0x7f;
2176 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2177 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2179 "IPv4 Subobject - %s, %s",
2180 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)),
2181 k ? "Loose" : "Strict");
2183 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2184 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2185 k ? "Loose Hop " : "Strict Hop");
2186 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2188 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2190 tvb_get_guint8(tvb, offset2+l+1));
2191 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 4,
2193 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)));
2194 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+6, 1,
2195 "Prefix length: %u",
2196 tvb_get_guint8(tvb, offset2+l+6));
2198 proto_item_append_text(ti, "IPv4 %s%s",
2199 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)),
2206 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2210 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2211 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2212 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2213 k ? "Loose Hop " : "Strict Hop");
2214 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2216 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2218 tvb_get_guint8(tvb, offset2+l+1));
2219 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 16,
2221 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2+l+2, 16)));
2222 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+18, 1,
2223 "Prefix length: %u",
2224 tvb_get_guint8(tvb, offset2+l+6));
2226 proto_item_append_text(ti, "IPv6 [...]%s", k ? " [L]":"");
2232 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2233 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2235 "Label Subobject - %d, %s",
2236 tvb_get_ntohl(tvb, offset2+l+4),
2237 k ? "Loose" : "Strict");
2239 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2240 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2241 k ? "Loose Hop " : "Strict Hop");
2242 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2244 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2246 tvb_get_guint8(tvb, offset2+l+1));
2247 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 1,
2249 tvb_get_guint8(tvb, offset2+l+2));
2250 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+3, 1,
2252 tvb_get_guint8(tvb, offset2+l+3));
2253 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+4, 4,
2255 tvb_get_ntohl(tvb, offset2+l+4));
2257 proto_item_append_text(ti, "Label %d%s",
2258 tvb_get_ntohl(tvb, offset2+l+4),
2263 case 4: /* Unnumbered Interface-ID */
2264 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2265 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2267 "Unnumbered Interface-ID - %s, %d, %s",
2268 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)),
2269 tvb_get_ntohl(tvb, offset2+l+8),
2270 k ? "Loose" : "Strict");
2272 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2273 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2274 k ? "Loose Hop " : "Strict Hop");
2275 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2276 "Type: 4 (Unnumbered Interface-ID)");
2277 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2279 tvb_get_guint8(tvb, offset2+l+1));
2280 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+4, 4,
2282 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)));
2283 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+8, 4,
2285 tvb_get_ntohl(tvb, offset2+l+8));
2287 proto_item_append_text(ti, "Unnum %s/%d%s",
2288 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)),
2289 tvb_get_ntohl(tvb, offset2+l+8),
2296 k = tvb_get_ntohs(tvb, offset2+l+2);
2297 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2299 "Autonomous System %u",
2302 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2303 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2304 "Type: 32 (Autonomous System Number)");
2305 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2307 tvb_get_guint8(tvb, offset2+l+1));
2308 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 2,
2309 "Autonomous System %u", k);
2311 proto_item_append_text(ti, "AS %d",
2312 tvb_get_ntohs(tvb, offset2+l+2));
2317 case 64: /* Path Term */
2318 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2319 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2321 "LSP Path Termination");
2323 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2324 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2325 k ? "Loose Hop " : "Strict Hop");
2326 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2327 "Type: 64 (MPLS LSP Path Termination)");
2328 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2330 tvb_get_guint8(tvb, offset2+l+1));
2332 proto_item_append_text(ti, "Path Term");
2336 default: /* Unknown subobject */
2337 k = tvb_get_guint8(tvb, offset2+l) & 0x80;
2338 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2340 tvb_get_guint8(tvb, offset2+l+1),
2341 "Unknown subobject: %d", j);
2343 proto_item_add_subtree(ti2, ett_rsvp_explicit_route_subobj);
2344 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2345 k ? "Loose Hop " : "Strict Hop");
2346 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2347 "Type: %u (Unknown)", j);
2348 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2350 tvb_get_guint8(tvb, offset2+l+1));
2354 l += tvb_get_guint8(tvb, offset2+l+1);
2357 proto_item_append_text(ti, ", ");
2359 proto_item_append_text(ti, "...");
2365 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2366 "C-type: Unknown (%u)",
2368 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2369 "Data (%d bytes)", mylen);
2376 case RSVP_CLASS_RECORD_ROUTE :
2377 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_record_route);
2378 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2379 "Length: %u", obj_length);
2380 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2381 "Class number: %u - %s",
2382 class, object_type);
2383 proto_item_set_text(ti, "RECORD ROUTE: ");
2384 mylen = obj_length - 4;
2387 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2389 for (i=1, l = 0; l < mylen; i++) {
2390 j = tvb_get_guint8(tvb, offset2+l);
2393 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2395 "IPv4 Subobject - %s",
2396 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)));
2398 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2399 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2401 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2403 tvb_get_guint8(tvb, offset2+l+1));
2404 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 4,
2406 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)));
2407 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+6, 1,
2408 "Prefix length: %u",
2409 tvb_get_guint8(tvb, offset2+l+6));
2411 proto_item_append_text(ti, "IPv4 %s",
2412 ip_to_str(tvb_get_ptr(tvb, offset2+l+2, 4)));
2418 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2422 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2423 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2425 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2427 tvb_get_guint8(tvb, offset2+l+1));
2428 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 16,
2430 ip6_to_str((struct e_in6_addr *)tvb_get_ptr(tvb, offset2+l+2, 16)));
2431 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+18, 1,
2432 "Prefix length: %u",
2433 tvb_get_guint8(tvb, offset2+l+6));
2435 proto_item_append_text(ti, "IPv6 [...]");
2440 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2442 "Label Subobject - %d",
2443 tvb_get_ntohl(tvb, offset2+l+4));
2445 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2446 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2448 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2450 tvb_get_guint8(tvb, offset2+l+1));
2451 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+2, 1,
2453 tvb_get_guint8(tvb, offset2+l+2));
2454 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+3, 1,
2456 tvb_get_guint8(tvb, offset2+l+3));
2457 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+4, 4,
2459 tvb_get_ntohl(tvb, offset2+l+4));
2461 proto_item_append_text(ti, "Label %d",
2462 tvb_get_ntohl(tvb, offset2+l+4));
2466 case 4: /* Unnumbered Interface-ID */
2467 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2469 "Unnumbered Interface-ID - %s, %d",
2470 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)),
2471 tvb_get_ntohl(tvb, offset2+l+8));
2473 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2474 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2475 "Type: 4 (Unnumbered Interface-ID)");
2476 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2478 tvb_get_guint8(tvb, offset2+l+1));
2479 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2481 tvb_get_guint8(tvb, offset2+l+2));
2482 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+4, 4,
2484 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)));
2485 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+8, 4,
2487 tvb_get_ntohl(tvb, offset2+l+8));
2489 proto_item_append_text(ti, "Unnum %s/%d",
2490 ip_to_str(tvb_get_ptr(tvb, offset2+l+4, 4)),
2491 tvb_get_ntohl(tvb, offset2+l+8));
2495 default: /* Unknown subobject */
2496 ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
2498 tvb_get_guint8(tvb, offset2+l+1),
2499 "Unknown subobject: %u",
2502 proto_item_add_subtree(ti2, ett_rsvp_record_route_subobj);
2503 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l, 1,
2504 "Type: %u (Unknown)", j);
2505 proto_tree_add_text(rsvp_ero_subtree, tvb, offset2+l+1, 1,
2507 tvb_get_guint8(tvb, offset2+l+1));
2511 l += tvb_get_guint8(tvb, offset2+l+1);
2514 proto_item_append_text(ti, ", ");
2516 proto_item_append_text(ti, "...");
2523 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2524 "C-type: Unknown (%u)",
2526 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2527 "Data (%d bytes)", mylen);
2533 case RSVP_CLASS_MESSAGE_ID :
2534 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_policy);
2535 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2536 "Length: %u", obj_length);
2537 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2538 "Class number: %u - %s",
2539 class, object_type);
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: %d %s",
2551 tvb_get_ntohl(tvb, offset+8),
2552 tvb_get_guint8(tvb, offset+4) & 1 ? "(Ack Desired)" : "");
2556 mylen = obj_length - 4;
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, mylen,
2561 "Data (%d bytes)", mylen);
2566 case RSVP_CLASS_MESSAGE_ID_ACK :
2567 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_policy);
2568 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2569 "Length: %u", obj_length);
2570 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2571 "Class number: %u - %s",
2572 class, object_type);
2575 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2577 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
2578 "Flags: %d", tvb_get_guint8(tvb, offset+4));
2579 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
2580 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
2581 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
2582 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
2583 proto_item_set_text(ti, "MESSAGE-ID ACK: %d", tvb_get_ntohl(tvb, offset+8));
2587 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2589 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
2590 "Flags: %d", tvb_get_guint8(tvb, offset+4));
2591 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
2592 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
2593 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
2594 "Message-ID: %d", tvb_get_ntohl(tvb, offset+8));
2595 proto_item_set_text(ti, "MESSAGE-ID NACK: %d", tvb_get_ntohl(tvb, offset+8));
2599 mylen = obj_length - 4;
2600 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2601 "C-type: Unknown (%u)",
2603 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2604 "Data (%d bytes)", mylen);
2609 case RSVP_CLASS_MESSAGE_ID_LIST :
2610 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_policy);
2611 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2612 "Length: %u", obj_length);
2613 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2614 "Class number: %u - %s",
2615 class, object_type);
2618 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2620 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 1,
2621 "Flags: %d", tvb_get_guint8(tvb, offset+4));
2622 proto_tree_add_text(rsvp_object_tree, tvb, offset+5, 3,
2623 "Epoch: %d", tvb_get_ntoh24(tvb, offset+5));
2624 for (mylen = 8; mylen < obj_length; mylen += 4)
2625 proto_tree_add_text(rsvp_object_tree, tvb, offset+mylen, 4,
2626 "Message-ID: %d", tvb_get_ntohl(tvb, offset+mylen));
2627 proto_item_set_text(ti, "MESSAGE-ID LIST: %d IDs",
2628 (obj_length - 8)/4);
2632 mylen = obj_length - 4;
2633 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2634 "C-type: Unknown (%u)",
2636 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2637 "Data (%d bytes)", mylen);
2642 case RSVP_CLASS_HELLO:
2643 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_hello_obj);
2644 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2645 "Length: %u", obj_length);
2646 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2647 "Class number: %u - %s",
2648 class, object_type);
2651 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2652 "C-Type: 1 - HELLO REQUEST object");
2655 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2656 "C-Type: 2 - HELLO ACK object");
2660 proto_tree_add_text(rsvp_object_tree, tvb, offset+4, 4,
2661 "Source Instance: 0x%x",tvb_get_ntohl(tvb, offset+4));
2663 proto_tree_add_text(rsvp_object_tree, tvb, offset+8, 4,
2664 "Destination Instance: 0x%x",tvb_get_ntohl(tvb, offset+8));
2668 case RSVP_CLASS_DCLASS:
2669 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_dclass);
2670 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2671 "Length: %u", obj_length);
2672 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2673 "Class number: %u - %s",
2674 class, object_type);
2675 proto_item_set_text(ti, "DCLASS: ");
2678 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2680 for (mylen = 4; mylen < obj_length; mylen += 4) {
2681 proto_tree_add_text(rsvp_object_tree, tvb, offset+mylen+3, 1,
2683 val_to_str(tvb_get_guint8(tvb, offset+mylen+3),
2684 dscp_vals, "Unknown (%d)"));
2685 proto_item_append_text(ti, "%d%s",
2686 tvb_get_guint8(tvb, offset+mylen+3)>>2,
2687 mylen==obj_length-4 ? "" :
2689 mylen==16 ? ", ..." : "");
2694 mylen = obj_length - 4;
2695 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2696 "C-type: Unknown (%u)",
2698 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2699 "Data (%d bytes)", mylen);
2704 case RSVP_CLASS_ADMIN_STATUS: {
2706 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_admin_status);
2707 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2708 "Length: %u", obj_length);
2709 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2710 "Class number: %u - %s",
2711 class, object_type);
2712 proto_item_set_text(ti, "ADMIN STATUS: ");
2715 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2717 status = tvb_get_ntohl(tvb, offset2);
2718 ti2 = proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2719 "Admin Status: 0x%08x", status);
2720 rsvp_admin_subtree =
2721 proto_item_add_subtree(ti2, ett_rsvp_admin_status_flags);
2722 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2, 1,
2723 (status & (1<<31)) ?
2725 "R: 0. Do not reflect");
2726 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2+3, 1,
2730 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2+3, 1,
2732 "A: 1. Administratively down" :
2734 proto_tree_add_text(rsvp_admin_subtree, tvb, offset2+3, 1,
2736 "D: 1. Deletion in progress" :
2738 proto_item_set_text(ti, "ADMIN-STATUS: %s %s %s %s",
2739 (status & (1<<31)) ? "Reflect" : "",
2740 (status & (1<<2)) ? "Testing" : "",
2741 (status & (1<<1)) ? "Admin-Down" : "",
2742 (status & (1<<0)) ? "Deleting" : "");
2746 mylen = obj_length - 4;
2747 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2748 "C-type: Unknown (%u)",
2750 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2751 "Data (%d bytes)", mylen);
2757 case RSVP_CLASS_LSP_TUNNEL_IF_ID:
2758 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_lsp_tunnel_if_id);
2759 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2760 "Length: %u", obj_length);
2761 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2762 "Class number: %u - %s",
2763 class, object_type);
2764 proto_item_set_text(ti, "LSP INTERFACE-ID: ");
2767 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2768 "C-type: 1 - IPv4");
2769 proto_tree_add_text(rsvp_object_tree, tvb, offset2, 4,
2771 ip_to_str(tvb_get_ptr(tvb, offset2, 4)));
2772 proto_tree_add_text(rsvp_object_tree, tvb, offset2+4, 4,
2773 "Interface ID: %u", tvb_get_ntohl(tvb, offset2+4));
2774 proto_item_set_text(ti, "LSP INTERFACE-ID: IPv4, Router-ID %s, Interface-ID %d",
2775 ip_to_str(tvb_get_ptr(tvb, offset2, 4)),
2776 tvb_get_ntohl(tvb, offset2+4));
2780 mylen = obj_length - 4;
2781 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
2782 "C-type: Unknown (%u)",
2784 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2785 "Data (%d bytes)", mylen);
2791 rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_unknown_class);
2792 proto_tree_add_text(rsvp_object_tree, tvb, offset, 2,
2793 "Length: %u", obj_length);
2794 proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
2795 "Class number: %u - %s",
2796 class, object_type);
2798 mylen = obj_length - 4;
2799 proto_tree_add_text(rsvp_object_tree, tvb, offset2, mylen,
2800 "Data (%d bytes)", mylen);
2803 case RSVP_CLASS_NULL :
2808 offset += obj_length;
2815 proto_register_rsvp(void)
2817 static gint *ett[] = {
2822 &ett_rsvp_hop_subobj,
2823 &ett_rsvp_time_values,
2828 &ett_rsvp_sender_template,
2829 &ett_rsvp_filter_spec,
2830 &ett_rsvp_sender_tspec,
2831 &ett_rsvp_sender_tspec_subtree,
2833 &ett_rsvp_flowspec_subtree,
2835 &ett_rsvp_adspec_subtree,
2836 &ett_rsvp_integrity,
2839 &ett_rsvp_label_request,
2840 &ett_rsvp_session_attribute,
2841 &ett_rsvp_session_attribute_flags,
2842 &ett_rsvp_explicit_route,
2843 &ett_rsvp_explicit_route_subobj,
2844 &ett_rsvp_record_route,
2845 &ett_rsvp_record_route_subobj,
2846 &ett_rsvp_hello_obj,
2848 &ett_rsvp_lsp_tunnel_if_id,
2849 &ett_rsvp_admin_status,
2850 &ett_rsvp_admin_status_flags,
2851 &ett_rsvp_unknown_class,
2854 proto_rsvp = proto_register_protocol("Resource ReserVation Protocol (RSVP)",
2856 proto_register_field_array(proto_rsvp, rsvpf_info, array_length(rsvpf_info));
2857 proto_register_subtree_array(ett, array_length(ett));
2861 proto_reg_handoff_rsvp(void)
2863 dissector_handle_t rsvp_handle;
2865 rsvp_handle = create_dissector_handle(dissect_rsvp, proto_rsvp);
2866 dissector_add("ip.proto", IP_PROTO_RSVP, rsvp_handle);