diff options
Diffstat (limited to 'testing/DHT_test.c')
-rw-r--r-- | testing/DHT_test.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/testing/DHT_test.c b/testing/DHT_test.c index 5cdd1823..2f99902f 100644 --- a/testing/DHT_test.c +++ b/testing/DHT_test.c | |||
@@ -54,12 +54,12 @@ | |||
54 | 54 | ||
55 | uint8_t zeroes_cid[CLIENT_ID_SIZE]; | 55 | uint8_t zeroes_cid[CLIENT_ID_SIZE]; |
56 | 56 | ||
57 | void print_client_id(uint8_t *client_id) | 57 | void print_client_id(uint8_t *public_key) |
58 | { | 58 | { |
59 | uint32_t j; | 59 | uint32_t j; |
60 | 60 | ||
61 | for (j = 0; j < CLIENT_ID_SIZE; j++) { | 61 | for (j = 0; j < CLIENT_ID_SIZE; j++) { |
62 | printf("%02hhX", client_id[j]); | 62 | printf("%02hhX", public_key[j]); |
63 | } | 63 | } |
64 | } | 64 | } |
65 | 65 | ||
@@ -108,11 +108,11 @@ void print_clientlist(DHT *dht) | |||
108 | for (i = 0; i < LCLIENT_LIST; i++) { | 108 | for (i = 0; i < LCLIENT_LIST; i++) { |
109 | Client_data *client = &dht->close_clientlist[i]; | 109 | Client_data *client = &dht->close_clientlist[i]; |
110 | 110 | ||
111 | if (memcmp(client->client_id, zeroes_cid, CLIENT_ID_SIZE) == 0) | 111 | if (memcmp(client->public_key, zeroes_cid, CLIENT_ID_SIZE) == 0) |
112 | continue; | 112 | continue; |
113 | 113 | ||
114 | printf("ClientID: "); | 114 | printf("ClientID: "); |
115 | print_client_id(client->client_id); | 115 | print_client_id(client->public_key); |
116 | 116 | ||
117 | print_assoc(&client->assoc4, 1); | 117 | print_assoc(&client->assoc4, 1); |
118 | print_assoc(&client->assoc6, 1); | 118 | print_assoc(&client->assoc6, 1); |
@@ -129,9 +129,9 @@ void print_friendlist(DHT *dht) | |||
129 | printf("FRIEND %u\n", k); | 129 | printf("FRIEND %u\n", k); |
130 | printf("ID: "); | 130 | printf("ID: "); |
131 | 131 | ||
132 | print_client_id(dht->friends_list[k].client_id); | 132 | print_client_id(dht->friends_list[k].public_key); |
133 | 133 | ||
134 | int friendok = DHT_getfriendip(dht, dht->friends_list[k].client_id, &p_ip); | 134 | int friendok = DHT_getfriendip(dht, dht->friends_list[k].public_key, &p_ip); |
135 | printf("\nIP: %s:%u (%d)", ip_ntoa(&p_ip.ip), ntohs(p_ip.port), friendok); | 135 | printf("\nIP: %s:%u (%d)", ip_ntoa(&p_ip.ip), ntohs(p_ip.port), friendok); |
136 | 136 | ||
137 | printf("\nCLIENTS IN LIST:\n\n"); | 137 | printf("\nCLIENTS IN LIST:\n\n"); |
@@ -139,11 +139,11 @@ void print_friendlist(DHT *dht) | |||
139 | for (i = 0; i < MAX_FRIEND_CLIENTS; i++) { | 139 | for (i = 0; i < MAX_FRIEND_CLIENTS; i++) { |
140 | Client_data *client = &dht->friends_list[k].client_list[i]; | 140 | Client_data *client = &dht->friends_list[k].client_list[i]; |
141 | 141 | ||
142 | if (memcmp(client->client_id, zeroes_cid, CLIENT_ID_SIZE) == 0) | 142 | if (memcmp(client->public_key, zeroes_cid, CLIENT_ID_SIZE) == 0) |
143 | continue; | 143 | continue; |
144 | 144 | ||
145 | printf("ClientID: "); | 145 | printf("ClientID: "); |
146 | print_client_id(client->client_id); | 146 | print_client_id(client->public_key); |
147 | 147 | ||
148 | print_assoc(&client->assoc4, 0); | 148 | print_assoc(&client->assoc4, 0); |
149 | print_assoc(&client->assoc6, 0); | 149 | print_assoc(&client->assoc6, 0); |
@@ -199,7 +199,7 @@ int main(int argc, char *argv[]) | |||
199 | } | 199 | } |
200 | 200 | ||
201 | char temp_id[128]; | 201 | char temp_id[128]; |
202 | printf("\nEnter the client_id of the friend you wish to add (32 bytes HEX format):\n"); | 202 | printf("\nEnter the public_key of the friend you wish to add (32 bytes HEX format):\n"); |
203 | 203 | ||
204 | if (!fgets(temp_id, sizeof(temp_id), stdin)) | 204 | if (!fgets(temp_id, sizeof(temp_id), stdin)) |
205 | exit(0); | 205 | exit(0); |