mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
add function to main
This commit is contained in:
parent
1a2aa2c6e2
commit
2a9d876988
2 changed files with 5 additions and 2 deletions
|
@ -136,6 +136,8 @@ int main(int argc, char **argv) {
|
|||
|
||||
init_socket_runopts(opt_broadcast_ip, opt_broadcast_port, 1);
|
||||
|
||||
insert_macs_from_file();
|
||||
|
||||
dawn_init_ubus(ubus_socket, opt_hostapd_dir);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -610,7 +610,7 @@ void insert_macs_from_file()
|
|||
size_t len = 0;
|
||||
ssize_t read;
|
||||
|
||||
fp = fopen("/etc/config/dawn", "r");
|
||||
fp = fopen("/etc/dawn/mac_list", "r");
|
||||
if (fp == NULL)
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
|
@ -621,6 +621,7 @@ void insert_macs_from_file()
|
|||
int tmp_int_mac[ETH_ALEN];
|
||||
sscanf(line, MACSTR, STR2MAC(tmp_int_mac));
|
||||
|
||||
mac_list_entry_last++;
|
||||
for (int i = 0; i < ETH_ALEN; ++i) {
|
||||
mac_list[mac_list_entry_last][i] = (uint8_t) tmp_int_mac[i];
|
||||
}
|
||||
|
@ -630,7 +631,7 @@ void insert_macs_from_file()
|
|||
for(int i = 0; i <= mac_list_entry_last; i++)
|
||||
{
|
||||
char mac_buf_target[20];
|
||||
sprintf(mac_buf_target, MACSTR, MAC2STR(mac_list[0]));
|
||||
sprintf(mac_buf_target, MACSTR, MAC2STR(mac_list[i]));
|
||||
printf("%d: %s\n", i, mac_buf_target);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue