aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-02-14 15:10:10 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-02-14 15:10:10 +0100
commitfe5b49ece4d993c3e0dc776bc7d5d91b256cbfb7 (patch)
tree24529fa892a037181cb209a0de1f326edb96d4fa
parent6b199117ef65264d9d44b505d1f4c3861731199b (diff)
downloadwireshark-fe5b49ece4d993c3e0dc776bc7d5d91b256cbfb7.tar.gz
wireshark-fe5b49ece4d993c3e0dc776bc7d5d91b256cbfb7.tar.bz2
wireshark-fe5b49ece4d993c3e0dc776bc7d5d91b256cbfb7.zip
Registering data structures.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r--epan/dissectors/packet-samsung-ipc.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/epan/dissectors/packet-samsung-ipc.c b/epan/dissectors/packet-samsung-ipc.c
index d078510574..b3856cd848 100644
--- a/epan/dissectors/packet-samsung-ipc.c
+++ b/epan/dissectors/packet-samsung-ipc.c
@@ -36,7 +36,7 @@ static const value_string ipc_responses_types[] = {
{0x03, "IPC_TYPE_NOTI"},
};
-static const value_string ipc_groups[] = {
+static const value_string hf_samsung_ipc_groups[] = {
{0x01, "PWR"},
{0x02, "CALL"},
{0x04, "SMS"},
@@ -57,17 +57,25 @@ static const value_string ipc_groups[] = {
{0x42, "RFS"},
{0x80, "GEN"},
};
+
#endif
-static int proto_samsung_ipc = -1;
+static gint proto_samsung_ipc = -1;
+static gint hf_samsung_ipc = -1; // TODO: check variable name with isi
+static gint ett_samsung_ipc = -1;
static int dissect_samsung_ipc(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree _U_, void *data _U_)
{
+// proto_tree *samsung_ipc_tree;
+
col_set_str(pinfo->cinfo, COL_PROTOCOL, "samsung-ipc");
col_clear(pinfo->cinfo, COL_INFO);
proto_tree_add_item(tree, proto_samsung_ipc, tvb, 0, -1, ENC_NA);
+// samsung_ipc_tree = proto_item_add_subtree(samsung_ipc_tree, ett_samsung_ipc);
+
+// proto_tree_add_item(samsung_ipc_tree, hf_samsung_ipc_groups, tvb, 7, 1, ENC_NA);
return tvb_captured_length(tvb);
}
@@ -152,9 +160,30 @@ static gboolean dissect_usb_samsung_ipc(tvbuff_t *tvb, packet_info *pinfo,
void proto_register_samsung_ipc(void)
{
+ static hf_register_info hf[] = {
+ { &hf_samsung_ipc,
+ {
+ "group",
+ "samsung-ipc.group",
+ FT_UINT8,
+ BASE_HEX, // BASE_DEC ?
+ NULL, // VALS(hf_samsung_ipc_groups),
+ 0x0,
+ NULL,
+ HFILL
+ }
+ },
+ };
+ static gint *ett[] = {
+ &ett_samsung_ipc
+ };
+
proto_samsung_ipc = proto_register_protocol("Samsung IPC",
"samsung-ipc",
"samsung-ipc");
+
+ proto_register_field_array(proto_samsung_ipc, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* Handler registration */