diff options
author | Uros Majstorovic <majstor@majstor.org> | 2017-07-17 22:17:51 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2017-07-17 22:17:51 +0200 |
commit | 8f53a56d06b128406cba3ce6f13696eb823e6a11 (patch) | |
tree | a6046e39346dc65d1901fecda480195e214d9870 /code/core/core.h | |
parent | 37f628a88d800123dbad003b122322e8181c3baa (diff) |
ring buffer initial commit
Diffstat (limited to 'code/core/core.h')
-rw-r--r-- | code/core/core.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/code/core/core.h b/code/core/core.h index 6c680f9..cb9bab6 100644 --- a/code/core/core.h +++ b/code/core/core.h @@ -70,7 +70,10 @@ #include "config.h" #include <stddef.h> +#include <stdint.h> + typedef long ssize_t; +typedef uint32_t ecp_seq_t; #ifdef ECP_WITH_PTHREAD #include <pthread.h> @@ -80,8 +83,8 @@ typedef long ssize_t; #include "crypto/crypto.h" #include "timer.h" -#ifdef ECP_WITH_PTHREAD -#include "msgq.h" +#ifdef ECP_WITH_RBUF +#include "rbuf.h" #endif #ifdef ECP_DEBUG @@ -95,8 +98,6 @@ struct ECPContext; struct ECPSocket; struct ECPConnection; -typedef uint32_t ecp_seq_t; - typedef int ecp_rng_t (void *, size_t); typedef int ecp_conn_handler_new_t (struct ECPSocket *s, struct ECPConnection **c, struct ECPConnection *p, unsigned char s_idx, unsigned char c_idx, unsigned char *pub, ecp_aead_key_t *sh, unsigned char *msg, size_t sz); @@ -250,8 +251,10 @@ typedef struct ECPConnection { unsigned char key_idx_map[ECP_MAX_SOCK_KEY]; ECPDHShared shared[ECP_MAX_NODE_KEY][ECP_MAX_NODE_KEY]; unsigned char nonce[ECP_AEAD_SIZE_NONCE]; +#ifdef ECP_WITH_RBUF + ECPConnRBuffer rbuf; +#endif #ifdef ECP_WITH_PTHREAD - ECPConnMsgQ msgq; pthread_mutex_t mutex; #endif struct ECPConnection *proxy; |