diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libstrongswan/chunk.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstrongswan/chunk.h b/src/libstrongswan/chunk.h index 9880ae20f..e4e816f0f 100644 --- a/src/libstrongswan/chunk.h +++ b/src/libstrongswan/chunk.h @@ -89,6 +89,11 @@ void chunk_free(chunk_t *chunk); #define chunk_from_buf(str) { str, sizeof(str) } /** + * Initialize a chunk to point to a thing + */ +#define chunk_from_thing(thing) chunk_create((char*)&(thing), sizeof(thing)) + +/** * Allocate a chunk on the heap */ #define chunk_alloc(bytes) chunk_create(malloc(bytes), bytes) |