2 * Copyright (c) 1998-2007 The TCPDUMP project
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that: (1) source code
6 * distributions retain the above copyright notice and this paragraph
7 * in its entirety, and (2) distributions including binary code include
8 * the above copyright notice and this paragraph in its entirety in
9 * the documentation or other materials provided with the distribution.
10 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
11 * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
12 * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
13 * FOR A PARTICULAR PURPOSE.
15 * Original code by Hannes Gredler (hannes@juniper.net)
18 #include <sys/cdefs.h>
20 __RCSID("$NetBSD: print-rsvp.c,v 1.7 2015/03/31 21:59:35 christos Exp $");
23 #define NETDISSECT_REWORKED
28 #include <tcpdump-stdinc.h>
30 #include "interface.h"
32 #include "addrtoname.h"
33 #include "ethertype.h"
36 #include "signature.h"
39 * RFC 2205 common header
42 * +-------------+-------------+-------------+-------------+
43 * | Vers | Flags| Msg Type | RSVP Checksum |
44 * +-------------+-------------+-------------+-------------+
45 * | Send_TTL | (Reserved) | RSVP Length |
46 * +-------------+-------------+-------------+-------------+
50 struct rsvp_common_header
{
51 uint8_t version_flags
;
60 * RFC2205 object header
64 * +-------------+-------------+-------------+-------------+
65 * | Length (bytes) | Class-Num | C-Type |
66 * +-------------+-------------+-------------+-------------+
68 * // (Object contents) //
70 * +-------------+-------------+-------------+-------------+
73 struct rsvp_object_header
{
79 #define RSVP_VERSION 1
80 #define RSVP_EXTRACT_VERSION(x) (((x)&0xf0)>>4)
81 #define RSVP_EXTRACT_FLAGS(x) ((x)&0x0f)
83 #define RSVP_MSGTYPE_PATH 1
84 #define RSVP_MSGTYPE_RESV 2
85 #define RSVP_MSGTYPE_PATHERR 3
86 #define RSVP_MSGTYPE_RESVERR 4
87 #define RSVP_MSGTYPE_PATHTEAR 5
88 #define RSVP_MSGTYPE_RESVTEAR 6
89 #define RSVP_MSGTYPE_RESVCONF 7
90 #define RSVP_MSGTYPE_AGGREGATE 12
91 #define RSVP_MSGTYPE_ACK 13
92 #define RSVP_MSGTYPE_HELLO_OLD 14 /* ancient Hellos */
93 #define RSVP_MSGTYPE_SREFRESH 15
94 #define RSVP_MSGTYPE_HELLO 20
96 static const struct tok rsvp_msg_type_values
[] = {
97 { RSVP_MSGTYPE_PATH
, "Path" },
98 { RSVP_MSGTYPE_RESV
, "Resv" },
99 { RSVP_MSGTYPE_PATHERR
, "PathErr" },
100 { RSVP_MSGTYPE_RESVERR
, "ResvErr" },
101 { RSVP_MSGTYPE_PATHTEAR
, "PathTear" },
102 { RSVP_MSGTYPE_RESVTEAR
, "ResvTear" },
103 { RSVP_MSGTYPE_RESVCONF
, "ResvConf" },
104 { RSVP_MSGTYPE_AGGREGATE
, "Aggregate" },
105 { RSVP_MSGTYPE_ACK
, "Acknowledgement" },
106 { RSVP_MSGTYPE_HELLO_OLD
, "Hello (Old)" },
107 { RSVP_MSGTYPE_SREFRESH
, "Refresh" },
108 { RSVP_MSGTYPE_HELLO
, "Hello" },
112 static const struct tok rsvp_header_flag_values
[] = {
113 { 0x01, "Refresh reduction capable" }, /* rfc2961 */
117 #define RSVP_OBJ_SESSION 1 /* rfc2205 */
118 #define RSVP_OBJ_RSVP_HOP 3 /* rfc2205, rfc3473 */
119 #define RSVP_OBJ_INTEGRITY 4 /* rfc2747 */
120 #define RSVP_OBJ_TIME_VALUES 5 /* rfc2205 */
121 #define RSVP_OBJ_ERROR_SPEC 6
122 #define RSVP_OBJ_SCOPE 7
123 #define RSVP_OBJ_STYLE 8 /* rfc2205 */
124 #define RSVP_OBJ_FLOWSPEC 9 /* rfc2215 */
125 #define RSVP_OBJ_FILTERSPEC 10 /* rfc2215 */
126 #define RSVP_OBJ_SENDER_TEMPLATE 11
127 #define RSVP_OBJ_SENDER_TSPEC 12 /* rfc2215 */
128 #define RSVP_OBJ_ADSPEC 13 /* rfc2215 */
129 #define RSVP_OBJ_POLICY_DATA 14
130 #define RSVP_OBJ_CONFIRM 15 /* rfc2205 */
131 #define RSVP_OBJ_LABEL 16 /* rfc3209 */
132 #define RSVP_OBJ_LABEL_REQ 19 /* rfc3209 */
133 #define RSVP_OBJ_ERO 20 /* rfc3209 */
134 #define RSVP_OBJ_RRO 21 /* rfc3209 */
135 #define RSVP_OBJ_HELLO 22 /* rfc3209 */
136 #define RSVP_OBJ_MESSAGE_ID 23 /* rfc2961 */
137 #define RSVP_OBJ_MESSAGE_ID_ACK 24 /* rfc2961 */
138 #define RSVP_OBJ_MESSAGE_ID_LIST 25 /* rfc2961 */
139 #define RSVP_OBJ_RECOVERY_LABEL 34 /* rfc3473 */
140 #define RSVP_OBJ_UPSTREAM_LABEL 35 /* rfc3473 */
141 #define RSVP_OBJ_LABEL_SET 36 /* rfc3473 */
142 #define RSVP_OBJ_PROTECTION 37 /* rfc3473 */
143 #define RSVP_OBJ_S2L 50 /* rfc4875 */
144 #define RSVP_OBJ_DETOUR 63 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07 */
145 #define RSVP_OBJ_CLASSTYPE 66 /* rfc4124 */
146 #define RSVP_OBJ_CLASSTYPE_OLD 125 /* draft-ietf-tewg-diff-te-proto-07 */
147 #define RSVP_OBJ_SUGGESTED_LABEL 129 /* rfc3473 */
148 #define RSVP_OBJ_ACCEPT_LABEL_SET 130 /* rfc3473 */
149 #define RSVP_OBJ_RESTART_CAPABILITY 131 /* rfc3473 */
150 #define RSVP_OBJ_NOTIFY_REQ 195 /* rfc3473 */
151 #define RSVP_OBJ_ADMIN_STATUS 196 /* rfc3473 */
152 #define RSVP_OBJ_PROPERTIES 204 /* juniper proprietary */
153 #define RSVP_OBJ_FASTREROUTE 205 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07 */
154 #define RSVP_OBJ_SESSION_ATTRIBUTE 207 /* rfc3209 */
155 #define RSVP_OBJ_GENERALIZED_UNI 229 /* OIF RSVP extensions UNI 1.0 Signaling, Rel. 2 */
156 #define RSVP_OBJ_CALL_ID 230 /* rfc3474 */
157 #define RSVP_OBJ_CALL_OPS 236 /* rfc3474 */
159 static const struct tok rsvp_obj_values
[] = {
160 { RSVP_OBJ_SESSION
, "Session" },
161 { RSVP_OBJ_RSVP_HOP
, "RSVP Hop" },
162 { RSVP_OBJ_INTEGRITY
, "Integrity" },
163 { RSVP_OBJ_TIME_VALUES
, "Time Values" },
164 { RSVP_OBJ_ERROR_SPEC
, "Error Spec" },
165 { RSVP_OBJ_SCOPE
, "Scope" },
166 { RSVP_OBJ_STYLE
, "Style" },
167 { RSVP_OBJ_FLOWSPEC
, "Flowspec" },
168 { RSVP_OBJ_FILTERSPEC
, "FilterSpec" },
169 { RSVP_OBJ_SENDER_TEMPLATE
, "Sender Template" },
170 { RSVP_OBJ_SENDER_TSPEC
, "Sender TSpec" },
171 { RSVP_OBJ_ADSPEC
, "Adspec" },
172 { RSVP_OBJ_POLICY_DATA
, "Policy Data" },
173 { RSVP_OBJ_CONFIRM
, "Confirm" },
174 { RSVP_OBJ_LABEL
, "Label" },
175 { RSVP_OBJ_LABEL_REQ
, "Label Request" },
176 { RSVP_OBJ_ERO
, "ERO" },
177 { RSVP_OBJ_RRO
, "RRO" },
178 { RSVP_OBJ_HELLO
, "Hello" },
179 { RSVP_OBJ_MESSAGE_ID
, "Message ID" },
180 { RSVP_OBJ_MESSAGE_ID_ACK
, "Message ID Ack" },
181 { RSVP_OBJ_MESSAGE_ID_LIST
, "Message ID List" },
182 { RSVP_OBJ_RECOVERY_LABEL
, "Recovery Label" },
183 { RSVP_OBJ_UPSTREAM_LABEL
, "Upstream Label" },
184 { RSVP_OBJ_LABEL_SET
, "Label Set" },
185 { RSVP_OBJ_ACCEPT_LABEL_SET
, "Acceptable Label Set" },
186 { RSVP_OBJ_DETOUR
, "Detour" },
187 { RSVP_OBJ_CLASSTYPE
, "Class Type" },
188 { RSVP_OBJ_CLASSTYPE_OLD
, "Class Type (old)" },
189 { RSVP_OBJ_SUGGESTED_LABEL
, "Suggested Label" },
190 { RSVP_OBJ_PROPERTIES
, "Properties" },
191 { RSVP_OBJ_FASTREROUTE
, "Fast Re-Route" },
192 { RSVP_OBJ_SESSION_ATTRIBUTE
, "Session Attribute" },
193 { RSVP_OBJ_GENERALIZED_UNI
, "Generalized UNI" },
194 { RSVP_OBJ_CALL_ID
, "Call-ID" },
195 { RSVP_OBJ_CALL_OPS
, "Call Capability" },
196 { RSVP_OBJ_RESTART_CAPABILITY
, "Restart Capability" },
197 { RSVP_OBJ_NOTIFY_REQ
, "Notify Request" },
198 { RSVP_OBJ_PROTECTION
, "Protection" },
199 { RSVP_OBJ_ADMIN_STATUS
, "Administrative Status" },
200 { RSVP_OBJ_S2L
, "Sub-LSP to LSP" },
204 #define RSVP_CTYPE_IPV4 1
205 #define RSVP_CTYPE_IPV6 2
206 #define RSVP_CTYPE_TUNNEL_IPV4 7
207 #define RSVP_CTYPE_TUNNEL_IPV6 8
208 #define RSVP_CTYPE_UNI_IPV4 11 /* OIF RSVP extensions UNI 1.0 Signaling Rel. 2 */
209 #define RSVP_CTYPE_1 1
210 #define RSVP_CTYPE_2 2
211 #define RSVP_CTYPE_3 3
212 #define RSVP_CTYPE_4 4
213 #define RSVP_CTYPE_12 12
214 #define RSVP_CTYPE_13 13
215 #define RSVP_CTYPE_14 14
218 * the ctypes are not globally unique so for
219 * translating it to strings we build a table based
220 * on objects offsetted by the ctype
223 static const struct tok rsvp_ctype_values
[] = {
224 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV4
, "IPv4" },
225 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV6
, "IPv6" },
226 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
227 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
228 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV4
, "IPv4" },
229 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV6
, "IPv6" },
230 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV4
, "IPv4" },
231 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV6
, "IPv6" },
232 { 256*RSVP_OBJ_TIME_VALUES
+RSVP_CTYPE_1
, "1" },
233 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_1
, "obsolete" },
234 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_2
, "IntServ" },
235 { 256*RSVP_OBJ_SENDER_TSPEC
+RSVP_CTYPE_2
, "IntServ" },
236 { 256*RSVP_OBJ_ADSPEC
+RSVP_CTYPE_2
, "IntServ" },
237 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
238 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
239 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_3
, "IPv6 Flow-label" },
240 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
241 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
242 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
243 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV4
, "IPv4" },
244 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV6
, "IPv6" },
245 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
246 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_UNI_IPV4
, "UNI IPv4" },
247 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_13
, "IPv4 P2MP LSP Tunnel" },
248 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_14
, "IPv6 P2MP LSP Tunnel" },
249 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV4
, "IPv4" },
250 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV6
, "IPv6" },
251 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
252 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
253 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
254 { 256*RSVP_OBJ_MESSAGE_ID
+RSVP_CTYPE_1
, "1" },
255 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_1
, "Message id ack" },
256 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_2
, "Message id nack" },
257 { 256*RSVP_OBJ_MESSAGE_ID_LIST
+RSVP_CTYPE_1
, "1" },
258 { 256*RSVP_OBJ_STYLE
+RSVP_CTYPE_1
, "1" },
259 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_1
, "Hello Request" },
260 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_2
, "Hello Ack" },
261 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_1
, "without label range" },
262 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_2
, "with ATM label range" },
263 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_3
, "with FR label range" },
264 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_4
, "Generalized Label" },
265 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_1
, "Label" },
266 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
267 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
268 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_1
, "Label" },
269 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
270 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
271 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_1
, "Label" },
272 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
273 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
274 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_1
, "Label" },
275 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
276 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
277 { 256*RSVP_OBJ_ERO
+RSVP_CTYPE_IPV4
, "IPv4" },
278 { 256*RSVP_OBJ_RRO
+RSVP_CTYPE_IPV4
, "IPv4" },
279 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
280 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
281 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
282 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
283 { 256*RSVP_OBJ_RESTART_CAPABILITY
+RSVP_CTYPE_1
, "IPv4" },
284 { 256*RSVP_OBJ_SESSION_ATTRIBUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
285 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" }, /* old style*/
286 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_1
, "1" }, /* new style */
287 { 256*RSVP_OBJ_DETOUR
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
288 { 256*RSVP_OBJ_PROPERTIES
+RSVP_CTYPE_1
, "1" },
289 { 256*RSVP_OBJ_ADMIN_STATUS
+RSVP_CTYPE_1
, "1" },
290 { 256*RSVP_OBJ_CLASSTYPE
+RSVP_CTYPE_1
, "1" },
291 { 256*RSVP_OBJ_CLASSTYPE_OLD
+RSVP_CTYPE_1
, "1" },
292 { 256*RSVP_OBJ_LABEL_SET
+RSVP_CTYPE_1
, "1" },
293 { 256*RSVP_OBJ_GENERALIZED_UNI
+RSVP_CTYPE_1
, "1" },
294 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV4
, "IPv4 sub-LSP" },
295 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV6
, "IPv6 sub-LSP" },
299 struct rsvp_obj_integrity_t
{
307 static const struct tok rsvp_obj_integrity_flag_values
[] = {
308 { 0x80, "Handshake" },
312 struct rsvp_obj_frr_t
{
317 uint8_t bandwidth
[4];
318 uint8_t include_any
[4];
319 uint8_t exclude_any
[4];
320 uint8_t include_all
[4];
324 #define RSVP_OBJ_XRO_MASK_SUBOBJ(x) ((x)&0x7f)
325 #define RSVP_OBJ_XRO_MASK_LOOSE(x) ((x)&0x80)
327 #define RSVP_OBJ_XRO_RES 0
328 #define RSVP_OBJ_XRO_IPV4 1
329 #define RSVP_OBJ_XRO_IPV6 2
330 #define RSVP_OBJ_XRO_LABEL 3
331 #define RSVP_OBJ_XRO_ASN 32
332 #define RSVP_OBJ_XRO_MPLS 64
334 static const struct tok rsvp_obj_xro_values
[] = {
335 { RSVP_OBJ_XRO_RES
, "Reserved" },
336 { RSVP_OBJ_XRO_IPV4
, "IPv4 prefix" },
337 { RSVP_OBJ_XRO_IPV6
, "IPv6 prefix" },
338 { RSVP_OBJ_XRO_LABEL
, "Label" },
339 { RSVP_OBJ_XRO_ASN
, "Autonomous system number" },
340 { RSVP_OBJ_XRO_MPLS
, "MPLS label switched path termination" },
344 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07.txt */
345 static const struct tok rsvp_obj_rro_flag_values
[] = {
346 { 0x01, "Local protection available" },
347 { 0x02, "Local protection in use" },
348 { 0x04, "Bandwidth protection" },
349 { 0x08, "Node protection" },
354 static const struct tok rsvp_obj_rro_label_flag_values
[] = {
359 static const struct tok rsvp_resstyle_values
[] = {
360 { 17, "Wildcard Filter" },
361 { 10, "Fixed Filter" },
362 { 18, "Shared Explicit" },
366 #define RSVP_OBJ_INTSERV_GUARANTEED_SERV 2
367 #define RSVP_OBJ_INTSERV_CONTROLLED_LOAD 5
369 static const struct tok rsvp_intserv_service_type_values
[] = {
370 { 1, "Default/Global Information" },
371 { RSVP_OBJ_INTSERV_GUARANTEED_SERV
, "Guaranteed Service" },
372 { RSVP_OBJ_INTSERV_CONTROLLED_LOAD
, "Controlled Load" },
376 static const struct tok rsvp_intserv_parameter_id_values
[] = {
378 { 6, "Path b/w estimate" },
379 { 8, "Minimum path latency" },
380 { 10, "Composed MTU" },
381 { 127, "Token Bucket TSpec" },
382 { 130, "Guaranteed Service RSpec" },
383 { 133, "End-to-end composed value for C" },
384 { 134, "End-to-end composed value for D" },
385 { 135, "Since-last-reshaping point composed C" },
386 { 136, "Since-last-reshaping point composed D" },
390 static const struct tok rsvp_session_attribute_flag_values
[] = {
391 { 0x01, "Local Protection" },
392 { 0x02, "Label Recording" },
393 { 0x04, "SE Style" },
394 { 0x08, "Bandwidth protection" }, /* RFC4090 */
395 { 0x10, "Node protection" }, /* RFC4090 */
399 static const struct tok rsvp_obj_prop_tlv_values
[] = {
401 { 0x02, "Metric 1" },
402 { 0x04, "Metric 2" },
403 { 0x08, "CCC Status" },
404 { 0x10, "Path Type" },
408 #define RSVP_OBJ_ERROR_SPEC_CODE_ROUTING 24
409 #define RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY 25
410 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE 28
411 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD 125
413 static const struct tok rsvp_obj_error_code_values
[] = {
414 { RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
, "Routing Problem" },
415 { RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY
, "Notify Error" },
416 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
, "Diffserv TE Error" },
417 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
, "Diffserv TE Error (Old)" },
421 static const struct tok rsvp_obj_error_code_routing_values
[] = {
422 { 1, "Bad EXPLICIT_ROUTE object" },
423 { 2, "Bad strict node" },
424 { 3, "Bad loose node" },
425 { 4, "Bad initial subobject" },
426 { 5, "No route available toward destination" },
427 { 6, "Unacceptable label value" },
428 { 7, "RRO indicated routing loops" },
429 { 8, "non-RSVP-capable router in the path" },
430 { 9, "MPLS label allocation failure" },
431 { 10, "Unsupported L3PID" },
435 static const struct tok rsvp_obj_error_code_diffserv_te_values
[] = {
436 { 1, "Unexpected CT object" },
437 { 2, "Unsupported CT" },
438 { 3, "Invalid CT value" },
439 { 4, "CT/setup priority do not form a configured TE-Class" },
440 { 5, "CT/holding priority do not form a configured TE-Class" },
441 { 6, "CT/setup priority and CT/holding priority do not form a configured TE-Class" },
442 { 7, "Inconsistency between signaled PSC and signaled CT" },
443 { 8, "Inconsistency between signaled PHBs and signaled CT" },
447 /* rfc3473 / rfc 3471 */
448 static const struct tok rsvp_obj_admin_status_flag_values
[] = {
449 { 0x80000000, "Reflect" },
450 { 0x00000004, "Testing" },
451 { 0x00000002, "Admin-down" },
452 { 0x00000001, "Delete-in-progress" },
456 /* label set actions - rfc3471 */
457 #define LABEL_SET_INCLUSIVE_LIST 0
458 #define LABEL_SET_EXCLUSIVE_LIST 1
459 #define LABEL_SET_INCLUSIVE_RANGE 2
460 #define LABEL_SET_EXCLUSIVE_RANGE 3
462 static const struct tok rsvp_obj_label_set_action_values
[] = {
463 { LABEL_SET_INCLUSIVE_LIST
, "Inclusive list" },
464 { LABEL_SET_EXCLUSIVE_LIST
, "Exclusive list" },
465 { LABEL_SET_INCLUSIVE_RANGE
, "Inclusive range" },
466 { LABEL_SET_EXCLUSIVE_RANGE
, "Exclusive range" },
470 /* OIF RSVP extensions UNI 1.0 Signaling, release 2 */
471 #define RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS 1
472 #define RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS 2
473 #define RSVP_GEN_UNI_SUBOBJ_DIVERSITY 3
474 #define RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL 4
475 #define RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL 5
477 static const struct tok rsvp_obj_generalized_uni_values
[] = {
478 { RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
, "Source TNA address" },
479 { RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
, "Destination TNA address" },
480 { RSVP_GEN_UNI_SUBOBJ_DIVERSITY
, "Diversity" },
481 { RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
, "Egress label" },
482 { RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
, "Service level" },
487 * this is a dissector for all the intserv defined
488 * specs as defined per rfc2215
489 * it is called from various rsvp objects;
490 * returns the amount of bytes being processed
493 rsvp_intserv_print(netdissect_options
*ndo
,
494 const u_char
*tptr
, u_short obj_tlen
)
496 int parameter_id
,parameter_length
;
504 parameter_id
= *(tptr
);
505 parameter_length
= EXTRACT_16BITS(tptr
+2)<<2; /* convert wordcount to bytecount */
507 ND_PRINT((ndo
, "\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
508 tok2str(rsvp_intserv_parameter_id_values
,"unknown",parameter_id
),
513 if (obj_tlen
< parameter_length
+4)
515 switch(parameter_id
) { /* parameter_id */
519 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
520 * | 4 (e) | (f) | 1 (g) |
521 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
522 * | IS hop cnt (32-bit unsigned integer) |
523 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
525 if (parameter_length
== 4)
526 ND_PRINT((ndo
, "\n\t\tIS hop count: %u", EXTRACT_32BITS(tptr
+ 4)));
531 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
532 * | 6 (h) | (i) | 1 (j) |
533 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
534 * | Path b/w estimate (32-bit IEEE floating point number) |
535 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
537 if (parameter_length
== 4) {
538 bw
.i
= EXTRACT_32BITS(tptr
+4);
539 ND_PRINT((ndo
, "\n\t\tPath b/w estimate: %.10g Mbps", bw
.f
/ 125000));
545 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
546 * | 8 (k) | (l) | 1 (m) |
547 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
548 * | Minimum path latency (32-bit integer) |
549 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
551 if (parameter_length
== 4) {
552 ND_PRINT((ndo
, "\n\t\tMinimum path latency: "));
553 if (EXTRACT_32BITS(tptr
+4) == 0xffffffff)
554 ND_PRINT((ndo
, "don't care"));
556 ND_PRINT((ndo
, "%u", EXTRACT_32BITS(tptr
+ 4)));
563 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
564 * | 10 (n) | (o) | 1 (p) |
565 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
566 * | Composed MTU (32-bit unsigned integer) |
567 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
569 if (parameter_length
== 4)
570 ND_PRINT((ndo
, "\n\t\tComposed MTU: %u bytes", EXTRACT_32BITS(tptr
+ 4)));
574 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
575 * | 127 (e) | 0 (f) | 5 (g) |
576 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
577 * | Token Bucket Rate [r] (32-bit IEEE floating point number) |
578 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
579 * | Token Bucket Size [b] (32-bit IEEE floating point number) |
580 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
581 * | Peak Data Rate [p] (32-bit IEEE floating point number) |
582 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
583 * | Minimum Policed Unit [m] (32-bit integer) |
584 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
585 * | Maximum Packet Size [M] (32-bit integer) |
586 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
589 if (parameter_length
== 20) {
590 bw
.i
= EXTRACT_32BITS(tptr
+4);
591 ND_PRINT((ndo
, "\n\t\tToken Bucket Rate: %.10g Mbps", bw
.f
/ 125000));
592 bw
.i
= EXTRACT_32BITS(tptr
+8);
593 ND_PRINT((ndo
, "\n\t\tToken Bucket Size: %.10g bytes", bw
.f
));
594 bw
.i
= EXTRACT_32BITS(tptr
+12);
595 ND_PRINT((ndo
, "\n\t\tPeak Data Rate: %.10g Mbps", bw
.f
/ 125000));
596 ND_PRINT((ndo
, "\n\t\tMinimum Policed Unit: %u bytes", EXTRACT_32BITS(tptr
+ 16)));
597 ND_PRINT((ndo
, "\n\t\tMaximum Packet Size: %u bytes", EXTRACT_32BITS(tptr
+ 20)));
603 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
604 * | 130 (h) | 0 (i) | 2 (j) |
605 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
606 * | Rate [R] (32-bit IEEE floating point number) |
607 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
608 * | Slack Term [S] (32-bit integer) |
609 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
612 if (parameter_length
== 8) {
613 bw
.i
= EXTRACT_32BITS(tptr
+4);
614 ND_PRINT((ndo
, "\n\t\tRate: %.10g Mbps", bw
.f
/ 125000));
615 ND_PRINT((ndo
, "\n\t\tSlack Term: %u", EXTRACT_32BITS(tptr
+ 8)));
623 if (parameter_length
== 4)
624 ND_PRINT((ndo
, "\n\t\tValue: %u", EXTRACT_32BITS(tptr
+ 4)));
628 if (ndo
->ndo_vflag
<= 1)
629 print_unknown_data(ndo
, tptr
+ 4, "\n\t\t", parameter_length
);
631 return (parameter_length
+4); /* header length 4 bytes */
635 rsvp_obj_print(netdissect_options
*ndo
,
637 #ifndef HAVE_LIBCRYPTO
641 #ifndef HAVE_LIBCRYPTO
644 , const u_char
*tptr
,
645 const char *ident
, u_int tlen
)
647 const struct rsvp_object_header
*rsvp_obj_header
;
648 const u_char
*obj_tptr
;
650 const struct rsvp_obj_integrity_t
*rsvp_obj_integrity
;
651 const struct rsvp_obj_frr_t
*rsvp_obj_frr
;
654 u_short rsvp_obj_len
,rsvp_obj_ctype
,obj_tlen
,intserv_serv_tlen
;
655 int hexdump
,processed
,padbytes
,error_code
,error_value
,i
,sigcheck
;
662 u_int action
, subchannel
;
664 while(tlen
>=sizeof(struct rsvp_object_header
)) {
665 /* did we capture enough for fully decoding the object header ? */
666 ND_TCHECK2(*tptr
, sizeof(struct rsvp_object_header
));
668 rsvp_obj_header
= (const struct rsvp_object_header
*)tptr
;
669 rsvp_obj_len
=EXTRACT_16BITS(rsvp_obj_header
->length
);
670 rsvp_obj_ctype
=rsvp_obj_header
->ctype
;
672 if(rsvp_obj_len
% 4) {
673 ND_PRINT((ndo
, "%sERROR: object header size %u not a multiple of 4", ident
, rsvp_obj_len
));
676 if(rsvp_obj_len
< sizeof(struct rsvp_object_header
)) {
677 ND_PRINT((ndo
, "%sERROR: object header too short %u < %lu", ident
, rsvp_obj_len
,
678 (unsigned long)sizeof(const struct rsvp_object_header
)));
682 ND_PRINT((ndo
, "%s%s Object (%u) Flags: [%s",
684 tok2str(rsvp_obj_values
,
686 rsvp_obj_header
->class_num
),
687 rsvp_obj_header
->class_num
,
688 ((rsvp_obj_header
->class_num
) & 0x80) ? "ignore" : "reject"));
690 if (rsvp_obj_header
->class_num
> 128)
691 ND_PRINT((ndo
, " %s",
692 ((rsvp_obj_header
->class_num
) & 0x40) ? "and forward" : "silently"));
694 ND_PRINT((ndo
, " if unknown], Class-Type: %s (%u), length: %u",
695 tok2str(rsvp_ctype_values
,
697 ((rsvp_obj_header
->class_num
)<<8)+rsvp_obj_ctype
),
701 if(tlen
< rsvp_obj_len
) {
702 ND_PRINT((ndo
, "%sERROR: object goes past end of objects TLV", ident
));
706 obj_tptr
=tptr
+sizeof(struct rsvp_object_header
);
707 obj_tlen
=rsvp_obj_len
-sizeof(struct rsvp_object_header
);
709 /* did we capture enough for fully decoding the object ? */
710 if (!ND_TTEST2(*tptr
, rsvp_obj_len
))
714 switch(rsvp_obj_header
->class_num
) {
715 case RSVP_OBJ_SESSION
:
716 switch(rsvp_obj_ctype
) {
717 case RSVP_CTYPE_IPV4
:
720 ND_PRINT((ndo
, "%s IPv4 DestAddress: %s, Protocol ID: 0x%02x",
722 ipaddr_string(ndo
, obj_tptr
),
723 *(obj_tptr
+ sizeof(struct in_addr
))));
724 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
727 EXTRACT_16BITS(obj_tptr
+ 6)));
732 case RSVP_CTYPE_IPV6
:
735 ND_PRINT((ndo
, "%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
737 ip6addr_string(ndo
, obj_tptr
),
738 *(obj_tptr
+ sizeof(struct in6_addr
))));
739 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
741 *(obj_tptr
+sizeof(struct in6_addr
)+1),
742 EXTRACT_16BITS(obj_tptr
+ sizeof(struct in6_addr
) + 2)));
747 case RSVP_CTYPE_TUNNEL_IPV6
:
750 ND_PRINT((ndo
, "%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
752 ip6addr_string(ndo
, obj_tptr
),
753 EXTRACT_16BITS(obj_tptr
+18),
754 ip6addr_string(ndo
, obj_tptr
+ 20)));
759 case RSVP_CTYPE_14
: /* IPv6 p2mp LSP Tunnel */
762 ND_PRINT((ndo
, "%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
764 EXTRACT_32BITS(obj_tptr
),
765 EXTRACT_16BITS(obj_tptr
+6),
766 ip6addr_string(ndo
, obj_tptr
+ 8)));
771 case RSVP_CTYPE_13
: /* IPv4 p2mp LSP Tunnel */
774 ND_PRINT((ndo
, "%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
776 ipaddr_string(ndo
, obj_tptr
),
777 EXTRACT_16BITS(obj_tptr
+6),
778 ipaddr_string(ndo
, obj_tptr
+ 8)));
782 case RSVP_CTYPE_TUNNEL_IPV4
:
783 case RSVP_CTYPE_UNI_IPV4
:
786 ND_PRINT((ndo
, "%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
788 ipaddr_string(ndo
, obj_tptr
),
789 EXTRACT_16BITS(obj_tptr
+6),
790 ipaddr_string(ndo
, obj_tptr
+ 8)));
799 case RSVP_OBJ_CONFIRM
:
800 switch(rsvp_obj_ctype
) {
801 case RSVP_CTYPE_IPV4
:
802 if (obj_tlen
< sizeof(struct in_addr
))
804 ND_PRINT((ndo
, "%s IPv4 Receiver Address: %s",
806 ipaddr_string(ndo
, obj_tptr
)));
807 obj_tlen
-=sizeof(struct in_addr
);
808 obj_tptr
+=sizeof(struct in_addr
);
811 case RSVP_CTYPE_IPV6
:
812 if (obj_tlen
< sizeof(struct in6_addr
))
814 ND_PRINT((ndo
, "%s IPv6 Receiver Address: %s",
816 ip6addr_string(ndo
, obj_tptr
)));
817 obj_tlen
-=sizeof(struct in6_addr
);
818 obj_tptr
+=sizeof(struct in6_addr
);
826 case RSVP_OBJ_NOTIFY_REQ
:
827 switch(rsvp_obj_ctype
) {
828 case RSVP_CTYPE_IPV4
:
829 if (obj_tlen
< sizeof(struct in_addr
))
831 ND_PRINT((ndo
, "%s IPv4 Notify Node Address: %s",
833 ipaddr_string(ndo
, obj_tptr
)));
834 obj_tlen
-=sizeof(struct in_addr
);
835 obj_tptr
+=sizeof(struct in_addr
);
838 case RSVP_CTYPE_IPV6
:
839 if (obj_tlen
< sizeof(struct in6_addr
))
841 ND_PRINT((ndo
, "%s IPv6 Notify Node Address: %s",
843 ip6addr_string(ndo
, obj_tptr
)));
844 obj_tlen
-=sizeof(struct in6_addr
);
845 obj_tptr
+=sizeof(struct in6_addr
);
853 case RSVP_OBJ_SUGGESTED_LABEL
: /* fall through */
854 case RSVP_OBJ_UPSTREAM_LABEL
: /* fall through */
855 case RSVP_OBJ_RECOVERY_LABEL
: /* fall through */
857 switch(rsvp_obj_ctype
) {
859 while(obj_tlen
>= 4 ) {
860 ND_PRINT((ndo
, "%s Label: %u", ident
, EXTRACT_32BITS(obj_tptr
)));
868 ND_PRINT((ndo
, "%s Generalized Label: %u",
870 EXTRACT_32BITS(obj_tptr
)));
877 ND_PRINT((ndo
, "%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
879 EXTRACT_32BITS(obj_tptr
),
881 EXTRACT_32BITS(obj_tptr
+4),
882 EXTRACT_32BITS(obj_tptr
+ 8)));
892 switch(rsvp_obj_ctype
) {
896 ND_PRINT((ndo
, "%s Reservation Style: %s, Flags: [0x%02x]",
898 tok2str(rsvp_resstyle_values
,
900 EXTRACT_24BITS(obj_tptr
+1)),
910 case RSVP_OBJ_SENDER_TEMPLATE
:
911 switch(rsvp_obj_ctype
) {
912 case RSVP_CTYPE_IPV4
:
915 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
917 ipaddr_string(ndo
, obj_tptr
),
918 EXTRACT_16BITS(obj_tptr
+ 6)));
923 case RSVP_CTYPE_IPV6
:
926 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
928 ip6addr_string(ndo
, obj_tptr
),
929 EXTRACT_16BITS(obj_tptr
+ 18)));
933 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
936 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
937 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
939 ip6addr_string(ndo
, obj_tptr
),
940 EXTRACT_16BITS(obj_tptr
+18),
942 ip6addr_string(ndo
, obj_tptr
+20),
943 EXTRACT_16BITS(obj_tptr
+ 38)));
948 case RSVP_CTYPE_TUNNEL_IPV4
:
951 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
953 ipaddr_string(ndo
, obj_tptr
),
954 EXTRACT_16BITS(obj_tptr
+ 6)));
958 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
961 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
962 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
964 ipaddr_string(ndo
, obj_tptr
),
965 EXTRACT_16BITS(obj_tptr
+6),
967 ipaddr_string(ndo
, obj_tptr
+8),
968 EXTRACT_16BITS(obj_tptr
+ 12)));
977 case RSVP_OBJ_LABEL_REQ
:
978 switch(rsvp_obj_ctype
) {
980 while(obj_tlen
>= 4 ) {
981 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
983 tok2str(ethertype_values
,
984 "Unknown Protocol (0x%04x)",
985 EXTRACT_16BITS(obj_tptr
+ 2))));
993 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
995 tok2str(ethertype_values
,
996 "Unknown Protocol (0x%04x)",
997 EXTRACT_16BITS(obj_tptr
+ 2))));
998 ND_PRINT((ndo
, ",%s merge capability",((*(obj_tptr
+ 4)) & 0x80) ? "no" : "" ));
999 ND_PRINT((ndo
, "%s Minimum VPI/VCI: %u/%u",
1001 (EXTRACT_16BITS(obj_tptr
+4))&0xfff,
1002 (EXTRACT_16BITS(obj_tptr
+ 6)) & 0xfff));
1003 ND_PRINT((ndo
, "%s Maximum VPI/VCI: %u/%u",
1005 (EXTRACT_16BITS(obj_tptr
+8))&0xfff,
1006 (EXTRACT_16BITS(obj_tptr
+ 10)) & 0xfff));
1013 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
1015 tok2str(ethertype_values
,
1016 "Unknown Protocol (0x%04x)",
1017 EXTRACT_16BITS(obj_tptr
+ 2))));
1018 ND_PRINT((ndo
, "%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1020 (EXTRACT_32BITS(obj_tptr
+4))&0x7fffff,
1021 (EXTRACT_32BITS(obj_tptr
+8))&0x7fffff,
1022 (((EXTRACT_16BITS(obj_tptr
+4)>>7)&3) == 0 ) ? "10" : "",
1023 (((EXTRACT_16BITS(obj_tptr
+ 4) >> 7) & 3) == 2 ) ? "23" : ""));
1030 ND_PRINT((ndo
, "%s LSP Encoding Type: %s (%u)",
1032 tok2str(gmpls_encoding_values
,
1036 ND_PRINT((ndo
, "%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1038 tok2str(gmpls_switch_cap_values
,
1042 tok2str(gmpls_payload_values
,
1044 EXTRACT_16BITS(obj_tptr
+2)),
1045 EXTRACT_16BITS(obj_tptr
+ 2)));
1056 switch(rsvp_obj_ctype
) {
1057 case RSVP_CTYPE_IPV4
:
1058 while(obj_tlen
>= 4 ) {
1059 ND_PRINT((ndo
, "%s Subobject Type: %s, length %u",
1061 tok2str(rsvp_obj_xro_values
,
1063 RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)),
1066 if (*(obj_tptr
+1) == 0) { /* prevent infinite loops */
1067 ND_PRINT((ndo
, "%s ERROR: zero length ERO subtype", ident
));
1071 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)) {
1072 case RSVP_OBJ_XRO_IPV4
:
1073 ND_PRINT((ndo
, ", %s, %s/%u, Flags: [%s]",
1074 RSVP_OBJ_XRO_MASK_LOOSE(*obj_tptr
) ? "Loose" : "Strict",
1075 ipaddr_string(ndo
, obj_tptr
+2),
1077 bittok2str(rsvp_obj_rro_flag_values
,
1079 *(obj_tptr
+ 7)))); /* rfc3209 says that this field is rsvd. */
1081 case RSVP_OBJ_XRO_LABEL
:
1082 ND_PRINT((ndo
, ", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1083 bittok2str(rsvp_obj_rro_label_flag_values
,
1087 tok2str(rsvp_ctype_values
,
1089 *(obj_tptr
+3) + 256*RSVP_OBJ_RRO
),
1091 EXTRACT_32BITS(obj_tptr
+ 4)));
1093 obj_tlen
-=*(obj_tptr
+1);
1094 obj_tptr
+=*(obj_tptr
+1);
1102 case RSVP_OBJ_HELLO
:
1103 switch(rsvp_obj_ctype
) {
1108 ND_PRINT((ndo
, "%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1110 EXTRACT_32BITS(obj_tptr
),
1111 EXTRACT_32BITS(obj_tptr
+ 4)));
1120 case RSVP_OBJ_RESTART_CAPABILITY
:
1121 switch(rsvp_obj_ctype
) {
1125 ND_PRINT((ndo
, "%s Restart Time: %ums, Recovery Time: %ums",
1127 EXTRACT_32BITS(obj_tptr
),
1128 EXTRACT_32BITS(obj_tptr
+ 4)));
1137 case RSVP_OBJ_SESSION_ATTRIBUTE
:
1138 switch(rsvp_obj_ctype
) {
1139 case RSVP_CTYPE_TUNNEL_IPV4
:
1142 namelen
= *(obj_tptr
+3);
1143 if (obj_tlen
< 4+namelen
)
1145 ND_PRINT((ndo
, "%s Session Name: ", ident
));
1146 for (i
= 0; i
< namelen
; i
++)
1147 safeputchar(ndo
, *(obj_tptr
+ 4 + i
));
1148 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1152 bittok2str(rsvp_session_attribute_flag_values
,
1156 obj_tlen
-=4+*(obj_tptr
+3);
1157 obj_tptr
+=4+*(obj_tptr
+3);
1164 case RSVP_OBJ_GENERALIZED_UNI
:
1165 switch(rsvp_obj_ctype
) {
1166 int subobj_type
,af
,subobj_len
,total_subobj_len
;
1173 /* read variable length subobjects */
1174 total_subobj_len
= obj_tlen
;
1175 while(total_subobj_len
> 0) {
1176 subobj_len
= EXTRACT_16BITS(obj_tptr
);
1177 subobj_type
= (EXTRACT_16BITS(obj_tptr
+2))>>8;
1178 af
= (EXTRACT_16BITS(obj_tptr
+2))&0x00FF;
1180 ND_PRINT((ndo
, "%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1182 tok2str(rsvp_obj_generalized_uni_values
, "Unknown", subobj_type
),
1184 tok2str(af_values
, "Unknown", af
), af
,
1187 switch(subobj_type
) {
1188 case RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
:
1189 case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
:
1195 ND_PRINT((ndo
, "%s UNI IPv4 TNA address: %s",
1196 ident
, ipaddr_string(ndo
, obj_tptr
+ 4)));
1200 if (subobj_len
< 20)
1202 ND_PRINT((ndo
, "%s UNI IPv6 TNA address: %s",
1203 ident
, ip6addr_string(ndo
, obj_tptr
+ 4)));
1208 /* unless we have a TLV parser lets just hexdump */
1215 case RSVP_GEN_UNI_SUBOBJ_DIVERSITY
:
1217 /* unless we have a TLV parser lets just hexdump */
1222 case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
:
1223 if (subobj_len
< 16) {
1227 ND_PRINT((ndo
, "%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
1229 ((EXTRACT_32BITS(obj_tptr
+4))>>31),
1230 ((EXTRACT_32BITS(obj_tptr
+4))&0xFF),
1231 EXTRACT_32BITS(obj_tptr
+8),
1232 EXTRACT_32BITS(obj_tptr
+ 12)));
1235 case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
:
1236 if (subobj_len
< 8) {
1240 ND_PRINT((ndo
, "%s Service level: %u",
1241 ident
, (EXTRACT_32BITS(obj_tptr
+ 4)) >> 24));
1248 total_subobj_len
-=subobj_len
;
1249 obj_tptr
+=subobj_len
;
1250 obj_tlen
+=subobj_len
;
1253 if (total_subobj_len
) {
1254 /* unless we have a TLV parser lets just hexdump */
1264 case RSVP_OBJ_RSVP_HOP
:
1265 switch(rsvp_obj_ctype
) {
1266 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1267 case RSVP_CTYPE_IPV4
:
1270 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1272 ipaddr_string(ndo
, obj_tptr
),
1273 EXTRACT_32BITS(obj_tptr
+ 4)));
1277 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1280 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1281 case RSVP_CTYPE_IPV6
:
1284 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1286 ip6addr_string(ndo
, obj_tptr
),
1287 EXTRACT_32BITS(obj_tptr
+ 16)));
1290 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1298 case RSVP_OBJ_TIME_VALUES
:
1299 switch(rsvp_obj_ctype
) {
1303 ND_PRINT((ndo
, "%s Refresh Period: %ums",
1305 EXTRACT_32BITS(obj_tptr
)));
1314 /* those three objects do share the same semantics */
1315 case RSVP_OBJ_SENDER_TSPEC
:
1316 case RSVP_OBJ_ADSPEC
:
1317 case RSVP_OBJ_FLOWSPEC
:
1318 switch(rsvp_obj_ctype
) {
1322 ND_PRINT((ndo
, "%s Msg-Version: %u, length: %u",
1324 (*obj_tptr
& 0xf0) >> 4,
1325 EXTRACT_16BITS(obj_tptr
+ 2) << 2));
1326 obj_tptr
+=4; /* get to the start of the service header */
1329 while (obj_tlen
>= 4) {
1330 intserv_serv_tlen
=EXTRACT_16BITS(obj_tptr
+2)<<2;
1331 ND_PRINT((ndo
, "%s Service Type: %s (%u), break bit %s set, Service length: %u",
1333 tok2str(rsvp_intserv_service_type_values
,"unknown",*(obj_tptr
)),
1335 (*(obj_tptr
+1)&0x80) ? "" : "not",
1336 intserv_serv_tlen
));
1338 obj_tptr
+=4; /* get to the start of the parameter list */
1341 while (intserv_serv_tlen
>=4) {
1342 processed
= rsvp_intserv_print(ndo
, obj_tptr
, obj_tlen
);
1345 obj_tlen
-=processed
;
1346 intserv_serv_tlen
-=processed
;
1347 obj_tptr
+=processed
;
1356 case RSVP_OBJ_FILTERSPEC
:
1357 switch(rsvp_obj_ctype
) {
1358 case RSVP_CTYPE_IPV4
:
1361 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1363 ipaddr_string(ndo
, obj_tptr
),
1364 EXTRACT_16BITS(obj_tptr
+ 6)));
1369 case RSVP_CTYPE_IPV6
:
1372 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1374 ip6addr_string(ndo
, obj_tptr
),
1375 EXTRACT_16BITS(obj_tptr
+ 18)));
1382 ND_PRINT((ndo
, "%s Source Address: %s, Flow Label: %u",
1384 ip6addr_string(ndo
, obj_tptr
),
1385 EXTRACT_24BITS(obj_tptr
+ 17)));
1389 case RSVP_CTYPE_TUNNEL_IPV6
:
1392 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1394 ipaddr_string(ndo
, obj_tptr
),
1395 EXTRACT_16BITS(obj_tptr
+ 18)));
1399 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
1402 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1403 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1405 ip6addr_string(ndo
, obj_tptr
),
1406 EXTRACT_16BITS(obj_tptr
+18),
1408 ip6addr_string(ndo
, obj_tptr
+20),
1409 EXTRACT_16BITS(obj_tptr
+ 38)));
1414 case RSVP_CTYPE_TUNNEL_IPV4
:
1417 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1419 ipaddr_string(ndo
, obj_tptr
),
1420 EXTRACT_16BITS(obj_tptr
+ 6)));
1424 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
1427 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1428 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1430 ipaddr_string(ndo
, obj_tptr
),
1431 EXTRACT_16BITS(obj_tptr
+6),
1433 ipaddr_string(ndo
, obj_tptr
+8),
1434 EXTRACT_16BITS(obj_tptr
+ 12)));
1443 case RSVP_OBJ_FASTREROUTE
:
1444 /* the differences between c-type 1 and 7 are minor */
1445 obj_ptr
.rsvp_obj_frr
= (const struct rsvp_obj_frr_t
*)obj_tptr
;
1446 bw
.i
= EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1448 switch(rsvp_obj_ctype
) {
1449 case RSVP_CTYPE_1
: /* new style */
1450 if (obj_tlen
< sizeof(struct rsvp_obj_frr_t
))
1452 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1454 (int)obj_ptr
.rsvp_obj_frr
->setup_prio
,
1455 (int)obj_ptr
.rsvp_obj_frr
->hold_prio
,
1456 (int)obj_ptr
.rsvp_obj_frr
->hop_limit
,
1457 bw
.f
* 8 / 1000000));
1458 ND_PRINT((ndo
, "%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
1460 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_any
),
1461 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->exclude_any
),
1462 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_all
)));
1463 obj_tlen
-=sizeof(struct rsvp_obj_frr_t
);
1464 obj_tptr
+=sizeof(struct rsvp_obj_frr_t
);
1467 case RSVP_CTYPE_TUNNEL_IPV4
: /* old style */
1470 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1472 (int)obj_ptr
.rsvp_obj_frr
->setup_prio
,
1473 (int)obj_ptr
.rsvp_obj_frr
->hold_prio
,
1474 (int)obj_ptr
.rsvp_obj_frr
->hop_limit
,
1475 bw
.f
* 8 / 1000000));
1476 ND_PRINT((ndo
, "%s Include Colors: 0x%08x, Exclude Colors: 0x%08x",
1478 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_any
),
1479 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->exclude_any
)));
1489 case RSVP_OBJ_DETOUR
:
1490 switch(rsvp_obj_ctype
) {
1491 case RSVP_CTYPE_TUNNEL_IPV4
:
1492 while(obj_tlen
>= 8) {
1493 ND_PRINT((ndo
, "%s PLR-ID: %s, Avoid-Node-ID: %s",
1495 ipaddr_string(ndo
, obj_tptr
),
1496 ipaddr_string(ndo
, obj_tptr
+ 4)));
1506 case RSVP_OBJ_CLASSTYPE
:
1507 case RSVP_OBJ_CLASSTYPE_OLD
: /* fall through */
1508 switch(rsvp_obj_ctype
) {
1510 ND_PRINT((ndo
, "%s CT: %u",
1512 EXTRACT_32BITS(obj_tptr
) & 0x7));
1521 case RSVP_OBJ_ERROR_SPEC
:
1522 switch(rsvp_obj_ctype
) {
1523 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1524 case RSVP_CTYPE_IPV4
:
1527 error_code
=*(obj_tptr
+5);
1528 error_value
=EXTRACT_16BITS(obj_tptr
+6);
1529 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1531 ipaddr_string(ndo
, obj_tptr
),
1534 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1536 switch (error_code
) {
1537 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1538 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1539 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1542 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
: /* fall through */
1543 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
:
1544 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1545 tok2str(rsvp_obj_error_code_diffserv_te_values
,"unknown",error_value
),
1549 ND_PRINT((ndo
, ", Unknown Error Value (%u)", error_value
));
1556 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1557 case RSVP_CTYPE_IPV6
:
1560 error_code
=*(obj_tptr
+17);
1561 error_value
=EXTRACT_16BITS(obj_tptr
+18);
1562 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1564 ip6addr_string(ndo
, obj_tptr
),
1567 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1570 switch (error_code
) {
1571 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1572 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1573 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1588 case RSVP_OBJ_PROPERTIES
:
1589 switch(rsvp_obj_ctype
) {
1593 padbytes
= EXTRACT_16BITS(obj_tptr
+2);
1594 ND_PRINT((ndo
, "%s TLV count: %u, padding bytes: %u",
1596 EXTRACT_16BITS(obj_tptr
),
1600 /* loop through as long there is anything longer than the TLV header (2) */
1601 while(obj_tlen
>= 2 + padbytes
) {
1602 ND_PRINT((ndo
, "%s %s TLV (0x%02x), length: %u", /* length includes header */
1604 tok2str(rsvp_obj_prop_tlv_values
,"unknown",*obj_tptr
),
1607 if (obj_tlen
< *(obj_tptr
+1))
1609 if (*(obj_tptr
+1) < 2)
1611 print_unknown_data(ndo
, obj_tptr
+ 2, "\n\t\t", *(obj_tptr
+ 1) - 2);
1612 obj_tlen
-=*(obj_tptr
+1);
1613 obj_tptr
+=*(obj_tptr
+1);
1621 case RSVP_OBJ_MESSAGE_ID
: /* fall through */
1622 case RSVP_OBJ_MESSAGE_ID_ACK
: /* fall through */
1623 case RSVP_OBJ_MESSAGE_ID_LIST
:
1624 switch(rsvp_obj_ctype
) {
1629 ND_PRINT((ndo
, "%s Flags [0x%02x], epoch: %u",
1632 EXTRACT_24BITS(obj_tptr
+ 1)));
1635 /* loop through as long there are no messages left */
1636 while(obj_tlen
>= 4) {
1637 ND_PRINT((ndo
, "%s Message-ID 0x%08x (%u)",
1639 EXTRACT_32BITS(obj_tptr
),
1640 EXTRACT_32BITS(obj_tptr
)));
1650 case RSVP_OBJ_INTEGRITY
:
1651 switch(rsvp_obj_ctype
) {
1653 if (obj_tlen
< sizeof(struct rsvp_obj_integrity_t
))
1655 obj_ptr
.rsvp_obj_integrity
= (const struct rsvp_obj_integrity_t
*)obj_tptr
;
1656 ND_PRINT((ndo
, "%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
1658 EXTRACT_16BITS(obj_ptr
.rsvp_obj_integrity
->key_id
),
1659 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->key_id
+2),
1660 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->sequence
),
1661 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->sequence
+4),
1662 bittok2str(rsvp_obj_integrity_flag_values
,
1664 obj_ptr
.rsvp_obj_integrity
->flags
)));
1665 ND_PRINT((ndo
, "%s MD5-sum 0x%08x%08x%08x%08x ",
1667 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
),
1668 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+4),
1669 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+8),
1670 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+ 12)));
1672 #ifdef HAVE_LIBCRYPTO
1673 sigcheck
= signature_verify(ndo
, pptr
, plen
, (unsigned char *)obj_ptr
.\
1674 rsvp_obj_integrity
->digest
);
1676 sigcheck
= CANT_CHECK_SIGNATURE
;
1678 ND_PRINT((ndo
, " (%s)", tok2str(signature_check_values
, "Unknown", sigcheck
)));
1680 obj_tlen
+=sizeof(struct rsvp_obj_integrity_t
);
1681 obj_tptr
+=sizeof(struct rsvp_obj_integrity_t
);
1688 case RSVP_OBJ_ADMIN_STATUS
:
1689 switch(rsvp_obj_ctype
) {
1693 ND_PRINT((ndo
, "%s Flags [%s]", ident
,
1694 bittok2str(rsvp_obj_admin_status_flag_values
, "none",
1695 EXTRACT_32BITS(obj_tptr
))));
1704 case RSVP_OBJ_LABEL_SET
:
1705 switch(rsvp_obj_ctype
) {
1709 action
= (EXTRACT_16BITS(obj_tptr
)>>8);
1711 ND_PRINT((ndo
, "%s Action: %s (%u), Label type: %u", ident
,
1712 tok2str(rsvp_obj_label_set_action_values
, "Unknown", action
),
1713 action
, ((EXTRACT_32BITS(obj_tptr
) & 0x7F))));
1716 case LABEL_SET_INCLUSIVE_RANGE
:
1717 case LABEL_SET_EXCLUSIVE_RANGE
: /* fall through */
1719 /* only a couple of subchannels are expected */
1722 ND_PRINT((ndo
, "%s Start range: %u, End range: %u", ident
,
1723 EXTRACT_32BITS(obj_tptr
+4),
1724 EXTRACT_32BITS(obj_tptr
+ 8)));
1733 while(obj_tlen
>= 4 ) {
1734 ND_PRINT((ndo
, "%s Subchannel #%u: %u", ident
, subchannel
,
1735 EXTRACT_32BITS(obj_tptr
)));
1748 switch (rsvp_obj_ctype
) {
1749 case RSVP_CTYPE_IPV4
:
1752 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1753 ident
, ipaddr_string(ndo
, obj_tptr
)));
1759 case RSVP_CTYPE_IPV6
:
1762 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1763 ident
, ip6addr_string(ndo
, obj_tptr
)));
1774 * FIXME those are the defined objects that lack a decoder
1775 * you are welcome to contribute code ;-)
1778 case RSVP_OBJ_SCOPE
:
1779 case RSVP_OBJ_POLICY_DATA
:
1780 case RSVP_OBJ_ACCEPT_LABEL_SET
:
1781 case RSVP_OBJ_PROTECTION
:
1783 if (ndo
->ndo_vflag
<= 1)
1784 print_unknown_data(ndo
, obj_tptr
, "\n\t ", obj_tlen
); /* FIXME indentation */
1787 /* do we also want to see a hex dump ? */
1788 if (ndo
->ndo_vflag
> 1 || hexdump
== TRUE
)
1789 print_unknown_data(ndo
, tptr
+ sizeof(struct rsvp_object_header
), "\n\t ", /* FIXME indentation */
1790 rsvp_obj_len
- sizeof(struct rsvp_object_header
));
1797 ND_PRINT((ndo
, "\n\t\t packet exceeded snapshot"));
1802 rsvp_print(netdissect_options
*ndo
,
1803 register const u_char
*pptr
, register u_int len
)
1805 struct rsvp_common_header
*rsvp_com_header
;
1806 const u_char
*tptr
,*subtptr
;
1807 u_short plen
, tlen
, subtlen
;
1811 rsvp_com_header
= (struct rsvp_common_header
*)pptr
;
1812 ND_TCHECK(*rsvp_com_header
);
1815 * Sanity checking of the header.
1817 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1818 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1819 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1823 /* in non-verbose mode just lets print the basic Message Type*/
1824 if (ndo
->ndo_vflag
< 1) {
1825 ND_PRINT((ndo
, "RSVPv%u %s Message, length: %u",
1826 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1827 tok2str(rsvp_msg_type_values
, "unknown (%u)",rsvp_com_header
->msg_type
),
1832 /* ok they seem to want to know everything - lets fully decode it */
1834 plen
= tlen
= EXTRACT_16BITS(rsvp_com_header
->length
);
1836 ND_PRINT((ndo
, "\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1837 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1838 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1839 rsvp_com_header
->msg_type
,
1840 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1842 rsvp_com_header
->ttl
,
1843 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1846 * Clear checksum prior to signature verification.
1848 rsvp_com_header
->checksum
[0] = 0;
1849 rsvp_com_header
->checksum
[1] = 0;
1851 if (tlen
< sizeof(const struct rsvp_common_header
)) {
1852 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", tlen
,
1853 (unsigned long)sizeof(const struct rsvp_common_header
)));
1857 tptr
+=sizeof(const struct rsvp_common_header
);
1858 tlen
-=sizeof(const struct rsvp_common_header
);
1860 switch(rsvp_com_header
->msg_type
) {
1862 case RSVP_MSGTYPE_AGGREGATE
:
1865 rsvp_com_header
= (struct rsvp_common_header
*)subtptr
;
1866 ND_TCHECK(*rsvp_com_header
);
1869 * Sanity checking of the header.
1871 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1872 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1873 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1876 subtlen
=EXTRACT_16BITS(rsvp_com_header
->length
);
1878 ND_PRINT((ndo
, "\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1879 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1880 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1881 rsvp_com_header
->msg_type
,
1882 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1884 rsvp_com_header
->ttl
,
1885 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1888 * Clear checksum prior to signature verification.
1890 rsvp_com_header
->checksum
[0] = 0;
1891 rsvp_com_header
->checksum
[1] = 0;
1893 if (subtlen
< sizeof(const struct rsvp_common_header
)) {
1894 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", subtlen
,
1895 (unsigned long)sizeof(const struct rsvp_common_header
)));
1899 if (tlen
< subtlen
) {
1900 ND_PRINT((ndo
, "ERROR: common header too large %u > %u", subtlen
,
1905 subtptr
+=sizeof(const struct rsvp_common_header
);
1906 subtlen
-=sizeof(const struct rsvp_common_header
);
1908 if (rsvp_obj_print(ndo
, pptr
, plen
, subtptr
, "\n\t ", subtlen
) == -1)
1911 tptr
+=subtlen
+sizeof(const struct rsvp_common_header
);
1912 tlen
-=subtlen
+sizeof(const struct rsvp_common_header
);
1917 case RSVP_MSGTYPE_PATH
:
1918 case RSVP_MSGTYPE_RESV
:
1919 case RSVP_MSGTYPE_PATHERR
:
1920 case RSVP_MSGTYPE_RESVERR
:
1921 case RSVP_MSGTYPE_PATHTEAR
:
1922 case RSVP_MSGTYPE_RESVTEAR
:
1923 case RSVP_MSGTYPE_RESVCONF
:
1924 case RSVP_MSGTYPE_HELLO_OLD
:
1925 case RSVP_MSGTYPE_HELLO
:
1926 case RSVP_MSGTYPE_ACK
:
1927 case RSVP_MSGTYPE_SREFRESH
:
1928 if (rsvp_obj_print(ndo
, pptr
, plen
, tptr
, "\n\t ", tlen
) == -1)
1933 print_unknown_data(ndo
, tptr
, "\n\t ", tlen
);
1939 ND_PRINT((ndo
, "\n\t\t packet exceeded snapshot"));