summaryrefslogtreecommitdiff
path: root/epan/dissectors
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2013-08-22 20:54:50 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2013-08-22 20:54:50 +0000
commit401cdb009e5bcad4c6b3b86002ae9969373161b6 (patch)
tree2ae16d19fe6e89c2cef75c3a963db26656069c07 /epan/dissectors
parent75f4fa5b4be443418a1128fe254dd3e3cbf850b1 (diff)
downloadwireshark-401cdb009e5bcad4c6b3b86002ae9969373161b6.tar.gz
Convert more dissectors to use hfinfo instead of hfindex.
svn path=/trunk/; revision=51478
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-2dparityfec.c364
-rw-r--r--epan/dissectors/packet-acap.c52
-rw-r--r--epan/dissectors/packet-data.c43
-rw-r--r--epan/dissectors/packet-daytime.c38
-rw-r--r--epan/dissectors/packet-fcdns.c918
-rw-r--r--epan/dissectors/packet-hpext.c60
6 files changed, 796 insertions, 679 deletions
diff --git a/epan/dissectors/packet-2dparityfec.c b/epan/dissectors/packet-2dparityfec.c
index aa84e84694..53315d315b 100644
--- a/epan/dissectors/packet-2dparityfec.c
+++ b/epan/dissectors/packet-2dparityfec.c
@@ -61,6 +61,8 @@
** Mark Lewis - 20th June 2006
*/
+#define NEW_PROTO_TREE_API
+
#include "config.h"
#include <epan/packet.h>
@@ -70,26 +72,96 @@
void proto_register_2dparityfec(void);
void proto_reg_handoff_2dparityfec(void);
+static dissector_handle_t handle_2dparityfec = NULL;
+
static gboolean dissect_fec = FALSE;
-static int proto_2dparityfec = -1;
static int fec_rtp_payload_type = 96;
static gint ett_2dparityfec = -1;
-static int hf_2dparityfec_snbase_low = -1;
-static int hf_2dparityfec_length_recovery = -1;
-static int hf_2dparityfec_rfc2733_ext = -1;
-static int hf_2dparityfec_pt_recovery = -1;
-static int hf_2dparityfec_mask = -1;
-static int hf_2dparityfec_ts_recovery = -1;
-static int hf_2dparityfec_ts_pro_mpeg_ext = -1;
-static int hf_2dparityfec_row_flag = -1;
-static int hf_2dparityfec_type = -1;
-static int hf_2dparityfec_index = -1;
-static int hf_2dparityfec_offset = -1;
-static int hf_2dparityfec_na = -1;
-static int hf_2dparityfec_snbase_ext = -1;
-static int hf_2dparityfec_payload = -1;
+static header_field_info *hfi_2dparityfec = NULL;
+
+#define _2DPARITYFEC_HFI_INIT HFI_INIT(proto_2dparityfec)
+
+static header_field_info hfi_2dparityfec_snbase_low _2DPARITYFEC_HFI_INIT =
+{ "SNBase low",
+ "2dparityfec.snbase_low",
+ FT_UINT16,
+ BASE_DEC,
+ NULL,
+ 0x0,
+ NULL,
+ HFILL};
+
+static header_field_info hfi_2dparityfec_length_recovery _2DPARITYFEC_HFI_INIT =
+{ "Length recovery",
+ "2dparityfec.lr",
+ FT_UINT16,
+ BASE_HEX,
+ NULL,
+ 0x0,
+ NULL,
+ HFILL};
+
+static header_field_info hfi_2dparityfec_rfc2733_ext _2DPARITYFEC_HFI_INIT =
+{ "RFC2733 Extension (E)",
+ "2dparityfec.e",
+ FT_BOOLEAN,
+ 8,
+ NULL,
+ 0x80,
+ NULL,
+ HFILL};
+
+static header_field_info hfi_2dparityfec_pt_recovery _2DPARITYFEC_HFI_INIT =
+{ "Payload Type recovery",
+ "2dparityfec.ptr",
+ FT_UINT8,
+ BASE_HEX,
+ NULL,
+ 0x7f,
+ NULL,
+ HFILL};
+
+static header_field_info hfi_2dparityfec_mask _2DPARITYFEC_HFI_INIT =
+{ "Mask",
+ "2dparityfec.mask",
+ /*FT_UINT32*/FT_UINT24,
+ BASE_HEX,
+ NULL,
+ /*0x00ffffff*/0x0,
+ NULL,
+ HFILL};
+
+static header_field_info hfi_2dparityfec_ts_recovery _2DPARITYFEC_HFI_INIT =
+{ "Timestamp recovery",
+ "2dparityfec.tsr",
+ FT_UINT32,
+ BASE_HEX,
+ NULL,
+ 0x0,
+ NULL,
+ HFILL};
+
+static header_field_info hfi_2dparityfec_ts_pro_mpeg_ext _2DPARITYFEC_HFI_INIT =
+{ "Pro-MPEG Extension (X)",
+ "2dparityfec.x",
+ FT_BOOLEAN,
+ 8,
+ NULL,
+ 0x80,
+ NULL,
+ HFILL};
+
+static header_field_info hfi_2dparityfec_row_flag _2DPARITYFEC_HFI_INIT =
+{ "Row FEC (D)",
+ "2dparityfec.d",
+ FT_BOOLEAN,
+ 8,
+ NULL,
+ 0x40,
+ NULL,
+ HFILL};
static const value_string fec_type_names[] = {
{0, "XOR"},
@@ -98,6 +170,67 @@ static const value_string fec_type_names[] = {
{0, NULL}
};
+static header_field_info hfi_2dparityfec_type _2DPARITYFEC_HFI_INIT =
+{ "Type",
+ "2dparityfec.type",
+ FT_UINT8,
+ BASE_DEC,
+ VALS(fec_type_names),
+ 0x38,
+ NULL,
+ HFILL};
+
+static header_field_info hfi_2dparityfec_index _2DPARITYFEC_HFI_INIT =
+{ "Index",
+ "2dparityfec.index",
+ FT_UINT8,
+ BASE_DEC,
+ NULL,
+ 0x07,
+ NULL,
+ HFILL};
+
+static header_field_info hfi_2dparityfec_offset _2DPARITYFEC_HFI_INIT =
+{ "Offset",
+ "2dparityfec.offset",
+ FT_UINT8,
+ BASE_DEC,
+ NULL,
+ 0x0,
+ NULL,
+ HFILL};
+
+static header_field_info hfi_2dparityfec_na _2DPARITYFEC_HFI_INIT =
+{ "NA",
+ "2dparityfec.na",
+ FT_UINT8,
+ BASE_DEC,
+ NULL,
+ 0x0,
+ NULL,
+ HFILL};
+
+static header_field_info hfi_2dparityfec_snbase_ext _2DPARITYFEC_HFI_INIT =
+{ "SNBase ext",
+ "2dparityfec.snbase_ext",
+ FT_UINT8,
+ BASE_DEC,
+ NULL,
+ 0x0,
+ NULL,
+ HFILL};
+
+static header_field_info hfi_2dparityfec_payload _2DPARITYFEC_HFI_INIT =
+{ "FEC Payload",
+ "2dparityfec.payload",
+ FT_BYTES,
+ BASE_NONE,
+ NULL,
+ 0x0,
+ NULL,
+ HFILL};
+
+
static void dissect_2dparityfec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint8 OffsetField;
@@ -138,23 +271,23 @@ static void dissect_2dparityfec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
proto_tree *tree_2dparityfec = NULL;
gint offset = 0;
- ti = proto_tree_add_item(tree, proto_2dparityfec, tvb, 0, -1, ENC_NA);
+ ti = proto_tree_add_item(tree, hfi_2dparityfec, tvb, 0, -1, ENC_NA);
tree_2dparityfec = proto_item_add_subtree(ti, ett_2dparityfec);
- proto_tree_add_item(tree_2dparityfec, hf_2dparityfec_snbase_low, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2;
- proto_tree_add_item(tree_2dparityfec, hf_2dparityfec_length_recovery, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2;
- proto_tree_add_item(tree_2dparityfec, hf_2dparityfec_rfc2733_ext, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(tree_2dparityfec, hf_2dparityfec_pt_recovery, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1;
- proto_tree_add_item(tree_2dparityfec, hf_2dparityfec_mask, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3;
- proto_tree_add_item(tree_2dparityfec, hf_2dparityfec_ts_recovery, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4;
- proto_tree_add_item(tree_2dparityfec, hf_2dparityfec_ts_pro_mpeg_ext, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(tree_2dparityfec, hf_2dparityfec_row_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(tree_2dparityfec, hf_2dparityfec_type, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(tree_2dparityfec, hf_2dparityfec_index, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1;
- proto_tree_add_item(tree_2dparityfec, hf_2dparityfec_offset, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1;
- proto_tree_add_item(tree_2dparityfec, hf_2dparityfec_na, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1;
- proto_tree_add_item(tree_2dparityfec, hf_2dparityfec_snbase_ext, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1;
- proto_tree_add_item(tree_2dparityfec, hf_2dparityfec_payload, tvb, offset, -1, ENC_NA);
+ proto_tree_add_item(tree_2dparityfec, &hfi_2dparityfec_snbase_low, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2;
+ proto_tree_add_item(tree_2dparityfec, &hfi_2dparityfec_length_recovery, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2;
+ proto_tree_add_item(tree_2dparityfec, &hfi_2dparityfec_rfc2733_ext, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tree_2dparityfec, &hfi_2dparityfec_pt_recovery, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1;
+ proto_tree_add_item(tree_2dparityfec, &hfi_2dparityfec_mask, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3;
+ proto_tree_add_item(tree_2dparityfec, &hfi_2dparityfec_ts_recovery, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4;
+ proto_tree_add_item(tree_2dparityfec, &hfi_2dparityfec_ts_pro_mpeg_ext, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tree_2dparityfec, &hfi_2dparityfec_row_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tree_2dparityfec, &hfi_2dparityfec_type, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tree_2dparityfec, &hfi_2dparityfec_index, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1;
+ proto_tree_add_item(tree_2dparityfec, &hfi_2dparityfec_offset, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1;
+ proto_tree_add_item(tree_2dparityfec, &hfi_2dparityfec_na, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1;
+ proto_tree_add_item(tree_2dparityfec, &hfi_2dparityfec_snbase_ext, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1;
+ proto_tree_add_item(tree_2dparityfec, &hfi_2dparityfec_payload, tvb, offset, -1, ENC_NA);
}
}
@@ -163,148 +296,21 @@ void proto_register_2dparityfec(void)
module_t *module_2dparityfec;
/* Payload type definitions */
- static hf_register_info hf[] = {
- {&hf_2dparityfec_snbase_low,
- { "SNBase low",
- "2dparityfec.snbase_low",
- FT_UINT16,
- BASE_DEC,
- NULL,
- 0x0,
- NULL,
- HFILL} },
-
- {&hf_2dparityfec_length_recovery,
- { "Length recovery",
- "2dparityfec.lr",
- FT_UINT16,
- BASE_HEX,
- NULL,
- 0x0,
- NULL,
- HFILL} },
-
- {&hf_2dparityfec_rfc2733_ext,
- { "RFC2733 Extension (E)",
- "2dparityfec.e",
- FT_BOOLEAN,
- 8,
- NULL,
- 0x80,
- NULL,
- HFILL} },
-
- {&hf_2dparityfec_pt_recovery,
- { "Payload Type recovery",
- "2dparityfec.ptr",
- FT_UINT8,
- BASE_HEX,
- NULL,
- 0x7f,
- NULL,
- HFILL} },
-
- {&hf_2dparityfec_mask,
- { "Mask",
- "2dparityfec.mask",
- /*FT_UINT32*/FT_UINT24,
- BASE_HEX,
- NULL,
- /*0x00ffffff*/0x0,
- NULL,
- HFILL} },
-
- {&hf_2dparityfec_ts_recovery,
- { "Timestamp recovery",
- "2dparityfec.tsr",
- FT_UINT32,
- BASE_HEX,
- NULL,
- 0x0,
- NULL,
- HFILL} },
-
- {&hf_2dparityfec_ts_pro_mpeg_ext,
- { "Pro-MPEG Extension (X)",
- "2dparityfec.x",
- FT_BOOLEAN,
- 8,
- NULL,
- 0x80,
- NULL,
- HFILL} },
-
- {&hf_2dparityfec_row_flag,
- { "Row FEC (D)",
- "2dparityfec.d",
- FT_BOOLEAN,
- 8,
- NULL,
- 0x40,
- NULL,
- HFILL} },
-
- {&hf_2dparityfec_type,
- { "Type",
- "2dparityfec.type",
- FT_UINT8,
- BASE_DEC,
- VALS(fec_type_names),
- 0x38,
- NULL,
- HFILL} },
-
- {&hf_2dparityfec_index,
- { "Index",
- "2dparityfec.index",
- FT_UINT8,
- BASE_DEC,
- NULL,
- 0x07,
- NULL,
- HFILL} },
-
- {&hf_2dparityfec_offset,
- { "Offset",
- "2dparityfec.offset",
- FT_UINT8,
- BASE_DEC,
- NULL,
- 0x0,
- NULL,
- HFILL} },
-
- {&hf_2dparityfec_na,
- { "NA",
- "2dparityfec.na",
- FT_UINT8,
- BASE_DEC,
- NULL,
- 0x0,
- NULL,
- HFILL} },
-
- {&hf_2dparityfec_snbase_ext,
- { "SNBase ext",
- "2dparityfec.snbase_ext",
- FT_UINT8,
- BASE_DEC,
- NULL,
- 0x0,
- NULL,
- HFILL} },
-
- {&hf_2dparityfec_payload,
- { "FEC Payload",
- "2dparityfec.payload",
- FT_BYTES,
- BASE_NONE,
- NULL,
- 0x0,
- NULL,
- HFILL} }
-
-
+ static header_field_info *hfi[] = {
+ &hfi_2dparityfec_snbase_low,
+ &hfi_2dparityfec_length_recovery,
+ &hfi_2dparityfec_rfc2733_ext,
+ &hfi_2dparityfec_pt_recovery,
+ &hfi_2dparityfec_mask,
+ &hfi_2dparityfec_ts_recovery,
+ &hfi_2dparityfec_ts_pro_mpeg_ext,
+ &hfi_2dparityfec_row_flag,
+ &hfi_2dparityfec_type,
+ &hfi_2dparityfec_index,
+ &hfi_2dparityfec_offset,
+ &hfi_2dparityfec_na,
+ &hfi_2dparityfec_snbase_ext,
+ &hfi_2dparityfec_payload,
};
/* Setup protocol subtree array */
@@ -312,12 +318,15 @@ void proto_register_2dparityfec(void)
&ett_2dparityfec,
};
+ int proto_2dparityfec;
+
proto_2dparityfec = proto_register_protocol(
"Pro-MPEG Code of Practice #3 release 2 FEC Protocol", /* name */
"2dparityfec", /* short name */
"2dparityfec"); /* abbrev */
+ hfi_2dparityfec = proto_registrar_get_nth(proto_2dparityfec);
- proto_register_field_array(proto_2dparityfec, hf, array_length(hf));
+ proto_register_fields(proto_2dparityfec, hfi, array_length(hfi));
proto_register_subtree_array(ett, array_length(ett));
module_2dparityfec = prefs_register_protocol(proto_2dparityfec,
@@ -329,17 +338,12 @@ void proto_register_2dparityfec(void)
"as FEC data corresponding to Pro-MPEG Code of Practice #3 release 2",
&dissect_fec);
+ handle_2dparityfec = create_dissector_handle(dissect_2dparityfec,
+ proto_2dparityfec);
}
void proto_reg_handoff_2dparityfec(void)
{
- static dissector_handle_t handle_2dparityfec = NULL;
-
- if (!handle_2dparityfec) {
- handle_2dparityfec = create_dissector_handle(dissect_2dparityfec,
- proto_2dparityfec);
- }
-
if (dissect_fec) {
dissector_add_uint("rtp.pt", fec_rtp_payload_type, handle_2dparityfec);
} else {
diff --git a/epan/dissectors/packet-acap.c b/epan/dissectors/packet-acap.c
index 975cde551a..1dd9f4db18 100644
--- a/epan/dissectors/packet-acap.c
+++ b/epan/dissectors/packet-acap.c
@@ -26,6 +26,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#define NEW_PROTO_TREE_API
+
#include "config.h"
#include <glib.h>
@@ -36,9 +38,22 @@
void proto_register_acap(void);
void proto_reg_handoff_acap(void);
-static int proto_acap = -1;
-static int hf_acap_response = -1;
-static int hf_acap_request = -1;
+static dissector_handle_t acap_handle;
+
+static header_field_info *hfi_acap = NULL;
+
+#define HFI_ACAP HFI_INIT(proto_acap)
+
+static header_field_info hfi_acap_response HFI_ACAP =
+ { "Response", "acap.response",
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0,
+ "TRUE if ACAP response", HFILL };
+
+static header_field_info hfi_acap_request HFI_ACAP =
+ { "Request", "acap.request",
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0,
+ "TRUE if ACAP request", HFILL };
+
static gint ett_acap = -1;
static gint ett_acap_reqresp = -1;
@@ -84,17 +99,17 @@ dissect_acap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
format_text(line, linelen));
if (tree) {
- ti = proto_tree_add_item(tree, proto_acap, tvb, offset, -1,
+ ti = proto_tree_add_item(tree, hfi_acap, tvb, offset, -1,
ENC_NA);
acap_tree = proto_item_add_subtree(ti, ett_acap);
if (is_request) {
hidden_item = proto_tree_add_boolean(acap_tree,
- hf_acap_request, tvb, 0, 0, TRUE);
+ &hfi_acap_request, tvb, 0, 0, TRUE);
PROTO_ITEM_SET_HIDDEN(hidden_item);
} else {
hidden_item = proto_tree_add_boolean(acap_tree,
- hf_acap_response, tvb, 0, 0, TRUE);
+ &hfi_acap_response, tvb, 0, 0, TRUE);
PROTO_ITEM_SET_HIDDEN(hidden_item);
}
@@ -159,33 +174,30 @@ dissect_acap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
void
proto_register_acap(void)
{
- static hf_register_info hf[] = {
- { &hf_acap_response,
- { "Response", "acap.response",
- FT_BOOLEAN, BASE_NONE, NULL, 0x0,
- "TRUE if ACAP response", HFILL }},
-
- { &hf_acap_request,
- { "Request", "acap.request",
- FT_BOOLEAN, BASE_NONE, NULL, 0x0,
- "TRUE if ACAP request", HFILL }}
+ static header_field_info *hfi[] = {
+ &hfi_acap_response,
+ &hfi_acap_request,
};
+
static gint *ett[] = {
&ett_acap,
&ett_acap_reqresp,
};
+ int proto_acap;
+
proto_acap = proto_register_protocol("Application Configuration Access Protocol",
"ACAP", "acap");
- proto_register_field_array(proto_acap, hf, array_length(hf));
+ hfi_acap = proto_registrar_get_nth(proto_acap);
+
+ proto_register_fields(proto_acap, hfi, array_length(hfi));
proto_register_subtree_array(ett, array_length(ett));
+
+ acap_handle = create_dissector_handle(dissect_acap, proto_acap);
}
void
proto_reg_handoff_acap(void)
{
- dissector_handle_t acap_handle;
-
- acap_handle = create_dissector_handle(dissect_acap, proto_acap);
dissector_add_uint("tcp.port", TCP_PORT_ACAP, acap_handle);
}
diff --git a/epan/dissectors/packet-data.c b/epan/dissectors/packet-data.c
index ba3388fd20..1290cf3cc8 100644
--- a/epan/dissectors/packet-data.c
+++ b/epan/dissectors/packet-data.c
@@ -23,6 +23,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#define NEW_PROTO_TREE_API
+
#include "config.h"
#include <glib.h>
@@ -40,10 +42,19 @@ void proto_register_data(void);
int proto_data = -1;
-static int hf_data_data = -1;
-static int hf_data_text = -1;
-static int hf_data_len = -1;
-static int hf_data_md5_hash = -1;
+#define DATA_HFI_INIT HFI_INIT(proto_data)
+
+static header_field_info hfi_data_data DATA_HFI_INIT =
+ { "Data", "data.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL };
+
+static header_field_info hfi_data_text DATA_HFI_INIT =
+ { "Text", "data.text", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL };
+
+static header_field_info hfi_data_len DATA_HFI_INIT =
+ { "Length", "data.len", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL };
+
+static header_field_info hfi_data_md5_hash DATA_HFI_INIT =
+ { "Payload MD5 hash", "data.md5_hash", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL };
static gboolean new_pane = FALSE;
static gboolean show_as_text = FALSE;
@@ -76,10 +87,10 @@ dissect_data(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
plurality(bytes, "", "s"));
data_tree = proto_item_add_subtree(ti, ett_data);
- proto_tree_add_item(data_tree, hf_data_data, data_tvb, 0, bytes, ENC_NA);
+ proto_tree_add_item(data_tree, &hfi_data_data, data_tvb, 0, bytes, ENC_NA);
if (show_as_text) {
- proto_tree_add_item(data_tree, hf_data_text, data_tvb, 0, bytes, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(data_tree, &hfi_data_text, data_tvb, 0, bytes, ENC_ASCII|ENC_NA);
}
if(generate_md5_hash) {
@@ -95,11 +106,11 @@ dissect_data(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
md5_finish(&md_ctx, digest);
digest_string = bytestring_to_str(digest, 16, '\0');
- ti = proto_tree_add_string(data_tree, hf_data_md5_hash, tvb, 0, 0, digest_string);
+ ti = proto_tree_add_string(data_tree, &hfi_data_md5_hash, tvb, 0, 0, digest_string);
PROTO_ITEM_SET_GENERATED(ti);
}
- ti = proto_tree_add_int(data_tree, hf_data_len, data_tvb, 0, 0, bytes);
+ ti = proto_tree_add_int(data_tree, &hfi_data_len, data_tvb, 0, 0, bytes);
PROTO_ITEM_SET_GENERATED (ti);
}
}
@@ -108,15 +119,11 @@ dissect_data(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
void
proto_register_data(void)
{
- static hf_register_info hf[] = {
- { &hf_data_data,
- { "Data", "data.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
- { &hf_data_text,
- { "Text", "data.text", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
- { &hf_data_md5_hash,
- { "Payload MD5 hash", "data.md5_hash", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
- { &hf_data_len,
- { "Length", "data.len", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }
+ static header_field_info *hfi[] = {
+ &hfi_data_data,
+ &hfi_data_text,
+ &hfi_data_md5_hash,
+ &hfi_data_len,
};
static gint *ett[] = {
@@ -133,7 +140,7 @@ proto_register_data(void)
register_dissector("data", dissect_data, proto_data);
- proto_register_field_array(proto_data, hf, array_length(hf));
+ proto_register_fields(proto_data, hfi, array_length(hfi));
proto_register_subtree_array(ett, array_length(ett));
module_data = prefs_register_protocol( proto_data, NULL);
diff --git a/epan/dissectors/packet-daytime.c b/epan/dissectors/packet-daytime.c
index 5dfd7a3961..926beb1ec2 100644
--- a/epan/dissectors/packet-daytime.c
+++ b/epan/dissectors/packet-daytime.c
@@ -25,6 +25,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#define NEW_PROTO_TREE_API
+
#include "config.h"
#include <epan/packet.h>
@@ -32,8 +34,16 @@
void proto_register_daytime(void);
void proto_reg_handoff_daytime(void);
-static int proto_daytime = -1;
-static int hf_daytime_string = -1;
+static dissector_handle_t daytime_handle;
+
+static header_field_info *hfi_daytime = NULL;
+
+#define DAYTIME_HFI_INIT HFI_INIT(proto_daytime)
+
+static header_field_info hfi_daytime_string DAYTIME_HFI_INIT =
+ { "Daytime", "daytime.string",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ "String containing time and date", HFILL };
static gint ett_daytime = -1;
@@ -53,13 +63,13 @@ dissect_daytime(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
- ti = proto_tree_add_item(tree, proto_daytime, tvb, 0, -1, ENC_NA);
+ ti = proto_tree_add_item(tree, hfi_daytime, tvb, 0, -1, ENC_NA);
daytime_tree = proto_item_add_subtree(ti, ett_daytime);
proto_tree_add_text(daytime_tree, tvb, 0, 0,
pinfo->srcport==DAYTIME_PORT ? "Type: Response":"Type: Request");
if (pinfo->srcport == DAYTIME_PORT) {
- proto_tree_add_item(daytime_tree, hf_daytime_string, tvb, 0, -1, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(daytime_tree, &hfi_daytime_string, tvb, 0, -1, ENC_ASCII|ENC_NA);
}
}
}
@@ -67,28 +77,28 @@ dissect_daytime(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
void
proto_register_daytime(void)
{
-
- static hf_register_info hf[] = {
- { &hf_daytime_string,
- { "Daytime", "daytime.string",
- FT_STRING, BASE_NONE, NULL, 0x0,
- "String containing time and date", HFILL }}
+ static header_field_info *hfi[] = {
+ &hfi_daytime_string,
};
+
static gint *ett[] = {
&ett_daytime,
};
+ int proto_daytime;
+
proto_daytime = proto_register_protocol("Daytime Protocol", "DAYTIME", "daytime");
- proto_register_field_array(proto_daytime, hf, array_length(hf));
+ hfi_daytime = proto_registrar_get_nth(proto_daytime);
+
+ proto_register_fields(proto_daytime, hfi, array_length(hfi));
proto_register_subtree_array(ett, array_length(ett));
+
+ daytime_handle = create_dissector_handle(dissect_daytime, proto_daytime);
}
void
proto_reg_handoff_daytime(void)
{
- dissector_handle_t daytime_handle;
-
- daytime_handle = create_dissector_handle(dissect_daytime, proto_daytime);
dissector_add_uint("udp.port", DAYTIME_PORT, daytime_handle);
dissector_add_uint("tcp.port", DAYTIME_PORT, daytime_handle);
}
diff --git a/epan/dissectors/packet-fcdns.c b/epan/dissectors/packet-fcdns.c
index 625acc7265..ac65019dd2 100644
--- a/epan/dissectors/packet-fcdns.c
+++ b/epan/dissectors/packet-fcdns.c
@@ -23,6 +23,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#define NEW_PROTO_TREE_API
+
#include "config.h"
#ifdef HAVE_NETINET_IN_H
@@ -45,72 +47,272 @@
* See FC-GS-2.
*/
-/* Initialize the protocol and registered fields */
-static int proto_fcdns = -1;
-/* static int hf_fcdns_gssubtype = -1; */
-static int hf_fcdns_opcode = -1;
-static int hf_fcdns_reason = -1;
-static int hf_fcdns_vendor = -1;
-static int hf_fcdns_req_portid = -1;
-static int hf_fcdns_rply_pname = -1;
-static int hf_fcdns_rply_nname = -1;
-static int hf_fcdns_rply_gft = -1;
-static int hf_fcdns_rply_snamelen = -1;
-static int hf_fcdns_rply_sname = -1;
-static int hf_fcdns_rply_ptype = -1;
-static int hf_fcdns_rply_fpname = -1;
-static int hf_fcdns_fc4type = -1;
-static int hf_fcdns_rply_fc4type = -1;
-static int hf_fcdns_rply_fc4desc = -1;
-static int hf_fcdns_req_pname = -1;
-static int hf_fcdns_rply_portid = -1;
-static int hf_fcdns_req_nname = -1;
-static int hf_fcdns_req_domainscope = -1;
-static int hf_fcdns_req_areascope = -1;
-static int hf_fcdns_req_ptype = -1;
-static int hf_fcdns_req_cos = -1;
-static int hf_fcdns_req_fc4types = -1;
-static int hf_fcdns_req_snamelen = -1;
-static int hf_fcdns_req_sname = -1;
-static int hf_fcdns_rply_spnamelen = -1;
-static int hf_fcdns_rply_spname = -1;
-static int hf_fcdns_req_spnamelen = -1;
-static int hf_fcdns_req_spname = -1;
-static int hf_fcdns_rply_ipa = -1;
-static int hf_fcdns_rply_ipnode = -1;
-static int hf_fcdns_rply_ipport = -1;
-static int hf_fcdns_rply_fc4desclen = -1;
-static int hf_fcdns_rply_hrdaddr = -1;
-static int hf_fcdns_req_fdesclen = -1;
-static int hf_fcdns_req_fdesc = -1;
-static int hf_fcdns_req_ip = -1;
-static int hf_fcdns_rjtdetail = -1;
-static int hf_fcdns_zone_mbrtype = -1;
-static int hf_fcdns_zone_mbrid = -1;
-static int hf_fcdns_zonenm = -1;
-static int hf_fcdns_portip = -1;
-static int hf_fcdns_sw2_objfmt = -1;
-static int hf_fcdns_num_fc4desc = -1;
-static int hf_fcdns_rply_ownerid = -1;
-static int hf_fcdns_maxres_size = -1;
-static int hf_fcdns_reply_cos = -1;
-static int hf_fcdns_cos_f = -1;
-static int hf_fcdns_cos_1 = -1;
-static int hf_fcdns_cos_2 = -1;
-static int hf_fcdns_cos_3 = -1;
-static int hf_fcdns_cos_4 = -1;
-static int hf_fcdns_cos_6 = -1;
-static int hf_fcdns_fc4type_llcsnap = -1;
-static int hf_fcdns_fc4type_ip = -1;
-static int hf_fcdns_fc4type_fcp = -1;
-static int hf_fcdns_fc4type_swils = -1;
-static int hf_fcdns_fc4type_snmp = -1;
-static int hf_fcdns_fc4type_gs3 = -1;
-static int hf_fcdns_fc4type_vi = -1;
-static int hf_fcdns_fc4features = -1;
-static int hf_fcdns_fc4features_i = -1;
-static int hf_fcdns_fc4features_t = -1;
-static int hf_fcdns_req_fc4type = -1;
+static dissector_handle_t dns_handle;
+
+/* protocol and registered fields */
+
+static header_field_info *hfi_fcdns = NULL;
+
+#define FCDNS_HFI_INIT HFI_INIT(proto_fcdns)
+
+#if 0
+static header_field_info hfi_fcdns_gssubtype FCDNS_HFI_INIT =
+ {"GS_Subtype", "fcdns.gssubtype", FT_UINT8, BASE_HEX,
+ VALS(fc_dns_subtype_val), 0x0, NULL, HFILL};
+#endif
+
+static header_field_info hfi_fcdns_opcode FCDNS_HFI_INIT =
+ {"Opcode", "fcdns.opcode", FT_UINT16, BASE_HEX, VALS (fc_dns_opcode_val),
+ 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_reason FCDNS_HFI_INIT =
+ {"Reason Code", "fcdns.rply.reason", FT_UINT8, BASE_HEX,
+ VALS (fc_ct_rjt_code_vals), 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_vendor FCDNS_HFI_INIT =
+ {"Vendor Unique Reject Code", "fcdns.rply.vendor", FT_UINT8,
+ BASE_HEX, NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_req_portid FCDNS_HFI_INIT =
+ {"Port Identifier", "fcdns.req.portid", FT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL};
+
+static header_field_info hfi_fcdns_rply_pname FCDNS_HFI_INIT =
+ {"Port Name", "fcdns.rply.pname", FT_STRING, BASE_NONE, NULL, 0x0, NULL,
+ HFILL};
+
+static header_field_info hfi_fcdns_rply_nname FCDNS_HFI_INIT =
+ {"Node Name", "fcdns.rply.nname", FT_STRING, BASE_NONE, NULL, 0x0, NULL,
+ HFILL};
+
+static header_field_info hfi_fcdns_rply_gft FCDNS_HFI_INIT =
+ {"FC-4 Types Supported", "fcdns.rply.fc4type", FT_NONE, BASE_NONE,
+ NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_rply_snamelen FCDNS_HFI_INIT =
+ {"Symbolic Node Name Length", "fcdns.rply.snamelen", FT_UINT8, BASE_DEC,
+ NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_rply_sname FCDNS_HFI_INIT =
+ {"Symbolic Node Name", "fcdns.rply.sname", FT_STRING, BASE_NONE, NULL,
+ 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_rply_ptype FCDNS_HFI_INIT =
+ {"Port Type", "fcdns.rply.porttype", FT_UINT8, BASE_HEX,
+ VALS (fc_dns_port_type_val), 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_rply_fpname FCDNS_HFI_INIT =
+ {"Fabric Port Name", "fcdns.rply.fpname", FT_STRING, BASE_NONE, NULL,
+ 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_fc4type FCDNS_HFI_INIT =
+ {"FC-4 Types", "fcdns.req.fc4type", FT_NONE, BASE_NONE,
+ NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_rply_fc4type FCDNS_HFI_INIT =
+ {"FC-4 Descriptor Type", "fcdns.rply.fc4type", FT_UINT8, BASE_HEX,
+ VALS (fc_fc4_val), 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_rply_fc4desc FCDNS_HFI_INIT =
+ {"FC-4 Descriptor", "fcdns.rply.fc4desc", FT_BYTES, BASE_NONE, NULL,
+ 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_req_pname FCDNS_HFI_INIT =
+ {"Port Name", "fcdns.req.portname", FT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL};
+
+static header_field_info hfi_fcdns_rply_portid FCDNS_HFI_INIT =
+ {"Port Identifier", "fcdns.rply.portid", FT_STRING, BASE_NONE, NULL,
+ 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_req_nname FCDNS_HFI_INIT =
+ {"Node Name", "fcdns.req.nname", FT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL};
+
+static header_field_info hfi_fcdns_req_domainscope FCDNS_HFI_INIT =
+ {"Domain ID Scope", "fcdns.req.domainid", FT_UINT8, BASE_HEX, NULL,
+ 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_req_areascope FCDNS_HFI_INIT =
+ {"Area ID Scope", "fcdns.req.areaid", FT_UINT8, BASE_HEX, NULL,
+ 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_req_ptype FCDNS_HFI_INIT =
+ {"Port Type", "fcdns.req.porttype", FT_UINT8, BASE_HEX,
+ VALS (fc_dns_port_type_val), 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_req_cos FCDNS_HFI_INIT =
+ {"Requested Class of Service", "fcdns.req.class", FT_UINT32, BASE_HEX,
+ NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_req_fc4types FCDNS_HFI_INIT =
+ {"FC-4 Types Supported", "fcdns.req.fc4types", FT_NONE, BASE_NONE,
+ NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_req_snamelen FCDNS_HFI_INIT =
+ {"Symbolic Name Length", "fcdns.req.snamelen", FT_UINT8, BASE_DEC,
+ NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_req_sname FCDNS_HFI_INIT =
+ {"Symbolic Port Name", "fcdns.req.sname", FT_STRING, BASE_NONE, NULL,
+ 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_rply_spnamelen FCDNS_HFI_INIT =
+ {"Symbolic Port Name Length", "fcdns.rply.spnamelen", FT_UINT8,
+ BASE_DEC, NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_rply_spname FCDNS_HFI_INIT =
+ {"Symbolic Port Name", "fcdns.rply.spname", FT_STRING, BASE_NONE, NULL,
+ 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_req_spnamelen FCDNS_HFI_INIT =
+ {"Symbolic Port Name Length", "fcdns.req.spnamelen", FT_UINT8,
+ BASE_DEC, NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_req_spname FCDNS_HFI_INIT =
+ {"Symbolic Port Name", "fcdns.req.spname", FT_STRING, BASE_NONE, NULL,
+ 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_rply_ipa FCDNS_HFI_INIT =
+ {"Initial Process Associator", "fcdns.rply.ipa", FT_BYTES, BASE_NONE,
+ NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_rply_ipnode FCDNS_HFI_INIT =
+ {"Node IP Address", "fcdns.rply.ipnode", FT_IPv6, BASE_NONE, NULL,
+ 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_rply_ipport FCDNS_HFI_INIT =
+ {"Port IP Address", "fcdns.rply.ipport", FT_IPv6, BASE_NONE, NULL,
+ 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_rply_fc4desclen FCDNS_HFI_INIT =
+ {"FC-4 Descriptor Length", "fcdns.rply.fc4desclen", FT_UINT8,
+ BASE_DEC, NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_rply_hrdaddr FCDNS_HFI_INIT =
+ {"Hard Address", "fcdns.rply.hrdaddr", FT_STRING, BASE_NONE, NULL,
+ 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_req_fdesclen FCDNS_HFI_INIT =
+ {"FC-4 Descriptor Length", "fcdns.req.fc4desclen", FT_UINT8, BASE_DEC,
+ NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_req_fdesc FCDNS_HFI_INIT =
+ {"FC-4 Descriptor", "fcdns.req.fc4desc", FT_STRING, BASE_NONE, NULL,
+ 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_req_ip FCDNS_HFI_INIT =
+ {"IP Address", "fcdns.req.ip", FT_IPv6, BASE_NONE, NULL, 0x0,
+ NULL, HFILL};
+
+static header_field_info hfi_fcdns_rjtdetail FCDNS_HFI_INIT =
+ {"Reason Code Explanantion", "fcdns.rply.reasondet", FT_UINT8,
+ BASE_HEX, VALS (fc_dns_rjt_det_code_val), 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_zone_mbrtype FCDNS_HFI_INIT =
+ {"Zone Member Type", "fcdns.zone.mbrtype", FT_UINT8, BASE_HEX,
+ VALS (fc_swils_zonembr_type_val), 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_zone_mbrid FCDNS_HFI_INIT =
+ {"Member Identifier", "fcdns.zone.mbrid", FT_STRING, BASE_NONE, NULL,
+ 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_zonenm FCDNS_HFI_INIT =
+ {"Zone Name", "fcdns.zonename", FT_STRING, BASE_NONE, NULL, 0x0, NULL,
+ HFILL};
+
+static header_field_info hfi_fcdns_portip FCDNS_HFI_INIT =
+ {"Port IP Address", "fcdns.portip", FT_IPv4, BASE_NONE, NULL, 0x0,
+ NULL, HFILL};
+
+static header_field_info hfi_fcdns_sw2_objfmt FCDNS_HFI_INIT =
+ {"Name Entry Object Format", "fcdns.entry.objfmt", FT_UINT8, BASE_HEX,
+ NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_num_fc4desc FCDNS_HFI_INIT =
+ {"Number of FC4 Descriptors Registered", "fcdns.entry.numfc4desc",
+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_rply_ownerid FCDNS_HFI_INIT =
+ {"Owner Id", "fcdns.rply.ownerid", FT_STRING, BASE_NONE, NULL, 0x0, NULL,
+ HFILL};
+
+static header_field_info hfi_fcdns_maxres_size FCDNS_HFI_INIT =
+ {"Maximum/Residual Size", "fcdns.maxres_size", FT_UINT16, BASE_DEC,
+ NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_reply_cos FCDNS_HFI_INIT =
+ {"Class of Service Supported", "fcdns.reply.cos", FT_UINT32, BASE_HEX,
+ NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_cos_f FCDNS_HFI_INIT =
+ {"F", "fcdns.cos.f", FT_BOOLEAN, 32,
+ TFS(&tfs_set_notset), 0x01, NULL, HFILL};
+
+static header_field_info hfi_fcdns_cos_1 FCDNS_HFI_INIT =
+ {"1", "fcdns.cos.1", FT_BOOLEAN, 32,
+ TFS(&tfs_set_notset), 0x02, NULL, HFILL};
+
+static header_field_info hfi_fcdns_cos_2 FCDNS_HFI_INIT =
+ {"2", "fcdns.cos.2", FT_BOOLEAN, 32,
+ TFS(&tfs_set_notset), 0x04, NULL, HFILL};
+
+static header_field_info hfi_fcdns_cos_3 FCDNS_HFI_INIT =
+ {"3", "fcdns.cos.3", FT_BOOLEAN, 32,
+ TFS(&tfs_set_notset), 0x08, NULL, HFILL};
+
+static header_field_info hfi_fcdns_cos_4 FCDNS_HFI_INIT =
+ {"4", "fcdns.cos.4", FT_BOOLEAN, 32,
+ TFS(&tfs_set_notset), 0x10, NULL, HFILL};
+
+static header_field_info hfi_fcdns_cos_6 FCDNS_HFI_INIT =
+ {"6", "fcdns.cos.6", FT_BOOLEAN, 32,
+ TFS(&tfs_set_notset), 0x40, NULL, HFILL};
+
+static header_field_info hfi_fcdns_fc4type_llcsnap FCDNS_HFI_INIT =
+ {"LLC/SNAP", "fcdns.fc4types.llc_snap", FT_BOOLEAN, 32,
+ TFS(&tfs_set_notset), 0x0010, NULL, HFILL};
+
+static header_field_info hfi_fcdns_fc4type_ip FCDNS_HFI_INIT =
+ {"IP", "fcdns.fc4types.ip", FT_BOOLEAN, 32,
+ TFS(&tfs_set_notset), 0x0020, NULL, HFILL};
+
+static header_field_info hfi_fcdns_fc4type_fcp FCDNS_HFI_INIT =
+ {"FCP", "fcdns.fc4types.fcp", FT_BOOLEAN, 32,
+ TFS(&tfs_set_notset), 0x0100, NULL, HFILL};
+
+static header_field_info hfi_fcdns_fc4type_swils FCDNS_HFI_INIT =
+ {"SW_ILS", "fcdns.fc4types.swils", FT_BOOLEAN, 32,
+ TFS(&tfs_set_notset), 0x0010, NULL, HFILL};
+
+static header_field_info hfi_fcdns_fc4type_snmp FCDNS_HFI_INIT =
+ {"SNMP", "fcdns.fc4types.snmp", FT_BOOLEAN, 32,
+ TFS(&tfs_set_notset), 0x0004, NULL, HFILL};
+
+static header_field_info hfi_fcdns_fc4type_gs3 FCDNS_HFI_INIT =
+ {"GS3", "fcdns.fc4types.gs3", FT_BOOLEAN, 32,
+ TFS(&tfs_set_notset), 0x0001, NULL, HFILL};
+
+static header_field_info hfi_fcdns_fc4type_vi FCDNS_HFI_INIT =
+ {"VI", "fcdns.fc4types.vi", FT_BOOLEAN, 32,
+ TFS(&tfs_set_notset), 0x0001, NULL, HFILL};
+
+static header_field_info hfi_fcdns_fc4features FCDNS_HFI_INIT =
+ {"FC-4 Feature Bits", "fcdns.fc4features", FT_UINT8,
+ BASE_HEX, NULL, 0x0, NULL, HFILL};
+
+static header_field_info hfi_fcdns_fc4features_i FCDNS_HFI_INIT =
+ {"I", "fcdns.fc4features.i", FT_BOOLEAN, 8,
+ TFS(&tfs_set_notset), 0x02, NULL, HFILL};
+
+static header_field_info hfi_fcdns_fc4features_t FCDNS_HFI_INIT =
+ {"T", "fcdns.fc4features.t", FT_BOOLEAN, 8,
+ TFS(&tfs_set_notset), 0x01, NULL, HFILL};
+
+static header_field_info hfi_fcdns_req_fc4type FCDNS_HFI_INIT =
+ {"FC-4 Type", "fcdns.req.fc4type", FT_UINT8, BASE_HEX,
+ VALS (fc_fc4_val), 0x0, NULL, HFILL};
+
/* Initialize the subtree pointers */
static gint ett_fcdns = -1;
@@ -167,7 +369,7 @@ fcdns_init_protocol(void)
static void
-dissect_cos_flags (proto_tree *parent_tree, tvbuff_t *tvb, int offset, int hfindex)
+dissect_cos_flags (proto_tree *parent_tree, tvbuff_t *tvb, int offset, const header_field_info *hfinfo)
{
proto_item *item=NULL;
proto_tree *tree=NULL;
@@ -175,43 +377,43 @@ dissect_cos_flags (proto_tree *parent_tree, tvbuff_t *tvb, int offset, int hfind
flags = tvb_get_ntohl (tvb, offset);
if(parent_tree){
- item=proto_tree_add_uint(parent_tree, hfindex,
+ item=proto_tree_add_uint(parent_tree, hfinfo,
tvb, offset, 1, flags);
tree=proto_item_add_subtree(item, ett_cos_flags);
}
- proto_tree_add_boolean(tree, hf_fcdns_cos_f, tvb, offset, 4, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_cos_f, tvb, offset, 4, flags);
if (flags&0x01){
proto_item_append_text(item, " F");
}
flags&=(~( 0x01 ));
- proto_tree_add_boolean(tree, hf_fcdns_cos_1, tvb, offset, 4, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_cos_1, tvb, offset, 4, flags);
if (flags&0x02){
proto_item_append_text(item, " 1");
}
flags&=(~( 0x02 ));
- proto_tree_add_boolean(tree, hf_fcdns_cos_2, tvb, offset, 4, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_cos_2, tvb, offset, 4, flags);
if (flags&0x04){
proto_item_append_text(item, " 2");
}
flags&=(~( 0x04 ));
- proto_tree_add_boolean(tree, hf_fcdns_cos_3, tvb, offset, 4, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_cos_3, tvb, offset, 4, flags);
if (flags&0x08){
proto_item_append_text(item, " 3");
}
flags&=(~( 0x08 ));
- proto_tree_add_boolean(tree, hf_fcdns_cos_4, tvb, offset, 4, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_cos_4, tvb, offset, 4, flags);
if (flags&0x10){
proto_item_append_text(item, " 4");
}
flags&=(~( 0x10 ));
- proto_tree_add_boolean(tree, hf_fcdns_cos_6, tvb, offset, 4, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_cos_6, tvb, offset, 4, flags);
if (flags&0x40){
proto_item_append_text(item, " 6");
}
@@ -233,26 +435,26 @@ dissect_fc4features_and_type (proto_tree *parent_tree, tvbuff_t *tvb, int offset
flags = tvb_get_guint8(tvb, offset);
type = tvb_get_guint8(tvb, offset+1);
if(parent_tree){
- item=proto_tree_add_uint(parent_tree, hf_fcdns_fc4features,
+ item=proto_tree_add_uint(parent_tree, &hfi_fcdns_fc4features,
tvb, offset, 1, flags);
tree=proto_item_add_subtree(item, ett_fc4features);
}
if(type==FC_TYPE_SCSI){
- proto_tree_add_boolean(tree, hf_fcdns_fc4features_i, tvb, offset, 1, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_fc4features_i, tvb, offset, 1, flags);
if (flags&0x02){
proto_item_append_text(item, " I");
}
flags&=(~( 0x02 ));
- proto_tree_add_boolean(tree, hf_fcdns_fc4features_t, tvb, offset, 1, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_fc4features_t, tvb, offset, 1, flags);
if (flags&0x01){
proto_item_append_text(item, " T");
}
/*flags&=(~( 0x01 ));*/
}
- proto_tree_add_item (tree, hf_fcdns_req_fc4type, tvb, offset+1, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item (tree, &hfi_fcdns_req_fc4type, tvb, offset+1, 1, ENC_BIG_ENDIAN);
}
/* The feature routines just decode FCP's FC-4 features field
@@ -266,18 +468,18 @@ dissect_fc4features (proto_tree *parent_tree, tvbuff_t *tvb, int offset)
flags = tvb_get_guint8(tvb, offset);
if(parent_tree){
- item=proto_tree_add_uint(parent_tree, hf_fcdns_fc4features,
+ item=proto_tree_add_uint(parent_tree, &hfi_fcdns_fc4features,
tvb, offset, 1, flags);
tree=proto_item_add_subtree(item, ett_fc4features);
}
- proto_tree_add_boolean(tree, hf_fcdns_fc4features_i, tvb, offset, 1, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_fc4features_i, tvb, offset, 1, flags);
if (flags&0x02){
proto_item_append_text(item, " I");
}
flags&=(~( 0x02 ));
- proto_tree_add_boolean(tree, hf_fcdns_fc4features_t, tvb, offset, 1, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_fc4features_t, tvb, offset, 1, flags);
if (flags&0x01){
proto_item_append_text(item, " T");
}
@@ -288,33 +490,33 @@ dissect_fc4features (proto_tree *parent_tree, tvbuff_t *tvb, int offset)
/* Decodes LLC/SNAP, IP, FCP, VI, GS, SW_ILS types only */
static void
-dissect_fc4type (proto_tree *parent_tree, tvbuff_t *tvb, int offset, int hfindex)
+dissect_fc4type (proto_tree *parent_tree, tvbuff_t *tvb, int offset, header_field_info *hfinfo)
{
proto_item *item=NULL;
proto_tree *tree=NULL;
guint32 flags;
if(parent_tree){
- item=proto_tree_add_item(parent_tree, hfindex, tvb, offset,
+ item=proto_tree_add_item(parent_tree, hfinfo, tvb, offset,
32, ENC_NA);
tree=proto_item_add_subtree(item, ett_fc4flags);
}
flags = tvb_get_ntohl (tvb, offset);
- proto_tree_add_boolean(tree, hf_fcdns_fc4type_fcp, tvb, offset, 4, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_fc4type_fcp, tvb, offset, 4, flags);
if (flags&0x0100){
proto_item_append_text(item, " FCP");
}
flags&=(~( 0x0100 ));
- proto_tree_add_boolean(tree, hf_fcdns_fc4type_ip, tvb, offset, 4, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_fc4type_ip, tvb, offset, 4, flags);
if (flags&0x0020){
proto_item_append_text(item, " IP");
}
flags&=(~( 0x0020 ));
- proto_tree_add_boolean(tree, hf_fcdns_fc4type_llcsnap, tvb, offset, 4, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_fc4type_llcsnap, tvb, offset, 4, flags);
if (flags&0x0010){
proto_item_append_text(item, " LLC/SNAP");
}
@@ -323,19 +525,19 @@ dissect_fc4type (proto_tree *parent_tree, tvbuff_t *tvb, int offset, int hfindex
flags = tvb_get_ntohl (tvb, offset+4);
- proto_tree_add_boolean(tree, hf_fcdns_fc4type_swils, tvb, offset+4, 4, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_fc4type_swils, tvb, offset+4, 4, flags);
if (flags&0x0010){
proto_item_append_text(item, " SW_ILS");
}
flags&=(~( 0x0010 ));
- proto_tree_add_boolean(tree, hf_fcdns_fc4type_snmp, tvb, offset+4, 4, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_fc4type_snmp, tvb, offset+4, 4, flags);
if (flags&0x0004){
proto_item_append_text(item, " SNMP");
}
flags&=(~( 0x0004 ));
- proto_tree_add_boolean(tree, hf_fcdns_fc4type_gs3, tvb, offset+4, 4, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_fc4type_gs3, tvb, offset+4, 4, flags);
if (flags&0x0001){
proto_item_append_text(item, " GS3");
}
@@ -344,7 +546,7 @@ dissect_fc4type (proto_tree *parent_tree, tvbuff_t *tvb, int offset, int hfindex
flags = tvb_get_ntohl (tvb, offset+8);
- proto_tree_add_boolean(tree, hf_fcdns_fc4type_vi, tvb, offset+8, 4, flags);
+ proto_tree_add_boolean(tree, &hfi_fcdns_fc4type_vi, tvb, offset+8, 4, flags);
if (flags&0x0001){
proto_item_append_text(item, " VI");
}
@@ -359,7 +561,7 @@ static void
dissect_fcdns_req_portid (tvbuff_t *tvb, proto_tree *tree, int offset)
{
if (tree) {
- proto_tree_add_string (tree, hf_fcdns_req_portid, tvb, offset, 3,
+ proto_tree_add_string (tree, &hfi_fcdns_req_portid, tvb, offset, 3,
tvb_fc_to_str (tvb, offset));
}
}
@@ -375,64 +577,64 @@ dissect_fcdns_ganxt (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
dissect_fcdns_req_portid (tvb, req_tree, offset+1);
}
else {
- proto_tree_add_item (req_tree, hf_fcdns_rply_ptype, tvb, offset,
+ proto_tree_add_item (req_tree, &hfi_fcdns_rply_ptype, tvb, offset,
1, ENC_BIG_ENDIAN);
- proto_tree_add_string (req_tree, hf_fcdns_rply_portid, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid, tvb,
offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
- proto_tree_add_string (req_tree, hf_fcdns_rply_pname, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_pname, tvb,
offset+4, 8,
tvb_fcwwn_to_str (tvb, offset+4));
len = tvb_get_guint8 (tvb, offset+12);
- proto_tree_add_item (req_tree, hf_fcdns_rply_spnamelen, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_rply_spnamelen, tvb,
offset+12, 1, ENC_BIG_ENDIAN);
if (!tvb_offset_exists (tvb, 29+len))
return;
if (len) {
- proto_tree_add_item (req_tree, hf_fcdns_rply_spname, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_rply_spname, tvb,
offset+13, len, ENC_ASCII|ENC_NA);
}
if (tvb_offset_exists (tvb, 292)) {
- proto_tree_add_string (req_tree, hf_fcdns_rply_nname, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_nname, tvb,
offset+268, 8,
tvb_fcwwn_to_str (tvb, offset+268));
}
if (tvb_offset_exists (tvb, 548)) {
len = tvb_get_guint8 (tvb, offset+276);
- proto_tree_add_item (req_tree, hf_fcdns_rply_snamelen, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_rply_snamelen, tvb,
offset+276, 1, ENC_BIG_ENDIAN);
if (len) {
- proto_tree_add_item (req_tree, hf_fcdns_rply_sname, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_rply_sname, tvb,
offset+277, len, ENC_ASCII|ENC_NA);
}
}
if (tvb_offset_exists (tvb, 556)) {
- proto_tree_add_item (req_tree, hf_fcdns_rply_ipa, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_rply_ipa, tvb,
offset+532, 8, ENC_NA);
}
if (tvb_offset_exists (tvb, 572)) {
- proto_tree_add_item (req_tree, hf_fcdns_rply_ipnode, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_rply_ipnode, tvb,
offset+540, 16, ENC_NA);
}
if (tvb_offset_exists (tvb, 576)) {
- dissect_cos_flags(req_tree, tvb, offset+556, hf_fcdns_reply_cos);
+ dissect_cos_flags(req_tree, tvb, offset+556, &hfi_fcdns_reply_cos);
}
if (tvb_offset_exists (tvb, 608)) {
- dissect_fc4type(req_tree, tvb, offset+560, hf_fcdns_rply_gft);
+ dissect_fc4type(req_tree, tvb, offset+560, &hfi_fcdns_rply_gft);
}
if (tvb_offset_exists (tvb, 624)) {
- proto_tree_add_item (req_tree, hf_fcdns_rply_ipport, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_rply_ipport, tvb,
offset+592, 16, ENC_NA);
}
if (tvb_offset_exists (tvb, 632)) {
- proto_tree_add_string (req_tree, hf_fcdns_rply_fpname, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_fpname, tvb,
offset+608, 8,
tvb_fcwwn_to_str (tvb, offset+608));
}
if (tvb_offset_exists (tvb, 635)) {
- proto_tree_add_string (req_tree, hf_fcdns_rply_hrdaddr, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_hrdaddr, tvb,
offset+617, 3,
tvb_fc_to_str (tvb, offset+617));
}
@@ -450,7 +652,7 @@ dissect_fcdns_gpnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
dissect_fcdns_req_portid (tvb, req_tree, offset+1);
}
else {
- proto_tree_add_string (req_tree, hf_fcdns_rply_pname, tvb, offset,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_pname, tvb, offset,
8, tvb_fcwwn_to_str (tvb, offset));
}
}
@@ -466,7 +668,7 @@ dissect_fcdns_gnnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
dissect_fcdns_req_portid (tvb, req_tree, offset+1);
}
else {
- proto_tree_add_string (req_tree, hf_fcdns_rply_nname, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_nname, tvb,
offset, 8,
tvb_fcwwn_to_str (tvb, offset));
}
@@ -483,7 +685,7 @@ dissect_fcdns_gcsid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
dissect_fcdns_req_portid (tvb, req_tree, offset);
}
else {
- dissect_cos_flags(req_tree, tvb, offset, hf_fcdns_reply_cos);
+ dissect_cos_flags(req_tree, tvb, offset, &hfi_fcdns_reply_cos);
}
}
}
@@ -498,7 +700,7 @@ dissect_fcdns_gftid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
dissect_fcdns_req_portid (tvb, req_tree, offset+1);
}
else {
- dissect_fc4type(req_tree, tvb, offset, hf_fcdns_rply_gft);
+ dissect_fc4type(req_tree, tvb, offset, &hfi_fcdns_rply_gft);
}
}
}
@@ -515,9 +717,9 @@ dissect_fcdns_gspnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
}
else {
len = tvb_get_guint8 (tvb, offset);
- proto_tree_add_item (req_tree, hf_fcdns_rply_spnamelen,
+ proto_tree_add_item (req_tree, &hfi_fcdns_rply_spnamelen,
tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item (req_tree, hf_fcdns_rply_spname, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_rply_spname, tvb,
offset+1, len, ENC_ASCII|ENC_NA);
}
}
@@ -533,7 +735,7 @@ dissect_fcdns_gptid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
dissect_fcdns_req_portid (tvb, req_tree, offset+1);
}
else {
- proto_tree_add_item (req_tree, hf_fcdns_rply_ptype, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_rply_ptype, tvb,
offset, 1, ENC_BIG_ENDIAN);
}
}
@@ -549,7 +751,7 @@ dissect_fcdns_gfpnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
dissect_fcdns_req_portid (tvb, req_tree, offset+1);
}
else {
- proto_tree_add_string (req_tree, hf_fcdns_rply_fpname, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_fpname, tvb,
offset, 8,
tvb_fcwwn_to_str (tvb, offset));
}
@@ -566,7 +768,7 @@ dissect_fcdns_gfdid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) {
if (isreq) {
dissect_fcdns_req_portid (tvb, req_tree, offset+1);
- dissect_fc4type(req_tree, tvb, offset+4, hf_fcdns_fc4type);
+ dissect_fc4type(req_tree, tvb, offset+4, &hfi_fcdns_fc4type);
}
else {
tot_len = tvb_reported_length_remaining (tvb, offset); /* excluding CT header */
@@ -574,7 +776,7 @@ dissect_fcdns_gfdid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
/* The count of the descriptors is not returned and so we have
* to track the display by the length field */
desclen = tvb_get_guint8 (tvb, offset);
- proto_tree_add_item (req_tree, hf_fcdns_rply_fc4desc, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_rply_fc4desc, tvb,
offset, desclen, ENC_NA);
tot_len -= 255; /* descriptors are aligned to 255 bytes */
offset += 256;
@@ -605,12 +807,12 @@ dissect_fcdns_gidpn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) {
if (isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_pname, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_pname, tvb,
offset, 8,
tvb_fcwwn_to_str (tvb, offset));
}
else {
- proto_tree_add_string (req_tree, hf_fcdns_rply_portid, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid, tvb,
offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
}
@@ -624,12 +826,12 @@ dissect_fcdns_gipppn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) {
if (isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_pname, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_pname, tvb,
offset, 8,
tvb_fcwwn_to_str (tvb, offset));
}
else {
- proto_tree_add_item (req_tree, hf_fcdns_rply_ipport, tvb, offset,
+ proto_tree_add_item (req_tree, &hfi_fcdns_rply_ipport, tvb, offset,
16, ENC_NA);
}
}
@@ -643,14 +845,14 @@ dissect_fcdns_gidnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) {
if (isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_nname, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_nname, tvb,
offset, 8,
tvb_fcwwn_to_str (tvb, offset));
}
else {
do {
islast = tvb_get_guint8 (tvb, offset);
- proto_tree_add_string (req_tree, hf_fcdns_rply_portid,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
offset += 4;
@@ -666,12 +868,12 @@ dissect_fcdns_gipnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) {
if (isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_nname, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_nname, tvb,
offset, 8,
tvb_fcwwn_to_str (tvb, offset));
}
else {
- proto_tree_add_item (req_tree, hf_fcdns_rply_ipnode, tvb, offset,
+ proto_tree_add_item (req_tree, &hfi_fcdns_rply_ipnode, tvb, offset,
16, ENC_NA);
}
}
@@ -685,17 +887,17 @@ dissect_fcdns_gpnnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) {
if (isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_nname, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_nname, tvb,
offset, 8,
tvb_fcwwn_to_str (tvb, offset));
}
else {
do {
islast = tvb_get_guint8 (tvb, offset);
- proto_tree_add_string (req_tree, hf_fcdns_rply_portid,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
- proto_tree_add_string (req_tree, hf_fcdns_rply_pname,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_pname,
tvb, offset+8, 8,
tvb_fcwwn_to_str (tvb, offset+8));
offset += 16;
@@ -712,15 +914,15 @@ dissect_fcdns_gsnnnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) {
if (isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_nname, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_nname, tvb,
offset, 8,
tvb_fcwwn_to_str (tvb, offset));
}
else {
len = tvb_get_guint8 (tvb, offset);
- proto_tree_add_item (req_tree, hf_fcdns_rply_snamelen, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_rply_snamelen, tvb,
offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item (req_tree, hf_fcdns_rply_sname, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_rply_sname, tvb,
offset+1, len, ENC_ASCII|ENC_NA);
}
}
@@ -734,17 +936,17 @@ dissect_fcdns_gidft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) {
if (isreq) {
- proto_tree_add_item (req_tree, hf_fcdns_req_domainscope,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_domainscope,
tvb, offset+1, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item (req_tree, hf_fcdns_req_areascope,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_areascope,
tvb, offset+2, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item (req_tree, hf_fcdns_req_fc4type,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_fc4type,
tvb, offset+3, 1, ENC_BIG_ENDIAN);
}
else {
do {
islast = tvb_get_guint8 (tvb, offset);
- proto_tree_add_string (req_tree, hf_fcdns_rply_portid,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
offset += 4;
@@ -761,20 +963,20 @@ dissect_fcdns_gpnft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) {
if (isreq) {
- proto_tree_add_item (req_tree, hf_fcdns_req_domainscope,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_domainscope,
tvb, offset+1, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item (req_tree, hf_fcdns_req_areascope,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_areascope,
tvb, offset+2, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item (req_tree, hf_fcdns_req_fc4type,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_fc4type,
tvb, offset+3, 1, ENC_BIG_ENDIAN);
}
else {
do {
islast = tvb_get_guint8 (tvb, offset);
- proto_tree_add_string (req_tree, hf_fcdns_rply_portid,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
- proto_tree_add_string (req_tree, hf_fcdns_rply_pname,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_pname,
tvb, offset+4, 8,
tvb_fcwwn_to_str (tvb, offset+8));
offset += 16;
@@ -791,20 +993,20 @@ dissect_fcdns_gnnft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) {
if (isreq) {
- proto_tree_add_item (req_tree, hf_fcdns_req_domainscope,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_domainscope,
tvb, offset+1, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item (req_tree, hf_fcdns_req_areascope,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_areascope,
tvb, offset+2, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item (req_tree, hf_fcdns_req_fc4type,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_fc4type,
tvb, offset+3, 1, ENC_BIG_ENDIAN);
}
else {
do {
islast = tvb_get_guint8 (tvb, offset);
- proto_tree_add_string (req_tree, hf_fcdns_rply_portid,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
- proto_tree_add_string (req_tree, hf_fcdns_rply_nname,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_nname,
tvb, offset+4, 8,
tvb_fcwwn_to_str (tvb, offset+8));
offset += 16;
@@ -821,17 +1023,17 @@ dissect_fcdns_gidpt (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) {
if (isreq) {
- proto_tree_add_item (req_tree, hf_fcdns_req_ptype,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_ptype,
tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item (req_tree, hf_fcdns_req_domainscope,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_domainscope,
tvb, offset+1, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item (req_tree, hf_fcdns_req_areascope,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_areascope,
tvb, offset+2, 1, ENC_BIG_ENDIAN);
}
else {
do {
islast = tvb_get_guint8 (tvb, offset);
- proto_tree_add_string (req_tree, hf_fcdns_rply_portid,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
offset += 4;
@@ -848,13 +1050,13 @@ dissect_fcdns_gidipp (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) {
if (isreq) {
- proto_tree_add_item (req_tree, hf_fcdns_req_ip, tvb, offset,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_ip, tvb, offset,
16, ENC_NA);
}
else {
do {
islast = tvb_get_guint8 (tvb, offset);
- proto_tree_add_string (req_tree, hf_fcdns_rply_portid,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
offset += 4;
@@ -871,16 +1073,16 @@ dissect_fcdns_gidff (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) {
if (isreq) {
- proto_tree_add_item (req_tree, hf_fcdns_req_domainscope, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_domainscope, tvb,
offset+1, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item (req_tree, hf_fcdns_req_areascope, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_areascope, tvb,
offset+2, 1, ENC_BIG_ENDIAN);
dissect_fc4features_and_type(req_tree, tvb, offset+6);
}
else {
do {
islast = tvb_get_guint8 (tvb, offset);
- proto_tree_add_string (req_tree, hf_fcdns_rply_portid,
+ proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
offset += 4;
@@ -896,10 +1098,10 @@ dissect_fcdns_rpnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) {
if (isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_portid,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
- proto_tree_add_string (req_tree, hf_fcdns_req_pname, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_pname, tvb,
offset+4, 8,
tvb_fcwwn_to_str (tvb, offset+4));
}
@@ -913,10 +1115,10 @@ dissect_fcdns_rnnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) {
if (isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_portid,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
- proto_tree_add_string (req_tree, hf_fcdns_req_nname, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_nname, tvb,
offset+4, 8,
tvb_fcwwn_to_str (tvb, offset+4));
}
@@ -929,10 +1131,10 @@ dissect_fcdns_rcsid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
int offset = 16; /* past the fc_ct header */
if (req_tree && isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
- dissect_cos_flags(req_tree, tvb, offset+4, hf_fcdns_req_cos);
+ dissect_cos_flags(req_tree, tvb, offset+4, &hfi_fcdns_req_cos);
}
}
@@ -942,10 +1144,10 @@ dissect_fcdns_rptid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
int offset = 16; /* past the fc_ct header */
if (req_tree && isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
- proto_tree_add_item (req_tree, hf_fcdns_req_ptype, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_ptype, tvb,
offset+4, 1, ENC_BIG_ENDIAN);
}
}
@@ -956,10 +1158,10 @@ dissect_fcdns_rftid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
int offset = 16; /* past the fc_ct header */
if (req_tree && isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
- dissect_fc4type(req_tree, tvb, offset+4, hf_fcdns_req_fc4types);
+ dissect_fc4type(req_tree, tvb, offset+4, &hfi_fcdns_req_fc4types);
}
}
@@ -970,14 +1172,14 @@ dissect_fcdns_rspnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
guint8 len;
if (req_tree && isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
- proto_tree_add_item (req_tree, hf_fcdns_req_spnamelen, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_spnamelen, tvb,
offset+4, 1, ENC_BIG_ENDIAN);
len = tvb_get_guint8 (tvb, offset+4);
- proto_tree_add_item (req_tree, hf_fcdns_req_spname, tvb, offset+5,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_spname, tvb, offset+5,
len, ENC_ASCII|ENC_NA);
}
}
@@ -988,10 +1190,10 @@ dissect_fcdns_rippid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
int offset = 16; /* past the fc_ct header */
if (req_tree && isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
- proto_tree_add_item (req_tree, hf_fcdns_req_ip, tvb,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_ip, tvb,
offset+4, 16, ENC_NA);
}
}
@@ -1003,18 +1205,18 @@ dissect_fcdns_rfdid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
int len;
if (req_tree && isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
- dissect_fc4type(req_tree, tvb, offset+4, hf_fcdns_req_fc4types);
+ dissect_fc4type(req_tree, tvb, offset+4, &hfi_fcdns_req_fc4types);
offset += 36;
len = tvb_reported_length_remaining (tvb, offset);
while (len > 0) {
- proto_tree_add_item (req_tree, hf_fcdns_req_fdesclen, tvb, offset,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_fdesclen, tvb, offset,
1, ENC_BIG_ENDIAN);
- proto_tree_add_item (req_tree, hf_fcdns_req_fdesc, tvb, offset+1,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_fdesc, tvb, offset+1,
len, ENC_ASCII|ENC_NA);
offset += 256;
len -= 256;
@@ -1028,7 +1230,7 @@ dissect_fcdns_rffid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
int offset = 16; /* past the fc_ct header */
if (req_tree && isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb, offset+1, 3,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
dissect_fc4features_and_type(req_tree, tvb, offset+6);
}
@@ -1040,9 +1242,9 @@ dissect_fcdns_ripnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
int offset = 16; /* past the fc_ct header */
if (req_tree && isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_nname, tvb, offset, 8,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_nname, tvb, offset, 8,
tvb_fcwwn_to_str (tvb, offset));
- proto_tree_add_item (req_tree, hf_fcdns_req_ip, tvb, offset+8, 16, ENC_NA);
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_ip, tvb, offset+8, 16, ENC_NA);
}
}
@@ -1053,13 +1255,13 @@ dissect_fcdns_rsnnnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
guint8 len;
if (req_tree && isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_nname, tvb, offset, 8,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_nname, tvb, offset, 8,
tvb_fcwwn_to_str (tvb, offset));
len = tvb_get_guint8 (tvb, offset+8);
- proto_tree_add_item (req_tree, hf_fcdns_req_snamelen, tvb, offset+8,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_snamelen, tvb, offset+8,
1, ENC_BIG_ENDIAN);
- proto_tree_add_item (req_tree, hf_fcdns_req_sname, tvb, offset+9,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_sname, tvb, offset+9,
len, ENC_ASCII|ENC_NA);
}
}
@@ -1070,7 +1272,7 @@ dissect_fcdns_daid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
int offset = 16; /* past the fc_ct header */
if (req_tree && isreq) {
- proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb, offset+1, 3,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
}
}
@@ -1091,7 +1293,7 @@ dissect_fcdns_zone_mbr (tvbuff_t *tvb, proto_tree *zmbr_tree, int offset)
char *str;
mbrtype = tvb_get_guint8 (tvb, offset);
- proto_tree_add_uint (zmbr_tree, hf_fcdns_zone_mbrtype, tvb,
+ proto_tree_add_uint (zmbr_tree, &hfi_fcdns_zone_mbrtype, tvb,
offset, 1, mbrtype);
proto_tree_add_text (zmbr_tree, tvb, offset+2, 1, "Flags: 0x%x",
tvb_get_guint8 (tvb, offset+2));
@@ -1100,27 +1302,27 @@ dissect_fcdns_zone_mbr (tvbuff_t *tvb, proto_tree *zmbr_tree, int offset)
"Identifier Length: %d", idlen);
switch (mbrtype) {
case FC_SWILS_ZONEMBR_WWN:
- proto_tree_add_string (zmbr_tree, hf_fcdns_zone_mbrid, tvb,
+ proto_tree_add_string (zmbr_tree, &hfi_fcdns_zone_mbrid, tvb,
offset+4, 8,
tvb_fcwwn_to_str (tvb, offset+4));
break;
case FC_SWILS_ZONEMBR_DP:
g_snprintf(dpbuf, sizeof(dpbuf), "0x%08x", tvb_get_ntohl (tvb, offset+4));
- proto_tree_add_string (zmbr_tree, hf_fcdns_zone_mbrid, tvb,
+ proto_tree_add_string (zmbr_tree, &hfi_fcdns_zone_mbrid, tvb,
offset+4, 4, dpbuf);
break;
case FC_SWILS_ZONEMBR_FCID:
- proto_tree_add_string (zmbr_tree, hf_fcdns_zone_mbrid, tvb,
+ proto_tree_add_string (zmbr_tree, &hfi_fcdns_zone_mbrid, tvb,
offset+4, 4,
tvb_fc_to_str (tvb, offset+5));
break;
case FC_SWILS_ZONEMBR_ALIAS:
str = zonenm_to_str (tvb, offset+4);
- proto_tree_add_string (zmbr_tree, hf_fcdns_zone_mbrid, tvb,
+ proto_tree_add_string (zmbr_tree, &hfi_fcdns_zone_mbrid, tvb,
offset+4, idlen, str);
break;
default:
- proto_tree_add_string (zmbr_tree, hf_fcdns_zone_mbrid, tvb,
+ proto_tree_add_string (zmbr_tree, &hfi_fcdns_zone_mbrid, tvb,
offset+4, idlen,
"Unknown member type format");
@@ -1143,63 +1345,63 @@ dissect_fcdns_swils_entries (tvbuff_t *tvb, proto_tree *tree, int offset)
for (i = 0; i < numrec; i++) {
objfmt = tvb_get_guint8 (tvb, offset);
- proto_tree_add_item (tree, hf_fcdns_sw2_objfmt, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_string (tree, hf_fcdns_rply_ownerid, tvb, offset+1,
+ proto_tree_add_item (tree, &hfi_fcdns_sw2_objfmt, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_string (tree, &hfi_fcdns_rply_ownerid, tvb, offset+1,
3, fc_to_str (tvb_get_ephemeral_string (tvb, offset+1,
3)));
- proto_tree_add_item (tree, hf_fcdns_rply_ptype, tvb, offset+4,
+ proto_tree_add_item (tree, &hfi_fcdns_rply_ptype, tvb, offset+4,
1, ENC_BIG_ENDIAN);
- proto_tree_add_string (tree, hf_fcdns_rply_portid, tvb, offset+5, 3,
+ proto_tree_add_string (tree, &hfi_fcdns_rply_portid, tvb, offset+5, 3,
tvb_fc_to_str (tvb, offset+5));
- proto_tree_add_string (tree, hf_fcdns_rply_pname, tvb, offset+8, 8,
+ proto_tree_add_string (tree, &hfi_fcdns_rply_pname, tvb, offset+8, 8,
tvb_fcwwn_to_str (tvb, offset+8));
offset += 16;
if (!(objfmt & 0x1)) {
len = tvb_get_guint8 (tvb, offset);
- proto_tree_add_item (tree, hf_fcdns_rply_spnamelen, tvb,
+ proto_tree_add_item (tree, &hfi_fcdns_rply_spnamelen, tvb,
offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item (tree, hf_fcdns_rply_spname, tvb,
+ proto_tree_add_item (tree, &hfi_fcdns_rply_spname, tvb,
offset+1, len, ENC_ASCII|ENC_NA);
offset += 256;
}
- proto_tree_add_string (tree, hf_fcdns_rply_nname, tvb, offset, 8,
+ proto_tree_add_string (tree, &hfi_fcdns_rply_nname, tvb, offset, 8,
tvb_fcwwn_to_str (tvb, offset));
offset += 8;
if (!(objfmt & 0x1)) {
len = tvb_get_guint8 (tvb, offset);
- proto_tree_add_item (tree, hf_fcdns_rply_snamelen, tvb,
+ proto_tree_add_item (tree, &hfi_fcdns_rply_snamelen, tvb,
offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item (tree, hf_fcdns_rply_sname, tvb,
+ proto_tree_add_item (tree, &hfi_fcdns_rply_sname, tvb,
offset+1, len, ENC_ASCII|ENC_NA);
offset += 256;
}
- proto_tree_add_item (tree, hf_fcdns_rply_ipa, tvb, offset, 8, ENC_NA);
- proto_tree_add_item (tree, hf_fcdns_rply_ipnode, tvb, offset+8, 16,
+ proto_tree_add_item (tree, &hfi_fcdns_rply_ipa, tvb, offset, 8, ENC_NA);
+ proto_tree_add_item (tree, &hfi_fcdns_rply_ipnode, tvb, offset+8, 16,
ENC_NA);
- dissect_cos_flags(tree, tvb, offset+24, hf_fcdns_reply_cos);
- dissect_fc4type(tree, tvb, offset+28, hf_fcdns_rply_gft);
- proto_tree_add_item (tree, hf_fcdns_rply_ipport, tvb, offset+60,
+ dissect_cos_flags(tree, tvb, offset+24, &hfi_fcdns_reply_cos);
+ dissect_fc4type(tree, tvb, offset+28, &hfi_fcdns_rply_gft);
+ proto_tree_add_item (tree, &hfi_fcdns_rply_ipport, tvb, offset+60,
16, ENC_NA);
- proto_tree_add_string (tree, hf_fcdns_rply_fpname, tvb, offset+76,
+ proto_tree_add_string (tree, &hfi_fcdns_rply_fpname, tvb, offset+76,
8, tvb_fcwwn_to_str (tvb, offset+76));
- proto_tree_add_string (tree, hf_fcdns_rply_hrdaddr, tvb, offset+85,
+ proto_tree_add_string (tree, &hfi_fcdns_rply_hrdaddr, tvb, offset+85,
3, tvb_fc_to_str (tvb, offset+85));
offset += 88;
if (objfmt & 0x2) {
dissect_fc4features(tree, tvb, offset);
if (tvb_get_guint8 (tvb, offset+129)) {
- proto_tree_add_item (tree, hf_fcdns_rply_fc4type, tvb,
+ proto_tree_add_item (tree, &hfi_fcdns_rply_fc4type, tvb,
offset+128, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item (tree, hf_fcdns_num_fc4desc, tvb,
+ proto_tree_add_item (tree, &hfi_fcdns_num_fc4desc, tvb,
offset+129, 1, ENC_BIG_ENDIAN);
len = tvb_get_guint8 (tvb, offset+132);
- proto_tree_add_item (tree, hf_fcdns_rply_fc4desclen, tvb,
+ proto_tree_add_item (tree, &hfi_fcdns_rply_fc4desclen, tvb,
offset+132, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item (tree, hf_fcdns_rply_fc4desc, tvb,
+ proto_tree_add_item (tree, &hfi_fcdns_rply_fc4desc, tvb,
offset+133, len, ENC_NA);
}
else {
- proto_tree_add_item (tree, hf_fcdns_num_fc4desc, tvb,
+ proto_tree_add_item (tree, &hfi_fcdns_num_fc4desc, tvb,
offset+129, 1, ENC_BIG_ENDIAN);
}
offset += 388; /* FC4 desc is 260 bytes, maybe padded */
@@ -1215,7 +1417,7 @@ dissect_fcdns_geid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (isreq) {
if (req_tree) {
- proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb, offset+1,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, offset+1,
3, tvb_fc_to_str (tvb, offset+1));
}
}
@@ -1230,7 +1432,7 @@ dissect_fcdns_gepn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
int offset = 16; /* past the fc_ct header */
if (isreq) {
if (req_tree) {
- proto_tree_add_string (req_tree, hf_fcdns_req_pname, tvb, offset, 8,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_pname, tvb, offset, 8,
tvb_fcwwn_to_str (tvb, offset));
}
}
@@ -1246,7 +1448,7 @@ dissect_fcdns_genn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (isreq) {
if (req_tree) {
- proto_tree_add_string (req_tree, hf_fcdns_req_nname, tvb, offset, 8,
+ proto_tree_add_string (req_tree, &hfi_fcdns_req_nname, tvb, offset, 8,
tvb_fcwwn_to_str (tvb, offset));
}
}
@@ -1262,7 +1464,7 @@ dissect_fcdns_geip (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (isreq) {
if (req_tree) {
- proto_tree_add_item (req_tree, hf_fcdns_req_ip, tvb, offset, 16, ENC_NA);
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_ip, tvb, offset, 16, ENC_NA);
}
}
else {
@@ -1277,7 +1479,7 @@ dissect_fcdns_geft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (isreq) {
if (req_tree) {
- dissect_fc4type(req_tree, tvb, offset, hf_fcdns_fc4type);
+ dissect_fc4type(req_tree, tvb, offset, &hfi_fcdns_fc4type);
}
}
else {
@@ -1292,7 +1494,7 @@ dissect_fcdns_gept (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (isreq) {
if (req_tree) {
- proto_tree_add_item (req_tree, hf_fcdns_req_ptype, tvb, offset+3,
+ proto_tree_add_item (req_tree, &hfi_fcdns_req_ptype, tvb, offset+3,
1, ENC_BIG_ENDIAN);
}
}
@@ -1327,7 +1529,7 @@ dissect_fcdns_gezn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
str_len = tvb_get_guint8 (tvb, offset);
proto_tree_add_text (req_tree, tvb, offset, 1, "Name Length: %d",
str_len);
- proto_tree_add_item (req_tree, hf_fcdns_zonenm, tvb, offset+3,
+ proto_tree_add_item (req_tree, &hfi_fcdns_zonenm, tvb, offset+3,
str_len, ENC_ASCII|ENC_NA);
}
}
@@ -1343,7 +1545,7 @@ dissect_fcdns_geipp (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (isreq) {
if (req_tree) {
- proto_tree_add_item (req_tree, hf_fcdns_portip, tvb, offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item (req_tree, &hfi_fcdns_portip, tvb, offset, 4, ENC_BIG_ENDIAN);
}
}
else {
@@ -1372,10 +1574,10 @@ dissect_fcdns_rjt (tvbuff_t *tvb, proto_tree *req_tree)
int offset = 0;
if (req_tree) {
- proto_tree_add_item (req_tree, hf_fcdns_reason, tvb, offset+13, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item (req_tree, hf_fcdns_rjtdetail, tvb, offset+14, 1,
+ proto_tree_add_item (req_tree, &hfi_fcdns_reason, tvb, offset+13, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item (req_tree, &hfi_fcdns_rjtdetail, tvb, offset+14, 1,
ENC_BIG_ENDIAN);
- proto_tree_add_item (req_tree, hf_fcdns_vendor, tvb, offset+15, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item (req_tree, &hfi_fcdns_vendor, tvb, offset+15, 1, ENC_BIG_ENDIAN);
}
}
@@ -1409,13 +1611,13 @@ dissect_fcdns (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
if (cthdr.gstype == FCCT_GSTYPE_DIRSVC) {
- ti = proto_tree_add_protocol_format (tree, proto_fcdns, tvb, 0,
+ ti = proto_tree_add_protocol_format (tree, hfi_fcdns->id, tvb, 0,
-1,
"dNS");
fcdns_tree = proto_item_add_subtree (ti, ett_fcdns);
}
else {
- ti = proto_tree_add_protocol_format (tree, proto_fcdns, tvb, 0,
+ ti = proto_tree_add_protocol_format (tree, hfi_fcdns->id, tvb, 0,
-1,
"Unzoned NS");
fcdns_tree = proto_item_add_subtree (ti, ett_fcdns);
@@ -1509,8 +1711,8 @@ dissect_fcdns (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- proto_tree_add_item (fcdns_tree, hf_fcdns_opcode, tvb, offset+8, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item (fcdns_tree, hf_fcdns_maxres_size, tvb, offset+10,
+ proto_tree_add_item (fcdns_tree, &hfi_fcdns_opcode, tvb, offset+8, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item (fcdns_tree, &hfi_fcdns_maxres_size, tvb, offset+10,
2, ENC_BIG_ENDIAN);
}
@@ -1661,201 +1863,71 @@ void
proto_register_fcdns (void)
{
- static hf_register_info hf[] = {
-#if 0
- { &hf_fcdns_gssubtype,
- {"GS_Subtype", "fcdns.gssubtype", FT_UINT8, BASE_HEX,
- VALS (fc_dns_subtype_val), 0x0, NULL, HFILL}},
-#endif
- {&hf_fcdns_opcode,
- {"Opcode", "fcdns.opcode", FT_UINT16, BASE_HEX, VALS (fc_dns_opcode_val),
- 0x0, NULL, HFILL}},
- { &hf_fcdns_req_portid,
- {"Port Identifier", "fcdns.req.portid", FT_STRING, BASE_NONE, NULL, 0x0,
- NULL, HFILL}},
- { &hf_fcdns_rply_pname,
- {"Port Name", "fcdns.rply.pname", FT_STRING, BASE_NONE, NULL, 0x0, NULL,
- HFILL}},
- { &hf_fcdns_rply_nname,
- {"Node Name", "fcdns.rply.nname", FT_STRING, BASE_NONE, NULL, 0x0, NULL,
- HFILL}},
- { &hf_fcdns_rply_snamelen,
- {"Symbolic Node Name Length", "fcdns.rply.snamelen", FT_UINT8, BASE_DEC,
- NULL, 0x0, NULL, HFILL}},
- { &hf_fcdns_rply_sname,
- {"Symbolic Node Name", "fcdns.rply.sname", FT_STRING, BASE_NONE, NULL,
- 0x0, NULL, HFILL}},
- { &hf_fcdns_rply_ptype,
- {"Port Type", "fcdns.rply.porttype", FT_UINT8, BASE_HEX,
- VALS (fc_dns_port_type_val), 0x0, NULL, HFILL}},
- { &hf_fcdns_rply_fpname,
- {"Fabric Port Name", "fcdns.rply.fpname", FT_STRING, BASE_NONE, NULL,
- 0x0, NULL, HFILL}},
- { &hf_fcdns_req_pname,
- {"Port Name", "fcdns.req.portname", FT_STRING, BASE_NONE, NULL, 0x0,
- NULL, HFILL}},
- { &hf_fcdns_rply_portid,
- {"Port Identifier", "fcdns.rply.portid", FT_STRING, BASE_NONE, NULL,
- 0x0, NULL, HFILL}},
- { &hf_fcdns_req_nname,
- {"Node Name", "fcdns.req.nname", FT_STRING, BASE_NONE, NULL, 0x0,
- NULL, HFILL}},
- { &hf_fcdns_req_domainscope,
- {"Domain ID Scope", "fcdns.req.domainid", FT_UINT8, BASE_HEX, NULL,
- 0x0, NULL, HFILL}},
- { &hf_fcdns_req_areascope,
- {"Area ID Scope", "fcdns.req.areaid", FT_UINT8, BASE_HEX, NULL,
- 0x0, NULL, HFILL}},
- { &hf_fcdns_req_fc4type,
- {"FC-4 Type", "fcdns.req.fc4type", FT_UINT8, BASE_HEX,
- VALS (fc_fc4_val), 0x0, NULL, HFILL}},
- { &hf_fcdns_req_ptype,
- {"Port Type", "fcdns.req.porttype", FT_UINT8, BASE_HEX,
- VALS (fc_dns_port_type_val), 0x0, NULL, HFILL}},
- { &hf_fcdns_req_ip,
- {"IP Address", "fcdns.req.ip", FT_IPv6, BASE_NONE, NULL, 0x0,
- NULL, HFILL}},
- { &hf_fcdns_rply_fc4type,
- {"FC-4 Descriptor Type", "fcdns.rply.fc4type", FT_UINT8, BASE_HEX,
- VALS (fc_fc4_val), 0x0, NULL, HFILL}},
- { &hf_fcdns_req_snamelen,
- {"Symbolic Name Length", "fcdns.req.snamelen", FT_UINT8, BASE_DEC,
- NULL, 0x0, NULL, HFILL}},
- { &hf_fcdns_req_sname,
- {"Symbolic Port Name", "fcdns.req.sname", FT_STRING, BASE_NONE, NULL,
- 0x0, NULL, HFILL}},
- { &hf_fcdns_rply_spnamelen,
- {"Symbolic Port Name Length", "fcdns.rply.spnamelen", FT_UINT8,
- BASE_DEC, NULL, 0x0, NULL, HFILL}},
- {&hf_fcdns_rply_spname,
- {"Symbolic Port Name", "fcdns.rply.spname", FT_STRING, BASE_NONE, NULL,
- 0x0, NULL, HFILL}},
- { &hf_fcdns_rply_ipa,
- {"Initial Process Associator", "fcdns.rply.ipa", FT_BYTES, BASE_NONE,
- NULL, 0x0, NULL, HFILL}},
- { &hf_fcdns_rply_ipnode,
- {"Node IP Address", "fcdns.rply.ipnode", FT_IPv6, BASE_NONE, NULL,
- 0x0, NULL, HFILL}},
- { &hf_fcdns_rply_ipport,
- {"Port IP Address", "fcdns.rply.ipport", FT_IPv6, BASE_NONE, NULL,
- 0x0, NULL, HFILL}},
- { &hf_fcdns_rply_fc4desclen,
- {"FC-4 Descriptor Length", "fcdns.rply.fc4desclen", FT_UINT8,
- BASE_DEC, NULL, 0x0, NULL, HFILL}},
- { &hf_fcdns_rply_fc4desc,
- {"FC-4 Descriptor", "fcdns.rply.fc4desc", FT_BYTES, BASE_NONE, NULL,
- 0x0, NULL, HFILL}},
- { &hf_fcdns_rply_hrdaddr,
- {"Hard Address", "fcdns.rply.hrdaddr", FT_STRING, BASE_NONE, NULL,
- 0x0, NULL, HFILL}},
- { &hf_fcdns_req_fdesclen,
- {"FC-4 Descriptor Length", "fcdns.req.fc4desclen", FT_UINT8, BASE_DEC,
- NULL, 0x0, NULL, HFILL}},
- { &hf_fcdns_req_fdesc,
- {"FC-4 Descriptor", "fcdns.req.fc4desc", FT_STRING, BASE_NONE, NULL,
- 0x0, NULL, HFILL}},
- { &hf_fcdns_req_spnamelen,
- {"Symbolic Port Name Length", "fcdns.req.spnamelen", FT_UINT8,
- BASE_DEC, NULL, 0x0, NULL, HFILL}},
- { &hf_fcdns_req_spname,
- {"Symbolic Port Name", "fcdns.req.spname", FT_STRING, BASE_NONE, NULL,
- 0x0, NULL, HFILL}},
- { &hf_fcdns_reason,
- {"Reason Code", "fcdns.rply.reason", FT_UINT8, BASE_HEX,
- VALS (fc_ct_rjt_code_vals), 0x0, NULL, HFILL}},
- { &hf_fcdns_rjtdetail,
- {"Reason Code Explanantion", "fcdns.rply.reasondet", FT_UINT8,
- BASE_HEX, VALS (fc_dns_rjt_det_code_val), 0x0, NULL, HFILL}},
- { &hf_fcdns_vendor,
- {"Vendor Unique Reject Code", "fcdns.rply.vendor", FT_UINT8,
- BASE_HEX, NULL, 0x0, NULL, HFILL}},
- { &hf_fcdns_zone_mbrtype,
- {"Zone Member Type", "fcdns.zone.mbrtype", FT_UINT8, BASE_HEX,
- VALS (fc_swils_zonembr_type_val), 0x0, NULL, HFILL}},
- { &hf_fcdns_zone_mbrid,
- {"Member Identifier", "fcdns.zone.mbrid", FT_STRING, BASE_NONE, NULL,
- 0x0, NULL, HFILL}},
- { &hf_fcdns_zonenm,
- {"Zone Name", "fcdns.zonename", FT_STRING, BASE_NONE, NULL, 0x0, NULL,
- HFILL}},
- { &hf_fcdns_portip,
- {"Port IP Address", "fcdns.portip", FT_IPv4, BASE_NONE, NULL, 0x0,
- NULL, HFILL}},
- { &hf_fcdns_sw2_objfmt,
- {"Name Entry Object Format", "fcdns.entry.objfmt", FT_UINT8, BASE_HEX,
- NULL, 0x0, NULL, HFILL}},
- { &hf_fcdns_num_fc4desc,
- {"Number of FC4 Descriptors Registered", "fcdns.entry.numfc4desc",
- FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
- { &hf_fcdns_rply_ownerid,
- {"Owner Id", "fcdns.rply.ownerid", FT_STRING, BASE_NONE, NULL, 0x0, NULL,
- HFILL}},
- { &hf_fcdns_maxres_size,
- {"Maximum/Residual Size", "fcdns.maxres_size", FT_UINT16, BASE_DEC,
- NULL, 0x0, NULL, HFILL}},
- { &hf_fcdns_reply_cos,
- {"Class of Service Supported", "fcdns.reply.cos", FT_UINT32, BASE_HEX,
- NULL, 0x0, NULL, HFILL}},
- { &hf_fcdns_req_cos,
- {"Requested Class of Service", "fcdns.req.class", FT_UINT32, BASE_HEX,
- NULL, 0x0, NULL, HFILL}},
- { &hf_fcdns_cos_f,
- {"F", "fcdns.cos.f", FT_BOOLEAN, 32,
- TFS(&tfs_set_notset), 0x01, NULL, HFILL}},
- { &hf_fcdns_cos_1,
- {"1", "fcdns.cos.1", FT_BOOLEAN, 32,
- TFS(&tfs_set_notset), 0x02, NULL, HFILL}},
- { &hf_fcdns_cos_2,
- {"2", "fcdns.cos.2", FT_BOOLEAN, 32,
- TFS(&tfs_set_notset), 0x04, NULL, HFILL}},
- { &hf_fcdns_cos_3,
- {"3", "fcdns.cos.3", FT_BOOLEAN, 32,
- TFS(&tfs_set_notset), 0x08, NULL, HFILL}},
- { &hf_fcdns_cos_4,
- {"4", "fcdns.cos.4", FT_BOOLEAN, 32,
- TFS(&tfs_set_notset), 0x10, NULL, HFILL}},
- { &hf_fcdns_cos_6,
- {"6", "fcdns.cos.6", FT_BOOLEAN, 32,
- TFS(&tfs_set_notset), 0x40, NULL, HFILL}},
- { &hf_fcdns_fc4type_llcsnap,
- {"LLC/SNAP", "fcdns.fc4types.llc_snap", FT_BOOLEAN, 32,
- TFS(&tfs_set_notset), 0x0010, NULL, HFILL}},
- { &hf_fcdns_fc4type_ip,
- {"IP", "fcdns.fc4types.ip", FT_BOOLEAN, 32,
- TFS(&tfs_set_notset), 0x0020, NULL, HFILL}},
- { &hf_fcdns_fc4type_fcp,
- {"FCP", "fcdns.fc4types.fcp", FT_BOOLEAN, 32,
- TFS(&tfs_set_notset), 0x0100, NULL, HFILL}},
- { &hf_fcdns_fc4type_swils,
- {"SW_ILS", "fcdns.fc4types.swils", FT_BOOLEAN, 32,
- TFS(&tfs_set_notset), 0x0010, NULL, HFILL}},
- { &hf_fcdns_fc4type_snmp,
- {"SNMP", "fcdns.fc4types.snmp", FT_BOOLEAN, 32,
- TFS(&tfs_set_notset), 0x0004, NULL, HFILL}},
- { &hf_fcdns_fc4type_gs3,
- {"GS3", "fcdns.fc4types.gs3", FT_BOOLEAN, 32,
- TFS(&tfs_set_notset), 0x0001, NULL, HFILL}},
- { &hf_fcdns_fc4type_vi,
- {"VI", "fcdns.fc4types.vi", FT_BOOLEAN, 32,
- TFS(&tfs_set_notset), 0x0001, NULL, HFILL}},
- { &hf_fcdns_rply_gft,
- {"FC-4 Types Supported", "fcdns.rply.fc4type", FT_NONE, BASE_NONE,
- NULL, 0x0, NULL, HFILL}},
- { &hf_fcdns_req_fc4types,
- {"FC-4 Types Supported", "fcdns.req.fc4types", FT_NONE, BASE_NONE,
- NULL, 0x0, NULL, HFILL}},
- { &hf_fcdns_fc4type,
- {"FC-4 Types", "fcdns.req.fc4type", FT_NONE, BASE_NONE,
- NULL, 0x0, NULL, HFILL}},
- { &hf_fcdns_fc4features,
- {"FC-4 Feature Bits", "fcdns.fc4features", FT_UINT8,
- BASE_HEX, NULL, 0x0, NULL, HFILL}},
- { &hf_fcdns_fc4features_i,
- {"I", "fcdns.fc4features.i", FT_BOOLEAN, 8,
- TFS(&tfs_set_notset), 0x02, NULL, HFILL}},
- { &hf_fcdns_fc4features_t,
- {"T", "fcdns.fc4features.t", FT_BOOLEAN, 8,
- TFS(&tfs_set_notset), 0x01, NULL, HFILL}},
+ static header_field_info *hfi[] = {
+ /* &hfi_fcdns_gssubtype */
+ &hfi_fcdns_opcode,
+ &hfi_fcdns_req_portid,
+ &hfi_fcdns_rply_pname,
+ &hfi_fcdns_rply_nname,
+ &hfi_fcdns_rply_snamelen,
+ &hfi_fcdns_rply_sname,
+ &hfi_fcdns_rply_ptype,
+ &hfi_fcdns_rply_fpname,
+ &hfi_fcdns_req_pname,
+ &hfi_fcdns_rply_portid,
+ &hfi_fcdns_req_nname,
+ &hfi_fcdns_req_domainscope,
+ &hfi_fcdns_req_areascope,
+ &hfi_fcdns_req_fc4type,
+ &hfi_fcdns_req_ptype,
+ &hfi_fcdns_req_ip,
+ &hfi_fcdns_rply_fc4type,
+ &hfi_fcdns_req_snamelen,
+ &hfi_fcdns_req_sname,
+ &hfi_fcdns_rply_spnamelen,
+ &hfi_fcdns_rply_spname,
+ &hfi_fcdns_rply_ipa,
+ &hfi_fcdns_rply_ipnode,
+ &hfi_fcdns_rply_ipport,
+ &hfi_fcdns_rply_fc4desclen,
+ &hfi_fcdns_rply_fc4desc,
+ &hfi_fcdns_rply_hrdaddr,
+ &hfi_fcdns_req_fdesclen,
+ &hfi_fcdns_req_fdesc,
+ &hfi_fcdns_req_spnamelen,
+ &hfi_fcdns_req_spname,
+ &hfi_fcdns_reason,
+ &hfi_fcdns_rjtdetail,
+ &hfi_fcdns_vendor,
+ &hfi_fcdns_zone_mbrtype,
+ &hfi_fcdns_zone_mbrid,
+ &hfi_fcdns_zonenm,
+ &hfi_fcdns_portip,
+ &hfi_fcdns_sw2_objfmt,
+ &hfi_fcdns_num_fc4desc,
+ &hfi_fcdns_rply_ownerid,
+ &hfi_fcdns_maxres_size,
+ &hfi_fcdns_reply_cos,
+ &hfi_fcdns_req_cos,
+ &hfi_fcdns_cos_f,
+ &hfi_fcdns_cos_1,
+ &hfi_fcdns_cos_2,
+ &hfi_fcdns_cos_3,
+ &hfi_fcdns_cos_4,
+ &hfi_fcdns_cos_6,
+ &hfi_fcdns_fc4type_llcsnap,
+ &hfi_fcdns_fc4type_ip,
+ &hfi_fcdns_fc4type_fcp,
+ &hfi_fcdns_fc4type_swils,
+ &hfi_fcdns_fc4type_snmp,
+ &hfi_fcdns_fc4type_gs3,
+ &hfi_fcdns_fc4type_vi,
+ &hfi_fcdns_rply_gft,
+ &hfi_fcdns_req_fc4types,
+ &hfi_fcdns_fc4type,
+ &hfi_fcdns_fc4features,
+ &hfi_fcdns_fc4features_i,
+ &hfi_fcdns_fc4features_t,
};
static gint *ett[] = {
@@ -1865,22 +1937,24 @@ proto_register_fcdns (void)
&ett_fc4features,
};
+ int proto_fcdns;
+
proto_fcdns = proto_register_protocol("Fibre Channel Name Server",
"FC-dNS", "fcdns");
+ hfi_fcdns = proto_registrar_get_nth(proto_fcdns);
- proto_register_field_array(proto_fcdns, hf, array_length(hf));
+ proto_register_fields(proto_fcdns, hfi, array_length(hfi));
proto_register_subtree_array(ett, array_length(ett));
register_init_routine (&fcdns_init_protocol);
+
+ dns_handle = create_dissector_handle (dissect_fcdns, proto_fcdns);
}
void
proto_reg_handoff_fcdns (void)
{
- dissector_handle_t dns_handle;
-
- dns_handle = create_dissector_handle (dissect_fcdns, proto_fcdns);
dissector_add_uint("fcct.server", FCCT_GSRVR_DNS, dns_handle);
dissector_add_uint("fcct.server", FCCT_GSRVR_UNS, dns_handle);
- data_handle = find_dissector ("data");
+ data_handle = find_dissector("data");
}
diff --git a/epan/dissectors/packet-hpext.c b/epan/dissectors/packet-hpext.c
index 40ee047806..d946a661c8 100644
--- a/epan/dissectors/packet-hpext.c
+++ b/epan/dissectors/packet-hpext.c
@@ -23,6 +23,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#define NEW_PROTO_TREE_API
+
#include "config.h"
#include <glib.h>
@@ -32,16 +34,9 @@
#include <epan/llcsaps.h>
#include "packet-hpext.h"
-static dissector_table_t subdissector_table;
-
-static dissector_handle_t data_handle;
+static dissector_handle_t hpext_handle;
-static int proto_hpext = -1;
-
-static int hf_hpext_dxsap = -1;
-static int hf_hpext_sxsap = -1;
-
-static gint ett_hpext = -1;
+static dissector_table_t subdissector_table;
static const value_string xsap_vals[] = {
{ HPEXT_DXSAP, "RBOOT Destination Service Access Point" },
@@ -51,6 +46,24 @@ static const value_string xsap_vals[] = {
{ 0x00, NULL }
};
+
+static header_field_info *hfi_hpext = NULL;
+
+#define HPEXT_HFI_INIT HFI_INIT(proto_hpext)
+
+static header_field_info hfi_hpext_dxsap HPEXT_HFI_INIT =
+ { "DXSAP", "hpext.dxsap", FT_UINT16, BASE_HEX,
+ VALS(xsap_vals), 0x0, NULL, HFILL };
+
+static header_field_info hfi_hpext_sxsap HPEXT_HFI_INIT =
+ { "SXSAP", "hpext.sxsap", FT_UINT16, BASE_HEX,
+ VALS(xsap_vals), 0x0, NULL, HFILL };
+
+
+static gint ett_hpext = -1;
+
+static dissector_handle_t data_handle;
+
static void
dissect_hpext(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
@@ -65,12 +78,12 @@ dissect_hpext(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
sxsap = tvb_get_ntohs(tvb, 5);
if (tree) {
- ti = proto_tree_add_item(tree, proto_hpext, tvb, 0, 7, ENC_NA);
+ ti = proto_tree_add_item(tree, hfi_hpext, tvb, 0, 7, ENC_NA);
hpext_tree = proto_item_add_subtree(ti, ett_hpext);
proto_tree_add_text(hpext_tree, tvb, 0, 3, "Reserved");
- proto_tree_add_uint(hpext_tree, hf_hpext_dxsap, tvb, 3,
+ proto_tree_add_uint(hpext_tree, &hfi_hpext_dxsap, tvb, 3,
2, dxsap);
- proto_tree_add_uint(hpext_tree, hf_hpext_sxsap, tvb, 5,
+ proto_tree_add_uint(hpext_tree, &hfi_hpext_sxsap, tvb, 5,
2, sxsap);
}
@@ -91,38 +104,35 @@ dissect_hpext(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
void
proto_register_hpext(void)
{
- static hf_register_info hf[] = {
- { &hf_hpext_dxsap,
- { "DXSAP", "hpext.dxsap", FT_UINT16, BASE_HEX,
- VALS(xsap_vals), 0x0, NULL, HFILL }},
-
- { &hf_hpext_sxsap,
- { "SXSAP", "hpext.sxsap", FT_UINT16, BASE_HEX,
- VALS(xsap_vals), 0x0, NULL, HFILL }}
+ static header_field_info *hfi[] = {
+ &hfi_hpext_dxsap,
+ &hfi_hpext_sxsap,
};
+
static gint *ett[] = {
&ett_hpext
};
+ int proto_hpext;
+
proto_hpext = proto_register_protocol(
"HP Extended Local-Link Control", "HPEXT", "hpext");
- proto_register_field_array(proto_hpext, hf, array_length(hf));
+ hfi_hpext = proto_registrar_get_nth(proto_hpext);
+
+ proto_register_fields(proto_hpext, hfi, array_length(hfi));
proto_register_subtree_array(ett, array_length(ett));
/* subdissector code */
subdissector_table = register_dissector_table("hpext.dxsap",
"HPEXT XSAP", FT_UINT16, BASE_HEX);
- register_dissector("hpext", dissect_hpext, proto_hpext);
+ hpext_handle = register_dissector("hpext", dissect_hpext, proto_hpext);
}
void
proto_reg_handoff_hpext(void)
{
- dissector_handle_t hpext_handle;
-
data_handle = find_dissector("data");
- hpext_handle = find_dissector("hpext");
dissector_add_uint("llc.dsap", SAP_HPEXT, hpext_handle);
}