2021-11-26 03:31:05 +00:00
|
|
|
/** @file
|
2015-02-09 01:36:03 +00:00
|
|
|
* Definitions for address types
|
2015-02-08 03:15:55 +00:00
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-08 16:59:17 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2015-02-08 03:15:55 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ADDRESS_TYPES_H__
|
|
|
|
#define __ADDRESS_TYPES_H__
|
|
|
|
|
|
|
|
#include "address.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2015-02-12 17:03:49 +00:00
|
|
|
typedef int (*AddrValueToString)(const address* addr, gchar *buf, int buf_len);
|
2015-02-08 03:15:55 +00:00
|
|
|
typedef int (*AddrValueToStringLen)(const address* addr);
|
2016-06-22 02:23:05 +00:00
|
|
|
typedef guint (*AddrValueToByte)(const address* addr, guint8 *buf, guint buf_len);
|
2015-02-09 01:36:03 +00:00
|
|
|
typedef int (*AddrFixedLen)(void);
|
2015-02-08 18:49:57 +00:00
|
|
|
typedef const char* (*AddrColFilterString)(const address* addr, gboolean src);
|
2015-02-12 17:03:49 +00:00
|
|
|
typedef int (*AddrNameResolutionLen)(void);
|
|
|
|
typedef const gchar* (*AddrNameResolutionToString)(const address* addr);
|
2015-02-08 03:15:55 +00:00
|
|
|
|
|
|
|
struct _address_type_t;
|
|
|
|
typedef struct _address_type_t address_type_t;
|
|
|
|
|
2015-10-09 09:48:35 +00:00
|
|
|
WS_DLL_PUBLIC int address_type_dissector_register(const char* name, const char* pretty_name,
|
2015-02-08 18:49:57 +00:00
|
|
|
AddrValueToString to_str_func, AddrValueToStringLen str_len_func,
|
2016-06-22 02:23:05 +00:00
|
|
|
AddrValueToByte to_bytes_func, AddrColFilterString col_filter_str_func, AddrFixedLen fixed_len_func,
|
2015-02-12 17:03:49 +00:00
|
|
|
AddrNameResolutionToString name_res_str_func, AddrNameResolutionLen name_res_len_func);
|
2015-02-08 03:15:55 +00:00
|
|
|
|
2016-06-12 15:12:15 +00:00
|
|
|
WS_DLL_PUBLIC int address_type_get_by_name(const char* name);
|
|
|
|
|
2015-02-08 03:15:55 +00:00
|
|
|
void address_types_initialize(void);
|
|
|
|
|
2015-02-08 21:36:07 +00:00
|
|
|
/* Address type functions used by multiple (dissector) address types */
|
2015-02-12 17:03:49 +00:00
|
|
|
int none_addr_to_str(const address* addr, gchar *buf, int buf_len);
|
2015-02-08 21:36:07 +00:00
|
|
|
int none_addr_str_len(const address* addr);
|
2015-02-09 01:36:03 +00:00
|
|
|
int none_addr_len(void);
|
2015-02-12 17:03:49 +00:00
|
|
|
|
|
|
|
int ether_to_str(const address* addr, gchar *buf, int buf_len);
|
2015-02-08 21:36:07 +00:00
|
|
|
int ether_str_len(const address* addr);
|
2015-02-09 01:36:03 +00:00
|
|
|
int ether_len(void);
|
2015-02-12 17:03:49 +00:00
|
|
|
const gchar* ether_name_resolution_str(const address* addr);
|
|
|
|
int ether_name_resolution_len(void);
|
2015-02-08 21:36:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-08 03:15:55 +00:00
|
|
|
/* XXX - Temporary? Here at least until all of the address type handling is finalized
|
|
|
|
* Otherwise should be folded into address_types.c or just be handled with function pointers
|
|
|
|
*/
|
2015-02-08 18:49:57 +00:00
|
|
|
const char* address_type_column_filter_string(const address* addr, gboolean src);
|
2015-02-08 03:15:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
#endif /* __ADDRESS_TYPES_H__ */
|
|
|
|
|
|
|
|
/*
|
2019-07-26 18:43:17 +00:00
|
|
|
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
2015-02-08 03:15:55 +00:00
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|