diff options
author | David Phillips <david@sighup.nz> | 2018-06-04 00:09:02 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2018-06-04 00:09:02 +1200 |
commit | 5f5316a034d68f8825a16e7b866c8e8b2b6c6bd8 (patch) | |
tree | ba8d8b59113aa0ec02b92cf14a50e2cef0913684 /inc | |
download | alarmd-5f5316a034d68f8825a16e7b866c8e8b2b6c6bd8.tar.xz |
Initial dump of prototype
Diffstat (limited to 'inc')
-rw-r--r-- | inc/alarmd_proto.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/inc/alarmd_proto.h b/inc/alarmd_proto.h new file mode 100644 index 0000000..ebeddf1 --- /dev/null +++ b/inc/alarmd_proto.h @@ -0,0 +1,23 @@ +#ifndef ALARMD_PROTO_H +#define ALARMD_PROTO_H + +#include <stdint.h> + +#define ALARMD_PORT "1433" + +enum alarmd_packet_type { + ALARMD_PACKET_TYPE_REGISTER, + ALARMD_PACKET_TYPE_DEREGISTER, + ALARMD_PACKET_TYPE_RAISE, + ALARMD_PACKET_TYPE_CLEAR, + ALARMD_PACKET_TYPE_QUERY, +}; + +int8_t recv_string(int sock, char (*buffer)[128]); +int send_string(int sock, char *buffer); +int alarmd_register(int sock, char *desc, char (*uuid)[16]); +int alarmd_deregister(int sock, char uuid[16]); +int alarmd_raise(int sock, char uuid[16]); +int alarmd_clear(int sock, char uuid[16]); + +#endif /* ALARMD_PROTO_H */ |