common.h 549 字节
Newer Older
M
Minghao Li 已提交
1 2 3 4 5 6 7
#ifndef TDENGINE_COMMON_H
#define TDENGINE_COMMON_H

#ifdef __cplusplus
extern "C" {
#endif

8 9 10 11 12 13 14
#include <stdint.h>

#define MAX_PEERS 10
#define COMMAND_LEN 512
#define TOKEN_LEN 128
#define DIR_LEN 256
#define HOST_LEN 64
M
Minghao Li 已提交
15 16
#define ADDRESS_LEN (HOST_LEN + 16)

17 18 19 20 21 22 23 24 25 26 27 28 29
typedef struct {
    char host[HOST_LEN];
    uint32_t port;
} Addr;

typedef struct {
    Addr me;
    Addr peers[MAX_PEERS];
    int peersCount;
    char dir[DIR_LEN];
    char dataDir[DIR_LEN + HOST_LEN * 2];
} SRaftServerConfig;

M
Minghao Li 已提交
30 31 32 33 34
#ifdef __cplusplus
}
#endif

#endif // TDENGINE_COMMON_H