attr_dissector_fn_t
[wireshark-sm.git] / epan / guid-utils.h
blobd7a2d212d36b70970e3f80265c9e031634d1c0c3
1 /** @file
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__
15 #include <stdint.h>
16 #include "ws_symbol_export.h"
17 #include <epan/wmem_scopes.h>
19 #define GUID_LEN 16
21 /* Note: this might be larger than GUID_LEN, so don't overlay data in packets
22 with this. */
23 typedef 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;
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
34 WS_DLL_PUBLIC void guids_init(void);
36 /* add a GUID */
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);
63 #ifdef __cplusplus
65 #endif /* __cplusplus */
67 #endif /* __GUID_UTILS_H__ */