X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=utcp.h;h=a29ef96b9293975db7482c92d4508e4e0a3df63e;hb=f1467a0aa5dc2f683d657d6b3670c98bcf1b1abe;hp=7ebca734bfa36f650b55f829a3e8f80c2def80d1;hpb=5e2471e7e38b68745668aa9c3b1d55297895bba2;p=utcp diff --git a/utcp.h b/utcp.h index 7ebca73..a29ef96 100644 --- a/utcp.h +++ b/utcp.h @@ -40,6 +40,10 @@ struct utcp; struct utcp_connection; #endif +#define UTCP_SHUT_RD 0 +#define UTCP_SHUT_WR 1 +#define UTCP_SHUT_RDWR 2 + typedef bool (*utcp_pre_accept_t)(struct utcp *utcp, uint16_t port); typedef void (*utcp_accept_t)(struct utcp_connection *utcp_connection, uint16_t port); @@ -61,6 +65,8 @@ extern int utcp_shutdown(struct utcp_connection *connection, int how); extern struct timeval utcp_timeout(struct utcp *utcp); extern void utcp_set_recv_cb(struct utcp_connection *connection, utcp_recv_t recv); extern void utcp_set_poll_cb(struct utcp_connection *connection, utcp_poll_t poll); +extern void utcp_set_accept_cb(struct utcp *utcp, utcp_accept_t accept, utcp_pre_accept_t pre_accept); +extern bool utcp_is_active(struct utcp *utcp); // Global socket options