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 */
26 #include "netdissect-stdinc.h"
28 #define ND_LONGJMP_FROM_TCHECK
29 #include "netdissect.h"
31 #include "addrtoname.h"
32 #include "ethertype.h"
35 #include "signature.h"
39 * RFC 2205 common header
42 * +-------------+-------------+-------------+-------------+
43 * | Vers | Flags| Msg Type | RSVP Checksum |
44 * +-------------+-------------+-------------+-------------+
45 * | Send_TTL | (Reserved) | RSVP Length |
46 * +-------------+-------------+-------------+-------------+
50 struct rsvp_common_header
{
51 nd_uint8_t version_flags
;
60 * RFC2205 object header
64 * +-------------+-------------+-------------+-------------+
65 * | Length (bytes) | Class-Num | C-Type |
66 * +-------------+-------------+-------------+-------------+
68 * // (Object contents) //
70 * +-------------+-------------+-------------+-------------+
73 struct rsvp_object_header
{
79 #define RSVP_VERSION 1
80 #define RSVP_EXTRACT_VERSION(x) (((x)&0xf0)>>4)
81 #define RSVP_EXTRACT_FLAGS(x) ((x)&0x0f)
83 #define RSVP_MSGTYPE_PATH 1
84 #define RSVP_MSGTYPE_RESV 2
85 #define RSVP_MSGTYPE_PATHERR 3
86 #define RSVP_MSGTYPE_RESVERR 4
87 #define RSVP_MSGTYPE_PATHTEAR 5
88 #define RSVP_MSGTYPE_RESVTEAR 6
89 #define RSVP_MSGTYPE_RESVCONF 7
90 #define RSVP_MSGTYPE_BUNDLE 12
91 #define RSVP_MSGTYPE_ACK 13
92 #define RSVP_MSGTYPE_HELLO_OLD 14 /* ancient Hellos */
93 #define RSVP_MSGTYPE_SREFRESH 15
94 #define RSVP_MSGTYPE_HELLO 20
96 static const struct tok rsvp_msg_type_values
[] = {
97 { RSVP_MSGTYPE_PATH
, "Path" },
98 { RSVP_MSGTYPE_RESV
, "Resv" },
99 { RSVP_MSGTYPE_PATHERR
, "PathErr" },
100 { RSVP_MSGTYPE_RESVERR
, "ResvErr" },
101 { RSVP_MSGTYPE_PATHTEAR
, "PathTear" },
102 { RSVP_MSGTYPE_RESVTEAR
, "ResvTear" },
103 { RSVP_MSGTYPE_RESVCONF
, "ResvConf" },
104 { RSVP_MSGTYPE_BUNDLE
, "Bundle" },
105 { RSVP_MSGTYPE_ACK
, "Acknowledgement" },
106 { RSVP_MSGTYPE_HELLO_OLD
, "Hello (Old)" },
107 { RSVP_MSGTYPE_SREFRESH
, "Refresh" },
108 { RSVP_MSGTYPE_HELLO
, "Hello" },
112 static const struct tok rsvp_header_flag_values
[] = {
113 { 0x01, "Refresh reduction capable" }, /* rfc2961 */
117 static const struct tok rsvp_obj_capability_flag_values
[] = {
118 { 0x0004, "RecoveryPath Transmit Enabled" },
119 { 0x0002, "RecoveryPath Desired" },
120 { 0x0001, "RecoveryPath Srefresh Capable" },
124 #define RSVP_OBJ_SESSION 1 /* rfc2205 */
125 #define RSVP_OBJ_RSVP_HOP 3 /* rfc2205, rfc3473 */
126 #define RSVP_OBJ_INTEGRITY 4 /* rfc2747 */
127 #define RSVP_OBJ_TIME_VALUES 5 /* rfc2205 */
128 #define RSVP_OBJ_ERROR_SPEC 6
129 #define RSVP_OBJ_SCOPE 7
130 #define RSVP_OBJ_STYLE 8 /* rfc2205 */
131 #define RSVP_OBJ_FLOWSPEC 9 /* rfc2215 */
132 #define RSVP_OBJ_FILTERSPEC 10 /* rfc2215 */
133 #define RSVP_OBJ_SENDER_TEMPLATE 11
134 #define RSVP_OBJ_SENDER_TSPEC 12 /* rfc2215 */
135 #define RSVP_OBJ_ADSPEC 13 /* rfc2215 */
136 #define RSVP_OBJ_POLICY_DATA 14
137 #define RSVP_OBJ_CONFIRM 15 /* rfc2205 */
138 #define RSVP_OBJ_LABEL 16 /* rfc3209 */
139 #define RSVP_OBJ_LABEL_REQ 19 /* rfc3209 */
140 #define RSVP_OBJ_ERO 20 /* rfc3209 */
141 #define RSVP_OBJ_RRO 21 /* rfc3209 */
142 #define RSVP_OBJ_HELLO 22 /* rfc3209 */
143 #define RSVP_OBJ_MESSAGE_ID 23 /* rfc2961 */
144 #define RSVP_OBJ_MESSAGE_ID_ACK 24 /* rfc2961 */
145 #define RSVP_OBJ_MESSAGE_ID_LIST 25 /* rfc2961 */
146 #define RSVP_OBJ_RECOVERY_LABEL 34 /* rfc3473 */
147 #define RSVP_OBJ_UPSTREAM_LABEL 35 /* rfc3473 */
148 #define RSVP_OBJ_LABEL_SET 36 /* rfc3473 */
149 #define RSVP_OBJ_PROTECTION 37 /* rfc3473 */
150 #define RSVP_OBJ_S2L 50 /* rfc4875 */
151 #define RSVP_OBJ_DETOUR 63 /* rfc4090 */
152 #define RSVP_OBJ_CLASSTYPE 66 /* rfc4124 */
153 #define RSVP_OBJ_CLASSTYPE_OLD 125 /* draft-ietf-tewg-diff-te-proto-07 */
154 #define RSVP_OBJ_SUGGESTED_LABEL 129 /* rfc3473 */
155 #define RSVP_OBJ_ACCEPT_LABEL_SET 130 /* rfc3473 */
156 #define RSVP_OBJ_RESTART_CAPABILITY 131 /* rfc3473 */
157 #define RSVP_OBJ_CAPABILITY 134 /* rfc5063 */
158 #define RSVP_OBJ_NOTIFY_REQ 195 /* rfc3473 */
159 #define RSVP_OBJ_ADMIN_STATUS 196 /* rfc3473 */
160 #define RSVP_OBJ_PROPERTIES 204 /* juniper proprietary */
161 #define RSVP_OBJ_FASTREROUTE 205 /* rfc4090 */
162 #define RSVP_OBJ_SESSION_ATTRIBUTE 207 /* rfc3209 */
163 #define RSVP_OBJ_GENERALIZED_UNI 229 /* OIF RSVP extensions UNI 1.0 Signaling, Rel. 2 */
164 #define RSVP_OBJ_CALL_ID 230 /* rfc3474 */
165 #define RSVP_OBJ_CALL_OPS 236 /* rfc3474 */
167 static const struct tok rsvp_obj_values
[] = {
168 { RSVP_OBJ_SESSION
, "Session" },
169 { RSVP_OBJ_RSVP_HOP
, "RSVP Hop" },
170 { RSVP_OBJ_INTEGRITY
, "Integrity" },
171 { RSVP_OBJ_TIME_VALUES
, "Time Values" },
172 { RSVP_OBJ_ERROR_SPEC
, "Error Spec" },
173 { RSVP_OBJ_SCOPE
, "Scope" },
174 { RSVP_OBJ_STYLE
, "Style" },
175 { RSVP_OBJ_FLOWSPEC
, "Flowspec" },
176 { RSVP_OBJ_FILTERSPEC
, "FilterSpec" },
177 { RSVP_OBJ_SENDER_TEMPLATE
, "Sender Template" },
178 { RSVP_OBJ_SENDER_TSPEC
, "Sender TSpec" },
179 { RSVP_OBJ_ADSPEC
, "Adspec" },
180 { RSVP_OBJ_POLICY_DATA
, "Policy Data" },
181 { RSVP_OBJ_CONFIRM
, "Confirm" },
182 { RSVP_OBJ_LABEL
, "Label" },
183 { RSVP_OBJ_LABEL_REQ
, "Label Request" },
184 { RSVP_OBJ_ERO
, "ERO" },
185 { RSVP_OBJ_RRO
, "RRO" },
186 { RSVP_OBJ_HELLO
, "Hello" },
187 { RSVP_OBJ_MESSAGE_ID
, "Message ID" },
188 { RSVP_OBJ_MESSAGE_ID_ACK
, "Message ID Ack" },
189 { RSVP_OBJ_MESSAGE_ID_LIST
, "Message ID List" },
190 { RSVP_OBJ_RECOVERY_LABEL
, "Recovery Label" },
191 { RSVP_OBJ_UPSTREAM_LABEL
, "Upstream Label" },
192 { RSVP_OBJ_LABEL_SET
, "Label Set" },
193 { RSVP_OBJ_ACCEPT_LABEL_SET
, "Acceptable Label Set" },
194 { RSVP_OBJ_DETOUR
, "Detour" },
195 { RSVP_OBJ_CLASSTYPE
, "Class Type" },
196 { RSVP_OBJ_CLASSTYPE_OLD
, "Class Type (old)" },
197 { RSVP_OBJ_SUGGESTED_LABEL
, "Suggested Label" },
198 { RSVP_OBJ_PROPERTIES
, "Properties" },
199 { RSVP_OBJ_FASTREROUTE
, "Fast Re-Route" },
200 { RSVP_OBJ_SESSION_ATTRIBUTE
, "Session Attribute" },
201 { RSVP_OBJ_GENERALIZED_UNI
, "Generalized UNI" },
202 { RSVP_OBJ_CALL_ID
, "Call-ID" },
203 { RSVP_OBJ_CALL_OPS
, "Call Capability" },
204 { RSVP_OBJ_RESTART_CAPABILITY
, "Restart Capability" },
205 { RSVP_OBJ_CAPABILITY
, "Capability" },
206 { RSVP_OBJ_NOTIFY_REQ
, "Notify Request" },
207 { RSVP_OBJ_PROTECTION
, "Protection" },
208 { RSVP_OBJ_ADMIN_STATUS
, "Administrative Status" },
209 { RSVP_OBJ_S2L
, "Sub-LSP to LSP" },
213 #define RSVP_CTYPE_IPV4 1
214 #define RSVP_CTYPE_IPV6 2
215 #define RSVP_CTYPE_TUNNEL_IPV4 7
216 #define RSVP_CTYPE_TUNNEL_IPV6 8
217 #define RSVP_CTYPE_UNI_IPV4 11 /* OIF RSVP extensions UNI 1.0 Signaling Rel. 2 */
218 #define RSVP_CTYPE_1 1
219 #define RSVP_CTYPE_2 2
220 #define RSVP_CTYPE_3 3
221 #define RSVP_CTYPE_4 4
222 #define RSVP_CTYPE_12 12
223 #define RSVP_CTYPE_13 13
224 #define RSVP_CTYPE_14 14
227 * the ctypes are not globally unique so for
228 * translating it to strings we build a table based
229 * on objects offsetted by the ctype
232 static const struct tok rsvp_ctype_values
[] = {
233 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV4
, "IPv4" },
234 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV6
, "IPv6" },
235 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
236 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
237 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV4
, "IPv4" },
238 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV6
, "IPv6" },
239 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV4
, "IPv4" },
240 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV6
, "IPv6" },
241 { 256*RSVP_OBJ_TIME_VALUES
+RSVP_CTYPE_1
, "1" },
242 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_1
, "obsolete" },
243 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_2
, "IntServ" },
244 { 256*RSVP_OBJ_SENDER_TSPEC
+RSVP_CTYPE_2
, "IntServ" },
245 { 256*RSVP_OBJ_ADSPEC
+RSVP_CTYPE_2
, "IntServ" },
246 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
247 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
248 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_3
, "IPv6 Flow-label" },
249 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
250 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
251 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
252 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV4
, "IPv4" },
253 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV6
, "IPv6" },
254 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
255 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_UNI_IPV4
, "UNI IPv4" },
256 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_13
, "IPv4 P2MP LSP Tunnel" },
257 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_14
, "IPv6 P2MP LSP Tunnel" },
258 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV4
, "IPv4" },
259 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV6
, "IPv6" },
260 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
261 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
262 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
263 { 256*RSVP_OBJ_MESSAGE_ID
+RSVP_CTYPE_1
, "1" },
264 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_1
, "Message id ack" },
265 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_2
, "Message id nack" },
266 { 256*RSVP_OBJ_MESSAGE_ID_LIST
+RSVP_CTYPE_1
, "1" },
267 { 256*RSVP_OBJ_STYLE
+RSVP_CTYPE_1
, "1" },
268 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_1
, "Hello Request" },
269 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_2
, "Hello Ack" },
270 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_1
, "without label range" },
271 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_2
, "with ATM label range" },
272 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_3
, "with FR label range" },
273 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_4
, "Generalized Label" },
274 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_1
, "Label" },
275 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
276 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
277 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_1
, "Label" },
278 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
279 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
280 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_1
, "Label" },
281 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
282 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
283 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_1
, "Label" },
284 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
285 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
286 { 256*RSVP_OBJ_ERO
+RSVP_CTYPE_IPV4
, "IPv4" },
287 { 256*RSVP_OBJ_RRO
+RSVP_CTYPE_IPV4
, "IPv4" },
288 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
289 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
290 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
291 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
292 { 256*RSVP_OBJ_RESTART_CAPABILITY
+RSVP_CTYPE_1
, "IPv4" },
293 { 256*RSVP_OBJ_CAPABILITY
+RSVP_CTYPE_1
, "1" },
294 { 256*RSVP_OBJ_SESSION_ATTRIBUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
295 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" }, /* old style*/
296 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_1
, "1" }, /* new style */
297 { 256*RSVP_OBJ_DETOUR
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
298 { 256*RSVP_OBJ_PROPERTIES
+RSVP_CTYPE_1
, "1" },
299 { 256*RSVP_OBJ_ADMIN_STATUS
+RSVP_CTYPE_1
, "1" },
300 { 256*RSVP_OBJ_CLASSTYPE
+RSVP_CTYPE_1
, "1" },
301 { 256*RSVP_OBJ_CLASSTYPE_OLD
+RSVP_CTYPE_1
, "1" },
302 { 256*RSVP_OBJ_LABEL_SET
+RSVP_CTYPE_1
, "1" },
303 { 256*RSVP_OBJ_GENERALIZED_UNI
+RSVP_CTYPE_1
, "1" },
304 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV4
, "IPv4 sub-LSP" },
305 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV6
, "IPv6 sub-LSP" },
310 * XXX - this assumes a 16-byte digest, which is true for HMAC-MD5, but
311 * isn't necessarily the case for other hash algorithms.
313 * Unless I've missed something, there's nothing in RFC 2747 to indicate
314 * the hash algorithm being used, so it's presumably something set up
315 * out-of-band, or negotiated by other RSVP objects.
317 struct rsvp_obj_integrity_t
{
325 static const struct tok rsvp_obj_integrity_flag_values
[] = {
326 { 0x80, "Handshake" },
330 struct rsvp_obj_frr_t
{
331 nd_uint8_t setup_prio
;
332 nd_uint8_t hold_prio
;
333 nd_uint8_t hop_limit
;
336 nd_uint32_t include_any
;
337 nd_uint32_t exclude_any
;
338 nd_uint32_t include_all
;
342 #define RSVP_OBJ_XRO_MASK_SUBOBJ(x) ((x)&0x7f)
343 #define RSVP_OBJ_XRO_MASK_LOOSE(x) ((x)&0x80)
345 #define RSVP_OBJ_CAPABILITY_FLAGS_MASK 0x7U
347 #define RSVP_OBJ_XRO_RES 0
348 #define RSVP_OBJ_XRO_IPV4 1
349 #define RSVP_OBJ_XRO_IPV6 2
350 #define RSVP_OBJ_XRO_LABEL 3
351 #define RSVP_OBJ_XRO_ASN 32
352 #define RSVP_OBJ_XRO_MPLS 64
354 static const struct tok rsvp_obj_xro_values
[] = {
355 { RSVP_OBJ_XRO_RES
, "Reserved" },
356 { RSVP_OBJ_XRO_IPV4
, "IPv4 prefix" },
357 { RSVP_OBJ_XRO_IPV6
, "IPv6 prefix" },
358 { RSVP_OBJ_XRO_LABEL
, "Label" },
359 { RSVP_OBJ_XRO_ASN
, "Autonomous system number" },
360 { RSVP_OBJ_XRO_MPLS
, "MPLS label switched path termination" },
365 static const struct tok rsvp_obj_rro_flag_values
[] = {
366 { 0x01, "Local protection available" },
367 { 0x02, "Local protection in use" },
368 { 0x04, "Bandwidth protection" },
369 { 0x08, "Node protection" },
374 static const struct tok rsvp_obj_rro_label_flag_values
[] = {
379 static const struct tok rsvp_resstyle_values
[] = {
380 { 17, "Wildcard Filter" },
381 { 10, "Fixed Filter" },
382 { 18, "Shared Explicit" },
386 #define RSVP_OBJ_INTSERV_GUARANTEED_SERV 2
387 #define RSVP_OBJ_INTSERV_CONTROLLED_LOAD 5
389 static const struct tok rsvp_intserv_service_type_values
[] = {
390 { 1, "Default/Global Information" },
391 { RSVP_OBJ_INTSERV_GUARANTEED_SERV
, "Guaranteed Service" },
392 { RSVP_OBJ_INTSERV_CONTROLLED_LOAD
, "Controlled Load" },
396 static const struct tok rsvp_intserv_parameter_id_values
[] = {
398 { 6, "Path b/w estimate" },
399 { 8, "Minimum path latency" },
400 { 10, "Composed MTU" },
401 { 127, "Token Bucket TSpec" },
402 { 130, "Guaranteed Service RSpec" },
403 { 133, "End-to-end composed value for C" },
404 { 134, "End-to-end composed value for D" },
405 { 135, "Since-last-reshaping point composed C" },
406 { 136, "Since-last-reshaping point composed D" },
410 static const struct tok rsvp_session_attribute_flag_values
[] = {
411 { 0x01, "Local Protection" },
412 { 0x02, "Label Recording" },
413 { 0x04, "SE Style" },
414 { 0x08, "Bandwidth protection" }, /* RFC4090 */
415 { 0x10, "Node protection" }, /* RFC4090 */
419 static const struct tok rsvp_obj_prop_tlv_values
[] = {
421 { 0x02, "Metric 1" },
422 { 0x04, "Metric 2" },
423 { 0x08, "CCC Status" },
424 { 0x10, "Path Type" },
428 #define RSVP_OBJ_ERROR_SPEC_CODE_ROUTING 24
429 #define RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY 25
430 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE 28
431 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD 125
433 static const struct tok rsvp_obj_error_code_values
[] = {
434 { RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
, "Routing Problem" },
435 { RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY
, "Notify Error" },
436 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
, "Diffserv TE Error" },
437 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
, "Diffserv TE Error (Old)" },
441 static const struct tok rsvp_obj_error_code_routing_values
[] = {
442 { 1, "Bad EXPLICIT_ROUTE object" },
443 { 2, "Bad strict node" },
444 { 3, "Bad loose node" },
445 { 4, "Bad initial subobject" },
446 { 5, "No route available toward destination" },
447 { 6, "Unacceptable label value" },
448 { 7, "RRO indicated routing loops" },
449 { 8, "non-RSVP-capable router in the path" },
450 { 9, "MPLS label allocation failure" },
451 { 10, "Unsupported L3PID" },
455 static const struct tok rsvp_obj_error_code_diffserv_te_values
[] = {
456 { 1, "Unexpected CT object" },
457 { 2, "Unsupported CT" },
458 { 3, "Invalid CT value" },
459 { 4, "CT/setup priority do not form a configured TE-Class" },
460 { 5, "CT/holding priority do not form a configured TE-Class" },
461 { 6, "CT/setup priority and CT/holding priority do not form a configured TE-Class" },
462 { 7, "Inconsistency between signaled PSC and signaled CT" },
463 { 8, "Inconsistency between signaled PHBs and signaled CT" },
467 /* rfc3473 / rfc 3471 */
468 static const struct tok rsvp_obj_admin_status_flag_values
[] = {
469 { 0x80000000, "Reflect" },
470 { 0x00000004, "Testing" },
471 { 0x00000002, "Admin-down" },
472 { 0x00000001, "Delete-in-progress" },
476 /* label set actions - rfc3471 */
477 #define LABEL_SET_INCLUSIVE_LIST 0
478 #define LABEL_SET_EXCLUSIVE_LIST 1
479 #define LABEL_SET_INCLUSIVE_RANGE 2
480 #define LABEL_SET_EXCLUSIVE_RANGE 3
482 static const struct tok rsvp_obj_label_set_action_values
[] = {
483 { LABEL_SET_INCLUSIVE_LIST
, "Inclusive list" },
484 { LABEL_SET_EXCLUSIVE_LIST
, "Exclusive list" },
485 { LABEL_SET_INCLUSIVE_RANGE
, "Inclusive range" },
486 { LABEL_SET_EXCLUSIVE_RANGE
, "Exclusive range" },
490 /* OIF RSVP extensions UNI 1.0 Signaling, release 2 */
491 #define RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS 1
492 #define RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS 2
493 #define RSVP_GEN_UNI_SUBOBJ_DIVERSITY 3
494 #define RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL 4
495 #define RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL 5
497 static const struct tok rsvp_obj_generalized_uni_values
[] = {
498 { RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
, "Source TNA address" },
499 { RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
, "Destination TNA address" },
500 { RSVP_GEN_UNI_SUBOBJ_DIVERSITY
, "Diversity" },
501 { RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
, "Egress label" },
502 { RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
, "Service level" },
507 * this is a dissector for all the intserv defined
508 * specs as defined per rfc2215
509 * it is called from various rsvp objects;
510 * returns the amount of bytes being processed
513 rsvp_intserv_print(netdissect_options
*ndo
,
514 const u_char
*tptr
, u_int obj_tlen
)
516 u_int parameter_id
,parameter_length
;
519 ND_ICHECK_U(obj_tlen
, <, 4);
520 parameter_id
= GET_U_1(tptr
);
521 parameter_length
= GET_BE_U_2(tptr
+ 2)<<2; /* convert wordcount to bytecount */
523 ND_PRINT("\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
524 tok2str(rsvp_intserv_parameter_id_values
,"unknown",parameter_id
),
529 ND_ICHECK_U(obj_tlen
, <, parameter_length
+ 4);
530 switch(parameter_id
) { /* parameter_id */
534 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
535 * | 4 (e) | (f) | 1 (g) |
536 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
537 * | IS hop cnt (32-bit unsigned integer) |
538 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
540 if (parameter_length
== 4) {
541 ND_PRINT("\n\t\tIS hop count: %u", GET_BE_U_4(tptr
+ 4));
547 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
548 * | 6 (h) | (i) | 1 (j) |
549 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
550 * | Path b/w estimate (32-bit IEEE floating point number) |
551 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
553 if (parameter_length
== 4) {
554 bw
= GET_BE_F_4(tptr
+ 4);
555 ND_PRINT("\n\t\tPath b/w estimate: %.10g Mbps", bw
/ 125000);
561 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
562 * | 8 (k) | (l) | 1 (m) |
563 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
564 * | Minimum path latency (32-bit integer) |
565 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
567 if (parameter_length
== 4) {
568 ND_PRINT("\n\t\tMinimum path latency: ");
569 if (GET_BE_U_4(tptr
+ 4) == 0xffffffff)
570 ND_PRINT("don't care");
572 ND_PRINT("%u", GET_BE_U_4(tptr
+ 4));
579 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
580 * | 10 (n) | (o) | 1 (p) |
581 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
582 * | Composed MTU (32-bit unsigned integer) |
583 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
585 if (parameter_length
== 4) {
586 ND_PRINT("\n\t\tComposed MTU: %u bytes", GET_BE_U_4(tptr
+ 4));
591 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
592 * | 127 (e) | 0 (f) | 5 (g) |
593 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
594 * | Token Bucket Rate [r] (32-bit IEEE floating point number) |
595 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
596 * | Token Bucket Size [b] (32-bit IEEE floating point number) |
597 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
598 * | Peak Data Rate [p] (32-bit IEEE floating point number) |
599 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
600 * | Minimum Policed Unit [m] (32-bit integer) |
601 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
602 * | Maximum Packet Size [M] (32-bit integer) |
603 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
606 if (parameter_length
== 20) {
607 bw
= GET_BE_F_4(tptr
+ 4);
608 ND_PRINT("\n\t\tToken Bucket Rate: %.10g Mbps", bw
/ 125000);
609 bw
= GET_BE_F_4(tptr
+ 8);
610 ND_PRINT("\n\t\tToken Bucket Size: %.10g bytes", bw
);
611 bw
= GET_BE_F_4(tptr
+ 12);
612 ND_PRINT("\n\t\tPeak Data Rate: %.10g Mbps", bw
/ 125000);
613 ND_PRINT("\n\t\tMinimum Policed Unit: %u bytes",
614 GET_BE_U_4(tptr
+ 16));
615 ND_PRINT("\n\t\tMaximum Packet Size: %u bytes",
616 GET_BE_U_4(tptr
+ 20));
622 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
623 * | 130 (h) | 0 (i) | 2 (j) |
624 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
625 * | Rate [R] (32-bit IEEE floating point number) |
626 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
627 * | Slack Term [S] (32-bit integer) |
628 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
631 if (parameter_length
== 8) {
632 bw
= GET_BE_F_4(tptr
+ 4);
633 ND_PRINT("\n\t\tRate: %.10g Mbps", bw
/ 125000);
634 ND_PRINT("\n\t\tSlack Term: %u", GET_BE_U_4(tptr
+ 8));
642 if (parameter_length
== 4) {
643 ND_PRINT("\n\t\tValue: %u", GET_BE_U_4(tptr
+ 4));
648 if (ndo
->ndo_vflag
<= 1)
649 print_unknown_data(ndo
, tptr
+ 4, "\n\t\t", parameter_length
);
651 return (parameter_length
+4); /* header length 4 bytes */
654 nd_print_invalid(ndo
);
659 * Clear checksum prior to signature verification.
662 rsvp_clear_checksum(void *header
)
664 struct rsvp_common_header
*rsvp_com_header
= (struct rsvp_common_header
*) header
;
666 rsvp_com_header
->checksum
[0] = 0;
667 rsvp_com_header
->checksum
[1] = 0;
671 rsvp_obj_print(netdissect_options
*ndo
,
672 const u_char
*pptr
, u_int plen
, const u_char
*tptr
,
673 const char *indent
, u_int tlen
,
674 const struct rsvp_common_header
*rsvp_com_header
)
676 const struct rsvp_object_header
*rsvp_obj_header
;
677 const u_char
*obj_tptr
;
679 const struct rsvp_obj_integrity_t
*rsvp_obj_integrity
;
680 const struct rsvp_obj_frr_t
*rsvp_obj_frr
;
683 u_short rsvp_obj_len
,rsvp_obj_ctype
,rsvp_obj_class_num
;
684 u_int obj_tlen
,intserv_serv_tlen
;
686 u_int processed
,padbytes
,error_code
,error_value
,i
,sigcheck
;
690 u_int action
, subchannel
;
692 while(tlen
>=sizeof(struct rsvp_object_header
)) {
693 rsvp_obj_header
= (const struct rsvp_object_header
*)tptr
;
694 rsvp_obj_len
=GET_BE_U_2(rsvp_obj_header
->length
);
695 rsvp_obj_ctype
=GET_U_1(rsvp_obj_header
->ctype
);
697 if(rsvp_obj_len
% 4) {
698 ND_PRINT("%sERROR: object header size %u not a multiple of 4", indent
, rsvp_obj_len
);
701 if(rsvp_obj_len
< sizeof(struct rsvp_object_header
)) {
702 ND_PRINT("%sERROR: object header too short %u < %zu", indent
, rsvp_obj_len
,
703 sizeof(struct rsvp_object_header
));
707 rsvp_obj_class_num
= GET_U_1(rsvp_obj_header
->class_num
);
708 ND_PRINT("%s%s Object (%u) Flags: [%s",
710 tok2str(rsvp_obj_values
,
714 (rsvp_obj_class_num
& 0x80) ?
715 ((rsvp_obj_class_num
& 0x40) ? "ignore and forward" :
719 ND_PRINT(" if unknown], Class-Type: %s (%u), length: %u",
720 tok2str(rsvp_ctype_values
,
722 (rsvp_obj_class_num
<<8)+rsvp_obj_ctype
),
726 if(tlen
< rsvp_obj_len
) {
727 ND_PRINT("%sERROR: object goes past end of objects TLV", indent
);
731 obj_tptr
=tptr
+sizeof(struct rsvp_object_header
);
732 obj_tlen
=rsvp_obj_len
-sizeof(struct rsvp_object_header
);
734 /* did we capture enough for fully decoding the object ? */
735 ND_TCHECK_LEN(tptr
, rsvp_obj_len
);
738 switch(rsvp_obj_class_num
) {
739 case RSVP_OBJ_SESSION
:
740 switch(rsvp_obj_ctype
) {
741 case RSVP_CTYPE_IPV4
:
744 ND_PRINT("%s IPv4 DestAddress: %s, Protocol ID: 0x%02x",
746 GET_IPADDR_STRING(obj_tptr
),
747 GET_U_1(obj_tptr
+ sizeof(nd_ipv4
)));
748 ND_PRINT("%s Flags: [0x%02x], DestPort %u",
750 GET_U_1((obj_tptr
+ 5)),
751 GET_BE_U_2(obj_tptr
+ 6));
755 case RSVP_CTYPE_IPV6
:
758 ND_PRINT("%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
760 GET_IP6ADDR_STRING(obj_tptr
),
761 GET_U_1(obj_tptr
+ sizeof(nd_ipv6
)));
762 ND_PRINT("%s Flags: [0x%02x], DestPort %u",
764 GET_U_1((obj_tptr
+ sizeof(nd_ipv6
) + 1)),
765 GET_BE_U_2(obj_tptr
+ sizeof(nd_ipv6
) + 2));
770 case RSVP_CTYPE_TUNNEL_IPV6
:
773 ND_PRINT("%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
775 GET_IP6ADDR_STRING(obj_tptr
),
776 GET_BE_U_2(obj_tptr
+ 18),
777 GET_IP6ADDR_STRING(obj_tptr
+ 20));
782 case RSVP_CTYPE_14
: /* IPv6 p2mp LSP Tunnel */
785 ND_PRINT("%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
787 GET_BE_U_4(obj_tptr
),
788 GET_BE_U_2(obj_tptr
+ 6),
789 GET_IP6ADDR_STRING(obj_tptr
+ 8));
793 case RSVP_CTYPE_13
: /* IPv4 p2mp LSP Tunnel */
796 ND_PRINT("%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
798 GET_IPADDR_STRING(obj_tptr
),
799 GET_BE_U_2(obj_tptr
+ 6),
800 GET_IPADDR_STRING(obj_tptr
+ 8));
804 case RSVP_CTYPE_TUNNEL_IPV4
:
805 case RSVP_CTYPE_UNI_IPV4
:
808 ND_PRINT("%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
810 GET_IPADDR_STRING(obj_tptr
),
811 GET_BE_U_2(obj_tptr
+ 6),
812 GET_IPADDR_STRING(obj_tptr
+ 8));
821 case RSVP_OBJ_CONFIRM
:
822 switch(rsvp_obj_ctype
) {
823 case RSVP_CTYPE_IPV4
:
824 if (obj_tlen
< sizeof(nd_ipv4
))
826 ND_PRINT("%s IPv4 Receiver Address: %s",
828 GET_IPADDR_STRING(obj_tptr
));
829 obj_tlen
-=sizeof(nd_ipv4
);
830 obj_tptr
+=sizeof(nd_ipv4
);
832 case RSVP_CTYPE_IPV6
:
833 if (obj_tlen
< sizeof(nd_ipv6
))
835 ND_PRINT("%s IPv6 Receiver Address: %s",
837 GET_IP6ADDR_STRING(obj_tptr
));
838 obj_tlen
-=sizeof(nd_ipv6
);
839 obj_tptr
+=sizeof(nd_ipv6
);
846 case RSVP_OBJ_NOTIFY_REQ
:
847 switch(rsvp_obj_ctype
) {
848 case RSVP_CTYPE_IPV4
:
849 if (obj_tlen
< sizeof(nd_ipv4
))
851 ND_PRINT("%s IPv4 Notify Node Address: %s",
853 GET_IPADDR_STRING(obj_tptr
));
854 obj_tlen
-=sizeof(nd_ipv4
);
855 obj_tptr
+=sizeof(nd_ipv4
);
857 case RSVP_CTYPE_IPV6
:
858 if (obj_tlen
< sizeof(nd_ipv6
))
860 ND_PRINT("%s IPv6 Notify Node Address: %s",
862 GET_IP6ADDR_STRING(obj_tptr
));
863 obj_tlen
-=sizeof(nd_ipv6
);
864 obj_tptr
+=sizeof(nd_ipv6
);
871 case RSVP_OBJ_SUGGESTED_LABEL
: /* fall through */
872 case RSVP_OBJ_UPSTREAM_LABEL
: /* fall through */
873 case RSVP_OBJ_RECOVERY_LABEL
: /* fall through */
875 switch(rsvp_obj_ctype
) {
877 while(obj_tlen
>= 4 ) {
878 ND_PRINT("%s Label: %u", indent
, GET_BE_U_4(obj_tptr
));
886 ND_PRINT("%s Generalized Label: %u",
888 GET_BE_U_4(obj_tptr
));
895 ND_PRINT("%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
897 GET_BE_U_4(obj_tptr
),
899 GET_BE_U_4(obj_tptr
+ 4),
900 GET_BE_U_4(obj_tptr
+ 8));
910 switch(rsvp_obj_ctype
) {
914 ND_PRINT("%s Reservation Style: %s, Flags: [0x%02x]",
916 tok2str(rsvp_resstyle_values
,
918 GET_BE_U_3(obj_tptr
+ 1)),
928 case RSVP_OBJ_SENDER_TEMPLATE
:
929 switch(rsvp_obj_ctype
) {
930 case RSVP_CTYPE_IPV4
:
933 ND_PRINT("%s Source Address: %s, Source Port: %u",
935 GET_IPADDR_STRING(obj_tptr
),
936 GET_BE_U_2(obj_tptr
+ 6));
940 case RSVP_CTYPE_IPV6
:
943 ND_PRINT("%s Source Address: %s, Source Port: %u",
945 GET_IP6ADDR_STRING(obj_tptr
),
946 GET_BE_U_2(obj_tptr
+ 18));
950 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
953 ND_PRINT("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
954 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
956 GET_IP6ADDR_STRING(obj_tptr
),
957 GET_BE_U_2(obj_tptr
+ 18),
959 GET_IP6ADDR_STRING(obj_tptr
+20),
960 GET_BE_U_2(obj_tptr
+ 38));
964 case RSVP_CTYPE_TUNNEL_IPV4
:
967 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
969 GET_IPADDR_STRING(obj_tptr
),
970 GET_BE_U_2(obj_tptr
+ 6));
974 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
977 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
978 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
980 GET_IPADDR_STRING(obj_tptr
),
981 GET_BE_U_2(obj_tptr
+ 6),
983 GET_IPADDR_STRING(obj_tptr
+8),
984 GET_BE_U_2(obj_tptr
+ 12));
993 case RSVP_OBJ_LABEL_REQ
:
994 switch(rsvp_obj_ctype
) {
996 while(obj_tlen
>= 4 ) {
997 ND_PRINT("%s L3 Protocol ID: %s",
999 tok2str(ethertype_values
,
1000 "Unknown Protocol (0x%04x)",
1001 GET_BE_U_2(obj_tptr
+ 2)));
1009 ND_PRINT("%s L3 Protocol ID: %s",
1011 tok2str(ethertype_values
,
1012 "Unknown Protocol (0x%04x)",
1013 GET_BE_U_2(obj_tptr
+ 2)));
1014 ND_PRINT(",%s merge capability",
1015 ((GET_U_1(obj_tptr
+ 4)) & 0x80) ? "no" : "" );
1016 ND_PRINT("%s Minimum VPI/VCI: %u/%u",
1018 (GET_BE_U_2(obj_tptr
+ 4))&0xfff,
1019 (GET_BE_U_2(obj_tptr
+ 6)) & 0xfff);
1020 ND_PRINT("%s Maximum VPI/VCI: %u/%u",
1022 (GET_BE_U_2(obj_tptr
+ 8))&0xfff,
1023 (GET_BE_U_2(obj_tptr
+ 10)) & 0xfff);
1030 ND_PRINT("%s L3 Protocol ID: %s",
1032 tok2str(ethertype_values
,
1033 "Unknown Protocol (0x%04x)",
1034 GET_BE_U_2(obj_tptr
+ 2)));
1035 ND_PRINT("%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1037 (GET_BE_U_4(obj_tptr
+ 4))&0x7fffff,
1038 (GET_BE_U_4(obj_tptr
+ 8))&0x7fffff,
1039 (((GET_BE_U_2(obj_tptr
+ 4)>>7)&3) == 0 ) ? "10" : "",
1040 (((GET_BE_U_2(obj_tptr
+ 4) >> 7) & 3) == 2 ) ? "23" : "");
1047 ND_PRINT("%s LSP Encoding Type: %s (%u)",
1049 tok2str(gmpls_encoding_values
,
1053 ND_PRINT("%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1055 tok2str(gmpls_switch_cap_values
,
1057 GET_U_1((obj_tptr
+ 1))),
1058 GET_U_1(obj_tptr
+ 1),
1059 tok2str(gmpls_payload_values
,
1061 GET_BE_U_2(obj_tptr
+ 2)),
1062 GET_BE_U_2(obj_tptr
+ 2));
1073 switch(rsvp_obj_ctype
) {
1074 case RSVP_CTYPE_IPV4
:
1075 while(obj_tlen
>= 4 ) {
1078 ND_TCHECK_4(obj_tptr
);
1079 length
= GET_U_1(obj_tptr
+ 1);
1080 ND_PRINT("%s Subobject Type: %s, length %u",
1082 tok2str(rsvp_obj_xro_values
,
1084 RSVP_OBJ_XRO_MASK_SUBOBJ(GET_U_1(obj_tptr
))),
1086 if (obj_tlen
< length
) {
1087 ND_PRINT("%s ERROR: ERO subobject length > object length", indent
);
1091 if (length
== 0) { /* prevent infinite loops */
1092 ND_PRINT("%s ERROR: zero length ERO subtype", indent
);
1096 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(GET_U_1(obj_tptr
))) {
1097 u_char prefix_length
;
1099 case RSVP_OBJ_XRO_IPV4
:
1101 ND_PRINT(" ERROR: length != 8");
1104 ND_TCHECK_8(obj_tptr
);
1105 prefix_length
= GET_U_1(obj_tptr
+ 6);
1106 if (prefix_length
!= 32) {
1107 ND_PRINT(" ERROR: Prefix length %u != 32",
1111 ND_PRINT(", %s, %s/%u, Flags: [%s]",
1112 RSVP_OBJ_XRO_MASK_LOOSE(GET_U_1(obj_tptr
)) ? "Loose" : "Strict",
1113 GET_IPADDR_STRING(obj_tptr
+2),
1114 GET_U_1((obj_tptr
+ 6)),
1115 bittok2str(rsvp_obj_rro_flag_values
,
1117 GET_U_1((obj_tptr
+ 7)))); /* rfc3209 says that this field is rsvd. */
1119 case RSVP_OBJ_XRO_LABEL
:
1121 ND_PRINT(" ERROR: length != 8");
1124 ND_PRINT(", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1125 bittok2str(rsvp_obj_rro_label_flag_values
,
1127 GET_U_1((obj_tptr
+ 2))),
1128 GET_U_1(obj_tptr
+ 2),
1129 tok2str(rsvp_ctype_values
,
1131 GET_U_1((obj_tptr
+ 3)) + (256 * RSVP_OBJ_RRO
)),
1132 GET_U_1((obj_tptr
+ 3)),
1133 GET_BE_U_4(obj_tptr
+ 4));
1144 case RSVP_OBJ_HELLO
:
1145 switch(rsvp_obj_ctype
) {
1150 ND_PRINT("%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1152 GET_BE_U_4(obj_tptr
),
1153 GET_BE_U_4(obj_tptr
+ 4));
1162 case RSVP_OBJ_RESTART_CAPABILITY
:
1163 switch(rsvp_obj_ctype
) {
1167 ND_PRINT("%s Restart Time: %ums, Recovery Time: %ums",
1169 GET_BE_U_4(obj_tptr
),
1170 GET_BE_U_4(obj_tptr
+ 4));
1179 case RSVP_OBJ_CAPABILITY
:
1180 switch(rsvp_obj_ctype
) {
1184 uint32_t unused_and_flags
= GET_BE_U_4(obj_tptr
);
1185 if (unused_and_flags
& ~RSVP_OBJ_CAPABILITY_FLAGS_MASK
)
1186 ND_PRINT("%s [reserved=0x%08x must be zero]", indent
,
1187 unused_and_flags
& ~RSVP_OBJ_CAPABILITY_FLAGS_MASK
);
1188 ND_PRINT("%s Flags: [%s]",
1190 bittok2str(rsvp_obj_capability_flag_values
,
1192 (unused_and_flags
& RSVP_OBJ_CAPABILITY_FLAGS_MASK
)));
1201 case RSVP_OBJ_SESSION_ATTRIBUTE
:
1202 switch(rsvp_obj_ctype
) {
1203 case RSVP_CTYPE_TUNNEL_IPV4
:
1206 namelen
= GET_U_1(obj_tptr
+ 3);
1207 if (obj_tlen
< 4+namelen
)
1209 ND_PRINT("%s Session Name: ", indent
);
1210 for (i
= 0; i
< namelen
; i
++)
1211 fn_print_char(ndo
, GET_U_1(obj_tptr
+ 4 + i
));
1212 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1215 GET_U_1(obj_tptr
+ 1),
1216 bittok2str(rsvp_session_attribute_flag_values
,
1218 GET_U_1((obj_tptr
+ 2))),
1219 GET_U_1(obj_tptr
+ 2));
1220 obj_tlen
-=4+namelen
;
1221 obj_tptr
+=4+namelen
;
1228 case RSVP_OBJ_GENERALIZED_UNI
:
1229 switch(rsvp_obj_ctype
) {
1230 u_int subobj_type
,af
,subobj_len
,total_subobj_len
;
1237 /* read variable length subobjects */
1238 total_subobj_len
= obj_tlen
;
1239 while(total_subobj_len
!= 0) {
1240 /* If RFC 3476 Section 3.1 defined that a sub-object of the
1241 * GENERALIZED_UNI RSVP object must have the Length field as
1242 * a multiple of 4, instead of the check below it would be
1243 * better to test total_subobj_len only once before the loop.
1244 * So long as it does not define it and this while loop does
1245 * not implement such a requirement, let's accept that within
1246 * each iteration subobj_len may happen to be a multiple of 1
1247 * and test it and total_subobj_len respectively.
1249 ND_ICHECK_U(total_subobj_len
, <, 4);
1250 subobj_len
= GET_BE_U_2(obj_tptr
);
1251 subobj_type
= (GET_BE_U_2(obj_tptr
+ 2))>>8;
1252 af
= (GET_BE_U_2(obj_tptr
+ 2))&0x00FF;
1254 ND_PRINT("%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1256 tok2str(rsvp_obj_generalized_uni_values
, "Unknown", subobj_type
),
1258 tok2str(af_values
, "Unknown", af
), af
,
1261 /* In addition to what is explained above, the same spec does not
1262 * explicitly say that the same Length field includes the 4-octet
1263 * sub-object header, but as long as this while loop implements it
1264 * as it does include, let's keep the check below consistent with
1265 * the rest of the code.
1267 * XXX - RFC 3476 Section 3.1 says "The contents of these
1268 * sub-objects are described in [8]", where [8] is
1269 * UNI 1.0 Signaling Specification, The Optical
1270 * Internetworking Forum. The URL they give for that
1273 * http://www.oiforum.com/public/UNI_1.0_ia.html
1275 * but that doesn't work; the new URL appears to be
1277 * https://web.archive.org/web/20160401194747/http://www.oiforum.com/public/documents/OIF-UNI-01.0.pdf
1279 * and *that* document, in section 12.5.2.3
1280 * "GENERALIZED_UNI Object (Class-Num=11bbbbbb (TBA))",
1281 * says nothing about the length field in general, but
1282 * some of the examples it gives in subsections have
1283 * length field values that clearly includes the length
1284 * of the sub-object header as well as the length of the
1287 if(subobj_len
< 4 || subobj_len
> total_subobj_len
||
1288 obj_tlen
< subobj_len
)
1291 switch(subobj_type
) {
1292 case RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
:
1293 case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
:
1298 goto subobj_tooshort
;
1299 ND_PRINT("%s UNI IPv4 TNA address: %s",
1300 indent
, GET_IPADDR_STRING(obj_tptr
+ 4));
1303 if (subobj_len
< 20)
1304 goto subobj_tooshort
;
1305 ND_PRINT("%s UNI IPv6 TNA address: %s",
1306 indent
, GET_IP6ADDR_STRING(obj_tptr
+ 4));
1310 /* unless we have a TLV parser lets just hexdump */
1317 case RSVP_GEN_UNI_SUBOBJ_DIVERSITY
:
1318 if (subobj_len
> 4) {
1319 /* unless we have a TLV parser lets just hexdump */
1324 case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
:
1325 if (subobj_len
< 16) {
1326 goto subobj_tooshort
;
1329 ND_PRINT("%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
1331 ((GET_BE_U_4(obj_tptr
+ 4))>>31),
1332 ((GET_BE_U_4(obj_tptr
+ 4))&0xFF),
1333 GET_BE_U_4(obj_tptr
+ 8),
1334 GET_BE_U_4(obj_tptr
+ 12));
1337 case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
:
1338 if (subobj_len
< 8) {
1339 goto subobj_tooshort
;
1342 ND_PRINT("%s Service level: %u",
1343 indent
, (GET_BE_U_4(obj_tptr
+ 4)) >> 24);
1350 total_subobj_len
-=subobj_len
;
1351 obj_tptr
+=subobj_len
;
1352 obj_tlen
+=subobj_len
;
1361 case RSVP_OBJ_RSVP_HOP
:
1362 switch(rsvp_obj_ctype
) {
1363 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1364 case RSVP_CTYPE_IPV4
:
1367 ND_PRINT("%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1369 GET_IPADDR_STRING(obj_tptr
),
1370 GET_BE_U_4(obj_tptr
+ 4));
1374 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1376 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1377 case RSVP_CTYPE_IPV6
:
1380 ND_PRINT("%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1382 GET_IP6ADDR_STRING(obj_tptr
),
1383 GET_BE_U_4(obj_tptr
+ 16));
1386 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1393 case RSVP_OBJ_TIME_VALUES
:
1394 switch(rsvp_obj_ctype
) {
1398 ND_PRINT("%s Refresh Period: %ums",
1400 GET_BE_U_4(obj_tptr
));
1409 /* those three objects do share the same semantics */
1410 case RSVP_OBJ_SENDER_TSPEC
:
1411 case RSVP_OBJ_ADSPEC
:
1412 case RSVP_OBJ_FLOWSPEC
:
1413 switch(rsvp_obj_ctype
) {
1417 ND_PRINT("%s Msg-Version: %u, length: %u",
1419 (GET_U_1(obj_tptr
) & 0xf0) >> 4,
1420 GET_BE_U_2(obj_tptr
+ 2) << 2);
1421 obj_tptr
+=4; /* get to the start of the service header */
1424 while (obj_tlen
>= 4) {
1425 intserv_serv_tlen
=GET_BE_U_2(obj_tptr
+ 2)<<2;
1426 ND_PRINT("%s Service Type: %s (%u), break bit %sset, Service length: %u",
1428 tok2str(rsvp_intserv_service_type_values
,"unknown",GET_U_1((obj_tptr
))),
1430 (GET_U_1(obj_tptr
+ 1)&0x80) ? "" : "not ",
1433 obj_tptr
+=4; /* get to the start of the parameter list */
1436 while (intserv_serv_tlen
>=4) {
1437 processed
= rsvp_intserv_print(ndo
, obj_tptr
, obj_tlen
);
1440 obj_tlen
-=processed
;
1441 intserv_serv_tlen
-=processed
;
1442 obj_tptr
+=processed
;
1451 case RSVP_OBJ_FILTERSPEC
:
1452 switch(rsvp_obj_ctype
) {
1453 case RSVP_CTYPE_IPV4
:
1456 ND_PRINT("%s Source Address: %s, Source Port: %u",
1458 GET_IPADDR_STRING(obj_tptr
),
1459 GET_BE_U_2(obj_tptr
+ 6));
1463 case RSVP_CTYPE_IPV6
:
1466 ND_PRINT("%s Source Address: %s, Source Port: %u",
1468 GET_IP6ADDR_STRING(obj_tptr
),
1469 GET_BE_U_2(obj_tptr
+ 18));
1476 ND_PRINT("%s Source Address: %s, Flow Label: %u",
1478 GET_IP6ADDR_STRING(obj_tptr
),
1479 GET_BE_U_3(obj_tptr
+ 17));
1483 case RSVP_CTYPE_TUNNEL_IPV6
:
1486 ND_PRINT("%s Source Address: %s, LSP-ID: 0x%04x",
1488 GET_IPADDR_STRING(obj_tptr
),
1489 GET_BE_U_2(obj_tptr
+ 18));
1493 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
1496 ND_PRINT("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1497 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1499 GET_IP6ADDR_STRING(obj_tptr
),
1500 GET_BE_U_2(obj_tptr
+ 18),
1502 GET_IP6ADDR_STRING(obj_tptr
+20),
1503 GET_BE_U_2(obj_tptr
+ 38));
1507 case RSVP_CTYPE_TUNNEL_IPV4
:
1510 ND_PRINT("%s Source Address: %s, LSP-ID: 0x%04x",
1512 GET_IPADDR_STRING(obj_tptr
),
1513 GET_BE_U_2(obj_tptr
+ 6));
1517 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
1520 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1521 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1523 GET_IPADDR_STRING(obj_tptr
),
1524 GET_BE_U_2(obj_tptr
+ 6),
1526 GET_IPADDR_STRING(obj_tptr
+8),
1527 GET_BE_U_2(obj_tptr
+ 12));
1536 case RSVP_OBJ_FASTREROUTE
:
1537 /* the differences between c-type 1 and 7 are minor */
1538 obj_ptr
.rsvp_obj_frr
= (const struct rsvp_obj_frr_t
*)obj_tptr
;
1540 switch(rsvp_obj_ctype
) {
1541 case RSVP_CTYPE_1
: /* new style */
1542 if (obj_tlen
< sizeof(struct rsvp_obj_frr_t
))
1544 bw
= GET_BE_F_4(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1545 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1547 GET_U_1(obj_ptr
.rsvp_obj_frr
->setup_prio
),
1548 GET_U_1(obj_ptr
.rsvp_obj_frr
->hold_prio
),
1549 GET_U_1(obj_ptr
.rsvp_obj_frr
->hop_limit
),
1551 ND_PRINT("%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
1553 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_any
),
1554 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->exclude_any
),
1555 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_all
));
1556 obj_tlen
-=sizeof(struct rsvp_obj_frr_t
);
1557 obj_tptr
+=sizeof(struct rsvp_obj_frr_t
);
1560 case RSVP_CTYPE_TUNNEL_IPV4
: /* old style */
1563 bw
= GET_BE_F_4(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1564 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1566 GET_U_1(obj_ptr
.rsvp_obj_frr
->setup_prio
),
1567 GET_U_1(obj_ptr
.rsvp_obj_frr
->hold_prio
),
1568 GET_U_1(obj_ptr
.rsvp_obj_frr
->hop_limit
),
1570 ND_PRINT("%s Include Colors: 0x%08x, Exclude Colors: 0x%08x",
1572 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_any
),
1573 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->exclude_any
));
1583 case RSVP_OBJ_DETOUR
:
1584 switch(rsvp_obj_ctype
) {
1585 case RSVP_CTYPE_TUNNEL_IPV4
:
1586 while(obj_tlen
>= 8) {
1587 ND_PRINT("%s PLR-ID: %s, Avoid-Node-ID: %s",
1589 GET_IPADDR_STRING(obj_tptr
),
1590 GET_IPADDR_STRING(obj_tptr
+ 4));
1600 case RSVP_OBJ_CLASSTYPE
:
1601 case RSVP_OBJ_CLASSTYPE_OLD
: /* fall through */
1602 switch(rsvp_obj_ctype
) {
1606 ND_PRINT("%s CT: %u",
1608 GET_BE_U_4(obj_tptr
) & 0x7);
1617 case RSVP_OBJ_ERROR_SPEC
:
1618 switch(rsvp_obj_ctype
) {
1619 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1620 case RSVP_CTYPE_IPV4
:
1623 error_code
=GET_U_1(obj_tptr
+ 5);
1624 error_value
=GET_BE_U_2(obj_tptr
+ 6);
1625 ND_PRINT("%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1627 GET_IPADDR_STRING(obj_tptr
),
1628 GET_U_1(obj_tptr
+ 4),
1630 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1632 switch (error_code
) {
1633 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1634 ND_PRINT(", Error Value: %s (%u)",
1635 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1638 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
: /* fall through */
1639 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
:
1640 ND_PRINT(", Error Value: %s (%u)",
1641 tok2str(rsvp_obj_error_code_diffserv_te_values
,"unknown",error_value
),
1645 ND_PRINT(", Unknown Error Value (%u)", error_value
);
1651 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1652 case RSVP_CTYPE_IPV6
:
1655 error_code
=GET_U_1(obj_tptr
+ 17);
1656 error_value
=GET_BE_U_2(obj_tptr
+ 18);
1657 ND_PRINT("%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1659 GET_IP6ADDR_STRING(obj_tptr
),
1660 GET_U_1(obj_tptr
+ 16),
1662 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1665 switch (error_code
) {
1666 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1667 ND_PRINT(", Error Value: %s (%u)",
1668 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1682 case RSVP_OBJ_PROPERTIES
:
1683 switch(rsvp_obj_ctype
) {
1687 padbytes
= GET_BE_U_2(obj_tptr
+ 2);
1688 ND_PRINT("%s TLV count: %u, padding bytes: %u",
1690 GET_BE_U_2(obj_tptr
),
1694 /* loop through as long there is anything longer than the TLV header (2) */
1695 while(obj_tlen
>= 2 + padbytes
) {
1696 ND_PRINT("%s %s TLV (0x%02x), length: %u", /* length includes header */
1698 tok2str(rsvp_obj_prop_tlv_values
,"unknown",GET_U_1(obj_tptr
)),
1700 GET_U_1(obj_tptr
+ 1));
1701 if (obj_tlen
< GET_U_1(obj_tptr
+ 1))
1703 if (GET_U_1(obj_tptr
+ 1) < 2) {
1704 ND_PRINT("%sERROR: property TLV is too short", indent
);
1707 print_unknown_data(ndo
, obj_tptr
+ 2, "\n\t\t",
1708 GET_U_1(obj_tptr
+ 1) - 2);
1709 obj_tlen
-=GET_U_1(obj_tptr
+ 1);
1710 obj_tptr
+=GET_U_1(obj_tptr
+ 1);
1718 case RSVP_OBJ_MESSAGE_ID
: /* fall through */
1719 case RSVP_OBJ_MESSAGE_ID_ACK
: /* fall through */
1720 case RSVP_OBJ_MESSAGE_ID_LIST
:
1721 switch(rsvp_obj_ctype
) {
1726 ND_PRINT("%s Flags [0x%02x], epoch: %u",
1729 GET_BE_U_3(obj_tptr
+ 1));
1732 /* loop through as long there are no messages left */
1733 while(obj_tlen
>= 4) {
1734 ND_PRINT("%s Message-ID 0x%08x (%u)",
1736 GET_BE_U_4(obj_tptr
),
1737 GET_BE_U_4(obj_tptr
));
1747 case RSVP_OBJ_INTEGRITY
:
1748 switch(rsvp_obj_ctype
) {
1750 if (obj_tlen
< sizeof(struct rsvp_obj_integrity_t
))
1752 obj_ptr
.rsvp_obj_integrity
= (const struct rsvp_obj_integrity_t
*)obj_tptr
;
1753 ND_PRINT("%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
1755 GET_BE_U_2(obj_ptr
.rsvp_obj_integrity
->key_id
),
1756 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->key_id
+ 2),
1757 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->sequence
),
1758 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->sequence
+ 4),
1759 bittok2str(rsvp_obj_integrity_flag_values
,
1761 GET_U_1(obj_ptr
.rsvp_obj_integrity
->flags
)));
1762 ND_PRINT("%s MD5-sum 0x%08x%08x%08x%08x ",
1764 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
),
1765 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 4),
1766 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 8),
1767 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 12));
1769 sigcheck
= signature_verify(ndo
, pptr
, plen
,
1770 obj_ptr
.rsvp_obj_integrity
->digest
,
1771 rsvp_clear_checksum
,
1773 ND_PRINT(" (%s)", tok2str(signature_check_values
, "Unknown", sigcheck
));
1775 obj_tlen
+=sizeof(struct rsvp_obj_integrity_t
);
1776 obj_tptr
+=sizeof(struct rsvp_obj_integrity_t
);
1783 case RSVP_OBJ_ADMIN_STATUS
:
1784 switch(rsvp_obj_ctype
) {
1788 ND_PRINT("%s Flags [%s]", indent
,
1789 bittok2str(rsvp_obj_admin_status_flag_values
, "none",
1790 GET_BE_U_4(obj_tptr
)));
1799 case RSVP_OBJ_LABEL_SET
:
1800 switch(rsvp_obj_ctype
) {
1804 action
= (GET_BE_U_2(obj_tptr
)>>8);
1806 ND_PRINT("%s Action: %s (%u), Label type: %u", indent
,
1807 tok2str(rsvp_obj_label_set_action_values
, "Unknown", action
),
1808 action
, (GET_BE_U_4(obj_tptr
) & 0x7F));
1811 case LABEL_SET_INCLUSIVE_RANGE
:
1812 case LABEL_SET_EXCLUSIVE_RANGE
: /* fall through */
1814 /* only a couple of subchannels are expected */
1817 ND_PRINT("%s Start range: %u, End range: %u", indent
,
1818 GET_BE_U_4(obj_tptr
+ 4),
1819 GET_BE_U_4(obj_tptr
+ 8));
1828 while(obj_tlen
>= 4 ) {
1829 ND_PRINT("%s Subchannel #%u: %u", indent
, subchannel
,
1830 GET_BE_U_4(obj_tptr
));
1844 switch (rsvp_obj_ctype
) {
1845 case RSVP_CTYPE_IPV4
:
1848 ND_PRINT("%s Sub-LSP destination address: %s",
1849 indent
, GET_IPADDR_STRING(obj_tptr
));
1854 case RSVP_CTYPE_IPV6
:
1857 ND_PRINT("%s Sub-LSP destination address: %s",
1858 indent
, GET_IP6ADDR_STRING(obj_tptr
));
1869 * FIXME those are the defined objects that lack a decoder
1870 * you are welcome to contribute code ;-)
1873 case RSVP_OBJ_SCOPE
:
1874 case RSVP_OBJ_POLICY_DATA
:
1875 case RSVP_OBJ_ACCEPT_LABEL_SET
:
1876 case RSVP_OBJ_PROTECTION
:
1878 if (ndo
->ndo_vflag
<= 1)
1879 print_unknown_data(ndo
, obj_tptr
, "\n\t ", obj_tlen
); /* FIXME indentation */
1882 /* do we also want to see a hex dump ? */
1883 if (ndo
->ndo_vflag
> 1 || hexdump
== TRUE
)
1884 print_unknown_data(ndo
, tptr
+ sizeof(struct rsvp_object_header
), "\n\t ", /* FIXME indentation */
1885 rsvp_obj_len
- sizeof(struct rsvp_object_header
));
1892 ND_PRINT("%sERROR: sub-object is too short", indent
);
1895 ND_PRINT("%sERROR: object is too short", indent
);
1898 nd_print_invalid(ndo
);
1903 rsvp_print(netdissect_options
*ndo
,
1904 const u_char
*pptr
, u_int len
)
1906 const struct rsvp_common_header
*rsvp_com_header
;
1907 uint8_t version_flags
, msg_type
;
1911 ndo
->ndo_protocol
= "rsvp";
1914 rsvp_com_header
= (const struct rsvp_common_header
*)pptr
;
1915 ND_TCHECK_SIZE(rsvp_com_header
);
1916 version_flags
= GET_U_1(rsvp_com_header
->version_flags
);
1919 * Sanity checking of the header.
1921 if (RSVP_EXTRACT_VERSION(version_flags
) != RSVP_VERSION
) {
1922 ND_PRINT("ERROR: RSVP version %u packet not supported",
1923 RSVP_EXTRACT_VERSION(version_flags
));
1927 msg_type
= GET_U_1(rsvp_com_header
->msg_type
);
1929 /* in non-verbose mode just lets print the basic Message Type*/
1930 if (ndo
->ndo_vflag
< 1) {
1931 ND_PRINT("RSVPv%u %s Message, length: %u",
1932 RSVP_EXTRACT_VERSION(version_flags
),
1933 tok2str(rsvp_msg_type_values
, "unknown (%u)",msg_type
),
1938 /* ok they seem to want to know everything - lets fully decode it */
1940 plen
= tlen
= GET_BE_U_2(rsvp_com_header
->length
);
1942 ND_PRINT("\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1943 RSVP_EXTRACT_VERSION(version_flags
),
1944 tok2str(rsvp_msg_type_values
, "unknown, type: %u",msg_type
),
1946 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(version_flags
)),
1948 GET_U_1(rsvp_com_header
->ttl
),
1949 GET_BE_U_2(rsvp_com_header
->checksum
));
1951 if (tlen
< sizeof(struct rsvp_common_header
)) {
1952 ND_PRINT("ERROR: common header too short %u < %zu", tlen
,
1953 sizeof(struct rsvp_common_header
));
1957 tptr
+=sizeof(struct rsvp_common_header
);
1958 tlen
-=sizeof(struct rsvp_common_header
);
1962 case RSVP_MSGTYPE_BUNDLE
:
1964 * Process each submessage in the bundle message.
1965 * Bundle messages may not contain bundle submessages, so we don't
1966 * need to handle bundle submessages specially.
1969 const u_char
*subpptr
=tptr
, *subtptr
;
1970 u_short subplen
, subtlen
;
1974 rsvp_com_header
= (const struct rsvp_common_header
*)subpptr
;
1975 ND_TCHECK_SIZE(rsvp_com_header
);
1976 version_flags
= GET_U_1(rsvp_com_header
->version_flags
);
1979 * Sanity checking of the header.
1981 if (RSVP_EXTRACT_VERSION(version_flags
) != RSVP_VERSION
) {
1982 ND_PRINT("ERROR: RSVP version %u packet not supported",
1983 RSVP_EXTRACT_VERSION(version_flags
));
1987 subplen
= subtlen
= GET_BE_U_2(rsvp_com_header
->length
);
1989 msg_type
= GET_U_1(rsvp_com_header
->msg_type
);
1990 ND_PRINT("\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1991 RSVP_EXTRACT_VERSION(version_flags
),
1992 tok2str(rsvp_msg_type_values
, "unknown, type: %u",msg_type
),
1994 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(version_flags
)),
1996 GET_U_1(rsvp_com_header
->ttl
),
1997 GET_BE_U_2(rsvp_com_header
->checksum
));
1999 if (subtlen
< sizeof(struct rsvp_common_header
)) {
2000 ND_PRINT("ERROR: common header too short %u < %zu", subtlen
,
2001 sizeof(struct rsvp_common_header
));
2005 if (tlen
< subtlen
) {
2006 ND_PRINT("ERROR: common header too large %u > %u", subtlen
,
2011 subtptr
+=sizeof(struct rsvp_common_header
);
2012 subtlen
-=sizeof(struct rsvp_common_header
);
2015 * Print all objects in the submessage.
2017 if (rsvp_obj_print(ndo
, subpptr
, subplen
, subtptr
, "\n\t ", subtlen
, rsvp_com_header
) == -1)
2020 tptr
+=subtlen
+sizeof(struct rsvp_common_header
);
2021 tlen
-=subtlen
+sizeof(struct rsvp_common_header
);
2026 case RSVP_MSGTYPE_PATH
:
2027 case RSVP_MSGTYPE_RESV
:
2028 case RSVP_MSGTYPE_PATHERR
:
2029 case RSVP_MSGTYPE_RESVERR
:
2030 case RSVP_MSGTYPE_PATHTEAR
:
2031 case RSVP_MSGTYPE_RESVTEAR
:
2032 case RSVP_MSGTYPE_RESVCONF
:
2033 case RSVP_MSGTYPE_HELLO_OLD
:
2034 case RSVP_MSGTYPE_HELLO
:
2035 case RSVP_MSGTYPE_ACK
:
2036 case RSVP_MSGTYPE_SREFRESH
:
2038 * Print all objects in the message.
2040 if (rsvp_obj_print(ndo
, pptr
, plen
, tptr
, "\n\t ", tlen
, rsvp_com_header
) == -1)
2045 print_unknown_data(ndo
, tptr
, "\n\t ", tlen
);