Merge branch 'master' of http://git.komect.net/ISG/secogateway
This commit is contained in:
commit
122fd2d982
|
@ -27,7 +27,7 @@ VPATH = ../user/configm/config-server
|
|||
|
||||
# set the source file, don't used .o because of ...
|
||||
|
||||
COMMON_SRCS = configserver.c ipconfig/ipconfig.c ipconfig/parsefile.c authfree_config/authfree.c localportal_config/localportal.c userlock_config/userlock.c
|
||||
COMMON_SRCS = configserver.c ipconfig/ipconfig.c ipconfig/parsefile.c authfree_config/authfree.c localportal_config/localportal.c userlock_config/userlock.c jumppage_config/jumppage.c
|
||||
|
||||
# MRS Board Source Files
|
||||
PLAT_LINUX_SRCS = $(COMMON_SRCS)
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef JUMPPAGE_H_
|
||||
#define JUMPPAGE_H_
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <net/if.h>
|
||||
#include "../../../../common/rpc/rpc_common.h"
|
||||
|
||||
|
||||
/*系统管理模块将数据内容(URL地址)发送给web server */
|
||||
ret_code jumppage_config_proc(uint source, uint config_type,
|
||||
pointer input, int input_len,
|
||||
pointer output, int *output_len);
|
||||
|
||||
#endif
|
|
@ -4,7 +4,7 @@
|
|||
#define IFCONFIG_PATH "/etc/network/interfaces"
|
||||
#define IF_BUFF_LEN 128
|
||||
|
||||
void set_if_config(char *if_name, char *conf_name, char *conf_buff);
|
||||
void del_if_config(char *if_name, char *conf_buff);
|
||||
void ip_conf_file_set(char *if_name, char *conf_name, char *conf_buff);
|
||||
void ip_conf_file_del(char *if_name, char *conf_buff);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -51,13 +51,13 @@ void ip_save_file(ip_config_t *ip_conf, uint config_type)
|
|||
sprintf(mask_buff, "netmask %s\n", inet_ntoa(netmask));
|
||||
rpc_log_info("%s %s",addr_buff, mask_buff);
|
||||
|
||||
set_if_config(ip_conf->ifname, addr_name, addr_buff);
|
||||
set_if_config(ip_conf->ifname, mask_name, mask_buff);
|
||||
ip_conf_file_set(ip_conf->ifname, addr_name, addr_buff);
|
||||
ip_conf_file_set(ip_conf->ifname, mask_name, mask_buff);
|
||||
}
|
||||
else if(config_type == CM_CONFIG_DEL)
|
||||
{
|
||||
del_if_config(ip_conf->ifname, addr_name);
|
||||
del_if_config(ip_conf->ifname, mask_name);
|
||||
ip_conf_file_del(ip_conf->ifname, addr_name);
|
||||
ip_conf_file_del(ip_conf->ifname, mask_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,292 +9,82 @@
|
|||
#include "parsefile.h"
|
||||
#include "rpc.h"
|
||||
|
||||
#if 0
|
||||
/*
|
||||
*从配置文件中读取相应的值
|
||||
*输入参数:1,配置文件路径 2,匹配标记 3,输出存储空间
|
||||
*并且排除了空行,“=”前后无内容,无“=”的情况
|
||||
*/
|
||||
void read_config(char *conf_path,char *conf_name,char *config_buff)
|
||||
/* 缓存字符串保存到配置文件中 */
|
||||
int conf_file_write(char *conf_path, char *sum_buf)
|
||||
{
|
||||
char config_linebuf[256];
|
||||
char line_name[40];
|
||||
char exchange_buf[256];
|
||||
char *config_sign = "=";
|
||||
char *leave_line;
|
||||
FILE *f;
|
||||
f = fopen(conf_path,"r");
|
||||
if(f == NULL)
|
||||
{
|
||||
printf("OPEN CONFIG FALID/n");
|
||||
return 0;
|
||||
}
|
||||
fseek(f,0,SEEK_SET);
|
||||
while(fgets(config_linebuf,256,f) != NULL)
|
||||
{
|
||||
if(strlen(config_linebuf) < 3) //判断是否是空行
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (config_linebuf[strlen(config_linebuf)-1] == 10) //去除最后一位是/n的情况
|
||||
{
|
||||
|
||||
memset(exchange_buf,0,sizeof(exchange_buf));
|
||||
strncpy(exchange_buf,config_linebuf,strlen(config_linebuf)-1);
|
||||
memset(config_linebuf,0,sizeof(config_linebuf));
|
||||
strcpy(config_linebuf,exchange_buf);
|
||||
}
|
||||
memset(line_name,0,sizeof(line_name));
|
||||
leave_line = strstr(config_linebuf,config_sign);
|
||||
if(leave_line == NULL) //去除无"="的情况
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int leave_num = leave_line - config_linebuf;
|
||||
strncpy(line_name,config_linebuf,leave_num);
|
||||
if(strcmp(line_name,conf_name) ==0)
|
||||
{
|
||||
strncpy(config_buff,config_linebuf+(leave_num+1),strlen(config_linebuf)-leave_num-1);
|
||||
break;
|
||||
}
|
||||
if(fgetc(f)==EOF)
|
||||
{
|
||||
break;
|
||||
}
|
||||
fseek(f,-1,SEEK_CUR);
|
||||
memset(config_linebuf,0,sizeof(config_linebuf));
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
/*
|
||||
*添加修改文件(当配置文件中存在标记字段,则进行修改,若不存在则进行添加)
|
||||
*
|
||||
*输入参数:1,配置文件路径 2,匹配标记 3,替换或添加的内容
|
||||
*
|
||||
*/
|
||||
void add_set_config(char *conf_path,char *conf_name,char *config_buff)
|
||||
{
|
||||
|
||||
char config_linebuf[256];
|
||||
char line_name[40];
|
||||
char *config_sign = "=";
|
||||
char *leave_line;
|
||||
int alter_sign = 0;
|
||||
|
||||
FILE *f;
|
||||
f = fopen(conf_path,"r+");
|
||||
if(f == NULL)
|
||||
{
|
||||
printf("OPEN CONFIG FALID/n");
|
||||
return 0;
|
||||
}
|
||||
fseek(f,0,SEEK_END);
|
||||
long congig_lenth = ftell(f);
|
||||
int configbuf_lenth = strlen(config_buff);
|
||||
configbuf_lenth = configbuf_lenth + 5;
|
||||
char sum_buf[congig_lenth+configbuf_lenth];
|
||||
memset(sum_buf,0,sizeof(sum_buf));
|
||||
fseek(f,0,SEEK_SET);
|
||||
while(fgets(config_linebuf,256,f) != NULL)
|
||||
{
|
||||
if(strlen(config_linebuf) < 3) //判断是否是空行
|
||||
{
|
||||
strcat(sum_buf,config_linebuf);
|
||||
continue;
|
||||
}
|
||||
leave_line = NULL;
|
||||
leave_line = strstr(config_linebuf,config_sign);
|
||||
if(leave_line == NULL) //去除无"="的情况
|
||||
{
|
||||
strcat(sum_buf,config_linebuf);
|
||||
continue;
|
||||
}
|
||||
int leave_num = leave_line - config_linebuf;
|
||||
memset(line_name,0,sizeof(line_name));
|
||||
strncpy(line_name,config_linebuf,leave_num);
|
||||
if(strcmp(line_name,conf_name) ==0)
|
||||
{
|
||||
strcat(sum_buf,config_buff);
|
||||
strcat(sum_buf,"/n");
|
||||
alter_sign = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat(sum_buf,config_linebuf);
|
||||
}
|
||||
if(fgetc(f)==EOF)
|
||||
{
|
||||
break;
|
||||
}
|
||||
fseek(f,-1,SEEK_CUR);
|
||||
memset(config_linebuf,0,sizeof(config_linebuf));
|
||||
}
|
||||
if(alter_sign == 0)
|
||||
{
|
||||
strcat(sum_buf,config_buff);
|
||||
strcat(sum_buf,"/n");
|
||||
}
|
||||
printf("---sum_buf---->%s<----------/n",sum_buf);
|
||||
remove(conf_path);
|
||||
fclose(f);
|
||||
FILE *fp;
|
||||
fp = fopen(conf_path,"w+");
|
||||
if(fp == NULL)
|
||||
{
|
||||
printf("OPEN CONFIG FALID/n");
|
||||
return 2;
|
||||
}
|
||||
fseek(fp,0,SEEK_SET);
|
||||
fputs(sum_buf,fp);
|
||||
fclose(fp);
|
||||
}
|
||||
/*
|
||||
*删除配置文件内容
|
||||
*
|
||||
*输入参数:1,匹配标记
|
||||
*
|
||||
*/
|
||||
void del_if_config(char *conf_name)
|
||||
{
|
||||
char *conf_path = "/etc/network/interface";
|
||||
char config_linebuf[256];
|
||||
char line_name[40];
|
||||
char *config_sign = "=";
|
||||
char *leave_line;
|
||||
|
||||
FILE *f;
|
||||
f = fopen(conf_path,"r+");
|
||||
if(f == NULL)
|
||||
{
|
||||
printf("OPEN CONFIG FALID/n");
|
||||
return 0;
|
||||
}
|
||||
fseek(f,0,SEEK_END);
|
||||
long congig_lenth = ftell(f);
|
||||
char sum_buf[congig_lenth+2];
|
||||
memset(sum_buf,0,sizeof(sum_buf));
|
||||
fseek(f,0,SEEK_SET);
|
||||
while(fgets(config_linebuf,256,f) != NULL)
|
||||
{
|
||||
if(strlen(config_linebuf) < 3) //判断是否是空行
|
||||
{
|
||||
strcat(sum_buf,config_linebuf);
|
||||
continue;
|
||||
}
|
||||
leave_line = NULL;
|
||||
leave_line = strstr(config_linebuf,config_sign);
|
||||
if(leave_line == NULL) //去除无"="的情况
|
||||
{
|
||||
strcat(sum_buf,config_linebuf);
|
||||
continue;
|
||||
}
|
||||
int leave_num = leave_line - config_linebuf;
|
||||
memset(line_name,0,sizeof(line_name));
|
||||
strncpy(line_name,config_linebuf,leave_num);
|
||||
if(strcmp(line_name,conf_name) !=0)
|
||||
{
|
||||
strcat(sum_buf,config_linebuf);
|
||||
}
|
||||
|
||||
if(fgetc(f)==EOF)
|
||||
{
|
||||
break;
|
||||
}
|
||||
fseek(f,-1,SEEK_CUR);
|
||||
memset(config_linebuf,0,sizeof(config_linebuf));
|
||||
}
|
||||
printf("---sum_buf---->%s<----------/n",sum_buf);
|
||||
remove(conf_path);
|
||||
fclose(f);
|
||||
FILE *fp;
|
||||
fp = fopen(conf_path,"w+");
|
||||
if(fp == NULL)
|
||||
{
|
||||
printf("OPEN CONFIG FALID/n");
|
||||
return 2;
|
||||
}
|
||||
fseek(fp,0,SEEK_SET);
|
||||
fputs(sum_buf,fp);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
*添加修改文件(当配置文件中存在标记字段,则进行修改,若不存在则进行添加)
|
||||
*
|
||||
*输入参数:1,接口名 2,匹配标记 3,替换或添加的内容
|
||||
*
|
||||
*/
|
||||
|
||||
void set_if_config(char *if_name, char *conf_name, char *conf_buff)
|
||||
{
|
||||
char *conf_path = IFCONFIG_PATH;
|
||||
char config_linebuf[IF_BUFF_LEN];
|
||||
char static_name[IF_BUFF_LEN] = {0};
|
||||
char iface_str[IF_BUFF_LEN] = {0};
|
||||
char auto_str[IF_BUFF_LEN] = {0};
|
||||
char *auto_line = NULL;
|
||||
char *iface_line = NULL;
|
||||
char *config_line = NULL;
|
||||
boolean next_flag = FALSE;
|
||||
|
||||
FILE *f;
|
||||
f = fopen(conf_path,"r+");
|
||||
if(f == NULL)
|
||||
{
|
||||
rpc_log_error("OPEN CONFIG FALID\n");
|
||||
return;
|
||||
return RET_ERR;
|
||||
}
|
||||
fseek(fp,0,SEEK_SET);
|
||||
fputs(sum_buf,fp);
|
||||
fclose(fp);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
/* 设置指定配置块中的配置 */
|
||||
int conf_value_in_block_set(char *conf_path,
|
||||
char *start_str, char *end_str,
|
||||
char *conf_name, char *conf_buff)
|
||||
{
|
||||
char config_linebuf[IF_BUFF_LEN];
|
||||
int configbuf_lenth = strlen(conf_buff) + 5;
|
||||
long config_lenth = 0;
|
||||
boolean next_flag = FALSE;
|
||||
char *start_line = NULL;
|
||||
char *config_line = NULL;
|
||||
FILE *f;
|
||||
|
||||
f = fopen(conf_path,"r+");
|
||||
if(f == NULL)
|
||||
{
|
||||
rpc_log_error("OPEN CONFIG %s FALID\n", conf_path);
|
||||
return RET_ERR;
|
||||
}
|
||||
|
||||
fseek(f,0,SEEK_END);
|
||||
fseek(f, 0, SEEK_END);
|
||||
|
||||
config_lenth = ftell(f);
|
||||
|
||||
long config_lenth = ftell(f);
|
||||
int configbuf_lenth = strlen(conf_buff);
|
||||
configbuf_lenth = configbuf_lenth + 5;
|
||||
char sum_buf[config_lenth + configbuf_lenth];
|
||||
|
||||
memset(sum_buf,0,sizeof(sum_buf));
|
||||
fseek(f,0,SEEK_SET);
|
||||
memset(sum_buf, 0, sizeof(sum_buf));
|
||||
|
||||
sprintf(auto_str, "auto %s", if_name);
|
||||
sprintf(iface_str, "iface %s inet", if_name);
|
||||
sprintf(static_name, "iface %s inet static\n", if_name);
|
||||
|
||||
memset(config_linebuf,0,sizeof(config_linebuf));
|
||||
|
||||
while(fgets(config_linebuf,IF_BUFF_LEN,f) != NULL)
|
||||
fseek(f, 0, SEEK_SET);
|
||||
|
||||
memset(config_linebuf, 0, sizeof(config_linebuf));
|
||||
|
||||
while(fgets(config_linebuf, IF_BUFF_LEN, f) != NULL)
|
||||
{
|
||||
/* 该做的事情已经做完 */
|
||||
if(next_flag == TRUE)
|
||||
{
|
||||
strcat(sum_buf,config_linebuf);
|
||||
strcat(sum_buf, config_linebuf);
|
||||
goto next_while;
|
||||
}
|
||||
|
||||
/* 判断是否是空行 */
|
||||
if(strlen(config_linebuf) < 3)
|
||||
{
|
||||
strcat(sum_buf,config_linebuf);
|
||||
strcat(sum_buf, config_linebuf);
|
||||
goto next_while;
|
||||
}
|
||||
|
||||
/* 没有找到接口配置块,则继续循环 */
|
||||
if(auto_line == NULL)
|
||||
/* 没有找到配置块,则继续循环 */
|
||||
if(start_line == NULL)
|
||||
{
|
||||
auto_line = strstr(config_linebuf, auto_str);
|
||||
start_line = strstr(config_linebuf, start_str);
|
||||
strcat(sum_buf, config_linebuf);
|
||||
goto next_while;
|
||||
}
|
||||
|
||||
/* 已经是下一个接口了*/
|
||||
if(strstr(config_linebuf, "auto"))
|
||||
/* 配置块结束 */
|
||||
if(strstr(config_linebuf, end_str))
|
||||
{
|
||||
if(iface_line == NULL)
|
||||
{
|
||||
strcat(sum_buf, static_name);
|
||||
}
|
||||
if(config_line == NULL)
|
||||
{
|
||||
strcat(sum_buf, conf_buff);
|
||||
|
@ -305,22 +95,12 @@ void set_if_config(char *if_name, char *conf_name, char *conf_buff)
|
|||
|
||||
goto next_while;
|
||||
}
|
||||
|
||||
/* 找到接口IP配置方式 */
|
||||
if(iface_line == NULL)
|
||||
{
|
||||
iface_line = strstr(config_linebuf, iface_str);
|
||||
if(iface_line)
|
||||
{
|
||||
strcat(sum_buf, static_name);
|
||||
goto next_while;
|
||||
}
|
||||
}
|
||||
|
||||
/* 找到配置行 */
|
||||
if(config_line == NULL)
|
||||
{
|
||||
config_line = strstr(config_linebuf, conf_name);
|
||||
|
||||
/* 找到配置行 */
|
||||
if(config_line)
|
||||
{
|
||||
next_flag = TRUE;
|
||||
|
@ -341,112 +121,94 @@ next_while:
|
|||
|
||||
memset(config_linebuf, 0, sizeof(config_linebuf));
|
||||
}
|
||||
|
||||
|
||||
/* 整个配置块都没有,则新创建该配置块 */
|
||||
if( next_flag == FALSE )
|
||||
{
|
||||
if(auto_line == NULL)
|
||||
if(start_line == NULL)
|
||||
{
|
||||
strcat(sum_buf, auto_str);
|
||||
strcat(sum_buf, start_str);
|
||||
strcat(sum_buf, "\n");
|
||||
}
|
||||
|
||||
if(iface_line == NULL)
|
||||
{
|
||||
strcat(sum_buf, static_name);
|
||||
}
|
||||
|
||||
if(config_line == NULL)
|
||||
{
|
||||
strcat(sum_buf, conf_buff);
|
||||
}
|
||||
}
|
||||
|
||||
rpc_log_dbg("---sum_buf---->%s<----------\n",sum_buf);
|
||||
|
||||
remove(conf_path);
|
||||
fclose(f);
|
||||
|
||||
FILE *fp;
|
||||
fp = fopen(conf_path,"w+");
|
||||
if(fp == NULL)
|
||||
{
|
||||
rpc_log_error("OPEN CONFIG FALID\n");
|
||||
return;
|
||||
}
|
||||
fseek(fp,0,SEEK_SET);
|
||||
fputs(sum_buf,fp);
|
||||
fclose(fp);
|
||||
|
||||
return;
|
||||
rpc_log_dbg("---sum_buf---->%s<----------\n",sum_buf);
|
||||
|
||||
return conf_file_write(conf_path, sum_buf);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*删除配置文件内容
|
||||
*
|
||||
*输入参数:1,匹配标记
|
||||
*
|
||||
*/
|
||||
void del_if_config(char *if_name, char *conf_buff)
|
||||
/* 删除指定配置块中的配置 */
|
||||
int conf_value_in_block_del(char *conf_path, char *start_str,
|
||||
char *end_str, char *conf_buff)
|
||||
{
|
||||
char *conf_path = IFCONFIG_PATH;
|
||||
char config_linebuf[IF_BUFF_LEN];
|
||||
char auto_str[IF_BUFF_LEN] = {0};
|
||||
int configbuf_lenth = strlen(conf_buff) + 5;
|
||||
long congig_lenth = 0;
|
||||
|
||||
boolean next_flag = FALSE;
|
||||
char *auto_line = NULL;
|
||||
FILE *f;
|
||||
f = fopen(conf_path,"r+");
|
||||
char *start_line = NULL;
|
||||
FILE *f = fopen(conf_path, "r+");
|
||||
|
||||
if(f == NULL)
|
||||
{
|
||||
printf("OPEN CONFIG FALID\n");
|
||||
return;
|
||||
return RET_ERR;
|
||||
}
|
||||
|
||||
fseek(f,0,SEEK_END);
|
||||
fseek(f, 0, SEEK_END);
|
||||
|
||||
long congig_lenth = ftell(f);
|
||||
int configbuf_lenth = strlen(conf_buff);
|
||||
configbuf_lenth = configbuf_lenth + 5;
|
||||
char sum_buf[congig_lenth+configbuf_lenth];
|
||||
congig_lenth = ftell(f);
|
||||
|
||||
memset(sum_buf,0,sizeof(sum_buf));
|
||||
fseek(f,0,SEEK_SET);
|
||||
char sum_buf[congig_lenth + configbuf_lenth];
|
||||
|
||||
sprintf(auto_str, "auto %s", if_name);
|
||||
memset(sum_buf, 0, sizeof(sum_buf));
|
||||
|
||||
fseek(f, 0, SEEK_SET);
|
||||
|
||||
while(fgets(config_linebuf,IF_BUFF_LEN,f) != NULL)
|
||||
memset(config_linebuf, 0, sizeof(config_linebuf));
|
||||
|
||||
while(fgets(config_linebuf, IF_BUFF_LEN,f) != NULL)
|
||||
{
|
||||
/* 该做的事情已经做完 */
|
||||
if(next_flag == TRUE)
|
||||
{
|
||||
strcat(sum_buf,config_linebuf);
|
||||
strcat(sum_buf, config_linebuf);
|
||||
goto next_while;
|
||||
}
|
||||
|
||||
/* 判断是否是空行 */
|
||||
if(strlen(config_linebuf) < 3)
|
||||
{
|
||||
strcat(sum_buf,config_linebuf);
|
||||
strcat(sum_buf, config_linebuf);
|
||||
goto next_while;
|
||||
}
|
||||
|
||||
/* 没有找到接口配置块,则继续循环 */
|
||||
if(auto_line == NULL)
|
||||
if(start_line == NULL)
|
||||
{
|
||||
auto_line = strstr(config_linebuf, auto_str);
|
||||
strcat(sum_buf,config_linebuf);
|
||||
start_line = strstr(config_linebuf, start_str);
|
||||
strcat(sum_buf, config_linebuf);
|
||||
goto next_while;
|
||||
}
|
||||
|
||||
/* 已经是下一个接口了, 则表示无法找到*/
|
||||
if(strstr(config_linebuf, "auto"))
|
||||
if(strstr(config_linebuf, end_str))
|
||||
{
|
||||
strcat(sum_buf,config_linebuf);
|
||||
strcat(sum_buf, config_linebuf);
|
||||
next_flag = TRUE;
|
||||
goto next_while;
|
||||
}
|
||||
|
||||
/* 找到配置行 */
|
||||
if(strstr(config_linebuf,conf_buff))
|
||||
if(strstr(config_linebuf, conf_buff))
|
||||
{
|
||||
next_flag = TRUE;
|
||||
}
|
||||
|
@ -463,23 +225,57 @@ void del_if_config(char *if_name, char *conf_buff)
|
|||
}
|
||||
fseek(f,-1,SEEK_CUR);
|
||||
|
||||
memset(config_linebuf,0,sizeof(config_linebuf));
|
||||
memset(config_linebuf, 0, sizeof(config_linebuf));
|
||||
}
|
||||
|
||||
printf("---sum_buf---->%s<----------/n",sum_buf);
|
||||
remove(conf_path);
|
||||
fclose(f);
|
||||
|
||||
FILE *fp;
|
||||
fp = fopen(conf_path,"w+");
|
||||
if(fp == NULL)
|
||||
{
|
||||
printf("OPEN CONFIG FALID/n");
|
||||
return;
|
||||
}
|
||||
fseek(fp,0,SEEK_SET);
|
||||
fputs(sum_buf,fp);
|
||||
fclose(fp);
|
||||
rpc_log_dbg("---sum_buf---->%s<----------\n",sum_buf);
|
||||
|
||||
return conf_file_write(conf_path, sum_buf);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*添加修改文件(当配置文件中存在标记字段,则进行修改,若不存在则进行添加)
|
||||
*
|
||||
*输入参数:1,接口名 2,匹配标记 3,替换或添加的内容
|
||||
*
|
||||
*/
|
||||
|
||||
void ip_conf_file_set(char *if_name, char *conf_name, char *conf_buff)
|
||||
{
|
||||
char auto_str[IF_BUFF_LEN] = {0};
|
||||
char iface_str[IF_BUFF_LEN] = {0};
|
||||
char static_name[IF_BUFF_LEN] = {0};
|
||||
|
||||
sprintf(auto_str, "auto %s", if_name);
|
||||
sprintf(iface_str, "iface %s inet", if_name);
|
||||
sprintf(static_name, "iface %s inet static\n", if_name);
|
||||
|
||||
conf_value_in_block_set(IFCONFIG_PATH, auto_str, "auto", iface_str, static_name);
|
||||
conf_value_in_block_set(IFCONFIG_PATH, auto_str, "auto", conf_name, conf_buff);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*删除配置文件内容
|
||||
*
|
||||
*输入参数:1,匹配标记
|
||||
*
|
||||
*/
|
||||
void ip_conf_file_del(char *if_name, char *conf_buff)
|
||||
{
|
||||
char auto_str[IF_BUFF_LEN] = {0};
|
||||
|
||||
sprintf(auto_str, "auto %s", if_name);
|
||||
|
||||
conf_value_in_block_del(IFCONFIG_PATH, auto_str, "auto", conf_buff);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
#include "../../../../common/rpc/rpc.h"
|
||||
#include "../include/parsefile.h"
|
||||
#include "../include/configm.h"
|
||||
#include "../../../netlink_uapi/libnetlinku.h"
|
||||
#include "../include/jumppage.h"
|
||||
#include <cjson/cJSON.h>
|
||||
#include "../../../../../Common/s2j/s2j.h"
|
||||
#include "../../../../../Common/commuapinl.h"
|
||||
|
||||
/*全局变量,存放用户跳转的页面 */
|
||||
char *jumpurl;
|
||||
|
||||
/*初始化 */
|
||||
char *jumpurl = NULL;
|
||||
|
||||
/*系统管理模块将数据内容(URL地址)发送给web server */
|
||||
ret_code jumppage_config_proc(uint source, uint config_type,
|
||||
pointer input, int input_len,
|
||||
pointer output, int *output_len)
|
||||
{
|
||||
ret_code ret = RET_OK;
|
||||
char *struct_jumppage;
|
||||
struct_jumppage = (char *)input;
|
||||
|
||||
rpc_log_info("jumppage configure: url: %s\n",
|
||||
struct_jumppage);
|
||||
|
||||
|
||||
/*将配置信息发送到web server */
|
||||
|
||||
|
||||
/*把本地Portal server的配置信息存入全局变量 */
|
||||
jumpurl = struct_jumppage;
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ ret_code userlock_config_proc(uint source, uint config_type,
|
|||
userlock_configure_t *struct_userlock;
|
||||
struct_userlock = (userlock_configure_t *)input;
|
||||
|
||||
rpc_log_info("userlock configure: 登录时间: %d 用户认证失败次数: %d 用户认证的时间范围: %d 用户锁定时间: %d\n",
|
||||
rpc_log_info("userlock configure: 登录时间: %d 用户认证失败次数: %d 用户认证的时间范围: %d 用户锁定时间: %ld\n",
|
||||
struct_userlock->logintime, struct_userlock->failcount,
|
||||
struct_userlock->timehorizon, struct_userlock->locktime);
|
||||
|
||||
|
|
|
@ -40,9 +40,11 @@
|
|||
|
||||
## **编译方法**
|
||||
#### 1. 从仓库获取最新代码
|
||||
<code>git clone git@git.komect.net:ISG/secogateway.git</code>
|
||||
<code>git clone --recursive git@git.komect.net:ISG/secogateway.git
|
||||
git submodule update --init --recursive</code>
|
||||
或
|
||||
<code>git pull</code>
|
||||
<code>git submodule update --init --recursive
|
||||
git pull</code>
|
||||
|
||||
#### 2. 安装必要软件(UBuntu)
|
||||
<code>sudo ./fsl-qoriq-glibc-x86_64-fsl-toolchain-aarch64-toolchain-2.4.1.sh
|
||||
|
|
Loading…
Reference in New Issue