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)
18 /* \summary: Resource ReSerVation Protocol (RSVP) printer */
24 #include <netdissect-stdinc.h>
26 #include "netdissect.h"
28 #include "addrtoname.h"
29 #include "ethertype.h"
32 #include "signature.h"
34 static const char tstr
[] = " [|rsvp]";
37 * RFC 2205 common header
40 * +-------------+-------------+-------------+-------------+
41 * | Vers | Flags| Msg Type | RSVP Checksum |
42 * +-------------+-------------+-------------+-------------+
43 * | Send_TTL | (Reserved) | RSVP Length |
44 * +-------------+-------------+-------------+-------------+
48 struct rsvp_common_header
{
49 uint8_t version_flags
;
58 * RFC2205 object header
62 * +-------------+-------------+-------------+-------------+
63 * | Length (bytes) | Class-Num | C-Type |
64 * +-------------+-------------+-------------+-------------+
66 * // (Object contents) //
68 * +-------------+-------------+-------------+-------------+
71 struct rsvp_object_header
{
77 #define RSVP_VERSION 1
78 #define RSVP_EXTRACT_VERSION(x) (((x)&0xf0)>>4)
79 #define RSVP_EXTRACT_FLAGS(x) ((x)&0x0f)
81 #define RSVP_MSGTYPE_PATH 1
82 #define RSVP_MSGTYPE_RESV 2
83 #define RSVP_MSGTYPE_PATHERR 3
84 #define RSVP_MSGTYPE_RESVERR 4
85 #define RSVP_MSGTYPE_PATHTEAR 5
86 #define RSVP_MSGTYPE_RESVTEAR 6
87 #define RSVP_MSGTYPE_RESVCONF 7
88 #define RSVP_MSGTYPE_BUNDLE 12
89 #define RSVP_MSGTYPE_ACK 13
90 #define RSVP_MSGTYPE_HELLO_OLD 14 /* ancient Hellos */
91 #define RSVP_MSGTYPE_SREFRESH 15
92 #define RSVP_MSGTYPE_HELLO 20
94 static const struct tok rsvp_msg_type_values
[] = {
95 { RSVP_MSGTYPE_PATH
, "Path" },
96 { RSVP_MSGTYPE_RESV
, "Resv" },
97 { RSVP_MSGTYPE_PATHERR
, "PathErr" },
98 { RSVP_MSGTYPE_RESVERR
, "ResvErr" },
99 { RSVP_MSGTYPE_PATHTEAR
, "PathTear" },
100 { RSVP_MSGTYPE_RESVTEAR
, "ResvTear" },
101 { RSVP_MSGTYPE_RESVCONF
, "ResvConf" },
102 { RSVP_MSGTYPE_BUNDLE
, "Bundle" },
103 { RSVP_MSGTYPE_ACK
, "Acknowledgement" },
104 { RSVP_MSGTYPE_HELLO_OLD
, "Hello (Old)" },
105 { RSVP_MSGTYPE_SREFRESH
, "Refresh" },
106 { RSVP_MSGTYPE_HELLO
, "Hello" },
110 static const struct tok rsvp_header_flag_values
[] = {
111 { 0x01, "Refresh reduction capable" }, /* rfc2961 */
115 #define RSVP_OBJ_SESSION 1 /* rfc2205 */
116 #define RSVP_OBJ_RSVP_HOP 3 /* rfc2205, rfc3473 */
117 #define RSVP_OBJ_INTEGRITY 4 /* rfc2747 */
118 #define RSVP_OBJ_TIME_VALUES 5 /* rfc2205 */
119 #define RSVP_OBJ_ERROR_SPEC 6
120 #define RSVP_OBJ_SCOPE 7
121 #define RSVP_OBJ_STYLE 8 /* rfc2205 */
122 #define RSVP_OBJ_FLOWSPEC 9 /* rfc2215 */
123 #define RSVP_OBJ_FILTERSPEC 10 /* rfc2215 */
124 #define RSVP_OBJ_SENDER_TEMPLATE 11
125 #define RSVP_OBJ_SENDER_TSPEC 12 /* rfc2215 */
126 #define RSVP_OBJ_ADSPEC 13 /* rfc2215 */
127 #define RSVP_OBJ_POLICY_DATA 14
128 #define RSVP_OBJ_CONFIRM 15 /* rfc2205 */
129 #define RSVP_OBJ_LABEL 16 /* rfc3209 */
130 #define RSVP_OBJ_LABEL_REQ 19 /* rfc3209 */
131 #define RSVP_OBJ_ERO 20 /* rfc3209 */
132 #define RSVP_OBJ_RRO 21 /* rfc3209 */
133 #define RSVP_OBJ_HELLO 22 /* rfc3209 */
134 #define RSVP_OBJ_MESSAGE_ID 23 /* rfc2961 */
135 #define RSVP_OBJ_MESSAGE_ID_ACK 24 /* rfc2961 */
136 #define RSVP_OBJ_MESSAGE_ID_LIST 25 /* rfc2961 */
137 #define RSVP_OBJ_RECOVERY_LABEL 34 /* rfc3473 */
138 #define RSVP_OBJ_UPSTREAM_LABEL 35 /* rfc3473 */
139 #define RSVP_OBJ_LABEL_SET 36 /* rfc3473 */
140 #define RSVP_OBJ_PROTECTION 37 /* rfc3473 */
141 #define RSVP_OBJ_S2L 50 /* rfc4875 */
142 #define RSVP_OBJ_DETOUR 63 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07 */
143 #define RSVP_OBJ_CLASSTYPE 66 /* rfc4124 */
144 #define RSVP_OBJ_CLASSTYPE_OLD 125 /* draft-ietf-tewg-diff-te-proto-07 */
145 #define RSVP_OBJ_SUGGESTED_LABEL 129 /* rfc3473 */
146 #define RSVP_OBJ_ACCEPT_LABEL_SET 130 /* rfc3473 */
147 #define RSVP_OBJ_RESTART_CAPABILITY 131 /* rfc3473 */
148 #define RSVP_OBJ_NOTIFY_REQ 195 /* rfc3473 */
149 #define RSVP_OBJ_ADMIN_STATUS 196 /* rfc3473 */
150 #define RSVP_OBJ_PROPERTIES 204 /* juniper proprietary */
151 #define RSVP_OBJ_FASTREROUTE 205 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07 */
152 #define RSVP_OBJ_SESSION_ATTRIBUTE 207 /* rfc3209 */
153 #define RSVP_OBJ_GENERALIZED_UNI 229 /* OIF RSVP extensions UNI 1.0 Signaling, Rel. 2 */
154 #define RSVP_OBJ_CALL_ID 230 /* rfc3474 */
155 #define RSVP_OBJ_CALL_OPS 236 /* rfc3474 */
157 static const struct tok rsvp_obj_values
[] = {
158 { RSVP_OBJ_SESSION
, "Session" },
159 { RSVP_OBJ_RSVP_HOP
, "RSVP Hop" },
160 { RSVP_OBJ_INTEGRITY
, "Integrity" },
161 { RSVP_OBJ_TIME_VALUES
, "Time Values" },
162 { RSVP_OBJ_ERROR_SPEC
, "Error Spec" },
163 { RSVP_OBJ_SCOPE
, "Scope" },
164 { RSVP_OBJ_STYLE
, "Style" },
165 { RSVP_OBJ_FLOWSPEC
, "Flowspec" },
166 { RSVP_OBJ_FILTERSPEC
, "FilterSpec" },
167 { RSVP_OBJ_SENDER_TEMPLATE
, "Sender Template" },
168 { RSVP_OBJ_SENDER_TSPEC
, "Sender TSpec" },
169 { RSVP_OBJ_ADSPEC
, "Adspec" },
170 { RSVP_OBJ_POLICY_DATA
, "Policy Data" },
171 { RSVP_OBJ_CONFIRM
, "Confirm" },
172 { RSVP_OBJ_LABEL
, "Label" },
173 { RSVP_OBJ_LABEL_REQ
, "Label Request" },
174 { RSVP_OBJ_ERO
, "ERO" },
175 { RSVP_OBJ_RRO
, "RRO" },
176 { RSVP_OBJ_HELLO
, "Hello" },
177 { RSVP_OBJ_MESSAGE_ID
, "Message ID" },
178 { RSVP_OBJ_MESSAGE_ID_ACK
, "Message ID Ack" },
179 { RSVP_OBJ_MESSAGE_ID_LIST
, "Message ID List" },
180 { RSVP_OBJ_RECOVERY_LABEL
, "Recovery Label" },
181 { RSVP_OBJ_UPSTREAM_LABEL
, "Upstream Label" },
182 { RSVP_OBJ_LABEL_SET
, "Label Set" },
183 { RSVP_OBJ_ACCEPT_LABEL_SET
, "Acceptable Label Set" },
184 { RSVP_OBJ_DETOUR
, "Detour" },
185 { RSVP_OBJ_CLASSTYPE
, "Class Type" },
186 { RSVP_OBJ_CLASSTYPE_OLD
, "Class Type (old)" },
187 { RSVP_OBJ_SUGGESTED_LABEL
, "Suggested Label" },
188 { RSVP_OBJ_PROPERTIES
, "Properties" },
189 { RSVP_OBJ_FASTREROUTE
, "Fast Re-Route" },
190 { RSVP_OBJ_SESSION_ATTRIBUTE
, "Session Attribute" },
191 { RSVP_OBJ_GENERALIZED_UNI
, "Generalized UNI" },
192 { RSVP_OBJ_CALL_ID
, "Call-ID" },
193 { RSVP_OBJ_CALL_OPS
, "Call Capability" },
194 { RSVP_OBJ_RESTART_CAPABILITY
, "Restart Capability" },
195 { RSVP_OBJ_NOTIFY_REQ
, "Notify Request" },
196 { RSVP_OBJ_PROTECTION
, "Protection" },
197 { RSVP_OBJ_ADMIN_STATUS
, "Administrative Status" },
198 { RSVP_OBJ_S2L
, "Sub-LSP to LSP" },
202 #define RSVP_CTYPE_IPV4 1
203 #define RSVP_CTYPE_IPV6 2
204 #define RSVP_CTYPE_TUNNEL_IPV4 7
205 #define RSVP_CTYPE_TUNNEL_IPV6 8
206 #define RSVP_CTYPE_UNI_IPV4 11 /* OIF RSVP extensions UNI 1.0 Signaling Rel. 2 */
207 #define RSVP_CTYPE_1 1
208 #define RSVP_CTYPE_2 2
209 #define RSVP_CTYPE_3 3
210 #define RSVP_CTYPE_4 4
211 #define RSVP_CTYPE_12 12
212 #define RSVP_CTYPE_13 13
213 #define RSVP_CTYPE_14 14
216 * the ctypes are not globally unique so for
217 * translating it to strings we build a table based
218 * on objects offsetted by the ctype
221 static const struct tok rsvp_ctype_values
[] = {
222 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV4
, "IPv4" },
223 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV6
, "IPv6" },
224 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
225 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
226 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV4
, "IPv4" },
227 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV6
, "IPv6" },
228 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV4
, "IPv4" },
229 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV6
, "IPv6" },
230 { 256*RSVP_OBJ_TIME_VALUES
+RSVP_CTYPE_1
, "1" },
231 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_1
, "obsolete" },
232 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_2
, "IntServ" },
233 { 256*RSVP_OBJ_SENDER_TSPEC
+RSVP_CTYPE_2
, "IntServ" },
234 { 256*RSVP_OBJ_ADSPEC
+RSVP_CTYPE_2
, "IntServ" },
235 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
236 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
237 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_3
, "IPv6 Flow-label" },
238 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
239 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
240 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
241 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV4
, "IPv4" },
242 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV6
, "IPv6" },
243 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
244 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_UNI_IPV4
, "UNI IPv4" },
245 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_13
, "IPv4 P2MP LSP Tunnel" },
246 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_14
, "IPv6 P2MP LSP Tunnel" },
247 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV4
, "IPv4" },
248 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV6
, "IPv6" },
249 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
250 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
251 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
252 { 256*RSVP_OBJ_MESSAGE_ID
+RSVP_CTYPE_1
, "1" },
253 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_1
, "Message id ack" },
254 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_2
, "Message id nack" },
255 { 256*RSVP_OBJ_MESSAGE_ID_LIST
+RSVP_CTYPE_1
, "1" },
256 { 256*RSVP_OBJ_STYLE
+RSVP_CTYPE_1
, "1" },
257 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_1
, "Hello Request" },
258 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_2
, "Hello Ack" },
259 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_1
, "without label range" },
260 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_2
, "with ATM label range" },
261 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_3
, "with FR label range" },
262 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_4
, "Generalized Label" },
263 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_1
, "Label" },
264 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
265 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
266 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_1
, "Label" },
267 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
268 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
269 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_1
, "Label" },
270 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
271 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
272 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_1
, "Label" },
273 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
274 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
275 { 256*RSVP_OBJ_ERO
+RSVP_CTYPE_IPV4
, "IPv4" },
276 { 256*RSVP_OBJ_RRO
+RSVP_CTYPE_IPV4
, "IPv4" },
277 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
278 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
279 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
280 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
281 { 256*RSVP_OBJ_RESTART_CAPABILITY
+RSVP_CTYPE_1
, "IPv4" },
282 { 256*RSVP_OBJ_SESSION_ATTRIBUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
283 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" }, /* old style*/
284 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_1
, "1" }, /* new style */
285 { 256*RSVP_OBJ_DETOUR
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
286 { 256*RSVP_OBJ_PROPERTIES
+RSVP_CTYPE_1
, "1" },
287 { 256*RSVP_OBJ_ADMIN_STATUS
+RSVP_CTYPE_1
, "1" },
288 { 256*RSVP_OBJ_CLASSTYPE
+RSVP_CTYPE_1
, "1" },
289 { 256*RSVP_OBJ_CLASSTYPE_OLD
+RSVP_CTYPE_1
, "1" },
290 { 256*RSVP_OBJ_LABEL_SET
+RSVP_CTYPE_1
, "1" },
291 { 256*RSVP_OBJ_GENERALIZED_UNI
+RSVP_CTYPE_1
, "1" },
292 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV4
, "IPv4 sub-LSP" },
293 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV6
, "IPv6 sub-LSP" },
297 struct rsvp_obj_integrity_t
{
305 static const struct tok rsvp_obj_integrity_flag_values
[] = {
306 { 0x80, "Handshake" },
310 struct rsvp_obj_frr_t
{
315 uint8_t bandwidth
[4];
316 uint8_t include_any
[4];
317 uint8_t exclude_any
[4];
318 uint8_t include_all
[4];
322 #define RSVP_OBJ_XRO_MASK_SUBOBJ(x) ((x)&0x7f)
323 #define RSVP_OBJ_XRO_MASK_LOOSE(x) ((x)&0x80)
325 #define RSVP_OBJ_XRO_RES 0
326 #define RSVP_OBJ_XRO_IPV4 1
327 #define RSVP_OBJ_XRO_IPV6 2
328 #define RSVP_OBJ_XRO_LABEL 3
329 #define RSVP_OBJ_XRO_ASN 32
330 #define RSVP_OBJ_XRO_MPLS 64
332 static const struct tok rsvp_obj_xro_values
[] = {
333 { RSVP_OBJ_XRO_RES
, "Reserved" },
334 { RSVP_OBJ_XRO_IPV4
, "IPv4 prefix" },
335 { RSVP_OBJ_XRO_IPV6
, "IPv6 prefix" },
336 { RSVP_OBJ_XRO_LABEL
, "Label" },
337 { RSVP_OBJ_XRO_ASN
, "Autonomous system number" },
338 { RSVP_OBJ_XRO_MPLS
, "MPLS label switched path termination" },
342 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07.txt */
343 static const struct tok rsvp_obj_rro_flag_values
[] = {
344 { 0x01, "Local protection available" },
345 { 0x02, "Local protection in use" },
346 { 0x04, "Bandwidth protection" },
347 { 0x08, "Node protection" },
352 static const struct tok rsvp_obj_rro_label_flag_values
[] = {
357 static const struct tok rsvp_resstyle_values
[] = {
358 { 17, "Wildcard Filter" },
359 { 10, "Fixed Filter" },
360 { 18, "Shared Explicit" },
364 #define RSVP_OBJ_INTSERV_GUARANTEED_SERV 2
365 #define RSVP_OBJ_INTSERV_CONTROLLED_LOAD 5
367 static const struct tok rsvp_intserv_service_type_values
[] = {
368 { 1, "Default/Global Information" },
369 { RSVP_OBJ_INTSERV_GUARANTEED_SERV
, "Guaranteed Service" },
370 { RSVP_OBJ_INTSERV_CONTROLLED_LOAD
, "Controlled Load" },
374 static const struct tok rsvp_intserv_parameter_id_values
[] = {
376 { 6, "Path b/w estimate" },
377 { 8, "Minimum path latency" },
378 { 10, "Composed MTU" },
379 { 127, "Token Bucket TSpec" },
380 { 130, "Guaranteed Service RSpec" },
381 { 133, "End-to-end composed value for C" },
382 { 134, "End-to-end composed value for D" },
383 { 135, "Since-last-reshaping point composed C" },
384 { 136, "Since-last-reshaping point composed D" },
388 static const struct tok rsvp_session_attribute_flag_values
[] = {
389 { 0x01, "Local Protection" },
390 { 0x02, "Label Recording" },
391 { 0x04, "SE Style" },
392 { 0x08, "Bandwidth protection" }, /* RFC4090 */
393 { 0x10, "Node protection" }, /* RFC4090 */
397 static const struct tok rsvp_obj_prop_tlv_values
[] = {
399 { 0x02, "Metric 1" },
400 { 0x04, "Metric 2" },
401 { 0x08, "CCC Status" },
402 { 0x10, "Path Type" },
406 #define RSVP_OBJ_ERROR_SPEC_CODE_ROUTING 24
407 #define RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY 25
408 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE 28
409 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD 125
411 static const struct tok rsvp_obj_error_code_values
[] = {
412 { RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
, "Routing Problem" },
413 { RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY
, "Notify Error" },
414 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
, "Diffserv TE Error" },
415 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
, "Diffserv TE Error (Old)" },
419 static const struct tok rsvp_obj_error_code_routing_values
[] = {
420 { 1, "Bad EXPLICIT_ROUTE object" },
421 { 2, "Bad strict node" },
422 { 3, "Bad loose node" },
423 { 4, "Bad initial subobject" },
424 { 5, "No route available toward destination" },
425 { 6, "Unacceptable label value" },
426 { 7, "RRO indicated routing loops" },
427 { 8, "non-RSVP-capable router in the path" },
428 { 9, "MPLS label allocation failure" },
429 { 10, "Unsupported L3PID" },
433 static const struct tok rsvp_obj_error_code_diffserv_te_values
[] = {
434 { 1, "Unexpected CT object" },
435 { 2, "Unsupported CT" },
436 { 3, "Invalid CT value" },
437 { 4, "CT/setup priority do not form a configured TE-Class" },
438 { 5, "CT/holding priority do not form a configured TE-Class" },
439 { 6, "CT/setup priority and CT/holding priority do not form a configured TE-Class" },
440 { 7, "Inconsistency between signaled PSC and signaled CT" },
441 { 8, "Inconsistency between signaled PHBs and signaled CT" },
445 /* rfc3473 / rfc 3471 */
446 static const struct tok rsvp_obj_admin_status_flag_values
[] = {
447 { 0x80000000, "Reflect" },
448 { 0x00000004, "Testing" },
449 { 0x00000002, "Admin-down" },
450 { 0x00000001, "Delete-in-progress" },
454 /* label set actions - rfc3471 */
455 #define LABEL_SET_INCLUSIVE_LIST 0
456 #define LABEL_SET_EXCLUSIVE_LIST 1
457 #define LABEL_SET_INCLUSIVE_RANGE 2
458 #define LABEL_SET_EXCLUSIVE_RANGE 3
460 static const struct tok rsvp_obj_label_set_action_values
[] = {
461 { LABEL_SET_INCLUSIVE_LIST
, "Inclusive list" },
462 { LABEL_SET_EXCLUSIVE_LIST
, "Exclusive list" },
463 { LABEL_SET_INCLUSIVE_RANGE
, "Inclusive range" },
464 { LABEL_SET_EXCLUSIVE_RANGE
, "Exclusive range" },
468 /* OIF RSVP extensions UNI 1.0 Signaling, release 2 */
469 #define RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS 1
470 #define RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS 2
471 #define RSVP_GEN_UNI_SUBOBJ_DIVERSITY 3
472 #define RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL 4
473 #define RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL 5
475 static const struct tok rsvp_obj_generalized_uni_values
[] = {
476 { RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
, "Source TNA address" },
477 { RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
, "Destination TNA address" },
478 { RSVP_GEN_UNI_SUBOBJ_DIVERSITY
, "Diversity" },
479 { RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
, "Egress label" },
480 { RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
, "Service level" },
485 * this is a dissector for all the intserv defined
486 * specs as defined per rfc2215
487 * it is called from various rsvp objects;
488 * returns the amount of bytes being processed
491 rsvp_intserv_print(netdissect_options
*ndo
,
492 const u_char
*tptr
, u_short obj_tlen
)
494 int parameter_id
,parameter_length
;
502 parameter_id
= *(tptr
);
503 ND_TCHECK2(*(tptr
+ 2), 2);
504 parameter_length
= EXTRACT_16BITS(tptr
+2)<<2; /* convert wordcount to bytecount */
506 ND_PRINT((ndo
, "\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
507 tok2str(rsvp_intserv_parameter_id_values
,"unknown",parameter_id
),
512 if (obj_tlen
< parameter_length
+4)
514 switch(parameter_id
) { /* parameter_id */
518 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
519 * | 4 (e) | (f) | 1 (g) |
520 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
521 * | IS hop cnt (32-bit unsigned integer) |
522 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
524 if (parameter_length
== 4)
525 ND_TCHECK2(*(tptr
+ 4), 4);
526 ND_PRINT((ndo
, "\n\t\tIS hop count: %u", EXTRACT_32BITS(tptr
+ 4)));
531 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
532 * | 6 (h) | (i) | 1 (j) |
533 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
534 * | Path b/w estimate (32-bit IEEE floating point number) |
535 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
537 if (parameter_length
== 4) {
538 ND_TCHECK2(*(tptr
+ 4), 4);
539 bw
.i
= EXTRACT_32BITS(tptr
+4);
540 ND_PRINT((ndo
, "\n\t\tPath b/w estimate: %.10g Mbps", bw
.f
/ 125000));
546 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
547 * | 8 (k) | (l) | 1 (m) |
548 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
549 * | Minimum path latency (32-bit integer) |
550 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
552 if (parameter_length
== 4) {
553 ND_TCHECK2(*(tptr
+ 4), 4);
554 ND_PRINT((ndo
, "\n\t\tMinimum path latency: "));
555 if (EXTRACT_32BITS(tptr
+4) == 0xffffffff)
556 ND_PRINT((ndo
, "don't care"));
558 ND_PRINT((ndo
, "%u", EXTRACT_32BITS(tptr
+ 4)));
565 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
566 * | 10 (n) | (o) | 1 (p) |
567 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
568 * | Composed MTU (32-bit unsigned integer) |
569 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
571 if (parameter_length
== 4)
572 ND_TCHECK2(*(tptr
+ 4), 4);
573 ND_PRINT((ndo
, "\n\t\tComposed MTU: %u bytes", EXTRACT_32BITS(tptr
+ 4)));
577 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
578 * | 127 (e) | 0 (f) | 5 (g) |
579 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
580 * | Token Bucket Rate [r] (32-bit IEEE floating point number) |
581 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
582 * | Token Bucket Size [b] (32-bit IEEE floating point number) |
583 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
584 * | Peak Data Rate [p] (32-bit IEEE floating point number) |
585 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
586 * | Minimum Policed Unit [m] (32-bit integer) |
587 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
588 * | Maximum Packet Size [M] (32-bit integer) |
589 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
592 if (parameter_length
== 20) {
593 ND_TCHECK2(*(tptr
+ 4), 20);
594 bw
.i
= EXTRACT_32BITS(tptr
+4);
595 ND_PRINT((ndo
, "\n\t\tToken Bucket Rate: %.10g Mbps", bw
.f
/ 125000));
596 bw
.i
= EXTRACT_32BITS(tptr
+8);
597 ND_PRINT((ndo
, "\n\t\tToken Bucket Size: %.10g bytes", bw
.f
));
598 bw
.i
= EXTRACT_32BITS(tptr
+12);
599 ND_PRINT((ndo
, "\n\t\tPeak Data Rate: %.10g Mbps", bw
.f
/ 125000));
600 ND_PRINT((ndo
, "\n\t\tMinimum Policed Unit: %u bytes", EXTRACT_32BITS(tptr
+ 16)));
601 ND_PRINT((ndo
, "\n\t\tMaximum Packet Size: %u bytes", EXTRACT_32BITS(tptr
+ 20)));
607 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
608 * | 130 (h) | 0 (i) | 2 (j) |
609 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
610 * | Rate [R] (32-bit IEEE floating point number) |
611 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
612 * | Slack Term [S] (32-bit integer) |
613 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
616 if (parameter_length
== 8) {
617 ND_TCHECK2(*(tptr
+ 4), 8);
618 bw
.i
= EXTRACT_32BITS(tptr
+4);
619 ND_PRINT((ndo
, "\n\t\tRate: %.10g Mbps", bw
.f
/ 125000));
620 ND_PRINT((ndo
, "\n\t\tSlack Term: %u", EXTRACT_32BITS(tptr
+ 8)));
628 if (parameter_length
== 4)
629 ND_TCHECK2(*(tptr
+ 4), 4);
630 ND_PRINT((ndo
, "\n\t\tValue: %u", EXTRACT_32BITS(tptr
+ 4)));
634 if (ndo
->ndo_vflag
<= 1)
635 print_unknown_data(ndo
, tptr
+ 4, "\n\t\t", parameter_length
);
637 return (parameter_length
+4); /* header length 4 bytes */
640 ND_PRINT((ndo
, "%s", tstr
));
645 * Clear checksum prior to signature verification.
648 rsvp_clear_checksum(void *header
)
650 struct rsvp_common_header
*rsvp_com_header
= (struct rsvp_common_header
*) header
;
652 rsvp_com_header
->checksum
[0] = 0;
653 rsvp_com_header
->checksum
[1] = 0;
657 rsvp_obj_print(netdissect_options
*ndo
,
658 const u_char
*pptr
, u_int plen
, const u_char
*tptr
,
659 const char *ident
, u_int tlen
,
660 const struct rsvp_common_header
*rsvp_com_header
)
662 const struct rsvp_object_header
*rsvp_obj_header
;
663 const u_char
*obj_tptr
;
665 const struct rsvp_obj_integrity_t
*rsvp_obj_integrity
;
666 const struct rsvp_obj_frr_t
*rsvp_obj_frr
;
669 u_short rsvp_obj_len
,rsvp_obj_ctype
,obj_tlen
,intserv_serv_tlen
;
670 int hexdump
,processed
,padbytes
,error_code
,error_value
,i
,sigcheck
;
677 u_int action
, subchannel
;
679 while(tlen
>=sizeof(struct rsvp_object_header
)) {
680 /* did we capture enough for fully decoding the object header ? */
681 ND_TCHECK2(*tptr
, sizeof(struct rsvp_object_header
));
683 rsvp_obj_header
= (const struct rsvp_object_header
*)tptr
;
684 rsvp_obj_len
=EXTRACT_16BITS(rsvp_obj_header
->length
);
685 rsvp_obj_ctype
=rsvp_obj_header
->ctype
;
687 if(rsvp_obj_len
% 4) {
688 ND_PRINT((ndo
, "%sERROR: object header size %u not a multiple of 4", ident
, rsvp_obj_len
));
691 if(rsvp_obj_len
< sizeof(struct rsvp_object_header
)) {
692 ND_PRINT((ndo
, "%sERROR: object header too short %u < %lu", ident
, rsvp_obj_len
,
693 (unsigned long)sizeof(const struct rsvp_object_header
)));
697 ND_PRINT((ndo
, "%s%s Object (%u) Flags: [%s",
699 tok2str(rsvp_obj_values
,
701 rsvp_obj_header
->class_num
),
702 rsvp_obj_header
->class_num
,
703 ((rsvp_obj_header
->class_num
) & 0x80) ? "ignore" : "reject"));
705 if (rsvp_obj_header
->class_num
> 128)
706 ND_PRINT((ndo
, " %s",
707 ((rsvp_obj_header
->class_num
) & 0x40) ? "and forward" : "silently"));
709 ND_PRINT((ndo
, " if unknown], Class-Type: %s (%u), length: %u",
710 tok2str(rsvp_ctype_values
,
712 ((rsvp_obj_header
->class_num
)<<8)+rsvp_obj_ctype
),
716 if(tlen
< rsvp_obj_len
) {
717 ND_PRINT((ndo
, "%sERROR: object goes past end of objects TLV", ident
));
721 obj_tptr
=tptr
+sizeof(struct rsvp_object_header
);
722 obj_tlen
=rsvp_obj_len
-sizeof(struct rsvp_object_header
);
724 /* did we capture enough for fully decoding the object ? */
725 if (!ND_TTEST2(*tptr
, rsvp_obj_len
))
729 switch(rsvp_obj_header
->class_num
) {
730 case RSVP_OBJ_SESSION
:
731 switch(rsvp_obj_ctype
) {
732 case RSVP_CTYPE_IPV4
:
735 ND_PRINT((ndo
, "%s IPv4 DestAddress: %s, Protocol ID: 0x%02x",
737 ipaddr_string(ndo
, obj_tptr
),
738 *(obj_tptr
+ sizeof(struct in_addr
))));
739 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
742 EXTRACT_16BITS(obj_tptr
+ 6)));
746 case RSVP_CTYPE_IPV6
:
749 ND_PRINT((ndo
, "%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
751 ip6addr_string(ndo
, obj_tptr
),
752 *(obj_tptr
+ sizeof(struct in6_addr
))));
753 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
755 *(obj_tptr
+sizeof(struct in6_addr
)+1),
756 EXTRACT_16BITS(obj_tptr
+ sizeof(struct in6_addr
) + 2)));
761 case RSVP_CTYPE_TUNNEL_IPV6
:
764 ND_PRINT((ndo
, "%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
766 ip6addr_string(ndo
, obj_tptr
),
767 EXTRACT_16BITS(obj_tptr
+18),
768 ip6addr_string(ndo
, obj_tptr
+ 20)));
773 case RSVP_CTYPE_14
: /* IPv6 p2mp LSP Tunnel */
776 ND_PRINT((ndo
, "%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
778 EXTRACT_32BITS(obj_tptr
),
779 EXTRACT_16BITS(obj_tptr
+6),
780 ip6addr_string(ndo
, obj_tptr
+ 8)));
784 case RSVP_CTYPE_13
: /* IPv4 p2mp LSP Tunnel */
787 ND_PRINT((ndo
, "%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
789 ipaddr_string(ndo
, obj_tptr
),
790 EXTRACT_16BITS(obj_tptr
+6),
791 ipaddr_string(ndo
, obj_tptr
+ 8)));
795 case RSVP_CTYPE_TUNNEL_IPV4
:
796 case RSVP_CTYPE_UNI_IPV4
:
799 ND_PRINT((ndo
, "%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
801 ipaddr_string(ndo
, obj_tptr
),
802 EXTRACT_16BITS(obj_tptr
+6),
803 ipaddr_string(ndo
, obj_tptr
+ 8)));
812 case RSVP_OBJ_CONFIRM
:
813 switch(rsvp_obj_ctype
) {
814 case RSVP_CTYPE_IPV4
:
815 if (obj_tlen
< sizeof(struct in_addr
))
817 ND_PRINT((ndo
, "%s IPv4 Receiver Address: %s",
819 ipaddr_string(ndo
, obj_tptr
)));
820 obj_tlen
-=sizeof(struct in_addr
);
821 obj_tptr
+=sizeof(struct in_addr
);
823 case RSVP_CTYPE_IPV6
:
824 if (obj_tlen
< sizeof(struct in6_addr
))
826 ND_PRINT((ndo
, "%s IPv6 Receiver Address: %s",
828 ip6addr_string(ndo
, obj_tptr
)));
829 obj_tlen
-=sizeof(struct in6_addr
);
830 obj_tptr
+=sizeof(struct in6_addr
);
837 case RSVP_OBJ_NOTIFY_REQ
:
838 switch(rsvp_obj_ctype
) {
839 case RSVP_CTYPE_IPV4
:
840 if (obj_tlen
< sizeof(struct in_addr
))
842 ND_PRINT((ndo
, "%s IPv4 Notify Node Address: %s",
844 ipaddr_string(ndo
, obj_tptr
)));
845 obj_tlen
-=sizeof(struct in_addr
);
846 obj_tptr
+=sizeof(struct in_addr
);
848 case RSVP_CTYPE_IPV6
:
849 if (obj_tlen
< sizeof(struct in6_addr
))
851 ND_PRINT((ndo
, "%s IPv6 Notify Node Address: %s",
853 ip6addr_string(ndo
, obj_tptr
)));
854 obj_tlen
-=sizeof(struct in6_addr
);
855 obj_tptr
+=sizeof(struct in6_addr
);
862 case RSVP_OBJ_SUGGESTED_LABEL
: /* fall through */
863 case RSVP_OBJ_UPSTREAM_LABEL
: /* fall through */
864 case RSVP_OBJ_RECOVERY_LABEL
: /* fall through */
866 switch(rsvp_obj_ctype
) {
868 while(obj_tlen
>= 4 ) {
869 ND_PRINT((ndo
, "%s Label: %u", ident
, EXTRACT_32BITS(obj_tptr
)));
877 ND_PRINT((ndo
, "%s Generalized Label: %u",
879 EXTRACT_32BITS(obj_tptr
)));
886 ND_PRINT((ndo
, "%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
888 EXTRACT_32BITS(obj_tptr
),
890 EXTRACT_32BITS(obj_tptr
+4),
891 EXTRACT_32BITS(obj_tptr
+ 8)));
901 switch(rsvp_obj_ctype
) {
905 ND_PRINT((ndo
, "%s Reservation Style: %s, Flags: [0x%02x]",
907 tok2str(rsvp_resstyle_values
,
909 EXTRACT_24BITS(obj_tptr
+1)),
919 case RSVP_OBJ_SENDER_TEMPLATE
:
920 switch(rsvp_obj_ctype
) {
921 case RSVP_CTYPE_IPV4
:
924 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
926 ipaddr_string(ndo
, obj_tptr
),
927 EXTRACT_16BITS(obj_tptr
+ 6)));
931 case RSVP_CTYPE_IPV6
:
934 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
936 ip6addr_string(ndo
, obj_tptr
),
937 EXTRACT_16BITS(obj_tptr
+ 18)));
941 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
944 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
945 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
947 ip6addr_string(ndo
, obj_tptr
),
948 EXTRACT_16BITS(obj_tptr
+18),
950 ip6addr_string(ndo
, obj_tptr
+20),
951 EXTRACT_16BITS(obj_tptr
+ 38)));
955 case RSVP_CTYPE_TUNNEL_IPV4
:
958 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
960 ipaddr_string(ndo
, obj_tptr
),
961 EXTRACT_16BITS(obj_tptr
+ 6)));
965 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
968 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
969 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
971 ipaddr_string(ndo
, obj_tptr
),
972 EXTRACT_16BITS(obj_tptr
+6),
974 ipaddr_string(ndo
, obj_tptr
+8),
975 EXTRACT_16BITS(obj_tptr
+ 12)));
984 case RSVP_OBJ_LABEL_REQ
:
985 switch(rsvp_obj_ctype
) {
987 while(obj_tlen
>= 4 ) {
988 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
990 tok2str(ethertype_values
,
991 "Unknown Protocol (0x%04x)",
992 EXTRACT_16BITS(obj_tptr
+ 2))));
1000 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
1002 tok2str(ethertype_values
,
1003 "Unknown Protocol (0x%04x)",
1004 EXTRACT_16BITS(obj_tptr
+ 2))));
1005 ND_PRINT((ndo
, ",%s merge capability",((*(obj_tptr
+ 4)) & 0x80) ? "no" : "" ));
1006 ND_PRINT((ndo
, "%s Minimum VPI/VCI: %u/%u",
1008 (EXTRACT_16BITS(obj_tptr
+4))&0xfff,
1009 (EXTRACT_16BITS(obj_tptr
+ 6)) & 0xfff));
1010 ND_PRINT((ndo
, "%s Maximum VPI/VCI: %u/%u",
1012 (EXTRACT_16BITS(obj_tptr
+8))&0xfff,
1013 (EXTRACT_16BITS(obj_tptr
+ 10)) & 0xfff));
1020 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
1022 tok2str(ethertype_values
,
1023 "Unknown Protocol (0x%04x)",
1024 EXTRACT_16BITS(obj_tptr
+ 2))));
1025 ND_PRINT((ndo
, "%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1027 (EXTRACT_32BITS(obj_tptr
+4))&0x7fffff,
1028 (EXTRACT_32BITS(obj_tptr
+8))&0x7fffff,
1029 (((EXTRACT_16BITS(obj_tptr
+4)>>7)&3) == 0 ) ? "10" : "",
1030 (((EXTRACT_16BITS(obj_tptr
+ 4) >> 7) & 3) == 2 ) ? "23" : ""));
1037 ND_PRINT((ndo
, "%s LSP Encoding Type: %s (%u)",
1039 tok2str(gmpls_encoding_values
,
1043 ND_PRINT((ndo
, "%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1045 tok2str(gmpls_switch_cap_values
,
1049 tok2str(gmpls_payload_values
,
1051 EXTRACT_16BITS(obj_tptr
+2)),
1052 EXTRACT_16BITS(obj_tptr
+ 2)));
1063 switch(rsvp_obj_ctype
) {
1064 case RSVP_CTYPE_IPV4
:
1065 while(obj_tlen
>= 4 ) {
1068 ND_TCHECK2(*obj_tptr
, 4);
1069 length
= *(obj_tptr
+ 1);
1070 ND_PRINT((ndo
, "%s Subobject Type: %s, length %u",
1072 tok2str(rsvp_obj_xro_values
,
1074 RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)),
1077 if (length
== 0) { /* prevent infinite loops */
1078 ND_PRINT((ndo
, "%s ERROR: zero length ERO subtype", ident
));
1082 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)) {
1083 u_char prefix_length
;
1085 case RSVP_OBJ_XRO_IPV4
:
1087 ND_PRINT((ndo
, " ERROR: length != 8"));
1090 ND_TCHECK2(*obj_tptr
, 8);
1091 prefix_length
= *(obj_tptr
+6);
1092 if (prefix_length
!= 32) {
1093 ND_PRINT((ndo
, " ERROR: Prefix length %u != 32",
1097 ND_PRINT((ndo
, ", %s, %s/%u, Flags: [%s]",
1098 RSVP_OBJ_XRO_MASK_LOOSE(*obj_tptr
) ? "Loose" : "Strict",
1099 ipaddr_string(ndo
, obj_tptr
+2),
1101 bittok2str(rsvp_obj_rro_flag_values
,
1103 *(obj_tptr
+ 7)))); /* rfc3209 says that this field is rsvd. */
1105 case RSVP_OBJ_XRO_LABEL
:
1107 ND_PRINT((ndo
, " ERROR: length != 8"));
1110 ND_TCHECK2(*obj_tptr
, 8);
1111 ND_PRINT((ndo
, ", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1112 bittok2str(rsvp_obj_rro_label_flag_values
,
1116 tok2str(rsvp_ctype_values
,
1118 *(obj_tptr
+3) + 256*RSVP_OBJ_RRO
),
1120 EXTRACT_32BITS(obj_tptr
+ 4)));
1122 obj_tlen
-=*(obj_tptr
+1);
1123 obj_tptr
+=*(obj_tptr
+1);
1131 case RSVP_OBJ_HELLO
:
1132 switch(rsvp_obj_ctype
) {
1137 ND_PRINT((ndo
, "%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1139 EXTRACT_32BITS(obj_tptr
),
1140 EXTRACT_32BITS(obj_tptr
+ 4)));
1149 case RSVP_OBJ_RESTART_CAPABILITY
:
1150 switch(rsvp_obj_ctype
) {
1154 ND_PRINT((ndo
, "%s Restart Time: %ums, Recovery Time: %ums",
1156 EXTRACT_32BITS(obj_tptr
),
1157 EXTRACT_32BITS(obj_tptr
+ 4)));
1166 case RSVP_OBJ_SESSION_ATTRIBUTE
:
1167 switch(rsvp_obj_ctype
) {
1168 case RSVP_CTYPE_TUNNEL_IPV4
:
1171 namelen
= *(obj_tptr
+3);
1172 if (obj_tlen
< 4+namelen
)
1174 ND_PRINT((ndo
, "%s Session Name: ", ident
));
1175 for (i
= 0; i
< namelen
; i
++)
1176 safeputchar(ndo
, *(obj_tptr
+ 4 + i
));
1177 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1181 bittok2str(rsvp_session_attribute_flag_values
,
1185 obj_tlen
-=4+*(obj_tptr
+3);
1186 obj_tptr
+=4+*(obj_tptr
+3);
1193 case RSVP_OBJ_GENERALIZED_UNI
:
1194 switch(rsvp_obj_ctype
) {
1195 int subobj_type
,af
,subobj_len
,total_subobj_len
;
1202 /* read variable length subobjects */
1203 total_subobj_len
= obj_tlen
;
1204 while(total_subobj_len
> 0) {
1205 subobj_len
= EXTRACT_16BITS(obj_tptr
);
1206 subobj_type
= (EXTRACT_16BITS(obj_tptr
+2))>>8;
1207 af
= (EXTRACT_16BITS(obj_tptr
+2))&0x00FF;
1209 ND_PRINT((ndo
, "%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1211 tok2str(rsvp_obj_generalized_uni_values
, "Unknown", subobj_type
),
1213 tok2str(af_values
, "Unknown", af
), af
,
1219 switch(subobj_type
) {
1220 case RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
:
1221 case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
:
1227 ND_PRINT((ndo
, "%s UNI IPv4 TNA address: %s",
1228 ident
, ipaddr_string(ndo
, obj_tptr
+ 4)));
1231 if (subobj_len
< 20)
1233 ND_PRINT((ndo
, "%s UNI IPv6 TNA address: %s",
1234 ident
, ip6addr_string(ndo
, obj_tptr
+ 4)));
1238 /* unless we have a TLV parser lets just hexdump */
1245 case RSVP_GEN_UNI_SUBOBJ_DIVERSITY
:
1247 /* unless we have a TLV parser lets just hexdump */
1252 case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
:
1253 if (subobj_len
< 16) {
1257 ND_PRINT((ndo
, "%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
1259 ((EXTRACT_32BITS(obj_tptr
+4))>>31),
1260 ((EXTRACT_32BITS(obj_tptr
+4))&0xFF),
1261 EXTRACT_32BITS(obj_tptr
+8),
1262 EXTRACT_32BITS(obj_tptr
+ 12)));
1265 case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
:
1266 if (subobj_len
< 8) {
1270 ND_PRINT((ndo
, "%s Service level: %u",
1271 ident
, (EXTRACT_32BITS(obj_tptr
+ 4)) >> 24));
1278 total_subobj_len
-=subobj_len
;
1279 obj_tptr
+=subobj_len
;
1280 obj_tlen
+=subobj_len
;
1283 if (total_subobj_len
) {
1284 /* unless we have a TLV parser lets just hexdump */
1294 case RSVP_OBJ_RSVP_HOP
:
1295 switch(rsvp_obj_ctype
) {
1296 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1297 case RSVP_CTYPE_IPV4
:
1300 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1302 ipaddr_string(ndo
, obj_tptr
),
1303 EXTRACT_32BITS(obj_tptr
+ 4)));
1307 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1309 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1310 case RSVP_CTYPE_IPV6
:
1313 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1315 ip6addr_string(ndo
, obj_tptr
),
1316 EXTRACT_32BITS(obj_tptr
+ 16)));
1319 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1326 case RSVP_OBJ_TIME_VALUES
:
1327 switch(rsvp_obj_ctype
) {
1331 ND_PRINT((ndo
, "%s Refresh Period: %ums",
1333 EXTRACT_32BITS(obj_tptr
)));
1342 /* those three objects do share the same semantics */
1343 case RSVP_OBJ_SENDER_TSPEC
:
1344 case RSVP_OBJ_ADSPEC
:
1345 case RSVP_OBJ_FLOWSPEC
:
1346 switch(rsvp_obj_ctype
) {
1350 ND_PRINT((ndo
, "%s Msg-Version: %u, length: %u",
1352 (*obj_tptr
& 0xf0) >> 4,
1353 EXTRACT_16BITS(obj_tptr
+ 2) << 2));
1354 obj_tptr
+=4; /* get to the start of the service header */
1357 while (obj_tlen
>= 4) {
1358 intserv_serv_tlen
=EXTRACT_16BITS(obj_tptr
+2)<<2;
1359 ND_PRINT((ndo
, "%s Service Type: %s (%u), break bit %s set, Service length: %u",
1361 tok2str(rsvp_intserv_service_type_values
,"unknown",*(obj_tptr
)),
1363 (*(obj_tptr
+1)&0x80) ? "" : "not",
1364 intserv_serv_tlen
));
1366 obj_tptr
+=4; /* get to the start of the parameter list */
1369 while (intserv_serv_tlen
>=4) {
1370 processed
= rsvp_intserv_print(ndo
, obj_tptr
, obj_tlen
);
1373 obj_tlen
-=processed
;
1374 intserv_serv_tlen
-=processed
;
1375 obj_tptr
+=processed
;
1384 case RSVP_OBJ_FILTERSPEC
:
1385 switch(rsvp_obj_ctype
) {
1386 case RSVP_CTYPE_IPV4
:
1389 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1391 ipaddr_string(ndo
, obj_tptr
),
1392 EXTRACT_16BITS(obj_tptr
+ 6)));
1396 case RSVP_CTYPE_IPV6
:
1399 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1401 ip6addr_string(ndo
, obj_tptr
),
1402 EXTRACT_16BITS(obj_tptr
+ 18)));
1409 ND_PRINT((ndo
, "%s Source Address: %s, Flow Label: %u",
1411 ip6addr_string(ndo
, obj_tptr
),
1412 EXTRACT_24BITS(obj_tptr
+ 17)));
1416 case RSVP_CTYPE_TUNNEL_IPV6
:
1419 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1421 ipaddr_string(ndo
, obj_tptr
),
1422 EXTRACT_16BITS(obj_tptr
+ 18)));
1426 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
1429 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1430 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1432 ip6addr_string(ndo
, obj_tptr
),
1433 EXTRACT_16BITS(obj_tptr
+18),
1435 ip6addr_string(ndo
, obj_tptr
+20),
1436 EXTRACT_16BITS(obj_tptr
+ 38)));
1440 case RSVP_CTYPE_TUNNEL_IPV4
:
1443 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1445 ipaddr_string(ndo
, obj_tptr
),
1446 EXTRACT_16BITS(obj_tptr
+ 6)));
1450 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
1453 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1454 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1456 ipaddr_string(ndo
, obj_tptr
),
1457 EXTRACT_16BITS(obj_tptr
+6),
1459 ipaddr_string(ndo
, obj_tptr
+8),
1460 EXTRACT_16BITS(obj_tptr
+ 12)));
1469 case RSVP_OBJ_FASTREROUTE
:
1470 /* the differences between c-type 1 and 7 are minor */
1471 obj_ptr
.rsvp_obj_frr
= (const struct rsvp_obj_frr_t
*)obj_tptr
;
1472 bw
.i
= EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1474 switch(rsvp_obj_ctype
) {
1475 case RSVP_CTYPE_1
: /* new style */
1476 if (obj_tlen
< sizeof(struct rsvp_obj_frr_t
))
1478 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1480 (int)obj_ptr
.rsvp_obj_frr
->setup_prio
,
1481 (int)obj_ptr
.rsvp_obj_frr
->hold_prio
,
1482 (int)obj_ptr
.rsvp_obj_frr
->hop_limit
,
1483 bw
.f
* 8 / 1000000));
1484 ND_PRINT((ndo
, "%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
1486 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_any
),
1487 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->exclude_any
),
1488 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_all
)));
1489 obj_tlen
-=sizeof(struct rsvp_obj_frr_t
);
1490 obj_tptr
+=sizeof(struct rsvp_obj_frr_t
);
1493 case RSVP_CTYPE_TUNNEL_IPV4
: /* old style */
1496 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1498 (int)obj_ptr
.rsvp_obj_frr
->setup_prio
,
1499 (int)obj_ptr
.rsvp_obj_frr
->hold_prio
,
1500 (int)obj_ptr
.rsvp_obj_frr
->hop_limit
,
1501 bw
.f
* 8 / 1000000));
1502 ND_PRINT((ndo
, "%s Include Colors: 0x%08x, Exclude Colors: 0x%08x",
1504 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_any
),
1505 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->exclude_any
)));
1515 case RSVP_OBJ_DETOUR
:
1516 switch(rsvp_obj_ctype
) {
1517 case RSVP_CTYPE_TUNNEL_IPV4
:
1518 while(obj_tlen
>= 8) {
1519 ND_PRINT((ndo
, "%s PLR-ID: %s, Avoid-Node-ID: %s",
1521 ipaddr_string(ndo
, obj_tptr
),
1522 ipaddr_string(ndo
, obj_tptr
+ 4)));
1532 case RSVP_OBJ_CLASSTYPE
:
1533 case RSVP_OBJ_CLASSTYPE_OLD
: /* fall through */
1534 switch(rsvp_obj_ctype
) {
1536 ND_PRINT((ndo
, "%s CT: %u",
1538 EXTRACT_32BITS(obj_tptr
) & 0x7));
1547 case RSVP_OBJ_ERROR_SPEC
:
1548 switch(rsvp_obj_ctype
) {
1549 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1550 case RSVP_CTYPE_IPV4
:
1553 error_code
=*(obj_tptr
+5);
1554 error_value
=EXTRACT_16BITS(obj_tptr
+6);
1555 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1557 ipaddr_string(ndo
, obj_tptr
),
1560 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1562 switch (error_code
) {
1563 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1564 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1565 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1568 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
: /* fall through */
1569 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
:
1570 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1571 tok2str(rsvp_obj_error_code_diffserv_te_values
,"unknown",error_value
),
1575 ND_PRINT((ndo
, ", Unknown Error Value (%u)", error_value
));
1581 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1582 case RSVP_CTYPE_IPV6
:
1585 error_code
=*(obj_tptr
+17);
1586 error_value
=EXTRACT_16BITS(obj_tptr
+18);
1587 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1589 ip6addr_string(ndo
, obj_tptr
),
1592 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1595 switch (error_code
) {
1596 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1597 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1598 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1612 case RSVP_OBJ_PROPERTIES
:
1613 switch(rsvp_obj_ctype
) {
1617 padbytes
= EXTRACT_16BITS(obj_tptr
+2);
1618 ND_PRINT((ndo
, "%s TLV count: %u, padding bytes: %u",
1620 EXTRACT_16BITS(obj_tptr
),
1624 /* loop through as long there is anything longer than the TLV header (2) */
1625 while(obj_tlen
>= 2 + padbytes
) {
1626 ND_PRINT((ndo
, "%s %s TLV (0x%02x), length: %u", /* length includes header */
1628 tok2str(rsvp_obj_prop_tlv_values
,"unknown",*obj_tptr
),
1631 if (obj_tlen
< *(obj_tptr
+1))
1633 if (*(obj_tptr
+1) < 2)
1635 print_unknown_data(ndo
, obj_tptr
+ 2, "\n\t\t", *(obj_tptr
+ 1) - 2);
1636 obj_tlen
-=*(obj_tptr
+1);
1637 obj_tptr
+=*(obj_tptr
+1);
1645 case RSVP_OBJ_MESSAGE_ID
: /* fall through */
1646 case RSVP_OBJ_MESSAGE_ID_ACK
: /* fall through */
1647 case RSVP_OBJ_MESSAGE_ID_LIST
:
1648 switch(rsvp_obj_ctype
) {
1653 ND_PRINT((ndo
, "%s Flags [0x%02x], epoch: %u",
1656 EXTRACT_24BITS(obj_tptr
+ 1)));
1659 /* loop through as long there are no messages left */
1660 while(obj_tlen
>= 4) {
1661 ND_PRINT((ndo
, "%s Message-ID 0x%08x (%u)",
1663 EXTRACT_32BITS(obj_tptr
),
1664 EXTRACT_32BITS(obj_tptr
)));
1674 case RSVP_OBJ_INTEGRITY
:
1675 switch(rsvp_obj_ctype
) {
1677 if (obj_tlen
< sizeof(struct rsvp_obj_integrity_t
))
1679 obj_ptr
.rsvp_obj_integrity
= (const struct rsvp_obj_integrity_t
*)obj_tptr
;
1680 ND_PRINT((ndo
, "%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
1682 EXTRACT_16BITS(obj_ptr
.rsvp_obj_integrity
->key_id
),
1683 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->key_id
+2),
1684 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->sequence
),
1685 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->sequence
+4),
1686 bittok2str(rsvp_obj_integrity_flag_values
,
1688 obj_ptr
.rsvp_obj_integrity
->flags
)));
1689 ND_PRINT((ndo
, "%s MD5-sum 0x%08x%08x%08x%08x ",
1691 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
),
1692 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+4),
1693 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+8),
1694 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+ 12)));
1696 sigcheck
= signature_verify(ndo
, pptr
, plen
,
1697 obj_ptr
.rsvp_obj_integrity
->digest
,
1698 rsvp_clear_checksum
,
1700 ND_PRINT((ndo
, " (%s)", tok2str(signature_check_values
, "Unknown", sigcheck
)));
1702 obj_tlen
+=sizeof(struct rsvp_obj_integrity_t
);
1703 obj_tptr
+=sizeof(struct rsvp_obj_integrity_t
);
1710 case RSVP_OBJ_ADMIN_STATUS
:
1711 switch(rsvp_obj_ctype
) {
1715 ND_PRINT((ndo
, "%s Flags [%s]", ident
,
1716 bittok2str(rsvp_obj_admin_status_flag_values
, "none",
1717 EXTRACT_32BITS(obj_tptr
))));
1726 case RSVP_OBJ_LABEL_SET
:
1727 switch(rsvp_obj_ctype
) {
1731 action
= (EXTRACT_16BITS(obj_tptr
)>>8);
1733 ND_PRINT((ndo
, "%s Action: %s (%u), Label type: %u", ident
,
1734 tok2str(rsvp_obj_label_set_action_values
, "Unknown", action
),
1735 action
, ((EXTRACT_32BITS(obj_tptr
) & 0x7F))));
1738 case LABEL_SET_INCLUSIVE_RANGE
:
1739 case LABEL_SET_EXCLUSIVE_RANGE
: /* fall through */
1741 /* only a couple of subchannels are expected */
1744 ND_PRINT((ndo
, "%s Start range: %u, End range: %u", ident
,
1745 EXTRACT_32BITS(obj_tptr
+4),
1746 EXTRACT_32BITS(obj_tptr
+ 8)));
1755 while(obj_tlen
>= 4 ) {
1756 ND_PRINT((ndo
, "%s Subchannel #%u: %u", ident
, subchannel
,
1757 EXTRACT_32BITS(obj_tptr
)));
1770 switch (rsvp_obj_ctype
) {
1771 case RSVP_CTYPE_IPV4
:
1774 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1775 ident
, ipaddr_string(ndo
, obj_tptr
)));
1780 case RSVP_CTYPE_IPV6
:
1783 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1784 ident
, ip6addr_string(ndo
, obj_tptr
)));
1794 * FIXME those are the defined objects that lack a decoder
1795 * you are welcome to contribute code ;-)
1798 case RSVP_OBJ_SCOPE
:
1799 case RSVP_OBJ_POLICY_DATA
:
1800 case RSVP_OBJ_ACCEPT_LABEL_SET
:
1801 case RSVP_OBJ_PROTECTION
:
1803 if (ndo
->ndo_vflag
<= 1)
1804 print_unknown_data(ndo
, obj_tptr
, "\n\t ", obj_tlen
); /* FIXME indentation */
1807 /* do we also want to see a hex dump ? */
1808 if (ndo
->ndo_vflag
> 1 || hexdump
== TRUE
)
1809 print_unknown_data(ndo
, tptr
+ sizeof(struct rsvp_object_header
), "\n\t ", /* FIXME indentation */
1810 rsvp_obj_len
- sizeof(struct rsvp_object_header
));
1817 ND_PRINT((ndo
, "%s", istr
));
1820 ND_PRINT((ndo
, "\n\t\t"));
1821 ND_PRINT((ndo
, "%s", tstr
));
1826 rsvp_print(netdissect_options
*ndo
,
1827 register const u_char
*pptr
, register u_int len
)
1829 const struct rsvp_common_header
*rsvp_com_header
;
1835 rsvp_com_header
= (const struct rsvp_common_header
*)pptr
;
1836 ND_TCHECK(*rsvp_com_header
);
1839 * Sanity checking of the header.
1841 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1842 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1843 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1847 /* in non-verbose mode just lets print the basic Message Type*/
1848 if (ndo
->ndo_vflag
< 1) {
1849 ND_PRINT((ndo
, "RSVPv%u %s Message, length: %u",
1850 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1851 tok2str(rsvp_msg_type_values
, "unknown (%u)",rsvp_com_header
->msg_type
),
1856 /* ok they seem to want to know everything - lets fully decode it */
1858 plen
= tlen
= EXTRACT_16BITS(rsvp_com_header
->length
);
1860 ND_PRINT((ndo
, "\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1861 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1862 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1863 rsvp_com_header
->msg_type
,
1864 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1866 rsvp_com_header
->ttl
,
1867 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1869 if (tlen
< sizeof(const struct rsvp_common_header
)) {
1870 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", tlen
,
1871 (unsigned long)sizeof(const struct rsvp_common_header
)));
1875 tptr
+=sizeof(const struct rsvp_common_header
);
1876 tlen
-=sizeof(const struct rsvp_common_header
);
1878 switch(rsvp_com_header
->msg_type
) {
1880 case RSVP_MSGTYPE_BUNDLE
:
1882 * Process each submessage in the bundle message.
1883 * Bundle messages may not contain bundle submessages, so we don't
1884 * need to handle bundle submessages specially.
1887 const u_char
*subpptr
=tptr
, *subtptr
;
1888 u_short subplen
, subtlen
;
1892 rsvp_com_header
= (const struct rsvp_common_header
*)subpptr
;
1893 ND_TCHECK(*rsvp_com_header
);
1896 * Sanity checking of the header.
1898 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1899 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1900 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1904 subplen
= subtlen
= EXTRACT_16BITS(rsvp_com_header
->length
);
1906 ND_PRINT((ndo
, "\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1907 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1908 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1909 rsvp_com_header
->msg_type
,
1910 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1912 rsvp_com_header
->ttl
,
1913 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1915 if (subtlen
< sizeof(const struct rsvp_common_header
)) {
1916 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", subtlen
,
1917 (unsigned long)sizeof(const struct rsvp_common_header
)));
1921 if (tlen
< subtlen
) {
1922 ND_PRINT((ndo
, "ERROR: common header too large %u > %u", subtlen
,
1927 subtptr
+=sizeof(const struct rsvp_common_header
);
1928 subtlen
-=sizeof(const struct rsvp_common_header
);
1931 * Print all objects in the submessage.
1933 if (rsvp_obj_print(ndo
, subpptr
, subplen
, subtptr
, "\n\t ", subtlen
, rsvp_com_header
) == -1)
1936 tptr
+=subtlen
+sizeof(const struct rsvp_common_header
);
1937 tlen
-=subtlen
+sizeof(const struct rsvp_common_header
);
1942 case RSVP_MSGTYPE_PATH
:
1943 case RSVP_MSGTYPE_RESV
:
1944 case RSVP_MSGTYPE_PATHERR
:
1945 case RSVP_MSGTYPE_RESVERR
:
1946 case RSVP_MSGTYPE_PATHTEAR
:
1947 case RSVP_MSGTYPE_RESVTEAR
:
1948 case RSVP_MSGTYPE_RESVCONF
:
1949 case RSVP_MSGTYPE_HELLO_OLD
:
1950 case RSVP_MSGTYPE_HELLO
:
1951 case RSVP_MSGTYPE_ACK
:
1952 case RSVP_MSGTYPE_SREFRESH
:
1954 * Print all objects in the message.
1956 if (rsvp_obj_print(ndo
, pptr
, plen
, tptr
, "\n\t ", tlen
, rsvp_com_header
) == -1)
1961 print_unknown_data(ndo
, tptr
, "\n\t ", tlen
);
1967 ND_PRINT((ndo
, "\n\t\t"));
1968 ND_PRINT((ndo
, "%s", tstr
));