[strongSwan-dev] IKE/Charon Plugin Development Tutorial

Martin Willi martin at strongswan.org
Thu Oct 13 10:28:48 CEST 2011

Hi Zhen,

> In a nutshell, some tutorial for Charon Plugin development would be
> nice..

The easiest way is to start from an existing plugin that does something
similar, in your case this is the dhcp plugin.

First you need a plugin class such as dhcp_plugin. It contains a
constructor for the plugin that does the registration. Your plugin will
need an attribute_provider_t implementation registered to the "hydra"
object. In the dhcp plugin, it is called dhcp_provider. There you'll
have to implement the require/release_address() methods to handle
virtual IPs.

In most of the plugins, you'll have to handle concurrent calls. Multiple
IKE_SAs may call your functions with a thread simultaneously.

Then you'll have to integrate the plugin to the build system, namely
configure.in and the libcharon/Makefile.am. Have a look how this is done
for the dhcp plugin.


More information about the Dev mailing list