diff options
author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2008-10-29 11:11:01 +0000 |
---|---|---|
committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2008-10-29 11:11:01 +0000 |
commit | 8b80ab5a6950ce6515f477624794defd7531642a (patch) | |
tree | aa8303f3806c5615fbeafc4dc82febe3cd7c24dc /src/libstrongswan/credentials/builder.h | |
parent | db67c87db3c9089ea8d2e14f617bf3d9e2af261f (diff) | |
download | vyos-strongswan-8b80ab5a6950ce6515f477624794defd7531642a.tar.gz vyos-strongswan-8b80ab5a6950ce6515f477624794defd7531642a.zip |
[svn-upgrade] Integrating new upstream version, strongswan (4.2.8)
Diffstat (limited to 'src/libstrongswan/credentials/builder.h')
-rw-r--r-- | src/libstrongswan/credentials/builder.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/libstrongswan/credentials/builder.h b/src/libstrongswan/credentials/builder.h index 22c106b7a..cd75236ba 100644 --- a/src/libstrongswan/credentials/builder.h +++ b/src/libstrongswan/credentials/builder.h @@ -40,6 +40,8 @@ typedef builder_t* (*builder_constructor_t)(int subtype); enum builder_part_t { /** path to a file containing an ASN1 blob, char* */ BUILD_FROM_FILE, + /** unix socket of a ssh/pgp agent, char* */ + BUILD_AGENT_SOCKET, /** DER encoded ASN1 blob, chunk_t */ BUILD_BLOB_ASN1_DER, /** PEM encoded ASN1 blob, null terminated char* */ @@ -94,8 +96,8 @@ struct builder_t { /** * Add a part to the construct. * - * Any added parts get owned by the builder/construct, so clone/refcount - * them if needed. + * Any added parts are cloned/refcounted by the builder implementation, a + * caller may need to free the passed ressources themself. * * @param part kind of part * @param ... part specific variable argument @@ -112,4 +114,15 @@ struct builder_t { void* (*build)(builder_t *this); }; +/** + * Helper macro to cancel a build in a builder + */ +#define builder_cancel(builder) { (builder)->add = (void*)nop; \ + (builder)->build = (void*)builder_free; } + +/** + * Helper function for a cancelled build. + */ +void* builder_free(builder_t *this); + #endif /* BUILDER_H_ @}*/ |