radiotap: Updates to the radiotap dissector to avoid confusion.
[metze/wireshark/wip.git] / epan / address_types.h
1 /* address_types.h
2  * Definitions for address types
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22
23 #ifndef __ADDRESS_TYPES_H__
24 #define __ADDRESS_TYPES_H__
25
26 #include "address.h"
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31
32 typedef int (*AddrValueToString)(const address* addr, gchar *buf, int buf_len);
33 typedef int (*AddrValueToStringLen)(const address* addr);
34 typedef guint (*AddrValueToByte)(const address* addr, guint8 *buf, guint buf_len);
35 typedef int (*AddrFixedLen)(void);
36 typedef const char* (*AddrColFilterString)(const address* addr, gboolean src);
37 typedef int (*AddrNameResolutionLen)(void);
38 typedef const gchar* (*AddrNameResolutionToString)(const address* addr);
39
40 struct _address_type_t;
41 typedef struct _address_type_t address_type_t;
42
43 WS_DLL_PUBLIC int address_type_dissector_register(const char* name, const char* pretty_name,
44                                     AddrValueToString to_str_func, AddrValueToStringLen str_len_func,
45                                     AddrValueToByte to_bytes_func, AddrColFilterString col_filter_str_func, AddrFixedLen fixed_len_func,
46                                     AddrNameResolutionToString name_res_str_func, AddrNameResolutionLen name_res_len_func);
47
48 WS_DLL_PUBLIC int address_type_get_by_name(const char* name);
49
50 void address_types_initialize(void);
51
52 /* Address type functions used by multiple (dissector) address types */
53 int none_addr_to_str(const address* addr, gchar *buf, int buf_len);
54 int none_addr_str_len(const address* addr);
55 int none_addr_len(void);
56
57 int ether_to_str(const address* addr, gchar *buf, int buf_len);
58 int ether_str_len(const address* addr);
59 int ether_len(void);
60 const gchar* ether_name_resolution_str(const address* addr);
61 int ether_name_resolution_len(void);
62
63
64
65 /* XXX - Temporary?  Here at least until all of the address type handling is finalized
66  * Otherwise should be folded into address_types.c or just be handled with function pointers
67  */
68 const char* address_type_column_filter_string(const address* addr, gboolean src);
69
70
71 #ifdef __cplusplus
72 }
73 #endif /* __cplusplus */
74
75 #endif /* __ADDRESS_TYPES_H__ */
76
77 /*
78  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
79  *
80  * Local variables:
81  * c-basic-offset: 4
82  * tab-width: 8
83  * indent-tabs-mode: nil
84  * End:
85  *
86  * vi: set shiftwidth=4 tabstop=8 expandtab:
87  * :indentSize=4:tabSize=8:noTabs=true:
88  */