[hipl-commit] [trunk] Rev 3550: Doxygen for conndb.c

  • From: Miika Komu <miika@xxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Mon, 8 Feb 2010 14:28:35 +0200

Committer: Miika Komu <miika@xxxxxx>
Date: Mon Feb 08 14:28:34 2010 +0200
Revision: 3550
Revision-id: miika@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  Doxygen for conndb.c

Modified:
  D  firewall/conndb.c.doxyme
  M  firewall/conndb.c

=== modified file 'firewall/conndb.c'
--- firewall/conndb.c   2010-02-08 12:18:37 +0000
+++ firewall/conndb.c   2010-02-08 12:28:34 +0000
@@ -1,5 +1,18 @@
-/*
- * HIP proxy connection tracking
+/**
+ * @file firewall/conndb.c
+ *
+ * Distributed under <a 
href="http://www.gnu.org/licenses/gpl2.txt";>GNU/GPL</a>.
+ *
+ * Connection database for clien-side HIP proxy. Operates only when
+ * the proxy mode is enabled.  Documented in more detail in <a
+ * href="http://hipl.hiit.fi/index.php?index=publications";>Weiwei
+ * Hu, HIP Proxy, to be completed during 2010</a>
+ *
+ * @brief Connection database for client-side HIP proxy
+ *
+ * @todo rename this file and associated functions to proxy_xx to avoid 
confusion with conntrack.c
+ *
+ * @author Weiwei Hu
  */
 #include <sys/types.h>
 #include <unistd.h>
@@ -24,11 +37,13 @@
 
 static HIP_HASHTABLE *hip_conn_db = NULL;
 
-/** A callback wrapper of the prototype required by @c lh_new(). */
-//static IMPLEMENT_LHASH_HASH_FN(hip_hash_proxy_db, const hip_proxy_t *)
-/** A callback wrapper of the prototype required by @c lh_new(). */
-//static IMPLEMENT_LHASH_COMP_FN(hip_compare_conn_db, const hip_conn_t *)
 
+/**
+ * Create a hash of the given entry for the hash table
+ *
+ * @param p the connection entry
+ * @return a hash calculated based on the given entry
+ **/
 unsigned long hip_conn_db_hash(const hip_conn_t *p)
 {
        uint8_t hash[HIP_AH_SHA_LEN];
@@ -45,6 +60,13 @@
 /** A callback wrapper of the prototype required by @c lh_new(). */
 static IMPLEMENT_LHASH_HASH_FN(hip_conn_db, const hip_conn_t)
 
+/**
+ * Compare two hash keys
+ *
+ * @param ha1 first hash key
+ * @param ha2 second hash key
+ * @return zero if keys match or one otherwise
+ **/
 int hip_conn_db_cmp(const hip_conn_t *ha1, const hip_conn_t *ha2)
 {
        if(ha1 == NULL || &(ha1->key) == NULL || &(ha1->addr_client) == NULL || 
&(ha1->addr_peer) == NULL ||
@@ -59,6 +81,9 @@
 /** A callback wrapper of the prototype required by @c lh_new(). */
 static IMPLEMENT_LHASH_COMP_FN(hip_conn_db, const hip_conn_t)
 
+/**
+ * Initialize the proxy database
+ **/
 void hip_init_conn_db(void)
 {
        /** @todo Check for errors. */
@@ -67,6 +92,9 @@
                                  LHASH_COMP_FN(hip_conn_db));
 }
 
+/**
+ * Unitialize the proxy database
+ **/
 void hip_uninit_conn_db(void)
 {
        int i = 0;
@@ -83,6 +111,19 @@
 
 }
 
+/**
+ * Add an entry to the connection database of the HIP proxy
+ *
+ * @param addr_client Addess of the legacy client
+ * @param addr_peer Address of the HIP server (responder)
+ * @param hit_proxy HIT of the local HIP proxy (initiator)
+ * @param hit_peer HIT of the HIP server (responder)
+ * @param protocol protocol of the current packet being translated 
(IPPROTO_TCP, etc)
+ * @param port_client TCP or UDP port of the legacy client
+ * @param port_peer TCP or UDP port of the server (responder)
+ * @param state HIP association state
+ * @return zero on success or non-zero on failure
+ **/
 int hip_conn_add_entry(const struct in6_addr *addr_client, 
                       const struct in6_addr *addr_peer,
                       const struct in6_addr *hit_proxy, 
@@ -124,6 +165,16 @@
 }
 
 
+/**
+ * Find the proxy database entry corresponding to packet's port numbers
+ *
+ * @param hit_proxy HIT of the local proxy (initiator) 
+ * @param hit_peer HIT of the server (responder)
+ * @param protocol protocol (IPPROTO_TCP etc) of the packet
+ * @param port_client transport protocol port of the legacy client
+ * @param port_peer transport protocol port of the server (responder)
+ * @return the database entry if found or otherwise NULL
+ **/
 hip_conn_t *hip_conn_find_by_portinfo(const struct in6_addr *hit_proxy,
                                      const struct in6_addr *hit_peer,
                                      const int protocol,

=== removed file 'firewall/conndb.c.doxyme'
--- firewall/conndb.c.doxyme    2009-12-12 10:44:54 +0000
+++ firewall/conndb.c.doxyme    1970-01-01 00:00:00 +0000
@@ -1,101 +0,0 @@
-/**
- * @file firewall/conndb.c
- *
- * <LICENSE TEMLPATE LINE - LEAVE THIS LINE INTACT>
- *
- * Write description of source file here for dOxygen. Be as precise as 
possible.
- * Please also note how and by which parts of the code this file should be 
used.
- *
- * @brief Write a short summary
- *
- * @author <Put all existing author information here>
- * @author another Author another@xxxxxxxxxx
- **/
-
-
-
- ///  Single line comment for dOxygen.
-
-/**
- * my_great_function
- *
- * Write description of function here.
- * The function should follow these comments.
- * 
- * Document the use of each function variable and indicate if this
- * argument is used to return information to the calling context. Use
- * [out] for outut parameters (This is very important). Align the 
- * descriptions to improve readability.
- *
- *  @note: put important usage informations to notes. 
- *
- *  @param      firstArg     Description of first function argument.
- *  @param[out] secondArg    Description of second function argument.
- *  @param      thirdArg     Description of third function argument.
- *  @return Description of returned value.
- **/
-
-int my_great_function(int firstArg, char** secondArg, int thirdArg){
-    .....
-
-/// Now it's your turn.
-
-
-
-
-/**
- * hip_conn_add_entry 
- *
- *
- * @param addr_client
- * @param addr_peer
- * @param hit_proxy
- * @param hit_peer
- * @param protocol
- * @param port_client
- * @param port_peer
- * @param state
- * @return 
- **/
-
-
-/**
- * hip_conn_db_cmp 
- *
- *
- * @param ha1
- * @param ha2
- * @return 
- **/
-
-
-/**
- * hip_conn_db_hash 
- *
- *
- * @param tcp
- * @return 
- **/
-
-
-/**
- * hip_conn_find_by_portinfo 
- *
- *
- * @param hit_proxy
- * @param hit_peer
- * @param protocol
- * @param port_client
- * @param port_peer
- * @return 
- **/
-
-
-/**
- * hip_init_conn_db 
- *
- *
- * @param void
- * @return 
- **/
-

Other related posts:

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