diff --git a/Common/config_manager.h b/Common/config_manager.h index 49743d901..88dae3601 100755 --- a/Common/config_manager.h +++ b/Common/config_manager.h @@ -23,6 +23,7 @@ typedef enum{ NAT_CONFIG_MODULE = 0x00000008, ///< nat config STATIC_ROUTING_CONFIG_MODULE = 0x00000009, ///< static routing OBJECT_MANAGER_CONFIG_MODULE = 0x0000000A, ///< Object manager config id + IPSEC_CONFIG_MODULE = 0x0000000B, ///< ipsec config CONFIG_ID_MAX, } CONFIG_ID_TYPE; @@ -100,6 +101,12 @@ typedef enum{ #define OBJECT_CONFIG (uint64)((uint64)OBJECT_MANAGER_CONFIG_MODULE<<32|1) #define OBJECT_GETALL_CONFIG (uint64)((uint64)OBJECT_MANAGER_CONFIG_MODULE<<32|2) + +#define IPSEC_IKE_CONFIG (uint64)((uint64)IPSEC_CONFIG_MODULE<<32|1) +#define IPSEC_FORWARD_CONFIG (uint64)((uint64)IPSEC_CONFIG_MODULE<<32|2) + + + /************************ config id定义 end**********************/ #endif diff --git a/Platform/build/user.configm.Makefile b/Platform/build/user.configm.Makefile index 8081a162c..d63772c0d 100755 --- a/Platform/build/user.configm.Makefile +++ b/Platform/build/user.configm.Makefile @@ -75,7 +75,8 @@ COMMON_SRCS = configserver.c \ LTE_config/LTE_config.c \ object_manager.c \ log.c \ - hexdump.c + hexdump.c \ + ipsec_config/ike_config.c @@ -89,7 +90,7 @@ COMMOM_CFLAGS = -I../user/configm/config-server/include \ -I../common/configm -I../common/rpc -I../common/rpc/hashtable \ -I../common/ulog -I../user/configm/config-server/netconfig/ \ -I../user/configm/config-server/netconfig/bridge/include \ - -I../common -I../../Producd/common + -I../common -I../../Producd/common -I/usr/include/nspr # gcc CFLAGS PLAT_ARM64_CFLAGS := $(COMMOM_CFLAGS) @@ -98,7 +99,7 @@ PLAT_LINUX_CFLAGS := $(COMMOM_CFLAGS) PLAT_ARM64_LDFLAGS := PLAT_LINUX_LDFLAGS := -COMMON_STD_LIB := -lpthread -lm -lcjson -levent -ljson-c -lhiredis -lodbc -lev -ldl +COMMON_STD_LIB := -lpthread -lm -lcjson -levent -ljson-c -lhiredis -lodbc -lev -ldl -lipsecconf -lwhack -lswan -llswtool -lswan -lunbound #gcc libs PLAT_ARM64_LIBS := -lopenrpc-$(ARM64_OBJ_TARGET) -lnetlinku-$(ARM64_OBJ_TARGET) -lredismq-$(ARM64_OBJ_TARGET) PLAT_ARM64_LIBS += -lulogapi-$(ARM64_OBJ_TARGET) -ldatabase-$(ARM64_OBJ_TARGET) $(COMMON_STD_LIB) diff --git a/Platform/user/configm/config-server/include/configm.h b/Platform/user/configm/config-server/include/configm.h index 08731e71c..66b152572 100755 --- a/Platform/user/configm/config-server/include/configm.h +++ b/Platform/user/configm/config-server/include/configm.h @@ -18,6 +18,7 @@ #include "static_routing.h" #include "LTE_config.h" #include "../object_manager/object_manager.h" +#include "ike_config.h" #define RET_CODE_LEN 16 #define RET_MSG_LEN 128 @@ -328,6 +329,15 @@ NULL, \ object_config_get, \ object_config_get_all, \ + }, \ + { \ + IPSEC_IKE_CONFIG, \ + CONFIG_FROM_WEB, \ + FALSE, \ + ike_config_chk, \ + ike_config_proc, \ + NULL, \ + NULL, \ } \ } diff --git a/Platform/user/configm/config-server/include/ike_config.h b/Platform/user/configm/config-server/include/ike_config.h new file mode 100755 index 000000000..ca4da74b3 --- /dev/null +++ b/Platform/user/configm/config-server/include/ike_config.h @@ -0,0 +1,16 @@ +#ifndef _IKE_CONFIG_H +#define _IKE_CONFIG_H + +#include + +#include "rpc_types.h" +#include "rpc_common.h" + +ret_code ike_config_chk(uint source, uint *config_type, + pointer input, int *input_len, + pointer output, int *output_len); +ret_code ike_config_proc(uint source, uint config_type, + pointer input, int input_len, + pointer output, int *output_len); + +#endif diff --git a/Platform/user/configm/config-server/ipsec_config/ike_config.c b/Platform/user/configm/config-server/ipsec_config/ike_config.c new file mode 100755 index 000000000..1b79887cc --- /dev/null +++ b/Platform/user/configm/config-server/ipsec_config/ike_config.c @@ -0,0 +1,30 @@ +#include "ike_config.h" + +#include "lswalloc.h" + +#include +#include + +ret_code ike_config_chk(uint source, uint *config_type, + pointer input, int *input_len, + pointer output, int *output_len) +{ + return RET_OK; +} + +ret_code ike_config_proc(uint source, uint config_type, + pointer input, int input_len, + pointer output, int *output_len) +{ + + ipsecconf_default_values(NULL); + /* + resolve_defaultroute(conn); + starter_whack_add_conn(cfg, conn); + starter_whack_listen(cfg); + starter_whack_route_conn(cfg, conn); + */ + + return RET_OK; +} +