Wireshark  4.3.0
The Wireshark network protocol analyzer
proto_data.h
Go to the documentation of this file.
1 /* proto_data.h
2  * Definitions for protocol-specific data
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * SPDX-License-Identifier: GPL-2.0-or-later
9  */
10 
11 #ifndef __PROTO_DATA_H__
12 #define __PROTO_DATA_H__
13 
14 #include "ws_symbol_export.h"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif /* __cplusplus */
19 
29 /* Allocator should be either pinfo->pool or wmem_file_scope() */
30 
46 WS_DLL_PUBLIC void p_add_proto_data(wmem_allocator_t *scope, struct _packet_info* pinfo, int proto, guint32 key, void *proto_data);
47 
64 WS_DLL_PUBLIC void p_set_proto_data(wmem_allocator_t *scope, struct _packet_info* pinfo, int proto, guint32 key, void *proto_data);
65 
77 WS_DLL_PUBLIC void *p_get_proto_data(wmem_allocator_t *scope, struct _packet_info* pinfo, int proto, guint32 key);
78 
87 WS_DLL_PUBLIC void p_remove_proto_data(wmem_allocator_t *scope, struct _packet_info* pinfo, int proto, guint32 key);
88 
89 gchar *p_get_proto_name_and_key(wmem_allocator_t *scope, struct _packet_info* pinfo, guint pfd_index);
90 
98 WS_DLL_PUBLIC void p_set_proto_depth(struct _packet_info* pinfo, int proto, unsigned depth);
99 
106 WS_DLL_PUBLIC unsigned p_get_proto_depth(struct _packet_info* pinfo, int proto);
107 
110 #ifdef __cplusplus
111 }
112 #endif /* __cplusplus */
113 
114 #endif /* __PROTO_DATA__ */
115 
116 /*
117  * Editor modelines - https://www.wireshark.org/tools/modelines.html
118  *
119  * Local variables:
120  * c-basic-offset: 2
121  * tab-width: 8
122  * indent-tabs-mode: nil
123  * End:
124  *
125  * vi: set shiftwidth=2 tabstop=8 expandtab:
126  * :indentSize=2:tabSize=8:noTabs=true:
127  */
WS_DLL_PUBLIC void p_set_proto_data(wmem_allocator_t *scope, struct _packet_info *pinfo, int proto, guint32 key, void *proto_data)
Definition: proto_data.c:77
WS_DLL_PUBLIC void * p_get_proto_data(wmem_allocator_t *scope, struct _packet_info *pinfo, int proto, guint32 key)
Definition: proto_data.c:104
WS_DLL_PUBLIC void p_remove_proto_data(wmem_allocator_t *scope, struct _packet_info *pinfo, int proto, guint32 key)
Definition: proto_data.c:130
WS_DLL_PUBLIC void p_add_proto_data(wmem_allocator_t *scope, struct _packet_info *pinfo, int proto, guint32 key, void *proto_data)
Definition: proto_data.c:50
WS_DLL_PUBLIC void p_set_proto_depth(struct _packet_info *pinfo, int proto, unsigned depth)
Definition: proto_data.c:172
WS_DLL_PUBLIC unsigned p_get_proto_depth(struct _packet_info *pinfo, int proto)
Definition: proto_data.c:176
Definition: packet_info.h:44
Definition: wmem_allocator.h:27