2 * Copyright (c) 1998-2007 The TCPDUMP project
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that: (1) source code
6 * distributions retain the above copyright notice and this paragraph
7 * in its entirety, and (2) distributions including binary code include
8 * the above copyright notice and this paragraph in its entirety in
9 * the documentation or other materials provided with the distribution.
10 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
11 * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
12 * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
13 * FOR A PARTICULAR PURPOSE.
15 * Original code by Hannes Gredler (hannes@juniper.net)
22 #include <netdissect-stdinc.h>
24 #include "netdissect.h"
26 #include "addrtoname.h"
27 #include "ethertype.h"
30 #include "signature.h"
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)));
725 case RSVP_CTYPE_IPV6
:
728 ND_PRINT((ndo
, "%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
730 ip6addr_string(ndo
, obj_tptr
),
731 *(obj_tptr
+ sizeof(struct in6_addr
))));
732 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
734 *(obj_tptr
+sizeof(struct in6_addr
)+1),
735 EXTRACT_16BITS(obj_tptr
+ sizeof(struct in6_addr
) + 2)));
740 case RSVP_CTYPE_TUNNEL_IPV6
:
743 ND_PRINT((ndo
, "%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
745 ip6addr_string(ndo
, obj_tptr
),
746 EXTRACT_16BITS(obj_tptr
+18),
747 ip6addr_string(ndo
, obj_tptr
+ 20)));
752 case RSVP_CTYPE_14
: /* IPv6 p2mp LSP Tunnel */
755 ND_PRINT((ndo
, "%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
757 EXTRACT_32BITS(obj_tptr
),
758 EXTRACT_16BITS(obj_tptr
+6),
759 ip6addr_string(ndo
, obj_tptr
+ 8)));
763 case RSVP_CTYPE_13
: /* IPv4 p2mp LSP Tunnel */
766 ND_PRINT((ndo
, "%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
768 ipaddr_string(ndo
, obj_tptr
),
769 EXTRACT_16BITS(obj_tptr
+6),
770 ipaddr_string(ndo
, obj_tptr
+ 8)));
774 case RSVP_CTYPE_TUNNEL_IPV4
:
775 case RSVP_CTYPE_UNI_IPV4
:
778 ND_PRINT((ndo
, "%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
780 ipaddr_string(ndo
, obj_tptr
),
781 EXTRACT_16BITS(obj_tptr
+6),
782 ipaddr_string(ndo
, obj_tptr
+ 8)));
791 case RSVP_OBJ_CONFIRM
:
792 switch(rsvp_obj_ctype
) {
793 case RSVP_CTYPE_IPV4
:
794 if (obj_tlen
< sizeof(struct in_addr
))
796 ND_PRINT((ndo
, "%s IPv4 Receiver Address: %s",
798 ipaddr_string(ndo
, obj_tptr
)));
799 obj_tlen
-=sizeof(struct in_addr
);
800 obj_tptr
+=sizeof(struct in_addr
);
802 case RSVP_CTYPE_IPV6
:
803 if (obj_tlen
< sizeof(struct in6_addr
))
805 ND_PRINT((ndo
, "%s IPv6 Receiver Address: %s",
807 ip6addr_string(ndo
, obj_tptr
)));
808 obj_tlen
-=sizeof(struct in6_addr
);
809 obj_tptr
+=sizeof(struct in6_addr
);
816 case RSVP_OBJ_NOTIFY_REQ
:
817 switch(rsvp_obj_ctype
) {
818 case RSVP_CTYPE_IPV4
:
819 if (obj_tlen
< sizeof(struct in_addr
))
821 ND_PRINT((ndo
, "%s IPv4 Notify Node Address: %s",
823 ipaddr_string(ndo
, obj_tptr
)));
824 obj_tlen
-=sizeof(struct in_addr
);
825 obj_tptr
+=sizeof(struct in_addr
);
827 case RSVP_CTYPE_IPV6
:
828 if (obj_tlen
< sizeof(struct in6_addr
))
830 ND_PRINT((ndo
, "%s IPv6 Notify Node Address: %s",
832 ip6addr_string(ndo
, obj_tptr
)));
833 obj_tlen
-=sizeof(struct in6_addr
);
834 obj_tptr
+=sizeof(struct in6_addr
);
841 case RSVP_OBJ_SUGGESTED_LABEL
: /* fall through */
842 case RSVP_OBJ_UPSTREAM_LABEL
: /* fall through */
843 case RSVP_OBJ_RECOVERY_LABEL
: /* fall through */
845 switch(rsvp_obj_ctype
) {
847 while(obj_tlen
>= 4 ) {
848 ND_PRINT((ndo
, "%s Label: %u", ident
, EXTRACT_32BITS(obj_tptr
)));
856 ND_PRINT((ndo
, "%s Generalized Label: %u",
858 EXTRACT_32BITS(obj_tptr
)));
865 ND_PRINT((ndo
, "%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
867 EXTRACT_32BITS(obj_tptr
),
869 EXTRACT_32BITS(obj_tptr
+4),
870 EXTRACT_32BITS(obj_tptr
+ 8)));
880 switch(rsvp_obj_ctype
) {
884 ND_PRINT((ndo
, "%s Reservation Style: %s, Flags: [0x%02x]",
886 tok2str(rsvp_resstyle_values
,
888 EXTRACT_24BITS(obj_tptr
+1)),
898 case RSVP_OBJ_SENDER_TEMPLATE
:
899 switch(rsvp_obj_ctype
) {
900 case RSVP_CTYPE_IPV4
:
903 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
905 ipaddr_string(ndo
, obj_tptr
),
906 EXTRACT_16BITS(obj_tptr
+ 6)));
910 case RSVP_CTYPE_IPV6
:
913 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
915 ip6addr_string(ndo
, obj_tptr
),
916 EXTRACT_16BITS(obj_tptr
+ 18)));
920 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
923 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
924 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
926 ip6addr_string(ndo
, obj_tptr
),
927 EXTRACT_16BITS(obj_tptr
+18),
929 ip6addr_string(ndo
, obj_tptr
+20),
930 EXTRACT_16BITS(obj_tptr
+ 38)));
934 case RSVP_CTYPE_TUNNEL_IPV4
:
937 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
939 ipaddr_string(ndo
, obj_tptr
),
940 EXTRACT_16BITS(obj_tptr
+ 6)));
944 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
947 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
948 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
950 ipaddr_string(ndo
, obj_tptr
),
951 EXTRACT_16BITS(obj_tptr
+6),
953 ipaddr_string(ndo
, obj_tptr
+8),
954 EXTRACT_16BITS(obj_tptr
+ 12)));
963 case RSVP_OBJ_LABEL_REQ
:
964 switch(rsvp_obj_ctype
) {
966 while(obj_tlen
>= 4 ) {
967 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
969 tok2str(ethertype_values
,
970 "Unknown Protocol (0x%04x)",
971 EXTRACT_16BITS(obj_tptr
+ 2))));
979 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
981 tok2str(ethertype_values
,
982 "Unknown Protocol (0x%04x)",
983 EXTRACT_16BITS(obj_tptr
+ 2))));
984 ND_PRINT((ndo
, ",%s merge capability",((*(obj_tptr
+ 4)) & 0x80) ? "no" : "" ));
985 ND_PRINT((ndo
, "%s Minimum VPI/VCI: %u/%u",
987 (EXTRACT_16BITS(obj_tptr
+4))&0xfff,
988 (EXTRACT_16BITS(obj_tptr
+ 6)) & 0xfff));
989 ND_PRINT((ndo
, "%s Maximum VPI/VCI: %u/%u",
991 (EXTRACT_16BITS(obj_tptr
+8))&0xfff,
992 (EXTRACT_16BITS(obj_tptr
+ 10)) & 0xfff));
999 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
1001 tok2str(ethertype_values
,
1002 "Unknown Protocol (0x%04x)",
1003 EXTRACT_16BITS(obj_tptr
+ 2))));
1004 ND_PRINT((ndo
, "%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1006 (EXTRACT_32BITS(obj_tptr
+4))&0x7fffff,
1007 (EXTRACT_32BITS(obj_tptr
+8))&0x7fffff,
1008 (((EXTRACT_16BITS(obj_tptr
+4)>>7)&3) == 0 ) ? "10" : "",
1009 (((EXTRACT_16BITS(obj_tptr
+ 4) >> 7) & 3) == 2 ) ? "23" : ""));
1016 ND_PRINT((ndo
, "%s LSP Encoding Type: %s (%u)",
1018 tok2str(gmpls_encoding_values
,
1022 ND_PRINT((ndo
, "%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1024 tok2str(gmpls_switch_cap_values
,
1028 tok2str(gmpls_payload_values
,
1030 EXTRACT_16BITS(obj_tptr
+2)),
1031 EXTRACT_16BITS(obj_tptr
+ 2)));
1042 switch(rsvp_obj_ctype
) {
1043 case RSVP_CTYPE_IPV4
:
1044 while(obj_tlen
>= 4 ) {
1045 ND_PRINT((ndo
, "%s Subobject Type: %s, length %u",
1047 tok2str(rsvp_obj_xro_values
,
1049 RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)),
1052 if (*(obj_tptr
+1) == 0) { /* prevent infinite loops */
1053 ND_PRINT((ndo
, "%s ERROR: zero length ERO subtype", ident
));
1057 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)) {
1058 case RSVP_OBJ_XRO_IPV4
:
1059 ND_PRINT((ndo
, ", %s, %s/%u, Flags: [%s]",
1060 RSVP_OBJ_XRO_MASK_LOOSE(*obj_tptr
) ? "Loose" : "Strict",
1061 ipaddr_string(ndo
, obj_tptr
+2),
1063 bittok2str(rsvp_obj_rro_flag_values
,
1065 *(obj_tptr
+ 7)))); /* rfc3209 says that this field is rsvd. */
1067 case RSVP_OBJ_XRO_LABEL
:
1068 ND_PRINT((ndo
, ", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1069 bittok2str(rsvp_obj_rro_label_flag_values
,
1073 tok2str(rsvp_ctype_values
,
1075 *(obj_tptr
+3) + 256*RSVP_OBJ_RRO
),
1077 EXTRACT_32BITS(obj_tptr
+ 4)));
1079 obj_tlen
-=*(obj_tptr
+1);
1080 obj_tptr
+=*(obj_tptr
+1);
1088 case RSVP_OBJ_HELLO
:
1089 switch(rsvp_obj_ctype
) {
1094 ND_PRINT((ndo
, "%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1096 EXTRACT_32BITS(obj_tptr
),
1097 EXTRACT_32BITS(obj_tptr
+ 4)));
1106 case RSVP_OBJ_RESTART_CAPABILITY
:
1107 switch(rsvp_obj_ctype
) {
1111 ND_PRINT((ndo
, "%s Restart Time: %ums, Recovery Time: %ums",
1113 EXTRACT_32BITS(obj_tptr
),
1114 EXTRACT_32BITS(obj_tptr
+ 4)));
1123 case RSVP_OBJ_SESSION_ATTRIBUTE
:
1124 switch(rsvp_obj_ctype
) {
1125 case RSVP_CTYPE_TUNNEL_IPV4
:
1128 namelen
= *(obj_tptr
+3);
1129 if (obj_tlen
< 4+namelen
)
1131 ND_PRINT((ndo
, "%s Session Name: ", ident
));
1132 for (i
= 0; i
< namelen
; i
++)
1133 safeputchar(ndo
, *(obj_tptr
+ 4 + i
));
1134 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1138 bittok2str(rsvp_session_attribute_flag_values
,
1142 obj_tlen
-=4+*(obj_tptr
+3);
1143 obj_tptr
+=4+*(obj_tptr
+3);
1150 case RSVP_OBJ_GENERALIZED_UNI
:
1151 switch(rsvp_obj_ctype
) {
1152 int subobj_type
,af
,subobj_len
,total_subobj_len
;
1159 /* read variable length subobjects */
1160 total_subobj_len
= obj_tlen
;
1161 while(total_subobj_len
> 0) {
1162 subobj_len
= EXTRACT_16BITS(obj_tptr
);
1163 subobj_type
= (EXTRACT_16BITS(obj_tptr
+2))>>8;
1164 af
= (EXTRACT_16BITS(obj_tptr
+2))&0x00FF;
1166 ND_PRINT((ndo
, "%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1168 tok2str(rsvp_obj_generalized_uni_values
, "Unknown", subobj_type
),
1170 tok2str(af_values
, "Unknown", af
), af
,
1173 switch(subobj_type
) {
1174 case RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
:
1175 case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
:
1181 ND_PRINT((ndo
, "%s UNI IPv4 TNA address: %s",
1182 ident
, ipaddr_string(ndo
, obj_tptr
+ 4)));
1185 if (subobj_len
< 20)
1187 ND_PRINT((ndo
, "%s UNI IPv6 TNA address: %s",
1188 ident
, ip6addr_string(ndo
, obj_tptr
+ 4)));
1192 /* unless we have a TLV parser lets just hexdump */
1199 case RSVP_GEN_UNI_SUBOBJ_DIVERSITY
:
1201 /* unless we have a TLV parser lets just hexdump */
1206 case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
:
1207 if (subobj_len
< 16) {
1211 ND_PRINT((ndo
, "%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
1213 ((EXTRACT_32BITS(obj_tptr
+4))>>31),
1214 ((EXTRACT_32BITS(obj_tptr
+4))&0xFF),
1215 EXTRACT_32BITS(obj_tptr
+8),
1216 EXTRACT_32BITS(obj_tptr
+ 12)));
1219 case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
:
1220 if (subobj_len
< 8) {
1224 ND_PRINT((ndo
, "%s Service level: %u",
1225 ident
, (EXTRACT_32BITS(obj_tptr
+ 4)) >> 24));
1232 total_subobj_len
-=subobj_len
;
1233 obj_tptr
+=subobj_len
;
1234 obj_tlen
+=subobj_len
;
1237 if (total_subobj_len
) {
1238 /* unless we have a TLV parser lets just hexdump */
1248 case RSVP_OBJ_RSVP_HOP
:
1249 switch(rsvp_obj_ctype
) {
1250 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1251 case RSVP_CTYPE_IPV4
:
1254 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1256 ipaddr_string(ndo
, obj_tptr
),
1257 EXTRACT_32BITS(obj_tptr
+ 4)));
1261 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1263 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1264 case RSVP_CTYPE_IPV6
:
1267 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1269 ip6addr_string(ndo
, obj_tptr
),
1270 EXTRACT_32BITS(obj_tptr
+ 16)));
1273 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1280 case RSVP_OBJ_TIME_VALUES
:
1281 switch(rsvp_obj_ctype
) {
1285 ND_PRINT((ndo
, "%s Refresh Period: %ums",
1287 EXTRACT_32BITS(obj_tptr
)));
1296 /* those three objects do share the same semantics */
1297 case RSVP_OBJ_SENDER_TSPEC
:
1298 case RSVP_OBJ_ADSPEC
:
1299 case RSVP_OBJ_FLOWSPEC
:
1300 switch(rsvp_obj_ctype
) {
1304 ND_PRINT((ndo
, "%s Msg-Version: %u, length: %u",
1306 (*obj_tptr
& 0xf0) >> 4,
1307 EXTRACT_16BITS(obj_tptr
+ 2) << 2));
1308 obj_tptr
+=4; /* get to the start of the service header */
1311 while (obj_tlen
>= 4) {
1312 intserv_serv_tlen
=EXTRACT_16BITS(obj_tptr
+2)<<2;
1313 ND_PRINT((ndo
, "%s Service Type: %s (%u), break bit %s set, Service length: %u",
1315 tok2str(rsvp_intserv_service_type_values
,"unknown",*(obj_tptr
)),
1317 (*(obj_tptr
+1)&0x80) ? "" : "not",
1318 intserv_serv_tlen
));
1320 obj_tptr
+=4; /* get to the start of the parameter list */
1323 while (intserv_serv_tlen
>=4) {
1324 processed
= rsvp_intserv_print(ndo
, obj_tptr
, obj_tlen
);
1327 obj_tlen
-=processed
;
1328 intserv_serv_tlen
-=processed
;
1329 obj_tptr
+=processed
;
1338 case RSVP_OBJ_FILTERSPEC
:
1339 switch(rsvp_obj_ctype
) {
1340 case RSVP_CTYPE_IPV4
:
1343 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1345 ipaddr_string(ndo
, obj_tptr
),
1346 EXTRACT_16BITS(obj_tptr
+ 6)));
1350 case RSVP_CTYPE_IPV6
:
1353 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1355 ip6addr_string(ndo
, obj_tptr
),
1356 EXTRACT_16BITS(obj_tptr
+ 18)));
1363 ND_PRINT((ndo
, "%s Source Address: %s, Flow Label: %u",
1365 ip6addr_string(ndo
, obj_tptr
),
1366 EXTRACT_24BITS(obj_tptr
+ 17)));
1370 case RSVP_CTYPE_TUNNEL_IPV6
:
1373 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1375 ipaddr_string(ndo
, obj_tptr
),
1376 EXTRACT_16BITS(obj_tptr
+ 18)));
1380 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
1383 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1384 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1386 ip6addr_string(ndo
, obj_tptr
),
1387 EXTRACT_16BITS(obj_tptr
+18),
1389 ip6addr_string(ndo
, obj_tptr
+20),
1390 EXTRACT_16BITS(obj_tptr
+ 38)));
1394 case RSVP_CTYPE_TUNNEL_IPV4
:
1397 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1399 ipaddr_string(ndo
, obj_tptr
),
1400 EXTRACT_16BITS(obj_tptr
+ 6)));
1404 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
1407 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1408 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1410 ipaddr_string(ndo
, obj_tptr
),
1411 EXTRACT_16BITS(obj_tptr
+6),
1413 ipaddr_string(ndo
, obj_tptr
+8),
1414 EXTRACT_16BITS(obj_tptr
+ 12)));
1423 case RSVP_OBJ_FASTREROUTE
:
1424 /* the differences between c-type 1 and 7 are minor */
1425 obj_ptr
.rsvp_obj_frr
= (const struct rsvp_obj_frr_t
*)obj_tptr
;
1426 bw
.i
= EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1428 switch(rsvp_obj_ctype
) {
1429 case RSVP_CTYPE_1
: /* new style */
1430 if (obj_tlen
< sizeof(struct rsvp_obj_frr_t
))
1432 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1434 (int)obj_ptr
.rsvp_obj_frr
->setup_prio
,
1435 (int)obj_ptr
.rsvp_obj_frr
->hold_prio
,
1436 (int)obj_ptr
.rsvp_obj_frr
->hop_limit
,
1437 bw
.f
* 8 / 1000000));
1438 ND_PRINT((ndo
, "%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
1440 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_any
),
1441 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->exclude_any
),
1442 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_all
)));
1443 obj_tlen
-=sizeof(struct rsvp_obj_frr_t
);
1444 obj_tptr
+=sizeof(struct rsvp_obj_frr_t
);
1447 case RSVP_CTYPE_TUNNEL_IPV4
: /* old style */
1450 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1452 (int)obj_ptr
.rsvp_obj_frr
->setup_prio
,
1453 (int)obj_ptr
.rsvp_obj_frr
->hold_prio
,
1454 (int)obj_ptr
.rsvp_obj_frr
->hop_limit
,
1455 bw
.f
* 8 / 1000000));
1456 ND_PRINT((ndo
, "%s Include Colors: 0x%08x, Exclude Colors: 0x%08x",
1458 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_any
),
1459 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->exclude_any
)));
1469 case RSVP_OBJ_DETOUR
:
1470 switch(rsvp_obj_ctype
) {
1471 case RSVP_CTYPE_TUNNEL_IPV4
:
1472 while(obj_tlen
>= 8) {
1473 ND_PRINT((ndo
, "%s PLR-ID: %s, Avoid-Node-ID: %s",
1475 ipaddr_string(ndo
, obj_tptr
),
1476 ipaddr_string(ndo
, obj_tptr
+ 4)));
1486 case RSVP_OBJ_CLASSTYPE
:
1487 case RSVP_OBJ_CLASSTYPE_OLD
: /* fall through */
1488 switch(rsvp_obj_ctype
) {
1490 ND_PRINT((ndo
, "%s CT: %u",
1492 EXTRACT_32BITS(obj_tptr
) & 0x7));
1501 case RSVP_OBJ_ERROR_SPEC
:
1502 switch(rsvp_obj_ctype
) {
1503 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1504 case RSVP_CTYPE_IPV4
:
1507 error_code
=*(obj_tptr
+5);
1508 error_value
=EXTRACT_16BITS(obj_tptr
+6);
1509 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1511 ipaddr_string(ndo
, obj_tptr
),
1514 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1516 switch (error_code
) {
1517 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1518 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1519 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1522 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
: /* fall through */
1523 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
:
1524 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1525 tok2str(rsvp_obj_error_code_diffserv_te_values
,"unknown",error_value
),
1529 ND_PRINT((ndo
, ", Unknown Error Value (%u)", error_value
));
1535 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1536 case RSVP_CTYPE_IPV6
:
1539 error_code
=*(obj_tptr
+17);
1540 error_value
=EXTRACT_16BITS(obj_tptr
+18);
1541 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1543 ip6addr_string(ndo
, obj_tptr
),
1546 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1549 switch (error_code
) {
1550 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1551 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1552 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1566 case RSVP_OBJ_PROPERTIES
:
1567 switch(rsvp_obj_ctype
) {
1571 padbytes
= EXTRACT_16BITS(obj_tptr
+2);
1572 ND_PRINT((ndo
, "%s TLV count: %u, padding bytes: %u",
1574 EXTRACT_16BITS(obj_tptr
),
1578 /* loop through as long there is anything longer than the TLV header (2) */
1579 while(obj_tlen
>= 2 + padbytes
) {
1580 ND_PRINT((ndo
, "%s %s TLV (0x%02x), length: %u", /* length includes header */
1582 tok2str(rsvp_obj_prop_tlv_values
,"unknown",*obj_tptr
),
1585 if (obj_tlen
< *(obj_tptr
+1))
1587 if (*(obj_tptr
+1) < 2)
1589 print_unknown_data(ndo
, obj_tptr
+ 2, "\n\t\t", *(obj_tptr
+ 1) - 2);
1590 obj_tlen
-=*(obj_tptr
+1);
1591 obj_tptr
+=*(obj_tptr
+1);
1599 case RSVP_OBJ_MESSAGE_ID
: /* fall through */
1600 case RSVP_OBJ_MESSAGE_ID_ACK
: /* fall through */
1601 case RSVP_OBJ_MESSAGE_ID_LIST
:
1602 switch(rsvp_obj_ctype
) {
1607 ND_PRINT((ndo
, "%s Flags [0x%02x], epoch: %u",
1610 EXTRACT_24BITS(obj_tptr
+ 1)));
1613 /* loop through as long there are no messages left */
1614 while(obj_tlen
>= 4) {
1615 ND_PRINT((ndo
, "%s Message-ID 0x%08x (%u)",
1617 EXTRACT_32BITS(obj_tptr
),
1618 EXTRACT_32BITS(obj_tptr
)));
1628 case RSVP_OBJ_INTEGRITY
:
1629 switch(rsvp_obj_ctype
) {
1631 if (obj_tlen
< sizeof(struct rsvp_obj_integrity_t
))
1633 obj_ptr
.rsvp_obj_integrity
= (const struct rsvp_obj_integrity_t
*)obj_tptr
;
1634 ND_PRINT((ndo
, "%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
1636 EXTRACT_16BITS(obj_ptr
.rsvp_obj_integrity
->key_id
),
1637 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->key_id
+2),
1638 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->sequence
),
1639 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->sequence
+4),
1640 bittok2str(rsvp_obj_integrity_flag_values
,
1642 obj_ptr
.rsvp_obj_integrity
->flags
)));
1643 ND_PRINT((ndo
, "%s MD5-sum 0x%08x%08x%08x%08x ",
1645 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
),
1646 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+4),
1647 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+8),
1648 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+ 12)));
1650 #ifdef HAVE_LIBCRYPTO
1651 sigcheck
= signature_verify(ndo
, pptr
, plen
, (unsigned char *)obj_ptr
.\
1652 rsvp_obj_integrity
->digest
);
1654 sigcheck
= CANT_CHECK_SIGNATURE
;
1656 ND_PRINT((ndo
, " (%s)", tok2str(signature_check_values
, "Unknown", sigcheck
)));
1658 obj_tlen
+=sizeof(struct rsvp_obj_integrity_t
);
1659 obj_tptr
+=sizeof(struct rsvp_obj_integrity_t
);
1666 case RSVP_OBJ_ADMIN_STATUS
:
1667 switch(rsvp_obj_ctype
) {
1671 ND_PRINT((ndo
, "%s Flags [%s]", ident
,
1672 bittok2str(rsvp_obj_admin_status_flag_values
, "none",
1673 EXTRACT_32BITS(obj_tptr
))));
1682 case RSVP_OBJ_LABEL_SET
:
1683 switch(rsvp_obj_ctype
) {
1687 action
= (EXTRACT_16BITS(obj_tptr
)>>8);
1689 ND_PRINT((ndo
, "%s Action: %s (%u), Label type: %u", ident
,
1690 tok2str(rsvp_obj_label_set_action_values
, "Unknown", action
),
1691 action
, ((EXTRACT_32BITS(obj_tptr
) & 0x7F))));
1694 case LABEL_SET_INCLUSIVE_RANGE
:
1695 case LABEL_SET_EXCLUSIVE_RANGE
: /* fall through */
1697 /* only a couple of subchannels are expected */
1700 ND_PRINT((ndo
, "%s Start range: %u, End range: %u", ident
,
1701 EXTRACT_32BITS(obj_tptr
+4),
1702 EXTRACT_32BITS(obj_tptr
+ 8)));
1711 while(obj_tlen
>= 4 ) {
1712 ND_PRINT((ndo
, "%s Subchannel #%u: %u", ident
, subchannel
,
1713 EXTRACT_32BITS(obj_tptr
)));
1726 switch (rsvp_obj_ctype
) {
1727 case RSVP_CTYPE_IPV4
:
1730 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1731 ident
, ipaddr_string(ndo
, obj_tptr
)));
1736 case RSVP_CTYPE_IPV6
:
1739 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1740 ident
, ip6addr_string(ndo
, obj_tptr
)));
1750 * FIXME those are the defined objects that lack a decoder
1751 * you are welcome to contribute code ;-)
1754 case RSVP_OBJ_SCOPE
:
1755 case RSVP_OBJ_POLICY_DATA
:
1756 case RSVP_OBJ_ACCEPT_LABEL_SET
:
1757 case RSVP_OBJ_PROTECTION
:
1759 if (ndo
->ndo_vflag
<= 1)
1760 print_unknown_data(ndo
, obj_tptr
, "\n\t ", obj_tlen
); /* FIXME indentation */
1763 /* do we also want to see a hex dump ? */
1764 if (ndo
->ndo_vflag
> 1 || hexdump
== TRUE
)
1765 print_unknown_data(ndo
, tptr
+ sizeof(struct rsvp_object_header
), "\n\t ", /* FIXME indentation */
1766 rsvp_obj_len
- sizeof(struct rsvp_object_header
));
1773 ND_PRINT((ndo
, "\n\t\t packet exceeded snapshot"));
1778 rsvp_print(netdissect_options
*ndo
,
1779 register const u_char
*pptr
, register u_int len
)
1781 struct rsvp_common_header
*rsvp_com_header
;
1782 const u_char
*tptr
,*subtptr
;
1783 u_short plen
, tlen
, subtlen
;
1787 rsvp_com_header
= (struct rsvp_common_header
*)pptr
;
1788 ND_TCHECK(*rsvp_com_header
);
1791 * Sanity checking of the header.
1793 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1794 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1795 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1799 /* in non-verbose mode just lets print the basic Message Type*/
1800 if (ndo
->ndo_vflag
< 1) {
1801 ND_PRINT((ndo
, "RSVPv%u %s Message, length: %u",
1802 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1803 tok2str(rsvp_msg_type_values
, "unknown (%u)",rsvp_com_header
->msg_type
),
1808 /* ok they seem to want to know everything - lets fully decode it */
1810 plen
= tlen
= EXTRACT_16BITS(rsvp_com_header
->length
);
1812 ND_PRINT((ndo
, "\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1813 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1814 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1815 rsvp_com_header
->msg_type
,
1816 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1818 rsvp_com_header
->ttl
,
1819 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1822 * Clear checksum prior to signature verification.
1824 rsvp_com_header
->checksum
[0] = 0;
1825 rsvp_com_header
->checksum
[1] = 0;
1827 if (tlen
< sizeof(const struct rsvp_common_header
)) {
1828 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", tlen
,
1829 (unsigned long)sizeof(const struct rsvp_common_header
)));
1833 tptr
+=sizeof(const struct rsvp_common_header
);
1834 tlen
-=sizeof(const struct rsvp_common_header
);
1836 switch(rsvp_com_header
->msg_type
) {
1838 case RSVP_MSGTYPE_AGGREGATE
:
1841 rsvp_com_header
= (struct rsvp_common_header
*)subtptr
;
1842 ND_TCHECK(*rsvp_com_header
);
1845 * Sanity checking of the header.
1847 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1848 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1849 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1852 subtlen
=EXTRACT_16BITS(rsvp_com_header
->length
);
1854 ND_PRINT((ndo
, "\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1855 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1856 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1857 rsvp_com_header
->msg_type
,
1858 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1860 rsvp_com_header
->ttl
,
1861 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1864 * Clear checksum prior to signature verification.
1866 rsvp_com_header
->checksum
[0] = 0;
1867 rsvp_com_header
->checksum
[1] = 0;
1869 if (subtlen
< sizeof(const struct rsvp_common_header
)) {
1870 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", subtlen
,
1871 (unsigned long)sizeof(const struct rsvp_common_header
)));
1875 if (tlen
< subtlen
) {
1876 ND_PRINT((ndo
, "ERROR: common header too large %u > %u", subtlen
,
1881 subtptr
+=sizeof(const struct rsvp_common_header
);
1882 subtlen
-=sizeof(const struct rsvp_common_header
);
1884 if (rsvp_obj_print(ndo
, pptr
, plen
, subtptr
, "\n\t ", subtlen
) == -1)
1887 tptr
+=subtlen
+sizeof(const struct rsvp_common_header
);
1888 tlen
-=subtlen
+sizeof(const struct rsvp_common_header
);
1893 case RSVP_MSGTYPE_PATH
:
1894 case RSVP_MSGTYPE_RESV
:
1895 case RSVP_MSGTYPE_PATHERR
:
1896 case RSVP_MSGTYPE_RESVERR
:
1897 case RSVP_MSGTYPE_PATHTEAR
:
1898 case RSVP_MSGTYPE_RESVTEAR
:
1899 case RSVP_MSGTYPE_RESVCONF
:
1900 case RSVP_MSGTYPE_HELLO_OLD
:
1901 case RSVP_MSGTYPE_HELLO
:
1902 case RSVP_MSGTYPE_ACK
:
1903 case RSVP_MSGTYPE_SREFRESH
:
1904 if (rsvp_obj_print(ndo
, pptr
, plen
, tptr
, "\n\t ", tlen
) == -1)
1909 print_unknown_data(ndo
, tptr
, "\n\t ", tlen
);
1915 ND_PRINT((ndo
, "\n\t\t packet exceeded snapshot"));