secgateway/Platform/user/configm/config-server/include/configm.h

75 lines
2.5 KiB
C
Raw Normal View History

#ifndef CONFIGM_H_
#define CONFIGM_H_
#include "rpc_common.h"
#include "ipconfig.h"
#include "configmapi.h"
/* 类型定义 */
/* IP CONFIG */
#define IPCONFIG_MODULE 0x00000001
/* config id define*/
#define IPCONFIG_V4 (uint64)((uint64)IPCONFIG_MODULE<<32|1)
/*
1ID
2,
WEB
3
4
5
6
7
8
*/
#define CONFIG_SERVICE_ARRAY \
{ \
{\
IPCONFIG_V4, \
CONFIG_FROM_WEB|CONFIG_FROM_NETOPEER, \
FALSE, \
FALSE, \
ip_config_chk, \
ip_config_proc, \
ip_config_get, \
ip_config_get_all \
}\
}
typedef ret_code (*cm_config_chk)(uint source, uint config_type,
pointer input, int input_len,
pointer output, int *output_len);
typedef ret_code (*cm_config_proc)(uint source, uint config_type,
pointer input, int input_len,
pointer output, int *output_len);
typedef ret_code (*cm_config_get)(uint source,
pointer input, int input_len,
pointer output, int *output_len);
typedef ret_code (*cm_config_get_all)(uint source, uint64 config_id,
pointer output, short *single_len,
int *output_len);
/* 配置注册 */
struct _config_service {
uint64 config_id; /* 配置ID全局唯一用于寻找对应的配置业务*/
uint config_src; /* 配置源检查,全局唯一,用于寻找对应的配置业务,从低位到高位第一位表示web后续配置扩展 */
boolean recovery; /* 配置恢复处理函数如果为FALSE则不进行配置恢复 */
boolean multi_inst; /* 是否是多实例 */
cm_config_chk chk_callback; /* 配置校验回调函数 */
cm_config_proc proc_callback; /* 配置接口 */
cm_config_get get_callback; /* 获取配置接口 */
cm_config_get_all getall_callback; /* 获取所有配置接口 */
};
typedef struct _config_service config_service_t;
#endif /* RPC_COMMON_H_ */