diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-10-10 21:16:24 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-10-10 21:16:24 +0000 |
commit | 04cd6b60742277df0002b89386696f2ebaa04df2 (patch) | |
tree | a5b45959f7d66c757590058400f70895ebd8183b | |
parent | a3d8b3481f86d4997133352c44e17924f220d02f (diff) | |
download | wireshark-04cd6b60742277df0002b89386696f2ebaa04df2.tar.gz |
From Akira Endoh: Diffserv MPLS signaling protocol support.
svn path=/trunk/; revision=8671
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | Makefile.nmake | 3 | ||||
-rw-r--r-- | packet-diffserv-mpls-common.c | 103 | ||||
-rw-r--r-- | packet-diffserv-mpls-common.h | 60 | ||||
-rw-r--r-- | packet-ldp.c | 117 | ||||
-rw-r--r-- | packet-rsvp.c | 157 |
7 files changed, 437 insertions, 8 deletions
@@ -959,6 +959,7 @@ Akira Endoh <endoh[AT]netmarks.co.jp> { Wellfleet Breath of Life support RSVP support for draft-ietf-mpls-nodeid-subobject-00.txt, and other bug fixes and enhancements + Diffserv MPLS signaling protocol support } Graeme Hewson <graeme.hewson[AT]oracle.com> { diff --git a/Makefile.am b/Makefile.am index c21e1fb2ee..d172be7238 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ # Makefile.am # Automake file for Ethereal # -# $Id: Makefile.am,v 1.637 2003/10/10 03:00:09 guy Exp $ +# $Id: Makefile.am,v 1.638 2003/10/10 21:16:23 guy Exp $ # # Ethereal - Network traffic analyzer # By Gerald Combs <gerald@ethereal.com> @@ -184,6 +184,7 @@ DISSECTOR_SRC = \ packet-dec-bpdu.c \ packet-dhcpv6.c \ packet-diameter.c \ + packet-diffserv-mpls-common.c \ packet-distcc.c \ packet-dlsw.c \ packet-dns.c \ @@ -600,6 +601,7 @@ noinst_HEADERS = \ packet-dcerpc.h \ packet-ddtp.h \ packet-diameter-defs.h \ + packet-diffserv-mpls-common.h \ packet-dns.h \ packet-dvmrp.h \ packet-edonkey.h \ diff --git a/Makefile.nmake b/Makefile.nmake index b02a968230..c669f3694e 100644 --- a/Makefile.nmake +++ b/Makefile.nmake @@ -1,7 +1,7 @@ ## Makefile for building ethereal.exe with Microsoft C and nmake ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake # -# $Id: Makefile.nmake,v 1.345 2003/10/10 09:48:54 guy Exp $ +# $Id: Makefile.nmake,v 1.346 2003/10/10 21:16:23 guy Exp $ include config.nmake include <win32.mak> @@ -124,6 +124,7 @@ DISSECTOR_SRC = \ packet-dec-bpdu.c \ packet-dhcpv6.c \ packet-diameter.c \ + packet-diffserv-mpls-common.c \ packet-distcc.c \ packet-dlsw.c \ packet-dns.c \ diff --git a/packet-diffserv-mpls-common.c b/packet-diffserv-mpls-common.c new file mode 100644 index 0000000000..68e0bde9c8 --- /dev/null +++ b/packet-diffserv-mpls-common.c @@ -0,0 +1,103 @@ +/* packet-diffserv-mpls-common.c + * Routines for the common part of Diffserv MPLS signaling protocols + * Author: Endoh Akira (endoh@netmarks.co.jp) + * + * $Id: packet-diffserv-mpls-common.c,v 1.1 2003/10/10 21:16:24 guy Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* + * This module defines routines only for the common part of LDP + * and RSVP to support for Diffserv MPLS as described in RFC 3270 + * and RFC 3140. Protocol specific routines of each signaling + * protocol are defined in each dissector. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <glib.h> +#include <epan/packet.h> +#include "packet-diffserv-mpls-common.h" + +#define hf_map *hfindexes[0] +#define hf_exp *hfindexes[1] +#define hf_phbid *hfindexes[2] +#define hf_phbid_dscp *hfindexes[3] +#define hf_phbid_code *hfindexes[4] +#define hf_phbid_bit14 *hfindexes[5] +#define hf_phbid_bit15 *hfindexes[6] +#define ett_map *etts[0] +#define ett_map_phbid *etts[1] + + +void +dissect_diffserv_mpls_common(tvbuff_t *tvb, proto_tree *tree, int type, + int offset, int **hfindexes, gint **etts) +{ + proto_item *ti = NULL, *sub_ti; + proto_tree *tree2 = NULL, *phbid_subtree; + int exp; + guint16 phbid; + + switch (type) { + case 1: /* E-LSP */ + ti = proto_tree_add_item(tree, hf_map, tvb, offset, 4, FALSE); + tree2 = proto_item_add_subtree(ti, ett_map); + proto_item_set_text(ti, "MAP: "); + offset ++; + exp = tvb_get_guint8(tvb, offset) & 7; + proto_tree_add_uint(tree2, hf_exp, tvb, offset, 1, exp); + proto_item_append_text(ti, "EXP %u, ", exp); + offset ++; + break; + case 2: /* L-LSP */ + tree2 = tree; + break; + default: + return; + } + + /* PHBID subtree */ + sub_ti = proto_tree_add_item(tree2, hf_phbid, tvb, offset, 2, FALSE); + phbid_subtree = proto_item_add_subtree(sub_ti, ett_map_phbid); + proto_item_set_text(sub_ti, "%s: ", (type == 1) ? "PHBID" : "PSC"); + phbid = tvb_get_ntohs(tvb, offset); + + if ((phbid & 1) == 0) { + /* Case 1 of RFC 3140 */ + proto_tree_add_uint(phbid_subtree, hf_phbid_dscp, + tvb, offset, 2, phbid); + if (type == 1) + proto_item_append_text(ti, "DSCP %u", phbid >> 10); + proto_item_append_text(sub_ti, "DSCP %u", phbid >> 10); + } + else { + /* Case 2 of RFC 3140 */ + proto_tree_add_uint(phbid_subtree, hf_phbid_code, + tvb, offset, 2, phbid); + if (type == 1) + proto_item_append_text(ti, "PHB id code %u", phbid >> 4); + proto_item_append_text(sub_ti, "PHB id code %u", phbid >> 4); + } + proto_tree_add_uint(phbid_subtree, hf_phbid_bit14, tvb, offset, 2, phbid); + proto_tree_add_uint(phbid_subtree, hf_phbid_bit15, tvb, offset, 2, phbid); +} diff --git a/packet-diffserv-mpls-common.h b/packet-diffserv-mpls-common.h new file mode 100644 index 0000000000..1064b4ee78 --- /dev/null +++ b/packet-diffserv-mpls-common.h @@ -0,0 +1,60 @@ +/* packet-diffserv-mpls-common.h + * Routines for the common part of Diffserv MPLS signaling protocols + * Author: Endoh Akira (endoh@netmarks.co.jp) + * + * $Id: packet-diffserv-mpls-common.h,v 1.1 2003/10/10 21:16:24 guy Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __PACKET_DSMPLS_H__ +#define __PACKET_DSMPLS_H__ + +#define PHBID_DSCP_MASK 0xFC00 +#define PHBID_CODE_MASK 0xFFF0 +#define PHBID_BIT14_MASK 2 +#define PHBID_BIT15_MASK 1 + +#define MAPNB_DESCRIPTION "Number of MAP entries" +#define MAP_DESCRIPTION "MAP entry" +#define EXP_DESCRIPTION "EXP bit code" +#define PHBID_DESCRIPTION "PHBID" +#define PHBID_DSCP_DESCRIPTION "DSCP" +#define PHBID_CODE_DESCRIPTION "PHB id code" +#define PHBID_BIT14_DESCRIPTION "Bit 14" +#define PHBID_BIT15_DESCRIPTION "Bit 15" + + +static const value_string phbid_bit14_vals[] = { + {0, "Single PHB"}, + {1, "Set of PHBs"}, + {0, NULL} +}; + +static const value_string phbid_bit15_vals[] = { + {0, "PHBs defined by standards action"}, + {1, "PHBs not defined by standards action"}, + {0, NULL} +}; + +void +dissect_diffserv_mpls_common(tvbuff_t *tvb, proto_tree *tree, int type, + int offset, int **hfindexes, gint **etts); + +#endif diff --git a/packet-ldp.c b/packet-ldp.c index ab862bb98d..8176f66b17 100644 --- a/packet-ldp.c +++ b/packet-ldp.c @@ -1,7 +1,7 @@ /* packet-ldp.c * Routines for LDP (RFC 3036) packet disassembly * - * $Id: packet-ldp.c,v 1.44 2003/07/08 00:46:26 guy Exp $ + * $Id: packet-ldp.c,v 1.45 2003/10/10 21:16:24 guy Exp $ * * Copyright (c) November 2000 by Richard Sharpe <rsharpe@ns.aus.com> * @@ -43,6 +43,7 @@ #include "afn.h" #include "packet-frame.h" +#include "packet-diffserv-mpls-common.h" #define TCP_PORT_LDP 646 #define UDP_PORT_LDP 646 @@ -171,6 +172,16 @@ static int hf_ldp_tlv_set_prio = -1; static int hf_ldp_tlv_hold_prio = -1; static int hf_ldp_tlv_route_pinning = -1; static int hf_ldp_tlv_resource_class = -1; +static int hf_ldp_tlv_diffserv = -1; +static int hf_ldp_tlv_diffserv_type = -1; +static int hf_ldp_tlv_diffserv_mapnb = -1; +static int hf_ldp_tlv_diffserv_map = -1; +static int hf_ldp_tlv_diffserv_map_exp = -1; +static int hf_ldp_tlv_diffserv_phbid = -1; +static int hf_ldp_tlv_diffserv_phbid_dscp = -1; +static int hf_ldp_tlv_diffserv_phbid_code = -1; +static int hf_ldp_tlv_diffserv_phbid_bit14 = -1; +static int hf_ldp_tlv_diffserv_phbid_bit15 = -1; static int ett_ldp = -1; static int ett_ldp_header = -1; static int ett_ldp_ldpid = -1; @@ -179,6 +190,8 @@ static int ett_ldp_tlv = -1; static int ett_ldp_tlv_val = -1; static int ett_ldp_fec = -1; static int ett_ldp_fec_vc_interfaceparam = -1; +static int ett_ldp_diffserv_map = -1; +static int ett_ldp_diffserv_map_phbid = -1; static int tcp_port = 0; static int udp_port = 0; @@ -225,7 +238,7 @@ static int global_ldp_udp_port = UDP_PORT_LDP; #define TLV_LSPID 0x0821 #define TLV_RESOURCE_CLASS 0x0822 #define TLV_ROUTE_PINNING 0x0823 - +#define TLV_DIFFSERV 0x0901 #define TLV_VENDOR_PRIVATE_START 0x3E00 #define TLV_VENDOR_PRIVATE_END 0x3EFF #define TLV_EXPERIMENTAL_START 0x3F00 @@ -262,6 +275,7 @@ static const value_string tlv_type_names[] = { { TLV_ER_HOP_LSPID, "ER hop LSPID prefix TLV"}, { TLV_RESOURCE_CLASS, "Resource Class (Color) TLV"}, { TLV_ROUTE_PINNING, "Route Pinning TLV"}, + { TLV_DIFFSERV, "Diff-Serv TLV"}, { TLV_VENDOR_PRIVATE_START, "Vendor Private TLV"}, { TLV_EXPERIMENTAL_START, "Experimental TLV"}, { 0, NULL} @@ -432,6 +446,12 @@ static const value_string route_pinning_vals[] = { {0, NULL} }; +static const value_string diffserv_type_vals[] = { + {0, "E-LSP"}, + {1, "L-LSP"}, + {0, NULL} +}; + static const value_string ldp_loose_vals[] = { {0, "strict hop"}, {1, "loose hop"}, @@ -1605,6 +1625,51 @@ dissect_tlv_preemption(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem) } } + +static void +dissect_tlv_diffserv(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem) +{ + int type, mapnb, count; + int *hfindexes[] = { + &hf_ldp_tlv_diffserv_map, + &hf_ldp_tlv_diffserv_map_exp, + &hf_ldp_tlv_diffserv_phbid, + &hf_ldp_tlv_diffserv_phbid_dscp, + &hf_ldp_tlv_diffserv_phbid_code, + &hf_ldp_tlv_diffserv_phbid_bit14, + &hf_ldp_tlv_diffserv_phbid_bit15 + }; + gint *etts[] = { + &ett_ldp_diffserv_map, + &ett_ldp_diffserv_map_phbid + }; + + if (rem < 4) { + proto_tree_add_text(tree, tvb, offset, rem, + "Error processing Diff-Serv TLV: length is %d, should be >= 4", rem); + return; + } + proto_tree_add_uint(tree, hf_ldp_tlv_diffserv_type, tvb, offset, 1, + type = tvb_get_guint8(tvb, offset)); + type = (type >> 7) + 1; + if (type == 1) { + /* E-LSP */ + offset += 3; + proto_tree_add_uint(tree, hf_ldp_tlv_diffserv_mapnb, tvb, offset, + 1, mapnb = tvb_get_guint8(tvb, offset) & 15); + offset += 1; + for (count = 0; count < mapnb; count++) { + dissect_diffserv_mpls_common(tvb, tree, type, offset, hfindexes, etts); + offset += 4; + } + } + else if (type == 2) { + /* L-LSP */ + dissect_diffserv_mpls_common(tvb, tree, type, offset + 2, hfindexes, etts); + } +} + + static int dissect_tlv(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem); @@ -1847,6 +1912,10 @@ dissect_tlv(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem) dissect_tlv_route_pinning(tvb, offset +4, tlv_tree, length); break; + case TLV_DIFFSERV: + dissect_tlv_diffserv(tvb, offset +4, tlv_tree, length); + break; + case TLV_VENDOR_PRIVATE_START: if( length < 4 ) /*error, at least Vendor ID*/ proto_tree_add_text(tlv_tree, tvb, offset + 4, length, @@ -2553,6 +2622,46 @@ proto_register_ldp(void) { &hf_ldp_tlv_resource_class, { "Resource Class", "ldp.msg.tlv.resource_class", FT_UINT32, BASE_HEX, NULL, 0, "Resource Class (Color)", HFILL}}, + { &hf_ldp_tlv_diffserv, + { "Diff-Serv TLV", "ldp.msg.tlv.diffserv", FT_NONE, BASE_NONE, NULL, + 0, "Diffserv TLV", HFILL}}, + + { &hf_ldp_tlv_diffserv_type, + { "LSP Type", "ldp.msg.tlv.diffserv.type", FT_UINT8, BASE_DEC, + VALS(diffserv_type_vals), 0x80, "LSP Type", HFILL}}, + + { &hf_ldp_tlv_diffserv_mapnb, + { "MAPnb", "ldp.msg.tlv.diffserv.mapnb", FT_UINT8, BASE_DEC, NULL, + 0, MAPNB_DESCRIPTION, HFILL}}, + + { &hf_ldp_tlv_diffserv_map, + { "MAP", "ldp.msg.tlv.diffserv.map", FT_NONE, BASE_NONE, NULL, + 0, MAP_DESCRIPTION, HFILL}}, + + { &hf_ldp_tlv_diffserv_map_exp, + { "EXP", "ldp.msg.tlv.diffserv.map.exp", FT_UINT8, BASE_DEC, NULL, + 0, EXP_DESCRIPTION, HFILL}}, + + { &hf_ldp_tlv_diffserv_phbid, + { "PHBID", "ldp.msg.tlv.diffserv.phbid", FT_NONE, BASE_NONE, NULL, + 0, PHBID_DESCRIPTION, HFILL}}, + + { &hf_ldp_tlv_diffserv_phbid_dscp, + { "DSCP", "ldp.msg.tlv.diffserv.phbid.dscp", FT_UINT16, BASE_DEC, + NULL, PHBID_DSCP_MASK, PHBID_DSCP_DESCRIPTION, HFILL}}, + + { &hf_ldp_tlv_diffserv_phbid_code, + { "PHB id code", "ldp.msg.tlv.diffserv.phbid.code", FT_UINT16, BASE_DEC, + NULL, PHBID_CODE_MASK, PHBID_CODE_DESCRIPTION, HFILL}}, + + { &hf_ldp_tlv_diffserv_phbid_bit14, + { "Bit 14", "ldp.msg.tlv.diffserv.phbid.bit14", FT_UINT16, BASE_DEC, + VALS(phbid_bit14_vals), PHBID_BIT14_MASK, PHBID_BIT14_DESCRIPTION, HFILL}}, + + { &hf_ldp_tlv_diffserv_phbid_bit15, + { "Bit 15", "ldp.msg.tlv.diffserv.phbid.bit15", FT_UINT16, BASE_DEC, + VALS(phbid_bit15_vals), PHBID_BIT15_MASK, PHBID_BIT15_DESCRIPTION, HFILL}} + }; static gint *ett[] = { @@ -2563,7 +2672,9 @@ proto_register_ldp(void) &ett_ldp_tlv, &ett_ldp_tlv_val, &ett_ldp_fec, - &ett_ldp_fec_vc_interfaceparam + &ett_ldp_fec_vc_interfaceparam, + &ett_ldp_diffserv_map, + &ett_ldp_diffserv_map_phbid }; module_t *ldp_module; diff --git a/packet-rsvp.c b/packet-rsvp.c index ac77102d23..53bb581c5e 100644 --- a/packet-rsvp.c +++ b/packet-rsvp.c @@ -3,7 +3,7 @@ * * (c) Copyright Ashok Narayanan <ashokn@cisco.com> * - * $Id: packet-rsvp.c,v 1.83 2003/10/06 20:46:51 guy Exp $ + * $Id: packet-rsvp.c,v 1.84 2003/10/10 21:16:24 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -68,6 +68,7 @@ #include "packet-rsvp.h" #include "packet-ip.h" #include "packet-frame.h" +#include "packet-diffserv-mpls-common.h" static int proto_rsvp = -1; @@ -121,6 +122,9 @@ enum { TT_PROTECTION_INFO, TT_FAST_REROUTE, TT_DETOUR, + TT_DIFFSERV, + TT_DIFFSERV_MAP, + TT_DIFFSERV_MAP_PHBID, TT_UNKNOWN_CLASS, TT_MAX @@ -220,6 +224,8 @@ enum rsvp_classes { RSVP_CLASS_LABEL_SET, RSVP_CLASS_PROTECTION, + RSVP_CLASS_DIFFSERV = 65, + RSVP_CLASS_SUGGESTED_LABEL = 129, RSVP_CLASS_ACCEPTABLE_LABEL_SET, RSVP_CLASS_RESTART_CAP, @@ -265,6 +271,7 @@ static value_string rsvp_class_vals[] = { {RSVP_CLASS_UPSTREAM_LABEL, "UPSTREAM-LABEL object"}, {RSVP_CLASS_LABEL_SET, "LABEL-SET object"}, {RSVP_CLASS_PROTECTION, "PROTECTION object"}, + {RSVP_CLASS_DIFFSERV, "DIFFSERV object"}, {RSVP_CLASS_SUGGESTED_LABEL, "SUGGESTED-LABEL object"}, {RSVP_CLASS_ACCEPTABLE_LABEL_SET, "ACCEPTABLE-LABEL-SET object"}, {RSVP_CLASS_RESTART_CAP, "RESTART-CAPABILITY object"}, @@ -296,7 +303,8 @@ enum rsvp_error_types { RSVP_ERROR_TRAFFIC_SYSTEM, RSVP_ERROR_SYSTEM, RSVP_ERROR_ROUTING, - RSVP_ERROR_NOTIFY + RSVP_ERROR_NOTIFY, + RSVP_ERROR_DIFFSERV = 27 }; enum { @@ -332,6 +340,14 @@ enum { RSVP_NOTIFY_ERROR_RRO_TUNNEL_LOCAL_REPAIRED }; +enum { + RSVP_DIFFSERV_ERROR_UNEXPECTED_DIFFSERVOBJ = 1, + RSVP_DIFFSERV_ERROR_UNSUPPORTED_PHB, + RSVP_DIFFSERV_ERROR_INVALID_EXP_PHB_MAPPING, + RSVP_DIFFSERV_ERROR_UNSUPPORTED_PSC, + RSVP_DIFFSERV_ERROR_PERLSP_CONTEXT_ALLOC_FAIL +}; + static value_string rsvp_error_codes[] = { {RSVP_ERROR_CONFIRM, "Confirmation"}, {RSVP_ERROR_ADMISSION, "Admission Control Failure "}, @@ -350,6 +366,7 @@ static value_string rsvp_error_codes[] = { {RSVP_ERROR_SYSTEM, "RSVP System Error"}, {RSVP_ERROR_ROUTING, "Routing Error"}, {RSVP_ERROR_NOTIFY, "RSVP Notify Error"}, + {RSVP_ERROR_DIFFSERV, "RSVP Diff-Serv Error"}, {0, NULL} }; @@ -390,6 +407,14 @@ static value_string rsvp_notify_error_vals[] = { {0, NULL} }; +static value_string rsvp_diffserv_error_vals[] = { + {RSVP_DIFFSERV_ERROR_UNEXPECTED_DIFFSERVOBJ, "Unexpected DIFFSERV object"}, + {RSVP_DIFFSERV_ERROR_UNSUPPORTED_PHB, "Unsupported PHB"}, + {RSVP_DIFFSERV_ERROR_INVALID_EXP_PHB_MAPPING, "Invalid `EXP<->PHB mapping'"}, + {RSVP_DIFFSERV_ERROR_UNSUPPORTED_PSC, "Unsupported PSC"}, + {RSVP_DIFFSERV_ERROR_PERLSP_CONTEXT_ALLOC_FAIL, "Per-LSP context allocation failure"}, + {0, NULL} +}; /* * Defines the reservation style plus style-specific information that @@ -667,6 +692,7 @@ enum rsvp_filter_keys { RSVPF_UPSTREAM_LABEL, RSVPF_LABEL_SET, RSVPF_PROTECTION, + RSVPF_DIFFSERV, RSVPF_SUGGESTED_LABEL, RSVPF_ACCEPTABLE_LABEL_SET, @@ -692,6 +718,16 @@ enum rsvp_filter_keys { RSVPF_SENDER_PORT, RSVPF_SENDER_LSP_ID, + /* Diffserv object */ + RSVPF_DIFFSERV_MAPNB, + RSVPF_DIFFSERV_MAP, + RSVPF_DIFFSERV_MAP_EXP, + RSVPF_DIFFSERV_PHBID, + RSVPF_DIFFSERV_PHBID_DSCP, + RSVPF_DIFFSERV_PHBID_CODE, + RSVPF_DIFFSERV_PHBID_BIT14, + RSVPF_DIFFSERV_PHBID_BIT15, + /* Sentinel */ RSVPF_MAX }; @@ -848,6 +884,10 @@ static hf_register_info rsvpf_info[] = { { "PROTECTION", "rsvp.protection", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }}, + {&rsvp_filter[RSVPF_DIFFSERV], + { "DIFFSERV", "rsvp.diffserv", FT_NONE, BASE_NONE, NULL, 0x0, + "", HFILL }}, + {&rsvp_filter[RSVPF_RESTART_CAP], { "RESTART CAPABILITY", "rsvp.restart", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }}, @@ -936,7 +976,41 @@ static hf_register_info rsvpf_info[] = { {&rsvp_filter[RSVPF_SENDER_LSP_ID], { "Sender LSP ID", "rsvp.sender.lsp_id", FT_UINT16, BASE_DEC, NULL, 0x0, - "", HFILL }} + "", HFILL }}, + + /* Diffserv object fields */ + {&rsvp_filter[RSVPF_DIFFSERV_MAPNB], + { "MAPnb", "rsvp.diffserv.mapnb", FT_UINT8, BASE_DEC, NULL, 0x0, + MAPNB_DESCRIPTION, HFILL }}, + + {&rsvp_filter[RSVPF_DIFFSERV_MAP], + { "MAP", "rsvp.diffserv.map", FT_NONE, BASE_NONE, NULL, 0x0, + MAP_DESCRIPTION, HFILL }}, + + {&rsvp_filter[RSVPF_DIFFSERV_MAP_EXP], + { "EXP", "rsvp.diffserv.map.exp", FT_UINT8, BASE_DEC, NULL, 0x0, + EXP_DESCRIPTION, HFILL }}, + + {&rsvp_filter[RSVPF_DIFFSERV_PHBID], + { "PHBID", "rsvp.diffserv.phbid", FT_NONE, BASE_NONE, NULL, 0x0, + PHBID_DESCRIPTION, HFILL }}, + + {&rsvp_filter[RSVPF_DIFFSERV_PHBID_DSCP], + { PHBID_DSCP_DESCRIPTION, "rsvp.diffserv.phbid.dscp", FT_UINT16, + BASE_DEC, NULL, PHBID_DSCP_MASK, "DSCP", HFILL }}, + + {&rsvp_filter[RSVPF_DIFFSERV_PHBID_CODE], + { PHBID_CODE_DESCRIPTION, "rsvp.diffserv.phbid.code", FT_UINT16, + BASE_DEC, NULL, PHBID_CODE_MASK, "PHB id code", HFILL }}, + + {&rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT14], + { PHBID_BIT14_DESCRIPTION, "rsvp.diffserv.phbid.bit14", FT_UINT16, + BASE_DEC, VALS(phbid_bit14_vals), PHBID_BIT14_MASK, "Bit 14", HFILL }}, + + {&rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT15], + { PHBID_BIT15_DESCRIPTION, "rsvp.diffserv.phbid.bit15", FT_UINT16, + BASE_DEC, VALS(phbid_bit15_vals), PHBID_BIT15_MASK, "Bit 15", HFILL }} + }; static inline int rsvp_class_to_filter_num(int classnum) @@ -978,6 +1052,9 @@ static inline int rsvp_class_to_filter_num(int classnum) case RSVP_CLASS_RESTART_CAP : return RSVPF_SUGGESTED_LABEL + (classnum - RSVP_CLASS_SUGGESTED_LABEL); + case RSVP_CLASS_DIFFSERV : + return RSVPF_DIFFSERV; + case RSVP_CLASS_NOTIFY_REQUEST : return RSVPF_NOTIFY_REQUEST; case RSVP_CLASS_ADMIN_STATUS : @@ -1408,12 +1485,16 @@ dissect_rsvp_error_value (proto_tree *ti, tvbuff_t *tvb, break; case RSVP_ERROR_NOTIFY: rsvp_error_vals = rsvp_notify_error_vals; + break; + case RSVP_ERROR_DIFFSERV: + rsvp_error_vals = rsvp_diffserv_error_vals; } switch (error_code) { case RSVP_ERROR_ADMISSION: case RSVP_ERROR_TRAFFIC: case RSVP_ERROR_NOTIFY: case RSVP_ERROR_ROUTING: + case RSVP_ERROR_DIFFSERV: if ((error_val & 0xc0) == 0) { proto_tree_add_text(ti, tvb, offset, 2, "Error value: %u - %s", error_val, @@ -4030,6 +4111,72 @@ dissect_rsvp_detour (proto_tree *ti, tvbuff_t *tvb, } /*------------------------------------------------------------------------------ + * DIFFSERV + *------------------------------------------------------------------------------*/ +static void +dissect_rsvp_diffserv (proto_tree *ti, tvbuff_t *tvb, + int offset, int obj_length, + int class, int type, + char *type_str + ) +{ + proto_tree *rsvp_object_tree; + int mapnb, count; + int *hfindexes[] = { + &rsvp_filter[RSVPF_DIFFSERV_MAP], + &rsvp_filter[RSVPF_DIFFSERV_MAP_EXP], + &rsvp_filter[RSVPF_DIFFSERV_PHBID], + &rsvp_filter[RSVPF_DIFFSERV_PHBID_DSCP], + &rsvp_filter[RSVPF_DIFFSERV_PHBID_CODE], + &rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT14], + &rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT15] + }; + gint *etts[] = { + &TREE(TT_DIFFSERV_MAP), + &TREE(TT_DIFFSERV_MAP_PHBID) + }; + + rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_DIFFSERV)); + proto_tree_add_text(rsvp_object_tree, tvb, offset, 2, + "Length: %u", obj_length); + proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1, + "Class number: %u - %s", + class, type_str); + proto_item_set_text(ti, "DIFFSERV: "); + offset += 3; + switch (type) { + case 1: + proto_tree_add_text(rsvp_object_tree, tvb, offset, 1, + "C-type: 1 - E-LSP"); + proto_tree_add_uint(rsvp_object_tree, rsvp_filter[RSVPF_DIFFSERV_MAPNB], + tvb, offset + 4, 1, + mapnb = tvb_get_guint8(tvb, offset + 4) & 15); + proto_item_append_text(ti, "E-LSP, %u MAP%s", mapnb, + (mapnb == 0) ? "" : "s"); + offset += 5; + + for (count = 0; count < mapnb; count++) { + dissect_diffserv_mpls_common(tvb, rsvp_object_tree, type, + offset, hfindexes, etts); + offset += 4; + } + break; + case 2: + proto_item_append_text(ti, "L-LSP"); + proto_tree_add_text(rsvp_object_tree, tvb, offset, 1, + "C-type: 2 - L-LSP"); + dissect_diffserv_mpls_common(tvb, rsvp_object_tree, type, + offset + 3, hfindexes, etts); + break; + default: + proto_tree_add_text(rsvp_object_tree, tvb, offset, 1, + "C-type: Unknown (%u)", type); + proto_tree_add_text(rsvp_object_tree, tvb, offset + 1, obj_length - 4, + "Data (%d bytes)", obj_length - 4); + } +} + +/*------------------------------------------------------------------------------ * Dissect a single RSVP message in a tree *------------------------------------------------------------------------------*/ static void @@ -4295,6 +4442,10 @@ dissect_rsvp_msg_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dissect_rsvp_detour(ti, tvb, offset, obj_length, class, type, type_str); break; + case RSVP_CLASS_DIFFSERV: + dissect_rsvp_diffserv(ti, tvb, offset, obj_length, class, type, type_str); + break; + case RSVP_CLASS_NULL: default: rsvp_object_tree = proto_item_add_subtree(ti, TREE(TT_UNKNOWN_CLASS)); |