diff options
| author | David Sommerseth <dazo@users.sourceforge.net> | 2009-11-09 20:07:36 +0100 |
|---|---|---|
| committer | David Sommerseth <dazo@users.sourceforge.net> | 2009-11-09 20:07:36 +0100 |
| commit | 8a3c00f570f512a898bc6dc33bf64c95ee1283b4 (patch) | |
| tree | 32724205353edffb3038042db59a7b5caa71d589 /plugin/firewall/eurephiafw_struct.h | |
| parent | cf6bc9dddc1484dd10fc068eb4af18ae57043cc4 (diff) | |
| download | eurephia-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.h | 32 |
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_ */ |
