我们为 libcharon 开发了一个插件,该插件可以调用我们的代码。因为我们正在使用此插件编译Strongswan,所以这在我们的应用程序和Strongswan之间造成了不必要的耦合。
我们将此插件称为 MyPlugin 。 它的配置如下:
$ cat /etc/strongswan/strongswan.d/charon/myplugin.conf
myplugin {
# Whether to load the plugin. Can also be an integer to increase the
# priority of this plugin.
load = yes
proxy
{
# Should send to proxy
send_to_proxy = yes
}
log
{
# Should save to file
log_path = /var/log/myplugin.log
log_ips = yes
}
}
我们想通过将此插件编译为应用程序的一部分,实现Strongswan接口来逆转这种依赖性。
问题是,strongswan支持吗? 可以将插件部署在已运行Strongswan的计算机上,并让Strongswan加载并使用它吗?怎么样?
我们正在CentOS 6上运行Strongswan 5.1.5。
答案 0 :(得分:0)
是的,您可以这样做。但是,有一些警告:
config.h
。编译插件时,您可以通过-include
传递路径。strongswan.conf
文件(即启用modular plugin loading并在strongswan.d
中包含配置代码段,您可以在其中放置插件的代码段-{{3} }应该可以正常工作。)您可以找到树外插件the default的示例。