From 353a82c017d1e32a026e10ebc586fee22d76cc2f Mon Sep 17 00:00:00 2001 From: Logan007 Date: Tue, 14 Apr 2020 19:54:43 +0200 Subject: [PATCH] added list of currently managed communities to supernode's management port output --- sn.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sn.c b/sn.c index 43e8841..c4a5466 100644 --- a/sn.c +++ b/sn.c @@ -378,6 +378,16 @@ static int process_mgmt(n2n_sn_t * sss, "last reg %lu sec ago\n", (long unsigned int) (now - sss->stats.last_reg_super)); + ressize += snprintf(resbuf+ressize, N2N_SN_PKTBUF_SIZE-ressize, + "cur_cmnts"); + HASH_ITER(hh, sss->communities, community, tmp) { + ressize += snprintf(resbuf+ressize, N2N_SN_PKTBUF_SIZE-ressize, + " [%s]", + community->community); + } + ressize += snprintf(resbuf+ressize, N2N_SN_PKTBUF_SIZE-ressize, + "\n"); + r = sendto(sss->mgmt_sock, resbuf, ressize, 0/*flags*/, (struct sockaddr *)sender_sock, sizeof(struct sockaddr_in));