added option to print peer list

This commit is contained in:
n07070 2020-05-06 13:45:16 +02:00
parent 29de8fd0b3
commit 78d526da16
2 changed files with 5 additions and 1 deletions

View File

@ -4,7 +4,7 @@
#include "node.h" #include "node.h"
#define DEBUG_LEVEL 0 #define DEBUG_LEVEL 6
void welcome(); void welcome();

View File

@ -1440,6 +1440,8 @@ int run_node(int sock_fd){
if (strcmp("",input_buffer) == 0){ if (strcmp("",input_buffer) == 0){
print_info(">> Printing all messages we know of so far :"); print_info(">> Printing all messages we know of so far :");
print_data_info(data_list); print_data_info(data_list);
} else if (strcmp("p",input_buffer) == 0) {
print_peers(neighbour_list);
} else { } else {
if (DEBUG_LEVEL > 0) { if (DEBUG_LEVEL > 0) {
printf("\x1b[31m[DEBUG]\x1b[0m >> Adding following message to the table : “%s”\n", input_buffer ); printf("\x1b[31m[DEBUG]\x1b[0m >> Adding following message to the table : “%s”\n", input_buffer );
@ -1602,6 +1604,8 @@ int bootstrap_node(int * sock_fd, char * root_peer_ip, uint16_t root_peer_port){
our_data->seqno = 1337; our_data->seqno = 1337;
our_data->data = NULL; our_data->data = NULL;
freeaddrinfo(res); freeaddrinfo(res);
print_debug(">> Boostraping done."); print_debug(">> Boostraping done.");
return 0; return 0;