mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
Change config file
This commit is contained in:
parent
64aa9d6629
commit
63a1432652
11 changed files with 154 additions and 25 deletions
|
|
@ -1,6 +1,17 @@
|
|||
config 'settings' 'dawn'
|
||||
config settings network
|
||||
option broadcast_ip '10.0.0.255'
|
||||
option broadcast_port '1025'
|
||||
option sort_order 'csfb'
|
||||
|
||||
config settings ordering
|
||||
option sort_order 'csfb'
|
||||
|
||||
config settings hostapd
|
||||
option hostapd_dir '/var/run/hostapd'
|
||||
option background '0'
|
||||
|
||||
config settings metric
|
||||
option ht_support '10'
|
||||
option vht_support '10'
|
||||
option vht_support '10'
|
||||
option rssi '10'
|
||||
option freq '10'
|
||||
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@ start_service()
|
|||
local hostapd_dir
|
||||
|
||||
config_load "${NAME}"
|
||||
config_get broadcast_ip dawn broadcast_ip
|
||||
config_get broadcast_port dawn broadcast_port
|
||||
config_get sort_order dawn sort_order
|
||||
config_get hostapd_dir dawn hostapd_dir
|
||||
config_get broadcast_ip network broadcast_ip
|
||||
config_get broadcast_port network broadcast_port
|
||||
config_get sort_order ordering sort_order
|
||||
config_get hostapd_dir hostapd hostapd_dir
|
||||
|
||||
|
||||
procd_open_instance
|
||||
|
|
|
|||
BIN
files/main
Executable file
BIN
files/main
Executable file
Binary file not shown.
33
files/main.c
Normal file
33
files/main.c
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <libconfig.h>
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
config_t cfg;
|
||||
config_setting_t *root, *setting, *movie;
|
||||
|
||||
config_init(&cfg);
|
||||
|
||||
/* Read the file. If there is an error, report it and exit. */
|
||||
if(! config_read_file(&cfg, "dawn.config"))
|
||||
{
|
||||
fprintf(stderr, "%s:%d - %s\n", config_error_file(&cfg),
|
||||
config_error_line(&cfg), config_error_text(&cfg));
|
||||
config_destroy(&cfg);
|
||||
return(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
printf("READ CONFIG!!!\n");
|
||||
|
||||
root = config_root_setting(&cfg);
|
||||
|
||||
int ht_support;
|
||||
if (config_lookup_int(&cfg, "ht_support", &ht_support))
|
||||
printf("Broadcast Port: %d\n\n", ht_support);
|
||||
else
|
||||
fprintf(stderr, "No 'name' setting in configuration file.\n");
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue