Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-stat-notify.c
blob1698d874649b4fcc926474a8b08274b92294d741
1 /* packet-stat.c
2 * Routines for async NSM stat callback dissection
3 * 2001 Ronnie Sahlberg <See AUTHORS for email>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #include "config.h"
14 #include "packet-rpc.h"
15 #include "packet-stat-notify.h"
17 void proto_register_statnotify(void);
18 void proto_reg_handoff_statnotify(void);
20 static int proto_statnotify;
21 static int hf_statnotify_procedure_v1;
22 static int hf_statnotify_name;
23 static int hf_statnotify_state;
24 static int hf_statnotify_priv;
26 static int ett_statnotify;
29 static int
30 dissect_statnotify_mon(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
32 int offset = 0;
34 offset = dissect_rpc_string(tvb,tree,hf_statnotify_name,offset,NULL);
36 offset = dissect_rpc_uint32(tvb,tree,hf_statnotify_state,offset);
38 proto_tree_add_item(tree,hf_statnotify_priv,tvb,offset,16,ENC_NA);
39 offset += 16;
41 return offset;
44 /* proc number, "proc name", dissect_request, dissect_reply */
46 static const vsff statnotify1_proc[] = {
47 { 0, "NULL",
48 dissect_rpc_void, dissect_rpc_void },
49 { STATNOTIFYPROC_MON, "MON-CALLBACK",
50 dissect_statnotify_mon, dissect_rpc_void },
51 { 0, NULL, NULL, NULL }
53 static const value_string statnotify1_proc_vals[] = {
54 { 0, "NULL" },
55 { STATNOTIFYPROC_MON, "MON-CALLBACK" },
56 { 0, NULL }
58 /* end of stat-notify version 1 */
60 static const rpc_prog_vers_info statnotify_vers_info[] = {
61 { 1, statnotify1_proc, &hf_statnotify_procedure_v1 },
65 void
66 proto_register_statnotify(void)
68 static hf_register_info hf[] = {
69 { &hf_statnotify_procedure_v1, {
70 "V1 Procedure", "statnotify.procedure_v1", FT_UINT32, BASE_DEC,
71 VALS(statnotify1_proc_vals), 0, NULL, HFILL }},
72 { &hf_statnotify_name, {
73 "Name", "statnotify.name", FT_STRING, BASE_NONE,
74 NULL, 0, "Name of client that changed", HFILL }},
75 { &hf_statnotify_state, {
76 "State", "statnotify.state", FT_UINT32, BASE_DEC,
77 NULL, 0, "New state of client that changed", HFILL }},
78 { &hf_statnotify_priv, {
79 "Priv", "statnotify.priv", FT_BYTES, BASE_NONE,
80 NULL, 0, "Client supplied opaque data", HFILL }},
83 static int *ett[] = {
84 &ett_statnotify,
87 proto_statnotify = proto_register_protocol("Network Status Monitor CallBack Protocol", "STAT-CB", "statnotify");
88 proto_register_field_array(proto_statnotify, hf, array_length(hf));
89 proto_register_subtree_array(ett, array_length(ett));
92 void
93 proto_reg_handoff_statnotify(void)
95 /* Register the protocol as RPC */
96 rpc_init_prog(proto_statnotify, STATNOTIFY_PROGRAM, ett_statnotify,
97 G_N_ELEMENTS(statnotify_vers_info), statnotify_vers_info);
101 * Editor modelines - https://www.wireshark.org/tools/modelines.html
103 * Local variables:
104 * c-basic-offset: 8
105 * tab-width: 8
106 * indent-tabs-mode: t
107 * End:
109 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
110 * :indentSize=8:tabSize=8:noTabs=false: