diff options
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_ */ |