libhydra: Move kernel interface to libcharon
This moves hydra->kernel_interface to charon->kernel.
This commit is contained in:
+38
-44
@@ -23,7 +23,6 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <collections/array.h>
|
||||
|
||||
@@ -469,10 +468,10 @@ static status_t update_usebytes(private_child_sa_t *this, bool inbound)
|
||||
{
|
||||
if (this->my_spi)
|
||||
{
|
||||
status = hydra->kernel_interface->query_sa(hydra->kernel_interface,
|
||||
this->other_addr, this->my_addr, this->my_spi,
|
||||
proto_ike2ip(this->protocol), this->mark_in,
|
||||
&bytes, &packets, &time);
|
||||
status = charon->kernel->query_sa(charon->kernel, this->other_addr,
|
||||
this->my_addr, this->my_spi,
|
||||
proto_ike2ip(this->protocol), this->mark_in,
|
||||
&bytes, &packets, &time);
|
||||
if (status == SUCCESS)
|
||||
{
|
||||
if (bytes > this->my_usebytes)
|
||||
@@ -493,10 +492,10 @@ static status_t update_usebytes(private_child_sa_t *this, bool inbound)
|
||||
{
|
||||
if (this->other_spi)
|
||||
{
|
||||
status = hydra->kernel_interface->query_sa(hydra->kernel_interface,
|
||||
this->my_addr, this->other_addr, this->other_spi,
|
||||
proto_ike2ip(this->protocol), this->mark_out,
|
||||
&bytes, &packets, &time);
|
||||
status = charon->kernel->query_sa(charon->kernel, this->my_addr,
|
||||
this->other_addr, this->other_spi,
|
||||
proto_ike2ip(this->protocol), this->mark_out,
|
||||
&bytes, &packets, &time);
|
||||
if (status == SUCCESS)
|
||||
{
|
||||
if (bytes > this->other_usebytes)
|
||||
@@ -532,15 +531,15 @@ static bool update_usetime(private_child_sa_t *this, bool inbound)
|
||||
|
||||
if (inbound)
|
||||
{
|
||||
if (hydra->kernel_interface->query_policy(hydra->kernel_interface,
|
||||
other_ts, my_ts, POLICY_IN, this->mark_in, &in) == SUCCESS)
|
||||
if (charon->kernel->query_policy(charon->kernel, other_ts,
|
||||
my_ts, POLICY_IN, this->mark_in, &in) == SUCCESS)
|
||||
{
|
||||
last_use = max(last_use, in);
|
||||
}
|
||||
if (this->mode != MODE_TRANSPORT)
|
||||
{
|
||||
if (hydra->kernel_interface->query_policy(hydra->kernel_interface,
|
||||
other_ts, my_ts, POLICY_FWD, this->mark_in, &fwd) == SUCCESS)
|
||||
if (charon->kernel->query_policy(charon->kernel, other_ts,
|
||||
my_ts, POLICY_FWD, this->mark_in, &fwd) == SUCCESS)
|
||||
{
|
||||
last_use = max(last_use, fwd);
|
||||
}
|
||||
@@ -548,8 +547,8 @@ static bool update_usetime(private_child_sa_t *this, bool inbound)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hydra->kernel_interface->query_policy(hydra->kernel_interface,
|
||||
my_ts, other_ts, POLICY_OUT, this->mark_out, &out) == SUCCESS)
|
||||
if (charon->kernel->query_policy(charon->kernel, my_ts,
|
||||
other_ts, POLICY_OUT, this->mark_out, &out) == SUCCESS)
|
||||
{
|
||||
last_use = max(last_use, out);
|
||||
}
|
||||
@@ -629,10 +628,8 @@ METHOD(child_sa_t, get_installtime, time_t,
|
||||
METHOD(child_sa_t, alloc_spi, u_int32_t,
|
||||
private_child_sa_t *this, protocol_id_t protocol)
|
||||
{
|
||||
if (hydra->kernel_interface->get_spi(hydra->kernel_interface,
|
||||
this->other_addr, this->my_addr,
|
||||
proto_ike2ip(protocol),
|
||||
&this->my_spi) == SUCCESS)
|
||||
if (charon->kernel->get_spi(charon->kernel, this->other_addr, this->my_addr,
|
||||
proto_ike2ip(protocol), &this->my_spi) == SUCCESS)
|
||||
{
|
||||
/* if we allocate a SPI, but then are unable to establish the SA, we
|
||||
* need to know the protocol family to delete the partial SA */
|
||||
@@ -645,9 +642,8 @@ METHOD(child_sa_t, alloc_spi, u_int32_t,
|
||||
METHOD(child_sa_t, alloc_cpi, u_int16_t,
|
||||
private_child_sa_t *this)
|
||||
{
|
||||
if (hydra->kernel_interface->get_cpi(hydra->kernel_interface,
|
||||
this->other_addr, this->my_addr,
|
||||
&this->my_cpi) == SUCCESS)
|
||||
if (charon->kernel->get_cpi(charon->kernel, this->other_addr, this->my_addr,
|
||||
&this->my_cpi) == SUCCESS)
|
||||
{
|
||||
return this->my_cpi;
|
||||
}
|
||||
@@ -711,9 +707,8 @@ METHOD(child_sa_t, install, status_t,
|
||||
|
||||
if (!this->reqid_allocated && !this->static_reqid)
|
||||
{
|
||||
status = hydra->kernel_interface->alloc_reqid(hydra->kernel_interface,
|
||||
my_ts, other_ts, this->mark_in, this->mark_out,
|
||||
&this->reqid);
|
||||
status = charon->kernel->alloc_reqid(charon->kernel, my_ts, other_ts,
|
||||
this->mark_in, this->mark_out, &this->reqid);
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
return status;
|
||||
@@ -757,7 +752,7 @@ METHOD(child_sa_t, install, status_t,
|
||||
dst_ts = other_ts;
|
||||
}
|
||||
|
||||
status = hydra->kernel_interface->add_sa(hydra->kernel_interface,
|
||||
status = charon->kernel->add_sa(charon->kernel,
|
||||
src, dst, spi, proto_ike2ip(this->protocol), this->reqid,
|
||||
inbound ? this->mark_in : this->mark_out, tfc,
|
||||
lifetime, enc_alg, encr, int_alg, integ, this->mode,
|
||||
@@ -776,7 +771,7 @@ static bool require_policy_update()
|
||||
{
|
||||
kernel_feature_t f;
|
||||
|
||||
f = hydra->kernel_interface->get_features(hydra->kernel_interface);
|
||||
f = charon->kernel->get_features(charon->kernel);
|
||||
return !(f & KERNEL_NO_POLICY_UPDATES);
|
||||
}
|
||||
|
||||
@@ -833,18 +828,18 @@ static status_t install_policies_internal(private_child_sa_t *this,
|
||||
ipsec_sa_cfg_t *other_sa, policy_type_t type, policy_priority_t priority)
|
||||
{
|
||||
status_t status = SUCCESS;
|
||||
status |= hydra->kernel_interface->add_policy(hydra->kernel_interface,
|
||||
status |= charon->kernel->add_policy(charon->kernel,
|
||||
my_addr, other_addr, my_ts, other_ts,
|
||||
POLICY_OUT, type, other_sa,
|
||||
this->mark_out, priority);
|
||||
|
||||
status |= hydra->kernel_interface->add_policy(hydra->kernel_interface,
|
||||
status |= charon->kernel->add_policy(charon->kernel,
|
||||
other_addr, my_addr, other_ts, my_ts,
|
||||
POLICY_IN, type, my_sa,
|
||||
this->mark_in, priority);
|
||||
if (this->mode != MODE_TRANSPORT)
|
||||
{
|
||||
status |= hydra->kernel_interface->add_policy(hydra->kernel_interface,
|
||||
status |= charon->kernel->add_policy(charon->kernel,
|
||||
other_addr, my_addr, other_ts, my_ts,
|
||||
POLICY_FWD, type, my_sa,
|
||||
this->mark_in, priority);
|
||||
@@ -861,15 +856,15 @@ static void del_policies_internal(private_child_sa_t *this,
|
||||
ipsec_sa_cfg_t *other_sa, policy_type_t type, policy_priority_t priority)
|
||||
{
|
||||
|
||||
hydra->kernel_interface->del_policy(hydra->kernel_interface,
|
||||
charon->kernel->del_policy(charon->kernel,
|
||||
my_addr, other_addr, my_ts, other_ts, POLICY_OUT, type,
|
||||
other_sa, this->mark_out, priority);
|
||||
hydra->kernel_interface->del_policy(hydra->kernel_interface,
|
||||
charon->kernel->del_policy(charon->kernel,
|
||||
other_addr, my_addr, other_ts, my_ts, POLICY_IN,
|
||||
type, my_sa, this->mark_in, priority);
|
||||
if (this->mode != MODE_TRANSPORT)
|
||||
{
|
||||
hydra->kernel_interface->del_policy(hydra->kernel_interface,
|
||||
charon->kernel->del_policy(charon->kernel,
|
||||
other_addr, my_addr, other_ts, my_ts, POLICY_FWD,
|
||||
type, my_sa, this->mark_in, priority);
|
||||
}
|
||||
@@ -886,8 +881,8 @@ METHOD(child_sa_t, add_policies, status_t,
|
||||
if (!this->reqid_allocated && !this->static_reqid)
|
||||
{
|
||||
/* trap policy, get or confirm reqid */
|
||||
status = hydra->kernel_interface->alloc_reqid(
|
||||
hydra->kernel_interface, my_ts_list, other_ts_list,
|
||||
status = charon->kernel->alloc_reqid(
|
||||
charon->kernel, my_ts_list, other_ts_list,
|
||||
this->mark_in, this->mark_out, &this->reqid);
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
@@ -967,11 +962,10 @@ static void reinstall_vip(host_t *vip, host_t *me)
|
||||
{
|
||||
char *iface;
|
||||
|
||||
if (hydra->kernel_interface->get_interface(hydra->kernel_interface,
|
||||
me, &iface))
|
||||
if (charon->kernel->get_interface(charon->kernel, me, &iface))
|
||||
{
|
||||
hydra->kernel_interface->del_ip(hydra->kernel_interface, vip, -1, TRUE);
|
||||
hydra->kernel_interface->add_ip(hydra->kernel_interface, vip, -1, iface);
|
||||
charon->kernel->del_ip(charon->kernel, vip, -1, TRUE);
|
||||
charon->kernel->add_ip(charon->kernel, vip, -1, iface);
|
||||
free(iface);
|
||||
}
|
||||
}
|
||||
@@ -1000,7 +994,7 @@ METHOD(child_sa_t, update, status_t,
|
||||
/* update our (initiator) SA */
|
||||
if (this->my_spi)
|
||||
{
|
||||
if (hydra->kernel_interface->update_sa(hydra->kernel_interface,
|
||||
if (charon->kernel->update_sa(charon->kernel,
|
||||
this->my_spi, proto_ike2ip(this->protocol),
|
||||
this->ipcomp != IPCOMP_NONE ? this->my_cpi : 0,
|
||||
this->other_addr, this->my_addr, other, me,
|
||||
@@ -1014,7 +1008,7 @@ METHOD(child_sa_t, update, status_t,
|
||||
/* update his (responder) SA */
|
||||
if (this->other_spi)
|
||||
{
|
||||
if (hydra->kernel_interface->update_sa(hydra->kernel_interface,
|
||||
if (charon->kernel->update_sa(charon->kernel,
|
||||
this->other_spi, proto_ike2ip(this->protocol),
|
||||
this->ipcomp != IPCOMP_NONE ? this->other_cpi : 0,
|
||||
this->my_addr, this->other_addr, me, other,
|
||||
@@ -1143,14 +1137,14 @@ METHOD(child_sa_t, destroy, void,
|
||||
/* delete SAs in the kernel, if they are set up */
|
||||
if (this->my_spi)
|
||||
{
|
||||
hydra->kernel_interface->del_sa(hydra->kernel_interface,
|
||||
charon->kernel->del_sa(charon->kernel,
|
||||
this->other_addr, this->my_addr, this->my_spi,
|
||||
proto_ike2ip(this->protocol), this->my_cpi,
|
||||
this->mark_in);
|
||||
}
|
||||
if (this->other_spi)
|
||||
{
|
||||
hydra->kernel_interface->del_sa(hydra->kernel_interface,
|
||||
charon->kernel->del_sa(charon->kernel,
|
||||
this->my_addr, this->other_addr, this->other_spi,
|
||||
proto_ike2ip(this->protocol), this->other_cpi,
|
||||
this->mark_out);
|
||||
@@ -1158,7 +1152,7 @@ METHOD(child_sa_t, destroy, void,
|
||||
|
||||
if (this->reqid_allocated)
|
||||
{
|
||||
if (hydra->kernel_interface->release_reqid(hydra->kernel_interface,
|
||||
if (charon->kernel->release_reqid(charon->kernel,
|
||||
this->reqid, this->mark_in, this->mark_out) != SUCCESS)
|
||||
{
|
||||
DBG1(DBG_CHD, "releasing reqid %u failed", this->reqid);
|
||||
|
||||
+11
-14
@@ -46,7 +46,6 @@
|
||||
#include "ike_sa.h"
|
||||
|
||||
#include <library.h>
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <collections/array.h>
|
||||
#include <utils/lexparser.h>
|
||||
@@ -803,12 +802,12 @@ METHOD(ike_sa_t, add_virtual_ip, void,
|
||||
{
|
||||
char *iface;
|
||||
|
||||
if (hydra->kernel_interface->get_interface(hydra->kernel_interface,
|
||||
this->my_host, &iface))
|
||||
if (charon->kernel->get_interface(charon->kernel, this->my_host,
|
||||
&iface))
|
||||
{
|
||||
DBG1(DBG_IKE, "installing new virtual IP %H", ip);
|
||||
if (hydra->kernel_interface->add_ip(hydra->kernel_interface,
|
||||
ip, -1, iface) == SUCCESS)
|
||||
if (charon->kernel->add_ip(charon->kernel, ip, -1,
|
||||
iface) == SUCCESS)
|
||||
{
|
||||
array_insert_create(&this->my_vips, ARRAY_TAIL, ip->clone(ip));
|
||||
}
|
||||
@@ -845,8 +844,7 @@ METHOD(ike_sa_t, clear_virtual_ips, void,
|
||||
{
|
||||
if (local)
|
||||
{
|
||||
hydra->kernel_interface->del_ip(hydra->kernel_interface,
|
||||
vip, -1, TRUE);
|
||||
charon->kernel->del_ip(charon->kernel, vip, -1, TRUE);
|
||||
}
|
||||
vip->destroy(vip);
|
||||
}
|
||||
@@ -1282,8 +1280,8 @@ static void resolve_hosts(private_ike_sa_t *this)
|
||||
!this->other_host->is_anyaddr(this->other_host))
|
||||
{
|
||||
host->destroy(host);
|
||||
host = hydra->kernel_interface->get_source_addr(
|
||||
hydra->kernel_interface, this->other_host, NULL);
|
||||
host = charon->kernel->get_source_addr(charon->kernel,
|
||||
this->other_host, NULL);
|
||||
if (host)
|
||||
{
|
||||
host->set_port(host, this->ike_cfg->get_my_port(this->ike_cfg));
|
||||
@@ -2084,8 +2082,8 @@ static bool is_current_path_valid(private_ike_sa_t *this)
|
||||
{
|
||||
bool valid = FALSE;
|
||||
host_t *src;
|
||||
src = hydra->kernel_interface->get_source_addr(hydra->kernel_interface,
|
||||
this->other_host, this->my_host);
|
||||
src = charon->kernel->get_source_addr(charon->kernel, this->other_host,
|
||||
this->my_host);
|
||||
if (src)
|
||||
{
|
||||
if (src->ip_equals(src, this->my_host))
|
||||
@@ -2129,8 +2127,7 @@ static bool is_any_path_valid(private_ike_sa_t *this)
|
||||
continue;
|
||||
}
|
||||
DBG1(DBG_IKE, "looking for a route to %H ...", addr);
|
||||
src = hydra->kernel_interface->get_source_addr(
|
||||
hydra->kernel_interface, addr, NULL);
|
||||
src = charon->kernel->get_source_addr(charon->kernel, addr, NULL);
|
||||
if (src)
|
||||
{
|
||||
break;
|
||||
@@ -2418,7 +2415,7 @@ METHOD(ike_sa_t, destroy, void,
|
||||
}
|
||||
while (array_remove(this->my_vips, ARRAY_TAIL, &vip))
|
||||
{
|
||||
hydra->kernel_interface->del_ip(hydra->kernel_interface, vip, -1, TRUE);
|
||||
charon->kernel->del_ip(charon->kernel, vip, -1, TRUE);
|
||||
vip->destroy(vip);
|
||||
}
|
||||
if (array_count(this->other_vips))
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <sa/ikev1/keymat_v1.h>
|
||||
#include <config/peer_cfg.h>
|
||||
@@ -104,7 +103,7 @@ static bool force_encap(ike_cfg_t *ike_cfg)
|
||||
{
|
||||
if (!ike_cfg->force_encap(ike_cfg))
|
||||
{
|
||||
return hydra->kernel_interface->get_features(hydra->kernel_interface) &
|
||||
return charon->kernel->get_features(charon->kernel) &
|
||||
KERNEL_REQUIRE_UDP_ENCAPSULATION;
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "xauth.h"
|
||||
|
||||
#include <daemon.h>
|
||||
#include <hydra.h>
|
||||
#include <encoding/payloads/cp_payload.h>
|
||||
#include <processing/jobs/adopt_children_job.h>
|
||||
#include <sa/ikev1/tasks/mode_config.h>
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "child_create.h"
|
||||
|
||||
#include <daemon.h>
|
||||
#include <hydra.h>
|
||||
#include <sa/ikev2/keymat_v2.h>
|
||||
#include <crypto/diffie_hellman.h>
|
||||
#include <credentials/certificates/x509.h>
|
||||
@@ -786,7 +785,7 @@ static bool build_payloads(private_child_create_t *this, message_t *message)
|
||||
break;
|
||||
}
|
||||
|
||||
features = hydra->kernel_interface->get_features(hydra->kernel_interface);
|
||||
features = charon->kernel->get_features(charon->kernel);
|
||||
if (!(features & KERNEL_ESP_V3_TFC))
|
||||
{
|
||||
message->add_notify(message, FALSE, ESP_TFC_PADDING_NOT_SUPPORTED,
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <config/peer_cfg.h>
|
||||
#include <encoding/payloads/id_payload.h>
|
||||
@@ -135,8 +134,8 @@ static void gather_and_add_endpoints(private_ike_me_t *this, message_t *message)
|
||||
host = this->ike_sa->get_my_host(this->ike_sa);
|
||||
port = host->get_port(host);
|
||||
|
||||
enumerator = hydra->kernel_interface->create_address_enumerator(
|
||||
hydra->kernel_interface, ADDR_TYPE_REGULAR);
|
||||
enumerator = charon->kernel->create_address_enumerator(charon->kernel,
|
||||
ADDR_TYPE_REGULAR);
|
||||
while (enumerator->enumerate(enumerator, (void**)&addr))
|
||||
{
|
||||
host = addr->clone(addr);
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <sa/ikev2/tasks/ike_natd.h>
|
||||
#include <encoding/payloads/notify_payload.h>
|
||||
@@ -196,8 +195,8 @@ static void build_address_list(private_ike_mobike_t *this, message_t *message)
|
||||
int added = 0;
|
||||
|
||||
me = this->ike_sa->get_my_host(this->ike_sa);
|
||||
enumerator = hydra->kernel_interface->create_address_enumerator(
|
||||
hydra->kernel_interface, ADDR_TYPE_REGULAR);
|
||||
enumerator = charon->kernel->create_address_enumerator(charon->kernel,
|
||||
ADDR_TYPE_REGULAR);
|
||||
while (enumerator->enumerate(enumerator, (void**)&host))
|
||||
{
|
||||
if (me->ip_equals(me, host))
|
||||
@@ -333,8 +332,7 @@ METHOD(ike_mobike_t, transmit, bool,
|
||||
|
||||
if (!this->check)
|
||||
{
|
||||
me = hydra->kernel_interface->get_source_addr(hydra->kernel_interface,
|
||||
other_old, me_old);
|
||||
me = charon->kernel->get_source_addr(charon->kernel, other_old, me_old);
|
||||
if (me)
|
||||
{
|
||||
if (me->ip_equals(me, me_old))
|
||||
@@ -372,8 +370,7 @@ METHOD(ike_mobike_t, transmit, bool,
|
||||
{
|
||||
continue;
|
||||
}
|
||||
me = hydra->kernel_interface->get_source_addr(
|
||||
hydra->kernel_interface, other, NULL);
|
||||
me = charon->kernel->get_source_addr(charon->kernel, other, NULL);
|
||||
if (me)
|
||||
{
|
||||
/* reuse port for an active address, 4500 otherwise */
|
||||
@@ -407,7 +404,7 @@ METHOD(task_t, build_i, status_t,
|
||||
|
||||
/* we check if the existing address is still valid */
|
||||
old = message->get_source(message);
|
||||
new = hydra->kernel_interface->get_source_addr(hydra->kernel_interface,
|
||||
new = charon->kernel->get_source_addr(charon->kernel,
|
||||
message->get_destination(message), old);
|
||||
if (new)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <config/peer_cfg.h>
|
||||
#include <crypto/hashers/hasher.h>
|
||||
@@ -86,7 +85,7 @@ static bool force_encap(ike_cfg_t *ike_cfg)
|
||||
{
|
||||
if (!ike_cfg->force_encap(ike_cfg))
|
||||
{
|
||||
return hydra->kernel_interface->get_features(hydra->kernel_interface) &
|
||||
return charon->kernel->get_features(charon->kernel) &
|
||||
KERNEL_REQUIRE_UDP_ENCAPSULATION;
|
||||
}
|
||||
return TRUE;
|
||||
@@ -327,7 +326,7 @@ METHOD(task_t, build_i, status_t,
|
||||
}
|
||||
else
|
||||
{
|
||||
host = hydra->kernel_interface->get_source_addr(hydra->kernel_interface,
|
||||
host = charon->kernel->get_source_addr(charon->kernel,
|
||||
this->ike_sa->get_other_host(this->ike_sa), NULL);
|
||||
if (host)
|
||||
{ /* 2. */
|
||||
@@ -341,8 +340,8 @@ METHOD(task_t, build_i, status_t,
|
||||
}
|
||||
else
|
||||
{ /* 3. */
|
||||
enumerator = hydra->kernel_interface->create_address_enumerator(
|
||||
hydra->kernel_interface, ADDR_TYPE_REGULAR);
|
||||
enumerator = charon->kernel->create_address_enumerator(
|
||||
charon->kernel, ADDR_TYPE_REGULAR);
|
||||
while (enumerator->enumerate(enumerator, (void**)&host))
|
||||
{
|
||||
/* apply port 500 to host, but work on a copy */
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
#include "shunt_manager.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <threading/rwlock.h>
|
||||
#include <threading/rwlock_condvar.h>
|
||||
@@ -111,22 +110,22 @@ static bool install_shunt_policy(child_cfg_t *child)
|
||||
continue;
|
||||
}
|
||||
/* install out policy */
|
||||
status |= hydra->kernel_interface->add_policy(
|
||||
hydra->kernel_interface, host_any, host_any,
|
||||
status |= charon->kernel->add_policy(charon->kernel,
|
||||
host_any, host_any,
|
||||
my_ts, other_ts, POLICY_OUT, policy_type,
|
||||
&sa, child->get_mark(child, FALSE),
|
||||
policy_prio);
|
||||
|
||||
/* install in policy */
|
||||
status |= hydra->kernel_interface->add_policy(
|
||||
hydra->kernel_interface, host_any, host_any,
|
||||
status |= charon->kernel->add_policy(charon->kernel,
|
||||
host_any, host_any,
|
||||
other_ts, my_ts, POLICY_IN, policy_type,
|
||||
&sa, child->get_mark(child, TRUE),
|
||||
policy_prio);
|
||||
|
||||
/* install forward policy */
|
||||
status |= hydra->kernel_interface->add_policy(
|
||||
hydra->kernel_interface, host_any, host_any,
|
||||
status |= charon->kernel->add_policy(charon->kernel,
|
||||
host_any, host_any,
|
||||
other_ts, my_ts, POLICY_FWD, policy_type,
|
||||
&sa, child->get_mark(child, TRUE),
|
||||
policy_prio);
|
||||
@@ -248,22 +247,22 @@ static void uninstall_shunt_policy(child_cfg_t *child)
|
||||
continue;
|
||||
}
|
||||
/* uninstall out policy */
|
||||
status |= hydra->kernel_interface->del_policy(
|
||||
hydra->kernel_interface, host_any, host_any,
|
||||
status |= charon->kernel->del_policy(charon->kernel,
|
||||
host_any, host_any,
|
||||
my_ts, other_ts, POLICY_OUT, policy_type,
|
||||
&sa, child->get_mark(child, FALSE),
|
||||
policy_prio);
|
||||
|
||||
/* uninstall in policy */
|
||||
status |= hydra->kernel_interface->del_policy(
|
||||
hydra->kernel_interface, host_any, host_any,
|
||||
status |= charon->kernel->del_policy(charon->kernel,
|
||||
host_any, host_any,
|
||||
other_ts, my_ts, POLICY_IN, policy_type,
|
||||
&sa, child->get_mark(child, TRUE),
|
||||
policy_prio);
|
||||
|
||||
/* uninstall forward policy */
|
||||
status |= hydra->kernel_interface->del_policy(
|
||||
hydra->kernel_interface, host_any, host_any,
|
||||
status |= charon->kernel->del_policy(charon->kernel,
|
||||
host_any, host_any,
|
||||
other_ts, my_ts, POLICY_FWD, policy_type,
|
||||
&sa, child->get_mark(child, TRUE),
|
||||
policy_prio);
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
#include "trap_manager.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <threading/mutex.h>
|
||||
#include <threading/rwlock.h>
|
||||
@@ -195,8 +194,7 @@ METHOD(trap_manager_t, install, u_int32_t,
|
||||
if (!me || me->is_anyaddr(me))
|
||||
{
|
||||
DESTROY_IF(me);
|
||||
me = hydra->kernel_interface->get_source_addr(
|
||||
hydra->kernel_interface, other, NULL);
|
||||
me = charon->kernel->get_source_addr(charon->kernel, other, NULL);
|
||||
if (!me)
|
||||
{
|
||||
DBG1(DBG_CFG, "installing trap failed, local address unknown");
|
||||
|
||||
Reference in New Issue
Block a user