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 /* try to get registered name for this GUID */
39 WS_DLL_PUBLIC const gchar *guids_get_guid_name(const e_guid_t *guid, wmem_allocator_t *scope);
40 
41 /* resolve GUID to name (or if unknown to hex string) */
42 /* (if you need hex string only, use guid_to_str instead) */
43 WS_DLL_PUBLIC const gchar* guids_resolve_guid_to_str(const e_guid_t *guid, wmem_allocator_t *scope);
44 
45 /* add a UUID (dcerpc_init_uuid() will call this too) */
46 #define guids_add_uuid(uuid, name) guids_add_guid((const e_guid_t *) (uuid), (name))
47 
48 /* try to get registered name for this UUID */
49 #define guids_get_uuid_name(uuid, scope) guids_get_guid_name((e_guid_t *) (uuid), scope)
50 
51 /* resolve UUID to name (or if unknown to hex string) */
52 /* (if you need hex string only, use guid_to_str instead) */
53 #define guids_resolve_uuid_to_str(uuid) guids_resolve_guid_to_str((e_guid_t *) (uuid))
54 
55 WS_DLL_PUBLIC int guid_cmp(const e_guid_t *g1, const e_guid_t *g2);
56 
57 WS_DLL_PUBLIC guint guid_hash(const e_guid_t *guid);
58 
59 #ifdef __cplusplus
60 }
61 #endif /* __cplusplus */
62 
63 #endif /* __GUID_UTILS_H__ */
Definition: guid-utils.h:22
Definition: wmem_allocator.h:27