summaryrefslogtreecommitdiffstats
path: root/plugin/eurephiadb_session.c
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2009-09-02 18:53:29 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2009-09-02 18:53:29 +0200
commit201677bb8b384306e09a84c90b7f18fbc879d626 (patch)
tree5cc38d970fac454b56d2c4e200afcffb19526591 /plugin/eurephiadb_session.c
parent2754156ff156fbb200ce2b36444e2f315f42583c (diff)
Added doxygen comments
Diffstat (limited to 'plugin/eurephiadb_session.c')
-rw-r--r--plugin/eurephiadb_session.c40
1 files changed, 37 insertions, 3 deletions
diff --git a/plugin/eurephiadb_session.c b/plugin/eurephiadb_session.c
index f6744e0..d6cd2b2 100644
--- a/plugin/eurephiadb_session.c
+++ b/plugin/eurephiadb_session.c
@@ -19,6 +19,16 @@
*
*/
+/**
+ * @file eurephiadb_session.c
+ * @author David Sommerseth <dazo@users.sourceforge.net>
+ * @date 2008-08-06
+ *
+ * @brief Handles creating user sessions, which is unique per openvpn connection.
+ *
+ */
+
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -45,8 +55,21 @@ extern int (*eDBregister_sessionkey) (eurephiaCTX *ctx, const char *seed, const
extern eurephiaVALUES *(*eDBload_sessiondata) (eurephiaCTX *ctx, const char *sesskey);
-// Generates a new session structure. Session key will be created if session seed (input params) are not known.
-// If session seed is known, the already generated session key will be used.
+/**
+ * Generates a new eurephia session. Session key will be created if session seed (input params)
+ * are not known. If session seed is known, the already generated session key will be used.
+ *
+ * @param ctx eurephiaCTX
+ * @param digest Contains the clients SHA1 fingerprint / digest
+ * @param cname Contains the clients X.509 Common Name field
+ * @param username The user name of the client
+ * @param vpnipaddr The IP address of the VPN connection of the client
+ * @param vpnipmask The IP address' network mask
+ * @param remipaddr The public IP address the client is connecting from
+ * @param remport The remote port of the client connection
+ *
+ * @return returns a eurephiaSESSION pointer on success, otherwise NULL.
+ */
eurephiaSESSION *eDBopen_session_seed(eurephiaCTX *ctx, const char *digest,
const char *cname, const char *username,
const char *vpnipaddr, const char *vpnipmask,
@@ -228,7 +251,18 @@ eurephiaSESSION *eDBopen_session_seed(eurephiaCTX *ctx, const char *digest,
return new_session;
}
-// Open an existing session based on a MAC address
+
+/**
+ * Open an existing eurephia session based on a MAC address. This function is only used
+ * when there is not enough information to generate a session seed and when the MAC address
+ * is available. Usually this only happens when the client has disconnected and the session
+ * is about to be marked as closed.
+ *
+ * @param ctx eurephiaCTX
+ * @param macaddr MAC address of the client
+ *
+ * @return returns a eurephiaSESSION pointer on success, otherwise NULL.
+ */
eurephiaSESSION *eDBopen_session_macaddr(eurephiaCTX *ctx, const char *macaddr) {
eurephiaSESSION *new_session = NULL;