From aef4eba5572d6b42f8ef2913ec41c0e778731960 Mon Sep 17 00:00:00 2001 From: Gediminas Jakutis Date: Thu, 23 May 2019 11:42:08 +0300 Subject: dameon: net: implement sending data. Also, dropped some adhockery and rebased some code. Signed-off-by: Gediminas Jakutis --- include/net.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/net.h') diff --git a/include/net.h b/include/net.h index e4ca0a6..02767dc 100644 --- a/include/net.h +++ b/include/net.h @@ -22,6 +22,9 @@ #ifndef USURPATION_NET_H_INCLUDED #define USURPATION_NET_H_INCLUDED +#include +#include + #define MTU 1500 enum response { @@ -29,8 +32,6 @@ enum response { A_OK = 0, /* would be "OK", but clashes with some lib definitions */ NONEWDATA, DEAD, - NO_ESPTOOL, - TMPFILE, }; /** @@ -49,5 +50,7 @@ int net_close(int nd); * and needs to be free()'d later. Otherwise, the supplied buffer is reused. */ int net_getlastdata(int nd, char ** const data); +int net_send(int nd, const char * const buf, size_t buf_size); +int net_send_addr(int nd, const char * const buf, size_t buf_size, const struct sockaddr_in * const addr); #endif /* USURPATION_NET_H_INCLUDED */ -- cgit v1.2.3 From 187fe61700fc97fff565ec53aac65c664042feae Mon Sep 17 00:00:00 2001 From: Gediminas Jakutis Date: Wed, 29 May 2019 13:03:49 +0300 Subject: daemon: get ready to use messaging interfaces. Signed-off-by: Gediminas Jakutis --- include/net.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/net.h') diff --git a/include/net.h b/include/net.h index 02767dc..8385943 100644 --- a/include/net.h +++ b/include/net.h @@ -22,7 +22,11 @@ #ifndef USURPATION_NET_H_INCLUDED #define USURPATION_NET_H_INCLUDED +#ifdef unix +#include #include +#endif + #include #define MTU 1500 @@ -51,6 +55,9 @@ int net_close(int nd); */ int net_getlastdata(int nd, char ** const data); int net_send(int nd, const char * const buf, size_t buf_size); + +#ifdef unix int net_send_addr(int nd, const char * const buf, size_t buf_size, const struct sockaddr_in * const addr); +#endif #endif /* USURPATION_NET_H_INCLUDED */ -- cgit v1.2.3