diff options
author | deniel <deniel@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-08-20 18:10:12 +0000 |
---|---|---|
committer | deniel <deniel@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-08-20 18:10:12 +0000 |
commit | b078548716f4f68be36567ca95f1e97712b5e2ad (patch) | |
tree | f5a933bea851e3a2c9044908fb76384f56d95085 /packet-bgp.c | |
parent | 8ea392d0f58cc7f2f3a0c5313facf11150930a5a (diff) |
- proto_bgp was not added in protocol tree, so "bgp" was not
working as display filter...
- add display filters.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2310 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-bgp.c')
-rw-r--r-- | packet-bgp.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/packet-bgp.c b/packet-bgp.c index 6e36073aea..4f612cf51d 100644 --- a/packet-bgp.c +++ b/packet-bgp.c @@ -2,7 +2,7 @@ * Routines for BGP packet dissection. * Copyright 1999, Jun-ichiro itojun Hagino <itojun@itojun.org> * - * $Id: packet-bgp.c,v 1.26 2000/08/13 14:08:02 deniel Exp $ + * $Id: packet-bgp.c,v 1.27 2000/08/20 18:10:12 deniel Exp $ * * Supports: * RFC1771 A Border Gateway Protocol 4 (BGP-4) @@ -184,6 +184,7 @@ static const value_string afnumber[] = { }; static int proto_bgp = -1; +static int hf_bgp_type = -1; static gint ett_bgp = -1; static gint ett_bgp_unfeas = -1; @@ -1177,8 +1178,8 @@ dissect_bgp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } if (tree) { - ti = proto_tree_add_text(tree, NullTVB, offset, END_OF_FRAME, - "Border Gateway Protocol"); + ti = proto_tree_add_item(tree, proto_bgp, NullTVB, offset, + END_OF_FRAME, FALSE); bgp_tree = proto_item_add_subtree(ti, ett_bgp); p = &pd[offset]; @@ -1242,9 +1243,11 @@ dissect_bgp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) (hlen == 1) ? "byte" : "bytes"); } - proto_tree_add_text(bgp1_tree, NullTVB, - offset + i + offsetof(struct bgp, bgp_type), 1, - "Type: %s (%u)", typ, bgp.bgp_type); + proto_tree_add_uint_format(bgp1_tree, hf_bgp_type, NullTVB, + offset + i + + offsetof(struct bgp, bgp_type), 1, + bgp.bgp_type, + "Type: %s (%u)", typ, bgp.bgp_type); CHECK_SIZE(i, hlen, l); @@ -1277,6 +1280,13 @@ dissect_bgp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) void proto_register_bgp(void) { + + static hf_register_info hf[] = { + { &hf_bgp_type, + { "BGP message type", "bgp.type", FT_UINT8, BASE_HEX, + VALS(bgptypevals), 0x0, "BGP message type" }}, + }; + static gint *ett[] = { &ett_bgp, &ett_bgp_unfeas, @@ -1295,6 +1305,7 @@ proto_register_bgp(void) }; proto_bgp = proto_register_protocol("Border Gateway Protocol", "bgp"); + proto_register_field_array(proto_bgp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } |