mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
add debug output
This commit is contained in:
parent
42194e44c0
commit
acf109d337
3 changed files with 19 additions and 0 deletions
|
@ -117,6 +117,8 @@ ap ap_array_get_ap(uint8_t bssid_addr[]);
|
|||
struct client_s client_array[ARRAY_CLIENT_LEN];
|
||||
pthread_mutex_t client_array_mutex;
|
||||
|
||||
void print_tcp_array();
|
||||
|
||||
int mac_is_equal(uint8_t addr1[], uint8_t addr2[]);
|
||||
|
||||
int mac_is_greater(uint8_t addr1[], uint8_t addr2[]);
|
||||
|
|
|
@ -36,6 +36,8 @@ int tcp_array_contains_address_help(struct sockaddr_in entry);
|
|||
|
||||
int tcp_array_insert(struct network_con_s entry);
|
||||
|
||||
void print_tcp_entry(struct network_con_s entry);
|
||||
|
||||
int probe_entry_last = -1;
|
||||
int client_entry_last = -1;
|
||||
int ap_entry_last = -1;
|
||||
|
@ -907,6 +909,20 @@ int insert_to_tcp_array(struct network_con_s entry) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
void print_tcp_entry(struct network_con_s entry)
|
||||
{
|
||||
printf("Conenctin to Port: %d\n", entry.sock_addr.sin_port);
|
||||
}
|
||||
|
||||
void print_tcp_array()
|
||||
{
|
||||
printf("--------Connections------\n");
|
||||
for (int i = 0; i <= tcp_entry_last; i++) {
|
||||
print_tcp_entry(network_array[i]);
|
||||
}
|
||||
printf("------------------\n");
|
||||
}
|
||||
|
||||
int tcp_array_insert(struct network_con_s entry) {
|
||||
if (tcp_entry_last == -1) {
|
||||
network_array[0] = entry;
|
||||
|
|
|
@ -673,6 +673,7 @@ static void ubus_umdns_cb(struct ubus_request *req, int type, struct blob_attr *
|
|||
|
||||
char *str = blobmsg_format_json(msg, true);
|
||||
printf("UMDNS:\n%s", str);
|
||||
print_tcp_array();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue