diff options
author | Martin Willi <martin@revosec.ch> | 2012-08-24 09:07:50 +0000 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-08-24 11:19:07 +0200 |
commit | d8eec395b22cc890c6f38236392753c6c80b5cc6 (patch) | |
tree | 1662fc0d9593a22da71e98d0dbe84dc18361211a /src | |
parent | da646ab94ad2cc246819bf1a023b4394745004f4 (diff) | |
download | strongswan-d8eec395b22cc890c6f38236392753c6c80b5cc6.tar.bz2 strongswan-d8eec395b22cc890c6f38236392753c6c80b5cc6.tar.xz |
Add a getter for the mem_pool_t base address
Diffstat (limited to 'src')
-rw-r--r-- | src/libhydra/attributes/mem_pool.c | 7 | ||||
-rw-r--r-- | src/libhydra/attributes/mem_pool.h | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/libhydra/attributes/mem_pool.c b/src/libhydra/attributes/mem_pool.c index f55b3a7d1..33b116d05 100644 --- a/src/libhydra/attributes/mem_pool.c +++ b/src/libhydra/attributes/mem_pool.c @@ -162,6 +162,12 @@ METHOD(mem_pool_t, get_name, const char*, return this->name; } +METHOD(mem_pool_t, get_base, host_t*, + private_mem_pool_t *this) +{ + return this->base; +} + METHOD(mem_pool_t, get_size, u_int, private_mem_pool_t *this) { @@ -463,6 +469,7 @@ mem_pool_t *mem_pool_create(char *name, host_t *base, int bits) INIT(this, .public = { .get_name = _get_name, + .get_base = _get_base, .get_size = _get_size, .get_online = _get_online, .get_offline = _get_offline, diff --git a/src/libhydra/attributes/mem_pool.h b/src/libhydra/attributes/mem_pool.h index bb963de93..7b7e58af7 100644 --- a/src/libhydra/attributes/mem_pool.h +++ b/src/libhydra/attributes/mem_pool.h @@ -39,6 +39,13 @@ struct mem_pool_t { const char* (*get_name)(mem_pool_t *this); /** + * Get the base (first) address of this pool. + * + * @return base address, internal host + */ + host_t* (*get_base)(mem_pool_t *this); + + /** * Get the size (i.e. number of addresses) of this pool. * * @return the size of this pool |