Add a lookip plugin stub to lookup connections by virtual IP

This commit is contained in:
Martin Willi 2012-10-03 16:25:36 +02:00
parent a19d591388
commit e0d7c1eda7
5 changed files with 129 additions and 0 deletions

View File

@ -216,6 +216,7 @@ ARG_ENABL_SET([maemo], [enable Maemo specific plugin.])
ARG_ENABL_SET([nm], [enable NetworkManager backend.])
ARG_ENABL_SET([ha], [enable high availability cluster plugin.])
ARG_ENABL_SET([whitelist], [enable peer identity whitelisting plugin.])
ARG_ENABL_SET([lookip], [enable fast virtual IP lookup and notification plugin.])
ARG_ENABL_SET([certexpire], [enable CSV export of expiration dates of used certificates.])
ARG_ENABL_SET([led], [enable plugin to control LEDs on IKEv2 activity using the Linux kernel LED subsystem.])
ARG_ENABL_SET([duplicheck], [advanced duplicate checking plugin using liveness checks.])
@ -948,6 +949,7 @@ ADD_PLUGIN([android], [c charon])
ADD_PLUGIN([android-log], [c charon])
ADD_PLUGIN([ha], [c charon])
ADD_PLUGIN([whitelist], [c charon])
ADD_PLUGIN([lookip], [c charon])
ADD_PLUGIN([certexpire], [c charon])
ADD_PLUGIN([led], [c charon])
ADD_PLUGIN([duplicheck], [c charon])
@ -1038,6 +1040,7 @@ AM_CONDITIONAL(USE_UNIT_TESTS, test x$unit_tester = xtrue)
AM_CONDITIONAL(USE_LOAD_TESTER, test x$load_tester = xtrue)
AM_CONDITIONAL(USE_HA, test x$ha = xtrue)
AM_CONDITIONAL(USE_WHITELIST, test x$whitelist = xtrue)
AM_CONDITIONAL(USE_LOOKIP, test x$lookip = xtrue)
AM_CONDITIONAL(USE_CERTEXPIRE, test x$certexpire = xtrue)
AM_CONDITIONAL(USE_LED, test x$led = xtrue)
AM_CONDITIONAL(USE_DUPLICHECK, test x$duplicheck = xtrue)
@ -1270,6 +1273,7 @@ AC_OUTPUT(
src/libcharon/plugins/uci/Makefile
src/libcharon/plugins/ha/Makefile
src/libcharon/plugins/whitelist/Makefile
src/libcharon/plugins/lookip/Makefile
src/libcharon/plugins/certexpire/Makefile
src/libcharon/plugins/led/Makefile
src/libcharon/plugins/duplicheck/Makefile

View File

@ -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

View File

@ -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

View File

@ -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;
}

View File

@ -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_ @}*/