added possibility to route CHILD_SAs, without to set them up
support for auto=route parameter support for ipsec route and ipsec unroute initiating of CHILD and/or IKE_SAs based on kernel acquires
This commit is contained in:
@@ -247,6 +247,29 @@ static traffic_selector_t *get_subset(private_traffic_selector_t *this, private_
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* implements traffic_selector_t.equals
|
||||
*/
|
||||
static bool equals(private_traffic_selector_t *this, private_traffic_selector_t *other)
|
||||
{
|
||||
if (this->type != other->type)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (this->type == TS_IPV4_ADDR_RANGE)
|
||||
{
|
||||
if (this->from_addr_ipv4 == other->from_addr_ipv4 &&
|
||||
this->to_addr_ipv4 == other->to_addr_ipv4 &&
|
||||
this->from_port == other->from_port &&
|
||||
this->to_port == other->to_port &&
|
||||
this->protocol == other->protocol)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements traffic_selector_t.get_from_address.
|
||||
*/
|
||||
@@ -518,6 +541,7 @@ static private_traffic_selector_t *traffic_selector_create(u_int8_t protocol, ts
|
||||
|
||||
/* public functions */
|
||||
this->public.get_subset = (traffic_selector_t*(*)(traffic_selector_t*,traffic_selector_t*))get_subset;
|
||||
this->public.equals = (bool(*)(traffic_selector_t*,traffic_selector_t*))equals;
|
||||
this->public.get_string = (char*(*)(traffic_selector_t*))get_string;
|
||||
this->public.get_from_address = (chunk_t(*)(traffic_selector_t*))get_from_address;
|
||||
this->public.get_to_address = (chunk_t(*)(traffic_selector_t*))get_to_address;
|
||||
|
||||
@@ -183,6 +183,15 @@ struct traffic_selector_t {
|
||||
*/
|
||||
char* (*get_string) (traffic_selector_t *this);
|
||||
|
||||
/**
|
||||
* @brief Compare two traffic selectors for equality.
|
||||
*
|
||||
* @param this first to compare
|
||||
* @param other second to compare with first
|
||||
* @return pointer to a string.
|
||||
*/
|
||||
bool (*equals) (traffic_selector_t *this, traffic_selector_t *other);
|
||||
|
||||
/**
|
||||
* @brief Destroys the ts object
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user