strongswan.org
Wiki/Project Management
Downloads
Gitweb
projects
/
strongswan.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed linux26/xfrm.h
[strongswan.git]
/
src
/
libstrongswan
/
chunk.h
diff --git
a/src/libstrongswan/chunk.h
b/src/libstrongswan/chunk.h
index
7fa257b
..
a13ccfc
100644
(file)
--- a/
src/libstrongswan/chunk.h
+++ b/
src/libstrongswan/chunk.h
@@
-79,6
+79,11
@@
chunk_t chunk_create_cat(u_char *ptr, const char* mode, ...);
void chunk_split(chunk_t chunk, const char *mode, ...);
/**
void chunk_split(chunk_t chunk, const char *mode, ...);
/**
+ * Write the binary contents of a chunk_t to a file
+ */
+bool chunk_write(chunk_t chunk, const char *path, const char *label, mode_t mask, bool force);
+
+/**
* Free contents of a chunk
*/
void chunk_free(chunk_t *chunk);
* Free contents of a chunk
*/
void chunk_free(chunk_t *chunk);
@@
-89,6
+94,11
@@
void chunk_free(chunk_t *chunk);
#define chunk_from_buf(str) { str, sizeof(str) }
/**
#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)
* Allocate a chunk on the heap
*/
#define chunk_alloc(bytes) chunk_create(malloc(bytes), bytes)
@@
-124,6
+134,12
@@
void chunk_free(chunk_t *chunk);
chunk_t chunk_skip(chunk_t chunk, size_t bytes);
/**
chunk_t chunk_skip(chunk_t chunk, size_t bytes);
/**
+ * Compare two chunks, returns zero if a equals b
+ * or negative/positive if a is small/greater than b
+ */
+int chunk_compare(chunk_t a, chunk_t b);
+
+/**
* Compare two chunks for equality,
* NULL chunks are never equal.
*/
* Compare two chunks for equality,
* NULL chunks are never equal.
*/