summaryrefslogtreecommitdiff
path: root/rcon-protocol.h
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-23 16:25:36 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-23 16:25:36 +0200
commit8c27290245b7bcc7cd2f72f3b4a7562294b43bbe (patch)
tree54bae7909a94bfc598df7b88d9794742daf0bb31 /rcon-protocol.h
parent973ae757342b91e3e6aafd07e0c0a24af84aad98 (diff)
Split directories better
Diffstat (limited to 'rcon-protocol.h')
-rw-r--r--rcon-protocol.h41
1 files changed, 0 insertions, 41 deletions
diff --git a/rcon-protocol.h b/rcon-protocol.h
deleted file mode 100644
index 35997c4..0000000
--- a/rcon-protocol.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef foorconprotocolhfoo
-#define foorconprotocolhfoo
-
-#include <stdbool.h>
-#include <stdint.h>
-
-enum rcon_packet_type {
- RCON_PACKET_LOGIN = 3,
- RCON_PACKET_LOGIN_OK = 2,
- RCON_PACKET_LOGIN_FAIL = -1,
- RCON_PACKET_COMMAND = 2,
- RCON_PACKET_RESPONSE = 0,
-};
-
-#define RCON_INT_LEN 4
-
-#define RCON_END_LEN 2
-
-#define RCON_HDR_LEN 4
-
-/* header + reqid + type + end */
-#define RCON_PKT_MIN_LEN (RCON_HDR_LEN + 2 * RCON_INT_LEN + RCON_END_LEN)
-
-static inline size_t
-rcon_protocol_packet_len(size_t msglen)
-{
- /* header + reqid + type + msg + end */
- return (RCON_PKT_MIN_LEN + msglen);
-}
-
-bool rcon_protocol_create_packet(char *buf, size_t len, size_t *rlen,
- int32_t reqid, enum rcon_packet_type type,
- const char *msg);
-
-int32_t rcon_protocol_packet_complete(const char *buf, size_t len);
-
-bool rcon_protocol_read_packet(const char *buf, size_t len, int32_t *id,
- int32_t *type, const char **rmsg,
- const char **error);
-
-#endif