Include config.h first; it defines _FILE_OFFSET_BITS, and if some system
[metze/wireshark/wip.git] / epan / addr_resolv.h
index 9a09acc955a23276eb34c8cafecaee66a211a89d..afe269166f407b70957026f666c9144af6d01232 100644 (file)
@@ -70,6 +70,19 @@ typedef struct serv_port {
   gchar            *dccp_name;
 } serv_port_t;
 
+/*
+ * XXX Some of this is duplicated in addrinfo_list. We may want to replace the
+ * addr and name parts with a struct addrinfo or create our own addrinfo-like
+ * struct that simply points to the data below.
+ */
+typedef struct hashipv4 {
+  guint             addr;
+  gboolean          is_dummy_entry; /* name is IPv4 address in dot format */
+  gboolean          resolve;        /* already tried to resolve it */
+  gchar             ip[16];
+  gchar             name[MAXNAMELEN];
+} hashipv4_t;
+
 /*
  * Flag controlling what names to resolve.
  */
@@ -137,9 +150,6 @@ void get_addr_name_buf(const address *addr, gchar *buf, gsize size);
 struct pref_module;
 extern void addr_resolve_pref_init(struct pref_module *nameres);
 
-/* host_name_lookup_init fires up an ADNS socket if we're using ADNS */
-extern void host_name_lookup_init(void);
-
 /** 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.
@@ -149,9 +159,6 @@ extern void host_name_lookup_init(void);
  */
 WS_DLL_PUBLIC gboolean host_name_lookup_process(void);
 
-/* host_name_lookup_cleanup cleans up an ADNS socket if we're using ADNS */
-extern void host_name_lookup_cleanup(void);
-
 /* get_hostname returns the host name or "%d.%d.%d.%d" if not found */
 WS_DLL_PUBLIC const gchar *get_hostname(const guint addr);
 
@@ -325,10 +332,30 @@ WS_DLL_PUBLIC
 GHashTable *get_serv_port_hashtable(void);
 
 WS_DLL_PUBLIC
-void initialize_ethers(void);
+GHashTable *get_ipv4_hash_table(void);
 
-WS_DLL_PUBLIC
-void eth_name_lookup_cleanup(void);
+/*
+ * private functions (should only be called by epan directly)
+ */
+
+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);
 
 #ifdef __cplusplus
 }