diff options
author | Jan Hutter <jhutter@hsr.ch> | 2005-12-01 17:16:10 +0000 |
---|---|---|
committer | Jan Hutter <jhutter@hsr.ch> | 2005-12-01 17:16:10 +0000 |
commit | a9428251cd1e6fc579204199ca09cbe55a8f2865 (patch) | |
tree | ea8ad014e885a4ae26a852a8c9f1100a82e58413 /Source/charon/utils/identification.c | |
parent | bae00c63f719c06c74d393c65bef0e5ebe25b24c (diff) | |
download | strongswan-a9428251cd1e6fc579204199ca09cbe55a8f2865.tar.bz2 strongswan-a9428251cd1e6fc579204199ca09cbe55a8f2865.tar.xz |
- new configuration support added to ike_sa and states
Diffstat (limited to 'Source/charon/utils/identification.c')
-rw-r--r-- | Source/charon/utils/identification.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/charon/utils/identification.c b/Source/charon/utils/identification.c index 270d96232..124ae46fb 100644 --- a/Source/charon/utils/identification.c +++ b/Source/charon/utils/identification.c @@ -81,6 +81,25 @@ static char *get_string(private_identification_t *this) } /** + * Implementation of identification_t.equals. + */ +static bool equals (private_identification_t *this,private_identification_t *other) +{ + if (this->type == other->type) + { + if (this->encoded.len != other->encoded.len) + { + return FALSE; + } + if (memcmp(this->encoded.ptr,other->encoded.ptr,this->encoded.len) == 0) + { + return TRUE; + } + } + return FALSE; +} + +/** * implements identification_t.destroy */ static void destroy(private_identification_t *this) @@ -99,6 +118,7 @@ static private_identification_t *identification_create() private_identification_t *this = allocator_alloc_thing(private_identification_t); /* assign methods */ + this->public.equals = (bool (*) (identification_t*,identification_t*))equals; this->public.get_encoding = (chunk_t (*) (identification_t*))get_encoding; this->public.get_type = (id_type_t (*) (identification_t*))get_type; this->public.get_string = (char* (*) (identification_t*))get_string; |