2 * Definitions for address types
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
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.
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.
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.
23 #ifndef __ADDRESS_TYPES_H__
24 #define __ADDRESS_TYPES_H__
30 #endif /* __cplusplus */
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);
40 struct _address_type_t;
41 typedef struct _address_type_t address_type_t;
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);
48 WS_DLL_PUBLIC int address_type_get_by_name(const char* name);
50 void address_types_initialize(void);
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);
57 int ether_to_str(const address* addr, gchar *buf, int buf_len);
58 int ether_str_len(const address* addr);
60 const gchar* ether_name_resolution_str(const address* addr);
61 int ether_name_resolution_len(void);
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
68 const char* address_type_column_filter_string(const address* addr, gboolean src);
73 #endif /* __cplusplus */
75 #endif /* __ADDRESS_TYPES_H__ */
78 * Editor modelines - http://www.wireshark.org/tools/modelines.html
83 * indent-tabs-mode: nil
86 * vi: set shiftwidth=4 tabstop=8 expandtab:
87 * :indentSize=4:tabSize=8:noTabs=true: