update epan/dissectors/pidl/drsuapi/drsuapi.idl from samba
[wireshark-sm.git] / epan / address_types.h
blobfd8cd4874a3e606938e76ec98fbbdf86f1958aa9
1 /** @file
2 * Definitions for address types
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
11 #ifndef __ADDRESS_TYPES_H__
12 #define __ADDRESS_TYPES_H__
14 #include "address.h"
16 #ifdef __cplusplus
17 extern "C" {
18 #endif /* __cplusplus */
20 typedef int (*AddrValueToString)(const address* addr, char *buf, int buf_len);
21 typedef int (*AddrValueToStringLen)(const address* addr);
22 typedef unsigned (*AddrValueToByte)(const address* addr, uint8_t *buf, unsigned buf_len);
23 typedef int (*AddrFixedLen)(void);
24 typedef const char* (*AddrColFilterString)(const address* addr, bool src);
25 typedef int (*AddrNameResolutionLen)(void);
26 typedef const char* (*AddrNameResolutionToString)(const address* addr);
28 struct _address_type_t;
29 typedef struct _address_type_t address_type_t;
31 WS_DLL_PUBLIC int address_type_dissector_register(const char* name, const char* pretty_name,
32 AddrValueToString to_str_func, AddrValueToStringLen str_len_func,
33 AddrValueToByte to_bytes_func, AddrColFilterString col_filter_str_func, AddrFixedLen fixed_len_func,
34 AddrNameResolutionToString name_res_str_func, AddrNameResolutionLen name_res_len_func);
36 WS_DLL_PUBLIC int address_type_get_by_name(const char* name);
38 int ipv4_to_str(const address* addr, char *buf, int buf_len);
40 void address_types_initialize(void);
42 /* Address type functions used by multiple (dissector) address types */
43 int none_addr_to_str(const address* addr, char *buf, int buf_len);
44 int none_addr_str_len(const address* addr);
45 int none_addr_len(void);
47 int ether_to_str(const address* addr, char *buf, int buf_len);
48 int ether_str_len(const address* addr);
49 int ether_len(void);
50 const char* ether_name_resolution_str(const address* addr);
51 int ether_name_resolution_len(void);
55 /* XXX - Temporary? Here at least until all of the address type handling is finalized
56 * Otherwise should be folded into address_types.c or just be handled with function pointers
58 const char* address_type_column_filter_string(const address* addr, bool src);
61 #ifdef __cplusplus
63 #endif /* __cplusplus */
65 #endif /* __ADDRESS_TYPES_H__ */
68 * Editor modelines - https://www.wireshark.org/tools/modelines.html
70 * Local variables:
71 * c-basic-offset: 4
72 * tab-width: 8
73 * indent-tabs-mode: nil
74 * End:
76 * vi: set shiftwidth=4 tabstop=8 expandtab:
77 * :indentSize=4:tabSize=8:noTabs=true: