diff options
author | 2019-05-21 19:16:22 +0300 | |
---|---|---|
committer | 2019-05-21 19:16:22 +0300 | |
commit | 36b3e7f310c624b7b4e31829090dd02131c528d5 (patch) | |
tree | 492df5090f64e298cad3f8995ef9d6a611b45c9d /include/net.h | |
parent | cabb90c1240015ee5cd17d91573588527bcc2482 (diff) | |
download | usurpation-36b3e7f310c624b7b4e31829090dd02131c528d5.tar.gz usurpation-36b3e7f310c624b7b4e31829090dd02131c528d5.tar.bz2 usurpation-36b3e7f310c624b7b4e31829090dd02131c528d5.zip |
Protocol: implementation of device-side protocol.
Parts of protocol specific for device are implementepd to reflect the
fact that the device is a client. This effectively means that device
gets a single connection only and severe memory restrictions about
which the daemon might get informed about in the future.
Signed-off-by: Ramūnas Mažeikis <ramunasnezinomas@gmail.com>
Diffstat (limited to 'include/net.h')
-rw-r--r-- | include/net.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/net.h b/include/net.h index 34f557a..6860455 100644 --- a/include/net.h +++ b/include/net.h @@ -33,9 +33,21 @@ enum response { TMPFILE, }; - +/** + * Initialises connection with daemon and returns a network descriptor. + */ int net_init(const unsigned short int port); + +/** + * Closes connection associated with network descriptor. + */ int net_close(int nd); + +/** + * Get last data received from connection associated with network descriptor. + * Function mallocates a buffer for data received from packet. Don't forget to + * free the buffer. + */ int net_getlastdata(int nd, char * const data); #endif /* NET_H_INCLUDED */ |