Add features support to socket-dynamic plugin
This commit is contained in:
@@ -34,6 +34,17 @@ struct private_socket_dynamic_plugin_t {
|
|||||||
socket_dynamic_plugin_t public;
|
socket_dynamic_plugin_t public;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
METHOD(plugin_t, get_features, int,
|
||||||
|
private_socket_dynamic_plugin_t *this, plugin_feature_t *features[])
|
||||||
|
{
|
||||||
|
static plugin_feature_t f[] = {
|
||||||
|
PLUGIN_CALLBACK(socket_register, socket_dynamic_socket_create),
|
||||||
|
PLUGIN_PROVIDE(CUSTOM, "socket"),
|
||||||
|
};
|
||||||
|
*features = f;
|
||||||
|
return countof(f);
|
||||||
|
}
|
||||||
|
|
||||||
METHOD(plugin_t, get_name, char*,
|
METHOD(plugin_t, get_name, char*,
|
||||||
private_socket_dynamic_plugin_t *this)
|
private_socket_dynamic_plugin_t *this)
|
||||||
{
|
{
|
||||||
@@ -43,8 +54,6 @@ METHOD(plugin_t, get_name, char*,
|
|||||||
METHOD(plugin_t, destroy, void,
|
METHOD(plugin_t, destroy, void,
|
||||||
private_socket_dynamic_plugin_t *this)
|
private_socket_dynamic_plugin_t *this)
|
||||||
{
|
{
|
||||||
charon->socket->remove_socket(charon->socket,
|
|
||||||
(socket_constructor_t)socket_dynamic_socket_create);
|
|
||||||
free(this);
|
free(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,15 +68,12 @@ plugin_t *socket_dynamic_plugin_create()
|
|||||||
.public = {
|
.public = {
|
||||||
.plugin = {
|
.plugin = {
|
||||||
.get_name = _get_name,
|
.get_name = _get_name,
|
||||||
.reload = (void*)return_false,
|
.get_features = _get_features,
|
||||||
.destroy = _destroy,
|
.destroy = _destroy,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
charon->socket->add_socket(charon->socket,
|
|
||||||
(socket_constructor_t)socket_dynamic_socket_create);
|
|
||||||
|
|
||||||
return &this->public.plugin;
|
return &this->public.plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user