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 */
24 #include <netdissect-stdinc.h>
26 #include "netdissect.h"
28 #include "addrtoname.h"
29 #include "ethertype.h"
32 #include "signature.h"
34 static const char tstr
[] = " [|rsvp]";
37 * RFC 2205 common header
40 * +-------------+-------------+-------------+-------------+
41 * | Vers | Flags| Msg Type | RSVP Checksum |
42 * +-------------+-------------+-------------+-------------+
43 * | Send_TTL | (Reserved) | RSVP Length |
44 * +-------------+-------------+-------------+-------------+
48 struct rsvp_common_header
{
49 uint8_t version_flags
;
58 * RFC2205 object header
62 * +-------------+-------------+-------------+-------------+
63 * | Length (bytes) | Class-Num | C-Type |
64 * +-------------+-------------+-------------+-------------+
66 * // (Object contents) //
68 * +-------------+-------------+-------------+-------------+
71 struct rsvp_object_header
{
77 #define RSVP_VERSION 1
78 #define RSVP_EXTRACT_VERSION(x) (((x)&0xf0)>>4)
79 #define RSVP_EXTRACT_FLAGS(x) ((x)&0x0f)
81 #define RSVP_MSGTYPE_PATH 1
82 #define RSVP_MSGTYPE_RESV 2
83 #define RSVP_MSGTYPE_PATHERR 3
84 #define RSVP_MSGTYPE_RESVERR 4
85 #define RSVP_MSGTYPE_PATHTEAR 5
86 #define RSVP_MSGTYPE_RESVTEAR 6
87 #define RSVP_MSGTYPE_RESVCONF 7
88 #define RSVP_MSGTYPE_BUNDLE 12
89 #define RSVP_MSGTYPE_ACK 13
90 #define RSVP_MSGTYPE_HELLO_OLD 14 /* ancient Hellos */
91 #define RSVP_MSGTYPE_SREFRESH 15
92 #define RSVP_MSGTYPE_HELLO 20
94 static const struct tok rsvp_msg_type_values
[] = {
95 { RSVP_MSGTYPE_PATH
, "Path" },
96 { RSVP_MSGTYPE_RESV
, "Resv" },
97 { RSVP_MSGTYPE_PATHERR
, "PathErr" },
98 { RSVP_MSGTYPE_RESVERR
, "ResvErr" },
99 { RSVP_MSGTYPE_PATHTEAR
, "PathTear" },
100 { RSVP_MSGTYPE_RESVTEAR
, "ResvTear" },
101 { RSVP_MSGTYPE_RESVCONF
, "ResvConf" },
102 { RSVP_MSGTYPE_BUNDLE
, "Bundle" },
103 { RSVP_MSGTYPE_ACK
, "Acknowledgement" },
104 { RSVP_MSGTYPE_HELLO_OLD
, "Hello (Old)" },
105 { RSVP_MSGTYPE_SREFRESH
, "Refresh" },
106 { RSVP_MSGTYPE_HELLO
, "Hello" },
110 static const struct tok rsvp_header_flag_values
[] = {
111 { 0x01, "Refresh reduction capable" }, /* rfc2961 */
115 #define RSVP_OBJ_SESSION 1 /* rfc2205 */
116 #define RSVP_OBJ_RSVP_HOP 3 /* rfc2205, rfc3473 */
117 #define RSVP_OBJ_INTEGRITY 4 /* rfc2747 */
118 #define RSVP_OBJ_TIME_VALUES 5 /* rfc2205 */
119 #define RSVP_OBJ_ERROR_SPEC 6
120 #define RSVP_OBJ_SCOPE 7
121 #define RSVP_OBJ_STYLE 8 /* rfc2205 */
122 #define RSVP_OBJ_FLOWSPEC 9 /* rfc2215 */
123 #define RSVP_OBJ_FILTERSPEC 10 /* rfc2215 */
124 #define RSVP_OBJ_SENDER_TEMPLATE 11
125 #define RSVP_OBJ_SENDER_TSPEC 12 /* rfc2215 */
126 #define RSVP_OBJ_ADSPEC 13 /* rfc2215 */
127 #define RSVP_OBJ_POLICY_DATA 14
128 #define RSVP_OBJ_CONFIRM 15 /* rfc2205 */
129 #define RSVP_OBJ_LABEL 16 /* rfc3209 */
130 #define RSVP_OBJ_LABEL_REQ 19 /* rfc3209 */
131 #define RSVP_OBJ_ERO 20 /* rfc3209 */
132 #define RSVP_OBJ_RRO 21 /* rfc3209 */
133 #define RSVP_OBJ_HELLO 22 /* rfc3209 */
134 #define RSVP_OBJ_MESSAGE_ID 23 /* rfc2961 */
135 #define RSVP_OBJ_MESSAGE_ID_ACK 24 /* rfc2961 */
136 #define RSVP_OBJ_MESSAGE_ID_LIST 25 /* rfc2961 */
137 #define RSVP_OBJ_RECOVERY_LABEL 34 /* rfc3473 */
138 #define RSVP_OBJ_UPSTREAM_LABEL 35 /* rfc3473 */
139 #define RSVP_OBJ_LABEL_SET 36 /* rfc3473 */
140 #define RSVP_OBJ_PROTECTION 37 /* rfc3473 */
141 #define RSVP_OBJ_S2L 50 /* rfc4875 */
142 #define RSVP_OBJ_DETOUR 63 /* rfc4090 */
143 #define RSVP_OBJ_CLASSTYPE 66 /* rfc4124 */
144 #define RSVP_OBJ_CLASSTYPE_OLD 125 /* draft-ietf-tewg-diff-te-proto-07 */
145 #define RSVP_OBJ_SUGGESTED_LABEL 129 /* rfc3473 */
146 #define RSVP_OBJ_ACCEPT_LABEL_SET 130 /* rfc3473 */
147 #define RSVP_OBJ_RESTART_CAPABILITY 131 /* rfc3473 */
148 #define RSVP_OBJ_NOTIFY_REQ 195 /* rfc3473 */
149 #define RSVP_OBJ_ADMIN_STATUS 196 /* rfc3473 */
150 #define RSVP_OBJ_PROPERTIES 204 /* juniper proprietary */
151 #define RSVP_OBJ_FASTREROUTE 205 /* rfc4090 */
152 #define RSVP_OBJ_SESSION_ATTRIBUTE 207 /* rfc3209 */
153 #define RSVP_OBJ_GENERALIZED_UNI 229 /* OIF RSVP extensions UNI 1.0 Signaling, Rel. 2 */
154 #define RSVP_OBJ_CALL_ID 230 /* rfc3474 */
155 #define RSVP_OBJ_CALL_OPS 236 /* rfc3474 */
157 static const struct tok rsvp_obj_values
[] = {
158 { RSVP_OBJ_SESSION
, "Session" },
159 { RSVP_OBJ_RSVP_HOP
, "RSVP Hop" },
160 { RSVP_OBJ_INTEGRITY
, "Integrity" },
161 { RSVP_OBJ_TIME_VALUES
, "Time Values" },
162 { RSVP_OBJ_ERROR_SPEC
, "Error Spec" },
163 { RSVP_OBJ_SCOPE
, "Scope" },
164 { RSVP_OBJ_STYLE
, "Style" },
165 { RSVP_OBJ_FLOWSPEC
, "Flowspec" },
166 { RSVP_OBJ_FILTERSPEC
, "FilterSpec" },
167 { RSVP_OBJ_SENDER_TEMPLATE
, "Sender Template" },
168 { RSVP_OBJ_SENDER_TSPEC
, "Sender TSpec" },
169 { RSVP_OBJ_ADSPEC
, "Adspec" },
170 { RSVP_OBJ_POLICY_DATA
, "Policy Data" },
171 { RSVP_OBJ_CONFIRM
, "Confirm" },
172 { RSVP_OBJ_LABEL
, "Label" },
173 { RSVP_OBJ_LABEL_REQ
, "Label Request" },
174 { RSVP_OBJ_ERO
, "ERO" },
175 { RSVP_OBJ_RRO
, "RRO" },
176 { RSVP_OBJ_HELLO
, "Hello" },
177 { RSVP_OBJ_MESSAGE_ID
, "Message ID" },
178 { RSVP_OBJ_MESSAGE_ID_ACK
, "Message ID Ack" },
179 { RSVP_OBJ_MESSAGE_ID_LIST
, "Message ID List" },
180 { RSVP_OBJ_RECOVERY_LABEL
, "Recovery Label" },
181 { RSVP_OBJ_UPSTREAM_LABEL
, "Upstream Label" },
182 { RSVP_OBJ_LABEL_SET
, "Label Set" },
183 { RSVP_OBJ_ACCEPT_LABEL_SET
, "Acceptable Label Set" },
184 { RSVP_OBJ_DETOUR
, "Detour" },
185 { RSVP_OBJ_CLASSTYPE
, "Class Type" },
186 { RSVP_OBJ_CLASSTYPE_OLD
, "Class Type (old)" },
187 { RSVP_OBJ_SUGGESTED_LABEL
, "Suggested Label" },
188 { RSVP_OBJ_PROPERTIES
, "Properties" },
189 { RSVP_OBJ_FASTREROUTE
, "Fast Re-Route" },
190 { RSVP_OBJ_SESSION_ATTRIBUTE
, "Session Attribute" },
191 { RSVP_OBJ_GENERALIZED_UNI
, "Generalized UNI" },
192 { RSVP_OBJ_CALL_ID
, "Call-ID" },
193 { RSVP_OBJ_CALL_OPS
, "Call Capability" },
194 { RSVP_OBJ_RESTART_CAPABILITY
, "Restart Capability" },
195 { RSVP_OBJ_NOTIFY_REQ
, "Notify Request" },
196 { RSVP_OBJ_PROTECTION
, "Protection" },
197 { RSVP_OBJ_ADMIN_STATUS
, "Administrative Status" },
198 { RSVP_OBJ_S2L
, "Sub-LSP to LSP" },
202 #define RSVP_CTYPE_IPV4 1
203 #define RSVP_CTYPE_IPV6 2
204 #define RSVP_CTYPE_TUNNEL_IPV4 7
205 #define RSVP_CTYPE_TUNNEL_IPV6 8
206 #define RSVP_CTYPE_UNI_IPV4 11 /* OIF RSVP extensions UNI 1.0 Signaling Rel. 2 */
207 #define RSVP_CTYPE_1 1
208 #define RSVP_CTYPE_2 2
209 #define RSVP_CTYPE_3 3
210 #define RSVP_CTYPE_4 4
211 #define RSVP_CTYPE_12 12
212 #define RSVP_CTYPE_13 13
213 #define RSVP_CTYPE_14 14
216 * the ctypes are not globally unique so for
217 * translating it to strings we build a table based
218 * on objects offsetted by the ctype
221 static const struct tok rsvp_ctype_values
[] = {
222 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV4
, "IPv4" },
223 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV6
, "IPv6" },
224 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
225 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
226 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV4
, "IPv4" },
227 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV6
, "IPv6" },
228 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV4
, "IPv4" },
229 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV6
, "IPv6" },
230 { 256*RSVP_OBJ_TIME_VALUES
+RSVP_CTYPE_1
, "1" },
231 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_1
, "obsolete" },
232 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_2
, "IntServ" },
233 { 256*RSVP_OBJ_SENDER_TSPEC
+RSVP_CTYPE_2
, "IntServ" },
234 { 256*RSVP_OBJ_ADSPEC
+RSVP_CTYPE_2
, "IntServ" },
235 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
236 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
237 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_3
, "IPv6 Flow-label" },
238 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
239 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
240 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
241 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV4
, "IPv4" },
242 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV6
, "IPv6" },
243 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
244 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_UNI_IPV4
, "UNI IPv4" },
245 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_13
, "IPv4 P2MP LSP Tunnel" },
246 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_14
, "IPv6 P2MP LSP Tunnel" },
247 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV4
, "IPv4" },
248 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV6
, "IPv6" },
249 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
250 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
251 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
252 { 256*RSVP_OBJ_MESSAGE_ID
+RSVP_CTYPE_1
, "1" },
253 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_1
, "Message id ack" },
254 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_2
, "Message id nack" },
255 { 256*RSVP_OBJ_MESSAGE_ID_LIST
+RSVP_CTYPE_1
, "1" },
256 { 256*RSVP_OBJ_STYLE
+RSVP_CTYPE_1
, "1" },
257 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_1
, "Hello Request" },
258 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_2
, "Hello Ack" },
259 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_1
, "without label range" },
260 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_2
, "with ATM label range" },
261 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_3
, "with FR label range" },
262 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_4
, "Generalized Label" },
263 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_1
, "Label" },
264 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
265 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
266 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_1
, "Label" },
267 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
268 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
269 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_1
, "Label" },
270 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
271 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
272 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_1
, "Label" },
273 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
274 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
275 { 256*RSVP_OBJ_ERO
+RSVP_CTYPE_IPV4
, "IPv4" },
276 { 256*RSVP_OBJ_RRO
+RSVP_CTYPE_IPV4
, "IPv4" },
277 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
278 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
279 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
280 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
281 { 256*RSVP_OBJ_RESTART_CAPABILITY
+RSVP_CTYPE_1
, "IPv4" },
282 { 256*RSVP_OBJ_SESSION_ATTRIBUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
283 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" }, /* old style*/
284 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_1
, "1" }, /* new style */
285 { 256*RSVP_OBJ_DETOUR
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
286 { 256*RSVP_OBJ_PROPERTIES
+RSVP_CTYPE_1
, "1" },
287 { 256*RSVP_OBJ_ADMIN_STATUS
+RSVP_CTYPE_1
, "1" },
288 { 256*RSVP_OBJ_CLASSTYPE
+RSVP_CTYPE_1
, "1" },
289 { 256*RSVP_OBJ_CLASSTYPE_OLD
+RSVP_CTYPE_1
, "1" },
290 { 256*RSVP_OBJ_LABEL_SET
+RSVP_CTYPE_1
, "1" },
291 { 256*RSVP_OBJ_GENERALIZED_UNI
+RSVP_CTYPE_1
, "1" },
292 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV4
, "IPv4 sub-LSP" },
293 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV6
, "IPv6 sub-LSP" },
297 struct rsvp_obj_integrity_t
{
305 static const struct tok rsvp_obj_integrity_flag_values
[] = {
306 { 0x80, "Handshake" },
310 struct rsvp_obj_frr_t
{
315 uint8_t bandwidth
[4];
316 uint8_t include_any
[4];
317 uint8_t exclude_any
[4];
318 uint8_t include_all
[4];
322 #define RSVP_OBJ_XRO_MASK_SUBOBJ(x) ((x)&0x7f)
323 #define RSVP_OBJ_XRO_MASK_LOOSE(x) ((x)&0x80)
325 #define RSVP_OBJ_XRO_RES 0
326 #define RSVP_OBJ_XRO_IPV4 1
327 #define RSVP_OBJ_XRO_IPV6 2
328 #define RSVP_OBJ_XRO_LABEL 3
329 #define RSVP_OBJ_XRO_ASN 32
330 #define RSVP_OBJ_XRO_MPLS 64
332 static const struct tok rsvp_obj_xro_values
[] = {
333 { RSVP_OBJ_XRO_RES
, "Reserved" },
334 { RSVP_OBJ_XRO_IPV4
, "IPv4 prefix" },
335 { RSVP_OBJ_XRO_IPV6
, "IPv6 prefix" },
336 { RSVP_OBJ_XRO_LABEL
, "Label" },
337 { RSVP_OBJ_XRO_ASN
, "Autonomous system number" },
338 { RSVP_OBJ_XRO_MPLS
, "MPLS label switched path termination" },
343 static const struct tok rsvp_obj_rro_flag_values
[] = {
344 { 0x01, "Local protection available" },
345 { 0x02, "Local protection in use" },
346 { 0x04, "Bandwidth protection" },
347 { 0x08, "Node protection" },
352 static const struct tok rsvp_obj_rro_label_flag_values
[] = {
357 static const struct tok rsvp_resstyle_values
[] = {
358 { 17, "Wildcard Filter" },
359 { 10, "Fixed Filter" },
360 { 18, "Shared Explicit" },
364 #define RSVP_OBJ_INTSERV_GUARANTEED_SERV 2
365 #define RSVP_OBJ_INTSERV_CONTROLLED_LOAD 5
367 static const struct tok rsvp_intserv_service_type_values
[] = {
368 { 1, "Default/Global Information" },
369 { RSVP_OBJ_INTSERV_GUARANTEED_SERV
, "Guaranteed Service" },
370 { RSVP_OBJ_INTSERV_CONTROLLED_LOAD
, "Controlled Load" },
374 static const struct tok rsvp_intserv_parameter_id_values
[] = {
376 { 6, "Path b/w estimate" },
377 { 8, "Minimum path latency" },
378 { 10, "Composed MTU" },
379 { 127, "Token Bucket TSpec" },
380 { 130, "Guaranteed Service RSpec" },
381 { 133, "End-to-end composed value for C" },
382 { 134, "End-to-end composed value for D" },
383 { 135, "Since-last-reshaping point composed C" },
384 { 136, "Since-last-reshaping point composed D" },
388 static const struct tok rsvp_session_attribute_flag_values
[] = {
389 { 0x01, "Local Protection" },
390 { 0x02, "Label Recording" },
391 { 0x04, "SE Style" },
392 { 0x08, "Bandwidth protection" }, /* RFC4090 */
393 { 0x10, "Node protection" }, /* RFC4090 */
397 static const struct tok rsvp_obj_prop_tlv_values
[] = {
399 { 0x02, "Metric 1" },
400 { 0x04, "Metric 2" },
401 { 0x08, "CCC Status" },
402 { 0x10, "Path Type" },
406 #define RSVP_OBJ_ERROR_SPEC_CODE_ROUTING 24
407 #define RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY 25
408 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE 28
409 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD 125
411 static const struct tok rsvp_obj_error_code_values
[] = {
412 { RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
, "Routing Problem" },
413 { RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY
, "Notify Error" },
414 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
, "Diffserv TE Error" },
415 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
, "Diffserv TE Error (Old)" },
419 static const struct tok rsvp_obj_error_code_routing_values
[] = {
420 { 1, "Bad EXPLICIT_ROUTE object" },
421 { 2, "Bad strict node" },
422 { 3, "Bad loose node" },
423 { 4, "Bad initial subobject" },
424 { 5, "No route available toward destination" },
425 { 6, "Unacceptable label value" },
426 { 7, "RRO indicated routing loops" },
427 { 8, "non-RSVP-capable router in the path" },
428 { 9, "MPLS label allocation failure" },
429 { 10, "Unsupported L3PID" },
433 static const struct tok rsvp_obj_error_code_diffserv_te_values
[] = {
434 { 1, "Unexpected CT object" },
435 { 2, "Unsupported CT" },
436 { 3, "Invalid CT value" },
437 { 4, "CT/setup priority do not form a configured TE-Class" },
438 { 5, "CT/holding priority do not form a configured TE-Class" },
439 { 6, "CT/setup priority and CT/holding priority do not form a configured TE-Class" },
440 { 7, "Inconsistency between signaled PSC and signaled CT" },
441 { 8, "Inconsistency between signaled PHBs and signaled CT" },
445 /* rfc3473 / rfc 3471 */
446 static const struct tok rsvp_obj_admin_status_flag_values
[] = {
447 { 0x80000000, "Reflect" },
448 { 0x00000004, "Testing" },
449 { 0x00000002, "Admin-down" },
450 { 0x00000001, "Delete-in-progress" },
454 /* label set actions - rfc3471 */
455 #define LABEL_SET_INCLUSIVE_LIST 0
456 #define LABEL_SET_EXCLUSIVE_LIST 1
457 #define LABEL_SET_INCLUSIVE_RANGE 2
458 #define LABEL_SET_EXCLUSIVE_RANGE 3
460 static const struct tok rsvp_obj_label_set_action_values
[] = {
461 { LABEL_SET_INCLUSIVE_LIST
, "Inclusive list" },
462 { LABEL_SET_EXCLUSIVE_LIST
, "Exclusive list" },
463 { LABEL_SET_INCLUSIVE_RANGE
, "Inclusive range" },
464 { LABEL_SET_EXCLUSIVE_RANGE
, "Exclusive range" },
468 /* OIF RSVP extensions UNI 1.0 Signaling, release 2 */
469 #define RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS 1
470 #define RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS 2
471 #define RSVP_GEN_UNI_SUBOBJ_DIVERSITY 3
472 #define RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL 4
473 #define RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL 5
475 static const struct tok rsvp_obj_generalized_uni_values
[] = {
476 { RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
, "Source TNA address" },
477 { RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
, "Destination TNA address" },
478 { RSVP_GEN_UNI_SUBOBJ_DIVERSITY
, "Diversity" },
479 { RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
, "Egress label" },
480 { RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
, "Service level" },
485 * this is a dissector for all the intserv defined
486 * specs as defined per rfc2215
487 * it is called from various rsvp objects;
488 * returns the amount of bytes being processed
491 rsvp_intserv_print(netdissect_options
*ndo
,
492 const u_char
*tptr
, u_short obj_tlen
)
494 u_int parameter_id
,parameter_length
;
503 parameter_id
= EXTRACT_U_1(tptr
);
504 ND_TCHECK_2(tptr
+ 2);
505 parameter_length
= EXTRACT_BE_U_2(tptr
+ 2)<<2; /* convert wordcount to bytecount */
507 ND_PRINT((ndo
, "\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
508 tok2str(rsvp_intserv_parameter_id_values
,"unknown",parameter_id
),
511 EXTRACT_U_1(tptr
+ 1)));
513 if (obj_tlen
< parameter_length
+4)
515 switch(parameter_id
) { /* parameter_id */
519 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
520 * | 4 (e) | (f) | 1 (g) |
521 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
522 * | IS hop cnt (32-bit unsigned integer) |
523 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
525 if (parameter_length
== 4) {
526 ND_TCHECK_4(tptr
+ 4);
527 ND_PRINT((ndo
, "\n\t\tIS hop count: %u", EXTRACT_BE_U_4(tptr
+ 4)));
533 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
534 * | 6 (h) | (i) | 1 (j) |
535 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
536 * | Path b/w estimate (32-bit IEEE floating point number) |
537 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
539 if (parameter_length
== 4) {
540 ND_TCHECK_4(tptr
+ 4);
541 bw
.i
= EXTRACT_BE_U_4(tptr
+ 4);
542 ND_PRINT((ndo
, "\n\t\tPath b/w estimate: %.10g Mbps", bw
.f
/ 125000));
548 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
549 * | 8 (k) | (l) | 1 (m) |
550 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
551 * | Minimum path latency (32-bit integer) |
552 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
554 if (parameter_length
== 4) {
555 ND_TCHECK_4(tptr
+ 4);
556 ND_PRINT((ndo
, "\n\t\tMinimum path latency: "));
557 if (EXTRACT_BE_U_4(tptr
+ 4) == 0xffffffff)
558 ND_PRINT((ndo
, "don't care"));
560 ND_PRINT((ndo
, "%u", EXTRACT_BE_U_4(tptr
+ 4)));
567 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
568 * | 10 (n) | (o) | 1 (p) |
569 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
570 * | Composed MTU (32-bit unsigned integer) |
571 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
573 if (parameter_length
== 4) {
574 ND_TCHECK_4(tptr
+ 4);
575 ND_PRINT((ndo
, "\n\t\tComposed MTU: %u bytes", EXTRACT_BE_U_4(tptr
+ 4)));
580 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
581 * | 127 (e) | 0 (f) | 5 (g) |
582 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
583 * | Token Bucket Rate [r] (32-bit IEEE floating point number) |
584 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
585 * | Token Bucket Size [b] (32-bit IEEE floating point number) |
586 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
587 * | Peak Data Rate [p] (32-bit IEEE floating point number) |
588 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
589 * | Minimum Policed Unit [m] (32-bit integer) |
590 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
591 * | Maximum Packet Size [M] (32-bit integer) |
592 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
595 if (parameter_length
== 20) {
596 ND_TCHECK_LEN(tptr
+ 4, 20);
597 bw
.i
= EXTRACT_BE_U_4(tptr
+ 4);
598 ND_PRINT((ndo
, "\n\t\tToken Bucket Rate: %.10g Mbps", bw
.f
/ 125000));
599 bw
.i
= EXTRACT_BE_U_4(tptr
+ 8);
600 ND_PRINT((ndo
, "\n\t\tToken Bucket Size: %.10g bytes", bw
.f
));
601 bw
.i
= EXTRACT_BE_U_4(tptr
+ 12);
602 ND_PRINT((ndo
, "\n\t\tPeak Data Rate: %.10g Mbps", bw
.f
/ 125000));
603 ND_PRINT((ndo
, "\n\t\tMinimum Policed Unit: %u bytes", EXTRACT_BE_U_4(tptr
+ 16)));
604 ND_PRINT((ndo
, "\n\t\tMaximum Packet Size: %u bytes", EXTRACT_BE_U_4(tptr
+ 20)));
610 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
611 * | 130 (h) | 0 (i) | 2 (j) |
612 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
613 * | Rate [R] (32-bit IEEE floating point number) |
614 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
615 * | Slack Term [S] (32-bit integer) |
616 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
619 if (parameter_length
== 8) {
620 ND_TCHECK_8(tptr
+ 4);
621 bw
.i
= EXTRACT_BE_U_4(tptr
+ 4);
622 ND_PRINT((ndo
, "\n\t\tRate: %.10g Mbps", bw
.f
/ 125000));
623 ND_PRINT((ndo
, "\n\t\tSlack Term: %u", EXTRACT_BE_U_4(tptr
+ 8)));
631 if (parameter_length
== 4) {
632 ND_TCHECK_4(tptr
+ 4);
633 ND_PRINT((ndo
, "\n\t\tValue: %u", EXTRACT_BE_U_4(tptr
+ 4)));
638 if (ndo
->ndo_vflag
<= 1)
639 print_unknown_data(ndo
, tptr
+ 4, "\n\t\t", parameter_length
);
641 return (parameter_length
+4); /* header length 4 bytes */
644 ND_PRINT((ndo
, "%s", tstr
));
649 * Clear checksum prior to signature verification.
652 rsvp_clear_checksum(void *header
)
654 struct rsvp_common_header
*rsvp_com_header
= (struct rsvp_common_header
*) header
;
656 rsvp_com_header
->checksum
[0] = 0;
657 rsvp_com_header
->checksum
[1] = 0;
661 rsvp_obj_print(netdissect_options
*ndo
,
662 const u_char
*pptr
, u_int plen
, const u_char
*tptr
,
663 const char *indent
, u_int tlen
,
664 const struct rsvp_common_header
*rsvp_com_header
)
666 const struct rsvp_object_header
*rsvp_obj_header
;
667 const u_char
*obj_tptr
;
669 const struct rsvp_obj_integrity_t
*rsvp_obj_integrity
;
670 const struct rsvp_obj_frr_t
*rsvp_obj_frr
;
673 u_short rsvp_obj_len
,rsvp_obj_ctype
,obj_tlen
;
674 u_int intserv_serv_tlen
;
675 int hexdump
,processed
,padbytes
,error_code
,error_value
,i
,sigcheck
;
682 u_int action
, subchannel
;
684 while(tlen
>=sizeof(struct rsvp_object_header
)) {
685 /* did we capture enough for fully decoding the object header ? */
686 ND_TCHECK_LEN(tptr
, sizeof(struct rsvp_object_header
));
688 rsvp_obj_header
= (const struct rsvp_object_header
*)tptr
;
689 rsvp_obj_len
=EXTRACT_BE_U_2(rsvp_obj_header
->length
);
690 rsvp_obj_ctype
=rsvp_obj_header
->ctype
;
692 if(rsvp_obj_len
% 4) {
693 ND_PRINT((ndo
, "%sERROR: object header size %u not a multiple of 4", indent
, rsvp_obj_len
));
696 if(rsvp_obj_len
< sizeof(struct rsvp_object_header
)) {
697 ND_PRINT((ndo
, "%sERROR: object header too short %u < %lu", indent
, rsvp_obj_len
,
698 (unsigned long)sizeof(struct rsvp_object_header
)));
702 ND_PRINT((ndo
, "%s%s Object (%u) Flags: [%s",
704 tok2str(rsvp_obj_values
,
706 rsvp_obj_header
->class_num
),
707 rsvp_obj_header
->class_num
,
708 ((rsvp_obj_header
->class_num
) & 0x80) ? "ignore" : "reject"));
710 if (rsvp_obj_header
->class_num
> 128)
711 ND_PRINT((ndo
, " %s",
712 ((rsvp_obj_header
->class_num
) & 0x40) ? "and forward" : "silently"));
714 ND_PRINT((ndo
, " if unknown], Class-Type: %s (%u), length: %u",
715 tok2str(rsvp_ctype_values
,
717 ((rsvp_obj_header
->class_num
)<<8)+rsvp_obj_ctype
),
721 if(tlen
< rsvp_obj_len
) {
722 ND_PRINT((ndo
, "%sERROR: object goes past end of objects TLV", indent
));
726 obj_tptr
=tptr
+sizeof(struct rsvp_object_header
);
727 obj_tlen
=rsvp_obj_len
-sizeof(struct rsvp_object_header
);
729 /* did we capture enough for fully decoding the object ? */
730 if (!ND_TTEST_LEN(tptr
, rsvp_obj_len
))
734 switch(rsvp_obj_header
->class_num
) {
735 case RSVP_OBJ_SESSION
:
736 switch(rsvp_obj_ctype
) {
737 case RSVP_CTYPE_IPV4
:
740 ND_PRINT((ndo
, "%s IPv4 DestAddress: %s, Protocol ID: 0x%02x",
742 ipaddr_string(ndo
, obj_tptr
),
743 EXTRACT_U_1(obj_tptr
+ sizeof(struct in_addr
))));
744 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
746 EXTRACT_U_1((obj_tptr
+ 5)),
747 EXTRACT_BE_U_2(obj_tptr
+ 6)));
751 case RSVP_CTYPE_IPV6
:
754 ND_PRINT((ndo
, "%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
756 ip6addr_string(ndo
, obj_tptr
),
757 EXTRACT_U_1(obj_tptr
+ sizeof(struct in6_addr
))));
758 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
760 EXTRACT_U_1((obj_tptr
+ sizeof(struct in6_addr
) + 1)),
761 EXTRACT_BE_U_2(obj_tptr
+ sizeof(struct in6_addr
) + 2)));
766 case RSVP_CTYPE_TUNNEL_IPV6
:
769 ND_PRINT((ndo
, "%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
771 ip6addr_string(ndo
, obj_tptr
),
772 EXTRACT_BE_U_2(obj_tptr
+ 18),
773 ip6addr_string(ndo
, obj_tptr
+ 20)));
778 case RSVP_CTYPE_14
: /* IPv6 p2mp LSP Tunnel */
781 ND_PRINT((ndo
, "%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
783 EXTRACT_BE_U_4(obj_tptr
),
784 EXTRACT_BE_U_2(obj_tptr
+ 6),
785 ip6addr_string(ndo
, obj_tptr
+ 8)));
789 case RSVP_CTYPE_13
: /* IPv4 p2mp LSP Tunnel */
792 ND_PRINT((ndo
, "%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
794 ipaddr_string(ndo
, obj_tptr
),
795 EXTRACT_BE_U_2(obj_tptr
+ 6),
796 ipaddr_string(ndo
, obj_tptr
+ 8)));
800 case RSVP_CTYPE_TUNNEL_IPV4
:
801 case RSVP_CTYPE_UNI_IPV4
:
804 ND_PRINT((ndo
, "%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
806 ipaddr_string(ndo
, obj_tptr
),
807 EXTRACT_BE_U_2(obj_tptr
+ 6),
808 ipaddr_string(ndo
, obj_tptr
+ 8)));
817 case RSVP_OBJ_CONFIRM
:
818 switch(rsvp_obj_ctype
) {
819 case RSVP_CTYPE_IPV4
:
820 if (obj_tlen
< sizeof(struct in_addr
))
822 ND_PRINT((ndo
, "%s IPv4 Receiver Address: %s",
824 ipaddr_string(ndo
, obj_tptr
)));
825 obj_tlen
-=sizeof(struct in_addr
);
826 obj_tptr
+=sizeof(struct in_addr
);
828 case RSVP_CTYPE_IPV6
:
829 if (obj_tlen
< sizeof(struct in6_addr
))
831 ND_PRINT((ndo
, "%s IPv6 Receiver Address: %s",
833 ip6addr_string(ndo
, obj_tptr
)));
834 obj_tlen
-=sizeof(struct in6_addr
);
835 obj_tptr
+=sizeof(struct in6_addr
);
842 case RSVP_OBJ_NOTIFY_REQ
:
843 switch(rsvp_obj_ctype
) {
844 case RSVP_CTYPE_IPV4
:
845 if (obj_tlen
< sizeof(struct in_addr
))
847 ND_PRINT((ndo
, "%s IPv4 Notify Node Address: %s",
849 ipaddr_string(ndo
, obj_tptr
)));
850 obj_tlen
-=sizeof(struct in_addr
);
851 obj_tptr
+=sizeof(struct in_addr
);
853 case RSVP_CTYPE_IPV6
:
854 if (obj_tlen
< sizeof(struct in6_addr
))
856 ND_PRINT((ndo
, "%s IPv6 Notify Node Address: %s",
858 ip6addr_string(ndo
, obj_tptr
)));
859 obj_tlen
-=sizeof(struct in6_addr
);
860 obj_tptr
+=sizeof(struct in6_addr
);
867 case RSVP_OBJ_SUGGESTED_LABEL
: /* fall through */
868 case RSVP_OBJ_UPSTREAM_LABEL
: /* fall through */
869 case RSVP_OBJ_RECOVERY_LABEL
: /* fall through */
871 switch(rsvp_obj_ctype
) {
873 while(obj_tlen
>= 4 ) {
874 ND_PRINT((ndo
, "%s Label: %u", indent
, EXTRACT_BE_U_4(obj_tptr
)));
882 ND_PRINT((ndo
, "%s Generalized Label: %u",
884 EXTRACT_BE_U_4(obj_tptr
)));
891 ND_PRINT((ndo
, "%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
893 EXTRACT_BE_U_4(obj_tptr
),
895 EXTRACT_BE_U_4(obj_tptr
+ 4),
896 EXTRACT_BE_U_4(obj_tptr
+ 8)));
906 switch(rsvp_obj_ctype
) {
910 ND_PRINT((ndo
, "%s Reservation Style: %s, Flags: [0x%02x]",
912 tok2str(rsvp_resstyle_values
,
914 EXTRACT_BE_U_3(obj_tptr
+ 1)),
915 EXTRACT_U_1(obj_tptr
)));
924 case RSVP_OBJ_SENDER_TEMPLATE
:
925 switch(rsvp_obj_ctype
) {
926 case RSVP_CTYPE_IPV4
:
929 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
931 ipaddr_string(ndo
, obj_tptr
),
932 EXTRACT_BE_U_2(obj_tptr
+ 6)));
936 case RSVP_CTYPE_IPV6
:
939 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
941 ip6addr_string(ndo
, obj_tptr
),
942 EXTRACT_BE_U_2(obj_tptr
+ 18)));
946 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
949 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
950 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
952 ip6addr_string(ndo
, obj_tptr
),
953 EXTRACT_BE_U_2(obj_tptr
+ 18),
955 ip6addr_string(ndo
, obj_tptr
+20),
956 EXTRACT_BE_U_2(obj_tptr
+ 38)));
960 case RSVP_CTYPE_TUNNEL_IPV4
:
963 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
965 ipaddr_string(ndo
, obj_tptr
),
966 EXTRACT_BE_U_2(obj_tptr
+ 6)));
970 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
973 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
974 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
976 ipaddr_string(ndo
, obj_tptr
),
977 EXTRACT_BE_U_2(obj_tptr
+ 6),
979 ipaddr_string(ndo
, obj_tptr
+8),
980 EXTRACT_BE_U_2(obj_tptr
+ 12)));
989 case RSVP_OBJ_LABEL_REQ
:
990 switch(rsvp_obj_ctype
) {
992 while(obj_tlen
>= 4 ) {
993 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
995 tok2str(ethertype_values
,
996 "Unknown Protocol (0x%04x)",
997 EXTRACT_BE_U_2(obj_tptr
+ 2))));
1005 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
1007 tok2str(ethertype_values
,
1008 "Unknown Protocol (0x%04x)",
1009 EXTRACT_BE_U_2(obj_tptr
+ 2))));
1010 ND_PRINT((ndo
, ",%s merge capability",((EXTRACT_U_1(obj_tptr
+ 4)) & 0x80) ? "no" : "" ));
1011 ND_PRINT((ndo
, "%s Minimum VPI/VCI: %u/%u",
1013 (EXTRACT_BE_U_2(obj_tptr
+ 4))&0xfff,
1014 (EXTRACT_BE_U_2(obj_tptr
+ 6)) & 0xfff));
1015 ND_PRINT((ndo
, "%s Maximum VPI/VCI: %u/%u",
1017 (EXTRACT_BE_U_2(obj_tptr
+ 8))&0xfff,
1018 (EXTRACT_BE_U_2(obj_tptr
+ 10)) & 0xfff));
1025 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
1027 tok2str(ethertype_values
,
1028 "Unknown Protocol (0x%04x)",
1029 EXTRACT_BE_U_2(obj_tptr
+ 2))));
1030 ND_PRINT((ndo
, "%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1032 (EXTRACT_BE_U_4(obj_tptr
+ 4))&0x7fffff,
1033 (EXTRACT_BE_U_4(obj_tptr
+ 8))&0x7fffff,
1034 (((EXTRACT_BE_U_2(obj_tptr
+ 4)>>7)&3) == 0 ) ? "10" : "",
1035 (((EXTRACT_BE_U_2(obj_tptr
+ 4) >> 7) & 3) == 2 ) ? "23" : ""));
1042 ND_PRINT((ndo
, "%s LSP Encoding Type: %s (%u)",
1044 tok2str(gmpls_encoding_values
,
1046 EXTRACT_U_1(obj_tptr
)),
1047 EXTRACT_U_1(obj_tptr
)));
1048 ND_PRINT((ndo
, "%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1050 tok2str(gmpls_switch_cap_values
,
1052 EXTRACT_U_1((obj_tptr
+ 1))),
1053 EXTRACT_U_1(obj_tptr
+ 1),
1054 tok2str(gmpls_payload_values
,
1056 EXTRACT_BE_U_2(obj_tptr
+ 2)),
1057 EXTRACT_BE_U_2(obj_tptr
+ 2)));
1068 switch(rsvp_obj_ctype
) {
1069 case RSVP_CTYPE_IPV4
:
1070 while(obj_tlen
>= 4 ) {
1073 ND_TCHECK_4(obj_tptr
);
1074 length
= EXTRACT_U_1(obj_tptr
+ 1);
1075 ND_PRINT((ndo
, "%s Subobject Type: %s, length %u",
1077 tok2str(rsvp_obj_xro_values
,
1079 RSVP_OBJ_XRO_MASK_SUBOBJ(EXTRACT_U_1(obj_tptr
))),
1082 if (length
== 0) { /* prevent infinite loops */
1083 ND_PRINT((ndo
, "%s ERROR: zero length ERO subtype", indent
));
1087 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(EXTRACT_U_1(obj_tptr
))) {
1088 u_char prefix_length
;
1090 case RSVP_OBJ_XRO_IPV4
:
1092 ND_PRINT((ndo
, " ERROR: length != 8"));
1095 ND_TCHECK_8(obj_tptr
);
1096 prefix_length
= EXTRACT_U_1(obj_tptr
+ 6);
1097 if (prefix_length
!= 32) {
1098 ND_PRINT((ndo
, " ERROR: Prefix length %u != 32",
1102 ND_PRINT((ndo
, ", %s, %s/%u, Flags: [%s]",
1103 RSVP_OBJ_XRO_MASK_LOOSE(EXTRACT_U_1(obj_tptr
)) ? "Loose" : "Strict",
1104 ipaddr_string(ndo
, obj_tptr
+2),
1105 EXTRACT_U_1((obj_tptr
+ 6)),
1106 bittok2str(rsvp_obj_rro_flag_values
,
1108 EXTRACT_U_1((obj_tptr
+ 7))))); /* rfc3209 says that this field is rsvd. */
1110 case RSVP_OBJ_XRO_LABEL
:
1112 ND_PRINT((ndo
, " ERROR: length != 8"));
1115 ND_TCHECK_8(obj_tptr
);
1116 ND_PRINT((ndo
, ", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1117 bittok2str(rsvp_obj_rro_label_flag_values
,
1119 EXTRACT_U_1((obj_tptr
+ 2))),
1120 EXTRACT_U_1(obj_tptr
+ 2),
1121 tok2str(rsvp_ctype_values
,
1123 EXTRACT_U_1((obj_tptr
+ 3)) + (256 * RSVP_OBJ_RRO
)),
1124 EXTRACT_U_1((obj_tptr
+ 3)),
1125 EXTRACT_BE_U_4(obj_tptr
+ 4)));
1127 obj_tlen
-=EXTRACT_U_1(obj_tptr
+ 1);
1128 obj_tptr
+=EXTRACT_U_1(obj_tptr
+ 1);
1136 case RSVP_OBJ_HELLO
:
1137 switch(rsvp_obj_ctype
) {
1142 ND_PRINT((ndo
, "%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1144 EXTRACT_BE_U_4(obj_tptr
),
1145 EXTRACT_BE_U_4(obj_tptr
+ 4)));
1154 case RSVP_OBJ_RESTART_CAPABILITY
:
1155 switch(rsvp_obj_ctype
) {
1159 ND_PRINT((ndo
, "%s Restart Time: %ums, Recovery Time: %ums",
1161 EXTRACT_BE_U_4(obj_tptr
),
1162 EXTRACT_BE_U_4(obj_tptr
+ 4)));
1171 case RSVP_OBJ_SESSION_ATTRIBUTE
:
1172 switch(rsvp_obj_ctype
) {
1173 case RSVP_CTYPE_TUNNEL_IPV4
:
1176 namelen
= EXTRACT_U_1(obj_tptr
+ 3);
1177 if (obj_tlen
< 4+namelen
)
1179 ND_PRINT((ndo
, "%s Session Name: ", indent
));
1180 for (i
= 0; i
< namelen
; i
++)
1181 safeputchar(ndo
, EXTRACT_U_1(obj_tptr
+ 4 + i
));
1182 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1184 EXTRACT_U_1(obj_tptr
),
1185 EXTRACT_U_1(obj_tptr
+ 1),
1186 bittok2str(rsvp_session_attribute_flag_values
,
1188 EXTRACT_U_1((obj_tptr
+ 2))),
1189 EXTRACT_U_1(obj_tptr
+ 2)));
1190 obj_tlen
-=4+EXTRACT_U_1((obj_tptr
+ 3));
1191 obj_tptr
+=4+EXTRACT_U_1((obj_tptr
+ 3));
1198 case RSVP_OBJ_GENERALIZED_UNI
:
1199 switch(rsvp_obj_ctype
) {
1200 int subobj_type
,af
,subobj_len
,total_subobj_len
;
1207 /* read variable length subobjects */
1208 total_subobj_len
= obj_tlen
;
1209 while(total_subobj_len
> 0) {
1210 /* If RFC 3476 Section 3.1 defined that a sub-object of the
1211 * GENERALIZED_UNI RSVP object must have the Length field as
1212 * a multiple of 4, instead of the check below it would be
1213 * better to test total_subobj_len only once before the loop.
1214 * So long as it does not define it and this while loop does
1215 * not implement such a requirement, let's accept that within
1216 * each iteration subobj_len may happen to be a multiple of 1
1217 * and test it and total_subobj_len respectively.
1219 if (total_subobj_len
< 4)
1221 subobj_len
= EXTRACT_BE_U_2(obj_tptr
);
1222 subobj_type
= (EXTRACT_BE_U_2(obj_tptr
+ 2))>>8;
1223 af
= (EXTRACT_BE_U_2(obj_tptr
+ 2))&0x00FF;
1225 ND_PRINT((ndo
, "%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1227 tok2str(rsvp_obj_generalized_uni_values
, "Unknown", subobj_type
),
1229 tok2str(af_values
, "Unknown", af
), af
,
1232 /* In addition to what is explained above, the same spec does not
1233 * explicitly say that the same Length field includes the 4-octet
1234 * sub-object header, but as long as this while loop implements it
1235 * as it does include, let's keep the check below consistent with
1236 * the rest of the code.
1238 if(subobj_len
< 4 || subobj_len
> total_subobj_len
)
1241 switch(subobj_type
) {
1242 case RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
:
1243 case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
:
1249 ND_PRINT((ndo
, "%s UNI IPv4 TNA address: %s",
1250 indent
, ipaddr_string(ndo
, obj_tptr
+ 4)));
1253 if (subobj_len
< 20)
1255 ND_PRINT((ndo
, "%s UNI IPv6 TNA address: %s",
1256 indent
, ip6addr_string(ndo
, obj_tptr
+ 4)));
1260 /* unless we have a TLV parser lets just hexdump */
1267 case RSVP_GEN_UNI_SUBOBJ_DIVERSITY
:
1269 /* unless we have a TLV parser lets just hexdump */
1274 case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
:
1275 if (subobj_len
< 16) {
1279 ND_PRINT((ndo
, "%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
1281 ((EXTRACT_BE_U_4(obj_tptr
+ 4))>>31),
1282 ((EXTRACT_BE_U_4(obj_tptr
+ 4))&0xFF),
1283 EXTRACT_BE_U_4(obj_tptr
+ 8),
1284 EXTRACT_BE_U_4(obj_tptr
+ 12)));
1287 case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
:
1288 if (subobj_len
< 8) {
1292 ND_PRINT((ndo
, "%s Service level: %u",
1293 indent
, (EXTRACT_BE_U_4(obj_tptr
+ 4)) >> 24));
1300 total_subobj_len
-=subobj_len
;
1301 obj_tptr
+=subobj_len
;
1302 obj_tlen
+=subobj_len
;
1305 if (total_subobj_len
) {
1306 /* unless we have a TLV parser lets just hexdump */
1316 case RSVP_OBJ_RSVP_HOP
:
1317 switch(rsvp_obj_ctype
) {
1318 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1319 case RSVP_CTYPE_IPV4
:
1322 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1324 ipaddr_string(ndo
, obj_tptr
),
1325 EXTRACT_BE_U_4(obj_tptr
+ 4)));
1329 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1331 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1332 case RSVP_CTYPE_IPV6
:
1335 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1337 ip6addr_string(ndo
, obj_tptr
),
1338 EXTRACT_BE_U_4(obj_tptr
+ 16)));
1341 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1348 case RSVP_OBJ_TIME_VALUES
:
1349 switch(rsvp_obj_ctype
) {
1353 ND_PRINT((ndo
, "%s Refresh Period: %ums",
1355 EXTRACT_BE_U_4(obj_tptr
)));
1364 /* those three objects do share the same semantics */
1365 case RSVP_OBJ_SENDER_TSPEC
:
1366 case RSVP_OBJ_ADSPEC
:
1367 case RSVP_OBJ_FLOWSPEC
:
1368 switch(rsvp_obj_ctype
) {
1372 ND_PRINT((ndo
, "%s Msg-Version: %u, length: %u",
1374 (EXTRACT_U_1(obj_tptr
) & 0xf0) >> 4,
1375 EXTRACT_BE_U_2(obj_tptr
+ 2) << 2));
1376 obj_tptr
+=4; /* get to the start of the service header */
1379 while (obj_tlen
>= 4) {
1380 intserv_serv_tlen
=EXTRACT_BE_U_2(obj_tptr
+ 2)<<2;
1381 ND_PRINT((ndo
, "%s Service Type: %s (%u), break bit %sset, Service length: %u",
1383 tok2str(rsvp_intserv_service_type_values
,"unknown",EXTRACT_U_1((obj_tptr
))),
1384 EXTRACT_U_1(obj_tptr
),
1385 (EXTRACT_U_1(obj_tptr
+ 1)&0x80) ? "" : "not ",
1386 intserv_serv_tlen
));
1388 obj_tptr
+=4; /* get to the start of the parameter list */
1391 while (intserv_serv_tlen
>=4) {
1392 processed
= rsvp_intserv_print(ndo
, obj_tptr
, obj_tlen
);
1395 obj_tlen
-=processed
;
1396 intserv_serv_tlen
-=processed
;
1397 obj_tptr
+=processed
;
1406 case RSVP_OBJ_FILTERSPEC
:
1407 switch(rsvp_obj_ctype
) {
1408 case RSVP_CTYPE_IPV4
:
1411 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1413 ipaddr_string(ndo
, obj_tptr
),
1414 EXTRACT_BE_U_2(obj_tptr
+ 6)));
1418 case RSVP_CTYPE_IPV6
:
1421 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1423 ip6addr_string(ndo
, obj_tptr
),
1424 EXTRACT_BE_U_2(obj_tptr
+ 18)));
1431 ND_PRINT((ndo
, "%s Source Address: %s, Flow Label: %u",
1433 ip6addr_string(ndo
, obj_tptr
),
1434 EXTRACT_BE_U_3(obj_tptr
+ 17)));
1438 case RSVP_CTYPE_TUNNEL_IPV6
:
1441 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1443 ipaddr_string(ndo
, obj_tptr
),
1444 EXTRACT_BE_U_2(obj_tptr
+ 18)));
1448 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
1451 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1452 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1454 ip6addr_string(ndo
, obj_tptr
),
1455 EXTRACT_BE_U_2(obj_tptr
+ 18),
1457 ip6addr_string(ndo
, obj_tptr
+20),
1458 EXTRACT_BE_U_2(obj_tptr
+ 38)));
1462 case RSVP_CTYPE_TUNNEL_IPV4
:
1465 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1467 ipaddr_string(ndo
, obj_tptr
),
1468 EXTRACT_BE_U_2(obj_tptr
+ 6)));
1472 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
1475 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1476 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1478 ipaddr_string(ndo
, obj_tptr
),
1479 EXTRACT_BE_U_2(obj_tptr
+ 6),
1481 ipaddr_string(ndo
, obj_tptr
+8),
1482 EXTRACT_BE_U_2(obj_tptr
+ 12)));
1491 case RSVP_OBJ_FASTREROUTE
:
1492 /* the differences between c-type 1 and 7 are minor */
1493 obj_ptr
.rsvp_obj_frr
= (const struct rsvp_obj_frr_t
*)obj_tptr
;
1495 switch(rsvp_obj_ctype
) {
1496 case RSVP_CTYPE_1
: /* new style */
1497 if (obj_tlen
< sizeof(struct rsvp_obj_frr_t
))
1499 bw
.i
= EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1500 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1502 obj_ptr
.rsvp_obj_frr
->setup_prio
,
1503 obj_ptr
.rsvp_obj_frr
->hold_prio
,
1504 obj_ptr
.rsvp_obj_frr
->hop_limit
,
1505 bw
.f
* 8 / 1000000));
1506 ND_PRINT((ndo
, "%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
1508 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_any
),
1509 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->exclude_any
),
1510 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_all
)));
1511 obj_tlen
-=sizeof(struct rsvp_obj_frr_t
);
1512 obj_tptr
+=sizeof(struct rsvp_obj_frr_t
);
1515 case RSVP_CTYPE_TUNNEL_IPV4
: /* old style */
1518 bw
.i
= EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1519 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1521 obj_ptr
.rsvp_obj_frr
->setup_prio
,
1522 obj_ptr
.rsvp_obj_frr
->hold_prio
,
1523 obj_ptr
.rsvp_obj_frr
->hop_limit
,
1524 bw
.f
* 8 / 1000000));
1525 ND_PRINT((ndo
, "%s Include Colors: 0x%08x, Exclude Colors: 0x%08x",
1527 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_any
),
1528 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->exclude_any
)));
1538 case RSVP_OBJ_DETOUR
:
1539 switch(rsvp_obj_ctype
) {
1540 case RSVP_CTYPE_TUNNEL_IPV4
:
1541 while(obj_tlen
>= 8) {
1542 ND_PRINT((ndo
, "%s PLR-ID: %s, Avoid-Node-ID: %s",
1544 ipaddr_string(ndo
, obj_tptr
),
1545 ipaddr_string(ndo
, obj_tptr
+ 4)));
1555 case RSVP_OBJ_CLASSTYPE
:
1556 case RSVP_OBJ_CLASSTYPE_OLD
: /* fall through */
1557 switch(rsvp_obj_ctype
) {
1559 ND_PRINT((ndo
, "%s CT: %u",
1561 EXTRACT_BE_U_4(obj_tptr
) & 0x7));
1570 case RSVP_OBJ_ERROR_SPEC
:
1571 switch(rsvp_obj_ctype
) {
1572 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1573 case RSVP_CTYPE_IPV4
:
1576 error_code
=EXTRACT_U_1(obj_tptr
+ 5);
1577 error_value
=EXTRACT_BE_U_2(obj_tptr
+ 6);
1578 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1580 ipaddr_string(ndo
, obj_tptr
),
1581 EXTRACT_U_1(obj_tptr
+ 4),
1583 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1585 switch (error_code
) {
1586 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1587 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1588 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1591 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
: /* fall through */
1592 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
:
1593 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1594 tok2str(rsvp_obj_error_code_diffserv_te_values
,"unknown",error_value
),
1598 ND_PRINT((ndo
, ", Unknown Error Value (%u)", error_value
));
1604 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1605 case RSVP_CTYPE_IPV6
:
1608 error_code
=EXTRACT_U_1(obj_tptr
+ 17);
1609 error_value
=EXTRACT_BE_U_2(obj_tptr
+ 18);
1610 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1612 ip6addr_string(ndo
, obj_tptr
),
1613 EXTRACT_U_1(obj_tptr
+ 16),
1615 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1618 switch (error_code
) {
1619 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1620 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1621 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1635 case RSVP_OBJ_PROPERTIES
:
1636 switch(rsvp_obj_ctype
) {
1640 padbytes
= EXTRACT_BE_U_2(obj_tptr
+ 2);
1641 ND_PRINT((ndo
, "%s TLV count: %u, padding bytes: %u",
1643 EXTRACT_BE_U_2(obj_tptr
),
1647 /* loop through as long there is anything longer than the TLV header (2) */
1648 while(obj_tlen
>= 2 + padbytes
) {
1649 ND_PRINT((ndo
, "%s %s TLV (0x%02x), length: %u", /* length includes header */
1651 tok2str(rsvp_obj_prop_tlv_values
,"unknown",EXTRACT_U_1(obj_tptr
)),
1652 EXTRACT_U_1(obj_tptr
),
1653 EXTRACT_U_1(obj_tptr
+ 1)));
1654 if (obj_tlen
< EXTRACT_U_1((obj_tptr
+ 1)))
1656 if (EXTRACT_U_1(obj_tptr
+ 1) < 2)
1658 print_unknown_data(ndo
, obj_tptr
+ 2, "\n\t\t",
1659 EXTRACT_U_1(obj_tptr
+ 1) - 2);
1660 obj_tlen
-=EXTRACT_U_1(obj_tptr
+ 1);
1661 obj_tptr
+=EXTRACT_U_1(obj_tptr
+ 1);
1669 case RSVP_OBJ_MESSAGE_ID
: /* fall through */
1670 case RSVP_OBJ_MESSAGE_ID_ACK
: /* fall through */
1671 case RSVP_OBJ_MESSAGE_ID_LIST
:
1672 switch(rsvp_obj_ctype
) {
1677 ND_PRINT((ndo
, "%s Flags [0x%02x], epoch: %u",
1679 EXTRACT_U_1(obj_tptr
),
1680 EXTRACT_BE_U_3(obj_tptr
+ 1)));
1683 /* loop through as long there are no messages left */
1684 while(obj_tlen
>= 4) {
1685 ND_PRINT((ndo
, "%s Message-ID 0x%08x (%u)",
1687 EXTRACT_BE_U_4(obj_tptr
),
1688 EXTRACT_BE_U_4(obj_tptr
)));
1698 case RSVP_OBJ_INTEGRITY
:
1699 switch(rsvp_obj_ctype
) {
1701 if (obj_tlen
< sizeof(struct rsvp_obj_integrity_t
))
1703 obj_ptr
.rsvp_obj_integrity
= (const struct rsvp_obj_integrity_t
*)obj_tptr
;
1704 ND_PRINT((ndo
, "%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
1706 EXTRACT_BE_U_2(obj_ptr
.rsvp_obj_integrity
->key_id
),
1707 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->key_id
+ 2),
1708 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->sequence
),
1709 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->sequence
+ 4),
1710 bittok2str(rsvp_obj_integrity_flag_values
,
1712 obj_ptr
.rsvp_obj_integrity
->flags
)));
1713 ND_PRINT((ndo
, "%s MD5-sum 0x%08x%08x%08x%08x ",
1715 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
),
1716 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 4),
1717 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 8),
1718 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 12)));
1720 sigcheck
= signature_verify(ndo
, pptr
, plen
,
1721 obj_ptr
.rsvp_obj_integrity
->digest
,
1722 rsvp_clear_checksum
,
1724 ND_PRINT((ndo
, " (%s)", tok2str(signature_check_values
, "Unknown", sigcheck
)));
1726 obj_tlen
+=sizeof(struct rsvp_obj_integrity_t
);
1727 obj_tptr
+=sizeof(struct rsvp_obj_integrity_t
);
1734 case RSVP_OBJ_ADMIN_STATUS
:
1735 switch(rsvp_obj_ctype
) {
1739 ND_PRINT((ndo
, "%s Flags [%s]", indent
,
1740 bittok2str(rsvp_obj_admin_status_flag_values
, "none",
1741 EXTRACT_BE_U_4(obj_tptr
))));
1750 case RSVP_OBJ_LABEL_SET
:
1751 switch(rsvp_obj_ctype
) {
1755 action
= (EXTRACT_BE_U_2(obj_tptr
)>>8);
1757 ND_PRINT((ndo
, "%s Action: %s (%u), Label type: %u", indent
,
1758 tok2str(rsvp_obj_label_set_action_values
, "Unknown", action
),
1759 action
, ((EXTRACT_BE_U_4(obj_tptr
) & 0x7F))));
1762 case LABEL_SET_INCLUSIVE_RANGE
:
1763 case LABEL_SET_EXCLUSIVE_RANGE
: /* fall through */
1765 /* only a couple of subchannels are expected */
1768 ND_PRINT((ndo
, "%s Start range: %u, End range: %u", indent
,
1769 EXTRACT_BE_U_4(obj_tptr
+ 4),
1770 EXTRACT_BE_U_4(obj_tptr
+ 8)));
1779 while(obj_tlen
>= 4 ) {
1780 ND_PRINT((ndo
, "%s Subchannel #%u: %u", indent
, subchannel
,
1781 EXTRACT_BE_U_4(obj_tptr
)));
1795 switch (rsvp_obj_ctype
) {
1796 case RSVP_CTYPE_IPV4
:
1799 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1800 indent
, ipaddr_string(ndo
, obj_tptr
)));
1805 case RSVP_CTYPE_IPV6
:
1808 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1809 indent
, ip6addr_string(ndo
, obj_tptr
)));
1820 * FIXME those are the defined objects that lack a decoder
1821 * you are welcome to contribute code ;-)
1824 case RSVP_OBJ_SCOPE
:
1825 case RSVP_OBJ_POLICY_DATA
:
1826 case RSVP_OBJ_ACCEPT_LABEL_SET
:
1827 case RSVP_OBJ_PROTECTION
:
1829 if (ndo
->ndo_vflag
<= 1)
1830 print_unknown_data(ndo
, obj_tptr
, "\n\t ", obj_tlen
); /* FIXME indentation */
1833 /* do we also want to see a hex dump ? */
1834 if (ndo
->ndo_vflag
> 1 || hexdump
== TRUE
)
1835 print_unknown_data(ndo
, tptr
+ sizeof(struct rsvp_object_header
), "\n\t ", /* FIXME indentation */
1836 rsvp_obj_len
- sizeof(struct rsvp_object_header
));
1843 ND_PRINT((ndo
, "%s", istr
));
1846 ND_PRINT((ndo
, "\n\t\t"));
1847 ND_PRINT((ndo
, "%s", tstr
));
1852 rsvp_print(netdissect_options
*ndo
,
1853 const u_char
*pptr
, u_int len
)
1855 const struct rsvp_common_header
*rsvp_com_header
;
1861 rsvp_com_header
= (const struct rsvp_common_header
*)pptr
;
1862 ND_TCHECK(*rsvp_com_header
);
1865 * Sanity checking of the header.
1867 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1868 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1869 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1873 /* in non-verbose mode just lets print the basic Message Type*/
1874 if (ndo
->ndo_vflag
< 1) {
1875 ND_PRINT((ndo
, "RSVPv%u %s Message, length: %u",
1876 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1877 tok2str(rsvp_msg_type_values
, "unknown (%u)",rsvp_com_header
->msg_type
),
1882 /* ok they seem to want to know everything - lets fully decode it */
1884 plen
= tlen
= EXTRACT_BE_U_2(rsvp_com_header
->length
);
1886 ND_PRINT((ndo
, "\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1887 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1888 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1889 rsvp_com_header
->msg_type
,
1890 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1892 rsvp_com_header
->ttl
,
1893 EXTRACT_BE_U_2(rsvp_com_header
->checksum
)));
1895 if (tlen
< sizeof(struct rsvp_common_header
)) {
1896 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", tlen
,
1897 (unsigned long)sizeof(struct rsvp_common_header
)));
1901 tptr
+=sizeof(struct rsvp_common_header
);
1902 tlen
-=sizeof(struct rsvp_common_header
);
1904 switch(rsvp_com_header
->msg_type
) {
1906 case RSVP_MSGTYPE_BUNDLE
:
1908 * Process each submessage in the bundle message.
1909 * Bundle messages may not contain bundle submessages, so we don't
1910 * need to handle bundle submessages specially.
1913 const u_char
*subpptr
=tptr
, *subtptr
;
1914 u_short subplen
, subtlen
;
1918 rsvp_com_header
= (const struct rsvp_common_header
*)subpptr
;
1919 ND_TCHECK(*rsvp_com_header
);
1922 * Sanity checking of the header.
1924 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1925 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1926 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1930 subplen
= subtlen
= EXTRACT_BE_U_2(rsvp_com_header
->length
);
1932 ND_PRINT((ndo
, "\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1933 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1934 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1935 rsvp_com_header
->msg_type
,
1936 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1938 rsvp_com_header
->ttl
,
1939 EXTRACT_BE_U_2(rsvp_com_header
->checksum
)));
1941 if (subtlen
< sizeof(struct rsvp_common_header
)) {
1942 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", subtlen
,
1943 (unsigned long)sizeof(struct rsvp_common_header
)));
1947 if (tlen
< subtlen
) {
1948 ND_PRINT((ndo
, "ERROR: common header too large %u > %u", subtlen
,
1953 subtptr
+=sizeof(struct rsvp_common_header
);
1954 subtlen
-=sizeof(struct rsvp_common_header
);
1957 * Print all objects in the submessage.
1959 if (rsvp_obj_print(ndo
, subpptr
, subplen
, subtptr
, "\n\t ", subtlen
, rsvp_com_header
) == -1)
1962 tptr
+=subtlen
+sizeof(struct rsvp_common_header
);
1963 tlen
-=subtlen
+sizeof(struct rsvp_common_header
);
1968 case RSVP_MSGTYPE_PATH
:
1969 case RSVP_MSGTYPE_RESV
:
1970 case RSVP_MSGTYPE_PATHERR
:
1971 case RSVP_MSGTYPE_RESVERR
:
1972 case RSVP_MSGTYPE_PATHTEAR
:
1973 case RSVP_MSGTYPE_RESVTEAR
:
1974 case RSVP_MSGTYPE_RESVCONF
:
1975 case RSVP_MSGTYPE_HELLO_OLD
:
1976 case RSVP_MSGTYPE_HELLO
:
1977 case RSVP_MSGTYPE_ACK
:
1978 case RSVP_MSGTYPE_SREFRESH
:
1980 * Print all objects in the message.
1982 if (rsvp_obj_print(ndo
, pptr
, plen
, tptr
, "\n\t ", tlen
, rsvp_com_header
) == -1)
1987 print_unknown_data(ndo
, tptr
, "\n\t ", tlen
);
1993 ND_PRINT((ndo
, "\n\t\t"));
1994 ND_PRINT((ndo
, "%s", tstr
));