summaryrefslogtreecommitdiffstats
path: root/include/protocol.h
diff options
context:
space:
mode:
authorGravatar Ramūnas Mažeikis <ramunasnezinomas@gmail.com> 2019-05-21 19:16:22 +0300
committerGravatar Ramūnas Mažeikis <ramunasnezinomas@gmail.com> 2019-05-21 19:16:22 +0300
commit36b3e7f310c624b7b4e31829090dd02131c528d5 (patch)
tree492df5090f64e298cad3f8995ef9d6a611b45c9d /include/protocol.h
parentcabb90c1240015ee5cd17d91573588527bcc2482 (diff)
downloadusurpation-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/protocol.h')
-rw-r--r--include/protocol.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/protocol.h b/include/protocol.h
index 60d31ea..c5e657b 100644
--- a/include/protocol.h
+++ b/include/protocol.h
@@ -106,12 +106,12 @@ struct tlv {
* Reads last packets received, parses and stores them to be later retreived
* via get_tlv.
* */
-void get_last_data(cd_t connection);
+int get_last_data(cd_t connection);
/** Returns tlv's parsed by get_last_data. Returned tlv is only valid until
* next call to get_tlv.
* */
-struct tlv * get_tlv(void);
+struct tlv * get_tlv(cd_t cd);
/**
* Any modifications made to the pending outgoing packet are nullified.
@@ -129,4 +129,6 @@ int push_data(cd_t connection, const char *data, enum tlv_type);
* */
void flush_data(cd_t connection);
+cd_t protocol_init(void);
+
#endif /* PROTOCOL_H_INCLUDED */