]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-rsvp.c
Improve printout of DHCPv6 options.
[tcpdump] / print-rsvp.c
index 346ff384caf858d3cbdf941992d4f05f5064e089..6aa2f6d71bd6eeeb8eb3690084f0157edf3b75df 100644 (file)
@@ -330,6 +330,7 @@ struct rsvp_obj_frr_t {
 #define        RSVP_OBJ_XRO_RES       0
 #define        RSVP_OBJ_XRO_IPV4      1
 #define        RSVP_OBJ_XRO_IPV6      2
+#define        RSVP_OBJ_XRO_LABEL     3
 #define        RSVP_OBJ_XRO_ASN       32
 #define        RSVP_OBJ_XRO_MPLS      64
 
@@ -337,6 +338,7 @@ static const struct tok rsvp_obj_xro_values[] = {
     { RSVP_OBJ_XRO_RES,              "Reserved" },
     { RSVP_OBJ_XRO_IPV4,      "IPv4 prefix" },
     { RSVP_OBJ_XRO_IPV6,      "IPv6 prefix" },
+    { RSVP_OBJ_XRO_LABEL,     "Label" },
     { RSVP_OBJ_XRO_ASN,       "Autonomous system number" },
     { RSVP_OBJ_XRO_MPLS,      "MPLS label switched path termination" },
     { 0, NULL}
@@ -351,6 +353,12 @@ static const struct tok rsvp_obj_rro_flag_values[] = {
     { 0, NULL}
 };
 
+/* RFC3209 */
+static const struct tok rsvp_obj_rro_label_flag_values[] = {
+    { 0x01,                   "Global" },
+    { 0, NULL}
+};
+
 static const struct tok rsvp_resstyle_values[] = {
     { 17,                    "Wildcard Filter" },
     { 10,                     "Fixed Filter" },
@@ -383,11 +391,11 @@ static const struct tok rsvp_intserv_parameter_id_values[] = {
 };
 
 static struct tok rsvp_session_attribute_flag_values[] = {
-    { 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 */
+    { 0x01,                  "Local Protection" },
+    { 0x02,                   "Label Recording" },
+    { 0x04,                   "SE Style" },
+    { 0x08,                   "Bandwidth protection" }, /* RFC4090 */
+    { 0x10,                   "Node protection" },      /* RFC4090 */
     { 0, NULL}
 };
 
@@ -628,7 +636,15 @@ rsvp_intserv_print(const u_char *tptr, u_short obj_tlen) {
 }
 
 static int
-rsvp_obj_print (const u_char *pptr, u_int plen, const u_char *tptr,
+rsvp_obj_print (const u_char *pptr
+#ifndef HAVE_LIBCRYPTO
+_U_
+#endif
+, u_int plen
+#ifndef HAVE_LIBCRYPTO
+_U_
+#endif
+, const u_char *tptr,
                 const char *ident, u_int tlen) {
 
     const struct rsvp_object_header *rsvp_obj_header;
@@ -1065,6 +1081,18 @@ rsvp_obj_print (const u_char *pptr, u_int plen, const u_char *tptr,
                                bittok2str(rsvp_obj_rro_flag_values,
                                    "none",
                                    *(obj_tptr+7))); /* rfc3209 says that this field is rsvd. */
+                    break;
+                    case RSVP_OBJ_XRO_LABEL:
+                        printf(", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
+                               bittok2str(rsvp_obj_rro_label_flag_values,
+                                   "none",
+                                   *(obj_tptr+2)),
+                               *(obj_tptr+2),
+                               tok2str(rsvp_ctype_values,
+                                       "Unknown",
+                                       *(obj_tptr+3) + 256*RSVP_OBJ_RRO),
+                               *(obj_tptr+3),
+                               EXTRACT_32BITS(obj_tptr+4));
                     }
                     obj_tlen-=*(obj_tptr+1);
                     obj_tptr+=*(obj_tptr+1);
@@ -1121,14 +1149,14 @@ rsvp_obj_print (const u_char *pptr, u_int plen, const u_char *tptr,
                 printf("%s  Session Name: ", ident);
                 for (i = 0; i < namelen; i++)
                     safeputchar(*(obj_tptr+4+i));
-                printf("%s  Setup Priority: %u, Holding Priority: %u, Flags: [%s]",
+                printf("%s  Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
                        ident,
                        (int)*obj_tptr,
                        (int)*(obj_tptr+1),
-                       tok2str(rsvp_session_attribute_flag_values,
+                       bittok2str(rsvp_session_attribute_flag_values,
                                   "none",
-                                  *(obj_tptr+2)));
-
+                                  *(obj_tptr+2)),
+                       *(obj_tptr+2));
                 obj_tlen-=4+*(obj_tptr+3);
                 obj_tptr+=4+*(obj_tptr+3);
                 break;