start and route connections defined in an SQL database via start_action field and ipsec up %startall command

This commit is contained in:
Andreas Steffen
2010-11-28 11:57:49 +01:00
parent 25be47b431
commit c616d84c3f
14 changed files with 116 additions and 32 deletions
+15 -3
View File
@@ -79,6 +79,11 @@ struct private_child_cfg_t {
*/
ipsec_mode_t mode;
/**
* action to take to start CHILD_SA
*/
action_t start_action;
/**
* action to take on DPD
*/
@@ -375,6 +380,12 @@ METHOD(child_cfg_t, get_mode, ipsec_mode_t,
return this->mode;
}
METHOD(child_cfg_t, get_start_action, action_t,
private_child_cfg_t *this)
{
return this->start_action;
}
METHOD(child_cfg_t, get_dpd_action, action_t,
private_child_cfg_t *this)
{
@@ -478,9 +489,9 @@ METHOD(child_cfg_t, destroy, void,
*/
child_cfg_t *child_cfg_create(char *name, lifetime_cfg_t *lifetime,
char *updown, bool hostaccess,
ipsec_mode_t mode, action_t dpd_action,
action_t close_action, bool ipcomp,
u_int32_t inactivity, u_int32_t reqid,
ipsec_mode_t mode, action_t start_action,
action_t dpd_action, action_t close_action,
bool ipcomp, u_int32_t inactivity, u_int32_t reqid,
mark_t *mark_in, mark_t *mark_out)
{
private_child_cfg_t *this;
@@ -496,6 +507,7 @@ child_cfg_t *child_cfg_create(char *name, lifetime_cfg_t *lifetime,
.get_updown = _get_updown,
.get_hostaccess = _get_hostaccess,
.get_mode = _get_mode,
.get_start_action = _get_start_action,
.get_dpd_action = _get_dpd_action,
.get_close_action = _get_close_action,
.get_lifetime = _get_lifetime,
+15 -6
View File
@@ -32,14 +32,15 @@ typedef struct child_cfg_t child_cfg_t;
#include <kernel/kernel_ipsec.h>
/**
* Action to take when DPD detected/connection gets closed by peer.
* Action to take when connection is loaded, DPD is detected or
* connection gets closed by peer.
*/
enum action_t {
/** No action */
ACTION_NONE,
/** Route config to reestablish on demand */
/** Route config to establish or reestablish on demand */
ACTION_ROUTE,
/** Restart config immediately */
/** Start or restart config immediately */
ACTION_RESTART,
};
@@ -168,6 +169,13 @@ struct child_cfg_t {
*/
ipsec_mode_t (*get_mode) (child_cfg_t *this);
/**
* Action to take to start CHILD_SA.
*
* @return start action
*/
action_t (*get_start_action) (child_cfg_t *this);
/**
* Action to take on DPD.
*
@@ -276,6 +284,7 @@ struct child_cfg_t {
* @param updown updown script to execute on up/down event
* @param hostaccess TRUE to allow access to the local host
* @param mode mode to propose for CHILD_SA, transport, tunnel or BEET
* @param start_action start action
* @param dpd_action DPD action
* @param close_action close action
* @param ipcomp use IPComp, if peer supports it
@@ -287,9 +296,9 @@ struct child_cfg_t {
*/
child_cfg_t *child_cfg_create(char *name, lifetime_cfg_t *lifetime,
char *updown, bool hostaccess,
ipsec_mode_t mode, action_t dpd_action,
action_t close_action, bool ipcomp,
u_int32_t inactivity, u_int32_t reqid,
ipsec_mode_t mode, action_t start_action,
action_t dpd_action, action_t close_action,
bool ipcomp, u_int32_t inactivity, u_int32_t reqid,
mark_t *mark_in, mark_t *mark_out);
#endif /** CHILD_CFG_H_ @}*/