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 istr
[] = " (invalid)";
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_AGGREGATE 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_AGGREGATE
, "Aggregate" },
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 parameter_length
= EXTRACT_16BITS(tptr
+2)<<2; /* convert wordcount to bytecount */
503 ND_PRINT((ndo
, "\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
504 tok2str(rsvp_intserv_parameter_id_values
,"unknown",parameter_id
),
509 if (obj_tlen
< parameter_length
+4)
511 switch(parameter_id
) { /* parameter_id */
515 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
516 * | 4 (e) | (f) | 1 (g) |
517 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
518 * | IS hop cnt (32-bit unsigned integer) |
519 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
521 if (parameter_length
== 4)
522 ND_PRINT((ndo
, "\n\t\tIS hop count: %u", EXTRACT_32BITS(tptr
+ 4)));
527 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
528 * | 6 (h) | (i) | 1 (j) |
529 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
530 * | Path b/w estimate (32-bit IEEE floating point number) |
531 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
533 if (parameter_length
== 4) {
534 bw
.i
= EXTRACT_32BITS(tptr
+4);
535 ND_PRINT((ndo
, "\n\t\tPath b/w estimate: %.10g Mbps", bw
.f
/ 125000));
541 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
542 * | 8 (k) | (l) | 1 (m) |
543 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
544 * | Minimum path latency (32-bit integer) |
545 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
547 if (parameter_length
== 4) {
548 ND_PRINT((ndo
, "\n\t\tMinimum path latency: "));
549 if (EXTRACT_32BITS(tptr
+4) == 0xffffffff)
550 ND_PRINT((ndo
, "don't care"));
552 ND_PRINT((ndo
, "%u", EXTRACT_32BITS(tptr
+ 4)));
559 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
560 * | 10 (n) | (o) | 1 (p) |
561 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
562 * | Composed MTU (32-bit unsigned integer) |
563 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
565 if (parameter_length
== 4)
566 ND_PRINT((ndo
, "\n\t\tComposed MTU: %u bytes", EXTRACT_32BITS(tptr
+ 4)));
570 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
571 * | 127 (e) | 0 (f) | 5 (g) |
572 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
573 * | Token Bucket Rate [r] (32-bit IEEE floating point number) |
574 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
575 * | Token Bucket Size [b] (32-bit IEEE floating point number) |
576 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
577 * | Peak Data Rate [p] (32-bit IEEE floating point number) |
578 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
579 * | Minimum Policed Unit [m] (32-bit integer) |
580 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
581 * | Maximum Packet Size [M] (32-bit integer) |
582 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
585 if (parameter_length
== 20) {
586 bw
.i
= EXTRACT_32BITS(tptr
+4);
587 ND_PRINT((ndo
, "\n\t\tToken Bucket Rate: %.10g Mbps", bw
.f
/ 125000));
588 bw
.i
= EXTRACT_32BITS(tptr
+8);
589 ND_PRINT((ndo
, "\n\t\tToken Bucket Size: %.10g bytes", bw
.f
));
590 bw
.i
= EXTRACT_32BITS(tptr
+12);
591 ND_PRINT((ndo
, "\n\t\tPeak Data Rate: %.10g Mbps", bw
.f
/ 125000));
592 ND_PRINT((ndo
, "\n\t\tMinimum Policed Unit: %u bytes", EXTRACT_32BITS(tptr
+ 16)));
593 ND_PRINT((ndo
, "\n\t\tMaximum Packet Size: %u bytes", EXTRACT_32BITS(tptr
+ 20)));
599 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
600 * | 130 (h) | 0 (i) | 2 (j) |
601 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
602 * | Rate [R] (32-bit IEEE floating point number) |
603 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
604 * | Slack Term [S] (32-bit integer) |
605 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
608 if (parameter_length
== 8) {
609 bw
.i
= EXTRACT_32BITS(tptr
+4);
610 ND_PRINT((ndo
, "\n\t\tRate: %.10g Mbps", bw
.f
/ 125000));
611 ND_PRINT((ndo
, "\n\t\tSlack Term: %u", EXTRACT_32BITS(tptr
+ 8)));
619 if (parameter_length
== 4)
620 ND_PRINT((ndo
, "\n\t\tValue: %u", EXTRACT_32BITS(tptr
+ 4)));
624 if (ndo
->ndo_vflag
<= 1)
625 print_unknown_data(ndo
, tptr
+ 4, "\n\t\t", parameter_length
);
627 return (parameter_length
+4); /* header length 4 bytes */
631 rsvp_obj_print(netdissect_options
*ndo
,
633 #ifndef HAVE_LIBCRYPTO
637 #ifndef HAVE_LIBCRYPTO
640 , const u_char
*tptr
,
641 const char *ident
, u_int tlen
)
643 const struct rsvp_object_header
*rsvp_obj_header
;
644 const u_char
*obj_tptr
;
646 const struct rsvp_obj_integrity_t
*rsvp_obj_integrity
;
647 const struct rsvp_obj_frr_t
*rsvp_obj_frr
;
650 u_short rsvp_obj_len
,rsvp_obj_ctype
,obj_tlen
,intserv_serv_tlen
;
651 int hexdump
,processed
,padbytes
,error_code
,error_value
,i
,sigcheck
;
658 u_int action
, subchannel
;
660 while(tlen
>=sizeof(struct rsvp_object_header
)) {
661 /* did we capture enough for fully decoding the object header ? */
662 ND_TCHECK2(*tptr
, sizeof(struct rsvp_object_header
));
664 rsvp_obj_header
= (const struct rsvp_object_header
*)tptr
;
665 rsvp_obj_len
=EXTRACT_16BITS(rsvp_obj_header
->length
);
666 rsvp_obj_ctype
=rsvp_obj_header
->ctype
;
668 if(rsvp_obj_len
% 4) {
669 ND_PRINT((ndo
, "%sERROR: object header size %u not a multiple of 4", ident
, rsvp_obj_len
));
672 if(rsvp_obj_len
< sizeof(struct rsvp_object_header
)) {
673 ND_PRINT((ndo
, "%sERROR: object header too short %u < %lu", ident
, rsvp_obj_len
,
674 (unsigned long)sizeof(const struct rsvp_object_header
)));
678 ND_PRINT((ndo
, "%s%s Object (%u) Flags: [%s",
680 tok2str(rsvp_obj_values
,
682 rsvp_obj_header
->class_num
),
683 rsvp_obj_header
->class_num
,
684 ((rsvp_obj_header
->class_num
) & 0x80) ? "ignore" : "reject"));
686 if (rsvp_obj_header
->class_num
> 128)
687 ND_PRINT((ndo
, " %s",
688 ((rsvp_obj_header
->class_num
) & 0x40) ? "and forward" : "silently"));
690 ND_PRINT((ndo
, " if unknown], Class-Type: %s (%u), length: %u",
691 tok2str(rsvp_ctype_values
,
693 ((rsvp_obj_header
->class_num
)<<8)+rsvp_obj_ctype
),
697 if(tlen
< rsvp_obj_len
) {
698 ND_PRINT((ndo
, "%sERROR: object goes past end of objects TLV", ident
));
702 obj_tptr
=tptr
+sizeof(struct rsvp_object_header
);
703 obj_tlen
=rsvp_obj_len
-sizeof(struct rsvp_object_header
);
705 /* did we capture enough for fully decoding the object ? */
706 if (!ND_TTEST2(*tptr
, rsvp_obj_len
))
710 switch(rsvp_obj_header
->class_num
) {
711 case RSVP_OBJ_SESSION
:
712 switch(rsvp_obj_ctype
) {
713 case RSVP_CTYPE_IPV4
:
716 ND_PRINT((ndo
, "%s IPv4 DestAddress: %s, Protocol ID: 0x%02x",
718 ipaddr_string(ndo
, obj_tptr
),
719 *(obj_tptr
+ sizeof(struct in_addr
))));
720 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
723 EXTRACT_16BITS(obj_tptr
+ 6)));
727 case RSVP_CTYPE_IPV6
:
730 ND_PRINT((ndo
, "%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
732 ip6addr_string(ndo
, obj_tptr
),
733 *(obj_tptr
+ sizeof(struct in6_addr
))));
734 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
736 *(obj_tptr
+sizeof(struct in6_addr
)+1),
737 EXTRACT_16BITS(obj_tptr
+ sizeof(struct in6_addr
) + 2)));
742 case RSVP_CTYPE_TUNNEL_IPV6
:
745 ND_PRINT((ndo
, "%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
747 ip6addr_string(ndo
, obj_tptr
),
748 EXTRACT_16BITS(obj_tptr
+18),
749 ip6addr_string(ndo
, obj_tptr
+ 20)));
754 case RSVP_CTYPE_14
: /* IPv6 p2mp LSP Tunnel */
757 ND_PRINT((ndo
, "%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
759 EXTRACT_32BITS(obj_tptr
),
760 EXTRACT_16BITS(obj_tptr
+6),
761 ip6addr_string(ndo
, obj_tptr
+ 8)));
765 case RSVP_CTYPE_13
: /* IPv4 p2mp LSP Tunnel */
768 ND_PRINT((ndo
, "%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
770 ipaddr_string(ndo
, obj_tptr
),
771 EXTRACT_16BITS(obj_tptr
+6),
772 ipaddr_string(ndo
, obj_tptr
+ 8)));
776 case RSVP_CTYPE_TUNNEL_IPV4
:
777 case RSVP_CTYPE_UNI_IPV4
:
780 ND_PRINT((ndo
, "%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
782 ipaddr_string(ndo
, obj_tptr
),
783 EXTRACT_16BITS(obj_tptr
+6),
784 ipaddr_string(ndo
, obj_tptr
+ 8)));
793 case RSVP_OBJ_CONFIRM
:
794 switch(rsvp_obj_ctype
) {
795 case RSVP_CTYPE_IPV4
:
796 if (obj_tlen
< sizeof(struct in_addr
))
798 ND_PRINT((ndo
, "%s IPv4 Receiver Address: %s",
800 ipaddr_string(ndo
, obj_tptr
)));
801 obj_tlen
-=sizeof(struct in_addr
);
802 obj_tptr
+=sizeof(struct in_addr
);
804 case RSVP_CTYPE_IPV6
:
805 if (obj_tlen
< sizeof(struct in6_addr
))
807 ND_PRINT((ndo
, "%s IPv6 Receiver Address: %s",
809 ip6addr_string(ndo
, obj_tptr
)));
810 obj_tlen
-=sizeof(struct in6_addr
);
811 obj_tptr
+=sizeof(struct in6_addr
);
818 case RSVP_OBJ_NOTIFY_REQ
:
819 switch(rsvp_obj_ctype
) {
820 case RSVP_CTYPE_IPV4
:
821 if (obj_tlen
< sizeof(struct in_addr
))
823 ND_PRINT((ndo
, "%s IPv4 Notify Node Address: %s",
825 ipaddr_string(ndo
, obj_tptr
)));
826 obj_tlen
-=sizeof(struct in_addr
);
827 obj_tptr
+=sizeof(struct in_addr
);
829 case RSVP_CTYPE_IPV6
:
830 if (obj_tlen
< sizeof(struct in6_addr
))
832 ND_PRINT((ndo
, "%s IPv6 Notify Node Address: %s",
834 ip6addr_string(ndo
, obj_tptr
)));
835 obj_tlen
-=sizeof(struct in6_addr
);
836 obj_tptr
+=sizeof(struct in6_addr
);
843 case RSVP_OBJ_SUGGESTED_LABEL
: /* fall through */
844 case RSVP_OBJ_UPSTREAM_LABEL
: /* fall through */
845 case RSVP_OBJ_RECOVERY_LABEL
: /* fall through */
847 switch(rsvp_obj_ctype
) {
849 while(obj_tlen
>= 4 ) {
850 ND_PRINT((ndo
, "%s Label: %u", ident
, EXTRACT_32BITS(obj_tptr
)));
858 ND_PRINT((ndo
, "%s Generalized Label: %u",
860 EXTRACT_32BITS(obj_tptr
)));
867 ND_PRINT((ndo
, "%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
869 EXTRACT_32BITS(obj_tptr
),
871 EXTRACT_32BITS(obj_tptr
+4),
872 EXTRACT_32BITS(obj_tptr
+ 8)));
882 switch(rsvp_obj_ctype
) {
886 ND_PRINT((ndo
, "%s Reservation Style: %s, Flags: [0x%02x]",
888 tok2str(rsvp_resstyle_values
,
890 EXTRACT_24BITS(obj_tptr
+1)),
900 case RSVP_OBJ_SENDER_TEMPLATE
:
901 switch(rsvp_obj_ctype
) {
902 case RSVP_CTYPE_IPV4
:
905 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
907 ipaddr_string(ndo
, obj_tptr
),
908 EXTRACT_16BITS(obj_tptr
+ 6)));
912 case RSVP_CTYPE_IPV6
:
915 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
917 ip6addr_string(ndo
, obj_tptr
),
918 EXTRACT_16BITS(obj_tptr
+ 18)));
922 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
925 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
926 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
928 ip6addr_string(ndo
, obj_tptr
),
929 EXTRACT_16BITS(obj_tptr
+18),
931 ip6addr_string(ndo
, obj_tptr
+20),
932 EXTRACT_16BITS(obj_tptr
+ 38)));
936 case RSVP_CTYPE_TUNNEL_IPV4
:
939 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
941 ipaddr_string(ndo
, obj_tptr
),
942 EXTRACT_16BITS(obj_tptr
+ 6)));
946 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
949 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
950 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
952 ipaddr_string(ndo
, obj_tptr
),
953 EXTRACT_16BITS(obj_tptr
+6),
955 ipaddr_string(ndo
, obj_tptr
+8),
956 EXTRACT_16BITS(obj_tptr
+ 12)));
965 case RSVP_OBJ_LABEL_REQ
:
966 switch(rsvp_obj_ctype
) {
968 while(obj_tlen
>= 4 ) {
969 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
971 tok2str(ethertype_values
,
972 "Unknown Protocol (0x%04x)",
973 EXTRACT_16BITS(obj_tptr
+ 2))));
981 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
983 tok2str(ethertype_values
,
984 "Unknown Protocol (0x%04x)",
985 EXTRACT_16BITS(obj_tptr
+ 2))));
986 ND_PRINT((ndo
, ",%s merge capability",((*(obj_tptr
+ 4)) & 0x80) ? "no" : "" ));
987 ND_PRINT((ndo
, "%s Minimum VPI/VCI: %u/%u",
989 (EXTRACT_16BITS(obj_tptr
+4))&0xfff,
990 (EXTRACT_16BITS(obj_tptr
+ 6)) & 0xfff));
991 ND_PRINT((ndo
, "%s Maximum VPI/VCI: %u/%u",
993 (EXTRACT_16BITS(obj_tptr
+8))&0xfff,
994 (EXTRACT_16BITS(obj_tptr
+ 10)) & 0xfff));
1001 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
1003 tok2str(ethertype_values
,
1004 "Unknown Protocol (0x%04x)",
1005 EXTRACT_16BITS(obj_tptr
+ 2))));
1006 ND_PRINT((ndo
, "%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1008 (EXTRACT_32BITS(obj_tptr
+4))&0x7fffff,
1009 (EXTRACT_32BITS(obj_tptr
+8))&0x7fffff,
1010 (((EXTRACT_16BITS(obj_tptr
+4)>>7)&3) == 0 ) ? "10" : "",
1011 (((EXTRACT_16BITS(obj_tptr
+ 4) >> 7) & 3) == 2 ) ? "23" : ""));
1018 ND_PRINT((ndo
, "%s LSP Encoding Type: %s (%u)",
1020 tok2str(gmpls_encoding_values
,
1024 ND_PRINT((ndo
, "%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1026 tok2str(gmpls_switch_cap_values
,
1030 tok2str(gmpls_payload_values
,
1032 EXTRACT_16BITS(obj_tptr
+2)),
1033 EXTRACT_16BITS(obj_tptr
+ 2)));
1044 switch(rsvp_obj_ctype
) {
1045 case RSVP_CTYPE_IPV4
:
1046 while(obj_tlen
>= 4 ) {
1047 ND_PRINT((ndo
, "%s Subobject Type: %s, length %u",
1049 tok2str(rsvp_obj_xro_values
,
1051 RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)),
1054 if (*(obj_tptr
+1) == 0) { /* prevent infinite loops */
1055 ND_PRINT((ndo
, "%s ERROR: zero length ERO subtype", ident
));
1059 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)) {
1060 case RSVP_OBJ_XRO_IPV4
:
1061 ND_PRINT((ndo
, ", %s, %s/%u, Flags: [%s]",
1062 RSVP_OBJ_XRO_MASK_LOOSE(*obj_tptr
) ? "Loose" : "Strict",
1063 ipaddr_string(ndo
, obj_tptr
+2),
1065 bittok2str(rsvp_obj_rro_flag_values
,
1067 *(obj_tptr
+ 7)))); /* rfc3209 says that this field is rsvd. */
1069 case RSVP_OBJ_XRO_LABEL
:
1070 ND_PRINT((ndo
, ", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1071 bittok2str(rsvp_obj_rro_label_flag_values
,
1075 tok2str(rsvp_ctype_values
,
1077 *(obj_tptr
+3) + 256*RSVP_OBJ_RRO
),
1079 EXTRACT_32BITS(obj_tptr
+ 4)));
1081 obj_tlen
-=*(obj_tptr
+1);
1082 obj_tptr
+=*(obj_tptr
+1);
1090 case RSVP_OBJ_HELLO
:
1091 switch(rsvp_obj_ctype
) {
1096 ND_PRINT((ndo
, "%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1098 EXTRACT_32BITS(obj_tptr
),
1099 EXTRACT_32BITS(obj_tptr
+ 4)));
1108 case RSVP_OBJ_RESTART_CAPABILITY
:
1109 switch(rsvp_obj_ctype
) {
1113 ND_PRINT((ndo
, "%s Restart Time: %ums, Recovery Time: %ums",
1115 EXTRACT_32BITS(obj_tptr
),
1116 EXTRACT_32BITS(obj_tptr
+ 4)));
1125 case RSVP_OBJ_SESSION_ATTRIBUTE
:
1126 switch(rsvp_obj_ctype
) {
1127 case RSVP_CTYPE_TUNNEL_IPV4
:
1130 namelen
= *(obj_tptr
+3);
1131 if (obj_tlen
< 4+namelen
)
1133 ND_PRINT((ndo
, "%s Session Name: ", ident
));
1134 for (i
= 0; i
< namelen
; i
++)
1135 safeputchar(ndo
, *(obj_tptr
+ 4 + i
));
1136 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1140 bittok2str(rsvp_session_attribute_flag_values
,
1144 obj_tlen
-=4+*(obj_tptr
+3);
1145 obj_tptr
+=4+*(obj_tptr
+3);
1152 case RSVP_OBJ_GENERALIZED_UNI
:
1153 switch(rsvp_obj_ctype
) {
1154 int subobj_type
,af
,subobj_len
,total_subobj_len
;
1161 /* read variable length subobjects */
1162 total_subobj_len
= obj_tlen
;
1163 while(total_subobj_len
> 0) {
1164 subobj_len
= EXTRACT_16BITS(obj_tptr
);
1165 subobj_type
= (EXTRACT_16BITS(obj_tptr
+2))>>8;
1166 af
= (EXTRACT_16BITS(obj_tptr
+2))&0x00FF;
1168 ND_PRINT((ndo
, "%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1170 tok2str(rsvp_obj_generalized_uni_values
, "Unknown", subobj_type
),
1172 tok2str(af_values
, "Unknown", af
), af
,
1178 switch(subobj_type
) {
1179 case RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
:
1180 case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
:
1186 ND_PRINT((ndo
, "%s UNI IPv4 TNA address: %s",
1187 ident
, ipaddr_string(ndo
, obj_tptr
+ 4)));
1190 if (subobj_len
< 20)
1192 ND_PRINT((ndo
, "%s UNI IPv6 TNA address: %s",
1193 ident
, ip6addr_string(ndo
, obj_tptr
+ 4)));
1197 /* unless we have a TLV parser lets just hexdump */
1204 case RSVP_GEN_UNI_SUBOBJ_DIVERSITY
:
1206 /* unless we have a TLV parser lets just hexdump */
1211 case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
:
1212 if (subobj_len
< 16) {
1216 ND_PRINT((ndo
, "%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
1218 ((EXTRACT_32BITS(obj_tptr
+4))>>31),
1219 ((EXTRACT_32BITS(obj_tptr
+4))&0xFF),
1220 EXTRACT_32BITS(obj_tptr
+8),
1221 EXTRACT_32BITS(obj_tptr
+ 12)));
1224 case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
:
1225 if (subobj_len
< 8) {
1229 ND_PRINT((ndo
, "%s Service level: %u",
1230 ident
, (EXTRACT_32BITS(obj_tptr
+ 4)) >> 24));
1237 total_subobj_len
-=subobj_len
;
1238 obj_tptr
+=subobj_len
;
1239 obj_tlen
+=subobj_len
;
1242 if (total_subobj_len
) {
1243 /* unless we have a TLV parser lets just hexdump */
1253 case RSVP_OBJ_RSVP_HOP
:
1254 switch(rsvp_obj_ctype
) {
1255 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1256 case RSVP_CTYPE_IPV4
:
1259 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1261 ipaddr_string(ndo
, obj_tptr
),
1262 EXTRACT_32BITS(obj_tptr
+ 4)));
1266 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1268 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1269 case RSVP_CTYPE_IPV6
:
1272 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1274 ip6addr_string(ndo
, obj_tptr
),
1275 EXTRACT_32BITS(obj_tptr
+ 16)));
1278 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1285 case RSVP_OBJ_TIME_VALUES
:
1286 switch(rsvp_obj_ctype
) {
1290 ND_PRINT((ndo
, "%s Refresh Period: %ums",
1292 EXTRACT_32BITS(obj_tptr
)));
1301 /* those three objects do share the same semantics */
1302 case RSVP_OBJ_SENDER_TSPEC
:
1303 case RSVP_OBJ_ADSPEC
:
1304 case RSVP_OBJ_FLOWSPEC
:
1305 switch(rsvp_obj_ctype
) {
1309 ND_PRINT((ndo
, "%s Msg-Version: %u, length: %u",
1311 (*obj_tptr
& 0xf0) >> 4,
1312 EXTRACT_16BITS(obj_tptr
+ 2) << 2));
1313 obj_tptr
+=4; /* get to the start of the service header */
1316 while (obj_tlen
>= 4) {
1317 intserv_serv_tlen
=EXTRACT_16BITS(obj_tptr
+2)<<2;
1318 ND_PRINT((ndo
, "%s Service Type: %s (%u), break bit %s set, Service length: %u",
1320 tok2str(rsvp_intserv_service_type_values
,"unknown",*(obj_tptr
)),
1322 (*(obj_tptr
+1)&0x80) ? "" : "not",
1323 intserv_serv_tlen
));
1325 obj_tptr
+=4; /* get to the start of the parameter list */
1328 while (intserv_serv_tlen
>=4) {
1329 processed
= rsvp_intserv_print(ndo
, obj_tptr
, obj_tlen
);
1332 obj_tlen
-=processed
;
1333 intserv_serv_tlen
-=processed
;
1334 obj_tptr
+=processed
;
1343 case RSVP_OBJ_FILTERSPEC
:
1344 switch(rsvp_obj_ctype
) {
1345 case RSVP_CTYPE_IPV4
:
1348 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1350 ipaddr_string(ndo
, obj_tptr
),
1351 EXTRACT_16BITS(obj_tptr
+ 6)));
1355 case RSVP_CTYPE_IPV6
:
1358 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1360 ip6addr_string(ndo
, obj_tptr
),
1361 EXTRACT_16BITS(obj_tptr
+ 18)));
1368 ND_PRINT((ndo
, "%s Source Address: %s, Flow Label: %u",
1370 ip6addr_string(ndo
, obj_tptr
),
1371 EXTRACT_24BITS(obj_tptr
+ 17)));
1375 case RSVP_CTYPE_TUNNEL_IPV6
:
1378 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1380 ipaddr_string(ndo
, obj_tptr
),
1381 EXTRACT_16BITS(obj_tptr
+ 18)));
1385 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
1388 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1389 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1391 ip6addr_string(ndo
, obj_tptr
),
1392 EXTRACT_16BITS(obj_tptr
+18),
1394 ip6addr_string(ndo
, obj_tptr
+20),
1395 EXTRACT_16BITS(obj_tptr
+ 38)));
1399 case RSVP_CTYPE_TUNNEL_IPV4
:
1402 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1404 ipaddr_string(ndo
, obj_tptr
),
1405 EXTRACT_16BITS(obj_tptr
+ 6)));
1409 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
1412 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1413 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1415 ipaddr_string(ndo
, obj_tptr
),
1416 EXTRACT_16BITS(obj_tptr
+6),
1418 ipaddr_string(ndo
, obj_tptr
+8),
1419 EXTRACT_16BITS(obj_tptr
+ 12)));
1428 case RSVP_OBJ_FASTREROUTE
:
1429 /* the differences between c-type 1 and 7 are minor */
1430 obj_ptr
.rsvp_obj_frr
= (const struct rsvp_obj_frr_t
*)obj_tptr
;
1431 bw
.i
= EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1433 switch(rsvp_obj_ctype
) {
1434 case RSVP_CTYPE_1
: /* new style */
1435 if (obj_tlen
< sizeof(struct rsvp_obj_frr_t
))
1437 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1439 (int)obj_ptr
.rsvp_obj_frr
->setup_prio
,
1440 (int)obj_ptr
.rsvp_obj_frr
->hold_prio
,
1441 (int)obj_ptr
.rsvp_obj_frr
->hop_limit
,
1442 bw
.f
* 8 / 1000000));
1443 ND_PRINT((ndo
, "%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
1445 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_any
),
1446 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->exclude_any
),
1447 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_all
)));
1448 obj_tlen
-=sizeof(struct rsvp_obj_frr_t
);
1449 obj_tptr
+=sizeof(struct rsvp_obj_frr_t
);
1452 case RSVP_CTYPE_TUNNEL_IPV4
: /* old style */
1455 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1457 (int)obj_ptr
.rsvp_obj_frr
->setup_prio
,
1458 (int)obj_ptr
.rsvp_obj_frr
->hold_prio
,
1459 (int)obj_ptr
.rsvp_obj_frr
->hop_limit
,
1460 bw
.f
* 8 / 1000000));
1461 ND_PRINT((ndo
, "%s Include Colors: 0x%08x, Exclude Colors: 0x%08x",
1463 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_any
),
1464 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->exclude_any
)));
1474 case RSVP_OBJ_DETOUR
:
1475 switch(rsvp_obj_ctype
) {
1476 case RSVP_CTYPE_TUNNEL_IPV4
:
1477 while(obj_tlen
>= 8) {
1478 ND_PRINT((ndo
, "%s PLR-ID: %s, Avoid-Node-ID: %s",
1480 ipaddr_string(ndo
, obj_tptr
),
1481 ipaddr_string(ndo
, obj_tptr
+ 4)));
1491 case RSVP_OBJ_CLASSTYPE
:
1492 case RSVP_OBJ_CLASSTYPE_OLD
: /* fall through */
1493 switch(rsvp_obj_ctype
) {
1495 ND_PRINT((ndo
, "%s CT: %u",
1497 EXTRACT_32BITS(obj_tptr
) & 0x7));
1506 case RSVP_OBJ_ERROR_SPEC
:
1507 switch(rsvp_obj_ctype
) {
1508 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1509 case RSVP_CTYPE_IPV4
:
1512 error_code
=*(obj_tptr
+5);
1513 error_value
=EXTRACT_16BITS(obj_tptr
+6);
1514 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1516 ipaddr_string(ndo
, obj_tptr
),
1519 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1521 switch (error_code
) {
1522 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1523 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1524 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1527 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
: /* fall through */
1528 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
:
1529 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1530 tok2str(rsvp_obj_error_code_diffserv_te_values
,"unknown",error_value
),
1534 ND_PRINT((ndo
, ", Unknown Error Value (%u)", error_value
));
1540 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1541 case RSVP_CTYPE_IPV6
:
1544 error_code
=*(obj_tptr
+17);
1545 error_value
=EXTRACT_16BITS(obj_tptr
+18);
1546 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1548 ip6addr_string(ndo
, obj_tptr
),
1551 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1554 switch (error_code
) {
1555 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1556 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1557 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1571 case RSVP_OBJ_PROPERTIES
:
1572 switch(rsvp_obj_ctype
) {
1576 padbytes
= EXTRACT_16BITS(obj_tptr
+2);
1577 ND_PRINT((ndo
, "%s TLV count: %u, padding bytes: %u",
1579 EXTRACT_16BITS(obj_tptr
),
1583 /* loop through as long there is anything longer than the TLV header (2) */
1584 while(obj_tlen
>= 2 + padbytes
) {
1585 ND_PRINT((ndo
, "%s %s TLV (0x%02x), length: %u", /* length includes header */
1587 tok2str(rsvp_obj_prop_tlv_values
,"unknown",*obj_tptr
),
1590 if (obj_tlen
< *(obj_tptr
+1))
1592 if (*(obj_tptr
+1) < 2)
1594 print_unknown_data(ndo
, obj_tptr
+ 2, "\n\t\t", *(obj_tptr
+ 1) - 2);
1595 obj_tlen
-=*(obj_tptr
+1);
1596 obj_tptr
+=*(obj_tptr
+1);
1604 case RSVP_OBJ_MESSAGE_ID
: /* fall through */
1605 case RSVP_OBJ_MESSAGE_ID_ACK
: /* fall through */
1606 case RSVP_OBJ_MESSAGE_ID_LIST
:
1607 switch(rsvp_obj_ctype
) {
1612 ND_PRINT((ndo
, "%s Flags [0x%02x], epoch: %u",
1615 EXTRACT_24BITS(obj_tptr
+ 1)));
1618 /* loop through as long there are no messages left */
1619 while(obj_tlen
>= 4) {
1620 ND_PRINT((ndo
, "%s Message-ID 0x%08x (%u)",
1622 EXTRACT_32BITS(obj_tptr
),
1623 EXTRACT_32BITS(obj_tptr
)));
1633 case RSVP_OBJ_INTEGRITY
:
1634 switch(rsvp_obj_ctype
) {
1636 if (obj_tlen
< sizeof(struct rsvp_obj_integrity_t
))
1638 obj_ptr
.rsvp_obj_integrity
= (const struct rsvp_obj_integrity_t
*)obj_tptr
;
1639 ND_PRINT((ndo
, "%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
1641 EXTRACT_16BITS(obj_ptr
.rsvp_obj_integrity
->key_id
),
1642 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->key_id
+2),
1643 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->sequence
),
1644 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->sequence
+4),
1645 bittok2str(rsvp_obj_integrity_flag_values
,
1647 obj_ptr
.rsvp_obj_integrity
->flags
)));
1648 ND_PRINT((ndo
, "%s MD5-sum 0x%08x%08x%08x%08x ",
1650 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
),
1651 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+4),
1652 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+8),
1653 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+ 12)));
1655 #ifdef HAVE_LIBCRYPTO
1656 sigcheck
= signature_verify(ndo
, pptr
, plen
, (unsigned char *)obj_ptr
.\
1657 rsvp_obj_integrity
->digest
);
1659 sigcheck
= CANT_CHECK_SIGNATURE
;
1661 ND_PRINT((ndo
, " (%s)", tok2str(signature_check_values
, "Unknown", sigcheck
)));
1663 obj_tlen
+=sizeof(struct rsvp_obj_integrity_t
);
1664 obj_tptr
+=sizeof(struct rsvp_obj_integrity_t
);
1671 case RSVP_OBJ_ADMIN_STATUS
:
1672 switch(rsvp_obj_ctype
) {
1676 ND_PRINT((ndo
, "%s Flags [%s]", ident
,
1677 bittok2str(rsvp_obj_admin_status_flag_values
, "none",
1678 EXTRACT_32BITS(obj_tptr
))));
1687 case RSVP_OBJ_LABEL_SET
:
1688 switch(rsvp_obj_ctype
) {
1692 action
= (EXTRACT_16BITS(obj_tptr
)>>8);
1694 ND_PRINT((ndo
, "%s Action: %s (%u), Label type: %u", ident
,
1695 tok2str(rsvp_obj_label_set_action_values
, "Unknown", action
),
1696 action
, ((EXTRACT_32BITS(obj_tptr
) & 0x7F))));
1699 case LABEL_SET_INCLUSIVE_RANGE
:
1700 case LABEL_SET_EXCLUSIVE_RANGE
: /* fall through */
1702 /* only a couple of subchannels are expected */
1705 ND_PRINT((ndo
, "%s Start range: %u, End range: %u", ident
,
1706 EXTRACT_32BITS(obj_tptr
+4),
1707 EXTRACT_32BITS(obj_tptr
+ 8)));
1716 while(obj_tlen
>= 4 ) {
1717 ND_PRINT((ndo
, "%s Subchannel #%u: %u", ident
, subchannel
,
1718 EXTRACT_32BITS(obj_tptr
)));
1731 switch (rsvp_obj_ctype
) {
1732 case RSVP_CTYPE_IPV4
:
1735 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1736 ident
, ipaddr_string(ndo
, obj_tptr
)));
1741 case RSVP_CTYPE_IPV6
:
1744 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1745 ident
, ip6addr_string(ndo
, obj_tptr
)));
1755 * FIXME those are the defined objects that lack a decoder
1756 * you are welcome to contribute code ;-)
1759 case RSVP_OBJ_SCOPE
:
1760 case RSVP_OBJ_POLICY_DATA
:
1761 case RSVP_OBJ_ACCEPT_LABEL_SET
:
1762 case RSVP_OBJ_PROTECTION
:
1764 if (ndo
->ndo_vflag
<= 1)
1765 print_unknown_data(ndo
, obj_tptr
, "\n\t ", obj_tlen
); /* FIXME indentation */
1768 /* do we also want to see a hex dump ? */
1769 if (ndo
->ndo_vflag
> 1 || hexdump
== TRUE
)
1770 print_unknown_data(ndo
, tptr
+ sizeof(struct rsvp_object_header
), "\n\t ", /* FIXME indentation */
1771 rsvp_obj_len
- sizeof(struct rsvp_object_header
));
1778 ND_PRINT((ndo
, "%s", istr
));
1781 ND_PRINT((ndo
, "\n\t\t packet exceeded snapshot"));
1786 rsvp_print(netdissect_options
*ndo
,
1787 register const u_char
*pptr
, register u_int len
)
1789 struct rsvp_common_header
*rsvp_com_header
;
1790 const u_char
*tptr
,*subtptr
;
1791 u_short plen
, tlen
, subtlen
;
1795 rsvp_com_header
= (struct rsvp_common_header
*)pptr
;
1796 ND_TCHECK(*rsvp_com_header
);
1799 * Sanity checking of the header.
1801 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1802 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1803 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1807 /* in non-verbose mode just lets print the basic Message Type*/
1808 if (ndo
->ndo_vflag
< 1) {
1809 ND_PRINT((ndo
, "RSVPv%u %s Message, length: %u",
1810 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1811 tok2str(rsvp_msg_type_values
, "unknown (%u)",rsvp_com_header
->msg_type
),
1816 /* ok they seem to want to know everything - lets fully decode it */
1818 plen
= tlen
= EXTRACT_16BITS(rsvp_com_header
->length
);
1820 ND_PRINT((ndo
, "\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1821 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1822 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1823 rsvp_com_header
->msg_type
,
1824 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1826 rsvp_com_header
->ttl
,
1827 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1830 * Clear checksum prior to signature verification.
1832 rsvp_com_header
->checksum
[0] = 0;
1833 rsvp_com_header
->checksum
[1] = 0;
1835 if (tlen
< sizeof(const struct rsvp_common_header
)) {
1836 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", tlen
,
1837 (unsigned long)sizeof(const struct rsvp_common_header
)));
1841 tptr
+=sizeof(const struct rsvp_common_header
);
1842 tlen
-=sizeof(const struct rsvp_common_header
);
1844 switch(rsvp_com_header
->msg_type
) {
1846 case RSVP_MSGTYPE_AGGREGATE
:
1849 rsvp_com_header
= (struct rsvp_common_header
*)subtptr
;
1850 ND_TCHECK(*rsvp_com_header
);
1853 * Sanity checking of the header.
1855 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1856 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1857 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1860 subtlen
=EXTRACT_16BITS(rsvp_com_header
->length
);
1862 ND_PRINT((ndo
, "\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1863 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1864 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1865 rsvp_com_header
->msg_type
,
1866 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1868 rsvp_com_header
->ttl
,
1869 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1872 * Clear checksum prior to signature verification.
1874 rsvp_com_header
->checksum
[0] = 0;
1875 rsvp_com_header
->checksum
[1] = 0;
1877 if (subtlen
< sizeof(const struct rsvp_common_header
)) {
1878 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", subtlen
,
1879 (unsigned long)sizeof(const struct rsvp_common_header
)));
1883 if (tlen
< subtlen
) {
1884 ND_PRINT((ndo
, "ERROR: common header too large %u > %u", subtlen
,
1889 subtptr
+=sizeof(const struct rsvp_common_header
);
1890 subtlen
-=sizeof(const struct rsvp_common_header
);
1892 if (rsvp_obj_print(ndo
, pptr
, plen
, subtptr
, "\n\t ", subtlen
) == -1)
1895 tptr
+=subtlen
+sizeof(const struct rsvp_common_header
);
1896 tlen
-=subtlen
+sizeof(const struct rsvp_common_header
);
1901 case RSVP_MSGTYPE_PATH
:
1902 case RSVP_MSGTYPE_RESV
:
1903 case RSVP_MSGTYPE_PATHERR
:
1904 case RSVP_MSGTYPE_RESVERR
:
1905 case RSVP_MSGTYPE_PATHTEAR
:
1906 case RSVP_MSGTYPE_RESVTEAR
:
1907 case RSVP_MSGTYPE_RESVCONF
:
1908 case RSVP_MSGTYPE_HELLO_OLD
:
1909 case RSVP_MSGTYPE_HELLO
:
1910 case RSVP_MSGTYPE_ACK
:
1911 case RSVP_MSGTYPE_SREFRESH
:
1912 if (rsvp_obj_print(ndo
, pptr
, plen
, tptr
, "\n\t ", tlen
) == -1)
1917 print_unknown_data(ndo
, tptr
, "\n\t ", tlen
);
1923 ND_PRINT((ndo
, "\n\t\t packet exceeded snapshot"));