aboutsummaryrefslogtreecommitdiffstats
path: root/src/libhydra/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/libhydra/kernel')
-rw-r--r--src/libhydra/kernel/kernel_interface.c9
-rw-r--r--src/libhydra/kernel/kernel_interface.h6
-rw-r--r--src/libhydra/kernel/kernel_net.h6
3 files changed, 13 insertions, 8 deletions
diff --git a/src/libhydra/kernel/kernel_interface.c b/src/libhydra/kernel/kernel_interface.c
index 542586115..2fbe84818 100644
--- a/src/libhydra/kernel/kernel_interface.c
+++ b/src/libhydra/kernel/kernel_interface.c
@@ -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,
+ host_t *iface_ip)
{
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_ip);
}
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)
{
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);
}
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 7058466b1..e3ebce8ee 100644
--- a/src/libhydra/kernel/kernel_interface.h
+++ b/src/libhydra/kernel/kernel_interface.h
@@ -336,10 +336,11 @@ struct kernel_interface_t {
* The virtual IP is attached to the interface where the iface_ip is found.
*
* @param virtual_ip virtual ip address to assign
+ * @param prefix prefix length to install IP with, -1 for auto
* @param iface_ip IP of an interface to attach virtual IP
* @return SUCCESS if operation completed
*/
- status_t (*add_ip) (kernel_interface_t *this, host_t *virtual_ip,
+ status_t (*add_ip) (kernel_interface_t *this, host_t *virtual_ip, int prefix,
host_t *iface_ip);
/**
@@ -348,9 +349,10 @@ 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
* @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);
/**
* Add a route.
diff --git a/src/libhydra/kernel/kernel_net.h b/src/libhydra/kernel/kernel_net.h
index 0f2e31cc9..50881ab4d 100644
--- a/src/libhydra/kernel/kernel_net.h
+++ b/src/libhydra/kernel/kernel_net.h
@@ -115,10 +115,11 @@ struct kernel_net_t {
* The virtual IP is attached to the interface where the iface_ip is found.
*
* @param virtual_ip virtual ip address to assign
+ * @param prefix prefix length to install with IP address, -1 for auto
* @param iface_ip IP of an interface to attach virtual IP
* @return SUCCESS if operation completed
*/
- status_t (*add_ip) (kernel_net_t *this, host_t *virtual_ip,
+ status_t (*add_ip) (kernel_net_t *this, host_t *virtual_ip, int prefix,
host_t *iface_ip);
/**
@@ -127,9 +128,10 @@ 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
* @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);
/**
* Add a route.