Licepnse -> License
[obnox/wireshark/wip.git] / epan / guid-utils.h
1 /* guid-utils.h
2  * Definitions for GUID handling
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  *
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 #ifndef __GUID_UTILS_H__
27 #define __GUID_UTILS_H__
28
29 #define GUID_LEN        16
30
31 /* Note: this might be larger than GUID_LEN, so don't overlay data in packets
32    with this. */
33 typedef struct _e_guid_t {
34     guint32 data1;
35     guint16 data2;
36     guint16 data3;
37     guint8  data4[8];
38 } e_guid_t;
39
40
41 extern void guids_init(void);
42
43 /* add a GUID */
44 extern void guids_add_guid(e_guid_t *guid, const gchar *name);
45
46 /* try to get registered name for this GUID */
47 extern const gchar *guids_get_guid_name(e_guid_t *guid);
48
49 /* resolve GUID to name (or if unknown to hex string) */
50 /* (if you need hex string only, use guid_to_str instead) */
51 extern const gchar* guids_resolve_guid_to_str(e_guid_t *guid);
52
53 /* add a UUID (dcerpc_init_uuid() will call this too) */
54 #define guids_add_uuid(uuid, name) guids_add_guid((e_guid_t *) (uuid), (name))
55
56 /* try to get registered name for this UUID */
57 #define guids_get_uuid_name(uuid) guids_get_guid_name((e_guid_t *) (uuid))
58
59 /* resolve UUID to name (or if unknown to hex string) */
60 /* (if you need hex string only, use guid_to_str instead) */
61 #define guids_resolve_uuid_to_str(uuid) guids_resolve_guid_to_str((e_guid_t *) (uuid))
62
63 #endif /* __GUID_UTILS_H__ */