diff options
author | Jesse Luehrs <doy@tozt.net> | 2016-05-16 02:54:33 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2016-05-16 03:05:55 -0400 |
commit | eabb10d017c312c5fac5446fbac5a1c23af94ae3 (patch) | |
tree | d0fbf14a2ef098979a5c79f9d7d54055434fe80c /src/protocol.h | |
parent | 3859c8d205581ee7238552af6bab05bda17f70e4 (diff) | |
download | runes-eabb10d017c312c5fac5446fbac5a1c23af94ae3.tar.gz runes-eabb10d017c312c5fac5446fbac5a1c23af94ae3.zip |
change the protocol up a bit to allow different message types
Diffstat (limited to 'src/protocol.h')
-rw-r--r-- | src/protocol.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/protocol.h b/src/protocol.h index fb3af96..67d6be0 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -5,19 +5,27 @@ #define RUNES_PROTOCOL_MESSAGE_VERSION 1 -struct runes_protocol_message { +struct runes_protocol_new_term_message { uint32_t argc; char **argv; char **envp; char *cwd; }; -int runes_protocol_parse_message( - char *buf, size_t len, struct runes_protocol_message *outmsg); -int runes_protocol_create_message( - struct runes_protocol_message *msg, char **outbuf, size_t *outlen); -void runes_protocol_free_message(struct runes_protocol_message *msg); -int runes_protocol_read_packet(int sock, char **outbuf, size_t *outlen); -int runes_protocol_send_packet(int s, char *buf, size_t len); +enum runes_protocol_message_type { + RUNES_PROTOCOL_NEW_TERM, + RUNES_PROTOCOL_NUM_MESSAGE_TYPES +}; + +int runes_protocol_parse_new_term_message( + char *buf, size_t len, struct runes_protocol_new_term_message *outmsg); +int runes_protocol_create_new_term_message( + struct runes_protocol_new_term_message *msg, + char **outbuf, size_t *outlen); +void runes_protocol_free_new_term_message( + struct runes_protocol_new_term_message *msg); +int runes_protocol_read_packet( + int sock, int *outtype, char **outbuf, size_t *outlen); +int runes_protocol_send_packet(int s, int type, char *buf, size_t len); #endif |