diff options
author | Michael Mann <mmann78@netscape.net> | 2013-08-06 01:11:55 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-08-06 01:11:55 +0000 |
commit | ac5ceb45facf3a8b422eda551ddc284e8bf94fa1 (patch) | |
tree | f8e59e1f1d2707cb7ba169ae25394c6b90b4f574 /epan/dissectors/packet-esis.c | |
parent | 1577a6992e309ca0060fea42df70a181201dcfaf (diff) |
Convert a few proto_tree_add_text to pacify checkAPIs.pl. Looks like the "proper" fix for the remaining calls would be to setup additional field types (to remove the tvb_get_ptr calls)
svn path=/trunk/; revision=51166
Diffstat (limited to 'epan/dissectors/packet-esis.c')
-rw-r--r-- | epan/dissectors/packet-esis.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/epan/dissectors/packet-esis.c b/epan/dissectors/packet-esis.c index e6c96c678c..35a06eb292 100644 --- a/epan/dissectors/packet-esis.c +++ b/epan/dissectors/packet-esis.c @@ -46,6 +46,12 @@ static int hf_esis_reserved = -1; static int hf_esis_type = -1; static int hf_esis_holdtime = -1; static int hf_esis_checksum = -1; +/* Generated from convert_proto_tree_add_text.pl */ +static int hf_esis_dal = -1; +static int hf_esis_number_of_source_addresses = -1; +static int hf_esis_netl = -1; +static int hf_esis_sal = -1; +static int hf_esis_bsnpal = -1; static gint ett_esis = -1; static gint ett_esis_area_addr = -1; @@ -161,14 +167,13 @@ esis_dissect_esh_pdu( guint8 len, tvbuff_t *tvb, proto_tree *tree) { no_sa = tvb_get_guint8(tvb, offset); len -= 1; - ti = proto_tree_add_text( tree, tvb, offset, -1, - "Number of Source Addresses (SA, Format: NSAP) : %u", no_sa ); + ti = proto_tree_add_uint( tree, hf_esis_number_of_source_addresses, tvb, offset, -1, no_sa); offset++; esis_area_tree = proto_item_add_subtree( ti, ett_esis_area_addr ); while ( no_sa-- > 0 ) { sal = (int) tvb_get_guint8(tvb, offset); - proto_tree_add_text(esis_area_tree, tvb, offset, 1, "SAL: %2u Octets", sal); + proto_tree_add_uint_format_value(esis_area_tree, hf_esis_sal, tvb, offset, 1, sal, "%2u Octets", sal); offset++; proto_tree_add_text(esis_area_tree, tvb, offset, sal, " SA: %s", @@ -192,7 +197,7 @@ esis_dissect_ish_pdu( guint8 len, tvbuff_t *tvb, proto_tree *tree) { netl = (int) tvb_get_guint8(tvb, offset); proto_tree_add_text( tree, tvb, offset, netl + 1, "### Network Entity Title Section ###"); - proto_tree_add_text( tree, tvb, offset++, 1, "NETL: %2u Octets", netl); + proto_tree_add_uint_format_value(tree, hf_esis_netl, tvb, offset++, 1, netl, "%2u Octets", netl); proto_tree_add_text( tree, tvb, offset, netl, " NET: %s", print_nsap_net( tvb_get_ptr(tvb, offset, netl), netl ) ); @@ -215,7 +220,7 @@ esis_dissect_redirect_pdu( guint8 len, tvbuff_t *tvb, proto_tree *tree) { tmpl = (int) tvb_get_guint8(tvb, offset); proto_tree_add_text( tree, tvb, offset, tmpl + 1, "### Destination Address Section ###" ); - proto_tree_add_text( tree, tvb, offset++, 1, "DAL: %2u Octets", tmpl); + proto_tree_add_uint_format_value(tree, hf_esis_dal, tvb, offset++, 1, tmpl, "%2u Octets", tmpl); proto_tree_add_text( tree, tvb, offset, tmpl, " DA : %s", print_nsap_net( tvb_get_ptr(tvb, offset, tmpl), tmpl ) ); @@ -225,7 +230,7 @@ esis_dissect_redirect_pdu( guint8 len, tvbuff_t *tvb, proto_tree *tree) { proto_tree_add_text( tree, tvb, offset, tmpl + 1, "### Subnetwork Address Section ###"); - proto_tree_add_text( tree, tvb, offset++, 1, "BSNPAL: %2u Octets", tmpl); + proto_tree_add_uint_format_value(tree, hf_esis_bsnpal, tvb, offset++, 1, tmpl, "%2u Octets", tmpl); proto_tree_add_text( tree, tvb, offset, tmpl, " BSNPA: %s", print_system_id( tvb_get_ptr(tvb, offset, tmpl), tmpl ) ); @@ -242,7 +247,7 @@ esis_dissect_redirect_pdu( guint8 len, tvbuff_t *tvb, proto_tree *tree) { else { proto_tree_add_text( tree, tvb, offset, 1, "### Network Entity Title Section ###" ); - proto_tree_add_text( tree, tvb, offset++, 1, "NETL: %2u Octets", tmpl ); + proto_tree_add_uint_format_value(tree, hf_esis_netl, tvb, offset++, 1, tmpl, "%2u Octets", tmpl ); proto_tree_add_text( tree, tvb, offset, tmpl, " NET: %s", print_nsap_net( tvb_get_ptr(tvb, offset, tmpl), tmpl ) ); @@ -424,7 +429,14 @@ proto_register_esis(void) { { "Holding Time", "esis.htime", FT_UINT16, BASE_DEC, NULL, 0x0, "s", HFILL }}, { &hf_esis_checksum, - { "Checksum", "esis.chksum", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }} + { "Checksum", "esis.chksum", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + + /* Generated from convert_proto_tree_add_text.pl */ + { &hf_esis_number_of_source_addresses, { "Number of Source Addresses (SA, Format: NSAP)", "esis.number_of_source_addresses", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_esis_sal, { "SAL", "esis.sal", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_esis_netl, { "NETL", "esis.netl", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_esis_dal, { "DAL", "esis.dal", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_esis_bsnpal, { "BSNPAL", "esis.bsnpal", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; /* * |