X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/52fe86f06da140a0b451b4474abe6f4d15e0ea8b..c519841be2fe87b3cdd9dc45fa7eb8b4266d40a5:/print-rsvp.c?ds=sidebyside diff --git a/print-rsvp.c b/print-rsvp.c index 7766a54c..5592421b 100644 --- a/print-rsvp.c +++ b/print-rsvp.c @@ -14,8 +14,8 @@ */ #ifndef lint -static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-rsvp.c,v 1.12 2002-12-12 18:31:58 hannes Exp $"; +static const char rcsid[] _U_ = + "@(#) $Header: /tcpdump/master/tcpdump/print-rsvp.c,v 1.26 2003-11-16 09:36:35 guy Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -32,6 +32,7 @@ static const char rcsid[] = #include "extract.h" #include "addrtoname.h" #include "ethertype.h" +#include "gmpls.h" /* * RFC 2205 common header @@ -76,6 +77,7 @@ struct rsvp_object_header { #define RSVP_VERSION 1 #define RSVP_EXTRACT_VERSION(x) (((x)&0xf0)>>4) +#define RSVP_EXTRACT_FLAGS(x) ((x)&0x0f) #define RSVP_MSGTYPE_PATH 1 #define RSVP_MSGTYPE_RESV 2 @@ -106,36 +108,48 @@ static const struct tok rsvp_msg_type_values[] = { { 0, NULL} }; -#define RSVP_OBJ_SESSION 1 /* rfc2205 */ -#define RSVP_OBJ_RSVP_HOP 3 /* rfc2205 */ +static const struct tok rsvp_header_flag_values[] = { + { 0x01, "Refresh reduction capable" }, /* rfc2961 */ + { 0, NULL} +}; + +#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" }, @@ -162,12 +176,19 @@ static const struct tok rsvp_obj_values[] = { { 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} }; @@ -178,6 +199,7 @@ static const struct tok rsvp_obj_values[] = { #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 @@ -188,6 +210,10 @@ static const struct tok rsvp_obj_values[] = { 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" }, @@ -202,6 +228,8 @@ static const struct tok rsvp_ctype_values[] = { { 256*RSVP_OBJ_SESSION+RSVP_CTYPE_IPV4, "IPv4" }, { 256*RSVP_OBJ_SESSION+RSVP_CTYPE_IPV6, "IPv6" }, { 256*RSVP_OBJ_SESSION+RSVP_CTYPE_TUNNEL_IPV4, "Tunnel IPv4" }, + { 256*RSVP_OBJ_SENDER_TEMPLATE+RSVP_CTYPE_IPV4, "IPv4" }, + { 256*RSVP_OBJ_SENDER_TEMPLATE+RSVP_CTYPE_IPV6, "IPv6" }, { 256*RSVP_OBJ_SENDER_TEMPLATE+RSVP_CTYPE_TUNNEL_IPV4, "Tunnel IPv4" }, { 256*RSVP_OBJ_STYLE+RSVP_CTYPE_1, "1" }, { 256*RSVP_OBJ_HELLO+RSVP_CTYPE_1, "Hello Request" }, @@ -209,13 +237,30 @@ static const struct tok rsvp_ctype_values[] = { { 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+RSVP_CTYPE_1, "1" }, + { 256*RSVP_OBJ_LABEL_REQ+RSVP_CTYPE_4, "Generalized Label" }, + { 256*RSVP_OBJ_LABEL+RSVP_CTYPE_1, "Label" }, + { 256*RSVP_OBJ_LABEL+RSVP_CTYPE_2, "Generalized Label" }, + { 256*RSVP_OBJ_LABEL+RSVP_CTYPE_3, "Waveband Switching" }, + { 256*RSVP_OBJ_SUGGESTED_LABEL+RSVP_CTYPE_1, "Label" }, + { 256*RSVP_OBJ_SUGGESTED_LABEL+RSVP_CTYPE_2, "Generalized Label" }, + { 256*RSVP_OBJ_SUGGESTED_LABEL+RSVP_CTYPE_3, "Waveband Switching" }, + { 256*RSVP_OBJ_UPSTREAM_LABEL+RSVP_CTYPE_1, "Label" }, + { 256*RSVP_OBJ_UPSTREAM_LABEL+RSVP_CTYPE_2, "Generalized Label" }, + { 256*RSVP_OBJ_UPSTREAM_LABEL+RSVP_CTYPE_3, "Waveband Switching" }, + { 256*RSVP_OBJ_RECOVERY_LABEL+RSVP_CTYPE_1, "Label" }, + { 256*RSVP_OBJ_RECOVERY_LABEL+RSVP_CTYPE_2, "Generalized Label" }, + { 256*RSVP_OBJ_RECOVERY_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" }, { 256*RSVP_OBJ_DETOUR+RSVP_CTYPE_TUNNEL_IPV4, "Tunnel IPv4" }, + { 256*RSVP_OBJ_PROPERTIES+RSVP_CTYPE_1, "1" }, { 0, NULL} }; @@ -237,6 +282,15 @@ static const struct tok rsvp_obj_xro_values[] = { { 0, NULL} }; +/* draft-ietf-mpls-rsvp-lsp-fastreroute-02.txt */ +static const struct tok rsvp_obj_rro_flag_values[] = { + { 0x01, "Local protection available" }, + { 0x02, "Local protection in use" }, + { 0x04, "Bandwidth protection" }, + { 0x08, "Node protection" }, + { 0, NULL} +}; + static const struct tok rsvp_resstyle_values[] = { { 17, "Wildcard Filter" }, { 10, "Fixed Filter" }, @@ -249,8 +303,8 @@ static const struct tok rsvp_resstyle_values[] = { static const struct tok rsvp_intserv_service_type_values[] = { { 1, "Default/Global Information" }, - { RSVP_OBJ_INTSERV_CONTROLLED_LOAD, "Controlled Load" }, { RSVP_OBJ_INTSERV_GUARANTEED_SERV, "Guaranteed Service" }, + { RSVP_OBJ_INTSERV_CONTROLLED_LOAD, "Controlled Load" }, { 0, NULL} }; @@ -261,13 +315,51 @@ static const struct tok rsvp_intserv_parameter_id_values[] = { { 10, "Composed MTU" }, { 127, "Token Bucket TSpec" }, { 130, "Guaranteed Service RSpec" }, + { 133, "End-to-end composed value for C" }, + { 134, "End-to-end composed value for D" }, + { 135, "Since-last-reshaping point composed C" }, + { 136, "Since-last-reshaping point composed D" }, { 0, NULL} }; static struct tok rsvp_session_attribute_flag_values[] = { - { 1, "Local Protection desired" }, - { 2, "Label Recording desired" }, - { 4, "SE Style desired" }, + { 0x01, "Local Protection desired" }, + { 0x02, "Label Recording desired" }, + { 0x04, "SE Style desired" }, + { 0x08, "Bandwidth protection desired" }, /* draft-ietf-mpls-rsvp-lsp-fastreroute-02.txt */ + { 0x10, "Node protection desired" }, /* draft-ietf-mpls-rsvp-lsp-fastreroute-02.txt */ + { 0, NULL} +}; + +static struct tok rsvp_obj_prop_tlv_values[] = { + { 0x01, "Cos" }, + { 0x02, "Metric 1" }, + { 0x04, "Metric 2" }, + { 0x08, "CCC Status" }, + { 0x10, "Path Type" }, + { 0, NULL} +}; + +#define RSVP_OBJ_ERROR_SPEC_CODE_ROUTING 24 +#define RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY 25 + +static struct tok rsvp_obj_error_code_values[] = { + { RSVP_OBJ_ERROR_SPEC_CODE_ROUTING, "Routing Problem" }, + { RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY, "Notify Error" }, + { 0, NULL} +}; + +static struct tok rsvp_obj_error_code_routing_values[] = { + { 1, "Bad EXPLICIT_ROUTE object" }, + { 2, "Bad strict node" }, + { 3, "Bad loose node" }, + { 4, "Bad initial subobject" }, + { 5, "No route available toward destination" }, + { 6, "Unacceptable label value" }, + { 7, "RRO indicated routing loops" }, + { 8, "non-RSVP-capable router in the path" }, + { 9, "MPLS label allocation failure" }, + { 10, "Unsupported L3PID" }, { 0, NULL} }; @@ -311,7 +403,7 @@ rsvp_intserv_print(const u_char *tptr) { * | IS hop cnt (32-bit unsigned integer) | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ - printf("\n\t\tIS hop cnt: %u", EXTRACT_32BITS(tptr+4)); + printf("\n\t\tIS hop count: %u", EXTRACT_32BITS(tptr+4)); break; case 6: @@ -394,18 +486,17 @@ rsvp_intserv_print(const u_char *tptr) { printf("\n\t\tRate: %.10g Mbps", bw.f/125000); printf("\n\t\tSlack Term: %u", EXTRACT_32BITS(tptr+8)); break; - /* - * FIXME those are the defined paramters that lack a decoder - * you are welcome to contribute code ;-) - */ + case 133: case 134: case 135: case 136: + printf("\n\t\tValue: %u", EXTRACT_32BITS(tptr+4)); + break; default: if (vflag <= 1) - print_unknown_data(tptr+4,"\n\t ",parameter_length); + print_unknown_data(tptr+4,"\n\t\t",parameter_length); } return (parameter_length+4); /* header length 4 bytes */ } @@ -416,8 +507,8 @@ rsvp_print(register const u_char *pptr, register u_int len) { const struct rsvp_common_header *rsvp_com_header; const struct rsvp_object_header *rsvp_obj_header; const u_char *tptr,*obj_tptr; - u_short tlen,rsvp_obj_len,rsvp_obj_ctype,obj_tlen; - int hexdump,processed; + u_short tlen,rsvp_obj_len,rsvp_obj_ctype,obj_tlen,intserv_serv_tlen; + int hexdump,processed,padbytes,error_code,error_value; union { float f; u_int32_t i; @@ -448,9 +539,10 @@ rsvp_print(register const u_char *pptr, register u_int len) { tlen=EXTRACT_16BITS(rsvp_com_header->length); - printf("RSVP\n\tv: %u, msg-type: %s, length: %u, ttl: %u, checksum: 0x%04x", + printf("RSVP\n\tv: %u, msg-type: %s, Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x", RSVP_EXTRACT_VERSION(rsvp_com_header->version_flags), tok2str(rsvp_msg_type_values, "unknown, type: %u",rsvp_com_header->msg_type), + bittok2str(rsvp_header_flag_values,"none",RSVP_EXTRACT_FLAGS(rsvp_com_header->version_flags)), tlen, rsvp_com_header->ttl, EXTRACT_16BITS(rsvp_com_header->checksum)); @@ -546,14 +638,35 @@ rsvp_print(register const u_char *pptr, register u_int len) { case RSVP_OBJ_CONFIRM: switch(rsvp_obj_ctype) { case RSVP_CTYPE_IPV4: - printf("\n\t IPv4 ReceiverAddress: %s", + printf("\n\t IPv4 Receiver Address: %s", + ipaddr_string(obj_tptr)); + obj_tlen-=4; + obj_tptr+=4; + break; +#ifdef INET6 + case RSVP_CTYPE_IPV6: + printf("\n\t IPv6 Receiver Address: %s", + ip6addr_string(obj_tptr)); + obj_tlen-=16; + obj_tptr+=16; + break; +#endif + default: + hexdump=TRUE; + } + 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 ReceiverAddress: %s", + printf("\n\t IPv6 Notify Node Address: %s", ip6addr_string(obj_tptr)); obj_tlen-=16; obj_tptr+=16; @@ -564,6 +677,9 @@ rsvp_print(register const u_char *pptr, register u_int len) { } break; + case RSVP_OBJ_SUGGESTED_LABEL: /* fall through */ + case RSVP_OBJ_UPSTREAM_LABEL: /* fall through */ + case RSVP_OBJ_RECOVERY_LABEL: /* fall through */ case RSVP_OBJ_LABEL: switch(rsvp_obj_ctype) { case RSVP_CTYPE_1: @@ -573,6 +689,20 @@ rsvp_print(register const u_char *pptr, register u_int len) { obj_tptr+=4; } break; + case RSVP_CTYPE_2: + printf("\n\t Generalized 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-=12; + obj_tptr+=12; + break; default: hexdump=TRUE; } @@ -596,6 +726,22 @@ rsvp_print(register const u_char *pptr, register u_int len) { case RSVP_OBJ_SENDER_TEMPLATE: switch(rsvp_obj_ctype) { + case RSVP_CTYPE_IPV4: + printf("\n\t Source Address: %s, Source Port: %u", + ipaddr_string(obj_tptr), + EXTRACT_16BITS(obj_tptr+6)); + obj_tlen-=8; + obj_tptr+=8; + break; +#ifdef INET6 + case RSVP_CTYPE_IPV6: + printf("\n\t Source Address: %s, Source Port: %u", + ip6addr_string(obj_tptr), + EXTRACT_16BITS(obj_tptr+18)); + obj_tlen-=20; + obj_tptr+=20; + break; +#endif case RSVP_CTYPE_TUNNEL_IPV4: printf("\n\t IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x", ipaddr_string(obj_tptr), @@ -614,7 +760,7 @@ rsvp_print(register const u_char *pptr, register u_int len) { while(obj_tlen >= 4 ) { 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; @@ -623,13 +769,13 @@ rsvp_print(register const u_char *pptr, register u_int len) { case RSVP_CTYPE_2: 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", + printf("\n\t Minimum VPI/VCI: %u/%u", (EXTRACT_16BITS(obj_tptr+4))&0xfff, (EXTRACT_16BITS(obj_tptr+6))&0xfff); - printf("\n\t Maximum VPI/VCI %u/%u", + printf("\n\t Maximum VPI/VCI: %u/%u", (EXTRACT_16BITS(obj_tptr+8))&0xfff, (EXTRACT_16BITS(obj_tptr+10))&0xfff); obj_tlen-=12; @@ -638,9 +784,9 @@ rsvp_print(register const u_char *pptr, register u_int len) { case RSVP_CTYPE_3: 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", + printf("\n\t Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI", (EXTRACT_32BITS(obj_tptr+4))&0x7fffff, (EXTRACT_32BITS(obj_tptr+8))&0x7fffff, (((EXTRACT_16BITS(obj_tptr+4)>>7)&3) == 0 ) ? "10" : "", @@ -648,6 +794,24 @@ rsvp_print(register const u_char *pptr, register u_int len) { obj_tlen-=12; obj_tptr+=12; break; + case RSVP_CTYPE_4: + printf("\n\t LSP Encoding Type: %s (%u)", + tok2str(gmpls_encoding_values, + "Unknown", + *obj_tptr), + *obj_tptr); + printf("\n\t Switching Type: %s (%u), Payload ID: %s (0x%04x)", + tok2str(gmpls_switch_cap_values, + "Unknown", + *(obj_tptr+1)), + *(obj_tptr+1), + tok2str(gmpls_payload_values, + "Unknown", + EXTRACT_16BITS(obj_tptr+2)), + EXTRACT_16BITS(obj_tptr+2)); + obj_tlen-=8; + obj_tptr+=8; + break; default: hexdump=TRUE; } @@ -664,10 +828,13 @@ rsvp_print(register const u_char *pptr, register u_int len) { RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr))); switch(RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr)) { case RSVP_OBJ_XRO_IPV4: - printf(", %s, %s/%u", + printf(", %s, %s/%u, Flags: [%s]", RSVP_OBJ_XRO_MASK_LOOSE(*obj_tptr) ? "Loose" : "Strict", ipaddr_string(obj_tptr+2), - *(obj_tptr+6)); + *(obj_tptr+6), + bittok2str(rsvp_obj_rro_flag_values, + "none", + *(obj_tptr+7))); /* rfc3209 says that this field is rsvd. */ } obj_tlen-=*(obj_tptr+1); obj_tptr+=*(obj_tptr+1); @@ -682,7 +849,7 @@ rsvp_print(register const u_char *pptr, register u_int len) { switch(rsvp_obj_ctype) { case RSVP_CTYPE_1: case RSVP_CTYPE_2: - printf("\n\t Source Instance 0x%08x, Destination Instance 0x%08x", + printf("\n\t Source Instance: 0x%08x, Destination Instance: 0x%08x", EXTRACT_32BITS(obj_tptr), EXTRACT_32BITS(obj_tptr+4)); obj_tlen-=8; @@ -696,7 +863,7 @@ rsvp_print(register const u_char *pptr, register u_int len) { case RSVP_OBJ_RESTART_CAPABILITY: switch(rsvp_obj_ctype) { case RSVP_CTYPE_1: - printf("\n\t Restart Time: %ums\n\t Recovery Time: %ums", + printf("\n\t Restart Time: %ums, Recovery Time: %ums", EXTRACT_16BITS(obj_tptr), EXTRACT_16BITS(obj_tptr+4)); break; @@ -708,7 +875,7 @@ rsvp_print(register const u_char *pptr, register u_int len) { case RSVP_OBJ_SESSION_ATTRIBUTE: switch(rsvp_obj_ctype) { case RSVP_CTYPE_TUNNEL_IPV4: - printf("\n\t Session Name: %s",(obj_tptr+3)); + printf("\n\t Session Name: %s",(obj_tptr+4)); printf("\n\t Setup Priority: %u, Holding Priority: %u, Flags: [%s]", (int)*obj_tptr, (int)*(obj_tptr+1), @@ -726,20 +893,24 @@ rsvp_print(register const u_char *pptr, register u_int len) { 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), EXTRACT_32BITS(obj_tptr+4)); obj_tlen-=8; obj_tptr+=8; + hexdump=TRUE; /* unless we have a TLV parser lets just hexdump */ 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), EXTRACT_32BITS(obj_tptr+16)); obj_tlen-=20; obj_tptr+=20; + hexdump=TRUE; /* unless we have a TLV parser lets just hexdump */ break; #endif default: @@ -766,22 +937,31 @@ rsvp_print(register const u_char *pptr, register u_int len) { case RSVP_OBJ_FLOWSPEC: switch(rsvp_obj_ctype) { case RSVP_CTYPE_2: - printf("\n\t Msg-Version: %u, length: %u\n\t Service Type: %s (%u), Service length: %u", + printf("\n\t Msg-Version: %u, length: %u", (*obj_tptr & 0xf0) >> 4, - EXTRACT_16BITS(obj_tptr+2)<<2, - tok2str(rsvp_intserv_service_type_values,"unknown",*(obj_tptr+4)), - *(obj_tptr+4), - EXTRACT_16BITS(obj_tptr+6)<<2); + EXTRACT_16BITS(obj_tptr+2)<<2); + obj_tptr+=4; /* get to the start of the service header */ + obj_tlen-=4; - obj_tlen-=8; /* get to the start of the parameter list */ - obj_tptr+=8; + while (obj_tlen >= 4) { + intserv_serv_tlen=EXTRACT_16BITS(obj_tptr+2)<<2; + printf("\n\t Service Type: %s (%u), break bit %s set, Service length: %u", + tok2str(rsvp_intserv_service_type_values,"unknown",*(obj_tptr)), + *(obj_tptr), + (*(obj_tptr+1)&0x80) ? "" : "not", + intserv_serv_tlen); + + obj_tptr+=4; /* get to the start of the parameter list */ + obj_tlen-=4; - while (obj_tlen>4) { - processed = rsvp_intserv_print(obj_tptr); - if (processed == 0) - break; + while (intserv_serv_tlen>=4) { + processed = rsvp_intserv_print(obj_tptr); + if (processed == 0) + break; obj_tlen-=processed; + intserv_serv_tlen-=processed; obj_tptr+=processed; + } } break; default: @@ -869,22 +1049,95 @@ rsvp_print(register const u_char *pptr, register u_int len) { } break; + 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); + printf("\n\t Error Node Adress: %s, Flags: [0x%02x]\n\t Error Code: %s (%u)", + ipaddr_string(obj_tptr), + *(obj_tptr+4), + tok2str(rsvp_obj_error_code_values,"unknown",error_code), + error_code); + switch (error_code) { + case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING: + printf(", Error Value: %s (%u)", + tok2str(rsvp_obj_error_code_routing_values,"unknown",error_value), + error_value); + break; + default: + printf(", Unknown Error Value (%u)", error_value); + break; + } + 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); + printf("\n\t Error Node Adress: %s, Flags: [0x%02x]\n\t Error Code: %s (%u)", + ip6addr_string(obj_tptr), + *(obj_tptr+16), + tok2str(rsvp_obj_error_code_values,"unknown",error_code), + error_code); + + switch (error_code) { + case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING: + printf(", Error Value: %s (%u)", + tok2str(rsvp_obj_error_code_routing_values,"unknown",error_value), + error_value); + break; + default: + break; + } + + break; +#endif + default: + hexdump=TRUE; + } + break; + + case RSVP_OBJ_PROPERTIES: + switch(rsvp_obj_ctype) { + case RSVP_CTYPE_1: + padbytes = EXTRACT_16BITS(obj_tptr+2); + printf("\n\t TLV count: %u, padding bytes: %u", + EXTRACT_16BITS(obj_tptr), + padbytes); + obj_tlen-=4; + obj_tptr+=4; + /* loop through as long there is anything longer than the TLV header (2) */ + while(obj_tlen >= 2 + padbytes) { + printf("\n\t %s TLV (0x%02x), length: %u", /* length includes header */ + tok2str(rsvp_obj_prop_tlv_values,"unknown",*obj_tptr), + *obj_tptr, + *(obj_tptr+1)); + print_unknown_data(obj_tptr+2,"\n\t\t",*(obj_tptr+1)-2); + obj_tlen-=*(obj_tptr+1); + obj_tptr+=*(obj_tptr+1); + } + break; + default: + hexdump=TRUE; + } + break; + /* * FIXME those are the defined objects that lack a decoder * you are welcome to contribute code ;-) */ case RSVP_OBJ_INTEGRITY: - case RSVP_OBJ_ERROR_SPEC: case RSVP_OBJ_SCOPE: case RSVP_OBJ_POLICY_DATA: case RSVP_OBJ_MESSAGE_ID: 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_PROPERTIES: + 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);