Wireshark  4.3.0
The Wireshark network protocol analyzer
guid-utils.h
Go to the documentation of this file.
1 
12 #ifndef __GUID_UTILS_H__
13 #define __GUID_UTILS_H__
14 
15 #include "ws_symbol_export.h"
16 #include <wsutil/wmem/wmem.h>
17 
18 #define GUID_LEN 16
19 
20 /* Note: this might be larger than GUID_LEN, so don't overlay data in packets
21  with this. */
22 typedef struct _e_guid_t {
23  guint32 data1;
24  guint16 data2;
25  guint16 data3;
26  guint8 data4[8];
27 } e_guid_t;
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif /* __cplusplus */
32 
33 WS_DLL_PUBLIC void guids_init(void);
34 
35 /* add a GUID */
36 WS_DLL_PUBLIC void guids_add_guid(const e_guid_t *guid, const gchar *name);
37 
38 /* remove a guid to name mapping */
39 WS_DLL_PUBLIC void guids_delete_guid(const e_guid_t *guid);
40 
41 /* try to get registered name for this GUID */
42 WS_DLL_PUBLIC const gchar *guids_get_guid_name(const e_guid_t *guid, wmem_allocator_t *scope);
43 
44 /* resolve GUID to name (or if unknown to hex string) */
45 /* (if you need hex string only, use guid_to_str instead) */
46 WS_DLL_PUBLIC const gchar* guids_resolve_guid_to_str(const e_guid_t *guid, wmem_allocator_t *scope);
47 
48 /* add a UUID (dcerpc_init_uuid() will call this too) */
49 #define guids_add_uuid(uuid, name) guids_add_guid((const e_guid_t *) (uuid), (name))
50 
51 /* try to get registered name for this UUID */
52 #define guids_get_uuid_name(uuid, scope) guids_get_guid_name((e_guid_t *) (uuid), scope)
53 
54 /* resolve UUID to name (or if unknown to hex string) */
55 /* (if you need hex string only, use guid_to_str instead) */
56 #define guids_resolve_uuid_to_str(uuid) guids_resolve_guid_to_str((e_guid_t *) (uuid))
57 
58 WS_DLL_PUBLIC int guid_cmp(const e_guid_t *g1, const e_guid_t *g2);
59 
60 WS_DLL_PUBLIC guint guid_hash(const e_guid_t *guid);
61 
62 #ifdef __cplusplus
63 }
64 #endif /* __cplusplus */
65 
66 #endif /* __GUID_UTILS_H__ */
Definition: guid-utils.h:22
Definition: wmem_allocator.h:27