Merge branch 'libhydra-bye-bye'
Moves kernel plugins to libcharon and removes the unused libhydra. The kernel interface is now accessible under charon->kernel.
This commit is contained in:
@@ -97,7 +97,6 @@ strongswan_CFLAGS += \
|
||||
strongswan_BUILD := \
|
||||
charon \
|
||||
libcharon \
|
||||
libhydra \
|
||||
libstrongswan \
|
||||
libtncif \
|
||||
libtnccs \
|
||||
|
||||
+10
-18
@@ -1280,9 +1280,8 @@ cmd_plugins=
|
||||
aikgen_plugins=
|
||||
|
||||
# location specific lists for checksumming,
|
||||
# for src/libcharon, src/libhydra, src/libstrongswan and src/libtnccs
|
||||
# for src/libcharon, src/libstrongswan and src/libtnccs
|
||||
c_plugins=
|
||||
h_plugins=
|
||||
s_plugins=
|
||||
t_plugins=
|
||||
|
||||
@@ -1347,9 +1346,9 @@ ADD_PLUGIN([load-tester], [c charon])
|
||||
ADD_PLUGIN([kernel-libipsec], [c charon cmd])
|
||||
ADD_PLUGIN([kernel-wfp], [c charon])
|
||||
ADD_PLUGIN([kernel-iph], [c charon])
|
||||
ADD_PLUGIN([kernel-pfkey], [h charon starter nm cmd])
|
||||
ADD_PLUGIN([kernel-pfroute], [h charon starter nm cmd])
|
||||
ADD_PLUGIN([kernel-netlink], [h charon starter nm cmd])
|
||||
ADD_PLUGIN([kernel-pfkey], [c charon starter nm cmd])
|
||||
ADD_PLUGIN([kernel-pfroute], [c charon starter nm cmd])
|
||||
ADD_PLUGIN([kernel-netlink], [c charon starter nm cmd])
|
||||
ADD_PLUGIN([resolve], [c charon cmd])
|
||||
ADD_PLUGIN([socket-default], [c charon nm cmd])
|
||||
ADD_PLUGIN([socket-dynamic], [c charon cmd])
|
||||
@@ -1511,6 +1510,9 @@ AM_CONDITIONAL(USE_UPDOWN, test x$updown = xtrue)
|
||||
AM_CONDITIONAL(USE_DHCP, test x$dhcp = xtrue)
|
||||
AM_CONDITIONAL(USE_LOAD_TESTER, test x$load_tester = xtrue)
|
||||
AM_CONDITIONAL(USE_HA, test x$ha = xtrue)
|
||||
AM_CONDITIONAL(USE_KERNEL_NETLINK, test x$kernel_netlink = xtrue)
|
||||
AM_CONDITIONAL(USE_KERNEL_PFKEY, test x$kernel_pfkey = xtrue)
|
||||
AM_CONDITIONAL(USE_KERNEL_PFROUTE, test x$kernel_pfroute = xtrue)
|
||||
AM_CONDITIONAL(USE_KERNEL_LIBIPSEC, test x$kernel_libipsec = xtrue)
|
||||
AM_CONDITIONAL(USE_KERNEL_WFP, test x$kernel_wfp = xtrue)
|
||||
AM_CONDITIONAL(USE_KERNEL_IPH, test x$kernel_iph = xtrue)
|
||||
@@ -1578,12 +1580,6 @@ AM_CONDITIONAL(USE_RESOLVE, test x$resolve = xtrue)
|
||||
AM_CONDITIONAL(USE_ATTR, test x$attr = xtrue)
|
||||
AM_CONDITIONAL(USE_ATTR_SQL, test x$attr_sql = xtrue)
|
||||
|
||||
# hydra plugins
|
||||
# ---------------
|
||||
AM_CONDITIONAL(USE_KERNEL_NETLINK, test x$kernel_netlink = xtrue)
|
||||
AM_CONDITIONAL(USE_KERNEL_PFKEY, test x$kernel_pfkey = xtrue)
|
||||
AM_CONDITIONAL(USE_KERNEL_PFROUTE, test x$kernel_pfroute = xtrue)
|
||||
|
||||
# other options
|
||||
# ---------------
|
||||
AM_CONDITIONAL(USE_LEAK_DETECTIVE, test x$leak_detective = xtrue)
|
||||
@@ -1605,7 +1601,6 @@ AM_CONDITIONAL(USE_SCEPCLIENT, test x$scepclient = xtrue)
|
||||
AM_CONDITIONAL(USE_SCRIPTS, test x$scripts = xtrue)
|
||||
AM_CONDITIONAL(USE_CONFTEST, test x$conftest = xtrue)
|
||||
AM_CONDITIONAL(USE_LIBSTRONGSWAN, test x$charon = xtrue -o x$pki = xtrue -o x$scepclient = xtrue -o x$conftest = xtrue -o x$fast = xtrue -o x$imcv = xtrue -o x$nm = xtrue -o x$tkm = xtrue -o x$cmd = xtrue -o x$tls = xtrue -o x$tnc_tnccs = xtrue -o x$aikgen = xtrue -o x$svc = xtrue -o x$systemd = xtrue)
|
||||
AM_CONDITIONAL(USE_LIBHYDRA, test x$charon = xtrue -o x$nm = xtrue -o x$tkm = xtrue -o x$cmd = xtrue -o x$svc = xtrue -o x$systemd = xtrue)
|
||||
AM_CONDITIONAL(USE_LIBCHARON, test x$charon = xtrue -o x$conftest = xtrue -o x$nm = xtrue -o x$tkm = xtrue -o x$cmd = xtrue -o x$svc = xtrue -o x$systemd = xtrue)
|
||||
AM_CONDITIONAL(USE_LIBIPSEC, test x$libipsec = xtrue)
|
||||
AM_CONDITIONAL(USE_LIBTNCIF, test x$tnc_tnccs = xtrue -o x$imcv = xtrue)
|
||||
@@ -1748,11 +1743,6 @@ AC_CONFIG_FILES([
|
||||
src/libstrongswan/plugins/bliss/tests/Makefile
|
||||
src/libstrongswan/plugins/test_vectors/Makefile
|
||||
src/libstrongswan/tests/Makefile
|
||||
src/libhydra/Makefile
|
||||
src/libhydra/plugins/kernel_netlink/Makefile
|
||||
src/libhydra/plugins/kernel_pfkey/Makefile
|
||||
src/libhydra/plugins/kernel_pfroute/Makefile
|
||||
src/libhydra/tests/Makefile
|
||||
src/libipsec/Makefile
|
||||
src/libipsec/tests/Makefile
|
||||
src/libsimaka/Makefile
|
||||
@@ -1828,6 +1818,9 @@ AC_CONFIG_FILES([
|
||||
src/libcharon/plugins/unity/Makefile
|
||||
src/libcharon/plugins/uci/Makefile
|
||||
src/libcharon/plugins/ha/Makefile
|
||||
src/libcharon/plugins/kernel_netlink/Makefile
|
||||
src/libcharon/plugins/kernel_pfkey/Makefile
|
||||
src/libcharon/plugins/kernel_pfroute/Makefile
|
||||
src/libcharon/plugins/kernel_libipsec/Makefile
|
||||
src/libcharon/plugins/kernel_wfp/Makefile
|
||||
src/libcharon/plugins/kernel_iph/Makefile
|
||||
@@ -1922,6 +1915,5 @@ AC_MSG_RESULT([-----------------------------------------------------])
|
||||
|
||||
AC_MSG_RESULT([libstrongswan:$s_plugins])
|
||||
AC_MSG_RESULT([libcharon: $c_plugins])
|
||||
AC_MSG_RESULT([libhydra: $h_plugins])
|
||||
AC_MSG_RESULT([libtnccs: $t_plugins])
|
||||
AC_MSG_RESULT([])
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
etc
|
||||
# libraries
|
||||
usr/lib/ipsec/libstrongswan.so*
|
||||
usr/lib/ipsec/libhydra.so*
|
||||
usr/lib/ipsec/libcharon.so*
|
||||
# starter etc.
|
||||
usr/sbin/ipsec
|
||||
|
||||
@@ -2,7 +2,6 @@ etc/strongswan.conf etc/
|
||||
usr/lib/strongswan/libstrongswan.so* usr/lib/strongswan/
|
||||
usr/lib/strongswan/libcharon.so* usr/lib/strongswan/
|
||||
usr/lib/strongswan/libtls.so* usr/lib/strongswan/
|
||||
usr/lib/strongswan/libhydra.so* usr/lib/strongswan/
|
||||
usr/lib/strongswan/plugins/libstrongswan-x509.so* usr/lib/strongswan/plugins/
|
||||
usr/lib/strongswan/plugins/libstrongswan-pubkey.so* usr/lib/strongswan/plugins/
|
||||
usr/lib/strongswan/plugins/libstrongswan-xcbc.so* usr/lib/strongswan/plugins/
|
||||
|
||||
@@ -4,10 +4,6 @@ if USE_LIBSTRONGSWAN
|
||||
SUBDIRS += libstrongswan
|
||||
endif
|
||||
|
||||
if USE_LIBHYDRA
|
||||
SUBDIRS += libhydra
|
||||
endif
|
||||
|
||||
if USE_LIBIPSEC
|
||||
SUBDIRS += libipsec
|
||||
endif
|
||||
|
||||
@@ -12,7 +12,6 @@ charon-cmd.o : $(top_builddir)/config.status
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-DIPSEC_DIR=\"${ipsecdir}\" \
|
||||
-DIPSEC_PIDDIR=\"${piddir}\" \
|
||||
@@ -20,6 +19,5 @@ AM_CPPFLAGS = \
|
||||
|
||||
charon_cmd_LDADD = \
|
||||
$(top_builddir)/src/libstrongswan/libstrongswan.la \
|
||||
$(top_builddir)/src/libhydra/libhydra.la \
|
||||
$(top_builddir)/src/libcharon/libcharon.la \
|
||||
-lm $(PTHREADLIB) $(DLLIB)
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include <library.h>
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <utils/backtrace.h>
|
||||
#include <threading/thread.h>
|
||||
@@ -330,11 +329,6 @@ int main(int argc, char *argv[])
|
||||
exit(SS_RC_DAEMON_INTEGRITY);
|
||||
}
|
||||
}
|
||||
atexit(libhydra_deinit);
|
||||
if (!libhydra_init())
|
||||
{
|
||||
exit(SS_RC_INITIALIZATION_FAILED);
|
||||
}
|
||||
atexit(libcharon_deinit);
|
||||
if (!libcharon_init())
|
||||
{
|
||||
|
||||
@@ -9,7 +9,6 @@ charon_nm_SOURCES = \
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-DIPSEC_DIR=\"${ipsecdir}\" \
|
||||
-DIPSEC_PIDDIR=\"${piddir}\" \
|
||||
@@ -21,6 +20,5 @@ AM_CFLAGS = \
|
||||
|
||||
charon_nm_LDADD = \
|
||||
$(top_builddir)/src/libstrongswan/libstrongswan.la \
|
||||
$(top_builddir)/src/libhydra/libhydra.la \
|
||||
$(top_builddir)/src/libcharon/libcharon.la \
|
||||
-lm $(PTHREADLIB) $(DLLIB) ${nm_LIBS}
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
|
||||
#include <library.h>
|
||||
@@ -177,14 +176,6 @@ int main(int argc, char *argv[])
|
||||
exit(SS_RC_DAEMON_INTEGRITY);
|
||||
}
|
||||
|
||||
if (!libhydra_init())
|
||||
{
|
||||
dbg_syslog(DBG_DMN, 1, "initialization failed - aborting charon-nm");
|
||||
libhydra_deinit();
|
||||
library_deinit();
|
||||
exit(SS_RC_INITIALIZATION_FAILED);
|
||||
}
|
||||
|
||||
if (!libcharon_init())
|
||||
{
|
||||
dbg_syslog(DBG_DMN, 1, "initialization failed - aborting charon-nm");
|
||||
@@ -212,7 +203,6 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
DBG1(DBG_DMN, "integrity tests enabled:");
|
||||
DBG1(DBG_DMN, "lib 'libstrongswan': passed file and segment integrity tests");
|
||||
DBG1(DBG_DMN, "lib 'libhydra': passed file and segment integrity tests");
|
||||
DBG1(DBG_DMN, "lib 'libcharon': passed file and segment integrity tests");
|
||||
DBG1(DBG_DMN, "daemon 'charon-nm': passed file integrity test");
|
||||
}
|
||||
@@ -260,7 +250,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
deinit:
|
||||
libcharon_deinit();
|
||||
libhydra_deinit();
|
||||
library_deinit();
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -6,11 +6,9 @@ charon-svc.o : $(top_builddir)/config.status
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-DPLUGINS=\""${charon_plugins}\""
|
||||
|
||||
charon_svc_LDADD = \
|
||||
$(top_builddir)/src/libstrongswan/libstrongswan.la \
|
||||
$(top_builddir)/src/libhydra/libhydra.la \
|
||||
$(top_builddir)/src/libcharon/libcharon.la
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
*/
|
||||
|
||||
#include <library.h>
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
|
||||
#include <utils/backtrace.h>
|
||||
@@ -210,28 +209,22 @@ static void init_and_run(DWORD dwArgc, LPTSTR *lpszArgv, int (*wait)())
|
||||
if (library_init(NULL, SERVICE_NAME))
|
||||
{
|
||||
update_status(SERVICE_START_PENDING);
|
||||
if (libhydra_init())
|
||||
if (libcharon_init())
|
||||
{
|
||||
charon->load_loggers(charon, levels, TRUE);
|
||||
print_version();
|
||||
update_status(SERVICE_START_PENDING);
|
||||
if (libcharon_init())
|
||||
if (charon->initialize(charon, PLUGINS))
|
||||
{
|
||||
charon->load_loggers(charon, levels, TRUE);
|
||||
print_version();
|
||||
update_status(SERVICE_START_PENDING);
|
||||
if (charon->initialize(charon, PLUGINS))
|
||||
{
|
||||
update_status(SERVICE_START_PENDING);
|
||||
lib->plugins->status(lib->plugins, LEVEL_CTRL);
|
||||
lib->plugins->status(lib->plugins, LEVEL_CTRL);
|
||||
|
||||
charon->start(charon);
|
||||
charon->start(charon);
|
||||
|
||||
status.dwWin32ExitCode = wait();
|
||||
}
|
||||
update_status(SERVICE_STOP_PENDING);
|
||||
libcharon_deinit();
|
||||
status.dwWin32ExitCode = wait();
|
||||
}
|
||||
update_status(SERVICE_STOP_PENDING);
|
||||
libhydra_deinit();
|
||||
libcharon_deinit();
|
||||
}
|
||||
update_status(SERVICE_STOP_PENDING);
|
||||
library_deinit();
|
||||
|
||||
@@ -7,13 +7,11 @@ charon-systemd.o : $(top_builddir)/config.status
|
||||
|
||||
charon_systemd_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
$(systemd_CFLAGS) $(systemd_daemon_CFLAGS) $(systemd_journal_CFLAGS) \
|
||||
-DPLUGINS=\""${charon_plugins}\""
|
||||
|
||||
charon_systemd_LDADD = \
|
||||
$(top_builddir)/src/libstrongswan/libstrongswan.la \
|
||||
$(top_builddir)/src/libhydra/libhydra.la \
|
||||
$(top_builddir)/src/libcharon/libcharon.la \
|
||||
$(systemd_LIBS) $(systemd_daemon_LIBS) $(systemd_journal_LIBS) -lm $(PTHREADLIB) $(DLLIB)
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include <systemd/sd-daemon.h>
|
||||
#include <systemd/sd-journal.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
|
||||
#include <library.h>
|
||||
@@ -355,12 +354,6 @@ int main(int argc, char *argv[])
|
||||
sd_notifyf(0, "STATUS=integrity check of charon-systemd failed");
|
||||
return SS_RC_INITIALIZATION_FAILED;
|
||||
}
|
||||
atexit(libhydra_deinit);
|
||||
if (!libhydra_init())
|
||||
{
|
||||
sd_notifyf(0, "STATUS=libhydra initialization failed");
|
||||
return SS_RC_INITIALIZATION_FAILED;
|
||||
}
|
||||
atexit(libcharon_deinit);
|
||||
if (!libcharon_init())
|
||||
{
|
||||
|
||||
@@ -4,15 +4,13 @@ OBJ = $(abs_top_builddir)/src
|
||||
AM_CPPFLAGS = \
|
||||
-include $(abs_top_builddir)/config.h \
|
||||
-I$(SRC)/libstrongswan \
|
||||
-I$(SRC)/libhydra \
|
||||
-I$(SRC)/libcharon
|
||||
|
||||
LIBLD = \
|
||||
-L$(OBJ)/libstrongswan/.libs \
|
||||
-L$(OBJ)/libhydra/.libs \
|
||||
-L$(OBJ)/libcharon/.libs
|
||||
LIBPT = $(OBJ)/libstrongswan/.libs:$(OBJ)/libhydra/.libs:$(OBJ)/libcharon/.libs
|
||||
LIBFL = -lstrongswan -lhydra -lcharon
|
||||
LIBPT = $(OBJ)/libstrongswan/.libs:$(OBJ)/libcharon/.libs
|
||||
LIBFL = -lstrongswan -lcharon
|
||||
|
||||
DEFS += -DPLUGINS=\""$(PLUGINS)\"" -DIPSEC_PIDDIR=\"${piddir}\"
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <libgen.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <library.h>
|
||||
#include <utils/backtrace.h>
|
||||
@@ -256,14 +255,6 @@ int main(int argc, char *argv[])
|
||||
exit(status);
|
||||
}
|
||||
|
||||
if (!libhydra_init())
|
||||
{
|
||||
dbg_syslog(DBG_DMN, 1, "initialization failed - aborting %s", dmn_name);
|
||||
libhydra_deinit();
|
||||
library_deinit();
|
||||
exit(status);
|
||||
}
|
||||
|
||||
if (!libcharon_init())
|
||||
{
|
||||
dbg_syslog(DBG_DMN, 1, "initialization failed - aborting %s", dmn_name);
|
||||
@@ -391,7 +382,6 @@ int main(int argc, char *argv[])
|
||||
deinit:
|
||||
destroy_dh_mapping();
|
||||
libcharon_deinit();
|
||||
libhydra_deinit();
|
||||
library_deinit();
|
||||
tkm_deinit();
|
||||
return status;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* for more details.
|
||||
*/
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <utils/debug.h>
|
||||
#include <tkm/constants.h>
|
||||
#include <tkm/types.h>
|
||||
@@ -25,8 +25,7 @@
|
||||
void charon_esa_acquire(result_type *res, const sp_id_type sp_id)
|
||||
{
|
||||
DBG1(DBG_KNL, "ees: acquire received for reqid %u", sp_id);
|
||||
hydra->kernel_interface->acquire(hydra->kernel_interface, sp_id, NULL,
|
||||
NULL);
|
||||
charon->kernel->acquire(charon->kernel, sp_id, NULL, NULL);
|
||||
*res = TKM_OK;
|
||||
}
|
||||
|
||||
@@ -47,6 +46,5 @@ void charon_esa_expire(result_type *res, const sp_id_type sp_id,
|
||||
|
||||
DBG1(DBG_KNL, "ees: expire received for reqid %u, spi %x, dst %H", sp_id,
|
||||
ntohl(spi_rem), dst);
|
||||
hydra->kernel_interface->expire(hydra->kernel_interface, protocol,
|
||||
spi_rem, dst, hard != 0);
|
||||
charon->kernel->expire(charon->kernel, protocol, spi_rem, dst, hard != 0);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <tests/test_suite.h>
|
||||
|
||||
#include <daemon.h>
|
||||
#include <hydra.h>
|
||||
#include <config/proposal.h>
|
||||
#include <encoding/payloads/ike_header.h>
|
||||
#include <tkm/client.h>
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include <tests/test_runner.h>
|
||||
|
||||
#include <library.h>
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
|
||||
#include "tkm.h"
|
||||
@@ -50,7 +49,6 @@ static bool test_runner_init(bool init)
|
||||
|
||||
if (init)
|
||||
{
|
||||
libhydra_init();
|
||||
libcharon_init();
|
||||
lib->settings->set_int(lib->settings,
|
||||
"test-runner.filelog.stdout.default", 0);
|
||||
@@ -74,8 +72,6 @@ static bool test_runner_init(bool init)
|
||||
|
||||
plugin_loader_add_plugindirs(BUILDDIR "/src/libstrongswan/plugins",
|
||||
PLUGINS);
|
||||
plugin_loader_add_plugindirs(BUILDDIR "/src/libhydra/plugins",
|
||||
PLUGINS);
|
||||
plugin_loader_add_plugindirs(BUILDDIR "/src/libcharon/plugins",
|
||||
PLUGINS);
|
||||
if (charon->initialize(charon, PLUGINS))
|
||||
@@ -95,7 +91,6 @@ static bool test_runner_init(bool init)
|
||||
|
||||
destroy_dh_mapping();
|
||||
libcharon_deinit();
|
||||
libhydra_deinit();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ charon.c
|
||||
# build charon -----------------------------------------------------------------
|
||||
|
||||
LOCAL_C_INCLUDES += \
|
||||
$(strongswan_PATH)/src/libhydra \
|
||||
$(strongswan_PATH)/src/libcharon \
|
||||
$(strongswan_PATH)/src/libstrongswan
|
||||
|
||||
@@ -23,7 +22,7 @@ LOCAL_ARM_MODE := arm
|
||||
|
||||
LOCAL_PRELINK_MODULE := false
|
||||
|
||||
LOCAL_SHARED_LIBRARIES += libstrongswan libhydra libcharon
|
||||
LOCAL_SHARED_LIBRARIES += libstrongswan libcharon
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ charon.o : $(top_builddir)/config.status
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-DIPSEC_DIR=\"${ipsecdir}\" \
|
||||
-DIPSEC_PIDDIR=\"${piddir}\" \
|
||||
@@ -15,7 +14,6 @@ AM_CPPFLAGS = \
|
||||
|
||||
charon_LDADD = \
|
||||
$(top_builddir)/src/libstrongswan/libstrongswan.la \
|
||||
$(top_builddir)/src/libhydra/libhydra.la \
|
||||
$(top_builddir)/src/libcharon/libcharon.la \
|
||||
-lm $(PTHREADLIB) $(DLLIB)
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
|
||||
#include <library.h>
|
||||
@@ -309,14 +308,6 @@ int main(int argc, char *argv[])
|
||||
exit(SS_RC_DAEMON_INTEGRITY);
|
||||
}
|
||||
|
||||
if (!libhydra_init())
|
||||
{
|
||||
dbg_stderr(DBG_DMN, 1, "initialization failed - aborting charon");
|
||||
libhydra_deinit();
|
||||
library_deinit();
|
||||
exit(SS_RC_INITIALIZATION_FAILED);
|
||||
}
|
||||
|
||||
if (!libcharon_init())
|
||||
{
|
||||
dbg_stderr(DBG_DMN, 1, "initialization failed - aborting charon");
|
||||
@@ -403,7 +394,6 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
DBG1(DBG_DMN, "integrity tests enabled:");
|
||||
DBG1(DBG_DMN, "lib 'libstrongswan': passed file and segment integrity tests");
|
||||
DBG1(DBG_DMN, "lib 'libhydra': passed file and segment integrity tests");
|
||||
DBG1(DBG_DMN, "lib 'libcharon': passed file and segment integrity tests");
|
||||
DBG1(DBG_DMN, "daemon 'charon': passed file integrity test");
|
||||
}
|
||||
@@ -457,7 +447,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
deinit:
|
||||
libcharon_deinit();
|
||||
libhydra_deinit();
|
||||
library_deinit();
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ EXTRA_PROGRAMS = checksum_builder
|
||||
checksum_builder_SOURCES = checksum_builder.c
|
||||
checksum_builder_LDADD = \
|
||||
$(top_builddir)/src/libstrongswan/libstrongswan.la \
|
||||
$(top_builddir)/src/libhydra/libhydra.la \
|
||||
$(top_builddir)/src/libcharon/libcharon.la \
|
||||
$(DLLIB)
|
||||
checksum_builder_LDFLAGS = -rpath '$(DESTDIR)$(ipseclibdir)'
|
||||
@@ -17,7 +16,6 @@ CLEANFILES = checksum.c $(EXTRA_PROGRAMS)
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-DPLUGINDIR=\"${DESTDIR}${plugindir}\"
|
||||
|
||||
@@ -35,14 +33,6 @@ if !MONOLITHIC
|
||||
AM_CPPFLAGS += -DS_PLUGINS=\""${s_plugins}\""
|
||||
endif
|
||||
|
||||
if USE_LIBHYDRA
|
||||
deps += $(top_builddir)/src/libhydra/libhydra.la
|
||||
libs += $(DESTDIR)$(ipseclibdir)/libhydra.so
|
||||
if !MONOLITHIC
|
||||
AM_CPPFLAGS += -DH_PLUGINS=\""${h_plugins}\""
|
||||
endif
|
||||
endif
|
||||
|
||||
if USE_LIBIPSEC
|
||||
deps += $(top_builddir)/src/libipsec/libipsec.la
|
||||
libs += $(DESTDIR)$(ipseclibdir)/libipsec.so
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include <library.h>
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <collections/enumerator.h>
|
||||
|
||||
@@ -128,9 +127,8 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
int i;
|
||||
|
||||
/* forces link against libhydra/libcharon, imports symbols needed to
|
||||
/* forces link against libcharon, imports symbols needed to
|
||||
* dlopen plugins */
|
||||
hydra = NULL;
|
||||
charon = NULL;
|
||||
|
||||
/* avoid confusing leak reports in build process */
|
||||
@@ -159,9 +157,6 @@ int main(int argc, char* argv[])
|
||||
#ifdef S_PLUGINS
|
||||
build_plugin_checksums(S_PLUGINS);
|
||||
#endif
|
||||
#ifdef H_PLUGINS
|
||||
build_plugin_checksums(H_PLUGINS);
|
||||
#endif
|
||||
#ifdef T_PLUGINS
|
||||
build_plugin_checksums(T_PLUGINS);
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,6 @@ ipsec_PROGRAMS = conftest
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-DPLUGINS=\""${charon_plugins}\""
|
||||
|
||||
@@ -20,7 +19,6 @@ conftest_SOURCES = conftest.c conftest.h config.c config.h actions.c actions.h \
|
||||
|
||||
conftest_LDADD = \
|
||||
$(top_builddir)/src/libstrongswan/libstrongswan.la \
|
||||
$(top_builddir)/src/libhydra/libhydra.la \
|
||||
$(top_builddir)/src/libcharon/libcharon.la \
|
||||
-lm $(PTHREADLIB) $(DLLIB)
|
||||
|
||||
|
||||
@@ -356,7 +356,6 @@ static void cleanup()
|
||||
free(conftest->suite_dir);
|
||||
free(conftest);
|
||||
libcharon_deinit();
|
||||
libhydra_deinit();
|
||||
library_deinit();
|
||||
}
|
||||
|
||||
@@ -442,16 +441,9 @@ int main(int argc, char *argv[])
|
||||
library_deinit();
|
||||
return SS_RC_LIBSTRONGSWAN_INTEGRITY;
|
||||
}
|
||||
if (!libhydra_init())
|
||||
{
|
||||
libhydra_deinit();
|
||||
library_deinit();
|
||||
return SS_RC_INITIALIZATION_FAILED;
|
||||
}
|
||||
if (!libcharon_init())
|
||||
{
|
||||
libcharon_deinit();
|
||||
libhydra_deinit();
|
||||
library_deinit();
|
||||
return SS_RC_INITIALIZATION_FAILED;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#define CONFTEST_H_
|
||||
|
||||
#include <library.h>
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <credentials/sets/mem_cred.h>
|
||||
|
||||
|
||||
-1
@@ -848,7 +848,6 @@ public class CharonVpnService extends VpnService implements Runnable
|
||||
System.loadLibrary("imcv");
|
||||
}
|
||||
|
||||
System.loadLibrary("hydra");
|
||||
System.loadLibrary("charon");
|
||||
System.loadLibrary("ipsec");
|
||||
}
|
||||
|
||||
@@ -71,7 +71,6 @@ strongswan_BUILD := \
|
||||
libandroidbridge \
|
||||
strongswan/src/libipsec \
|
||||
strongswan/src/libcharon \
|
||||
strongswan/src/libhydra \
|
||||
strongswan/src/libstrongswan
|
||||
|
||||
ifneq ($(strongswan_USE_BYOD),)
|
||||
|
||||
@@ -25,7 +25,6 @@ endif
|
||||
|
||||
LOCAL_C_INCLUDES += \
|
||||
$(strongswan_PATH)/src/libipsec \
|
||||
$(strongswan_PATH)/src/libhydra \
|
||||
$(strongswan_PATH)/src/libcharon \
|
||||
$(strongswan_PATH)/src/libstrongswan
|
||||
|
||||
@@ -54,7 +53,7 @@ LOCAL_PRELINK_MODULE := false
|
||||
|
||||
LOCAL_LDLIBS := -llog
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := libstrongswan libhydra libipsec libcharon
|
||||
LOCAL_SHARED_LIBRARIES := libstrongswan libipsec libcharon
|
||||
|
||||
ifneq ($(strongswan_USE_BYOD),)
|
||||
LOCAL_SHARED_LIBRARIES += libimcv libtncif libtnccs
|
||||
|
||||
@@ -37,7 +37,6 @@ static struct {
|
||||
{ "libtnccs.so", NULL },
|
||||
{ "libimcv.so", NULL },
|
||||
#endif
|
||||
{ "libhydra.so", NULL },
|
||||
{ "libcharon.so", NULL },
|
||||
{ "libipsec.so", NULL },
|
||||
};
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "android_attr.h"
|
||||
#include "../charonservice.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <utils/debug.h>
|
||||
#include <library.h>
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "android_dns_proxy.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <threading/rwlock.h>
|
||||
#include <collections/hashtable.h>
|
||||
#include <processing/jobs/callback_job.h>
|
||||
@@ -121,8 +121,7 @@ static int open_socket(int family)
|
||||
DBG1(DBG_NET, "could not open proxy socket: %s", strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
if (!hydra->kernel_interface->bypass_socket(hydra->kernel_interface,
|
||||
skt, family))
|
||||
if (!charon->kernel->bypass_socket(charon->kernel, skt, family))
|
||||
{
|
||||
DBG1(DBG_NET, "installing bypass policy for proxy socket failed");
|
||||
close(skt);
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#endif
|
||||
|
||||
#include <daemon.h>
|
||||
#include <hydra.h>
|
||||
#include <ipsec.h>
|
||||
#include <library.h>
|
||||
#include <threading/thread.h>
|
||||
@@ -606,17 +605,9 @@ JNI_METHOD(CharonVpnService, initializeCharon, jboolean,
|
||||
set_options(logfile);
|
||||
free(logfile);
|
||||
|
||||
if (!libhydra_init())
|
||||
{
|
||||
libhydra_deinit();
|
||||
library_deinit();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!libipsec_init())
|
||||
{
|
||||
libipsec_deinit();
|
||||
libhydra_deinit();
|
||||
library_deinit();
|
||||
return FALSE;
|
||||
}
|
||||
@@ -625,7 +616,6 @@ JNI_METHOD(CharonVpnService, initializeCharon, jboolean,
|
||||
{
|
||||
libcharon_deinit();
|
||||
libipsec_deinit();
|
||||
libhydra_deinit();
|
||||
library_deinit();
|
||||
return FALSE;
|
||||
}
|
||||
@@ -657,7 +647,6 @@ JNI_METHOD(CharonVpnService, initializeCharon, jboolean,
|
||||
libcharon_deinit();
|
||||
charonservice_deinit(env);
|
||||
libipsec_deinit();
|
||||
libhydra_deinit();
|
||||
library_deinit();
|
||||
return FALSE;
|
||||
}
|
||||
@@ -687,7 +676,6 @@ JNI_METHOD(CharonVpnService, deinitializeCharon, void)
|
||||
libcharon_deinit();
|
||||
charonservice_deinit(env);
|
||||
libipsec_deinit();
|
||||
libhydra_deinit();
|
||||
library_deinit();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <utils/debug.h>
|
||||
#include <library.h>
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <ipsec.h>
|
||||
|
||||
typedef struct private_kernel_android_ipsec_t private_kernel_android_ipsec_t;
|
||||
@@ -42,8 +42,7 @@ struct private_kernel_android_ipsec_t {
|
||||
*/
|
||||
static void expire(u_int8_t protocol, u_int32_t spi, host_t *dst, bool hard)
|
||||
{
|
||||
hydra->kernel_interface->expire(hydra->kernel_interface, protocol,
|
||||
spi, dst, hard);
|
||||
charon->kernel->expire(charon->kernel, protocol, spi, dst, hard);
|
||||
}
|
||||
|
||||
METHOD(kernel_ipsec_t, get_spi, status_t,
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "../android_jni.h"
|
||||
#include "../charonservice.h"
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <processing/jobs/callback_job.h>
|
||||
#include <threading/mutex.h>
|
||||
|
||||
@@ -75,7 +75,7 @@ static job_requeue_t roam_event()
|
||||
{
|
||||
/* this will fail if no connection is up */
|
||||
charonservice->bypass_socket(charonservice, -1, 0);
|
||||
hydra->kernel_interface->roam(hydra->kernel_interface, TRUE);
|
||||
charon->kernel->roam(charon->kernel, TRUE);
|
||||
return JOB_REQUEUE_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include <library.h>
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <threading/thread.h>
|
||||
#include <utils/backtrace.h>
|
||||
@@ -170,11 +169,6 @@ int main(int argc, char *argv[])
|
||||
exit(SS_RC_DAEMON_INTEGRITY);
|
||||
}
|
||||
}
|
||||
atexit(libhydra_deinit);
|
||||
if (!libhydra_init())
|
||||
{
|
||||
exit(SS_RC_INITIALIZATION_FAILED);
|
||||
}
|
||||
atexit(libcharon_deinit);
|
||||
if (!libcharon_init())
|
||||
{
|
||||
|
||||
@@ -478,7 +478,6 @@
|
||||
/usr/include,
|
||||
../../libstrongswan,
|
||||
../../libcharon,
|
||||
../../libhydra,
|
||||
);
|
||||
INFOPLIST_FILE = "charon-xpc/charon-xpc-Info.plist";
|
||||
INSTALL_PATH = /;
|
||||
@@ -486,7 +485,6 @@
|
||||
/usr/lib,
|
||||
../../libstrongswan/.libs,
|
||||
../../libcharon/.libs,
|
||||
../../libhydra/.libs,
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
OTHER_CFLAGS = (
|
||||
@@ -500,8 +498,6 @@
|
||||
"-force_load",
|
||||
../../libipsec/.libs/libipsec.a,
|
||||
"-force_load",
|
||||
../../libhydra/.libs/libhydra.a,
|
||||
"-force_load",
|
||||
../../libcharon/.libs/libcharon.a,
|
||||
"-sectcreate",
|
||||
__TEXT,
|
||||
@@ -531,7 +527,6 @@
|
||||
/usr/include,
|
||||
../../libstrongswan,
|
||||
../../libcharon,
|
||||
../../libhydra,
|
||||
);
|
||||
INFOPLIST_FILE = "charon-xpc/charon-xpc-Info.plist";
|
||||
INSTALL_PATH = /;
|
||||
@@ -539,7 +534,6 @@
|
||||
/usr/lib,
|
||||
../../libstrongswan/.libs,
|
||||
../../libcharon/.libs,
|
||||
../../libhydra/.libs,
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
OTHER_CFLAGS = (
|
||||
@@ -553,8 +547,6 @@
|
||||
"-force_load",
|
||||
../../libipsec/.libs/libipsec.a,
|
||||
"-force_load",
|
||||
../../libhydra/.libs/libhydra.a,
|
||||
"-force_load",
|
||||
../../libcharon/.libs/libcharon.a,
|
||||
"-sectcreate",
|
||||
__TEXT,
|
||||
|
||||
@@ -47,7 +47,10 @@ encoding/payloads/unknown_payload.c encoding/payloads/unknown_payload.h \
|
||||
encoding/payloads/vendor_id_payload.c encoding/payloads/vendor_id_payload.h \
|
||||
encoding/payloads/hash_payload.c encoding/payloads/hash_payload.h \
|
||||
encoding/payloads/fragment_payload.c encoding/payloads/fragment_payload.h \
|
||||
kernel/kernel_handler.c kernel/kernel_handler.h \
|
||||
kernel/kernel_interface.c kernel/kernel_interface.h \
|
||||
kernel/kernel_ipsec.c kernel/kernel_ipsec.h \
|
||||
kernel/kernel_net.c kernel/kernel_net.h \
|
||||
kernel/kernel_listener.h kernel/kernel_handler.c kernel/kernel_handler.h \
|
||||
network/receiver.c network/receiver.h network/sender.c network/sender.h \
|
||||
network/socket.c network/socket.h \
|
||||
network/socket_manager.c network/socket_manager.h \
|
||||
@@ -216,6 +219,10 @@ endif
|
||||
|
||||
LOCAL_SRC_FILES += $(call add_plugin, load-tester)
|
||||
|
||||
LOCAL_SRC_FILES += $(call add_plugin, kernel-pfkey)
|
||||
|
||||
LOCAL_SRC_FILES += $(call add_plugin, kernel-netlink)
|
||||
|
||||
LOCAL_SRC_FILES += $(call add_plugin, socket-default)
|
||||
|
||||
LOCAL_SRC_FILES += $(call add_plugin, socket-dynamic)
|
||||
@@ -228,7 +235,6 @@ endif
|
||||
# build libcharon --------------------------------------------------------------
|
||||
|
||||
LOCAL_C_INCLUDES += \
|
||||
$(strongswan_PATH)/src/libhydra \
|
||||
$(strongswan_PATH)/src/libstrongswan
|
||||
|
||||
LOCAL_CFLAGS := $(strongswan_CFLAGS)
|
||||
@@ -241,6 +247,6 @@ LOCAL_ARM_MODE := arm
|
||||
|
||||
LOCAL_PRELINK_MODULE := false
|
||||
|
||||
LOCAL_SHARED_LIBRARIES += libstrongswan libhydra
|
||||
LOCAL_SHARED_LIBRARIES += libstrongswan
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
@@ -46,7 +46,10 @@ encoding/payloads/unknown_payload.c encoding/payloads/unknown_payload.h \
|
||||
encoding/payloads/vendor_id_payload.c encoding/payloads/vendor_id_payload.h \
|
||||
encoding/payloads/hash_payload.c encoding/payloads/hash_payload.h \
|
||||
encoding/payloads/fragment_payload.c encoding/payloads/fragment_payload.h \
|
||||
kernel/kernel_handler.c kernel/kernel_handler.h \
|
||||
kernel/kernel_interface.c kernel/kernel_interface.h \
|
||||
kernel/kernel_ipsec.c kernel/kernel_ipsec.h \
|
||||
kernel/kernel_net.c kernel/kernel_net.h \
|
||||
kernel/kernel_listener.h kernel/kernel_handler.c kernel/kernel_handler.h \
|
||||
network/receiver.c network/receiver.h network/sender.c network/sender.h \
|
||||
network/socket.c network/socket.h \
|
||||
network/socket_manager.c network/socket_manager.h \
|
||||
@@ -143,7 +146,6 @@ daemon.lo : $(top_builddir)/config.status
|
||||
AM_CPPFLAGS = \
|
||||
-I${linux_headers} \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-DIPSEC_DIR=\"${ipsecdir}\" \
|
||||
-DIPSEC_PIDDIR=\"${piddir}\"
|
||||
@@ -153,7 +155,6 @@ AM_LDFLAGS = \
|
||||
|
||||
libcharon_la_LIBADD = \
|
||||
$(top_builddir)/src/libstrongswan/libstrongswan.la \
|
||||
$(top_builddir)/src/libhydra/libhydra.la \
|
||||
-lm $(PTHREADLIB) $(DLLIB) $(SOCKLIB)
|
||||
|
||||
if USE_WINDOWS
|
||||
@@ -512,6 +513,27 @@ if MONOLITHIC
|
||||
endif
|
||||
endif
|
||||
|
||||
if USE_KERNEL_PFKEY
|
||||
SUBDIRS += plugins/kernel_pfkey
|
||||
if MONOLITHIC
|
||||
libcharon_la_LIBADD += plugins/kernel_pfkey/libstrongswan-kernel-pfkey.la
|
||||
endif
|
||||
endif
|
||||
|
||||
if USE_KERNEL_PFROUTE
|
||||
SUBDIRS += plugins/kernel_pfroute
|
||||
if MONOLITHIC
|
||||
libcharon_la_LIBADD += plugins/kernel_pfroute/libstrongswan-kernel-pfroute.la
|
||||
endif
|
||||
endif
|
||||
|
||||
if USE_KERNEL_NETLINK
|
||||
SUBDIRS += plugins/kernel_netlink
|
||||
if MONOLITHIC
|
||||
libcharon_la_LIBADD += plugins/kernel_netlink/libstrongswan-kernel-netlink.la
|
||||
endif
|
||||
endif
|
||||
|
||||
if USE_KERNEL_LIBIPSEC
|
||||
SUBDIRS += plugins/kernel_libipsec
|
||||
if MONOLITHIC
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "mem_pool.h"
|
||||
|
||||
#include <library.h>
|
||||
#include <hydra.h>
|
||||
#include <utils/debug.h>
|
||||
#include <collections/hashtable.h>
|
||||
#include <collections/array.h>
|
||||
|
||||
@@ -685,6 +685,7 @@ static void destroy(private_daemon_t *this)
|
||||
DESTROY_IF(this->public.xauth);
|
||||
DESTROY_IF(this->public.backends);
|
||||
DESTROY_IF(this->public.socket);
|
||||
DESTROY_IF(this->public.kernel);
|
||||
|
||||
/* rehook library logging, shutdown logging */
|
||||
dbg = dbg_old;
|
||||
@@ -862,6 +863,7 @@ private_daemon_t *daemon_create()
|
||||
.ref = 1,
|
||||
);
|
||||
charon = &this->public;
|
||||
this->public.kernel = kernel_interface_create();
|
||||
this->public.attributes = attribute_manager_create();
|
||||
this->public.controller = controller_create();
|
||||
this->public.eap = eap_manager_create();
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
* @defgroup payloads payloads
|
||||
* @ingroup encoding
|
||||
*
|
||||
* @defgroup ckernel kernel
|
||||
* @defgroup kernel kernel
|
||||
* @ingroup libcharon
|
||||
*
|
||||
* @defgroup network network
|
||||
@@ -179,6 +179,7 @@
|
||||
typedef struct daemon_t daemon_t;
|
||||
|
||||
#include <attributes/attribute_manager.h>
|
||||
#include <kernel/kernel_interface.h>
|
||||
#include <network/sender.h>
|
||||
#include <network/receiver.h>
|
||||
#include <network/socket_manager.h>
|
||||
@@ -238,6 +239,11 @@ struct daemon_t {
|
||||
*/
|
||||
socket_manager_t *socket;
|
||||
|
||||
/**
|
||||
* Kernel interface to communicate with kernel
|
||||
*/
|
||||
kernel_interface_t *kernel;
|
||||
|
||||
/**
|
||||
* A ike_sa_manager_t instance.
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
#include "kernel_handler.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <processing/jobs/acquire_job.h>
|
||||
#include <processing/jobs/delete_child_sa_job.h>
|
||||
@@ -135,8 +134,7 @@ METHOD(kernel_listener_t, roam, bool,
|
||||
METHOD(kernel_handler_t, destroy, void,
|
||||
private_kernel_handler_t *this)
|
||||
{
|
||||
hydra->kernel_interface->remove_listener(hydra->kernel_interface,
|
||||
&this->public.listener);
|
||||
charon->kernel->remove_listener(charon->kernel, &this->public.listener);
|
||||
free(this);
|
||||
}
|
||||
|
||||
@@ -157,8 +155,7 @@ kernel_handler_t *kernel_handler_create()
|
||||
},
|
||||
);
|
||||
|
||||
hydra->kernel_interface->add_listener(hydra->kernel_interface,
|
||||
&this->public.listener);
|
||||
charon->kernel->add_listener(charon->kernel, &this->public.listener);
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
/**
|
||||
* @defgroup kernel_handler kernel_handler
|
||||
* @{ @ingroup ckernel
|
||||
* @{ @ingroup kernel
|
||||
*/
|
||||
|
||||
#ifndef KERNEL_HANDLER_H_
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
|
||||
#include "kernel_interface.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <utils/debug.h>
|
||||
#include <threading/mutex.h>
|
||||
#include <collections/linked_list.h>
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
/**
|
||||
* @defgroup kernel_interface kernel_interface
|
||||
* @{ @ingroup hkernel
|
||||
* @{ @ingroup kernel
|
||||
*/
|
||||
|
||||
#ifndef KERNEL_INTERFACE_H_
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include "kernel_ipsec.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
|
||||
/**
|
||||
* See header
|
||||
@@ -25,14 +25,12 @@ bool kernel_ipsec_register(plugin_t *plugin, plugin_feature_t *feature,
|
||||
{
|
||||
if (reg)
|
||||
{
|
||||
return hydra->kernel_interface->add_ipsec_interface(
|
||||
hydra->kernel_interface,
|
||||
return charon->kernel->add_ipsec_interface(charon->kernel,
|
||||
(kernel_ipsec_constructor_t)data);
|
||||
}
|
||||
else
|
||||
{
|
||||
return hydra->kernel_interface->remove_ipsec_interface(
|
||||
hydra->kernel_interface,
|
||||
return charon->kernel->remove_ipsec_interface(charon->kernel,
|
||||
(kernel_ipsec_constructor_t)data);
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
/**
|
||||
* @defgroup kernel_ipsec kernel_ipsec
|
||||
* @{ @ingroup hkernel
|
||||
* @{ @ingroup kernel
|
||||
*/
|
||||
|
||||
#ifndef KERNEL_IPSEC_H_
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
/**
|
||||
* @defgroup kernel_listener kernel_listener
|
||||
* @{ @ingroup hkernel
|
||||
* @{ @ingroup kernel
|
||||
*/
|
||||
|
||||
#ifndef KERNEL_LISTENER_H_
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include "kernel_net.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
|
||||
/**
|
||||
* See header
|
||||
@@ -25,14 +25,12 @@ bool kernel_net_register(plugin_t *plugin, plugin_feature_t *feature,
|
||||
{
|
||||
if (reg)
|
||||
{
|
||||
return hydra->kernel_interface->add_net_interface(
|
||||
hydra->kernel_interface,
|
||||
return charon->kernel->add_net_interface(charon->kernel,
|
||||
(kernel_net_constructor_t)data);
|
||||
}
|
||||
else
|
||||
{
|
||||
return hydra->kernel_interface->remove_net_interface(
|
||||
hydra->kernel_interface,
|
||||
return charon->kernel->remove_net_interface(charon->kernel,
|
||||
(kernel_net_constructor_t)data);
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
/**
|
||||
* @defgroup kernel_net kernel_net
|
||||
* @{ @ingroup hkernel
|
||||
* @{ @ingroup kernel
|
||||
*/
|
||||
|
||||
#ifndef KERNEL_NET_H_
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include "receiver.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <network/socket.h>
|
||||
#include <processing/jobs/job.h>
|
||||
@@ -451,9 +450,8 @@ static job_requeue_t receive_packets(private_receiver_t *this)
|
||||
|
||||
dst = packet->get_destination(packet);
|
||||
src = packet->get_source(packet);
|
||||
if (!hydra->kernel_interface->all_interfaces_usable(hydra->kernel_interface)
|
||||
&& !hydra->kernel_interface->get_interface(hydra->kernel_interface,
|
||||
dst, NULL))
|
||||
if (!charon->kernel->all_interfaces_usable(charon->kernel)
|
||||
&& !charon->kernel->get_interface(charon->kernel, dst, NULL))
|
||||
{
|
||||
DBG3(DBG_NET, "received packet from %#H to %#H on ignored interface",
|
||||
src, dst);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-DIPSEC_PIDDIR=\"${piddir}\"
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include <threading/condvar.h>
|
||||
#include <threading/thread.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <processing/jobs/callback_job.h>
|
||||
|
||||
@@ -209,8 +208,7 @@ static int prepare_dhcp(private_dhcp_socket_t *this,
|
||||
else
|
||||
{
|
||||
/* act as relay agent */
|
||||
src = hydra->kernel_interface->get_source_addr(hydra->kernel_interface,
|
||||
this->dst, NULL);
|
||||
src = charon->kernel->get_source_addr(charon->kernel, this->dst, NULL);
|
||||
if (src)
|
||||
{
|
||||
memcpy(&dhcp->gateway_address, src->get_address(src).ptr,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-DIPSEC_PIDDIR=\"${piddir}\"
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-I$(top_srcdir)/src/libsimaka
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-I$(top_srcdir)/src/libsimaka
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-I$(top_srcdir)/src/libtls
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-I$(top_srcdir)/src/libradius
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-I$(top_srcdir)/src/libsimaka
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-I$(top_srcdir)/src/libsimaka \
|
||||
-DIPSEC_CONFDIR=\"${sysconfdir}\"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-I$(top_srcdir)/src/libsimaka
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-I$(top_srcdir)/src/libsimaka
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-I$(top_srcdir)/src/libsimaka
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-I$(top_srcdir)/src/libsimaka \
|
||||
-DIPSEC_CONFDIR=\"${sysconfdir}\"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-I$(top_srcdir)/src/libtls
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-I$(top_srcdir)/src/libtls \
|
||||
-I$(top_srcdir)/src/libtncif \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-I$(top_srcdir)/src/libtls \
|
||||
-I$(top_srcdir)/src/libradius
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-DIPSEC_PIDDIR=\"${piddir}\"
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <ifaddrs.h>
|
||||
#include <net/if.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <threading/thread.h>
|
||||
#include <processing/jobs/callback_job.h>
|
||||
@@ -428,8 +427,7 @@ METHOD(forecast_forwarder_t, destroy, void,
|
||||
lib->watcher->remove(lib->watcher, this->kernel.pkt);
|
||||
close(this->kernel.pkt);
|
||||
}
|
||||
hydra->kernel_interface->remove_listener(hydra->kernel_interface,
|
||||
&this->kernel.listener);
|
||||
charon->kernel->remove_listener(charon->kernel, &this->kernel.listener);
|
||||
free(this);
|
||||
}
|
||||
|
||||
@@ -486,8 +484,8 @@ forecast_forwarder_t *forecast_forwarder_create(forecast_listener_t *listener)
|
||||
|
||||
setup_interface(&this->kernel);
|
||||
|
||||
hydra->kernel_interface->add_listener(hydra->kernel_interface,
|
||||
&this->kernel.listener);
|
||||
charon->kernel->add_listener(charon->kernel,
|
||||
&this->kernel.listener);
|
||||
|
||||
lib->watcher->add(lib->watcher, this->kernel.pkt, WATCHER_READ,
|
||||
(watcher_cb_t)receive_casts, this);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-DIPSEC_PIDDIR=\"${piddir}\"
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "kernel_iph_net.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <threading/mutex.h>
|
||||
#include <collections/linked_list.h>
|
||||
#include <processing/jobs/callback_job.h>
|
||||
@@ -130,7 +130,7 @@ static job_requeue_t roam_event(private_kernel_iph_net_t *this)
|
||||
this->roam_address = FALSE;
|
||||
this->mutex->unlock(this->mutex);
|
||||
|
||||
hydra->kernel_interface->roam(hydra->kernel_interface, address);
|
||||
charon->kernel->roam(charon->kernel, address);
|
||||
return JOB_REQUEUE_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
#include "kernel_iph_plugin.h"
|
||||
#include "kernel_iph_net.h"
|
||||
|
||||
#include <hydra.h>
|
||||
|
||||
typedef struct private_kernel_iph_plugin_t private_kernel_iph_plugin_t;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-I$(top_srcdir)/src/libipsec
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <library.h>
|
||||
#include <ipsec.h>
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <networking/tun_device.h>
|
||||
#include <threading/mutex.h>
|
||||
#include <utils/debug.h>
|
||||
@@ -224,8 +224,7 @@ static inline bool policy_entry_equals(policy_entry_t *a,
|
||||
*/
|
||||
static void expire(u_int8_t protocol, u_int32_t spi, host_t *dst, bool hard)
|
||||
{
|
||||
hydra->kernel_interface->expire(hydra->kernel_interface, protocol,
|
||||
spi, dst, hard);
|
||||
charon->kernel->expire(charon->kernel, protocol, spi, dst, hard);
|
||||
}
|
||||
|
||||
METHOD(kernel_ipsec_t, get_features, kernel_feature_t,
|
||||
@@ -313,16 +312,13 @@ static void add_exclude_route(private_kernel_libipsec_ipsec_t *this,
|
||||
if (!route->exclude)
|
||||
{
|
||||
DBG2(DBG_KNL, "installing new exclude route for %H src %H", dst, src);
|
||||
gtw = hydra->kernel_interface->get_nexthop(hydra->kernel_interface,
|
||||
dst, -1, NULL);
|
||||
gtw = charon->kernel->get_nexthop(charon->kernel, dst, -1, NULL);
|
||||
if (gtw)
|
||||
{
|
||||
char *if_name = NULL;
|
||||
|
||||
if (hydra->kernel_interface->get_interface(
|
||||
hydra->kernel_interface, src, &if_name) &&
|
||||
hydra->kernel_interface->add_route(hydra->kernel_interface,
|
||||
dst->get_address(dst),
|
||||
if (charon->kernel->get_interface(charon->kernel, src, &if_name) &&
|
||||
charon->kernel->add_route(charon->kernel, dst->get_address(dst),
|
||||
dst->get_family(dst) == AF_INET ? 32 : 128,
|
||||
gtw, src, if_name) == SUCCESS)
|
||||
{
|
||||
@@ -367,14 +363,12 @@ static void remove_exclude_route(private_kernel_libipsec_ipsec_t *this,
|
||||
dst = route->exclude->dst;
|
||||
DBG2(DBG_KNL, "uninstalling exclude route for %H src %H",
|
||||
dst, route->exclude->src);
|
||||
if (hydra->kernel_interface->get_interface(
|
||||
hydra->kernel_interface,
|
||||
route->exclude->src, &if_name) &&
|
||||
hydra->kernel_interface->del_route(hydra->kernel_interface,
|
||||
dst->get_address(dst),
|
||||
dst->get_family(dst) == AF_INET ? 32 : 128,
|
||||
route->exclude->gtw, route->exclude->src,
|
||||
if_name) != SUCCESS)
|
||||
if (charon->kernel->get_interface(charon->kernel, route->exclude->src,
|
||||
&if_name) &&
|
||||
charon->kernel->del_route(charon->kernel, dst->get_address(dst),
|
||||
dst->get_family(dst) == AF_INET ? 32 : 128,
|
||||
route->exclude->gtw, route->exclude->src,
|
||||
if_name) != SUCCESS)
|
||||
{
|
||||
DBG1(DBG_KNL, "uninstalling exclude route for %H failed", dst);
|
||||
}
|
||||
@@ -402,8 +396,8 @@ static bool install_route(private_kernel_libipsec_ipsec_t *this,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (hydra->kernel_interface->get_address_by_ts(hydra->kernel_interface,
|
||||
src_ts, &src_ip, &is_virtual) != SUCCESS)
|
||||
if (charon->kernel->get_address_by_ts(charon->kernel, src_ts, &src_ip,
|
||||
&is_virtual) != SUCCESS)
|
||||
{
|
||||
traffic_selector_t *multicast, *broadcast = NULL;
|
||||
bool ignore = FALSE;
|
||||
@@ -444,8 +438,7 @@ static bool install_route(private_kernel_libipsec_ipsec_t *this,
|
||||
);
|
||||
#ifndef __linux__
|
||||
/* on Linux we cant't install a gateway */
|
||||
route->gateway = hydra->kernel_interface->get_nexthop(
|
||||
hydra->kernel_interface, dst, -1, src);
|
||||
route->gateway = charon->kernel->get_nexthop(charon->kernel, dst, -1, src);
|
||||
#endif
|
||||
|
||||
if (policy->route)
|
||||
@@ -459,9 +452,9 @@ static bool install_route(private_kernel_libipsec_ipsec_t *this,
|
||||
return TRUE;
|
||||
}
|
||||
/* uninstall previously installed route */
|
||||
if (hydra->kernel_interface->del_route(hydra->kernel_interface,
|
||||
old->dst_net, old->prefixlen, old->gateway,
|
||||
old->src_ip, old->if_name) != SUCCESS)
|
||||
if (charon->kernel->del_route(charon->kernel, old->dst_net,
|
||||
old->prefixlen, old->gateway,
|
||||
old->src_ip, old->if_name) != SUCCESS)
|
||||
{
|
||||
DBG1(DBG_KNL, "error uninstalling route installed with policy "
|
||||
"%R === %R %N", src_ts, dst_ts, policy_dir_names,
|
||||
@@ -490,9 +483,9 @@ static bool install_route(private_kernel_libipsec_ipsec_t *this,
|
||||
DBG2(DBG_KNL, "installing route: %R src %H dev %s",
|
||||
dst_ts, route->src_ip, route->if_name);
|
||||
|
||||
switch (hydra->kernel_interface->add_route(hydra->kernel_interface,
|
||||
route->dst_net, route->prefixlen, route->gateway,
|
||||
route->src_ip, route->if_name))
|
||||
switch (charon->kernel->add_route(charon->kernel, route->dst_net,
|
||||
route->prefixlen, route->gateway,
|
||||
route->src_ip, route->if_name))
|
||||
{
|
||||
case ALREADY_DONE:
|
||||
/* route exists, do not uninstall */
|
||||
@@ -598,9 +591,9 @@ METHOD(kernel_ipsec_t, del_policy, status_t,
|
||||
{
|
||||
route_entry_t *route = policy->route;
|
||||
|
||||
if (hydra->kernel_interface->del_route(hydra->kernel_interface,
|
||||
route->dst_net, route->prefixlen, route->gateway, route->src_ip,
|
||||
route->if_name) != SUCCESS)
|
||||
if (charon->kernel->del_route(charon->kernel, route->dst_net,
|
||||
route->prefixlen, route->gateway,
|
||||
route->src_ip, route->if_name) != SUCCESS)
|
||||
{
|
||||
DBG1(DBG_KNL, "error uninstalling route installed with "
|
||||
"policy %R === %R %N", src_ts, dst_ts,
|
||||
@@ -629,9 +622,9 @@ METHOD(kernel_ipsec_t, flush_policies, status_t,
|
||||
{
|
||||
route_entry_t *route = pol->route;
|
||||
|
||||
hydra->kernel_interface->del_route(hydra->kernel_interface,
|
||||
route->dst_net, route->prefixlen, route->gateway,
|
||||
route->src_ip, route->if_name);
|
||||
charon->kernel->del_route(charon->kernel, route->dst_net,
|
||||
route->prefixlen, route->gateway,
|
||||
route->src_ip, route->if_name);
|
||||
remove_exclude_route(this, route);
|
||||
}
|
||||
policy_entry_destroy(pol);
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "kernel_libipsec_router.h"
|
||||
|
||||
#include <daemon.h>
|
||||
#include <hydra.h>
|
||||
#include <ipsec.h>
|
||||
#include <collections/hashtable.h>
|
||||
#include <networking/tun_device.h>
|
||||
@@ -298,8 +297,7 @@ METHOD(kernel_libipsec_router_t, destroy, void,
|
||||
(ipsec_outbound_cb_t)send_esp);
|
||||
ipsec->processor->unregister_inbound(ipsec->processor,
|
||||
(ipsec_inbound_cb_t)deliver_plain);
|
||||
hydra->kernel_interface->remove_listener(hydra->kernel_interface,
|
||||
&this->public.listener);
|
||||
charon->kernel->remove_listener(charon->kernel, &this->public.listener);
|
||||
this->lock->destroy(this->lock);
|
||||
this->tuns->destroy(this->tuns);
|
||||
close(this->notify[0]);
|
||||
@@ -351,8 +349,7 @@ kernel_libipsec_router_t *kernel_libipsec_router_create()
|
||||
(hashtable_equals_t)tun_entry_equals, 4);
|
||||
this->lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
|
||||
|
||||
hydra->kernel_interface->add_listener(hydra->kernel_interface,
|
||||
&this->public.listener);
|
||||
charon->kernel->add_listener(charon->kernel, &this->public.listener);
|
||||
ipsec->processor->register_outbound(ipsec->processor, send_esp, NULL);
|
||||
ipsec->processor->register_inbound(ipsec->processor,
|
||||
(ipsec_inbound_cb_t)deliver_plain, this);
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I${linux_headers} \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-DROUTING_TABLE=${routing_table} \
|
||||
-DROUTING_TABLE_PRIO=${routing_table_prio}
|
||||
|
||||
+28
-31
@@ -35,7 +35,7 @@
|
||||
#include "kernel_netlink_ipsec.h"
|
||||
#include "kernel_netlink_shared.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <utils/debug.h>
|
||||
#include <threading/mutex.h>
|
||||
#include <collections/array.h>
|
||||
@@ -262,8 +262,8 @@ static char* lookup_algorithm(transform_type_t type, int ikev2)
|
||||
return list[i].name;
|
||||
}
|
||||
}
|
||||
if (hydra->kernel_interface->lookup_algorithm(hydra->kernel_interface,
|
||||
ikev2, type, NULL, &name))
|
||||
if (charon->kernel->lookup_algorithm(charon->kernel, ikev2, type, NULL,
|
||||
&name))
|
||||
{
|
||||
return name;
|
||||
}
|
||||
@@ -856,8 +856,7 @@ static void process_acquire(private_kernel_netlink_ipsec_t *this,
|
||||
src_ts = selector2ts(&acquire->sel, TRUE);
|
||||
dst_ts = selector2ts(&acquire->sel, FALSE);
|
||||
|
||||
hydra->kernel_interface->acquire(hydra->kernel_interface, reqid, src_ts,
|
||||
dst_ts);
|
||||
charon->kernel->acquire(charon->kernel, reqid, src_ts, dst_ts);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -882,8 +881,8 @@ static void process_expire(private_kernel_netlink_ipsec_t *this,
|
||||
dst = xfrm2host(expire->state.family, &expire->state.id.daddr, 0);
|
||||
if (dst)
|
||||
{
|
||||
hydra->kernel_interface->expire(hydra->kernel_interface, protocol,
|
||||
spi, dst, expire->hard != 0);
|
||||
charon->kernel->expire(charon->kernel, protocol, spi, dst,
|
||||
expire->hard != 0);
|
||||
dst->destroy(dst);
|
||||
}
|
||||
}
|
||||
@@ -951,8 +950,8 @@ static void process_migrate(private_kernel_netlink_ipsec_t *this,
|
||||
|
||||
if (src_ts && dst_ts && local && remote)
|
||||
{
|
||||
hydra->kernel_interface->migrate(hydra->kernel_interface, reqid,
|
||||
src_ts, dst_ts, dir, local, remote);
|
||||
charon->kernel->migrate(charon->kernel, reqid, src_ts, dst_ts, dir,
|
||||
local, remote);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -988,8 +987,8 @@ static void process_mapping(private_kernel_netlink_ipsec_t *this,
|
||||
mapping->new_sport);
|
||||
if (new)
|
||||
{
|
||||
hydra->kernel_interface->mapping(hydra->kernel_interface,
|
||||
IPPROTO_ESP, spi, dst, new);
|
||||
charon->kernel->mapping(charon->kernel, IPPROTO_ESP, spi, dst,
|
||||
new);
|
||||
new->destroy(new);
|
||||
}
|
||||
dst->destroy(dst);
|
||||
@@ -2202,22 +2201,21 @@ static status_t add_policy_internal(private_kernel_netlink_ipsec_t *this,
|
||||
.prefixlen = policy->sel.prefixlen_s,
|
||||
);
|
||||
|
||||
if (hydra->kernel_interface->get_address_by_ts(hydra->kernel_interface,
|
||||
fwd->dst_ts, &route->src_ip, NULL) == SUCCESS)
|
||||
if (charon->kernel->get_address_by_ts(charon->kernel, fwd->dst_ts,
|
||||
&route->src_ip, NULL) == SUCCESS)
|
||||
{
|
||||
/* get the nexthop to src (src as we are in POLICY_FWD) */
|
||||
if (!ipsec->src->is_anyaddr(ipsec->src))
|
||||
{
|
||||
route->gateway = hydra->kernel_interface->get_nexthop(
|
||||
hydra->kernel_interface, ipsec->src,
|
||||
-1, ipsec->dst);
|
||||
route->gateway = charon->kernel->get_nexthop(charon->kernel,
|
||||
ipsec->src, -1, ipsec->dst);
|
||||
}
|
||||
else
|
||||
{ /* for shunt policies */
|
||||
iface = xfrm2host(policy->sel.family, &policy->sel.saddr, 0);
|
||||
route->gateway = hydra->kernel_interface->get_nexthop(
|
||||
hydra->kernel_interface, iface,
|
||||
policy->sel.prefixlen_s, route->src_ip);
|
||||
route->gateway = charon->kernel->get_nexthop(charon->kernel,
|
||||
iface, policy->sel.prefixlen_s,
|
||||
route->src_ip);
|
||||
iface->destroy(iface);
|
||||
}
|
||||
route->dst_net = chunk_alloc(policy->sel.family == AF_INET ? 4 : 16);
|
||||
@@ -2232,8 +2230,8 @@ static status_t add_policy_internal(private_kernel_netlink_ipsec_t *this,
|
||||
iface = route->src_ip;
|
||||
}
|
||||
/* install route via outgoing interface */
|
||||
if (!hydra->kernel_interface->get_interface(hydra->kernel_interface,
|
||||
iface, &route->if_name))
|
||||
if (!charon->kernel->get_interface(charon->kernel, iface,
|
||||
&route->if_name))
|
||||
{
|
||||
this->mutex->unlock(this->mutex);
|
||||
route_entry_destroy(route);
|
||||
@@ -2250,9 +2248,9 @@ static status_t add_policy_internal(private_kernel_netlink_ipsec_t *this,
|
||||
return SUCCESS;
|
||||
}
|
||||
/* uninstall previously installed route */
|
||||
if (hydra->kernel_interface->del_route(hydra->kernel_interface,
|
||||
old->dst_net, old->prefixlen, old->gateway,
|
||||
old->src_ip, old->if_name) != SUCCESS)
|
||||
if (charon->kernel->del_route(charon->kernel, old->dst_net,
|
||||
old->prefixlen, old->gateway,
|
||||
old->src_ip, old->if_name) != SUCCESS)
|
||||
{
|
||||
DBG1(DBG_KNL, "error uninstalling route installed with "
|
||||
"policy %R === %R %N", fwd->src_ts,
|
||||
@@ -2265,10 +2263,9 @@ static status_t add_policy_internal(private_kernel_netlink_ipsec_t *this,
|
||||
|
||||
DBG2(DBG_KNL, "installing route: %R via %H src %H dev %s",
|
||||
fwd->src_ts, route->gateway, route->src_ip, route->if_name);
|
||||
switch (hydra->kernel_interface->add_route(
|
||||
hydra->kernel_interface, route->dst_net,
|
||||
route->prefixlen, route->gateway,
|
||||
route->src_ip, route->if_name))
|
||||
switch (charon->kernel->add_route(charon->kernel, route->dst_net,
|
||||
route->prefixlen, route->gateway,
|
||||
route->src_ip, route->if_name))
|
||||
{
|
||||
default:
|
||||
DBG1(DBG_KNL, "unable to install source route for %H",
|
||||
@@ -2579,9 +2576,9 @@ METHOD(kernel_ipsec_t, del_policy, status_t,
|
||||
if (current->route)
|
||||
{
|
||||
route_entry_t *route = current->route;
|
||||
if (hydra->kernel_interface->del_route(hydra->kernel_interface,
|
||||
route->dst_net, route->prefixlen, route->gateway,
|
||||
route->src_ip, route->if_name) != SUCCESS)
|
||||
if (charon->kernel->del_route(charon->kernel, route->dst_net,
|
||||
route->prefixlen, route->gateway,
|
||||
route->src_ip, route->if_name) != SUCCESS)
|
||||
{
|
||||
DBG1(DBG_KNL, "error uninstalling route installed with "
|
||||
"policy %R === %R %N", src_ts, dst_ts,
|
||||
+4
-4
@@ -51,7 +51,7 @@
|
||||
#include "kernel_netlink_net.h"
|
||||
#include "kernel_netlink_shared.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <utils/debug.h>
|
||||
#include <threading/mutex.h>
|
||||
#include <threading/rwlock.h>
|
||||
@@ -893,7 +893,7 @@ static job_requeue_t roam_event(private_kernel_netlink_net_t *this)
|
||||
address = this->roam_address;
|
||||
this->roam_address = FALSE;
|
||||
this->roam_lock->unlock(this->roam_lock);
|
||||
hydra->kernel_interface->roam(hydra->kernel_interface, address);
|
||||
charon->kernel->roam(charon->kernel, address);
|
||||
return JOB_REQUEUE_NONE;
|
||||
}
|
||||
|
||||
@@ -1004,8 +1004,8 @@ static void process_link(private_kernel_netlink_net_t *this,
|
||||
INIT(entry,
|
||||
.ifindex = msg->ifi_index,
|
||||
.addrs = linked_list_create(),
|
||||
.usable = hydra->kernel_interface->is_interface_usable(
|
||||
hydra->kernel_interface, name),
|
||||
.usable = charon->kernel->is_interface_usable(
|
||||
charon->kernel, name),
|
||||
);
|
||||
this->ifaces->insert_last(this->ifaces, entry);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user