diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2011-09-30 15:08:52 +0000 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2011-09-30 15:08:52 +0000 |
commit | 50c6e8bb0fb0604464ed97901e36f7319de1dc1b (patch) | |
tree | a50f87811ca986528d65317832b296e425b3a47d /epan/dissectors/packet-bgp.c | |
parent | 0b7914b55ee61aba310a9a1041ba972852cb3c2e (diff) |
Enhance extended communities when RD Type 2
svn path=/trunk/; revision=39194
Diffstat (limited to 'epan/dissectors/packet-bgp.c')
-rw-r--r-- | epan/dissectors/packet-bgp.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/epan/dissectors/packet-bgp.c b/epan/dissectors/packet-bgp.c index d6dd07d156..2d9648e140 100644 --- a/epan/dissectors/packet-bgp.c +++ b/epan/dissectors/packet-bgp.c @@ -192,12 +192,12 @@ static const value_string bgpext_com8_type[] = { }; static const value_string bgpext_com_type[] = { - { BGP_EXT_COM_RT_0, "Route Target" }, - { BGP_EXT_COM_RT_1, "Route Target" }, - { BGP_EXT_COM_RT_2, "Route Target" }, - { BGP_EXT_COM_RO_0, "Route Origin" }, - { BGP_EXT_COM_RO_1, "Route Origin" }, - { BGP_EXT_COM_RO_2, "Route Origin" }, + { BGP_EXT_COM_RT_0, "two-octet AS specific Route Target" }, + { BGP_EXT_COM_RT_1, "IPv4 address specific Route Target" }, + { BGP_EXT_COM_RT_2, "four-octet AS specific Route Target" }, + { BGP_EXT_COM_RO_0, "two-octet AS specific Route Origin" }, + { BGP_EXT_COM_RO_1, "IPv4 address specific Route Origin" }, + { BGP_EXT_COM_RO_2, "four-octet AS specific Route Origin" }, { BGP_EXT_COM_LINKBAND, "Link Bandwidth" }, { BGP_EXT_COM_VPN_ORIGIN, "OSPF Domain" }, { BGP_EXT_COM_OSPF_RTYPE, "OSPF Route Type" }, @@ -2570,7 +2570,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree) while (q < end) { ext_com8 = tvb_get_guint8(tvb,q); /* handle regular types (8 bit) */ ext_com = tvb_get_ntohs(tvb,q); /* handle extended length types (16 bit) */ - ep_strbuf_printf(junk_emstr, "%s", val_to_str(ext_com8,bgpext_com8_type,"Unknown")); + ep_strbuf_printf(junk_emstr, "%s", val_to_str(ext_com8,bgpext_com8_type,"Unknown %d")); is_regular_type = FALSE; is_extended_type = FALSE; /* handle regular types (8 bit) */ @@ -2635,14 +2635,12 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree) } /* switch (ext_com8) */ if (!is_regular_type) { - ep_strbuf_append(junk_emstr, val_to_str(ext_com,bgpext_com_type,"Unknown")); + ep_strbuf_printf(junk_emstr, "%s", val_to_str(ext_com,bgpext_com_type,"Unknown %d")); /* handle extended length types (16 bit) */ switch (ext_com) { case BGP_EXT_COM_RT_0: - case BGP_EXT_COM_RT_2: case BGP_EXT_COM_RO_0: - case BGP_EXT_COM_RO_2: is_extended_type = TRUE; ep_strbuf_append_printf(junk_emstr, ": %u%s%d", tvb_get_ntohs(tvb,q+2),":",tvb_get_ntohl(tvb,q+4)); @@ -2656,6 +2654,13 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree) ip_to_str((guint8 *)&ipaddr),":",tvb_get_ntohs(tvb,q+6)); proto_tree_add_text(subtree3,tvb,q,8, "%s",junk_emstr->str); break; + case BGP_EXT_COM_RT_2: + case BGP_EXT_COM_RO_2: + is_extended_type = TRUE; + ep_strbuf_append_printf(junk_emstr, ": %u.%u:%u", + tvb_get_ntohs(tvb,q+2),tvb_get_ntohs(tvb,q+4) ,tvb_get_ntohs(tvb,q+6)); + proto_tree_add_text(subtree3,tvb,q,8, "%s",junk_emstr->str); + break; case BGP_EXT_COM_VPN_ORIGIN: case BGP_EXT_COM_OSPF_RID: is_extended_type = TRUE; |