mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
tcpsocket: add option to add server ip
A new config option allows to add a server ip
option server_ip '10.0.0.2'
However, this server does not send anything back. Therefore it is not
possible to change the node configuration. This will probably be added
soon. The main goal of this commit is to allow monitoring of all nodes
in a network with DAWN, e.g. clients, channel utilization, ...
Also a network option (3) has been added which allows to use TCP but
not to announce your daemon in the broadcast domain. This allows you to
create a monitor-only node that holds only the local information and
forwards it to the central server.
A monitor-only node could be configured like
option server_ip '10.0.0.1'
option tcp_port '1026'
option network_option '3'
Another possible config is
option server_ip '10.0.0.1'
option tcp_port '1026'
option network_option '3'
Here, the node shares information with a central server, which can be
located outside the broadcast domain. Nevertheless, it also shares
information within its broadcast domain and can therefore perform
client steering.
This commit is contained in:
parent
1da5ad5a96
commit
25a493c438
4 changed files with 26 additions and 9 deletions
|
|
@ -45,7 +45,7 @@ struct uloop_timeout client_timer = {
|
|||
struct uloop_timeout hostapd_timer = {
|
||||
.cb = update_hostapd_sockets
|
||||
};
|
||||
struct uloop_timeout umdns_timer = {
|
||||
struct uloop_timeout tcp_con_timer = {
|
||||
.cb = update_tcp_connections
|
||||
};
|
||||
struct uloop_timeout channel_utilization_timer = {
|
||||
|
|
@ -529,7 +529,8 @@ int send_blob_attr_via_network(struct blob_attr* msg, char* method) {
|
|||
str = blobmsg_format_json(b_send_network.head, true);
|
||||
dawn_regmem(str);
|
||||
|
||||
if (network_config.network_option == 2) {
|
||||
if (network_config.network_option == 2
|
||||
|| network_config.network_option == 3) {
|
||||
send_tcp(str);
|
||||
} else {
|
||||
if (network_config.use_symm_enc) {
|
||||
|
|
@ -618,9 +619,10 @@ int dawn_init_ubus(const char *ubus_socket, const char *hostapd_dir) {
|
|||
|
||||
ubus_add_oject();
|
||||
|
||||
if (network_config.network_option == 2)
|
||||
if (network_config.network_option == 2
|
||||
|| network_config.network_option == 3)
|
||||
{
|
||||
start_umdns_update();
|
||||
start_tcp_con_update();
|
||||
if(run_server(network_config.tcp_port))
|
||||
uloop_timeout_set(&usock_timer, 1 * 1000);
|
||||
}
|
||||
|
|
@ -825,13 +827,21 @@ void update_beacon_reports(struct uloop_timeout *t) {
|
|||
}
|
||||
|
||||
void update_tcp_connections(struct uloop_timeout *t) {
|
||||
ubus_call_umdns();
|
||||
uloop_timeout_set(&umdns_timer, timeout_config.update_tcp_con * 1000);
|
||||
if (strcmp(network_config.server_ip, ""))
|
||||
{
|
||||
// nothing happens if tcp connection is already established
|
||||
add_tcp_conncection(network_config.server_ip, network_config.tcp_port);
|
||||
}
|
||||
if (network_config.network_option == 2) // mdns enabled?
|
||||
{
|
||||
ubus_call_umdns();
|
||||
}
|
||||
uloop_timeout_set(&tcp_con_timer, timeout_config.update_tcp_con * 1000);
|
||||
}
|
||||
|
||||
void start_umdns_update() {
|
||||
void start_tcp_con_update() {
|
||||
// update connections
|
||||
uloop_timeout_add(&umdns_timer); // callback = update_tcp_connections
|
||||
uloop_timeout_add(&tcp_con_timer); // callback = update_tcp_connections
|
||||
}
|
||||
|
||||
void update_hostapd_sockets(struct uloop_timeout *t) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue