+static const struct tok rsvp_intserv_service_type_values[] = {
+ { 1, "Default/Global Information" },
+ { RSVP_OBJ_INTSERV_GUARANTEED_SERV, "Guaranteed Service" },
+ { RSVP_OBJ_INTSERV_CONTROLLED_LOAD, "Controlled Load" },
+ { 0, NULL}
+};
+
+static const struct tok rsvp_intserv_parameter_id_values[] = {
+ { 4, "IS hop cnt" },
+ { 6, "Path b/w estimate" },
+ { 8, "Minimum path latency" },
+ { 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 const struct tok rsvp_session_attribute_flag_values[] = {
+ { 0x01, "Local Protection" },
+ { 0x02, "Label Recording" },
+ { 0x04, "SE Style" },
+ { 0x08, "Bandwidth protection" }, /* RFC4090 */
+ { 0x10, "Node protection" }, /* RFC4090 */
+ { 0, NULL}
+};
+
+static const 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
+#define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE 28
+#define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD 125
+
+static const struct tok rsvp_obj_error_code_values[] = {
+ { RSVP_OBJ_ERROR_SPEC_CODE_ROUTING, "Routing Problem" },
+ { RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY, "Notify Error" },
+ { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE, "Diffserv TE Error" },
+ { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD, "Diffserv TE Error (Old)" },
+ { 0, NULL}
+};
+
+static const 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}
+};
+
+static const struct tok rsvp_obj_error_code_diffserv_te_values[] = {
+ { 1, "Unexpected CT object" },
+ { 2, "Unsupported CT" },
+ { 3, "Invalid CT value" },
+ { 4, "CT/setup priority do not form a configured TE-Class" },
+ { 5, "CT/holding priority do not form a configured TE-Class" },
+ { 6, "CT/setup priority and CT/holding priority do not form a configured TE-Class" },
+ { 7, "Inconsistency between signaled PSC and signaled CT" },
+ { 8, "Inconsistency between signaled PHBs and signaled CT" },
+ { 0, NULL}
+};
+
+/* rfc3473 / rfc 3471 */
+static const struct tok rsvp_obj_admin_status_flag_values[] = {
+ { 0x80000000, "Reflect" },
+ { 0x00000004, "Testing" },
+ { 0x00000002, "Admin-down" },
+ { 0x00000001, "Delete-in-progress" },
+ { 0, NULL}
+};
+
+/* label set actions - rfc3471 */
+#define LABEL_SET_INCLUSIVE_LIST 0
+#define LABEL_SET_EXCLUSIVE_LIST 1
+#define LABEL_SET_INCLUSIVE_RANGE 2
+#define LABEL_SET_EXCLUSIVE_RANGE 3
+
+static const struct tok rsvp_obj_label_set_action_values[] = {
+ { LABEL_SET_INCLUSIVE_LIST, "Inclusive list" },
+ { LABEL_SET_EXCLUSIVE_LIST, "Exclusive list" },
+ { LABEL_SET_INCLUSIVE_RANGE, "Inclusive range" },
+ { LABEL_SET_EXCLUSIVE_RANGE, "Exclusive range" },
+ { 0, NULL}
+};
+
+/* OIF RSVP extensions UNI 1.0 Signaling, release 2 */
+#define RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS 1
+#define RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS 2
+#define RSVP_GEN_UNI_SUBOBJ_DIVERSITY 3
+#define RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL 4
+#define RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL 5
+
+static const struct tok rsvp_obj_generalized_uni_values[] = {
+ { RSVP_GEN_UNI_SUBOBJ_SOURCE_TNA_ADDRESS, "Source TNA address" },
+ { RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS, "Destination TNA address" },
+ { RSVP_GEN_UNI_SUBOBJ_DIVERSITY, "Diversity" },
+ { RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL, "Egress label" },
+ { RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL, "Service level" },
+ { 0, NULL}
+};
+
+/*
+ * this is a dissector for all the intserv defined
+ * specs as defined per rfc2215
+ * it is called from various rsvp objects;
+ * returns the amount of bytes being processed
+ */
+static int
+rsvp_intserv_print(netdissect_options *ndo,
+ const u_char *tptr, u_short obj_tlen)
+{
+ int parameter_id,parameter_length;
+ union {
+ float f;
+ uint32_t i;
+ } bw;
+
+ if (obj_tlen < 4)
+ return 0;
+ ND_TCHECK_8BITS(tptr);
+ parameter_id = *(tptr);
+ ND_TCHECK2(*(tptr + 2), 2);
+ parameter_length = EXTRACT_16BITS(tptr+2)<<2; /* convert wordcount to bytecount */
+
+ ND_PRINT((ndo, "\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
+ tok2str(rsvp_intserv_parameter_id_values,"unknown",parameter_id),
+ parameter_id,
+ parameter_length,
+ *(tptr + 1)));
+
+ if (obj_tlen < parameter_length+4)
+ return 0;
+ switch(parameter_id) { /* parameter_id */
+
+ case 4:
+ /*
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | 4 (e) | (f) | 1 (g) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | IS hop cnt (32-bit unsigned integer) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ if (parameter_length == 4) {
+ ND_TCHECK2(*(tptr + 4), 4);
+ ND_PRINT((ndo, "\n\t\tIS hop count: %u", EXTRACT_32BITS(tptr + 4)));
+ }
+ break;
+
+ case 6:
+ /*
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | 6 (h) | (i) | 1 (j) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Path b/w estimate (32-bit IEEE floating point number) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ if (parameter_length == 4) {
+ ND_TCHECK2(*(tptr + 4), 4);
+ bw.i = EXTRACT_32BITS(tptr+4);
+ ND_PRINT((ndo, "\n\t\tPath b/w estimate: %.10g Mbps", bw.f / 125000));
+ }
+ break;
+
+ case 8:
+ /*
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | 8 (k) | (l) | 1 (m) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Minimum path latency (32-bit integer) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ if (parameter_length == 4) {
+ ND_TCHECK2(*(tptr + 4), 4);
+ ND_PRINT((ndo, "\n\t\tMinimum path latency: "));
+ if (EXTRACT_32BITS(tptr+4) == 0xffffffff)
+ ND_PRINT((ndo, "don't care"));
+ else
+ ND_PRINT((ndo, "%u", EXTRACT_32BITS(tptr + 4)));
+ }
+ break;
+
+ case 10:
+
+ /*
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | 10 (n) | (o) | 1 (p) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Composed MTU (32-bit unsigned integer) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ if (parameter_length == 4) {
+ ND_TCHECK2(*(tptr + 4), 4);
+ ND_PRINT((ndo, "\n\t\tComposed MTU: %u bytes", EXTRACT_32BITS(tptr + 4)));
+ }
+ break;
+ case 127:
+ /*
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | 127 (e) | 0 (f) | 5 (g) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Token Bucket Rate [r] (32-bit IEEE floating point number) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Token Bucket Size [b] (32-bit IEEE floating point number) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Peak Data Rate [p] (32-bit IEEE floating point number) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Minimum Policed Unit [m] (32-bit integer) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Maximum Packet Size [M] (32-bit integer) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+
+ if (parameter_length == 20) {
+ ND_TCHECK2(*(tptr + 4), 20);
+ bw.i = EXTRACT_32BITS(tptr+4);
+ ND_PRINT((ndo, "\n\t\tToken Bucket Rate: %.10g Mbps", bw.f / 125000));
+ bw.i = EXTRACT_32BITS(tptr+8);
+ ND_PRINT((ndo, "\n\t\tToken Bucket Size: %.10g bytes", bw.f));
+ bw.i = EXTRACT_32BITS(tptr+12);
+ ND_PRINT((ndo, "\n\t\tPeak Data Rate: %.10g Mbps", bw.f / 125000));
+ ND_PRINT((ndo, "\n\t\tMinimum Policed Unit: %u bytes", EXTRACT_32BITS(tptr + 16)));
+ ND_PRINT((ndo, "\n\t\tMaximum Packet Size: %u bytes", EXTRACT_32BITS(tptr + 20)));
+ }
+ break;
+
+ case 130:
+ /*
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | 130 (h) | 0 (i) | 2 (j) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Rate [R] (32-bit IEEE floating point number) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Slack Term [S] (32-bit integer) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+
+ if (parameter_length == 8) {
+ ND_TCHECK2(*(tptr + 4), 8);
+ bw.i = EXTRACT_32BITS(tptr+4);
+ ND_PRINT((ndo, "\n\t\tRate: %.10g Mbps", bw.f / 125000));
+ ND_PRINT((ndo, "\n\t\tSlack Term: %u", EXTRACT_32BITS(tptr + 8)));
+ }
+ break;
+
+ case 133:
+ case 134:
+ case 135:
+ case 136:
+ if (parameter_length == 4) {
+ ND_TCHECK2(*(tptr + 4), 4);
+ ND_PRINT((ndo, "\n\t\tValue: %u", EXTRACT_32BITS(tptr + 4)));
+ }
+ break;
+
+ default:
+ if (ndo->ndo_vflag <= 1)
+ print_unknown_data(ndo, tptr + 4, "\n\t\t", parameter_length);