summaryrefslogtreecommitdiff
path: root/src/charon/kernel/kernel_interface.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/charon/kernel/kernel_interface.h')
-rw-r--r--src/charon/kernel/kernel_interface.h106
1 files changed, 53 insertions, 53 deletions
diff --git a/src/charon/kernel/kernel_interface.h b/src/charon/kernel/kernel_interface.h
index c4a273a34..c39246e72 100644
--- a/src/charon/kernel/kernel_interface.h
+++ b/src/charon/kernel/kernel_interface.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006-2008 Tobias Brunner
+ * Copyright (C) 2006-2009 Tobias Brunner
* Copyright (C) 2006 Daniel Roethlisberger
* Copyright (C) 2005-2006 Martin Willi
* Copyright (C) 2005 Jan Hutter
@@ -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,39 +61,36 @@ 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.
- *
+ *
* add_sa() may update an already allocated
* SPI (via get_spi). In this case, the replace
* flag must be set.
* This function does install a single SA for a
- * single protocol in one direction. The kernel-interface
- * gets the keys itself from the PRF, as we don't know
- * his algorithms and key sizes.
- *
+ * single protocol in one direction.
+ *
* @param src source address for this SA
* @param dst destination address for this SA
* @param spi SPI allocated by us or remote peer
* @param protocol protocol for this SA (ESP/AH)
* @param reqid unique ID for this SA
- * @param expire_soft lifetime in seconds before rekeying
- * @param expire_hard lifetime in seconds before delete
+ * @param lifetime lifetime_cfg_t for this SA
* @param enc_alg Algorithm to use for encryption (ESP only)
* @param enc_key key to use for encryption
* @param int_alg Algorithm to use for integrity protection
@@ -103,17 +100,20 @@ struct kernel_interface_t {
* @param cpi CPI for IPComp
* @param encap enable UDP encapsulation for NAT traversal
* @param inbound TRUE if this is an inbound SA
+ * @param src_ts traffic selector with BEET source address
+ * @param dst_ts traffic selector with BEET destination address
* @return SUCCESS if operation completed
*/
status_t (*add_sa) (kernel_interface_t *this,
host_t *src, host_t *dst, u_int32_t spi,
protocol_id_t protocol, u_int32_t reqid,
- u_int64_t expire_soft, u_int64_t expire_hard,
- u_int16_t enc_alg, chunk_t enc_key,
- u_int16_t int_alg, chunk_t int_key,
+ lifetime_cfg_t *lifetime,
+ u_int16_t enc_alg, chunk_t enc_key,
+ 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);
-
+ bool encap, bool inbound,
+ traffic_selector_t *src_ts, traffic_selector_t *dst_ts);
+
/**
* Update the hosts on an installed SA.
*
@@ -132,17 +132,17 @@ struct kernel_interface_t {
* @param encap current use of UDP encapsulation
* @param new_encap new use of UDP encapsulation
* @return SUCCESS if operation completed, NOT_SUPPORTED if
- * the kernel interface can't update the SA
+ * the kernel interface can't update the SA
*/
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
@@ -152,10 +152,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
@@ -165,13 +165,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
@@ -194,13 +194,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
@@ -208,10 +208,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.
*
@@ -227,11 +227,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.
*
@@ -246,7 +246,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.
*
@@ -257,7 +257,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.
*
@@ -265,21 +265,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.
*
@@ -294,7 +294,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.
*
@@ -304,10 +304,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
@@ -318,10 +318,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
@@ -331,50 +331,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.
*/