2 * Copyright (c) 1998-2007 The TCPDUMP project
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that: (1) source code
6 * distributions retain the above copyright notice and this paragraph
7 * in its entirety, and (2) distributions including binary code include
8 * the above copyright notice and this paragraph in its entirety in
9 * the documentation or other materials provided with the distribution.
10 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
11 * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
12 * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
13 * FOR A PARTICULAR PURPOSE.
15 * Original code by Hannes Gredler (hannes@juniper.net)
22 #include <netdissect-stdinc.h>
24 #include "netdissect.h"
26 #include "addrtoname.h"
27 #include "ethertype.h"
30 #include "signature.h"
32 static const char tstr
[] = " [|rsvp]";
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_BUNDLE 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_BUNDLE
, "Bundle" },
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 ND_TCHECK2(*(tptr
+ 2), 2);
503 parameter_length
= EXTRACT_16BITS(tptr
+2)<<2; /* convert wordcount to bytecount */
505 ND_PRINT((ndo
, "\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
506 tok2str(rsvp_intserv_parameter_id_values
,"unknown",parameter_id
),
511 if (obj_tlen
< parameter_length
+4)
513 switch(parameter_id
) { /* parameter_id */
517 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
518 * | 4 (e) | (f) | 1 (g) |
519 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
520 * | IS hop cnt (32-bit unsigned integer) |
521 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
523 if (parameter_length
== 4)
524 ND_TCHECK2(*(tptr
+ 4), 4);
525 ND_PRINT((ndo
, "\n\t\tIS hop count: %u", EXTRACT_32BITS(tptr
+ 4)));
530 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
531 * | 6 (h) | (i) | 1 (j) |
532 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
533 * | Path b/w estimate (32-bit IEEE floating point number) |
534 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
536 if (parameter_length
== 4) {
537 ND_TCHECK2(*(tptr
+ 4), 4);
538 bw
.i
= EXTRACT_32BITS(tptr
+4);
539 ND_PRINT((ndo
, "\n\t\tPath b/w estimate: %.10g Mbps", bw
.f
/ 125000));
545 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
546 * | 8 (k) | (l) | 1 (m) |
547 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
548 * | Minimum path latency (32-bit integer) |
549 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
551 if (parameter_length
== 4) {
552 ND_TCHECK2(*(tptr
+ 4), 4);
553 ND_PRINT((ndo
, "\n\t\tMinimum path latency: "));
554 if (EXTRACT_32BITS(tptr
+4) == 0xffffffff)
555 ND_PRINT((ndo
, "don't care"));
557 ND_PRINT((ndo
, "%u", EXTRACT_32BITS(tptr
+ 4)));
564 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
565 * | 10 (n) | (o) | 1 (p) |
566 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
567 * | Composed MTU (32-bit unsigned integer) |
568 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
570 if (parameter_length
== 4)
571 ND_TCHECK2(*(tptr
+ 4), 4);
572 ND_PRINT((ndo
, "\n\t\tComposed MTU: %u bytes", EXTRACT_32BITS(tptr
+ 4)));
576 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
577 * | 127 (e) | 0 (f) | 5 (g) |
578 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
579 * | Token Bucket Rate [r] (32-bit IEEE floating point number) |
580 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
581 * | Token Bucket Size [b] (32-bit IEEE floating point number) |
582 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
583 * | Peak Data Rate [p] (32-bit IEEE floating point number) |
584 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
585 * | Minimum Policed Unit [m] (32-bit integer) |
586 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
587 * | Maximum Packet Size [M] (32-bit integer) |
588 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
591 if (parameter_length
== 20) {
592 ND_TCHECK2(*(tptr
+ 4), 20);
593 bw
.i
= EXTRACT_32BITS(tptr
+4);
594 ND_PRINT((ndo
, "\n\t\tToken Bucket Rate: %.10g Mbps", bw
.f
/ 125000));
595 bw
.i
= EXTRACT_32BITS(tptr
+8);
596 ND_PRINT((ndo
, "\n\t\tToken Bucket Size: %.10g bytes", bw
.f
));
597 bw
.i
= EXTRACT_32BITS(tptr
+12);
598 ND_PRINT((ndo
, "\n\t\tPeak Data Rate: %.10g Mbps", bw
.f
/ 125000));
599 ND_PRINT((ndo
, "\n\t\tMinimum Policed Unit: %u bytes", EXTRACT_32BITS(tptr
+ 16)));
600 ND_PRINT((ndo
, "\n\t\tMaximum Packet Size: %u bytes", EXTRACT_32BITS(tptr
+ 20)));
606 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
607 * | 130 (h) | 0 (i) | 2 (j) |
608 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
609 * | Rate [R] (32-bit IEEE floating point number) |
610 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
611 * | Slack Term [S] (32-bit integer) |
612 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
615 if (parameter_length
== 8) {
616 ND_TCHECK2(*(tptr
+ 4), 8);
617 bw
.i
= EXTRACT_32BITS(tptr
+4);
618 ND_PRINT((ndo
, "\n\t\tRate: %.10g Mbps", bw
.f
/ 125000));
619 ND_PRINT((ndo
, "\n\t\tSlack Term: %u", EXTRACT_32BITS(tptr
+ 8)));
627 if (parameter_length
== 4)
628 ND_TCHECK2(*(tptr
+ 4), 4);
629 ND_PRINT((ndo
, "\n\t\tValue: %u", EXTRACT_32BITS(tptr
+ 4)));
633 if (ndo
->ndo_vflag
<= 1)
634 print_unknown_data(ndo
, tptr
+ 4, "\n\t\t", parameter_length
);
636 return (parameter_length
+4); /* header length 4 bytes */
639 ND_PRINT((ndo
, "%s", tstr
));
644 * Clear checksum prior to signature verification.
647 rsvp_clear_checksum(void *header
)
649 struct rsvp_common_header
*rsvp_com_header
= (struct rsvp_common_header
*) header
;
651 rsvp_com_header
->checksum
[0] = 0;
652 rsvp_com_header
->checksum
[1] = 0;
656 rsvp_obj_print(netdissect_options
*ndo
,
657 const u_char
*pptr
, u_int plen
, const u_char
*tptr
,
658 const char *ident
, u_int tlen
,
659 const struct rsvp_common_header
*rsvp_com_header
)
661 const struct rsvp_object_header
*rsvp_obj_header
;
662 const u_char
*obj_tptr
;
664 const struct rsvp_obj_integrity_t
*rsvp_obj_integrity
;
665 const struct rsvp_obj_frr_t
*rsvp_obj_frr
;
668 u_short rsvp_obj_len
,rsvp_obj_ctype
,obj_tlen
,intserv_serv_tlen
;
669 int hexdump
,processed
,padbytes
,error_code
,error_value
,i
,sigcheck
;
676 u_int action
, subchannel
;
678 while(tlen
>=sizeof(struct rsvp_object_header
)) {
679 /* did we capture enough for fully decoding the object header ? */
680 ND_TCHECK2(*tptr
, sizeof(struct rsvp_object_header
));
682 rsvp_obj_header
= (const struct rsvp_object_header
*)tptr
;
683 rsvp_obj_len
=EXTRACT_16BITS(rsvp_obj_header
->length
);
684 rsvp_obj_ctype
=rsvp_obj_header
->ctype
;
686 if(rsvp_obj_len
% 4) {
687 ND_PRINT((ndo
, "%sERROR: object header size %u not a multiple of 4", ident
, rsvp_obj_len
));
690 if(rsvp_obj_len
< sizeof(struct rsvp_object_header
)) {
691 ND_PRINT((ndo
, "%sERROR: object header too short %u < %lu", ident
, rsvp_obj_len
,
692 (unsigned long)sizeof(const struct rsvp_object_header
)));
696 ND_PRINT((ndo
, "%s%s Object (%u) Flags: [%s",
698 tok2str(rsvp_obj_values
,
700 rsvp_obj_header
->class_num
),
701 rsvp_obj_header
->class_num
,
702 ((rsvp_obj_header
->class_num
) & 0x80) ? "ignore" : "reject"));
704 if (rsvp_obj_header
->class_num
> 128)
705 ND_PRINT((ndo
, " %s",
706 ((rsvp_obj_header
->class_num
) & 0x40) ? "and forward" : "silently"));
708 ND_PRINT((ndo
, " if unknown], Class-Type: %s (%u), length: %u",
709 tok2str(rsvp_ctype_values
,
711 ((rsvp_obj_header
->class_num
)<<8)+rsvp_obj_ctype
),
715 if(tlen
< rsvp_obj_len
) {
716 ND_PRINT((ndo
, "%sERROR: object goes past end of objects TLV", ident
));
720 obj_tptr
=tptr
+sizeof(struct rsvp_object_header
);
721 obj_tlen
=rsvp_obj_len
-sizeof(struct rsvp_object_header
);
723 /* did we capture enough for fully decoding the object ? */
724 if (!ND_TTEST2(*tptr
, rsvp_obj_len
))
728 switch(rsvp_obj_header
->class_num
) {
729 case RSVP_OBJ_SESSION
:
730 switch(rsvp_obj_ctype
) {
731 case RSVP_CTYPE_IPV4
:
734 ND_PRINT((ndo
, "%s IPv4 DestAddress: %s, Protocol ID: 0x%02x",
736 ipaddr_string(ndo
, obj_tptr
),
737 *(obj_tptr
+ sizeof(struct in_addr
))));
738 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
741 EXTRACT_16BITS(obj_tptr
+ 6)));
745 case RSVP_CTYPE_IPV6
:
748 ND_PRINT((ndo
, "%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
750 ip6addr_string(ndo
, obj_tptr
),
751 *(obj_tptr
+ sizeof(struct in6_addr
))));
752 ND_PRINT((ndo
, "%s Flags: [0x%02x], DestPort %u",
754 *(obj_tptr
+sizeof(struct in6_addr
)+1),
755 EXTRACT_16BITS(obj_tptr
+ sizeof(struct in6_addr
) + 2)));
760 case RSVP_CTYPE_TUNNEL_IPV6
:
763 ND_PRINT((ndo
, "%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
765 ip6addr_string(ndo
, obj_tptr
),
766 EXTRACT_16BITS(obj_tptr
+18),
767 ip6addr_string(ndo
, obj_tptr
+ 20)));
772 case RSVP_CTYPE_14
: /* IPv6 p2mp LSP Tunnel */
775 ND_PRINT((ndo
, "%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
777 EXTRACT_32BITS(obj_tptr
),
778 EXTRACT_16BITS(obj_tptr
+6),
779 ip6addr_string(ndo
, obj_tptr
+ 8)));
783 case RSVP_CTYPE_13
: /* IPv4 p2mp LSP Tunnel */
786 ND_PRINT((ndo
, "%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
788 ipaddr_string(ndo
, obj_tptr
),
789 EXTRACT_16BITS(obj_tptr
+6),
790 ipaddr_string(ndo
, obj_tptr
+ 8)));
794 case RSVP_CTYPE_TUNNEL_IPV4
:
795 case RSVP_CTYPE_UNI_IPV4
:
798 ND_PRINT((ndo
, "%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
800 ipaddr_string(ndo
, obj_tptr
),
801 EXTRACT_16BITS(obj_tptr
+6),
802 ipaddr_string(ndo
, obj_tptr
+ 8)));
811 case RSVP_OBJ_CONFIRM
:
812 switch(rsvp_obj_ctype
) {
813 case RSVP_CTYPE_IPV4
:
814 if (obj_tlen
< sizeof(struct in_addr
))
816 ND_PRINT((ndo
, "%s IPv4 Receiver Address: %s",
818 ipaddr_string(ndo
, obj_tptr
)));
819 obj_tlen
-=sizeof(struct in_addr
);
820 obj_tptr
+=sizeof(struct in_addr
);
822 case RSVP_CTYPE_IPV6
:
823 if (obj_tlen
< sizeof(struct in6_addr
))
825 ND_PRINT((ndo
, "%s IPv6 Receiver Address: %s",
827 ip6addr_string(ndo
, obj_tptr
)));
828 obj_tlen
-=sizeof(struct in6_addr
);
829 obj_tptr
+=sizeof(struct in6_addr
);
836 case RSVP_OBJ_NOTIFY_REQ
:
837 switch(rsvp_obj_ctype
) {
838 case RSVP_CTYPE_IPV4
:
839 if (obj_tlen
< sizeof(struct in_addr
))
841 ND_PRINT((ndo
, "%s IPv4 Notify Node Address: %s",
843 ipaddr_string(ndo
, obj_tptr
)));
844 obj_tlen
-=sizeof(struct in_addr
);
845 obj_tptr
+=sizeof(struct in_addr
);
847 case RSVP_CTYPE_IPV6
:
848 if (obj_tlen
< sizeof(struct in6_addr
))
850 ND_PRINT((ndo
, "%s IPv6 Notify Node Address: %s",
852 ip6addr_string(ndo
, obj_tptr
)));
853 obj_tlen
-=sizeof(struct in6_addr
);
854 obj_tptr
+=sizeof(struct in6_addr
);
861 case RSVP_OBJ_SUGGESTED_LABEL
: /* fall through */
862 case RSVP_OBJ_UPSTREAM_LABEL
: /* fall through */
863 case RSVP_OBJ_RECOVERY_LABEL
: /* fall through */
865 switch(rsvp_obj_ctype
) {
867 while(obj_tlen
>= 4 ) {
868 ND_PRINT((ndo
, "%s Label: %u", ident
, EXTRACT_32BITS(obj_tptr
)));
876 ND_PRINT((ndo
, "%s Generalized Label: %u",
878 EXTRACT_32BITS(obj_tptr
)));
885 ND_PRINT((ndo
, "%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
887 EXTRACT_32BITS(obj_tptr
),
889 EXTRACT_32BITS(obj_tptr
+4),
890 EXTRACT_32BITS(obj_tptr
+ 8)));
900 switch(rsvp_obj_ctype
) {
904 ND_PRINT((ndo
, "%s Reservation Style: %s, Flags: [0x%02x]",
906 tok2str(rsvp_resstyle_values
,
908 EXTRACT_24BITS(obj_tptr
+1)),
918 case RSVP_OBJ_SENDER_TEMPLATE
:
919 switch(rsvp_obj_ctype
) {
920 case RSVP_CTYPE_IPV4
:
923 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
925 ipaddr_string(ndo
, obj_tptr
),
926 EXTRACT_16BITS(obj_tptr
+ 6)));
930 case RSVP_CTYPE_IPV6
:
933 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
935 ip6addr_string(ndo
, obj_tptr
),
936 EXTRACT_16BITS(obj_tptr
+ 18)));
940 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
943 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
944 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
946 ip6addr_string(ndo
, obj_tptr
),
947 EXTRACT_16BITS(obj_tptr
+18),
949 ip6addr_string(ndo
, obj_tptr
+20),
950 EXTRACT_16BITS(obj_tptr
+ 38)));
954 case RSVP_CTYPE_TUNNEL_IPV4
:
957 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
959 ipaddr_string(ndo
, obj_tptr
),
960 EXTRACT_16BITS(obj_tptr
+ 6)));
964 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
967 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
968 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
970 ipaddr_string(ndo
, obj_tptr
),
971 EXTRACT_16BITS(obj_tptr
+6),
973 ipaddr_string(ndo
, obj_tptr
+8),
974 EXTRACT_16BITS(obj_tptr
+ 12)));
983 case RSVP_OBJ_LABEL_REQ
:
984 switch(rsvp_obj_ctype
) {
986 while(obj_tlen
>= 4 ) {
987 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
989 tok2str(ethertype_values
,
990 "Unknown Protocol (0x%04x)",
991 EXTRACT_16BITS(obj_tptr
+ 2))));
999 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
1001 tok2str(ethertype_values
,
1002 "Unknown Protocol (0x%04x)",
1003 EXTRACT_16BITS(obj_tptr
+ 2))));
1004 ND_PRINT((ndo
, ",%s merge capability",((*(obj_tptr
+ 4)) & 0x80) ? "no" : "" ));
1005 ND_PRINT((ndo
, "%s Minimum VPI/VCI: %u/%u",
1007 (EXTRACT_16BITS(obj_tptr
+4))&0xfff,
1008 (EXTRACT_16BITS(obj_tptr
+ 6)) & 0xfff));
1009 ND_PRINT((ndo
, "%s Maximum VPI/VCI: %u/%u",
1011 (EXTRACT_16BITS(obj_tptr
+8))&0xfff,
1012 (EXTRACT_16BITS(obj_tptr
+ 10)) & 0xfff));
1019 ND_PRINT((ndo
, "%s L3 Protocol ID: %s",
1021 tok2str(ethertype_values
,
1022 "Unknown Protocol (0x%04x)",
1023 EXTRACT_16BITS(obj_tptr
+ 2))));
1024 ND_PRINT((ndo
, "%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1026 (EXTRACT_32BITS(obj_tptr
+4))&0x7fffff,
1027 (EXTRACT_32BITS(obj_tptr
+8))&0x7fffff,
1028 (((EXTRACT_16BITS(obj_tptr
+4)>>7)&3) == 0 ) ? "10" : "",
1029 (((EXTRACT_16BITS(obj_tptr
+ 4) >> 7) & 3) == 2 ) ? "23" : ""));
1036 ND_PRINT((ndo
, "%s LSP Encoding Type: %s (%u)",
1038 tok2str(gmpls_encoding_values
,
1042 ND_PRINT((ndo
, "%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1044 tok2str(gmpls_switch_cap_values
,
1048 tok2str(gmpls_payload_values
,
1050 EXTRACT_16BITS(obj_tptr
+2)),
1051 EXTRACT_16BITS(obj_tptr
+ 2)));
1062 switch(rsvp_obj_ctype
) {
1063 case RSVP_CTYPE_IPV4
:
1064 while(obj_tlen
>= 4 ) {
1065 ND_PRINT((ndo
, "%s Subobject Type: %s, length %u",
1067 tok2str(rsvp_obj_xro_values
,
1069 RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)),
1072 if (*(obj_tptr
+1) == 0) { /* prevent infinite loops */
1073 ND_PRINT((ndo
, "%s ERROR: zero length ERO subtype", ident
));
1077 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr
)) {
1078 case RSVP_OBJ_XRO_IPV4
:
1079 ND_PRINT((ndo
, ", %s, %s/%u, Flags: [%s]",
1080 RSVP_OBJ_XRO_MASK_LOOSE(*obj_tptr
) ? "Loose" : "Strict",
1081 ipaddr_string(ndo
, obj_tptr
+2),
1083 bittok2str(rsvp_obj_rro_flag_values
,
1085 *(obj_tptr
+ 7)))); /* rfc3209 says that this field is rsvd. */
1087 case RSVP_OBJ_XRO_LABEL
:
1088 ND_PRINT((ndo
, ", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1089 bittok2str(rsvp_obj_rro_label_flag_values
,
1093 tok2str(rsvp_ctype_values
,
1095 *(obj_tptr
+3) + 256*RSVP_OBJ_RRO
),
1097 EXTRACT_32BITS(obj_tptr
+ 4)));
1099 obj_tlen
-=*(obj_tptr
+1);
1100 obj_tptr
+=*(obj_tptr
+1);
1108 case RSVP_OBJ_HELLO
:
1109 switch(rsvp_obj_ctype
) {
1114 ND_PRINT((ndo
, "%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1116 EXTRACT_32BITS(obj_tptr
),
1117 EXTRACT_32BITS(obj_tptr
+ 4)));
1126 case RSVP_OBJ_RESTART_CAPABILITY
:
1127 switch(rsvp_obj_ctype
) {
1131 ND_PRINT((ndo
, "%s Restart Time: %ums, Recovery Time: %ums",
1133 EXTRACT_32BITS(obj_tptr
),
1134 EXTRACT_32BITS(obj_tptr
+ 4)));
1143 case RSVP_OBJ_SESSION_ATTRIBUTE
:
1144 switch(rsvp_obj_ctype
) {
1145 case RSVP_CTYPE_TUNNEL_IPV4
:
1148 namelen
= *(obj_tptr
+3);
1149 if (obj_tlen
< 4+namelen
)
1151 ND_PRINT((ndo
, "%s Session Name: ", ident
));
1152 for (i
= 0; i
< namelen
; i
++)
1153 safeputchar(ndo
, *(obj_tptr
+ 4 + i
));
1154 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1158 bittok2str(rsvp_session_attribute_flag_values
,
1162 obj_tlen
-=4+*(obj_tptr
+3);
1163 obj_tptr
+=4+*(obj_tptr
+3);
1170 case RSVP_OBJ_GENERALIZED_UNI
:
1171 switch(rsvp_obj_ctype
) {
1172 int subobj_type
,af
,subobj_len
,total_subobj_len
;
1179 /* read variable length subobjects */
1180 total_subobj_len
= obj_tlen
;
1181 while(total_subobj_len
> 0) {
1182 subobj_len
= EXTRACT_16BITS(obj_tptr
);
1183 subobj_type
= (EXTRACT_16BITS(obj_tptr
+2))>>8;
1184 af
= (EXTRACT_16BITS(obj_tptr
+2))&0x00FF;
1186 ND_PRINT((ndo
, "%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1188 tok2str(rsvp_obj_generalized_uni_values
, "Unknown", subobj_type
),
1190 tok2str(af_values
, "Unknown", af
), af
,
1196 switch(subobj_type
) {
1197 case RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS
:
1198 case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS
:
1204 ND_PRINT((ndo
, "%s UNI IPv4 TNA address: %s",
1205 ident
, ipaddr_string(ndo
, obj_tptr
+ 4)));
1208 if (subobj_len
< 20)
1210 ND_PRINT((ndo
, "%s UNI IPv6 TNA address: %s",
1211 ident
, ip6addr_string(ndo
, obj_tptr
+ 4)));
1215 /* unless we have a TLV parser lets just hexdump */
1222 case RSVP_GEN_UNI_SUBOBJ_DIVERSITY
:
1224 /* unless we have a TLV parser lets just hexdump */
1229 case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL
:
1230 if (subobj_len
< 16) {
1234 ND_PRINT((ndo
, "%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
1236 ((EXTRACT_32BITS(obj_tptr
+4))>>31),
1237 ((EXTRACT_32BITS(obj_tptr
+4))&0xFF),
1238 EXTRACT_32BITS(obj_tptr
+8),
1239 EXTRACT_32BITS(obj_tptr
+ 12)));
1242 case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL
:
1243 if (subobj_len
< 8) {
1247 ND_PRINT((ndo
, "%s Service level: %u",
1248 ident
, (EXTRACT_32BITS(obj_tptr
+ 4)) >> 24));
1255 total_subobj_len
-=subobj_len
;
1256 obj_tptr
+=subobj_len
;
1257 obj_tlen
+=subobj_len
;
1260 if (total_subobj_len
) {
1261 /* unless we have a TLV parser lets just hexdump */
1271 case RSVP_OBJ_RSVP_HOP
:
1272 switch(rsvp_obj_ctype
) {
1273 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1274 case RSVP_CTYPE_IPV4
:
1277 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1279 ipaddr_string(ndo
, obj_tptr
),
1280 EXTRACT_32BITS(obj_tptr
+ 4)));
1284 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1286 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1287 case RSVP_CTYPE_IPV6
:
1290 ND_PRINT((ndo
, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1292 ip6addr_string(ndo
, obj_tptr
),
1293 EXTRACT_32BITS(obj_tptr
+ 16)));
1296 hexdump
=TRUE
; /* unless we have a TLV parser lets just hexdump */
1303 case RSVP_OBJ_TIME_VALUES
:
1304 switch(rsvp_obj_ctype
) {
1308 ND_PRINT((ndo
, "%s Refresh Period: %ums",
1310 EXTRACT_32BITS(obj_tptr
)));
1319 /* those three objects do share the same semantics */
1320 case RSVP_OBJ_SENDER_TSPEC
:
1321 case RSVP_OBJ_ADSPEC
:
1322 case RSVP_OBJ_FLOWSPEC
:
1323 switch(rsvp_obj_ctype
) {
1327 ND_PRINT((ndo
, "%s Msg-Version: %u, length: %u",
1329 (*obj_tptr
& 0xf0) >> 4,
1330 EXTRACT_16BITS(obj_tptr
+ 2) << 2));
1331 obj_tptr
+=4; /* get to the start of the service header */
1334 while (obj_tlen
>= 4) {
1335 intserv_serv_tlen
=EXTRACT_16BITS(obj_tptr
+2)<<2;
1336 ND_PRINT((ndo
, "%s Service Type: %s (%u), break bit %s set, Service length: %u",
1338 tok2str(rsvp_intserv_service_type_values
,"unknown",*(obj_tptr
)),
1340 (*(obj_tptr
+1)&0x80) ? "" : "not",
1341 intserv_serv_tlen
));
1343 obj_tptr
+=4; /* get to the start of the parameter list */
1346 while (intserv_serv_tlen
>=4) {
1347 processed
= rsvp_intserv_print(ndo
, obj_tptr
, obj_tlen
);
1350 obj_tlen
-=processed
;
1351 intserv_serv_tlen
-=processed
;
1352 obj_tptr
+=processed
;
1361 case RSVP_OBJ_FILTERSPEC
:
1362 switch(rsvp_obj_ctype
) {
1363 case RSVP_CTYPE_IPV4
:
1366 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1368 ipaddr_string(ndo
, obj_tptr
),
1369 EXTRACT_16BITS(obj_tptr
+ 6)));
1373 case RSVP_CTYPE_IPV6
:
1376 ND_PRINT((ndo
, "%s Source Address: %s, Source Port: %u",
1378 ip6addr_string(ndo
, obj_tptr
),
1379 EXTRACT_16BITS(obj_tptr
+ 18)));
1386 ND_PRINT((ndo
, "%s Source Address: %s, Flow Label: %u",
1388 ip6addr_string(ndo
, obj_tptr
),
1389 EXTRACT_24BITS(obj_tptr
+ 17)));
1393 case RSVP_CTYPE_TUNNEL_IPV6
:
1396 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1398 ipaddr_string(ndo
, obj_tptr
),
1399 EXTRACT_16BITS(obj_tptr
+ 18)));
1403 case RSVP_CTYPE_13
: /* IPv6 p2mp LSP tunnel */
1406 ND_PRINT((ndo
, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1407 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1409 ip6addr_string(ndo
, obj_tptr
),
1410 EXTRACT_16BITS(obj_tptr
+18),
1412 ip6addr_string(ndo
, obj_tptr
+20),
1413 EXTRACT_16BITS(obj_tptr
+ 38)));
1417 case RSVP_CTYPE_TUNNEL_IPV4
:
1420 ND_PRINT((ndo
, "%s Source Address: %s, LSP-ID: 0x%04x",
1422 ipaddr_string(ndo
, obj_tptr
),
1423 EXTRACT_16BITS(obj_tptr
+ 6)));
1427 case RSVP_CTYPE_12
: /* IPv4 p2mp LSP tunnel */
1430 ND_PRINT((ndo
, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1431 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1433 ipaddr_string(ndo
, obj_tptr
),
1434 EXTRACT_16BITS(obj_tptr
+6),
1436 ipaddr_string(ndo
, obj_tptr
+8),
1437 EXTRACT_16BITS(obj_tptr
+ 12)));
1446 case RSVP_OBJ_FASTREROUTE
:
1447 /* the differences between c-type 1 and 7 are minor */
1448 obj_ptr
.rsvp_obj_frr
= (const struct rsvp_obj_frr_t
*)obj_tptr
;
1449 bw
.i
= EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->bandwidth
);
1451 switch(rsvp_obj_ctype
) {
1452 case RSVP_CTYPE_1
: /* new style */
1453 if (obj_tlen
< sizeof(struct rsvp_obj_frr_t
))
1455 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1457 (int)obj_ptr
.rsvp_obj_frr
->setup_prio
,
1458 (int)obj_ptr
.rsvp_obj_frr
->hold_prio
,
1459 (int)obj_ptr
.rsvp_obj_frr
->hop_limit
,
1460 bw
.f
* 8 / 1000000));
1461 ND_PRINT((ndo
, "%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
1463 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_any
),
1464 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->exclude_any
),
1465 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_all
)));
1466 obj_tlen
-=sizeof(struct rsvp_obj_frr_t
);
1467 obj_tptr
+=sizeof(struct rsvp_obj_frr_t
);
1470 case RSVP_CTYPE_TUNNEL_IPV4
: /* old style */
1473 ND_PRINT((ndo
, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1475 (int)obj_ptr
.rsvp_obj_frr
->setup_prio
,
1476 (int)obj_ptr
.rsvp_obj_frr
->hold_prio
,
1477 (int)obj_ptr
.rsvp_obj_frr
->hop_limit
,
1478 bw
.f
* 8 / 1000000));
1479 ND_PRINT((ndo
, "%s Include Colors: 0x%08x, Exclude Colors: 0x%08x",
1481 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->include_any
),
1482 EXTRACT_32BITS(obj_ptr
.rsvp_obj_frr
->exclude_any
)));
1492 case RSVP_OBJ_DETOUR
:
1493 switch(rsvp_obj_ctype
) {
1494 case RSVP_CTYPE_TUNNEL_IPV4
:
1495 while(obj_tlen
>= 8) {
1496 ND_PRINT((ndo
, "%s PLR-ID: %s, Avoid-Node-ID: %s",
1498 ipaddr_string(ndo
, obj_tptr
),
1499 ipaddr_string(ndo
, obj_tptr
+ 4)));
1509 case RSVP_OBJ_CLASSTYPE
:
1510 case RSVP_OBJ_CLASSTYPE_OLD
: /* fall through */
1511 switch(rsvp_obj_ctype
) {
1513 ND_PRINT((ndo
, "%s CT: %u",
1515 EXTRACT_32BITS(obj_tptr
) & 0x7));
1524 case RSVP_OBJ_ERROR_SPEC
:
1525 switch(rsvp_obj_ctype
) {
1526 case RSVP_CTYPE_3
: /* fall through - FIXME add TLV parser */
1527 case RSVP_CTYPE_IPV4
:
1530 error_code
=*(obj_tptr
+5);
1531 error_value
=EXTRACT_16BITS(obj_tptr
+6);
1532 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1534 ipaddr_string(ndo
, obj_tptr
),
1537 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1539 switch (error_code
) {
1540 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1541 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1542 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1545 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE
: /* fall through */
1546 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD
:
1547 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1548 tok2str(rsvp_obj_error_code_diffserv_te_values
,"unknown",error_value
),
1552 ND_PRINT((ndo
, ", Unknown Error Value (%u)", error_value
));
1558 case RSVP_CTYPE_4
: /* fall through - FIXME add TLV parser */
1559 case RSVP_CTYPE_IPV6
:
1562 error_code
=*(obj_tptr
+17);
1563 error_value
=EXTRACT_16BITS(obj_tptr
+18);
1564 ND_PRINT((ndo
, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1566 ip6addr_string(ndo
, obj_tptr
),
1569 tok2str(rsvp_obj_error_code_values
,"unknown",error_code
),
1572 switch (error_code
) {
1573 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING
:
1574 ND_PRINT((ndo
, ", Error Value: %s (%u)",
1575 tok2str(rsvp_obj_error_code_routing_values
,"unknown",error_value
),
1589 case RSVP_OBJ_PROPERTIES
:
1590 switch(rsvp_obj_ctype
) {
1594 padbytes
= EXTRACT_16BITS(obj_tptr
+2);
1595 ND_PRINT((ndo
, "%s TLV count: %u, padding bytes: %u",
1597 EXTRACT_16BITS(obj_tptr
),
1601 /* loop through as long there is anything longer than the TLV header (2) */
1602 while(obj_tlen
>= 2 + padbytes
) {
1603 ND_PRINT((ndo
, "%s %s TLV (0x%02x), length: %u", /* length includes header */
1605 tok2str(rsvp_obj_prop_tlv_values
,"unknown",*obj_tptr
),
1608 if (obj_tlen
< *(obj_tptr
+1))
1610 if (*(obj_tptr
+1) < 2)
1612 print_unknown_data(ndo
, obj_tptr
+ 2, "\n\t\t", *(obj_tptr
+ 1) - 2);
1613 obj_tlen
-=*(obj_tptr
+1);
1614 obj_tptr
+=*(obj_tptr
+1);
1622 case RSVP_OBJ_MESSAGE_ID
: /* fall through */
1623 case RSVP_OBJ_MESSAGE_ID_ACK
: /* fall through */
1624 case RSVP_OBJ_MESSAGE_ID_LIST
:
1625 switch(rsvp_obj_ctype
) {
1630 ND_PRINT((ndo
, "%s Flags [0x%02x], epoch: %u",
1633 EXTRACT_24BITS(obj_tptr
+ 1)));
1636 /* loop through as long there are no messages left */
1637 while(obj_tlen
>= 4) {
1638 ND_PRINT((ndo
, "%s Message-ID 0x%08x (%u)",
1640 EXTRACT_32BITS(obj_tptr
),
1641 EXTRACT_32BITS(obj_tptr
)));
1651 case RSVP_OBJ_INTEGRITY
:
1652 switch(rsvp_obj_ctype
) {
1654 if (obj_tlen
< sizeof(struct rsvp_obj_integrity_t
))
1656 obj_ptr
.rsvp_obj_integrity
= (const struct rsvp_obj_integrity_t
*)obj_tptr
;
1657 ND_PRINT((ndo
, "%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
1659 EXTRACT_16BITS(obj_ptr
.rsvp_obj_integrity
->key_id
),
1660 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->key_id
+2),
1661 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->sequence
),
1662 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->sequence
+4),
1663 bittok2str(rsvp_obj_integrity_flag_values
,
1665 obj_ptr
.rsvp_obj_integrity
->flags
)));
1666 ND_PRINT((ndo
, "%s MD5-sum 0x%08x%08x%08x%08x ",
1668 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
),
1669 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+4),
1670 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+8),
1671 EXTRACT_32BITS(obj_ptr
.rsvp_obj_integrity
->digest
+ 12)));
1673 sigcheck
= signature_verify(ndo
, pptr
, plen
,
1674 obj_ptr
.rsvp_obj_integrity
->digest
,
1675 rsvp_clear_checksum
,
1677 ND_PRINT((ndo
, " (%s)", tok2str(signature_check_values
, "Unknown", sigcheck
)));
1679 obj_tlen
+=sizeof(struct rsvp_obj_integrity_t
);
1680 obj_tptr
+=sizeof(struct rsvp_obj_integrity_t
);
1687 case RSVP_OBJ_ADMIN_STATUS
:
1688 switch(rsvp_obj_ctype
) {
1692 ND_PRINT((ndo
, "%s Flags [%s]", ident
,
1693 bittok2str(rsvp_obj_admin_status_flag_values
, "none",
1694 EXTRACT_32BITS(obj_tptr
))));
1703 case RSVP_OBJ_LABEL_SET
:
1704 switch(rsvp_obj_ctype
) {
1708 action
= (EXTRACT_16BITS(obj_tptr
)>>8);
1710 ND_PRINT((ndo
, "%s Action: %s (%u), Label type: %u", ident
,
1711 tok2str(rsvp_obj_label_set_action_values
, "Unknown", action
),
1712 action
, ((EXTRACT_32BITS(obj_tptr
) & 0x7F))));
1715 case LABEL_SET_INCLUSIVE_RANGE
:
1716 case LABEL_SET_EXCLUSIVE_RANGE
: /* fall through */
1718 /* only a couple of subchannels are expected */
1721 ND_PRINT((ndo
, "%s Start range: %u, End range: %u", ident
,
1722 EXTRACT_32BITS(obj_tptr
+4),
1723 EXTRACT_32BITS(obj_tptr
+ 8)));
1732 while(obj_tlen
>= 4 ) {
1733 ND_PRINT((ndo
, "%s Subchannel #%u: %u", ident
, subchannel
,
1734 EXTRACT_32BITS(obj_tptr
)));
1747 switch (rsvp_obj_ctype
) {
1748 case RSVP_CTYPE_IPV4
:
1751 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1752 ident
, ipaddr_string(ndo
, obj_tptr
)));
1757 case RSVP_CTYPE_IPV6
:
1760 ND_PRINT((ndo
, "%s Sub-LSP destination address: %s",
1761 ident
, ip6addr_string(ndo
, obj_tptr
)));
1771 * FIXME those are the defined objects that lack a decoder
1772 * you are welcome to contribute code ;-)
1775 case RSVP_OBJ_SCOPE
:
1776 case RSVP_OBJ_POLICY_DATA
:
1777 case RSVP_OBJ_ACCEPT_LABEL_SET
:
1778 case RSVP_OBJ_PROTECTION
:
1780 if (ndo
->ndo_vflag
<= 1)
1781 print_unknown_data(ndo
, obj_tptr
, "\n\t ", obj_tlen
); /* FIXME indentation */
1784 /* do we also want to see a hex dump ? */
1785 if (ndo
->ndo_vflag
> 1 || hexdump
== TRUE
)
1786 print_unknown_data(ndo
, tptr
+ sizeof(struct rsvp_object_header
), "\n\t ", /* FIXME indentation */
1787 rsvp_obj_len
- sizeof(struct rsvp_object_header
));
1794 ND_PRINT((ndo
, "%s", istr
));
1797 ND_PRINT((ndo
, "\n\t\t"));
1798 ND_PRINT((ndo
, "%s", tstr
));
1803 rsvp_print(netdissect_options
*ndo
,
1804 register const u_char
*pptr
, register u_int len
)
1806 const struct rsvp_common_header
*rsvp_com_header
;
1812 rsvp_com_header
= (const struct rsvp_common_header
*)pptr
;
1813 ND_TCHECK(*rsvp_com_header
);
1816 * Sanity checking of the header.
1818 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1819 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1820 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1824 /* in non-verbose mode just lets print the basic Message Type*/
1825 if (ndo
->ndo_vflag
< 1) {
1826 ND_PRINT((ndo
, "RSVPv%u %s Message, length: %u",
1827 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1828 tok2str(rsvp_msg_type_values
, "unknown (%u)",rsvp_com_header
->msg_type
),
1833 /* ok they seem to want to know everything - lets fully decode it */
1835 plen
= tlen
= EXTRACT_16BITS(rsvp_com_header
->length
);
1837 ND_PRINT((ndo
, "\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1838 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1839 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1840 rsvp_com_header
->msg_type
,
1841 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1843 rsvp_com_header
->ttl
,
1844 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1846 if (tlen
< sizeof(const struct rsvp_common_header
)) {
1847 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", tlen
,
1848 (unsigned long)sizeof(const struct rsvp_common_header
)));
1852 tptr
+=sizeof(const struct rsvp_common_header
);
1853 tlen
-=sizeof(const struct rsvp_common_header
);
1855 switch(rsvp_com_header
->msg_type
) {
1857 case RSVP_MSGTYPE_BUNDLE
:
1859 * Process each submessage in the bundle message.
1860 * Bundle messages may not contain bundle submessages, so we don't
1861 * need to handle bundle submessages specially.
1864 const u_char
*subpptr
=tptr
, *subtptr
;
1868 rsvp_com_header
= (const struct rsvp_common_header
*)subpptr
;
1869 ND_TCHECK(*rsvp_com_header
);
1870 u_short subplen
, subtlen
;
1873 * Sanity checking of the header.
1875 if (RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
) != RSVP_VERSION
) {
1876 ND_PRINT((ndo
, "ERROR: RSVP version %u packet not supported",
1877 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
)));
1881 subplen
= subtlen
= EXTRACT_16BITS(rsvp_com_header
->length
);
1883 ND_PRINT((ndo
, "\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1884 RSVP_EXTRACT_VERSION(rsvp_com_header
->version_flags
),
1885 tok2str(rsvp_msg_type_values
, "unknown, type: %u",rsvp_com_header
->msg_type
),
1886 rsvp_com_header
->msg_type
,
1887 bittok2str(rsvp_header_flag_values
,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header
->version_flags
)),
1889 rsvp_com_header
->ttl
,
1890 EXTRACT_16BITS(rsvp_com_header
->checksum
)));
1892 if (subtlen
< sizeof(const struct rsvp_common_header
)) {
1893 ND_PRINT((ndo
, "ERROR: common header too short %u < %lu", subtlen
,
1894 (unsigned long)sizeof(const struct rsvp_common_header
)));
1898 if (tlen
< subtlen
) {
1899 ND_PRINT((ndo
, "ERROR: common header too large %u > %u", subtlen
,
1904 subtptr
+=sizeof(const struct rsvp_common_header
);
1905 subtlen
-=sizeof(const struct rsvp_common_header
);
1908 * Print all objects in the submessage.
1910 if (rsvp_obj_print(ndo
, subpptr
, subplen
, subtptr
, "\n\t ", subtlen
, rsvp_com_header
) == -1)
1913 tptr
+=subtlen
+sizeof(const struct rsvp_common_header
);
1914 tlen
-=subtlen
+sizeof(const struct rsvp_common_header
);
1919 case RSVP_MSGTYPE_PATH
:
1920 case RSVP_MSGTYPE_RESV
:
1921 case RSVP_MSGTYPE_PATHERR
:
1922 case RSVP_MSGTYPE_RESVERR
:
1923 case RSVP_MSGTYPE_PATHTEAR
:
1924 case RSVP_MSGTYPE_RESVTEAR
:
1925 case RSVP_MSGTYPE_RESVCONF
:
1926 case RSVP_MSGTYPE_HELLO_OLD
:
1927 case RSVP_MSGTYPE_HELLO
:
1928 case RSVP_MSGTYPE_ACK
:
1929 case RSVP_MSGTYPE_SREFRESH
:
1931 * Print all objects in the message.
1933 if (rsvp_obj_print(ndo
, pptr
, plen
, tptr
, "\n\t ", tlen
, rsvp_com_header
) == -1)
1938 print_unknown_data(ndo
, tptr
, "\n\t ", tlen
);
1944 ND_PRINT((ndo
, "\n\t\t"));
1945 ND_PRINT((ndo
, "%s", tstr
));