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 <tcpdump-stdinc.h>
24 #include "interface.h"
26 #include "addrtoname.h"
27 #include "ethertype.h"
30 #include "signature.h"
33 * RFC 2205 common header
36 * +-------------+-------------+-------------+-------------+
37 * | Vers | Flags| Msg Type | RSVP Checksum |
38 * +-------------+-------------+-------------+-------------+
39 * | Send_TTL | (Reserved) | RSVP Length |
40 * +-------------+-------------+-------------+-------------+
44 struct rsvp_common_header
{
45 uint8_t version_flags
;
54 * RFC2205 object header
58 * +-------------+-------------+-------------+-------------+
59 * | Length (bytes) | Class-Num | C-Type |
60 * +-------------+-------------+-------------+-------------+
62 * // (Object contents) //
64 * +-------------+-------------+-------------+-------------+
67 struct rsvp_object_header
{
73 #define RSVP_VERSION 1
74 #define RSVP_EXTRACT_VERSION(x) (((x)&0xf0)>>4)
75 #define RSVP_EXTRACT_FLAGS(x) ((x)&0x0f)
77 #define RSVP_MSGTYPE_PATH 1
78 #define RSVP_MSGTYPE_RESV 2
79 #define RSVP_MSGTYPE_PATHERR 3
80 #define RSVP_MSGTYPE_RESVERR 4
81 #define RSVP_MSGTYPE_PATHTEAR 5
82 #define RSVP_MSGTYPE_RESVTEAR 6
83 #define RSVP_MSGTYPE_RESVCONF 7
84 #define RSVP_MSGTYPE_AGGREGATE 12
85 #define RSVP_MSGTYPE_ACK 13
86 #define RSVP_MSGTYPE_HELLO_OLD 14 /* ancient Hellos */
87 #define RSVP_MSGTYPE_SREFRESH 15
88 #define RSVP_MSGTYPE_HELLO 20
90 static const struct tok rsvp_msg_type_values
[] = {
91 { RSVP_MSGTYPE_PATH
, "Path" },
92 { RSVP_MSGTYPE_RESV
, "Resv" },
93 { RSVP_MSGTYPE_PATHERR
, "PathErr" },
94 { RSVP_MSGTYPE_RESVERR
, "ResvErr" },
95 { RSVP_MSGTYPE_PATHTEAR
, "PathTear" },
96 { RSVP_MSGTYPE_RESVTEAR
, "ResvTear" },
97 { RSVP_MSGTYPE_RESVCONF
, "ResvConf" },
98 { RSVP_MSGTYPE_AGGREGATE
, "Aggregate" },
99 { RSVP_MSGTYPE_ACK
, "Acknowledgement" },
100 { RSVP_MSGTYPE_HELLO_OLD
, "Hello (Old)" },
101 { RSVP_MSGTYPE_SREFRESH
, "Refresh" },
102 { RSVP_MSGTYPE_HELLO
, "Hello" },
106 static const struct tok rsvp_header_flag_values
[] = {
107 { 0x01, "Refresh reduction capable" }, /* rfc2961 */
111 #define RSVP_OBJ_SESSION 1 /* rfc2205 */
112 #define RSVP_OBJ_RSVP_HOP 3 /* rfc2205, rfc3473 */
113 #define RSVP_OBJ_INTEGRITY 4 /* rfc2747 */
114 #define RSVP_OBJ_TIME_VALUES 5 /* rfc2205 */
115 #define RSVP_OBJ_ERROR_SPEC 6
116 #define RSVP_OBJ_SCOPE 7
117 #define RSVP_OBJ_STYLE 8 /* rfc2205 */
118 #define RSVP_OBJ_FLOWSPEC 9 /* rfc2215 */
119 #define RSVP_OBJ_FILTERSPEC 10 /* rfc2215 */
120 #define RSVP_OBJ_SENDER_TEMPLATE 11
121 #define RSVP_OBJ_SENDER_TSPEC 12 /* rfc2215 */
122 #define RSVP_OBJ_ADSPEC 13 /* rfc2215 */
123 #define RSVP_OBJ_POLICY_DATA 14
124 #define RSVP_OBJ_CONFIRM 15 /* rfc2205 */
125 #define RSVP_OBJ_LABEL 16 /* rfc3209 */
126 #define RSVP_OBJ_LABEL_REQ 19 /* rfc3209 */
127 #define RSVP_OBJ_ERO 20 /* rfc3209 */
128 #define RSVP_OBJ_RRO 21 /* rfc3209 */
129 #define RSVP_OBJ_HELLO 22 /* rfc3209 */
130 #define RSVP_OBJ_MESSAGE_ID 23 /* rfc2961 */
131 #define RSVP_OBJ_MESSAGE_ID_ACK 24 /* rfc2961 */
132 #define RSVP_OBJ_MESSAGE_ID_LIST 25 /* rfc2961 */
133 #define RSVP_OBJ_RECOVERY_LABEL 34 /* rfc3473 */
134 #define RSVP_OBJ_UPSTREAM_LABEL 35 /* rfc3473 */
135 #define RSVP_OBJ_LABEL_SET 36 /* rfc3473 */
136 #define RSVP_OBJ_PROTECTION 37 /* rfc3473 */
137 #define RSVP_OBJ_S2L 50 /* rfc4875 */
138 #define RSVP_OBJ_DETOUR 63 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07 */
139 #define RSVP_OBJ_CLASSTYPE 66 /* rfc4124 */
140 #define RSVP_OBJ_CLASSTYPE_OLD 125 /* draft-ietf-tewg-diff-te-proto-07 */
141 #define RSVP_OBJ_SUGGESTED_LABEL 129 /* rfc3473 */
142 #define RSVP_OBJ_ACCEPT_LABEL_SET 130 /* rfc3473 */
143 #define RSVP_OBJ_RESTART_CAPABILITY 131 /* rfc3473 */
144 #define RSVP_OBJ_NOTIFY_REQ 195 /* rfc3473 */
145 #define RSVP_OBJ_ADMIN_STATUS 196 /* rfc3473 */
146 #define RSVP_OBJ_PROPERTIES 204 /* juniper proprietary */
147 #define RSVP_OBJ_FASTREROUTE 205 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07 */
148 #define RSVP_OBJ_SESSION_ATTRIBUTE 207 /* rfc3209 */
149 #define RSVP_OBJ_GENERALIZED_UNI 229 /* OIF RSVP extensions UNI 1.0 Signaling, Rel. 2 */
150 #define RSVP_OBJ_CALL_ID 230 /* rfc3474 */
151 #define RSVP_OBJ_CALL_OPS 236 /* rfc3474 */
153 static const struct tok rsvp_obj_values
[] = {
154 { RSVP_OBJ_SESSION
, "Session" },
155 { RSVP_OBJ_RSVP_HOP
, "RSVP Hop" },
156 { RSVP_OBJ_INTEGRITY
, "Integrity" },
157 { RSVP_OBJ_TIME_VALUES
, "Time Values" },
158 { RSVP_OBJ_ERROR_SPEC
, "Error Spec" },
159 { RSVP_OBJ_SCOPE
, "Scope" },
160 { RSVP_OBJ_STYLE
, "Style" },
161 { RSVP_OBJ_FLOWSPEC
, "Flowspec" },
162 { RSVP_OBJ_FILTERSPEC
, "FilterSpec" },
163 { RSVP_OBJ_SENDER_TEMPLATE
, "Sender Template" },
164 { RSVP_OBJ_SENDER_TSPEC
, "Sender TSpec" },
165 { RSVP_OBJ_ADSPEC
, "Adspec" },
166 { RSVP_OBJ_POLICY_DATA
, "Policy Data" },
167 { RSVP_OBJ_CONFIRM
, "Confirm" },
168 { RSVP_OBJ_LABEL
, "Label" },
169 { RSVP_OBJ_LABEL_REQ
, "Label Request" },
170 { RSVP_OBJ_ERO
, "ERO" },
171 { RSVP_OBJ_RRO
, "RRO" },
172 { RSVP_OBJ_HELLO
, "Hello" },
173 { RSVP_OBJ_MESSAGE_ID
, "Message ID" },
174 { RSVP_OBJ_MESSAGE_ID_ACK
, "Message ID Ack" },
175 { RSVP_OBJ_MESSAGE_ID_LIST
, "Message ID List" },
176 { RSVP_OBJ_RECOVERY_LABEL
, "Recovery Label" },
177 { RSVP_OBJ_UPSTREAM_LABEL
, "Upstream Label" },
178 { RSVP_OBJ_LABEL_SET
, "Label Set" },
179 { RSVP_OBJ_ACCEPT_LABEL_SET
, "Acceptable Label Set" },
180 { RSVP_OBJ_DETOUR
, "Detour" },
181 { RSVP_OBJ_CLASSTYPE
, "Class Type" },
182 { RSVP_OBJ_CLASSTYPE_OLD
, "Class Type (old)" },
183 { RSVP_OBJ_SUGGESTED_LABEL
, "Suggested Label" },
184 { RSVP_OBJ_PROPERTIES
, "Properties" },
185 { RSVP_OBJ_FASTREROUTE
, "Fast Re-Route" },
186 { RSVP_OBJ_SESSION_ATTRIBUTE
, "Session Attribute" },
187 { RSVP_OBJ_GENERALIZED_UNI
, "Generalized UNI" },
188 { RSVP_OBJ_CALL_ID
, "Call-ID" },
189 { RSVP_OBJ_CALL_OPS
, "Call Capability" },
190 { RSVP_OBJ_RESTART_CAPABILITY
, "Restart Capability" },
191 { RSVP_OBJ_NOTIFY_REQ
, "Notify Request" },
192 { RSVP_OBJ_PROTECTION
, "Protection" },
193 { RSVP_OBJ_ADMIN_STATUS
, "Administrative Status" },
194 { RSVP_OBJ_S2L
, "Sub-LSP to LSP" },
198 #define RSVP_CTYPE_IPV4 1
199 #define RSVP_CTYPE_IPV6 2
200 #define RSVP_CTYPE_TUNNEL_IPV4 7
201 #define RSVP_CTYPE_TUNNEL_IPV6 8
202 #define RSVP_CTYPE_UNI_IPV4 11 /* OIF RSVP extensions UNI 1.0 Signaling Rel. 2 */
203 #define RSVP_CTYPE_1 1
204 #define RSVP_CTYPE_2 2
205 #define RSVP_CTYPE_3 3
206 #define RSVP_CTYPE_4 4
207 #define RSVP_CTYPE_12 12
208 #define RSVP_CTYPE_13 13
209 #define RSVP_CTYPE_14 14
212 * the ctypes are not globally unique so for
213 * translating it to strings we build a table based
214 * on objects offsetted by the ctype
217 static const struct tok rsvp_ctype_values
[] = {
218 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV4
, "IPv4" },
219 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV6
, "IPv6" },
220 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
221 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
222 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV4
, "IPv4" },
223 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV6
, "IPv6" },
224 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV4
, "IPv4" },
225 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV6
, "IPv6" },
226 { 256*RSVP_OBJ_TIME_VALUES
+RSVP_CTYPE_1
, "1" },
227 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_1
, "obsolete" },
228 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_2
, "IntServ" },
229 { 256*RSVP_OBJ_SENDER_TSPEC
+RSVP_CTYPE_2
, "IntServ" },
230 { 256*RSVP_OBJ_ADSPEC
+RSVP_CTYPE_2
, "IntServ" },
231 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
232 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
233 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_3
, "IPv6 Flow-label" },
234 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
235 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
236 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
237 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV4
, "IPv4" },
238 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV6
, "IPv6" },
239 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
240 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_UNI_IPV4
, "UNI IPv4" },
241 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_13
, "IPv4 P2MP LSP Tunnel" },
242 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_14
, "IPv6 P2MP LSP Tunnel" },
243 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV4
, "IPv4" },
244 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV6
, "IPv6" },
245 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
246 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
247 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
248 { 256*RSVP_OBJ_MESSAGE_ID
+RSVP_CTYPE_1
, "1" },
249 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_1
, "Message id ack" },
250 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_2
, "Message id nack" },
251 { 256*RSVP_OBJ_MESSAGE_ID_LIST
+RSVP_CTYPE_1
, "1" },
252 { 256*RSVP_OBJ_STYLE
+RSVP_CTYPE_1
, "1" },
253 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_1
, "Hello Request" },
254 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_2
, "Hello Ack" },
255 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_1
, "without label range" },
256 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_2
, "with ATM label range" },
257 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_3
, "with FR label range" },
258 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_4
, "Generalized Label" },
259 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_1
, "Label" },
260 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
261 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
262 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_1
, "Label" },
263 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
264 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
265 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_1
, "Label" },
266 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
267 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
268 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_1
, "Label" },
269 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
270 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
271 { 256*RSVP_OBJ_ERO
+RSVP_CTYPE_IPV4
, "IPv4" },
272 { 256*RSVP_OBJ_RRO
+RSVP_CTYPE_IPV4
, "IPv4" },
273 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
274 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
275 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
276 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
277 { 256*RSVP_OBJ_RESTART_CAPABILITY
+RSVP_CTYPE_1
, "IPv4" },
278 { 256*RSVP_OBJ_SESSION_ATTRIBUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
279 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" }, /* old style*/
280 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_1
, "1" }, /* new style */
281 { 256*RSVP_OBJ_DETOUR
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
282 { 256*RSVP_OBJ_PROPERTIES
+RSVP_CTYPE_1
, "1" },
283 { 256*RSVP_OBJ_ADMIN_STATUS
+RSVP_CTYPE_1
, "1" },
284 { 256*RSVP_OBJ_CLASSTYPE
+RSVP_CTYPE_1
, "1" },
285 { 256*RSVP_OBJ_CLASSTYPE_OLD
+RSVP_CTYPE_1
, "1" },
286 { 256*RSVP_OBJ_LABEL_SET
+RSVP_CTYPE_1
, "1" },
287 { 256*RSVP_OBJ_GENERALIZED_UNI
+RSVP_CTYPE_1
, "1" },
288 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV4
, "IPv4 sub-LSP" },
289 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV6
, "IPv6 sub-LSP" },
293 struct rsvp_obj_integrity_t
{
301 static const struct tok rsvp_obj_integrity_flag_values
[] = {
302 { 0x80, "Handshake" },
306 struct rsvp_obj_frr_t
{
311 uint8_t bandwidth
[4];
312 uint8_t include_any
[4];
313 uint8_t exclude_any
[4];
314 uint8_t include_all
[4];
318 #define RSVP_OBJ_XRO_MASK_SUBOBJ(x) ((x)&0x7f)
319 #define RSVP_OBJ_XRO_MASK_LOOSE(x) ((x)&0x80)
321 #define RSVP_OBJ_XRO_RES 0
322 #define RSVP_OBJ_XRO_IPV4 1
323 #define RSVP_OBJ_XRO_IPV6 2
324 #define RSVP_OBJ_XRO_LABEL 3
325 #define RSVP_OBJ_XRO_ASN 32
326 #define RSVP_OBJ_XRO_MPLS 64
328 static const struct tok rsvp_obj_xro_values
[] = {
329 { RSVP_OBJ_XRO_RES
, "Reserved" },
330 { RSVP_OBJ_XRO_IPV4
, "IPv4 prefix" },
331 { RSVP_OBJ_XRO_IPV6
, "IPv6 prefix" },
332 { RSVP_OBJ_XRO_LABEL
, "Label" },
333 { RSVP_OBJ_XRO_ASN
, "Autonomous system number" },
334 { RSVP_OBJ_XRO_MPLS
, "MPLS label switched path termination" },
338 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07.txt */
339 static const struct tok rsvp_obj_rro_flag_values
[] = {
340 { 0x01, "Local protection available" },
341 { 0x02, "Local protection in use" },
342 { 0x04, "Bandwidth protection" },
343 { 0x08, "Node protection" },
348 static const struct tok rsvp_obj_rro_label_flag_values
[] = {
353 static const struct tok rsvp_resstyle_values
[] = {
354 { 17, "Wildcard Filter" },
355 { 10, "Fixed Filter" },
356 { 18, "Shared Explicit" },
360 #define RSVP_OBJ_INTSERV_GUARANTEED_SERV 2
361 #define RSVP_OBJ_INTSERV_CONTROLLED_LOAD 5
363 static const struct tok rsvp_intserv_service_type_values
[] = {
364 { 1, "Default/Global Information" },
365 { RSVP_OBJ_INTSERV_GUARANTEED_SERV
, "Guaranteed Service" },
366 { RSVP_OBJ_INTSERV_CONTROLLED_LOAD
, "Controlled Load" },
370 static const struct tok rsvp_intserv_parameter_id_values
[] = {
372 { 6, "Path b/w estimate" },
373 { 8, "Minimum path latency" },
374 { 10, "Composed MTU" },
375 { 127, "Token Bucket TSpec" },
376 { 130, "Guaranteed Service RSpec" },
377 { 133, "End-to-end composed value for C" },
378 { 134, "End-to-end composed value for D" },
379 { 135, "Since-last-reshaping point composed C" },
380 { 136, "Since-last-reshaping point composed D" },
384 static const struct tok rsvp_session_attribute_flag_values
[] = {
385 { 0x01, "Local Protection" },
386 { 0x02, "Label Recording" },
387 { 0x04, "SE Style" },
388 { 0x08, "Bandwidth protection" }, /* RFC4090 */
389 { 0x10, "Node protection" }, /* RFC4090 */
393 static const struct tok rsvp_obj_prop_tlv_values
[] = {
395 { 0x02, "Metric 1" },
396 { 0x04, "Metric 2" },
397 { 0x08, "CCC Status" },
398 { 0x10, "Path Type" },
402 #define RSVP_OBJ_ERROR_SPEC_CODE_ROUTING 24
403 #define RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY 25
404 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE 28
405 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD 125
407 static const struct tok rsvp_obj_error_code_values
[] = {
408 { RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
, "Routing Problem" },
409 { RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY
, "Notify Error" },
410 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
, "Diffserv TE Error" },
411 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
, "Diffserv TE Error (Old)" },
415 static const struct tok rsvp_obj_error_code_routing_values
[] = {
416 { 1, "Bad EXPLICIT_ROUTE object" },
417 { 2, "Bad strict node" },
418 { 3, "Bad loose node" },
419 { 4, "Bad initial subobject" },
420 { 5, "No route available toward destination" },
421 { 6, "Unacceptable label value" },
422 { 7, "RRO indicated routing loops" },
423 { 8, "non-RSVP-capable router in the path" },
424 { 9, "MPLS label allocation failure" },
425 { 10, "Unsupported L3PID" },
429 static const struct tok rsvp_obj_error_code_diffserv_te_values
[] = {
430 { 1, "Unexpected CT object" },
431 { 2, "Unsupported CT" },
432 { 3, "Invalid CT value" },
433 { 4, "CT/setup priority do not form a configured TE-Class" },
434 { 5, "CT/holding priority do not form a configured TE-Class" },
435 { 6, "CT/setup priority and CT/holding priority do not form a configured TE-Class" },
436 { 7, "Inconsistency between signaled PSC and signaled CT" },
437 { 8, "Inconsistency between signaled PHBs and signaled CT" },
441 /* rfc3473 / rfc 3471 */
442 static const struct tok rsvp_obj_admin_status_flag_values
[] = {
443 { 0x80000000, "Reflect" },
444 { 0x00000004, "Testing" },
445 { 0x00000002, "Admin-down" },
446 { 0x00000001, "Delete-in-progress" },
450 /* label set actions - rfc3471 */
451 #define LABEL_SET_INCLUSIVE_LIST 0
452 #define LABEL_SET_EXCLUSIVE_LIST 1
453 #define LABEL_SET_INCLUSIVE_RANGE 2
454 #define LABEL_SET_EXCLUSIVE_RANGE 3
456 static const struct tok rsvp_obj_label_set_action_values
[] = {
457 { LABEL_SET_INCLUSIVE_LIST
, "Inclusive list" },
458 { LABEL_SET_EXCLUSIVE_LIST
, "Exclusive list" },
459 { LABEL_SET_INCLUSIVE_RANGE
, "Inclusive range" },
460 { LABEL_SET_EXCLUSIVE_RANGE
, "Exclusive range" },
464 /* OIF RSVP extensions UNI 1.0 Signaling, release 2 */
465 #define RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS 1
466 #define RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS 2
467 #define RSVP_GEN_UNI_SUBOBJ_DIVERSITY 3
468 #define RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL 4
469 #define RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL 5
471 static const struct tok rsvp_obj_generalized_uni_values
[] = {
472 { RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
, "Source TNA address" },
473 { RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
, "Destination TNA address" },
474 { RSVP_GEN_UNI_SUBOBJ_DIVERSITY
, "Diversity" },
475 { RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
, "Egress label" },
476 { RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
, "Service level" },
481 * this is a dissector for all the intserv defined
482 * specs as defined per rfc2215
483 * it is called from various rsvp objects;
484 * returns the amount of bytes being processed
487 rsvp_intserv_print(netdissect_options
*ndo
,
488 const u_char
*tptr
, u_short obj_tlen
)
490 int parameter_id
,parameter_length
;
498 parameter_id
= *(tptr
);
499 parameter_length
= EXTRACT_16BITS(tptr
+2)<<2; /* convert wordcount to bytecount */
501 ND_PRINT((ndo
, "\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
502 tok2str(rsvp_intserv_parameter_id_values
,"unknown",parameter_id
),
507 if (obj_tlen
< parameter_length
+4)
509 switch(parameter_id
) { /* parameter_id */
513 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
514 * | 4 (e) | (f) | 1 (g) |
515 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
516 * | IS hop cnt (32-bit unsigned integer) |
517 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
519 if (parameter_length
== 4)
520 ND_PRINT((ndo
, "\n\t\tIS hop count: %u", EXTRACT_32BITS(tptr
+ 4)));
525 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
526 * | 6 (h) | (i) | 1 (j) |
527 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
528 * | Path b/w estimate (32-bit IEEE floating point number) |
529 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
531 if (parameter_length
== 4) {
532 bw
.i
= EXTRACT_32BITS(tptr
+4);
533 ND_PRINT((ndo
, "\n\t\tPath b/w estimate: %.10g Mbps", bw
.f
/ 125000));
539 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
540 * | 8 (k) | (l) | 1 (m) |
541 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
542 * | Minimum path latency (32-bit integer) |
543 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
545 if (parameter_length
== 4) {
546 ND_PRINT((ndo
, "\n\t\tMinimum path latency: "));
547 if (EXTRACT_32BITS(tptr
+4) == 0xffffffff)
548 ND_PRINT((ndo
, "don't care"));
550 ND_PRINT((ndo
, "%u", EXTRACT_32BITS(tptr
+ 4)));
557 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
558 * | 10 (n) | (o) | 1 (p) |
559 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
560 * | Composed MTU (32-bit unsigned integer) |
561 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
563 if (parameter_length
== 4)
564 ND_PRINT((ndo
, "\n\t\tComposed MTU: %u bytes", EXTRACT_32BITS(tptr
+ 4)));
568 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
569 * | 127 (e) | 0 (f) | 5 (g) |
570 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
571 * | Token Bucket Rate [r] (32-bit IEEE floating point number) |
572 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
573 * | Token Bucket Size [b] (32-bit IEEE floating point number) |
574 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
575 * | Peak Data Rate [p] (32-bit IEEE floating point number) |
576 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
577 * | Minimum Policed Unit [m] (32-bit integer) |
578 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
579 * | Maximum Packet Size [M] (32-bit integer) |
580 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
583 if (parameter_length
== 20) {
584 bw
.i
= EXTRACT_32BITS(tptr
+4);
585 ND_PRINT((ndo
, "\n\t\tToken Bucket Rate: %.10g Mbps", bw
.f
/ 125000));
586 bw
.i
= EXTRACT_32BITS(tptr
+8);
587 ND_PRINT((ndo
, "\n\t\tToken Bucket Size: %.10g bytes", bw
.f
));
588 bw
.i
= EXTRACT_32BITS(tptr
+12);
589 ND_PRINT((ndo
, "\n\t\tPeak Data Rate: %.10g Mbps", bw
.f
/ 125000));
590 ND_PRINT((ndo
, "\n\t\tMinimum Policed Unit: %u bytes", EXTRACT_32BITS(tptr
+ 16)));
591 ND_PRINT((ndo
, "\n\t\tMaximum Packet Size: %u bytes", EXTRACT_32BITS(tptr
+ 20)));
597 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
598 * | 130 (h) | 0 (i) | 2 (j) |
599 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
600 * | Rate [R] (32-bit IEEE floating point number) |
601 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
602 * | Slack Term [S] (32-bit integer) |
603 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
606 if (parameter_length
== 8) {
607 bw
.i
= EXTRACT_32BITS(tptr
+4);
608 ND_PRINT((ndo
, "\n\t\tRate: %.10g Mbps", bw
.f
/ 125000));
609 ND_PRINT((ndo
, "\n\t\tSlack Term: %u", EXTRACT_32BITS(tptr
+ 8)));
617 if (parameter_length
== 4)
618 ND_PRINT((ndo
, "\n\t\tValue: %u", EXTRACT_32BITS(tptr
+ 4)));
622 if (ndo
->ndo_vflag
<= 1)
623 print_unknown_data(ndo
, tptr
+ 4, "\n\t\t", parameter_length
);
625 return (parameter_length
+4); /* header length 4 bytes */
629 rsvp_obj_print(netdissect_options
*ndo
,
631 #ifndef HAVE_LIBCRYPTO
635 #ifndef HAVE_LIBCRYPTO
638 , const u_char
*tptr
,
639 const char *ident
, u_int tlen
)
641 const struct rsvp_object_header
*rsvp_obj_header
;
642 const u_char
*obj_tptr
;
644 const struct rsvp_obj_integrity_t
*rsvp_obj_integrity
;
645 const struct rsvp_obj_frr_t
*rsvp_obj_frr
;
648 u_short rsvp_obj_len
,rsvp_obj_ctype
,obj_tlen
,intserv_serv_tlen
;
649 int hexdump
,processed
,padbytes
,error_code
,error_value
,i
,sigcheck
;
656 u_int action
, subchannel
;
658 while(tlen
>=sizeof(struct rsvp_object_header
)) {
659 /* did we capture enough for fully decoding the object header ? */
660 ND_TCHECK2(*tptr
, sizeof(struct rsvp_object_header
));
662 rsvp_obj_header
= (const struct rsvp_object_header
*)tptr
;
663 rsvp_obj_len
=EXTRACT_16BITS(rsvp_obj_header
->length
);
664 rsvp_obj_ctype
=rsvp_obj_header
->ctype
;
666 if(rsvp_obj_len
% 4) {
667 ND_PRINT((ndo
, "%sERROR: object header size %u not a multiple of 4", ident
, rsvp_obj_len
));
670 if(rsvp_obj_len
< sizeof(struct rsvp_object_header
)) {
671 ND_PRINT((ndo
, "%sERROR: object header too short %u < %lu", ident
, rsvp_obj_len
,
672 (unsigned long)sizeof(const struct rsvp_object_header
)));
676 ND_PRINT((ndo
, "%s%s Object (%u) Flags: [%s",
678 tok2str(rsvp_obj_values
,
680 rsvp_obj_header
->class_num
),
681 rsvp_obj_header
->class_num
,
682 ((rsvp_obj_header
->class_num
) & 0x80) ? "ignore" : "reject"));
684 if (rsvp_obj_header
->class_num
> 128)
685 ND_PRINT((ndo
, " %s",
686 ((rsvp_obj_header
->class_num
) & 0x40) ? "and forward" : "silently"));
688 ND_PRINT((ndo
, " if unknown], Class-Type: %s (%u), length: %u",
689 tok2str(rsvp_ctype_values
,
691 ((rsvp_obj_header
->class_num
)<<8)+rsvp_obj_ctype
),
695 if(tlen
< rsvp_obj_len
) {
696 ND_PRINT((ndo
, "%sERROR: object goes past end of objects TLV", ident
));
700 obj_tptr
=tptr
+sizeof(struct rsvp_object_header
);
701 obj_tlen
=rsvp_obj_len
-sizeof(struct rsvp_object_header
);
703 /* did we capture enough for fully decoding the object ? */
704 if (!ND_TTEST2(*tptr
, rsvp_obj_len
))
708 switch(rsvp_obj_header
->class_num
) {
709 case RSVP_OBJ_SESSION
:
710 switch(rsvp_obj_ctype
) {
711 case RSVP_CTYPE_IPV4
:
714 ND_PRINT((ndo
, "%s IPv4 DestAddress: %s, Protocol ID: 0x%02x",
716 ipaddr_string(ndo
, obj_tptr
),
717 *(obj_tptr
+ sizeof(struct in_addr
))));
718 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
721 EXTRACT_16BITS(obj_tptr
+ 6)));
726 case RSVP_CTYPE_IPV6
:
729 ND_PRINT((ndo
, "%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
731 ip6addr_string(ndo
, obj_tptr
),
732 *(obj_tptr
+ sizeof(struct in6_addr
))));
733 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
735 *(obj_tptr
+sizeof(struct in6_addr
)+1),
736 EXTRACT_16BITS(obj_tptr
+ sizeof(struct in6_addr
) + 2)));
741 case RSVP_CTYPE_TUNNEL_IPV6
:
744 ND_PRINT((ndo
, "%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
746 ip6addr_string(ndo
, obj_tptr
),
747 EXTRACT_16BITS(obj_tptr
+18),
748 ip6addr_string(ndo
, obj_tptr
+ 20)));
753 case RSVP_CTYPE_14
: /* IPv6 p2mp LSP Tunnel */
756 ND_PRINT((ndo
, "%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
758 EXTRACT_32BITS(obj_tptr
),
759 EXTRACT_16BITS(obj_tptr
+6),
760 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
);
805 case RSVP_CTYPE_IPV6
:
806 if (obj_tlen
< sizeof(struct in6_addr
))
808 ND_PRINT((ndo
, "%s IPv6 Receiver Address: %s",
810 ip6addr_string(ndo
, obj_tptr
)));
811 obj_tlen
-=sizeof(struct in6_addr
);
812 obj_tptr
+=sizeof(struct in6_addr
);
820 case RSVP_OBJ_NOTIFY_REQ
:
821 switch(rsvp_obj_ctype
) {
822 case RSVP_CTYPE_IPV4
:
823 if (obj_tlen
< sizeof(struct in_addr
))
825 ND_PRINT((ndo
, "%s IPv4 Notify Node Address: %s",
827 ipaddr_string(ndo
, obj_tptr
)));
828 obj_tlen
-=sizeof(struct in_addr
);
829 obj_tptr
+=sizeof(struct in_addr
);
832 case RSVP_CTYPE_IPV6
:
833 if (obj_tlen
< sizeof(struct in6_addr
))
835 ND_PRINT((ndo
, "%s IPv6 Notify Node Address: %s",
837 ip6addr_string(ndo
, obj_tptr
)));
838 obj_tlen
-=sizeof(struct in6_addr
);
839 obj_tptr
+=sizeof(struct in6_addr
);
847 case RSVP_OBJ_SUGGESTED_LABEL
: /* fall through */
848 case RSVP_OBJ_UPSTREAM_LABEL
: /* fall through */
849 case RSVP_OBJ_RECOVERY_LABEL
: /* fall through */
851 switch(rsvp_obj_ctype
) {
853 while(obj_tlen
>= 4 ) {
854 ND_PRINT((ndo
, "%s Label: %u", ident
, EXTRACT_32BITS(obj_tptr
)));
862 ND_PRINT((ndo
, "%s Generalized Label: %u",
864 EXTRACT_32BITS(obj_tptr
)));
871 ND_PRINT((ndo
, "%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
873 EXTRACT_32BITS(obj_tptr
),
875 EXTRACT_32BITS(obj_tptr
+4),
876 EXTRACT_32BITS(obj_tptr
+ 8)));
886 switch(rsvp_obj_ctype
) {
890 ND_PRINT((ndo
, "%s Reservation Style: %s, Flags: [0x%02x]",
892 tok2str(rsvp_resstyle_values
,
894 EXTRACT_24BITS(obj_tptr
+1)),
904 case RSVP_OBJ_SENDER_TEMPLATE
:
905 switch(rsvp_obj_ctype
) {
906 case RSVP_CTYPE_IPV4
:
909 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
911 ipaddr_string(ndo
, obj_tptr
),
912 EXTRACT_16BITS(obj_tptr
+ 6)));
917 case RSVP_CTYPE_IPV6
:
920 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
922 ip6addr_string(ndo
, obj_tptr
),
923 EXTRACT_16BITS(obj_tptr
+ 18)));
927 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
930 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
931 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
933 ip6addr_string(ndo
, obj_tptr
),
934 EXTRACT_16BITS(obj_tptr
+18),
936 ip6addr_string(ndo
, obj_tptr
+20),
937 EXTRACT_16BITS(obj_tptr
+ 38)));
942 case RSVP_CTYPE_TUNNEL_IPV4
:
945 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
947 ipaddr_string(ndo
, obj_tptr
),
948 EXTRACT_16BITS(obj_tptr
+ 6)));
952 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
955 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
956 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
958 ipaddr_string(ndo
, obj_tptr
),
959 EXTRACT_16BITS(obj_tptr
+6),
961 ipaddr_string(ndo
, obj_tptr
+8),
962 EXTRACT_16BITS(obj_tptr
+ 12)));
971 case RSVP_OBJ_LABEL_REQ
:
972 switch(rsvp_obj_ctype
) {
974 while(obj_tlen
>= 4 ) {
975 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
977 tok2str(ethertype_values
,
978 "Unknown Protocol (0x%04x)",
979 EXTRACT_16BITS(obj_tptr
+ 2))));
987 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
989 tok2str(ethertype_values
,
990 "Unknown Protocol (0x%04x)",
991 EXTRACT_16BITS(obj_tptr
+ 2))));
992 ND_PRINT((ndo
, ",%s merge capability",((*(obj_tptr
+ 4)) & 0x80) ? "no" : "" ));
993 ND_PRINT((ndo
, "%s Minimum VPI/VCI: %u/%u",
995 (EXTRACT_16BITS(obj_tptr
+4))&0xfff,
996 (EXTRACT_16BITS(obj_tptr
+ 6)) & 0xfff));
997 ND_PRINT((ndo
, "%s Maximum VPI/VCI: %u/%u",
999 (EXTRACT_16BITS(obj_tptr
+8))&0xfff,
1000 (EXTRACT_16BITS(obj_tptr
+ 10)) & 0xfff));
1007 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
1009 tok2str(ethertype_values
,
1010 "Unknown Protocol (0x%04x)",
1011 EXTRACT_16BITS(obj_tptr
+ 2))));
1012 ND_PRINT((ndo
, "%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1014 (EXTRACT_32BITS(obj_tptr
+4))&0x7fffff,
1015 (EXTRACT_32BITS(obj_tptr
+8))&0x7fffff,
1016 (((EXTRACT_16BITS(obj_tptr
+4)>>7)&3) == 0 ) ? "10" : "",
1017 (((EXTRACT_16BITS(obj_tptr
+ 4) >> 7) & 3) == 2 ) ? "23" : ""));
1024 ND_PRINT((ndo
, "%s LSP Encoding Type: %s (%u)",
1026 tok2str(gmpls_encoding_values
,
1030 ND_PRINT((ndo
, "%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1032 tok2str(gmpls_switch_cap_values
,
1036 tok2str(gmpls_payload_values
,
1038 EXTRACT_16BITS(obj_tptr
+2)),
1039 EXTRACT_16BITS(obj_tptr
+ 2)));
1050 switch(rsvp_obj_ctype
) {
1051 case RSVP_CTYPE_IPV4
:
1052 while(obj_tlen
>= 4 ) {
1053 ND_PRINT((ndo
, "%s Subobject Type: %s, length %u",
1055 tok2str(rsvp_obj_xro_values
,
1057 RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)),
1060 if (*(obj_tptr
+1) == 0) { /* prevent infinite loops */
1061 ND_PRINT((ndo
, "%s ERROR: zero length ERO subtype", ident
));
1065 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)) {
1066 case RSVP_OBJ_XRO_IPV4
:
1067 ND_PRINT((ndo
, ", %s, %s/%u, Flags: [%s]",
1068 RSVP_OBJ_XRO_MASK_LOOSE(*obj_tptr
) ? "Loose" : "Strict",
1069 ipaddr_string(ndo
, obj_tptr
+2),
1071 bittok2str(rsvp_obj_rro_flag_values
,
1073 *(obj_tptr
+ 7)))); /* rfc3209 says that this field is rsvd. */
1075 case RSVP_OBJ_XRO_LABEL
:
1076 ND_PRINT((ndo
, ", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1077 bittok2str(rsvp_obj_rro_label_flag_values
,
1081 tok2str(rsvp_ctype_values
,
1083 *(obj_tptr
+3) + 256*RSVP_OBJ_RRO
),
1085 EXTRACT_32BITS(obj_tptr
+ 4)));
1087 obj_tlen
-=*(obj_tptr
+1);
1088 obj_tptr
+=*(obj_tptr
+1);
1096 case RSVP_OBJ_HELLO
:
1097 switch(rsvp_obj_ctype
) {
1102 ND_PRINT((ndo
, "%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1104 EXTRACT_32BITS(obj_tptr
),
1105 EXTRACT_32BITS(obj_tptr
+ 4)));
1114 case RSVP_OBJ_RESTART_CAPABILITY
:
1115 switch(rsvp_obj_ctype
) {
1119 ND_PRINT((ndo
, "%s Restart Time: %ums, Recovery Time: %ums",
1121 EXTRACT_32BITS(obj_tptr
),
1122 EXTRACT_32BITS(obj_tptr
+ 4)));
1131 case RSVP_OBJ_SESSION_ATTRIBUTE
:
1132 switch(rsvp_obj_ctype
) {
1133 case RSVP_CTYPE_TUNNEL_IPV4
:
1136 namelen
= *(obj_tptr
+3);
1137 if (obj_tlen
< 4+namelen
)
1139 ND_PRINT((ndo
, "%s Session Name: ", ident
));
1140 for (i
= 0; i
< namelen
; i
++)
1141 safeputchar(ndo
, *(obj_tptr
+ 4 + i
));
1142 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1146 bittok2str(rsvp_session_attribute_flag_values
,
1150 obj_tlen
-=4+*(obj_tptr
+3);
1151 obj_tptr
+=4+*(obj_tptr
+3);
1158 case RSVP_OBJ_GENERALIZED_UNI
:
1159 switch(rsvp_obj_ctype
) {
1160 int subobj_type
,af
,subobj_len
,total_subobj_len
;
1167 /* read variable length subobjects */
1168 total_subobj_len
= obj_tlen
;
1169 while(total_subobj_len
> 0) {
1170 subobj_len
= EXTRACT_16BITS(obj_tptr
);
1171 subobj_type
= (EXTRACT_16BITS(obj_tptr
+2))>>8;
1172 af
= (EXTRACT_16BITS(obj_tptr
+2))&0x00FF;
1174 ND_PRINT((ndo
, "%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1176 tok2str(rsvp_obj_generalized_uni_values
, "Unknown", subobj_type
),
1178 tok2str(af_values
, "Unknown", af
), af
,
1181 switch(subobj_type
) {
1182 case RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
:
1183 case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
:
1189 ND_PRINT((ndo
, "%s UNI IPv4 TNA address: %s",
1190 ident
, ipaddr_string(ndo
, obj_tptr
+ 4)));
1194 if (subobj_len
< 20)
1196 ND_PRINT((ndo
, "%s UNI IPv6 TNA address: %s",
1197 ident
, ip6addr_string(ndo
, obj_tptr
+ 4)));
1202 /* unless we have a TLV parser lets just hexdump */
1209 case RSVP_GEN_UNI_SUBOBJ_DIVERSITY
:
1211 /* unless we have a TLV parser lets just hexdump */
1216 case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
:
1217 if (subobj_len
< 16) {
1221 ND_PRINT((ndo
, "%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
1223 ((EXTRACT_32BITS(obj_tptr
+4))>>31),
1224 ((EXTRACT_32BITS(obj_tptr
+4))&0xFF),
1225 EXTRACT_32BITS(obj_tptr
+8),
1226 EXTRACT_32BITS(obj_tptr
+ 12)));
1229 case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
:
1230 if (subobj_len
< 8) {
1234 ND_PRINT((ndo
, "%s Service level: %u",
1235 ident
, (EXTRACT_32BITS(obj_tptr
+ 4)) >> 24));
1242 total_subobj_len
-=subobj_len
;
1243 obj_tptr
+=subobj_len
;
1244 obj_tlen
+=subobj_len
;
1247 if (total_subobj_len
) {
1248 /* unless we have a TLV parser lets just hexdump */
1258 case RSVP_OBJ_RSVP_HOP
:
1259 switch(rsvp_obj_ctype
) {
1260 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1261 case RSVP_CTYPE_IPV4
:
1264 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1266 ipaddr_string(ndo
, obj_tptr
),
1267 EXTRACT_32BITS(obj_tptr
+ 4)));
1271 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1274 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1275 case RSVP_CTYPE_IPV6
:
1278 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1280 ip6addr_string(ndo
, obj_tptr
),
1281 EXTRACT_32BITS(obj_tptr
+ 16)));
1284 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1292 case RSVP_OBJ_TIME_VALUES
:
1293 switch(rsvp_obj_ctype
) {
1297 ND_PRINT((ndo
, "%s Refresh Period: %ums",
1299 EXTRACT_32BITS(obj_tptr
)));
1308 /* those three objects do share the same semantics */
1309 case RSVP_OBJ_SENDER_TSPEC
:
1310 case RSVP_OBJ_ADSPEC
:
1311 case RSVP_OBJ_FLOWSPEC
:
1312 switch(rsvp_obj_ctype
) {
1316 ND_PRINT((ndo
, "%s Msg-Version: %u, length: %u",
1318 (*obj_tptr
& 0xf0) >> 4,
1319 EXTRACT_16BITS(obj_tptr
+ 2) << 2));
1320 obj_tptr
+=4; /* get to the start of the service header */
1323 while (obj_tlen
>= 4) {
1324 intserv_serv_tlen
=EXTRACT_16BITS(obj_tptr
+2)<<2;
1325 ND_PRINT((ndo
, "%s Service Type: %s (%u), break bit %s set, Service length: %u",
1327 tok2str(rsvp_intserv_service_type_values
,"unknown",*(obj_tptr
)),
1329 (*(obj_tptr
+1)&0x80) ? "" : "not",
1330 intserv_serv_tlen
));
1332 obj_tptr
+=4; /* get to the start of the parameter list */
1335 while (intserv_serv_tlen
>=4) {
1336 processed
= rsvp_intserv_print(ndo
, obj_tptr
, obj_tlen
);
1339 obj_tlen
-=processed
;
1340 intserv_serv_tlen
-=processed
;
1341 obj_tptr
+=processed
;
1350 case RSVP_OBJ_FILTERSPEC
:
1351 switch(rsvp_obj_ctype
) {
1352 case RSVP_CTYPE_IPV4
:
1355 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1357 ipaddr_string(ndo
, obj_tptr
),
1358 EXTRACT_16BITS(obj_tptr
+ 6)));
1363 case RSVP_CTYPE_IPV6
:
1366 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1368 ip6addr_string(ndo
, obj_tptr
),
1369 EXTRACT_16BITS(obj_tptr
+ 18)));
1376 ND_PRINT((ndo
, "%s Source Address: %s, Flow Label: %u",
1378 ip6addr_string(ndo
, obj_tptr
),
1379 EXTRACT_24BITS(obj_tptr
+ 17)));
1383 case RSVP_CTYPE_TUNNEL_IPV6
:
1386 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1388 ipaddr_string(ndo
, obj_tptr
),
1389 EXTRACT_16BITS(obj_tptr
+ 18)));
1393 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
1396 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1397 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1399 ip6addr_string(ndo
, obj_tptr
),
1400 EXTRACT_16BITS(obj_tptr
+18),
1402 ip6addr_string(ndo
, obj_tptr
+20),
1403 EXTRACT_16BITS(obj_tptr
+ 38)));
1408 case RSVP_CTYPE_TUNNEL_IPV4
:
1411 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1413 ipaddr_string(ndo
, obj_tptr
),
1414 EXTRACT_16BITS(obj_tptr
+ 6)));
1418 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
1421 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1422 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1424 ipaddr_string(ndo
, obj_tptr
),
1425 EXTRACT_16BITS(obj_tptr
+6),
1427 ipaddr_string(ndo
, obj_tptr
+8),
1428 EXTRACT_16BITS(obj_tptr
+ 12)));
1437 case RSVP_OBJ_FASTREROUTE
:
1438 /* the differences between c-type 1 and 7 are minor */
1439 obj_ptr
.rsvp_obj_frr
= (const struct rsvp_obj_frr_t
*)obj_tptr
;
1440 bw
.i
= EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1442 switch(rsvp_obj_ctype
) {
1443 case RSVP_CTYPE_1
: /* new style */
1444 if (obj_tlen
< sizeof(struct rsvp_obj_frr_t
))
1446 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1448 (int)obj_ptr
.rsvp_obj_frr
->setup_prio
,
1449 (int)obj_ptr
.rsvp_obj_frr
->hold_prio
,
1450 (int)obj_ptr
.rsvp_obj_frr
->hop_limit
,
1451 bw
.f
* 8 / 1000000));
1452 ND_PRINT((ndo
, "%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
1454 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_any
),
1455 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->exclude_any
),
1456 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_all
)));
1457 obj_tlen
-=sizeof(struct rsvp_obj_frr_t
);
1458 obj_tptr
+=sizeof(struct rsvp_obj_frr_t
);
1461 case RSVP_CTYPE_TUNNEL_IPV4
: /* old style */
1464 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1466 (int)obj_ptr
.rsvp_obj_frr
->setup_prio
,
1467 (int)obj_ptr
.rsvp_obj_frr
->hold_prio
,
1468 (int)obj_ptr
.rsvp_obj_frr
->hop_limit
,
1469 bw
.f
* 8 / 1000000));
1470 ND_PRINT((ndo
, "%s Include Colors: 0x%08x, Exclude Colors: 0x%08x",
1472 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_any
),
1473 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->exclude_any
)));
1483 case RSVP_OBJ_DETOUR
:
1484 switch(rsvp_obj_ctype
) {
1485 case RSVP_CTYPE_TUNNEL_IPV4
:
1486 while(obj_tlen
>= 8) {
1487 ND_PRINT((ndo
, "%s PLR-ID: %s, Avoid-Node-ID: %s",
1489 ipaddr_string(ndo
, obj_tptr
),
1490 ipaddr_string(ndo
, obj_tptr
+ 4)));
1500 case RSVP_OBJ_CLASSTYPE
:
1501 case RSVP_OBJ_CLASSTYPE_OLD
: /* fall through */
1502 switch(rsvp_obj_ctype
) {
1504 ND_PRINT((ndo
, "%s CT: %u",
1506 EXTRACT_32BITS(obj_tptr
) & 0x7));
1515 case RSVP_OBJ_ERROR_SPEC
:
1516 switch(rsvp_obj_ctype
) {
1517 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1518 case RSVP_CTYPE_IPV4
:
1521 error_code
=*(obj_tptr
+5);
1522 error_value
=EXTRACT_16BITS(obj_tptr
+6);
1523 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1525 ipaddr_string(ndo
, obj_tptr
),
1528 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1530 switch (error_code
) {
1531 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1532 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1533 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1536 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
: /* fall through */
1537 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
:
1538 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1539 tok2str(rsvp_obj_error_code_diffserv_te_values
,"unknown",error_value
),
1543 ND_PRINT((ndo
, ", Unknown Error Value (%u)", error_value
));
1550 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1551 case RSVP_CTYPE_IPV6
:
1554 error_code
=*(obj_tptr
+17);
1555 error_value
=EXTRACT_16BITS(obj_tptr
+18);
1556 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1558 ip6addr_string(ndo
, obj_tptr
),
1561 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1564 switch (error_code
) {
1565 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1566 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1567 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1582 case RSVP_OBJ_PROPERTIES
:
1583 switch(rsvp_obj_ctype
) {
1587 padbytes
= EXTRACT_16BITS(obj_tptr
+2);
1588 ND_PRINT((ndo
, "%s TLV count: %u, padding bytes: %u",
1590 EXTRACT_16BITS(obj_tptr
),
1594 /* loop through as long there is anything longer than the TLV header (2) */
1595 while(obj_tlen
>= 2 + padbytes
) {
1596 ND_PRINT((ndo
, "%s %s TLV (0x%02x), length: %u", /* length includes header */
1598 tok2str(rsvp_obj_prop_tlv_values
,"unknown",*obj_tptr
),
1601 if (obj_tlen
< *(obj_tptr
+1))
1603 if (*(obj_tptr
+1) < 2)
1605 print_unknown_data(ndo
, obj_tptr
+ 2, "\n\t\t", *(obj_tptr
+ 1) - 2);
1606 obj_tlen
-=*(obj_tptr
+1);
1607 obj_tptr
+=*(obj_tptr
+1);
1615 case RSVP_OBJ_MESSAGE_ID
: /* fall through */
1616 case RSVP_OBJ_MESSAGE_ID_ACK
: /* fall through */
1617 case RSVP_OBJ_MESSAGE_ID_LIST
:
1618 switch(rsvp_obj_ctype
) {
1623 ND_PRINT((ndo
, "%s Flags [0x%02x], epoch: %u",
1626 EXTRACT_24BITS(obj_tptr
+ 1)));
1629 /* loop through as long there are no messages left */
1630 while(obj_tlen
>= 4) {
1631 ND_PRINT((ndo
, "%s Message-ID 0x%08x (%u)",
1633 EXTRACT_32BITS(obj_tptr
),
1634 EXTRACT_32BITS(obj_tptr
)));
1644 case RSVP_OBJ_INTEGRITY
:
1645 switch(rsvp_obj_ctype
) {
1647 if (obj_tlen
< sizeof(struct rsvp_obj_integrity_t
))
1649 obj_ptr
.rsvp_obj_integrity
= (const struct rsvp_obj_integrity_t
*)obj_tptr
;
1650 ND_PRINT((ndo
, "%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
1652 EXTRACT_16BITS(obj_ptr
.rsvp_obj_integrity
->key_id
),
1653 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->key_id
+2),
1654 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->sequence
),
1655 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->sequence
+4),
1656 bittok2str(rsvp_obj_integrity_flag_values
,
1658 obj_ptr
.rsvp_obj_integrity
->flags
)));
1659 ND_PRINT((ndo
, "%s MD5-sum 0x%08x%08x%08x%08x ",
1661 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
),
1662 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+4),
1663 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+8),
1664 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+ 12)));
1666 #ifdef HAVE_LIBCRYPTO
1667 sigcheck
= signature_verify(ndo
, pptr
, plen
, (unsigned char *)obj_ptr
.\
1668 rsvp_obj_integrity
->digest
);
1670 sigcheck
= CANT_CHECK_SIGNATURE
;
1672 ND_PRINT((ndo
, " (%s)", tok2str(signature_check_values
, "Unknown", sigcheck
)));
1674 obj_tlen
+=sizeof(struct rsvp_obj_integrity_t
);
1675 obj_tptr
+=sizeof(struct rsvp_obj_integrity_t
);
1682 case RSVP_OBJ_ADMIN_STATUS
:
1683 switch(rsvp_obj_ctype
) {
1687 ND_PRINT((ndo
, "%s Flags [%s]", ident
,
1688 bittok2str(rsvp_obj_admin_status_flag_values
, "none",
1689 EXTRACT_32BITS(obj_tptr
))));
1698 case RSVP_OBJ_LABEL_SET
:
1699 switch(rsvp_obj_ctype
) {
1703 action
= (EXTRACT_16BITS(obj_tptr
)>>8);
1705 ND_PRINT((ndo
, "%s Action: %s (%u), Label type: %u", ident
,
1706 tok2str(rsvp_obj_label_set_action_values
, "Unknown", action
),
1707 action
, ((EXTRACT_32BITS(obj_tptr
) & 0x7F))));
1710 case LABEL_SET_INCLUSIVE_RANGE
:
1711 case LABEL_SET_EXCLUSIVE_RANGE
: /* fall through */
1713 /* only a couple of subchannels are expected */
1716 ND_PRINT((ndo
, "%s Start range: %u, End range: %u", ident
,
1717 EXTRACT_32BITS(obj_tptr
+4),
1718 EXTRACT_32BITS(obj_tptr
+ 8)));
1727 while(obj_tlen
>= 4 ) {
1728 ND_PRINT((ndo
, "%s Subchannel #%u: %u", ident
, subchannel
,
1729 EXTRACT_32BITS(obj_tptr
)));
1742 switch (rsvp_obj_ctype
) {
1743 case RSVP_CTYPE_IPV4
:
1746 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1747 ident
, ipaddr_string(ndo
, obj_tptr
)));
1753 case RSVP_CTYPE_IPV6
:
1756 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1757 ident
, ip6addr_string(ndo
, obj_tptr
)));
1768 * FIXME those are the defined objects that lack a decoder
1769 * you are welcome to contribute code ;-)
1772 case RSVP_OBJ_SCOPE
:
1773 case RSVP_OBJ_POLICY_DATA
:
1774 case RSVP_OBJ_ACCEPT_LABEL_SET
:
1775 case RSVP_OBJ_PROTECTION
:
1777 if (ndo
->ndo_vflag
<= 1)
1778 print_unknown_data(ndo
, obj_tptr
, "\n\t ", obj_tlen
); /* FIXME indentation */
1781 /* do we also want to see a hex dump ? */
1782 if (ndo
->ndo_vflag
> 1 || hexdump
== TRUE
)
1783 print_unknown_data(ndo
, tptr
+ sizeof(struct rsvp_object_header
), "\n\t ", /* FIXME indentation */
1784 rsvp_obj_len
- sizeof(struct rsvp_object_header
));
1791 ND_PRINT((ndo
, "\n\t\t packet exceeded snapshot"));
1796 rsvp_print(netdissect_options
*ndo
,
1797 register const u_char
*pptr
, register u_int len
)
1799 struct rsvp_common_header
*rsvp_com_header
;
1800 const u_char
*tptr
,*subtptr
;
1801 u_short plen
, tlen
, subtlen
;
1805 rsvp_com_header
= (struct rsvp_common_header
*)pptr
;
1806 ND_TCHECK(*rsvp_com_header
);
1809 * Sanity checking of the header.
1811 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1812 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1813 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1817 /* in non-verbose mode just lets print the basic Message Type*/
1818 if (ndo
->ndo_vflag
< 1) {
1819 ND_PRINT((ndo
, "RSVPv%u %s Message, length: %u",
1820 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1821 tok2str(rsvp_msg_type_values
, "unknown (%u)",rsvp_com_header
->msg_type
),
1826 /* ok they seem to want to know everything - lets fully decode it */
1828 plen
= tlen
= EXTRACT_16BITS(rsvp_com_header
->length
);
1830 ND_PRINT((ndo
, "\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1831 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1832 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1833 rsvp_com_header
->msg_type
,
1834 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1836 rsvp_com_header
->ttl
,
1837 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1840 * Clear checksum prior to signature verification.
1842 rsvp_com_header
->checksum
[0] = 0;
1843 rsvp_com_header
->checksum
[1] = 0;
1845 if (tlen
< sizeof(const struct rsvp_common_header
)) {
1846 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", tlen
,
1847 (unsigned long)sizeof(const struct rsvp_common_header
)));
1851 tptr
+=sizeof(const struct rsvp_common_header
);
1852 tlen
-=sizeof(const struct rsvp_common_header
);
1854 switch(rsvp_com_header
->msg_type
) {
1856 case RSVP_MSGTYPE_AGGREGATE
:
1859 rsvp_com_header
= (struct rsvp_common_header
*)subtptr
;
1860 ND_TCHECK(*rsvp_com_header
);
1863 * Sanity checking of the header.
1865 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1866 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1867 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1870 subtlen
=EXTRACT_16BITS(rsvp_com_header
->length
);
1872 ND_PRINT((ndo
, "\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1873 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1874 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1875 rsvp_com_header
->msg_type
,
1876 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1878 rsvp_com_header
->ttl
,
1879 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1882 * Clear checksum prior to signature verification.
1884 rsvp_com_header
->checksum
[0] = 0;
1885 rsvp_com_header
->checksum
[1] = 0;
1887 if (subtlen
< sizeof(const struct rsvp_common_header
)) {
1888 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", subtlen
,
1889 (unsigned long)sizeof(const struct rsvp_common_header
)));
1893 if (tlen
< subtlen
) {
1894 ND_PRINT((ndo
, "ERROR: common header too large %u > %u", subtlen
,
1899 subtptr
+=sizeof(const struct rsvp_common_header
);
1900 subtlen
-=sizeof(const struct rsvp_common_header
);
1902 if (rsvp_obj_print(ndo
, pptr
, plen
, subtptr
, "\n\t ", subtlen
) == -1)
1905 tptr
+=subtlen
+sizeof(const struct rsvp_common_header
);
1906 tlen
-=subtlen
+sizeof(const struct rsvp_common_header
);
1911 case RSVP_MSGTYPE_PATH
:
1912 case RSVP_MSGTYPE_RESV
:
1913 case RSVP_MSGTYPE_PATHERR
:
1914 case RSVP_MSGTYPE_RESVERR
:
1915 case RSVP_MSGTYPE_PATHTEAR
:
1916 case RSVP_MSGTYPE_RESVTEAR
:
1917 case RSVP_MSGTYPE_RESVCONF
:
1918 case RSVP_MSGTYPE_HELLO_OLD
:
1919 case RSVP_MSGTYPE_HELLO
:
1920 case RSVP_MSGTYPE_ACK
:
1921 case RSVP_MSGTYPE_SREFRESH
:
1922 if (rsvp_obj_print(ndo
, pptr
, plen
, tptr
, "\n\t ", tlen
) == -1)
1927 print_unknown_data(ndo
, tptr
, "\n\t ", tlen
);
1933 ND_PRINT((ndo
, "\n\t\t packet exceeded snapshot"));