From: Guus Sliepen Date: Sat, 16 Aug 2014 15:48:48 +0000 (+0200) Subject: Add utcp_set_mtu(). X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=65af2149e7e8f830146adeba414fc6ad0d818a33;p=utcp Add utcp_set_mtu(). --- diff --git a/utcp.c b/utcp.c index 6588528..02305d1 100644 --- a/utcp.c +++ b/utcp.c @@ -1064,6 +1064,11 @@ void utcp_exit(struct utcp *utcp) { free(utcp); } +void utcp_set_mtu(struct utcp *utcp, uint16_t mtu) { + // TODO: handle overhead of the header + utcp->mtu = mtu; +} + int utcp_set_connection_timeout(struct utcp *u, int timeout) { int prev = u->timeout; u->timeout = timeout; diff --git a/utcp.h b/utcp.h index 3e069a0..b189a24 100644 --- a/utcp.h +++ b/utcp.h @@ -46,6 +46,9 @@ typedef int (*utcp_recv_t)(struct utcp_connection *connection, const void *data, extern struct utcp *utcp_init(utcp_accept_t accept, utcp_pre_accept_t pre_accept, utcp_send_t send, void *priv); extern void utcp_exit(struct utcp *utcp); + +extern void utcp_set_mtu(struct utcp *utcp, uint16_t mtu); + extern struct utcp_connection *utcp_connect(struct utcp *utcp, uint16_t port, utcp_recv_t recv, void *priv); extern void utcp_accept(struct utcp_connection *utcp, utcp_recv_t recv, void *priv); extern ssize_t utcp_send(struct utcp_connection *connection, const void *data, size_t len);