28#include "ws_symbol_export.h"
39#define MAXVLANNAMELEN 128
43#define MAXDNSNAMELEN 256
46#define BASE_ENTERPRISES BASE_CUSTOM
47#define STRINGS_ENTERPRISES CF_FUNC(enterprises_base_custom)
64#define ADDR_RESOLV_MACADDR(at) \
65 (((at)->type == AT_ETHER) || ((at)->type == AT_EUI64))
67#define ADDR_RESOLV_NETADDR(at) \
68 (((at)->type == AT_IPv4) || ((at)->type == AT_IPv6) || ((at)->type == AT_IPX))
89 char name[MAXDNSNAMELEN];
95#define TRIED_RESOLVE_ADDRESS (1U<<0)
96#define NAME_RESOLVED (1U<<1)
97#define RESOLVED_ADDRESS_USED (1U<<2)
98#define STATIC_HOSTNAME (1U<<3)
99#define NAME_RESOLVED_PREFIX (1U<<4)
101#define TRIED_OR_RESOLVED_MASK (TRIED_RESOLVE_ADDRESS | NAME_RESOLVED)
102#define USED_AND_RESOLVED_MASK (NAME_RESOLVED | RESOLVED_ADDRESS_USED)
111extern char *g_ethers_path;
112extern char *g_ipxnets_path;
113extern char *g_pethers_path;
114extern char *g_pipxnets_path;
278 port_type proto,
unsigned port);
299 port_type proto,
unsigned port);
307extern void addr_resolve_pref_init(
struct pref_module *nameres);
308extern void addr_resolve_pref_apply(
void);
349WS_DLL_PUBLIC
const char *
get_hostname(
const unsigned addr);
376WS_DLL_PUBLIC
const char *get_hostname6(
const ws_in6_addr *ad);
385WS_DLL_PUBLIC
const char *get_ether_name(
const uint8_t *addr);
389const char *get_hostname_ss7pc(
const uint8_t ni,
const uint32_t pc);
392void fill_unresolved_ss7pc(
const char * pc_addr,
const uint8_t ni,
const uint32_t pc);
396WS_DLL_PUBLIC
const char *tvb_get_ether_name(
tvbuff_t *tvb,
int offset);
403const char *get_ether_name_if_known(
const uint8_t *addr);
415extern const char *get_manuf_name(
const uint8_t *addr,
size_t size);
427WS_DLL_PUBLIC
const char *get_manuf_name_if_known(
const uint8_t *addr,
size_t size);
435extern const char *uint_get_manuf_name_if_known(
const uint32_t oid);
446WS_DLL_PUBLIC
const char *tvb_get_manuf_name(
tvbuff_t *tvb,
int offset);
455WS_DLL_PUBLIC
const char *tvb_get_manuf_name_if_known(
tvbuff_t *tvb,
int offset);
462extern const char *get_eui64_name(
const uint8_t *addr);
470extern char *eui64_to_display(
wmem_allocator_t *allocator,
const uint64_t addr);
474extern char *get_ipxnet_name(
wmem_allocator_t *allocator,
const uint32_t addr);
480WS_DLL_PUBLIC
unsigned get_hash_ether_status(
hashether_t* ether);
481WS_DLL_PUBLIC
bool get_hash_ether_used(
hashether_t* ether);
482WS_DLL_PUBLIC
char* get_hash_ether_hexaddr(
hashether_t* ether);
483WS_DLL_PUBLIC
char* get_hash_ether_resolved_name(
hashether_t* ether);
485WS_DLL_PUBLIC
bool get_hash_manuf_used(
hashmanuf_t* manuf);
486WS_DLL_PUBLIC
char* get_hash_manuf_resolved_name(
hashmanuf_t* manuf);
488WS_DLL_PUBLIC
bool get_hash_wka_used(
hashwka_t* wka);
489WS_DLL_PUBLIC
char* get_hash_wka_resolved_name(
hashwka_t* wka);
492WS_DLL_PUBLIC
void add_ipv4_name(
const unsigned addr,
const char *
name,
const bool static_entry);
495WS_DLL_PUBLIC
void add_ipv6_name(
const ws_in6_addr *addr,
const char *
name,
const bool static_entry);
509WS_DLL_PUBLIC
bool add_ip_name_from_string (
const char *addr,
const char *
name);
512WS_DLL_PUBLIC
resolved_name_t* get_edited_resolved_name(
const char* addr);
524extern void add_ether_byip(
const unsigned ip,
const uint8_t *eth);
584void set_resolution_synchrony(
bool synchronous);
591void name_resolver_init(
void);
595void host_name_lookup_reset(
void);
598void addr_resolv_init(
void);
601void addr_resolv_cleanup(
void);
604bool str_to_ip(
const char *str,
void *dst);
607bool str_to_ip6(
const char *str,
void *dst);
610bool str_to_eth(
const char *str,
char *eth_bytes);
613unsigned ipv6_oat_hash(
const void *key);
616gboolean ipv6_equal(
const void *v1,
const void *v2);
WS_DLL_PUBLIC bool host_name_lookup_process(void)
Process outstanding asynchronous host name lookups via c-ares.
Definition addr_resolv.c:3465
WS_DLL_PUBLIC const char * get_hostname(const unsigned addr)
Resolve an IPv4 address to its host name.
Definition addr_resolv.c:3512
char * dccp_port_to_display(wmem_allocator_t *allocator, unsigned port)
Resolve a DCCP port number to its display name.
Definition addr_resolv.c:3789
WS_DLL_PUBLIC char * tcp_port_to_display(wmem_allocator_t *allocator, unsigned port)
Resolve a TCP port number to its display name.
Definition addr_resolv.c:3801
WS_DLL_PUBLIC void enterprises_base_custom(char *buf, uint32_t value)
Format a private enterprise code as "name (decimal)" into a buffer.
Definition addr_resolv.c:1141
WS_DLL_PUBLIC const char * try_enterprises_lookup(uint32_t value)
Attempt to resolve a private enterprise code to its registered name.
Definition addr_resolv.c:1115
WS_DLL_PUBLIC const char * serv_name_lookup(port_type proto, unsigned port)
Resolve a port number to its well-known service name.
Definition addr_resolv.c:982
WS_DLL_PUBLIC bool get_host_ipaddr6(const char *host, ws_in6_addr *addrp)
Definition addr_resolv.c:4132
WS_DLL_PUBLIC hashipv4_t * new_ipv4(const unsigned addr)
Construct a new IPv4 object from a 32-bit address.
Definition addr_resolv.c:1268
WS_DLL_PUBLIC char * udp_port_to_display(wmem_allocator_t *allocator, unsigned port)
Resolve a UDP port number to its display name.
Definition addr_resolv.c:3777
WS_DLL_PUBLIC const char * try_serv_name_lookup(port_type proto, unsigned port)
Attempt to resolve a port number to its well-known service name.
Definition addr_resolv.c:976
WS_DLL_PUBLIC bool get_host_ipaddr(const char *host, uint32_t *addrp)
Definition addr_resolv.c:4067
WS_DLL_PUBLIC const char * enterprises_lookup(uint32_t value, const char *unknown_str)
Resolve a private enterprise code to its registered name.
Definition addr_resolv.c:1128
WS_DLL_PUBLIC addrinfo_lists_t * get_addrinfo_list(void)
Definition addr_resolv.c:2987
WS_DLL_PUBLIC char * sctp_port_to_display(wmem_allocator_t *allocator, unsigned port)
Resolve an SCTP port number to its display name.
Definition addr_resolv.c:3813
WS_DLL_PUBLIC bool fill_dummy_ip4(const unsigned addr, hashipv4_t *volatile tp)
Populate a dummy IPv4 object with the specified address.
Definition addr_resolv.c:1166
WS_DLL_PUBLIC char * get_hostname_wmem(wmem_allocator_t *allocator, const unsigned addr)
Resolve an IPv4 address to its host name using scoped memory allocation.
Definition addr_resolv.c:3539
WS_DLL_PUBLIC bool add_hosts_file(const char *hosts_file)
Definition addr_resolv.c:2863
struct _e_addr_resolve e_addr_resolve
Flags to control name resolution.
WS_DLL_PUBLIC void disable_name_resolution(void)
Disable all forms of name resolution.
Definition addr_resolv.c:3452
WS_DLL_PUBLIC int port_with_resolution_to_str_buf(char *buf, unsigned long buf_size, port_type proto, unsigned port)
Format a port number with its resolved service name into a buffer.
Definition addr_resolv.c:3839
WS_DLL_PUBLIC char * port_with_resolution_to_str(wmem_allocator_t *scope, port_type proto, unsigned port)
Format a port number with its resolved service name.
Definition addr_resolv.c:3825
Flags to control name resolution.
Definition addr_resolv.h:52
bool dns_pkt_addr_resolution
Definition addr_resolv.h:56
bool maxmind_geoip
Definition addr_resolv.h:61
bool ss7pc_name
Definition addr_resolv.h:60
bool use_external_net_name_resolver
Definition addr_resolv.h:58
bool handshake_sni_addr_resolution
Definition addr_resolv.h:57
bool transport_name
Definition addr_resolv.h:55
bool mac_name
Definition addr_resolv.h:53
bool network_name
Definition addr_resolv.h:54
bool vlan_name
Definition addr_resolv.h:59
Definition addr_resolv.h:88
Definition addr_resolv.h:82
Definition wmem_allocator.h:27
Definition inet_addr.h:27
Definition addr_resolv.c:162
Definition addr_resolv.c:169
Definition addr_resolv.c:181
Definition addr_resolv.c:176
Definition prefs-int.h:27
const char * name
Definition prefs-int.h:28
Definition tvbuff-int.h:35