1
0
mirror of https://github.com/fumiama/simple-dict.git synced 2026-06-05 18:20:26 +08:00
Files
simple-dict/server.h
fumiama 53f46ac1d3 finish
2021-12-12 14:43:54 +08:00

21 lines
528 B
C

#ifndef _SERVER_H_
#define _SERVER_H_
#define THREADCNT 16
#define MAXWAITSEC 10
enum SERVERCMD {CMDGET, CMDCAT, CMDMD5, CMDACK, CMDEND, CMDSET, CMDDEL, CMDDAT};
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_ */