#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-rsvp.c,v 1.19 2003-05-08 14:52:20 hannes Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-rsvp.c,v 1.20 2003-06-07 22:41:31 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
#include "extract.h"
#include "addrtoname.h"
#include "ethertype.h"
+#include "gmpls.h"
/*
* RFC 2205 common header
{ 0, NULL}
};
-#define RSVP_OBJ_SESSION 1 /* rfc2205 */
-#define RSVP_OBJ_RSVP_HOP 3 /* rfc2205 */
+#define RSVP_OBJ_SESSION 1 /* rfc2205 */
+#define RSVP_OBJ_RSVP_HOP 3 /* rfc2205, rfc3473 */
#define RSVP_OBJ_INTEGRITY 4
-#define RSVP_OBJ_TIME_VALUES 5 /* rfc2205 */
+#define RSVP_OBJ_TIME_VALUES 5 /* rfc2205 */
#define RSVP_OBJ_ERROR_SPEC 6
#define RSVP_OBJ_SCOPE 7
-#define RSVP_OBJ_STYLE 8 /* rfc2205 */
-#define RSVP_OBJ_FLOWSPEC 9 /* rfc2215 */
-#define RSVP_OBJ_FILTERSPEC 10 /* rfc2215 */
+#define RSVP_OBJ_STYLE 8 /* rfc2205 */
+#define RSVP_OBJ_FLOWSPEC 9 /* rfc2215 */
+#define RSVP_OBJ_FILTERSPEC 10 /* rfc2215 */
#define RSVP_OBJ_SENDER_TEMPLATE 11
-#define RSVP_OBJ_SENDER_TSPEC 12 /* rfc2215 */
-#define RSVP_OBJ_ADSPEC 13 /* rfc2215 */
+#define RSVP_OBJ_SENDER_TSPEC 12 /* rfc2215 */
+#define RSVP_OBJ_ADSPEC 13 /* rfc2215 */
#define RSVP_OBJ_POLICY_DATA 14
-#define RSVP_OBJ_CONFIRM 15 /* rfc2205 */
-#define RSVP_OBJ_LABEL 16 /* rfc3209 */
-#define RSVP_OBJ_LABEL_REQ 19 /* rfc3209 */
-#define RSVP_OBJ_ERO 20 /* rfc3209 */
-#define RSVP_OBJ_RRO 21 /* rfc3209 */
-#define RSVP_OBJ_HELLO 22 /* rfc3209 */
+#define RSVP_OBJ_CONFIRM 15 /* rfc2205 */
+#define RSVP_OBJ_LABEL 16 /* rfc3209 */
+#define RSVP_OBJ_LABEL_REQ 19 /* rfc3209 */
+#define RSVP_OBJ_ERO 20 /* rfc3209 */
+#define RSVP_OBJ_RRO 21 /* rfc3209 */
+#define RSVP_OBJ_HELLO 22 /* rfc3209 */
#define RSVP_OBJ_MESSAGE_ID 23
#define RSVP_OBJ_MESSAGE_ID_ACK 24
#define RSVP_OBJ_MESSAGE_ID_LIST 25
-#define RSVP_OBJ_RECOVERY_LABEL 34
-#define RSVP_OBJ_UPSTREAM_LABEL 35
+#define RSVP_OBJ_RECOVERY_LABEL 34 /* rfc3473 */
+#define RSVP_OBJ_UPSTREAM_LABEL 35 /* rfc3473 */
+#define RSVP_OBJ_LABEL_SET 36 /* rfc3473 */
+#define RSVP_OBJ_PROTECTION 37 /* rfc3473 */
#define RSVP_OBJ_DETOUR 63 /* draft-ietf-mpls-rsvp-lsp-fastreroute-01 */
-#define RSVP_OBJ_SUGGESTED_LABEL 129
-#define RSVP_OBJ_PROPERTIES 204
+#define RSVP_OBJ_SUGGESTED_LABEL 129 /* rfc3473 */
+#define RSVP_OBJ_ACCEPT_LABEL_SET 130 /* rfc3473 */
+#define RSVP_OBJ_RESTART_CAPABILITY 131 /* rfc3473 */
+#define RSVP_OBJ_NOTIFY_REQ 195 /* rfc3473 */
+#define RSVP_OBJ_ADMIN_STATUS 196 /* rfc3473 */
+#define RSVP_OBJ_PROPERTIES 204 /* juniper proprietary */
#define RSVP_OBJ_FASTREROUTE 205 /* draft-ietf-mpls-rsvp-lsp-fastreroute-01 */
#define RSVP_OBJ_SESSION_ATTRIBUTE 207 /* rfc3209 */
-#define RSVP_OBJ_RESTART_CAPABILITY 131 /* draft-pan-rsvp-te-restart */
+#define RSVP_OBJ_CALL_ID 230 /* rfc3474 */
+#define RSVP_OBJ_CALL_OPS 236 /* rfc3474 */
static const struct tok rsvp_obj_values[] = {
{ RSVP_OBJ_SESSION, "Session" },
{ RSVP_OBJ_MESSAGE_ID_LIST, "Message ID List" },
{ RSVP_OBJ_RECOVERY_LABEL, "Recovery Label" },
{ RSVP_OBJ_UPSTREAM_LABEL, "Upstream Label" },
+ { RSVP_OBJ_LABEL_SET, "Label Set" },
+ { RSVP_OBJ_ACCEPT_LABEL_SET, "Acceptable Label Set" },
{ RSVP_OBJ_DETOUR, "Detour" },
{ RSVP_OBJ_SUGGESTED_LABEL, "Suggested Label" },
{ RSVP_OBJ_PROPERTIES, "Properties" },
{ RSVP_OBJ_FASTREROUTE, "Fast Re-Route" },
{ RSVP_OBJ_SESSION_ATTRIBUTE, "Session Attribute" },
+ { RSVP_OBJ_CALL_ID, "Call-ID" },
+ { RSVP_OBJ_CALL_OPS, "Call Capability" },
{ RSVP_OBJ_RESTART_CAPABILITY, "Restart Capability" },
+ { RSVP_OBJ_NOTIFY_REQ, "Notify Request" },
+ { RSVP_OBJ_PROTECTION, "Protection" },
+ { RSVP_OBJ_ADMIN_STATUS, "Administrative Status" },
{ 0, NULL}
};
#define RSVP_CTYPE_1 1
#define RSVP_CTYPE_2 2
#define RSVP_CTYPE_3 3
+#define RSVP_CTYPE_4 4
/*
* the ctypes are not globally unique so for
static const struct tok rsvp_ctype_values[] = {
{ 256*RSVP_OBJ_RSVP_HOP+RSVP_CTYPE_IPV4, "IPv4" },
{ 256*RSVP_OBJ_RSVP_HOP+RSVP_CTYPE_IPV6, "IPv6" },
+ { 256*RSVP_OBJ_RSVP_HOP+RSVP_CTYPE_3, "IPv4 plus opt. TLVs" },
+ { 256*RSVP_OBJ_RSVP_HOP+RSVP_CTYPE_4, "IPv6 plus opt. TLVs" },
+ { 256*RSVP_OBJ_NOTIFY_REQ+RSVP_CTYPE_IPV4, "IPv4" },
+ { 256*RSVP_OBJ_NOTIFY_REQ+RSVP_CTYPE_IPV6, "IPv6" },
{ 256*RSVP_OBJ_CONFIRM+RSVP_CTYPE_IPV4, "IPv4" },
{ 256*RSVP_OBJ_CONFIRM+RSVP_CTYPE_IPV6, "IPv6" },
{ 256*RSVP_OBJ_TIME_VALUES+RSVP_CTYPE_1, "1" },
{ 256*RSVP_OBJ_LABEL_REQ+RSVP_CTYPE_1, "without label range" },
{ 256*RSVP_OBJ_LABEL_REQ+RSVP_CTYPE_2, "with ATM label range" },
{ 256*RSVP_OBJ_LABEL_REQ+RSVP_CTYPE_3, "with FR label range" },
+ { 256*RSVP_OBJ_LABEL_REQ+RSVP_CTYPE_4, "generalized" },
{ 256*RSVP_OBJ_LABEL+RSVP_CTYPE_1, "1" },
+ { 256*RSVP_OBJ_LABEL+RSVP_CTYPE_3, "Waveband Switching" },
+ { 256*RSVP_OBJ_SUGGESTED_LABEL+RSVP_CTYPE_1, "1" },
+ { 256*RSVP_OBJ_SUGGESTED_LABEL+RSVP_CTYPE_3, "Waveband Switching" },
+ { 256*RSVP_OBJ_UPSTREAM_LABEL+RSVP_CTYPE_1, "1" },
+ { 256*RSVP_OBJ_UPSTREAM_LABEL+RSVP_CTYPE_3, "Waveband Switching" },
{ 256*RSVP_OBJ_ERO+RSVP_CTYPE_IPV4, "IPv4" },
{ 256*RSVP_OBJ_RRO+RSVP_CTYPE_IPV4, "IPv4" },
{ 256*RSVP_OBJ_ERROR_SPEC+RSVP_CTYPE_IPV4, "IPv4" },
{ 256*RSVP_OBJ_ERROR_SPEC+RSVP_CTYPE_IPV6, "IPv6" },
+ { 256*RSVP_OBJ_ERROR_SPEC+RSVP_CTYPE_3, "IPv4 plus opt. TLVs" },
+ { 256*RSVP_OBJ_ERROR_SPEC+RSVP_CTYPE_4, "IPv6 plus opt. TLVs" },
{ 256*RSVP_OBJ_RESTART_CAPABILITY+RSVP_CTYPE_1, "IPv4" },
{ 256*RSVP_OBJ_SESSION_ATTRIBUTE+RSVP_CTYPE_TUNNEL_IPV4, "Tunnel IPv4" },
{ 256*RSVP_OBJ_FASTREROUTE+RSVP_CTYPE_TUNNEL_IPV4, "Tunnel IPv4" },
}
break;
+ case RSVP_OBJ_NOTIFY_REQ:
+ switch(rsvp_obj_ctype) {
+ case RSVP_CTYPE_IPV4:
+ printf("\n\t IPv4 Notify Node Address %s",
+ ipaddr_string(obj_tptr));
+ obj_tlen-=4;
+ obj_tptr+=4;
+ break;
+#ifdef INET6
+ case RSVP_CTYPE_IPV6:
+ printf("\n\t IPv6 Notify Node Address %s",
+ ip6addr_string(obj_tptr));
+ obj_tlen-=16;
+ obj_tptr+=16;
+ break;
+#endif
+ default:
+ hexdump=TRUE;
+ }
+ break;
+
+ case RSVP_OBJ_SUGGESTED_LABEL: /* fall through */
+ case RSVP_OBJ_UPSTREAM_LABEL: /* fall through */
case RSVP_OBJ_LABEL:
switch(rsvp_obj_ctype) {
case RSVP_CTYPE_1:
while(obj_tlen >= 4 ) {
- printf("\n\t Label: %u", EXTRACT_32BITS(obj_tptr));
+ printf("\n\t Label %u", EXTRACT_32BITS(obj_tptr));
obj_tlen-=4;
obj_tptr+=4;
}
break;
+ case RSVP_CTYPE_3:
+ printf("\n\t Waveband ID %u\n\t Start Label %u, Stop Label %u",
+ EXTRACT_32BITS(obj_tptr),
+ EXTRACT_32BITS(obj_tptr+4),
+ EXTRACT_32BITS(obj_tptr+8));
+ obj_tlen-=16;
+ obj_tptr+=16;
+ break;
default:
hexdump=TRUE;
}
switch(rsvp_obj_ctype) {
case RSVP_CTYPE_1:
while(obj_tlen >= 4 ) {
- printf("\n\t L3 Protocol ID: %s",
+ printf("\n\t L3 Protocol ID %s",
tok2str(ethertype_values,
- "Unknown Protocol 0x%04x",
+ "Unknown Protocol (0x%04x)",
EXTRACT_16BITS(obj_tptr+2)));
obj_tlen-=4;
obj_tptr+=4;
}
break;
case RSVP_CTYPE_2:
- printf("\n\t L3 Protocol ID: %s",
+ printf("\n\t L3 Protocol ID %s",
tok2str(ethertype_values,
- "Unknown Protocol 0x%04x",
+ "Unknown Protocol (0x%04x)",
EXTRACT_16BITS(obj_tptr+2)));
printf(",%s merge capability",((*(obj_tptr+4))&0x80) ? "no" : "" );
printf("\n\t Minimum VPI/VCI %u/%u",
obj_tptr+=12;
break;
case RSVP_CTYPE_3:
- printf("\n\t L3 Protocol ID: %s",
+ printf("\n\t L3 Protocol ID %s",
tok2str(ethertype_values,
- "Unknown Protocol 0x%04x",
+ "Unknown Protocol (0x%04x)",
EXTRACT_16BITS(obj_tptr+2)));
printf("\n\t Minimum/Maximum DLCI %u/%u, %s%s bit DLCI",
(EXTRACT_32BITS(obj_tptr+4))&0x7fffff,
obj_tlen-=12;
obj_tptr+=12;
break;
+ case RSVP_CTYPE_4:
+ printf("\n\t LSP Encoding Type %s",
+ tok2str(gmpls_encoding_values,
+ "Unknown (0x%02x)",
+ *obj_tptr));
+ printf("\n\t Switching Type %s, Payload ID %s",
+ tok2str(gmpls_switch_cap_values,
+ "Unknown (0x%02x)",
+ *(obj_tptr+1)),
+ tok2str(gmpls_payload_values,
+ "Unknown (0x%04x)",
+ EXTRACT_16BITS(obj_tptr+2)));
+ obj_tlen-=8;
+ obj_tptr+=8;
+ break;
default:
hexdump=TRUE;
}
case RSVP_OBJ_RSVP_HOP:
switch(rsvp_obj_ctype) {
+ case RSVP_CTYPE_3: /* fall through - FIXME add TLV parser */
case RSVP_CTYPE_IPV4:
printf("\n\t Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
ipaddr_string(obj_tptr),
obj_tptr+=8;
break;
#ifdef INET6
+ case RSVP_CTYPE_4: /* fall through - FIXME add TLV parser */
case RSVP_CTYPE_IPV6:
printf("\n\t Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
ip6addr_string(obj_tptr),
case RSVP_OBJ_ERROR_SPEC:
switch(rsvp_obj_ctype) {
+ case RSVP_CTYPE_3: /* fall through - FIXME add TLV parser */
case RSVP_CTYPE_IPV4:
error_code=*(obj_tptr+5);
error_value=EXTRACT_16BITS(obj_tptr+6);
}
break;
#ifdef INET6
+ case RSVP_CTYPE_4: /* fall through - FIXME add TLV parser */
case RSVP_CTYPE_IPV6:
error_code=*(obj_tptr+17);
error_value=EXTRACT_16BITS(obj_tptr+18);
case RSVP_OBJ_MESSAGE_ID_ACK:
case RSVP_OBJ_MESSAGE_ID_LIST:
case RSVP_OBJ_RECOVERY_LABEL:
- case RSVP_OBJ_UPSTREAM_LABEL:
- case RSVP_OBJ_SUGGESTED_LABEL:
+ case RSVP_OBJ_LABEL_SET:
+ case RSVP_OBJ_ACCEPT_LABEL_SET:
+ case RSVP_OBJ_PROTECTION:
default:
if (vflag <= 1)
print_unknown_data(obj_tptr,"\n\t ",obj_tlen);