mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
try stuff
This commit is contained in:
parent
ef341ef032
commit
8744d429a6
1 changed files with 9 additions and 44 deletions
|
@ -745,6 +745,9 @@ static int add_subscriber(char *name) {
|
||||||
|
|
||||||
char subscribe_name[300];
|
char subscribe_name[300];
|
||||||
int ret;
|
int ret;
|
||||||
|
struct hostapd_sock_entry *hostapd_entry:
|
||||||
|
|
||||||
|
|
||||||
sprintf(subscribe_name, "hostapd.%s", name);
|
sprintf(subscribe_name, "hostapd.%s", name);
|
||||||
|
|
||||||
uint32_t id = 0;
|
uint32_t id = 0;
|
||||||
|
@ -754,51 +757,13 @@ static int add_subscriber(char *name) {
|
||||||
fprintf(stderr, "Failed to look up test object for %s\n", subscribe_name);
|
fprintf(stderr, "Failed to look up test object for %s\n", subscribe_name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hostapd_array_check_id(id)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// add callbacks
|
// add callbacks
|
||||||
|
hostapd_entry = malloc(sizeof(struct hostapd_sock_entry));
|
||||||
|
hostapd_entry->subscriber.remove_cb = hostapd_handle_remove;
|
||||||
//struct hostapd_sock_entry *hostapd_entry = malloc(sizeof(struct hostapd_sock_entry));
|
hostapd_entry->subscriber.cb = hostapd_notify;
|
||||||
|
ret = ubus_register_subscriber( ctx_clients, &hostapd_entry->subscriber );
|
||||||
//struct ubus_subscriber *hostapd_event = malloc(sizeof(struct ubus_subscriber));
|
fprintf(stderr, "Watching object %08x: %s\n", id, ubus_strerror(ret));
|
||||||
//struct ubus_subscriber hostapd_event;
|
ret = ubus_subscribe( ctx_clients, &hostapd_entry->subscriber, id)
|
||||||
//hostapd_entry->subscriber.remove_cb = hostapd_handle_remove;
|
|
||||||
//hostapd_entry->subscriber.cb = hostapd_notify;
|
|
||||||
|
|
||||||
hostapd_event.remove_cb = hostapd_handle_remove;
|
|
||||||
hostapd_event.cb = hostapd_notify;
|
|
||||||
|
|
||||||
|
|
||||||
//hostapd_entry->subscriber = hostapd_event;
|
|
||||||
//strcpy(hostapd_entry->iface_name, name);
|
|
||||||
//printf("COPY BSSID!\n");
|
|
||||||
//get_bssid(name,hostapd_entry->bssid_addr);
|
|
||||||
|
|
||||||
//char mac_buf_bssid[20];
|
|
||||||
//sprintf(mac_buf_bssid, MACSTR, MAC2STR(hostapd_entry->bssid_addr));
|
|
||||||
|
|
||||||
//printf("COPYED BSSID: %s\n", mac_buf_bssid);
|
|
||||||
//printf("COPY SSID!\n");
|
|
||||||
//get_ssid(name, hostapd_entry->ssid);
|
|
||||||
// printf("COPYED SSID: %s\n", hostapd_entry->ssid);
|
|
||||||
|
|
||||||
//hostapd_array_insert(hostapd_entry);
|
|
||||||
//printf("INSERTED HOSTAPDDD!\n");
|
|
||||||
|
|
||||||
//printf("Bla %p\n", &hostapd_entry->subscriber);
|
|
||||||
|
|
||||||
printf("USING OTHER SUBSCRIBER!\n");
|
|
||||||
ret = ubus_register_subscriber(ctx_clients, &hostapd_event);
|
|
||||||
if (ret) {
|
|
||||||
fprintf(stderr, "Failed to add watch handler: %s\n", ubus_strerror(ret));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
printf("TRY TO SUBSCRIBE!!!\n");
|
|
||||||
ret = ubus_subscribe(ctx_clients, &hostapd_event, id);
|
|
||||||
|
|
||||||
fprintf(stderr, "Watching object %08x: %s\n", id, ubus_strerror(ret));
|
fprintf(stderr, "Watching object %08x: %s\n", id, ubus_strerror(ret));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue