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"
38 * RFC 2205 common header
41 * +-------------+-------------+-------------+-------------+
42 * | Vers | Flags| Msg Type | RSVP Checksum |
43 * +-------------+-------------+-------------+-------------+
44 * | Send_TTL | (Reserved) | RSVP Length |
45 * +-------------+-------------+-------------+-------------+
49 struct rsvp_common_header
{
50 nd_uint8_t version_flags
;
59 * RFC2205 object header
63 * +-------------+-------------+-------------+-------------+
64 * | Length (bytes) | Class-Num | C-Type |
65 * +-------------+-------------+-------------+-------------+
67 * // (Object contents) //
69 * +-------------+-------------+-------------+-------------+
72 struct rsvp_object_header
{
78 #define RSVP_VERSION 1
79 #define RSVP_EXTRACT_VERSION(x) (((x)&0xf0)>>4)
80 #define RSVP_EXTRACT_FLAGS(x) ((x)&0x0f)
82 #define RSVP_MSGTYPE_PATH 1
83 #define RSVP_MSGTYPE_RESV 2
84 #define RSVP_MSGTYPE_PATHERR 3
85 #define RSVP_MSGTYPE_RESVERR 4
86 #define RSVP_MSGTYPE_PATHTEAR 5
87 #define RSVP_MSGTYPE_RESVTEAR 6
88 #define RSVP_MSGTYPE_RESVCONF 7
89 #define RSVP_MSGTYPE_BUNDLE 12
90 #define RSVP_MSGTYPE_ACK 13
91 #define RSVP_MSGTYPE_HELLO_OLD 14 /* ancient Hellos */
92 #define RSVP_MSGTYPE_SREFRESH 15
93 #define RSVP_MSGTYPE_HELLO 20
95 static const struct tok rsvp_msg_type_values
[] = {
96 { RSVP_MSGTYPE_PATH
, "Path" },
97 { RSVP_MSGTYPE_RESV
, "Resv" },
98 { RSVP_MSGTYPE_PATHERR
, "PathErr" },
99 { RSVP_MSGTYPE_RESVERR
, "ResvErr" },
100 { RSVP_MSGTYPE_PATHTEAR
, "PathTear" },
101 { RSVP_MSGTYPE_RESVTEAR
, "ResvTear" },
102 { RSVP_MSGTYPE_RESVCONF
, "ResvConf" },
103 { RSVP_MSGTYPE_BUNDLE
, "Bundle" },
104 { RSVP_MSGTYPE_ACK
, "Acknowledgement" },
105 { RSVP_MSGTYPE_HELLO_OLD
, "Hello (Old)" },
106 { RSVP_MSGTYPE_SREFRESH
, "Refresh" },
107 { RSVP_MSGTYPE_HELLO
, "Hello" },
111 static const struct tok rsvp_header_flag_values
[] = {
112 { 0x01, "Refresh reduction capable" }, /* rfc2961 */
116 #define RSVP_OBJ_SESSION 1 /* rfc2205 */
117 #define RSVP_OBJ_RSVP_HOP 3 /* rfc2205, rfc3473 */
118 #define RSVP_OBJ_INTEGRITY 4 /* rfc2747 */
119 #define RSVP_OBJ_TIME_VALUES 5 /* rfc2205 */
120 #define RSVP_OBJ_ERROR_SPEC 6
121 #define RSVP_OBJ_SCOPE 7
122 #define RSVP_OBJ_STYLE 8 /* rfc2205 */
123 #define RSVP_OBJ_FLOWSPEC 9 /* rfc2215 */
124 #define RSVP_OBJ_FILTERSPEC 10 /* rfc2215 */
125 #define RSVP_OBJ_SENDER_TEMPLATE 11
126 #define RSVP_OBJ_SENDER_TSPEC 12 /* rfc2215 */
127 #define RSVP_OBJ_ADSPEC 13 /* rfc2215 */
128 #define RSVP_OBJ_POLICY_DATA 14
129 #define RSVP_OBJ_CONFIRM 15 /* rfc2205 */
130 #define RSVP_OBJ_LABEL 16 /* rfc3209 */
131 #define RSVP_OBJ_LABEL_REQ 19 /* rfc3209 */
132 #define RSVP_OBJ_ERO 20 /* rfc3209 */
133 #define RSVP_OBJ_RRO 21 /* rfc3209 */
134 #define RSVP_OBJ_HELLO 22 /* rfc3209 */
135 #define RSVP_OBJ_MESSAGE_ID 23 /* rfc2961 */
136 #define RSVP_OBJ_MESSAGE_ID_ACK 24 /* rfc2961 */
137 #define RSVP_OBJ_MESSAGE_ID_LIST 25 /* rfc2961 */
138 #define RSVP_OBJ_RECOVERY_LABEL 34 /* rfc3473 */
139 #define RSVP_OBJ_UPSTREAM_LABEL 35 /* rfc3473 */
140 #define RSVP_OBJ_LABEL_SET 36 /* rfc3473 */
141 #define RSVP_OBJ_PROTECTION 37 /* rfc3473 */
142 #define RSVP_OBJ_S2L 50 /* rfc4875 */
143 #define RSVP_OBJ_DETOUR 63 /* rfc4090 */
144 #define RSVP_OBJ_CLASSTYPE 66 /* rfc4124 */
145 #define RSVP_OBJ_CLASSTYPE_OLD 125 /* draft-ietf-tewg-diff-te-proto-07 */
146 #define RSVP_OBJ_SUGGESTED_LABEL 129 /* rfc3473 */
147 #define RSVP_OBJ_ACCEPT_LABEL_SET 130 /* rfc3473 */
148 #define RSVP_OBJ_RESTART_CAPABILITY 131 /* rfc3473 */
149 #define RSVP_OBJ_NOTIFY_REQ 195 /* rfc3473 */
150 #define RSVP_OBJ_ADMIN_STATUS 196 /* rfc3473 */
151 #define RSVP_OBJ_PROPERTIES 204 /* juniper proprietary */
152 #define RSVP_OBJ_FASTREROUTE 205 /* rfc4090 */
153 #define RSVP_OBJ_SESSION_ATTRIBUTE 207 /* rfc3209 */
154 #define RSVP_OBJ_GENERALIZED_UNI 229 /* OIF RSVP extensions UNI 1.0 Signaling, Rel. 2 */
155 #define RSVP_OBJ_CALL_ID 230 /* rfc3474 */
156 #define RSVP_OBJ_CALL_OPS 236 /* rfc3474 */
158 static const struct tok rsvp_obj_values
[] = {
159 { RSVP_OBJ_SESSION
, "Session" },
160 { RSVP_OBJ_RSVP_HOP
, "RSVP Hop" },
161 { RSVP_OBJ_INTEGRITY
, "Integrity" },
162 { RSVP_OBJ_TIME_VALUES
, "Time Values" },
163 { RSVP_OBJ_ERROR_SPEC
, "Error Spec" },
164 { RSVP_OBJ_SCOPE
, "Scope" },
165 { RSVP_OBJ_STYLE
, "Style" },
166 { RSVP_OBJ_FLOWSPEC
, "Flowspec" },
167 { RSVP_OBJ_FILTERSPEC
, "FilterSpec" },
168 { RSVP_OBJ_SENDER_TEMPLATE
, "Sender Template" },
169 { RSVP_OBJ_SENDER_TSPEC
, "Sender TSpec" },
170 { RSVP_OBJ_ADSPEC
, "Adspec" },
171 { RSVP_OBJ_POLICY_DATA
, "Policy Data" },
172 { RSVP_OBJ_CONFIRM
, "Confirm" },
173 { RSVP_OBJ_LABEL
, "Label" },
174 { RSVP_OBJ_LABEL_REQ
, "Label Request" },
175 { RSVP_OBJ_ERO
, "ERO" },
176 { RSVP_OBJ_RRO
, "RRO" },
177 { RSVP_OBJ_HELLO
, "Hello" },
178 { RSVP_OBJ_MESSAGE_ID
, "Message ID" },
179 { RSVP_OBJ_MESSAGE_ID_ACK
, "Message ID Ack" },
180 { RSVP_OBJ_MESSAGE_ID_LIST
, "Message ID List" },
181 { RSVP_OBJ_RECOVERY_LABEL
, "Recovery Label" },
182 { RSVP_OBJ_UPSTREAM_LABEL
, "Upstream Label" },
183 { RSVP_OBJ_LABEL_SET
, "Label Set" },
184 { RSVP_OBJ_ACCEPT_LABEL_SET
, "Acceptable Label Set" },
185 { RSVP_OBJ_DETOUR
, "Detour" },
186 { RSVP_OBJ_CLASSTYPE
, "Class Type" },
187 { RSVP_OBJ_CLASSTYPE_OLD
, "Class Type (old)" },
188 { RSVP_OBJ_SUGGESTED_LABEL
, "Suggested Label" },
189 { RSVP_OBJ_PROPERTIES
, "Properties" },
190 { RSVP_OBJ_FASTREROUTE
, "Fast Re-Route" },
191 { RSVP_OBJ_SESSION_ATTRIBUTE
, "Session Attribute" },
192 { RSVP_OBJ_GENERALIZED_UNI
, "Generalized UNI" },
193 { RSVP_OBJ_CALL_ID
, "Call-ID" },
194 { RSVP_OBJ_CALL_OPS
, "Call Capability" },
195 { RSVP_OBJ_RESTART_CAPABILITY
, "Restart Capability" },
196 { RSVP_OBJ_NOTIFY_REQ
, "Notify Request" },
197 { RSVP_OBJ_PROTECTION
, "Protection" },
198 { RSVP_OBJ_ADMIN_STATUS
, "Administrative Status" },
199 { RSVP_OBJ_S2L
, "Sub-LSP to LSP" },
203 #define RSVP_CTYPE_IPV4 1
204 #define RSVP_CTYPE_IPV6 2
205 #define RSVP_CTYPE_TUNNEL_IPV4 7
206 #define RSVP_CTYPE_TUNNEL_IPV6 8
207 #define RSVP_CTYPE_UNI_IPV4 11 /* OIF RSVP extensions UNI 1.0 Signaling Rel. 2 */
208 #define RSVP_CTYPE_1 1
209 #define RSVP_CTYPE_2 2
210 #define RSVP_CTYPE_3 3
211 #define RSVP_CTYPE_4 4
212 #define RSVP_CTYPE_12 12
213 #define RSVP_CTYPE_13 13
214 #define RSVP_CTYPE_14 14
217 * the ctypes are not globally unique so for
218 * translating it to strings we build a table based
219 * on objects offsetted by the ctype
222 static const struct tok rsvp_ctype_values
[] = {
223 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV4
, "IPv4" },
224 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV6
, "IPv6" },
225 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
226 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
227 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV4
, "IPv4" },
228 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV6
, "IPv6" },
229 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV4
, "IPv4" },
230 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV6
, "IPv6" },
231 { 256*RSVP_OBJ_TIME_VALUES
+RSVP_CTYPE_1
, "1" },
232 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_1
, "obsolete" },
233 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_2
, "IntServ" },
234 { 256*RSVP_OBJ_SENDER_TSPEC
+RSVP_CTYPE_2
, "IntServ" },
235 { 256*RSVP_OBJ_ADSPEC
+RSVP_CTYPE_2
, "IntServ" },
236 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
237 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
238 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_3
, "IPv6 Flow-label" },
239 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
240 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
241 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
242 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV4
, "IPv4" },
243 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV6
, "IPv6" },
244 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
245 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_UNI_IPV4
, "UNI IPv4" },
246 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_13
, "IPv4 P2MP LSP Tunnel" },
247 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_14
, "IPv6 P2MP LSP Tunnel" },
248 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV4
, "IPv4" },
249 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV6
, "IPv6" },
250 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
251 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
252 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
253 { 256*RSVP_OBJ_MESSAGE_ID
+RSVP_CTYPE_1
, "1" },
254 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_1
, "Message id ack" },
255 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_2
, "Message id nack" },
256 { 256*RSVP_OBJ_MESSAGE_ID_LIST
+RSVP_CTYPE_1
, "1" },
257 { 256*RSVP_OBJ_STYLE
+RSVP_CTYPE_1
, "1" },
258 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_1
, "Hello Request" },
259 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_2
, "Hello Ack" },
260 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_1
, "without label range" },
261 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_2
, "with ATM label range" },
262 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_3
, "with FR label range" },
263 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_4
, "Generalized Label" },
264 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_1
, "Label" },
265 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
266 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
267 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_1
, "Label" },
268 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
269 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
270 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_1
, "Label" },
271 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
272 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
273 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_1
, "Label" },
274 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
275 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
276 { 256*RSVP_OBJ_ERO
+RSVP_CTYPE_IPV4
, "IPv4" },
277 { 256*RSVP_OBJ_RRO
+RSVP_CTYPE_IPV4
, "IPv4" },
278 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
279 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
280 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
281 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
282 { 256*RSVP_OBJ_RESTART_CAPABILITY
+RSVP_CTYPE_1
, "IPv4" },
283 { 256*RSVP_OBJ_SESSION_ATTRIBUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
284 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" }, /* old style*/
285 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_1
, "1" }, /* new style */
286 { 256*RSVP_OBJ_DETOUR
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
287 { 256*RSVP_OBJ_PROPERTIES
+RSVP_CTYPE_1
, "1" },
288 { 256*RSVP_OBJ_ADMIN_STATUS
+RSVP_CTYPE_1
, "1" },
289 { 256*RSVP_OBJ_CLASSTYPE
+RSVP_CTYPE_1
, "1" },
290 { 256*RSVP_OBJ_CLASSTYPE_OLD
+RSVP_CTYPE_1
, "1" },
291 { 256*RSVP_OBJ_LABEL_SET
+RSVP_CTYPE_1
, "1" },
292 { 256*RSVP_OBJ_GENERALIZED_UNI
+RSVP_CTYPE_1
, "1" },
293 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV4
, "IPv4 sub-LSP" },
294 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV6
, "IPv6 sub-LSP" },
298 struct rsvp_obj_integrity_t
{
306 static const struct tok rsvp_obj_integrity_flag_values
[] = {
307 { 0x80, "Handshake" },
311 struct rsvp_obj_frr_t
{
316 uint8_t bandwidth
[4];
317 uint8_t include_any
[4];
318 uint8_t exclude_any
[4];
319 uint8_t include_all
[4];
323 #define RSVP_OBJ_XRO_MASK_SUBOBJ(x) ((x)&0x7f)
324 #define RSVP_OBJ_XRO_MASK_LOOSE(x) ((x)&0x80)
326 #define RSVP_OBJ_XRO_RES 0
327 #define RSVP_OBJ_XRO_IPV4 1
328 #define RSVP_OBJ_XRO_IPV6 2
329 #define RSVP_OBJ_XRO_LABEL 3
330 #define RSVP_OBJ_XRO_ASN 32
331 #define RSVP_OBJ_XRO_MPLS 64
333 static const struct tok rsvp_obj_xro_values
[] = {
334 { RSVP_OBJ_XRO_RES
, "Reserved" },
335 { RSVP_OBJ_XRO_IPV4
, "IPv4 prefix" },
336 { RSVP_OBJ_XRO_IPV6
, "IPv6 prefix" },
337 { RSVP_OBJ_XRO_LABEL
, "Label" },
338 { RSVP_OBJ_XRO_ASN
, "Autonomous system number" },
339 { RSVP_OBJ_XRO_MPLS
, "MPLS label switched path termination" },
344 static const struct tok rsvp_obj_rro_flag_values
[] = {
345 { 0x01, "Local protection available" },
346 { 0x02, "Local protection in use" },
347 { 0x04, "Bandwidth protection" },
348 { 0x08, "Node protection" },
353 static const struct tok rsvp_obj_rro_label_flag_values
[] = {
358 static const struct tok rsvp_resstyle_values
[] = {
359 { 17, "Wildcard Filter" },
360 { 10, "Fixed Filter" },
361 { 18, "Shared Explicit" },
365 #define RSVP_OBJ_INTSERV_GUARANTEED_SERV 2
366 #define RSVP_OBJ_INTSERV_CONTROLLED_LOAD 5
368 static const struct tok rsvp_intserv_service_type_values
[] = {
369 { 1, "Default/Global Information" },
370 { RSVP_OBJ_INTSERV_GUARANTEED_SERV
, "Guaranteed Service" },
371 { RSVP_OBJ_INTSERV_CONTROLLED_LOAD
, "Controlled Load" },
375 static const struct tok rsvp_intserv_parameter_id_values
[] = {
377 { 6, "Path b/w estimate" },
378 { 8, "Minimum path latency" },
379 { 10, "Composed MTU" },
380 { 127, "Token Bucket TSpec" },
381 { 130, "Guaranteed Service RSpec" },
382 { 133, "End-to-end composed value for C" },
383 { 134, "End-to-end composed value for D" },
384 { 135, "Since-last-reshaping point composed C" },
385 { 136, "Since-last-reshaping point composed D" },
389 static const struct tok rsvp_session_attribute_flag_values
[] = {
390 { 0x01, "Local Protection" },
391 { 0x02, "Label Recording" },
392 { 0x04, "SE Style" },
393 { 0x08, "Bandwidth protection" }, /* RFC4090 */
394 { 0x10, "Node protection" }, /* RFC4090 */
398 static const struct tok rsvp_obj_prop_tlv_values
[] = {
400 { 0x02, "Metric 1" },
401 { 0x04, "Metric 2" },
402 { 0x08, "CCC Status" },
403 { 0x10, "Path Type" },
407 #define RSVP_OBJ_ERROR_SPEC_CODE_ROUTING 24
408 #define RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY 25
409 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE 28
410 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD 125
412 static const struct tok rsvp_obj_error_code_values
[] = {
413 { RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
, "Routing Problem" },
414 { RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY
, "Notify Error" },
415 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
, "Diffserv TE Error" },
416 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
, "Diffserv TE Error (Old)" },
420 static const struct tok rsvp_obj_error_code_routing_values
[] = {
421 { 1, "Bad EXPLICIT_ROUTE object" },
422 { 2, "Bad strict node" },
423 { 3, "Bad loose node" },
424 { 4, "Bad initial subobject" },
425 { 5, "No route available toward destination" },
426 { 6, "Unacceptable label value" },
427 { 7, "RRO indicated routing loops" },
428 { 8, "non-RSVP-capable router in the path" },
429 { 9, "MPLS label allocation failure" },
430 { 10, "Unsupported L3PID" },
434 static const struct tok rsvp_obj_error_code_diffserv_te_values
[] = {
435 { 1, "Unexpected CT object" },
436 { 2, "Unsupported CT" },
437 { 3, "Invalid CT value" },
438 { 4, "CT/setup priority do not form a configured TE-Class" },
439 { 5, "CT/holding priority do not form a configured TE-Class" },
440 { 6, "CT/setup priority and CT/holding priority do not form a configured TE-Class" },
441 { 7, "Inconsistency between signaled PSC and signaled CT" },
442 { 8, "Inconsistency between signaled PHBs and signaled CT" },
446 /* rfc3473 / rfc 3471 */
447 static const struct tok rsvp_obj_admin_status_flag_values
[] = {
448 { 0x80000000, "Reflect" },
449 { 0x00000004, "Testing" },
450 { 0x00000002, "Admin-down" },
451 { 0x00000001, "Delete-in-progress" },
455 /* label set actions - rfc3471 */
456 #define LABEL_SET_INCLUSIVE_LIST 0
457 #define LABEL_SET_EXCLUSIVE_LIST 1
458 #define LABEL_SET_INCLUSIVE_RANGE 2
459 #define LABEL_SET_EXCLUSIVE_RANGE 3
461 static const struct tok rsvp_obj_label_set_action_values
[] = {
462 { LABEL_SET_INCLUSIVE_LIST
, "Inclusive list" },
463 { LABEL_SET_EXCLUSIVE_LIST
, "Exclusive list" },
464 { LABEL_SET_INCLUSIVE_RANGE
, "Inclusive range" },
465 { LABEL_SET_EXCLUSIVE_RANGE
, "Exclusive range" },
469 /* OIF RSVP extensions UNI 1.0 Signaling, release 2 */
470 #define RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS 1
471 #define RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS 2
472 #define RSVP_GEN_UNI_SUBOBJ_DIVERSITY 3
473 #define RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL 4
474 #define RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL 5
476 static const struct tok rsvp_obj_generalized_uni_values
[] = {
477 { RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
, "Source TNA address" },
478 { RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
, "Destination TNA address" },
479 { RSVP_GEN_UNI_SUBOBJ_DIVERSITY
, "Diversity" },
480 { RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
, "Egress label" },
481 { RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
, "Service level" },
486 * this is a dissector for all the intserv defined
487 * specs as defined per rfc2215
488 * it is called from various rsvp objects;
489 * returns the amount of bytes being processed
492 rsvp_intserv_print(netdissect_options
*ndo
,
493 const u_char
*tptr
, u_short obj_tlen
)
495 u_int parameter_id
,parameter_length
;
504 parameter_id
= EXTRACT_U_1(tptr
);
505 ND_TCHECK_2(tptr
+ 2);
506 parameter_length
= EXTRACT_BE_U_2(tptr
+ 2)<<2; /* convert wordcount to bytecount */
508 ND_PRINT("\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
509 tok2str(rsvp_intserv_parameter_id_values
,"unknown",parameter_id
),
512 EXTRACT_U_1(tptr
+ 1));
514 if (obj_tlen
< parameter_length
+4)
516 switch(parameter_id
) { /* parameter_id */
520 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
521 * | 4 (e) | (f) | 1 (g) |
522 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
523 * | IS hop cnt (32-bit unsigned integer) |
524 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
526 if (parameter_length
== 4) {
527 ND_TCHECK_4(tptr
+ 4);
528 ND_PRINT("\n\t\tIS hop count: %u", EXTRACT_BE_U_4(tptr
+ 4));
534 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
535 * | 6 (h) | (i) | 1 (j) |
536 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
537 * | Path b/w estimate (32-bit IEEE floating point number) |
538 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
540 if (parameter_length
== 4) {
541 ND_TCHECK_4(tptr
+ 4);
542 bw
.i
= EXTRACT_BE_U_4(tptr
+ 4);
543 ND_PRINT("\n\t\tPath b/w estimate: %.10g Mbps", bw
.f
/ 125000);
549 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
550 * | 8 (k) | (l) | 1 (m) |
551 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
552 * | Minimum path latency (32-bit integer) |
553 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
555 if (parameter_length
== 4) {
556 ND_TCHECK_4(tptr
+ 4);
557 ND_PRINT("\n\t\tMinimum path latency: ");
558 if (EXTRACT_BE_U_4(tptr
+ 4) == 0xffffffff)
559 ND_PRINT("don't care");
561 ND_PRINT("%u", EXTRACT_BE_U_4(tptr
+ 4));
568 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
569 * | 10 (n) | (o) | 1 (p) |
570 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
571 * | Composed MTU (32-bit unsigned integer) |
572 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
574 if (parameter_length
== 4) {
575 ND_TCHECK_4(tptr
+ 4);
576 ND_PRINT("\n\t\tComposed MTU: %u bytes", EXTRACT_BE_U_4(tptr
+ 4));
581 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
582 * | 127 (e) | 0 (f) | 5 (g) |
583 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
584 * | Token Bucket Rate [r] (32-bit IEEE floating point number) |
585 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
586 * | Token Bucket Size [b] (32-bit IEEE floating point number) |
587 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
588 * | Peak Data Rate [p] (32-bit IEEE floating point number) |
589 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
590 * | Minimum Policed Unit [m] (32-bit integer) |
591 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
592 * | Maximum Packet Size [M] (32-bit integer) |
593 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
596 if (parameter_length
== 20) {
597 ND_TCHECK_LEN(tptr
+ 4, 20);
598 bw
.i
= EXTRACT_BE_U_4(tptr
+ 4);
599 ND_PRINT("\n\t\tToken Bucket Rate: %.10g Mbps", bw
.f
/ 125000);
600 bw
.i
= EXTRACT_BE_U_4(tptr
+ 8);
601 ND_PRINT("\n\t\tToken Bucket Size: %.10g bytes", bw
.f
);
602 bw
.i
= EXTRACT_BE_U_4(tptr
+ 12);
603 ND_PRINT("\n\t\tPeak Data Rate: %.10g Mbps", bw
.f
/ 125000);
604 ND_PRINT("\n\t\tMinimum Policed Unit: %u bytes", EXTRACT_BE_U_4(tptr
+ 16));
605 ND_PRINT("\n\t\tMaximum Packet Size: %u bytes", EXTRACT_BE_U_4(tptr
+ 20));
611 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
612 * | 130 (h) | 0 (i) | 2 (j) |
613 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
614 * | Rate [R] (32-bit IEEE floating point number) |
615 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
616 * | Slack Term [S] (32-bit integer) |
617 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
620 if (parameter_length
== 8) {
621 ND_TCHECK_8(tptr
+ 4);
622 bw
.i
= EXTRACT_BE_U_4(tptr
+ 4);
623 ND_PRINT("\n\t\tRate: %.10g Mbps", bw
.f
/ 125000);
624 ND_PRINT("\n\t\tSlack Term: %u", EXTRACT_BE_U_4(tptr
+ 8));
632 if (parameter_length
== 4) {
633 ND_TCHECK_4(tptr
+ 4);
634 ND_PRINT("\n\t\tValue: %u", EXTRACT_BE_U_4(tptr
+ 4));
639 if (ndo
->ndo_vflag
<= 1)
640 print_unknown_data(ndo
, tptr
+ 4, "\n\t\t", parameter_length
);
642 return (parameter_length
+4); /* header length 4 bytes */
650 * Clear checksum prior to signature verification.
653 rsvp_clear_checksum(void *header
)
655 struct rsvp_common_header
*rsvp_com_header
= (struct rsvp_common_header
*) header
;
657 rsvp_com_header
->checksum
[0] = 0;
658 rsvp_com_header
->checksum
[1] = 0;
662 rsvp_obj_print(netdissect_options
*ndo
,
663 const u_char
*pptr
, u_int plen
, const u_char
*tptr
,
664 const char *indent
, u_int tlen
,
665 const struct rsvp_common_header
*rsvp_com_header
)
667 const struct rsvp_object_header
*rsvp_obj_header
;
668 const u_char
*obj_tptr
;
670 const struct rsvp_obj_integrity_t
*rsvp_obj_integrity
;
671 const struct rsvp_obj_frr_t
*rsvp_obj_frr
;
674 u_short rsvp_obj_len
,rsvp_obj_ctype
,rsvp_obj_class_num
,obj_tlen
;
675 u_int intserv_serv_tlen
;
677 u_int processed
,padbytes
,error_code
,error_value
,i
,sigcheck
;
684 u_int action
, subchannel
;
686 while(tlen
>=sizeof(struct rsvp_object_header
)) {
687 /* did we capture enough for fully decoding the object header ? */
688 ND_TCHECK_LEN(tptr
, sizeof(struct rsvp_object_header
));
690 rsvp_obj_header
= (const struct rsvp_object_header
*)tptr
;
691 rsvp_obj_len
=EXTRACT_BE_U_2(rsvp_obj_header
->length
);
692 rsvp_obj_ctype
=EXTRACT_U_1(rsvp_obj_header
->ctype
);
694 if(rsvp_obj_len
% 4) {
695 ND_PRINT("%sERROR: object header size %u not a multiple of 4", indent
, rsvp_obj_len
);
698 if(rsvp_obj_len
< sizeof(struct rsvp_object_header
)) {
699 ND_PRINT("%sERROR: object header too short %u < %lu", indent
, rsvp_obj_len
,
700 (unsigned long)sizeof(struct rsvp_object_header
));
704 rsvp_obj_class_num
= EXTRACT_U_1(rsvp_obj_header
->class_num
);
705 ND_PRINT("%s%s Object (%u) Flags: [%s",
707 tok2str(rsvp_obj_values
,
711 (rsvp_obj_class_num
& 0x80) ?
712 ((rsvp_obj_class_num
& 0x40) ? "ignore and forward" :
716 ND_PRINT(" if unknown], Class-Type: %s (%u), length: %u",
717 tok2str(rsvp_ctype_values
,
719 (rsvp_obj_class_num
<<8)+rsvp_obj_ctype
),
723 if(tlen
< rsvp_obj_len
) {
724 ND_PRINT("%sERROR: object goes past end of objects TLV", indent
);
728 obj_tptr
=tptr
+sizeof(struct rsvp_object_header
);
729 obj_tlen
=rsvp_obj_len
-sizeof(struct rsvp_object_header
);
731 /* did we capture enough for fully decoding the object ? */
732 if (!ND_TTEST_LEN(tptr
, rsvp_obj_len
))
736 switch(rsvp_obj_class_num
) {
737 case RSVP_OBJ_SESSION
:
738 switch(rsvp_obj_ctype
) {
739 case RSVP_CTYPE_IPV4
:
742 ND_PRINT("%s IPv4 DestAddress: %s, Protocol ID: 0x%02x",
744 ipaddr_string(ndo
, obj_tptr
),
745 EXTRACT_U_1(obj_tptr
+ sizeof(nd_ipv4
)));
746 ND_PRINT("%s Flags: [0x%02x], DestPort %u",
748 EXTRACT_U_1((obj_tptr
+ 5)),
749 EXTRACT_BE_U_2(obj_tptr
+ 6));
753 case RSVP_CTYPE_IPV6
:
756 ND_PRINT("%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
758 ip6addr_string(ndo
, obj_tptr
),
759 EXTRACT_U_1(obj_tptr
+ sizeof(nd_ipv6
)));
760 ND_PRINT("%s Flags: [0x%02x], DestPort %u",
762 EXTRACT_U_1((obj_tptr
+ sizeof(nd_ipv6
) + 1)),
763 EXTRACT_BE_U_2(obj_tptr
+ sizeof(nd_ipv6
) + 2));
768 case RSVP_CTYPE_TUNNEL_IPV6
:
771 ND_PRINT("%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
773 ip6addr_string(ndo
, obj_tptr
),
774 EXTRACT_BE_U_2(obj_tptr
+ 18),
775 ip6addr_string(ndo
, obj_tptr
+ 20));
780 case RSVP_CTYPE_14
: /* IPv6 p2mp LSP Tunnel */
783 ND_PRINT("%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
785 EXTRACT_BE_U_4(obj_tptr
),
786 EXTRACT_BE_U_2(obj_tptr
+ 6),
787 ip6addr_string(ndo
, obj_tptr
+ 8));
791 case RSVP_CTYPE_13
: /* IPv4 p2mp LSP Tunnel */
794 ND_PRINT("%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
796 ipaddr_string(ndo
, obj_tptr
),
797 EXTRACT_BE_U_2(obj_tptr
+ 6),
798 ipaddr_string(ndo
, obj_tptr
+ 8));
802 case RSVP_CTYPE_TUNNEL_IPV4
:
803 case RSVP_CTYPE_UNI_IPV4
:
806 ND_PRINT("%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
808 ipaddr_string(ndo
, obj_tptr
),
809 EXTRACT_BE_U_2(obj_tptr
+ 6),
810 ipaddr_string(ndo
, obj_tptr
+ 8));
819 case RSVP_OBJ_CONFIRM
:
820 switch(rsvp_obj_ctype
) {
821 case RSVP_CTYPE_IPV4
:
822 if (obj_tlen
< sizeof(nd_ipv4
))
824 ND_PRINT("%s IPv4 Receiver Address: %s",
826 ipaddr_string(ndo
, obj_tptr
));
827 obj_tlen
-=sizeof(nd_ipv4
);
828 obj_tptr
+=sizeof(nd_ipv4
);
830 case RSVP_CTYPE_IPV6
:
831 if (obj_tlen
< sizeof(nd_ipv6
))
833 ND_PRINT("%s IPv6 Receiver Address: %s",
835 ip6addr_string(ndo
, obj_tptr
));
836 obj_tlen
-=sizeof(nd_ipv6
);
837 obj_tptr
+=sizeof(nd_ipv6
);
844 case RSVP_OBJ_NOTIFY_REQ
:
845 switch(rsvp_obj_ctype
) {
846 case RSVP_CTYPE_IPV4
:
847 if (obj_tlen
< sizeof(nd_ipv4
))
849 ND_PRINT("%s IPv4 Notify Node Address: %s",
851 ipaddr_string(ndo
, obj_tptr
));
852 obj_tlen
-=sizeof(nd_ipv4
);
853 obj_tptr
+=sizeof(nd_ipv4
);
855 case RSVP_CTYPE_IPV6
:
856 if (obj_tlen
< sizeof(nd_ipv6
))
858 ND_PRINT("%s IPv6 Notify Node Address: %s",
860 ip6addr_string(ndo
, obj_tptr
));
861 obj_tlen
-=sizeof(nd_ipv6
);
862 obj_tptr
+=sizeof(nd_ipv6
);
869 case RSVP_OBJ_SUGGESTED_LABEL
: /* fall through */
870 case RSVP_OBJ_UPSTREAM_LABEL
: /* fall through */
871 case RSVP_OBJ_RECOVERY_LABEL
: /* fall through */
873 switch(rsvp_obj_ctype
) {
875 while(obj_tlen
>= 4 ) {
876 ND_PRINT("%s Label: %u", indent
, EXTRACT_BE_U_4(obj_tptr
));
884 ND_PRINT("%s Generalized Label: %u",
886 EXTRACT_BE_U_4(obj_tptr
));
893 ND_PRINT("%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
895 EXTRACT_BE_U_4(obj_tptr
),
897 EXTRACT_BE_U_4(obj_tptr
+ 4),
898 EXTRACT_BE_U_4(obj_tptr
+ 8));
908 switch(rsvp_obj_ctype
) {
912 ND_PRINT("%s Reservation Style: %s, Flags: [0x%02x]",
914 tok2str(rsvp_resstyle_values
,
916 EXTRACT_BE_U_3(obj_tptr
+ 1)),
917 EXTRACT_U_1(obj_tptr
));
926 case RSVP_OBJ_SENDER_TEMPLATE
:
927 switch(rsvp_obj_ctype
) {
928 case RSVP_CTYPE_IPV4
:
931 ND_PRINT("%s Source Address: %s, Source Port: %u",
933 ipaddr_string(ndo
, obj_tptr
),
934 EXTRACT_BE_U_2(obj_tptr
+ 6));
938 case RSVP_CTYPE_IPV6
:
941 ND_PRINT("%s Source Address: %s, Source Port: %u",
943 ip6addr_string(ndo
, obj_tptr
),
944 EXTRACT_BE_U_2(obj_tptr
+ 18));
948 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
951 ND_PRINT("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
952 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
954 ip6addr_string(ndo
, obj_tptr
),
955 EXTRACT_BE_U_2(obj_tptr
+ 18),
957 ip6addr_string(ndo
, obj_tptr
+20),
958 EXTRACT_BE_U_2(obj_tptr
+ 38));
962 case RSVP_CTYPE_TUNNEL_IPV4
:
965 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
967 ipaddr_string(ndo
, obj_tptr
),
968 EXTRACT_BE_U_2(obj_tptr
+ 6));
972 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
975 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
976 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
978 ipaddr_string(ndo
, obj_tptr
),
979 EXTRACT_BE_U_2(obj_tptr
+ 6),
981 ipaddr_string(ndo
, obj_tptr
+8),
982 EXTRACT_BE_U_2(obj_tptr
+ 12));
991 case RSVP_OBJ_LABEL_REQ
:
992 switch(rsvp_obj_ctype
) {
994 while(obj_tlen
>= 4 ) {
995 ND_PRINT("%s L3 Protocol ID: %s",
997 tok2str(ethertype_values
,
998 "Unknown Protocol (0x%04x)",
999 EXTRACT_BE_U_2(obj_tptr
+ 2)));
1007 ND_PRINT("%s L3 Protocol ID: %s",
1009 tok2str(ethertype_values
,
1010 "Unknown Protocol (0x%04x)",
1011 EXTRACT_BE_U_2(obj_tptr
+ 2)));
1012 ND_PRINT(",%s merge capability",((EXTRACT_U_1(obj_tptr
+ 4)) & 0x80) ? "no" : "" );
1013 ND_PRINT("%s Minimum VPI/VCI: %u/%u",
1015 (EXTRACT_BE_U_2(obj_tptr
+ 4))&0xfff,
1016 (EXTRACT_BE_U_2(obj_tptr
+ 6)) & 0xfff);
1017 ND_PRINT("%s Maximum VPI/VCI: %u/%u",
1019 (EXTRACT_BE_U_2(obj_tptr
+ 8))&0xfff,
1020 (EXTRACT_BE_U_2(obj_tptr
+ 10)) & 0xfff);
1027 ND_PRINT("%s L3 Protocol ID: %s",
1029 tok2str(ethertype_values
,
1030 "Unknown Protocol (0x%04x)",
1031 EXTRACT_BE_U_2(obj_tptr
+ 2)));
1032 ND_PRINT("%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1034 (EXTRACT_BE_U_4(obj_tptr
+ 4))&0x7fffff,
1035 (EXTRACT_BE_U_4(obj_tptr
+ 8))&0x7fffff,
1036 (((EXTRACT_BE_U_2(obj_tptr
+ 4)>>7)&3) == 0 ) ? "10" : "",
1037 (((EXTRACT_BE_U_2(obj_tptr
+ 4) >> 7) & 3) == 2 ) ? "23" : "");
1044 ND_PRINT("%s LSP Encoding Type: %s (%u)",
1046 tok2str(gmpls_encoding_values
,
1048 EXTRACT_U_1(obj_tptr
)),
1049 EXTRACT_U_1(obj_tptr
));
1050 ND_PRINT("%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1052 tok2str(gmpls_switch_cap_values
,
1054 EXTRACT_U_1((obj_tptr
+ 1))),
1055 EXTRACT_U_1(obj_tptr
+ 1),
1056 tok2str(gmpls_payload_values
,
1058 EXTRACT_BE_U_2(obj_tptr
+ 2)),
1059 EXTRACT_BE_U_2(obj_tptr
+ 2));
1070 switch(rsvp_obj_ctype
) {
1071 case RSVP_CTYPE_IPV4
:
1072 while(obj_tlen
>= 4 ) {
1075 ND_TCHECK_4(obj_tptr
);
1076 length
= EXTRACT_U_1(obj_tptr
+ 1);
1077 ND_PRINT("%s Subobject Type: %s, length %u",
1079 tok2str(rsvp_obj_xro_values
,
1081 RSVP_OBJ_XRO_MASK_SUBOBJ(EXTRACT_U_1(obj_tptr
))),
1083 if (obj_tlen
< length
) {
1084 ND_PRINT("%s ERROR: ERO subobject length > object length", indent
);
1088 if (length
== 0) { /* prevent infinite loops */
1089 ND_PRINT("%s ERROR: zero length ERO subtype", indent
);
1093 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(EXTRACT_U_1(obj_tptr
))) {
1094 u_char prefix_length
;
1096 case RSVP_OBJ_XRO_IPV4
:
1098 ND_PRINT(" ERROR: length != 8");
1101 ND_TCHECK_8(obj_tptr
);
1102 prefix_length
= EXTRACT_U_1(obj_tptr
+ 6);
1103 if (prefix_length
!= 32) {
1104 ND_PRINT(" ERROR: Prefix length %u != 32",
1108 ND_PRINT(", %s, %s/%u, Flags: [%s]",
1109 RSVP_OBJ_XRO_MASK_LOOSE(EXTRACT_U_1(obj_tptr
)) ? "Loose" : "Strict",
1110 ipaddr_string(ndo
, obj_tptr
+2),
1111 EXTRACT_U_1((obj_tptr
+ 6)),
1112 bittok2str(rsvp_obj_rro_flag_values
,
1114 EXTRACT_U_1((obj_tptr
+ 7)))); /* rfc3209 says that this field is rsvd. */
1116 case RSVP_OBJ_XRO_LABEL
:
1118 ND_PRINT(" ERROR: length != 8");
1121 ND_TCHECK_8(obj_tptr
);
1122 ND_PRINT(", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1123 bittok2str(rsvp_obj_rro_label_flag_values
,
1125 EXTRACT_U_1((obj_tptr
+ 2))),
1126 EXTRACT_U_1(obj_tptr
+ 2),
1127 tok2str(rsvp_ctype_values
,
1129 EXTRACT_U_1((obj_tptr
+ 3)) + (256 * RSVP_OBJ_RRO
)),
1130 EXTRACT_U_1((obj_tptr
+ 3)),
1131 EXTRACT_BE_U_4(obj_tptr
+ 4));
1142 case RSVP_OBJ_HELLO
:
1143 switch(rsvp_obj_ctype
) {
1148 ND_PRINT("%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1150 EXTRACT_BE_U_4(obj_tptr
),
1151 EXTRACT_BE_U_4(obj_tptr
+ 4));
1160 case RSVP_OBJ_RESTART_CAPABILITY
:
1161 switch(rsvp_obj_ctype
) {
1165 ND_PRINT("%s Restart Time: %ums, Recovery Time: %ums",
1167 EXTRACT_BE_U_4(obj_tptr
),
1168 EXTRACT_BE_U_4(obj_tptr
+ 4));
1177 case RSVP_OBJ_SESSION_ATTRIBUTE
:
1178 switch(rsvp_obj_ctype
) {
1179 case RSVP_CTYPE_TUNNEL_IPV4
:
1182 namelen
= EXTRACT_U_1(obj_tptr
+ 3);
1183 if (obj_tlen
< 4+namelen
)
1185 ND_PRINT("%s Session Name: ", indent
);
1186 for (i
= 0; i
< namelen
; i
++)
1187 fn_print_char(ndo
, EXTRACT_U_1(obj_tptr
+ 4 + i
));
1188 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1190 EXTRACT_U_1(obj_tptr
),
1191 EXTRACT_U_1(obj_tptr
+ 1),
1192 bittok2str(rsvp_session_attribute_flag_values
,
1194 EXTRACT_U_1((obj_tptr
+ 2))),
1195 EXTRACT_U_1(obj_tptr
+ 2));
1196 obj_tlen
-=4+namelen
;
1197 obj_tptr
+=4+namelen
;
1204 case RSVP_OBJ_GENERALIZED_UNI
:
1205 switch(rsvp_obj_ctype
) {
1206 u_int subobj_type
,af
,subobj_len
,total_subobj_len
;
1213 /* read variable length subobjects */
1214 total_subobj_len
= obj_tlen
;
1215 while(total_subobj_len
> 0) {
1216 /* If RFC 3476 Section 3.1 defined that a sub-object of the
1217 * GENERALIZED_UNI RSVP object must have the Length field as
1218 * a multiple of 4, instead of the check below it would be
1219 * better to test total_subobj_len only once before the loop.
1220 * So long as it does not define it and this while loop does
1221 * not implement such a requirement, let's accept that within
1222 * each iteration subobj_len may happen to be a multiple of 1
1223 * and test it and total_subobj_len respectively.
1225 if (total_subobj_len
< 4)
1227 subobj_len
= EXTRACT_BE_U_2(obj_tptr
);
1228 subobj_type
= (EXTRACT_BE_U_2(obj_tptr
+ 2))>>8;
1229 af
= (EXTRACT_BE_U_2(obj_tptr
+ 2))&0x00FF;
1231 ND_PRINT("%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1233 tok2str(rsvp_obj_generalized_uni_values
, "Unknown", subobj_type
),
1235 tok2str(af_values
, "Unknown", af
), af
,
1238 /* In addition to what is explained above, the same spec does not
1239 * explicitly say that the same Length field includes the 4-octet
1240 * sub-object header, but as long as this while loop implements it
1241 * as it does include, let's keep the check below consistent with
1242 * the rest of the code.
1244 * XXX - RFC 3476 Section 3.1 says "The contents of these
1245 * sub-objects are described in [8]", where [8] is
1246 * UNI 1.0 Signaling Specification, The Optical
1247 * Internetworking Forum. The URL they give for that
1250 * http://www.oiforum.com/public/UNI_1.0_ia.html
1252 * but that doesn't work; the new URL appears to be
1254 * http://www.oiforum.com/public/documents/OIF-UNI-01.0.pdf
1256 * and *that* document, in section 12.5.2.3
1257 * "GENERALIZED_UNI Object (Class-Num=11bbbbbb (TBA))",
1258 * says nothing about the length field in general, but
1259 * some of the examples it gives in subsections have
1260 * length field values that clearly includes the length
1261 * of the sub-object header as well as the length of the
1264 if(subobj_len
< 4 || subobj_len
> total_subobj_len
||
1265 obj_tlen
< subobj_len
)
1268 switch(subobj_type
) {
1269 case RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
:
1270 case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
:
1276 ND_PRINT("%s UNI IPv4 TNA address: %s",
1277 indent
, ipaddr_string(ndo
, obj_tptr
+ 4));
1280 if (subobj_len
< 20)
1282 ND_PRINT("%s UNI IPv6 TNA address: %s",
1283 indent
, ip6addr_string(ndo
, obj_tptr
+ 4));
1287 /* unless we have a TLV parser lets just hexdump */
1294 case RSVP_GEN_UNI_SUBOBJ_DIVERSITY
:
1295 if (subobj_len
> 4) {
1296 /* unless we have a TLV parser lets just hexdump */
1301 case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
:
1302 if (subobj_len
< 16) {
1306 ND_PRINT("%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
1308 ((EXTRACT_BE_U_4(obj_tptr
+ 4))>>31),
1309 ((EXTRACT_BE_U_4(obj_tptr
+ 4))&0xFF),
1310 EXTRACT_BE_U_4(obj_tptr
+ 8),
1311 EXTRACT_BE_U_4(obj_tptr
+ 12));
1314 case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
:
1315 if (subobj_len
< 8) {
1319 ND_PRINT("%s Service level: %u",
1320 indent
, (EXTRACT_BE_U_4(obj_tptr
+ 4)) >> 24);
1327 total_subobj_len
-=subobj_len
;
1328 obj_tptr
+=subobj_len
;
1329 obj_tlen
+=subobj_len
;
1338 case RSVP_OBJ_RSVP_HOP
:
1339 switch(rsvp_obj_ctype
) {
1340 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1341 case RSVP_CTYPE_IPV4
:
1344 ND_PRINT("%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1346 ipaddr_string(ndo
, obj_tptr
),
1347 EXTRACT_BE_U_4(obj_tptr
+ 4));
1351 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1353 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1354 case RSVP_CTYPE_IPV6
:
1357 ND_PRINT("%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1359 ip6addr_string(ndo
, obj_tptr
),
1360 EXTRACT_BE_U_4(obj_tptr
+ 16));
1363 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1370 case RSVP_OBJ_TIME_VALUES
:
1371 switch(rsvp_obj_ctype
) {
1375 ND_PRINT("%s Refresh Period: %ums",
1377 EXTRACT_BE_U_4(obj_tptr
));
1386 /* those three objects do share the same semantics */
1387 case RSVP_OBJ_SENDER_TSPEC
:
1388 case RSVP_OBJ_ADSPEC
:
1389 case RSVP_OBJ_FLOWSPEC
:
1390 switch(rsvp_obj_ctype
) {
1394 ND_PRINT("%s Msg-Version: %u, length: %u",
1396 (EXTRACT_U_1(obj_tptr
) & 0xf0) >> 4,
1397 EXTRACT_BE_U_2(obj_tptr
+ 2) << 2);
1398 obj_tptr
+=4; /* get to the start of the service header */
1401 while (obj_tlen
>= 4) {
1402 intserv_serv_tlen
=EXTRACT_BE_U_2(obj_tptr
+ 2)<<2;
1403 ND_PRINT("%s Service Type: %s (%u), break bit %sset, Service length: %u",
1405 tok2str(rsvp_intserv_service_type_values
,"unknown",EXTRACT_U_1((obj_tptr
))),
1406 EXTRACT_U_1(obj_tptr
),
1407 (EXTRACT_U_1(obj_tptr
+ 1)&0x80) ? "" : "not ",
1410 obj_tptr
+=4; /* get to the start of the parameter list */
1413 while (intserv_serv_tlen
>=4) {
1414 processed
= rsvp_intserv_print(ndo
, obj_tptr
, obj_tlen
);
1417 obj_tlen
-=processed
;
1418 intserv_serv_tlen
-=processed
;
1419 obj_tptr
+=processed
;
1428 case RSVP_OBJ_FILTERSPEC
:
1429 switch(rsvp_obj_ctype
) {
1430 case RSVP_CTYPE_IPV4
:
1433 ND_PRINT("%s Source Address: %s, Source Port: %u",
1435 ipaddr_string(ndo
, obj_tptr
),
1436 EXTRACT_BE_U_2(obj_tptr
+ 6));
1440 case RSVP_CTYPE_IPV6
:
1443 ND_PRINT("%s Source Address: %s, Source Port: %u",
1445 ip6addr_string(ndo
, obj_tptr
),
1446 EXTRACT_BE_U_2(obj_tptr
+ 18));
1453 ND_PRINT("%s Source Address: %s, Flow Label: %u",
1455 ip6addr_string(ndo
, obj_tptr
),
1456 EXTRACT_BE_U_3(obj_tptr
+ 17));
1460 case RSVP_CTYPE_TUNNEL_IPV6
:
1463 ND_PRINT("%s Source Address: %s, LSP-ID: 0x%04x",
1465 ipaddr_string(ndo
, obj_tptr
),
1466 EXTRACT_BE_U_2(obj_tptr
+ 18));
1470 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
1473 ND_PRINT("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1474 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1476 ip6addr_string(ndo
, obj_tptr
),
1477 EXTRACT_BE_U_2(obj_tptr
+ 18),
1479 ip6addr_string(ndo
, obj_tptr
+20),
1480 EXTRACT_BE_U_2(obj_tptr
+ 38));
1484 case RSVP_CTYPE_TUNNEL_IPV4
:
1487 ND_PRINT("%s Source Address: %s, LSP-ID: 0x%04x",
1489 ipaddr_string(ndo
, obj_tptr
),
1490 EXTRACT_BE_U_2(obj_tptr
+ 6));
1494 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
1497 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1498 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1500 ipaddr_string(ndo
, obj_tptr
),
1501 EXTRACT_BE_U_2(obj_tptr
+ 6),
1503 ipaddr_string(ndo
, obj_tptr
+8),
1504 EXTRACT_BE_U_2(obj_tptr
+ 12));
1513 case RSVP_OBJ_FASTREROUTE
:
1514 /* the differences between c-type 1 and 7 are minor */
1515 obj_ptr
.rsvp_obj_frr
= (const struct rsvp_obj_frr_t
*)obj_tptr
;
1517 switch(rsvp_obj_ctype
) {
1518 case RSVP_CTYPE_1
: /* new style */
1519 if (obj_tlen
< sizeof(struct rsvp_obj_frr_t
))
1521 bw
.i
= EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1522 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1524 obj_ptr
.rsvp_obj_frr
->setup_prio
,
1525 obj_ptr
.rsvp_obj_frr
->hold_prio
,
1526 obj_ptr
.rsvp_obj_frr
->hop_limit
,
1527 bw
.f
* 8 / 1000000);
1528 ND_PRINT("%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
1530 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_any
),
1531 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->exclude_any
),
1532 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_all
));
1533 obj_tlen
-=sizeof(struct rsvp_obj_frr_t
);
1534 obj_tptr
+=sizeof(struct rsvp_obj_frr_t
);
1537 case RSVP_CTYPE_TUNNEL_IPV4
: /* old style */
1540 bw
.i
= EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1541 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1543 obj_ptr
.rsvp_obj_frr
->setup_prio
,
1544 obj_ptr
.rsvp_obj_frr
->hold_prio
,
1545 obj_ptr
.rsvp_obj_frr
->hop_limit
,
1546 bw
.f
* 8 / 1000000);
1547 ND_PRINT("%s Include Colors: 0x%08x, Exclude Colors: 0x%08x",
1549 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_any
),
1550 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_frr
->exclude_any
));
1560 case RSVP_OBJ_DETOUR
:
1561 switch(rsvp_obj_ctype
) {
1562 case RSVP_CTYPE_TUNNEL_IPV4
:
1563 while(obj_tlen
>= 8) {
1564 ND_PRINT("%s PLR-ID: %s, Avoid-Node-ID: %s",
1566 ipaddr_string(ndo
, obj_tptr
),
1567 ipaddr_string(ndo
, obj_tptr
+ 4));
1577 case RSVP_OBJ_CLASSTYPE
:
1578 case RSVP_OBJ_CLASSTYPE_OLD
: /* fall through */
1579 switch(rsvp_obj_ctype
) {
1581 ND_PRINT("%s CT: %u",
1583 EXTRACT_BE_U_4(obj_tptr
) & 0x7);
1592 case RSVP_OBJ_ERROR_SPEC
:
1593 switch(rsvp_obj_ctype
) {
1594 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1595 case RSVP_CTYPE_IPV4
:
1598 error_code
=EXTRACT_U_1(obj_tptr
+ 5);
1599 error_value
=EXTRACT_BE_U_2(obj_tptr
+ 6);
1600 ND_PRINT("%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1602 ipaddr_string(ndo
, obj_tptr
),
1603 EXTRACT_U_1(obj_tptr
+ 4),
1605 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1607 switch (error_code
) {
1608 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1609 ND_PRINT(", Error Value: %s (%u)",
1610 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1613 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
: /* fall through */
1614 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
:
1615 ND_PRINT(", Error Value: %s (%u)",
1616 tok2str(rsvp_obj_error_code_diffserv_te_values
,"unknown",error_value
),
1620 ND_PRINT(", Unknown Error Value (%u)", error_value
);
1626 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1627 case RSVP_CTYPE_IPV6
:
1630 error_code
=EXTRACT_U_1(obj_tptr
+ 17);
1631 error_value
=EXTRACT_BE_U_2(obj_tptr
+ 18);
1632 ND_PRINT("%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1634 ip6addr_string(ndo
, obj_tptr
),
1635 EXTRACT_U_1(obj_tptr
+ 16),
1637 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1640 switch (error_code
) {
1641 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1642 ND_PRINT(", Error Value: %s (%u)",
1643 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1657 case RSVP_OBJ_PROPERTIES
:
1658 switch(rsvp_obj_ctype
) {
1662 padbytes
= EXTRACT_BE_U_2(obj_tptr
+ 2);
1663 ND_PRINT("%s TLV count: %u, padding bytes: %u",
1665 EXTRACT_BE_U_2(obj_tptr
),
1669 /* loop through as long there is anything longer than the TLV header (2) */
1670 while(obj_tlen
>= 2 + padbytes
) {
1671 ND_PRINT("%s %s TLV (0x%02x), length: %u", /* length includes header */
1673 tok2str(rsvp_obj_prop_tlv_values
,"unknown",EXTRACT_U_1(obj_tptr
)),
1674 EXTRACT_U_1(obj_tptr
),
1675 EXTRACT_U_1(obj_tptr
+ 1));
1676 if (obj_tlen
< EXTRACT_U_1(obj_tptr
+ 1))
1678 if (EXTRACT_U_1(obj_tptr
+ 1) < 2)
1680 print_unknown_data(ndo
, obj_tptr
+ 2, "\n\t\t",
1681 EXTRACT_U_1(obj_tptr
+ 1) - 2);
1682 obj_tlen
-=EXTRACT_U_1(obj_tptr
+ 1);
1683 obj_tptr
+=EXTRACT_U_1(obj_tptr
+ 1);
1691 case RSVP_OBJ_MESSAGE_ID
: /* fall through */
1692 case RSVP_OBJ_MESSAGE_ID_ACK
: /* fall through */
1693 case RSVP_OBJ_MESSAGE_ID_LIST
:
1694 switch(rsvp_obj_ctype
) {
1699 ND_PRINT("%s Flags [0x%02x], epoch: %u",
1701 EXTRACT_U_1(obj_tptr
),
1702 EXTRACT_BE_U_3(obj_tptr
+ 1));
1705 /* loop through as long there are no messages left */
1706 while(obj_tlen
>= 4) {
1707 ND_PRINT("%s Message-ID 0x%08x (%u)",
1709 EXTRACT_BE_U_4(obj_tptr
),
1710 EXTRACT_BE_U_4(obj_tptr
));
1720 case RSVP_OBJ_INTEGRITY
:
1721 switch(rsvp_obj_ctype
) {
1723 if (obj_tlen
< sizeof(struct rsvp_obj_integrity_t
))
1725 obj_ptr
.rsvp_obj_integrity
= (const struct rsvp_obj_integrity_t
*)obj_tptr
;
1726 ND_PRINT("%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
1728 EXTRACT_BE_U_2(obj_ptr
.rsvp_obj_integrity
->key_id
),
1729 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->key_id
+ 2),
1730 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->sequence
),
1731 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->sequence
+ 4),
1732 bittok2str(rsvp_obj_integrity_flag_values
,
1734 obj_ptr
.rsvp_obj_integrity
->flags
));
1735 ND_PRINT("%s MD5-sum 0x%08x%08x%08x%08x ",
1737 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
),
1738 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 4),
1739 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 8),
1740 EXTRACT_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 12));
1742 sigcheck
= signature_verify(ndo
, pptr
, plen
,
1743 obj_ptr
.rsvp_obj_integrity
->digest
,
1744 rsvp_clear_checksum
,
1746 ND_PRINT(" (%s)", tok2str(signature_check_values
, "Unknown", sigcheck
));
1748 obj_tlen
+=sizeof(struct rsvp_obj_integrity_t
);
1749 obj_tptr
+=sizeof(struct rsvp_obj_integrity_t
);
1756 case RSVP_OBJ_ADMIN_STATUS
:
1757 switch(rsvp_obj_ctype
) {
1761 ND_PRINT("%s Flags [%s]", indent
,
1762 bittok2str(rsvp_obj_admin_status_flag_values
, "none",
1763 EXTRACT_BE_U_4(obj_tptr
)));
1772 case RSVP_OBJ_LABEL_SET
:
1773 switch(rsvp_obj_ctype
) {
1777 action
= (EXTRACT_BE_U_2(obj_tptr
)>>8);
1779 ND_PRINT("%s Action: %s (%u), Label type: %u", indent
,
1780 tok2str(rsvp_obj_label_set_action_values
, "Unknown", action
),
1781 action
, (EXTRACT_BE_U_4(obj_tptr
) & 0x7F));
1784 case LABEL_SET_INCLUSIVE_RANGE
:
1785 case LABEL_SET_EXCLUSIVE_RANGE
: /* fall through */
1787 /* only a couple of subchannels are expected */
1790 ND_PRINT("%s Start range: %u, End range: %u", indent
,
1791 EXTRACT_BE_U_4(obj_tptr
+ 4),
1792 EXTRACT_BE_U_4(obj_tptr
+ 8));
1801 while(obj_tlen
>= 4 ) {
1802 ND_PRINT("%s Subchannel #%u: %u", indent
, subchannel
,
1803 EXTRACT_BE_U_4(obj_tptr
));
1817 switch (rsvp_obj_ctype
) {
1818 case RSVP_CTYPE_IPV4
:
1821 ND_PRINT("%s Sub-LSP destination address: %s",
1822 indent
, ipaddr_string(ndo
, obj_tptr
));
1827 case RSVP_CTYPE_IPV6
:
1830 ND_PRINT("%s Sub-LSP destination address: %s",
1831 indent
, ip6addr_string(ndo
, obj_tptr
));
1842 * FIXME those are the defined objects that lack a decoder
1843 * you are welcome to contribute code ;-)
1846 case RSVP_OBJ_SCOPE
:
1847 case RSVP_OBJ_POLICY_DATA
:
1848 case RSVP_OBJ_ACCEPT_LABEL_SET
:
1849 case RSVP_OBJ_PROTECTION
:
1851 if (ndo
->ndo_vflag
<= 1)
1852 print_unknown_data(ndo
, obj_tptr
, "\n\t ", obj_tlen
); /* FIXME indentation */
1855 /* do we also want to see a hex dump ? */
1856 if (ndo
->ndo_vflag
> 1 || hexdump
== TRUE
)
1857 print_unknown_data(ndo
, tptr
+ sizeof(struct rsvp_object_header
), "\n\t ", /* FIXME indentation */
1858 rsvp_obj_len
- sizeof(struct rsvp_object_header
));
1865 nd_print_invalid(ndo
);
1868 nd_print_trunc(ndo
);
1873 rsvp_print(netdissect_options
*ndo
,
1874 const u_char
*pptr
, u_int len
)
1876 const struct rsvp_common_header
*rsvp_com_header
;
1877 uint8_t version_flags
, msg_type
;
1881 ndo
->ndo_protocol
= "rsvp";
1884 rsvp_com_header
= (const struct rsvp_common_header
*)pptr
;
1885 ND_TCHECK_SIZE(rsvp_com_header
);
1886 version_flags
= EXTRACT_U_1(rsvp_com_header
->version_flags
);
1889 * Sanity checking of the header.
1891 if (RSVP_EXTRACT_VERSION(version_flags
) != RSVP_VERSION
) {
1892 ND_PRINT("ERROR: RSVP version %u packet not supported",
1893 RSVP_EXTRACT_VERSION(version_flags
));
1897 msg_type
= EXTRACT_U_1(rsvp_com_header
->msg_type
);
1899 /* in non-verbose mode just lets print the basic Message Type*/
1900 if (ndo
->ndo_vflag
< 1) {
1901 ND_PRINT("RSVPv%u %s Message, length: %u",
1902 RSVP_EXTRACT_VERSION(version_flags
),
1903 tok2str(rsvp_msg_type_values
, "unknown (%u)",msg_type
),
1908 /* ok they seem to want to know everything - lets fully decode it */
1910 plen
= tlen
= EXTRACT_BE_U_2(rsvp_com_header
->length
);
1912 ND_PRINT("\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1913 RSVP_EXTRACT_VERSION(version_flags
),
1914 tok2str(rsvp_msg_type_values
, "unknown, type: %u",msg_type
),
1916 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(version_flags
)),
1918 EXTRACT_U_1(rsvp_com_header
->ttl
),
1919 EXTRACT_BE_U_2(rsvp_com_header
->checksum
));
1921 if (tlen
< sizeof(struct rsvp_common_header
)) {
1922 ND_PRINT("ERROR: common header too short %u < %lu", tlen
,
1923 (unsigned long)sizeof(struct rsvp_common_header
));
1927 tptr
+=sizeof(struct rsvp_common_header
);
1928 tlen
-=sizeof(struct rsvp_common_header
);
1932 case RSVP_MSGTYPE_BUNDLE
:
1934 * Process each submessage in the bundle message.
1935 * Bundle messages may not contain bundle submessages, so we don't
1936 * need to handle bundle submessages specially.
1939 const u_char
*subpptr
=tptr
, *subtptr
;
1940 u_short subplen
, subtlen
;
1944 rsvp_com_header
= (const struct rsvp_common_header
*)subpptr
;
1945 ND_TCHECK_SIZE(rsvp_com_header
);
1946 version_flags
= EXTRACT_U_1(rsvp_com_header
->version_flags
);
1949 * Sanity checking of the header.
1951 if (RSVP_EXTRACT_VERSION(version_flags
) != RSVP_VERSION
) {
1952 ND_PRINT("ERROR: RSVP version %u packet not supported",
1953 RSVP_EXTRACT_VERSION(version_flags
));
1957 subplen
= subtlen
= EXTRACT_BE_U_2(rsvp_com_header
->length
);
1959 msg_type
= EXTRACT_U_1(rsvp_com_header
->msg_type
);
1960 ND_PRINT("\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1961 RSVP_EXTRACT_VERSION(version_flags
),
1962 tok2str(rsvp_msg_type_values
, "unknown, type: %u",msg_type
),
1964 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(version_flags
)),
1966 EXTRACT_U_1(rsvp_com_header
->ttl
),
1967 EXTRACT_BE_U_2(rsvp_com_header
->checksum
));
1969 if (subtlen
< sizeof(struct rsvp_common_header
)) {
1970 ND_PRINT("ERROR: common header too short %u < %lu", subtlen
,
1971 (unsigned long)sizeof(struct rsvp_common_header
));
1975 if (tlen
< subtlen
) {
1976 ND_PRINT("ERROR: common header too large %u > %u", subtlen
,
1981 subtptr
+=sizeof(struct rsvp_common_header
);
1982 subtlen
-=sizeof(struct rsvp_common_header
);
1985 * Print all objects in the submessage.
1987 if (rsvp_obj_print(ndo
, subpptr
, subplen
, subtptr
, "\n\t ", subtlen
, rsvp_com_header
) == -1)
1990 tptr
+=subtlen
+sizeof(struct rsvp_common_header
);
1991 tlen
-=subtlen
+sizeof(struct rsvp_common_header
);
1996 case RSVP_MSGTYPE_PATH
:
1997 case RSVP_MSGTYPE_RESV
:
1998 case RSVP_MSGTYPE_PATHERR
:
1999 case RSVP_MSGTYPE_RESVERR
:
2000 case RSVP_MSGTYPE_PATHTEAR
:
2001 case RSVP_MSGTYPE_RESVTEAR
:
2002 case RSVP_MSGTYPE_RESVCONF
:
2003 case RSVP_MSGTYPE_HELLO_OLD
:
2004 case RSVP_MSGTYPE_HELLO
:
2005 case RSVP_MSGTYPE_ACK
:
2006 case RSVP_MSGTYPE_SREFRESH
:
2008 * Print all objects in the message.
2010 if (rsvp_obj_print(ndo
, pptr
, plen
, tptr
, "\n\t ", tlen
, rsvp_com_header
) == -1)
2015 print_unknown_data(ndo
, tptr
, "\n\t ", tlen
);
2021 nd_print_trunc(ndo
);