From: Martin Willi Date: Fri, 24 Aug 2012 09:07:50 +0000 (+0000) Subject: Add a getter for the mem_pool_t base address X-Git-Tag: 5.0.1~153^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8eec395b22cc890c6f38236392753c6c80b5cc6;p=thirdparty%2Fstrongswan.git Add a getter for the mem_pool_t base address --- diff --git a/src/libhydra/attributes/mem_pool.c b/src/libhydra/attributes/mem_pool.c index f55b3a7d1d..33b116d057 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 bb963de93a..7b7e58af75 100644 --- a/src/libhydra/attributes/mem_pool.h +++ b/src/libhydra/attributes/mem_pool.h @@ -38,6 +38,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. *