vici: Add a plugin stub for the "Versatile IKE Control Interface" plugin
This commit is contained in:
@@ -202,6 +202,13 @@ if MONOLITHIC
|
||||
endif
|
||||
endif
|
||||
|
||||
if USE_VICI
|
||||
SUBDIRS += plugins/vici
|
||||
if MONOLITHIC
|
||||
libcharon_la_LIBADD += plugins/vici/libstrongswan-vici.la
|
||||
endif
|
||||
endif
|
||||
|
||||
if USE_SMP
|
||||
SUBDIRS += plugins/smp
|
||||
if MONOLITHIC
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon \
|
||||
-DIPSEC_PIDDIR=\"${piddir}\"
|
||||
|
||||
AM_CFLAGS = \
|
||||
-rdynamic
|
||||
|
||||
if MONOLITHIC
|
||||
noinst_LTLIBRARIES = libstrongswan-vici.la
|
||||
else
|
||||
plugin_LTLIBRARIES = libstrongswan-vici.la
|
||||
endif
|
||||
|
||||
libstrongswan_vici_la_SOURCES = \
|
||||
vici_plugin.h vici_plugin.c
|
||||
|
||||
libstrongswan_vici_la_LDFLAGS = -module -avoid-version
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Martin Willi
|
||||
* Copyright (C) 2014 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 "vici_plugin.h"
|
||||
|
||||
#include <library.h>
|
||||
|
||||
typedef struct private_vici_plugin_t private_vici_plugin_t;
|
||||
|
||||
/**
|
||||
* Private members of vici_plugin_t
|
||||
*/
|
||||
struct private_vici_plugin_t {
|
||||
|
||||
/**
|
||||
* public functions
|
||||
*/
|
||||
vici_plugin_t public;
|
||||
};
|
||||
|
||||
METHOD(plugin_t, get_name, char*,
|
||||
private_vici_plugin_t *this)
|
||||
{
|
||||
return "vici";
|
||||
}
|
||||
|
||||
/**
|
||||
* Register vici plugin features
|
||||
*/
|
||||
static bool register_vici(private_vici_plugin_t *this,
|
||||
plugin_feature_t *feature, bool reg, void *data)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
METHOD(plugin_t, get_features, int,
|
||||
private_vici_plugin_t *this, plugin_feature_t *features[])
|
||||
{
|
||||
static plugin_feature_t f[] = {
|
||||
PLUGIN_CALLBACK((plugin_feature_callback_t)register_vici, NULL),
|
||||
PLUGIN_PROVIDE(CUSTOM, "vici"),
|
||||
};
|
||||
*features = f;
|
||||
return countof(f);
|
||||
}
|
||||
|
||||
METHOD(plugin_t, destroy, void,
|
||||
private_vici_plugin_t *this)
|
||||
{
|
||||
free(this);
|
||||
}
|
||||
|
||||
/*
|
||||
* see header file
|
||||
*/
|
||||
plugin_t *vici_plugin_create()
|
||||
{
|
||||
private_vici_plugin_t *this;
|
||||
|
||||
INIT(this,
|
||||
.public = {
|
||||
.plugin = {
|
||||
.get_name = _get_name,
|
||||
.reload = (void*)return_false,
|
||||
.get_features = _get_features,
|
||||
.destroy = _destroy,
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
return &this->public.plugin;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Martin Willi
|
||||
* Copyright (C) 2014 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 vici vici
|
||||
* @ingroup cplugins
|
||||
*
|
||||
* @defgroup vici_plugin vici_plugin
|
||||
* @{ @ingroup vici
|
||||
*/
|
||||
|
||||
#ifndef VICI_PLUGIN_H_
|
||||
#define VICI_PLUGIN_H_
|
||||
|
||||
#include <plugins/plugin.h>
|
||||
|
||||
typedef struct vici_plugin_t vici_plugin_t;
|
||||
|
||||
/**
|
||||
* vici plugin, the "Versatile IKE Control Interface" interface.
|
||||
*/
|
||||
struct vici_plugin_t {
|
||||
|
||||
/**
|
||||
* Implements plugin interface
|
||||
*/
|
||||
plugin_t plugin;
|
||||
};
|
||||
|
||||
#endif /** VICI_PLUGIN_H_ @}*/
|
||||
Reference in New Issue
Block a user