diff options
author | irungentoo <irungentoo@gmail.com> | 2013-08-30 07:53:51 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-08-30 07:53:51 -0400 |
commit | 7441a234b7f6dae025819bc2717026d6462e151a (patch) | |
tree | 3b5f42b61e14b6f54687adaf182248337dc93638 /testing/DHT_test.c | |
parent | b37a016b6be8d6c43c368bb566c2c23962a6e571 (diff) | |
parent | eb33796e58cfca4fa26b459ad5a9d013f1df4c42 (diff) |
Merge branch 'udp_connections' of https://github.com/vx-k/ProjectTox-Core into vx-k-udp_connections
Diffstat (limited to 'testing/DHT_test.c')
-rw-r--r-- | testing/DHT_test.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/testing/DHT_test.c b/testing/DHT_test.c index cfb3ec73..c4f1e368 100644 --- a/testing/DHT_test.c +++ b/testing/DHT_test.c | |||
@@ -30,7 +30,7 @@ | |||
30 | //#include "../core/network.h" | 30 | //#include "../core/network.h" |
31 | #include "../toxcore/DHT.h" | 31 | #include "../toxcore/DHT.h" |
32 | #include "../toxcore/friend_requests.h" | 32 | #include "../toxcore/friend_requests.h" |
33 | #include "misc_tools.h" | 33 | #include "../toxcore/misc_tools.h" |
34 | 34 | ||
35 | #include <string.h> | 35 | #include <string.h> |
36 | 36 | ||
@@ -62,11 +62,13 @@ void print_clientlist(DHT *dht) | |||
62 | } | 62 | } |
63 | 63 | ||
64 | p_ip = dht->close_clientlist[i].ip_port; | 64 | p_ip = dht->close_clientlist[i].ip_port; |
65 | printf("\nIP: %u.%u.%u.%u Port: %u", p_ip.ip.uint8[0], p_ip.ip.uint8[1], p_ip.ip.uint8[2], p_ip.ip.uint8[3], ntohs(p_ip.port)); | 65 | printf("\nIP: %u.%u.%u.%u Port: %u", p_ip.ip.uint8[0], p_ip.ip.uint8[1], p_ip.ip.uint8[2], p_ip.ip.uint8[3], |
66 | ntohs(p_ip.port)); | ||
66 | printf("\nTimestamp: %llu", (long long unsigned int) dht->close_clientlist[i].timestamp); | 67 | printf("\nTimestamp: %llu", (long long unsigned int) dht->close_clientlist[i].timestamp); |
67 | printf("\nLast pinged: %llu\n", (long long unsigned int) dht->close_clientlist[i].last_pinged); | 68 | printf("\nLast pinged: %llu\n", (long long unsigned int) dht->close_clientlist[i].last_pinged); |
68 | p_ip = dht->close_clientlist[i].ret_ip_port; | 69 | p_ip = dht->close_clientlist[i].ret_ip_port; |
69 | printf("OUR IP: %u.%u.%u.%u Port: %u\n", p_ip.ip.uint8[0], p_ip.ip.uint8[1], p_ip.ip.uint8[2], p_ip.ip.uint8[3], ntohs(p_ip.port)); | 70 | printf("OUR IP: %u.%u.%u.%u Port: %u\n", p_ip.ip.uint8[0], p_ip.ip.uint8[1], p_ip.ip.uint8[2], p_ip.ip.uint8[3], |
71 | ntohs(p_ip.port)); | ||
70 | printf("Timestamp: %llu\n", (long long unsigned int) dht->close_clientlist[i].ret_timestamp); | 72 | printf("Timestamp: %llu\n", (long long unsigned int) dht->close_clientlist[i].ret_timestamp); |
71 | } | 73 | } |
72 | } | 74 | } |
@@ -86,7 +88,8 @@ void print_friendlist(DHT *dht) | |||
86 | } | 88 | } |
87 | 89 | ||
88 | p_ip = DHT_getfriendip(dht, dht->friends_list[k].client_id); | 90 | p_ip = DHT_getfriendip(dht, dht->friends_list[k].client_id); |
89 | printf("\nIP: %u.%u.%u.%u:%u", p_ip.ip.uint8[0], p_ip.ip.uint8[1], p_ip.ip.uint8[2], p_ip.ip.uint8[3], ntohs(p_ip.port)); | 91 | printf("\nIP: %u.%u.%u.%u:%u", p_ip.ip.uint8[0], p_ip.ip.uint8[1], p_ip.ip.uint8[2], p_ip.ip.uint8[3], |
92 | ntohs(p_ip.port)); | ||
90 | 93 | ||
91 | printf("\nCLIENTS IN LIST:\n\n"); | 94 | printf("\nCLIENTS IN LIST:\n\n"); |
92 | 95 | ||
@@ -101,11 +104,13 @@ void print_friendlist(DHT *dht) | |||
101 | } | 104 | } |
102 | 105 | ||
103 | p_ip = dht->friends_list[k].client_list[i].ip_port; | 106 | p_ip = dht->friends_list[k].client_list[i].ip_port; |
104 | printf("\nIP: %u.%u.%u.%u:%u", p_ip.ip.uint8[0], p_ip.ip.uint8[1], p_ip.ip.uint8[2], p_ip.ip.uint8[3], ntohs(p_ip.port)); | 107 | printf("\nIP: %u.%u.%u.%u:%u", p_ip.ip.uint8[0], p_ip.ip.uint8[1], p_ip.ip.uint8[2], p_ip.ip.uint8[3], |
108 | ntohs(p_ip.port)); | ||
105 | printf("\nTimestamp: %llu", (long long unsigned int) dht->friends_list[k].client_list[i].timestamp); | 109 | printf("\nTimestamp: %llu", (long long unsigned int) dht->friends_list[k].client_list[i].timestamp); |
106 | printf("\nLast pinged: %llu\n", (long long unsigned int) dht->friends_list[k].client_list[i].last_pinged); | 110 | printf("\nLast pinged: %llu\n", (long long unsigned int) dht->friends_list[k].client_list[i].last_pinged); |
107 | p_ip = dht->friends_list[k].client_list[i].ret_ip_port; | 111 | p_ip = dht->friends_list[k].client_list[i].ret_ip_port; |
108 | printf("ret IP: %u.%u.%u.%u:%u\n", p_ip.ip.uint8[0], p_ip.ip.uint8[1], p_ip.ip.uint8[2], p_ip.ip.uint8[3], ntohs(p_ip.port)); | 112 | printf("ret IP: %u.%u.%u.%u:%u\n", p_ip.ip.uint8[0], p_ip.ip.uint8[1], p_ip.ip.uint8[2], p_ip.ip.uint8[3], |
113 | ntohs(p_ip.port)); | ||
109 | printf("Timestamp: %llu\n", (long long unsigned int)dht->friends_list[k].client_list[i].ret_timestamp); | 114 | printf("Timestamp: %llu\n", (long long unsigned int)dht->friends_list[k].client_list[i].ret_timestamp); |
110 | } | 115 | } |
111 | } | 116 | } |