Add aaa-12 修改VLAN静态检查
SOL 修改VLAN静态检查 修改人:yinbin 检视人:yinbin Signed-off-by: yinbin <yinbin@cmhi.chinamobile.com>
This commit is contained in:
parent
60b1037916
commit
282fbf9375
|
@ -92,7 +92,7 @@ int if_vlan2subif(char *if_name, int vid, char *subif)
|
|||
|
||||
int br_if_num_stub(char *br_name, operation_type op_type)
|
||||
{
|
||||
int ret;
|
||||
int ret = 0;
|
||||
if(op_type == OP_ADD){
|
||||
ret = 0;
|
||||
}
|
||||
|
@ -796,7 +796,6 @@ ret_code refresh_if_vlan_info_op_del(interface_vlan_info *if_vlan_info)
|
|||
{
|
||||
int ifnode;
|
||||
int vid = 0;
|
||||
int vcnt = 0;
|
||||
if(!if_vlan_info){
|
||||
return -1;
|
||||
}
|
||||
|
@ -1190,10 +1189,10 @@ ret_code interface_vlan_set(interface_vlan_info *if_vlan_info)
|
|||
{
|
||||
operation_type op_type;
|
||||
ret_code ret = RET_OK;
|
||||
op_type = if_vlan_info->op_type;
|
||||
if(!if_vlan_info){
|
||||
return RET_NULLP;
|
||||
}
|
||||
op_type = if_vlan_info->op_type;
|
||||
/* ADD只管现在 */
|
||||
if(op_type == OP_ADD){
|
||||
ret = add_interface_vlan(if_vlan_info);
|
||||
|
@ -1609,7 +1608,6 @@ ret_code vlan_config_get(uint source,
|
|||
pointer output, int *output_len)
|
||||
{
|
||||
//interface_vlan_info if_vlan_info[MAX_INTERFACES] = {0};
|
||||
int if_vlnum = 0;
|
||||
ret_code ret = RET_OK;
|
||||
int interface[MAX_INTERFACES] = {0};
|
||||
if(!input){
|
||||
|
@ -1646,18 +1644,8 @@ ret_code vlan_config_get(uint source,
|
|||
************************************************************/
|
||||
ret_code vlan_get_from_conf_file(int *interface)
|
||||
{
|
||||
if(!interface){
|
||||
printf("[vlan]vlan_get_from_conf_file: para is null.\n");
|
||||
return RET_NULLP;
|
||||
}
|
||||
FILE *fp = NULL;
|
||||
char line[FILE_BUF_LINE] = {0};
|
||||
if(!(fp = fopen(ETC_NETWORK_IFS, "r"))){
|
||||
printf("[vlan]vlan_get_from_conf_file: file open failed.\n");
|
||||
return RET_SYS_FILEOP_ERR;
|
||||
}
|
||||
//fseek(fp,0,SEEK_END);
|
||||
//rewind(fp);
|
||||
int vid;
|
||||
int node_num = 0;
|
||||
char *pauto = NULL;//"auto"指针位置
|
||||
|
@ -1665,6 +1653,17 @@ ret_code vlan_get_from_conf_file(int *interface)
|
|||
char *ifname = NULL;//"ens38"指针位置
|
||||
char tmp_name[IF_NAME_LEN] = {0};//
|
||||
int i;
|
||||
if(!interface){
|
||||
printf("[vlan]vlan_get_from_conf_file: para is null.\n");
|
||||
return RET_NULLP;
|
||||
}
|
||||
if(!(fp = fopen(ETC_NETWORK_IFS, "r"))){
|
||||
printf("[vlan]vlan_get_from_conf_file: file open failed.\n");
|
||||
return RET_SYS_FILEOP_ERR;
|
||||
}
|
||||
//fseek(fp,0,SEEK_END);
|
||||
//rewind(fp);
|
||||
|
||||
while(fgets(line, FILE_BUF_LINE, fp)){
|
||||
|
||||
/* 找到"auto" */
|
||||
|
@ -1962,7 +1961,6 @@ out:
|
|||
************************************************************/
|
||||
ret_code op_type_chk(interface_vlan_info *if_vlan_info)
|
||||
{
|
||||
int ifnode, vid, i;
|
||||
ret_code ret = RET_OK;
|
||||
if(!if_vlan_info){
|
||||
printf("[vlan]op_type_chk: input is null.\n");
|
||||
|
@ -2141,7 +2139,6 @@ out:
|
|||
ret_code vlan_config_get_chk(uint source, pointer input)
|
||||
{
|
||||
int ret = RET_OK;
|
||||
int i;
|
||||
int interface[MAX_INTERFACES] = {0};
|
||||
if(!input){
|
||||
printf("[vlan]vlan_config_get_chk: input null.\n");
|
||||
|
@ -2293,10 +2290,10 @@ void vlan_config_stub1(void)
|
|||
}
|
||||
|
||||
/* DEL */
|
||||
//vlan_set_struct_stub(if_vlan_info_del, OP_DEL, &if_vlnum);
|
||||
//for(i = 0; i < if_vlnum; i++){
|
||||
//interface_vlan_set(&if_vlan_info_del[i]);
|
||||
//}
|
||||
vlan_set_struct_stub(if_vlan_info_del, OP_DEL, &if_vlnum);
|
||||
for(i = 0; i < if_vlnum; i++){
|
||||
interface_vlan_set(&if_vlan_info_del[i]);
|
||||
}
|
||||
|
||||
/* MOD */
|
||||
vlan_set_struct_stub(if_vlan_info_add, OP_MOD, &if_vlnum);
|
||||
|
@ -2321,7 +2318,7 @@ void vlan_config_stub(operation_type op_type)
|
|||
|
||||
void vlan_config_format_json_stub(int *interface)
|
||||
{
|
||||
int i, j, vid;
|
||||
int i, vid;
|
||||
for(i = 0; i < MAX_INTERFACES; i++){
|
||||
if(!(interface[i])){
|
||||
continue;
|
||||
|
@ -2341,7 +2338,6 @@ void vlan_config_format_json_stub(int *interface)
|
|||
|
||||
void vlan_config_get_stub(void)
|
||||
{
|
||||
int if_vlnum;
|
||||
int interface[MAX_INTERFACES] = {0};
|
||||
interface[1] = 1;
|
||||
printf("[vlan]vlan_config_get_stub:start.\n");
|
||||
|
@ -2354,7 +2350,7 @@ void vlan_config_get_stub(void)
|
|||
void vlan_config_get_all_stub(uint source)
|
||||
{
|
||||
int interface[MAX_INTERFACES] = {0};
|
||||
int i;
|
||||
int i = 0;
|
||||
|
||||
/* WEB下发,g_if_vlan_info对应的node是有数据的
|
||||
只需将有数据的节点node返回到interface里即可*/
|
||||
|
|
Loading…
Reference in New Issue