diff options
author | Martin Willi <martin@strongswan.org> | 2006-03-16 15:25:06 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-03-16 15:25:06 +0000 |
commit | 16b9a73cc4bd4c4fafc8618fdd4c05ab72195df1 (patch) | |
tree | b7d3214d59942dbd75ad8b9b8f86468f82f7a496 /Source/charon/utils/identification.c | |
parent | b1953ccd05b5e6cf5a87c557208d5f8a1fcad231 (diff) | |
download | strongswan-16b9a73cc4bd4c4fafc8618fdd4c05ab72195df1.tar.bz2 strongswan-16b9a73cc4bd4c4fafc8618fdd4c05ab72195df1.tar.xz |
- reworked configuration framework completly
- configuration is now split up in: connections, policies, credentials and daemon config
- further alloc/free fixes needed!
Diffstat (limited to 'Source/charon/utils/identification.c')
-rw-r--r-- | Source/charon/utils/identification.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/charon/utils/identification.c b/Source/charon/utils/identification.c index 844c98b8d..73f218874 100644 --- a/Source/charon/utils/identification.c +++ b/Source/charon/utils/identification.c @@ -70,6 +70,8 @@ struct private_identification_t { id_type_t type; }; +static private_identification_t *identification_create(); + /** * Implementation of identification_t.get_encoding. */ @@ -114,6 +116,21 @@ static bool equals (private_identification_t *this,private_identification_t *oth } /** + * Implementation of identification_t.clone. + */ +static identification_t *clone(private_identification_t *this) +{ + private_identification_t *clone = identification_create(); + + clone->type = this->type; + clone->encoded = allocator_clone_chunk(this->encoded); + clone->string = allocator_alloc(strlen(this->string) + 1); + strcpy(clone->string, this->string); + + return &clone->public; +} + +/** * Implementation of identification_t.destroy. */ static void destroy(private_identification_t *this) @@ -136,6 +153,7 @@ static private_identification_t *identification_create() 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; + this->public.clone = (identification_t* (*) (identification_t*))clone; this->public.destroy = (void (*) (identification_t*))destroy; this->string = NULL; @@ -144,6 +162,7 @@ static private_identification_t *identification_create() return this; } + /* * Described in header. */ |