2004-08-09 22:31:21 +00:00
|
|
|
/* addr_resolv.h
|
1998-09-16 02:39:15 +00:00
|
|
|
* Definitions for network object lookup
|
|
|
|
*
|
2003-01-26 19:35:31 +00:00
|
|
|
* Laurent Deniel <laurent.deniel@free.fr>
|
1998-09-16 02:39:15 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
1998-09-16 02:39:15 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 20:41:00 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 20:41:00 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 20:41:00 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
1998-09-16 02:39:15 +00:00
|
|
|
*/
|
2009-09-06 14:25:47 +00:00
|
|
|
/* The buffers returned by these functions are all allocated with a
|
|
|
|
* packet lifetime and does not have have to be freed.
|
2005-08-17 20:45:18 +00:00
|
|
|
* However, take into account that when the packet dissection
|
|
|
|
* completes, these buffers will be automatically reclaimed/freed.
|
|
|
|
* If you need the buffer to remain for a longer scope than packet lifetime
|
|
|
|
* you must copy the content to an se_alloc() buffer.
|
|
|
|
*/
|
1998-09-16 02:39:15 +00:00
|
|
|
|
|
|
|
#ifndef __RESOLV_H__
|
|
|
|
#define __RESOLV_H__
|
|
|
|
|
2005-01-07 11:56:00 +00:00
|
|
|
#include <epan/address.h>
|
2011-05-20 02:42:14 +00:00
|
|
|
#include <epan/tvbuff.h>
|
2013-11-10 12:31:17 +00:00
|
|
|
#include <epan/ipv6-utils.h>
|
2013-08-18 19:02:48 +00:00
|
|
|
#include <epan/to_str.h>
|
2013-09-22 19:40:02 +00:00
|
|
|
#include <wiretap/wtap.h>
|
2013-03-01 23:53:11 +00:00
|
|
|
#include "ws_symbol_export.h"
|
2005-01-07 11:56:00 +00:00
|
|
|
|
2007-01-18 18:43:30 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
1999-11-20 05:35:15 +00:00
|
|
|
#ifndef MAXNAMELEN
|
|
|
|
#define MAXNAMELEN 64 /* max name length (hostname and port name) */
|
|
|
|
#endif
|
|
|
|
|
2012-07-06 04:48:36 +00:00
|
|
|
typedef struct _e_addr_resolve {
|
|
|
|
gboolean mac_name;
|
|
|
|
gboolean network_name;
|
|
|
|
gboolean transport_name;
|
|
|
|
gboolean concurrent_dns;
|
2012-07-08 01:31:48 +00:00
|
|
|
gboolean use_external_net_name_resolver;
|
2012-07-11 08:52:51 +00:00
|
|
|
gboolean load_hosts_file_from_profile_only;
|
2012-07-06 04:48:36 +00:00
|
|
|
} e_addr_resolve;
|
|
|
|
|
2013-08-02 15:05:00 +00:00
|
|
|
|
|
|
|
typedef struct hashether {
|
|
|
|
guint status; /* (See above) */
|
|
|
|
guint8 addr[6];
|
|
|
|
char hexaddr[6*3];
|
|
|
|
char resolved_name[MAXNAMELEN];
|
|
|
|
} hashether_t;
|
|
|
|
|
2013-08-05 16:36:24 +00:00
|
|
|
typedef struct serv_port {
|
|
|
|
gchar *udp_name;
|
|
|
|
gchar *tcp_name;
|
|
|
|
gchar *sctp_name;
|
|
|
|
gchar *dccp_name;
|
|
|
|
} serv_port_t;
|
|
|
|
|
2013-08-11 19:02:26 +00:00
|
|
|
/*
|
2014-02-25 20:42:35 +00:00
|
|
|
*
|
2013-08-11 19:02:26 +00:00
|
|
|
*/
|
2013-10-10 19:17:48 +00:00
|
|
|
#define DUMMY_ADDRESS_ENTRY 1<<0
|
|
|
|
#define TRIED_RESOLVE_ADDRESS 1<<1
|
|
|
|
#define RESOLVED_ADDRESS_USED 1<<2
|
|
|
|
|
|
|
|
#define DUMMY_AND_RESOLVE_FLGS 3
|
2013-10-10 19:30:29 +00:00
|
|
|
#define USED_AND_RESOLVED_MASK (1+4)
|
2013-08-11 19:02:26 +00:00
|
|
|
typedef struct hashipv4 {
|
2013-10-10 19:17:48 +00:00
|
|
|
guint addr;
|
|
|
|
guint8 flags; /* B0 dummy_entry, B1 resolve, B2 If the address is used in the trace */
|
|
|
|
gchar ip[16];
|
|
|
|
gchar name[MAXNAMELEN];
|
2013-08-11 19:02:26 +00:00
|
|
|
} hashipv4_t;
|
|
|
|
|
2013-08-18 19:02:48 +00:00
|
|
|
|
|
|
|
typedef struct hashipv6 {
|
|
|
|
struct e_in6_addr addr;
|
2013-10-10 19:17:48 +00:00
|
|
|
guint8 flags; /* B0 dummy_entry, B1 resolve, B2 If the address is used in the trace */
|
2013-08-29 22:08:23 +00:00
|
|
|
gchar ip6[MAX_IP6_STR_LEN]; /* XX */
|
2013-08-18 19:02:48 +00:00
|
|
|
gchar name[MAXNAMELEN];
|
|
|
|
} hashipv6_t;
|
2002-01-13 20:35:12 +00:00
|
|
|
/*
|
|
|
|
* Flag controlling what names to resolve.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC e_addr_resolve gbl_resolv_flags;
|
2002-01-13 20:35:12 +00:00
|
|
|
|
1998-09-25 23:24:07 +00:00
|
|
|
/* global variables */
|
|
|
|
|
|
|
|
extern gchar *g_ethers_path;
|
1999-11-21 16:32:23 +00:00
|
|
|
extern gchar *g_ipxnets_path;
|
1998-09-25 23:24:07 +00:00
|
|
|
extern gchar *g_pethers_path;
|
1999-11-21 16:32:23 +00:00
|
|
|
extern gchar *g_pipxnets_path;
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2012-07-06 04:48:36 +00:00
|
|
|
/* Functions in addr_resolv.c */
|
2002-01-13 20:35:12 +00:00
|
|
|
|
2004-12-30 02:10:24 +00:00
|
|
|
/*
|
|
|
|
* get_udp_port() returns the port name corresponding to that UDP port,
|
|
|
|
* or the port number as a string if not found.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC gchar *get_udp_port(guint port);
|
1998-09-25 23:24:07 +00:00
|
|
|
|
2004-12-30 02:10:24 +00:00
|
|
|
/*
|
|
|
|
* get_tcp_port() returns the port name corresponding to that TCP port,
|
|
|
|
* or the port number as a string if not found.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC gchar *get_tcp_port(guint port);
|
1998-09-25 23:24:07 +00:00
|
|
|
|
2005-09-20 15:18:28 +00:00
|
|
|
/*
|
|
|
|
* get_dccp_port() returns the port name corresponding to that DCCP port,
|
|
|
|
* or the port number as a string if not found.
|
|
|
|
*/
|
|
|
|
extern gchar *get_dccp_port(guint port);
|
|
|
|
|
2004-12-30 02:10:24 +00:00
|
|
|
/*
|
|
|
|
* get_sctp_port() returns the port name corresponding to that SCTP port,
|
|
|
|
* or the port number as a string if not found.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC gchar *get_sctp_port(guint port);
|
2000-08-19 08:26:04 +00:00
|
|
|
|
2005-02-22 01:55:04 +00:00
|
|
|
/* get_addr_name takes as input an "address", as defined in address.h */
|
|
|
|
/* it returns a string that contains: */
|
|
|
|
/* - if the address is of a type that can be translated into a name, and the user */
|
|
|
|
/* has activated name resolution, the translated name */
|
|
|
|
/* - if the address is of type AT_NONE, a pointer to the string "NONE" */
|
2009-09-06 14:25:47 +00:00
|
|
|
/* - if the address is of any other type, the result of ep_address_to_str on the argument, */
|
2005-02-22 01:55:04 +00:00
|
|
|
/* which should be a string representation for the answer -e.g. "10.10.10.10" for IPv4 */
|
|
|
|
/* address 10.10.10.10 */
|
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2009-09-07 16:17:58 +00:00
|
|
|
const gchar *get_addr_name(const address *addr);
|
|
|
|
const gchar *se_get_addr_name(const address *addr);
|
2004-12-30 02:10:24 +00:00
|
|
|
|
2005-02-22 01:55:04 +00:00
|
|
|
/* get_addr_name_buf solves an address in the same way as get_addr_name above */
|
2007-09-28 18:23:59 +00:00
|
|
|
/* The difference is that get_addr_name_buf takes as input a buffer, into which it puts */
|
|
|
|
/* the result which is always NUL ('\0') terminated. The buffer should be large enough to */
|
|
|
|
/* contain size characters including the terminator */
|
2005-02-22 01:55:04 +00:00
|
|
|
|
2010-04-03 18:18:50 +00:00
|
|
|
void get_addr_name_buf(const address *addr, gchar *buf, gsize size);
|
2005-02-22 01:55:04 +00:00
|
|
|
|
|
|
|
|
2003-05-05 08:20:01 +00:00
|
|
|
/*
|
|
|
|
* Asynchronous host name lookup initialization, processing, and cleanup
|
|
|
|
*/
|
|
|
|
|
2012-07-06 04:48:36 +00:00
|
|
|
/* Setup name resolution preferences */
|
2012-07-06 07:06:09 +00:00
|
|
|
struct pref_module;
|
|
|
|
extern void addr_resolve_pref_init(struct pref_module *nameres);
|
2012-07-06 04:48:36 +00:00
|
|
|
|
2009-12-22 20:01:06 +00:00
|
|
|
/** If we're using c-ares or ADNS, process outstanding host name lookups.
|
|
|
|
* This is called from a GLIB timeout in Wireshark and before processing
|
|
|
|
* each packet in TShark.
|
|
|
|
*
|
|
|
|
* @return True if any new objects have been resolved since the previous
|
|
|
|
* call. This can be used to trigger a display update, e.g. in Wireshark.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC gboolean host_name_lookup_process(void);
|
2003-05-05 08:20:01 +00:00
|
|
|
|
1998-09-25 23:24:07 +00:00
|
|
|
/* get_hostname returns the host name or "%d.%d.%d.%d" if not found */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC const gchar *get_hostname(const guint addr);
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2003-05-04 18:50:56 +00:00
|
|
|
/* get_hostname6 returns the host name, or numeric addr if not found */
|
1999-03-28 18:32:03 +00:00
|
|
|
struct e_in6_addr;
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC const gchar* get_hostname6(const struct e_in6_addr *ad);
|
1999-03-28 18:32:03 +00:00
|
|
|
|
1998-09-25 23:24:07 +00:00
|
|
|
/* get_ether_name returns the logical name if found in ethers files else
|
|
|
|
"<vendor>_%02x:%02x:%02x" if the vendor code is known else
|
|
|
|
"%02x:%02x:%02x:%02x:%02x:%02x" */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC gchar *get_ether_name(const guint8 *addr);
|
1998-09-25 23:24:07 +00:00
|
|
|
|
1999-11-20 05:35:15 +00:00
|
|
|
/* get_ether_name returns the logical name if found in ethers files else NULL */
|
2013-03-01 23:53:11 +00:00
|
|
|
gchar *get_ether_name_if_known(const guint8 *addr);
|
1999-11-20 05:35:15 +00:00
|
|
|
|
2012-04-13 22:23:04 +00:00
|
|
|
/*
|
|
|
|
* Given a sequence of 3 octets containing an OID, get_manuf_name()
|
|
|
|
* returns the vendor name, or "%02x:%02x:%02x" if not known.
|
|
|
|
*/
|
2004-01-10 17:31:40 +00:00
|
|
|
extern const gchar *get_manuf_name(const guint8 *addr);
|
1998-09-25 23:24:07 +00:00
|
|
|
|
2012-04-13 22:23:04 +00:00
|
|
|
/*
|
|
|
|
* Given a sequence of 3 octets containing an OID, get_manuf_name_if_known()
|
|
|
|
* returns the vendor name, or NULL if not known.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC const gchar *get_manuf_name_if_known(const guint8 *addr);
|
2005-05-20 21:44:17 +00:00
|
|
|
|
2012-04-13 22:23:04 +00:00
|
|
|
/*
|
|
|
|
* Given an integer containing a 24-bit OID, uint_get_manuf_name()
|
|
|
|
* returns the vendor name, or "%02x:%02x:%02x" if not known.
|
|
|
|
*/
|
|
|
|
extern const gchar *uint_get_manuf_name(const guint oid);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Given an integer containing a 24-bit OID, uint_get_manuf_name_if_known()
|
|
|
|
* returns the vendor name, or NULL if not known.
|
|
|
|
*/
|
|
|
|
extern const gchar *uint_get_manuf_name_if_known(const guint oid);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Given a tvbuff and an offset in that tvbuff for a 3-octet OID,
|
|
|
|
* tvb_get_manuf_name() returns the vendor name, or "%02x:%02x:%02x"
|
|
|
|
* if not known.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC const gchar *tvb_get_manuf_name(tvbuff_t *tvb, gint offset);
|
2011-05-20 02:42:14 +00:00
|
|
|
|
2012-04-13 22:23:04 +00:00
|
|
|
/*
|
|
|
|
* Given a tvbuff and an offset in that tvbuff for a 3-octet OID,
|
|
|
|
* tvb_get_manuf_name_if_known() returns the vendor name, or NULL
|
|
|
|
* if not known.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC const gchar *tvb_get_manuf_name_if_known(tvbuff_t *tvb, gint offset);
|
2011-05-20 02:42:14 +00:00
|
|
|
|
|
|
|
/* get_eui64_name returns "<vendor>_%02x:%02x:%02x:%02x:%02x:%02x" if the vendor code is known
|
2011-05-08 10:23:53 +00:00
|
|
|
"%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x" */
|
|
|
|
extern const gchar *get_eui64_name(const guint64 addr);
|
|
|
|
|
|
|
|
/* get_eui64_name_if_known returns "<vendor>_%02x:%02x:%02x:%02x:%02x:%02x" if the vendor code is known else NULL */
|
|
|
|
extern const gchar *get_eui64_name_if_known(const guint64 addr);
|
|
|
|
|
|
|
|
|
1999-11-21 16:32:23 +00:00
|
|
|
/* get_ipxnet_name returns the logical name if found in an ipxnets file,
|
|
|
|
* or a string formatted with "%X" if not */
|
2004-01-10 17:31:40 +00:00
|
|
|
extern const gchar *get_ipxnet_name(const guint32 addr);
|
1999-11-21 16:32:23 +00:00
|
|
|
|
1998-09-25 23:24:07 +00:00
|
|
|
/* returns the ethernet address corresponding to name or NULL if not known */
|
2004-01-10 17:31:40 +00:00
|
|
|
extern guint8 *get_ether_addr(const gchar *name);
|
1998-09-25 23:24:07 +00:00
|
|
|
|
1999-11-21 16:32:23 +00:00
|
|
|
/* returns the ipx network corresponding to name. If name is unknown,
|
2001-01-31 05:52:24 +00:00
|
|
|
* 0 is returned and 'known' is set to FALSE. On success, 'known'
|
|
|
|
* is set to TRUE. */
|
2004-01-10 17:31:40 +00:00
|
|
|
guint32 get_ipxnet_addr(const gchar *name, gboolean *known);
|
1999-11-21 16:32:23 +00:00
|
|
|
|
2004-11-17 08:53:20 +00:00
|
|
|
/* adds a hostname/IPv4 in the hash table */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void add_ipv4_name(const guint addr, const gchar *name);
|
1998-09-25 23:24:07 +00:00
|
|
|
|
2004-11-17 09:44:41 +00:00
|
|
|
/* adds a hostname/IPv6 in the hash table */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void add_ipv6_name(const struct e_in6_addr *addr, const gchar *name);
|
2004-11-17 09:44:41 +00:00
|
|
|
|
2012-11-29 00:32:39 +00:00
|
|
|
/** Add an additional "hosts" file for IPv4 and IPv6 name resolution.
|
|
|
|
*
|
|
|
|
* The file can be added before host_name_lookup_init() is called and
|
|
|
|
* will be re-read each time host_name_lookup_init() is called.
|
|
|
|
*
|
2013-04-26 18:28:21 +00:00
|
|
|
* @param hosts_file Absolute path to the hosts file.
|
2012-11-29 00:32:39 +00:00
|
|
|
*
|
|
|
|
* @return TRUE if the hosts file can be read.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC gboolean add_hosts_file (const char *hosts_file);
|
2011-03-24 22:47:57 +00:00
|
|
|
|
2010-04-27 06:51:16 +00:00
|
|
|
/* adds a hostname in the hash table */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC gboolean add_ip_name_from_string (const char *addr, const char *name);
|
2010-04-27 06:51:16 +00:00
|
|
|
|
2013-09-22 19:40:02 +00:00
|
|
|
|
|
|
|
/** Get lists of host name to address mappings we know about.
|
2011-03-24 22:47:57 +00:00
|
|
|
*
|
2013-09-22 19:40:02 +00:00
|
|
|
* The struct contains two g_lists one with hashipv4_t entries and one with hashipv6_t entries.
|
2011-05-20 02:42:14 +00:00
|
|
|
*
|
2013-09-22 19:40:02 +00:00
|
|
|
* @return a struct with lists of known addresses(IPv4 and IPv6). May be NULL.
|
2011-03-24 22:47:57 +00:00
|
|
|
*/
|
2013-09-22 19:40:02 +00:00
|
|
|
WS_DLL_PUBLIC addrinfo_lists_t *get_addrinfo_list(void);
|
2011-03-24 22:47:57 +00:00
|
|
|
|
2000-08-10 20:09:29 +00:00
|
|
|
/* add ethernet address / name corresponding to IP address */
|
2010-04-03 18:18:50 +00:00
|
|
|
extern void add_ether_byip(const guint ip, const guint8 *eth);
|
2000-08-10 20:09:29 +00:00
|
|
|
|
2009-12-24 00:58:31 +00:00
|
|
|
/** Translates a string representing a hostname or dotted-decimal IPv4 address
|
|
|
|
* into a numeric IPv4 address value in network byte order. If compiled with
|
|
|
|
* c-ares, the request will wait a maximum of 250ms for the request to finish.
|
|
|
|
* Otherwise the wait time will be system-dependent, ususally much longer.
|
2009-12-24 17:21:02 +00:00
|
|
|
* Immediately returns FALSE for hostnames if network name resolution is
|
|
|
|
* disabled.
|
2009-12-24 00:58:31 +00:00
|
|
|
*
|
|
|
|
* @param[in] host The hostname.
|
|
|
|
* @param[out] addrp The numeric IPv4 address in network byte order.
|
2009-12-24 17:21:02 +00:00
|
|
|
* @return TRUE on success, FALSE on failure, timeout.
|
2009-12-24 00:58:31 +00:00
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
Have "get_host_ipaddr()" return a Boolean indicating whether it
succeeded or failed, and, if it succeeded, have it fill in the IP
address if found through a pointer passed as the second argument.
Have it first try interpreting its first argument as a dotted-quad IP
address, with "inet_aton()", and, if that fails, have it try to
interpret it as a host name with "gethostbyname()"; don't bother with
"gethostbyaddr()", as we should be allowed to filter on IP addresses
even if there's no host name associated with them (there's no guarantee
that "gethostbyaddr()" will succeed if handed an IP address with no
corresponding name - and it looks as if FreeBSD 3.2, at least, may not
succeed in that case).
Add a "dfilter_fail()" routine that takes "printf()"-like arguments and
uses them to set an error message for the parse; doing so means that
even if the filter expression is syntactically valid, we treat it as
being invalid. (Is there a better way to force a parse to fail from
arbitrary places in routines called by the parser?)
Use that routine in the lexical analyzer.
If that error message was set, use it as is as the failure message,
rather than adding "Unable to parse filter string XXX" to it.
Have the code to handle IP addresses and host names in display filters
check whether "get_host_ipaddr()" succeeded or failed and, if it failed,
arrange that the parse fail with an error message indicating the source
of the problem.
svn path=/trunk/; revision=802
1999-10-11 03:03:12 +00:00
|
|
|
gboolean get_host_ipaddr(const char *host, guint32 *addrp);
|
1999-07-07 22:52:57 +00:00
|
|
|
|
2009-12-24 00:58:31 +00:00
|
|
|
/** Translates a string representing a hostname or colon-hex IPv6 address
|
|
|
|
* into a numeric IPv6 address value in network byte order. If compiled with
|
|
|
|
* c-ares, the request will wait a maximum of 250ms for the request to finish.
|
|
|
|
* Otherwise the wait time will be system-dependent, usually much longer.
|
2009-12-24 17:21:02 +00:00
|
|
|
* Immediately returns FALSE for hostnames if network name resolution is
|
|
|
|
* disabled.
|
2009-12-24 00:58:31 +00:00
|
|
|
*
|
|
|
|
* @param[in] host The hostname.
|
|
|
|
* @param[out] addrp The numeric IPv6 address in network byte order.
|
|
|
|
* @return TRUE on success, FALSE on failure or timeout.
|
1999-10-15 03:11:52 +00:00
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
1999-10-15 03:11:52 +00:00
|
|
|
gboolean get_host_ipaddr6(const char *host, struct e_in6_addr *addrp);
|
|
|
|
|
2004-06-25 07:00:54 +00:00
|
|
|
/*
|
|
|
|
* Find out whether a hostname resolves to an ip or ipv6 address
|
|
|
|
* Return "ip6" if it is IPv6, "ip" otherwise (including the case
|
|
|
|
* that we don't know)
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2004-06-25 07:00:54 +00:00
|
|
|
const char* host_ip_af(const char *host);
|
|
|
|
|
2013-08-01 20:11:13 +00:00
|
|
|
WS_DLL_PUBLIC
|
|
|
|
GHashTable *get_manuf_hashtable(void);
|
|
|
|
|
|
|
|
WS_DLL_PUBLIC
|
|
|
|
GHashTable *get_wka_hashtable(void);
|
|
|
|
|
2013-08-02 15:05:00 +00:00
|
|
|
WS_DLL_PUBLIC
|
|
|
|
GHashTable *get_eth_hashtable(void);
|
|
|
|
|
2013-08-05 16:36:24 +00:00
|
|
|
WS_DLL_PUBLIC
|
|
|
|
GHashTable *get_serv_port_hashtable(void);
|
|
|
|
|
2013-08-20 05:06:26 +00:00
|
|
|
WS_DLL_PUBLIC
|
2013-12-20 06:30:13 +00:00
|
|
|
GHashTable *get_ipxnet_hash_table(void);
|
2013-08-20 05:06:26 +00:00
|
|
|
|
2013-08-11 19:02:26 +00:00
|
|
|
WS_DLL_PUBLIC
|
|
|
|
GHashTable *get_ipv4_hash_table(void);
|
|
|
|
|
2013-08-18 19:02:48 +00:00
|
|
|
WS_DLL_PUBLIC
|
|
|
|
GHashTable *get_ipv6_hash_table(void);
|
|
|
|
|
2013-08-07 16:46:08 +00:00
|
|
|
/*
|
|
|
|
* private functions (should only be called by epan directly)
|
|
|
|
*/
|
2013-08-01 20:11:13 +00:00
|
|
|
|
2013-08-07 16:46:08 +00:00
|
|
|
WS_DLL_LOCAL
|
|
|
|
void name_resolver_init(void);
|
|
|
|
|
|
|
|
/* (Re)Initialize hostname resolution subsystem */
|
|
|
|
WS_DLL_LOCAL
|
|
|
|
void host_name_lookup_init(void);
|
|
|
|
|
|
|
|
/* Clean up only hostname resolutions (so they don't "leak" from one
|
|
|
|
* file to the next).
|
|
|
|
*/
|
|
|
|
WS_DLL_LOCAL
|
|
|
|
void host_name_lookup_cleanup(void);
|
|
|
|
|
|
|
|
WS_DLL_LOCAL
|
|
|
|
void addr_resolv_init(void);
|
|
|
|
|
|
|
|
WS_DLL_LOCAL
|
|
|
|
void addr_resolv_cleanup(void);
|
2013-08-01 20:11:13 +00:00
|
|
|
|
2013-10-23 12:02:15 +00:00
|
|
|
WS_DLL_PUBLIC
|
2013-10-23 14:04:19 +00:00
|
|
|
void manually_resolve_cleanup(void);
|
2013-10-23 12:02:15 +00:00
|
|
|
|
2013-12-21 16:16:56 +00:00
|
|
|
gboolean str_to_ip(const char *str, void *dst);
|
|
|
|
gboolean str_to_ip6(const char *str, void *dst);
|
|
|
|
|
2007-01-18 18:43:30 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
1998-09-16 02:39:15 +00:00
|
|
|
#endif /* __RESOLV_H__ */
|