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 #include "netdissect.h"
30 #include "addrtoname.h"
31 #include "ethertype.h"
34 #include "signature.h"
36 static const char tstr
[] = " [|rsvp]";
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 #define RSVP_OBJ_SESSION 1 /* rfc2205 */
118 #define RSVP_OBJ_RSVP_HOP 3 /* rfc2205, rfc3473 */
119 #define RSVP_OBJ_INTEGRITY 4 /* rfc2747 */
120 #define RSVP_OBJ_TIME_VALUES 5 /* rfc2205 */
121 #define RSVP_OBJ_ERROR_SPEC 6
122 #define RSVP_OBJ_SCOPE 7
123 #define RSVP_OBJ_STYLE 8 /* rfc2205 */
124 #define RSVP_OBJ_FLOWSPEC 9 /* rfc2215 */
125 #define RSVP_OBJ_FILTERSPEC 10 /* rfc2215 */
126 #define RSVP_OBJ_SENDER_TEMPLATE 11
127 #define RSVP_OBJ_SENDER_TSPEC 12 /* rfc2215 */
128 #define RSVP_OBJ_ADSPEC 13 /* rfc2215 */
129 #define RSVP_OBJ_POLICY_DATA 14
130 #define RSVP_OBJ_CONFIRM 15 /* rfc2205 */
131 #define RSVP_OBJ_LABEL 16 /* rfc3209 */
132 #define RSVP_OBJ_LABEL_REQ 19 /* rfc3209 */
133 #define RSVP_OBJ_ERO 20 /* rfc3209 */
134 #define RSVP_OBJ_RRO 21 /* rfc3209 */
135 #define RSVP_OBJ_HELLO 22 /* rfc3209 */
136 #define RSVP_OBJ_MESSAGE_ID 23 /* rfc2961 */
137 #define RSVP_OBJ_MESSAGE_ID_ACK 24 /* rfc2961 */
138 #define RSVP_OBJ_MESSAGE_ID_LIST 25 /* rfc2961 */
139 #define RSVP_OBJ_RECOVERY_LABEL 34 /* rfc3473 */
140 #define RSVP_OBJ_UPSTREAM_LABEL 35 /* rfc3473 */
141 #define RSVP_OBJ_LABEL_SET 36 /* rfc3473 */
142 #define RSVP_OBJ_PROTECTION 37 /* rfc3473 */
143 #define RSVP_OBJ_S2L 50 /* rfc4875 */
144 #define RSVP_OBJ_DETOUR 63 /* rfc4090 */
145 #define RSVP_OBJ_CLASSTYPE 66 /* rfc4124 */
146 #define RSVP_OBJ_CLASSTYPE_OLD 125 /* draft-ietf-tewg-diff-te-proto-07 */
147 #define RSVP_OBJ_SUGGESTED_LABEL 129 /* rfc3473 */
148 #define RSVP_OBJ_ACCEPT_LABEL_SET 130 /* rfc3473 */
149 #define RSVP_OBJ_RESTART_CAPABILITY 131 /* rfc3473 */
150 #define RSVP_OBJ_NOTIFY_REQ 195 /* rfc3473 */
151 #define RSVP_OBJ_ADMIN_STATUS 196 /* rfc3473 */
152 #define RSVP_OBJ_PROPERTIES 204 /* juniper proprietary */
153 #define RSVP_OBJ_FASTREROUTE 205 /* rfc4090 */
154 #define RSVP_OBJ_SESSION_ATTRIBUTE 207 /* rfc3209 */
155 #define RSVP_OBJ_GENERALIZED_UNI 229 /* OIF RSVP extensions UNI 1.0 Signaling, Rel. 2 */
156 #define RSVP_OBJ_CALL_ID 230 /* rfc3474 */
157 #define RSVP_OBJ_CALL_OPS 236 /* rfc3474 */
159 static const struct tok rsvp_obj_values
[] = {
160 { RSVP_OBJ_SESSION
, "Session" },
161 { RSVP_OBJ_RSVP_HOP
, "RSVP Hop" },
162 { RSVP_OBJ_INTEGRITY
, "Integrity" },
163 { RSVP_OBJ_TIME_VALUES
, "Time Values" },
164 { RSVP_OBJ_ERROR_SPEC
, "Error Spec" },
165 { RSVP_OBJ_SCOPE
, "Scope" },
166 { RSVP_OBJ_STYLE
, "Style" },
167 { RSVP_OBJ_FLOWSPEC
, "Flowspec" },
168 { RSVP_OBJ_FILTERSPEC
, "FilterSpec" },
169 { RSVP_OBJ_SENDER_TEMPLATE
, "Sender Template" },
170 { RSVP_OBJ_SENDER_TSPEC
, "Sender TSpec" },
171 { RSVP_OBJ_ADSPEC
, "Adspec" },
172 { RSVP_OBJ_POLICY_DATA
, "Policy Data" },
173 { RSVP_OBJ_CONFIRM
, "Confirm" },
174 { RSVP_OBJ_LABEL
, "Label" },
175 { RSVP_OBJ_LABEL_REQ
, "Label Request" },
176 { RSVP_OBJ_ERO
, "ERO" },
177 { RSVP_OBJ_RRO
, "RRO" },
178 { RSVP_OBJ_HELLO
, "Hello" },
179 { RSVP_OBJ_MESSAGE_ID
, "Message ID" },
180 { RSVP_OBJ_MESSAGE_ID_ACK
, "Message ID Ack" },
181 { RSVP_OBJ_MESSAGE_ID_LIST
, "Message ID List" },
182 { RSVP_OBJ_RECOVERY_LABEL
, "Recovery Label" },
183 { RSVP_OBJ_UPSTREAM_LABEL
, "Upstream Label" },
184 { RSVP_OBJ_LABEL_SET
, "Label Set" },
185 { RSVP_OBJ_ACCEPT_LABEL_SET
, "Acceptable Label Set" },
186 { RSVP_OBJ_DETOUR
, "Detour" },
187 { RSVP_OBJ_CLASSTYPE
, "Class Type" },
188 { RSVP_OBJ_CLASSTYPE_OLD
, "Class Type (old)" },
189 { RSVP_OBJ_SUGGESTED_LABEL
, "Suggested Label" },
190 { RSVP_OBJ_PROPERTIES
, "Properties" },
191 { RSVP_OBJ_FASTREROUTE
, "Fast Re-Route" },
192 { RSVP_OBJ_SESSION_ATTRIBUTE
, "Session Attribute" },
193 { RSVP_OBJ_GENERALIZED_UNI
, "Generalized UNI" },
194 { RSVP_OBJ_CALL_ID
, "Call-ID" },
195 { RSVP_OBJ_CALL_OPS
, "Call Capability" },
196 { RSVP_OBJ_RESTART_CAPABILITY
, "Restart Capability" },
197 { RSVP_OBJ_NOTIFY_REQ
, "Notify Request" },
198 { RSVP_OBJ_PROTECTION
, "Protection" },
199 { RSVP_OBJ_ADMIN_STATUS
, "Administrative Status" },
200 { RSVP_OBJ_S2L
, "Sub-LSP to LSP" },
204 #define RSVP_CTYPE_IPV4 1
205 #define RSVP_CTYPE_IPV6 2
206 #define RSVP_CTYPE_TUNNEL_IPV4 7
207 #define RSVP_CTYPE_TUNNEL_IPV6 8
208 #define RSVP_CTYPE_UNI_IPV4 11 /* OIF RSVP extensions UNI 1.0 Signaling Rel. 2 */
209 #define RSVP_CTYPE_1 1
210 #define RSVP_CTYPE_2 2
211 #define RSVP_CTYPE_3 3
212 #define RSVP_CTYPE_4 4
213 #define RSVP_CTYPE_12 12
214 #define RSVP_CTYPE_13 13
215 #define RSVP_CTYPE_14 14
218 * the ctypes are not globally unique so for
219 * translating it to strings we build a table based
220 * on objects offsetted by the ctype
223 static const struct tok rsvp_ctype_values
[] = {
224 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV4
, "IPv4" },
225 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV6
, "IPv6" },
226 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
227 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
228 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV4
, "IPv4" },
229 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV6
, "IPv6" },
230 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV4
, "IPv4" },
231 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV6
, "IPv6" },
232 { 256*RSVP_OBJ_TIME_VALUES
+RSVP_CTYPE_1
, "1" },
233 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_1
, "obsolete" },
234 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_2
, "IntServ" },
235 { 256*RSVP_OBJ_SENDER_TSPEC
+RSVP_CTYPE_2
, "IntServ" },
236 { 256*RSVP_OBJ_ADSPEC
+RSVP_CTYPE_2
, "IntServ" },
237 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
238 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
239 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_3
, "IPv6 Flow-label" },
240 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
241 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
242 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
243 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV4
, "IPv4" },
244 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV6
, "IPv6" },
245 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
246 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_UNI_IPV4
, "UNI IPv4" },
247 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_13
, "IPv4 P2MP LSP Tunnel" },
248 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_14
, "IPv6 P2MP LSP Tunnel" },
249 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV4
, "IPv4" },
250 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV6
, "IPv6" },
251 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
252 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
253 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
254 { 256*RSVP_OBJ_MESSAGE_ID
+RSVP_CTYPE_1
, "1" },
255 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_1
, "Message id ack" },
256 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_2
, "Message id nack" },
257 { 256*RSVP_OBJ_MESSAGE_ID_LIST
+RSVP_CTYPE_1
, "1" },
258 { 256*RSVP_OBJ_STYLE
+RSVP_CTYPE_1
, "1" },
259 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_1
, "Hello Request" },
260 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_2
, "Hello Ack" },
261 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_1
, "without label range" },
262 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_2
, "with ATM label range" },
263 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_3
, "with FR label range" },
264 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_4
, "Generalized Label" },
265 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_1
, "Label" },
266 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
267 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
268 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_1
, "Label" },
269 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
270 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
271 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_1
, "Label" },
272 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
273 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
274 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_1
, "Label" },
275 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
276 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
277 { 256*RSVP_OBJ_ERO
+RSVP_CTYPE_IPV4
, "IPv4" },
278 { 256*RSVP_OBJ_RRO
+RSVP_CTYPE_IPV4
, "IPv4" },
279 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
280 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
281 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
282 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
283 { 256*RSVP_OBJ_RESTART_CAPABILITY
+RSVP_CTYPE_1
, "IPv4" },
284 { 256*RSVP_OBJ_SESSION_ATTRIBUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
285 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" }, /* old style*/
286 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_1
, "1" }, /* new style */
287 { 256*RSVP_OBJ_DETOUR
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
288 { 256*RSVP_OBJ_PROPERTIES
+RSVP_CTYPE_1
, "1" },
289 { 256*RSVP_OBJ_ADMIN_STATUS
+RSVP_CTYPE_1
, "1" },
290 { 256*RSVP_OBJ_CLASSTYPE
+RSVP_CTYPE_1
, "1" },
291 { 256*RSVP_OBJ_CLASSTYPE_OLD
+RSVP_CTYPE_1
, "1" },
292 { 256*RSVP_OBJ_LABEL_SET
+RSVP_CTYPE_1
, "1" },
293 { 256*RSVP_OBJ_GENERALIZED_UNI
+RSVP_CTYPE_1
, "1" },
294 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV4
, "IPv4 sub-LSP" },
295 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV6
, "IPv6 sub-LSP" },
299 struct rsvp_obj_integrity_t
{
307 static const struct tok rsvp_obj_integrity_flag_values
[] = {
308 { 0x80, "Handshake" },
312 struct rsvp_obj_frr_t
{
317 uint8_t bandwidth
[4];
318 uint8_t include_any
[4];
319 uint8_t exclude_any
[4];
320 uint8_t include_all
[4];
324 #define RSVP_OBJ_XRO_MASK_SUBOBJ(x) ((x)&0x7f)
325 #define RSVP_OBJ_XRO_MASK_LOOSE(x) ((x)&0x80)
327 #define RSVP_OBJ_XRO_RES 0
328 #define RSVP_OBJ_XRO_IPV4 1
329 #define RSVP_OBJ_XRO_IPV6 2
330 #define RSVP_OBJ_XRO_LABEL 3
331 #define RSVP_OBJ_XRO_ASN 32
332 #define RSVP_OBJ_XRO_MPLS 64
334 static const struct tok rsvp_obj_xro_values
[] = {
335 { RSVP_OBJ_XRO_RES
, "Reserved" },
336 { RSVP_OBJ_XRO_IPV4
, "IPv4 prefix" },
337 { RSVP_OBJ_XRO_IPV6
, "IPv6 prefix" },
338 { RSVP_OBJ_XRO_LABEL
, "Label" },
339 { RSVP_OBJ_XRO_ASN
, "Autonomous system number" },
340 { RSVP_OBJ_XRO_MPLS
, "MPLS label switched path termination" },
345 static const struct tok rsvp_obj_rro_flag_values
[] = {
346 { 0x01, "Local protection available" },
347 { 0x02, "Local protection in use" },
348 { 0x04, "Bandwidth protection" },
349 { 0x08, "Node protection" },
354 static const struct tok rsvp_obj_rro_label_flag_values
[] = {
359 static const struct tok rsvp_resstyle_values
[] = {
360 { 17, "Wildcard Filter" },
361 { 10, "Fixed Filter" },
362 { 18, "Shared Explicit" },
366 #define RSVP_OBJ_INTSERV_GUARANTEED_SERV 2
367 #define RSVP_OBJ_INTSERV_CONTROLLED_LOAD 5
369 static const struct tok rsvp_intserv_service_type_values
[] = {
370 { 1, "Default/Global Information" },
371 { RSVP_OBJ_INTSERV_GUARANTEED_SERV
, "Guaranteed Service" },
372 { RSVP_OBJ_INTSERV_CONTROLLED_LOAD
, "Controlled Load" },
376 static const struct tok rsvp_intserv_parameter_id_values
[] = {
378 { 6, "Path b/w estimate" },
379 { 8, "Minimum path latency" },
380 { 10, "Composed MTU" },
381 { 127, "Token Bucket TSpec" },
382 { 130, "Guaranteed Service RSpec" },
383 { 133, "End-to-end composed value for C" },
384 { 134, "End-to-end composed value for D" },
385 { 135, "Since-last-reshaping point composed C" },
386 { 136, "Since-last-reshaping point composed D" },
390 static const struct tok rsvp_session_attribute_flag_values
[] = {
391 { 0x01, "Local Protection" },
392 { 0x02, "Label Recording" },
393 { 0x04, "SE Style" },
394 { 0x08, "Bandwidth protection" }, /* RFC4090 */
395 { 0x10, "Node protection" }, /* RFC4090 */
399 static const struct tok rsvp_obj_prop_tlv_values
[] = {
401 { 0x02, "Metric 1" },
402 { 0x04, "Metric 2" },
403 { 0x08, "CCC Status" },
404 { 0x10, "Path Type" },
408 #define RSVP_OBJ_ERROR_SPEC_CODE_ROUTING 24
409 #define RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY 25
410 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE 28
411 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD 125
413 static const struct tok rsvp_obj_error_code_values
[] = {
414 { RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
, "Routing Problem" },
415 { RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY
, "Notify Error" },
416 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
, "Diffserv TE Error" },
417 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
, "Diffserv TE Error (Old)" },
421 static const struct tok rsvp_obj_error_code_routing_values
[] = {
422 { 1, "Bad EXPLICIT_ROUTE object" },
423 { 2, "Bad strict node" },
424 { 3, "Bad loose node" },
425 { 4, "Bad initial subobject" },
426 { 5, "No route available toward destination" },
427 { 6, "Unacceptable label value" },
428 { 7, "RRO indicated routing loops" },
429 { 8, "non-RSVP-capable router in the path" },
430 { 9, "MPLS label allocation failure" },
431 { 10, "Unsupported L3PID" },
435 static const struct tok rsvp_obj_error_code_diffserv_te_values
[] = {
436 { 1, "Unexpected CT object" },
437 { 2, "Unsupported CT" },
438 { 3, "Invalid CT value" },
439 { 4, "CT/setup priority do not form a configured TE-Class" },
440 { 5, "CT/holding priority do not form a configured TE-Class" },
441 { 6, "CT/setup priority and CT/holding priority do not form a configured TE-Class" },
442 { 7, "Inconsistency between signaled PSC and signaled CT" },
443 { 8, "Inconsistency between signaled PHBs and signaled CT" },
447 /* rfc3473 / rfc 3471 */
448 static const struct tok rsvp_obj_admin_status_flag_values
[] = {
449 { 0x80000000, "Reflect" },
450 { 0x00000004, "Testing" },
451 { 0x00000002, "Admin-down" },
452 { 0x00000001, "Delete-in-progress" },
456 /* label set actions - rfc3471 */
457 #define LABEL_SET_INCLUSIVE_LIST 0
458 #define LABEL_SET_EXCLUSIVE_LIST 1
459 #define LABEL_SET_INCLUSIVE_RANGE 2
460 #define LABEL_SET_EXCLUSIVE_RANGE 3
462 static const struct tok rsvp_obj_label_set_action_values
[] = {
463 { LABEL_SET_INCLUSIVE_LIST
, "Inclusive list" },
464 { LABEL_SET_EXCLUSIVE_LIST
, "Exclusive list" },
465 { LABEL_SET_INCLUSIVE_RANGE
, "Inclusive range" },
466 { LABEL_SET_EXCLUSIVE_RANGE
, "Exclusive range" },
470 /* OIF RSVP extensions UNI 1.0 Signaling, release 2 */
471 #define RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS 1
472 #define RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS 2
473 #define RSVP_GEN_UNI_SUBOBJ_DIVERSITY 3
474 #define RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL 4
475 #define RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL 5
477 static const struct tok rsvp_obj_generalized_uni_values
[] = {
478 { RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
, "Source TNA address" },
479 { RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
, "Destination TNA address" },
480 { RSVP_GEN_UNI_SUBOBJ_DIVERSITY
, "Diversity" },
481 { RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
, "Egress label" },
482 { RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
, "Service level" },
487 * this is a dissector for all the intserv defined
488 * specs as defined per rfc2215
489 * it is called from various rsvp objects;
490 * returns the amount of bytes being processed
493 rsvp_intserv_print(netdissect_options
*ndo
,
494 const u_char
*tptr
, u_short obj_tlen
)
496 u_int parameter_id
,parameter_length
;
505 parameter_id
= EXTRACT_U_1(tptr
);
506 ND_TCHECK_2(tptr
+ 2);
507 parameter_length
= EXTRACT_BE_U_2(tptr
+ 2)<<2; /* convert wordcount to bytecount */
509 ND_PRINT("\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
510 tok2str(rsvp_intserv_parameter_id_values
,"unknown",parameter_id
),
513 EXTRACT_U_1(tptr
+ 1));
515 if (obj_tlen
< parameter_length
+4)
517 switch(parameter_id
) { /* parameter_id */
521 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
522 * | 4 (e) | (f) | 1 (g) |
523 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
524 * | IS hop cnt (32-bit unsigned integer) |
525 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
527 if (parameter_length
== 4) {
528 ND_TCHECK_4(tptr
+ 4);
529 ND_PRINT("\n\t\tIS hop count: %u", EXTRACT_BE_U_4(tptr
+ 4));
535 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
536 * | 6 (h) | (i) | 1 (j) |
537 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
538 * | Path b/w estimate (32-bit IEEE floating point number) |
539 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
541 if (parameter_length
== 4) {
542 ND_TCHECK_4(tptr
+ 4);
543 bw
.i
= EXTRACT_BE_U_4(tptr
+ 4);
544 ND_PRINT("\n\t\tPath b/w estimate: %.10g Mbps", bw
.f
/ 125000);
550 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
551 * | 8 (k) | (l) | 1 (m) |
552 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
553 * | Minimum path latency (32-bit integer) |
554 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
556 if (parameter_length
== 4) {
557 ND_TCHECK_4(tptr
+ 4);
558 ND_PRINT("\n\t\tMinimum path latency: ");
559 if (EXTRACT_BE_U_4(tptr
+ 4) == 0xffffffff)
560 ND_PRINT("don't care");
562 ND_PRINT("%u", EXTRACT_BE_U_4(tptr
+ 4));
569 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
570 * | 10 (n) | (o) | 1 (p) |
571 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
572 * | Composed MTU (32-bit unsigned integer) |
573 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
575 if (parameter_length
== 4) {
576 ND_TCHECK_4(tptr
+ 4);
577 ND_PRINT("\n\t\tComposed MTU: %u bytes", EXTRACT_BE_U_4(tptr
+ 4));
582 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
583 * | 127 (e) | 0 (f) | 5 (g) |
584 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
585 * | Token Bucket Rate [r] (32-bit IEEE floating point number) |
586 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
587 * | Token Bucket Size [b] (32-bit IEEE floating point number) |
588 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
589 * | Peak Data Rate [p] (32-bit IEEE floating point number) |
590 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
591 * | Minimum Policed Unit [m] (32-bit integer) |
592 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
593 * | Maximum Packet Size [M] (32-bit integer) |
594 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
597 if (parameter_length
== 20) {
598 ND_TCHECK_LEN(tptr
+ 4, 20);
599 bw
.i
= EXTRACT_BE_U_4(tptr
+ 4);
600 ND_PRINT("\n\t\tToken Bucket Rate: %.10g Mbps", bw
.f
/ 125000);
601 bw
.i
= EXTRACT_BE_U_4(tptr
+ 8);
602 ND_PRINT("\n\t\tToken Bucket Size: %.10g bytes", bw
.f
);
603 bw
.i
= EXTRACT_BE_U_4(tptr
+ 12);
604 ND_PRINT("\n\t\tPeak Data Rate: %.10g Mbps", bw
.f
/ 125000);
605 ND_PRINT("\n\t\tMinimum Policed Unit: %u bytes", EXTRACT_BE_U_4(tptr
+ 16));
606 ND_PRINT("\n\t\tMaximum Packet Size: %u bytes", EXTRACT_BE_U_4(tptr
+ 20));
612 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
613 * | 130 (h) | 0 (i) | 2 (j) |
614 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
615 * | Rate [R] (32-bit IEEE floating point number) |
616 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
617 * | Slack Term [S] (32-bit integer) |
618 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
621 if (parameter_length
== 8) {
622 ND_TCHECK_8(tptr
+ 4);
623 bw
.i
= EXTRACT_BE_U_4(tptr
+ 4);
624 ND_PRINT("\n\t\tRate: %.10g Mbps", bw
.f
/ 125000);
625 ND_PRINT("\n\t\tSlack Term: %u", EXTRACT_BE_U_4(tptr
+ 8));
633 if (parameter_length
== 4) {
634 ND_TCHECK_4(tptr
+ 4);
635 ND_PRINT("\n\t\tValue: %u", EXTRACT_BE_U_4(tptr
+ 4));
640 if (ndo
->ndo_vflag
<= 1)
641 print_unknown_data(ndo
, tptr
+ 4, "\n\t\t", parameter_length
);
643 return (parameter_length
+4); /* header length 4 bytes */
646 ND_PRINT("%s", tstr
);
651 * Clear checksum prior to signature verification.
654 rsvp_clear_checksum(void *header
)
656 struct rsvp_common_header
*rsvp_com_header
= (struct rsvp_common_header
*) header
;
658 rsvp_com_header
->checksum
[0] = 0;
659 rsvp_com_header
->checksum
[1] = 0;
663 rsvp_obj_print(netdissect_options
*ndo
,
664 const u_char
*pptr
, u_int plen
, const u_char
*tptr
,
665 const char *indent
, u_int tlen
,
666 const struct rsvp_common_header
*rsvp_com_header
)
668 const struct rsvp_object_header
*rsvp_obj_header
;
669 const u_char
*obj_tptr
;
671 const struct rsvp_obj_integrity_t
*rsvp_obj_integrity
;
672 const struct rsvp_obj_frr_t
*rsvp_obj_frr
;
675 u_short rsvp_obj_len
,rsvp_obj_ctype
,rsvp_obj_class_num
,obj_tlen
;
676 u_int intserv_serv_tlen
;
678 u_int processed
,padbytes
,error_code
,error_value
,i
,sigcheck
;
685 u_int action
, subchannel
;
687 while(tlen
>=sizeof(struct rsvp_object_header
)) {
688 /* did we capture enough for fully decoding the object header ? */
689 ND_TCHECK_LEN(tptr
, sizeof(struct rsvp_object_header
));
691 rsvp_obj_header
= (const struct rsvp_object_header
*)tptr
;
692 rsvp_obj_len
=EXTRACT_BE_U_2(rsvp_obj_header
->length
);
693 rsvp_obj_ctype
=EXTRACT_U_1(rsvp_obj_header
->ctype
);
695 if(rsvp_obj_len
% 4) {
696 ND_PRINT("%sERROR: object header size %u not a multiple of 4", indent
, rsvp_obj_len
);
699 if(rsvp_obj_len
< sizeof(struct rsvp_object_header
)) {
700 ND_PRINT("%sERROR: object header too short %u < %lu", indent
, rsvp_obj_len
,
701 (unsigned long)sizeof(struct rsvp_object_header
));
705 rsvp_obj_class_num
= EXTRACT_U_1(rsvp_obj_header
->class_num
);
706 ND_PRINT("%s%s Object (%u) Flags: [%s",
708 tok2str(rsvp_obj_values
,
712 (rsvp_obj_class_num
& 0x80) ?
713 ((rsvp_obj_class_num
& 0x40) ? "ignore and forward" :
717 ND_PRINT(" if unknown], Class-Type: %s (%u), length: %u",
718 tok2str(rsvp_ctype_values
,
720 (rsvp_obj_class_num
<<8)+rsvp_obj_ctype
),
724 if(tlen
< rsvp_obj_len
) {
725 ND_PRINT("%sERROR: object goes past end of objects TLV", indent
);
729 obj_tptr
=tptr
+sizeof(struct rsvp_object_header
);
730 obj_tlen
=rsvp_obj_len
-sizeof(struct rsvp_object_header
);
732 /* did we capture enough for fully decoding the object ? */
733 if (!ND_TTEST_LEN(tptr
, rsvp_obj_len
))
737 switch(rsvp_obj_class_num
) {
738 case RSVP_OBJ_SESSION
:
739 switch(rsvp_obj_ctype
) {
740 case RSVP_CTYPE_IPV4
:
743 ND_PRINT("%s IPv4 DestAddress: %s, Protocol ID: 0x%02x",
745 ipaddr_string(ndo
, obj_tptr
),
746 EXTRACT_U_1(obj_tptr
+ sizeof(struct in_addr
)));
747 ND_PRINT("%s Flags: [0x%02x], DestPort %u",
749 EXTRACT_U_1((obj_tptr
+ 5)),
750 EXTRACT_BE_U_2(obj_tptr
+ 6));
754 case RSVP_CTYPE_IPV6
:
757 ND_PRINT("%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
759 ip6addr_string(ndo
, obj_tptr
),
760 EXTRACT_U_1(obj_tptr
+ sizeof(struct in6_addr
)));
761 ND_PRINT("%s Flags: [0x%02x], DestPort %u",
763 EXTRACT_U_1((obj_tptr
+ sizeof(struct in6_addr
) + 1)),
764 EXTRACT_BE_U_2(obj_tptr
+ sizeof(struct in6_addr
) + 2));
769 case RSVP_CTYPE_TUNNEL_IPV6
:
772 ND_PRINT("%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
774 ip6addr_string(ndo
, obj_tptr
),
775 EXTRACT_BE_U_2(obj_tptr
+ 18),
776 ip6addr_string(ndo
, obj_tptr
+ 20));
781 case RSVP_CTYPE_14
: /* IPv6 p2mp LSP Tunnel */
784 ND_PRINT("%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
786 EXTRACT_BE_U_4(obj_tptr
),
787 EXTRACT_BE_U_2(obj_tptr
+ 6),
788 ip6addr_string(ndo
, obj_tptr
+ 8));
792 case RSVP_CTYPE_13
: /* IPv4 p2mp LSP Tunnel */
795 ND_PRINT("%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
797 ipaddr_string(ndo
, obj_tptr
),
798 EXTRACT_BE_U_2(obj_tptr
+ 6),
799 ipaddr_string(ndo
, obj_tptr
+ 8));
803 case RSVP_CTYPE_TUNNEL_IPV4
:
804 case RSVP_CTYPE_UNI_IPV4
:
807 ND_PRINT("%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
809 ipaddr_string(ndo
, obj_tptr
),
810 EXTRACT_BE_U_2(obj_tptr
+ 6),
811 ipaddr_string(ndo
, obj_tptr
+ 8));
820 case RSVP_OBJ_CONFIRM
:
821 switch(rsvp_obj_ctype
) {
822 case RSVP_CTYPE_IPV4
:
823 if (obj_tlen
< sizeof(struct in_addr
))
825 ND_PRINT("%s IPv4 Receiver Address: %s",
827 ipaddr_string(ndo
, obj_tptr
));
828 obj_tlen
-=sizeof(struct in_addr
);
829 obj_tptr
+=sizeof(struct in_addr
);
831 case RSVP_CTYPE_IPV6
:
832 if (obj_tlen
< sizeof(struct in6_addr
))
834 ND_PRINT("%s IPv6 Receiver Address: %s",
836 ip6addr_string(ndo
, obj_tptr
));
837 obj_tlen
-=sizeof(struct in6_addr
);
838 obj_tptr
+=sizeof(struct in6_addr
);
845 case RSVP_OBJ_NOTIFY_REQ
:
846 switch(rsvp_obj_ctype
) {
847 case RSVP_CTYPE_IPV4
:
848 if (obj_tlen
< sizeof(struct in_addr
))
850 ND_PRINT("%s IPv4 Notify Node Address: %s",
852 ipaddr_string(ndo
, obj_tptr
));
853 obj_tlen
-=sizeof(struct in_addr
);
854 obj_tptr
+=sizeof(struct in_addr
);
856 case RSVP_CTYPE_IPV6
:
857 if (obj_tlen
< sizeof(struct in6_addr
))
859 ND_PRINT("%s IPv6 Notify Node Address: %s",
861 ip6addr_string(ndo
, obj_tptr
));
862 obj_tlen
-=sizeof(struct in6_addr
);
863 obj_tptr
+=sizeof(struct in6_addr
);
870 case RSVP_OBJ_SUGGESTED_LABEL
: /* fall through */
871 case RSVP_OBJ_UPSTREAM_LABEL
: /* fall through */
872 case RSVP_OBJ_RECOVERY_LABEL
: /* fall through */
874 switch(rsvp_obj_ctype
) {
876 while(obj_tlen
>= 4 ) {
877 ND_PRINT("%s Label: %u", indent
, EXTRACT_BE_U_4(obj_tptr
));
885 ND_PRINT("%s Generalized Label: %u",
887 EXTRACT_BE_U_4(obj_tptr
));
894 ND_PRINT("%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
896 EXTRACT_BE_U_4(obj_tptr
),
898 EXTRACT_BE_U_4(obj_tptr
+ 4),
899 EXTRACT_BE_U_4(obj_tptr
+ 8));
909 switch(rsvp_obj_ctype
) {
913 ND_PRINT("%s Reservation Style: %s, Flags: [0x%02x]",
915 tok2str(rsvp_resstyle_values
,
917 EXTRACT_BE_U_3(obj_tptr
+ 1)),
918 EXTRACT_U_1(obj_tptr
));
927 case RSVP_OBJ_SENDER_TEMPLATE
:
928 switch(rsvp_obj_ctype
) {
929 case RSVP_CTYPE_IPV4
:
932 ND_PRINT("%s Source Address: %s, Source Port: %u",
934 ipaddr_string(ndo
, obj_tptr
),
935 EXTRACT_BE_U_2(obj_tptr
+ 6));
939 case RSVP_CTYPE_IPV6
:
942 ND_PRINT("%s Source Address: %s, Source Port: %u",
944 ip6addr_string(ndo
, obj_tptr
),
945 EXTRACT_BE_U_2(obj_tptr
+ 18));
949 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
952 ND_PRINT("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
953 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
955 ip6addr_string(ndo
, obj_tptr
),
956 EXTRACT_BE_U_2(obj_tptr
+ 18),
958 ip6addr_string(ndo
, obj_tptr
+20),
959 EXTRACT_BE_U_2(obj_tptr
+ 38));
963 case RSVP_CTYPE_TUNNEL_IPV4
:
966 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
968 ipaddr_string(ndo
, obj_tptr
),
969 EXTRACT_BE_U_2(obj_tptr
+ 6));
973 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
976 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
977 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
979 ipaddr_string(ndo
, obj_tptr
),
980 EXTRACT_BE_U_2(obj_tptr
+ 6),
982 ipaddr_string(ndo
, obj_tptr
+8),
983 EXTRACT_BE_U_2(obj_tptr
+ 12));
992 case RSVP_OBJ_LABEL_REQ
:
993 switch(rsvp_obj_ctype
) {
995 while(obj_tlen
>= 4 ) {
996 ND_PRINT("%s L3 Protocol ID: %s",
998 tok2str(ethertype_values
,
999 "Unknown Protocol (0x%04x)",
1000 EXTRACT_BE_U_2(obj_tptr
+ 2)));
1008 ND_PRINT("%s L3 Protocol ID: %s",
1010 tok2str(ethertype_values
,
1011 "Unknown Protocol (0x%04x)",
1012 EXTRACT_BE_U_2(obj_tptr
+ 2)));
1013 ND_PRINT(",%s merge capability",((EXTRACT_U_1(obj_tptr
+ 4)) & 0x80) ? "no" : "" );
1014 ND_PRINT("%s Minimum VPI/VCI: %u/%u",
1016 (EXTRACT_BE_U_2(obj_tptr
+ 4))&0xfff,
1017 (EXTRACT_BE_U_2(obj_tptr
+ 6)) & 0xfff);
1018 ND_PRINT("%s Maximum VPI/VCI: %u/%u",
1020 (EXTRACT_BE_U_2(obj_tptr
+ 8))&0xfff,
1021 (EXTRACT_BE_U_2(obj_tptr
+ 10)) & 0xfff);
1028 ND_PRINT("%s L3 Protocol ID: %s",
1030 tok2str(ethertype_values
,
1031 "Unknown Protocol (0x%04x)",
1032 EXTRACT_BE_U_2(obj_tptr
+ 2)));
1033 ND_PRINT("%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1035 (EXTRACT_BE_U_4(obj_tptr
+ 4))&0x7fffff,
1036 (EXTRACT_BE_U_4(obj_tptr
+ 8))&0x7fffff,
1037 (((EXTRACT_BE_U_2(obj_tptr
+ 4)>>7)&3) == 0 ) ? "10" : "",
1038 (((EXTRACT_BE_U_2(obj_tptr
+ 4) >> 7) & 3) == 2 ) ? "23" : "");
1045 ND_PRINT("%s LSP Encoding Type: %s (%u)",
1047 tok2str(gmpls_encoding_values
,
1049 EXTRACT_U_1(obj_tptr
)),
1050 EXTRACT_U_1(obj_tptr
));
1051 ND_PRINT("%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1053 tok2str(gmpls_switch_cap_values
,
1055 EXTRACT_U_1((obj_tptr
+ 1))),
1056 EXTRACT_U_1(obj_tptr
+ 1),
1057 tok2str(gmpls_payload_values
,
1059 EXTRACT_BE_U_2(obj_tptr
+ 2)),
1060 EXTRACT_BE_U_2(obj_tptr
+ 2));
1071 switch(rsvp_obj_ctype
) {
1072 case RSVP_CTYPE_IPV4
:
1073 while(obj_tlen
>= 4 ) {
1076 ND_TCHECK_4(obj_tptr
);
1077 length
= EXTRACT_U_1(obj_tptr
+ 1);
1078 ND_PRINT("%s Subobject Type: %s, length %u",
1080 tok2str(rsvp_obj_xro_values
,
1082 RSVP_OBJ_XRO_MASK_SUBOBJ(EXTRACT_U_1(obj_tptr
))),
1084 if (obj_tlen
< length
) {
1085 ND_PRINT("%s ERROR: ERO subobject length > object length", indent
);
1089 if (length
== 0) { /* prevent infinite loops */
1090 ND_PRINT("%s ERROR: zero length ERO subtype", indent
);
1094 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(EXTRACT_U_1(obj_tptr
))) {
1095 u_char prefix_length
;
1097 case RSVP_OBJ_XRO_IPV4
:
1099 ND_PRINT(" ERROR: length != 8");
1102 ND_TCHECK_8(obj_tptr
);
1103 prefix_length
= EXTRACT_U_1(obj_tptr
+ 6);
1104 if (prefix_length
!= 32) {
1105 ND_PRINT(" ERROR: Prefix length %u != 32",
1109 ND_PRINT(", %s, %s/%u, Flags: [%s]",
1110 RSVP_OBJ_XRO_MASK_LOOSE(EXTRACT_U_1(obj_tptr
)) ? "Loose" : "Strict",
1111 ipaddr_string(ndo
, obj_tptr
+2),
1112 EXTRACT_U_1((obj_tptr
+ 6)),
1113 bittok2str(rsvp_obj_rro_flag_values
,
1115 EXTRACT_U_1((obj_tptr
+ 7)))); /* rfc3209 says that this field is rsvd. */
1117 case RSVP_OBJ_XRO_LABEL
:
1119 ND_PRINT(" ERROR: length != 8");
1122 ND_TCHECK_8(obj_tptr
);
1123 ND_PRINT(", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1124 bittok2str(rsvp_obj_rro_label_flag_values
,
1126 EXTRACT_U_1((obj_tptr
+ 2))),
1127 EXTRACT_U_1(obj_tptr
+ 2),
1128 tok2str(rsvp_ctype_values
,
1130 EXTRACT_U_1((obj_tptr
+ 3)) + (256 * RSVP_OBJ_RRO
)),
1131 EXTRACT_U_1((obj_tptr
+ 3)),
1132 EXTRACT_BE_U_4(obj_tptr
+ 4));
1143 case RSVP_OBJ_HELLO
:
1144 switch(rsvp_obj_ctype
) {
1149 ND_PRINT("%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1151 EXTRACT_BE_U_4(obj_tptr
),
1152 EXTRACT_BE_U_4(obj_tptr
+ 4));
1161 case RSVP_OBJ_RESTART_CAPABILITY
:
1162 switch(rsvp_obj_ctype
) {
1166 ND_PRINT("%s Restart Time: %ums, Recovery Time: %ums",
1168 EXTRACT_BE_U_4(obj_tptr
),
1169 EXTRACT_BE_U_4(obj_tptr
+ 4));
1178 case RSVP_OBJ_SESSION_ATTRIBUTE
:
1179 switch(rsvp_obj_ctype
) {
1180 case RSVP_CTYPE_TUNNEL_IPV4
:
1183 namelen
= EXTRACT_U_1(obj_tptr
+ 3);
1184 if (obj_tlen
< 4+namelen
)
1186 ND_PRINT("%s Session Name: ", indent
);
1187 for (i
= 0; i
< namelen
; i
++)
1188 safeputchar(ndo
, EXTRACT_U_1(obj_tptr
+ 4 + i
));
1189 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1191 EXTRACT_U_1(obj_tptr
),
1192 EXTRACT_U_1(obj_tptr
+ 1),
1193 bittok2str(rsvp_session_attribute_flag_values
,
1195 EXTRACT_U_1((obj_tptr
+ 2))),
1196 EXTRACT_U_1(obj_tptr
+ 2));
1197 obj_tlen
-=4+namelen
;
1198 obj_tptr
+=4+namelen
;
1205 case RSVP_OBJ_GENERALIZED_UNI
:
1206 switch(rsvp_obj_ctype
) {
1207 u_int subobj_type
,af
,subobj_len
,total_subobj_len
;
1214 /* read variable length subobjects */
1215 total_subobj_len
= obj_tlen
;
1216 while(total_subobj_len
> 0) {
1217 /* If RFC 3476 Section 3.1 defined that a sub-object of the
1218 * GENERALIZED_UNI RSVP object must have the Length field as
1219 * a multiple of 4, instead of the check below it would be
1220 * better to test total_subobj_len only once before the loop.
1221 * So long as it does not define it and this while loop does
1222 * not implement such a requirement, let's accept that within
1223 * each iteration subobj_len may happen to be a multiple of 1
1224 * and test it and total_subobj_len respectively.
1226 if (total_subobj_len
< 4)
1228 subobj_len
= EXTRACT_BE_U_2(obj_tptr
);
1229 subobj_type
= (EXTRACT_BE_U_2(obj_tptr
+ 2))>>8;
1230 af
= (EXTRACT_BE_U_2(obj_tptr
+ 2))&0x00FF;
1232 ND_PRINT("%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1234 tok2str(rsvp_obj_generalized_uni_values
, "Unknown", subobj_type
),
1236 tok2str(af_values
, "Unknown", af
), af
,
1239 /* In addition to what is explained above, the same spec does not
1240 * explicitly say that the same Length field includes the 4-octet
1241 * sub-object header, but as long as this while loop implements it
1242 * as it does include, let's keep the check below consistent with
1243 * the rest of the code.
1245 * XXX - RFC 3476 Section 3.1 says "The contents of these
1246 * sub-objects are described in [8]", where [8] is
1247 * UNI 1.0 Signaling Specification, The Optical
1248 * Internetworking Forum. The URL they give for that
1251 * http://www.oiforum.com/public/UNI_1.0_ia.html
1253 * but that doesn't work; the new URL appears to be
1255 * http://www.oiforum.com/public/documents/OIF-UNI-01.0.pdf
1257 * and *that* document, in section 12.5.2.3
1258 * "GENERALIZED_UNI Object (Class-Num=11bbbbbb (TBA))",
1259 * says nothing about the length field in general, but
1260 * some of the examples it gives in subsections have
1261 * length field values that clearly includes the length
1262 * of the sub-object header as well as the length of the
1265 if(subobj_len
< 4 || subobj_len
> total_subobj_len
||
1266 obj_tlen
< subobj_len
)
1269 switch(subobj_type
) {
1270 case RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
:
1271 case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
:
1277 ND_PRINT("%s UNI IPv4 TNA address: %s",
1278 indent
, ipaddr_string(ndo
, obj_tptr
+ 4));
1281 if (subobj_len
< 20)
1283 ND_PRINT("%s UNI IPv6 TNA address: %s",
1284 indent
, ip6addr_string(ndo
, obj_tptr
+ 4));
1288 /* unless we have a TLV parser lets just hexdump */
1295 case RSVP_GEN_UNI_SUBOBJ_DIVERSITY
:
1296 if (subobj_len
> 4) {
1297 /* unless we have a TLV parser lets just hexdump */
1302 case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
:
1303 if (subobj_len
< 16) {
1307 ND_PRINT("%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
1309 ((EXTRACT_BE_U_4(obj_tptr
+ 4))>>31),
1310 ((EXTRACT_BE_U_4(obj_tptr
+ 4))&0xFF),
1311 EXTRACT_BE_U_4(obj_tptr
+ 8),
1312 EXTRACT_BE_U_4(obj_tptr
+ 12));
1315 case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
:
1316 if (subobj_len
< 8) {
1320 ND_PRINT("%s Service level: %u",
1321 indent
, (EXTRACT_BE_U_4(obj_tptr
+ 4)) >> 24);
1328 total_subobj_len
-=subobj_len
;
1329 obj_tptr
+=subobj_len
;
1330 obj_tlen
+=subobj_len
;
1339 case RSVP_OBJ_RSVP_HOP
:
1340 switch(rsvp_obj_ctype
) {
1341 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1342 case RSVP_CTYPE_IPV4
:
1345 ND_PRINT("%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1347 ipaddr_string(ndo
, obj_tptr
),
1348 EXTRACT_BE_U_4(obj_tptr
+ 4));
1352 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1354 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1355 case RSVP_CTYPE_IPV6
:
1358 ND_PRINT("%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1360 ip6addr_string(ndo
, obj_tptr
),
1361 EXTRACT_BE_U_4(obj_tptr
+ 16));
1364 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1371 case RSVP_OBJ_TIME_VALUES
:
1372 switch(rsvp_obj_ctype
) {
1376 ND_PRINT("%s Refresh Period: %ums",
1378 EXTRACT_BE_U_4(obj_tptr
));
1387 /* those three objects do share the same semantics */
1388 case RSVP_OBJ_SENDER_TSPEC
:
1389 case RSVP_OBJ_ADSPEC
:
1390 case RSVP_OBJ_FLOWSPEC
:
1391 switch(rsvp_obj_ctype
) {
1395 ND_PRINT("%s Msg-Version: %u, length: %u",
1397 (EXTRACT_U_1(obj_tptr
) & 0xf0) >> 4,
1398 EXTRACT_BE_U_2(obj_tptr
+ 2) << 2);
1399 obj_tptr
+=4; /* get to the start of the service header */
1402 while (obj_tlen
>= 4) {
1403 intserv_serv_tlen
=EXTRACT_BE_U_2(obj_tptr
+ 2)<<2;
1404 ND_PRINT("%s Service Type: %s (%u), break bit %sset, Service length: %u",
1406 tok2str(rsvp_intserv_service_type_values
,"unknown",EXTRACT_U_1((obj_tptr
))),
1407 EXTRACT_U_1(obj_tptr
),
1408 (EXTRACT_U_1(obj_tptr
+ 1)&0x80) ? "" : "not ",
1411 obj_tptr
+=4; /* get to the start of the parameter list */
1414 while (intserv_serv_tlen
>=4) {
1415 processed
= rsvp_intserv_print(ndo
, obj_tptr
, obj_tlen
);
1418 obj_tlen
-=processed
;
1419 intserv_serv_tlen
-=processed
;
1420 obj_tptr
+=processed
;
1429 case RSVP_OBJ_FILTERSPEC
:
1430 switch(rsvp_obj_ctype
) {
1431 case RSVP_CTYPE_IPV4
:
1434 ND_PRINT("%s Source Address: %s, Source Port: %u",
1436 ipaddr_string(ndo
, obj_tptr
),
1437 EXTRACT_BE_U_2(obj_tptr
+ 6));
1441 case RSVP_CTYPE_IPV6
:
1444 ND_PRINT("%s Source Address: %s, Source Port: %u",
1446 ip6addr_string(ndo
, obj_tptr
),
1447 EXTRACT_BE_U_2(obj_tptr
+ 18));
1454 ND_PRINT("%s Source Address: %s, Flow Label: %u",
1456 ip6addr_string(ndo
, obj_tptr
),
1457 EXTRACT_BE_U_3(obj_tptr
+ 17));
1461 case RSVP_CTYPE_TUNNEL_IPV6
:
1464 ND_PRINT("%s Source Address: %s, LSP-ID: 0x%04x",
1466 ipaddr_string(ndo
, obj_tptr
),
1467 EXTRACT_BE_U_2(obj_tptr
+ 18));
1471 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
1474 ND_PRINT("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1475 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1477 ip6addr_string(ndo
, obj_tptr
),
1478 EXTRACT_BE_U_2(obj_tptr
+ 18),
1480 ip6addr_string(ndo
, obj_tptr
+20),
1481 EXTRACT_BE_U_2(obj_tptr
+ 38));
1485 case RSVP_CTYPE_TUNNEL_IPV4
:
1488 ND_PRINT("%s Source Address: %s, LSP-ID: 0x%04x",
1490 ipaddr_string(ndo
, obj_tptr
),
1491 EXTRACT_BE_U_2(obj_tptr
+ 6));
1495 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
1498 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1499 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1501 ipaddr_string(ndo
, obj_tptr
),
1502 EXTRACT_BE_U_2(obj_tptr
+ 6),
1504 ipaddr_string(ndo
, obj_tptr
+8),
1505 EXTRACT_BE_U_2(obj_tptr
+ 12));
1514 case RSVP_OBJ_FASTREROUTE
:
1515 /* the differences between c-type 1 and 7 are minor */
1516 obj_ptr
.rsvp_obj_frr
= (const struct rsvp_obj_frr_t
*)obj_tptr
;
1518 switch(rsvp_obj_ctype
) {
1519 case RSVP_CTYPE_1
: /* new style */
1520 if (obj_tlen
< sizeof(struct rsvp_obj_frr_t
))
1522 bw
.i
= EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1523 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1525 obj_ptr
.rsvp_obj_frr
->setup_prio
,
1526 obj_ptr
.rsvp_obj_frr
->hold_prio
,
1527 obj_ptr
.rsvp_obj_frr
->hop_limit
,
1528 bw
.f
* 8 / 1000000);
1529 ND_PRINT("%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
1531 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_any
),
1532 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->exclude_any
),
1533 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_all
));
1534 obj_tlen
-=sizeof(struct rsvp_obj_frr_t
);
1535 obj_tptr
+=sizeof(struct rsvp_obj_frr_t
);
1538 case RSVP_CTYPE_TUNNEL_IPV4
: /* old style */
1541 bw
.i
= EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1542 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1544 obj_ptr
.rsvp_obj_frr
->setup_prio
,
1545 obj_ptr
.rsvp_obj_frr
->hold_prio
,
1546 obj_ptr
.rsvp_obj_frr
->hop_limit
,
1547 bw
.f
* 8 / 1000000);
1548 ND_PRINT("%s Include Colors: 0x%08x, Exclude Colors: 0x%08x",
1550 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_any
),
1551 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->exclude_any
));
1561 case RSVP_OBJ_DETOUR
:
1562 switch(rsvp_obj_ctype
) {
1563 case RSVP_CTYPE_TUNNEL_IPV4
:
1564 while(obj_tlen
>= 8) {
1565 ND_PRINT("%s PLR-ID: %s, Avoid-Node-ID: %s",
1567 ipaddr_string(ndo
, obj_tptr
),
1568 ipaddr_string(ndo
, obj_tptr
+ 4));
1578 case RSVP_OBJ_CLASSTYPE
:
1579 case RSVP_OBJ_CLASSTYPE_OLD
: /* fall through */
1580 switch(rsvp_obj_ctype
) {
1582 ND_PRINT("%s CT: %u",
1584 EXTRACT_BE_U_4(obj_tptr
) & 0x7);
1593 case RSVP_OBJ_ERROR_SPEC
:
1594 switch(rsvp_obj_ctype
) {
1595 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1596 case RSVP_CTYPE_IPV4
:
1599 error_code
=EXTRACT_U_1(obj_tptr
+ 5);
1600 error_value
=EXTRACT_BE_U_2(obj_tptr
+ 6);
1601 ND_PRINT("%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1603 ipaddr_string(ndo
, obj_tptr
),
1604 EXTRACT_U_1(obj_tptr
+ 4),
1606 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1608 switch (error_code
) {
1609 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1610 ND_PRINT(", Error Value: %s (%u)",
1611 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1614 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
: /* fall through */
1615 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
:
1616 ND_PRINT(", Error Value: %s (%u)",
1617 tok2str(rsvp_obj_error_code_diffserv_te_values
,"unknown",error_value
),
1621 ND_PRINT(", Unknown Error Value (%u)", error_value
);
1627 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1628 case RSVP_CTYPE_IPV6
:
1631 error_code
=EXTRACT_U_1(obj_tptr
+ 17);
1632 error_value
=EXTRACT_BE_U_2(obj_tptr
+ 18);
1633 ND_PRINT("%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1635 ip6addr_string(ndo
, obj_tptr
),
1636 EXTRACT_U_1(obj_tptr
+ 16),
1638 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1641 switch (error_code
) {
1642 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1643 ND_PRINT(", Error Value: %s (%u)",
1644 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1658 case RSVP_OBJ_PROPERTIES
:
1659 switch(rsvp_obj_ctype
) {
1663 padbytes
= EXTRACT_BE_U_2(obj_tptr
+ 2);
1664 ND_PRINT("%s TLV count: %u, padding bytes: %u",
1666 EXTRACT_BE_U_2(obj_tptr
),
1670 /* loop through as long there is anything longer than the TLV header (2) */
1671 while(obj_tlen
>= 2 + padbytes
) {
1672 ND_PRINT("%s %s TLV (0x%02x), length: %u", /* length includes header */
1674 tok2str(rsvp_obj_prop_tlv_values
,"unknown",EXTRACT_U_1(obj_tptr
)),
1675 EXTRACT_U_1(obj_tptr
),
1676 EXTRACT_U_1(obj_tptr
+ 1));
1677 if (obj_tlen
< EXTRACT_U_1(obj_tptr
+ 1))
1679 if (EXTRACT_U_1(obj_tptr
+ 1) < 2)
1681 print_unknown_data(ndo
, obj_tptr
+ 2, "\n\t\t",
1682 EXTRACT_U_1(obj_tptr
+ 1) - 2);
1683 obj_tlen
-=EXTRACT_U_1(obj_tptr
+ 1);
1684 obj_tptr
+=EXTRACT_U_1(obj_tptr
+ 1);
1692 case RSVP_OBJ_MESSAGE_ID
: /* fall through */
1693 case RSVP_OBJ_MESSAGE_ID_ACK
: /* fall through */
1694 case RSVP_OBJ_MESSAGE_ID_LIST
:
1695 switch(rsvp_obj_ctype
) {
1700 ND_PRINT("%s Flags [0x%02x], epoch: %u",
1702 EXTRACT_U_1(obj_tptr
),
1703 EXTRACT_BE_U_3(obj_tptr
+ 1));
1706 /* loop through as long there are no messages left */
1707 while(obj_tlen
>= 4) {
1708 ND_PRINT("%s Message-ID 0x%08x (%u)",
1710 EXTRACT_BE_U_4(obj_tptr
),
1711 EXTRACT_BE_U_4(obj_tptr
));
1721 case RSVP_OBJ_INTEGRITY
:
1722 switch(rsvp_obj_ctype
) {
1724 if (obj_tlen
< sizeof(struct rsvp_obj_integrity_t
))
1726 obj_ptr
.rsvp_obj_integrity
= (const struct rsvp_obj_integrity_t
*)obj_tptr
;
1727 ND_PRINT("%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
1729 EXTRACT_BE_U_2(obj_ptr
.rsvp_obj_integrity
->key_id
),
1730 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->key_id
+ 2),
1731 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->sequence
),
1732 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->sequence
+ 4),
1733 bittok2str(rsvp_obj_integrity_flag_values
,
1735 obj_ptr
.rsvp_obj_integrity
->flags
));
1736 ND_PRINT("%s MD5-sum 0x%08x%08x%08x%08x ",
1738 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
),
1739 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 4),
1740 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 8),
1741 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 12));
1743 sigcheck
= signature_verify(ndo
, pptr
, plen
,
1744 obj_ptr
.rsvp_obj_integrity
->digest
,
1745 rsvp_clear_checksum
,
1747 ND_PRINT(" (%s)", tok2str(signature_check_values
, "Unknown", sigcheck
));
1749 obj_tlen
+=sizeof(struct rsvp_obj_integrity_t
);
1750 obj_tptr
+=sizeof(struct rsvp_obj_integrity_t
);
1757 case RSVP_OBJ_ADMIN_STATUS
:
1758 switch(rsvp_obj_ctype
) {
1762 ND_PRINT("%s Flags [%s]", indent
,
1763 bittok2str(rsvp_obj_admin_status_flag_values
, "none",
1764 EXTRACT_BE_U_4(obj_tptr
)));
1773 case RSVP_OBJ_LABEL_SET
:
1774 switch(rsvp_obj_ctype
) {
1778 action
= (EXTRACT_BE_U_2(obj_tptr
)>>8);
1780 ND_PRINT("%s Action: %s (%u), Label type: %u", indent
,
1781 tok2str(rsvp_obj_label_set_action_values
, "Unknown", action
),
1782 action
, ((EXTRACT_BE_U_4(obj_tptr
) & 0x7F)));
1785 case LABEL_SET_INCLUSIVE_RANGE
:
1786 case LABEL_SET_EXCLUSIVE_RANGE
: /* fall through */
1788 /* only a couple of subchannels are expected */
1791 ND_PRINT("%s Start range: %u, End range: %u", indent
,
1792 EXTRACT_BE_U_4(obj_tptr
+ 4),
1793 EXTRACT_BE_U_4(obj_tptr
+ 8));
1802 while(obj_tlen
>= 4 ) {
1803 ND_PRINT("%s Subchannel #%u: %u", indent
, subchannel
,
1804 EXTRACT_BE_U_4(obj_tptr
));
1818 switch (rsvp_obj_ctype
) {
1819 case RSVP_CTYPE_IPV4
:
1822 ND_PRINT("%s Sub-LSP destination address: %s",
1823 indent
, ipaddr_string(ndo
, obj_tptr
));
1828 case RSVP_CTYPE_IPV6
:
1831 ND_PRINT("%s Sub-LSP destination address: %s",
1832 indent
, ip6addr_string(ndo
, obj_tptr
));
1843 * FIXME those are the defined objects that lack a decoder
1844 * you are welcome to contribute code ;-)
1847 case RSVP_OBJ_SCOPE
:
1848 case RSVP_OBJ_POLICY_DATA
:
1849 case RSVP_OBJ_ACCEPT_LABEL_SET
:
1850 case RSVP_OBJ_PROTECTION
:
1852 if (ndo
->ndo_vflag
<= 1)
1853 print_unknown_data(ndo
, obj_tptr
, "\n\t ", obj_tlen
); /* FIXME indentation */
1856 /* do we also want to see a hex dump ? */
1857 if (ndo
->ndo_vflag
> 1 || hexdump
== TRUE
)
1858 print_unknown_data(ndo
, tptr
+ sizeof(struct rsvp_object_header
), "\n\t ", /* FIXME indentation */
1859 rsvp_obj_len
- sizeof(struct rsvp_object_header
));
1866 ND_PRINT("%s", istr
);
1870 ND_PRINT("%s", tstr
);
1875 rsvp_print(netdissect_options
*ndo
,
1876 const u_char
*pptr
, u_int len
)
1878 const struct rsvp_common_header
*rsvp_com_header
;
1879 uint8_t version_flags
, msg_type
;
1885 rsvp_com_header
= (const struct rsvp_common_header
*)pptr
;
1886 ND_TCHECK_SIZE(rsvp_com_header
);
1887 version_flags
= EXTRACT_U_1(rsvp_com_header
->version_flags
);
1890 * Sanity checking of the header.
1892 if (RSVP_EXTRACT_VERSION(version_flags
) != RSVP_VERSION
) {
1893 ND_PRINT("ERROR: RSVP version %u packet not supported",
1894 RSVP_EXTRACT_VERSION(version_flags
));
1898 msg_type
= EXTRACT_U_1(rsvp_com_header
->msg_type
);
1900 /* in non-verbose mode just lets print the basic Message Type*/
1901 if (ndo
->ndo_vflag
< 1) {
1902 ND_PRINT("RSVPv%u %s Message, length: %u",
1903 RSVP_EXTRACT_VERSION(version_flags
),
1904 tok2str(rsvp_msg_type_values
, "unknown (%u)",msg_type
),
1909 /* ok they seem to want to know everything - lets fully decode it */
1911 plen
= tlen
= EXTRACT_BE_U_2(rsvp_com_header
->length
);
1913 ND_PRINT("\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1914 RSVP_EXTRACT_VERSION(version_flags
),
1915 tok2str(rsvp_msg_type_values
, "unknown, type: %u",msg_type
),
1917 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(version_flags
)),
1919 EXTRACT_U_1(rsvp_com_header
->ttl
),
1920 EXTRACT_BE_U_2(rsvp_com_header
->checksum
));
1922 if (tlen
< sizeof(struct rsvp_common_header
)) {
1923 ND_PRINT("ERROR: common header too short %u < %lu", tlen
,
1924 (unsigned long)sizeof(struct rsvp_common_header
));
1928 tptr
+=sizeof(struct rsvp_common_header
);
1929 tlen
-=sizeof(struct rsvp_common_header
);
1933 case RSVP_MSGTYPE_BUNDLE
:
1935 * Process each submessage in the bundle message.
1936 * Bundle messages may not contain bundle submessages, so we don't
1937 * need to handle bundle submessages specially.
1940 const u_char
*subpptr
=tptr
, *subtptr
;
1941 u_short subplen
, subtlen
;
1945 rsvp_com_header
= (const struct rsvp_common_header
*)subpptr
;
1946 ND_TCHECK_SIZE(rsvp_com_header
);
1947 version_flags
= EXTRACT_U_1(rsvp_com_header
->version_flags
);
1950 * Sanity checking of the header.
1952 if (RSVP_EXTRACT_VERSION(version_flags
) != RSVP_VERSION
) {
1953 ND_PRINT("ERROR: RSVP version %u packet not supported",
1954 RSVP_EXTRACT_VERSION(version_flags
));
1958 subplen
= subtlen
= EXTRACT_BE_U_2(rsvp_com_header
->length
);
1960 msg_type
= EXTRACT_U_1(rsvp_com_header
->msg_type
);
1961 ND_PRINT("\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1962 RSVP_EXTRACT_VERSION(version_flags
),
1963 tok2str(rsvp_msg_type_values
, "unknown, type: %u",msg_type
),
1965 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(version_flags
)),
1967 EXTRACT_U_1(rsvp_com_header
->ttl
),
1968 EXTRACT_BE_U_2(rsvp_com_header
->checksum
));
1970 if (subtlen
< sizeof(struct rsvp_common_header
)) {
1971 ND_PRINT("ERROR: common header too short %u < %lu", subtlen
,
1972 (unsigned long)sizeof(struct rsvp_common_header
));
1976 if (tlen
< subtlen
) {
1977 ND_PRINT("ERROR: common header too large %u > %u", subtlen
,
1982 subtptr
+=sizeof(struct rsvp_common_header
);
1983 subtlen
-=sizeof(struct rsvp_common_header
);
1986 * Print all objects in the submessage.
1988 if (rsvp_obj_print(ndo
, subpptr
, subplen
, subtptr
, "\n\t ", subtlen
, rsvp_com_header
) == -1)
1991 tptr
+=subtlen
+sizeof(struct rsvp_common_header
);
1992 tlen
-=subtlen
+sizeof(struct rsvp_common_header
);
1997 case RSVP_MSGTYPE_PATH
:
1998 case RSVP_MSGTYPE_RESV
:
1999 case RSVP_MSGTYPE_PATHERR
:
2000 case RSVP_MSGTYPE_RESVERR
:
2001 case RSVP_MSGTYPE_PATHTEAR
:
2002 case RSVP_MSGTYPE_RESVTEAR
:
2003 case RSVP_MSGTYPE_RESVCONF
:
2004 case RSVP_MSGTYPE_HELLO_OLD
:
2005 case RSVP_MSGTYPE_HELLO
:
2006 case RSVP_MSGTYPE_ACK
:
2007 case RSVP_MSGTYPE_SREFRESH
:
2009 * Print all objects in the message.
2011 if (rsvp_obj_print(ndo
, pptr
, plen
, tptr
, "\n\t ", tlen
, rsvp_com_header
) == -1)
2016 print_unknown_data(ndo
, tptr
, "\n\t ", tlen
);
2023 ND_PRINT("%s", tstr
);