diff options
Diffstat (limited to 'include/packet.c')
-rw-r--r-- | include/packet.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/include/packet.c b/include/packet.c index a523285..45ebcd1 100644 --- a/include/packet.c +++ b/include/packet.c @@ -1,14 +1,17 @@ #include "packet.h" -i64 const commd_size_lookup[64] = {[CMD_CREATE] = sizeof(struct commd_create), - [CMD_DELETE] = sizeof(struct commd_delete), - [CMD_JOIN] = sizeof(struct commd_join), - [CMD_LEAVE] = sizeof(struct commd_leave), - [CMD_REGISTER] = sizeof(struct commd_register), - [CMD_UNREGISTER] = sizeof(struct commd_unregister), - [CMD_GET_PORT] = sizeof(struct commd_get_port), - [CMD_GET_CHANNELS] = 0, // You can not get a sizeof(void) - 0}; +i64 const commd_size_lookup[64] = { + [CMD_CREATE] = sizeof(struct commd_create), + [CMD_DELETE] = sizeof(struct commd_delete), + [CMD_JOIN] = sizeof(struct commd_join), + [CMD_LEAVE] = sizeof(struct commd_leave), + [CMD_REGISTER] = sizeof(struct commd_register), + [CMD_UNREGISTER] = sizeof(struct commd_unregister), + [CMD_GET_PORT] = sizeof(struct commd_get_port), + [CMD_GET_CHANNELS] = 0, // You can not get a sizeof(void) + [CMD_LAST] = -1, + 0 +}; u32 system_packet_checksum(struct kv_system_packet *packet) { @@ -61,6 +64,9 @@ const char *kv_strerror(enum commd_error e) return "Not implemented"; case ERR_DO_IT_YOURSELF: return "You should not have recieved this error. This is either server or network fault"; + case ERR_TYPE: + return "No such command"; } return "Unknown error"; } +/* vim: set ts=8 noet: */ |