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 #include "netdissect.h"
28 #include "addrtoname.h"
29 #include "ethertype.h"
32 #include "signature.h"
36 * RFC 2205 common header
39 * +-------------+-------------+-------------+-------------+
40 * | Vers | Flags| Msg Type | RSVP Checksum |
41 * +-------------+-------------+-------------+-------------+
42 * | Send_TTL | (Reserved) | RSVP Length |
43 * +-------------+-------------+-------------+-------------+
47 struct rsvp_common_header
{
48 nd_uint8_t version_flags
;
57 * RFC2205 object header
61 * +-------------+-------------+-------------+-------------+
62 * | Length (bytes) | Class-Num | C-Type |
63 * +-------------+-------------+-------------+-------------+
65 * // (Object contents) //
67 * +-------------+-------------+-------------+-------------+
70 struct rsvp_object_header
{
76 #define RSVP_VERSION 1
77 #define RSVP_EXTRACT_VERSION(x) (((x)&0xf0)>>4)
78 #define RSVP_EXTRACT_FLAGS(x) ((x)&0x0f)
80 #define RSVP_MSGTYPE_PATH 1
81 #define RSVP_MSGTYPE_RESV 2
82 #define RSVP_MSGTYPE_PATHERR 3
83 #define RSVP_MSGTYPE_RESVERR 4
84 #define RSVP_MSGTYPE_PATHTEAR 5
85 #define RSVP_MSGTYPE_RESVTEAR 6
86 #define RSVP_MSGTYPE_RESVCONF 7
87 #define RSVP_MSGTYPE_BUNDLE 12
88 #define RSVP_MSGTYPE_ACK 13
89 #define RSVP_MSGTYPE_HELLO_OLD 14 /* ancient Hellos */
90 #define RSVP_MSGTYPE_SREFRESH 15
91 #define RSVP_MSGTYPE_HELLO 20
93 static const struct tok rsvp_msg_type_values
[] = {
94 { RSVP_MSGTYPE_PATH
, "Path" },
95 { RSVP_MSGTYPE_RESV
, "Resv" },
96 { RSVP_MSGTYPE_PATHERR
, "PathErr" },
97 { RSVP_MSGTYPE_RESVERR
, "ResvErr" },
98 { RSVP_MSGTYPE_PATHTEAR
, "PathTear" },
99 { RSVP_MSGTYPE_RESVTEAR
, "ResvTear" },
100 { RSVP_MSGTYPE_RESVCONF
, "ResvConf" },
101 { RSVP_MSGTYPE_BUNDLE
, "Bundle" },
102 { RSVP_MSGTYPE_ACK
, "Acknowledgement" },
103 { RSVP_MSGTYPE_HELLO_OLD
, "Hello (Old)" },
104 { RSVP_MSGTYPE_SREFRESH
, "Refresh" },
105 { RSVP_MSGTYPE_HELLO
, "Hello" },
109 static const struct tok rsvp_header_flag_values
[] = {
110 { 0x01, "Refresh reduction capable" }, /* rfc2961 */
114 static const struct tok rsvp_obj_capability_flag_values
[] = {
115 { 0x0004, "RecoveryPath Transmit Enabled" },
116 { 0x0002, "RecoveryPath Desired" },
117 { 0x0001, "RecoveryPath Srefresh Capable" },
121 #define RSVP_OBJ_SESSION 1 /* rfc2205 */
122 #define RSVP_OBJ_RSVP_HOP 3 /* rfc2205, rfc3473 */
123 #define RSVP_OBJ_INTEGRITY 4 /* rfc2747 */
124 #define RSVP_OBJ_TIME_VALUES 5 /* rfc2205 */
125 #define RSVP_OBJ_ERROR_SPEC 6
126 #define RSVP_OBJ_SCOPE 7
127 #define RSVP_OBJ_STYLE 8 /* rfc2205 */
128 #define RSVP_OBJ_FLOWSPEC 9 /* rfc2215 */
129 #define RSVP_OBJ_FILTERSPEC 10 /* rfc2215 */
130 #define RSVP_OBJ_SENDER_TEMPLATE 11
131 #define RSVP_OBJ_SENDER_TSPEC 12 /* rfc2215 */
132 #define RSVP_OBJ_ADSPEC 13 /* rfc2215 */
133 #define RSVP_OBJ_POLICY_DATA 14
134 #define RSVP_OBJ_CONFIRM 15 /* rfc2205 */
135 #define RSVP_OBJ_LABEL 16 /* rfc3209 */
136 #define RSVP_OBJ_LABEL_REQ 19 /* rfc3209 */
137 #define RSVP_OBJ_ERO 20 /* rfc3209 */
138 #define RSVP_OBJ_RRO 21 /* rfc3209 */
139 #define RSVP_OBJ_HELLO 22 /* rfc3209 */
140 #define RSVP_OBJ_MESSAGE_ID 23 /* rfc2961 */
141 #define RSVP_OBJ_MESSAGE_ID_ACK 24 /* rfc2961 */
142 #define RSVP_OBJ_MESSAGE_ID_LIST 25 /* rfc2961 */
143 #define RSVP_OBJ_RECOVERY_LABEL 34 /* rfc3473 */
144 #define RSVP_OBJ_UPSTREAM_LABEL 35 /* rfc3473 */
145 #define RSVP_OBJ_LABEL_SET 36 /* rfc3473 */
146 #define RSVP_OBJ_PROTECTION 37 /* rfc3473 */
147 #define RSVP_OBJ_S2L 50 /* rfc4875 */
148 #define RSVP_OBJ_DETOUR 63 /* rfc4090 */
149 #define RSVP_OBJ_CLASSTYPE 66 /* rfc4124 */
150 #define RSVP_OBJ_CLASSTYPE_OLD 125 /* draft-ietf-tewg-diff-te-proto-07 */
151 #define RSVP_OBJ_SUGGESTED_LABEL 129 /* rfc3473 */
152 #define RSVP_OBJ_ACCEPT_LABEL_SET 130 /* rfc3473 */
153 #define RSVP_OBJ_RESTART_CAPABILITY 131 /* rfc3473 */
154 #define RSVP_OBJ_CAPABILITY 134 /* rfc5063 */
155 #define RSVP_OBJ_NOTIFY_REQ 195 /* rfc3473 */
156 #define RSVP_OBJ_ADMIN_STATUS 196 /* rfc3473 */
157 #define RSVP_OBJ_PROPERTIES 204 /* juniper proprietary */
158 #define RSVP_OBJ_FASTREROUTE 205 /* rfc4090 */
159 #define RSVP_OBJ_SESSION_ATTRIBUTE 207 /* rfc3209 */
160 #define RSVP_OBJ_GENERALIZED_UNI 229 /* OIF RSVP extensions UNI 1.0 Signaling, Rel. 2 */
161 #define RSVP_OBJ_CALL_ID 230 /* rfc3474 */
162 #define RSVP_OBJ_CALL_OPS 236 /* rfc3474 */
164 static const struct tok rsvp_obj_values
[] = {
165 { RSVP_OBJ_SESSION
, "Session" },
166 { RSVP_OBJ_RSVP_HOP
, "RSVP Hop" },
167 { RSVP_OBJ_INTEGRITY
, "Integrity" },
168 { RSVP_OBJ_TIME_VALUES
, "Time Values" },
169 { RSVP_OBJ_ERROR_SPEC
, "Error Spec" },
170 { RSVP_OBJ_SCOPE
, "Scope" },
171 { RSVP_OBJ_STYLE
, "Style" },
172 { RSVP_OBJ_FLOWSPEC
, "Flowspec" },
173 { RSVP_OBJ_FILTERSPEC
, "FilterSpec" },
174 { RSVP_OBJ_SENDER_TEMPLATE
, "Sender Template" },
175 { RSVP_OBJ_SENDER_TSPEC
, "Sender TSpec" },
176 { RSVP_OBJ_ADSPEC
, "Adspec" },
177 { RSVP_OBJ_POLICY_DATA
, "Policy Data" },
178 { RSVP_OBJ_CONFIRM
, "Confirm" },
179 { RSVP_OBJ_LABEL
, "Label" },
180 { RSVP_OBJ_LABEL_REQ
, "Label Request" },
181 { RSVP_OBJ_ERO
, "ERO" },
182 { RSVP_OBJ_RRO
, "RRO" },
183 { RSVP_OBJ_HELLO
, "Hello" },
184 { RSVP_OBJ_MESSAGE_ID
, "Message ID" },
185 { RSVP_OBJ_MESSAGE_ID_ACK
, "Message ID Ack" },
186 { RSVP_OBJ_MESSAGE_ID_LIST
, "Message ID List" },
187 { RSVP_OBJ_RECOVERY_LABEL
, "Recovery Label" },
188 { RSVP_OBJ_UPSTREAM_LABEL
, "Upstream Label" },
189 { RSVP_OBJ_LABEL_SET
, "Label Set" },
190 { RSVP_OBJ_ACCEPT_LABEL_SET
, "Acceptable Label Set" },
191 { RSVP_OBJ_DETOUR
, "Detour" },
192 { RSVP_OBJ_CLASSTYPE
, "Class Type" },
193 { RSVP_OBJ_CLASSTYPE_OLD
, "Class Type (old)" },
194 { RSVP_OBJ_SUGGESTED_LABEL
, "Suggested Label" },
195 { RSVP_OBJ_PROPERTIES
, "Properties" },
196 { RSVP_OBJ_FASTREROUTE
, "Fast Re-Route" },
197 { RSVP_OBJ_SESSION_ATTRIBUTE
, "Session Attribute" },
198 { RSVP_OBJ_GENERALIZED_UNI
, "Generalized UNI" },
199 { RSVP_OBJ_CALL_ID
, "Call-ID" },
200 { RSVP_OBJ_CALL_OPS
, "Call Capability" },
201 { RSVP_OBJ_RESTART_CAPABILITY
, "Restart Capability" },
202 { RSVP_OBJ_CAPABILITY
, "Capability" },
203 { RSVP_OBJ_NOTIFY_REQ
, "Notify Request" },
204 { RSVP_OBJ_PROTECTION
, "Protection" },
205 { RSVP_OBJ_ADMIN_STATUS
, "Administrative Status" },
206 { RSVP_OBJ_S2L
, "Sub-LSP to LSP" },
210 #define RSVP_CTYPE_IPV4 1
211 #define RSVP_CTYPE_IPV6 2
212 #define RSVP_CTYPE_TUNNEL_IPV4 7
213 #define RSVP_CTYPE_TUNNEL_IPV6 8
214 #define RSVP_CTYPE_UNI_IPV4 11 /* OIF RSVP extensions UNI 1.0 Signaling Rel. 2 */
215 #define RSVP_CTYPE_1 1
216 #define RSVP_CTYPE_2 2
217 #define RSVP_CTYPE_3 3
218 #define RSVP_CTYPE_4 4
219 #define RSVP_CTYPE_12 12
220 #define RSVP_CTYPE_13 13
221 #define RSVP_CTYPE_14 14
224 * the ctypes are not globally unique so for
225 * translating it to strings we build a table based
226 * on objects offsetted by the ctype
229 static const struct tok rsvp_ctype_values
[] = {
230 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV4
, "IPv4" },
231 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV6
, "IPv6" },
232 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
233 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
234 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV4
, "IPv4" },
235 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV6
, "IPv6" },
236 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV4
, "IPv4" },
237 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV6
, "IPv6" },
238 { 256*RSVP_OBJ_TIME_VALUES
+RSVP_CTYPE_1
, "1" },
239 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_1
, "obsolete" },
240 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_2
, "IntServ" },
241 { 256*RSVP_OBJ_SENDER_TSPEC
+RSVP_CTYPE_2
, "IntServ" },
242 { 256*RSVP_OBJ_ADSPEC
+RSVP_CTYPE_2
, "IntServ" },
243 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
244 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
245 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_3
, "IPv6 Flow-label" },
246 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
247 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
248 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
249 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV4
, "IPv4" },
250 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV6
, "IPv6" },
251 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
252 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_UNI_IPV4
, "UNI IPv4" },
253 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_13
, "IPv4 P2MP LSP Tunnel" },
254 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_14
, "IPv6 P2MP LSP Tunnel" },
255 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV4
, "IPv4" },
256 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV6
, "IPv6" },
257 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
258 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
259 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
260 { 256*RSVP_OBJ_MESSAGE_ID
+RSVP_CTYPE_1
, "1" },
261 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_1
, "Message id ack" },
262 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_2
, "Message id nack" },
263 { 256*RSVP_OBJ_MESSAGE_ID_LIST
+RSVP_CTYPE_1
, "1" },
264 { 256*RSVP_OBJ_STYLE
+RSVP_CTYPE_1
, "1" },
265 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_1
, "Hello Request" },
266 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_2
, "Hello Ack" },
267 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_1
, "without label range" },
268 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_2
, "with ATM label range" },
269 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_3
, "with FR label range" },
270 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_4
, "Generalized Label" },
271 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_1
, "Label" },
272 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
273 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
274 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_1
, "Label" },
275 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
276 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
277 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_1
, "Label" },
278 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
279 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
280 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_1
, "Label" },
281 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
282 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
283 { 256*RSVP_OBJ_ERO
+RSVP_CTYPE_IPV4
, "IPv4" },
284 { 256*RSVP_OBJ_RRO
+RSVP_CTYPE_IPV4
, "IPv4" },
285 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
286 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
287 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
288 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
289 { 256*RSVP_OBJ_RESTART_CAPABILITY
+RSVP_CTYPE_1
, "IPv4" },
290 { 256*RSVP_OBJ_CAPABILITY
+RSVP_CTYPE_1
, "1" },
291 { 256*RSVP_OBJ_SESSION_ATTRIBUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
292 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" }, /* old style*/
293 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_1
, "1" }, /* new style */
294 { 256*RSVP_OBJ_DETOUR
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
295 { 256*RSVP_OBJ_PROPERTIES
+RSVP_CTYPE_1
, "1" },
296 { 256*RSVP_OBJ_ADMIN_STATUS
+RSVP_CTYPE_1
, "1" },
297 { 256*RSVP_OBJ_CLASSTYPE
+RSVP_CTYPE_1
, "1" },
298 { 256*RSVP_OBJ_CLASSTYPE_OLD
+RSVP_CTYPE_1
, "1" },
299 { 256*RSVP_OBJ_LABEL_SET
+RSVP_CTYPE_1
, "1" },
300 { 256*RSVP_OBJ_GENERALIZED_UNI
+RSVP_CTYPE_1
, "1" },
301 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV4
, "IPv4 sub-LSP" },
302 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV6
, "IPv6 sub-LSP" },
307 * XXX - this assumes a 16-byte digest, which is true for HMAC-MD5, but
308 * isn't necessarily the case for other hash algorithms.
310 * Unless I've missed something, there's nothing in RFC 2747 to indicate
311 * the hash algorithm being used, so it's presumably something set up
312 * out-of-band, or negotiated by other RSVP objects.
314 struct rsvp_obj_integrity_t
{
322 static const struct tok rsvp_obj_integrity_flag_values
[] = {
323 { 0x80, "Handshake" },
327 struct rsvp_obj_frr_t
{
332 uint8_t bandwidth
[4];
333 uint8_t include_any
[4];
334 uint8_t exclude_any
[4];
335 uint8_t include_all
[4];
339 #define RSVP_OBJ_XRO_MASK_SUBOBJ(x) ((x)&0x7f)
340 #define RSVP_OBJ_XRO_MASK_LOOSE(x) ((x)&0x80)
342 #define RSVP_OBJ_CAPABILITY_FLAGS_MASK 0x7U
344 #define RSVP_OBJ_XRO_RES 0
345 #define RSVP_OBJ_XRO_IPV4 1
346 #define RSVP_OBJ_XRO_IPV6 2
347 #define RSVP_OBJ_XRO_LABEL 3
348 #define RSVP_OBJ_XRO_ASN 32
349 #define RSVP_OBJ_XRO_MPLS 64
351 static const struct tok rsvp_obj_xro_values
[] = {
352 { RSVP_OBJ_XRO_RES
, "Reserved" },
353 { RSVP_OBJ_XRO_IPV4
, "IPv4 prefix" },
354 { RSVP_OBJ_XRO_IPV6
, "IPv6 prefix" },
355 { RSVP_OBJ_XRO_LABEL
, "Label" },
356 { RSVP_OBJ_XRO_ASN
, "Autonomous system number" },
357 { RSVP_OBJ_XRO_MPLS
, "MPLS label switched path termination" },
362 static const struct tok rsvp_obj_rro_flag_values
[] = {
363 { 0x01, "Local protection available" },
364 { 0x02, "Local protection in use" },
365 { 0x04, "Bandwidth protection" },
366 { 0x08, "Node protection" },
371 static const struct tok rsvp_obj_rro_label_flag_values
[] = {
376 static const struct tok rsvp_resstyle_values
[] = {
377 { 17, "Wildcard Filter" },
378 { 10, "Fixed Filter" },
379 { 18, "Shared Explicit" },
383 #define RSVP_OBJ_INTSERV_GUARANTEED_SERV 2
384 #define RSVP_OBJ_INTSERV_CONTROLLED_LOAD 5
386 static const struct tok rsvp_intserv_service_type_values
[] = {
387 { 1, "Default/Global Information" },
388 { RSVP_OBJ_INTSERV_GUARANTEED_SERV
, "Guaranteed Service" },
389 { RSVP_OBJ_INTSERV_CONTROLLED_LOAD
, "Controlled Load" },
393 static const struct tok rsvp_intserv_parameter_id_values
[] = {
395 { 6, "Path b/w estimate" },
396 { 8, "Minimum path latency" },
397 { 10, "Composed MTU" },
398 { 127, "Token Bucket TSpec" },
399 { 130, "Guaranteed Service RSpec" },
400 { 133, "End-to-end composed value for C" },
401 { 134, "End-to-end composed value for D" },
402 { 135, "Since-last-reshaping point composed C" },
403 { 136, "Since-last-reshaping point composed D" },
407 static const struct tok rsvp_session_attribute_flag_values
[] = {
408 { 0x01, "Local Protection" },
409 { 0x02, "Label Recording" },
410 { 0x04, "SE Style" },
411 { 0x08, "Bandwidth protection" }, /* RFC4090 */
412 { 0x10, "Node protection" }, /* RFC4090 */
416 static const struct tok rsvp_obj_prop_tlv_values
[] = {
418 { 0x02, "Metric 1" },
419 { 0x04, "Metric 2" },
420 { 0x08, "CCC Status" },
421 { 0x10, "Path Type" },
425 #define RSVP_OBJ_ERROR_SPEC_CODE_ROUTING 24
426 #define RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY 25
427 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE 28
428 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD 125
430 static const struct tok rsvp_obj_error_code_values
[] = {
431 { RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
, "Routing Problem" },
432 { RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY
, "Notify Error" },
433 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
, "Diffserv TE Error" },
434 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
, "Diffserv TE Error (Old)" },
438 static const struct tok rsvp_obj_error_code_routing_values
[] = {
439 { 1, "Bad EXPLICIT_ROUTE object" },
440 { 2, "Bad strict node" },
441 { 3, "Bad loose node" },
442 { 4, "Bad initial subobject" },
443 { 5, "No route available toward destination" },
444 { 6, "Unacceptable label value" },
445 { 7, "RRO indicated routing loops" },
446 { 8, "non-RSVP-capable router in the path" },
447 { 9, "MPLS label allocation failure" },
448 { 10, "Unsupported L3PID" },
452 static const struct tok rsvp_obj_error_code_diffserv_te_values
[] = {
453 { 1, "Unexpected CT object" },
454 { 2, "Unsupported CT" },
455 { 3, "Invalid CT value" },
456 { 4, "CT/setup priority do not form a configured TE-Class" },
457 { 5, "CT/holding priority do not form a configured TE-Class" },
458 { 6, "CT/setup priority and CT/holding priority do not form a configured TE-Class" },
459 { 7, "Inconsistency between signaled PSC and signaled CT" },
460 { 8, "Inconsistency between signaled PHBs and signaled CT" },
464 /* rfc3473 / rfc 3471 */
465 static const struct tok rsvp_obj_admin_status_flag_values
[] = {
466 { 0x80000000, "Reflect" },
467 { 0x00000004, "Testing" },
468 { 0x00000002, "Admin-down" },
469 { 0x00000001, "Delete-in-progress" },
473 /* label set actions - rfc3471 */
474 #define LABEL_SET_INCLUSIVE_LIST 0
475 #define LABEL_SET_EXCLUSIVE_LIST 1
476 #define LABEL_SET_INCLUSIVE_RANGE 2
477 #define LABEL_SET_EXCLUSIVE_RANGE 3
479 static const struct tok rsvp_obj_label_set_action_values
[] = {
480 { LABEL_SET_INCLUSIVE_LIST
, "Inclusive list" },
481 { LABEL_SET_EXCLUSIVE_LIST
, "Exclusive list" },
482 { LABEL_SET_INCLUSIVE_RANGE
, "Inclusive range" },
483 { LABEL_SET_EXCLUSIVE_RANGE
, "Exclusive range" },
487 /* OIF RSVP extensions UNI 1.0 Signaling, release 2 */
488 #define RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS 1
489 #define RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS 2
490 #define RSVP_GEN_UNI_SUBOBJ_DIVERSITY 3
491 #define RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL 4
492 #define RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL 5
494 static const struct tok rsvp_obj_generalized_uni_values
[] = {
495 { RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
, "Source TNA address" },
496 { RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
, "Destination TNA address" },
497 { RSVP_GEN_UNI_SUBOBJ_DIVERSITY
, "Diversity" },
498 { RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
, "Egress label" },
499 { RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
, "Service level" },
504 * this is a dissector for all the intserv defined
505 * specs as defined per rfc2215
506 * it is called from various rsvp objects;
507 * returns the amount of bytes being processed
510 rsvp_intserv_print(netdissect_options
*ndo
,
511 const u_char
*tptr
, u_int obj_tlen
)
513 u_int parameter_id
,parameter_length
;
521 parameter_id
= GET_U_1(tptr
);
522 parameter_length
= GET_BE_U_2(tptr
+ 2)<<2; /* convert wordcount to bytecount */
524 ND_PRINT("\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
525 tok2str(rsvp_intserv_parameter_id_values
,"unknown",parameter_id
),
530 if (obj_tlen
< parameter_length
+4)
532 switch(parameter_id
) { /* parameter_id */
536 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
537 * | 4 (e) | (f) | 1 (g) |
538 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
539 * | IS hop cnt (32-bit unsigned integer) |
540 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
542 if (parameter_length
== 4) {
543 ND_PRINT("\n\t\tIS hop count: %u", GET_BE_U_4(tptr
+ 4));
549 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
550 * | 6 (h) | (i) | 1 (j) |
551 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
552 * | Path b/w estimate (32-bit IEEE floating point number) |
553 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
555 if (parameter_length
== 4) {
556 bw
.i
= GET_BE_U_4(tptr
+ 4);
557 ND_PRINT("\n\t\tPath b/w estimate: %.10g Mbps", bw
.f
/ 125000);
563 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
564 * | 8 (k) | (l) | 1 (m) |
565 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
566 * | Minimum path latency (32-bit integer) |
567 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
569 if (parameter_length
== 4) {
570 ND_PRINT("\n\t\tMinimum path latency: ");
571 if (GET_BE_U_4(tptr
+ 4) == 0xffffffff)
572 ND_PRINT("don't care");
574 ND_PRINT("%u", GET_BE_U_4(tptr
+ 4));
581 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
582 * | 10 (n) | (o) | 1 (p) |
583 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
584 * | Composed MTU (32-bit unsigned integer) |
585 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
587 if (parameter_length
== 4) {
588 ND_PRINT("\n\t\tComposed MTU: %u bytes", GET_BE_U_4(tptr
+ 4));
593 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
594 * | 127 (e) | 0 (f) | 5 (g) |
595 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
596 * | Token Bucket Rate [r] (32-bit IEEE floating point number) |
597 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
598 * | Token Bucket Size [b] (32-bit IEEE floating point number) |
599 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
600 * | Peak Data Rate [p] (32-bit IEEE floating point number) |
601 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
602 * | Minimum Policed Unit [m] (32-bit integer) |
603 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
604 * | Maximum Packet Size [M] (32-bit integer) |
605 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
608 if (parameter_length
== 20) {
609 ND_TCHECK_LEN(tptr
+ 4, 20);
610 bw
.i
= GET_BE_U_4(tptr
+ 4);
611 ND_PRINT("\n\t\tToken Bucket Rate: %.10g Mbps", bw
.f
/ 125000);
612 bw
.i
= GET_BE_U_4(tptr
+ 8);
613 ND_PRINT("\n\t\tToken Bucket Size: %.10g bytes", bw
.f
);
614 bw
.i
= GET_BE_U_4(tptr
+ 12);
615 ND_PRINT("\n\t\tPeak Data Rate: %.10g Mbps", bw
.f
/ 125000);
616 ND_PRINT("\n\t\tMinimum Policed Unit: %u bytes",
617 GET_BE_U_4(tptr
+ 16));
618 ND_PRINT("\n\t\tMaximum Packet Size: %u bytes",
619 GET_BE_U_4(tptr
+ 20));
625 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
626 * | 130 (h) | 0 (i) | 2 (j) |
627 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
628 * | Rate [R] (32-bit IEEE floating point number) |
629 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
630 * | Slack Term [S] (32-bit integer) |
631 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
634 if (parameter_length
== 8) {
635 ND_TCHECK_8(tptr
+ 4);
636 bw
.i
= GET_BE_U_4(tptr
+ 4);
637 ND_PRINT("\n\t\tRate: %.10g Mbps", bw
.f
/ 125000);
638 ND_PRINT("\n\t\tSlack Term: %u", GET_BE_U_4(tptr
+ 8));
646 if (parameter_length
== 4) {
647 ND_PRINT("\n\t\tValue: %u", GET_BE_U_4(tptr
+ 4));
652 if (ndo
->ndo_vflag
<= 1)
653 print_unknown_data(ndo
, tptr
+ 4, "\n\t\t", parameter_length
);
655 return (parameter_length
+4); /* header length 4 bytes */
663 * Clear checksum prior to signature verification.
666 rsvp_clear_checksum(void *header
)
668 struct rsvp_common_header
*rsvp_com_header
= (struct rsvp_common_header
*) header
;
670 rsvp_com_header
->checksum
[0] = 0;
671 rsvp_com_header
->checksum
[1] = 0;
675 rsvp_obj_print(netdissect_options
*ndo
,
676 const u_char
*pptr
, u_int plen
, const u_char
*tptr
,
677 const char *indent
, u_int tlen
,
678 const struct rsvp_common_header
*rsvp_com_header
)
680 const struct rsvp_object_header
*rsvp_obj_header
;
681 const u_char
*obj_tptr
;
683 const struct rsvp_obj_integrity_t
*rsvp_obj_integrity
;
684 const struct rsvp_obj_frr_t
*rsvp_obj_frr
;
687 u_short rsvp_obj_len
,rsvp_obj_ctype
,rsvp_obj_class_num
;
688 u_int obj_tlen
,intserv_serv_tlen
;
690 u_int processed
,padbytes
,error_code
,error_value
,i
,sigcheck
;
697 u_int action
, subchannel
;
699 while(tlen
>=sizeof(struct rsvp_object_header
)) {
700 /* did we capture enough for fully decoding the object header ? */
701 ND_TCHECK_LEN(tptr
, sizeof(struct rsvp_object_header
));
703 rsvp_obj_header
= (const struct rsvp_object_header
*)tptr
;
704 rsvp_obj_len
=GET_BE_U_2(rsvp_obj_header
->length
);
705 rsvp_obj_ctype
=GET_U_1(rsvp_obj_header
->ctype
);
707 if(rsvp_obj_len
% 4) {
708 ND_PRINT("%sERROR: object header size %u not a multiple of 4", indent
, rsvp_obj_len
);
711 if(rsvp_obj_len
< sizeof(struct rsvp_object_header
)) {
712 ND_PRINT("%sERROR: object header too short %u < %zu", indent
, rsvp_obj_len
,
713 sizeof(struct rsvp_object_header
));
717 rsvp_obj_class_num
= GET_U_1(rsvp_obj_header
->class_num
);
718 ND_PRINT("%s%s Object (%u) Flags: [%s",
720 tok2str(rsvp_obj_values
,
724 (rsvp_obj_class_num
& 0x80) ?
725 ((rsvp_obj_class_num
& 0x40) ? "ignore and forward" :
729 ND_PRINT(" if unknown], Class-Type: %s (%u), length: %u",
730 tok2str(rsvp_ctype_values
,
732 (rsvp_obj_class_num
<<8)+rsvp_obj_ctype
),
736 if(tlen
< rsvp_obj_len
) {
737 ND_PRINT("%sERROR: object goes past end of objects TLV", indent
);
741 obj_tptr
=tptr
+sizeof(struct rsvp_object_header
);
742 obj_tlen
=rsvp_obj_len
-sizeof(struct rsvp_object_header
);
744 /* did we capture enough for fully decoding the object ? */
745 ND_TCHECK_LEN(tptr
, rsvp_obj_len
);
748 switch(rsvp_obj_class_num
) {
749 case RSVP_OBJ_SESSION
:
750 switch(rsvp_obj_ctype
) {
751 case RSVP_CTYPE_IPV4
:
754 ND_PRINT("%s IPv4 DestAddress: %s, Protocol ID: 0x%02x",
756 GET_IPADDR_STRING(obj_tptr
),
757 GET_U_1(obj_tptr
+ sizeof(nd_ipv4
)));
758 ND_PRINT("%s Flags: [0x%02x], DestPort %u",
760 GET_U_1((obj_tptr
+ 5)),
761 GET_BE_U_2(obj_tptr
+ 6));
765 case RSVP_CTYPE_IPV6
:
768 ND_PRINT("%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
770 GET_IP6ADDR_STRING(obj_tptr
),
771 GET_U_1(obj_tptr
+ sizeof(nd_ipv6
)));
772 ND_PRINT("%s Flags: [0x%02x], DestPort %u",
774 GET_U_1((obj_tptr
+ sizeof(nd_ipv6
) + 1)),
775 GET_BE_U_2(obj_tptr
+ sizeof(nd_ipv6
) + 2));
780 case RSVP_CTYPE_TUNNEL_IPV6
:
783 ND_PRINT("%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
785 GET_IP6ADDR_STRING(obj_tptr
),
786 GET_BE_U_2(obj_tptr
+ 18),
787 GET_IP6ADDR_STRING(obj_tptr
+ 20));
792 case RSVP_CTYPE_14
: /* IPv6 p2mp LSP Tunnel */
795 ND_PRINT("%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
797 GET_BE_U_4(obj_tptr
),
798 GET_BE_U_2(obj_tptr
+ 6),
799 GET_IP6ADDR_STRING(obj_tptr
+ 8));
803 case RSVP_CTYPE_13
: /* IPv4 p2mp LSP Tunnel */
806 ND_PRINT("%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
808 GET_IPADDR_STRING(obj_tptr
),
809 GET_BE_U_2(obj_tptr
+ 6),
810 GET_IPADDR_STRING(obj_tptr
+ 8));
814 case RSVP_CTYPE_TUNNEL_IPV4
:
815 case RSVP_CTYPE_UNI_IPV4
:
818 ND_PRINT("%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
820 GET_IPADDR_STRING(obj_tptr
),
821 GET_BE_U_2(obj_tptr
+ 6),
822 GET_IPADDR_STRING(obj_tptr
+ 8));
831 case RSVP_OBJ_CONFIRM
:
832 switch(rsvp_obj_ctype
) {
833 case RSVP_CTYPE_IPV4
:
834 if (obj_tlen
< sizeof(nd_ipv4
))
836 ND_PRINT("%s IPv4 Receiver Address: %s",
838 GET_IPADDR_STRING(obj_tptr
));
839 obj_tlen
-=sizeof(nd_ipv4
);
840 obj_tptr
+=sizeof(nd_ipv4
);
842 case RSVP_CTYPE_IPV6
:
843 if (obj_tlen
< sizeof(nd_ipv6
))
845 ND_PRINT("%s IPv6 Receiver Address: %s",
847 GET_IP6ADDR_STRING(obj_tptr
));
848 obj_tlen
-=sizeof(nd_ipv6
);
849 obj_tptr
+=sizeof(nd_ipv6
);
856 case RSVP_OBJ_NOTIFY_REQ
:
857 switch(rsvp_obj_ctype
) {
858 case RSVP_CTYPE_IPV4
:
859 if (obj_tlen
< sizeof(nd_ipv4
))
861 ND_PRINT("%s IPv4 Notify Node Address: %s",
863 GET_IPADDR_STRING(obj_tptr
));
864 obj_tlen
-=sizeof(nd_ipv4
);
865 obj_tptr
+=sizeof(nd_ipv4
);
867 case RSVP_CTYPE_IPV6
:
868 if (obj_tlen
< sizeof(nd_ipv6
))
870 ND_PRINT("%s IPv6 Notify Node Address: %s",
872 GET_IP6ADDR_STRING(obj_tptr
));
873 obj_tlen
-=sizeof(nd_ipv6
);
874 obj_tptr
+=sizeof(nd_ipv6
);
881 case RSVP_OBJ_SUGGESTED_LABEL
: /* fall through */
882 case RSVP_OBJ_UPSTREAM_LABEL
: /* fall through */
883 case RSVP_OBJ_RECOVERY_LABEL
: /* fall through */
885 switch(rsvp_obj_ctype
) {
887 while(obj_tlen
>= 4 ) {
888 ND_PRINT("%s Label: %u", indent
, GET_BE_U_4(obj_tptr
));
896 ND_PRINT("%s Generalized Label: %u",
898 GET_BE_U_4(obj_tptr
));
905 ND_PRINT("%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
907 GET_BE_U_4(obj_tptr
),
909 GET_BE_U_4(obj_tptr
+ 4),
910 GET_BE_U_4(obj_tptr
+ 8));
920 switch(rsvp_obj_ctype
) {
924 ND_PRINT("%s Reservation Style: %s, Flags: [0x%02x]",
926 tok2str(rsvp_resstyle_values
,
928 GET_BE_U_3(obj_tptr
+ 1)),
938 case RSVP_OBJ_SENDER_TEMPLATE
:
939 switch(rsvp_obj_ctype
) {
940 case RSVP_CTYPE_IPV4
:
943 ND_PRINT("%s Source Address: %s, Source Port: %u",
945 GET_IPADDR_STRING(obj_tptr
),
946 GET_BE_U_2(obj_tptr
+ 6));
950 case RSVP_CTYPE_IPV6
:
953 ND_PRINT("%s Source Address: %s, Source Port: %u",
955 GET_IP6ADDR_STRING(obj_tptr
),
956 GET_BE_U_2(obj_tptr
+ 18));
960 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
963 ND_PRINT("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
964 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
966 GET_IP6ADDR_STRING(obj_tptr
),
967 GET_BE_U_2(obj_tptr
+ 18),
969 GET_IP6ADDR_STRING(obj_tptr
+20),
970 GET_BE_U_2(obj_tptr
+ 38));
974 case RSVP_CTYPE_TUNNEL_IPV4
:
977 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
979 GET_IPADDR_STRING(obj_tptr
),
980 GET_BE_U_2(obj_tptr
+ 6));
984 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
987 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
988 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
990 GET_IPADDR_STRING(obj_tptr
),
991 GET_BE_U_2(obj_tptr
+ 6),
993 GET_IPADDR_STRING(obj_tptr
+8),
994 GET_BE_U_2(obj_tptr
+ 12));
1003 case RSVP_OBJ_LABEL_REQ
:
1004 switch(rsvp_obj_ctype
) {
1006 while(obj_tlen
>= 4 ) {
1007 ND_PRINT("%s L3 Protocol ID: %s",
1009 tok2str(ethertype_values
,
1010 "Unknown Protocol (0x%04x)",
1011 GET_BE_U_2(obj_tptr
+ 2)));
1019 ND_PRINT("%s L3 Protocol ID: %s",
1021 tok2str(ethertype_values
,
1022 "Unknown Protocol (0x%04x)",
1023 GET_BE_U_2(obj_tptr
+ 2)));
1024 ND_PRINT(",%s merge capability",
1025 ((GET_U_1(obj_tptr
+ 4)) & 0x80) ? "no" : "" );
1026 ND_PRINT("%s Minimum VPI/VCI: %u/%u",
1028 (GET_BE_U_2(obj_tptr
+ 4))&0xfff,
1029 (GET_BE_U_2(obj_tptr
+ 6)) & 0xfff);
1030 ND_PRINT("%s Maximum VPI/VCI: %u/%u",
1032 (GET_BE_U_2(obj_tptr
+ 8))&0xfff,
1033 (GET_BE_U_2(obj_tptr
+ 10)) & 0xfff);
1040 ND_PRINT("%s L3 Protocol ID: %s",
1042 tok2str(ethertype_values
,
1043 "Unknown Protocol (0x%04x)",
1044 GET_BE_U_2(obj_tptr
+ 2)));
1045 ND_PRINT("%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1047 (GET_BE_U_4(obj_tptr
+ 4))&0x7fffff,
1048 (GET_BE_U_4(obj_tptr
+ 8))&0x7fffff,
1049 (((GET_BE_U_2(obj_tptr
+ 4)>>7)&3) == 0 ) ? "10" : "",
1050 (((GET_BE_U_2(obj_tptr
+ 4) >> 7) & 3) == 2 ) ? "23" : "");
1057 ND_PRINT("%s LSP Encoding Type: %s (%u)",
1059 tok2str(gmpls_encoding_values
,
1063 ND_PRINT("%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1065 tok2str(gmpls_switch_cap_values
,
1067 GET_U_1((obj_tptr
+ 1))),
1068 GET_U_1(obj_tptr
+ 1),
1069 tok2str(gmpls_payload_values
,
1071 GET_BE_U_2(obj_tptr
+ 2)),
1072 GET_BE_U_2(obj_tptr
+ 2));
1083 switch(rsvp_obj_ctype
) {
1084 case RSVP_CTYPE_IPV4
:
1085 while(obj_tlen
>= 4 ) {
1088 ND_TCHECK_4(obj_tptr
);
1089 length
= GET_U_1(obj_tptr
+ 1);
1090 ND_PRINT("%s Subobject Type: %s, length %u",
1092 tok2str(rsvp_obj_xro_values
,
1094 RSVP_OBJ_XRO_MASK_SUBOBJ(GET_U_1(obj_tptr
))),
1096 if (obj_tlen
< length
) {
1097 ND_PRINT("%s ERROR: ERO subobject length > object length", indent
);
1101 if (length
== 0) { /* prevent infinite loops */
1102 ND_PRINT("%s ERROR: zero length ERO subtype", indent
);
1106 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(GET_U_1(obj_tptr
))) {
1107 u_char prefix_length
;
1109 case RSVP_OBJ_XRO_IPV4
:
1111 ND_PRINT(" ERROR: length != 8");
1114 ND_TCHECK_8(obj_tptr
);
1115 prefix_length
= GET_U_1(obj_tptr
+ 6);
1116 if (prefix_length
!= 32) {
1117 ND_PRINT(" ERROR: Prefix length %u != 32",
1121 ND_PRINT(", %s, %s/%u, Flags: [%s]",
1122 RSVP_OBJ_XRO_MASK_LOOSE(GET_U_1(obj_tptr
)) ? "Loose" : "Strict",
1123 GET_IPADDR_STRING(obj_tptr
+2),
1124 GET_U_1((obj_tptr
+ 6)),
1125 bittok2str(rsvp_obj_rro_flag_values
,
1127 GET_U_1((obj_tptr
+ 7)))); /* rfc3209 says that this field is rsvd. */
1129 case RSVP_OBJ_XRO_LABEL
:
1131 ND_PRINT(" ERROR: length != 8");
1134 ND_TCHECK_8(obj_tptr
);
1135 ND_PRINT(", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1136 bittok2str(rsvp_obj_rro_label_flag_values
,
1138 GET_U_1((obj_tptr
+ 2))),
1139 GET_U_1(obj_tptr
+ 2),
1140 tok2str(rsvp_ctype_values
,
1142 GET_U_1((obj_tptr
+ 3)) + (256 * RSVP_OBJ_RRO
)),
1143 GET_U_1((obj_tptr
+ 3)),
1144 GET_BE_U_4(obj_tptr
+ 4));
1155 case RSVP_OBJ_HELLO
:
1156 switch(rsvp_obj_ctype
) {
1161 ND_PRINT("%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1163 GET_BE_U_4(obj_tptr
),
1164 GET_BE_U_4(obj_tptr
+ 4));
1173 case RSVP_OBJ_RESTART_CAPABILITY
:
1174 switch(rsvp_obj_ctype
) {
1178 ND_PRINT("%s Restart Time: %ums, Recovery Time: %ums",
1180 GET_BE_U_4(obj_tptr
),
1181 GET_BE_U_4(obj_tptr
+ 4));
1190 case RSVP_OBJ_CAPABILITY
:
1191 switch(rsvp_obj_ctype
) {
1195 uint32_t unused_and_flags
= GET_BE_U_4(obj_tptr
);
1196 if (unused_and_flags
& ~RSVP_OBJ_CAPABILITY_FLAGS_MASK
)
1197 ND_PRINT("%s [reserved=0x%08x must be zero]", indent
,
1198 unused_and_flags
& ~RSVP_OBJ_CAPABILITY_FLAGS_MASK
);
1199 ND_PRINT("%s Flags: [%s]",
1201 bittok2str(rsvp_obj_capability_flag_values
,
1203 (unused_and_flags
& RSVP_OBJ_CAPABILITY_FLAGS_MASK
)));
1212 case RSVP_OBJ_SESSION_ATTRIBUTE
:
1213 switch(rsvp_obj_ctype
) {
1214 case RSVP_CTYPE_TUNNEL_IPV4
:
1217 namelen
= GET_U_1(obj_tptr
+ 3);
1218 if (obj_tlen
< 4+namelen
)
1220 ND_PRINT("%s Session Name: ", indent
);
1221 for (i
= 0; i
< namelen
; i
++)
1222 fn_print_char(ndo
, GET_U_1(obj_tptr
+ 4 + i
));
1223 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1226 GET_U_1(obj_tptr
+ 1),
1227 bittok2str(rsvp_session_attribute_flag_values
,
1229 GET_U_1((obj_tptr
+ 2))),
1230 GET_U_1(obj_tptr
+ 2));
1231 obj_tlen
-=4+namelen
;
1232 obj_tptr
+=4+namelen
;
1239 case RSVP_OBJ_GENERALIZED_UNI
:
1240 switch(rsvp_obj_ctype
) {
1241 u_int subobj_type
,af
,subobj_len
,total_subobj_len
;
1248 /* read variable length subobjects */
1249 total_subobj_len
= obj_tlen
;
1250 while(total_subobj_len
> 0) {
1251 /* If RFC 3476 Section 3.1 defined that a sub-object of the
1252 * GENERALIZED_UNI RSVP object must have the Length field as
1253 * a multiple of 4, instead of the check below it would be
1254 * better to test total_subobj_len only once before the loop.
1255 * So long as it does not define it and this while loop does
1256 * not implement such a requirement, let's accept that within
1257 * each iteration subobj_len may happen to be a multiple of 1
1258 * and test it and total_subobj_len respectively.
1260 if (total_subobj_len
< 4)
1262 subobj_len
= GET_BE_U_2(obj_tptr
);
1263 subobj_type
= (GET_BE_U_2(obj_tptr
+ 2))>>8;
1264 af
= (GET_BE_U_2(obj_tptr
+ 2))&0x00FF;
1266 ND_PRINT("%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1268 tok2str(rsvp_obj_generalized_uni_values
, "Unknown", subobj_type
),
1270 tok2str(af_values
, "Unknown", af
), af
,
1273 /* In addition to what is explained above, the same spec does not
1274 * explicitly say that the same Length field includes the 4-octet
1275 * sub-object header, but as long as this while loop implements it
1276 * as it does include, let's keep the check below consistent with
1277 * the rest of the code.
1279 * XXX - RFC 3476 Section 3.1 says "The contents of these
1280 * sub-objects are described in [8]", where [8] is
1281 * UNI 1.0 Signaling Specification, The Optical
1282 * Internetworking Forum. The URL they give for that
1285 * http://www.oiforum.com/public/UNI_1.0_ia.html
1287 * but that doesn't work; the new URL appears to be
1289 * https://web.archive.org/web/20160401194747/http://www.oiforum.com/public/documents/OIF-UNI-01.0.pdf
1291 * and *that* document, in section 12.5.2.3
1292 * "GENERALIZED_UNI Object (Class-Num=11bbbbbb (TBA))",
1293 * says nothing about the length field in general, but
1294 * some of the examples it gives in subsections have
1295 * length field values that clearly includes the length
1296 * of the sub-object header as well as the length of the
1299 if(subobj_len
< 4 || subobj_len
> total_subobj_len
||
1300 obj_tlen
< subobj_len
)
1303 switch(subobj_type
) {
1304 case RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
:
1305 case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
:
1310 goto subobj_tooshort
;
1311 ND_PRINT("%s UNI IPv4 TNA address: %s",
1312 indent
, GET_IPADDR_STRING(obj_tptr
+ 4));
1315 if (subobj_len
< 20)
1316 goto subobj_tooshort
;
1317 ND_PRINT("%s UNI IPv6 TNA address: %s",
1318 indent
, GET_IP6ADDR_STRING(obj_tptr
+ 4));
1322 /* unless we have a TLV parser lets just hexdump */
1329 case RSVP_GEN_UNI_SUBOBJ_DIVERSITY
:
1330 if (subobj_len
> 4) {
1331 /* unless we have a TLV parser lets just hexdump */
1336 case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
:
1337 if (subobj_len
< 16) {
1338 goto subobj_tooshort
;
1341 ND_PRINT("%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
1343 ((GET_BE_U_4(obj_tptr
+ 4))>>31),
1344 ((GET_BE_U_4(obj_tptr
+ 4))&0xFF),
1345 GET_BE_U_4(obj_tptr
+ 8),
1346 GET_BE_U_4(obj_tptr
+ 12));
1349 case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
:
1350 if (subobj_len
< 8) {
1351 goto subobj_tooshort
;
1354 ND_PRINT("%s Service level: %u",
1355 indent
, (GET_BE_U_4(obj_tptr
+ 4)) >> 24);
1362 total_subobj_len
-=subobj_len
;
1363 obj_tptr
+=subobj_len
;
1364 obj_tlen
+=subobj_len
;
1373 case RSVP_OBJ_RSVP_HOP
:
1374 switch(rsvp_obj_ctype
) {
1375 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1376 case RSVP_CTYPE_IPV4
:
1379 ND_PRINT("%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1381 GET_IPADDR_STRING(obj_tptr
),
1382 GET_BE_U_4(obj_tptr
+ 4));
1386 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1388 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1389 case RSVP_CTYPE_IPV6
:
1392 ND_PRINT("%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1394 GET_IP6ADDR_STRING(obj_tptr
),
1395 GET_BE_U_4(obj_tptr
+ 16));
1398 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1405 case RSVP_OBJ_TIME_VALUES
:
1406 switch(rsvp_obj_ctype
) {
1410 ND_PRINT("%s Refresh Period: %ums",
1412 GET_BE_U_4(obj_tptr
));
1421 /* those three objects do share the same semantics */
1422 case RSVP_OBJ_SENDER_TSPEC
:
1423 case RSVP_OBJ_ADSPEC
:
1424 case RSVP_OBJ_FLOWSPEC
:
1425 switch(rsvp_obj_ctype
) {
1429 ND_PRINT("%s Msg-Version: %u, length: %u",
1431 (GET_U_1(obj_tptr
) & 0xf0) >> 4,
1432 GET_BE_U_2(obj_tptr
+ 2) << 2);
1433 obj_tptr
+=4; /* get to the start of the service header */
1436 while (obj_tlen
>= 4) {
1437 intserv_serv_tlen
=GET_BE_U_2(obj_tptr
+ 2)<<2;
1438 ND_PRINT("%s Service Type: %s (%u), break bit %sset, Service length: %u",
1440 tok2str(rsvp_intserv_service_type_values
,"unknown",GET_U_1((obj_tptr
))),
1442 (GET_U_1(obj_tptr
+ 1)&0x80) ? "" : "not ",
1445 obj_tptr
+=4; /* get to the start of the parameter list */
1448 while (intserv_serv_tlen
>=4) {
1449 processed
= rsvp_intserv_print(ndo
, obj_tptr
, obj_tlen
);
1452 obj_tlen
-=processed
;
1453 intserv_serv_tlen
-=processed
;
1454 obj_tptr
+=processed
;
1463 case RSVP_OBJ_FILTERSPEC
:
1464 switch(rsvp_obj_ctype
) {
1465 case RSVP_CTYPE_IPV4
:
1468 ND_PRINT("%s Source Address: %s, Source Port: %u",
1470 GET_IPADDR_STRING(obj_tptr
),
1471 GET_BE_U_2(obj_tptr
+ 6));
1475 case RSVP_CTYPE_IPV6
:
1478 ND_PRINT("%s Source Address: %s, Source Port: %u",
1480 GET_IP6ADDR_STRING(obj_tptr
),
1481 GET_BE_U_2(obj_tptr
+ 18));
1488 ND_PRINT("%s Source Address: %s, Flow Label: %u",
1490 GET_IP6ADDR_STRING(obj_tptr
),
1491 GET_BE_U_3(obj_tptr
+ 17));
1495 case RSVP_CTYPE_TUNNEL_IPV6
:
1498 ND_PRINT("%s Source Address: %s, LSP-ID: 0x%04x",
1500 GET_IPADDR_STRING(obj_tptr
),
1501 GET_BE_U_2(obj_tptr
+ 18));
1505 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
1508 ND_PRINT("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1509 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1511 GET_IP6ADDR_STRING(obj_tptr
),
1512 GET_BE_U_2(obj_tptr
+ 18),
1514 GET_IP6ADDR_STRING(obj_tptr
+20),
1515 GET_BE_U_2(obj_tptr
+ 38));
1519 case RSVP_CTYPE_TUNNEL_IPV4
:
1522 ND_PRINT("%s Source Address: %s, LSP-ID: 0x%04x",
1524 GET_IPADDR_STRING(obj_tptr
),
1525 GET_BE_U_2(obj_tptr
+ 6));
1529 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
1532 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1533 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1535 GET_IPADDR_STRING(obj_tptr
),
1536 GET_BE_U_2(obj_tptr
+ 6),
1538 GET_IPADDR_STRING(obj_tptr
+8),
1539 GET_BE_U_2(obj_tptr
+ 12));
1548 case RSVP_OBJ_FASTREROUTE
:
1549 /* the differences between c-type 1 and 7 are minor */
1550 obj_ptr
.rsvp_obj_frr
= (const struct rsvp_obj_frr_t
*)obj_tptr
;
1552 switch(rsvp_obj_ctype
) {
1553 case RSVP_CTYPE_1
: /* new style */
1554 if (obj_tlen
< sizeof(struct rsvp_obj_frr_t
))
1556 bw
.i
= GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1557 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1559 obj_ptr
.rsvp_obj_frr
->setup_prio
,
1560 obj_ptr
.rsvp_obj_frr
->hold_prio
,
1561 obj_ptr
.rsvp_obj_frr
->hop_limit
,
1562 bw
.f
* 8 / 1000000);
1563 ND_PRINT("%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
1565 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_any
),
1566 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->exclude_any
),
1567 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_all
));
1568 obj_tlen
-=sizeof(struct rsvp_obj_frr_t
);
1569 obj_tptr
+=sizeof(struct rsvp_obj_frr_t
);
1572 case RSVP_CTYPE_TUNNEL_IPV4
: /* old style */
1575 bw
.i
= GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1576 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1578 obj_ptr
.rsvp_obj_frr
->setup_prio
,
1579 obj_ptr
.rsvp_obj_frr
->hold_prio
,
1580 obj_ptr
.rsvp_obj_frr
->hop_limit
,
1581 bw
.f
* 8 / 1000000);
1582 ND_PRINT("%s Include Colors: 0x%08x, Exclude Colors: 0x%08x",
1584 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_any
),
1585 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->exclude_any
));
1595 case RSVP_OBJ_DETOUR
:
1596 switch(rsvp_obj_ctype
) {
1597 case RSVP_CTYPE_TUNNEL_IPV4
:
1598 while(obj_tlen
>= 8) {
1599 ND_PRINT("%s PLR-ID: %s, Avoid-Node-ID: %s",
1601 GET_IPADDR_STRING(obj_tptr
),
1602 GET_IPADDR_STRING(obj_tptr
+ 4));
1612 case RSVP_OBJ_CLASSTYPE
:
1613 case RSVP_OBJ_CLASSTYPE_OLD
: /* fall through */
1614 switch(rsvp_obj_ctype
) {
1618 ND_PRINT("%s CT: %u",
1620 GET_BE_U_4(obj_tptr
) & 0x7);
1629 case RSVP_OBJ_ERROR_SPEC
:
1630 switch(rsvp_obj_ctype
) {
1631 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1632 case RSVP_CTYPE_IPV4
:
1635 error_code
=GET_U_1(obj_tptr
+ 5);
1636 error_value
=GET_BE_U_2(obj_tptr
+ 6);
1637 ND_PRINT("%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1639 GET_IPADDR_STRING(obj_tptr
),
1640 GET_U_1(obj_tptr
+ 4),
1642 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1644 switch (error_code
) {
1645 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1646 ND_PRINT(", Error Value: %s (%u)",
1647 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1650 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
: /* fall through */
1651 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
:
1652 ND_PRINT(", Error Value: %s (%u)",
1653 tok2str(rsvp_obj_error_code_diffserv_te_values
,"unknown",error_value
),
1657 ND_PRINT(", Unknown Error Value (%u)", error_value
);
1663 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1664 case RSVP_CTYPE_IPV6
:
1667 error_code
=GET_U_1(obj_tptr
+ 17);
1668 error_value
=GET_BE_U_2(obj_tptr
+ 18);
1669 ND_PRINT("%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1671 GET_IP6ADDR_STRING(obj_tptr
),
1672 GET_U_1(obj_tptr
+ 16),
1674 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1677 switch (error_code
) {
1678 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1679 ND_PRINT(", Error Value: %s (%u)",
1680 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1694 case RSVP_OBJ_PROPERTIES
:
1695 switch(rsvp_obj_ctype
) {
1699 padbytes
= GET_BE_U_2(obj_tptr
+ 2);
1700 ND_PRINT("%s TLV count: %u, padding bytes: %u",
1702 GET_BE_U_2(obj_tptr
),
1706 /* loop through as long there is anything longer than the TLV header (2) */
1707 while(obj_tlen
>= 2 + padbytes
) {
1708 ND_PRINT("%s %s TLV (0x%02x), length: %u", /* length includes header */
1710 tok2str(rsvp_obj_prop_tlv_values
,"unknown",GET_U_1(obj_tptr
)),
1712 GET_U_1(obj_tptr
+ 1));
1713 if (obj_tlen
< GET_U_1(obj_tptr
+ 1))
1715 if (GET_U_1(obj_tptr
+ 1) < 2) {
1716 ND_PRINT("%sERROR: property TLV is too short", indent
);
1719 print_unknown_data(ndo
, obj_tptr
+ 2, "\n\t\t",
1720 GET_U_1(obj_tptr
+ 1) - 2);
1721 obj_tlen
-=GET_U_1(obj_tptr
+ 1);
1722 obj_tptr
+=GET_U_1(obj_tptr
+ 1);
1730 case RSVP_OBJ_MESSAGE_ID
: /* fall through */
1731 case RSVP_OBJ_MESSAGE_ID_ACK
: /* fall through */
1732 case RSVP_OBJ_MESSAGE_ID_LIST
:
1733 switch(rsvp_obj_ctype
) {
1738 ND_PRINT("%s Flags [0x%02x], epoch: %u",
1741 GET_BE_U_3(obj_tptr
+ 1));
1744 /* loop through as long there are no messages left */
1745 while(obj_tlen
>= 4) {
1746 ND_PRINT("%s Message-ID 0x%08x (%u)",
1748 GET_BE_U_4(obj_tptr
),
1749 GET_BE_U_4(obj_tptr
));
1759 case RSVP_OBJ_INTEGRITY
:
1760 switch(rsvp_obj_ctype
) {
1762 if (obj_tlen
< sizeof(struct rsvp_obj_integrity_t
))
1764 obj_ptr
.rsvp_obj_integrity
= (const struct rsvp_obj_integrity_t
*)obj_tptr
;
1765 ND_PRINT("%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
1767 GET_BE_U_2(obj_ptr
.rsvp_obj_integrity
->key_id
),
1768 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->key_id
+ 2),
1769 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->sequence
),
1770 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->sequence
+ 4),
1771 bittok2str(rsvp_obj_integrity_flag_values
,
1773 obj_ptr
.rsvp_obj_integrity
->flags
));
1774 ND_PRINT("%s MD5-sum 0x%08x%08x%08x%08x ",
1776 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
),
1777 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 4),
1778 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 8),
1779 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 12));
1781 sigcheck
= signature_verify(ndo
, pptr
, plen
,
1782 obj_ptr
.rsvp_obj_integrity
->digest
,
1783 rsvp_clear_checksum
,
1785 ND_PRINT(" (%s)", tok2str(signature_check_values
, "Unknown", sigcheck
));
1787 obj_tlen
+=sizeof(struct rsvp_obj_integrity_t
);
1788 obj_tptr
+=sizeof(struct rsvp_obj_integrity_t
);
1795 case RSVP_OBJ_ADMIN_STATUS
:
1796 switch(rsvp_obj_ctype
) {
1800 ND_PRINT("%s Flags [%s]", indent
,
1801 bittok2str(rsvp_obj_admin_status_flag_values
, "none",
1802 GET_BE_U_4(obj_tptr
)));
1811 case RSVP_OBJ_LABEL_SET
:
1812 switch(rsvp_obj_ctype
) {
1816 action
= (GET_BE_U_2(obj_tptr
)>>8);
1818 ND_PRINT("%s Action: %s (%u), Label type: %u", indent
,
1819 tok2str(rsvp_obj_label_set_action_values
, "Unknown", action
),
1820 action
, (GET_BE_U_4(obj_tptr
) & 0x7F));
1823 case LABEL_SET_INCLUSIVE_RANGE
:
1824 case LABEL_SET_EXCLUSIVE_RANGE
: /* fall through */
1826 /* only a couple of subchannels are expected */
1829 ND_PRINT("%s Start range: %u, End range: %u", indent
,
1830 GET_BE_U_4(obj_tptr
+ 4),
1831 GET_BE_U_4(obj_tptr
+ 8));
1840 while(obj_tlen
>= 4 ) {
1841 ND_PRINT("%s Subchannel #%u: %u", indent
, subchannel
,
1842 GET_BE_U_4(obj_tptr
));
1856 switch (rsvp_obj_ctype
) {
1857 case RSVP_CTYPE_IPV4
:
1860 ND_PRINT("%s Sub-LSP destination address: %s",
1861 indent
, GET_IPADDR_STRING(obj_tptr
));
1866 case RSVP_CTYPE_IPV6
:
1869 ND_PRINT("%s Sub-LSP destination address: %s",
1870 indent
, GET_IP6ADDR_STRING(obj_tptr
));
1881 * FIXME those are the defined objects that lack a decoder
1882 * you are welcome to contribute code ;-)
1885 case RSVP_OBJ_SCOPE
:
1886 case RSVP_OBJ_POLICY_DATA
:
1887 case RSVP_OBJ_ACCEPT_LABEL_SET
:
1888 case RSVP_OBJ_PROTECTION
:
1890 if (ndo
->ndo_vflag
<= 1)
1891 print_unknown_data(ndo
, obj_tptr
, "\n\t ", obj_tlen
); /* FIXME indentation */
1894 /* do we also want to see a hex dump ? */
1895 if (ndo
->ndo_vflag
> 1 || hexdump
== TRUE
)
1896 print_unknown_data(ndo
, tptr
+ sizeof(struct rsvp_object_header
), "\n\t ", /* FIXME indentation */
1897 rsvp_obj_len
- sizeof(struct rsvp_object_header
));
1904 ND_PRINT("%sERROR: sub-object is too short", indent
);
1907 ND_PRINT("%sERROR: object is too short", indent
);
1910 nd_print_invalid(ndo
);
1913 nd_print_trunc(ndo
);
1918 rsvp_print(netdissect_options
*ndo
,
1919 const u_char
*pptr
, u_int len
)
1921 const struct rsvp_common_header
*rsvp_com_header
;
1922 uint8_t version_flags
, msg_type
;
1926 ndo
->ndo_protocol
= "rsvp";
1929 rsvp_com_header
= (const struct rsvp_common_header
*)pptr
;
1930 ND_TCHECK_SIZE(rsvp_com_header
);
1931 version_flags
= GET_U_1(rsvp_com_header
->version_flags
);
1934 * Sanity checking of the header.
1936 if (RSVP_EXTRACT_VERSION(version_flags
) != RSVP_VERSION
) {
1937 ND_PRINT("ERROR: RSVP version %u packet not supported",
1938 RSVP_EXTRACT_VERSION(version_flags
));
1942 msg_type
= GET_U_1(rsvp_com_header
->msg_type
);
1944 /* in non-verbose mode just lets print the basic Message Type*/
1945 if (ndo
->ndo_vflag
< 1) {
1946 ND_PRINT("RSVPv%u %s Message, length: %u",
1947 RSVP_EXTRACT_VERSION(version_flags
),
1948 tok2str(rsvp_msg_type_values
, "unknown (%u)",msg_type
),
1953 /* ok they seem to want to know everything - lets fully decode it */
1955 plen
= tlen
= GET_BE_U_2(rsvp_com_header
->length
);
1957 ND_PRINT("\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1958 RSVP_EXTRACT_VERSION(version_flags
),
1959 tok2str(rsvp_msg_type_values
, "unknown, type: %u",msg_type
),
1961 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(version_flags
)),
1963 GET_U_1(rsvp_com_header
->ttl
),
1964 GET_BE_U_2(rsvp_com_header
->checksum
));
1966 if (tlen
< sizeof(struct rsvp_common_header
)) {
1967 ND_PRINT("ERROR: common header too short %u < %zu", tlen
,
1968 sizeof(struct rsvp_common_header
));
1972 tptr
+=sizeof(struct rsvp_common_header
);
1973 tlen
-=sizeof(struct rsvp_common_header
);
1977 case RSVP_MSGTYPE_BUNDLE
:
1979 * Process each submessage in the bundle message.
1980 * Bundle messages may not contain bundle submessages, so we don't
1981 * need to handle bundle submessages specially.
1984 const u_char
*subpptr
=tptr
, *subtptr
;
1985 u_short subplen
, subtlen
;
1989 rsvp_com_header
= (const struct rsvp_common_header
*)subpptr
;
1990 ND_TCHECK_SIZE(rsvp_com_header
);
1991 version_flags
= GET_U_1(rsvp_com_header
->version_flags
);
1994 * Sanity checking of the header.
1996 if (RSVP_EXTRACT_VERSION(version_flags
) != RSVP_VERSION
) {
1997 ND_PRINT("ERROR: RSVP version %u packet not supported",
1998 RSVP_EXTRACT_VERSION(version_flags
));
2002 subplen
= subtlen
= GET_BE_U_2(rsvp_com_header
->length
);
2004 msg_type
= GET_U_1(rsvp_com_header
->msg_type
);
2005 ND_PRINT("\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
2006 RSVP_EXTRACT_VERSION(version_flags
),
2007 tok2str(rsvp_msg_type_values
, "unknown, type: %u",msg_type
),
2009 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(version_flags
)),
2011 GET_U_1(rsvp_com_header
->ttl
),
2012 GET_BE_U_2(rsvp_com_header
->checksum
));
2014 if (subtlen
< sizeof(struct rsvp_common_header
)) {
2015 ND_PRINT("ERROR: common header too short %u < %zu", subtlen
,
2016 sizeof(struct rsvp_common_header
));
2020 if (tlen
< subtlen
) {
2021 ND_PRINT("ERROR: common header too large %u > %u", subtlen
,
2026 subtptr
+=sizeof(struct rsvp_common_header
);
2027 subtlen
-=sizeof(struct rsvp_common_header
);
2030 * Print all objects in the submessage.
2032 if (rsvp_obj_print(ndo
, subpptr
, subplen
, subtptr
, "\n\t ", subtlen
, rsvp_com_header
) == -1)
2035 tptr
+=subtlen
+sizeof(struct rsvp_common_header
);
2036 tlen
-=subtlen
+sizeof(struct rsvp_common_header
);
2041 case RSVP_MSGTYPE_PATH
:
2042 case RSVP_MSGTYPE_RESV
:
2043 case RSVP_MSGTYPE_PATHERR
:
2044 case RSVP_MSGTYPE_RESVERR
:
2045 case RSVP_MSGTYPE_PATHTEAR
:
2046 case RSVP_MSGTYPE_RESVTEAR
:
2047 case RSVP_MSGTYPE_RESVCONF
:
2048 case RSVP_MSGTYPE_HELLO_OLD
:
2049 case RSVP_MSGTYPE_HELLO
:
2050 case RSVP_MSGTYPE_ACK
:
2051 case RSVP_MSGTYPE_SREFRESH
:
2053 * Print all objects in the message.
2055 if (rsvp_obj_print(ndo
, pptr
, plen
, tptr
, "\n\t ", tlen
, rsvp_com_header
) == -1)
2060 print_unknown_data(ndo
, tptr
, "\n\t ", tlen
);
2066 nd_print_trunc(ndo
);