summaryrefslogtreecommitdiffstats
path: root/plugin/firewall/eurephiafw_struct.h
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2009-11-09 20:07:36 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2009-11-09 20:07:36 +0100
commit8a3c00f570f512a898bc6dc33bf64c95ee1283b4 (patch)
tree32724205353edffb3038042db59a7b5caa71d589 /plugin/firewall/eurephiafw_struct.h
parentcf6bc9dddc1484dd10fc068eb4af18ae57043cc4 (diff)
downloadeurephia-8a3c00f570f512a898bc6dc33bf64c95ee1283b4.tar.gz
eurephia-8a3c00f570f512a898bc6dc33bf64c95ee1283b4.tar.xz
eurephia-8a3c00f570f512a898bc6dc33bf64c95ee1283b4.zip
Changed main firewall implementation to use eFWupdateRequest struct
All functions calling eFW_UpdateFirewall() and the iptables driver needs to be updated as well.
Diffstat (limited to 'plugin/firewall/eurephiafw_struct.h')
-rw-r--r--plugin/firewall/eurephiafw_struct.h32
1 files changed, 26 insertions, 6 deletions
diff --git a/plugin/firewall/eurephiafw_struct.h b/plugin/firewall/eurephiafw_struct.h
index dc7df59..10fd630 100644
--- a/plugin/firewall/eurephiafw_struct.h
+++ b/plugin/firewall/eurephiafw_struct.h
@@ -29,8 +29,8 @@
*/
-#ifndef EUREPHIAFW_STRUCT_H_
-#define EUREPHIAFW_STRUCT_H_
+#ifndef EUREPHIAFW_STRUCT_H_
+#define EUREPHIAFW_STRUCT_H_
#include <mqueue.h>
#include <semaphore.h>
@@ -53,12 +53,32 @@ typedef struct {
* Definition of the eurephiaFWINTF struct
*/
typedef struct {
- efw_threaddata thrdata; /**< Process related information */
- pid_t fwproc_pid; /**< Contains the PID of the firewall process */
+ 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 */
+ char *fwblacklist_sendto; /**< Which fw dest. blacklisted IP addr should forward their hits to */
eurephiaVALUES *blacklisted; /**< Contains all IP addresses we have blacklisted */
} eurephiaFWINTF;
-#endif /* !EUREPHIAFW_STRUCT_H_ */
+
+/**
+ * Valid firewall modes to be passed over the POSIX MQ queue
+ */
+typedef enum {fwADD, /**< Add a new VPN client to the firewall VPN chain */
+ fwDELETE, /**< Delete an existing VPN client from the firewall VPN chain */
+ fwBLACKLIST, /**< Blacklist an IP address */
+ fwFLUSH, /**< Flush the firewall VPN chain */
+ fwINITIALISE, /**< Initialiase the firewall VPN chain */
+ fwSHUTDOWN, /**< Initialiase the firewall VPN chain */
+} eFWmode;
+
+typedef struct {
+ eFWmode mode; /**< Defines what the update will do with the firewall (mandatory) */
+ char ipaddress[36]; /**< IP address to include (used by fwADD,fwDELETE and fwBLACKLIST) */
+ char macaddress[19]; /**< VPN MAC address (used by fwADD and fwDELETE) */
+ char rule_destination[66]; /**< Where this new rule will be inserted (mandatory) */
+ char goto_destination[66]; /**< Where matching rules should go next (used by fwBLACKLIST) */
+} eFWupdateRequest;
+
+#endif /* !EUREPHIAFW_STRUCT_H_ */