Added the ability to specify (-c) on the supernode the list of allowed communities

kill -HUP on the supernode lists the registered edges
This commit is contained in:
Luca Deri 2018-09-28 22:31:45 +02:00
parent cb9e758d58
commit fd356cde64
6 changed files with 1561 additions and 414 deletions

5
community.list Normal file
View File

@ -0,0 +1,5 @@
#
# List of allowed communities
#
mynetwork
netleo

View File

@ -921,7 +921,7 @@ static void readFromMgmtSocket(n2n_edge_t * eee, int * keep_running) {
(unsigned int)peer_list_size(eee->known_peers));
msg_len += snprintf((char *)(udp_buf+msg_len), (N2N_PKT_BUF_SIZE-msg_len),
"last super:%lu(%ld sec ago) p2p:%lu(%lD sec ago)\n",
"last super:%lu(%ld sec ago) p2p:%lu(%ld sec ago)\n",
eee->last_sup, (now-eee->last_sup), eee->last_p2p,
(now-eee->last_p2p));

2
n2n.h
View File

@ -111,6 +111,8 @@ typedef struct ether_hdr ether_hdr_t;
#include <stdarg.h>
#include "uthash.h"
#ifdef WIN32
#include "win32/wintap.h"
#endif /* #ifdef WIN32 */

View File

@ -9,3 +9,6 @@
#
# -l=7777
#
# Specify in supernodes.list the list of allowed communities
#
# -c=supernodes.list

885
sn.c

File diff suppressed because it is too large Load Diff

1074
uthash.h Normal file

File diff suppressed because it is too large Load Diff