2019-06-18 07:54:42 +00:00
|
|
|
|
#ifndef CONFIGMAPI_H_
|
|
|
|
|
#define CONFIGMAPI_H_
|
|
|
|
|
|
2019-07-01 07:39:28 +00:00
|
|
|
|
#include "../rpc/rpc_common.h"
|
2019-06-18 07:54:42 +00:00
|
|
|
|
|
|
|
|
|
#define CONFIG_FROM_WEB 0x00000001
|
|
|
|
|
#define CONFIG_FROM_NETOPEER 0x00000010
|
|
|
|
|
#define CONFIG_FROM_RECOVER1 0x01000000
|
|
|
|
|
#define CONFIG_FROM_RECOVER2 0x02000000
|
|
|
|
|
|
2019-07-26 10:03:30 +00:00
|
|
|
|
#define CM_BUFF_SIZE BUF_MAX_SIZE
|
2019-06-20 06:36:16 +00:00
|
|
|
|
|
|
|
|
|
#define CONFIG_RECOVERY_DONE "/tmp/config_recovery"
|
|
|
|
|
|
2019-06-18 07:54:42 +00:00
|
|
|
|
/* 结构体定义 */
|
|
|
|
|
|
|
|
|
|
/* 配置消息 */
|
|
|
|
|
struct _config_message {
|
|
|
|
|
uint64 config_id; /*配置ID*/
|
|
|
|
|
uint source; /*配置来源*/
|
|
|
|
|
uint config_type; /*配置类型:add,del,set*/
|
|
|
|
|
char config_buff[0]; /*配置数据缓存*/
|
|
|
|
|
};
|
|
|
|
|
typedef struct _config_message config_msg_t;
|
|
|
|
|
/* 函数声明 */
|
|
|
|
|
|
|
|
|
|
ret_code web_config_exec_sync(uint config_type, uint64 config_id,
|
|
|
|
|
char* config_data, int config_len,
|
|
|
|
|
char**output, int *output_len);
|
|
|
|
|
|
|
|
|
|
ret_code web_config_exec_async(uint config_type, uint64 config_id,
|
|
|
|
|
char* config_data, int config_len,
|
|
|
|
|
rpc_callback callback, pointer data);
|
|
|
|
|
|
|
|
|
|
#endif /* RPC_COMMON_H_ */
|
|
|
|
|
|