parent
bced0a2bf4
commit
cd9ec8fb58
|
@ -1,14 +1,14 @@
|
|||
#include "dhcp_lib.h"
|
||||
|
||||
void dhcp_config_init(void)
|
||||
ret_code dhcp_config_init(void)
|
||||
{
|
||||
ret_code ret = RET_OK;
|
||||
ret = br_event_register(BR_DELETE_EVENT_PRE,del_interface_dhcp_cb);
|
||||
if(ret != RET_OK){
|
||||
printf("register failed.\n");
|
||||
return;
|
||||
return ret;
|
||||
}
|
||||
return;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int del_interface_dhcp_cb(BR_EVENT_TYPE event_type, br_event_t event_arg)
|
||||
|
@ -397,7 +397,8 @@ char *get_interface_ip(char *interface) {
|
|||
snprintf(cmd, 100, "ifconfig %s | grep \"inet\" | awk '{ print $2}' > /tmp/ip", interface);
|
||||
system(cmd);
|
||||
memset(cmd, 0, 101);
|
||||
free(cmd);
|
||||
free(cmd);
|
||||
|
||||
return getfilefirstline("/tmp/ip");
|
||||
}
|
||||
|
||||
|
@ -411,7 +412,8 @@ char *get_interface_mask(char *interface) {
|
|||
snprintf(cmd, 100, "ifconfig %s | grep \"netmask\" | awk '{ print $4}' > /tmp/mask", interface);
|
||||
system(cmd);
|
||||
memset(cmd, 0, 101);
|
||||
free(cmd);
|
||||
free(cmd);
|
||||
|
||||
return getfilefirstline("/tmp/mask");
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "dhcp_dhcpd_lease.h"
|
||||
|
||||
|
||||
void dhcp_config_init(void);
|
||||
ret_code dhcp_config_init(void);
|
||||
|
||||
int del_interface_dhcp_cb(BR_EVENT_TYPE event_type, br_event_t event_arg);
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ void vlan_config_format_json_stub(int *interface);
|
|||
void vlan_config_get_all_stub(uint source);
|
||||
void vlan_config_get_stub(void);
|
||||
void vlan_config_proc_test(operation_type op_type);
|
||||
void vlan_config_init(void);
|
||||
ret_code vlan_config_init(void);
|
||||
void vlan_config_stub1(void);
|
||||
|
||||
/* int */
|
||||
|
|
|
@ -203,7 +203,7 @@ interface_model which_interface_model(char *if_name)
|
|||
* 输出:
|
||||
* 返回值:
|
||||
************************************************************/
|
||||
void vlan_config_init(void)
|
||||
ret_code vlan_config_init(void)
|
||||
{
|
||||
ret_code ret = RET_OK;
|
||||
//int sys_ret = 0;
|
||||
|
@ -213,7 +213,7 @@ void vlan_config_init(void)
|
|||
ret = br_event_register(BR_IF_LEAVE_EVENT_PRE, del_interface_vlan_cb);
|
||||
if(ret != RET_OK){
|
||||
printf("[vlan]vlan_config_init: event register failed(%d).\n", ret);
|
||||
return;
|
||||
return ret;
|
||||
}
|
||||
#if 0
|
||||
/* 创建br0 */
|
||||
|
@ -242,7 +242,7 @@ void vlan_config_init(void)
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
|
|
Loading…
Reference in New Issue