diff --git a/src/libcharon/plugins/osmo_epdg/osmo_epdg_plugin.c b/src/libcharon/plugins/osmo_epdg/osmo_epdg_plugin.c index c166988e8..2b0a1e0ea 100644 --- a/src/libcharon/plugins/osmo_epdg/osmo_epdg_plugin.c +++ b/src/libcharon/plugins/osmo_epdg/osmo_epdg_plugin.c @@ -59,12 +59,14 @@ static bool register_functions(private_osmo_epdg_t *this, this->provider = osmo_epdg_provider_create(gsup); this->listener = osmo_epdg_listener_create(gsup); charon->bus->add_listener(charon->bus, &this->listener->listener); + charon->attributes->add_provider(charon->attributes, &this->provider->attribute); return TRUE; } if (this->listener) { charon->bus->remove_listener(charon->bus, &this->listener->listener); } + charon->attributes->remove_provider(charon->attributes, &this->provider->attribute); this->provider->destroy(this->provider); this->provider = NULL; return TRUE; diff --git a/src/libcharon/plugins/osmo_epdg/osmo_epdg_provider.c b/src/libcharon/plugins/osmo_epdg/osmo_epdg_provider.c index 32c0f8b37..c3abfef7e 100644 --- a/src/libcharon/plugins/osmo_epdg/osmo_epdg_provider.c +++ b/src/libcharon/plugins/osmo_epdg/osmo_epdg_provider.c @@ -138,6 +138,31 @@ METHOD(simaka_provider_t, resync, bool, return FALSE; } +METHOD(attribute_provider_t, acquire_address, host_t*, + private_osmo_epdg_provider_t *this, linked_list_t *pools, ike_sa_t *ike_sa, + host_t *requested) +{ + host_t *address = NULL; + + address = host_create_from_string_and_family("10.45.0.1", AF_INET, 0); + return address; +} + +METHOD(attribute_provider_t, release_address, bool, + private_osmo_epdg_provider_t *this, linked_list_t *pools, host_t *address, + ike_sa_t *ike_sa) +{ + return TRUE; +} + +METHOD(attribute_provider_t, create_attribute_enumerator, enumerator_t*, + private_osmo_epdg_provider_t *this, linked_list_t *pools, ike_sa_t *ike_sa, + linked_list_t *vips) +{ + /* no additional attributes for this ike_sa */ + return enumerator_create_empty(); +} + METHOD(osmo_epdg_provider_t, destroy, void, private_osmo_epdg_provider_t *this) { @@ -153,6 +178,11 @@ osmo_epdg_provider_t *osmo_epdg_provider_create(osmo_epdg_gsup_client_t *gsup) INIT(this, .public = { + .attribute = { + .acquire_address = _acquire_address, + .release_address = _release_address, + .create_attribute_enumerator = _create_attribute_enumerator, + }, .simaka = { .get_triplet = (void*)return_false, .get_quintuplet = _get_quintuplet, diff --git a/src/libcharon/plugins/osmo_epdg/osmo_epdg_provider.h b/src/libcharon/plugins/osmo_epdg/osmo_epdg_provider.h index 5f94efaa6..896ea6fa6 100644 --- a/src/libcharon/plugins/osmo_epdg/osmo_epdg_provider.h +++ b/src/libcharon/plugins/osmo_epdg/osmo_epdg_provider.h @@ -27,6 +27,7 @@ #define OSMO_EPDG_PROVIDER_H_ #include +#include #include "gsup_client.h" typedef struct osmo_epdg_provider_t osmo_epdg_provider_t; @@ -41,6 +42,12 @@ struct osmo_epdg_provider_t { */ simaka_provider_t simaka; + + /** + * Implements attribute_provider interface to assign config attributes and virtual ips. + */ + attribute_provider_t attribute; + /** * Destroy a osmo_epdg_provider_t. */