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