summaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2009-09-04 23:07:57 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2009-09-04 23:07:57 +0200
commit0695956b4b419beaf1b596d69243c09d00bfa9f7 (patch)
tree5857964f028654544b81eaa8962f205caeb6b7cd /plugin
parentdea39103b369f0903be326c505d36a9d489a0c1e (diff)
downloadeurephia-0695956b4b419beaf1b596d69243c09d00bfa9f7.tar.gz
eurephia-0695956b4b419beaf1b596d69243c09d00bfa9f7.tar.xz
eurephia-0695956b4b419beaf1b596d69243c09d00bfa9f7.zip
Even more comments
Diffstat (limited to 'plugin')
-rw-r--r--plugin/eurephia.h9
-rw-r--r--plugin/eurephiadb_session.h9
-rw-r--r--plugin/firewall/eurephiafw.h16
-rw-r--r--plugin/firewall/eurephiafw_helpers.h18
-rw-r--r--plugin/firewall/eurephiafw_intf.h10
-rw-r--r--plugin/firewall/eurephiafw_struct.h44
6 files changed, 83 insertions, 23 deletions
diff --git a/plugin/eurephia.h b/plugin/eurephia.h
index 3b4c8ba..95e6b98 100644
--- a/plugin/eurephia.h
+++ b/plugin/eurephia.h
@@ -19,6 +19,15 @@
*
*/
+/**
+ * @file eurephia.h
+ * @author David Sommerseth <dazo@users.sourceforge.net>
+ * @date 2008-08-06
+ *
+ * @brief The core eurephia functions which is called from OpenVPN.
+ *
+ */
+
#ifndef EUREPHIA_H_
#define EUREPHIA_H_
diff --git a/plugin/eurephiadb_session.h b/plugin/eurephiadb_session.h
index ebdb1bb..af827ad 100644
--- a/plugin/eurephiadb_session.h
+++ b/plugin/eurephiadb_session.h
@@ -19,6 +19,15 @@
*
*/
+/**
+ * @file eurephiadb_session.h
+ * @author David Sommerseth <dazo@users.sourceforge.net>
+ * @date 2008-08-06
+ *
+ * @brief Handles creating user sessions, which is unique per openvpn connection.
+ *
+ */
+
#ifndef EUREPHIADB_SESSION_H_
# define EUREPHIADB_SESSION_H_
diff --git a/plugin/firewall/eurephiafw.h b/plugin/firewall/eurephiafw.h
index 4c837e5..860411b 100644
--- a/plugin/firewall/eurephiafw.h
+++ b/plugin/firewall/eurephiafw.h
@@ -19,12 +19,22 @@
*
*/
+/**
+ * @file eurephiafw.h
+ * @author David Sommerseth <dazo@users.sourceforge.net>
+ * @date 2008-08-10
+ *
+ * @brief Takes care of loading the configured firewall driver and provides a
+ * generic API for updating the firewall rules.
+ *
+ */
+
#ifndef EUREPHIAFW_H_
#define EUREPHIAFW_H_
-#define FWRULE_ADD 0x101
-#define FWRULE_DELETE 0x102
-#define FWRULE_BLACKLIST 0x103
+#define FWRULE_ADD 0x101 /**< Add a new firewall rule */
+#define FWRULE_DELETE 0x102 /**< Delete an existing firewall rule */
+#define FWRULE_BLACKLIST 0x103 /**< Blacklist an IP address in the firewall */
int eFW_load(eurephiaCTX *ctx, const char *intf);
int eFW_unload(eurephiaCTX *ctx);
diff --git a/plugin/firewall/eurephiafw_helpers.h b/plugin/firewall/eurephiafw_helpers.h
index aa00307..7ba93bb 100644
--- a/plugin/firewall/eurephiafw_helpers.h
+++ b/plugin/firewall/eurephiafw_helpers.h
@@ -20,13 +20,23 @@
*
*/
+/**
+ * @file eurephiafw_helpers.h
+ * @author David Sommerseth <dazo@users.sourceforge.net>
+ * @date 2009-08-14
+ *
+ * @brief Helper functions which is shared between the main eurephia-auth module and
+ * the firewall module. It takes care of preparing POSIX MQ queues and semaphores.
+ *
+ */
+
#ifndef EUREPHIAFW_HELPERS_H_
#define EUREPHIAFW_HELPERS_H_
-#define EFW_MSG_SIZE 1024
-#define MQUEUE_NAME "/eurephiaFW"
-#define SEMPH_MASTER "eurephiafw_master"
-#define SEMPH_WORKER "eurephiafw_worker"
+#define EFW_MSG_SIZE 1024 /**< Maximum size of a message in the POSIX MQ queue */
+#define MQUEUE_NAME "/eurephiaFW" /**< Name of the MQ queue */
+#define SEMPH_MASTER "eurephiafw_master" /**< Name of the semaphore the main openvpn process uses */
+#define SEMPH_WORKER "eurephiafw_worker" /**< Name of the semaphore the firewall process uses */
int efwSetupSemaphores(eurephiaCTX *, efw_threaddata *);
int efwRemoveSemaphores(eurephiaCTX *, efw_threaddata *);
diff --git a/plugin/firewall/eurephiafw_intf.h b/plugin/firewall/eurephiafw_intf.h
index df395d0..c4fc065 100644
--- a/plugin/firewall/eurephiafw_intf.h
+++ b/plugin/firewall/eurephiafw_intf.h
@@ -19,6 +19,16 @@
*
*/
+/**
+ * @file eurephiafw_intf.h
+ * @author David Sommerseth <dazo@users.sourceforge.net>
+ * @date 2008-08-10
+ *
+ * @brief Declaration of the firewall driver API
+ *
+ */
+
+
#ifndef EUREPHIAFW_INTF_H_
#define EUREPHIAFW_INTF_H_
diff --git a/plugin/firewall/eurephiafw_struct.h b/plugin/firewall/eurephiafw_struct.h
index a385c13..dc7df59 100644
--- a/plugin/firewall/eurephiafw_struct.h
+++ b/plugin/firewall/eurephiafw_struct.h
@@ -19,6 +19,16 @@
*
*/
+/**
+ * @file eurephiafw_struct.h
+ * @author David Sommerseth <dazo@users.sourceforge.net>
+ * @date 2008-11-05
+ *
+ * @brief Declaraion of the constants and structs the firewall interface uses
+ *
+ */
+
+
#ifndef EUREPHIAFW_STRUCT_H_
#define EUREPHIAFW_STRUCT_H_
@@ -27,26 +37,28 @@
#include <eurephia_values_struct.h>
-//
-// structs used by the firewall interface
-//
+/**
+ * Important variables for the firewall updater process. They are sent to the
+ * firewall process during the process forking.
+ */
typedef struct {
- mqd_t msgq;
- sem_t *semp_worker;
- sem_t *semp_master;
- char *fw_command;
- void *ctx;
+ mqd_t msgq; /**< MQ descriptor */
+ sem_t *semp_worker; /**< semaphore descriptor for the firewall process */
+ sem_t *semp_master; /**< semaphore descriptor for the main openvpn process */
+ char *fw_command; /**< string (char *) with full path to the firewall update command */
+ void *ctx; /**< A "shadow" eurephiaCTX used for allowing shared logging */
} efw_threaddata;
+/**
+ * Definition of the eurephiaFWINTF struct
+ */
typedef struct {
- efw_threaddata thrdata;
- pid_t fwproc_pid;
-
- // Where to update firewall if we block blackisted
- // IP addr in firewall too
- char *fwblacklist;
- char *fwblacklist_sendto;
- eurephiaVALUES *blacklisted; // Contains all IP addresses we have blacklisted
+ efw_threaddata thrdata; /**< Process related information */
+ pid_t fwproc_pid; /**< Contains the PID of the firewall process */
+
+ char *fwblacklist; /**< Which fw dest. blacklisted IP addr should be registered into */
+ char *fwblacklist_sendto; /**< Which fw dest. blacklisted IP addr should forward their hits to. t */
+ eurephiaVALUES *blacklisted; /**< Contains all IP addresses we have blacklisted */
} eurephiaFWINTF;
#endif /* !EUREPHIAFW_STRUCT_H_ */