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"
34 * RFC 2205 common header
37 * +-------------+-------------+-------------+-------------+
38 * | Vers | Flags| Msg Type | RSVP Checksum |
39 * +-------------+-------------+-------------+-------------+
40 * | Send_TTL | (Reserved) | RSVP Length |
41 * +-------------+-------------+-------------+-------------+
45 struct rsvp_common_header
{
46 u_int8_t version_flags
;
55 * RFC2205 object header
59 * +-------------+-------------+-------------+-------------+
60 * | Length (bytes) | Class-Num | C-Type |
61 * +-------------+-------------+-------------+-------------+
63 * // (Object contents) //
65 * +-------------+-------------+-------------+-------------+
68 struct rsvp_object_header
{
74 #define RSVP_VERSION 1
75 #define RSVP_EXTRACT_VERSION(x) (((x)&0xf0)>>4)
76 #define RSVP_EXTRACT_FLAGS(x) ((x)&0x0f)
78 #define RSVP_MSGTYPE_PATH 1
79 #define RSVP_MSGTYPE_RESV 2
80 #define RSVP_MSGTYPE_PATHERR 3
81 #define RSVP_MSGTYPE_RESVERR 4
82 #define RSVP_MSGTYPE_PATHTEAR 5
83 #define RSVP_MSGTYPE_RESVTEAR 6
84 #define RSVP_MSGTYPE_RESVCONF 7
85 #define RSVP_MSGTYPE_AGGREGATE 12
86 #define RSVP_MSGTYPE_ACK 13
87 #define RSVP_MSGTYPE_HELLO_OLD 14 /* ancient Hellos */
88 #define RSVP_MSGTYPE_SREFRESH 15
89 #define RSVP_MSGTYPE_HELLO 20
91 static const struct tok rsvp_msg_type_values
[] = {
92 { RSVP_MSGTYPE_PATH
, "Path" },
93 { RSVP_MSGTYPE_RESV
, "Resv" },
94 { RSVP_MSGTYPE_PATHERR
, "PathErr" },
95 { RSVP_MSGTYPE_RESVERR
, "ResvErr" },
96 { RSVP_MSGTYPE_PATHTEAR
, "PathTear" },
97 { RSVP_MSGTYPE_RESVTEAR
, "ResvTear" },
98 { RSVP_MSGTYPE_RESVCONF
, "ResvConf" },
99 { RSVP_MSGTYPE_AGGREGATE
, "Aggregate" },
100 { RSVP_MSGTYPE_ACK
, "Acknowledgement" },
101 { RSVP_MSGTYPE_HELLO_OLD
, "Hello (Old)" },
102 { RSVP_MSGTYPE_SREFRESH
, "Refresh" },
103 { RSVP_MSGTYPE_HELLO
, "Hello" },
107 static const struct tok rsvp_header_flag_values
[] = {
108 { 0x01, "Refresh reduction capable" }, /* rfc2961 */
112 #define RSVP_OBJ_SESSION 1 /* rfc2205 */
113 #define RSVP_OBJ_RSVP_HOP 3 /* rfc2205, rfc3473 */
114 #define RSVP_OBJ_INTEGRITY 4 /* rfc2747 */
115 #define RSVP_OBJ_TIME_VALUES 5 /* rfc2205 */
116 #define RSVP_OBJ_ERROR_SPEC 6
117 #define RSVP_OBJ_SCOPE 7
118 #define RSVP_OBJ_STYLE 8 /* rfc2205 */
119 #define RSVP_OBJ_FLOWSPEC 9 /* rfc2215 */
120 #define RSVP_OBJ_FILTERSPEC 10 /* rfc2215 */
121 #define RSVP_OBJ_SENDER_TEMPLATE 11
122 #define RSVP_OBJ_SENDER_TSPEC 12 /* rfc2215 */
123 #define RSVP_OBJ_ADSPEC 13 /* rfc2215 */
124 #define RSVP_OBJ_POLICY_DATA 14
125 #define RSVP_OBJ_CONFIRM 15 /* rfc2205 */
126 #define RSVP_OBJ_LABEL 16 /* rfc3209 */
127 #define RSVP_OBJ_LABEL_REQ 19 /* rfc3209 */
128 #define RSVP_OBJ_ERO 20 /* rfc3209 */
129 #define RSVP_OBJ_RRO 21 /* rfc3209 */
130 #define RSVP_OBJ_HELLO 22 /* rfc3209 */
131 #define RSVP_OBJ_MESSAGE_ID 23 /* rfc2961 */
132 #define RSVP_OBJ_MESSAGE_ID_ACK 24 /* rfc2961 */
133 #define RSVP_OBJ_MESSAGE_ID_LIST 25 /* rfc2961 */
134 #define RSVP_OBJ_RECOVERY_LABEL 34 /* rfc3473 */
135 #define RSVP_OBJ_UPSTREAM_LABEL 35 /* rfc3473 */
136 #define RSVP_OBJ_LABEL_SET 36 /* rfc3473 */
137 #define RSVP_OBJ_PROTECTION 37 /* rfc3473 */
138 #define RSVP_OBJ_S2L 50 /* rfc4875 */
139 #define RSVP_OBJ_DETOUR 63 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07 */
140 #define RSVP_OBJ_CLASSTYPE 66 /* rfc4124 */
141 #define RSVP_OBJ_CLASSTYPE_OLD 125 /* draft-ietf-tewg-diff-te-proto-07 */
142 #define RSVP_OBJ_SUGGESTED_LABEL 129 /* rfc3473 */
143 #define RSVP_OBJ_ACCEPT_LABEL_SET 130 /* rfc3473 */
144 #define RSVP_OBJ_RESTART_CAPABILITY 131 /* rfc3473 */
145 #define RSVP_OBJ_NOTIFY_REQ 195 /* rfc3473 */
146 #define RSVP_OBJ_ADMIN_STATUS 196 /* rfc3473 */
147 #define RSVP_OBJ_PROPERTIES 204 /* juniper proprietary */
148 #define RSVP_OBJ_FASTREROUTE 205 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07 */
149 #define RSVP_OBJ_SESSION_ATTRIBUTE 207 /* rfc3209 */
150 #define RSVP_OBJ_GENERALIZED_UNI 229 /* OIF RSVP extensions UNI 1.0 Signaling, Rel. 2 */
151 #define RSVP_OBJ_CALL_ID 230 /* rfc3474 */
152 #define RSVP_OBJ_CALL_OPS 236 /* rfc3474 */
154 static const struct tok rsvp_obj_values
[] = {
155 { RSVP_OBJ_SESSION
, "Session" },
156 { RSVP_OBJ_RSVP_HOP
, "RSVP Hop" },
157 { RSVP_OBJ_INTEGRITY
, "Integrity" },
158 { RSVP_OBJ_TIME_VALUES
, "Time Values" },
159 { RSVP_OBJ_ERROR_SPEC
, "Error Spec" },
160 { RSVP_OBJ_SCOPE
, "Scope" },
161 { RSVP_OBJ_STYLE
, "Style" },
162 { RSVP_OBJ_FLOWSPEC
, "Flowspec" },
163 { RSVP_OBJ_FILTERSPEC
, "FilterSpec" },
164 { RSVP_OBJ_SENDER_TEMPLATE
, "Sender Template" },
165 { RSVP_OBJ_SENDER_TSPEC
, "Sender TSpec" },
166 { RSVP_OBJ_ADSPEC
, "Adspec" },
167 { RSVP_OBJ_POLICY_DATA
, "Policy Data" },
168 { RSVP_OBJ_CONFIRM
, "Confirm" },
169 { RSVP_OBJ_LABEL
, "Label" },
170 { RSVP_OBJ_LABEL_REQ
, "Label Request" },
171 { RSVP_OBJ_ERO
, "ERO" },
172 { RSVP_OBJ_RRO
, "RRO" },
173 { RSVP_OBJ_HELLO
, "Hello" },
174 { RSVP_OBJ_MESSAGE_ID
, "Message ID" },
175 { RSVP_OBJ_MESSAGE_ID_ACK
, "Message ID Ack" },
176 { RSVP_OBJ_MESSAGE_ID_LIST
, "Message ID List" },
177 { RSVP_OBJ_RECOVERY_LABEL
, "Recovery Label" },
178 { RSVP_OBJ_UPSTREAM_LABEL
, "Upstream Label" },
179 { RSVP_OBJ_LABEL_SET
, "Label Set" },
180 { RSVP_OBJ_ACCEPT_LABEL_SET
, "Acceptable Label Set" },
181 { RSVP_OBJ_DETOUR
, "Detour" },
182 { RSVP_OBJ_CLASSTYPE
, "Class Type" },
183 { RSVP_OBJ_CLASSTYPE_OLD
, "Class Type (old)" },
184 { RSVP_OBJ_SUGGESTED_LABEL
, "Suggested Label" },
185 { RSVP_OBJ_PROPERTIES
, "Properties" },
186 { RSVP_OBJ_FASTREROUTE
, "Fast Re-Route" },
187 { RSVP_OBJ_SESSION_ATTRIBUTE
, "Session Attribute" },
188 { RSVP_OBJ_GENERALIZED_UNI
, "Generalized UNI" },
189 { RSVP_OBJ_CALL_ID
, "Call-ID" },
190 { RSVP_OBJ_CALL_OPS
, "Call Capability" },
191 { RSVP_OBJ_RESTART_CAPABILITY
, "Restart Capability" },
192 { RSVP_OBJ_NOTIFY_REQ
, "Notify Request" },
193 { RSVP_OBJ_PROTECTION
, "Protection" },
194 { RSVP_OBJ_ADMIN_STATUS
, "Administrative Status" },
195 { RSVP_OBJ_S2L
, "Sub-LSP to LSP" },
199 #define RSVP_CTYPE_IPV4 1
200 #define RSVP_CTYPE_IPV6 2
201 #define RSVP_CTYPE_TUNNEL_IPV4 7
202 #define RSVP_CTYPE_TUNNEL_IPV6 8
203 #define RSVP_CTYPE_UNI_IPV4 11 /* OIF RSVP extensions UNI 1.0 Signaling Rel. 2 */
204 #define RSVP_CTYPE_1 1
205 #define RSVP_CTYPE_2 2
206 #define RSVP_CTYPE_3 3
207 #define RSVP_CTYPE_4 4
208 #define RSVP_CTYPE_12 12
209 #define RSVP_CTYPE_13 13
210 #define RSVP_CTYPE_14 14
213 * the ctypes are not globally unique so for
214 * translating it to strings we build a table based
215 * on objects offsetted by the ctype
218 static const struct tok rsvp_ctype_values
[] = {
219 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV4
, "IPv4" },
220 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_IPV6
, "IPv6" },
221 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
222 { 256*RSVP_OBJ_RSVP_HOP
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
223 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV4
, "IPv4" },
224 { 256*RSVP_OBJ_NOTIFY_REQ
+RSVP_CTYPE_IPV6
, "IPv6" },
225 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV4
, "IPv4" },
226 { 256*RSVP_OBJ_CONFIRM
+RSVP_CTYPE_IPV6
, "IPv6" },
227 { 256*RSVP_OBJ_TIME_VALUES
+RSVP_CTYPE_1
, "1" },
228 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_1
, "obsolete" },
229 { 256*RSVP_OBJ_FLOWSPEC
+RSVP_CTYPE_2
, "IntServ" },
230 { 256*RSVP_OBJ_SENDER_TSPEC
+RSVP_CTYPE_2
, "IntServ" },
231 { 256*RSVP_OBJ_ADSPEC
+RSVP_CTYPE_2
, "IntServ" },
232 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
233 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
234 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_3
, "IPv6 Flow-label" },
235 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
236 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
237 { 256*RSVP_OBJ_FILTERSPEC
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
238 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV4
, "IPv4" },
239 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_IPV6
, "IPv6" },
240 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
241 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_UNI_IPV4
, "UNI IPv4" },
242 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_13
, "IPv4 P2MP LSP Tunnel" },
243 { 256*RSVP_OBJ_SESSION
+RSVP_CTYPE_14
, "IPv6 P2MP LSP Tunnel" },
244 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV4
, "IPv4" },
245 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_IPV6
, "IPv6" },
246 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
247 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_12
, "IPv4 P2MP LSP Tunnel" },
248 { 256*RSVP_OBJ_SENDER_TEMPLATE
+RSVP_CTYPE_13
, "IPv6 P2MP LSP Tunnel" },
249 { 256*RSVP_OBJ_MESSAGE_ID
+RSVP_CTYPE_1
, "1" },
250 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_1
, "Message id ack" },
251 { 256*RSVP_OBJ_MESSAGE_ID_ACK
+RSVP_CTYPE_2
, "Message id nack" },
252 { 256*RSVP_OBJ_MESSAGE_ID_LIST
+RSVP_CTYPE_1
, "1" },
253 { 256*RSVP_OBJ_STYLE
+RSVP_CTYPE_1
, "1" },
254 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_1
, "Hello Request" },
255 { 256*RSVP_OBJ_HELLO
+RSVP_CTYPE_2
, "Hello Ack" },
256 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_1
, "without label range" },
257 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_2
, "with ATM label range" },
258 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_3
, "with FR label range" },
259 { 256*RSVP_OBJ_LABEL_REQ
+RSVP_CTYPE_4
, "Generalized Label" },
260 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_1
, "Label" },
261 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
262 { 256*RSVP_OBJ_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
263 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_1
, "Label" },
264 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
265 { 256*RSVP_OBJ_SUGGESTED_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
266 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_1
, "Label" },
267 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
268 { 256*RSVP_OBJ_UPSTREAM_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
269 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_1
, "Label" },
270 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_2
, "Generalized Label" },
271 { 256*RSVP_OBJ_RECOVERY_LABEL
+RSVP_CTYPE_3
, "Waveband Switching" },
272 { 256*RSVP_OBJ_ERO
+RSVP_CTYPE_IPV4
, "IPv4" },
273 { 256*RSVP_OBJ_RRO
+RSVP_CTYPE_IPV4
, "IPv4" },
274 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV4
, "IPv4" },
275 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_IPV6
, "IPv6" },
276 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_3
, "IPv4 plus opt. TLVs" },
277 { 256*RSVP_OBJ_ERROR_SPEC
+RSVP_CTYPE_4
, "IPv6 plus opt. TLVs" },
278 { 256*RSVP_OBJ_RESTART_CAPABILITY
+RSVP_CTYPE_1
, "IPv4" },
279 { 256*RSVP_OBJ_SESSION_ATTRIBUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
280 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" }, /* old style*/
281 { 256*RSVP_OBJ_FASTREROUTE
+RSVP_CTYPE_1
, "1" }, /* new style */
282 { 256*RSVP_OBJ_DETOUR
+RSVP_CTYPE_TUNNEL_IPV4
, "Tunnel IPv4" },
283 { 256*RSVP_OBJ_PROPERTIES
+RSVP_CTYPE_1
, "1" },
284 { 256*RSVP_OBJ_ADMIN_STATUS
+RSVP_CTYPE_1
, "1" },
285 { 256*RSVP_OBJ_CLASSTYPE
+RSVP_CTYPE_1
, "1" },
286 { 256*RSVP_OBJ_CLASSTYPE_OLD
+RSVP_CTYPE_1
, "1" },
287 { 256*RSVP_OBJ_LABEL_SET
+RSVP_CTYPE_1
, "1" },
288 { 256*RSVP_OBJ_GENERALIZED_UNI
+RSVP_CTYPE_1
, "1" },
289 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV4
, "IPv4 sub-LSP" },
290 { 256*RSVP_OBJ_S2L
+RSVP_CTYPE_IPV6
, "IPv6 sub-LSP" },
294 struct rsvp_obj_integrity_t
{
298 u_int8_t sequence
[8];
302 static const struct tok rsvp_obj_integrity_flag_values
[] = {
303 { 0x80, "Handshake" },
307 struct rsvp_obj_frr_t
{
312 u_int8_t bandwidth
[4];
313 u_int8_t include_any
[4];
314 u_int8_t exclude_any
[4];
315 u_int8_t include_all
[4];
319 #define RSVP_OBJ_XRO_MASK_SUBOBJ(x) ((x)&0x7f)
320 #define RSVP_OBJ_XRO_MASK_LOOSE(x) ((x)&0x80)
322 #define RSVP_OBJ_XRO_RES 0
323 #define RSVP_OBJ_XRO_IPV4 1
324 #define RSVP_OBJ_XRO_IPV6 2
325 #define RSVP_OBJ_XRO_LABEL 3
326 #define RSVP_OBJ_XRO_ASN 32
327 #define RSVP_OBJ_XRO_MPLS 64
329 static const struct tok rsvp_obj_xro_values
[] = {
330 { RSVP_OBJ_XRO_RES
, "Reserved" },
331 { RSVP_OBJ_XRO_IPV4
, "IPv4 prefix" },
332 { RSVP_OBJ_XRO_IPV6
, "IPv6 prefix" },
333 { RSVP_OBJ_XRO_LABEL
, "Label" },
334 { RSVP_OBJ_XRO_ASN
, "Autonomous system number" },
335 { RSVP_OBJ_XRO_MPLS
, "MPLS label switched path termination" },
339 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07.txt */
340 static const struct tok rsvp_obj_rro_flag_values
[] = {
341 { 0x01, "Local protection available" },
342 { 0x02, "Local protection in use" },
343 { 0x04, "Bandwidth protection" },
344 { 0x08, "Node protection" },
349 static const struct tok rsvp_obj_rro_label_flag_values
[] = {
354 static const struct tok rsvp_resstyle_values
[] = {
355 { 17, "Wildcard Filter" },
356 { 10, "Fixed Filter" },
357 { 18, "Shared Explicit" },
361 #define RSVP_OBJ_INTSERV_GUARANTEED_SERV 2
362 #define RSVP_OBJ_INTSERV_CONTROLLED_LOAD 5
364 static const struct tok rsvp_intserv_service_type_values
[] = {
365 { 1, "Default/Global Information" },
366 { RSVP_OBJ_INTSERV_GUARANTEED_SERV
, "Guaranteed Service" },
367 { RSVP_OBJ_INTSERV_CONTROLLED_LOAD
, "Controlled Load" },
371 static const struct tok rsvp_intserv_parameter_id_values
[] = {
373 { 6, "Path b/w estimate" },
374 { 8, "Minimum path latency" },
375 { 10, "Composed MTU" },
376 { 127, "Token Bucket TSpec" },
377 { 130, "Guaranteed Service RSpec" },
378 { 133, "End-to-end composed value for C" },
379 { 134, "End-to-end composed value for D" },
380 { 135, "Since-last-reshaping point composed C" },
381 { 136, "Since-last-reshaping point composed D" },
385 static const struct tok rsvp_session_attribute_flag_values
[] = {
386 { 0x01, "Local Protection" },
387 { 0x02, "Label Recording" },
388 { 0x04, "SE Style" },
389 { 0x08, "Bandwidth protection" }, /* RFC4090 */
390 { 0x10, "Node protection" }, /* RFC4090 */
394 static const struct tok rsvp_obj_prop_tlv_values
[] = {
396 { 0x02, "Metric 1" },
397 { 0x04, "Metric 2" },
398 { 0x08, "CCC Status" },
399 { 0x10, "Path Type" },
403 #define RSVP_OBJ_ERROR_SPEC_CODE_ROUTING 24
404 #define RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY 25
405 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE 28
406 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD 125
408 static const struct tok rsvp_obj_error_code_values
[] = {
409 { RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
, "Routing Problem" },
410 { RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY
, "Notify Error" },
411 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
, "Diffserv TE Error" },
412 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
, "Diffserv TE Error (Old)" },
416 static const struct tok rsvp_obj_error_code_routing_values
[] = {
417 { 1, "Bad EXPLICIT_ROUTE object" },
418 { 2, "Bad strict node" },
419 { 3, "Bad loose node" },
420 { 4, "Bad initial subobject" },
421 { 5, "No route available toward destination" },
422 { 6, "Unacceptable label value" },
423 { 7, "RRO indicated routing loops" },
424 { 8, "non-RSVP-capable router in the path" },
425 { 9, "MPLS label allocation failure" },
426 { 10, "Unsupported L3PID" },
430 static const struct tok rsvp_obj_error_code_diffserv_te_values
[] = {
431 { 1, "Unexpected CT object" },
432 { 2, "Unsupported CT" },
433 { 3, "Invalid CT value" },
434 { 4, "CT/setup priority do not form a configured TE-Class" },
435 { 5, "CT/holding priority do not form a configured TE-Class" },
436 { 6, "CT/setup priority and CT/holding priority do not form a configured TE-Class" },
437 { 7, "Inconsistency between signaled PSC and signaled CT" },
438 { 8, "Inconsistency between signaled PHBs and signaled CT" },
442 /* rfc3473 / rfc 3471 */
443 static const struct tok rsvp_obj_admin_status_flag_values
[] = {
444 { 0x80000000, "Reflect" },
445 { 0x00000004, "Testing" },
446 { 0x00000002, "Admin-down" },
447 { 0x00000001, "Delete-in-progress" },
451 /* label set actions - rfc3471 */
452 #define LABEL_SET_INCLUSIVE_LIST 0
453 #define LABEL_SET_EXCLUSIVE_LIST 1
454 #define LABEL_SET_INCLUSIVE_RANGE 2
455 #define LABEL_SET_EXCLUSIVE_RANGE 3
457 static const struct tok rsvp_obj_label_set_action_values
[] = {
458 { LABEL_SET_INCLUSIVE_LIST
, "Inclusive list" },
459 { LABEL_SET_EXCLUSIVE_LIST
, "Exclusive list" },
460 { LABEL_SET_INCLUSIVE_RANGE
, "Inclusive range" },
461 { LABEL_SET_EXCLUSIVE_RANGE
, "Exclusive range" },
465 /* OIF RSVP extensions UNI 1.0 Signaling, release 2 */
466 #define RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS 1
467 #define RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS 2
468 #define RSVP_GEN_UNI_SUBOBJ_DIVERSITY 3
469 #define RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL 4
470 #define RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL 5
472 static const struct tok rsvp_obj_generalized_uni_values
[] = {
473 { RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
, "Source TNA address" },
474 { RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
, "Destination TNA address" },
475 { RSVP_GEN_UNI_SUBOBJ_DIVERSITY
, "Diversity" },
476 { RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
, "Egress label" },
477 { RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
, "Service level" },
482 * this is a dissector for all the intserv defined
483 * specs as defined per rfc2215
484 * it is called from various rsvp objects;
485 * returns the amount of bytes being processed
488 rsvp_intserv_print(netdissect_options
*ndo
,
489 const u_char
*tptr
, u_short obj_tlen
) {
491 int parameter_id
,parameter_length
;
499 parameter_id
= *(tptr
);
500 parameter_length
= EXTRACT_16BITS(tptr
+2)<<2; /* convert wordcount to bytecount */
502 ND_PRINT((ndo
, "\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
503 tok2str(rsvp_intserv_parameter_id_values
,"unknown",parameter_id
),
508 if (obj_tlen
< parameter_length
+4)
510 switch(parameter_id
) { /* parameter_id */
514 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
515 * | 4 (e) | (f) | 1 (g) |
516 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
517 * | IS hop cnt (32-bit unsigned integer) |
518 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
520 if (parameter_length
== 4)
521 ND_PRINT((ndo
, "\n\t\tIS hop count: %u", EXTRACT_32BITS(tptr
+ 4)));
526 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
527 * | 6 (h) | (i) | 1 (j) |
528 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
529 * | Path b/w estimate (32-bit IEEE floating point number) |
530 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
532 if (parameter_length
== 4) {
533 bw
.i
= EXTRACT_32BITS(tptr
+4);
534 ND_PRINT((ndo
, "\n\t\tPath b/w estimate: %.10g Mbps", bw
.f
/ 125000));
540 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
541 * | 8 (k) | (l) | 1 (m) |
542 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
543 * | Minimum path latency (32-bit integer) |
544 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
546 if (parameter_length
== 4) {
547 ND_PRINT((ndo
, "\n\t\tMinimum path latency: "));
548 if (EXTRACT_32BITS(tptr
+4) == 0xffffffff)
549 ND_PRINT((ndo
, "don't care"));
551 ND_PRINT((ndo
, "%u", EXTRACT_32BITS(tptr
+ 4)));
558 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
559 * | 10 (n) | (o) | 1 (p) |
560 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
561 * | Composed MTU (32-bit unsigned integer) |
562 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
564 if (parameter_length
== 4)
565 ND_PRINT((ndo
, "\n\t\tComposed MTU: %u bytes", EXTRACT_32BITS(tptr
+ 4)));
569 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
570 * | 127 (e) | 0 (f) | 5 (g) |
571 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
572 * | Token Bucket Rate [r] (32-bit IEEE floating point number) |
573 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
574 * | Token Bucket Size [b] (32-bit IEEE floating point number) |
575 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
576 * | Peak Data Rate [p] (32-bit IEEE floating point number) |
577 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
578 * | Minimum Policed Unit [m] (32-bit integer) |
579 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
580 * | Maximum Packet Size [M] (32-bit integer) |
581 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
584 if (parameter_length
== 20) {
585 bw
.i
= EXTRACT_32BITS(tptr
+4);
586 ND_PRINT((ndo
, "\n\t\tToken Bucket Rate: %.10g Mbps", bw
.f
/ 125000));
587 bw
.i
= EXTRACT_32BITS(tptr
+8);
588 ND_PRINT((ndo
, "\n\t\tToken Bucket Size: %.10g bytes", bw
.f
));
589 bw
.i
= EXTRACT_32BITS(tptr
+12);
590 ND_PRINT((ndo
, "\n\t\tPeak Data Rate: %.10g Mbps", bw
.f
/ 125000));
591 ND_PRINT((ndo
, "\n\t\tMinimum Policed Unit: %u bytes", EXTRACT_32BITS(tptr
+ 16)));
592 ND_PRINT((ndo
, "\n\t\tMaximum Packet Size: %u bytes", EXTRACT_32BITS(tptr
+ 20)));
598 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
599 * | 130 (h) | 0 (i) | 2 (j) |
600 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
601 * | Rate [R] (32-bit IEEE floating point number) |
602 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
603 * | Slack Term [S] (32-bit integer) |
604 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
607 if (parameter_length
== 8) {
608 bw
.i
= EXTRACT_32BITS(tptr
+4);
609 ND_PRINT((ndo
, "\n\t\tRate: %.10g Mbps", bw
.f
/ 125000));
610 ND_PRINT((ndo
, "\n\t\tSlack Term: %u", EXTRACT_32BITS(tptr
+ 8)));
618 if (parameter_length
== 4)
619 ND_PRINT((ndo
, "\n\t\tValue: %u", EXTRACT_32BITS(tptr
+ 4)));
623 if (ndo
->ndo_vflag
<= 1)
624 print_unknown_data(ndo
, tptr
+ 4, "\n\t\t", parameter_length
);
626 return (parameter_length
+4); /* header length 4 bytes */
630 rsvp_obj_print(netdissect_options
*ndo
,
632 #ifndef HAVE_LIBCRYPTO
636 #ifndef HAVE_LIBCRYPTO
639 , const u_char
*tptr
,
640 const char *ident
, u_int tlen
) {
642 const struct rsvp_object_header
*rsvp_obj_header
;
643 const u_char
*obj_tptr
;
645 const struct rsvp_obj_integrity_t
*rsvp_obj_integrity
;
646 const struct rsvp_obj_frr_t
*rsvp_obj_frr
;
649 u_short rsvp_obj_len
,rsvp_obj_ctype
,obj_tlen
,intserv_serv_tlen
;
650 int hexdump
,processed
,padbytes
,error_code
,error_value
,i
,sigcheck
;
657 u_int action
, subchannel
;
659 while(tlen
>=sizeof(struct rsvp_object_header
)) {
660 /* did we capture enough for fully decoding the object header ? */
661 if (!ND_TTEST2(*tptr
, sizeof(struct rsvp_object_header
)))
664 rsvp_obj_header
= (const struct rsvp_object_header
*)tptr
;
665 rsvp_obj_len
=EXTRACT_16BITS(rsvp_obj_header
->length
);
666 rsvp_obj_ctype
=rsvp_obj_header
->ctype
;
668 if(rsvp_obj_len
% 4) {
669 ND_PRINT((ndo
, "%sERROR: object header size %u not a multiple of 4", ident
, rsvp_obj_len
));
672 if(rsvp_obj_len
< sizeof(struct rsvp_object_header
)) {
673 ND_PRINT((ndo
, "%sERROR: object header too short %u < %lu", ident
, rsvp_obj_len
,
674 (unsigned long)sizeof(const struct rsvp_object_header
)));
678 ND_PRINT((ndo
, "%s%s Object (%u) Flags: [%s",
680 tok2str(rsvp_obj_values
,
682 rsvp_obj_header
->class_num
),
683 rsvp_obj_header
->class_num
,
684 ((rsvp_obj_header
->class_num
) & 0x80) ? "ignore" : "reject"));
686 if (rsvp_obj_header
->class_num
> 128)
687 ND_PRINT((ndo
, " %s",
688 ((rsvp_obj_header
->class_num
) & 0x40) ? "and forward" : "silently"));
690 ND_PRINT((ndo
, " if unknown], Class-Type: %s (%u), length: %u",
691 tok2str(rsvp_ctype_values
,
693 ((rsvp_obj_header
->class_num
)<<8)+rsvp_obj_ctype
),
697 if(tlen
< rsvp_obj_len
) {
698 ND_PRINT((ndo
, "%sERROR: object goes past end of objects TLV", ident
));
702 obj_tptr
=tptr
+sizeof(struct rsvp_object_header
);
703 obj_tlen
=rsvp_obj_len
-sizeof(struct rsvp_object_header
);
705 /* did we capture enough for fully decoding the object ? */
706 if (!ND_TTEST2(*tptr
, rsvp_obj_len
))
710 switch(rsvp_obj_header
->class_num
) {
711 case RSVP_OBJ_SESSION
:
712 switch(rsvp_obj_ctype
) {
713 case RSVP_CTYPE_IPV4
:
716 ND_PRINT((ndo
, "%s IPv4 DestAddress: %s, Protocol ID: 0x%02x",
718 ipaddr_string(obj_tptr
),
719 *(obj_tptr
+ sizeof(struct in_addr
))));
720 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
723 EXTRACT_16BITS(obj_tptr
+ 6)));
728 case RSVP_CTYPE_IPV6
:
731 ND_PRINT((ndo
, "%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
733 ip6addr_string(obj_tptr
),
734 *(obj_tptr
+ sizeof(struct in6_addr
))));
735 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
737 *(obj_tptr
+sizeof(struct in6_addr
)+1),
738 EXTRACT_16BITS(obj_tptr
+ sizeof(struct in6_addr
) + 2)));
743 case RSVP_CTYPE_TUNNEL_IPV6
:
746 ND_PRINT((ndo
, "%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
748 ip6addr_string(obj_tptr
),
749 EXTRACT_16BITS(obj_tptr
+18),
750 ip6addr_string(obj_tptr
+ 20)));
755 case RSVP_CTYPE_14
: /* IPv6 p2mp LSP Tunnel */
758 ND_PRINT((ndo
, "%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
760 EXTRACT_32BITS(obj_tptr
),
761 EXTRACT_16BITS(obj_tptr
+6),
762 ip6addr_string(obj_tptr
+ 8)));
767 case RSVP_CTYPE_13
: /* IPv4 p2mp LSP Tunnel */
770 ND_PRINT((ndo
, "%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
772 ipaddr_string(obj_tptr
),
773 EXTRACT_16BITS(obj_tptr
+6),
774 ipaddr_string(obj_tptr
+ 8)));
778 case RSVP_CTYPE_TUNNEL_IPV4
:
779 case RSVP_CTYPE_UNI_IPV4
:
782 ND_PRINT((ndo
, "%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
784 ipaddr_string(obj_tptr
),
785 EXTRACT_16BITS(obj_tptr
+6),
786 ipaddr_string(obj_tptr
+ 8)));
795 case RSVP_OBJ_CONFIRM
:
796 switch(rsvp_obj_ctype
) {
797 case RSVP_CTYPE_IPV4
:
798 if (obj_tlen
< sizeof(struct in_addr
))
800 ND_PRINT((ndo
, "%s IPv4 Receiver Address: %s",
802 ipaddr_string(obj_tptr
)));
803 obj_tlen
-=sizeof(struct in_addr
);
804 obj_tptr
+=sizeof(struct in_addr
);
807 case RSVP_CTYPE_IPV6
:
808 if (obj_tlen
< sizeof(struct in6_addr
))
810 ND_PRINT((ndo
, "%s IPv6 Receiver Address: %s",
812 ip6addr_string(obj_tptr
)));
813 obj_tlen
-=sizeof(struct in6_addr
);
814 obj_tptr
+=sizeof(struct in6_addr
);
822 case RSVP_OBJ_NOTIFY_REQ
:
823 switch(rsvp_obj_ctype
) {
824 case RSVP_CTYPE_IPV4
:
825 if (obj_tlen
< sizeof(struct in_addr
))
827 ND_PRINT((ndo
, "%s IPv4 Notify Node Address: %s",
829 ipaddr_string(obj_tptr
)));
830 obj_tlen
-=sizeof(struct in_addr
);
831 obj_tptr
+=sizeof(struct in_addr
);
834 case RSVP_CTYPE_IPV6
:
835 if (obj_tlen
< sizeof(struct in6_addr
))
837 ND_PRINT((ndo
, "%s IPv6 Notify Node Address: %s",
839 ip6addr_string(obj_tptr
)));
840 obj_tlen
-=sizeof(struct in6_addr
);
841 obj_tptr
+=sizeof(struct in6_addr
);
849 case RSVP_OBJ_SUGGESTED_LABEL
: /* fall through */
850 case RSVP_OBJ_UPSTREAM_LABEL
: /* fall through */
851 case RSVP_OBJ_RECOVERY_LABEL
: /* fall through */
853 switch(rsvp_obj_ctype
) {
855 while(obj_tlen
>= 4 ) {
856 ND_PRINT((ndo
, "%s Label: %u", ident
, EXTRACT_32BITS(obj_tptr
)));
864 ND_PRINT((ndo
, "%s Generalized Label: %u",
866 EXTRACT_32BITS(obj_tptr
)));
873 ND_PRINT((ndo
, "%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
875 EXTRACT_32BITS(obj_tptr
),
877 EXTRACT_32BITS(obj_tptr
+4),
878 EXTRACT_32BITS(obj_tptr
+ 8)));
888 switch(rsvp_obj_ctype
) {
892 ND_PRINT((ndo
, "%s Reservation Style: %s, Flags: [0x%02x]",
894 tok2str(rsvp_resstyle_values
,
896 EXTRACT_24BITS(obj_tptr
+1)),
906 case RSVP_OBJ_SENDER_TEMPLATE
:
907 switch(rsvp_obj_ctype
) {
908 case RSVP_CTYPE_IPV4
:
911 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
913 ipaddr_string(obj_tptr
),
914 EXTRACT_16BITS(obj_tptr
+ 6)));
919 case RSVP_CTYPE_IPV6
:
922 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
924 ip6addr_string(obj_tptr
),
925 EXTRACT_16BITS(obj_tptr
+ 18)));
929 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
932 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
933 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
935 ip6addr_string(obj_tptr
),
936 EXTRACT_16BITS(obj_tptr
+18),
938 ip6addr_string(obj_tptr
+20),
939 EXTRACT_16BITS(obj_tptr
+ 38)));
944 case RSVP_CTYPE_TUNNEL_IPV4
:
947 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
949 ipaddr_string(obj_tptr
),
950 EXTRACT_16BITS(obj_tptr
+ 6)));
954 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
957 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
958 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
960 ipaddr_string(obj_tptr
),
961 EXTRACT_16BITS(obj_tptr
+6),
963 ipaddr_string(obj_tptr
+8),
964 EXTRACT_16BITS(obj_tptr
+ 12)));
973 case RSVP_OBJ_LABEL_REQ
:
974 switch(rsvp_obj_ctype
) {
976 while(obj_tlen
>= 4 ) {
977 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
979 tok2str(ethertype_values
,
980 "Unknown Protocol (0x%04x)",
981 EXTRACT_16BITS(obj_tptr
+ 2))));
989 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
991 tok2str(ethertype_values
,
992 "Unknown Protocol (0x%04x)",
993 EXTRACT_16BITS(obj_tptr
+ 2))));
994 ND_PRINT((ndo
, ",%s merge capability",((*(obj_tptr
+ 4)) & 0x80) ? "no" : "" ));
995 ND_PRINT((ndo
, "%s Minimum VPI/VCI: %u/%u",
997 (EXTRACT_16BITS(obj_tptr
+4))&0xfff,
998 (EXTRACT_16BITS(obj_tptr
+ 6)) & 0xfff));
999 ND_PRINT((ndo
, "%s Maximum VPI/VCI: %u/%u",
1001 (EXTRACT_16BITS(obj_tptr
+8))&0xfff,
1002 (EXTRACT_16BITS(obj_tptr
+ 10)) & 0xfff));
1009 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
1011 tok2str(ethertype_values
,
1012 "Unknown Protocol (0x%04x)",
1013 EXTRACT_16BITS(obj_tptr
+ 2))));
1014 ND_PRINT((ndo
, "%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1016 (EXTRACT_32BITS(obj_tptr
+4))&0x7fffff,
1017 (EXTRACT_32BITS(obj_tptr
+8))&0x7fffff,
1018 (((EXTRACT_16BITS(obj_tptr
+4)>>7)&3) == 0 ) ? "10" : "",
1019 (((EXTRACT_16BITS(obj_tptr
+ 4) >> 7) & 3) == 2 ) ? "23" : ""));
1026 ND_PRINT((ndo
, "%s LSP Encoding Type: %s (%u)",
1028 tok2str(gmpls_encoding_values
,
1032 ND_PRINT((ndo
, "%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1034 tok2str(gmpls_switch_cap_values
,
1038 tok2str(gmpls_payload_values
,
1040 EXTRACT_16BITS(obj_tptr
+2)),
1041 EXTRACT_16BITS(obj_tptr
+ 2)));
1052 switch(rsvp_obj_ctype
) {
1053 case RSVP_CTYPE_IPV4
:
1054 while(obj_tlen
>= 4 ) {
1055 ND_PRINT((ndo
, "%s Subobject Type: %s, length %u",
1057 tok2str(rsvp_obj_xro_values
,
1059 RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)),
1062 if (*(obj_tptr
+1) == 0) { /* prevent infinite loops */
1063 ND_PRINT((ndo
, "%s ERROR: zero length ERO subtype", ident
));
1067 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)) {
1068 case RSVP_OBJ_XRO_IPV4
:
1069 ND_PRINT((ndo
, ", %s, %s/%u, Flags: [%s]",
1070 RSVP_OBJ_XRO_MASK_LOOSE(*obj_tptr
) ? "Loose" : "Strict",
1071 ipaddr_string(obj_tptr
+2),
1073 bittok2str(rsvp_obj_rro_flag_values
,
1075 *(obj_tptr
+ 7)))); /* rfc3209 says that this field is rsvd. */
1077 case RSVP_OBJ_XRO_LABEL
:
1078 ND_PRINT((ndo
, ", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1079 bittok2str(rsvp_obj_rro_label_flag_values
,
1083 tok2str(rsvp_ctype_values
,
1085 *(obj_tptr
+3) + 256*RSVP_OBJ_RRO
),
1087 EXTRACT_32BITS(obj_tptr
+ 4)));
1089 obj_tlen
-=*(obj_tptr
+1);
1090 obj_tptr
+=*(obj_tptr
+1);
1098 case RSVP_OBJ_HELLO
:
1099 switch(rsvp_obj_ctype
) {
1104 ND_PRINT((ndo
, "%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1106 EXTRACT_32BITS(obj_tptr
),
1107 EXTRACT_32BITS(obj_tptr
+ 4)));
1116 case RSVP_OBJ_RESTART_CAPABILITY
:
1117 switch(rsvp_obj_ctype
) {
1121 ND_PRINT((ndo
, "%s Restart Time: %ums, Recovery Time: %ums",
1123 EXTRACT_32BITS(obj_tptr
),
1124 EXTRACT_32BITS(obj_tptr
+ 4)));
1133 case RSVP_OBJ_SESSION_ATTRIBUTE
:
1134 switch(rsvp_obj_ctype
) {
1135 case RSVP_CTYPE_TUNNEL_IPV4
:
1138 namelen
= *(obj_tptr
+3);
1139 if (obj_tlen
< 4+namelen
)
1141 ND_PRINT((ndo
, "%s Session Name: ", ident
));
1142 for (i
= 0; i
< namelen
; i
++)
1143 safeputchar(ndo
, *(obj_tptr
+ 4 + i
));
1144 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1148 bittok2str(rsvp_session_attribute_flag_values
,
1152 obj_tlen
-=4+*(obj_tptr
+3);
1153 obj_tptr
+=4+*(obj_tptr
+3);
1160 case RSVP_OBJ_GENERALIZED_UNI
:
1161 switch(rsvp_obj_ctype
) {
1162 int subobj_type
,af
,subobj_len
,total_subobj_len
;
1169 /* read variable length subobjects */
1170 total_subobj_len
= obj_tlen
;
1171 while(total_subobj_len
> 0) {
1172 subobj_len
= EXTRACT_16BITS(obj_tptr
);
1173 subobj_type
= (EXTRACT_16BITS(obj_tptr
+2))>>8;
1174 af
= (EXTRACT_16BITS(obj_tptr
+2))&0x00FF;
1176 ND_PRINT((ndo
, "%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1178 tok2str(rsvp_obj_generalized_uni_values
, "Unknown", subobj_type
),
1180 tok2str(af_values
, "Unknown", af
), af
,
1183 switch(subobj_type
) {
1184 case RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
:
1185 case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
:
1191 ND_PRINT((ndo
, "%s UNI IPv4 TNA address: %s",
1192 ident
, ipaddr_string(obj_tptr
+ 4)));
1196 if (subobj_len
< 20)
1198 ND_PRINT((ndo
, "%s UNI IPv6 TNA address: %s",
1199 ident
, ip6addr_string(obj_tptr
+ 4)));
1204 /* unless we have a TLV parser lets just hexdump */
1211 case RSVP_GEN_UNI_SUBOBJ_DIVERSITY
:
1213 /* unless we have a TLV parser lets just hexdump */
1218 case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
:
1219 if (subobj_len
< 16) {
1223 ND_PRINT((ndo
, "%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
1225 ((EXTRACT_32BITS(obj_tptr
+4))>>31),
1226 ((EXTRACT_32BITS(obj_tptr
+4))&0xFF),
1227 EXTRACT_32BITS(obj_tptr
+8),
1228 EXTRACT_32BITS(obj_tptr
+ 12)));
1231 case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
:
1232 if (subobj_len
< 8) {
1236 ND_PRINT((ndo
, "%s Service level: %u",
1237 ident
, (EXTRACT_32BITS(obj_tptr
+ 4)) >> 24));
1244 total_subobj_len
-=subobj_len
;
1245 obj_tptr
+=subobj_len
;
1246 obj_tlen
+=subobj_len
;
1249 if (total_subobj_len
) {
1250 /* unless we have a TLV parser lets just hexdump */
1260 case RSVP_OBJ_RSVP_HOP
:
1261 switch(rsvp_obj_ctype
) {
1262 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1263 case RSVP_CTYPE_IPV4
:
1266 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1268 ipaddr_string(obj_tptr
),
1269 EXTRACT_32BITS(obj_tptr
+ 4)));
1273 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1276 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1277 case RSVP_CTYPE_IPV6
:
1280 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1282 ip6addr_string(obj_tptr
),
1283 EXTRACT_32BITS(obj_tptr
+ 16)));
1286 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1294 case RSVP_OBJ_TIME_VALUES
:
1295 switch(rsvp_obj_ctype
) {
1299 ND_PRINT((ndo
, "%s Refresh Period: %ums",
1301 EXTRACT_32BITS(obj_tptr
)));
1310 /* those three objects do share the same semantics */
1311 case RSVP_OBJ_SENDER_TSPEC
:
1312 case RSVP_OBJ_ADSPEC
:
1313 case RSVP_OBJ_FLOWSPEC
:
1314 switch(rsvp_obj_ctype
) {
1318 ND_PRINT((ndo
, "%s Msg-Version: %u, length: %u",
1320 (*obj_tptr
& 0xf0) >> 4,
1321 EXTRACT_16BITS(obj_tptr
+ 2) << 2));
1322 obj_tptr
+=4; /* get to the start of the service header */
1325 while (obj_tlen
>= 4) {
1326 intserv_serv_tlen
=EXTRACT_16BITS(obj_tptr
+2)<<2;
1327 ND_PRINT((ndo
, "%s Service Type: %s (%u), break bit %s set, Service length: %u",
1329 tok2str(rsvp_intserv_service_type_values
,"unknown",*(obj_tptr
)),
1331 (*(obj_tptr
+1)&0x80) ? "" : "not",
1332 intserv_serv_tlen
));
1334 obj_tptr
+=4; /* get to the start of the parameter list */
1337 while (intserv_serv_tlen
>=4) {
1338 processed
= rsvp_intserv_print(ndo
, obj_tptr
, obj_tlen
);
1341 obj_tlen
-=processed
;
1342 intserv_serv_tlen
-=processed
;
1343 obj_tptr
+=processed
;
1352 case RSVP_OBJ_FILTERSPEC
:
1353 switch(rsvp_obj_ctype
) {
1354 case RSVP_CTYPE_IPV4
:
1357 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1359 ipaddr_string(obj_tptr
),
1360 EXTRACT_16BITS(obj_tptr
+ 6)));
1365 case RSVP_CTYPE_IPV6
:
1368 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1370 ip6addr_string(obj_tptr
),
1371 EXTRACT_16BITS(obj_tptr
+ 18)));
1378 ND_PRINT((ndo
, "%s Source Address: %s, Flow Label: %u",
1380 ip6addr_string(obj_tptr
),
1381 EXTRACT_24BITS(obj_tptr
+ 17)));
1385 case RSVP_CTYPE_TUNNEL_IPV6
:
1388 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1390 ipaddr_string(obj_tptr
),
1391 EXTRACT_16BITS(obj_tptr
+ 18)));
1395 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
1398 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1399 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1401 ip6addr_string(obj_tptr
),
1402 EXTRACT_16BITS(obj_tptr
+18),
1404 ip6addr_string(obj_tptr
+20),
1405 EXTRACT_16BITS(obj_tptr
+ 38)));
1410 case RSVP_CTYPE_TUNNEL_IPV4
:
1413 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1415 ipaddr_string(obj_tptr
),
1416 EXTRACT_16BITS(obj_tptr
+ 6)));
1420 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
1423 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1424 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1426 ipaddr_string(obj_tptr
),
1427 EXTRACT_16BITS(obj_tptr
+6),
1429 ipaddr_string(obj_tptr
+8),
1430 EXTRACT_16BITS(obj_tptr
+ 12)));
1439 case RSVP_OBJ_FASTREROUTE
:
1440 /* the differences between c-type 1 and 7 are minor */
1441 obj_ptr
.rsvp_obj_frr
= (const struct rsvp_obj_frr_t
*)obj_tptr
;
1442 bw
.i
= EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1444 switch(rsvp_obj_ctype
) {
1445 case RSVP_CTYPE_1
: /* new style */
1446 if (obj_tlen
< sizeof(struct rsvp_obj_frr_t
))
1448 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1450 (int)obj_ptr
.rsvp_obj_frr
->setup_prio
,
1451 (int)obj_ptr
.rsvp_obj_frr
->hold_prio
,
1452 (int)obj_ptr
.rsvp_obj_frr
->hop_limit
,
1453 bw
.f
* 8 / 1000000));
1454 ND_PRINT((ndo
, "%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
1456 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_any
),
1457 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->exclude_any
),
1458 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_all
)));
1459 obj_tlen
-=sizeof(struct rsvp_obj_frr_t
);
1460 obj_tptr
+=sizeof(struct rsvp_obj_frr_t
);
1463 case RSVP_CTYPE_TUNNEL_IPV4
: /* old style */
1466 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1468 (int)obj_ptr
.rsvp_obj_frr
->setup_prio
,
1469 (int)obj_ptr
.rsvp_obj_frr
->hold_prio
,
1470 (int)obj_ptr
.rsvp_obj_frr
->hop_limit
,
1471 bw
.f
* 8 / 1000000));
1472 ND_PRINT((ndo
, "%s Include Colors: 0x%08x, Exclude Colors: 0x%08x",
1474 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_any
),
1475 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->exclude_any
)));
1485 case RSVP_OBJ_DETOUR
:
1486 switch(rsvp_obj_ctype
) {
1487 case RSVP_CTYPE_TUNNEL_IPV4
:
1488 while(obj_tlen
>= 8) {
1489 ND_PRINT((ndo
, "%s PLR-ID: %s, Avoid-Node-ID: %s",
1491 ipaddr_string(obj_tptr
),
1492 ipaddr_string(obj_tptr
+ 4)));
1502 case RSVP_OBJ_CLASSTYPE
:
1503 case RSVP_OBJ_CLASSTYPE_OLD
: /* fall through */
1504 switch(rsvp_obj_ctype
) {
1506 ND_PRINT((ndo
, "%s CT: %u",
1508 EXTRACT_32BITS(obj_tptr
) & 0x7));
1517 case RSVP_OBJ_ERROR_SPEC
:
1518 switch(rsvp_obj_ctype
) {
1519 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1520 case RSVP_CTYPE_IPV4
:
1523 error_code
=*(obj_tptr
+5);
1524 error_value
=EXTRACT_16BITS(obj_tptr
+6);
1525 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1527 ipaddr_string(obj_tptr
),
1530 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1532 switch (error_code
) {
1533 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1534 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1535 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1538 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
: /* fall through */
1539 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
:
1540 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1541 tok2str(rsvp_obj_error_code_diffserv_te_values
,"unknown",error_value
),
1545 ND_PRINT((ndo
, ", Unknown Error Value (%u)", error_value
));
1552 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1553 case RSVP_CTYPE_IPV6
:
1556 error_code
=*(obj_tptr
+17);
1557 error_value
=EXTRACT_16BITS(obj_tptr
+18);
1558 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1560 ip6addr_string(obj_tptr
),
1563 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1566 switch (error_code
) {
1567 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1568 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1569 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1584 case RSVP_OBJ_PROPERTIES
:
1585 switch(rsvp_obj_ctype
) {
1589 padbytes
= EXTRACT_16BITS(obj_tptr
+2);
1590 ND_PRINT((ndo
, "%s TLV count: %u, padding bytes: %u",
1592 EXTRACT_16BITS(obj_tptr
),
1596 /* loop through as long there is anything longer than the TLV header (2) */
1597 while(obj_tlen
>= 2 + padbytes
) {
1598 ND_PRINT((ndo
, "%s %s TLV (0x%02x), length: %u", /* length includes header */
1600 tok2str(rsvp_obj_prop_tlv_values
,"unknown",*obj_tptr
),
1603 if (obj_tlen
< *(obj_tptr
+1))
1605 if (*(obj_tptr
+1) < 2)
1607 print_unknown_data(ndo
, obj_tptr
+ 2, "\n\t\t", *(obj_tptr
+ 1) - 2);
1608 obj_tlen
-=*(obj_tptr
+1);
1609 obj_tptr
+=*(obj_tptr
+1);
1617 case RSVP_OBJ_MESSAGE_ID
: /* fall through */
1618 case RSVP_OBJ_MESSAGE_ID_ACK
: /* fall through */
1619 case RSVP_OBJ_MESSAGE_ID_LIST
:
1620 switch(rsvp_obj_ctype
) {
1625 ND_PRINT((ndo
, "%s Flags [0x%02x], epoch: %u",
1628 EXTRACT_24BITS(obj_tptr
+ 1)));
1631 /* loop through as long there are no messages left */
1632 while(obj_tlen
>= 4) {
1633 ND_PRINT((ndo
, "%s Message-ID 0x%08x (%u)",
1635 EXTRACT_32BITS(obj_tptr
),
1636 EXTRACT_32BITS(obj_tptr
)));
1646 case RSVP_OBJ_INTEGRITY
:
1647 switch(rsvp_obj_ctype
) {
1649 if (obj_tlen
< sizeof(struct rsvp_obj_integrity_t
))
1651 obj_ptr
.rsvp_obj_integrity
= (const struct rsvp_obj_integrity_t
*)obj_tptr
;
1652 ND_PRINT((ndo
, "%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
1654 EXTRACT_16BITS(obj_ptr
.rsvp_obj_integrity
->key_id
),
1655 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->key_id
+2),
1656 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->sequence
),
1657 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->sequence
+4),
1658 bittok2str(rsvp_obj_integrity_flag_values
,
1660 obj_ptr
.rsvp_obj_integrity
->flags
)));
1661 ND_PRINT((ndo
, "%s MD5-sum 0x%08x%08x%08x%08x ",
1663 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
),
1664 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+4),
1665 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+8),
1666 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+ 12)));
1668 #ifdef HAVE_LIBCRYPTO
1669 sigcheck
= signature_verify(pptr
, plen
, (unsigned char *)obj_ptr
.\
1670 rsvp_obj_integrity
->digest
);
1672 sigcheck
= CANT_CHECK_SIGNATURE
;
1674 ND_PRINT((ndo
, " (%s)", tok2str(signature_check_values
, "Unknown", sigcheck
)));
1676 obj_tlen
+=sizeof(struct rsvp_obj_integrity_t
);
1677 obj_tptr
+=sizeof(struct rsvp_obj_integrity_t
);
1684 case RSVP_OBJ_ADMIN_STATUS
:
1685 switch(rsvp_obj_ctype
) {
1689 ND_PRINT((ndo
, "%s Flags [%s]", ident
,
1690 bittok2str(rsvp_obj_admin_status_flag_values
, "none",
1691 EXTRACT_32BITS(obj_tptr
))));
1700 case RSVP_OBJ_LABEL_SET
:
1701 switch(rsvp_obj_ctype
) {
1705 action
= (EXTRACT_16BITS(obj_tptr
)>>8);
1707 ND_PRINT((ndo
, "%s Action: %s (%u), Label type: %u", ident
,
1708 tok2str(rsvp_obj_label_set_action_values
, "Unknown", action
),
1709 action
, ((EXTRACT_32BITS(obj_tptr
) & 0x7F))));
1712 case LABEL_SET_INCLUSIVE_RANGE
:
1713 case LABEL_SET_EXCLUSIVE_RANGE
: /* fall through */
1715 /* only a couple of subchannels are expected */
1718 ND_PRINT((ndo
, "%s Start range: %u, End range: %u", ident
,
1719 EXTRACT_32BITS(obj_tptr
+4),
1720 EXTRACT_32BITS(obj_tptr
+ 8)));
1729 while(obj_tlen
>= 4 ) {
1730 ND_PRINT((ndo
, "%s Subchannel #%u: %u", ident
, subchannel
,
1731 EXTRACT_32BITS(obj_tptr
)));
1744 switch (rsvp_obj_ctype
) {
1745 case RSVP_CTYPE_IPV4
:
1748 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1749 ident
, ipaddr_string(obj_tptr
)));
1755 case RSVP_CTYPE_IPV6
:
1758 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1759 ident
, ip6addr_string(obj_tptr
)));
1770 * FIXME those are the defined objects that lack a decoder
1771 * you are welcome to contribute code ;-)
1774 case RSVP_OBJ_SCOPE
:
1775 case RSVP_OBJ_POLICY_DATA
:
1776 case RSVP_OBJ_ACCEPT_LABEL_SET
:
1777 case RSVP_OBJ_PROTECTION
:
1779 if (ndo
->ndo_vflag
<= 1)
1780 print_unknown_data(ndo
, obj_tptr
, "\n\t ", obj_tlen
); /* FIXME indentation */
1783 /* do we also want to see a hex dump ? */
1784 if (ndo
->ndo_vflag
> 1 || hexdump
== TRUE
)
1785 print_unknown_data(ndo
, tptr
+ sizeof(struct rsvp_object_header
), "\n\t ", /* FIXME indentation */
1786 rsvp_obj_len
- sizeof(struct rsvp_object_header
));
1793 ND_PRINT((ndo
, "\n\t\t packet exceeded snapshot"));
1798 rsvp_print(netdissect_options
*ndo
,
1799 register const u_char
*pptr
, register u_int len
) {
1801 struct rsvp_common_header
*rsvp_com_header
;
1802 const u_char
*tptr
,*subtptr
;
1803 u_short plen
, tlen
, subtlen
;
1807 rsvp_com_header
= (struct rsvp_common_header
*)pptr
;
1808 ND_TCHECK(*rsvp_com_header
);
1811 * Sanity checking of the header.
1813 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1814 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1815 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1819 /* in non-verbose mode just lets print the basic Message Type*/
1820 if (ndo
->ndo_vflag
< 1) {
1821 ND_PRINT((ndo
, "RSVPv%u %s Message, length: %u",
1822 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1823 tok2str(rsvp_msg_type_values
, "unknown (%u)",rsvp_com_header
->msg_type
),
1828 /* ok they seem to want to know everything - lets fully decode it */
1830 plen
= tlen
= EXTRACT_16BITS(rsvp_com_header
->length
);
1832 ND_PRINT((ndo
, "\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1833 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1834 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1835 rsvp_com_header
->msg_type
,
1836 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1838 rsvp_com_header
->ttl
,
1839 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1842 * Clear checksum prior to signature verification.
1844 rsvp_com_header
->checksum
[0] = 0;
1845 rsvp_com_header
->checksum
[1] = 0;
1847 if (tlen
< sizeof(const struct rsvp_common_header
)) {
1848 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", tlen
,
1849 (unsigned long)sizeof(const struct rsvp_common_header
)));
1853 tptr
+=sizeof(const struct rsvp_common_header
);
1854 tlen
-=sizeof(const struct rsvp_common_header
);
1856 switch(rsvp_com_header
->msg_type
) {
1858 case RSVP_MSGTYPE_AGGREGATE
:
1861 rsvp_com_header
= (struct rsvp_common_header
*)subtptr
;
1862 ND_TCHECK(*rsvp_com_header
);
1865 * Sanity checking of the header.
1867 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1868 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1869 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1872 subtlen
=EXTRACT_16BITS(rsvp_com_header
->length
);
1874 ND_PRINT((ndo
, "\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1875 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1876 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1877 rsvp_com_header
->msg_type
,
1878 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1880 rsvp_com_header
->ttl
,
1881 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1884 * Clear checksum prior to signature verification.
1886 rsvp_com_header
->checksum
[0] = 0;
1887 rsvp_com_header
->checksum
[1] = 0;
1889 if (subtlen
< sizeof(const struct rsvp_common_header
)) {
1890 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", subtlen
,
1891 (unsigned long)sizeof(const struct rsvp_common_header
)));
1895 if (tlen
< subtlen
) {
1896 ND_PRINT((ndo
, "ERROR: common header too large %u > %u", subtlen
,
1901 subtptr
+=sizeof(const struct rsvp_common_header
);
1902 subtlen
-=sizeof(const struct rsvp_common_header
);
1904 if (rsvp_obj_print(ndo
, pptr
, plen
, subtptr
, "\n\t ", subtlen
) == -1)
1907 tptr
+=subtlen
+sizeof(const struct rsvp_common_header
);
1908 tlen
-=subtlen
+sizeof(const struct rsvp_common_header
);
1913 case RSVP_MSGTYPE_PATH
:
1914 case RSVP_MSGTYPE_RESV
:
1915 case RSVP_MSGTYPE_PATHERR
:
1916 case RSVP_MSGTYPE_RESVERR
:
1917 case RSVP_MSGTYPE_PATHTEAR
:
1918 case RSVP_MSGTYPE_RESVTEAR
:
1919 case RSVP_MSGTYPE_RESVCONF
:
1920 case RSVP_MSGTYPE_HELLO_OLD
:
1921 case RSVP_MSGTYPE_HELLO
:
1922 case RSVP_MSGTYPE_ACK
:
1923 case RSVP_MSGTYPE_SREFRESH
:
1924 if (rsvp_obj_print(ndo
, pptr
, plen
, tptr
, "\n\t ", tlen
) == -1)
1929 print_unknown_data(ndo
, tptr
, "\n\t ", tlen
);
1935 ND_PRINT((ndo
, "\n\t\t packet exceeded snapshot"));