implement static IP assignment of 10.45.0.1
This commit is contained in:
parent
2771a44af7
commit
afcdf9b932
|
@ -59,12 +59,14 @@ static bool register_functions(private_osmo_epdg_t *this,
|
||||||
this->provider = osmo_epdg_provider_create(gsup);
|
this->provider = osmo_epdg_provider_create(gsup);
|
||||||
this->listener = osmo_epdg_listener_create(gsup);
|
this->listener = osmo_epdg_listener_create(gsup);
|
||||||
charon->bus->add_listener(charon->bus, &this->listener->listener);
|
charon->bus->add_listener(charon->bus, &this->listener->listener);
|
||||||
|
charon->attributes->add_provider(charon->attributes, &this->provider->attribute);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
if (this->listener)
|
if (this->listener)
|
||||||
{
|
{
|
||||||
charon->bus->remove_listener(charon->bus, &this->listener->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->destroy(this->provider);
|
||||||
this->provider = NULL;
|
this->provider = NULL;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -138,6 +138,31 @@ METHOD(simaka_provider_t, resync, bool,
|
||||||
return FALSE;
|
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,
|
METHOD(osmo_epdg_provider_t, destroy, void,
|
||||||
private_osmo_epdg_provider_t *this)
|
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,
|
INIT(this,
|
||||||
.public = {
|
.public = {
|
||||||
|
.attribute = {
|
||||||
|
.acquire_address = _acquire_address,
|
||||||
|
.release_address = _release_address,
|
||||||
|
.create_attribute_enumerator = _create_attribute_enumerator,
|
||||||
|
},
|
||||||
.simaka = {
|
.simaka = {
|
||||||
.get_triplet = (void*)return_false,
|
.get_triplet = (void*)return_false,
|
||||||
.get_quintuplet = _get_quintuplet,
|
.get_quintuplet = _get_quintuplet,
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#define OSMO_EPDG_PROVIDER_H_
|
#define OSMO_EPDG_PROVIDER_H_
|
||||||
|
|
||||||
#include <simaka_provider.h>
|
#include <simaka_provider.h>
|
||||||
|
#include <attributes/attribute_provider.h>
|
||||||
#include "gsup_client.h"
|
#include "gsup_client.h"
|
||||||
|
|
||||||
typedef struct osmo_epdg_provider_t osmo_epdg_provider_t;
|
typedef struct osmo_epdg_provider_t osmo_epdg_provider_t;
|
||||||
|
@ -41,6 +42,12 @@ struct osmo_epdg_provider_t {
|
||||||
*/
|
*/
|
||||||
simaka_provider_t simaka;
|
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.
|
* Destroy a osmo_epdg_provider_t.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue