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

229 lines
7.1 KiB
C
Raw Normal View History

#ifndef CONFIGM_H_
#define CONFIGM_H_
#include "config_manager.h"
#include "s2j/s2j.h"
#include "../../../../common/rpc/rpc_common.h"
#include "../../../../../Common/commuapinl.h"
#include "../user_manager_config/user_group_config.h"
#include "../user_manager_config/user_account_config.h"
#include "../user_manager_config/user_recover_config.h"
#include "netconfig.h"
#include "log_config.h"
#include "../web_config/authfree.h"
#include "../web_config/auth_parameters.h"
#include "natconfig.h"
#define CONFIG_INIT_ARRAY \
{\
{ \
NETCONFIG_MODULE, \
net_main \
}, \
{ \
LOG_CONFIG_MODULE, \
log_config_init \
} \
}
/*
1ID
2,
WEB
3
4
5
6
7
8
*/
#define CONFIG_SERVICE_ARRAY \
{ \
{\
IPCONFIG_V4, \
CONFIG_FROM_WEB|CONFIG_FROM_NETOPEER, \
FALSE, \
ip_config_chk, \
ip_config_proc, \
ip_config_get, \
ip_config_get_all \
},\
{\
BR_CONFIG, \
CONFIG_FROM_WEB|CONFIG_FROM_NETOPEER, \
FALSE, \
br_config_chk, \
br_config_proc, \
NULL, \
NULL \
},\
{\
BRIF_CONFIG, \
CONFIG_FROM_WEB|CONFIG_FROM_NETOPEER, \
FALSE, \
br_if_config_chk, \
br_if_config_proc, \
br_if_config_get, \
br_if_config_get_all \
},\
{\
BRFDB_CONFIG, \
CONFIG_FROM_WEB|CONFIG_FROM_NETOPEER, \
FALSE, \
br_fdb_config_chk, \
NULL, \
br_fdb_config_get, \
NULL \
},\
{\
USER_MANAGER_CONFIG_GROUP, \
CONFIG_FROM_WEB, \
FALSE, \
usergroup_config_chk, \
usergroup_config_proc, \
usergroup_config_get, \
usergroup_config_get_all \
},\
{\
USER_MANAGER_CONFIG_RECOVER, \
CONFIG_FROM_RECOVER1, \
TRUE, \
userecover_config_chk, \
userecover_config_proc, \
userecover_config_get, \
userecover_config_get_all \
},\
{ \
AUTHFREE_CONFIG, \
CONFIG_FROM_WEB|CONFIG_FROM_NETOPEER, \
FALSE, \
freeauth_config_chk, \
freeauth_config_proc, \
NULL, \
NULL \
},\
{\
FREEPARAMETERS_CONFIG, \
CONFIG_FROM_WEB|CONFIG_FROM_NETOPEER, \
FALSE, \
authpara_config_chk, \
authpara_config_proc, \
NULL, \
NULL \
},\
{\
USER_MANAGER_CONFIG_USER, \
CONFIG_FROM_WEB, \
FALSE, \
user_config_chk, \
user_config_proc, \
user_config_get, \
user_config_get_all \
},\
{\
LOG_CONFIG_CONSOLE, \
CONFIG_FROM_WEB, \
FALSE, \
log_console_config_chk, \
log_console_config_proc, \
NULL, \
NULL \
},\
{\
LOG_CONFIG_MONITOR, \
CONFIG_FROM_WEB, \
FALSE, \
log_monitor_config_chk, \
log_monitor_config_proc, \
NULL, \
NULL \
},\
{\
LOG_CONFIG_REMOTE_ADD_HOST, \
CONFIG_FROM_WEB, \
FALSE, \
log_remote_host_config_chk, \
log_remote_add_host_config_proc, \
NULL, \
NULL \
},\
{\
LOG_CONFIG_REMOTE_DEL_HOST, \
CONFIG_FROM_WEB, \
FALSE, \
log_remote_host_config_chk, \
log_remote_del_host_config_proc, \
NULL, \
NULL \
},\
{\
LOG_CONFIG_REMOTE_LEVEL, \
CONFIG_FROM_WEB, \
FALSE, \
log_remote_level_config_chk, \
log_remote_level_config_proc, \
NULL, \
NULL \
},\
{\
LOG_CONFIG_FILE, \
CONFIG_FROM_WEB, \
FALSE, \
log_file_config_chk, \
log_file_config_proc, \
NULL, \
NULL \
},\
{\
NAT4_CONFIG, \
CONFIG_FROM_WEB, \
FALSE, \
nat_config_chk, \
nat_config_proc, \
NULL, \
nat_config_get_all \
}\
}
typedef ret_code (*cm_config_init)();
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,
pointer output, int *output_len);
/* 配置注册 */
struct _config_init {
uint config_mudlue;
cm_config_init init_callback;
};
typedef struct _config_init config_init_t;
/* 配置注册 */
struct _config_service {
uint64 config_id; /* 配置ID全局唯一用于寻找对应的配置业务*/
uint config_src; /* 配置源检查,全局唯一,用于寻找对应的配置业务,从低位到高位第一位表示web后续配置扩展 */
boolean recovery; /* 配置恢复处理函数如果为FALSE则不进行配置恢复 */
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_ */