unbound: Use plugin features and provide RESOLVER
This commit is contained in:
parent
f5bd1a5e09
commit
d895721489
|
@ -37,10 +37,20 @@ METHOD(plugin_t, get_name, char*,
|
||||||
return "unbound";
|
return "unbound";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
METHOD(plugin_t, get_features, int,
|
||||||
|
private_unbound_plugin_t *this, plugin_feature_t *features[])
|
||||||
|
{
|
||||||
|
static plugin_feature_t f[] = {
|
||||||
|
PLUGIN_REGISTER(RESOLVER, unbound_resolver_create),
|
||||||
|
PLUGIN_PROVIDE(RESOLVER),
|
||||||
|
};
|
||||||
|
*features = f;
|
||||||
|
return countof(f);
|
||||||
|
}
|
||||||
|
|
||||||
METHOD(plugin_t, destroy, void,
|
METHOD(plugin_t, destroy, void,
|
||||||
private_unbound_plugin_t *this)
|
private_unbound_plugin_t *this)
|
||||||
{
|
{
|
||||||
lib->resolver->remove_resolver(lib->resolver, unbound_resolver_create);
|
|
||||||
free(this);
|
free(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,12 +65,11 @@ plugin_t *unbound_plugin_create()
|
||||||
.public = {
|
.public = {
|
||||||
.plugin = {
|
.plugin = {
|
||||||
.get_name = _get_name,
|
.get_name = _get_name,
|
||||||
|
.get_features = _get_features,
|
||||||
.destroy = _destroy,
|
.destroy = _destroy,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
lib->resolver->add_resolver(lib->resolver, unbound_resolver_create);
|
|
||||||
|
|
||||||
return &this->public.plugin;
|
return &this->public.plugin;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue