warning fix: guint16 is always <= 0xFFFF
[obnox/wireshark/wip.git] / epan / addr_resolv.h
index a9276ea9cba85347cd3762bba565d88337052b60..89eca39498ae1f8095be56697abe7b2b914d0887 100644 (file)
@@ -5,8 +5,8 @@
  *
  * 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__
@@ -75,20 +82,36 @@ extern gchar *get_udp_port(guint port);
 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
  */
@@ -96,8 +119,8 @@ const gchar *get_addr_name(address *addr);
 /* 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 */
@@ -121,6 +144,9 @@ extern gchar *get_ether_name_if_known(const guint8 *addr);
 /* 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);