2 * Copyright (c) 1998-2007 The TCPDUMP project
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that: (1) source code
6 * distributions retain the above copyright notice and this paragraph
7 * in its entirety, and (2) distributions including binary code include
8 * the above copyright notice and this paragraph in its entirety in
9 * the documentation or other materials provided with the distribution.
10 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
11 * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
12 * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
13 * FOR A PARTICULAR PURPOSE.
15 * Original code by Hannes Gredler (hannes@gredler.at)
18 /* \summary: Resource ReSerVation Protocol (RSVP) printer */
20 /* specification: RFC 2205 */
24 #include "netdissect-stdinc.h"
26 #define ND_LONGJMP_FROM_TCHECK
27 #include "netdissect.h"
29 #include "addrtoname.h"
30 #include "ethertype.h"
33 #include "signature.h"
37 * RFC 2205 common header
40 * +-------------+-------------+-------------+-------------+
41 * | Vers | Flags| Msg Type | RSVP Checksum |
42 * +-------------+-------------+-------------+-------------+
43 * | Send_TTL | (Reserved) | RSVP Length |
44 * +-------------+-------------+-------------+-------------+
48 struct rsvp_common_header
{
49 nd_uint8_t version_flags
;
58 * RFC2205 object header
62 * +-------------+-------------+-------------+-------------+
63 * | Length (bytes) | Class-Num | C-Type |
64 * +-------------+-------------+-------------+-------------+
66 * // (Object contents) //
68 * +-------------+-------------+-------------+-------------+
71 struct rsvp_object_header
{
77 #define RSVP_VERSION 1
78 #define RSVP_EXTRACT_VERSION(x) (((x)&0xf0)>>4)
79 #define RSVP_EXTRACT_FLAGS(x) ((x)&0x0f)
81 #define RSVP_MSGTYPE_PATH 1
82 #define RSVP_MSGTYPE_RESV 2
83 #define RSVP_MSGTYPE_PATHERR 3
84 #define RSVP_MSGTYPE_RESVERR 4
85 #define RSVP_MSGTYPE_PATHTEAR 5
86 #define RSVP_MSGTYPE_RESVTEAR 6
87 #define RSVP_MSGTYPE_RESVCONF 7
88 #define RSVP_MSGTYPE_BUNDLE 12
89 #define RSVP_MSGTYPE_ACK 13
90 #define RSVP_MSGTYPE_HELLO_OLD 14 /* ancient Hellos */
91 #define RSVP_MSGTYPE_SREFRESH 15
92 #define RSVP_MSGTYPE_HELLO 20
94 static const struct tok rsvp_msg_type_values
[] = {
95 { RSVP_MSGTYPE_PATH
, "Path" },
96 { RSVP_MSGTYPE_RESV
, "Resv" },
97 { RSVP_MSGTYPE_PATHERR
, "PathErr" },
98 { RSVP_MSGTYPE_RESVERR
, "ResvErr" },
99 { RSVP_MSGTYPE_PATHTEAR
, "PathTear" },
100 { RSVP_MSGTYPE_RESVTEAR
, "ResvTear" },
101 { RSVP_MSGTYPE_RESVCONF
, "ResvConf" },
102 { RSVP_MSGTYPE_BUNDLE
, "Bundle" },
103 { RSVP_MSGTYPE_ACK
, "Acknowledgement" },
104 { RSVP_MSGTYPE_HELLO_OLD
, "Hello (Old)" },
105 { RSVP_MSGTYPE_SREFRESH
, "Refresh" },
106 { RSVP_MSGTYPE_HELLO
, "Hello" },
110 static const struct tok rsvp_header_flag_values
[] = {
111 { 0x01, "Refresh reduction capable" }, /* rfc2961 */
115 static const struct tok rsvp_obj_capability_flag_values
[] = {
116 { 0x0004, "RecoveryPath Transmit Enabled" },
117 { 0x0002, "RecoveryPath Desired" },
118 { 0x0001, "RecoveryPath Srefresh Capable" },
122 #define RSVP_OBJ_SESSION 1 /* rfc2205 */
123 #define RSVP_OBJ_RSVP_HOP 3 /* rfc2205, rfc3473 */
124 #define RSVP_OBJ_INTEGRITY 4 /* rfc2747 */
125 #define RSVP_OBJ_TIME_VALUES 5 /* rfc2205 */
126 #define RSVP_OBJ_ERROR_SPEC 6
127 #define RSVP_OBJ_SCOPE 7
128 #define RSVP_OBJ_STYLE 8 /* rfc2205 */
129 #define RSVP_OBJ_FLOWSPEC 9 /* rfc2215 */
130 #define RSVP_OBJ_FILTERSPEC 10 /* rfc2215 */
131 #define RSVP_OBJ_SENDER_TEMPLATE 11
132 #define RSVP_OBJ_SENDER_TSPEC 12 /* rfc2215 */
133 #define RSVP_OBJ_ADSPEC 13 /* rfc2215 */
134 #define RSVP_OBJ_POLICY_DATA 14
135 #define RSVP_OBJ_CONFIRM 15 /* rfc2205 */
136 #define RSVP_OBJ_LABEL 16 /* rfc3209 */
137 #define RSVP_OBJ_LABEL_REQ 19 /* rfc3209 */
138 #define RSVP_OBJ_ERO 20 /* rfc3209 */
139 #define RSVP_OBJ_RRO 21 /* rfc3209 */
140 #define RSVP_OBJ_HELLO 22 /* rfc3209 */
141 #define RSVP_OBJ_MESSAGE_ID 23 /* rfc2961 */
142 #define RSVP_OBJ_MESSAGE_ID_ACK 24 /* rfc2961 */
143 #define RSVP_OBJ_MESSAGE_ID_LIST 25 /* rfc2961 */
144 #define RSVP_OBJ_RECOVERY_LABEL 34 /* rfc3473 */
145 #define RSVP_OBJ_UPSTREAM_LABEL 35 /* rfc3473 */
146 #define RSVP_OBJ_LABEL_SET 36 /* rfc3473 */
147 #define RSVP_OBJ_PROTECTION 37 /* rfc3473 */
148 #define RSVP_OBJ_S2L 50 /* rfc4875 */
149 #define RSVP_OBJ_DETOUR 63 /* rfc4090 */
150 #define RSVP_OBJ_CLASSTYPE 66 /* rfc4124 */
151 #define RSVP_OBJ_CLASSTYPE_OLD 125 /* draft-ietf-tewg-diff-te-proto-07 */
152 #define RSVP_OBJ_SUGGESTED_LABEL 129 /* rfc3473 */
153 #define RSVP_OBJ_ACCEPT_LABEL_SET 130 /* rfc3473 */
154 #define RSVP_OBJ_RESTART_CAPABILITY 131 /* rfc3473 */
155 #define RSVP_OBJ_CAPABILITY 134 /* rfc5063 */
156 #define RSVP_OBJ_NOTIFY_REQ 195 /* rfc3473 */
157 #define RSVP_OBJ_ADMIN_STATUS 196 /* rfc3473 */
158 #define RSVP_OBJ_PROPERTIES 204 /* juniper proprietary */
159 #define RSVP_OBJ_FASTREROUTE 205 /* rfc4090 */
160 #define RSVP_OBJ_SESSION_ATTRIBUTE 207 /* rfc3209 */
161 #define RSVP_OBJ_GENERALIZED_UNI 229 /* OIF RSVP extensions UNI 1.0 Signaling, Rel. 2 */
162 #define RSVP_OBJ_CALL_ID 230 /* rfc3474 */
163 #define RSVP_OBJ_CALL_OPS 236 /* rfc3474 */
165 static const struct tok rsvp_obj_values
[] = {
166 { RSVP_OBJ_SESSION
, "Session" },
167 { RSVP_OBJ_RSVP_HOP
, "RSVP Hop" },
168 { RSVP_OBJ_INTEGRITY
, "Integrity" },
169 { RSVP_OBJ_TIME_VALUES
, "Time Values" },
170 { RSVP_OBJ_ERROR_SPEC
, "Error Spec" },
171 { RSVP_OBJ_SCOPE
, "Scope" },
172 { RSVP_OBJ_STYLE
, "Style" },
173 { RSVP_OBJ_FLOWSPEC
, "Flowspec" },
174 { RSVP_OBJ_FILTERSPEC
, "FilterSpec" },
175 { RSVP_OBJ_SENDER_TEMPLATE
, "Sender Template" },
176 { RSVP_OBJ_SENDER_TSPEC
, "Sender TSpec" },
177 { RSVP_OBJ_ADSPEC
, "Adspec" },
178 { RSVP_OBJ_POLICY_DATA
, "Policy Data" },
179 { RSVP_OBJ_CONFIRM
, "Confirm" },
180 { RSVP_OBJ_LABEL
, "Label" },
181 { RSVP_OBJ_LABEL_REQ
, "Label Request" },
182 { RSVP_OBJ_ERO
, "ERO" },
183 { RSVP_OBJ_RRO
, "RRO" },
184 { RSVP_OBJ_HELLO
, "Hello" },
185 { RSVP_OBJ_MESSAGE_ID
, "Message ID" },
186 { RSVP_OBJ_MESSAGE_ID_ACK
, "Message ID Ack" },
187 { RSVP_OBJ_MESSAGE_ID_LIST
, "Message ID List" },
188 { RSVP_OBJ_RECOVERY_LABEL
, "Recovery Label" },
189 { RSVP_OBJ_UPSTREAM_LABEL
, "Upstream Label" },
190 { RSVP_OBJ_LABEL_SET
, "Label Set" },
191 { RSVP_OBJ_ACCEPT_LABEL_SET
, "Acceptable Label Set" },
192 { RSVP_OBJ_DETOUR
, "Detour" },
193 { RSVP_OBJ_CLASSTYPE
, "Class Type" },
194 { RSVP_OBJ_CLASSTYPE_OLD
, "Class Type (old)" },
195 { RSVP_OBJ_SUGGESTED_LABEL
, "Suggested Label" },
196 { RSVP_OBJ_PROPERTIES
, "Properties" },
197 { RSVP_OBJ_FASTREROUTE
, "Fast Re-Route" },
198 { RSVP_OBJ_SESSION_ATTRIBUTE
, "Session Attribute" },
199 { RSVP_OBJ_GENERALIZED_UNI
, "Generalized UNI" },
200 { RSVP_OBJ_CALL_ID
, "Call-ID" },
201 { RSVP_OBJ_CALL_OPS
, "Call Capability" },
202 { RSVP_OBJ_RESTART_CAPABILITY
, "Restart Capability" },
203 { RSVP_OBJ_CAPABILITY
, "Capability" },
204 { RSVP_OBJ_NOTIFY_REQ
, "Notify Request" },
205 { RSVP_OBJ_PROTECTION
, "Protection" },
206 { RSVP_OBJ_ADMIN_STATUS
, "Administrative Status" },
207 { RSVP_OBJ_S2L
, "Sub-LSP to LSP" },
211 #define RSVP_CTYPE_IPV4 1
212 #define RSVP_CTYPE_IPV6 2
213 #define RSVP_CTYPE_TUNNEL_IPV4 7
214 #define RSVP_CTYPE_TUNNEL_IPV6 8
215 #define RSVP_CTYPE_UNI_IPV4 11 /* OIF RSVP extensions UNI 1.0 Signaling Rel. 2 */
216 #define RSVP_CTYPE_1 1
217 #define RSVP_CTYPE_2 2
218 #define RSVP_CTYPE_3 3
219 #define RSVP_CTYPE_4 4
220 #define RSVP_CTYPE_12 12
221 #define RSVP_CTYPE_13 13
222 #define RSVP_CTYPE_14 14
225 * the ctypes are not globally unique so for
226 * translating it to strings we build a table based
227 * on objects offsetted by the ctype
230 static const struct tok rsvp_ctype_values
[] = {
231 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV4
, "IPv4" },
232 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV6
, "IPv6" },
233 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
234 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
235 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV4
, "IPv4" },
236 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV6
, "IPv6" },
237 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV4
, "IPv4" },
238 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV6
, "IPv6" },
239 { 256*RSVP_OBJ_TIME_VALUES
+RSVP_CTYPE_1
, "1" },
240 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_1
, "obsolete" },
241 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_2
, "IntServ" },
242 { 256*RSVP_OBJ_SENDER_TSPEC
+RSVP_CTYPE_2
, "IntServ" },
243 { 256*RSVP_OBJ_ADSPEC
+RSVP_CTYPE_2
, "IntServ" },
244 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
245 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
246 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_3
, "IPv6 Flow-label" },
247 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
248 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
249 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
250 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV4
, "IPv4" },
251 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV6
, "IPv6" },
252 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
253 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_UNI_IPV4
, "UNI IPv4" },
254 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_13
, "IPv4 P2MP LSP Tunnel" },
255 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_14
, "IPv6 P2MP LSP Tunnel" },
256 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV4
, "IPv4" },
257 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV6
, "IPv6" },
258 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
259 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
260 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
261 { 256*RSVP_OBJ_MESSAGE_ID
+RSVP_CTYPE_1
, "1" },
262 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_1
, "Message id ack" },
263 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_2
, "Message id nack" },
264 { 256*RSVP_OBJ_MESSAGE_ID_LIST
+RSVP_CTYPE_1
, "1" },
265 { 256*RSVP_OBJ_STYLE
+RSVP_CTYPE_1
, "1" },
266 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_1
, "Hello Request" },
267 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_2
, "Hello Ack" },
268 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_1
, "without label range" },
269 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_2
, "with ATM label range" },
270 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_3
, "with FR label range" },
271 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_4
, "Generalized Label" },
272 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_1
, "Label" },
273 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
274 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
275 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_1
, "Label" },
276 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
277 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
278 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_1
, "Label" },
279 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
280 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
281 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_1
, "Label" },
282 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
283 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
284 { 256*RSVP_OBJ_ERO
+RSVP_CTYPE_IPV4
, "IPv4" },
285 { 256*RSVP_OBJ_RRO
+RSVP_CTYPE_IPV4
, "IPv4" },
286 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
287 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
288 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
289 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
290 { 256*RSVP_OBJ_RESTART_CAPABILITY
+RSVP_CTYPE_1
, "IPv4" },
291 { 256*RSVP_OBJ_CAPABILITY
+RSVP_CTYPE_1
, "1" },
292 { 256*RSVP_OBJ_SESSION_ATTRIBUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
293 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" }, /* old style*/
294 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_1
, "1" }, /* new style */
295 { 256*RSVP_OBJ_DETOUR
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
296 { 256*RSVP_OBJ_PROPERTIES
+RSVP_CTYPE_1
, "1" },
297 { 256*RSVP_OBJ_ADMIN_STATUS
+RSVP_CTYPE_1
, "1" },
298 { 256*RSVP_OBJ_CLASSTYPE
+RSVP_CTYPE_1
, "1" },
299 { 256*RSVP_OBJ_CLASSTYPE_OLD
+RSVP_CTYPE_1
, "1" },
300 { 256*RSVP_OBJ_LABEL_SET
+RSVP_CTYPE_1
, "1" },
301 { 256*RSVP_OBJ_GENERALIZED_UNI
+RSVP_CTYPE_1
, "1" },
302 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV4
, "IPv4 sub-LSP" },
303 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV6
, "IPv6 sub-LSP" },
308 * XXX - this assumes a 16-byte digest, which is true for HMAC-MD5, but
309 * isn't necessarily the case for other hash algorithms.
311 * Unless I've missed something, there's nothing in RFC 2747 to indicate
312 * the hash algorithm being used, so it's presumably something set up
313 * out-of-band, or negotiated by other RSVP objects.
315 struct rsvp_obj_integrity_t
{
323 static const struct tok rsvp_obj_integrity_flag_values
[] = {
324 { 0x80, "Handshake" },
328 struct rsvp_obj_frr_t
{
329 nd_uint8_t setup_prio
;
330 nd_uint8_t hold_prio
;
331 nd_uint8_t hop_limit
;
334 nd_uint32_t include_any
;
335 nd_uint32_t exclude_any
;
336 nd_uint32_t include_all
;
340 #define RSVP_OBJ_XRO_MASK_SUBOBJ(x) ((x)&0x7f)
341 #define RSVP_OBJ_XRO_MASK_LOOSE(x) ((x)&0x80)
343 #define RSVP_OBJ_CAPABILITY_FLAGS_MASK 0x7U
345 #define RSVP_OBJ_XRO_RES 0
346 #define RSVP_OBJ_XRO_IPV4 1
347 #define RSVP_OBJ_XRO_IPV6 2
348 #define RSVP_OBJ_XRO_LABEL 3
349 #define RSVP_OBJ_XRO_ASN 32
350 #define RSVP_OBJ_XRO_MPLS 64
352 static const struct tok rsvp_obj_xro_values
[] = {
353 { RSVP_OBJ_XRO_RES
, "Reserved" },
354 { RSVP_OBJ_XRO_IPV4
, "IPv4 prefix" },
355 { RSVP_OBJ_XRO_IPV6
, "IPv6 prefix" },
356 { RSVP_OBJ_XRO_LABEL
, "Label" },
357 { RSVP_OBJ_XRO_ASN
, "Autonomous system number" },
358 { RSVP_OBJ_XRO_MPLS
, "MPLS label switched path termination" },
363 static const struct tok rsvp_obj_rro_flag_values
[] = {
364 { 0x01, "Local protection available" },
365 { 0x02, "Local protection in use" },
366 { 0x04, "Bandwidth protection" },
367 { 0x08, "Node protection" },
372 static const struct tok rsvp_obj_rro_label_flag_values
[] = {
377 static const struct tok rsvp_resstyle_values
[] = {
378 { 17, "Wildcard Filter" },
379 { 10, "Fixed Filter" },
380 { 18, "Shared Explicit" },
384 #define RSVP_OBJ_INTSERV_GUARANTEED_SERV 2
385 #define RSVP_OBJ_INTSERV_CONTROLLED_LOAD 5
387 static const struct tok rsvp_intserv_service_type_values
[] = {
388 { 1, "Default/Global Information" },
389 { RSVP_OBJ_INTSERV_GUARANTEED_SERV
, "Guaranteed Service" },
390 { RSVP_OBJ_INTSERV_CONTROLLED_LOAD
, "Controlled Load" },
394 static const struct tok rsvp_intserv_parameter_id_values
[] = {
396 { 6, "Path b/w estimate" },
397 { 8, "Minimum path latency" },
398 { 10, "Composed MTU" },
399 { 127, "Token Bucket TSpec" },
400 { 130, "Guaranteed Service RSpec" },
401 { 133, "End-to-end composed value for C" },
402 { 134, "End-to-end composed value for D" },
403 { 135, "Since-last-reshaping point composed C" },
404 { 136, "Since-last-reshaping point composed D" },
408 static const struct tok rsvp_session_attribute_flag_values
[] = {
409 { 0x01, "Local Protection" },
410 { 0x02, "Label Recording" },
411 { 0x04, "SE Style" },
412 { 0x08, "Bandwidth protection" }, /* RFC4090 */
413 { 0x10, "Node protection" }, /* RFC4090 */
417 static const struct tok rsvp_obj_prop_tlv_values
[] = {
419 { 0x02, "Metric 1" },
420 { 0x04, "Metric 2" },
421 { 0x08, "CCC Status" },
422 { 0x10, "Path Type" },
426 #define RSVP_OBJ_ERROR_SPEC_CODE_ROUTING 24
427 #define RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY 25
428 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE 28
429 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD 125
431 static const struct tok rsvp_obj_error_code_values
[] = {
432 { RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
, "Routing Problem" },
433 { RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY
, "Notify Error" },
434 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
, "Diffserv TE Error" },
435 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
, "Diffserv TE Error (Old)" },
439 static const struct tok rsvp_obj_error_code_routing_values
[] = {
440 { 1, "Bad EXPLICIT_ROUTE object" },
441 { 2, "Bad strict node" },
442 { 3, "Bad loose node" },
443 { 4, "Bad initial subobject" },
444 { 5, "No route available toward destination" },
445 { 6, "Unacceptable label value" },
446 { 7, "RRO indicated routing loops" },
447 { 8, "non-RSVP-capable router in the path" },
448 { 9, "MPLS label allocation failure" },
449 { 10, "Unsupported L3PID" },
453 static const struct tok rsvp_obj_error_code_diffserv_te_values
[] = {
454 { 1, "Unexpected CT object" },
455 { 2, "Unsupported CT" },
456 { 3, "Invalid CT value" },
457 { 4, "CT/setup priority do not form a configured TE-Class" },
458 { 5, "CT/holding priority do not form a configured TE-Class" },
459 { 6, "CT/setup priority and CT/holding priority do not form a configured TE-Class" },
460 { 7, "Inconsistency between signaled PSC and signaled CT" },
461 { 8, "Inconsistency between signaled PHBs and signaled CT" },
465 /* rfc3473 / rfc 3471 */
466 static const struct tok rsvp_obj_admin_status_flag_values
[] = {
467 { 0x80000000, "Reflect" },
468 { 0x00000004, "Testing" },
469 { 0x00000002, "Admin-down" },
470 { 0x00000001, "Delete-in-progress" },
474 /* label set actions - rfc3471 */
475 #define LABEL_SET_INCLUSIVE_LIST 0
476 #define LABEL_SET_EXCLUSIVE_LIST 1
477 #define LABEL_SET_INCLUSIVE_RANGE 2
478 #define LABEL_SET_EXCLUSIVE_RANGE 3
480 static const struct tok rsvp_obj_label_set_action_values
[] = {
481 { LABEL_SET_INCLUSIVE_LIST
, "Inclusive list" },
482 { LABEL_SET_EXCLUSIVE_LIST
, "Exclusive list" },
483 { LABEL_SET_INCLUSIVE_RANGE
, "Inclusive range" },
484 { LABEL_SET_EXCLUSIVE_RANGE
, "Exclusive range" },
488 /* OIF RSVP extensions UNI 1.0 Signaling, release 2 */
489 #define RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS 1
490 #define RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS 2
491 #define RSVP_GEN_UNI_SUBOBJ_DIVERSITY 3
492 #define RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL 4
493 #define RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL 5
495 static const struct tok rsvp_obj_generalized_uni_values
[] = {
496 { RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
, "Source TNA address" },
497 { RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
, "Destination TNA address" },
498 { RSVP_GEN_UNI_SUBOBJ_DIVERSITY
, "Diversity" },
499 { RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
, "Egress label" },
500 { RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
, "Service level" },
505 * this is a dissector for all the intserv defined
506 * specs as defined per rfc2215
507 * it is called from various rsvp objects;
508 * returns the amount of bytes being processed
511 rsvp_intserv_print(netdissect_options
*ndo
,
512 const u_char
*tptr
, u_int obj_tlen
)
514 u_int parameter_id
,parameter_length
;
516 ND_ICHECK_U(obj_tlen
, <, 4);
517 parameter_id
= GET_U_1(tptr
);
518 parameter_length
= GET_BE_U_2(tptr
+ 2)<<2; /* convert wordcount to bytecount */
520 ND_PRINT("\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
521 tok2str(rsvp_intserv_parameter_id_values
,"unknown",parameter_id
),
526 ND_ICHECK_U(obj_tlen
, <, parameter_length
+ 4);
527 switch(parameter_id
) { /* parameter_id */
531 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
532 * | 4 (e) | (f) | 1 (g) |
533 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
534 * | IS hop cnt (32-bit unsigned integer) |
535 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
537 if (parameter_length
== 4) {
538 ND_PRINT("\n\t\tIS hop count: %u", GET_BE_U_4(tptr
+ 4));
544 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
545 * | 6 (h) | (i) | 1 (j) |
546 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
547 * | Path b/w estimate (32-bit IEEE floating point number) |
548 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
550 if (parameter_length
== 4) {
551 ND_PRINT("\n\t\tPath b/w estimate: %.10g Mbps",
552 GET_BE_F_4(tptr
+ 4) / 125000);
558 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
559 * | 8 (k) | (l) | 1 (m) |
560 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
561 * | Minimum path latency (32-bit integer) |
562 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
564 if (parameter_length
== 4) {
565 ND_PRINT("\n\t\tMinimum path latency: ");
566 if (GET_BE_U_4(tptr
+ 4) == 0xffffffff)
567 ND_PRINT("don't care");
569 ND_PRINT("%u", GET_BE_U_4(tptr
+ 4));
576 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
577 * | 10 (n) | (o) | 1 (p) |
578 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
579 * | Composed MTU (32-bit unsigned integer) |
580 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
582 if (parameter_length
== 4) {
583 ND_PRINT("\n\t\tComposed MTU: %u bytes", GET_BE_U_4(tptr
+ 4));
588 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
589 * | 127 (e) | 0 (f) | 5 (g) |
590 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
591 * | Token Bucket Rate [r] (32-bit IEEE floating point number) |
592 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
593 * | Token Bucket Size [b] (32-bit IEEE floating point number) |
594 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
595 * | Peak Data Rate [p] (32-bit IEEE floating point number) |
596 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
597 * | Minimum Policed Unit [m] (32-bit integer) |
598 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
599 * | Maximum Packet Size [M] (32-bit integer) |
600 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
603 if (parameter_length
== 20) {
604 ND_PRINT("\n\t\tToken Bucket Rate: %.10g Mbps",
605 GET_BE_F_4(tptr
+ 4) / 125000);
606 ND_PRINT("\n\t\tToken Bucket Size: %.10g bytes",
607 GET_BE_F_4(tptr
+ 8));
608 ND_PRINT("\n\t\tPeak Data Rate: %.10g Mbps",
609 GET_BE_F_4(tptr
+ 12) / 125000);
610 ND_PRINT("\n\t\tMinimum Policed Unit: %u bytes",
611 GET_BE_U_4(tptr
+ 16));
612 ND_PRINT("\n\t\tMaximum Packet Size: %u bytes",
613 GET_BE_U_4(tptr
+ 20));
619 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
620 * | 130 (h) | 0 (i) | 2 (j) |
621 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
622 * | Rate [R] (32-bit IEEE floating point number) |
623 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
624 * | Slack Term [S] (32-bit integer) |
625 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
628 if (parameter_length
== 8) {
629 ND_PRINT("\n\t\tRate: %.10g Mbps", GET_BE_F_4(tptr
+ 4) / 125000);
630 ND_PRINT("\n\t\tSlack Term: %u", GET_BE_U_4(tptr
+ 8));
638 if (parameter_length
== 4) {
639 ND_PRINT("\n\t\tValue: %u", GET_BE_U_4(tptr
+ 4));
644 if (ndo
->ndo_vflag
<= 1)
645 print_unknown_data(ndo
, tptr
+ 4, "\n\t\t", parameter_length
);
647 return (parameter_length
+4); /* header length 4 bytes */
650 nd_print_invalid(ndo
);
655 * Clear checksum prior to signature verification.
658 rsvp_clear_checksum(void *header
)
660 struct rsvp_common_header
*rsvp_com_header
= (struct rsvp_common_header
*) header
;
662 rsvp_com_header
->checksum
[0] = 0;
663 rsvp_com_header
->checksum
[1] = 0;
667 rsvp_obj_print(netdissect_options
*ndo
,
668 const u_char
*pptr
, u_int plen
, const u_char
*tptr
,
669 const char *indent
, u_int tlen
,
670 const struct rsvp_common_header
*rsvp_com_header
)
672 const struct rsvp_object_header
*rsvp_obj_header
;
673 const u_char
*obj_tptr
;
675 const struct rsvp_obj_integrity_t
*rsvp_obj_integrity
;
676 const struct rsvp_obj_frr_t
*rsvp_obj_frr
;
679 u_short rsvp_obj_len
,rsvp_obj_ctype
,rsvp_obj_class_num
;
680 u_int obj_tlen
,intserv_serv_tlen
;
682 u_int processed
,padbytes
,error_code
,error_value
,sigcheck
;
685 u_int action
, subchannel
;
687 while(tlen
>=sizeof(struct rsvp_object_header
)) {
688 rsvp_obj_header
= (const struct rsvp_object_header
*)tptr
;
689 rsvp_obj_len
=GET_BE_U_2(rsvp_obj_header
->length
);
690 rsvp_obj_ctype
=GET_U_1(rsvp_obj_header
->ctype
);
692 if(rsvp_obj_len
% 4) {
693 ND_PRINT("%sERROR: object header size %u not a multiple of 4", indent
, rsvp_obj_len
);
696 if(rsvp_obj_len
< sizeof(struct rsvp_object_header
)) {
697 ND_PRINT("%sERROR: object header too short %u < %zu", indent
, rsvp_obj_len
,
698 sizeof(struct rsvp_object_header
));
702 rsvp_obj_class_num
= GET_U_1(rsvp_obj_header
->class_num
);
703 ND_PRINT("%s%s Object (%u) Flags: [%s",
705 tok2str(rsvp_obj_values
,
709 (rsvp_obj_class_num
& 0x80) ?
710 ((rsvp_obj_class_num
& 0x40) ? "ignore and forward" :
714 ND_PRINT(" if unknown], Class-Type: %s (%u), length: %u",
715 tok2str(rsvp_ctype_values
,
717 (rsvp_obj_class_num
<<8)+rsvp_obj_ctype
),
721 if(tlen
< rsvp_obj_len
) {
722 ND_PRINT("%sERROR: object goes past end of objects TLV", indent
);
726 obj_tptr
=tptr
+sizeof(struct rsvp_object_header
);
727 obj_tlen
=rsvp_obj_len
-sizeof(struct rsvp_object_header
);
729 /* did we capture enough for fully decoding the object ? */
730 ND_TCHECK_LEN(tptr
, rsvp_obj_len
);
733 switch(rsvp_obj_class_num
) {
734 case RSVP_OBJ_SESSION
:
735 switch(rsvp_obj_ctype
) {
736 case RSVP_CTYPE_IPV4
:
739 ND_PRINT("%s IPv4 DestAddress: %s, Protocol ID: 0x%02x",
741 GET_IPADDR_STRING(obj_tptr
),
742 GET_U_1(obj_tptr
+ sizeof(nd_ipv4
)));
743 ND_PRINT("%s Flags: [0x%02x], DestPort %u",
745 GET_U_1((obj_tptr
+ 5)),
746 GET_BE_U_2(obj_tptr
+ 6));
750 case RSVP_CTYPE_IPV6
:
753 ND_PRINT("%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
755 GET_IP6ADDR_STRING(obj_tptr
),
756 GET_U_1(obj_tptr
+ sizeof(nd_ipv6
)));
757 ND_PRINT("%s Flags: [0x%02x], DestPort %u",
759 GET_U_1((obj_tptr
+ sizeof(nd_ipv6
) + 1)),
760 GET_BE_U_2(obj_tptr
+ sizeof(nd_ipv6
) + 2));
765 case RSVP_CTYPE_TUNNEL_IPV6
:
768 ND_PRINT("%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
770 GET_IP6ADDR_STRING(obj_tptr
),
771 GET_BE_U_2(obj_tptr
+ 18),
772 GET_IP6ADDR_STRING(obj_tptr
+ 20));
777 case RSVP_CTYPE_14
: /* IPv6 p2mp LSP Tunnel */
780 ND_PRINT("%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
782 GET_BE_U_4(obj_tptr
),
783 GET_BE_U_2(obj_tptr
+ 6),
784 GET_IP6ADDR_STRING(obj_tptr
+ 8));
788 case RSVP_CTYPE_13
: /* IPv4 p2mp LSP Tunnel */
791 ND_PRINT("%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
793 GET_IPADDR_STRING(obj_tptr
),
794 GET_BE_U_2(obj_tptr
+ 6),
795 GET_IPADDR_STRING(obj_tptr
+ 8));
799 case RSVP_CTYPE_TUNNEL_IPV4
:
800 case RSVP_CTYPE_UNI_IPV4
:
803 ND_PRINT("%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
805 GET_IPADDR_STRING(obj_tptr
),
806 GET_BE_U_2(obj_tptr
+ 6),
807 GET_IPADDR_STRING(obj_tptr
+ 8));
816 case RSVP_OBJ_CONFIRM
:
817 switch(rsvp_obj_ctype
) {
818 case RSVP_CTYPE_IPV4
:
819 if (obj_tlen
< sizeof(nd_ipv4
))
821 ND_PRINT("%s IPv4 Receiver Address: %s",
823 GET_IPADDR_STRING(obj_tptr
));
824 obj_tlen
-=sizeof(nd_ipv4
);
825 obj_tptr
+=sizeof(nd_ipv4
);
827 case RSVP_CTYPE_IPV6
:
828 if (obj_tlen
< sizeof(nd_ipv6
))
830 ND_PRINT("%s IPv6 Receiver Address: %s",
832 GET_IP6ADDR_STRING(obj_tptr
));
833 obj_tlen
-=sizeof(nd_ipv6
);
834 obj_tptr
+=sizeof(nd_ipv6
);
841 case RSVP_OBJ_NOTIFY_REQ
:
842 switch(rsvp_obj_ctype
) {
843 case RSVP_CTYPE_IPV4
:
844 if (obj_tlen
< sizeof(nd_ipv4
))
846 ND_PRINT("%s IPv4 Notify Node Address: %s",
848 GET_IPADDR_STRING(obj_tptr
));
849 obj_tlen
-=sizeof(nd_ipv4
);
850 obj_tptr
+=sizeof(nd_ipv4
);
852 case RSVP_CTYPE_IPV6
:
853 if (obj_tlen
< sizeof(nd_ipv6
))
855 ND_PRINT("%s IPv6 Notify Node Address: %s",
857 GET_IP6ADDR_STRING(obj_tptr
));
858 obj_tlen
-=sizeof(nd_ipv6
);
859 obj_tptr
+=sizeof(nd_ipv6
);
866 case RSVP_OBJ_SUGGESTED_LABEL
: /* fall through */
867 case RSVP_OBJ_UPSTREAM_LABEL
: /* fall through */
868 case RSVP_OBJ_RECOVERY_LABEL
: /* fall through */
870 switch(rsvp_obj_ctype
) {
872 while(obj_tlen
>= 4 ) {
873 ND_PRINT("%s Label: %u", indent
, GET_BE_U_4(obj_tptr
));
881 ND_PRINT("%s Generalized Label: %u",
883 GET_BE_U_4(obj_tptr
));
890 ND_PRINT("%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
892 GET_BE_U_4(obj_tptr
),
894 GET_BE_U_4(obj_tptr
+ 4),
895 GET_BE_U_4(obj_tptr
+ 8));
905 switch(rsvp_obj_ctype
) {
909 ND_PRINT("%s Reservation Style: %s, Flags: [0x%02x]",
911 tok2str(rsvp_resstyle_values
,
913 GET_BE_U_3(obj_tptr
+ 1)),
923 case RSVP_OBJ_SENDER_TEMPLATE
:
924 switch(rsvp_obj_ctype
) {
925 case RSVP_CTYPE_IPV4
:
928 ND_PRINT("%s Source Address: %s, Source Port: %u",
930 GET_IPADDR_STRING(obj_tptr
),
931 GET_BE_U_2(obj_tptr
+ 6));
935 case RSVP_CTYPE_IPV6
:
938 ND_PRINT("%s Source Address: %s, Source Port: %u",
940 GET_IP6ADDR_STRING(obj_tptr
),
941 GET_BE_U_2(obj_tptr
+ 18));
945 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
948 ND_PRINT("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
949 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
951 GET_IP6ADDR_STRING(obj_tptr
),
952 GET_BE_U_2(obj_tptr
+ 18),
954 GET_IP6ADDR_STRING(obj_tptr
+20),
955 GET_BE_U_2(obj_tptr
+ 38));
959 case RSVP_CTYPE_TUNNEL_IPV4
:
962 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
964 GET_IPADDR_STRING(obj_tptr
),
965 GET_BE_U_2(obj_tptr
+ 6));
969 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
972 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
973 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
975 GET_IPADDR_STRING(obj_tptr
),
976 GET_BE_U_2(obj_tptr
+ 6),
978 GET_IPADDR_STRING(obj_tptr
+8),
979 GET_BE_U_2(obj_tptr
+ 12));
988 case RSVP_OBJ_LABEL_REQ
:
989 switch(rsvp_obj_ctype
) {
991 while(obj_tlen
>= 4 ) {
992 ND_PRINT("%s L3 Protocol ID: %s",
994 tok2str(ethertype_values
,
995 "Unknown Protocol (0x%04x)",
996 GET_BE_U_2(obj_tptr
+ 2)));
1004 ND_PRINT("%s L3 Protocol ID: %s",
1006 tok2str(ethertype_values
,
1007 "Unknown Protocol (0x%04x)",
1008 GET_BE_U_2(obj_tptr
+ 2)));
1009 ND_PRINT(",%s merge capability",
1010 ((GET_U_1(obj_tptr
+ 4)) & 0x80) ? "no" : "" );
1011 ND_PRINT("%s Minimum VPI/VCI: %u/%u",
1013 (GET_BE_U_2(obj_tptr
+ 4))&0xfff,
1014 (GET_BE_U_2(obj_tptr
+ 6)) & 0xfff);
1015 ND_PRINT("%s Maximum VPI/VCI: %u/%u",
1017 (GET_BE_U_2(obj_tptr
+ 8))&0xfff,
1018 (GET_BE_U_2(obj_tptr
+ 10)) & 0xfff);
1025 ND_PRINT("%s L3 Protocol ID: %s",
1027 tok2str(ethertype_values
,
1028 "Unknown Protocol (0x%04x)",
1029 GET_BE_U_2(obj_tptr
+ 2)));
1030 ND_PRINT("%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1032 (GET_BE_U_4(obj_tptr
+ 4))&0x7fffff,
1033 (GET_BE_U_4(obj_tptr
+ 8))&0x7fffff,
1034 (((GET_BE_U_2(obj_tptr
+ 4)>>7)&3) == 0 ) ? "10" : "",
1035 (((GET_BE_U_2(obj_tptr
+ 4) >> 7) & 3) == 2 ) ? "23" : "");
1042 ND_PRINT("%s LSP Encoding Type: %s (%u)",
1044 tok2str(gmpls_encoding_values
,
1048 ND_PRINT("%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1050 tok2str(gmpls_switch_cap_values
,
1052 GET_U_1((obj_tptr
+ 1))),
1053 GET_U_1(obj_tptr
+ 1),
1054 tok2str(gmpls_payload_values
,
1056 GET_BE_U_2(obj_tptr
+ 2)),
1057 GET_BE_U_2(obj_tptr
+ 2));
1068 switch(rsvp_obj_ctype
) {
1069 case RSVP_CTYPE_IPV4
:
1070 while(obj_tlen
>= 4 ) {
1073 ND_TCHECK_4(obj_tptr
);
1074 length
= GET_U_1(obj_tptr
+ 1);
1075 ND_PRINT("%s Subobject Type: %s, length %u",
1077 tok2str(rsvp_obj_xro_values
,
1079 RSVP_OBJ_XRO_MASK_SUBOBJ(GET_U_1(obj_tptr
))),
1081 if (obj_tlen
< length
) {
1082 ND_PRINT("%s ERROR: ERO subobject length > object length", indent
);
1086 if (length
== 0) { /* prevent infinite loops */
1087 ND_PRINT("%s ERROR: zero length ERO subtype", indent
);
1091 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(GET_U_1(obj_tptr
))) {
1092 u_char prefix_length
;
1094 case RSVP_OBJ_XRO_IPV4
:
1096 ND_PRINT(" ERROR: length != 8");
1099 ND_TCHECK_8(obj_tptr
);
1100 prefix_length
= GET_U_1(obj_tptr
+ 6);
1101 if (prefix_length
!= 32) {
1102 ND_PRINT(" ERROR: Prefix length %u != 32",
1106 ND_PRINT(", %s, %s/%u, Flags: [%s]",
1107 RSVP_OBJ_XRO_MASK_LOOSE(GET_U_1(obj_tptr
)) ? "Loose" : "Strict",
1108 GET_IPADDR_STRING(obj_tptr
+2),
1109 GET_U_1((obj_tptr
+ 6)),
1110 bittok2str(rsvp_obj_rro_flag_values
,
1112 GET_U_1((obj_tptr
+ 7)))); /* rfc3209 says that this field is rsvd. */
1114 case RSVP_OBJ_XRO_LABEL
:
1116 ND_PRINT(" ERROR: length != 8");
1119 ND_PRINT(", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1120 bittok2str(rsvp_obj_rro_label_flag_values
,
1122 GET_U_1((obj_tptr
+ 2))),
1123 GET_U_1(obj_tptr
+ 2),
1124 tok2str(rsvp_ctype_values
,
1126 GET_U_1((obj_tptr
+ 3)) + (256 * RSVP_OBJ_RRO
)),
1127 GET_U_1((obj_tptr
+ 3)),
1128 GET_BE_U_4(obj_tptr
+ 4));
1139 case RSVP_OBJ_HELLO
:
1140 switch(rsvp_obj_ctype
) {
1145 ND_PRINT("%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1147 GET_BE_U_4(obj_tptr
),
1148 GET_BE_U_4(obj_tptr
+ 4));
1157 case RSVP_OBJ_RESTART_CAPABILITY
:
1158 switch(rsvp_obj_ctype
) {
1162 ND_PRINT("%s Restart Time: %ums, Recovery Time: %ums",
1164 GET_BE_U_4(obj_tptr
),
1165 GET_BE_U_4(obj_tptr
+ 4));
1174 case RSVP_OBJ_CAPABILITY
:
1175 switch(rsvp_obj_ctype
) {
1179 uint32_t unused_and_flags
= GET_BE_U_4(obj_tptr
);
1180 if (unused_and_flags
& ~RSVP_OBJ_CAPABILITY_FLAGS_MASK
)
1181 ND_PRINT("%s [reserved=0x%08x must be zero]", indent
,
1182 unused_and_flags
& ~RSVP_OBJ_CAPABILITY_FLAGS_MASK
);
1183 ND_PRINT("%s Flags: [%s]",
1185 bittok2str(rsvp_obj_capability_flag_values
,
1187 (unused_and_flags
& RSVP_OBJ_CAPABILITY_FLAGS_MASK
)));
1196 case RSVP_OBJ_SESSION_ATTRIBUTE
:
1197 switch(rsvp_obj_ctype
) {
1198 case RSVP_CTYPE_TUNNEL_IPV4
:
1201 namelen
= GET_U_1(obj_tptr
+ 3);
1202 if (obj_tlen
< 4+namelen
)
1204 ND_PRINT("%s Session Name: ", indent
);
1205 nd_printjn(ndo
, obj_tptr
+ 4, namelen
);
1206 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1209 GET_U_1(obj_tptr
+ 1),
1210 bittok2str(rsvp_session_attribute_flag_values
,
1212 GET_U_1((obj_tptr
+ 2))),
1213 GET_U_1(obj_tptr
+ 2));
1214 obj_tlen
-=4+namelen
;
1215 obj_tptr
+=4+namelen
;
1222 case RSVP_OBJ_GENERALIZED_UNI
:
1223 switch(rsvp_obj_ctype
) {
1224 u_int subobj_type
,af
,subobj_len
,total_subobj_len
;
1231 /* read variable length subobjects */
1232 total_subobj_len
= obj_tlen
;
1233 while(total_subobj_len
!= 0) {
1234 /* If RFC 3476 Section 3.1 defined that a sub-object of the
1235 * GENERALIZED_UNI RSVP object must have the Length field as
1236 * a multiple of 4, instead of the check below it would be
1237 * better to test total_subobj_len only once before the loop.
1238 * So long as it does not define it and this while loop does
1239 * not implement such a requirement, let's accept that within
1240 * each iteration subobj_len may happen to be a multiple of 1
1241 * and test it and total_subobj_len respectively.
1243 ND_ICHECK_U(total_subobj_len
, <, 4);
1244 subobj_len
= GET_BE_U_2(obj_tptr
);
1245 subobj_type
= (GET_BE_U_2(obj_tptr
+ 2))>>8;
1246 af
= (GET_BE_U_2(obj_tptr
+ 2))&0x00FF;
1248 ND_PRINT("%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1250 tok2str(rsvp_obj_generalized_uni_values
, "Unknown", subobj_type
),
1252 tok2str(af_values
, "Unknown", af
), af
,
1255 /* In addition to what is explained above, the same spec does not
1256 * explicitly say that the same Length field includes the 4-octet
1257 * sub-object header, but as long as this while loop implements it
1258 * as it does include, let's keep the check below consistent with
1259 * the rest of the code.
1261 * XXX - RFC 3476 Section 3.1 says "The contents of these
1262 * sub-objects are described in [8]", where [8] is
1263 * UNI 1.0 Signaling Specification, The Optical
1264 * Internetworking Forum. The URL they give for that
1267 * http://www.oiforum.com/public/UNI_1.0_ia.html
1269 * but that doesn't work; the new URL appears to be
1271 * https://web.archive.org/web/20160401194747/http://www.oiforum.com/public/documents/OIF-UNI-01.0.pdf
1273 * and *that* document, in section 12.5.2.3
1274 * "GENERALIZED_UNI Object (Class-Num=11bbbbbb (TBA))",
1275 * says nothing about the length field in general, but
1276 * some of the examples it gives in subsections have
1277 * length field values that clearly includes the length
1278 * of the sub-object header as well as the length of the
1281 if(subobj_len
< 4 || subobj_len
> total_subobj_len
||
1282 obj_tlen
< subobj_len
)
1285 switch(subobj_type
) {
1286 case RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
:
1287 case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
:
1292 goto subobj_tooshort
;
1293 ND_PRINT("%s UNI IPv4 TNA address: %s",
1294 indent
, GET_IPADDR_STRING(obj_tptr
+ 4));
1297 if (subobj_len
< 20)
1298 goto subobj_tooshort
;
1299 ND_PRINT("%s UNI IPv6 TNA address: %s",
1300 indent
, GET_IP6ADDR_STRING(obj_tptr
+ 4));
1304 /* unless we have a TLV parser lets just hexdump */
1311 case RSVP_GEN_UNI_SUBOBJ_DIVERSITY
:
1312 if (subobj_len
> 4) {
1313 /* unless we have a TLV parser lets just hexdump */
1318 case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
:
1319 if (subobj_len
< 16) {
1320 goto subobj_tooshort
;
1323 ND_PRINT("%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
1325 ((GET_BE_U_4(obj_tptr
+ 4))>>31),
1326 ((GET_BE_U_4(obj_tptr
+ 4))&0xFF),
1327 GET_BE_U_4(obj_tptr
+ 8),
1328 GET_BE_U_4(obj_tptr
+ 12));
1331 case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
:
1332 if (subobj_len
< 8) {
1333 goto subobj_tooshort
;
1336 ND_PRINT("%s Service level: %u",
1337 indent
, (GET_BE_U_4(obj_tptr
+ 4)) >> 24);
1344 total_subobj_len
-=subobj_len
;
1345 obj_tptr
+=subobj_len
;
1346 obj_tlen
+=subobj_len
;
1355 case RSVP_OBJ_RSVP_HOP
:
1356 switch(rsvp_obj_ctype
) {
1357 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1358 case RSVP_CTYPE_IPV4
:
1361 ND_PRINT("%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1363 GET_IPADDR_STRING(obj_tptr
),
1364 GET_BE_U_4(obj_tptr
+ 4));
1368 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1370 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1371 case RSVP_CTYPE_IPV6
:
1374 ND_PRINT("%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1376 GET_IP6ADDR_STRING(obj_tptr
),
1377 GET_BE_U_4(obj_tptr
+ 16));
1380 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1387 case RSVP_OBJ_TIME_VALUES
:
1388 switch(rsvp_obj_ctype
) {
1392 ND_PRINT("%s Refresh Period: %ums",
1394 GET_BE_U_4(obj_tptr
));
1403 /* those three objects do share the same semantics */
1404 case RSVP_OBJ_SENDER_TSPEC
:
1405 case RSVP_OBJ_ADSPEC
:
1406 case RSVP_OBJ_FLOWSPEC
:
1407 switch(rsvp_obj_ctype
) {
1411 ND_PRINT("%s Msg-Version: %u, length: %u",
1413 (GET_U_1(obj_tptr
) & 0xf0) >> 4,
1414 GET_BE_U_2(obj_tptr
+ 2) << 2);
1415 obj_tptr
+=4; /* get to the start of the service header */
1418 while (obj_tlen
>= 4) {
1419 intserv_serv_tlen
=GET_BE_U_2(obj_tptr
+ 2)<<2;
1420 ND_PRINT("%s Service Type: %s (%u), break bit %sset, Service length: %u",
1422 tok2str(rsvp_intserv_service_type_values
,"unknown",GET_U_1((obj_tptr
))),
1424 (GET_U_1(obj_tptr
+ 1)&0x80) ? "" : "not ",
1427 obj_tptr
+=4; /* get to the start of the parameter list */
1430 while (intserv_serv_tlen
>=4) {
1431 processed
= rsvp_intserv_print(ndo
, obj_tptr
, obj_tlen
);
1434 obj_tlen
-=processed
;
1435 intserv_serv_tlen
-=processed
;
1436 obj_tptr
+=processed
;
1445 case RSVP_OBJ_FILTERSPEC
:
1446 switch(rsvp_obj_ctype
) {
1447 case RSVP_CTYPE_IPV4
:
1450 ND_PRINT("%s Source Address: %s, Source Port: %u",
1452 GET_IPADDR_STRING(obj_tptr
),
1453 GET_BE_U_2(obj_tptr
+ 6));
1457 case RSVP_CTYPE_IPV6
:
1460 ND_PRINT("%s Source Address: %s, Source Port: %u",
1462 GET_IP6ADDR_STRING(obj_tptr
),
1463 GET_BE_U_2(obj_tptr
+ 18));
1470 ND_PRINT("%s Source Address: %s, Flow Label: %u",
1472 GET_IP6ADDR_STRING(obj_tptr
),
1473 GET_BE_U_3(obj_tptr
+ 17));
1477 case RSVP_CTYPE_TUNNEL_IPV6
:
1480 ND_PRINT("%s Source Address: %s, LSP-ID: 0x%04x",
1482 GET_IPADDR_STRING(obj_tptr
),
1483 GET_BE_U_2(obj_tptr
+ 18));
1487 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
1490 ND_PRINT("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1491 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1493 GET_IP6ADDR_STRING(obj_tptr
),
1494 GET_BE_U_2(obj_tptr
+ 18),
1496 GET_IP6ADDR_STRING(obj_tptr
+20),
1497 GET_BE_U_2(obj_tptr
+ 38));
1501 case RSVP_CTYPE_TUNNEL_IPV4
:
1504 ND_PRINT("%s Source Address: %s, LSP-ID: 0x%04x",
1506 GET_IPADDR_STRING(obj_tptr
),
1507 GET_BE_U_2(obj_tptr
+ 6));
1511 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
1514 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1515 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1517 GET_IPADDR_STRING(obj_tptr
),
1518 GET_BE_U_2(obj_tptr
+ 6),
1520 GET_IPADDR_STRING(obj_tptr
+8),
1521 GET_BE_U_2(obj_tptr
+ 12));
1530 case RSVP_OBJ_FASTREROUTE
:
1531 /* the differences between c-type 1 and 7 are minor */
1532 obj_ptr
.rsvp_obj_frr
= (const struct rsvp_obj_frr_t
*)obj_tptr
;
1534 switch(rsvp_obj_ctype
) {
1535 case RSVP_CTYPE_1
: /* new style */
1536 if (obj_tlen
< sizeof(struct rsvp_obj_frr_t
))
1538 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1540 GET_U_1(obj_ptr
.rsvp_obj_frr
->setup_prio
),
1541 GET_U_1(obj_ptr
.rsvp_obj_frr
->hold_prio
),
1542 GET_U_1(obj_ptr
.rsvp_obj_frr
->hop_limit
),
1543 GET_BE_F_4(obj_ptr
.rsvp_obj_frr
->bandwidth
) * 8 / 1000000);
1544 ND_PRINT("%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
1546 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_any
),
1547 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->exclude_any
),
1548 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_all
));
1549 obj_tlen
-=sizeof(struct rsvp_obj_frr_t
);
1550 obj_tptr
+=sizeof(struct rsvp_obj_frr_t
);
1553 case RSVP_CTYPE_TUNNEL_IPV4
: /* old style */
1556 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1558 GET_U_1(obj_ptr
.rsvp_obj_frr
->setup_prio
),
1559 GET_U_1(obj_ptr
.rsvp_obj_frr
->hold_prio
),
1560 GET_U_1(obj_ptr
.rsvp_obj_frr
->hop_limit
),
1561 GET_BE_F_4(obj_ptr
.rsvp_obj_frr
->bandwidth
) * 8 / 1000000);
1562 ND_PRINT("%s Include Colors: 0x%08x, Exclude Colors: 0x%08x",
1564 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_any
),
1565 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->exclude_any
));
1575 case RSVP_OBJ_DETOUR
:
1576 switch(rsvp_obj_ctype
) {
1577 case RSVP_CTYPE_TUNNEL_IPV4
:
1578 while(obj_tlen
>= 8) {
1579 ND_PRINT("%s PLR-ID: %s, Avoid-Node-ID: %s",
1581 GET_IPADDR_STRING(obj_tptr
),
1582 GET_IPADDR_STRING(obj_tptr
+ 4));
1592 case RSVP_OBJ_CLASSTYPE
:
1593 case RSVP_OBJ_CLASSTYPE_OLD
: /* fall through */
1594 switch(rsvp_obj_ctype
) {
1598 ND_PRINT("%s CT: %u",
1600 GET_BE_U_4(obj_tptr
) & 0x7);
1609 case RSVP_OBJ_ERROR_SPEC
:
1610 switch(rsvp_obj_ctype
) {
1611 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1612 case RSVP_CTYPE_IPV4
:
1615 error_code
=GET_U_1(obj_tptr
+ 5);
1616 error_value
=GET_BE_U_2(obj_tptr
+ 6);
1617 ND_PRINT("%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1619 GET_IPADDR_STRING(obj_tptr
),
1620 GET_U_1(obj_tptr
+ 4),
1622 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1624 switch (error_code
) {
1625 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1626 ND_PRINT(", Error Value: %s (%u)",
1627 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1630 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
: /* fall through */
1631 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
:
1632 ND_PRINT(", Error Value: %s (%u)",
1633 tok2str(rsvp_obj_error_code_diffserv_te_values
,"unknown",error_value
),
1637 ND_PRINT(", Unknown Error Value (%u)", error_value
);
1643 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1644 case RSVP_CTYPE_IPV6
:
1647 error_code
=GET_U_1(obj_tptr
+ 17);
1648 error_value
=GET_BE_U_2(obj_tptr
+ 18);
1649 ND_PRINT("%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1651 GET_IP6ADDR_STRING(obj_tptr
),
1652 GET_U_1(obj_tptr
+ 16),
1654 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1657 switch (error_code
) {
1658 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1659 ND_PRINT(", Error Value: %s (%u)",
1660 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1674 case RSVP_OBJ_PROPERTIES
:
1675 switch(rsvp_obj_ctype
) {
1679 padbytes
= GET_BE_U_2(obj_tptr
+ 2);
1680 ND_PRINT("%s TLV count: %u, padding bytes: %u",
1682 GET_BE_U_2(obj_tptr
),
1686 /* loop through as long there is anything longer than the TLV header (2) */
1687 while(obj_tlen
>= 2 + padbytes
) {
1688 ND_PRINT("%s %s TLV (0x%02x), length: %u", /* length includes header */
1690 tok2str(rsvp_obj_prop_tlv_values
,"unknown",GET_U_1(obj_tptr
)),
1692 GET_U_1(obj_tptr
+ 1));
1693 if (obj_tlen
< GET_U_1(obj_tptr
+ 1))
1695 if (GET_U_1(obj_tptr
+ 1) < 2) {
1696 ND_PRINT("%sERROR: property TLV is too short", indent
);
1699 print_unknown_data(ndo
, obj_tptr
+ 2, "\n\t\t",
1700 GET_U_1(obj_tptr
+ 1) - 2);
1701 obj_tlen
-=GET_U_1(obj_tptr
+ 1);
1702 obj_tptr
+=GET_U_1(obj_tptr
+ 1);
1710 case RSVP_OBJ_MESSAGE_ID
: /* fall through */
1711 case RSVP_OBJ_MESSAGE_ID_ACK
: /* fall through */
1712 case RSVP_OBJ_MESSAGE_ID_LIST
:
1713 switch(rsvp_obj_ctype
) {
1718 ND_PRINT("%s Flags [0x%02x], epoch: %u",
1721 GET_BE_U_3(obj_tptr
+ 1));
1724 /* loop through as long there are no messages left */
1725 while(obj_tlen
>= 4) {
1726 ND_PRINT("%s Message-ID 0x%08x (%u)",
1728 GET_BE_U_4(obj_tptr
),
1729 GET_BE_U_4(obj_tptr
));
1739 case RSVP_OBJ_INTEGRITY
:
1740 switch(rsvp_obj_ctype
) {
1742 if (obj_tlen
< sizeof(struct rsvp_obj_integrity_t
))
1744 obj_ptr
.rsvp_obj_integrity
= (const struct rsvp_obj_integrity_t
*)obj_tptr
;
1745 ND_PRINT("%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
1747 GET_BE_U_2(obj_ptr
.rsvp_obj_integrity
->key_id
),
1748 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->key_id
+ 2),
1749 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->sequence
),
1750 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->sequence
+ 4),
1751 bittok2str(rsvp_obj_integrity_flag_values
,
1753 GET_U_1(obj_ptr
.rsvp_obj_integrity
->flags
)));
1754 ND_PRINT("%s MD5-sum 0x%08x%08x%08x%08x ",
1756 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
),
1757 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 4),
1758 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 8),
1759 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 12));
1761 sigcheck
= signature_verify(ndo
, pptr
, plen
,
1762 obj_ptr
.rsvp_obj_integrity
->digest
,
1763 rsvp_clear_checksum
,
1765 ND_PRINT(" (%s)", tok2str(signature_check_values
, "Unknown", sigcheck
));
1767 obj_tlen
+=sizeof(struct rsvp_obj_integrity_t
);
1768 obj_tptr
+=sizeof(struct rsvp_obj_integrity_t
);
1775 case RSVP_OBJ_ADMIN_STATUS
:
1776 switch(rsvp_obj_ctype
) {
1780 ND_PRINT("%s Flags [%s]", indent
,
1781 bittok2str(rsvp_obj_admin_status_flag_values
, "none",
1782 GET_BE_U_4(obj_tptr
)));
1791 case RSVP_OBJ_LABEL_SET
:
1792 switch(rsvp_obj_ctype
) {
1796 action
= (GET_BE_U_2(obj_tptr
)>>8);
1798 ND_PRINT("%s Action: %s (%u), Label type: %u", indent
,
1799 tok2str(rsvp_obj_label_set_action_values
, "Unknown", action
),
1800 action
, (GET_BE_U_4(obj_tptr
) & 0x7F));
1803 case LABEL_SET_INCLUSIVE_RANGE
:
1804 case LABEL_SET_EXCLUSIVE_RANGE
: /* fall through */
1806 /* only a couple of subchannels are expected */
1809 ND_PRINT("%s Start range: %u, End range: %u", indent
,
1810 GET_BE_U_4(obj_tptr
+ 4),
1811 GET_BE_U_4(obj_tptr
+ 8));
1820 while(obj_tlen
>= 4 ) {
1821 ND_PRINT("%s Subchannel #%u: %u", indent
, subchannel
,
1822 GET_BE_U_4(obj_tptr
));
1836 switch (rsvp_obj_ctype
) {
1837 case RSVP_CTYPE_IPV4
:
1840 ND_PRINT("%s Sub-LSP destination address: %s",
1841 indent
, GET_IPADDR_STRING(obj_tptr
));
1846 case RSVP_CTYPE_IPV6
:
1849 ND_PRINT("%s Sub-LSP destination address: %s",
1850 indent
, GET_IP6ADDR_STRING(obj_tptr
));
1861 * FIXME those are the defined objects that lack a decoder
1862 * you are welcome to contribute code ;-)
1865 case RSVP_OBJ_SCOPE
:
1866 case RSVP_OBJ_POLICY_DATA
:
1867 case RSVP_OBJ_ACCEPT_LABEL_SET
:
1868 case RSVP_OBJ_PROTECTION
:
1870 if (ndo
->ndo_vflag
<= 1)
1871 print_unknown_data(ndo
, obj_tptr
, "\n\t ", obj_tlen
); /* FIXME indentation */
1874 /* do we also want to see a hex dump ? */
1875 if (ndo
->ndo_vflag
> 1 || hexdump
== TRUE
)
1876 print_unknown_data(ndo
, tptr
+ sizeof(struct rsvp_object_header
), "\n\t ", /* FIXME indentation */
1877 rsvp_obj_len
- sizeof(struct rsvp_object_header
));
1884 ND_PRINT("%sERROR: sub-object is too short", indent
);
1887 ND_PRINT("%sERROR: object is too short", indent
);
1890 nd_print_invalid(ndo
);
1895 rsvp_print(netdissect_options
*ndo
,
1896 const u_char
*pptr
, u_int len
)
1898 const struct rsvp_common_header
*rsvp_com_header
;
1899 uint8_t version_flags
, msg_type
;
1903 ndo
->ndo_protocol
= "rsvp";
1906 rsvp_com_header
= (const struct rsvp_common_header
*)pptr
;
1907 ND_TCHECK_SIZE(rsvp_com_header
);
1908 version_flags
= GET_U_1(rsvp_com_header
->version_flags
);
1911 * Sanity checking of the header.
1913 if (RSVP_EXTRACT_VERSION(version_flags
) != RSVP_VERSION
) {
1914 ND_PRINT("ERROR: RSVP version %u packet not supported",
1915 RSVP_EXTRACT_VERSION(version_flags
));
1919 msg_type
= GET_U_1(rsvp_com_header
->msg_type
);
1921 /* in non-verbose mode just lets print the basic Message Type*/
1922 if (ndo
->ndo_vflag
< 1) {
1923 ND_PRINT("RSVPv%u %s Message, length: %u",
1924 RSVP_EXTRACT_VERSION(version_flags
),
1925 tok2str(rsvp_msg_type_values
, "unknown (%u)",msg_type
),
1930 /* ok they seem to want to know everything - lets fully decode it */
1932 plen
= tlen
= GET_BE_U_2(rsvp_com_header
->length
);
1934 ND_PRINT("\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1935 RSVP_EXTRACT_VERSION(version_flags
),
1936 tok2str(rsvp_msg_type_values
, "unknown, type: %u",msg_type
),
1938 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(version_flags
)),
1940 GET_U_1(rsvp_com_header
->ttl
),
1941 GET_BE_U_2(rsvp_com_header
->checksum
));
1943 if (tlen
< sizeof(struct rsvp_common_header
)) {
1944 ND_PRINT("ERROR: common header too short %u < %zu", tlen
,
1945 sizeof(struct rsvp_common_header
));
1949 tptr
+=sizeof(struct rsvp_common_header
);
1950 tlen
-=sizeof(struct rsvp_common_header
);
1954 case RSVP_MSGTYPE_BUNDLE
:
1956 * Process each submessage in the bundle message.
1957 * Bundle messages may not contain bundle submessages, so we don't
1958 * need to handle bundle submessages specially.
1961 const u_char
*subpptr
=tptr
, *subtptr
;
1962 u_short subplen
, subtlen
;
1966 rsvp_com_header
= (const struct rsvp_common_header
*)subpptr
;
1967 ND_TCHECK_SIZE(rsvp_com_header
);
1968 version_flags
= GET_U_1(rsvp_com_header
->version_flags
);
1971 * Sanity checking of the header.
1973 if (RSVP_EXTRACT_VERSION(version_flags
) != RSVP_VERSION
) {
1974 ND_PRINT("ERROR: RSVP version %u packet not supported",
1975 RSVP_EXTRACT_VERSION(version_flags
));
1979 subplen
= subtlen
= GET_BE_U_2(rsvp_com_header
->length
);
1981 msg_type
= GET_U_1(rsvp_com_header
->msg_type
);
1982 ND_PRINT("\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1983 RSVP_EXTRACT_VERSION(version_flags
),
1984 tok2str(rsvp_msg_type_values
, "unknown, type: %u",msg_type
),
1986 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(version_flags
)),
1988 GET_U_1(rsvp_com_header
->ttl
),
1989 GET_BE_U_2(rsvp_com_header
->checksum
));
1991 if (subtlen
< sizeof(struct rsvp_common_header
)) {
1992 ND_PRINT("ERROR: common header too short %u < %zu", subtlen
,
1993 sizeof(struct rsvp_common_header
));
1997 if (tlen
< subtlen
) {
1998 ND_PRINT("ERROR: common header too large %u > %u", subtlen
,
2003 subtptr
+=sizeof(struct rsvp_common_header
);
2004 subtlen
-=sizeof(struct rsvp_common_header
);
2007 * Print all objects in the submessage.
2009 if (rsvp_obj_print(ndo
, subpptr
, subplen
, subtptr
, "\n\t ", subtlen
, rsvp_com_header
) == -1)
2012 tptr
+=subtlen
+sizeof(struct rsvp_common_header
);
2013 tlen
-=subtlen
+sizeof(struct rsvp_common_header
);
2018 case RSVP_MSGTYPE_PATH
:
2019 case RSVP_MSGTYPE_RESV
:
2020 case RSVP_MSGTYPE_PATHERR
:
2021 case RSVP_MSGTYPE_RESVERR
:
2022 case RSVP_MSGTYPE_PATHTEAR
:
2023 case RSVP_MSGTYPE_RESVTEAR
:
2024 case RSVP_MSGTYPE_RESVCONF
:
2025 case RSVP_MSGTYPE_HELLO_OLD
:
2026 case RSVP_MSGTYPE_HELLO
:
2027 case RSVP_MSGTYPE_ACK
:
2028 case RSVP_MSGTYPE_SREFRESH
:
2030 * Print all objects in the message.
2032 if (rsvp_obj_print(ndo
, pptr
, plen
, tptr
, "\n\t ", tlen
, rsvp_com_header
) == -1)
2037 print_unknown_data(ndo
, tptr
, "\n\t ", tlen
);