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