1
0
mirror of https://github.com/fumiama/simple-dict.git synced 2026-06-11 05:30:28 +08:00

初步使用新封包

This commit is contained in:
fumiama
2021-12-11 23:50:46 +08:00
parent a16926a673
commit 5abe175e90
6 changed files with 405 additions and 151 deletions

View File

@@ -4,4 +4,17 @@
#define THREADCNT 16
#define MAXWAITSEC 10
enum SERVERCMD {CMDGET, CMDSET, CMDDEL, CMDCAT, CMDMD5, CMDDAT, CMDACK, CMDEND};
struct CMDPACKET {
uint8_t cmd;
uint8_t datalen; // data len is less than 255
uint8_t md5[16]; // md5 digest of data below
uint8_t data[]; // with TEA encoding, 64 bytes will be 160 bytes
};
typedef struct CMDPACKET CMDPACKET;
#define CMDPACKET_HEAD_LEN (1+1+16)
#define CMDPACKET_LEN_MAX (CMDPACKET_HEAD_LEN+255)
#endif /* _SERVER_H_ */