Mod aaa-12 修改配置文件

RCA:
SOL:
修改人:chenling
检视人:
This commit is contained in:
ChenLing 2019-07-02 19:48:55 +08:00
parent f93af5d8a1
commit 944512546a
8 changed files with 42 additions and 44 deletions

View File

@ -27,7 +27,7 @@ VPATH = ../user/configm/config-server
# set the source file, don't used .o because of ... # set the source file, don't used .o because of ...
COMMON_SRCS = configserver.c ipconfig/ipconfig.c ipconfig/parsefile.c COMMON_SRCS = configserver.c ipconfig/ipconfig.c ipconfig/parsefile.c authfree_config/authfree.c localportal_config/localportal.c userlock_config/userlock.c
# MRS Board Source Files # MRS Board Source Files
PLAT_LINUX_SRCS = $(COMMON_SRCS) PLAT_LINUX_SRCS = $(COMMON_SRCS)
@ -42,17 +42,17 @@ PLAT_ARM64_LDFLAGS :=
PLAT_LINUX_LDFLAGS := PLAT_LINUX_LDFLAGS :=
#gcc libs #gcc libs
ARM64_LIBS := ../thirdparty/arm64/libev-arm64.so ./libopenrpc-arm64.so -lpthread -lm ARM64_LIBS := ../thirdparty/arm64/libev-arm64.so ./libopenrpc-arm64.so ./libnetlinku-arm64.so -lpthread -lm
LINUX_LIBS := ../thirdparty/x86_64/libev-linux.so ./libopenrpc-linux.so -lpthread -lm LINUX_LIBS := ../thirdparty/x86_64/libev-linux.so ./libopenrpc-linux.so ./libnetlinku-linux.so -lpthread -lm
ifeq ($(PLAT_ARM64), TRUE) ifeq ($(PLAT_ARM64), TRUE)
DEPEND_LIB += ../thirdparty/arm64/libev-arm64.so ./debug/libopenrpc-arm64.so DEPEND_LIB += ../thirdparty/arm64/libev-arm64.so ./debug/libopenrpc-arm64.so ./debug/libnetlinku-arm64.so
USER_CLEAN_ITEMS += ./libopenrpc-arm64.so USER_CLEAN_ITEMS += ./libopenrpc-arm64.so ./libnetlinku-arm64.so
endif endif
ifeq ($(PLAT_LINUX), TRUE) ifeq ($(PLAT_LINUX), TRUE)
DEPEND_LIB += ../thirdparty/x86_64/libev-linux.so ./debug/libopenrpc-linux.so DEPEND_LIB += ../thirdparty/x86_64/libev-linux.so ./debug/libopenrpc-linux.so ./libnetlinku-linux.so
USER_CLEAN_ITEMS += ./libopenrpc-linux.so USER_CLEAN_ITEMS += ./libopenrpc-linux.so ./libnetlinku-linux.so
endif endif

View File

@ -4,7 +4,7 @@
#include "../../../../common/rpc/rpc.h" #include "../../../../common/rpc/rpc.h"
#include "../include/authfree.h" #include "../include/authfree.h"
#include <cjson/cJSON.h> #include <cjson/cJSON.h>
#include "s2j/s2j.h" #include "../../../../../Common/s2j/s2j.h"
#include "../../../../../Common/commuapinl.h" #include "../../../../../Common/commuapinl.h"
#ifdef FREEAUTH_ACK_COOKIES #ifdef FREEAUTH_ACK_COOKIES
@ -15,7 +15,7 @@
freeauth_configure_t *localuser; freeauth_configure_t *localuser;
/*全局变量初始化 失败为1 成功为0*/ /*全局变量初始化 失败为1 成功为0*/
int Init(freeauth_configure_t *localuser) int authfreeInit(freeauth_configure_t *localuser)
{ {
localuser = (freeauth_configure_t *)malloc(sizeof * localuser); localuser = (freeauth_configure_t *)malloc(sizeof * localuser);
if (NULL == localuser) if (NULL == localuser)
@ -177,7 +177,7 @@ ret_code freeauth_config_chk(uint source, uint config_type,
/*免认证规则有效将免认证规则通过netlink下发到内核态 */ /*免认证规则有效将免认证规则通过netlink下发到内核态 */
int freeauth_config_proc(uint source, uint config_type, ret_code freeauth_config_proc(uint source, uint config_type,
pointer input, int input_len, pointer input, int input_len,
pointer output, int *output_len) pointer output, int *output_len)
{ {
@ -205,7 +205,7 @@ int freeauth_config_proc(uint source, uint config_type,
if(ret1 < 0) if(ret1 < 0)
{ {
printf(" pdlivnl_open fail, exit.\r\n"); printf(" pdlivnl_open fail, exit.\r\n");
return -1; return RET_ERR;
} }
/*下发配置到内核态 */ /*下发配置到内核态 */
@ -213,7 +213,7 @@ int freeauth_config_proc(uint source, uint config_type,
if(ret1 < 0) if(ret1 < 0)
{ {
printf("set_cfg_debug_waitack failed.\r\n"); printf("set_cfg_debug_waitack failed.\r\n");
return -1; return RET_ERR;
} }
/*关闭netlink通道 */ /*关闭netlink通道 */
@ -223,12 +223,7 @@ int freeauth_config_proc(uint source, uint config_type,
/*把免认证规则的配置信息存入全局变量 */ /*把免认证规则的配置信息存入全局变量 */
localuser = struct_freeauth; localuser = struct_freeauth;
return 0; return RET_OK;
}
int main(int argc, char** argv)
{
return 0;
} }

View File

@ -26,7 +26,7 @@ typedef struct {
/*全局变量初始化 失败为1 成功为0*/ /*全局变量初始化 失败为1 成功为0*/
int Init(freeauth_configure_t *localuser); int authfreeInit(freeauth_configure_t *localuser);
/* 判断IPv4格式是否正确*/ /* 判断IPv4格式是否正确*/
@ -43,7 +43,7 @@ ret_code freeauth_config_chk(uint source, uint config_type,
/*免认证规则有效将免认证规则通过netlink下发到内核态 */ /*免认证规则有效将免认证规则通过netlink下发到内核态 */
int freeauth_config_proc(uint source, uint config_type, ret_code freeauth_config_proc(uint source, uint config_type,
pointer input, int input_len, pointer input, int input_len,
pointer output, int *output_len); pointer output, int *output_len);

View File

@ -5,6 +5,11 @@
#include "ipconfig.h" #include "ipconfig.h"
#include "../../../../../Common/commuapinl.h" #include "../../../../../Common/commuapinl.h"
#include "user_group_config.h" #include "user_group_config.h"
#include "authfree.h"
#include "localportal.h"
#include "jumppage.h"
#include "userlock.h"
/* 类型定义 */ /* 类型定义 */
/* IP CONFIG */ /* IP CONFIG */
@ -17,9 +22,6 @@
#define LOCALAUTH_CONFIG_MODULE 0x00000003 #define LOCALAUTH_CONFIG_MODULE 0x00000003
/* config id define*/ /* config id define*/
#define IPCONFIG_V4 (uint64)((uint64)IPCONFIG_MODULE<<32|1) #define IPCONFIG_V4 (uint64)((uint64)IPCONFIG_MODULE<<32|1)
@ -72,8 +74,8 @@
FALSE, \ FALSE, \
portalserver_config_chk, \ portalserver_config_chk, \
portalserver_config_proc, \ portalserver_config_proc, \
portalserver_config_get, \ NULL, \
portalserver_get_all \ NULL \
}, \ }, \
{ \ { \
AUTHFREE_CONFIG, \ AUTHFREE_CONFIG, \
@ -82,8 +84,8 @@
FALSE, \ FALSE, \
freeauth_config_chk, \ freeauth_config_chk, \
freeauth_config_proc, \ freeauth_config_proc, \
freeauth_config_get, \ NULL, \
freeauth_config_get_all \ NULL \
},\ },\
{\ {\
USERLOCK_CONFIG, \ USERLOCK_CONFIG, \
@ -92,19 +94,19 @@
FALSE, \ FALSE, \
userlock_config_chk, \ userlock_config_chk, \
userlock_config_proc, \ userlock_config_proc, \
userlock_config_get, \ NULL, \
userlock_config_get_all \ NULL \
},\ },\
{\ {\
JUMPPAGE_CONFIG, \ JUMPPAGE_CONFIG, \
CONFIG_FROM_WEB|CONFIG_FROM_NETOPEER, \ CONFIG_FROM_WEB|CONFIG_FROM_NETOPEER, \
FALSE, \ FALSE, \
FALSE, \ FALSE, \
jumppage_config_chk, \ NULL, \
jumppage_config_proc, \ jumppage_config_proc, \
jumppage_config_get, \ NULL, \
jumppage_config_get_all \ NULL \
},\ } \
\ \
} }

View File

@ -21,7 +21,7 @@ typedef struct {
}localportal_configure_t; }localportal_configure_t;
/*全局变量初始化 失败为1 成功为0*/ /*全局变量初始化 失败为1 成功为0*/
int Init(localportal_configure_t *localportal); int localportalInit(localportal_configure_t *localportal);
/*检查IP地址是否有效端口号是否被占用 */ /*检查IP地址是否有效端口号是否被占用 */
@ -35,7 +35,7 @@ ret_code portalserver_config_chk(uint source, uint config_type,
/*系统管理模块将数据内容IP地址、端口号发送给web server */ /*系统管理模块将数据内容IP地址、端口号发送给web server */
int portalserver_config_proc(uint source, uint config_type, ret_code portalserver_config_proc(uint source, uint config_type,
pointer input, int input_len, pointer input, int input_len,
pointer output, int *output_len); pointer output, int *output_len);

View File

@ -38,7 +38,7 @@ ret_code userlock_config_chk(uint source, uint config_type,
/*系统管理模块将数据内容IP地址、端口号发送给web server */ /*系统管理模块将数据内容IP地址、端口号发送给web server */
int userlock_config_proc(uint source, uint config_type, ret_code userlock_config_proc(uint source, uint config_type,
pointer input, int input_len, pointer input, int input_len,
pointer output, int *output_len); pointer output, int *output_len);

View File

@ -11,7 +11,7 @@
localportal_configure_t *localportal; localportal_configure_t *localportal;
/*全局变量初始化 失败为1 成功为0*/ /*全局变量初始化 失败为1 成功为0*/
int Init(localportal_configure_t *localportal) int localportalInit(localportal_configure_t *localportal)
{ {
localportal = (localportal_configure_t *)malloc(sizeof * localportal); localportal = (localportal_configure_t *)malloc(sizeof * localportal);
if (NULL == localportal) if (NULL == localportal)
@ -107,7 +107,7 @@ ret_code portalserver_config_chk(uint source, uint config_type,
/*系统管理模块将数据内容IP地址、端口号发送给web server */ /*系统管理模块将数据内容IP地址、端口号发送给web server */
int portalserver_config_proc(uint source, uint config_type, ret_code portalserver_config_proc(uint source, uint config_type,
pointer input, int input_len, pointer input, int input_len,
pointer output, int *output_len) pointer output, int *output_len)
{ {
@ -127,7 +127,8 @@ int portalserver_config_proc(uint source, uint config_type,
/*把本地Portal server的配置信息存入全局变量 */ /*把本地Portal server的配置信息存入全局变量 */
localportal = struct_portal; localportal = struct_portal;
return 0;
return RET_OK;
} }

View File

@ -67,7 +67,7 @@ ret_code userlock_config_chk(uint source, uint config_type,
/*系统管理模块将数据内容IP地址、端口号发送给web server */ /*系统管理模块将数据内容IP地址、端口号发送给web server */
int userlock_config_proc(uint source, uint config_type, ret_code userlock_config_proc(uint source, uint config_type,
pointer input, int input_len, pointer input, int input_len,
pointer output, int *output_len) pointer output, int *output_len)
{ {
@ -85,7 +85,7 @@ int userlock_config_proc(uint source, uint config_type,
/*把本地Portal server的配置信息存入全局变量 */ /*把本地Portal server的配置信息存入全局变量 */
userlock = struct_userlock; userlock = struct_userlock;
return 0; return RET_OK;
} }