aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-fcfcs.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2014-09-11 16:43:00 -0400
committerAnders Broman <a.broman58@gmail.com>2014-09-12 05:51:11 +0000
commit3df42e79a54af411d3b197f461e8f98913cce59e (patch)
tree3313b9bf2326667ac80f1c3302c4ed90c25293e7 /epan/dissectors/packet-fcfcs.c
parent47c592938ba9f0caeacc4c2ccadb370e72f293a2 (diff)
proto_tree_add_text cleanup
Create filters (expert and hf_) that have the "most bang for the buck" (ie have many instances for a single filter) Change-Id: I61995e41c5b298df77e084e65cdf30ebe95da1e6 Reviewed-on: https://code.wireshark.org/review/4086 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-fcfcs.c')
-rw-r--r--epan/dissectors/packet-fcfcs.c38
1 files changed, 15 insertions, 23 deletions
diff --git a/epan/dissectors/packet-fcfcs.c b/epan/dissectors/packet-fcfcs.c
index 1c268cbcf2..c2c1655ca8 100644
--- a/epan/dissectors/packet-fcfcs.c
+++ b/epan/dissectors/packet-fcfcs.c
@@ -60,6 +60,7 @@ static int hf_fcs_porttype = -1;
static int hf_fcs_physportnum = -1;
static int hf_fcs_portflags = -1;
static int hf_fcs_portstate = -1;
+static int hf_fcs_platformname_len = -1;
static int hf_fcs_platformname = -1;
static int hf_fcs_platformnname = -1;
static int hf_fcs_platformtype = -1;
@@ -426,8 +427,7 @@ dissect_fcfcs_gplnl (tvbuff_t *tvb, proto_tree *tree, gboolean isreq)
if (tree) {
if (isreq) {
len = tvb_get_guint8 (tvb, offset);
- proto_tree_add_text (tree, tvb, offset, 1,
- "Platform Name Length: %d", len);
+ proto_tree_add_uint(tree, hf_fcs_platformname_len, tvb, offset, 1, len);
proto_tree_add_item (tree, hf_fcs_platformname, tvb, offset+1,
len, ENC_NA);
}
@@ -455,8 +455,7 @@ dissect_fcfcs_gplt (tvbuff_t *tvb, proto_tree *tree, gboolean isreq)
if (tree) {
if (isreq) {
len = tvb_get_guint8 (tvb, offset);
- proto_tree_add_text (tree, tvb, offset, 1,
- "Platform Name Length: %d", len);
+ proto_tree_add_uint(tree, hf_fcs_platformname_len, tvb, offset, 1, len);
proto_tree_add_item (tree, hf_fcs_platformname, tvb, offset+1,
len, ENC_NA);
}
@@ -476,8 +475,7 @@ dissect_fcfcs_gplml (tvbuff_t *tvb, proto_tree *tree, gboolean isreq)
if (tree) {
if (isreq) {
len = tvb_get_guint8 (tvb, offset);
- proto_tree_add_text (tree, tvb, offset, 1,
- "Platform Name Length: %d", len);
+ proto_tree_add_uint(tree, hf_fcs_platformname_len, tvb, offset, 1, len);
proto_tree_add_item (tree, hf_fcs_platformname, tvb, offset+1,
len, ENC_NA);
}
@@ -513,8 +511,7 @@ dissect_fcfcs_gnpl (tvbuff_t *tvb, proto_tree *tree, gboolean isreq)
}
else {
len = tvb_get_guint8 (tvb, offset);
- proto_tree_add_text (tree, tvb, offset, 1,
- "Platform Name Length: %d", len);
+ proto_tree_add_uint (tree, hf_fcs_platformname_len, tvb, offset, 1, len);
proto_tree_add_item (tree, hf_fcs_platformname, tvb, offset+1,
len, ENC_NA);
}
@@ -537,9 +534,7 @@ dissect_fcfcs_gpnl (tvbuff_t *tvb, proto_tree *tree, gboolean isreq)
offset += 4;
for (i = 0; i < numelem; i++) {
len = tvb_get_guint8 (tvb, offset);
- proto_tree_add_text (tree, tvb, offset, 1,
- "Platform Name Length: %d",
- len);
+ proto_tree_add_uint (tree, hf_fcs_platformname_len, tvb, offset, 1, len);
proto_tree_add_item (tree, hf_fcs_platformname, tvb, offset+1,
len, ENC_NA);
offset += 256;
@@ -575,8 +570,7 @@ dissect_fcfcs_rpl (tvbuff_t *tvb, proto_tree *tree, gboolean isreq)
if (tree) {
if (isreq) {
len = tvb_get_guint8 (tvb, offset);
- proto_tree_add_text (tree, tvb, offset, 1,
- "Platform Name Length: %d", len);
+ proto_tree_add_uint (tree, hf_fcs_platformname_len, tvb, offset, 1, len);
proto_tree_add_item (tree, hf_fcs_platformname, tvb, offset+1,
len, ENC_NA);
proto_tree_add_item (tree, hf_fcs_platformtype, tvb, offset+256, 4,
@@ -617,8 +611,7 @@ dissect_fcfcs_rpln (tvbuff_t *tvb, proto_tree *tree, gboolean isreq)
if (tree) {
if (isreq) {
len = tvb_get_guint8 (tvb, offset);
- proto_tree_add_text (tree, tvb, offset, 1,
- "Platform Name Length: %d", len);
+ proto_tree_add_uint (tree, hf_fcs_platformname_len, tvb, offset, 1, len);
proto_tree_add_item (tree, hf_fcs_platformname, tvb, offset+1,
len, ENC_NA);
proto_tree_add_string (tree, hf_fcs_platformnname, tvb, offset+256,
@@ -636,8 +629,7 @@ dissect_fcfcs_rplt (tvbuff_t *tvb, proto_tree *tree, gboolean isreq)
if (tree) {
if (isreq) {
len = tvb_get_guint8 (tvb, offset);
- proto_tree_add_text (tree, tvb, offset, 1,
- "Platform Name Length: %d", len);
+ proto_tree_add_uint (tree, hf_fcs_platformname_len, tvb, offset, 1, len);
proto_tree_add_item (tree, hf_fcs_platformname, tvb, offset+1,
len, ENC_NA);
proto_tree_add_item (tree, hf_fcs_platformtype, tvb, offset+256,
@@ -655,8 +647,7 @@ dissect_fcfcs_rplm (tvbuff_t *tvb, proto_tree *tree, gboolean isreq)
if (tree) {
if (isreq) {
len = tvb_get_guint8 (tvb, offset);
- proto_tree_add_text (tree, tvb, offset, 1,
- "Platform Name Length: %d", len);
+ proto_tree_add_uint (tree, hf_fcs_platformname_len, tvb, offset, 1, len);
proto_tree_add_item (tree, hf_fcs_platformname, tvb, offset+1,
len, ENC_NA);
len = tvb_get_guint8 (tvb, offset+256);
@@ -677,8 +668,7 @@ dissect_fcfcs_dpl (tvbuff_t *tvb, proto_tree *tree, gboolean isreq)
if (tree) {
if (isreq) {
len = tvb_get_guint8 (tvb, offset);
- proto_tree_add_text (tree, tvb, offset, 1,
- "Platform Name Length: %d", len);
+ proto_tree_add_uint (tree, hf_fcs_platformname_len, tvb, offset, 1, len);
proto_tree_add_item (tree, hf_fcs_platformname, tvb, offset+1,
len, ENC_NA);
}
@@ -707,8 +697,7 @@ dissect_fcfcs_dplml (tvbuff_t *tvb, proto_tree *tree, gboolean isreq)
if (tree) {
if (isreq) {
len = tvb_get_guint8 (tvb, offset);
- proto_tree_add_text (tree, tvb, offset, 1,
- "Platform Name Length: %d", len);
+ proto_tree_add_uint (tree, hf_fcs_platformname_len, tvb, offset, 1, len);
proto_tree_add_item (tree, hf_fcs_platformname, tvb, offset+1,
len, ENC_NA);
}
@@ -1044,6 +1033,9 @@ proto_register_fcfcs (void)
{ &hf_fcs_portstate,
{"Port State", "fcs.port.state", FT_UINT8, BASE_HEX,
VALS (fc_fcs_port_state_val), 0x0, NULL, HFILL}},
+ { &hf_fcs_platformname_len,
+ {"Platform Name Length", "fcs.platform.len", FT_UINT8, BASE_DEC,
+ NULL, 0x0, NULL, HFILL}},
{ &hf_fcs_platformname,
{"Platform Name", "fcs.platform.name", FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL}},