comparison libfdcore/config.c @ 1396:188c82b6690b

Add ProcessingPeersPattern and ProcessingPeersMinimum parameters. If this is configured, the process will accept all connections from peers matching ProcessingPeersPattern, but will NOT accept connections from other peers until ProcessingPeersMinimum peers of the first type are connected. This allows relays to only go online if there are enough worker peers connected behind them.
author Thomas Klausner <tk@giga.or.at>
date Fri, 15 Nov 2019 11:38:30 +0100
parents afe0ecdb0692
children 239ba25870d8
comparison
equal deleted inserted replaced
1395:603a72c4bf6c 1396:188c82b6690b
57 57
58 fd_g_config->cnf_port = DIAMETER_PORT; 58 fd_g_config->cnf_port = DIAMETER_PORT;
59 fd_g_config->cnf_port_tls = DIAMETER_SECURE_PORT; 59 fd_g_config->cnf_port_tls = DIAMETER_SECURE_PORT;
60 fd_g_config->cnf_sctp_str = 30; 60 fd_g_config->cnf_sctp_str = 30;
61 fd_g_config->cnf_thr_srv = 5; 61 fd_g_config->cnf_thr_srv = 5;
62 fd_g_config->cnf_processing_peers_minimum = 0;
62 fd_g_config->cnf_dispthr = 4; 63 fd_g_config->cnf_dispthr = 4;
63 fd_list_init(&fd_g_config->cnf_endpoints, NULL); 64 fd_list_init(&fd_g_config->cnf_endpoints, NULL);
64 fd_list_init(&fd_g_config->cnf_apps, NULL); 65 fd_list_init(&fd_g_config->cnf_apps, NULL);
65 #ifdef DISABLE_SCTP 66 #ifdef DISABLE_SCTP
66 fd_g_config->cnf_flags.no_sctp = 1; 67 fd_g_config->cnf_flags.no_sctp = 1;
99 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Local SCTP TLS port .... : %hu\n", fd_g_config->cnf_port_3436), return NULL); 100 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Local SCTP TLS port .... : %hu\n", fd_g_config->cnf_port_3436), return NULL);
100 } 101 }
101 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Number of SCTP streams . : %hu\n", fd_g_config->cnf_sctp_str), return NULL); 102 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Number of SCTP streams . : %hu\n", fd_g_config->cnf_sctp_str), return NULL);
102 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Number of clients thr .. : %d\n", fd_g_config->cnf_thr_srv), return NULL); 103 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Number of clients thr .. : %d\n", fd_g_config->cnf_thr_srv), return NULL);
103 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Number of app threads .. : %hu\n", fd_g_config->cnf_dispthr), return NULL); 104 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Number of app threads .. : %hu\n", fd_g_config->cnf_dispthr), return NULL);
105 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Minimal processing peers : %hu\n", fd_g_config->cnf_processing_peers_minimum), return NULL);
104 if (FD_IS_LIST_EMPTY(&fd_g_config->cnf_endpoints)) { 106 if (FD_IS_LIST_EMPTY(&fd_g_config->cnf_endpoints)) {
105 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Local endpoints ........ : Default (use all available)\n"), return NULL); 107 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Local endpoints ........ : Default (use all available)\n"), return NULL);
106 } else { 108 } else {
107 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Local endpoints ........ : "), return NULL); 109 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Local endpoints ........ : "), return NULL);
108 CHECK_MALLOC_DO( fd_ep_dump( FD_DUMP_STD_PARAMS, 0, 0, &fd_g_config->cnf_endpoints ), return NULL); 110 CHECK_MALLOC_DO( fd_ep_dump( FD_DUMP_STD_PARAMS, 0, 0, &fd_g_config->cnf_endpoints ), return NULL);
"Welcome to our mercurial repository"