[hipl-commit] [trunk] Rev 3610: Doxygen for helpers.c

  • From: Miika Komu <miika@xxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Thu, 11 Feb 2010 19:12:32 +0200

Committer: Miika Komu <miika@xxxxxx>
Date: Thu Feb 11 19:12:30 2010 +0200
Revision: 3610
Revision-id: miika@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  Doxygen for helpers.c

Modified:
  M  firewall/helpers.c

=== modified file 'firewall/helpers.c'
--- firewall/helpers.c  2010-02-11 16:17:35 +0000
+++ firewall/helpers.c  2010-02-11 17:12:30 +0000
@@ -1,3 +1,15 @@
+/**
+ * @file firewall/helpers.c
+ *
+ * Distributed under <a href="http://www.gnu.org/licenses/gpl2.txt";>GNU/GPL</a>
+ *
+ * @brief Few "utility" functions for the firewall
+ *
+ * @author Essi Vehmersalo
+ *
+ * @todo the actual utility of this file seems questionable (should be removed)
+ **/
+
 #include <linux/types.h>
 #include <limits.h>
 #include <linux/netfilter_ipv6.h>
@@ -5,7 +17,16 @@
 #include "helpers.h"
 
 /**
- * get char* out of in6_addr
+ * A wrapper for inet_ntop(). Converts a numeric IPv6 address to a string.
+ *
+ * @param addrp an IPv6 address to be converted to a string
+ *
+ * @return A static pointer to a string containing the the IPv6 address.
+ *         Caller must not try to deallocate. On error, returns NULL and sets
+ *         errno (see man inet_ntop).
+ *
+ * @note this function is not re-entrant and should not be used with threads
+ *
  */
 char *addr_to_numeric(const struct in6_addr *addrp)
 {
@@ -14,7 +35,15 @@
 }
 
 /**
- * get in6_addr out of char*
+ * A wrapper for inet_pton(). Converts a string to a numeric IPv6 address
+ *
+ * @param num the string to be converted into an in6_addr structure
+ *
+ * @return A static pointer to an in6_addr structure corresponding to the
+ *         given "num" string. Caller must not try to deallocate.
+ *         On error, returns NULL and sets errno (see man inet_ntop).
+ *
+ * @note this function is not re-entrant and should not be used with threads
  */
 struct in6_addr *numeric_to_addr(const char *num)
 {

Other related posts:

  • » [hipl-commit] [trunk] Rev 3610: Doxygen for helpers.c - Miika Komu