aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/kernel
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2009-09-04 13:46:09 +0200
committerMartin Willi <martin@strongswan.org>2009-09-04 13:46:09 +0200
commit7daf5226b74e14a6e0f1a888b0be26f3d246f9f8 (patch)
tree6436de2e84e7a677ecfb83db4bf44766cc273d9f /src/charon/kernel
parent7d1b0304467bc668b592ccd6680fd9615efbb5b2 (diff)
downloadstrongswan-7daf5226b74e14a6e0f1a888b0be26f3d246f9f8.tar.bz2
strongswan-7daf5226b74e14a6e0f1a888b0be26f3d246f9f8.tar.xz
removed trailing spaces ([[:space:]]+$)
Diffstat (limited to 'src/charon/kernel')
-rw-r--r--src/charon/kernel/kernel_interface.c38
-rw-r--r--src/charon/kernel/kernel_interface.h80
-rw-r--r--src/charon/kernel/kernel_ipsec.h46
-rw-r--r--src/charon/kernel/kernel_net.h26
4 files changed, 95 insertions, 95 deletions
diff --git a/src/charon/kernel/kernel_interface.c b/src/charon/kernel/kernel_interface.c
index f33451383..b1a1d703f 100644
--- a/src/charon/kernel/kernel_interface.c
+++ b/src/charon/kernel/kernel_interface.c
@@ -30,12 +30,12 @@ struct private_kernel_interface_t {
* Public part of kernel_interface_t object.
*/
kernel_interface_t public;
-
+
/**
* ipsec interface
*/
kernel_ipsec_t *ipsec;
-
+
/**
* network interface
*/
@@ -45,7 +45,7 @@ struct private_kernel_interface_t {
/**
* Implementation of kernel_interface_t.get_spi
*/
-static status_t get_spi(private_kernel_interface_t *this, host_t *src, host_t *dst,
+static status_t get_spi(private_kernel_interface_t *this, host_t *src, host_t *dst,
protocol_id_t protocol, u_int32_t reqid, u_int32_t *spi)
{
if (!this->ipsec)
@@ -58,7 +58,7 @@ static status_t get_spi(private_kernel_interface_t *this, host_t *src, host_t *d
/**
* Implementation of kernel_interface_t.get_cpi
*/
-static status_t get_cpi(private_kernel_interface_t *this, host_t *src, host_t *dst,
+static status_t get_cpi(private_kernel_interface_t *this, host_t *src, host_t *dst,
u_int32_t reqid, u_int16_t *cpi)
{
if (!this->ipsec)
@@ -92,7 +92,7 @@ static status_t add_sa(private_kernel_interface_t *this, host_t *src, host_t *ds
* Implementation of kernel_interface_t.update_sa
*/
static status_t update_sa(private_kernel_interface_t *this, u_int32_t spi,
- protocol_id_t protocol, u_int16_t cpi, host_t *src, host_t *dst,
+ protocol_id_t protocol, u_int16_t cpi, host_t *src, host_t *dst,
host_t *new_src, host_t *new_dst, bool encap, bool new_encap)
{
if (!this->ipsec)
@@ -289,13 +289,13 @@ static status_t get_address_by_ts(private_kernel_interface_t *this,
host_t *host;
int family;
bool found = FALSE;
-
+
DBG2(DBG_KNL, "getting a local address in traffic selector %R", ts);
-
+
/* if we have a family which includes localhost, we do not
* search for an IP, we use the default */
family = ts->get_type(ts) == TS_IPV4_ADDR_RANGE ? AF_INET : AF_INET6;
-
+
if (family == AF_INET)
{
host = host_create_from_string("127.0.0.1", 0);
@@ -304,7 +304,7 @@ static status_t get_address_by_ts(private_kernel_interface_t *this,
{
host = host_create_from_string("::1", 0);
}
-
+
if (ts->includes(ts, host))
{
*ip = host_create_any(family);
@@ -313,7 +313,7 @@ static status_t get_address_by_ts(private_kernel_interface_t *this,
return SUCCESS;
}
host->destroy(host);
-
+
addrs = create_address_enumerator(this, TRUE, TRUE);
while (addrs->enumerate(addrs, (void**)&host))
{
@@ -325,13 +325,13 @@ static status_t get_address_by_ts(private_kernel_interface_t *this,
}
}
addrs->destroy(addrs);
-
+
if (!found)
{
DBG1(DBG_KNL, "no local address found in traffic selector %R", ts);
return FAILED;
}
-
+
DBG2(DBG_KNL, "using host %H", *ip);
return SUCCESS;
}
@@ -395,7 +395,7 @@ static void destroy(private_kernel_interface_t *this)
kernel_interface_t *kernel_interface_create()
{
private_kernel_interface_t *this = malloc_thing(private_kernel_interface_t);
-
+
this->public.get_spi = (status_t(*)(kernel_interface_t*,host_t*,host_t*,protocol_id_t,u_int32_t,u_int32_t*))get_spi;
this->public.get_cpi = (status_t(*)(kernel_interface_t*,host_t*,host_t*,u_int32_t,u_int16_t*))get_cpi;
this->public.add_sa = (status_t(*)(kernel_interface_t *,host_t*,host_t*,u_int32_t,protocol_id_t,u_int32_t,lifetime_cfg_t*,u_int16_t,chunk_t,u_int16_t,chunk_t,ipsec_mode_t,u_int16_t,u_int16_t,bool,bool))add_sa;
@@ -405,7 +405,7 @@ kernel_interface_t *kernel_interface_create()
this->public.add_policy = (status_t(*)(kernel_interface_t*,host_t*,host_t*,traffic_selector_t*,traffic_selector_t*,policy_dir_t,u_int32_t,protocol_id_t,u_int32_t,ipsec_mode_t,u_int16_t,u_int16_t,bool))add_policy;
this->public.query_policy = (status_t(*)(kernel_interface_t*,traffic_selector_t*,traffic_selector_t*,policy_dir_t,u_int32_t*))query_policy;
this->public.del_policy = (status_t(*)(kernel_interface_t*,traffic_selector_t*,traffic_selector_t*,policy_dir_t,bool))del_policy;
-
+
this->public.get_source_addr = (host_t*(*)(kernel_interface_t*, host_t *dest, host_t *src))get_source_addr;
this->public.get_nexthop = (host_t*(*)(kernel_interface_t*, host_t *dest))get_nexthop;
this->public.get_interface = (char*(*)(kernel_interface_t*,host_t*))get_interface;
@@ -414,18 +414,18 @@ kernel_interface_t *kernel_interface_create()
this->public.del_ip = (status_t(*)(kernel_interface_t*,host_t*)) del_ip;
this->public.add_route = (status_t(*)(kernel_interface_t*,chunk_t,u_int8_t,host_t*,host_t*,char*)) add_route;
this->public.del_route = (status_t(*)(kernel_interface_t*,chunk_t,u_int8_t,host_t*,host_t*,char*)) del_route;
-
+
this->public.get_address_by_ts = (status_t(*)(kernel_interface_t*,traffic_selector_t*,host_t**))get_address_by_ts;
-
+
this->public.add_ipsec_interface = (void(*)(kernel_interface_t*, kernel_ipsec_constructor_t))add_ipsec_interface;
this->public.remove_ipsec_interface = (void(*)(kernel_interface_t*, kernel_ipsec_constructor_t))remove_ipsec_interface;
this->public.add_net_interface = (void(*)(kernel_interface_t*, kernel_net_constructor_t))add_net_interface;
this->public.remove_net_interface = (void(*)(kernel_interface_t*, kernel_net_constructor_t))remove_net_interface;
-
+
this->public.destroy = (void (*)(kernel_interface_t*))destroy;
-
+
this->ipsec = NULL;
this->net = NULL;
-
+
return &this->public;
}
diff --git a/src/charon/kernel/kernel_interface.h b/src/charon/kernel/kernel_interface.h
index f4247a260..505fb1f56 100644
--- a/src/charon/kernel/kernel_interface.h
+++ b/src/charon/kernel/kernel_interface.h
@@ -45,7 +45,7 @@ typedef kernel_net_t* (*kernel_net_constructor_t)(void);
/**
* Manager and wrapper for different kernel interfaces.
- *
+ *
* The kernel interface handles the communication with the kernel
* for SA and policy management and interface and IP address management.
*/
@@ -61,21 +61,21 @@ struct kernel_interface_t {
* @param spi allocated spi
* @return SUCCESS if operation completed
*/
- status_t (*get_spi)(kernel_interface_t *this, host_t *src, host_t *dst,
+ status_t (*get_spi)(kernel_interface_t *this, host_t *src, host_t *dst,
protocol_id_t protocol, u_int32_t reqid, u_int32_t *spi);
-
+
/**
* Get a Compression Parameter Index (CPI) from the kernel.
- *
+ *
* @param src source address of SA
* @param dst destination address of SA
* @param reqid unique ID for the corresponding SA
* @param cpi allocated cpi
* @return SUCCESS if operation completed
*/
- status_t (*get_cpi)(kernel_interface_t *this, host_t *src, host_t *dst,
+ status_t (*get_cpi)(kernel_interface_t *this, host_t *src, host_t *dst,
u_int32_t reqid, u_int16_t *cpi);
-
+
/**
* Add an SA to the SAD.
*
@@ -110,7 +110,7 @@ struct kernel_interface_t {
u_int16_t int_alg, chunk_t int_key,
ipsec_mode_t mode, u_int16_t ipcomp, u_int16_t cpi,
bool encap, bool inbound);
-
+
/**
* Update the hosts on an installed SA.
*
@@ -133,13 +133,13 @@ struct kernel_interface_t {
*/
status_t (*update_sa)(kernel_interface_t *this,
u_int32_t spi, protocol_id_t protocol, u_int16_t cpi,
- host_t *src, host_t *dst,
+ host_t *src, host_t *dst,
host_t *new_src, host_t *new_dst,
bool encap, bool new_encap);
-
+
/**
* Query the number of bytes processed by an SA from the SAD.
- *
+ *
* @param src source address for this SA
* @param dst destination address for this SA
* @param spi SPI allocated by us or remote peer
@@ -149,10 +149,10 @@ struct kernel_interface_t {
*/
status_t (*query_sa) (kernel_interface_t *this, host_t *src, host_t *dst,
u_int32_t spi, protocol_id_t protocol, u_int64_t *bytes);
-
+
/**
* Delete a previously installed SA from the SAD.
- *
+ *
* @param src source address for this SA
* @param dst destination address for this SA
* @param spi SPI allocated by us or remote peer
@@ -162,13 +162,13 @@ struct kernel_interface_t {
*/
status_t (*del_sa) (kernel_interface_t *this, host_t *src, host_t *dst,
u_int32_t spi, protocol_id_t protocol, u_int16_t cpi);
-
+
/**
* Add a policy to the SPD.
- *
+ *
* A policy is always associated to an SA. Traffic which matches a
* policy is handled by the SA with the same reqid.
- *
+ *
* @param src source address of SA
* @param dst dest address of SA
* @param src_ts traffic selector to match traffic source
@@ -191,13 +191,13 @@ struct kernel_interface_t {
protocol_id_t protocol, u_int32_t reqid,
ipsec_mode_t mode, u_int16_t ipcomp, u_int16_t cpi,
bool routed);
-
+
/**
* Query the use time of a policy.
*
* The use time of a policy is the time the policy was used
* for the last time.
- *
+ *
* @param src_ts traffic selector to match traffic source
* @param dst_ts traffic selector to match traffic dest
* @param direction direction of traffic, POLICY_IN, POLICY_OUT, POLICY_FWD
@@ -205,10 +205,10 @@ struct kernel_interface_t {
* @return SUCCESS if operation completed
*/
status_t (*query_policy) (kernel_interface_t *this,
- traffic_selector_t *src_ts,
+ traffic_selector_t *src_ts,
traffic_selector_t *dst_ts,
policy_dir_t direction, u_int32_t *use_time);
-
+
/**
* Remove a policy from the SPD.
*
@@ -224,11 +224,11 @@ struct kernel_interface_t {
* @return SUCCESS if operation completed
*/
status_t (*del_policy) (kernel_interface_t *this,
- traffic_selector_t *src_ts,
+ traffic_selector_t *src_ts,
traffic_selector_t *dst_ts,
policy_dir_t direction,
bool unrouted);
-
+
/**
* Get our outgoing source address for a destination.
*
@@ -243,7 +243,7 @@ struct kernel_interface_t {
*/
host_t* (*get_source_addr)(kernel_interface_t *this,
host_t *dest, host_t *src);
-
+
/**
* Get the next hop for a destination.
*
@@ -254,7 +254,7 @@ struct kernel_interface_t {
* @return next hop address, NULL if unreachable
*/
host_t* (*get_nexthop)(kernel_interface_t *this, host_t *dest);
-
+
/**
* Get the interface name of a local address.
*
@@ -262,21 +262,21 @@ struct kernel_interface_t {
* @return allocated interface name, or NULL if not found
*/
char* (*get_interface) (kernel_interface_t *this, host_t *host);
-
+
/**
* Creates an enumerator over all local addresses.
- *
+ *
* This function blocks an internal cached address list until the
* enumerator gets destroyed.
* The hosts are read-only, do not modify of free.
- *
+ *
* @param include_down_ifaces TRUE to enumerate addresses from down interfaces
* @param include_virtual_ips TRUE to enumerate virtual ip addresses
* @return enumerator over host_t's
*/
enumerator_t *(*create_address_enumerator) (kernel_interface_t *this,
bool include_down_ifaces, bool include_virtual_ips);
-
+
/**
* Add a virtual IP to an interface.
*
@@ -291,7 +291,7 @@ struct kernel_interface_t {
*/
status_t (*add_ip) (kernel_interface_t *this, host_t *virtual_ip,
host_t *iface_ip);
-
+
/**
* Remove a virtual IP from an interface.
*
@@ -301,10 +301,10 @@ struct kernel_interface_t {
* @return SUCCESS if operation completed
*/
status_t (*del_ip) (kernel_interface_t *this, host_t *virtual_ip);
-
+
/**
* Add a route.
- *
+ *
* @param dst_net destination net
* @param prefixlen destination net prefix length
* @param gateway gateway for this route
@@ -315,10 +315,10 @@ struct kernel_interface_t {
*/
status_t (*add_route) (kernel_interface_t *this, chunk_t dst_net, u_int8_t prefixlen,
host_t *gateway, host_t *src_ip, char *if_name);
-
+
/**
* Delete a route.
- *
+ *
* @param dst_net destination net
* @param prefixlen destination net prefix length
* @param gateway gateway for this route
@@ -328,50 +328,50 @@ struct kernel_interface_t {
*/
status_t (*del_route) (kernel_interface_t *this, chunk_t dst_net, u_int8_t prefixlen,
host_t *gateway, host_t *src_ip, char *if_name);
-
+
/**
* manager methods
*/
-
+
/**
* Tries to find an ip address of a local interface that is included in the
* supplied traffic selector.
- *
+ *
* @param ts traffic selector
* @param ip returned ip (has to be destroyed)
* @return SUCCESS if address found
*/
status_t (*get_address_by_ts) (kernel_interface_t *this,
traffic_selector_t *ts, host_t **ip);
-
+
/**
* Register an ipsec kernel interface constructor on the manager.
*
* @param create constructor to register
*/
void (*add_ipsec_interface)(kernel_interface_t *this, kernel_ipsec_constructor_t create);
-
+
/**
* Unregister an ipsec kernel interface constructor.
*
* @param create constructor to unregister
*/
void (*remove_ipsec_interface)(kernel_interface_t *this, kernel_ipsec_constructor_t create);
-
+
/**
* Register a network kernel interface constructor on the manager.
*
* @param create constructor to register
*/
void (*add_net_interface)(kernel_interface_t *this, kernel_net_constructor_t create);
-
+
/**
* Unregister a network kernel interface constructor.
*
* @param create constructor to unregister
*/
void (*remove_net_interface)(kernel_interface_t *this, kernel_net_constructor_t create);
-
+
/**
* Destroys a kernel_interface_manager_t object.
*/
diff --git a/src/charon/kernel/kernel_ipsec.h b/src/charon/kernel/kernel_ipsec.h
index b21be849d..fdcc5f40a 100644
--- a/src/charon/kernel/kernel_ipsec.h
+++ b/src/charon/kernel/kernel_ipsec.h
@@ -71,9 +71,9 @@ extern enum_name_t *policy_dir_names;
/**
* Interface to the ipsec subsystem of the kernel.
- *
+ *
* The kernel ipsec interface handles the communication with the kernel
- * for SA and policy management. It allows setup of these, and provides
+ * for SA and policy management. It allows setup of these, and provides
* further the handling of kernel events.
* Policy information are cached in the interface. This is necessary to do
* reference counting. The Linux kernel does not allow the same policy
@@ -81,7 +81,7 @@ extern enum_name_t *policy_dir_names;
* when rekeying. Thats why we do reference counting of policies.
*/
struct kernel_ipsec_t {
-
+
/**
* Get a SPI from the kernel.
*
@@ -92,21 +92,21 @@ struct kernel_ipsec_t {
* @param spi allocated spi
* @return SUCCESS if operation completed
*/
- status_t (*get_spi)(kernel_ipsec_t *this, host_t *src, host_t *dst,
+ status_t (*get_spi)(kernel_ipsec_t *this, host_t *src, host_t *dst,
protocol_id_t protocol, u_int32_t reqid, u_int32_t *spi);
-
+
/**
* Get a Compression Parameter Index (CPI) from the kernel.
- *
+ *
* @param src source address of SA
* @param dst destination address of SA
* @param reqid unique ID for the corresponding SA
* @param cpi allocated cpi
* @return SUCCESS if operation completed
*/
- status_t (*get_cpi)(kernel_ipsec_t *this, host_t *src, host_t *dst,
+ status_t (*get_cpi)(kernel_ipsec_t *this, host_t *src, host_t *dst,
u_int32_t reqid, u_int16_t *cpi);
-
+
/**
* Add an SA to the SAD.
*
@@ -141,7 +141,7 @@ struct kernel_ipsec_t {
u_int16_t int_alg, chunk_t int_key,
ipsec_mode_t mode, u_int16_t ipcomp, u_int16_t cpi,
bool encap, bool inbound);
-
+
/**
* Update the hosts on an installed SA.
*
@@ -164,13 +164,13 @@ struct kernel_ipsec_t {
*/
status_t (*update_sa)(kernel_ipsec_t *this,
u_int32_t spi, protocol_id_t protocol, u_int16_t cpi,
- host_t *src, host_t *dst,
+ host_t *src, host_t *dst,
host_t *new_src, host_t *new_dst,
bool encap, bool new_encap);
-
+
/**
* Query the number of bytes processed by an SA from the SAD.
- *
+ *
* @param src source address for this SA
* @param dst destination address for this SA
* @param spi SPI allocated by us or remote peer
@@ -180,10 +180,10 @@ struct kernel_ipsec_t {
*/
status_t (*query_sa) (kernel_ipsec_t *this, host_t *src, host_t *dst,
u_int32_t spi, protocol_id_t protocol, u_int64_t *bytes);
-
+
/**
* Delete a previusly installed SA from the SAD.
- *
+ *
* @param src source address for this SA
* @param dst destination address for this SA
* @param spi SPI allocated by us or remote peer
@@ -193,13 +193,13 @@ struct kernel_ipsec_t {
*/
status_t (*del_sa) (kernel_ipsec_t *this, host_t *src, host_t *dst,
u_int32_t spi, protocol_id_t protocol, u_int16_t cpi);
-
+
/**
* Add a policy to the SPD.
- *
+ *
* A policy is always associated to an SA. Traffic which matches a
* policy is handled by the SA with the same reqid.
- *
+ *
* @param src source address of SA
* @param dst dest address of SA
* @param src_ts traffic selector to match traffic source
@@ -222,14 +222,14 @@ struct kernel_ipsec_t {
protocol_id_t protocol, u_int32_t reqid,
ipsec_mode_t mode, u_int16_t ipcomp, u_int16_t cpi,
bool routed);
-
+
/**
* Query the use time of a policy.
*
* The use time of a policy is the time the policy was used for the last
* time. It is not the system time, but a monotonic timestamp as returned
* by time_monotonic.
- *
+ *
* @param src_ts traffic selector to match traffic source
* @param dst_ts traffic selector to match traffic dest
* @param direction direction of traffic, POLICY_IN, POLICY_OUT, POLICY_FWD
@@ -237,10 +237,10 @@ struct kernel_ipsec_t {
* @return SUCCESS if operation completed
*/
status_t (*query_policy) (kernel_ipsec_t *this,
- traffic_selector_t *src_ts,
+ traffic_selector_t *src_ts,
traffic_selector_t *dst_ts,
policy_dir_t direction, u_int32_t *use_time);
-
+
/**
* Remove a policy from the SPD.
*
@@ -256,11 +256,11 @@ struct kernel_ipsec_t {
* @return SUCCESS if operation completed
*/
status_t (*del_policy) (kernel_ipsec_t *this,
- traffic_selector_t *src_ts,
+ traffic_selector_t *src_ts,
traffic_selector_t *dst_ts,
policy_dir_t direction,
bool unrouted);
-
+
/**
* Destroy the implementation.
*/
diff --git a/src/charon/kernel/kernel_net.h b/src/charon/kernel/kernel_net.h
index 02242f3a8..efb221f88 100644
--- a/src/charon/kernel/kernel_net.h
+++ b/src/charon/kernel/kernel_net.h
@@ -29,7 +29,7 @@ typedef struct kernel_net_t kernel_net_t;
/**
* Interface to the network subsystem of the kernel.
- *
+ *
* The kernel network interface handles the communication with the kernel
* for interface and IP address management.
*/
@@ -48,7 +48,7 @@ struct kernel_net_t {
* @return outgoing source address, NULL if unreachable
*/
host_t* (*get_source_addr)(kernel_net_t *this, host_t *dest, host_t *src);
-
+
/**
* Get the next hop for a destination.
*
@@ -59,7 +59,7 @@ struct kernel_net_t {
* @return next hop address, NULL if unreachable
*/
host_t* (*get_nexthop)(kernel_net_t *this, host_t *dest);
-
+
/**
* Get the interface name of a local address.
*
@@ -67,21 +67,21 @@ struct kernel_net_t {
* @return allocated interface name, or NULL if not found
*/
char* (*get_interface) (kernel_net_t *this, host_t *host);
-
+
/**
* Creates an enumerator over all local addresses.
- *
+ *
* This function blocks an internal cached address list until the
* enumerator gets destroyed.
* The hosts are read-only, do not modify of free.
- *
+ *
* @param include_down_ifaces TRUE to enumerate addresses from down interfaces
* @param include_virtual_ips TRUE to enumerate virtual ip addresses
* @return enumerator over host_t's
*/
enumerator_t *(*create_address_enumerator) (kernel_net_t *this,
bool include_down_ifaces, bool include_virtual_ips);
-
+
/**
* Add a virtual IP to an interface.
*
@@ -96,7 +96,7 @@ struct kernel_net_t {
*/
status_t (*add_ip) (kernel_net_t *this, host_t *virtual_ip,
host_t *iface_ip);
-
+
/**
* Remove a virtual IP from an interface.
*
@@ -106,10 +106,10 @@ struct kernel_net_t {
* @return SUCCESS if operation completed
*/
status_t (*del_ip) (kernel_net_t *this, host_t *virtual_ip);
-
+
/**
* Add a route.
- *
+ *
* @param dst_net destination net
* @param prefixlen destination net prefix length
* @param gateway gateway for this route
@@ -120,10 +120,10 @@ struct kernel_net_t {
*/
status_t (*add_route) (kernel_net_t *this, chunk_t dst_net, u_int8_t prefixlen,
host_t *gateway, host_t *src_ip, char *if_name);
-
+
/**
* Delete a route.
- *
+ *
* @param dst_net destination net
* @param prefixlen destination net prefix length
* @param gateway gateway for this route
@@ -133,7 +133,7 @@ struct kernel_net_t {
*/
status_t (*del_route) (kernel_net_t *this, chunk_t dst_net, u_int8_t prefixlen,
host_t *gateway, host_t *src_ip, char *if_name);
-
+
/**
* Destroy the implementation.
*/