summaryrefslogtreecommitdiff
path: root/src/libhydra/kernel
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2013-02-07 13:27:27 +0100
committerYves-Alexis Perez <corsac@debian.org>2013-02-07 13:27:27 +0100
commit7585facf05d927eb6df3929ce09ed5e60d905437 (patch)
treee4d14b4dc180db20356b6b01ce0112f3a2d7897e /src/libhydra/kernel
parentc1343b3278cdf99533b7902744d15969f9d6fdc1 (diff)
downloadvyos-strongswan-7585facf05d927eb6df3929ce09ed5e60d905437.tar.gz
vyos-strongswan-7585facf05d927eb6df3929ce09ed5e60d905437.zip
Imported Upstream version 5.0.2
Diffstat (limited to 'src/libhydra/kernel')
-rw-r--r--src/libhydra/kernel/kernel_interface.c13
-rw-r--r--src/libhydra/kernel/kernel_interface.h15
-rw-r--r--src/libhydra/kernel/kernel_ipsec.h2
-rw-r--r--src/libhydra/kernel/kernel_listener.h2
-rw-r--r--src/libhydra/kernel/kernel_net.h17
5 files changed, 28 insertions, 21 deletions
diff --git a/src/libhydra/kernel/kernel_interface.c b/src/libhydra/kernel/kernel_interface.c
index 5320ee2e9..8948e0561 100644
--- a/src/libhydra/kernel/kernel_interface.c
+++ b/src/libhydra/kernel/kernel_interface.c
@@ -40,9 +40,9 @@
#include "kernel_interface.h"
#include <hydra.h>
-#include <debug.h>
+#include <utils/debug.h>
#include <threading/mutex.h>
-#include <utils/linked_list.h>
+#include <collections/linked_list.h>
typedef struct private_kernel_interface_t private_kernel_interface_t;
@@ -312,23 +312,24 @@ METHOD(kernel_interface_t, create_address_enumerator, enumerator_t*,
}
METHOD(kernel_interface_t, add_ip, status_t,
- private_kernel_interface_t *this, host_t *virtual_ip, host_t *iface_ip)
+ private_kernel_interface_t *this, host_t *virtual_ip, int prefix,
+ char *iface)
{
if (!this->net)
{
return NOT_SUPPORTED;
}
- return this->net->add_ip(this->net, virtual_ip, iface_ip);
+ return this->net->add_ip(this->net, virtual_ip, prefix, iface);
}
METHOD(kernel_interface_t, del_ip, status_t,
- private_kernel_interface_t *this, host_t *virtual_ip)
+ private_kernel_interface_t *this, host_t *virtual_ip, int prefix, bool wait)
{
if (!this->net)
{
return NOT_SUPPORTED;
}
- return this->net->del_ip(this->net, virtual_ip);
+ return this->net->del_ip(this->net, virtual_ip, prefix, wait);
}
METHOD(kernel_interface_t, add_route, status_t,
diff --git a/src/libhydra/kernel/kernel_interface.h b/src/libhydra/kernel/kernel_interface.h
index 88d4a5bce..8d8ef2e83 100644
--- a/src/libhydra/kernel/kernel_interface.h
+++ b/src/libhydra/kernel/kernel_interface.h
@@ -48,7 +48,7 @@
typedef struct kernel_interface_t kernel_interface_t;
-#include <utils/host.h>
+#include <networking/host.h>
#include <crypto/prf_plus.h>
#include <kernel/kernel_listener.h>
@@ -333,14 +333,14 @@ struct kernel_interface_t {
* Virtual IPs are attached to an interface. If an IP is added multiple
* times, the IP is refcounted and not removed until del_ip() was called
* as many times as add_ip().
- * The virtual IP is attached to the interface where the iface_ip is found.
*
* @param virtual_ip virtual ip address to assign
- * @param iface_ip IP of an interface to attach virtual IP
+ * @param prefix prefix length to install IP with, -1 for auto
+ * @param iface interface to install virtual IP on
* @return SUCCESS if operation completed
*/
- status_t (*add_ip) (kernel_interface_t *this, host_t *virtual_ip,
- host_t *iface_ip);
+ status_t (*add_ip) (kernel_interface_t *this, host_t *virtual_ip, int prefix,
+ char *iface);
/**
* Remove a virtual IP from an interface.
@@ -348,9 +348,12 @@ struct kernel_interface_t {
* The kernel interface uses refcounting, see add_ip().
*
* @param virtual_ip virtual ip address to assign
+ * @param prefix prefix length of the IP to uninstall, -1 for auto
+ * @param wait TRUE to wait untily IP is gone
* @return SUCCESS if operation completed
*/
- status_t (*del_ip) (kernel_interface_t *this, host_t *virtual_ip);
+ status_t (*del_ip) (kernel_interface_t *this, host_t *virtual_ip,
+ int prefix, bool wait);
/**
* Add a route.
diff --git a/src/libhydra/kernel/kernel_ipsec.h b/src/libhydra/kernel/kernel_ipsec.h
index ee0ade2aa..1da0805cb 100644
--- a/src/libhydra/kernel/kernel_ipsec.h
+++ b/src/libhydra/kernel/kernel_ipsec.h
@@ -26,7 +26,7 @@
typedef struct kernel_ipsec_t kernel_ipsec_t;
-#include <utils/host.h>
+#include <networking/host.h>
#include <ipsec/ipsec_types.h>
#include <selectors/traffic_selector.h>
#include <plugins/plugin.h>
diff --git a/src/libhydra/kernel/kernel_listener.h b/src/libhydra/kernel/kernel_listener.h
index 5db297b6f..27ea947eb 100644
--- a/src/libhydra/kernel/kernel_listener.h
+++ b/src/libhydra/kernel/kernel_listener.h
@@ -25,7 +25,7 @@ typedef struct kernel_listener_t kernel_listener_t;
#include <kernel/kernel_ipsec.h>
#include <selectors/traffic_selector.h>
-#include <utils/host.h>
+#include <networking/host.h>
/**
* Interface for components interested in kernel events.
diff --git a/src/libhydra/kernel/kernel_net.h b/src/libhydra/kernel/kernel_net.h
index 10350d644..6a3b2cee7 100644
--- a/src/libhydra/kernel/kernel_net.h
+++ b/src/libhydra/kernel/kernel_net.h
@@ -25,8 +25,8 @@
typedef struct kernel_net_t kernel_net_t;
typedef enum kernel_address_type_t kernel_address_type_t;
-#include <utils/enumerator.h>
-#include <utils/host.h>
+#include <collections/enumerator.h>
+#include <networking/host.h>
#include <plugins/plugin.h>
/**
@@ -112,14 +112,14 @@ struct kernel_net_t {
* Virtual IPs are attached to an interface. If an IP is added multiple
* times, the IP is refcounted and not removed until del_ip() was called
* as many times as add_ip().
- * The virtual IP is attached to the interface where the iface_ip is found.
*
* @param virtual_ip virtual ip address to assign
- * @param iface_ip IP of an interface to attach virtual IP
+ * @param prefix prefix length to install with IP address, -1 for auto
+ * @param iface interface to install virtual IP on
* @return SUCCESS if operation completed
*/
- status_t (*add_ip) (kernel_net_t *this, host_t *virtual_ip,
- host_t *iface_ip);
+ status_t (*add_ip) (kernel_net_t *this, host_t *virtual_ip, int prefix,
+ char *iface);
/**
* Remove a virtual IP from an interface.
@@ -127,9 +127,12 @@ struct kernel_net_t {
* The kernel interface uses refcounting, see add_ip().
*
* @param virtual_ip virtual ip address to assign
+ * @param prefix prefix length of the IP to uninstall, -1 for auto
+ * @param wait TRUE to wait until IP is gone
* @return SUCCESS if operation completed
*/
- status_t (*del_ip) (kernel_net_t *this, host_t *virtual_ip);
+ status_t (*del_ip) (kernel_net_t *this, host_t *virtual_ip, int prefix,
+ bool wait);
/**
* Add a route.