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

92 lines
3.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef CONFIGM_H_
#define CONFIGM_H_
#include "rpc_common.h"
#include "ipconfig.h"
#include "configmapi.h"
#include "user_group_config.h"
/* 类型定义 */
/* IP CONFIG */
#define IPCONFIG_MODULE 0x00000001
/* USER MANAGER CONFIG */
#define USER_MANAGER_CONFIG_MODULE 0x00000002
/* config id define*/
#define IPCONFIG_V4 (uint64)((uint64)IPCONFIG_MODULE<<32|1)
#define USER_MANAGER_CONFIG_GROUP (uint64)((uint64)USER_MANAGER_CONFIG_MODULE<<32|1)
#define USER_MANAGER_CONFIG_USER (uint64)((uint64)USER_MANAGER_CONFIG_MODULE<<32|2)
/*
1、配置ID全局唯一用于寻找对应的配置业务
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 \
},\
{\
USER_MANAGER_CONFIG_GROUP, \
CONFIG_FROM_WEB, \
FALSE, \
FALSE, \
usergroup_config_chk, \
usergroup_config_proc, \
usergroup_config_get, \
usergroup_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 *cnt);
/* 配置注册 */
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_ */