2 * Definitions for GUID handling
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #ifndef __GUID_UTILS_H__
13 #define __GUID_UTILS_H__
16 #include "ws_symbol_export.h"
17 #include <epan/wmem_scopes.h>
21 /* Note: this might be larger than GUID_LEN, so don't overlay data in packets
23 typedef struct _e_guid_t
{
32 #endif /* __cplusplus */
34 WS_DLL_PUBLIC
void guids_init(void);
37 WS_DLL_PUBLIC
void guids_add_guid(const e_guid_t
*guid
, const char *name
);
39 /* remove a guid to name mapping */
40 WS_DLL_PUBLIC
void guids_delete_guid(const e_guid_t
*guid
);
42 /* try to get registered name for this GUID */
43 WS_DLL_PUBLIC
const char *guids_get_guid_name(const e_guid_t
*guid
, wmem_allocator_t
*scope
);
45 /* resolve GUID to name (or if unknown to hex string) */
46 /* (if you need hex string only, use guid_to_str instead) */
47 WS_DLL_PUBLIC
const char* guids_resolve_guid_to_str(const e_guid_t
*guid
, wmem_allocator_t
*scope
);
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))
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)
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))
59 WS_DLL_PUBLIC
int guid_cmp(const e_guid_t
*g1
, const e_guid_t
*g2
);
61 WS_DLL_PUBLIC
unsigned guid_hash(const e_guid_t
*guid
);
65 #endif /* __cplusplus */
67 #endif /* __GUID_UTILS_H__ */