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 #define NETDISSECT_REWORKED
23 #include <tcpdump-stdinc.h>
25 #include "interface.h"
27 #include "addrtoname.h"
28 #include "ethertype.h"
31 #include "signature.h"
33 static const char istr
[] = " (invalid)";
36 * RFC 2205 common header
39 * +-------------+-------------+-------------+-------------+
40 * | Vers | Flags| Msg Type | RSVP Checksum |
41 * +-------------+-------------+-------------+-------------+
42 * | Send_TTL | (Reserved) | RSVP Length |
43 * +-------------+-------------+-------------+-------------+
47 struct rsvp_common_header
{
48 uint8_t version_flags
;
57 * RFC2205 object header
61 * +-------------+-------------+-------------+-------------+
62 * | Length (bytes) | Class-Num | C-Type |
63 * +-------------+-------------+-------------+-------------+
65 * // (Object contents) //
67 * +-------------+-------------+-------------+-------------+
70 struct rsvp_object_header
{
76 #define RSVP_VERSION 1
77 #define RSVP_EXTRACT_VERSION(x) (((x)&0xf0)>>4)
78 #define RSVP_EXTRACT_FLAGS(x) ((x)&0x0f)
80 #define RSVP_MSGTYPE_PATH 1
81 #define RSVP_MSGTYPE_RESV 2
82 #define RSVP_MSGTYPE_PATHERR 3
83 #define RSVP_MSGTYPE_RESVERR 4
84 #define RSVP_MSGTYPE_PATHTEAR 5
85 #define RSVP_MSGTYPE_RESVTEAR 6
86 #define RSVP_MSGTYPE_RESVCONF 7
87 #define RSVP_MSGTYPE_AGGREGATE 12
88 #define RSVP_MSGTYPE_ACK 13
89 #define RSVP_MSGTYPE_HELLO_OLD 14 /* ancient Hellos */
90 #define RSVP_MSGTYPE_SREFRESH 15
91 #define RSVP_MSGTYPE_HELLO 20
93 static const struct tok rsvp_msg_type_values
[] = {
94 { RSVP_MSGTYPE_PATH
, "Path" },
95 { RSVP_MSGTYPE_RESV
, "Resv" },
96 { RSVP_MSGTYPE_PATHERR
, "PathErr" },
97 { RSVP_MSGTYPE_RESVERR
, "ResvErr" },
98 { RSVP_MSGTYPE_PATHTEAR
, "PathTear" },
99 { RSVP_MSGTYPE_RESVTEAR
, "ResvTear" },
100 { RSVP_MSGTYPE_RESVCONF
, "ResvConf" },
101 { RSVP_MSGTYPE_AGGREGATE
, "Aggregate" },
102 { RSVP_MSGTYPE_ACK
, "Acknowledgement" },
103 { RSVP_MSGTYPE_HELLO_OLD
, "Hello (Old)" },
104 { RSVP_MSGTYPE_SREFRESH
, "Refresh" },
105 { RSVP_MSGTYPE_HELLO
, "Hello" },
109 static const struct tok rsvp_header_flag_values
[] = {
110 { 0x01, "Refresh reduction capable" }, /* rfc2961 */
114 #define RSVP_OBJ_SESSION 1 /* rfc2205 */
115 #define RSVP_OBJ_RSVP_HOP 3 /* rfc2205, rfc3473 */
116 #define RSVP_OBJ_INTEGRITY 4 /* rfc2747 */
117 #define RSVP_OBJ_TIME_VALUES 5 /* rfc2205 */
118 #define RSVP_OBJ_ERROR_SPEC 6
119 #define RSVP_OBJ_SCOPE 7
120 #define RSVP_OBJ_STYLE 8 /* rfc2205 */
121 #define RSVP_OBJ_FLOWSPEC 9 /* rfc2215 */
122 #define RSVP_OBJ_FILTERSPEC 10 /* rfc2215 */
123 #define RSVP_OBJ_SENDER_TEMPLATE 11
124 #define RSVP_OBJ_SENDER_TSPEC 12 /* rfc2215 */
125 #define RSVP_OBJ_ADSPEC 13 /* rfc2215 */
126 #define RSVP_OBJ_POLICY_DATA 14
127 #define RSVP_OBJ_CONFIRM 15 /* rfc2205 */
128 #define RSVP_OBJ_LABEL 16 /* rfc3209 */
129 #define RSVP_OBJ_LABEL_REQ 19 /* rfc3209 */
130 #define RSVP_OBJ_ERO 20 /* rfc3209 */
131 #define RSVP_OBJ_RRO 21 /* rfc3209 */
132 #define RSVP_OBJ_HELLO 22 /* rfc3209 */
133 #define RSVP_OBJ_MESSAGE_ID 23 /* rfc2961 */
134 #define RSVP_OBJ_MESSAGE_ID_ACK 24 /* rfc2961 */
135 #define RSVP_OBJ_MESSAGE_ID_LIST 25 /* rfc2961 */
136 #define RSVP_OBJ_RECOVERY_LABEL 34 /* rfc3473 */
137 #define RSVP_OBJ_UPSTREAM_LABEL 35 /* rfc3473 */
138 #define RSVP_OBJ_LABEL_SET 36 /* rfc3473 */
139 #define RSVP_OBJ_PROTECTION 37 /* rfc3473 */
140 #define RSVP_OBJ_S2L 50 /* rfc4875 */
141 #define RSVP_OBJ_DETOUR 63 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07 */
142 #define RSVP_OBJ_CLASSTYPE 66 /* rfc4124 */
143 #define RSVP_OBJ_CLASSTYPE_OLD 125 /* draft-ietf-tewg-diff-te-proto-07 */
144 #define RSVP_OBJ_SUGGESTED_LABEL 129 /* rfc3473 */
145 #define RSVP_OBJ_ACCEPT_LABEL_SET 130 /* rfc3473 */
146 #define RSVP_OBJ_RESTART_CAPABILITY 131 /* rfc3473 */
147 #define RSVP_OBJ_NOTIFY_REQ 195 /* rfc3473 */
148 #define RSVP_OBJ_ADMIN_STATUS 196 /* rfc3473 */
149 #define RSVP_OBJ_PROPERTIES 204 /* juniper proprietary */
150 #define RSVP_OBJ_FASTREROUTE 205 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07 */
151 #define RSVP_OBJ_SESSION_ATTRIBUTE 207 /* rfc3209 */
152 #define RSVP_OBJ_GENERALIZED_UNI 229 /* OIF RSVP extensions UNI 1.0 Signaling, Rel. 2 */
153 #define RSVP_OBJ_CALL_ID 230 /* rfc3474 */
154 #define RSVP_OBJ_CALL_OPS 236 /* rfc3474 */
156 static const struct tok rsvp_obj_values
[] = {
157 { RSVP_OBJ_SESSION
, "Session" },
158 { RSVP_OBJ_RSVP_HOP
, "RSVP Hop" },
159 { RSVP_OBJ_INTEGRITY
, "Integrity" },
160 { RSVP_OBJ_TIME_VALUES
, "Time Values" },
161 { RSVP_OBJ_ERROR_SPEC
, "Error Spec" },
162 { RSVP_OBJ_SCOPE
, "Scope" },
163 { RSVP_OBJ_STYLE
, "Style" },
164 { RSVP_OBJ_FLOWSPEC
, "Flowspec" },
165 { RSVP_OBJ_FILTERSPEC
, "FilterSpec" },
166 { RSVP_OBJ_SENDER_TEMPLATE
, "Sender Template" },
167 { RSVP_OBJ_SENDER_TSPEC
, "Sender TSpec" },
168 { RSVP_OBJ_ADSPEC
, "Adspec" },
169 { RSVP_OBJ_POLICY_DATA
, "Policy Data" },
170 { RSVP_OBJ_CONFIRM
, "Confirm" },
171 { RSVP_OBJ_LABEL
, "Label" },
172 { RSVP_OBJ_LABEL_REQ
, "Label Request" },
173 { RSVP_OBJ_ERO
, "ERO" },
174 { RSVP_OBJ_RRO
, "RRO" },
175 { RSVP_OBJ_HELLO
, "Hello" },
176 { RSVP_OBJ_MESSAGE_ID
, "Message ID" },
177 { RSVP_OBJ_MESSAGE_ID_ACK
, "Message ID Ack" },
178 { RSVP_OBJ_MESSAGE_ID_LIST
, "Message ID List" },
179 { RSVP_OBJ_RECOVERY_LABEL
, "Recovery Label" },
180 { RSVP_OBJ_UPSTREAM_LABEL
, "Upstream Label" },
181 { RSVP_OBJ_LABEL_SET
, "Label Set" },
182 { RSVP_OBJ_ACCEPT_LABEL_SET
, "Acceptable Label Set" },
183 { RSVP_OBJ_DETOUR
, "Detour" },
184 { RSVP_OBJ_CLASSTYPE
, "Class Type" },
185 { RSVP_OBJ_CLASSTYPE_OLD
, "Class Type (old)" },
186 { RSVP_OBJ_SUGGESTED_LABEL
, "Suggested Label" },
187 { RSVP_OBJ_PROPERTIES
, "Properties" },
188 { RSVP_OBJ_FASTREROUTE
, "Fast Re-Route" },
189 { RSVP_OBJ_SESSION_ATTRIBUTE
, "Session Attribute" },
190 { RSVP_OBJ_GENERALIZED_UNI
, "Generalized UNI" },
191 { RSVP_OBJ_CALL_ID
, "Call-ID" },
192 { RSVP_OBJ_CALL_OPS
, "Call Capability" },
193 { RSVP_OBJ_RESTART_CAPABILITY
, "Restart Capability" },
194 { RSVP_OBJ_NOTIFY_REQ
, "Notify Request" },
195 { RSVP_OBJ_PROTECTION
, "Protection" },
196 { RSVP_OBJ_ADMIN_STATUS
, "Administrative Status" },
197 { RSVP_OBJ_S2L
, "Sub-LSP to LSP" },
201 #define RSVP_CTYPE_IPV4 1
202 #define RSVP_CTYPE_IPV6 2
203 #define RSVP_CTYPE_TUNNEL_IPV4 7
204 #define RSVP_CTYPE_TUNNEL_IPV6 8
205 #define RSVP_CTYPE_UNI_IPV4 11 /* OIF RSVP extensions UNI 1.0 Signaling Rel. 2 */
206 #define RSVP_CTYPE_1 1
207 #define RSVP_CTYPE_2 2
208 #define RSVP_CTYPE_3 3
209 #define RSVP_CTYPE_4 4
210 #define RSVP_CTYPE_12 12
211 #define RSVP_CTYPE_13 13
212 #define RSVP_CTYPE_14 14
215 * the ctypes are not globally unique so for
216 * translating it to strings we build a table based
217 * on objects offsetted by the ctype
220 static const struct tok rsvp_ctype_values
[] = {
221 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV4
, "IPv4" },
222 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV6
, "IPv6" },
223 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
224 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
225 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV4
, "IPv4" },
226 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV6
, "IPv6" },
227 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV4
, "IPv4" },
228 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV6
, "IPv6" },
229 { 256*RSVP_OBJ_TIME_VALUES
+RSVP_CTYPE_1
, "1" },
230 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_1
, "obsolete" },
231 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_2
, "IntServ" },
232 { 256*RSVP_OBJ_SENDER_TSPEC
+RSVP_CTYPE_2
, "IntServ" },
233 { 256*RSVP_OBJ_ADSPEC
+RSVP_CTYPE_2
, "IntServ" },
234 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
235 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
236 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_3
, "IPv6 Flow-label" },
237 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
238 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
239 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
240 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV4
, "IPv4" },
241 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV6
, "IPv6" },
242 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
243 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_UNI_IPV4
, "UNI IPv4" },
244 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_13
, "IPv4 P2MP LSP Tunnel" },
245 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_14
, "IPv6 P2MP LSP Tunnel" },
246 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV4
, "IPv4" },
247 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV6
, "IPv6" },
248 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
249 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
250 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
251 { 256*RSVP_OBJ_MESSAGE_ID
+RSVP_CTYPE_1
, "1" },
252 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_1
, "Message id ack" },
253 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_2
, "Message id nack" },
254 { 256*RSVP_OBJ_MESSAGE_ID_LIST
+RSVP_CTYPE_1
, "1" },
255 { 256*RSVP_OBJ_STYLE
+RSVP_CTYPE_1
, "1" },
256 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_1
, "Hello Request" },
257 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_2
, "Hello Ack" },
258 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_1
, "without label range" },
259 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_2
, "with ATM label range" },
260 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_3
, "with FR label range" },
261 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_4
, "Generalized Label" },
262 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_1
, "Label" },
263 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
264 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
265 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_1
, "Label" },
266 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
267 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
268 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_1
, "Label" },
269 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
270 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
271 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_1
, "Label" },
272 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
273 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
274 { 256*RSVP_OBJ_ERO
+RSVP_CTYPE_IPV4
, "IPv4" },
275 { 256*RSVP_OBJ_RRO
+RSVP_CTYPE_IPV4
, "IPv4" },
276 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
277 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
278 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
279 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
280 { 256*RSVP_OBJ_RESTART_CAPABILITY
+RSVP_CTYPE_1
, "IPv4" },
281 { 256*RSVP_OBJ_SESSION_ATTRIBUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
282 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" }, /* old style*/
283 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_1
, "1" }, /* new style */
284 { 256*RSVP_OBJ_DETOUR
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
285 { 256*RSVP_OBJ_PROPERTIES
+RSVP_CTYPE_1
, "1" },
286 { 256*RSVP_OBJ_ADMIN_STATUS
+RSVP_CTYPE_1
, "1" },
287 { 256*RSVP_OBJ_CLASSTYPE
+RSVP_CTYPE_1
, "1" },
288 { 256*RSVP_OBJ_CLASSTYPE_OLD
+RSVP_CTYPE_1
, "1" },
289 { 256*RSVP_OBJ_LABEL_SET
+RSVP_CTYPE_1
, "1" },
290 { 256*RSVP_OBJ_GENERALIZED_UNI
+RSVP_CTYPE_1
, "1" },
291 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV4
, "IPv4 sub-LSP" },
292 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV6
, "IPv6 sub-LSP" },
296 struct rsvp_obj_integrity_t
{
304 static const struct tok rsvp_obj_integrity_flag_values
[] = {
305 { 0x80, "Handshake" },
309 struct rsvp_obj_frr_t
{
314 uint8_t bandwidth
[4];
315 uint8_t include_any
[4];
316 uint8_t exclude_any
[4];
317 uint8_t include_all
[4];
321 #define RSVP_OBJ_XRO_MASK_SUBOBJ(x) ((x)&0x7f)
322 #define RSVP_OBJ_XRO_MASK_LOOSE(x) ((x)&0x80)
324 #define RSVP_OBJ_XRO_RES 0
325 #define RSVP_OBJ_XRO_IPV4 1
326 #define RSVP_OBJ_XRO_IPV6 2
327 #define RSVP_OBJ_XRO_LABEL 3
328 #define RSVP_OBJ_XRO_ASN 32
329 #define RSVP_OBJ_XRO_MPLS 64
331 static const struct tok rsvp_obj_xro_values
[] = {
332 { RSVP_OBJ_XRO_RES
, "Reserved" },
333 { RSVP_OBJ_XRO_IPV4
, "IPv4 prefix" },
334 { RSVP_OBJ_XRO_IPV6
, "IPv6 prefix" },
335 { RSVP_OBJ_XRO_LABEL
, "Label" },
336 { RSVP_OBJ_XRO_ASN
, "Autonomous system number" },
337 { RSVP_OBJ_XRO_MPLS
, "MPLS label switched path termination" },
341 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07.txt */
342 static const struct tok rsvp_obj_rro_flag_values
[] = {
343 { 0x01, "Local protection available" },
344 { 0x02, "Local protection in use" },
345 { 0x04, "Bandwidth protection" },
346 { 0x08, "Node protection" },
351 static const struct tok rsvp_obj_rro_label_flag_values
[] = {
356 static const struct tok rsvp_resstyle_values
[] = {
357 { 17, "Wildcard Filter" },
358 { 10, "Fixed Filter" },
359 { 18, "Shared Explicit" },
363 #define RSVP_OBJ_INTSERV_GUARANTEED_SERV 2
364 #define RSVP_OBJ_INTSERV_CONTROLLED_LOAD 5
366 static const struct tok rsvp_intserv_service_type_values
[] = {
367 { 1, "Default/Global Information" },
368 { RSVP_OBJ_INTSERV_GUARANTEED_SERV
, "Guaranteed Service" },
369 { RSVP_OBJ_INTSERV_CONTROLLED_LOAD
, "Controlled Load" },
373 static const struct tok rsvp_intserv_parameter_id_values
[] = {
375 { 6, "Path b/w estimate" },
376 { 8, "Minimum path latency" },
377 { 10, "Composed MTU" },
378 { 127, "Token Bucket TSpec" },
379 { 130, "Guaranteed Service RSpec" },
380 { 133, "End-to-end composed value for C" },
381 { 134, "End-to-end composed value for D" },
382 { 135, "Since-last-reshaping point composed C" },
383 { 136, "Since-last-reshaping point composed D" },
387 static const struct tok rsvp_session_attribute_flag_values
[] = {
388 { 0x01, "Local Protection" },
389 { 0x02, "Label Recording" },
390 { 0x04, "SE Style" },
391 { 0x08, "Bandwidth protection" }, /* RFC4090 */
392 { 0x10, "Node protection" }, /* RFC4090 */
396 static const struct tok rsvp_obj_prop_tlv_values
[] = {
398 { 0x02, "Metric 1" },
399 { 0x04, "Metric 2" },
400 { 0x08, "CCC Status" },
401 { 0x10, "Path Type" },
405 #define RSVP_OBJ_ERROR_SPEC_CODE_ROUTING 24
406 #define RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY 25
407 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE 28
408 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD 125
410 static const struct tok rsvp_obj_error_code_values
[] = {
411 { RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
, "Routing Problem" },
412 { RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY
, "Notify Error" },
413 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
, "Diffserv TE Error" },
414 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
, "Diffserv TE Error (Old)" },
418 static const struct tok rsvp_obj_error_code_routing_values
[] = {
419 { 1, "Bad EXPLICIT_ROUTE object" },
420 { 2, "Bad strict node" },
421 { 3, "Bad loose node" },
422 { 4, "Bad initial subobject" },
423 { 5, "No route available toward destination" },
424 { 6, "Unacceptable label value" },
425 { 7, "RRO indicated routing loops" },
426 { 8, "non-RSVP-capable router in the path" },
427 { 9, "MPLS label allocation failure" },
428 { 10, "Unsupported L3PID" },
432 static const struct tok rsvp_obj_error_code_diffserv_te_values
[] = {
433 { 1, "Unexpected CT object" },
434 { 2, "Unsupported CT" },
435 { 3, "Invalid CT value" },
436 { 4, "CT/setup priority do not form a configured TE-Class" },
437 { 5, "CT/holding priority do not form a configured TE-Class" },
438 { 6, "CT/setup priority and CT/holding priority do not form a configured TE-Class" },
439 { 7, "Inconsistency between signaled PSC and signaled CT" },
440 { 8, "Inconsistency between signaled PHBs and signaled CT" },
444 /* rfc3473 / rfc 3471 */
445 static const struct tok rsvp_obj_admin_status_flag_values
[] = {
446 { 0x80000000, "Reflect" },
447 { 0x00000004, "Testing" },
448 { 0x00000002, "Admin-down" },
449 { 0x00000001, "Delete-in-progress" },
453 /* label set actions - rfc3471 */
454 #define LABEL_SET_INCLUSIVE_LIST 0
455 #define LABEL_SET_EXCLUSIVE_LIST 1
456 #define LABEL_SET_INCLUSIVE_RANGE 2
457 #define LABEL_SET_EXCLUSIVE_RANGE 3
459 static const struct tok rsvp_obj_label_set_action_values
[] = {
460 { LABEL_SET_INCLUSIVE_LIST
, "Inclusive list" },
461 { LABEL_SET_EXCLUSIVE_LIST
, "Exclusive list" },
462 { LABEL_SET_INCLUSIVE_RANGE
, "Inclusive range" },
463 { LABEL_SET_EXCLUSIVE_RANGE
, "Exclusive range" },
467 /* OIF RSVP extensions UNI 1.0 Signaling, release 2 */
468 #define RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS 1
469 #define RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS 2
470 #define RSVP_GEN_UNI_SUBOBJ_DIVERSITY 3
471 #define RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL 4
472 #define RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL 5
474 static const struct tok rsvp_obj_generalized_uni_values
[] = {
475 { RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
, "Source TNA address" },
476 { RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
, "Destination TNA address" },
477 { RSVP_GEN_UNI_SUBOBJ_DIVERSITY
, "Diversity" },
478 { RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
, "Egress label" },
479 { RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
, "Service level" },
484 * this is a dissector for all the intserv defined
485 * specs as defined per rfc2215
486 * it is called from various rsvp objects;
487 * returns the amount of bytes being processed
490 rsvp_intserv_print(netdissect_options
*ndo
,
491 const u_char
*tptr
, u_short obj_tlen
)
493 int parameter_id
,parameter_length
;
501 parameter_id
= *(tptr
);
502 parameter_length
= EXTRACT_16BITS(tptr
+2)<<2; /* convert wordcount to bytecount */
504 ND_PRINT((ndo
, "\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
505 tok2str(rsvp_intserv_parameter_id_values
,"unknown",parameter_id
),
510 if (obj_tlen
< parameter_length
+4)
512 switch(parameter_id
) { /* parameter_id */
516 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
517 * | 4 (e) | (f) | 1 (g) |
518 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
519 * | IS hop cnt (32-bit unsigned integer) |
520 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
522 if (parameter_length
== 4)
523 ND_PRINT((ndo
, "\n\t\tIS hop count: %u", EXTRACT_32BITS(tptr
+ 4)));
528 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
529 * | 6 (h) | (i) | 1 (j) |
530 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
531 * | Path b/w estimate (32-bit IEEE floating point number) |
532 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
534 if (parameter_length
== 4) {
535 bw
.i
= EXTRACT_32BITS(tptr
+4);
536 ND_PRINT((ndo
, "\n\t\tPath b/w estimate: %.10g Mbps", bw
.f
/ 125000));
542 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
543 * | 8 (k) | (l) | 1 (m) |
544 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
545 * | Minimum path latency (32-bit integer) |
546 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
548 if (parameter_length
== 4) {
549 ND_PRINT((ndo
, "\n\t\tMinimum path latency: "));
550 if (EXTRACT_32BITS(tptr
+4) == 0xffffffff)
551 ND_PRINT((ndo
, "don't care"));
553 ND_PRINT((ndo
, "%u", EXTRACT_32BITS(tptr
+ 4)));
560 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
561 * | 10 (n) | (o) | 1 (p) |
562 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
563 * | Composed MTU (32-bit unsigned integer) |
564 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
566 if (parameter_length
== 4)
567 ND_PRINT((ndo
, "\n\t\tComposed MTU: %u bytes", EXTRACT_32BITS(tptr
+ 4)));
571 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
572 * | 127 (e) | 0 (f) | 5 (g) |
573 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
574 * | Token Bucket Rate [r] (32-bit IEEE floating point number) |
575 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
576 * | Token Bucket Size [b] (32-bit IEEE floating point number) |
577 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
578 * | Peak Data Rate [p] (32-bit IEEE floating point number) |
579 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
580 * | Minimum Policed Unit [m] (32-bit integer) |
581 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
582 * | Maximum Packet Size [M] (32-bit integer) |
583 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
586 if (parameter_length
== 20) {
587 bw
.i
= EXTRACT_32BITS(tptr
+4);
588 ND_PRINT((ndo
, "\n\t\tToken Bucket Rate: %.10g Mbps", bw
.f
/ 125000));
589 bw
.i
= EXTRACT_32BITS(tptr
+8);
590 ND_PRINT((ndo
, "\n\t\tToken Bucket Size: %.10g bytes", bw
.f
));
591 bw
.i
= EXTRACT_32BITS(tptr
+12);
592 ND_PRINT((ndo
, "\n\t\tPeak Data Rate: %.10g Mbps", bw
.f
/ 125000));
593 ND_PRINT((ndo
, "\n\t\tMinimum Policed Unit: %u bytes", EXTRACT_32BITS(tptr
+ 16)));
594 ND_PRINT((ndo
, "\n\t\tMaximum Packet Size: %u bytes", EXTRACT_32BITS(tptr
+ 20)));
600 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
601 * | 130 (h) | 0 (i) | 2 (j) |
602 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
603 * | Rate [R] (32-bit IEEE floating point number) |
604 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
605 * | Slack Term [S] (32-bit integer) |
606 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
609 if (parameter_length
== 8) {
610 bw
.i
= EXTRACT_32BITS(tptr
+4);
611 ND_PRINT((ndo
, "\n\t\tRate: %.10g Mbps", bw
.f
/ 125000));
612 ND_PRINT((ndo
, "\n\t\tSlack Term: %u", EXTRACT_32BITS(tptr
+ 8)));
620 if (parameter_length
== 4)
621 ND_PRINT((ndo
, "\n\t\tValue: %u", EXTRACT_32BITS(tptr
+ 4)));
625 if (ndo
->ndo_vflag
<= 1)
626 print_unknown_data(ndo
, tptr
+ 4, "\n\t\t", parameter_length
);
628 return (parameter_length
+4); /* header length 4 bytes */
632 rsvp_obj_print(netdissect_options
*ndo
,
634 #ifndef HAVE_LIBCRYPTO
638 #ifndef HAVE_LIBCRYPTO
641 , const u_char
*tptr
,
642 const char *ident
, u_int tlen
)
644 const struct rsvp_object_header
*rsvp_obj_header
;
645 const u_char
*obj_tptr
;
647 const struct rsvp_obj_integrity_t
*rsvp_obj_integrity
;
648 const struct rsvp_obj_frr_t
*rsvp_obj_frr
;
651 u_short rsvp_obj_len
,rsvp_obj_ctype
,obj_tlen
,intserv_serv_tlen
;
652 int hexdump
,processed
,padbytes
,error_code
,error_value
,i
,sigcheck
;
659 u_int action
, subchannel
;
661 while(tlen
>=sizeof(struct rsvp_object_header
)) {
662 /* did we capture enough for fully decoding the object header ? */
663 ND_TCHECK2(*tptr
, sizeof(struct rsvp_object_header
));
665 rsvp_obj_header
= (const struct rsvp_object_header
*)tptr
;
666 rsvp_obj_len
=EXTRACT_16BITS(rsvp_obj_header
->length
);
667 rsvp_obj_ctype
=rsvp_obj_header
->ctype
;
669 if(rsvp_obj_len
% 4) {
670 ND_PRINT((ndo
, "%sERROR: object header size %u not a multiple of 4", ident
, rsvp_obj_len
));
673 if(rsvp_obj_len
< sizeof(struct rsvp_object_header
)) {
674 ND_PRINT((ndo
, "%sERROR: object header too short %u < %lu", ident
, rsvp_obj_len
,
675 (unsigned long)sizeof(const struct rsvp_object_header
)));
679 ND_PRINT((ndo
, "%s%s Object (%u) Flags: [%s",
681 tok2str(rsvp_obj_values
,
683 rsvp_obj_header
->class_num
),
684 rsvp_obj_header
->class_num
,
685 ((rsvp_obj_header
->class_num
) & 0x80) ? "ignore" : "reject"));
687 if (rsvp_obj_header
->class_num
> 128)
688 ND_PRINT((ndo
, " %s",
689 ((rsvp_obj_header
->class_num
) & 0x40) ? "and forward" : "silently"));
691 ND_PRINT((ndo
, " if unknown], Class-Type: %s (%u), length: %u",
692 tok2str(rsvp_ctype_values
,
694 ((rsvp_obj_header
->class_num
)<<8)+rsvp_obj_ctype
),
698 if(tlen
< rsvp_obj_len
) {
699 ND_PRINT((ndo
, "%sERROR: object goes past end of objects TLV", ident
));
703 obj_tptr
=tptr
+sizeof(struct rsvp_object_header
);
704 obj_tlen
=rsvp_obj_len
-sizeof(struct rsvp_object_header
);
706 /* did we capture enough for fully decoding the object ? */
707 if (!ND_TTEST2(*tptr
, rsvp_obj_len
))
711 switch(rsvp_obj_header
->class_num
) {
712 case RSVP_OBJ_SESSION
:
713 switch(rsvp_obj_ctype
) {
714 case RSVP_CTYPE_IPV4
:
717 ND_PRINT((ndo
, "%s IPv4 DestAddress: %s, Protocol ID: 0x%02x",
719 ipaddr_string(ndo
, obj_tptr
),
720 *(obj_tptr
+ sizeof(struct in_addr
))));
721 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
724 EXTRACT_16BITS(obj_tptr
+ 6)));
729 case RSVP_CTYPE_IPV6
:
732 ND_PRINT((ndo
, "%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
734 ip6addr_string(ndo
, obj_tptr
),
735 *(obj_tptr
+ sizeof(struct in6_addr
))));
736 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
738 *(obj_tptr
+sizeof(struct in6_addr
)+1),
739 EXTRACT_16BITS(obj_tptr
+ sizeof(struct in6_addr
) + 2)));
744 case RSVP_CTYPE_TUNNEL_IPV6
:
747 ND_PRINT((ndo
, "%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
749 ip6addr_string(ndo
, obj_tptr
),
750 EXTRACT_16BITS(obj_tptr
+18),
751 ip6addr_string(ndo
, obj_tptr
+ 20)));
756 case RSVP_CTYPE_14
: /* IPv6 p2mp LSP Tunnel */
759 ND_PRINT((ndo
, "%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
761 EXTRACT_32BITS(obj_tptr
),
762 EXTRACT_16BITS(obj_tptr
+6),
763 ip6addr_string(ndo
, obj_tptr
+ 8)));
768 case RSVP_CTYPE_13
: /* IPv4 p2mp LSP Tunnel */
771 ND_PRINT((ndo
, "%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
773 ipaddr_string(ndo
, obj_tptr
),
774 EXTRACT_16BITS(obj_tptr
+6),
775 ipaddr_string(ndo
, obj_tptr
+ 8)));
779 case RSVP_CTYPE_TUNNEL_IPV4
:
780 case RSVP_CTYPE_UNI_IPV4
:
783 ND_PRINT((ndo
, "%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
785 ipaddr_string(ndo
, obj_tptr
),
786 EXTRACT_16BITS(obj_tptr
+6),
787 ipaddr_string(ndo
, obj_tptr
+ 8)));
796 case RSVP_OBJ_CONFIRM
:
797 switch(rsvp_obj_ctype
) {
798 case RSVP_CTYPE_IPV4
:
799 if (obj_tlen
< sizeof(struct in_addr
))
801 ND_PRINT((ndo
, "%s IPv4 Receiver Address: %s",
803 ipaddr_string(ndo
, obj_tptr
)));
804 obj_tlen
-=sizeof(struct in_addr
);
805 obj_tptr
+=sizeof(struct in_addr
);
808 case RSVP_CTYPE_IPV6
:
809 if (obj_tlen
< sizeof(struct in6_addr
))
811 ND_PRINT((ndo
, "%s IPv6 Receiver Address: %s",
813 ip6addr_string(ndo
, obj_tptr
)));
814 obj_tlen
-=sizeof(struct in6_addr
);
815 obj_tptr
+=sizeof(struct in6_addr
);
823 case RSVP_OBJ_NOTIFY_REQ
:
824 switch(rsvp_obj_ctype
) {
825 case RSVP_CTYPE_IPV4
:
826 if (obj_tlen
< sizeof(struct in_addr
))
828 ND_PRINT((ndo
, "%s IPv4 Notify Node Address: %s",
830 ipaddr_string(ndo
, obj_tptr
)));
831 obj_tlen
-=sizeof(struct in_addr
);
832 obj_tptr
+=sizeof(struct in_addr
);
835 case RSVP_CTYPE_IPV6
:
836 if (obj_tlen
< sizeof(struct in6_addr
))
838 ND_PRINT((ndo
, "%s IPv6 Notify Node Address: %s",
840 ip6addr_string(ndo
, obj_tptr
)));
841 obj_tlen
-=sizeof(struct in6_addr
);
842 obj_tptr
+=sizeof(struct in6_addr
);
850 case RSVP_OBJ_SUGGESTED_LABEL
: /* fall through */
851 case RSVP_OBJ_UPSTREAM_LABEL
: /* fall through */
852 case RSVP_OBJ_RECOVERY_LABEL
: /* fall through */
854 switch(rsvp_obj_ctype
) {
856 while(obj_tlen
>= 4 ) {
857 ND_PRINT((ndo
, "%s Label: %u", ident
, EXTRACT_32BITS(obj_tptr
)));
865 ND_PRINT((ndo
, "%s Generalized Label: %u",
867 EXTRACT_32BITS(obj_tptr
)));
874 ND_PRINT((ndo
, "%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
876 EXTRACT_32BITS(obj_tptr
),
878 EXTRACT_32BITS(obj_tptr
+4),
879 EXTRACT_32BITS(obj_tptr
+ 8)));
889 switch(rsvp_obj_ctype
) {
893 ND_PRINT((ndo
, "%s Reservation Style: %s, Flags: [0x%02x]",
895 tok2str(rsvp_resstyle_values
,
897 EXTRACT_24BITS(obj_tptr
+1)),
907 case RSVP_OBJ_SENDER_TEMPLATE
:
908 switch(rsvp_obj_ctype
) {
909 case RSVP_CTYPE_IPV4
:
912 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
914 ipaddr_string(ndo
, obj_tptr
),
915 EXTRACT_16BITS(obj_tptr
+ 6)));
920 case RSVP_CTYPE_IPV6
:
923 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
925 ip6addr_string(ndo
, obj_tptr
),
926 EXTRACT_16BITS(obj_tptr
+ 18)));
930 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
933 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
934 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
936 ip6addr_string(ndo
, obj_tptr
),
937 EXTRACT_16BITS(obj_tptr
+18),
939 ip6addr_string(ndo
, obj_tptr
+20),
940 EXTRACT_16BITS(obj_tptr
+ 38)));
945 case RSVP_CTYPE_TUNNEL_IPV4
:
948 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
950 ipaddr_string(ndo
, obj_tptr
),
951 EXTRACT_16BITS(obj_tptr
+ 6)));
955 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
958 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
959 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
961 ipaddr_string(ndo
, obj_tptr
),
962 EXTRACT_16BITS(obj_tptr
+6),
964 ipaddr_string(ndo
, obj_tptr
+8),
965 EXTRACT_16BITS(obj_tptr
+ 12)));
974 case RSVP_OBJ_LABEL_REQ
:
975 switch(rsvp_obj_ctype
) {
977 while(obj_tlen
>= 4 ) {
978 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
980 tok2str(ethertype_values
,
981 "Unknown Protocol (0x%04x)",
982 EXTRACT_16BITS(obj_tptr
+ 2))));
990 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
992 tok2str(ethertype_values
,
993 "Unknown Protocol (0x%04x)",
994 EXTRACT_16BITS(obj_tptr
+ 2))));
995 ND_PRINT((ndo
, ",%s merge capability",((*(obj_tptr
+ 4)) & 0x80) ? "no" : "" ));
996 ND_PRINT((ndo
, "%s Minimum VPI/VCI: %u/%u",
998 (EXTRACT_16BITS(obj_tptr
+4))&0xfff,
999 (EXTRACT_16BITS(obj_tptr
+ 6)) & 0xfff));
1000 ND_PRINT((ndo
, "%s Maximum VPI/VCI: %u/%u",
1002 (EXTRACT_16BITS(obj_tptr
+8))&0xfff,
1003 (EXTRACT_16BITS(obj_tptr
+ 10)) & 0xfff));
1010 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
1012 tok2str(ethertype_values
,
1013 "Unknown Protocol (0x%04x)",
1014 EXTRACT_16BITS(obj_tptr
+ 2))));
1015 ND_PRINT((ndo
, "%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1017 (EXTRACT_32BITS(obj_tptr
+4))&0x7fffff,
1018 (EXTRACT_32BITS(obj_tptr
+8))&0x7fffff,
1019 (((EXTRACT_16BITS(obj_tptr
+4)>>7)&3) == 0 ) ? "10" : "",
1020 (((EXTRACT_16BITS(obj_tptr
+ 4) >> 7) & 3) == 2 ) ? "23" : ""));
1027 ND_PRINT((ndo
, "%s LSP Encoding Type: %s (%u)",
1029 tok2str(gmpls_encoding_values
,
1033 ND_PRINT((ndo
, "%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1035 tok2str(gmpls_switch_cap_values
,
1039 tok2str(gmpls_payload_values
,
1041 EXTRACT_16BITS(obj_tptr
+2)),
1042 EXTRACT_16BITS(obj_tptr
+ 2)));
1053 switch(rsvp_obj_ctype
) {
1054 case RSVP_CTYPE_IPV4
:
1055 while(obj_tlen
>= 4 ) {
1056 ND_PRINT((ndo
, "%s Subobject Type: %s, length %u",
1058 tok2str(rsvp_obj_xro_values
,
1060 RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)),
1063 if (*(obj_tptr
+1) == 0) { /* prevent infinite loops */
1064 ND_PRINT((ndo
, "%s ERROR: zero length ERO subtype", ident
));
1068 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)) {
1069 case RSVP_OBJ_XRO_IPV4
:
1070 ND_PRINT((ndo
, ", %s, %s/%u, Flags: [%s]",
1071 RSVP_OBJ_XRO_MASK_LOOSE(*obj_tptr
) ? "Loose" : "Strict",
1072 ipaddr_string(ndo
, obj_tptr
+2),
1074 bittok2str(rsvp_obj_rro_flag_values
,
1076 *(obj_tptr
+ 7)))); /* rfc3209 says that this field is rsvd. */
1078 case RSVP_OBJ_XRO_LABEL
:
1079 ND_PRINT((ndo
, ", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1080 bittok2str(rsvp_obj_rro_label_flag_values
,
1084 tok2str(rsvp_ctype_values
,
1086 *(obj_tptr
+3) + 256*RSVP_OBJ_RRO
),
1088 EXTRACT_32BITS(obj_tptr
+ 4)));
1090 obj_tlen
-=*(obj_tptr
+1);
1091 obj_tptr
+=*(obj_tptr
+1);
1099 case RSVP_OBJ_HELLO
:
1100 switch(rsvp_obj_ctype
) {
1105 ND_PRINT((ndo
, "%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1107 EXTRACT_32BITS(obj_tptr
),
1108 EXTRACT_32BITS(obj_tptr
+ 4)));
1117 case RSVP_OBJ_RESTART_CAPABILITY
:
1118 switch(rsvp_obj_ctype
) {
1122 ND_PRINT((ndo
, "%s Restart Time: %ums, Recovery Time: %ums",
1124 EXTRACT_32BITS(obj_tptr
),
1125 EXTRACT_32BITS(obj_tptr
+ 4)));
1134 case RSVP_OBJ_SESSION_ATTRIBUTE
:
1135 switch(rsvp_obj_ctype
) {
1136 case RSVP_CTYPE_TUNNEL_IPV4
:
1139 namelen
= *(obj_tptr
+3);
1140 if (obj_tlen
< 4+namelen
)
1142 ND_PRINT((ndo
, "%s Session Name: ", ident
));
1143 for (i
= 0; i
< namelen
; i
++)
1144 safeputchar(ndo
, *(obj_tptr
+ 4 + i
));
1145 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1149 bittok2str(rsvp_session_attribute_flag_values
,
1153 obj_tlen
-=4+*(obj_tptr
+3);
1154 obj_tptr
+=4+*(obj_tptr
+3);
1161 case RSVP_OBJ_GENERALIZED_UNI
:
1162 switch(rsvp_obj_ctype
) {
1163 int subobj_type
,af
,subobj_len
,total_subobj_len
;
1170 /* read variable length subobjects */
1171 total_subobj_len
= obj_tlen
;
1172 while(total_subobj_len
> 0) {
1173 subobj_len
= EXTRACT_16BITS(obj_tptr
);
1174 subobj_type
= (EXTRACT_16BITS(obj_tptr
+2))>>8;
1175 af
= (EXTRACT_16BITS(obj_tptr
+2))&0x00FF;
1177 ND_PRINT((ndo
, "%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1179 tok2str(rsvp_obj_generalized_uni_values
, "Unknown", subobj_type
),
1181 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
, "%s", istr
));
1800 ND_PRINT((ndo
, "\n\t\t packet exceeded snapshot"));
1805 rsvp_print(netdissect_options
*ndo
,
1806 register const u_char
*pptr
, register u_int len
)
1808 struct rsvp_common_header
*rsvp_com_header
;
1809 const u_char
*tptr
,*subtptr
;
1810 u_short plen
, tlen
, subtlen
;
1814 rsvp_com_header
= (struct rsvp_common_header
*)pptr
;
1815 ND_TCHECK(*rsvp_com_header
);
1818 * Sanity checking of the header.
1820 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1821 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1822 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1826 /* in non-verbose mode just lets print the basic Message Type*/
1827 if (ndo
->ndo_vflag
< 1) {
1828 ND_PRINT((ndo
, "RSVPv%u %s Message, length: %u",
1829 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1830 tok2str(rsvp_msg_type_values
, "unknown (%u)",rsvp_com_header
->msg_type
),
1835 /* ok they seem to want to know everything - lets fully decode it */
1837 plen
= tlen
= EXTRACT_16BITS(rsvp_com_header
->length
);
1839 ND_PRINT((ndo
, "\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1840 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1841 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1842 rsvp_com_header
->msg_type
,
1843 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1845 rsvp_com_header
->ttl
,
1846 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1849 * Clear checksum prior to signature verification.
1851 rsvp_com_header
->checksum
[0] = 0;
1852 rsvp_com_header
->checksum
[1] = 0;
1854 if (tlen
< sizeof(const struct rsvp_common_header
)) {
1855 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", tlen
,
1856 (unsigned long)sizeof(const struct rsvp_common_header
)));
1860 tptr
+=sizeof(const struct rsvp_common_header
);
1861 tlen
-=sizeof(const struct rsvp_common_header
);
1863 switch(rsvp_com_header
->msg_type
) {
1865 case RSVP_MSGTYPE_AGGREGATE
:
1868 rsvp_com_header
= (struct rsvp_common_header
*)subtptr
;
1869 ND_TCHECK(*rsvp_com_header
);
1872 * Sanity checking of the header.
1874 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1875 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1876 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1879 subtlen
=EXTRACT_16BITS(rsvp_com_header
->length
);
1881 ND_PRINT((ndo
, "\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1882 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1883 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1884 rsvp_com_header
->msg_type
,
1885 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1887 rsvp_com_header
->ttl
,
1888 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1891 * Clear checksum prior to signature verification.
1893 rsvp_com_header
->checksum
[0] = 0;
1894 rsvp_com_header
->checksum
[1] = 0;
1896 if (subtlen
< sizeof(const struct rsvp_common_header
)) {
1897 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", subtlen
,
1898 (unsigned long)sizeof(const struct rsvp_common_header
)));
1902 if (tlen
< subtlen
) {
1903 ND_PRINT((ndo
, "ERROR: common header too large %u > %u", subtlen
,
1908 subtptr
+=sizeof(const struct rsvp_common_header
);
1909 subtlen
-=sizeof(const struct rsvp_common_header
);
1911 if (rsvp_obj_print(ndo
, pptr
, plen
, subtptr
, "\n\t ", subtlen
) == -1)
1914 tptr
+=subtlen
+sizeof(const struct rsvp_common_header
);
1915 tlen
-=subtlen
+sizeof(const struct rsvp_common_header
);
1920 case RSVP_MSGTYPE_PATH
:
1921 case RSVP_MSGTYPE_RESV
:
1922 case RSVP_MSGTYPE_PATHERR
:
1923 case RSVP_MSGTYPE_RESVERR
:
1924 case RSVP_MSGTYPE_PATHTEAR
:
1925 case RSVP_MSGTYPE_RESVTEAR
:
1926 case RSVP_MSGTYPE_RESVCONF
:
1927 case RSVP_MSGTYPE_HELLO_OLD
:
1928 case RSVP_MSGTYPE_HELLO
:
1929 case RSVP_MSGTYPE_ACK
:
1930 case RSVP_MSGTYPE_SREFRESH
:
1931 if (rsvp_obj_print(ndo
, pptr
, plen
, tptr
, "\n\t ", tlen
) == -1)
1936 print_unknown_data(ndo
, tptr
, "\n\t ", tlen
);
1942 ND_PRINT((ndo
, "\n\t\t packet exceeded snapshot"));