summaryrefslogtreecommitdiffstats
path: root/src/handshake.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-10-30 22:41:20 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-10-30 22:41:20 +0100
commit601efec8e944bfc6ecb8afbfdfa1393030f36b06 (patch)
tree0826e35d9f69c2c36c89946e8955d097add7b0e3 /src/handshake.h
parent658c83870a254340a777f8ebca48c87dd98c73d6 (diff)
downloadfastd-601efec8e944bfc6ecb8afbfdfa1393030f36b06.tar
fastd-601efec8e944bfc6ecb8afbfdfa1393030f36b06.zip
Add fastd_handshake_add_zero function
Diffstat (limited to 'src/handshake.h')
-rw-r--r--src/handshake.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/handshake.h b/src/handshake.h
index e3d4960..4aff83c 100644
--- a/src/handshake.h
+++ b/src/handshake.h
@@ -119,6 +119,13 @@ static inline void fastd_handshake_add(fastd_context_t *ctx, fastd_buffer_t *buf
memcpy(dst, data, len);
}
+static inline uint8_t* fastd_handshake_add_zero(fastd_context_t *ctx, fastd_buffer_t *buffer, fastd_handshake_record_type_t type, size_t len) {
+ uint8_t *dst = fastd_handshake_extend(ctx, buffer, type, len);
+
+ memset(dst, 0, len);
+ return dst;
+}
+
static inline void fastd_handshake_add_uint8(fastd_context_t *ctx, fastd_buffer_t *buffer, fastd_handshake_record_type_t type, uint8_t value) {
uint8_t *dst = fastd_handshake_extend(ctx, buffer, type, 1);