]> The Tcpdump Group git mirrors - tcpdump/blob - print-rsvp.c
AppleTalk: Update the link-layer dissector to a void function
[tcpdump] / print-rsvp.c
1 /*
2 * Copyright (c) 1998-2007 The TCPDUMP project
3 *
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.
14 *
15 * Original code by Hannes Gredler (hannes@gredler.at)
16 */
17
18 /* \summary: Resource ReSerVation Protocol (RSVP) printer */
19
20 /* specification: RFC 2205 */
21
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
25
26 #include "netdissect-stdinc.h"
27
28 #include "netdissect.h"
29 #include "extract.h"
30 #include "addrtoname.h"
31 #include "ethertype.h"
32 #include "gmpls.h"
33 #include "af.h"
34 #include "signature.h"
35
36
37 /*
38 * RFC 2205 common header
39 *
40 * 0 1 2 3
41 * +-------------+-------------+-------------+-------------+
42 * | Vers | Flags| Msg Type | RSVP Checksum |
43 * +-------------+-------------+-------------+-------------+
44 * | Send_TTL | (Reserved) | RSVP Length |
45 * +-------------+-------------+-------------+-------------+
46 *
47 */
48
49 struct rsvp_common_header {
50 nd_uint8_t version_flags;
51 nd_uint8_t msg_type;
52 nd_uint16_t checksum;
53 nd_uint8_t ttl;
54 nd_byte reserved[1];
55 nd_uint16_t length;
56 };
57
58 /*
59 * RFC2205 object header
60 *
61 *
62 * 0 1 2 3
63 * +-------------+-------------+-------------+-------------+
64 * | Length (bytes) | Class-Num | C-Type |
65 * +-------------+-------------+-------------+-------------+
66 * | |
67 * // (Object contents) //
68 * | |
69 * +-------------+-------------+-------------+-------------+
70 */
71
72 struct rsvp_object_header {
73 nd_uint16_t length;
74 nd_uint8_t class_num;
75 nd_uint8_t ctype;
76 };
77
78 #define RSVP_VERSION 1
79 #define RSVP_EXTRACT_VERSION(x) (((x)&0xf0)>>4)
80 #define RSVP_EXTRACT_FLAGS(x) ((x)&0x0f)
81
82 #define RSVP_MSGTYPE_PATH 1
83 #define RSVP_MSGTYPE_RESV 2
84 #define RSVP_MSGTYPE_PATHERR 3
85 #define RSVP_MSGTYPE_RESVERR 4
86 #define RSVP_MSGTYPE_PATHTEAR 5
87 #define RSVP_MSGTYPE_RESVTEAR 6
88 #define RSVP_MSGTYPE_RESVCONF 7
89 #define RSVP_MSGTYPE_BUNDLE 12
90 #define RSVP_MSGTYPE_ACK 13
91 #define RSVP_MSGTYPE_HELLO_OLD 14 /* ancient Hellos */
92 #define RSVP_MSGTYPE_SREFRESH 15
93 #define RSVP_MSGTYPE_HELLO 20
94
95 static const struct tok rsvp_msg_type_values[] = {
96 { RSVP_MSGTYPE_PATH, "Path" },
97 { RSVP_MSGTYPE_RESV, "Resv" },
98 { RSVP_MSGTYPE_PATHERR, "PathErr" },
99 { RSVP_MSGTYPE_RESVERR, "ResvErr" },
100 { RSVP_MSGTYPE_PATHTEAR, "PathTear" },
101 { RSVP_MSGTYPE_RESVTEAR, "ResvTear" },
102 { RSVP_MSGTYPE_RESVCONF, "ResvConf" },
103 { RSVP_MSGTYPE_BUNDLE, "Bundle" },
104 { RSVP_MSGTYPE_ACK, "Acknowledgement" },
105 { RSVP_MSGTYPE_HELLO_OLD, "Hello (Old)" },
106 { RSVP_MSGTYPE_SREFRESH, "Refresh" },
107 { RSVP_MSGTYPE_HELLO, "Hello" },
108 { 0, NULL}
109 };
110
111 static const struct tok rsvp_header_flag_values[] = {
112 { 0x01, "Refresh reduction capable" }, /* rfc2961 */
113 { 0, NULL}
114 };
115
116 static const struct tok rsvp_obj_capability_flag_values[] = {
117 { 0x0004, "RecoveryPath Transmit Enabled" },
118 { 0x0002, "RecoveryPath Desired" },
119 { 0x0001, "RecoveryPath Srefresh Capable" },
120 { 0, NULL}
121 };
122
123 #define RSVP_OBJ_SESSION 1 /* rfc2205 */
124 #define RSVP_OBJ_RSVP_HOP 3 /* rfc2205, rfc3473 */
125 #define RSVP_OBJ_INTEGRITY 4 /* rfc2747 */
126 #define RSVP_OBJ_TIME_VALUES 5 /* rfc2205 */
127 #define RSVP_OBJ_ERROR_SPEC 6
128 #define RSVP_OBJ_SCOPE 7
129 #define RSVP_OBJ_STYLE 8 /* rfc2205 */
130 #define RSVP_OBJ_FLOWSPEC 9 /* rfc2215 */
131 #define RSVP_OBJ_FILTERSPEC 10 /* rfc2215 */
132 #define RSVP_OBJ_SENDER_TEMPLATE 11
133 #define RSVP_OBJ_SENDER_TSPEC 12 /* rfc2215 */
134 #define RSVP_OBJ_ADSPEC 13 /* rfc2215 */
135 #define RSVP_OBJ_POLICY_DATA 14
136 #define RSVP_OBJ_CONFIRM 15 /* rfc2205 */
137 #define RSVP_OBJ_LABEL 16 /* rfc3209 */
138 #define RSVP_OBJ_LABEL_REQ 19 /* rfc3209 */
139 #define RSVP_OBJ_ERO 20 /* rfc3209 */
140 #define RSVP_OBJ_RRO 21 /* rfc3209 */
141 #define RSVP_OBJ_HELLO 22 /* rfc3209 */
142 #define RSVP_OBJ_MESSAGE_ID 23 /* rfc2961 */
143 #define RSVP_OBJ_MESSAGE_ID_ACK 24 /* rfc2961 */
144 #define RSVP_OBJ_MESSAGE_ID_LIST 25 /* rfc2961 */
145 #define RSVP_OBJ_RECOVERY_LABEL 34 /* rfc3473 */
146 #define RSVP_OBJ_UPSTREAM_LABEL 35 /* rfc3473 */
147 #define RSVP_OBJ_LABEL_SET 36 /* rfc3473 */
148 #define RSVP_OBJ_PROTECTION 37 /* rfc3473 */
149 #define RSVP_OBJ_S2L 50 /* rfc4875 */
150 #define RSVP_OBJ_DETOUR 63 /* rfc4090 */
151 #define RSVP_OBJ_CLASSTYPE 66 /* rfc4124 */
152 #define RSVP_OBJ_CLASSTYPE_OLD 125 /* draft-ietf-tewg-diff-te-proto-07 */
153 #define RSVP_OBJ_SUGGESTED_LABEL 129 /* rfc3473 */
154 #define RSVP_OBJ_ACCEPT_LABEL_SET 130 /* rfc3473 */
155 #define RSVP_OBJ_RESTART_CAPABILITY 131 /* rfc3473 */
156 #define RSVP_OBJ_CAPABILITY 134 /* rfc5063 */
157 #define RSVP_OBJ_NOTIFY_REQ 195 /* rfc3473 */
158 #define RSVP_OBJ_ADMIN_STATUS 196 /* rfc3473 */
159 #define RSVP_OBJ_PROPERTIES 204 /* juniper proprietary */
160 #define RSVP_OBJ_FASTREROUTE 205 /* rfc4090 */
161 #define RSVP_OBJ_SESSION_ATTRIBUTE 207 /* rfc3209 */
162 #define RSVP_OBJ_GENERALIZED_UNI 229 /* OIF RSVP extensions UNI 1.0 Signaling, Rel. 2 */
163 #define RSVP_OBJ_CALL_ID 230 /* rfc3474 */
164 #define RSVP_OBJ_CALL_OPS 236 /* rfc3474 */
165
166 static const struct tok rsvp_obj_values[] = {
167 { RSVP_OBJ_SESSION, "Session" },
168 { RSVP_OBJ_RSVP_HOP, "RSVP Hop" },
169 { RSVP_OBJ_INTEGRITY, "Integrity" },
170 { RSVP_OBJ_TIME_VALUES, "Time Values" },
171 { RSVP_OBJ_ERROR_SPEC, "Error Spec" },
172 { RSVP_OBJ_SCOPE, "Scope" },
173 { RSVP_OBJ_STYLE, "Style" },
174 { RSVP_OBJ_FLOWSPEC, "Flowspec" },
175 { RSVP_OBJ_FILTERSPEC, "FilterSpec" },
176 { RSVP_OBJ_SENDER_TEMPLATE, "Sender Template" },
177 { RSVP_OBJ_SENDER_TSPEC, "Sender TSpec" },
178 { RSVP_OBJ_ADSPEC, "Adspec" },
179 { RSVP_OBJ_POLICY_DATA, "Policy Data" },
180 { RSVP_OBJ_CONFIRM, "Confirm" },
181 { RSVP_OBJ_LABEL, "Label" },
182 { RSVP_OBJ_LABEL_REQ, "Label Request" },
183 { RSVP_OBJ_ERO, "ERO" },
184 { RSVP_OBJ_RRO, "RRO" },
185 { RSVP_OBJ_HELLO, "Hello" },
186 { RSVP_OBJ_MESSAGE_ID, "Message ID" },
187 { RSVP_OBJ_MESSAGE_ID_ACK, "Message ID Ack" },
188 { RSVP_OBJ_MESSAGE_ID_LIST, "Message ID List" },
189 { RSVP_OBJ_RECOVERY_LABEL, "Recovery Label" },
190 { RSVP_OBJ_UPSTREAM_LABEL, "Upstream Label" },
191 { RSVP_OBJ_LABEL_SET, "Label Set" },
192 { RSVP_OBJ_ACCEPT_LABEL_SET, "Acceptable Label Set" },
193 { RSVP_OBJ_DETOUR, "Detour" },
194 { RSVP_OBJ_CLASSTYPE, "Class Type" },
195 { RSVP_OBJ_CLASSTYPE_OLD, "Class Type (old)" },
196 { RSVP_OBJ_SUGGESTED_LABEL, "Suggested Label" },
197 { RSVP_OBJ_PROPERTIES, "Properties" },
198 { RSVP_OBJ_FASTREROUTE, "Fast Re-Route" },
199 { RSVP_OBJ_SESSION_ATTRIBUTE, "Session Attribute" },
200 { RSVP_OBJ_GENERALIZED_UNI, "Generalized UNI" },
201 { RSVP_OBJ_CALL_ID, "Call-ID" },
202 { RSVP_OBJ_CALL_OPS, "Call Capability" },
203 { RSVP_OBJ_RESTART_CAPABILITY, "Restart Capability" },
204 { RSVP_OBJ_CAPABILITY, "Capability" },
205 { RSVP_OBJ_NOTIFY_REQ, "Notify Request" },
206 { RSVP_OBJ_PROTECTION, "Protection" },
207 { RSVP_OBJ_ADMIN_STATUS, "Administrative Status" },
208 { RSVP_OBJ_S2L, "Sub-LSP to LSP" },
209 { 0, NULL}
210 };
211
212 #define RSVP_CTYPE_IPV4 1
213 #define RSVP_CTYPE_IPV6 2
214 #define RSVP_CTYPE_TUNNEL_IPV4 7
215 #define RSVP_CTYPE_TUNNEL_IPV6 8
216 #define RSVP_CTYPE_UNI_IPV4 11 /* OIF RSVP extensions UNI 1.0 Signaling Rel. 2 */
217 #define RSVP_CTYPE_1 1
218 #define RSVP_CTYPE_2 2
219 #define RSVP_CTYPE_3 3
220 #define RSVP_CTYPE_4 4
221 #define RSVP_CTYPE_12 12
222 #define RSVP_CTYPE_13 13
223 #define RSVP_CTYPE_14 14
224
225 /*
226 * the ctypes are not globally unique so for
227 * translating it to strings we build a table based
228 * on objects offsetted by the ctype
229 */
230
231 static const struct tok rsvp_ctype_values[] = {
232 { 256*RSVP_OBJ_RSVP_HOP+RSVP_CTYPE_IPV4, "IPv4" },
233 { 256*RSVP_OBJ_RSVP_HOP+RSVP_CTYPE_IPV6, "IPv6" },
234 { 256*RSVP_OBJ_RSVP_HOP+RSVP_CTYPE_3, "IPv4 plus opt. TLVs" },
235 { 256*RSVP_OBJ_RSVP_HOP+RSVP_CTYPE_4, "IPv6 plus opt. TLVs" },
236 { 256*RSVP_OBJ_NOTIFY_REQ+RSVP_CTYPE_IPV4, "IPv4" },
237 { 256*RSVP_OBJ_NOTIFY_REQ+RSVP_CTYPE_IPV6, "IPv6" },
238 { 256*RSVP_OBJ_CONFIRM+RSVP_CTYPE_IPV4, "IPv4" },
239 { 256*RSVP_OBJ_CONFIRM+RSVP_CTYPE_IPV6, "IPv6" },
240 { 256*RSVP_OBJ_TIME_VALUES+RSVP_CTYPE_1, "1" },
241 { 256*RSVP_OBJ_FLOWSPEC+RSVP_CTYPE_1, "obsolete" },
242 { 256*RSVP_OBJ_FLOWSPEC+RSVP_CTYPE_2, "IntServ" },
243 { 256*RSVP_OBJ_SENDER_TSPEC+RSVP_CTYPE_2, "IntServ" },
244 { 256*RSVP_OBJ_ADSPEC+RSVP_CTYPE_2, "IntServ" },
245 { 256*RSVP_OBJ_FILTERSPEC+RSVP_CTYPE_IPV4, "IPv4" },
246 { 256*RSVP_OBJ_FILTERSPEC+RSVP_CTYPE_IPV6, "IPv6" },
247 { 256*RSVP_OBJ_FILTERSPEC+RSVP_CTYPE_3, "IPv6 Flow-label" },
248 { 256*RSVP_OBJ_FILTERSPEC+RSVP_CTYPE_TUNNEL_IPV4, "Tunnel IPv4" },
249 { 256*RSVP_OBJ_FILTERSPEC+RSVP_CTYPE_12, "IPv4 P2MP LSP Tunnel" },
250 { 256*RSVP_OBJ_FILTERSPEC+RSVP_CTYPE_13, "IPv6 P2MP LSP Tunnel" },
251 { 256*RSVP_OBJ_SESSION+RSVP_CTYPE_IPV4, "IPv4" },
252 { 256*RSVP_OBJ_SESSION+RSVP_CTYPE_IPV6, "IPv6" },
253 { 256*RSVP_OBJ_SESSION+RSVP_CTYPE_TUNNEL_IPV4, "Tunnel IPv4" },
254 { 256*RSVP_OBJ_SESSION+RSVP_CTYPE_UNI_IPV4, "UNI IPv4" },
255 { 256*RSVP_OBJ_SESSION+RSVP_CTYPE_13, "IPv4 P2MP LSP Tunnel" },
256 { 256*RSVP_OBJ_SESSION+RSVP_CTYPE_14, "IPv6 P2MP LSP Tunnel" },
257 { 256*RSVP_OBJ_SENDER_TEMPLATE+RSVP_CTYPE_IPV4, "IPv4" },
258 { 256*RSVP_OBJ_SENDER_TEMPLATE+RSVP_CTYPE_IPV6, "IPv6" },
259 { 256*RSVP_OBJ_SENDER_TEMPLATE+RSVP_CTYPE_TUNNEL_IPV4, "Tunnel IPv4" },
260 { 256*RSVP_OBJ_SENDER_TEMPLATE+RSVP_CTYPE_12, "IPv4 P2MP LSP Tunnel" },
261 { 256*RSVP_OBJ_SENDER_TEMPLATE+RSVP_CTYPE_13, "IPv6 P2MP LSP Tunnel" },
262 { 256*RSVP_OBJ_MESSAGE_ID+RSVP_CTYPE_1, "1" },
263 { 256*RSVP_OBJ_MESSAGE_ID_ACK+RSVP_CTYPE_1, "Message id ack" },
264 { 256*RSVP_OBJ_MESSAGE_ID_ACK+RSVP_CTYPE_2, "Message id nack" },
265 { 256*RSVP_OBJ_MESSAGE_ID_LIST+RSVP_CTYPE_1, "1" },
266 { 256*RSVP_OBJ_STYLE+RSVP_CTYPE_1, "1" },
267 { 256*RSVP_OBJ_HELLO+RSVP_CTYPE_1, "Hello Request" },
268 { 256*RSVP_OBJ_HELLO+RSVP_CTYPE_2, "Hello Ack" },
269 { 256*RSVP_OBJ_LABEL_REQ+RSVP_CTYPE_1, "without label range" },
270 { 256*RSVP_OBJ_LABEL_REQ+RSVP_CTYPE_2, "with ATM label range" },
271 { 256*RSVP_OBJ_LABEL_REQ+RSVP_CTYPE_3, "with FR label range" },
272 { 256*RSVP_OBJ_LABEL_REQ+RSVP_CTYPE_4, "Generalized Label" },
273 { 256*RSVP_OBJ_LABEL+RSVP_CTYPE_1, "Label" },
274 { 256*RSVP_OBJ_LABEL+RSVP_CTYPE_2, "Generalized Label" },
275 { 256*RSVP_OBJ_LABEL+RSVP_CTYPE_3, "Waveband Switching" },
276 { 256*RSVP_OBJ_SUGGESTED_LABEL+RSVP_CTYPE_1, "Label" },
277 { 256*RSVP_OBJ_SUGGESTED_LABEL+RSVP_CTYPE_2, "Generalized Label" },
278 { 256*RSVP_OBJ_SUGGESTED_LABEL+RSVP_CTYPE_3, "Waveband Switching" },
279 { 256*RSVP_OBJ_UPSTREAM_LABEL+RSVP_CTYPE_1, "Label" },
280 { 256*RSVP_OBJ_UPSTREAM_LABEL+RSVP_CTYPE_2, "Generalized Label" },
281 { 256*RSVP_OBJ_UPSTREAM_LABEL+RSVP_CTYPE_3, "Waveband Switching" },
282 { 256*RSVP_OBJ_RECOVERY_LABEL+RSVP_CTYPE_1, "Label" },
283 { 256*RSVP_OBJ_RECOVERY_LABEL+RSVP_CTYPE_2, "Generalized Label" },
284 { 256*RSVP_OBJ_RECOVERY_LABEL+RSVP_CTYPE_3, "Waveband Switching" },
285 { 256*RSVP_OBJ_ERO+RSVP_CTYPE_IPV4, "IPv4" },
286 { 256*RSVP_OBJ_RRO+RSVP_CTYPE_IPV4, "IPv4" },
287 { 256*RSVP_OBJ_ERROR_SPEC+RSVP_CTYPE_IPV4, "IPv4" },
288 { 256*RSVP_OBJ_ERROR_SPEC+RSVP_CTYPE_IPV6, "IPv6" },
289 { 256*RSVP_OBJ_ERROR_SPEC+RSVP_CTYPE_3, "IPv4 plus opt. TLVs" },
290 { 256*RSVP_OBJ_ERROR_SPEC+RSVP_CTYPE_4, "IPv6 plus opt. TLVs" },
291 { 256*RSVP_OBJ_RESTART_CAPABILITY+RSVP_CTYPE_1, "IPv4" },
292 { 256*RSVP_OBJ_CAPABILITY+RSVP_CTYPE_1, "1" },
293 { 256*RSVP_OBJ_SESSION_ATTRIBUTE+RSVP_CTYPE_TUNNEL_IPV4, "Tunnel IPv4" },
294 { 256*RSVP_OBJ_FASTREROUTE+RSVP_CTYPE_TUNNEL_IPV4, "Tunnel IPv4" }, /* old style*/
295 { 256*RSVP_OBJ_FASTREROUTE+RSVP_CTYPE_1, "1" }, /* new style */
296 { 256*RSVP_OBJ_DETOUR+RSVP_CTYPE_TUNNEL_IPV4, "Tunnel IPv4" },
297 { 256*RSVP_OBJ_PROPERTIES+RSVP_CTYPE_1, "1" },
298 { 256*RSVP_OBJ_ADMIN_STATUS+RSVP_CTYPE_1, "1" },
299 { 256*RSVP_OBJ_CLASSTYPE+RSVP_CTYPE_1, "1" },
300 { 256*RSVP_OBJ_CLASSTYPE_OLD+RSVP_CTYPE_1, "1" },
301 { 256*RSVP_OBJ_LABEL_SET+RSVP_CTYPE_1, "1" },
302 { 256*RSVP_OBJ_GENERALIZED_UNI+RSVP_CTYPE_1, "1" },
303 { 256*RSVP_OBJ_S2L+RSVP_CTYPE_IPV4, "IPv4 sub-LSP" },
304 { 256*RSVP_OBJ_S2L+RSVP_CTYPE_IPV6, "IPv6 sub-LSP" },
305 { 0, NULL}
306 };
307
308 /*
309 * XXX - this assumes a 16-byte digest, which is true for HMAC-MD5, but
310 * isn't necessarily the case for other hash algorithms.
311 *
312 * Unless I've missed something, there's nothing in RFC 2747 to indicate
313 * the hash algorithm being used, so it's presumably something set up
314 * out-of-band, or negotiated by other RSVP objects.
315 */
316 struct rsvp_obj_integrity_t {
317 uint8_t flags;
318 uint8_t res;
319 uint8_t key_id[6];
320 uint8_t sequence[8];
321 uint8_t digest[16];
322 };
323
324 static const struct tok rsvp_obj_integrity_flag_values[] = {
325 { 0x80, "Handshake" },
326 { 0, NULL}
327 };
328
329 struct rsvp_obj_frr_t {
330 uint8_t setup_prio;
331 uint8_t hold_prio;
332 uint8_t hop_limit;
333 uint8_t flags;
334 uint8_t bandwidth[4];
335 uint8_t include_any[4];
336 uint8_t exclude_any[4];
337 uint8_t include_all[4];
338 };
339
340
341 #define RSVP_OBJ_XRO_MASK_SUBOBJ(x) ((x)&0x7f)
342 #define RSVP_OBJ_XRO_MASK_LOOSE(x) ((x)&0x80)
343
344 #define RSVP_OBJ_CAPABILITY_FLAGS_MASK 0x7U
345
346 #define RSVP_OBJ_XRO_RES 0
347 #define RSVP_OBJ_XRO_IPV4 1
348 #define RSVP_OBJ_XRO_IPV6 2
349 #define RSVP_OBJ_XRO_LABEL 3
350 #define RSVP_OBJ_XRO_ASN 32
351 #define RSVP_OBJ_XRO_MPLS 64
352
353 static const struct tok rsvp_obj_xro_values[] = {
354 { RSVP_OBJ_XRO_RES, "Reserved" },
355 { RSVP_OBJ_XRO_IPV4, "IPv4 prefix" },
356 { RSVP_OBJ_XRO_IPV6, "IPv6 prefix" },
357 { RSVP_OBJ_XRO_LABEL, "Label" },
358 { RSVP_OBJ_XRO_ASN, "Autonomous system number" },
359 { RSVP_OBJ_XRO_MPLS, "MPLS label switched path termination" },
360 { 0, NULL}
361 };
362
363 /* RFC4090 */
364 static const struct tok rsvp_obj_rro_flag_values[] = {
365 { 0x01, "Local protection available" },
366 { 0x02, "Local protection in use" },
367 { 0x04, "Bandwidth protection" },
368 { 0x08, "Node protection" },
369 { 0, NULL}
370 };
371
372 /* RFC3209 */
373 static const struct tok rsvp_obj_rro_label_flag_values[] = {
374 { 0x01, "Global" },
375 { 0, NULL}
376 };
377
378 static const struct tok rsvp_resstyle_values[] = {
379 { 17, "Wildcard Filter" },
380 { 10, "Fixed Filter" },
381 { 18, "Shared Explicit" },
382 { 0, NULL}
383 };
384
385 #define RSVP_OBJ_INTSERV_GUARANTEED_SERV 2
386 #define RSVP_OBJ_INTSERV_CONTROLLED_LOAD 5
387
388 static const struct tok rsvp_intserv_service_type_values[] = {
389 { 1, "Default/Global Information" },
390 { RSVP_OBJ_INTSERV_GUARANTEED_SERV, "Guaranteed Service" },
391 { RSVP_OBJ_INTSERV_CONTROLLED_LOAD, "Controlled Load" },
392 { 0, NULL}
393 };
394
395 static const struct tok rsvp_intserv_parameter_id_values[] = {
396 { 4, "IS hop cnt" },
397 { 6, "Path b/w estimate" },
398 { 8, "Minimum path latency" },
399 { 10, "Composed MTU" },
400 { 127, "Token Bucket TSpec" },
401 { 130, "Guaranteed Service RSpec" },
402 { 133, "End-to-end composed value for C" },
403 { 134, "End-to-end composed value for D" },
404 { 135, "Since-last-reshaping point composed C" },
405 { 136, "Since-last-reshaping point composed D" },
406 { 0, NULL}
407 };
408
409 static const struct tok rsvp_session_attribute_flag_values[] = {
410 { 0x01, "Local Protection" },
411 { 0x02, "Label Recording" },
412 { 0x04, "SE Style" },
413 { 0x08, "Bandwidth protection" }, /* RFC4090 */
414 { 0x10, "Node protection" }, /* RFC4090 */
415 { 0, NULL}
416 };
417
418 static const struct tok rsvp_obj_prop_tlv_values[] = {
419 { 0x01, "Cos" },
420 { 0x02, "Metric 1" },
421 { 0x04, "Metric 2" },
422 { 0x08, "CCC Status" },
423 { 0x10, "Path Type" },
424 { 0, NULL}
425 };
426
427 #define RSVP_OBJ_ERROR_SPEC_CODE_ROUTING 24
428 #define RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY 25
429 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE 28
430 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD 125
431
432 static const struct tok rsvp_obj_error_code_values[] = {
433 { RSVP_OBJ_ERROR_SPEC_CODE_ROUTING, "Routing Problem" },
434 { RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY, "Notify Error" },
435 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE, "Diffserv TE Error" },
436 { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD, "Diffserv TE Error (Old)" },
437 { 0, NULL}
438 };
439
440 static const struct tok rsvp_obj_error_code_routing_values[] = {
441 { 1, "Bad EXPLICIT_ROUTE object" },
442 { 2, "Bad strict node" },
443 { 3, "Bad loose node" },
444 { 4, "Bad initial subobject" },
445 { 5, "No route available toward destination" },
446 { 6, "Unacceptable label value" },
447 { 7, "RRO indicated routing loops" },
448 { 8, "non-RSVP-capable router in the path" },
449 { 9, "MPLS label allocation failure" },
450 { 10, "Unsupported L3PID" },
451 { 0, NULL}
452 };
453
454 static const struct tok rsvp_obj_error_code_diffserv_te_values[] = {
455 { 1, "Unexpected CT object" },
456 { 2, "Unsupported CT" },
457 { 3, "Invalid CT value" },
458 { 4, "CT/setup priority do not form a configured TE-Class" },
459 { 5, "CT/holding priority do not form a configured TE-Class" },
460 { 6, "CT/setup priority and CT/holding priority do not form a configured TE-Class" },
461 { 7, "Inconsistency between signaled PSC and signaled CT" },
462 { 8, "Inconsistency between signaled PHBs and signaled CT" },
463 { 0, NULL}
464 };
465
466 /* rfc3473 / rfc 3471 */
467 static const struct tok rsvp_obj_admin_status_flag_values[] = {
468 { 0x80000000, "Reflect" },
469 { 0x00000004, "Testing" },
470 { 0x00000002, "Admin-down" },
471 { 0x00000001, "Delete-in-progress" },
472 { 0, NULL}
473 };
474
475 /* label set actions - rfc3471 */
476 #define LABEL_SET_INCLUSIVE_LIST 0
477 #define LABEL_SET_EXCLUSIVE_LIST 1
478 #define LABEL_SET_INCLUSIVE_RANGE 2
479 #define LABEL_SET_EXCLUSIVE_RANGE 3
480
481 static const struct tok rsvp_obj_label_set_action_values[] = {
482 { LABEL_SET_INCLUSIVE_LIST, "Inclusive list" },
483 { LABEL_SET_EXCLUSIVE_LIST, "Exclusive list" },
484 { LABEL_SET_INCLUSIVE_RANGE, "Inclusive range" },
485 { LABEL_SET_EXCLUSIVE_RANGE, "Exclusive range" },
486 { 0, NULL}
487 };
488
489 /* OIF RSVP extensions UNI 1.0 Signaling, release 2 */
490 #define RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS 1
491 #define RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS 2
492 #define RSVP_GEN_UNI_SUBOBJ_DIVERSITY 3
493 #define RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL 4
494 #define RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL 5
495
496 static const struct tok rsvp_obj_generalized_uni_values[] = {
497 { RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS, "Source TNA address" },
498 { RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS, "Destination TNA address" },
499 { RSVP_GEN_UNI_SUBOBJ_DIVERSITY, "Diversity" },
500 { RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL, "Egress label" },
501 { RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL, "Service level" },
502 { 0, NULL}
503 };
504
505 /*
506 * this is a dissector for all the intserv defined
507 * specs as defined per rfc2215
508 * it is called from various rsvp objects;
509 * returns the amount of bytes being processed
510 */
511 static u_int
512 rsvp_intserv_print(netdissect_options *ndo,
513 const u_char *tptr, u_int obj_tlen)
514 {
515 u_int parameter_id,parameter_length;
516 union {
517 float f;
518 uint32_t i;
519 } bw;
520
521 if (obj_tlen < 4)
522 return 0;
523 ND_TCHECK_1(tptr);
524 parameter_id = GET_U_1(tptr);
525 ND_TCHECK_2(tptr + 2);
526 parameter_length = GET_BE_U_2(tptr + 2)<<2; /* convert wordcount to bytecount */
527
528 ND_PRINT("\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
529 tok2str(rsvp_intserv_parameter_id_values,"unknown",parameter_id),
530 parameter_id,
531 parameter_length,
532 GET_U_1(tptr + 1));
533
534 if (obj_tlen < parameter_length+4)
535 return 0;
536 switch(parameter_id) { /* parameter_id */
537
538 case 4:
539 /*
540 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
541 * | 4 (e) | (f) | 1 (g) |
542 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
543 * | IS hop cnt (32-bit unsigned integer) |
544 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
545 */
546 if (parameter_length == 4) {
547 ND_TCHECK_4(tptr + 4);
548 ND_PRINT("\n\t\tIS hop count: %u", GET_BE_U_4(tptr + 4));
549 }
550 break;
551
552 case 6:
553 /*
554 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
555 * | 6 (h) | (i) | 1 (j) |
556 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
557 * | Path b/w estimate (32-bit IEEE floating point number) |
558 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
559 */
560 if (parameter_length == 4) {
561 ND_TCHECK_4(tptr + 4);
562 bw.i = GET_BE_U_4(tptr + 4);
563 ND_PRINT("\n\t\tPath b/w estimate: %.10g Mbps", bw.f / 125000);
564 }
565 break;
566
567 case 8:
568 /*
569 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
570 * | 8 (k) | (l) | 1 (m) |
571 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
572 * | Minimum path latency (32-bit integer) |
573 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
574 */
575 if (parameter_length == 4) {
576 ND_TCHECK_4(tptr + 4);
577 ND_PRINT("\n\t\tMinimum path latency: ");
578 if (GET_BE_U_4(tptr + 4) == 0xffffffff)
579 ND_PRINT("don't care");
580 else
581 ND_PRINT("%u", GET_BE_U_4(tptr + 4));
582 }
583 break;
584
585 case 10:
586
587 /*
588 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
589 * | 10 (n) | (o) | 1 (p) |
590 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
591 * | Composed MTU (32-bit unsigned integer) |
592 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
593 */
594 if (parameter_length == 4) {
595 ND_TCHECK_4(tptr + 4);
596 ND_PRINT("\n\t\tComposed MTU: %u bytes", GET_BE_U_4(tptr + 4));
597 }
598 break;
599 case 127:
600 /*
601 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
602 * | 127 (e) | 0 (f) | 5 (g) |
603 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
604 * | Token Bucket Rate [r] (32-bit IEEE floating point number) |
605 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
606 * | Token Bucket Size [b] (32-bit IEEE floating point number) |
607 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
608 * | Peak Data Rate [p] (32-bit IEEE floating point number) |
609 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
610 * | Minimum Policed Unit [m] (32-bit integer) |
611 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
612 * | Maximum Packet Size [M] (32-bit integer) |
613 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
614 */
615
616 if (parameter_length == 20) {
617 ND_TCHECK_LEN(tptr + 4, 20);
618 bw.i = GET_BE_U_4(tptr + 4);
619 ND_PRINT("\n\t\tToken Bucket Rate: %.10g Mbps", bw.f / 125000);
620 bw.i = GET_BE_U_4(tptr + 8);
621 ND_PRINT("\n\t\tToken Bucket Size: %.10g bytes", bw.f);
622 bw.i = GET_BE_U_4(tptr + 12);
623 ND_PRINT("\n\t\tPeak Data Rate: %.10g Mbps", bw.f / 125000);
624 ND_PRINT("\n\t\tMinimum Policed Unit: %u bytes",
625 GET_BE_U_4(tptr + 16));
626 ND_PRINT("\n\t\tMaximum Packet Size: %u bytes",
627 GET_BE_U_4(tptr + 20));
628 }
629 break;
630
631 case 130:
632 /*
633 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
634 * | 130 (h) | 0 (i) | 2 (j) |
635 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
636 * | Rate [R] (32-bit IEEE floating point number) |
637 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
638 * | Slack Term [S] (32-bit integer) |
639 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
640 */
641
642 if (parameter_length == 8) {
643 ND_TCHECK_8(tptr + 4);
644 bw.i = GET_BE_U_4(tptr + 4);
645 ND_PRINT("\n\t\tRate: %.10g Mbps", bw.f / 125000);
646 ND_PRINT("\n\t\tSlack Term: %u", GET_BE_U_4(tptr + 8));
647 }
648 break;
649
650 case 133:
651 case 134:
652 case 135:
653 case 136:
654 if (parameter_length == 4) {
655 ND_TCHECK_4(tptr + 4);
656 ND_PRINT("\n\t\tValue: %u", GET_BE_U_4(tptr + 4));
657 }
658 break;
659
660 default:
661 if (ndo->ndo_vflag <= 1)
662 print_unknown_data(ndo, tptr + 4, "\n\t\t", parameter_length);
663 }
664 return (parameter_length+4); /* header length 4 bytes */
665
666 trunc:
667 nd_print_trunc(ndo);
668 return 0;
669 }
670
671 /*
672 * Clear checksum prior to signature verification.
673 */
674 static void
675 rsvp_clear_checksum(void *header)
676 {
677 struct rsvp_common_header *rsvp_com_header = (struct rsvp_common_header *) header;
678
679 rsvp_com_header->checksum[0] = 0;
680 rsvp_com_header->checksum[1] = 0;
681 }
682
683 static int
684 rsvp_obj_print(netdissect_options *ndo,
685 const u_char *pptr, u_int plen, const u_char *tptr,
686 const char *indent, u_int tlen,
687 const struct rsvp_common_header *rsvp_com_header)
688 {
689 const struct rsvp_object_header *rsvp_obj_header;
690 const u_char *obj_tptr;
691 union {
692 const struct rsvp_obj_integrity_t *rsvp_obj_integrity;
693 const struct rsvp_obj_frr_t *rsvp_obj_frr;
694 } obj_ptr;
695
696 u_short rsvp_obj_len,rsvp_obj_ctype,rsvp_obj_class_num;
697 u_int obj_tlen,intserv_serv_tlen;
698 int hexdump;
699 u_int processed,padbytes,error_code,error_value,i,sigcheck;
700 union {
701 float f;
702 uint32_t i;
703 } bw;
704 u_int namelen;
705
706 u_int action, subchannel;
707
708 while(tlen>=sizeof(struct rsvp_object_header)) {
709 /* did we capture enough for fully decoding the object header ? */
710 ND_TCHECK_LEN(tptr, sizeof(struct rsvp_object_header));
711
712 rsvp_obj_header = (const struct rsvp_object_header *)tptr;
713 rsvp_obj_len=GET_BE_U_2(rsvp_obj_header->length);
714 rsvp_obj_ctype=GET_U_1(rsvp_obj_header->ctype);
715
716 if(rsvp_obj_len % 4) {
717 ND_PRINT("%sERROR: object header size %u not a multiple of 4", indent, rsvp_obj_len);
718 return -1;
719 }
720 if(rsvp_obj_len < sizeof(struct rsvp_object_header)) {
721 ND_PRINT("%sERROR: object header too short %u < %zu", indent, rsvp_obj_len,
722 sizeof(struct rsvp_object_header));
723 return -1;
724 }
725
726 rsvp_obj_class_num = GET_U_1(rsvp_obj_header->class_num);
727 ND_PRINT("%s%s Object (%u) Flags: [%s",
728 indent,
729 tok2str(rsvp_obj_values,
730 "Unknown",
731 rsvp_obj_class_num),
732 rsvp_obj_class_num,
733 (rsvp_obj_class_num & 0x80) ?
734 ((rsvp_obj_class_num & 0x40) ? "ignore and forward" :
735 "ignore silently") :
736 "reject");
737
738 ND_PRINT(" if unknown], Class-Type: %s (%u), length: %u",
739 tok2str(rsvp_ctype_values,
740 "Unknown",
741 (rsvp_obj_class_num<<8)+rsvp_obj_ctype),
742 rsvp_obj_ctype,
743 rsvp_obj_len);
744
745 if(tlen < rsvp_obj_len) {
746 ND_PRINT("%sERROR: object goes past end of objects TLV", indent);
747 return -1;
748 }
749
750 obj_tptr=tptr+sizeof(struct rsvp_object_header);
751 obj_tlen=rsvp_obj_len-sizeof(struct rsvp_object_header);
752
753 /* did we capture enough for fully decoding the object ? */
754 ND_TCHECK_LEN(tptr, rsvp_obj_len);
755 hexdump=FALSE;
756
757 switch(rsvp_obj_class_num) {
758 case RSVP_OBJ_SESSION:
759 switch(rsvp_obj_ctype) {
760 case RSVP_CTYPE_IPV4:
761 if (obj_tlen < 8)
762 goto obj_tooshort;
763 ND_PRINT("%s IPv4 DestAddress: %s, Protocol ID: 0x%02x",
764 indent,
765 GET_IPADDR_STRING(obj_tptr),
766 GET_U_1(obj_tptr + sizeof(nd_ipv4)));
767 ND_PRINT("%s Flags: [0x%02x], DestPort %u",
768 indent,
769 GET_U_1((obj_tptr + 5)),
770 GET_BE_U_2(obj_tptr + 6));
771 obj_tlen-=8;
772 obj_tptr+=8;
773 break;
774 case RSVP_CTYPE_IPV6:
775 if (obj_tlen < 20)
776 goto obj_tooshort;
777 ND_PRINT("%s IPv6 DestAddress: %s, Protocol ID: 0x%02x",
778 indent,
779 GET_IP6ADDR_STRING(obj_tptr),
780 GET_U_1(obj_tptr + sizeof(nd_ipv6)));
781 ND_PRINT("%s Flags: [0x%02x], DestPort %u",
782 indent,
783 GET_U_1((obj_tptr + sizeof(nd_ipv6) + 1)),
784 GET_BE_U_2(obj_tptr + sizeof(nd_ipv6) + 2));
785 obj_tlen-=20;
786 obj_tptr+=20;
787 break;
788
789 case RSVP_CTYPE_TUNNEL_IPV6:
790 if (obj_tlen < 36)
791 goto obj_tooshort;
792 ND_PRINT("%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
793 indent,
794 GET_IP6ADDR_STRING(obj_tptr),
795 GET_BE_U_2(obj_tptr + 18),
796 GET_IP6ADDR_STRING(obj_tptr + 20));
797 obj_tlen-=36;
798 obj_tptr+=36;
799 break;
800
801 case RSVP_CTYPE_14: /* IPv6 p2mp LSP Tunnel */
802 if (obj_tlen < 26)
803 goto obj_tooshort;
804 ND_PRINT("%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
805 indent,
806 GET_BE_U_4(obj_tptr),
807 GET_BE_U_2(obj_tptr + 6),
808 GET_IP6ADDR_STRING(obj_tptr + 8));
809 obj_tlen-=26;
810 obj_tptr+=26;
811 break;
812 case RSVP_CTYPE_13: /* IPv4 p2mp LSP Tunnel */
813 if (obj_tlen < 12)
814 goto obj_tooshort;
815 ND_PRINT("%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
816 indent,
817 GET_IPADDR_STRING(obj_tptr),
818 GET_BE_U_2(obj_tptr + 6),
819 GET_IPADDR_STRING(obj_tptr + 8));
820 obj_tlen-=12;
821 obj_tptr+=12;
822 break;
823 case RSVP_CTYPE_TUNNEL_IPV4:
824 case RSVP_CTYPE_UNI_IPV4:
825 if (obj_tlen < 12)
826 goto obj_tooshort;
827 ND_PRINT("%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
828 indent,
829 GET_IPADDR_STRING(obj_tptr),
830 GET_BE_U_2(obj_tptr + 6),
831 GET_IPADDR_STRING(obj_tptr + 8));
832 obj_tlen-=12;
833 obj_tptr+=12;
834 break;
835 default:
836 hexdump=TRUE;
837 }
838 break;
839
840 case RSVP_OBJ_CONFIRM:
841 switch(rsvp_obj_ctype) {
842 case RSVP_CTYPE_IPV4:
843 if (obj_tlen < sizeof(nd_ipv4))
844 goto obj_tooshort;
845 ND_PRINT("%s IPv4 Receiver Address: %s",
846 indent,
847 GET_IPADDR_STRING(obj_tptr));
848 obj_tlen-=sizeof(nd_ipv4);
849 obj_tptr+=sizeof(nd_ipv4);
850 break;
851 case RSVP_CTYPE_IPV6:
852 if (obj_tlen < sizeof(nd_ipv6))
853 goto obj_tooshort;
854 ND_PRINT("%s IPv6 Receiver Address: %s",
855 indent,
856 GET_IP6ADDR_STRING(obj_tptr));
857 obj_tlen-=sizeof(nd_ipv6);
858 obj_tptr+=sizeof(nd_ipv6);
859 break;
860 default:
861 hexdump=TRUE;
862 }
863 break;
864
865 case RSVP_OBJ_NOTIFY_REQ:
866 switch(rsvp_obj_ctype) {
867 case RSVP_CTYPE_IPV4:
868 if (obj_tlen < sizeof(nd_ipv4))
869 goto obj_tooshort;
870 ND_PRINT("%s IPv4 Notify Node Address: %s",
871 indent,
872 GET_IPADDR_STRING(obj_tptr));
873 obj_tlen-=sizeof(nd_ipv4);
874 obj_tptr+=sizeof(nd_ipv4);
875 break;
876 case RSVP_CTYPE_IPV6:
877 if (obj_tlen < sizeof(nd_ipv6))
878 goto obj_tooshort;
879 ND_PRINT("%s IPv6 Notify Node Address: %s",
880 indent,
881 GET_IP6ADDR_STRING(obj_tptr));
882 obj_tlen-=sizeof(nd_ipv6);
883 obj_tptr+=sizeof(nd_ipv6);
884 break;
885 default:
886 hexdump=TRUE;
887 }
888 break;
889
890 case RSVP_OBJ_SUGGESTED_LABEL: /* fall through */
891 case RSVP_OBJ_UPSTREAM_LABEL: /* fall through */
892 case RSVP_OBJ_RECOVERY_LABEL: /* fall through */
893 case RSVP_OBJ_LABEL:
894 switch(rsvp_obj_ctype) {
895 case RSVP_CTYPE_1:
896 while(obj_tlen >= 4 ) {
897 ND_PRINT("%s Label: %u", indent, GET_BE_U_4(obj_tptr));
898 obj_tlen-=4;
899 obj_tptr+=4;
900 }
901 break;
902 case RSVP_CTYPE_2:
903 if (obj_tlen < 4)
904 goto obj_tooshort;
905 ND_PRINT("%s Generalized Label: %u",
906 indent,
907 GET_BE_U_4(obj_tptr));
908 obj_tlen-=4;
909 obj_tptr+=4;
910 break;
911 case RSVP_CTYPE_3:
912 if (obj_tlen < 12)
913 goto obj_tooshort;
914 ND_PRINT("%s Waveband ID: %u%s Start Label: %u, Stop Label: %u",
915 indent,
916 GET_BE_U_4(obj_tptr),
917 indent,
918 GET_BE_U_4(obj_tptr + 4),
919 GET_BE_U_4(obj_tptr + 8));
920 obj_tlen-=12;
921 obj_tptr+=12;
922 break;
923 default:
924 hexdump=TRUE;
925 }
926 break;
927
928 case RSVP_OBJ_STYLE:
929 switch(rsvp_obj_ctype) {
930 case RSVP_CTYPE_1:
931 if (obj_tlen < 4)
932 goto obj_tooshort;
933 ND_PRINT("%s Reservation Style: %s, Flags: [0x%02x]",
934 indent,
935 tok2str(rsvp_resstyle_values,
936 "Unknown",
937 GET_BE_U_3(obj_tptr + 1)),
938 GET_U_1(obj_tptr));
939 obj_tlen-=4;
940 obj_tptr+=4;
941 break;
942 default:
943 hexdump=TRUE;
944 }
945 break;
946
947 case RSVP_OBJ_SENDER_TEMPLATE:
948 switch(rsvp_obj_ctype) {
949 case RSVP_CTYPE_IPV4:
950 if (obj_tlen < 8)
951 goto obj_tooshort;
952 ND_PRINT("%s Source Address: %s, Source Port: %u",
953 indent,
954 GET_IPADDR_STRING(obj_tptr),
955 GET_BE_U_2(obj_tptr + 6));
956 obj_tlen-=8;
957 obj_tptr+=8;
958 break;
959 case RSVP_CTYPE_IPV6:
960 if (obj_tlen < 20)
961 goto obj_tooshort;
962 ND_PRINT("%s Source Address: %s, Source Port: %u",
963 indent,
964 GET_IP6ADDR_STRING(obj_tptr),
965 GET_BE_U_2(obj_tptr + 18));
966 obj_tlen-=20;
967 obj_tptr+=20;
968 break;
969 case RSVP_CTYPE_13: /* IPv6 p2mp LSP tunnel */
970 if (obj_tlen < 40)
971 goto obj_tooshort;
972 ND_PRINT("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
973 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
974 indent,
975 GET_IP6ADDR_STRING(obj_tptr),
976 GET_BE_U_2(obj_tptr + 18),
977 indent,
978 GET_IP6ADDR_STRING(obj_tptr+20),
979 GET_BE_U_2(obj_tptr + 38));
980 obj_tlen-=40;
981 obj_tptr+=40;
982 break;
983 case RSVP_CTYPE_TUNNEL_IPV4:
984 if (obj_tlen < 8)
985 goto obj_tooshort;
986 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
987 indent,
988 GET_IPADDR_STRING(obj_tptr),
989 GET_BE_U_2(obj_tptr + 6));
990 obj_tlen-=8;
991 obj_tptr+=8;
992 break;
993 case RSVP_CTYPE_12: /* IPv4 p2mp LSP tunnel */
994 if (obj_tlen < 16)
995 goto obj_tooshort;
996 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
997 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
998 indent,
999 GET_IPADDR_STRING(obj_tptr),
1000 GET_BE_U_2(obj_tptr + 6),
1001 indent,
1002 GET_IPADDR_STRING(obj_tptr+8),
1003 GET_BE_U_2(obj_tptr + 12));
1004 obj_tlen-=16;
1005 obj_tptr+=16;
1006 break;
1007 default:
1008 hexdump=TRUE;
1009 }
1010 break;
1011
1012 case RSVP_OBJ_LABEL_REQ:
1013 switch(rsvp_obj_ctype) {
1014 case RSVP_CTYPE_1:
1015 while(obj_tlen >= 4 ) {
1016 ND_PRINT("%s L3 Protocol ID: %s",
1017 indent,
1018 tok2str(ethertype_values,
1019 "Unknown Protocol (0x%04x)",
1020 GET_BE_U_2(obj_tptr + 2)));
1021 obj_tlen-=4;
1022 obj_tptr+=4;
1023 }
1024 break;
1025 case RSVP_CTYPE_2:
1026 if (obj_tlen < 12)
1027 goto obj_tooshort;
1028 ND_PRINT("%s L3 Protocol ID: %s",
1029 indent,
1030 tok2str(ethertype_values,
1031 "Unknown Protocol (0x%04x)",
1032 GET_BE_U_2(obj_tptr + 2)));
1033 ND_PRINT(",%s merge capability",
1034 ((GET_U_1(obj_tptr + 4)) & 0x80) ? "no" : "" );
1035 ND_PRINT("%s Minimum VPI/VCI: %u/%u",
1036 indent,
1037 (GET_BE_U_2(obj_tptr + 4))&0xfff,
1038 (GET_BE_U_2(obj_tptr + 6)) & 0xfff);
1039 ND_PRINT("%s Maximum VPI/VCI: %u/%u",
1040 indent,
1041 (GET_BE_U_2(obj_tptr + 8))&0xfff,
1042 (GET_BE_U_2(obj_tptr + 10)) & 0xfff);
1043 obj_tlen-=12;
1044 obj_tptr+=12;
1045 break;
1046 case RSVP_CTYPE_3:
1047 if (obj_tlen < 12)
1048 goto obj_tooshort;
1049 ND_PRINT("%s L3 Protocol ID: %s",
1050 indent,
1051 tok2str(ethertype_values,
1052 "Unknown Protocol (0x%04x)",
1053 GET_BE_U_2(obj_tptr + 2)));
1054 ND_PRINT("%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI",
1055 indent,
1056 (GET_BE_U_4(obj_tptr + 4))&0x7fffff,
1057 (GET_BE_U_4(obj_tptr + 8))&0x7fffff,
1058 (((GET_BE_U_2(obj_tptr + 4)>>7)&3) == 0 ) ? "10" : "",
1059 (((GET_BE_U_2(obj_tptr + 4) >> 7) & 3) == 2 ) ? "23" : "");
1060 obj_tlen-=12;
1061 obj_tptr+=12;
1062 break;
1063 case RSVP_CTYPE_4:
1064 if (obj_tlen < 4)
1065 goto obj_tooshort;
1066 ND_PRINT("%s LSP Encoding Type: %s (%u)",
1067 indent,
1068 tok2str(gmpls_encoding_values,
1069 "Unknown",
1070 GET_U_1(obj_tptr)),
1071 GET_U_1(obj_tptr));
1072 ND_PRINT("%s Switching Type: %s (%u), Payload ID: %s (0x%04x)",
1073 indent,
1074 tok2str(gmpls_switch_cap_values,
1075 "Unknown",
1076 GET_U_1((obj_tptr + 1))),
1077 GET_U_1(obj_tptr + 1),
1078 tok2str(gmpls_payload_values,
1079 "Unknown",
1080 GET_BE_U_2(obj_tptr + 2)),
1081 GET_BE_U_2(obj_tptr + 2));
1082 obj_tlen-=4;
1083 obj_tptr+=4;
1084 break;
1085 default:
1086 hexdump=TRUE;
1087 }
1088 break;
1089
1090 case RSVP_OBJ_RRO:
1091 case RSVP_OBJ_ERO:
1092 switch(rsvp_obj_ctype) {
1093 case RSVP_CTYPE_IPV4:
1094 while(obj_tlen >= 4 ) {
1095 u_char length;
1096
1097 ND_TCHECK_4(obj_tptr);
1098 length = GET_U_1(obj_tptr + 1);
1099 ND_PRINT("%s Subobject Type: %s, length %u",
1100 indent,
1101 tok2str(rsvp_obj_xro_values,
1102 "Unknown %u",
1103 RSVP_OBJ_XRO_MASK_SUBOBJ(GET_U_1(obj_tptr))),
1104 length);
1105 if (obj_tlen < length) {
1106 ND_PRINT("%s ERROR: ERO subobject length > object length", indent);
1107 break;
1108 }
1109
1110 if (length == 0) { /* prevent infinite loops */
1111 ND_PRINT("%s ERROR: zero length ERO subtype", indent);
1112 break;
1113 }
1114
1115 switch(RSVP_OBJ_XRO_MASK_SUBOBJ(GET_U_1(obj_tptr))) {
1116 u_char prefix_length;
1117
1118 case RSVP_OBJ_XRO_IPV4:
1119 if (length != 8) {
1120 ND_PRINT(" ERROR: length != 8");
1121 goto invalid;
1122 }
1123 ND_TCHECK_8(obj_tptr);
1124 prefix_length = GET_U_1(obj_tptr + 6);
1125 if (prefix_length != 32) {
1126 ND_PRINT(" ERROR: Prefix length %u != 32",
1127 prefix_length);
1128 goto invalid;
1129 }
1130 ND_PRINT(", %s, %s/%u, Flags: [%s]",
1131 RSVP_OBJ_XRO_MASK_LOOSE(GET_U_1(obj_tptr)) ? "Loose" : "Strict",
1132 GET_IPADDR_STRING(obj_tptr+2),
1133 GET_U_1((obj_tptr + 6)),
1134 bittok2str(rsvp_obj_rro_flag_values,
1135 "none",
1136 GET_U_1((obj_tptr + 7)))); /* rfc3209 says that this field is rsvd. */
1137 break;
1138 case RSVP_OBJ_XRO_LABEL:
1139 if (length != 8) {
1140 ND_PRINT(" ERROR: length != 8");
1141 goto invalid;
1142 }
1143 ND_TCHECK_8(obj_tptr);
1144 ND_PRINT(", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
1145 bittok2str(rsvp_obj_rro_label_flag_values,
1146 "none",
1147 GET_U_1((obj_tptr + 2))),
1148 GET_U_1(obj_tptr + 2),
1149 tok2str(rsvp_ctype_values,
1150 "Unknown",
1151 GET_U_1((obj_tptr + 3)) + (256 * RSVP_OBJ_RRO)),
1152 GET_U_1((obj_tptr + 3)),
1153 GET_BE_U_4(obj_tptr + 4));
1154 }
1155 obj_tlen-=length;
1156 obj_tptr+=length;
1157 }
1158 break;
1159 default:
1160 hexdump=TRUE;
1161 }
1162 break;
1163
1164 case RSVP_OBJ_HELLO:
1165 switch(rsvp_obj_ctype) {
1166 case RSVP_CTYPE_1:
1167 case RSVP_CTYPE_2:
1168 if (obj_tlen < 8)
1169 goto obj_tooshort;
1170 ND_PRINT("%s Source Instance: 0x%08x, Destination Instance: 0x%08x",
1171 indent,
1172 GET_BE_U_4(obj_tptr),
1173 GET_BE_U_4(obj_tptr + 4));
1174 obj_tlen-=8;
1175 obj_tptr+=8;
1176 break;
1177 default:
1178 hexdump=TRUE;
1179 }
1180 break;
1181
1182 case RSVP_OBJ_RESTART_CAPABILITY:
1183 switch(rsvp_obj_ctype) {
1184 case RSVP_CTYPE_1:
1185 if (obj_tlen < 8)
1186 goto obj_tooshort;
1187 ND_PRINT("%s Restart Time: %ums, Recovery Time: %ums",
1188 indent,
1189 GET_BE_U_4(obj_tptr),
1190 GET_BE_U_4(obj_tptr + 4));
1191 obj_tlen-=8;
1192 obj_tptr+=8;
1193 break;
1194 default:
1195 hexdump=TRUE;
1196 }
1197 break;
1198
1199 case RSVP_OBJ_CAPABILITY:
1200 switch(rsvp_obj_ctype) {
1201 case RSVP_CTYPE_1:
1202 if (obj_tlen < 4)
1203 goto obj_tooshort;
1204 uint32_t unused_and_flags = GET_BE_U_4(obj_tptr);
1205 if (unused_and_flags & ~RSVP_OBJ_CAPABILITY_FLAGS_MASK)
1206 ND_PRINT("%s [reserved=0x%08x must be zero]", indent,
1207 unused_and_flags & ~RSVP_OBJ_CAPABILITY_FLAGS_MASK);
1208 ND_PRINT("%s Flags: [%s]",
1209 indent,
1210 bittok2str(rsvp_obj_capability_flag_values,
1211 "none",
1212 (unused_and_flags & RSVP_OBJ_CAPABILITY_FLAGS_MASK)));
1213 obj_tlen-=4;
1214 obj_tptr+=4;
1215 break;
1216 default:
1217 hexdump=TRUE;
1218 }
1219 break;
1220
1221 case RSVP_OBJ_SESSION_ATTRIBUTE:
1222 switch(rsvp_obj_ctype) {
1223 case RSVP_CTYPE_TUNNEL_IPV4:
1224 if (obj_tlen < 4)
1225 goto obj_tooshort;
1226 namelen = GET_U_1(obj_tptr + 3);
1227 if (obj_tlen < 4+namelen)
1228 goto obj_tooshort;
1229 ND_PRINT("%s Session Name: ", indent);
1230 for (i = 0; i < namelen; i++)
1231 fn_print_char(ndo, GET_U_1(obj_tptr + 4 + i));
1232 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
1233 indent,
1234 GET_U_1(obj_tptr),
1235 GET_U_1(obj_tptr + 1),
1236 bittok2str(rsvp_session_attribute_flag_values,
1237 "none",
1238 GET_U_1((obj_tptr + 2))),
1239 GET_U_1(obj_tptr + 2));
1240 obj_tlen-=4+namelen;
1241 obj_tptr+=4+namelen;
1242 break;
1243 default:
1244 hexdump=TRUE;
1245 }
1246 break;
1247
1248 case RSVP_OBJ_GENERALIZED_UNI:
1249 switch(rsvp_obj_ctype) {
1250 u_int subobj_type,af,subobj_len,total_subobj_len;
1251
1252 case RSVP_CTYPE_1:
1253
1254 if (obj_tlen < 4)
1255 goto obj_tooshort;
1256
1257 /* read variable length subobjects */
1258 total_subobj_len = obj_tlen;
1259 while(total_subobj_len > 0) {
1260 /* If RFC 3476 Section 3.1 defined that a sub-object of the
1261 * GENERALIZED_UNI RSVP object must have the Length field as
1262 * a multiple of 4, instead of the check below it would be
1263 * better to test total_subobj_len only once before the loop.
1264 * So long as it does not define it and this while loop does
1265 * not implement such a requirement, let's accept that within
1266 * each iteration subobj_len may happen to be a multiple of 1
1267 * and test it and total_subobj_len respectively.
1268 */
1269 if (total_subobj_len < 4)
1270 goto invalid;
1271 subobj_len = GET_BE_U_2(obj_tptr);
1272 subobj_type = (GET_BE_U_2(obj_tptr + 2))>>8;
1273 af = (GET_BE_U_2(obj_tptr + 2))&0x00FF;
1274
1275 ND_PRINT("%s Subobject Type: %s (%u), AF: %s (%u), length: %u",
1276 indent,
1277 tok2str(rsvp_obj_generalized_uni_values, "Unknown", subobj_type),
1278 subobj_type,
1279 tok2str(af_values, "Unknown", af), af,
1280 subobj_len);
1281
1282 /* In addition to what is explained above, the same spec does not
1283 * explicitly say that the same Length field includes the 4-octet
1284 * sub-object header, but as long as this while loop implements it
1285 * as it does include, let's keep the check below consistent with
1286 * the rest of the code.
1287 *
1288 * XXX - RFC 3476 Section 3.1 says "The contents of these
1289 * sub-objects are described in [8]", where [8] is
1290 * UNI 1.0 Signaling Specification, The Optical
1291 * Internetworking Forum. The URL they give for that
1292 * document is
1293 *
1294 * http://www.oiforum.com/public/UNI_1.0_ia.html
1295 *
1296 * but that doesn't work; the new URL appears to be
1297 *
1298 * https://web.archive.org/web/20160401194747/http://www.oiforum.com/public/documents/OIF-UNI-01.0.pdf
1299 *
1300 * and *that* document, in section 12.5.2.3
1301 * "GENERALIZED_UNI Object (Class-Num=11bbbbbb (TBA))",
1302 * says nothing about the length field in general, but
1303 * some of the examples it gives in subsections have
1304 * length field values that clearly includes the length
1305 * of the sub-object header as well as the length of the
1306 * value.
1307 */
1308 if(subobj_len < 4 || subobj_len > total_subobj_len ||
1309 obj_tlen < subobj_len)
1310 goto invalid;
1311
1312 switch(subobj_type) {
1313 case RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS:
1314 case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS:
1315
1316 switch(af) {
1317 case AFNUM_INET:
1318 if (subobj_len < 8)
1319 goto subobj_tooshort;
1320 ND_PRINT("%s UNI IPv4 TNA address: %s",
1321 indent, GET_IPADDR_STRING(obj_tptr + 4));
1322 break;
1323 case AFNUM_INET6:
1324 if (subobj_len < 20)
1325 goto subobj_tooshort;
1326 ND_PRINT("%s UNI IPv6 TNA address: %s",
1327 indent, GET_IP6ADDR_STRING(obj_tptr + 4));
1328 break;
1329 case AFNUM_NSAP:
1330 if (subobj_len) {
1331 /* unless we have a TLV parser lets just hexdump */
1332 hexdump=TRUE;
1333 }
1334 break;
1335 }
1336 break;
1337
1338 case RSVP_GEN_UNI_SUBOBJ_DIVERSITY:
1339 if (subobj_len > 4) {
1340 /* unless we have a TLV parser lets just hexdump */
1341 hexdump=TRUE;
1342 }
1343 break;
1344
1345 case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL:
1346 if (subobj_len < 16) {
1347 goto subobj_tooshort;
1348 }
1349
1350 ND_PRINT("%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
1351 indent,
1352 ((GET_BE_U_4(obj_tptr + 4))>>31),
1353 ((GET_BE_U_4(obj_tptr + 4))&0xFF),
1354 GET_BE_U_4(obj_tptr + 8),
1355 GET_BE_U_4(obj_tptr + 12));
1356 break;
1357
1358 case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL:
1359 if (subobj_len < 8) {
1360 goto subobj_tooshort;
1361 }
1362
1363 ND_PRINT("%s Service level: %u",
1364 indent, (GET_BE_U_4(obj_tptr + 4)) >> 24);
1365 break;
1366
1367 default:
1368 hexdump=TRUE;
1369 break;
1370 }
1371 total_subobj_len-=subobj_len;
1372 obj_tptr+=subobj_len;
1373 obj_tlen+=subobj_len;
1374 }
1375 break;
1376
1377 default:
1378 hexdump=TRUE;
1379 }
1380 break;
1381
1382 case RSVP_OBJ_RSVP_HOP:
1383 switch(rsvp_obj_ctype) {
1384 case RSVP_CTYPE_3: /* fall through - FIXME add TLV parser */
1385 case RSVP_CTYPE_IPV4:
1386 if (obj_tlen < 8)
1387 goto obj_tooshort;
1388 ND_PRINT("%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1389 indent,
1390 GET_IPADDR_STRING(obj_tptr),
1391 GET_BE_U_4(obj_tptr + 4));
1392 obj_tlen-=8;
1393 obj_tptr+=8;
1394 if (obj_tlen)
1395 hexdump=TRUE; /* unless we have a TLV parser lets just hexdump */
1396 break;
1397 case RSVP_CTYPE_4: /* fall through - FIXME add TLV parser */
1398 case RSVP_CTYPE_IPV6:
1399 if (obj_tlen < 20)
1400 goto obj_tooshort;
1401 ND_PRINT("%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
1402 indent,
1403 GET_IP6ADDR_STRING(obj_tptr),
1404 GET_BE_U_4(obj_tptr + 16));
1405 obj_tlen-=20;
1406 obj_tptr+=20;
1407 hexdump=TRUE; /* unless we have a TLV parser lets just hexdump */
1408 break;
1409 default:
1410 hexdump=TRUE;
1411 }
1412 break;
1413
1414 case RSVP_OBJ_TIME_VALUES:
1415 switch(rsvp_obj_ctype) {
1416 case RSVP_CTYPE_1:
1417 if (obj_tlen < 4)
1418 goto obj_tooshort;
1419 ND_PRINT("%s Refresh Period: %ums",
1420 indent,
1421 GET_BE_U_4(obj_tptr));
1422 obj_tlen-=4;
1423 obj_tptr+=4;
1424 break;
1425 default:
1426 hexdump=TRUE;
1427 }
1428 break;
1429
1430 /* those three objects do share the same semantics */
1431 case RSVP_OBJ_SENDER_TSPEC:
1432 case RSVP_OBJ_ADSPEC:
1433 case RSVP_OBJ_FLOWSPEC:
1434 switch(rsvp_obj_ctype) {
1435 case RSVP_CTYPE_2:
1436 if (obj_tlen < 4)
1437 goto obj_tooshort;
1438 ND_PRINT("%s Msg-Version: %u, length: %u",
1439 indent,
1440 (GET_U_1(obj_tptr) & 0xf0) >> 4,
1441 GET_BE_U_2(obj_tptr + 2) << 2);
1442 obj_tptr+=4; /* get to the start of the service header */
1443 obj_tlen-=4;
1444
1445 while (obj_tlen >= 4) {
1446 intserv_serv_tlen=GET_BE_U_2(obj_tptr + 2)<<2;
1447 ND_PRINT("%s Service Type: %s (%u), break bit %sset, Service length: %u",
1448 indent,
1449 tok2str(rsvp_intserv_service_type_values,"unknown",GET_U_1((obj_tptr))),
1450 GET_U_1(obj_tptr),
1451 (GET_U_1(obj_tptr + 1)&0x80) ? "" : "not ",
1452 intserv_serv_tlen);
1453
1454 obj_tptr+=4; /* get to the start of the parameter list */
1455 obj_tlen-=4;
1456
1457 while (intserv_serv_tlen>=4) {
1458 processed = rsvp_intserv_print(ndo, obj_tptr, obj_tlen);
1459 if (processed == 0)
1460 break;
1461 obj_tlen-=processed;
1462 intserv_serv_tlen-=processed;
1463 obj_tptr+=processed;
1464 }
1465 }
1466 break;
1467 default:
1468 hexdump=TRUE;
1469 }
1470 break;
1471
1472 case RSVP_OBJ_FILTERSPEC:
1473 switch(rsvp_obj_ctype) {
1474 case RSVP_CTYPE_IPV4:
1475 if (obj_tlen < 8)
1476 goto obj_tooshort;
1477 ND_PRINT("%s Source Address: %s, Source Port: %u",
1478 indent,
1479 GET_IPADDR_STRING(obj_tptr),
1480 GET_BE_U_2(obj_tptr + 6));
1481 obj_tlen-=8;
1482 obj_tptr+=8;
1483 break;
1484 case RSVP_CTYPE_IPV6:
1485 if (obj_tlen < 20)
1486 goto obj_tooshort;
1487 ND_PRINT("%s Source Address: %s, Source Port: %u",
1488 indent,
1489 GET_IP6ADDR_STRING(obj_tptr),
1490 GET_BE_U_2(obj_tptr + 18));
1491 obj_tlen-=20;
1492 obj_tptr+=20;
1493 break;
1494 case RSVP_CTYPE_3:
1495 if (obj_tlen < 20)
1496 goto obj_tooshort;
1497 ND_PRINT("%s Source Address: %s, Flow Label: %u",
1498 indent,
1499 GET_IP6ADDR_STRING(obj_tptr),
1500 GET_BE_U_3(obj_tptr + 17));
1501 obj_tlen-=20;
1502 obj_tptr+=20;
1503 break;
1504 case RSVP_CTYPE_TUNNEL_IPV6:
1505 if (obj_tlen < 20)
1506 goto obj_tooshort;
1507 ND_PRINT("%s Source Address: %s, LSP-ID: 0x%04x",
1508 indent,
1509 GET_IPADDR_STRING(obj_tptr),
1510 GET_BE_U_2(obj_tptr + 18));
1511 obj_tlen-=20;
1512 obj_tptr+=20;
1513 break;
1514 case RSVP_CTYPE_13: /* IPv6 p2mp LSP tunnel */
1515 if (obj_tlen < 40)
1516 goto obj_tooshort;
1517 ND_PRINT("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1518 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1519 indent,
1520 GET_IP6ADDR_STRING(obj_tptr),
1521 GET_BE_U_2(obj_tptr + 18),
1522 indent,
1523 GET_IP6ADDR_STRING(obj_tptr+20),
1524 GET_BE_U_2(obj_tptr + 38));
1525 obj_tlen-=40;
1526 obj_tptr+=40;
1527 break;
1528 case RSVP_CTYPE_TUNNEL_IPV4:
1529 if (obj_tlen < 8)
1530 goto obj_tooshort;
1531 ND_PRINT("%s Source Address: %s, LSP-ID: 0x%04x",
1532 indent,
1533 GET_IPADDR_STRING(obj_tptr),
1534 GET_BE_U_2(obj_tptr + 6));
1535 obj_tlen-=8;
1536 obj_tptr+=8;
1537 break;
1538 case RSVP_CTYPE_12: /* IPv4 p2mp LSP tunnel */
1539 if (obj_tlen < 16)
1540 goto obj_tooshort;
1541 ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
1542 "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
1543 indent,
1544 GET_IPADDR_STRING(obj_tptr),
1545 GET_BE_U_2(obj_tptr + 6),
1546 indent,
1547 GET_IPADDR_STRING(obj_tptr+8),
1548 GET_BE_U_2(obj_tptr + 12));
1549 obj_tlen-=16;
1550 obj_tptr+=16;
1551 break;
1552 default:
1553 hexdump=TRUE;
1554 }
1555 break;
1556
1557 case RSVP_OBJ_FASTREROUTE:
1558 /* the differences between c-type 1 and 7 are minor */
1559 obj_ptr.rsvp_obj_frr = (const struct rsvp_obj_frr_t *)obj_tptr;
1560
1561 switch(rsvp_obj_ctype) {
1562 case RSVP_CTYPE_1: /* new style */
1563 if (obj_tlen < sizeof(struct rsvp_obj_frr_t))
1564 goto obj_tooshort;
1565 bw.i = GET_BE_U_4(obj_ptr.rsvp_obj_frr->bandwidth);
1566 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1567 indent,
1568 obj_ptr.rsvp_obj_frr->setup_prio,
1569 obj_ptr.rsvp_obj_frr->hold_prio,
1570 obj_ptr.rsvp_obj_frr->hop_limit,
1571 bw.f * 8 / 1000000);
1572 ND_PRINT("%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
1573 indent,
1574 GET_BE_U_4(obj_ptr.rsvp_obj_frr->include_any),
1575 GET_BE_U_4(obj_ptr.rsvp_obj_frr->exclude_any),
1576 GET_BE_U_4(obj_ptr.rsvp_obj_frr->include_all));
1577 obj_tlen-=sizeof(struct rsvp_obj_frr_t);
1578 obj_tptr+=sizeof(struct rsvp_obj_frr_t);
1579 break;
1580
1581 case RSVP_CTYPE_TUNNEL_IPV4: /* old style */
1582 if (obj_tlen < 16)
1583 goto obj_tooshort;
1584 bw.i = GET_BE_U_4(obj_ptr.rsvp_obj_frr->bandwidth);
1585 ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
1586 indent,
1587 obj_ptr.rsvp_obj_frr->setup_prio,
1588 obj_ptr.rsvp_obj_frr->hold_prio,
1589 obj_ptr.rsvp_obj_frr->hop_limit,
1590 bw.f * 8 / 1000000);
1591 ND_PRINT("%s Include Colors: 0x%08x, Exclude Colors: 0x%08x",
1592 indent,
1593 GET_BE_U_4(obj_ptr.rsvp_obj_frr->include_any),
1594 GET_BE_U_4(obj_ptr.rsvp_obj_frr->exclude_any));
1595 obj_tlen-=16;
1596 obj_tptr+=16;
1597 break;
1598
1599 default:
1600 hexdump=TRUE;
1601 }
1602 break;
1603
1604 case RSVP_OBJ_DETOUR:
1605 switch(rsvp_obj_ctype) {
1606 case RSVP_CTYPE_TUNNEL_IPV4:
1607 while(obj_tlen >= 8) {
1608 ND_PRINT("%s PLR-ID: %s, Avoid-Node-ID: %s",
1609 indent,
1610 GET_IPADDR_STRING(obj_tptr),
1611 GET_IPADDR_STRING(obj_tptr + 4));
1612 obj_tlen-=8;
1613 obj_tptr+=8;
1614 }
1615 break;
1616 default:
1617 hexdump=TRUE;
1618 }
1619 break;
1620
1621 case RSVP_OBJ_CLASSTYPE:
1622 case RSVP_OBJ_CLASSTYPE_OLD: /* fall through */
1623 switch(rsvp_obj_ctype) {
1624 case RSVP_CTYPE_1:
1625 if (obj_tlen < 4)
1626 goto obj_tooshort;
1627 ND_PRINT("%s CT: %u",
1628 indent,
1629 GET_BE_U_4(obj_tptr) & 0x7);
1630 obj_tlen-=4;
1631 obj_tptr+=4;
1632 break;
1633 default:
1634 hexdump=TRUE;
1635 }
1636 break;
1637
1638 case RSVP_OBJ_ERROR_SPEC:
1639 switch(rsvp_obj_ctype) {
1640 case RSVP_CTYPE_3: /* fall through - FIXME add TLV parser */
1641 case RSVP_CTYPE_IPV4:
1642 if (obj_tlen < 8)
1643 goto obj_tooshort;
1644 error_code=GET_U_1(obj_tptr + 5);
1645 error_value=GET_BE_U_2(obj_tptr + 6);
1646 ND_PRINT("%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1647 indent,
1648 GET_IPADDR_STRING(obj_tptr),
1649 GET_U_1(obj_tptr + 4),
1650 indent,
1651 tok2str(rsvp_obj_error_code_values,"unknown",error_code),
1652 error_code);
1653 switch (error_code) {
1654 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING:
1655 ND_PRINT(", Error Value: %s (%u)",
1656 tok2str(rsvp_obj_error_code_routing_values,"unknown",error_value),
1657 error_value);
1658 break;
1659 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE: /* fall through */
1660 case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD:
1661 ND_PRINT(", Error Value: %s (%u)",
1662 tok2str(rsvp_obj_error_code_diffserv_te_values,"unknown",error_value),
1663 error_value);
1664 break;
1665 default:
1666 ND_PRINT(", Unknown Error Value (%u)", error_value);
1667 break;
1668 }
1669 obj_tlen-=8;
1670 obj_tptr+=8;
1671 break;
1672 case RSVP_CTYPE_4: /* fall through - FIXME add TLV parser */
1673 case RSVP_CTYPE_IPV6:
1674 if (obj_tlen < 20)
1675 goto obj_tooshort;
1676 error_code=GET_U_1(obj_tptr + 17);
1677 error_value=GET_BE_U_2(obj_tptr + 18);
1678 ND_PRINT("%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)",
1679 indent,
1680 GET_IP6ADDR_STRING(obj_tptr),
1681 GET_U_1(obj_tptr + 16),
1682 indent,
1683 tok2str(rsvp_obj_error_code_values,"unknown",error_code),
1684 error_code);
1685
1686 switch (error_code) {
1687 case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING:
1688 ND_PRINT(", Error Value: %s (%u)",
1689 tok2str(rsvp_obj_error_code_routing_values,"unknown",error_value),
1690 error_value);
1691 break;
1692 default:
1693 break;
1694 }
1695 obj_tlen-=20;
1696 obj_tptr+=20;
1697 break;
1698 default:
1699 hexdump=TRUE;
1700 }
1701 break;
1702
1703 case RSVP_OBJ_PROPERTIES:
1704 switch(rsvp_obj_ctype) {
1705 case RSVP_CTYPE_1:
1706 if (obj_tlen < 4)
1707 goto obj_tooshort;
1708 padbytes = GET_BE_U_2(obj_tptr + 2);
1709 ND_PRINT("%s TLV count: %u, padding bytes: %u",
1710 indent,
1711 GET_BE_U_2(obj_tptr),
1712 padbytes);
1713 obj_tlen-=4;
1714 obj_tptr+=4;
1715 /* loop through as long there is anything longer than the TLV header (2) */
1716 while(obj_tlen >= 2 + padbytes) {
1717 ND_PRINT("%s %s TLV (0x%02x), length: %u", /* length includes header */
1718 indent,
1719 tok2str(rsvp_obj_prop_tlv_values,"unknown",GET_U_1(obj_tptr)),
1720 GET_U_1(obj_tptr),
1721 GET_U_1(obj_tptr + 1));
1722 if (obj_tlen < GET_U_1(obj_tptr + 1))
1723 goto obj_tooshort;
1724 if (GET_U_1(obj_tptr + 1) < 2) {
1725 ND_PRINT("%sERROR: property TLV is too short", indent);
1726 return -1;
1727 }
1728 print_unknown_data(ndo, obj_tptr + 2, "\n\t\t",
1729 GET_U_1(obj_tptr + 1) - 2);
1730 obj_tlen-=GET_U_1(obj_tptr + 1);
1731 obj_tptr+=GET_U_1(obj_tptr + 1);
1732 }
1733 break;
1734 default:
1735 hexdump=TRUE;
1736 }
1737 break;
1738
1739 case RSVP_OBJ_MESSAGE_ID: /* fall through */
1740 case RSVP_OBJ_MESSAGE_ID_ACK: /* fall through */
1741 case RSVP_OBJ_MESSAGE_ID_LIST:
1742 switch(rsvp_obj_ctype) {
1743 case RSVP_CTYPE_1:
1744 case RSVP_CTYPE_2:
1745 if (obj_tlen < 4)
1746 goto obj_tooshort;
1747 ND_PRINT("%s Flags [0x%02x], epoch: %u",
1748 indent,
1749 GET_U_1(obj_tptr),
1750 GET_BE_U_3(obj_tptr + 1));
1751 obj_tlen-=4;
1752 obj_tptr+=4;
1753 /* loop through as long there are no messages left */
1754 while(obj_tlen >= 4) {
1755 ND_PRINT("%s Message-ID 0x%08x (%u)",
1756 indent,
1757 GET_BE_U_4(obj_tptr),
1758 GET_BE_U_4(obj_tptr));
1759 obj_tlen-=4;
1760 obj_tptr+=4;
1761 }
1762 break;
1763 default:
1764 hexdump=TRUE;
1765 }
1766 break;
1767
1768 case RSVP_OBJ_INTEGRITY:
1769 switch(rsvp_obj_ctype) {
1770 case RSVP_CTYPE_1:
1771 if (obj_tlen < sizeof(struct rsvp_obj_integrity_t))
1772 goto obj_tooshort;
1773 obj_ptr.rsvp_obj_integrity = (const struct rsvp_obj_integrity_t *)obj_tptr;
1774 ND_PRINT("%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
1775 indent,
1776 GET_BE_U_2(obj_ptr.rsvp_obj_integrity->key_id),
1777 GET_BE_U_4(obj_ptr.rsvp_obj_integrity->key_id + 2),
1778 GET_BE_U_4(obj_ptr.rsvp_obj_integrity->sequence),
1779 GET_BE_U_4(obj_ptr.rsvp_obj_integrity->sequence + 4),
1780 bittok2str(rsvp_obj_integrity_flag_values,
1781 "none",
1782 obj_ptr.rsvp_obj_integrity->flags));
1783 ND_PRINT("%s MD5-sum 0x%08x%08x%08x%08x ",
1784 indent,
1785 GET_BE_U_4(obj_ptr.rsvp_obj_integrity->digest),
1786 GET_BE_U_4(obj_ptr.rsvp_obj_integrity->digest + 4),
1787 GET_BE_U_4(obj_ptr.rsvp_obj_integrity->digest + 8),
1788 GET_BE_U_4(obj_ptr.rsvp_obj_integrity->digest + 12));
1789
1790 sigcheck = signature_verify(ndo, pptr, plen,
1791 obj_ptr.rsvp_obj_integrity->digest,
1792 rsvp_clear_checksum,
1793 rsvp_com_header);
1794 ND_PRINT(" (%s)", tok2str(signature_check_values, "Unknown", sigcheck));
1795
1796 obj_tlen+=sizeof(struct rsvp_obj_integrity_t);
1797 obj_tptr+=sizeof(struct rsvp_obj_integrity_t);
1798 break;
1799 default:
1800 hexdump=TRUE;
1801 }
1802 break;
1803
1804 case RSVP_OBJ_ADMIN_STATUS:
1805 switch(rsvp_obj_ctype) {
1806 case RSVP_CTYPE_1:
1807 if (obj_tlen < 4)
1808 goto obj_tooshort;
1809 ND_PRINT("%s Flags [%s]", indent,
1810 bittok2str(rsvp_obj_admin_status_flag_values, "none",
1811 GET_BE_U_4(obj_tptr)));
1812 obj_tlen-=4;
1813 obj_tptr+=4;
1814 break;
1815 default:
1816 hexdump=TRUE;
1817 }
1818 break;
1819
1820 case RSVP_OBJ_LABEL_SET:
1821 switch(rsvp_obj_ctype) {
1822 case RSVP_CTYPE_1:
1823 if (obj_tlen < 4)
1824 goto obj_tooshort;
1825 action = (GET_BE_U_2(obj_tptr)>>8);
1826
1827 ND_PRINT("%s Action: %s (%u), Label type: %u", indent,
1828 tok2str(rsvp_obj_label_set_action_values, "Unknown", action),
1829 action, (GET_BE_U_4(obj_tptr) & 0x7F));
1830
1831 switch (action) {
1832 case LABEL_SET_INCLUSIVE_RANGE:
1833 case LABEL_SET_EXCLUSIVE_RANGE: /* fall through */
1834
1835 /* only a couple of subchannels are expected */
1836 if (obj_tlen < 12)
1837 goto obj_tooshort;
1838 ND_PRINT("%s Start range: %u, End range: %u", indent,
1839 GET_BE_U_4(obj_tptr + 4),
1840 GET_BE_U_4(obj_tptr + 8));
1841 obj_tlen-=12;
1842 obj_tptr+=12;
1843 break;
1844
1845 default:
1846 obj_tlen-=4;
1847 obj_tptr+=4;
1848 subchannel = 1;
1849 while(obj_tlen >= 4 ) {
1850 ND_PRINT("%s Subchannel #%u: %u", indent, subchannel,
1851 GET_BE_U_4(obj_tptr));
1852 obj_tptr+=4;
1853 obj_tlen-=4;
1854 subchannel++;
1855 }
1856 break;
1857 }
1858 break;
1859 default:
1860 hexdump=TRUE;
1861 }
1862 break;
1863
1864 case RSVP_OBJ_S2L:
1865 switch (rsvp_obj_ctype) {
1866 case RSVP_CTYPE_IPV4:
1867 if (obj_tlen < 4)
1868 goto obj_tooshort;
1869 ND_PRINT("%s Sub-LSP destination address: %s",
1870 indent, GET_IPADDR_STRING(obj_tptr));
1871
1872 obj_tlen-=4;
1873 obj_tptr+=4;
1874 break;
1875 case RSVP_CTYPE_IPV6:
1876 if (obj_tlen < 16)
1877 goto obj_tooshort;
1878 ND_PRINT("%s Sub-LSP destination address: %s",
1879 indent, GET_IP6ADDR_STRING(obj_tptr));
1880
1881 obj_tlen-=16;
1882 obj_tptr+=16;
1883 break;
1884 default:
1885 hexdump=TRUE;
1886 }
1887 break;
1888
1889 /*
1890 * FIXME those are the defined objects that lack a decoder
1891 * you are welcome to contribute code ;-)
1892 */
1893
1894 case RSVP_OBJ_SCOPE:
1895 case RSVP_OBJ_POLICY_DATA:
1896 case RSVP_OBJ_ACCEPT_LABEL_SET:
1897 case RSVP_OBJ_PROTECTION:
1898 default:
1899 if (ndo->ndo_vflag <= 1)
1900 print_unknown_data(ndo, obj_tptr, "\n\t ", obj_tlen); /* FIXME indentation */
1901 break;
1902 }
1903 /* do we also want to see a hex dump ? */
1904 if (ndo->ndo_vflag > 1 || hexdump == TRUE)
1905 print_unknown_data(ndo, tptr + sizeof(struct rsvp_object_header), "\n\t ", /* FIXME indentation */
1906 rsvp_obj_len - sizeof(struct rsvp_object_header));
1907
1908 tptr+=rsvp_obj_len;
1909 tlen-=rsvp_obj_len;
1910 }
1911 return 0;
1912 subobj_tooshort:
1913 ND_PRINT("%sERROR: sub-object is too short", indent);
1914 return -1;
1915 obj_tooshort:
1916 ND_PRINT("%sERROR: object is too short", indent);
1917 return -1;
1918 invalid:
1919 nd_print_invalid(ndo);
1920 return -1;
1921 trunc:
1922 nd_print_trunc(ndo);
1923 return -1;
1924 }
1925
1926 void
1927 rsvp_print(netdissect_options *ndo,
1928 const u_char *pptr, u_int len)
1929 {
1930 const struct rsvp_common_header *rsvp_com_header;
1931 uint8_t version_flags, msg_type;
1932 const u_char *tptr;
1933 u_short plen, tlen;
1934
1935 ndo->ndo_protocol = "rsvp";
1936 tptr=pptr;
1937
1938 rsvp_com_header = (const struct rsvp_common_header *)pptr;
1939 ND_TCHECK_SIZE(rsvp_com_header);
1940 version_flags = GET_U_1(rsvp_com_header->version_flags);
1941
1942 /*
1943 * Sanity checking of the header.
1944 */
1945 if (RSVP_EXTRACT_VERSION(version_flags) != RSVP_VERSION) {
1946 ND_PRINT("ERROR: RSVP version %u packet not supported",
1947 RSVP_EXTRACT_VERSION(version_flags));
1948 return;
1949 }
1950
1951 msg_type = GET_U_1(rsvp_com_header->msg_type);
1952
1953 /* in non-verbose mode just lets print the basic Message Type*/
1954 if (ndo->ndo_vflag < 1) {
1955 ND_PRINT("RSVPv%u %s Message, length: %u",
1956 RSVP_EXTRACT_VERSION(version_flags),
1957 tok2str(rsvp_msg_type_values, "unknown (%u)",msg_type),
1958 len);
1959 return;
1960 }
1961
1962 /* ok they seem to want to know everything - lets fully decode it */
1963
1964 plen = tlen = GET_BE_U_2(rsvp_com_header->length);
1965
1966 ND_PRINT("\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
1967 RSVP_EXTRACT_VERSION(version_flags),
1968 tok2str(rsvp_msg_type_values, "unknown, type: %u",msg_type),
1969 msg_type,
1970 bittok2str(rsvp_header_flag_values,"none",RSVP_EXTRACT_FLAGS(version_flags)),
1971 tlen,
1972 GET_U_1(rsvp_com_header->ttl),
1973 GET_BE_U_2(rsvp_com_header->checksum));
1974
1975 if (tlen < sizeof(struct rsvp_common_header)) {
1976 ND_PRINT("ERROR: common header too short %u < %zu", tlen,
1977 sizeof(struct rsvp_common_header));
1978 return;
1979 }
1980
1981 tptr+=sizeof(struct rsvp_common_header);
1982 tlen-=sizeof(struct rsvp_common_header);
1983
1984 switch(msg_type) {
1985
1986 case RSVP_MSGTYPE_BUNDLE:
1987 /*
1988 * Process each submessage in the bundle message.
1989 * Bundle messages may not contain bundle submessages, so we don't
1990 * need to handle bundle submessages specially.
1991 */
1992 while(tlen > 0) {
1993 const u_char *subpptr=tptr, *subtptr;
1994 u_short subplen, subtlen;
1995
1996 subtptr=subpptr;
1997
1998 rsvp_com_header = (const struct rsvp_common_header *)subpptr;
1999 ND_TCHECK_SIZE(rsvp_com_header);
2000 version_flags = GET_U_1(rsvp_com_header->version_flags);
2001
2002 /*
2003 * Sanity checking of the header.
2004 */
2005 if (RSVP_EXTRACT_VERSION(version_flags) != RSVP_VERSION) {
2006 ND_PRINT("ERROR: RSVP version %u packet not supported",
2007 RSVP_EXTRACT_VERSION(version_flags));
2008 return;
2009 }
2010
2011 subplen = subtlen = GET_BE_U_2(rsvp_com_header->length);
2012
2013 msg_type = GET_U_1(rsvp_com_header->msg_type);
2014 ND_PRINT("\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
2015 RSVP_EXTRACT_VERSION(version_flags),
2016 tok2str(rsvp_msg_type_values, "unknown, type: %u",msg_type),
2017 msg_type,
2018 bittok2str(rsvp_header_flag_values,"none",RSVP_EXTRACT_FLAGS(version_flags)),
2019 subtlen,
2020 GET_U_1(rsvp_com_header->ttl),
2021 GET_BE_U_2(rsvp_com_header->checksum));
2022
2023 if (subtlen < sizeof(struct rsvp_common_header)) {
2024 ND_PRINT("ERROR: common header too short %u < %zu", subtlen,
2025 sizeof(struct rsvp_common_header));
2026 return;
2027 }
2028
2029 if (tlen < subtlen) {
2030 ND_PRINT("ERROR: common header too large %u > %u", subtlen,
2031 tlen);
2032 return;
2033 }
2034
2035 subtptr+=sizeof(struct rsvp_common_header);
2036 subtlen-=sizeof(struct rsvp_common_header);
2037
2038 /*
2039 * Print all objects in the submessage.
2040 */
2041 if (rsvp_obj_print(ndo, subpptr, subplen, subtptr, "\n\t ", subtlen, rsvp_com_header) == -1)
2042 return;
2043
2044 tptr+=subtlen+sizeof(struct rsvp_common_header);
2045 tlen-=subtlen+sizeof(struct rsvp_common_header);
2046 }
2047
2048 break;
2049
2050 case RSVP_MSGTYPE_PATH:
2051 case RSVP_MSGTYPE_RESV:
2052 case RSVP_MSGTYPE_PATHERR:
2053 case RSVP_MSGTYPE_RESVERR:
2054 case RSVP_MSGTYPE_PATHTEAR:
2055 case RSVP_MSGTYPE_RESVTEAR:
2056 case RSVP_MSGTYPE_RESVCONF:
2057 case RSVP_MSGTYPE_HELLO_OLD:
2058 case RSVP_MSGTYPE_HELLO:
2059 case RSVP_MSGTYPE_ACK:
2060 case RSVP_MSGTYPE_SREFRESH:
2061 /*
2062 * Print all objects in the message.
2063 */
2064 if (rsvp_obj_print(ndo, pptr, plen, tptr, "\n\t ", tlen, rsvp_com_header) == -1)
2065 return;
2066 break;
2067
2068 default:
2069 print_unknown_data(ndo, tptr, "\n\t ", tlen);
2070 break;
2071 }
2072
2073 return;
2074 trunc:
2075 nd_print_trunc(ndo);
2076 }