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@juniper.net)
22 #include <netdissect-stdinc.h>
24 #include "netdissect.h"
26 #include "addrtoname.h"
27 #include "ethertype.h"
30 #include "signature.h"
32 static const char tstr
[] = " [|rsvp]";
35 * RFC 2205 common header
38 * +-------------+-------------+-------------+-------------+
39 * | Vers | Flags| Msg Type | RSVP Checksum |
40 * +-------------+-------------+-------------+-------------+
41 * | Send_TTL | (Reserved) | RSVP Length |
42 * +-------------+-------------+-------------+-------------+
46 struct rsvp_common_header
{
47 uint8_t version_flags
;
56 * RFC2205 object header
60 * +-------------+-------------+-------------+-------------+
61 * | Length (bytes) | Class-Num | C-Type |
62 * +-------------+-------------+-------------+-------------+
64 * // (Object contents) //
66 * +-------------+-------------+-------------+-------------+
69 struct rsvp_object_header
{
75 #define RSVP_VERSION 1
76 #define RSVP_EXTRACT_VERSION(x) (((x)&0xf0)>>4)
77 #define RSVP_EXTRACT_FLAGS(x) ((x)&0x0f)
79 #define RSVP_MSGTYPE_PATH 1
80 #define RSVP_MSGTYPE_RESV 2
81 #define RSVP_MSGTYPE_PATHERR 3
82 #define RSVP_MSGTYPE_RESVERR 4
83 #define RSVP_MSGTYPE_PATHTEAR 5
84 #define RSVP_MSGTYPE_RESVTEAR 6
85 #define RSVP_MSGTYPE_RESVCONF 7
86 #define RSVP_MSGTYPE_BUNDLE 12
87 #define RSVP_MSGTYPE_ACK 13
88 #define RSVP_MSGTYPE_HELLO_OLD 14 /* ancient Hellos */
89 #define RSVP_MSGTYPE_SREFRESH 15
90 #define RSVP_MSGTYPE_HELLO 20
92 static const struct tok rsvp_msg_type_values
[] = {
93 { RSVP_MSGTYPE_PATH
, "Path" },
94 { RSVP_MSGTYPE_RESV
, "Resv" },
95 { RSVP_MSGTYPE_PATHERR
, "PathErr" },
96 { RSVP_MSGTYPE_RESVERR
, "ResvErr" },
97 { RSVP_MSGTYPE_PATHTEAR
, "PathTear" },
98 { RSVP_MSGTYPE_RESVTEAR
, "ResvTear" },
99 { RSVP_MSGTYPE_RESVCONF
, "ResvConf" },
100 { RSVP_MSGTYPE_BUNDLE
, "Bundle" },
101 { RSVP_MSGTYPE_ACK
, "Acknowledgement" },
102 { RSVP_MSGTYPE_HELLO_OLD
, "Hello (Old)" },
103 { RSVP_MSGTYPE_SREFRESH
, "Refresh" },
104 { RSVP_MSGTYPE_HELLO
, "Hello" },
108 static const struct tok rsvp_header_flag_values
[] = {
109 { 0x01, "Refresh reduction capable" }, /* rfc2961 */
113 #define RSVP_OBJ_SESSION 1 /* rfc2205 */
114 #define RSVP_OBJ_RSVP_HOP 3 /* rfc2205, rfc3473 */
115 #define RSVP_OBJ_INTEGRITY 4 /* rfc2747 */
116 #define RSVP_OBJ_TIME_VALUES 5 /* rfc2205 */
117 #define RSVP_OBJ_ERROR_SPEC 6
118 #define RSVP_OBJ_SCOPE 7
119 #define RSVP_OBJ_STYLE 8 /* rfc2205 */
120 #define RSVP_OBJ_FLOWSPEC 9 /* rfc2215 */
121 #define RSVP_OBJ_FILTERSPEC 10 /* rfc2215 */
122 #define RSVP_OBJ_SENDER_TEMPLATE 11
123 #define RSVP_OBJ_SENDER_TSPEC 12 /* rfc2215 */
124 #define RSVP_OBJ_ADSPEC 13 /* rfc2215 */
125 #define RSVP_OBJ_POLICY_DATA 14
126 #define RSVP_OBJ_CONFIRM 15 /* rfc2205 */
127 #define RSVP_OBJ_LABEL 16 /* rfc3209 */
128 #define RSVP_OBJ_LABEL_REQ 19 /* rfc3209 */
129 #define RSVP_OBJ_ERO 20 /* rfc3209 */
130 #define RSVP_OBJ_RRO 21 /* rfc3209 */
131 #define RSVP_OBJ_HELLO 22 /* rfc3209 */
132 #define RSVP_OBJ_MESSAGE_ID 23 /* rfc2961 */
133 #define RSVP_OBJ_MESSAGE_ID_ACK 24 /* rfc2961 */
134 #define RSVP_OBJ_MESSAGE_ID_LIST 25 /* rfc2961 */
135 #define RSVP_OBJ_RECOVERY_LABEL 34 /* rfc3473 */
136 #define RSVP_OBJ_UPSTREAM_LABEL 35 /* rfc3473 */
137 #define RSVP_OBJ_LABEL_SET 36 /* rfc3473 */
138 #define RSVP_OBJ_PROTECTION 37 /* rfc3473 */
139 #define RSVP_OBJ_S2L 50 /* rfc4875 */
140 #define RSVP_OBJ_DETOUR 63 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07 */
141 #define RSVP_OBJ_CLASSTYPE 66 /* rfc4124 */
142 #define RSVP_OBJ_CLASSTYPE_OLD 125 /* draft-ietf-tewg-diff-te-proto-07 */
143 #define RSVP_OBJ_SUGGESTED_LABEL 129 /* rfc3473 */
144 #define RSVP_OBJ_ACCEPT_LABEL_SET 130 /* rfc3473 */
145 #define RSVP_OBJ_RESTART_CAPABILITY 131 /* rfc3473 */
146 #define RSVP_OBJ_NOTIFY_REQ 195 /* rfc3473 */
147 #define RSVP_OBJ_ADMIN_STATUS 196 /* rfc3473 */
148 #define RSVP_OBJ_PROPERTIES 204 /* juniper proprietary */
149 #define RSVP_OBJ_FASTREROUTE 205 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07 */
150 #define RSVP_OBJ_SESSION_ATTRIBUTE 207 /* rfc3209 */
151 #define RSVP_OBJ_GENERALIZED_UNI 229 /* OIF RSVP extensions UNI 1.0 Signaling, Rel. 2 */
152 #define RSVP_OBJ_CALL_ID 230 /* rfc3474 */
153 #define RSVP_OBJ_CALL_OPS 236 /* rfc3474 */
155 static const struct tok rsvp_obj_values
[] = {
156 { RSVP_OBJ_SESSION
, "Session" },
157 { RSVP_OBJ_RSVP_HOP
, "RSVP Hop" },
158 { RSVP_OBJ_INTEGRITY
, "Integrity" },
159 { RSVP_OBJ_TIME_VALUES
, "Time Values" },
160 { RSVP_OBJ_ERROR_SPEC
, "Error Spec" },
161 { RSVP_OBJ_SCOPE
, "Scope" },
162 { RSVP_OBJ_STYLE
, "Style" },
163 { RSVP_OBJ_FLOWSPEC
, "Flowspec" },
164 { RSVP_OBJ_FILTERSPEC
, "FilterSpec" },
165 { RSVP_OBJ_SENDER_TEMPLATE
, "Sender Template" },
166 { RSVP_OBJ_SENDER_TSPEC
, "Sender TSpec" },
167 { RSVP_OBJ_ADSPEC
, "Adspec" },
168 { RSVP_OBJ_POLICY_DATA
, "Policy Data" },
169 { RSVP_OBJ_CONFIRM
, "Confirm" },
170 { RSVP_OBJ_LABEL
, "Label" },
171 { RSVP_OBJ_LABEL_REQ
, "Label Request" },
172 { RSVP_OBJ_ERO
, "ERO" },
173 { RSVP_OBJ_RRO
, "RRO" },
174 { RSVP_OBJ_HELLO
, "Hello" },
175 { RSVP_OBJ_MESSAGE_ID
, "Message ID" },
176 { RSVP_OBJ_MESSAGE_ID_ACK
, "Message ID Ack" },
177 { RSVP_OBJ_MESSAGE_ID_LIST
, "Message ID List" },
178 { RSVP_OBJ_RECOVERY_LABEL
, "Recovery Label" },
179 { RSVP_OBJ_UPSTREAM_LABEL
, "Upstream Label" },
180 { RSVP_OBJ_LABEL_SET
, "Label Set" },
181 { RSVP_OBJ_ACCEPT_LABEL_SET
, "Acceptable Label Set" },
182 { RSVP_OBJ_DETOUR
, "Detour" },
183 { RSVP_OBJ_CLASSTYPE
, "Class Type" },
184 { RSVP_OBJ_CLASSTYPE_OLD
, "Class Type (old)" },
185 { RSVP_OBJ_SUGGESTED_LABEL
, "Suggested Label" },
186 { RSVP_OBJ_PROPERTIES
, "Properties" },
187 { RSVP_OBJ_FASTREROUTE
, "Fast Re-Route" },
188 { RSVP_OBJ_SESSION_ATTRIBUTE
, "Session Attribute" },
189 { RSVP_OBJ_GENERALIZED_UNI
, "Generalized UNI" },
190 { RSVP_OBJ_CALL_ID
, "Call-ID" },
191 { RSVP_OBJ_CALL_OPS
, "Call Capability" },
192 { RSVP_OBJ_RESTART_CAPABILITY
, "Restart Capability" },
193 { RSVP_OBJ_NOTIFY_REQ
, "Notify Request" },
194 { RSVP_OBJ_PROTECTION
, "Protection" },
195 { RSVP_OBJ_ADMIN_STATUS
, "Administrative Status" },
196 { RSVP_OBJ_S2L
, "Sub-LSP to LSP" },
200 #define RSVP_CTYPE_IPV4 1
201 #define RSVP_CTYPE_IPV6 2
202 #define RSVP_CTYPE_TUNNEL_IPV4 7
203 #define RSVP_CTYPE_TUNNEL_IPV6 8
204 #define RSVP_CTYPE_UNI_IPV4 11 /* OIF RSVP extensions UNI 1.0 Signaling Rel. 2 */
205 #define RSVP_CTYPE_1 1
206 #define RSVP_CTYPE_2 2
207 #define RSVP_CTYPE_3 3
208 #define RSVP_CTYPE_4 4
209 #define RSVP_CTYPE_12 12
210 #define RSVP_CTYPE_13 13
211 #define RSVP_CTYPE_14 14
214 * the ctypes are not globally unique so for
215 * translating it to strings we build a table based
216 * on objects offsetted by the ctype
219 static const struct tok rsvp_ctype_values
[] = {
220 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV4
, "IPv4" },
221 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV6
, "IPv6" },
222 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
223 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
224 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV4
, "IPv4" },
225 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV6
, "IPv6" },
226 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV4
, "IPv4" },
227 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV6
, "IPv6" },
228 { 256*RSVP_OBJ_TIME_VALUES
+RSVP_CTYPE_1
, "1" },
229 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_1
, "obsolete" },
230 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_2
, "IntServ" },
231 { 256*RSVP_OBJ_SENDER_TSPEC
+RSVP_CTYPE_2
, "IntServ" },
232 { 256*RSVP_OBJ_ADSPEC
+RSVP_CTYPE_2
, "IntServ" },
233 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
234 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
235 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_3
, "IPv6 Flow-label" },
236 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
237 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
238 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
239 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV4
, "IPv4" },
240 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV6
, "IPv6" },
241 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
242 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_UNI_IPV4
, "UNI IPv4" },
243 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_13
, "IPv4 P2MP LSP Tunnel" },
244 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_14
, "IPv6 P2MP LSP Tunnel" },
245 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV4
, "IPv4" },
246 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV6
, "IPv6" },
247 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
248 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
249 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
250 { 256*RSVP_OBJ_MESSAGE_ID
+RSVP_CTYPE_1
, "1" },
251 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_1
, "Message id ack" },
252 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_2
, "Message id nack" },
253 { 256*RSVP_OBJ_MESSAGE_ID_LIST
+RSVP_CTYPE_1
, "1" },
254 { 256*RSVP_OBJ_STYLE
+RSVP_CTYPE_1
, "1" },
255 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_1
, "Hello Request" },
256 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_2
, "Hello Ack" },
257 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_1
, "without label range" },
258 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_2
, "with ATM label range" },
259 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_3
, "with FR label range" },
260 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_4
, "Generalized Label" },
261 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_1
, "Label" },
262 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
263 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
264 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_1
, "Label" },
265 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
266 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
267 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_1
, "Label" },
268 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
269 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
270 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_1
, "Label" },
271 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
272 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
273 { 256*RSVP_OBJ_ERO
+RSVP_CTYPE_IPV4
, "IPv4" },
274 { 256*RSVP_OBJ_RRO
+RSVP_CTYPE_IPV4
, "IPv4" },
275 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
276 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
277 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
278 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
279 { 256*RSVP_OBJ_RESTART_CAPABILITY
+RSVP_CTYPE_1
, "IPv4" },
280 { 256*RSVP_OBJ_SESSION_ATTRIBUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
281 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" }, /* old style*/
282 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_1
, "1" }, /* new style */
283 { 256*RSVP_OBJ_DETOUR
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
284 { 256*RSVP_OBJ_PROPERTIES
+RSVP_CTYPE_1
, "1" },
285 { 256*RSVP_OBJ_ADMIN_STATUS
+RSVP_CTYPE_1
, "1" },
286 { 256*RSVP_OBJ_CLASSTYPE
+RSVP_CTYPE_1
, "1" },
287 { 256*RSVP_OBJ_CLASSTYPE_OLD
+RSVP_CTYPE_1
, "1" },
288 { 256*RSVP_OBJ_LABEL_SET
+RSVP_CTYPE_1
, "1" },
289 { 256*RSVP_OBJ_GENERALIZED_UNI
+RSVP_CTYPE_1
, "1" },
290 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV4
, "IPv4 sub-LSP" },
291 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV6
, "IPv6 sub-LSP" },
295 struct rsvp_obj_integrity_t
{
303 static const struct tok rsvp_obj_integrity_flag_values
[] = {
304 { 0x80, "Handshake" },
308 struct rsvp_obj_frr_t
{
313 uint8_t bandwidth
[4];
314 uint8_t include_any
[4];
315 uint8_t exclude_any
[4];
316 uint8_t include_all
[4];
320 #define RSVP_OBJ_XRO_MASK_SUBOBJ(x) ((x)&0x7f)
321 #define RSVP_OBJ_XRO_MASK_LOOSE(x) ((x)&0x80)
323 #define RSVP_OBJ_XRO_RES 0
324 #define RSVP_OBJ_XRO_IPV4 1
325 #define RSVP_OBJ_XRO_IPV6 2
326 #define RSVP_OBJ_XRO_LABEL 3
327 #define RSVP_OBJ_XRO_ASN 32
328 #define RSVP_OBJ_XRO_MPLS 64
330 static const struct tok rsvp_obj_xro_values
[] = {
331 { RSVP_OBJ_XRO_RES
, "Reserved" },
332 { RSVP_OBJ_XRO_IPV4
, "IPv4 prefix" },
333 { RSVP_OBJ_XRO_IPV6
, "IPv6 prefix" },
334 { RSVP_OBJ_XRO_LABEL
, "Label" },
335 { RSVP_OBJ_XRO_ASN
, "Autonomous system number" },
336 { RSVP_OBJ_XRO_MPLS
, "MPLS label switched path termination" },
340 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07.txt */
341 static const struct tok rsvp_obj_rro_flag_values
[] = {
342 { 0x01, "Local protection available" },
343 { 0x02, "Local protection in use" },
344 { 0x04, "Bandwidth protection" },
345 { 0x08, "Node protection" },
350 static const struct tok rsvp_obj_rro_label_flag_values
[] = {
355 static const struct tok rsvp_resstyle_values
[] = {
356 { 17, "Wildcard Filter" },
357 { 10, "Fixed Filter" },
358 { 18, "Shared Explicit" },
362 #define RSVP_OBJ_INTSERV_GUARANTEED_SERV 2
363 #define RSVP_OBJ_INTSERV_CONTROLLED_LOAD 5
365 static const struct tok rsvp_intserv_service_type_values
[] = {
366 { 1, "Default/Global Information" },
367 { RSVP_OBJ_INTSERV_GUARANTEED_SERV
, "Guaranteed Service" },
368 { RSVP_OBJ_INTSERV_CONTROLLED_LOAD
, "Controlled Load" },
372 static const struct tok rsvp_intserv_parameter_id_values
[] = {
374 { 6, "Path b/w estimate" },
375 { 8, "Minimum path latency" },
376 { 10, "Composed MTU" },
377 { 127, "Token Bucket TSpec" },
378 { 130, "Guaranteed Service RSpec" },
379 { 133, "End-to-end composed value for C" },
380 { 134, "End-to-end composed value for D" },
381 { 135, "Since-last-reshaping point composed C" },
382 { 136, "Since-last-reshaping point composed D" },
386 static const struct tok rsvp_session_attribute_flag_values
[] = {
387 { 0x01, "Local Protection" },
388 { 0x02, "Label Recording" },
389 { 0x04, "SE Style" },
390 { 0x08, "Bandwidth protection" }, /* RFC4090 */
391 { 0x10, "Node protection" }, /* RFC4090 */
395 static const struct tok rsvp_obj_prop_tlv_values
[] = {
397 { 0x02, "Metric 1" },
398 { 0x04, "Metric 2" },
399 { 0x08, "CCC Status" },
400 { 0x10, "Path Type" },
404 #define RSVP_OBJ_ERROR_SPEC_CODE_ROUTING 24
405 #define RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY 25
406 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE 28
407 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD 125
409 static const struct tok rsvp_obj_error_code_values
[] = {
410 { RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
, "Routing Problem" },
411 { RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY
, "Notify Error" },
412 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
, "Diffserv TE Error" },
413 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
, "Diffserv TE Error (Old)" },
417 static const struct tok rsvp_obj_error_code_routing_values
[] = {
418 { 1, "Bad EXPLICIT_ROUTE object" },
419 { 2, "Bad strict node" },
420 { 3, "Bad loose node" },
421 { 4, "Bad initial subobject" },
422 { 5, "No route available toward destination" },
423 { 6, "Unacceptable label value" },
424 { 7, "RRO indicated routing loops" },
425 { 8, "non-RSVP-capable router in the path" },
426 { 9, "MPLS label allocation failure" },
427 { 10, "Unsupported L3PID" },
431 static const struct tok rsvp_obj_error_code_diffserv_te_values
[] = {
432 { 1, "Unexpected CT object" },
433 { 2, "Unsupported CT" },
434 { 3, "Invalid CT value" },
435 { 4, "CT/setup priority do not form a configured TE-Class" },
436 { 5, "CT/holding priority do not form a configured TE-Class" },
437 { 6, "CT/setup priority and CT/holding priority do not form a configured TE-Class" },
438 { 7, "Inconsistency between signaled PSC and signaled CT" },
439 { 8, "Inconsistency between signaled PHBs and signaled CT" },
443 /* rfc3473 / rfc 3471 */
444 static const struct tok rsvp_obj_admin_status_flag_values
[] = {
445 { 0x80000000, "Reflect" },
446 { 0x00000004, "Testing" },
447 { 0x00000002, "Admin-down" },
448 { 0x00000001, "Delete-in-progress" },
452 /* label set actions - rfc3471 */
453 #define LABEL_SET_INCLUSIVE_LIST 0
454 #define LABEL_SET_EXCLUSIVE_LIST 1
455 #define LABEL_SET_INCLUSIVE_RANGE 2
456 #define LABEL_SET_EXCLUSIVE_RANGE 3
458 static const struct tok rsvp_obj_label_set_action_values
[] = {
459 { LABEL_SET_INCLUSIVE_LIST
, "Inclusive list" },
460 { LABEL_SET_EXCLUSIVE_LIST
, "Exclusive list" },
461 { LABEL_SET_INCLUSIVE_RANGE
, "Inclusive range" },
462 { LABEL_SET_EXCLUSIVE_RANGE
, "Exclusive range" },
466 /* OIF RSVP extensions UNI 1.0 Signaling, release 2 */
467 #define RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS 1
468 #define RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS 2
469 #define RSVP_GEN_UNI_SUBOBJ_DIVERSITY 3
470 #define RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL 4
471 #define RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL 5
473 static const struct tok rsvp_obj_generalized_uni_values
[] = {
474 { RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
, "Source TNA address" },
475 { RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
, "Destination TNA address" },
476 { RSVP_GEN_UNI_SUBOBJ_DIVERSITY
, "Diversity" },
477 { RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
, "Egress label" },
478 { RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
, "Service level" },
483 * this is a dissector for all the intserv defined
484 * specs as defined per rfc2215
485 * it is called from various rsvp objects;
486 * returns the amount of bytes being processed
489 rsvp_intserv_print(netdissect_options
*ndo
,
490 const u_char
*tptr
, u_short obj_tlen
)
492 int parameter_id
,parameter_length
;
500 parameter_id
= *(tptr
);
501 ND_TCHECK2(*(tptr
+ 2), 2);
502 parameter_length
= EXTRACT_16BITS(tptr
+2)<<2; /* convert wordcount to bytecount */
504 ND_PRINT((ndo
, "\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
505 tok2str(rsvp_intserv_parameter_id_values
,"unknown",parameter_id
),
510 if (obj_tlen
< parameter_length
+4)
512 switch(parameter_id
) { /* parameter_id */
516 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
517 * | 4 (e) | (f) | 1 (g) |
518 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
519 * | IS hop cnt (32-bit unsigned integer) |
520 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
522 if (parameter_length
== 4)
523 ND_TCHECK2(*(tptr
+ 4), 4);
524 ND_PRINT((ndo
, "\n\t\tIS hop count: %u", EXTRACT_32BITS(tptr
+ 4)));
529 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
530 * | 6 (h) | (i) | 1 (j) |
531 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
532 * | Path b/w estimate (32-bit IEEE floating point number) |
533 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
535 if (parameter_length
== 4) {
536 ND_TCHECK2(*(tptr
+ 4), 4);
537 bw
.i
= EXTRACT_32BITS(tptr
+4);
538 ND_PRINT((ndo
, "\n\t\tPath b/w estimate: %.10g Mbps", bw
.f
/ 125000));
544 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
545 * | 8 (k) | (l) | 1 (m) |
546 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
547 * | Minimum path latency (32-bit integer) |
548 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
550 if (parameter_length
== 4) {
551 ND_TCHECK2(*(tptr
+ 4), 4);
552 ND_PRINT((ndo
, "\n\t\tMinimum path latency: "));
553 if (EXTRACT_32BITS(tptr
+4) == 0xffffffff)
554 ND_PRINT((ndo
, "don't care"));
556 ND_PRINT((ndo
, "%u", EXTRACT_32BITS(tptr
+ 4)));
563 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
564 * | 10 (n) | (o) | 1 (p) |
565 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
566 * | Composed MTU (32-bit unsigned integer) |
567 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
569 if (parameter_length
== 4)
570 ND_TCHECK2(*(tptr
+ 4), 4);
571 ND_PRINT((ndo
, "\n\t\tComposed MTU: %u bytes", EXTRACT_32BITS(tptr
+ 4)));
575 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
576 * | 127 (e) | 0 (f) | 5 (g) |
577 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
578 * | Token Bucket Rate [r] (32-bit IEEE floating point number) |
579 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
580 * | Token Bucket Size [b] (32-bit IEEE floating point number) |
581 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
582 * | Peak Data Rate [p] (32-bit IEEE floating point number) |
583 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
584 * | Minimum Policed Unit [m] (32-bit integer) |
585 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
586 * | Maximum Packet Size [M] (32-bit integer) |
587 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
590 if (parameter_length
== 20) {
591 ND_TCHECK2(*(tptr
+ 4), 20);
592 bw
.i
= EXTRACT_32BITS(tptr
+4);
593 ND_PRINT((ndo
, "\n\t\tToken Bucket Rate: %.10g Mbps", bw
.f
/ 125000));
594 bw
.i
= EXTRACT_32BITS(tptr
+8);
595 ND_PRINT((ndo
, "\n\t\tToken Bucket Size: %.10g bytes", bw
.f
));
596 bw
.i
= EXTRACT_32BITS(tptr
+12);
597 ND_PRINT((ndo
, "\n\t\tPeak Data Rate: %.10g Mbps", bw
.f
/ 125000));
598 ND_PRINT((ndo
, "\n\t\tMinimum Policed Unit: %u bytes", EXTRACT_32BITS(tptr
+ 16)));
599 ND_PRINT((ndo
, "\n\t\tMaximum Packet Size: %u bytes", EXTRACT_32BITS(tptr
+ 20)));
605 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
606 * | 130 (h) | 0 (i) | 2 (j) |
607 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
608 * | Rate [R] (32-bit IEEE floating point number) |
609 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
610 * | Slack Term [S] (32-bit integer) |
611 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
614 if (parameter_length
== 8) {
615 ND_TCHECK2(*(tptr
+ 4), 8);
616 bw
.i
= EXTRACT_32BITS(tptr
+4);
617 ND_PRINT((ndo
, "\n\t\tRate: %.10g Mbps", bw
.f
/ 125000));
618 ND_PRINT((ndo
, "\n\t\tSlack Term: %u", EXTRACT_32BITS(tptr
+ 8)));
626 if (parameter_length
== 4)
627 ND_TCHECK2(*(tptr
+ 4), 4);
628 ND_PRINT((ndo
, "\n\t\tValue: %u", EXTRACT_32BITS(tptr
+ 4)));
632 if (ndo
->ndo_vflag
<= 1)
633 print_unknown_data(ndo
, tptr
+ 4, "\n\t\t", parameter_length
);
635 return (parameter_length
+4); /* header length 4 bytes */
638 ND_PRINT((ndo
, "%s", tstr
));
643 * Clear checksum prior to signature verification.
646 rsvp_clear_checksum(void *header
)
648 struct rsvp_common_header
*rsvp_com_header
= (struct rsvp_common_header
*) header
;
650 rsvp_com_header
->checksum
[0] = 0;
651 rsvp_com_header
->checksum
[1] = 0;
655 rsvp_obj_print(netdissect_options
*ndo
,
656 const u_char
*pptr
, u_int plen
, const u_char
*tptr
,
657 const char *ident
, u_int tlen
,
658 const struct rsvp_common_header
*rsvp_com_header
)
660 const struct rsvp_object_header
*rsvp_obj_header
;
661 const u_char
*obj_tptr
;
663 const struct rsvp_obj_integrity_t
*rsvp_obj_integrity
;
664 const struct rsvp_obj_frr_t
*rsvp_obj_frr
;
667 u_short rsvp_obj_len
,rsvp_obj_ctype
,obj_tlen
,intserv_serv_tlen
;
668 int hexdump
,processed
,padbytes
,error_code
,error_value
,i
,sigcheck
;
675 u_int action
, subchannel
;
677 while(tlen
>=sizeof(struct rsvp_object_header
)) {
678 /* did we capture enough for fully decoding the object header ? */
679 ND_TCHECK2(*tptr
, sizeof(struct rsvp_object_header
));
681 rsvp_obj_header
= (const struct rsvp_object_header
*)tptr
;
682 rsvp_obj_len
=EXTRACT_16BITS(rsvp_obj_header
->length
);
683 rsvp_obj_ctype
=rsvp_obj_header
->ctype
;
685 if(rsvp_obj_len
% 4) {
686 ND_PRINT((ndo
, "%sERROR: object header size %u not a multiple of 4", ident
, rsvp_obj_len
));
689 if(rsvp_obj_len
< sizeof(struct rsvp_object_header
)) {
690 ND_PRINT((ndo
, "%sERROR: object header too short %u < %lu", ident
, rsvp_obj_len
,
691 (unsigned long)sizeof(const struct rsvp_object_header
)));
695 ND_PRINT((ndo
, "%s%s Object (%u) Flags: [%s",
697 tok2str(rsvp_obj_values
,
699 rsvp_obj_header
->class_num
),
700 rsvp_obj_header
->class_num
,
701 ((rsvp_obj_header
->class_num
) & 0x80) ? "ignore" : "reject"));
703 if (rsvp_obj_header
->class_num
> 128)
704 ND_PRINT((ndo
, " %s",
705 ((rsvp_obj_header
->class_num
) & 0x40) ? "and forward" : "silently"));
707 ND_PRINT((ndo
, " if unknown], Class-Type: %s (%u), length: %u",
708 tok2str(rsvp_ctype_values
,
710 ((rsvp_obj_header
->class_num
)<<8)+rsvp_obj_ctype
),
714 if(tlen
< rsvp_obj_len
) {
715 ND_PRINT((ndo
, "%sERROR: object goes past end of objects TLV", ident
));
719 obj_tptr
=tptr
+sizeof(struct rsvp_object_header
);
720 obj_tlen
=rsvp_obj_len
-sizeof(struct rsvp_object_header
);
722 /* did we capture enough for fully decoding the object ? */
723 if (!ND_TTEST2(*tptr
, rsvp_obj_len
))
727 switch(rsvp_obj_header
->class_num
) {
728 case RSVP_OBJ_SESSION
:
729 switch(rsvp_obj_ctype
) {
730 case RSVP_CTYPE_IPV4
:
733 ND_PRINT((ndo
, "%s IPv4 DestAddress: %s, Protocol ID: 0x%02x",
735 ipaddr_string(ndo
, obj_tptr
),
736 *(obj_tptr
+ sizeof(struct in_addr
))));
737 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
740 EXTRACT_16BITS(obj_tptr
+ 6)));
744 case RSVP_CTYPE_IPV6
:
747 ND_PRINT((ndo
, "%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
749 ip6addr_string(ndo
, obj_tptr
),
750 *(obj_tptr
+ sizeof(struct in6_addr
))));
751 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
753 *(obj_tptr
+sizeof(struct in6_addr
)+1),
754 EXTRACT_16BITS(obj_tptr
+ sizeof(struct in6_addr
) + 2)));
759 case RSVP_CTYPE_TUNNEL_IPV6
:
762 ND_PRINT((ndo
, "%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
764 ip6addr_string(ndo
, obj_tptr
),
765 EXTRACT_16BITS(obj_tptr
+18),
766 ip6addr_string(ndo
, obj_tptr
+ 20)));
771 case RSVP_CTYPE_14
: /* IPv6 p2mp LSP Tunnel */
774 ND_PRINT((ndo
, "%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
776 EXTRACT_32BITS(obj_tptr
),
777 EXTRACT_16BITS(obj_tptr
+6),
778 ip6addr_string(ndo
, obj_tptr
+ 8)));
782 case RSVP_CTYPE_13
: /* IPv4 p2mp LSP Tunnel */
785 ND_PRINT((ndo
, "%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
787 ipaddr_string(ndo
, obj_tptr
),
788 EXTRACT_16BITS(obj_tptr
+6),
789 ipaddr_string(ndo
, obj_tptr
+ 8)));
793 case RSVP_CTYPE_TUNNEL_IPV4
:
794 case RSVP_CTYPE_UNI_IPV4
:
797 ND_PRINT((ndo
, "%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
799 ipaddr_string(ndo
, obj_tptr
),
800 EXTRACT_16BITS(obj_tptr
+6),
801 ipaddr_string(ndo
, obj_tptr
+ 8)));
810 case RSVP_OBJ_CONFIRM
:
811 switch(rsvp_obj_ctype
) {
812 case RSVP_CTYPE_IPV4
:
813 if (obj_tlen
< sizeof(struct in_addr
))
815 ND_PRINT((ndo
, "%s IPv4 Receiver Address: %s",
817 ipaddr_string(ndo
, obj_tptr
)));
818 obj_tlen
-=sizeof(struct in_addr
);
819 obj_tptr
+=sizeof(struct in_addr
);
821 case RSVP_CTYPE_IPV6
:
822 if (obj_tlen
< sizeof(struct in6_addr
))
824 ND_PRINT((ndo
, "%s IPv6 Receiver Address: %s",
826 ip6addr_string(ndo
, obj_tptr
)));
827 obj_tlen
-=sizeof(struct in6_addr
);
828 obj_tptr
+=sizeof(struct in6_addr
);
835 case RSVP_OBJ_NOTIFY_REQ
:
836 switch(rsvp_obj_ctype
) {
837 case RSVP_CTYPE_IPV4
:
838 if (obj_tlen
< sizeof(struct in_addr
))
840 ND_PRINT((ndo
, "%s IPv4 Notify Node Address: %s",
842 ipaddr_string(ndo
, obj_tptr
)));
843 obj_tlen
-=sizeof(struct in_addr
);
844 obj_tptr
+=sizeof(struct in_addr
);
846 case RSVP_CTYPE_IPV6
:
847 if (obj_tlen
< sizeof(struct in6_addr
))
849 ND_PRINT((ndo
, "%s IPv6 Notify Node Address: %s",
851 ip6addr_string(ndo
, obj_tptr
)));
852 obj_tlen
-=sizeof(struct in6_addr
);
853 obj_tptr
+=sizeof(struct in6_addr
);
860 case RSVP_OBJ_SUGGESTED_LABEL
: /* fall through */
861 case RSVP_OBJ_UPSTREAM_LABEL
: /* fall through */
862 case RSVP_OBJ_RECOVERY_LABEL
: /* fall through */
864 switch(rsvp_obj_ctype
) {
866 while(obj_tlen
>= 4 ) {
867 ND_PRINT((ndo
, "%s Label: %u", ident
, EXTRACT_32BITS(obj_tptr
)));
875 ND_PRINT((ndo
, "%s Generalized Label: %u",
877 EXTRACT_32BITS(obj_tptr
)));
884 ND_PRINT((ndo
, "%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
886 EXTRACT_32BITS(obj_tptr
),
888 EXTRACT_32BITS(obj_tptr
+4),
889 EXTRACT_32BITS(obj_tptr
+ 8)));
899 switch(rsvp_obj_ctype
) {
903 ND_PRINT((ndo
, "%s Reservation Style: %s, Flags: [0x%02x]",
905 tok2str(rsvp_resstyle_values
,
907 EXTRACT_24BITS(obj_tptr
+1)),
917 case RSVP_OBJ_SENDER_TEMPLATE
:
918 switch(rsvp_obj_ctype
) {
919 case RSVP_CTYPE_IPV4
:
922 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
924 ipaddr_string(ndo
, obj_tptr
),
925 EXTRACT_16BITS(obj_tptr
+ 6)));
929 case RSVP_CTYPE_IPV6
:
932 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
934 ip6addr_string(ndo
, obj_tptr
),
935 EXTRACT_16BITS(obj_tptr
+ 18)));
939 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
942 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
943 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
945 ip6addr_string(ndo
, obj_tptr
),
946 EXTRACT_16BITS(obj_tptr
+18),
948 ip6addr_string(ndo
, obj_tptr
+20),
949 EXTRACT_16BITS(obj_tptr
+ 38)));
953 case RSVP_CTYPE_TUNNEL_IPV4
:
956 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
958 ipaddr_string(ndo
, obj_tptr
),
959 EXTRACT_16BITS(obj_tptr
+ 6)));
963 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
966 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
967 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
969 ipaddr_string(ndo
, obj_tptr
),
970 EXTRACT_16BITS(obj_tptr
+6),
972 ipaddr_string(ndo
, obj_tptr
+8),
973 EXTRACT_16BITS(obj_tptr
+ 12)));
982 case RSVP_OBJ_LABEL_REQ
:
983 switch(rsvp_obj_ctype
) {
985 while(obj_tlen
>= 4 ) {
986 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
988 tok2str(ethertype_values
,
989 "Unknown Protocol (0x%04x)",
990 EXTRACT_16BITS(obj_tptr
+ 2))));
998 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
1000 tok2str(ethertype_values
,
1001 "Unknown Protocol (0x%04x)",
1002 EXTRACT_16BITS(obj_tptr
+ 2))));
1003 ND_PRINT((ndo
, ",%s merge capability",((*(obj_tptr
+ 4)) & 0x80) ? "no" : "" ));
1004 ND_PRINT((ndo
, "%s Minimum VPI/VCI: %u/%u",
1006 (EXTRACT_16BITS(obj_tptr
+4))&0xfff,
1007 (EXTRACT_16BITS(obj_tptr
+ 6)) & 0xfff));
1008 ND_PRINT((ndo
, "%s Maximum VPI/VCI: %u/%u",
1010 (EXTRACT_16BITS(obj_tptr
+8))&0xfff,
1011 (EXTRACT_16BITS(obj_tptr
+ 10)) & 0xfff));
1018 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
1020 tok2str(ethertype_values
,
1021 "Unknown Protocol (0x%04x)",
1022 EXTRACT_16BITS(obj_tptr
+ 2))));
1023 ND_PRINT((ndo
, "%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1025 (EXTRACT_32BITS(obj_tptr
+4))&0x7fffff,
1026 (EXTRACT_32BITS(obj_tptr
+8))&0x7fffff,
1027 (((EXTRACT_16BITS(obj_tptr
+4)>>7)&3) == 0 ) ? "10" : "",
1028 (((EXTRACT_16BITS(obj_tptr
+ 4) >> 7) & 3) == 2 ) ? "23" : ""));
1035 ND_PRINT((ndo
, "%s LSP Encoding Type: %s (%u)",
1037 tok2str(gmpls_encoding_values
,
1041 ND_PRINT((ndo
, "%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1043 tok2str(gmpls_switch_cap_values
,
1047 tok2str(gmpls_payload_values
,
1049 EXTRACT_16BITS(obj_tptr
+2)),
1050 EXTRACT_16BITS(obj_tptr
+ 2)));
1061 switch(rsvp_obj_ctype
) {
1062 case RSVP_CTYPE_IPV4
:
1063 while(obj_tlen
>= 4 ) {
1064 ND_PRINT((ndo
, "%s Subobject Type: %s, length %u",
1066 tok2str(rsvp_obj_xro_values
,
1068 RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)),
1071 if (*(obj_tptr
+1) == 0) { /* prevent infinite loops */
1072 ND_PRINT((ndo
, "%s ERROR: zero length ERO subtype", ident
));
1076 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)) {
1077 case RSVP_OBJ_XRO_IPV4
:
1078 ND_PRINT((ndo
, ", %s, %s/%u, Flags: [%s]",
1079 RSVP_OBJ_XRO_MASK_LOOSE(*obj_tptr
) ? "Loose" : "Strict",
1080 ipaddr_string(ndo
, obj_tptr
+2),
1082 bittok2str(rsvp_obj_rro_flag_values
,
1084 *(obj_tptr
+ 7)))); /* rfc3209 says that this field is rsvd. */
1086 case RSVP_OBJ_XRO_LABEL
:
1087 ND_PRINT((ndo
, ", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1088 bittok2str(rsvp_obj_rro_label_flag_values
,
1092 tok2str(rsvp_ctype_values
,
1094 *(obj_tptr
+3) + 256*RSVP_OBJ_RRO
),
1096 EXTRACT_32BITS(obj_tptr
+ 4)));
1098 obj_tlen
-=*(obj_tptr
+1);
1099 obj_tptr
+=*(obj_tptr
+1);
1107 case RSVP_OBJ_HELLO
:
1108 switch(rsvp_obj_ctype
) {
1113 ND_PRINT((ndo
, "%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1115 EXTRACT_32BITS(obj_tptr
),
1116 EXTRACT_32BITS(obj_tptr
+ 4)));
1125 case RSVP_OBJ_RESTART_CAPABILITY
:
1126 switch(rsvp_obj_ctype
) {
1130 ND_PRINT((ndo
, "%s Restart Time: %ums, Recovery Time: %ums",
1132 EXTRACT_32BITS(obj_tptr
),
1133 EXTRACT_32BITS(obj_tptr
+ 4)));
1142 case RSVP_OBJ_SESSION_ATTRIBUTE
:
1143 switch(rsvp_obj_ctype
) {
1144 case RSVP_CTYPE_TUNNEL_IPV4
:
1147 namelen
= *(obj_tptr
+3);
1148 if (obj_tlen
< 4+namelen
)
1150 ND_PRINT((ndo
, "%s Session Name: ", ident
));
1151 for (i
= 0; i
< namelen
; i
++)
1152 safeputchar(ndo
, *(obj_tptr
+ 4 + i
));
1153 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1157 bittok2str(rsvp_session_attribute_flag_values
,
1161 obj_tlen
-=4+*(obj_tptr
+3);
1162 obj_tptr
+=4+*(obj_tptr
+3);
1169 case RSVP_OBJ_GENERALIZED_UNI
:
1170 switch(rsvp_obj_ctype
) {
1171 int subobj_type
,af
,subobj_len
,total_subobj_len
;
1178 /* read variable length subobjects */
1179 total_subobj_len
= obj_tlen
;
1180 while(total_subobj_len
> 0) {
1181 subobj_len
= EXTRACT_16BITS(obj_tptr
);
1182 subobj_type
= (EXTRACT_16BITS(obj_tptr
+2))>>8;
1183 af
= (EXTRACT_16BITS(obj_tptr
+2))&0x00FF;
1185 ND_PRINT((ndo
, "%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1187 tok2str(rsvp_obj_generalized_uni_values
, "Unknown", subobj_type
),
1189 tok2str(af_values
, "Unknown", af
), af
,
1195 switch(subobj_type
) {
1196 case RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
:
1197 case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
:
1203 ND_PRINT((ndo
, "%s UNI IPv4 TNA address: %s",
1204 ident
, ipaddr_string(ndo
, obj_tptr
+ 4)));
1207 if (subobj_len
< 20)
1209 ND_PRINT((ndo
, "%s UNI IPv6 TNA address: %s",
1210 ident
, ip6addr_string(ndo
, obj_tptr
+ 4)));
1214 /* unless we have a TLV parser lets just hexdump */
1221 case RSVP_GEN_UNI_SUBOBJ_DIVERSITY
:
1223 /* unless we have a TLV parser lets just hexdump */
1228 case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
:
1229 if (subobj_len
< 16) {
1233 ND_PRINT((ndo
, "%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
1235 ((EXTRACT_32BITS(obj_tptr
+4))>>31),
1236 ((EXTRACT_32BITS(obj_tptr
+4))&0xFF),
1237 EXTRACT_32BITS(obj_tptr
+8),
1238 EXTRACT_32BITS(obj_tptr
+ 12)));
1241 case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
:
1242 if (subobj_len
< 8) {
1246 ND_PRINT((ndo
, "%s Service level: %u",
1247 ident
, (EXTRACT_32BITS(obj_tptr
+ 4)) >> 24));
1254 total_subobj_len
-=subobj_len
;
1255 obj_tptr
+=subobj_len
;
1256 obj_tlen
+=subobj_len
;
1259 if (total_subobj_len
) {
1260 /* unless we have a TLV parser lets just hexdump */
1270 case RSVP_OBJ_RSVP_HOP
:
1271 switch(rsvp_obj_ctype
) {
1272 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1273 case RSVP_CTYPE_IPV4
:
1276 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1278 ipaddr_string(ndo
, obj_tptr
),
1279 EXTRACT_32BITS(obj_tptr
+ 4)));
1283 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1285 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1286 case RSVP_CTYPE_IPV6
:
1289 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1291 ip6addr_string(ndo
, obj_tptr
),
1292 EXTRACT_32BITS(obj_tptr
+ 16)));
1295 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1302 case RSVP_OBJ_TIME_VALUES
:
1303 switch(rsvp_obj_ctype
) {
1307 ND_PRINT((ndo
, "%s Refresh Period: %ums",
1309 EXTRACT_32BITS(obj_tptr
)));
1318 /* those three objects do share the same semantics */
1319 case RSVP_OBJ_SENDER_TSPEC
:
1320 case RSVP_OBJ_ADSPEC
:
1321 case RSVP_OBJ_FLOWSPEC
:
1322 switch(rsvp_obj_ctype
) {
1326 ND_PRINT((ndo
, "%s Msg-Version: %u, length: %u",
1328 (*obj_tptr
& 0xf0) >> 4,
1329 EXTRACT_16BITS(obj_tptr
+ 2) << 2));
1330 obj_tptr
+=4; /* get to the start of the service header */
1333 while (obj_tlen
>= 4) {
1334 intserv_serv_tlen
=EXTRACT_16BITS(obj_tptr
+2)<<2;
1335 ND_PRINT((ndo
, "%s Service Type: %s (%u), break bit %s set, Service length: %u",
1337 tok2str(rsvp_intserv_service_type_values
,"unknown",*(obj_tptr
)),
1339 (*(obj_tptr
+1)&0x80) ? "" : "not",
1340 intserv_serv_tlen
));
1342 obj_tptr
+=4; /* get to the start of the parameter list */
1345 while (intserv_serv_tlen
>=4) {
1346 processed
= rsvp_intserv_print(ndo
, obj_tptr
, obj_tlen
);
1349 obj_tlen
-=processed
;
1350 intserv_serv_tlen
-=processed
;
1351 obj_tptr
+=processed
;
1360 case RSVP_OBJ_FILTERSPEC
:
1361 switch(rsvp_obj_ctype
) {
1362 case RSVP_CTYPE_IPV4
:
1365 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1367 ipaddr_string(ndo
, obj_tptr
),
1368 EXTRACT_16BITS(obj_tptr
+ 6)));
1372 case RSVP_CTYPE_IPV6
:
1375 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1377 ip6addr_string(ndo
, obj_tptr
),
1378 EXTRACT_16BITS(obj_tptr
+ 18)));
1385 ND_PRINT((ndo
, "%s Source Address: %s, Flow Label: %u",
1387 ip6addr_string(ndo
, obj_tptr
),
1388 EXTRACT_24BITS(obj_tptr
+ 17)));
1392 case RSVP_CTYPE_TUNNEL_IPV6
:
1395 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1397 ipaddr_string(ndo
, obj_tptr
),
1398 EXTRACT_16BITS(obj_tptr
+ 18)));
1402 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
1405 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1406 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1408 ip6addr_string(ndo
, obj_tptr
),
1409 EXTRACT_16BITS(obj_tptr
+18),
1411 ip6addr_string(ndo
, obj_tptr
+20),
1412 EXTRACT_16BITS(obj_tptr
+ 38)));
1416 case RSVP_CTYPE_TUNNEL_IPV4
:
1419 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1421 ipaddr_string(ndo
, obj_tptr
),
1422 EXTRACT_16BITS(obj_tptr
+ 6)));
1426 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
1429 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1430 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1432 ipaddr_string(ndo
, obj_tptr
),
1433 EXTRACT_16BITS(obj_tptr
+6),
1435 ipaddr_string(ndo
, obj_tptr
+8),
1436 EXTRACT_16BITS(obj_tptr
+ 12)));
1445 case RSVP_OBJ_FASTREROUTE
:
1446 /* the differences between c-type 1 and 7 are minor */
1447 obj_ptr
.rsvp_obj_frr
= (const struct rsvp_obj_frr_t
*)obj_tptr
;
1448 bw
.i
= EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1450 switch(rsvp_obj_ctype
) {
1451 case RSVP_CTYPE_1
: /* new style */
1452 if (obj_tlen
< sizeof(struct rsvp_obj_frr_t
))
1454 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1456 (int)obj_ptr
.rsvp_obj_frr
->setup_prio
,
1457 (int)obj_ptr
.rsvp_obj_frr
->hold_prio
,
1458 (int)obj_ptr
.rsvp_obj_frr
->hop_limit
,
1459 bw
.f
* 8 / 1000000));
1460 ND_PRINT((ndo
, "%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
1462 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_any
),
1463 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->exclude_any
),
1464 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_all
)));
1465 obj_tlen
-=sizeof(struct rsvp_obj_frr_t
);
1466 obj_tptr
+=sizeof(struct rsvp_obj_frr_t
);
1469 case RSVP_CTYPE_TUNNEL_IPV4
: /* old style */
1472 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1474 (int)obj_ptr
.rsvp_obj_frr
->setup_prio
,
1475 (int)obj_ptr
.rsvp_obj_frr
->hold_prio
,
1476 (int)obj_ptr
.rsvp_obj_frr
->hop_limit
,
1477 bw
.f
* 8 / 1000000));
1478 ND_PRINT((ndo
, "%s Include Colors: 0x%08x, Exclude Colors: 0x%08x",
1480 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_any
),
1481 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->exclude_any
)));
1491 case RSVP_OBJ_DETOUR
:
1492 switch(rsvp_obj_ctype
) {
1493 case RSVP_CTYPE_TUNNEL_IPV4
:
1494 while(obj_tlen
>= 8) {
1495 ND_PRINT((ndo
, "%s PLR-ID: %s, Avoid-Node-ID: %s",
1497 ipaddr_string(ndo
, obj_tptr
),
1498 ipaddr_string(ndo
, obj_tptr
+ 4)));
1508 case RSVP_OBJ_CLASSTYPE
:
1509 case RSVP_OBJ_CLASSTYPE_OLD
: /* fall through */
1510 switch(rsvp_obj_ctype
) {
1512 ND_PRINT((ndo
, "%s CT: %u",
1514 EXTRACT_32BITS(obj_tptr
) & 0x7));
1523 case RSVP_OBJ_ERROR_SPEC
:
1524 switch(rsvp_obj_ctype
) {
1525 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1526 case RSVP_CTYPE_IPV4
:
1529 error_code
=*(obj_tptr
+5);
1530 error_value
=EXTRACT_16BITS(obj_tptr
+6);
1531 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1533 ipaddr_string(ndo
, obj_tptr
),
1536 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1538 switch (error_code
) {
1539 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1540 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1541 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1544 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
: /* fall through */
1545 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
:
1546 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1547 tok2str(rsvp_obj_error_code_diffserv_te_values
,"unknown",error_value
),
1551 ND_PRINT((ndo
, ", Unknown Error Value (%u)", error_value
));
1557 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1558 case RSVP_CTYPE_IPV6
:
1561 error_code
=*(obj_tptr
+17);
1562 error_value
=EXTRACT_16BITS(obj_tptr
+18);
1563 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1565 ip6addr_string(ndo
, obj_tptr
),
1568 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1571 switch (error_code
) {
1572 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1573 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1574 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1588 case RSVP_OBJ_PROPERTIES
:
1589 switch(rsvp_obj_ctype
) {
1593 padbytes
= EXTRACT_16BITS(obj_tptr
+2);
1594 ND_PRINT((ndo
, "%s TLV count: %u, padding bytes: %u",
1596 EXTRACT_16BITS(obj_tptr
),
1600 /* loop through as long there is anything longer than the TLV header (2) */
1601 while(obj_tlen
>= 2 + padbytes
) {
1602 ND_PRINT((ndo
, "%s %s TLV (0x%02x), length: %u", /* length includes header */
1604 tok2str(rsvp_obj_prop_tlv_values
,"unknown",*obj_tptr
),
1607 if (obj_tlen
< *(obj_tptr
+1))
1609 if (*(obj_tptr
+1) < 2)
1611 print_unknown_data(ndo
, obj_tptr
+ 2, "\n\t\t", *(obj_tptr
+ 1) - 2);
1612 obj_tlen
-=*(obj_tptr
+1);
1613 obj_tptr
+=*(obj_tptr
+1);
1621 case RSVP_OBJ_MESSAGE_ID
: /* fall through */
1622 case RSVP_OBJ_MESSAGE_ID_ACK
: /* fall through */
1623 case RSVP_OBJ_MESSAGE_ID_LIST
:
1624 switch(rsvp_obj_ctype
) {
1629 ND_PRINT((ndo
, "%s Flags [0x%02x], epoch: %u",
1632 EXTRACT_24BITS(obj_tptr
+ 1)));
1635 /* loop through as long there are no messages left */
1636 while(obj_tlen
>= 4) {
1637 ND_PRINT((ndo
, "%s Message-ID 0x%08x (%u)",
1639 EXTRACT_32BITS(obj_tptr
),
1640 EXTRACT_32BITS(obj_tptr
)));
1650 case RSVP_OBJ_INTEGRITY
:
1651 switch(rsvp_obj_ctype
) {
1653 if (obj_tlen
< sizeof(struct rsvp_obj_integrity_t
))
1655 obj_ptr
.rsvp_obj_integrity
= (const struct rsvp_obj_integrity_t
*)obj_tptr
;
1656 ND_PRINT((ndo
, "%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
1658 EXTRACT_16BITS(obj_ptr
.rsvp_obj_integrity
->key_id
),
1659 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->key_id
+2),
1660 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->sequence
),
1661 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->sequence
+4),
1662 bittok2str(rsvp_obj_integrity_flag_values
,
1664 obj_ptr
.rsvp_obj_integrity
->flags
)));
1665 ND_PRINT((ndo
, "%s MD5-sum 0x%08x%08x%08x%08x ",
1667 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
),
1668 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+4),
1669 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+8),
1670 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+ 12)));
1672 sigcheck
= signature_verify(ndo
, pptr
, plen
,
1673 obj_ptr
.rsvp_obj_integrity
->digest
,
1674 rsvp_clear_checksum
,
1676 ND_PRINT((ndo
, " (%s)", tok2str(signature_check_values
, "Unknown", sigcheck
)));
1678 obj_tlen
+=sizeof(struct rsvp_obj_integrity_t
);
1679 obj_tptr
+=sizeof(struct rsvp_obj_integrity_t
);
1686 case RSVP_OBJ_ADMIN_STATUS
:
1687 switch(rsvp_obj_ctype
) {
1691 ND_PRINT((ndo
, "%s Flags [%s]", ident
,
1692 bittok2str(rsvp_obj_admin_status_flag_values
, "none",
1693 EXTRACT_32BITS(obj_tptr
))));
1702 case RSVP_OBJ_LABEL_SET
:
1703 switch(rsvp_obj_ctype
) {
1707 action
= (EXTRACT_16BITS(obj_tptr
)>>8);
1709 ND_PRINT((ndo
, "%s Action: %s (%u), Label type: %u", ident
,
1710 tok2str(rsvp_obj_label_set_action_values
, "Unknown", action
),
1711 action
, ((EXTRACT_32BITS(obj_tptr
) & 0x7F))));
1714 case LABEL_SET_INCLUSIVE_RANGE
:
1715 case LABEL_SET_EXCLUSIVE_RANGE
: /* fall through */
1717 /* only a couple of subchannels are expected */
1720 ND_PRINT((ndo
, "%s Start range: %u, End range: %u", ident
,
1721 EXTRACT_32BITS(obj_tptr
+4),
1722 EXTRACT_32BITS(obj_tptr
+ 8)));
1731 while(obj_tlen
>= 4 ) {
1732 ND_PRINT((ndo
, "%s Subchannel #%u: %u", ident
, subchannel
,
1733 EXTRACT_32BITS(obj_tptr
)));
1746 switch (rsvp_obj_ctype
) {
1747 case RSVP_CTYPE_IPV4
:
1750 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1751 ident
, ipaddr_string(ndo
, obj_tptr
)));
1756 case RSVP_CTYPE_IPV6
:
1759 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1760 ident
, ip6addr_string(ndo
, obj_tptr
)));
1770 * FIXME those are the defined objects that lack a decoder
1771 * you are welcome to contribute code ;-)
1774 case RSVP_OBJ_SCOPE
:
1775 case RSVP_OBJ_POLICY_DATA
:
1776 case RSVP_OBJ_ACCEPT_LABEL_SET
:
1777 case RSVP_OBJ_PROTECTION
:
1779 if (ndo
->ndo_vflag
<= 1)
1780 print_unknown_data(ndo
, obj_tptr
, "\n\t ", obj_tlen
); /* FIXME indentation */
1783 /* do we also want to see a hex dump ? */
1784 if (ndo
->ndo_vflag
> 1 || hexdump
== TRUE
)
1785 print_unknown_data(ndo
, tptr
+ sizeof(struct rsvp_object_header
), "\n\t ", /* FIXME indentation */
1786 rsvp_obj_len
- sizeof(struct rsvp_object_header
));
1793 ND_PRINT((ndo
, "%s", istr
));
1796 ND_PRINT((ndo
, "\n\t\t"));
1797 ND_PRINT((ndo
, "%s", tstr
));
1802 rsvp_print(netdissect_options
*ndo
,
1803 register const u_char
*pptr
, register u_int len
)
1805 const struct rsvp_common_header
*rsvp_com_header
;
1811 rsvp_com_header
= (const struct rsvp_common_header
*)pptr
;
1812 ND_TCHECK(*rsvp_com_header
);
1815 * Sanity checking of the header.
1817 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1818 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1819 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1823 /* in non-verbose mode just lets print the basic Message Type*/
1824 if (ndo
->ndo_vflag
< 1) {
1825 ND_PRINT((ndo
, "RSVPv%u %s Message, length: %u",
1826 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1827 tok2str(rsvp_msg_type_values
, "unknown (%u)",rsvp_com_header
->msg_type
),
1832 /* ok they seem to want to know everything - lets fully decode it */
1834 plen
= tlen
= EXTRACT_16BITS(rsvp_com_header
->length
);
1836 ND_PRINT((ndo
, "\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1837 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1838 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1839 rsvp_com_header
->msg_type
,
1840 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1842 rsvp_com_header
->ttl
,
1843 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1845 if (tlen
< sizeof(const struct rsvp_common_header
)) {
1846 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", tlen
,
1847 (unsigned long)sizeof(const struct rsvp_common_header
)));
1851 tptr
+=sizeof(const struct rsvp_common_header
);
1852 tlen
-=sizeof(const struct rsvp_common_header
);
1854 switch(rsvp_com_header
->msg_type
) {
1856 case RSVP_MSGTYPE_BUNDLE
:
1858 * Process each submessage in the bundle message.
1859 * Bundle messages may not contain bundle submessages, so we don't
1860 * need to handle bundle submessages specially.
1863 const u_char
*subpptr
=tptr
, *subtptr
;
1864 u_short subplen
, subtlen
;
1868 rsvp_com_header
= (const struct rsvp_common_header
*)subpptr
;
1869 ND_TCHECK(*rsvp_com_header
);
1872 * Sanity checking of the header.
1874 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1875 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1876 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1880 subplen
= subtlen
= EXTRACT_16BITS(rsvp_com_header
->length
);
1882 ND_PRINT((ndo
, "\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1883 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1884 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1885 rsvp_com_header
->msg_type
,
1886 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1888 rsvp_com_header
->ttl
,
1889 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1891 if (subtlen
< sizeof(const struct rsvp_common_header
)) {
1892 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", subtlen
,
1893 (unsigned long)sizeof(const struct rsvp_common_header
)));
1897 if (tlen
< subtlen
) {
1898 ND_PRINT((ndo
, "ERROR: common header too large %u > %u", subtlen
,
1903 subtptr
+=sizeof(const struct rsvp_common_header
);
1904 subtlen
-=sizeof(const struct rsvp_common_header
);
1907 * Print all objects in the submessage.
1909 if (rsvp_obj_print(ndo
, subpptr
, subplen
, subtptr
, "\n\t ", subtlen
, rsvp_com_header
) == -1)
1912 tptr
+=subtlen
+sizeof(const struct rsvp_common_header
);
1913 tlen
-=subtlen
+sizeof(const struct rsvp_common_header
);
1918 case RSVP_MSGTYPE_PATH
:
1919 case RSVP_MSGTYPE_RESV
:
1920 case RSVP_MSGTYPE_PATHERR
:
1921 case RSVP_MSGTYPE_RESVERR
:
1922 case RSVP_MSGTYPE_PATHTEAR
:
1923 case RSVP_MSGTYPE_RESVTEAR
:
1924 case RSVP_MSGTYPE_RESVCONF
:
1925 case RSVP_MSGTYPE_HELLO_OLD
:
1926 case RSVP_MSGTYPE_HELLO
:
1927 case RSVP_MSGTYPE_ACK
:
1928 case RSVP_MSGTYPE_SREFRESH
:
1930 * Print all objects in the message.
1932 if (rsvp_obj_print(ndo
, pptr
, plen
, tptr
, "\n\t ", tlen
, rsvp_com_header
) == -1)
1937 print_unknown_data(ndo
, tptr
, "\n\t ", tlen
);
1943 ND_PRINT((ndo
, "\n\t\t"));
1944 ND_PRINT((ndo
, "%s", tstr
));