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:
Martin Willi
2006-07-21 13:31:53 +00:00
parent c0593835f4
commit 45f76a7ddd
26 changed files with 1011 additions and 142 deletions
+24
View File
@@ -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;
+9
View File
@@ -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
*