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

207 lines
6.2 KiB
C
Executable File
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 "s2j/s2j.h"
#include "../../../../common/rpc/rpc_common.h"
#include "ipconfig.h"
#include "../../../../../Common/commuapinl.h"
#include "../user_manager_config/user_group_config.h"
#include "../user_manager_config/user_account_config.h"
#include "log_config.h"
#include "authfree.h"
#include "localportal.h"
#include "jumppage.h"
#include "userlock.h"
#include "agingtime.h"
/* 类型定义 */
/* IP CONFIG */
#define NETCONFIG_MODULE 0x00000001
/* USER MANAGER CONFIG */
#define USER_MANAGER_CONFIG_MODULE 0x00000002
/*PORTAL SERVER CONFIG */
#define LOCALAUTH_CONFIG_MODULE 0x00000003
#define LOG_CONFIG_MODULE 0x00000004
/* config id define*/
#define IPCONFIG_V4 (uint64)((uint64)NETCONFIG_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)
#define PORTALSERVER_CONFIG (uint64)((uint64)LOCALAUTH_CONFIG_MODULE<<32|1)
#define AUTHFREE_CONFIG (uint64)((uint64)LOCALAUTH_CONFIG_MODULE<<32|2)
#define USERLOCK_CONFIG (uint64)((uint64)LOCALAUTH_CONFIG_MODULE<<32|3)
#define JUMPPAGE_CONFIG (uint64)((uint64)LOCALAUTH_CONFIG_MODULE<<32|4)
#define AGINGTIME_CONFIG (uint64)((uint64)LOCALAUTH_CONFIG_MODULE<<32|5)
#define LOG_CONFIG_CONSOLE (uint64)((uint64)LOG_CONFIG_MODULE<<32|1)
#define CONFIG_INIT_ARRAY \
{\
{\
NETCONFIG_MODULE,\
NULL\
},\
{ \
LOG_CONFIG_MODULE, \
log_config_init \
} \
}
/*
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 \
},\
{\
PORTALSERVER_CONFIG, \
CONFIG_FROM_WEB|CONFIG_FROM_NETOPEER, \
FALSE, \
FALSE, \
portalserver_config_chk, \
portalserver_config_proc, \
NULL, \
NULL \
}, \
{ \
AUTHFREE_CONFIG, \
CONFIG_FROM_WEB|CONFIG_FROM_NETOPEER, \
FALSE, \
FALSE, \
freeauth_config_chk, \
freeauth_config_proc, \
NULL, \
NULL \
},\
{\
USERLOCK_CONFIG, \
CONFIG_FROM_WEB|CONFIG_FROM_NETOPEER, \
FALSE, \
FALSE, \
userlock_config_chk, \
userlock_config_proc, \
NULL, \
NULL \
},\
{\
JUMPPAGE_CONFIG, \
CONFIG_FROM_WEB|CONFIG_FROM_NETOPEER, \
FALSE, \
FALSE, \
NULL, \
jumppage_config_proc, \
NULL, \
NULL \
}, \
{\
AGINGTIME_CONFIG, \
CONFIG_FROM_WEB|CONFIG_FROM_NETOPEER, \
FALSE, \
FALSE, \
agingtime_config_chk, \
agingtime_config_proc, \
agingtime_config_get, \
agingtime_config_get_all \
}, \
{\
USER_MANAGER_CONFIG_USER, \
CONFIG_FROM_WEB, \
FALSE, \
FALSE, \
user_config_chk, \
user_config_proc, \
user_config_get, \
user_config_get_all \
},\
{\
LOG_CONFIG_CONSOLE, \
CONFIG_FROM_WEB, \
FALSE, \
FALSE, \
log_console_config_chk, \
log_console_config_proc, \
NULL, \
NULL \
}\
}
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则不进行配置恢复 */
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_ */