3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
11 #include <wireshark.h>
12 #include <wsutil/plugins.h>
13 #include <epan/packet.h>
14 #include <epan/proto.h>
17 #define VERSION "0.0.0"
20 WS_DLL_PUBLIC_DEF
const char plugin_version
[] = VERSION
;
21 WS_DLL_PUBLIC_DEF
const int plugin_want_major
= WIRESHARK_VERSION_MAJOR
;
22 WS_DLL_PUBLIC_DEF
const int plugin_want_minor
= WIRESHARK_VERSION_MINOR
;
24 WS_DLL_PUBLIC
void plugin_register(void);
25 WS_DLL_PUBLIC
uint32_t plugin_describe(void);
27 static int proto_hello
;
28 static dissector_handle_t handle_hello
;
31 dissect_hello(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void *data _U_
)
33 proto_tree_add_protocol_format(tree
, proto_hello
, tvb
, 0, -1, "This is Hello version %s, a Wireshark postdissector plugin prototype", plugin_version
);
34 return tvb_captured_length(tvb
);
38 proto_register_hello(void)
40 proto_hello
= proto_register_protocol("Wireshark Hello Plugin", "Hello WS", "hello_ws");
41 handle_hello
= create_dissector_handle(dissect_hello
, proto_hello
);
42 register_postdissector(handle_hello
);
46 proto_reg_handoff_hello(void)
54 static proto_plugin plug
;
56 plug
.register_protoinfo
= proto_register_hello
;
57 plug
.register_handoff
= proto_reg_handoff_hello
; /* or NULL */
58 proto_register_plugin(&plug
);
64 return WS_PLUGIN_DESC_DISSECTOR
;