diff options
author | Uli Heilmeier <uh@heilmeier.eu> | 2018-01-05 22:12:15 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-01-10 06:00:19 +0000 |
commit | 80cd3859d1db72d77a85035d572d8a02aa3d8d84 (patch) | |
tree | 4d73c34c547bab30d5a47a484f42ffda511ab010 /epan/dissectors/packet-bgp.c | |
parent | be143963f6de7f33ec9c3f300efabf156596b7d7 (diff) |
BGP: Resolve AS23456 to AS_TRANS
AS23456 is reserved in RFC6793 for 32-bit AS number range as AS_TRANS.
Add an additional text "(AS_TRANS)" to AS 23456 items.
Bug: 14305
Change-Id: I1a0ea9e07c74b7e409cb32e2da55dbf233a2348d
Reviewed-on: https://code.wireshark.org/review/25172
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-bgp.c')
-rw-r--r-- | epan/dissectors/packet-bgp.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/epan/dissectors/packet-bgp.c b/epan/dissectors/packet-bgp.c index 87562046bc..e1cc446416 100644 --- a/epan/dissectors/packet-bgp.c +++ b/epan/dissectors/packet-bgp.c @@ -193,6 +193,9 @@ static dissector_handle_t bgp_handle; #define FOURHEX0 0x00000000 #define FOURHEXF 0xFFFF0000 +/* IANA assigned AS */ +#define BGP_AS_TRANS 23456 + /* attribute types */ #define BGPTYPE_ORIGIN 1 /* RFC4271 */ #define BGPTYPE_AS_PATH 2 /* RFC4271 */ @@ -5831,6 +5834,7 @@ dissect_bgp_open(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo) int cend; /* capabilities end */ int oend; /* options end */ int offset; /* tvb offset counter */ + guint32 as_num; /* AS Number */ proto_item *ti; /* tree item */ proto_tree *opt_tree; /* subtree for options */ proto_tree *par_tree; /* subtree for par options */ @@ -5840,7 +5844,10 @@ dissect_bgp_open(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo) proto_tree_add_item(tree, hf_bgp_open_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_bgp_open_myas, tvb, offset, 2, ENC_BIG_ENDIAN); + ti = proto_tree_add_item_ret_uint(tree, hf_bgp_open_myas, tvb, offset, 2, ENC_BIG_ENDIAN, &as_num); + if (as_num == BGP_AS_TRANS) { + proto_item_append_text(ti, " (AS_TRANS)"); + } offset += 2; proto_tree_add_item(tree, hf_bgp_open_holdtime, tvb, offset, 2, ENC_BIG_ENDIAN); @@ -6785,6 +6792,7 @@ dissect_bgp_path_attr(proto_tree *subtree, tvbuff_t *tvb, guint16 path_attr_len, proto_item *ti; /* tree item */ proto_item *ti_communities; /* tree communities */ proto_item *ti_community; /* tree for each community */ + proto_item *ti_as; /* tree for each as */ proto_item *attr_len_item; proto_item *aigp_type_item; proto_tree *subtree2; /* path attribute subtree */ @@ -6827,6 +6835,7 @@ dissect_bgp_path_attr(proto_tree *subtree, tvbuff_t *tvb, guint16 path_attr_len, guint8 saf, snpa; guint8 nexthop_len; guint8 asn_len = 0; + guint32 as_num; static const int * path_flags[] = { &hf_bgp_update_path_attribute_flags_optional, @@ -6933,9 +6942,12 @@ dissect_bgp_path_attr(proto_tree *subtree, tvbuff_t *tvb, guint16 path_attr_len, for (j = 0; j < length; j++) { if(asn_len == 2) { - proto_tree_add_item(as_path_segment_tree, + ti_as = proto_tree_add_item_ret_uint(as_path_segment_tree, hf_bgp_update_path_attribute_as_path_segment_as2, - tvb, q, 2, ENC_BIG_ENDIAN); + tvb, q, 2, ENC_BIG_ENDIAN, &as_num); + if (as_num == BGP_AS_TRANS) { + proto_item_append_text(ti_as, " (AS_TRANS)"); + } proto_item_append_text(ti_pa, "%u", tvb_get_ntohs(tvb, q)); proto_item_append_text(ti, "%u", |