summaryrefslogtreecommitdiffstats
path: root/src/fastd.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-07-25 15:17:54 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-07-25 15:17:54 +0200
commit900ac61351cabc78b5126adbe9c9936d1c3b5ca6 (patch)
treeaf2c93deb9cdeec30aa5d7f79cc69519cb5b3217 /src/fastd.h
parentc3dee51736841587b2f81adc54c1949276ab5de0 (diff)
downloadfastd-900ac61351cabc78b5126adbe9c9936d1c3b5ca6.tar
fastd-900ac61351cabc78b5126adbe9c9936d1c3b5ca6.zip
Move send functions out of fastd.c
Diffstat (limited to 'src/fastd.h')
-rw-r--r--src/fastd.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/fastd.h b/src/fastd.h
index 8668db6..1bbda28 100644
--- a/src/fastd.h
+++ b/src/fastd.h
@@ -208,6 +208,13 @@ struct fastd_config {
const fastd_protocol_t *protocol;
const fastd_method_t *methods[MAX_METHODS];
const fastd_method_t *method_default;
+
+ size_t max_packet_size;
+ size_t min_encrypt_head_space;
+ size_t min_decrypt_head_space;
+ size_t min_encrypt_tail_space;
+ size_t min_decrypt_tail_space;
+
char *secret;
unsigned key_valid;
unsigned key_refresh;
@@ -302,6 +309,7 @@ struct fastd_string_stack {
void fastd_send(fastd_context_t *ctx, const fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_buffer_t buffer);
+void fastd_send_all(fastd_context_t *ctx, fastd_peer_t *source_peer, fastd_buffer_t buffer);
void fastd_send_handshake(fastd_context_t *ctx, const fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_buffer_t buffer);
void fastd_handle_receive(fastd_context_t *ctx, fastd_peer_t *peer, fastd_buffer_t buffer);
@@ -483,4 +491,8 @@ static inline bool strequal(const char *str1, const char *str2) {
return (str1 == str2);
}
+static inline size_t max_size_t(size_t a, size_t b) {
+ return (a > b) ? a : b;
+}
+
#endif /* _FASTD_FASTD_H_ */