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
= GET_U_1(tptr
);
505 ND_TCHECK_2(tptr
+ 2);
506 parameter_length
= GET_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
),
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", GET_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
= GET_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 (GET_BE_U_4(tptr
+ 4) == 0xffffffff)
559 ND_PRINT("don't care");
561 ND_PRINT("%u", GET_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", GET_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
= GET_BE_U_4(tptr
+ 4);
599 ND_PRINT("\n\t\tToken Bucket Rate: %.10g Mbps", bw
.f
/ 125000);
600 bw
.i
= GET_BE_U_4(tptr
+ 8);
601 ND_PRINT("\n\t\tToken Bucket Size: %.10g bytes", bw
.f
);
602 bw
.i
= GET_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",
605 GET_BE_U_4(tptr
+ 16));
606 ND_PRINT("\n\t\tMaximum Packet Size: %u bytes",
607 GET_BE_U_4(tptr
+ 20));
613 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
614 * | 130 (h) | 0 (i) | 2 (j) |
615 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
616 * | Rate [R] (32-bit IEEE floating point number) |
617 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
618 * | Slack Term [S] (32-bit integer) |
619 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
622 if (parameter_length
== 8) {
623 ND_TCHECK_8(tptr
+ 4);
624 bw
.i
= GET_BE_U_4(tptr
+ 4);
625 ND_PRINT("\n\t\tRate: %.10g Mbps", bw
.f
/ 125000);
626 ND_PRINT("\n\t\tSlack Term: %u", GET_BE_U_4(tptr
+ 8));
634 if (parameter_length
== 4) {
635 ND_TCHECK_4(tptr
+ 4);
636 ND_PRINT("\n\t\tValue: %u", GET_BE_U_4(tptr
+ 4));
641 if (ndo
->ndo_vflag
<= 1)
642 print_unknown_data(ndo
, tptr
+ 4, "\n\t\t", parameter_length
);
644 return (parameter_length
+4); /* header length 4 bytes */
652 * Clear checksum prior to signature verification.
655 rsvp_clear_checksum(void *header
)
657 struct rsvp_common_header
*rsvp_com_header
= (struct rsvp_common_header
*) header
;
659 rsvp_com_header
->checksum
[0] = 0;
660 rsvp_com_header
->checksum
[1] = 0;
664 rsvp_obj_print(netdissect_options
*ndo
,
665 const u_char
*pptr
, u_int plen
, const u_char
*tptr
,
666 const char *indent
, u_int tlen
,
667 const struct rsvp_common_header
*rsvp_com_header
)
669 const struct rsvp_object_header
*rsvp_obj_header
;
670 const u_char
*obj_tptr
;
672 const struct rsvp_obj_integrity_t
*rsvp_obj_integrity
;
673 const struct rsvp_obj_frr_t
*rsvp_obj_frr
;
676 u_short rsvp_obj_len
,rsvp_obj_ctype
,rsvp_obj_class_num
,obj_tlen
;
677 u_int intserv_serv_tlen
;
679 u_int processed
,padbytes
,error_code
,error_value
,i
,sigcheck
;
686 u_int action
, subchannel
;
688 while(tlen
>=sizeof(struct rsvp_object_header
)) {
689 /* did we capture enough for fully decoding the object header ? */
690 ND_TCHECK_LEN(tptr
, sizeof(struct rsvp_object_header
));
692 rsvp_obj_header
= (const struct rsvp_object_header
*)tptr
;
693 rsvp_obj_len
=GET_BE_U_2(rsvp_obj_header
->length
);
694 rsvp_obj_ctype
=GET_U_1(rsvp_obj_header
->ctype
);
696 if(rsvp_obj_len
% 4) {
697 ND_PRINT("%sERROR: object header size %u not a multiple of 4", indent
, rsvp_obj_len
);
700 if(rsvp_obj_len
< sizeof(struct rsvp_object_header
)) {
701 ND_PRINT("%sERROR: object header too short %u < %lu", indent
, rsvp_obj_len
,
702 (unsigned long)sizeof(struct rsvp_object_header
));
706 rsvp_obj_class_num
= GET_U_1(rsvp_obj_header
->class_num
);
707 ND_PRINT("%s%s Object (%u) Flags: [%s",
709 tok2str(rsvp_obj_values
,
713 (rsvp_obj_class_num
& 0x80) ?
714 ((rsvp_obj_class_num
& 0x40) ? "ignore and forward" :
718 ND_PRINT(" if unknown], Class-Type: %s (%u), length: %u",
719 tok2str(rsvp_ctype_values
,
721 (rsvp_obj_class_num
<<8)+rsvp_obj_ctype
),
725 if(tlen
< rsvp_obj_len
) {
726 ND_PRINT("%sERROR: object goes past end of objects TLV", indent
);
730 obj_tptr
=tptr
+sizeof(struct rsvp_object_header
);
731 obj_tlen
=rsvp_obj_len
-sizeof(struct rsvp_object_header
);
733 /* did we capture enough for fully decoding the object ? */
734 ND_TCHECK_LEN(tptr
, rsvp_obj_len
);
737 switch(rsvp_obj_class_num
) {
738 case RSVP_OBJ_SESSION
:
739 switch(rsvp_obj_ctype
) {
740 case RSVP_CTYPE_IPV4
:
743 ND_PRINT("%s IPv4 DestAddress: %s, Protocol ID: 0x%02x",
745 ipaddr_string(ndo
, obj_tptr
),
746 GET_U_1(obj_tptr
+ sizeof(nd_ipv4
)));
747 ND_PRINT("%s Flags: [0x%02x], DestPort %u",
749 GET_U_1((obj_tptr
+ 5)),
750 GET_BE_U_2(obj_tptr
+ 6));
754 case RSVP_CTYPE_IPV6
:
757 ND_PRINT("%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
759 ip6addr_string(ndo
, obj_tptr
),
760 GET_U_1(obj_tptr
+ sizeof(nd_ipv6
)));
761 ND_PRINT("%s Flags: [0x%02x], DestPort %u",
763 GET_U_1((obj_tptr
+ sizeof(nd_ipv6
) + 1)),
764 GET_BE_U_2(obj_tptr
+ sizeof(nd_ipv6
) + 2));
769 case RSVP_CTYPE_TUNNEL_IPV6
:
772 ND_PRINT("%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
774 ip6addr_string(ndo
, obj_tptr
),
775 GET_BE_U_2(obj_tptr
+ 18),
776 ip6addr_string(ndo
, obj_tptr
+ 20));
781 case RSVP_CTYPE_14
: /* IPv6 p2mp LSP Tunnel */
784 ND_PRINT("%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
786 GET_BE_U_4(obj_tptr
),
787 GET_BE_U_2(obj_tptr
+ 6),
788 ip6addr_string(ndo
, obj_tptr
+ 8));
792 case RSVP_CTYPE_13
: /* IPv4 p2mp LSP Tunnel */
795 ND_PRINT("%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
797 ipaddr_string(ndo
, obj_tptr
),
798 GET_BE_U_2(obj_tptr
+ 6),
799 ipaddr_string(ndo
, obj_tptr
+ 8));
803 case RSVP_CTYPE_TUNNEL_IPV4
:
804 case RSVP_CTYPE_UNI_IPV4
:
807 ND_PRINT("%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
809 ipaddr_string(ndo
, obj_tptr
),
810 GET_BE_U_2(obj_tptr
+ 6),
811 ipaddr_string(ndo
, obj_tptr
+ 8));
820 case RSVP_OBJ_CONFIRM
:
821 switch(rsvp_obj_ctype
) {
822 case RSVP_CTYPE_IPV4
:
823 if (obj_tlen
< sizeof(nd_ipv4
))
825 ND_PRINT("%s IPv4 Receiver Address: %s",
827 ipaddr_string(ndo
, obj_tptr
));
828 obj_tlen
-=sizeof(nd_ipv4
);
829 obj_tptr
+=sizeof(nd_ipv4
);
831 case RSVP_CTYPE_IPV6
:
832 if (obj_tlen
< sizeof(nd_ipv6
))
834 ND_PRINT("%s IPv6 Receiver Address: %s",
836 ip6addr_string(ndo
, obj_tptr
));
837 obj_tlen
-=sizeof(nd_ipv6
);
838 obj_tptr
+=sizeof(nd_ipv6
);
845 case RSVP_OBJ_NOTIFY_REQ
:
846 switch(rsvp_obj_ctype
) {
847 case RSVP_CTYPE_IPV4
:
848 if (obj_tlen
< sizeof(nd_ipv4
))
850 ND_PRINT("%s IPv4 Notify Node Address: %s",
852 ipaddr_string(ndo
, obj_tptr
));
853 obj_tlen
-=sizeof(nd_ipv4
);
854 obj_tptr
+=sizeof(nd_ipv4
);
856 case RSVP_CTYPE_IPV6
:
857 if (obj_tlen
< sizeof(nd_ipv6
))
859 ND_PRINT("%s IPv6 Notify Node Address: %s",
861 ip6addr_string(ndo
, obj_tptr
));
862 obj_tlen
-=sizeof(nd_ipv6
);
863 obj_tptr
+=sizeof(nd_ipv6
);
870 case RSVP_OBJ_SUGGESTED_LABEL
: /* fall through */
871 case RSVP_OBJ_UPSTREAM_LABEL
: /* fall through */
872 case RSVP_OBJ_RECOVERY_LABEL
: /* fall through */
874 switch(rsvp_obj_ctype
) {
876 while(obj_tlen
>= 4 ) {
877 ND_PRINT("%s Label: %u", indent
, GET_BE_U_4(obj_tptr
));
885 ND_PRINT("%s Generalized Label: %u",
887 GET_BE_U_4(obj_tptr
));
894 ND_PRINT("%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
896 GET_BE_U_4(obj_tptr
),
898 GET_BE_U_4(obj_tptr
+ 4),
899 GET_BE_U_4(obj_tptr
+ 8));
909 switch(rsvp_obj_ctype
) {
913 ND_PRINT("%s Reservation Style: %s, Flags: [0x%02x]",
915 tok2str(rsvp_resstyle_values
,
917 GET_BE_U_3(obj_tptr
+ 1)),
927 case RSVP_OBJ_SENDER_TEMPLATE
:
928 switch(rsvp_obj_ctype
) {
929 case RSVP_CTYPE_IPV4
:
932 ND_PRINT("%s Source Address: %s, Source Port: %u",
934 ipaddr_string(ndo
, obj_tptr
),
935 GET_BE_U_2(obj_tptr
+ 6));
939 case RSVP_CTYPE_IPV6
:
942 ND_PRINT("%s Source Address: %s, Source Port: %u",
944 ip6addr_string(ndo
, obj_tptr
),
945 GET_BE_U_2(obj_tptr
+ 18));
949 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
952 ND_PRINT("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
953 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
955 ip6addr_string(ndo
, obj_tptr
),
956 GET_BE_U_2(obj_tptr
+ 18),
958 ip6addr_string(ndo
, obj_tptr
+20),
959 GET_BE_U_2(obj_tptr
+ 38));
963 case RSVP_CTYPE_TUNNEL_IPV4
:
966 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
968 ipaddr_string(ndo
, obj_tptr
),
969 GET_BE_U_2(obj_tptr
+ 6));
973 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
976 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
977 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
979 ipaddr_string(ndo
, obj_tptr
),
980 GET_BE_U_2(obj_tptr
+ 6),
982 ipaddr_string(ndo
, obj_tptr
+8),
983 GET_BE_U_2(obj_tptr
+ 12));
992 case RSVP_OBJ_LABEL_REQ
:
993 switch(rsvp_obj_ctype
) {
995 while(obj_tlen
>= 4 ) {
996 ND_PRINT("%s L3 Protocol ID: %s",
998 tok2str(ethertype_values
,
999 "Unknown Protocol (0x%04x)",
1000 GET_BE_U_2(obj_tptr
+ 2)));
1008 ND_PRINT("%s L3 Protocol ID: %s",
1010 tok2str(ethertype_values
,
1011 "Unknown Protocol (0x%04x)",
1012 GET_BE_U_2(obj_tptr
+ 2)));
1013 ND_PRINT(",%s merge capability",
1014 ((GET_U_1(obj_tptr
+ 4)) & 0x80) ? "no" : "" );
1015 ND_PRINT("%s Minimum VPI/VCI: %u/%u",
1017 (GET_BE_U_2(obj_tptr
+ 4))&0xfff,
1018 (GET_BE_U_2(obj_tptr
+ 6)) & 0xfff);
1019 ND_PRINT("%s Maximum VPI/VCI: %u/%u",
1021 (GET_BE_U_2(obj_tptr
+ 8))&0xfff,
1022 (GET_BE_U_2(obj_tptr
+ 10)) & 0xfff);
1029 ND_PRINT("%s L3 Protocol ID: %s",
1031 tok2str(ethertype_values
,
1032 "Unknown Protocol (0x%04x)",
1033 GET_BE_U_2(obj_tptr
+ 2)));
1034 ND_PRINT("%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1036 (GET_BE_U_4(obj_tptr
+ 4))&0x7fffff,
1037 (GET_BE_U_4(obj_tptr
+ 8))&0x7fffff,
1038 (((GET_BE_U_2(obj_tptr
+ 4)>>7)&3) == 0 ) ? "10" : "",
1039 (((GET_BE_U_2(obj_tptr
+ 4) >> 7) & 3) == 2 ) ? "23" : "");
1046 ND_PRINT("%s LSP Encoding Type: %s (%u)",
1048 tok2str(gmpls_encoding_values
,
1052 ND_PRINT("%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1054 tok2str(gmpls_switch_cap_values
,
1056 GET_U_1((obj_tptr
+ 1))),
1057 GET_U_1(obj_tptr
+ 1),
1058 tok2str(gmpls_payload_values
,
1060 GET_BE_U_2(obj_tptr
+ 2)),
1061 GET_BE_U_2(obj_tptr
+ 2));
1072 switch(rsvp_obj_ctype
) {
1073 case RSVP_CTYPE_IPV4
:
1074 while(obj_tlen
>= 4 ) {
1077 ND_TCHECK_4(obj_tptr
);
1078 length
= GET_U_1(obj_tptr
+ 1);
1079 ND_PRINT("%s Subobject Type: %s, length %u",
1081 tok2str(rsvp_obj_xro_values
,
1083 RSVP_OBJ_XRO_MASK_SUBOBJ(GET_U_1(obj_tptr
))),
1085 if (obj_tlen
< length
) {
1086 ND_PRINT("%s ERROR: ERO subobject length > object length", indent
);
1090 if (length
== 0) { /* prevent infinite loops */
1091 ND_PRINT("%s ERROR: zero length ERO subtype", indent
);
1095 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(GET_U_1(obj_tptr
))) {
1096 u_char prefix_length
;
1098 case RSVP_OBJ_XRO_IPV4
:
1100 ND_PRINT(" ERROR: length != 8");
1103 ND_TCHECK_8(obj_tptr
);
1104 prefix_length
= GET_U_1(obj_tptr
+ 6);
1105 if (prefix_length
!= 32) {
1106 ND_PRINT(" ERROR: Prefix length %u != 32",
1110 ND_PRINT(", %s, %s/%u, Flags: [%s]",
1111 RSVP_OBJ_XRO_MASK_LOOSE(GET_U_1(obj_tptr
)) ? "Loose" : "Strict",
1112 ipaddr_string(ndo
, obj_tptr
+2),
1113 GET_U_1((obj_tptr
+ 6)),
1114 bittok2str(rsvp_obj_rro_flag_values
,
1116 GET_U_1((obj_tptr
+ 7)))); /* rfc3209 says that this field is rsvd. */
1118 case RSVP_OBJ_XRO_LABEL
:
1120 ND_PRINT(" ERROR: length != 8");
1123 ND_TCHECK_8(obj_tptr
);
1124 ND_PRINT(", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1125 bittok2str(rsvp_obj_rro_label_flag_values
,
1127 GET_U_1((obj_tptr
+ 2))),
1128 GET_U_1(obj_tptr
+ 2),
1129 tok2str(rsvp_ctype_values
,
1131 GET_U_1((obj_tptr
+ 3)) + (256 * RSVP_OBJ_RRO
)),
1132 GET_U_1((obj_tptr
+ 3)),
1133 GET_BE_U_4(obj_tptr
+ 4));
1144 case RSVP_OBJ_HELLO
:
1145 switch(rsvp_obj_ctype
) {
1150 ND_PRINT("%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1152 GET_BE_U_4(obj_tptr
),
1153 GET_BE_U_4(obj_tptr
+ 4));
1162 case RSVP_OBJ_RESTART_CAPABILITY
:
1163 switch(rsvp_obj_ctype
) {
1167 ND_PRINT("%s Restart Time: %ums, Recovery Time: %ums",
1169 GET_BE_U_4(obj_tptr
),
1170 GET_BE_U_4(obj_tptr
+ 4));
1179 case RSVP_OBJ_SESSION_ATTRIBUTE
:
1180 switch(rsvp_obj_ctype
) {
1181 case RSVP_CTYPE_TUNNEL_IPV4
:
1184 namelen
= GET_U_1(obj_tptr
+ 3);
1185 if (obj_tlen
< 4+namelen
)
1187 ND_PRINT("%s Session Name: ", indent
);
1188 for (i
= 0; i
< namelen
; i
++)
1189 fn_print_char(ndo
, GET_U_1(obj_tptr
+ 4 + i
));
1190 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1193 GET_U_1(obj_tptr
+ 1),
1194 bittok2str(rsvp_session_attribute_flag_values
,
1196 GET_U_1((obj_tptr
+ 2))),
1197 GET_U_1(obj_tptr
+ 2));
1198 obj_tlen
-=4+namelen
;
1199 obj_tptr
+=4+namelen
;
1206 case RSVP_OBJ_GENERALIZED_UNI
:
1207 switch(rsvp_obj_ctype
) {
1208 u_int subobj_type
,af
,subobj_len
,total_subobj_len
;
1215 /* read variable length subobjects */
1216 total_subobj_len
= obj_tlen
;
1217 while(total_subobj_len
> 0) {
1218 /* If RFC 3476 Section 3.1 defined that a sub-object of the
1219 * GENERALIZED_UNI RSVP object must have the Length field as
1220 * a multiple of 4, instead of the check below it would be
1221 * better to test total_subobj_len only once before the loop.
1222 * So long as it does not define it and this while loop does
1223 * not implement such a requirement, let's accept that within
1224 * each iteration subobj_len may happen to be a multiple of 1
1225 * and test it and total_subobj_len respectively.
1227 if (total_subobj_len
< 4)
1229 subobj_len
= GET_BE_U_2(obj_tptr
);
1230 subobj_type
= (GET_BE_U_2(obj_tptr
+ 2))>>8;
1231 af
= (GET_BE_U_2(obj_tptr
+ 2))&0x00FF;
1233 ND_PRINT("%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1235 tok2str(rsvp_obj_generalized_uni_values
, "Unknown", subobj_type
),
1237 tok2str(af_values
, "Unknown", af
), af
,
1240 /* In addition to what is explained above, the same spec does not
1241 * explicitly say that the same Length field includes the 4-octet
1242 * sub-object header, but as long as this while loop implements it
1243 * as it does include, let's keep the check below consistent with
1244 * the rest of the code.
1246 * XXX - RFC 3476 Section 3.1 says "The contents of these
1247 * sub-objects are described in [8]", where [8] is
1248 * UNI 1.0 Signaling Specification, The Optical
1249 * Internetworking Forum. The URL they give for that
1252 * http://www.oiforum.com/public/UNI_1.0_ia.html
1254 * but that doesn't work; the new URL appears to be
1256 * http://www.oiforum.com/public/documents/OIF-UNI-01.0.pdf
1258 * and *that* document, in section 12.5.2.3
1259 * "GENERALIZED_UNI Object (Class-Num=11bbbbbb (TBA))",
1260 * says nothing about the length field in general, but
1261 * some of the examples it gives in subsections have
1262 * length field values that clearly includes the length
1263 * of the sub-object header as well as the length of the
1266 if(subobj_len
< 4 || subobj_len
> total_subobj_len
||
1267 obj_tlen
< subobj_len
)
1270 switch(subobj_type
) {
1271 case RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
:
1272 case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
:
1278 ND_PRINT("%s UNI IPv4 TNA address: %s",
1279 indent
, ipaddr_string(ndo
, obj_tptr
+ 4));
1282 if (subobj_len
< 20)
1284 ND_PRINT("%s UNI IPv6 TNA address: %s",
1285 indent
, ip6addr_string(ndo
, obj_tptr
+ 4));
1289 /* unless we have a TLV parser lets just hexdump */
1296 case RSVP_GEN_UNI_SUBOBJ_DIVERSITY
:
1297 if (subobj_len
> 4) {
1298 /* unless we have a TLV parser lets just hexdump */
1303 case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
:
1304 if (subobj_len
< 16) {
1308 ND_PRINT("%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
1310 ((GET_BE_U_4(obj_tptr
+ 4))>>31),
1311 ((GET_BE_U_4(obj_tptr
+ 4))&0xFF),
1312 GET_BE_U_4(obj_tptr
+ 8),
1313 GET_BE_U_4(obj_tptr
+ 12));
1316 case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
:
1317 if (subobj_len
< 8) {
1321 ND_PRINT("%s Service level: %u",
1322 indent
, (GET_BE_U_4(obj_tptr
+ 4)) >> 24);
1329 total_subobj_len
-=subobj_len
;
1330 obj_tptr
+=subobj_len
;
1331 obj_tlen
+=subobj_len
;
1340 case RSVP_OBJ_RSVP_HOP
:
1341 switch(rsvp_obj_ctype
) {
1342 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1343 case RSVP_CTYPE_IPV4
:
1346 ND_PRINT("%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1348 ipaddr_string(ndo
, obj_tptr
),
1349 GET_BE_U_4(obj_tptr
+ 4));
1353 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1355 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1356 case RSVP_CTYPE_IPV6
:
1359 ND_PRINT("%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1361 ip6addr_string(ndo
, obj_tptr
),
1362 GET_BE_U_4(obj_tptr
+ 16));
1365 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1372 case RSVP_OBJ_TIME_VALUES
:
1373 switch(rsvp_obj_ctype
) {
1377 ND_PRINT("%s Refresh Period: %ums",
1379 GET_BE_U_4(obj_tptr
));
1388 /* those three objects do share the same semantics */
1389 case RSVP_OBJ_SENDER_TSPEC
:
1390 case RSVP_OBJ_ADSPEC
:
1391 case RSVP_OBJ_FLOWSPEC
:
1392 switch(rsvp_obj_ctype
) {
1396 ND_PRINT("%s Msg-Version: %u, length: %u",
1398 (GET_U_1(obj_tptr
) & 0xf0) >> 4,
1399 GET_BE_U_2(obj_tptr
+ 2) << 2);
1400 obj_tptr
+=4; /* get to the start of the service header */
1403 while (obj_tlen
>= 4) {
1404 intserv_serv_tlen
=GET_BE_U_2(obj_tptr
+ 2)<<2;
1405 ND_PRINT("%s Service Type: %s (%u), break bit %sset, Service length: %u",
1407 tok2str(rsvp_intserv_service_type_values
,"unknown",GET_U_1((obj_tptr
))),
1409 (GET_U_1(obj_tptr
+ 1)&0x80) ? "" : "not ",
1412 obj_tptr
+=4; /* get to the start of the parameter list */
1415 while (intserv_serv_tlen
>=4) {
1416 processed
= rsvp_intserv_print(ndo
, obj_tptr
, obj_tlen
);
1419 obj_tlen
-=processed
;
1420 intserv_serv_tlen
-=processed
;
1421 obj_tptr
+=processed
;
1430 case RSVP_OBJ_FILTERSPEC
:
1431 switch(rsvp_obj_ctype
) {
1432 case RSVP_CTYPE_IPV4
:
1435 ND_PRINT("%s Source Address: %s, Source Port: %u",
1437 ipaddr_string(ndo
, obj_tptr
),
1438 GET_BE_U_2(obj_tptr
+ 6));
1442 case RSVP_CTYPE_IPV6
:
1445 ND_PRINT("%s Source Address: %s, Source Port: %u",
1447 ip6addr_string(ndo
, obj_tptr
),
1448 GET_BE_U_2(obj_tptr
+ 18));
1455 ND_PRINT("%s Source Address: %s, Flow Label: %u",
1457 ip6addr_string(ndo
, obj_tptr
),
1458 GET_BE_U_3(obj_tptr
+ 17));
1462 case RSVP_CTYPE_TUNNEL_IPV6
:
1465 ND_PRINT("%s Source Address: %s, LSP-ID: 0x%04x",
1467 ipaddr_string(ndo
, obj_tptr
),
1468 GET_BE_U_2(obj_tptr
+ 18));
1472 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
1475 ND_PRINT("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1476 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1478 ip6addr_string(ndo
, obj_tptr
),
1479 GET_BE_U_2(obj_tptr
+ 18),
1481 ip6addr_string(ndo
, obj_tptr
+20),
1482 GET_BE_U_2(obj_tptr
+ 38));
1486 case RSVP_CTYPE_TUNNEL_IPV4
:
1489 ND_PRINT("%s Source Address: %s, LSP-ID: 0x%04x",
1491 ipaddr_string(ndo
, obj_tptr
),
1492 GET_BE_U_2(obj_tptr
+ 6));
1496 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
1499 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1500 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1502 ipaddr_string(ndo
, obj_tptr
),
1503 GET_BE_U_2(obj_tptr
+ 6),
1505 ipaddr_string(ndo
, obj_tptr
+8),
1506 GET_BE_U_2(obj_tptr
+ 12));
1515 case RSVP_OBJ_FASTREROUTE
:
1516 /* the differences between c-type 1 and 7 are minor */
1517 obj_ptr
.rsvp_obj_frr
= (const struct rsvp_obj_frr_t
*)obj_tptr
;
1519 switch(rsvp_obj_ctype
) {
1520 case RSVP_CTYPE_1
: /* new style */
1521 if (obj_tlen
< sizeof(struct rsvp_obj_frr_t
))
1523 bw
.i
= GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1524 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1526 obj_ptr
.rsvp_obj_frr
->setup_prio
,
1527 obj_ptr
.rsvp_obj_frr
->hold_prio
,
1528 obj_ptr
.rsvp_obj_frr
->hop_limit
,
1529 bw
.f
* 8 / 1000000);
1530 ND_PRINT("%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
1532 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_any
),
1533 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->exclude_any
),
1534 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_all
));
1535 obj_tlen
-=sizeof(struct rsvp_obj_frr_t
);
1536 obj_tptr
+=sizeof(struct rsvp_obj_frr_t
);
1539 case RSVP_CTYPE_TUNNEL_IPV4
: /* old style */
1542 bw
.i
= GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1543 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1545 obj_ptr
.rsvp_obj_frr
->setup_prio
,
1546 obj_ptr
.rsvp_obj_frr
->hold_prio
,
1547 obj_ptr
.rsvp_obj_frr
->hop_limit
,
1548 bw
.f
* 8 / 1000000);
1549 ND_PRINT("%s Include Colors: 0x%08x, Exclude Colors: 0x%08x",
1551 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->include_any
),
1552 GET_BE_U_4(obj_ptr
.rsvp_obj_frr
->exclude_any
));
1562 case RSVP_OBJ_DETOUR
:
1563 switch(rsvp_obj_ctype
) {
1564 case RSVP_CTYPE_TUNNEL_IPV4
:
1565 while(obj_tlen
>= 8) {
1566 ND_PRINT("%s PLR-ID: %s, Avoid-Node-ID: %s",
1568 ipaddr_string(ndo
, obj_tptr
),
1569 ipaddr_string(ndo
, obj_tptr
+ 4));
1579 case RSVP_OBJ_CLASSTYPE
:
1580 case RSVP_OBJ_CLASSTYPE_OLD
: /* fall through */
1581 switch(rsvp_obj_ctype
) {
1583 ND_PRINT("%s CT: %u",
1585 GET_BE_U_4(obj_tptr
) & 0x7);
1594 case RSVP_OBJ_ERROR_SPEC
:
1595 switch(rsvp_obj_ctype
) {
1596 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1597 case RSVP_CTYPE_IPV4
:
1600 error_code
=GET_U_1(obj_tptr
+ 5);
1601 error_value
=GET_BE_U_2(obj_tptr
+ 6);
1602 ND_PRINT("%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1604 ipaddr_string(ndo
, obj_tptr
),
1605 GET_U_1(obj_tptr
+ 4),
1607 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1609 switch (error_code
) {
1610 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1611 ND_PRINT(", Error Value: %s (%u)",
1612 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1615 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
: /* fall through */
1616 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
:
1617 ND_PRINT(", Error Value: %s (%u)",
1618 tok2str(rsvp_obj_error_code_diffserv_te_values
,"unknown",error_value
),
1622 ND_PRINT(", Unknown Error Value (%u)", error_value
);
1628 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1629 case RSVP_CTYPE_IPV6
:
1632 error_code
=GET_U_1(obj_tptr
+ 17);
1633 error_value
=GET_BE_U_2(obj_tptr
+ 18);
1634 ND_PRINT("%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1636 ip6addr_string(ndo
, obj_tptr
),
1637 GET_U_1(obj_tptr
+ 16),
1639 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1642 switch (error_code
) {
1643 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1644 ND_PRINT(", Error Value: %s (%u)",
1645 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1659 case RSVP_OBJ_PROPERTIES
:
1660 switch(rsvp_obj_ctype
) {
1664 padbytes
= GET_BE_U_2(obj_tptr
+ 2);
1665 ND_PRINT("%s TLV count: %u, padding bytes: %u",
1667 GET_BE_U_2(obj_tptr
),
1671 /* loop through as long there is anything longer than the TLV header (2) */
1672 while(obj_tlen
>= 2 + padbytes
) {
1673 ND_PRINT("%s %s TLV (0x%02x), length: %u", /* length includes header */
1675 tok2str(rsvp_obj_prop_tlv_values
,"unknown",GET_U_1(obj_tptr
)),
1677 GET_U_1(obj_tptr
+ 1));
1678 if (obj_tlen
< GET_U_1(obj_tptr
+ 1))
1680 if (GET_U_1(obj_tptr
+ 1) < 2)
1682 print_unknown_data(ndo
, obj_tptr
+ 2, "\n\t\t",
1683 GET_U_1(obj_tptr
+ 1) - 2);
1684 obj_tlen
-=GET_U_1(obj_tptr
+ 1);
1685 obj_tptr
+=GET_U_1(obj_tptr
+ 1);
1693 case RSVP_OBJ_MESSAGE_ID
: /* fall through */
1694 case RSVP_OBJ_MESSAGE_ID_ACK
: /* fall through */
1695 case RSVP_OBJ_MESSAGE_ID_LIST
:
1696 switch(rsvp_obj_ctype
) {
1701 ND_PRINT("%s Flags [0x%02x], epoch: %u",
1704 GET_BE_U_3(obj_tptr
+ 1));
1707 /* loop through as long there are no messages left */
1708 while(obj_tlen
>= 4) {
1709 ND_PRINT("%s Message-ID 0x%08x (%u)",
1711 GET_BE_U_4(obj_tptr
),
1712 GET_BE_U_4(obj_tptr
));
1722 case RSVP_OBJ_INTEGRITY
:
1723 switch(rsvp_obj_ctype
) {
1725 if (obj_tlen
< sizeof(struct rsvp_obj_integrity_t
))
1727 obj_ptr
.rsvp_obj_integrity
= (const struct rsvp_obj_integrity_t
*)obj_tptr
;
1728 ND_PRINT("%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
1730 GET_BE_U_2(obj_ptr
.rsvp_obj_integrity
->key_id
),
1731 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->key_id
+ 2),
1732 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->sequence
),
1733 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->sequence
+ 4),
1734 bittok2str(rsvp_obj_integrity_flag_values
,
1736 obj_ptr
.rsvp_obj_integrity
->flags
));
1737 ND_PRINT("%s MD5-sum 0x%08x%08x%08x%08x ",
1739 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
),
1740 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 4),
1741 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 8),
1742 GET_BE_U_4(obj_ptr
.rsvp_obj_integrity
->digest
+ 12));
1744 sigcheck
= signature_verify(ndo
, pptr
, plen
,
1745 obj_ptr
.rsvp_obj_integrity
->digest
,
1746 rsvp_clear_checksum
,
1748 ND_PRINT(" (%s)", tok2str(signature_check_values
, "Unknown", sigcheck
));
1750 obj_tlen
+=sizeof(struct rsvp_obj_integrity_t
);
1751 obj_tptr
+=sizeof(struct rsvp_obj_integrity_t
);
1758 case RSVP_OBJ_ADMIN_STATUS
:
1759 switch(rsvp_obj_ctype
) {
1763 ND_PRINT("%s Flags [%s]", indent
,
1764 bittok2str(rsvp_obj_admin_status_flag_values
, "none",
1765 GET_BE_U_4(obj_tptr
)));
1774 case RSVP_OBJ_LABEL_SET
:
1775 switch(rsvp_obj_ctype
) {
1779 action
= (GET_BE_U_2(obj_tptr
)>>8);
1781 ND_PRINT("%s Action: %s (%u), Label type: %u", indent
,
1782 tok2str(rsvp_obj_label_set_action_values
, "Unknown", action
),
1783 action
, (GET_BE_U_4(obj_tptr
) & 0x7F));
1786 case LABEL_SET_INCLUSIVE_RANGE
:
1787 case LABEL_SET_EXCLUSIVE_RANGE
: /* fall through */
1789 /* only a couple of subchannels are expected */
1792 ND_PRINT("%s Start range: %u, End range: %u", indent
,
1793 GET_BE_U_4(obj_tptr
+ 4),
1794 GET_BE_U_4(obj_tptr
+ 8));
1803 while(obj_tlen
>= 4 ) {
1804 ND_PRINT("%s Subchannel #%u: %u", indent
, subchannel
,
1805 GET_BE_U_4(obj_tptr
));
1819 switch (rsvp_obj_ctype
) {
1820 case RSVP_CTYPE_IPV4
:
1823 ND_PRINT("%s Sub-LSP destination address: %s",
1824 indent
, ipaddr_string(ndo
, obj_tptr
));
1829 case RSVP_CTYPE_IPV6
:
1832 ND_PRINT("%s Sub-LSP destination address: %s",
1833 indent
, ip6addr_string(ndo
, obj_tptr
));
1844 * FIXME those are the defined objects that lack a decoder
1845 * you are welcome to contribute code ;-)
1848 case RSVP_OBJ_SCOPE
:
1849 case RSVP_OBJ_POLICY_DATA
:
1850 case RSVP_OBJ_ACCEPT_LABEL_SET
:
1851 case RSVP_OBJ_PROTECTION
:
1853 if (ndo
->ndo_vflag
<= 1)
1854 print_unknown_data(ndo
, obj_tptr
, "\n\t ", obj_tlen
); /* FIXME indentation */
1857 /* do we also want to see a hex dump ? */
1858 if (ndo
->ndo_vflag
> 1 || hexdump
== TRUE
)
1859 print_unknown_data(ndo
, tptr
+ sizeof(struct rsvp_object_header
), "\n\t ", /* FIXME indentation */
1860 rsvp_obj_len
- sizeof(struct rsvp_object_header
));
1867 nd_print_invalid(ndo
);
1870 nd_print_trunc(ndo
);
1875 rsvp_print(netdissect_options
*ndo
,
1876 const u_char
*pptr
, u_int len
)
1878 const struct rsvp_common_header
*rsvp_com_header
;
1879 uint8_t version_flags
, msg_type
;
1883 ndo
->ndo_protocol
= "rsvp";
1886 rsvp_com_header
= (const struct rsvp_common_header
*)pptr
;
1887 ND_TCHECK_SIZE(rsvp_com_header
);
1888 version_flags
= GET_U_1(rsvp_com_header
->version_flags
);
1891 * Sanity checking of the header.
1893 if (RSVP_EXTRACT_VERSION(version_flags
) != RSVP_VERSION
) {
1894 ND_PRINT("ERROR: RSVP version %u packet not supported",
1895 RSVP_EXTRACT_VERSION(version_flags
));
1899 msg_type
= GET_U_1(rsvp_com_header
->msg_type
);
1901 /* in non-verbose mode just lets print the basic Message Type*/
1902 if (ndo
->ndo_vflag
< 1) {
1903 ND_PRINT("RSVPv%u %s Message, length: %u",
1904 RSVP_EXTRACT_VERSION(version_flags
),
1905 tok2str(rsvp_msg_type_values
, "unknown (%u)",msg_type
),
1910 /* ok they seem to want to know everything - lets fully decode it */
1912 plen
= tlen
= GET_BE_U_2(rsvp_com_header
->length
);
1914 ND_PRINT("\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1915 RSVP_EXTRACT_VERSION(version_flags
),
1916 tok2str(rsvp_msg_type_values
, "unknown, type: %u",msg_type
),
1918 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(version_flags
)),
1920 GET_U_1(rsvp_com_header
->ttl
),
1921 GET_BE_U_2(rsvp_com_header
->checksum
));
1923 if (tlen
< sizeof(struct rsvp_common_header
)) {
1924 ND_PRINT("ERROR: common header too short %u < %lu", tlen
,
1925 (unsigned long)sizeof(struct rsvp_common_header
));
1929 tptr
+=sizeof(struct rsvp_common_header
);
1930 tlen
-=sizeof(struct rsvp_common_header
);
1934 case RSVP_MSGTYPE_BUNDLE
:
1936 * Process each submessage in the bundle message.
1937 * Bundle messages may not contain bundle submessages, so we don't
1938 * need to handle bundle submessages specially.
1941 const u_char
*subpptr
=tptr
, *subtptr
;
1942 u_short subplen
, subtlen
;
1946 rsvp_com_header
= (const struct rsvp_common_header
*)subpptr
;
1947 ND_TCHECK_SIZE(rsvp_com_header
);
1948 version_flags
= GET_U_1(rsvp_com_header
->version_flags
);
1951 * Sanity checking of the header.
1953 if (RSVP_EXTRACT_VERSION(version_flags
) != RSVP_VERSION
) {
1954 ND_PRINT("ERROR: RSVP version %u packet not supported",
1955 RSVP_EXTRACT_VERSION(version_flags
));
1959 subplen
= subtlen
= GET_BE_U_2(rsvp_com_header
->length
);
1961 msg_type
= GET_U_1(rsvp_com_header
->msg_type
);
1962 ND_PRINT("\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1963 RSVP_EXTRACT_VERSION(version_flags
),
1964 tok2str(rsvp_msg_type_values
, "unknown, type: %u",msg_type
),
1966 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(version_flags
)),
1968 GET_U_1(rsvp_com_header
->ttl
),
1969 GET_BE_U_2(rsvp_com_header
->checksum
));
1971 if (subtlen
< sizeof(struct rsvp_common_header
)) {
1972 ND_PRINT("ERROR: common header too short %u < %lu", subtlen
,
1973 (unsigned long)sizeof(struct rsvp_common_header
));
1977 if (tlen
< subtlen
) {
1978 ND_PRINT("ERROR: common header too large %u > %u", subtlen
,
1983 subtptr
+=sizeof(struct rsvp_common_header
);
1984 subtlen
-=sizeof(struct rsvp_common_header
);
1987 * Print all objects in the submessage.
1989 if (rsvp_obj_print(ndo
, subpptr
, subplen
, subtptr
, "\n\t ", subtlen
, rsvp_com_header
) == -1)
1992 tptr
+=subtlen
+sizeof(struct rsvp_common_header
);
1993 tlen
-=subtlen
+sizeof(struct rsvp_common_header
);
1998 case RSVP_MSGTYPE_PATH
:
1999 case RSVP_MSGTYPE_RESV
:
2000 case RSVP_MSGTYPE_PATHERR
:
2001 case RSVP_MSGTYPE_RESVERR
:
2002 case RSVP_MSGTYPE_PATHTEAR
:
2003 case RSVP_MSGTYPE_RESVTEAR
:
2004 case RSVP_MSGTYPE_RESVCONF
:
2005 case RSVP_MSGTYPE_HELLO_OLD
:
2006 case RSVP_MSGTYPE_HELLO
:
2007 case RSVP_MSGTYPE_ACK
:
2008 case RSVP_MSGTYPE_SREFRESH
:
2010 * Print all objects in the message.
2012 if (rsvp_obj_print(ndo
, pptr
, plen
, tptr
, "\n\t ", tlen
, rsvp_com_header
) == -1)
2017 print_unknown_data(ndo
, tptr
, "\n\t ", tlen
);
2023 nd_print_trunc(ndo
);