aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ospf.c
diff options
context:
space:
mode:
authorMike Gerschefske <msgersch2@gmail.com>2014-04-27 19:02:54 -0700
committerAnders Broman <a.broman58@gmail.com>2014-04-28 06:22:50 +0000
commite240c4e9cd91f30b51426e2f5c6dcf6dc3eb9fbd (patch)
tree6ba5aee9a1f81f33c7d05a501045c9e607281b72 /epan/dissectors/packet-ospf.c
parent1a7e5c9e2800f0e235aa49cc255f3546ec1bec69 (diff)
Updated ospf link state router messages to use proto_tree_add_item instead of proto_tree_add_text.
Change-Id: Icb04aaa68e7e8b79116a6ac48d1897eb387aab3e Reviewed-on: https://code.wireshark.org/review/1404 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-ospf.c')
-rw-r--r--epan/dissectors/packet-ospf.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/epan/dissectors/packet-ospf.c b/epan/dissectors/packet-ospf.c
index 589728b047..d48a74a3d2 100644
--- a/epan/dissectors/packet-ospf.c
+++ b/epan/dissectors/packet-ospf.c
@@ -587,7 +587,11 @@ enum {
OSPFF_LS_MPLS_TE_INSTANCE,
OSPFF_LS_MIN,
+
OSPFF_LS_ROUTER,
+ OSPFF_LS_ROUTER_LINKTYPE,
+ OSPFF_LS_ROUTER_LINKID,
+ OSPFF_LS_ROUTER_LINKDATA,
OSPFF_LS_NETWORK,
OSPFF_LS_SUMMARY,
OSPFF_LS_ASBR,
@@ -2620,6 +2624,7 @@ dissect_ospf_v2_lsa(tvbuff_t *tvb, int offset, proto_tree *tree,
for (link_counter = 0; link_counter < nr_links; link_counter++) {
proto_tree *ospf_lsa_router_link_tree;
proto_item *ti_local;
+ proto_item *ti_item;
/* check the Link Type and ID */
@@ -2669,15 +2674,19 @@ dissect_ospf_v2_lsa(tvbuff_t *tvb, int offset, proto_tree *tree,
ospf_lsa_router_link_tree = proto_item_add_subtree(ti_local, ett_ospf_lsa_router_link);
- proto_tree_add_text(ospf_lsa_router_link_tree, tvb, offset, 4, "%s: %s", link_id,
- tvb_ip_to_str(tvb, offset));
+
+ ti_item = proto_tree_add_item(ospf_lsa_router_link_tree, hf_ospf_filter[OSPFF_LS_ROUTER_LINKID],
+ tvb, offset, 4, ENC_BIG_ENDIAN);
+ proto_item_append_text(ti_item, " - %s", link_id);
/* link_data should be specified in detail (e.g. network mask) (depends on link type)*/
- proto_tree_add_text(ospf_lsa_router_link_tree, tvb, offset + 4, 4, "Link Data: %s",
- tvb_ip_to_str(tvb, offset + 4));
+ ti_item = proto_tree_add_item(ospf_lsa_router_link_tree, hf_ospf_filter[OSPFF_LS_ROUTER_LINKDATA],
+ tvb, offset +4, 4, ENC_BIG_ENDIAN);
+
+ ti_item = proto_tree_add_item(ospf_lsa_router_link_tree, hf_ospf_filter[OSPFF_LS_ROUTER_LINKTYPE],
+ tvb, offset + 8, 1, ENC_BIG_ENDIAN);
+ proto_item_append_text(ti_item, " - %s", link_type_str);
- proto_tree_add_text(ospf_lsa_router_link_tree, tvb, offset + 8, 1, "Link Type: %u - %s",
- link_type, link_type_str);
proto_tree_add_text(ospf_lsa_router_link_tree, tvb, offset + 9, 1, "Number of %s metrics: %u",
metric_type_str, nr_metric);
proto_tree_add_text(ospf_lsa_router_link_tree, tvb, offset + 10, 2, "%s 0 metric: %u",
@@ -3318,6 +3327,16 @@ proto_register_ospf(void)
{&hf_ospf_filter[OSPFF_LS_ROUTER],
{ "Router LSA", "ospf.lsa.router", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
+ {&hf_ospf_filter[OSPFF_LS_ROUTER_LINKTYPE],
+ { "Link Type", "ospf.lsa.router.linktype", FT_UINT8, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }},
+ {&hf_ospf_filter[OSPFF_LS_ROUTER_LINKID],
+ { "Link ID", "ospf.lsa.router.linkid", FT_IPv4, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+ {&hf_ospf_filter[OSPFF_LS_ROUTER_LINKDATA],
+ { "Link Data", "ospf.lsa.router.linkdata", FT_IPv4, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
{&hf_ospf_filter[OSPFF_LS_NETWORK],
{ "Network LSA", "ospf.lsa.network", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
NULL, HFILL }},