aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rwall.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2013-10-18 21:11:11 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2013-10-18 21:11:11 +0000
commitd3a09e0514f5e380fbe012f43fae29f504124fd7 (patch)
tree801c73c67f6ab24c67962f05356cb676e4b9dbe0 /epan/dissectors/packet-rwall.c
parentf86132a09a23ae8e39cc9e94667be23ebdacebbe (diff)
- Remove hf_ integers from few more dissectors
- udp: remove proto_udp. svn path=/trunk/; revision=52678
Diffstat (limited to 'epan/dissectors/packet-rwall.c')
-rw-r--r--epan/dissectors/packet-rwall.c56
1 files changed, 31 insertions, 25 deletions
diff --git a/epan/dissectors/packet-rwall.c b/epan/dissectors/packet-rwall.c
index 0a3df1180b..d9496ae519 100644
--- a/epan/dissectors/packet-rwall.c
+++ b/epan/dissectors/packet-rwall.c
@@ -21,57 +21,63 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "config.h"
-
+#define NEW_PROTO_TREE_API
+#include "config.h"
#include "packet-rpc.h"
#include "packet-rwall.h"
-static int proto_rwall = -1;
-static int hf_rwall_procedure_v1 = -1;
-static int hf_rwall_message = -1;
+static header_field_info *hfi_rwall = NULL;
+
+#define RWALL_HFI_INIT HFI_INIT(proto_rwall)
+
+static const value_string rwall1_proc_vals[] = {
+ { RWALL_WALL, "RWALL" },
+ { 0, NULL }
+};
+
+static header_field_info hfi_rwall_procedure_v1 RWALL_HFI_INIT = {
+ "V1 Procedure", "rwall.procedure_v1", FT_UINT32, BASE_DEC,
+ VALS(rwall1_proc_vals), 0, NULL, HFILL };
+
+static header_field_info hfi_rwall_message RWALL_HFI_INIT = {
+ "Message", "rwall.message", FT_STRING, BASE_NONE,
+ NULL, 0, NULL, HFILL };
static gint ett_rwall = -1;
static int
dissect_rwall_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
{
- offset = dissect_rpc_string(tvb, tree, hf_rwall_message, offset, NULL);
+ offset = dissect_rpc_string(tvb, tree, hfi_rwall_message.id, offset, NULL);
return offset;
}
static const vsff rwall1_proc[] = {
- { RWALL_WALL, "RWALL",
- dissect_rwall_call, NULL },
+ { RWALL_WALL, "RWALL", dissect_rwall_call, NULL },
{ 0, NULL, NULL, NULL }
};
-static const value_string rwall1_proc_vals[] = {
- { RWALL_WALL, "RWALL" },
- { 0, NULL }
-};
-
void
proto_register_rwall(void)
{
- static hf_register_info hf[] = {
- { &hf_rwall_procedure_v1, {
- "V1 Procedure", "rwall.procedure_v1", FT_UINT32, BASE_DEC,
- VALS(rwall1_proc_vals), 0, NULL, HFILL }},
- { &hf_rwall_message, {
- "Message", "rwall.message", FT_STRING, BASE_NONE,
- NULL, 0, NULL, HFILL }}
+ static header_field_info *hfi[] = {
+ &hfi_rwall_procedure_v1,
+ &hfi_rwall_message,
};
static gint *ett[] = {
&ett_rwall,
};
- proto_rwall = proto_register_protocol("Remote Wall protocol",
- "RWALL", "rwall");
- proto_register_field_array(proto_rwall, hf, array_length(hf));
+ int proto_rwall;
+
+ proto_rwall = proto_register_protocol("Remote Wall protocol", "RWALL", "rwall");
+ hfi_rwall = proto_registrar_get_nth(proto_rwall);
+
+ proto_register_fields(proto_rwall, hfi, array_length(hfi));
proto_register_subtree_array(ett, array_length(ett));
}
@@ -79,9 +85,9 @@ void
proto_reg_handoff_rwall(void)
{
/* Register the protocol as RPC */
- rpc_init_prog(proto_rwall, RWALL_PROGRAM, ett_rwall);
+ rpc_init_prog(hfi_rwall->id, RWALL_PROGRAM, ett_rwall);
/* Register the procedure tables */
- rpc_init_proc_table(RWALL_PROGRAM, 1, rwall1_proc, hf_rwall_procedure_v1);
+ rpc_init_proc_table(RWALL_PROGRAM, 1, rwall1_proc, hfi_rwall_procedure_v1.id);
}