aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2012-10-03 16:25:36 +0200
committerMartin Willi <martin@revosec.ch>2012-10-24 11:43:33 +0200
commite0d7c1eda7194ab13a69ce70dd9e1e953aa7d9a0 (patch)
treeb3b32793237f48a323a87055eb17add3f030ba5b /src
parenta19d5913889d80b66dd961c282c7edc58cb0fabb (diff)
downloadstrongswan-e0d7c1eda7194ab13a69ce70dd9e1e953aa7d9a0.tar.bz2
strongswan-e0d7c1eda7194ab13a69ce70dd9e1e953aa7d9a0.tar.xz
Add a lookip plugin stub to lookup connections by virtual IP
Diffstat (limited to 'src')
-rw-r--r--src/libcharon/Makefile.am7
-rw-r--r--src/libcharon/plugins/lookip/Makefile.am13
-rw-r--r--src/libcharon/plugins/lookip/lookip_plugin.c63
-rw-r--r--src/libcharon/plugins/lookip/lookip_plugin.h42
4 files changed, 125 insertions, 0 deletions
diff --git a/src/libcharon/Makefile.am b/src/libcharon/Makefile.am
index 56192bf0e..368dbc1c9 100644
--- a/src/libcharon/Makefile.am
+++ b/src/libcharon/Makefile.am
@@ -484,6 +484,13 @@ if MONOLITHIC
endif
endif
+if USE_LOOKIP
+ SUBDIRS += plugins/lookip
+if MONOLITHIC
+ libcharon_la_LIBADD += plugins/lookip/libstrongswan-lookip.la
+endif
+endif
+
if USE_CERTEXPIRE
SUBDIRS += plugins/certexpire
if MONOLITHIC
diff --git a/src/libcharon/plugins/lookip/Makefile.am b/src/libcharon/plugins/lookip/Makefile.am
new file mode 100644
index 000000000..00d2192a4
--- /dev/null
+++ b/src/libcharon/plugins/lookip/Makefile.am
@@ -0,0 +1,13 @@
+
+INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/libhydra \
+ -I$(top_srcdir)/src/libcharon
+
+if MONOLITHIC
+noinst_LTLIBRARIES = libstrongswan-lookip.la
+else
+plugin_LTLIBRARIES = libstrongswan-lookip.la
+endif
+
+libstrongswan_lookip_la_SOURCES = lookip_plugin.h lookip_plugin.c
+
+libstrongswan_lookip_la_LDFLAGS = -module -avoid-version
diff --git a/src/libcharon/plugins/lookip/lookip_plugin.c b/src/libcharon/plugins/lookip/lookip_plugin.c
new file mode 100644
index 000000000..5d8c698a5
--- /dev/null
+++ b/src/libcharon/plugins/lookip/lookip_plugin.c
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2012 Martin Willi
+ * Copyright (C) 2012 revosec AG
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+#include "lookip_plugin.h"
+
+#include <daemon.h>
+
+typedef struct private_lookip_plugin_t private_lookip_plugin_t;
+
+/**
+ * private data of lookip plugin
+ */
+struct private_lookip_plugin_t {
+
+ /**
+ * implements plugin interface
+ */
+ lookip_plugin_t public;
+};
+
+METHOD(plugin_t, get_name, char*,
+ private_lookip_plugin_t *this)
+{
+ return "lookip";
+}
+
+METHOD(plugin_t, destroy, void,
+ private_lookip_plugin_t *this)
+{
+ free(this);
+}
+
+/**
+ * Plugin constructor
+ */
+plugin_t *lookip_plugin_create()
+{
+ private_lookip_plugin_t *this;
+
+ INIT(this,
+ .public = {
+ .plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
+ .destroy = _destroy,
+ },
+ },
+ );
+
+ return &this->public.plugin;
+}
diff --git a/src/libcharon/plugins/lookip/lookip_plugin.h b/src/libcharon/plugins/lookip/lookip_plugin.h
new file mode 100644
index 000000000..ea780ebe7
--- /dev/null
+++ b/src/libcharon/plugins/lookip/lookip_plugin.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2012 Martin Willi
+ * Copyright (C) 2012 revosec AG
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+/**
+ * @defgroup lookip lookip
+ * @ingroup cplugins
+ *
+ * @defgroup lookip_plugin lookip_plugin
+ * @{ @ingroup lookip
+ */
+
+#ifndef LOOKIP_PLUGIN_H_
+#define LOOKIP_PLUGIN_H_
+
+#include <plugins/plugin.h>
+
+typedef struct lookip_plugin_t lookip_plugin_t;
+
+/**
+ * Plugin providing fast connection lookup and notification for virtual IPs.
+ */
+struct lookip_plugin_t {
+
+ /**
+ * Implements plugin interface.
+ */
+ plugin_t plugin;
+};
+
+#endif /** LOOKIP_PLUGIN_H_ @}*/