*
* Laurent Deniel <laurent.deniel@free.fr>
*
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+/* The buffers returned by these functions are all allocated with a
+ * packet lifetime and does not have have to be freed.
+ * 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.
+ */
#ifndef __RESOLV_H__
#define __RESOLV_H__
extern gchar *get_tcp_port(guint port);
/*
- * get_sctp_port() returns the port name corresponding to that SCTP port,
+ * 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_sctp_port(guint port);
+extern gchar *get_dccp_port(guint port);
/*
- * For address types that support name resolution, and for AT_STRINGZ,
- * "get_addr_name()" returns the name corresponding to the address,
- * or a string for the address if not found.
- *
- * For other address types, it returns a null pointer.
+ * get_sctp_port() returns the port name corresponding to that SCTP port,
+ * or the port number as a string if not found.
*/
+extern gchar *get_sctp_port(guint port);
+
+/* 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" */
+/* - if the address is of any other type, the result of address_to_str on the argument, */
+/* which should be a string representation for the answer -e.g. "10.10.10.10" for IPv4 */
+/* address 10.10.10.10 */
+
const gchar *get_addr_name(address *addr);
+/* get_addr_name_buf solves an address in the same way as get_addr_name above */
+/* The difference is that get_addr_name_buf takes as input a buffer, in which it puts */
+/* the result, and a maximum string length -size-. the buffer should be large enough to */
+/* contain size characters plus the terminator */
+
+void get_addr_name_buf(address *addr, gchar *buf, guint size);
+
+
/*
* Asynchronous host name lookup initialization, processing, and cleanup
*/
/* host_name_lookup_init fires up an ADNS socket if we're using ADNS */
extern void host_name_lookup_init(void);
-/* host_name_lookup_process does ADNS processing in GTK+ timeouts in Ethereal,
- and before processing each packet in Tethereal, if we're using ADNS */
+/* host_name_lookup_process does ADNS processing in GTK+ timeouts in Wireshark,
+ and before processing each packet in TShark, if we're using ADNS */
extern gint host_name_lookup_process(gpointer data);
/* host_name_lookup_cleanup cleans up an ADNS socket if we're using ADNS */
/* get_manuf_name returns the vendor name or "%02x:%02x:%02x" if not known */
extern const gchar *get_manuf_name(const guint8 *addr);
+/* get_manuf_name returns the vendor name or NULL if not known */
+extern const gchar *get_manuf_name_if_known(const guint8 *addr);
+
/* get_ipxnet_name returns the logical name if found in an ipxnets file,
* or a string formatted with "%X" if not */
extern const gchar *get_ipxnet_name(const guint32 addr);