Support manually-set IPsec policy priorities
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Andreas Steffen
|
||||
* Copyright (C) 2008-2016 Tobias Brunner
|
||||
* Copyright (C) 2005-2007 Martin Willi
|
||||
* Copyright (C) 2005 Jan Hutter
|
||||
@@ -132,6 +133,11 @@ struct private_child_cfg_t {
|
||||
*/
|
||||
uint32_t tfc;
|
||||
|
||||
/**
|
||||
* Optional manually-set IPsec policy priorities
|
||||
*/
|
||||
uint32_t manual_prio;
|
||||
|
||||
/**
|
||||
* set up IPsec transport SA in MIPv6 proxy mode
|
||||
*/
|
||||
@@ -500,6 +506,12 @@ METHOD(child_cfg_t, get_tfc, uint32_t,
|
||||
return this->tfc;
|
||||
}
|
||||
|
||||
METHOD(child_cfg_t, get_manual_prio, uint32_t,
|
||||
private_child_cfg_t *this)
|
||||
{
|
||||
return this->manual_prio;
|
||||
}
|
||||
|
||||
METHOD(child_cfg_t, get_replay_window, uint32_t,
|
||||
private_child_cfg_t *this)
|
||||
{
|
||||
@@ -569,6 +581,7 @@ METHOD(child_cfg_t, equals, bool,
|
||||
this->mark_out.value == other->mark_out.value &&
|
||||
this->mark_out.mask == other->mark_out.mask &&
|
||||
this->tfc == other->tfc &&
|
||||
this->manual_prio == other->manual_prio &&
|
||||
this->replay_window == other->replay_window &&
|
||||
this->proxy_mode == other->proxy_mode &&
|
||||
this->install_policy == other->install_policy &&
|
||||
@@ -627,6 +640,7 @@ child_cfg_t *child_cfg_create(char *name, child_cfg_create_t *data)
|
||||
.get_reqid = _get_reqid,
|
||||
.get_mark = _get_mark,
|
||||
.get_tfc = _get_tfc,
|
||||
.get_manual_prio = _get_manual_prio,
|
||||
.get_replay_window = _get_replay_window,
|
||||
.set_replay_window = _set_replay_window,
|
||||
.use_proxy_mode = _use_proxy_mode,
|
||||
@@ -650,6 +664,7 @@ child_cfg_t *child_cfg_create(char *name, child_cfg_create_t *data)
|
||||
.inactivity = data->inactivity,
|
||||
.use_ipcomp = data->ipcomp,
|
||||
.tfc = data->tfc,
|
||||
.manual_prio = data->priority,
|
||||
.install_policy = !data->suppress_policies,
|
||||
.refcount = 1,
|
||||
.proposals = linked_list_create(),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Andreas Steffen
|
||||
* Copyright (C) 2008-2016 Tobias Brunner
|
||||
* Copyright (C) 2005-2007 Martin Willi
|
||||
* Copyright (C) 2005 Jan Hutter
|
||||
@@ -235,6 +236,13 @@ struct child_cfg_t {
|
||||
*/
|
||||
uint32_t (*get_tfc)(child_cfg_t *this);
|
||||
|
||||
/**
|
||||
* Get optional manually-set IPsec policy priority
|
||||
*
|
||||
* @return manually-set IPsec policy priority (automatic if 0)
|
||||
*/
|
||||
uint32_t (*get_manual_prio)(child_cfg_t *this);
|
||||
|
||||
/**
|
||||
* Get anti-replay window size
|
||||
*
|
||||
@@ -308,6 +316,8 @@ struct child_cfg_create_t {
|
||||
bool ipcomp;
|
||||
/** TFC padding size, 0 to disable, -1 to pad to PMTU */
|
||||
uint32_t tfc;
|
||||
/** Optional manually-set IPsec policy priority */
|
||||
uint32_t priority;
|
||||
/** lifetime_cfg_t for this child_cfg */
|
||||
lifetime_cfg_t lifetime;
|
||||
/** Inactivity timeout in s before closing a CHILD_SA */
|
||||
|
||||
Reference in New Issue
Block a user