Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated types to bool in _turn_params_ to reflect C11 #1406

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 38 additions & 38 deletions src/apps/relay/mainrelay.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,32 +98,32 @@ turn_params_t turn_params = {
"", /*tls_password*/
"", /*dh_file*/

0, /*no_tlsv1*/
0, /*no_tlsv1_1*/
0, /*no_tlsv1_2*/
/*no_tls*/
false, /*no_tlsv1*/
false, /*no_tlsv1_1*/
false, /*no_tlsv1_2*/
/*no_tls*/
#if !TLS_SUPPORTED
1,
true,
#else
0,
false,
#endif
/*no_dtls*/
#if !DTLS_SUPPORTED
1,
true,
#else
0,
false,
#endif

NULL, /*tls_ctx_update_ev*/
{0, NULL}, /*tls_mutex*/

//////////////// Common params ////////////////////
TURN_VERBOSE_NONE, /* verbose */
0, /* turn_daemon */
0, /* no_software_attribute */
0, /* web_admin_listen_on_workers */
false, /* turn_daemon */
false, /* no_software_attribute */
false, /* web_admin_listen_on_workers */

0, /* do_not_use_config_file */
false, /* do_not_use_config_file */

"/var/run/turnserver.pid", /* pidfile */
"", /* acme_redirect */
Expand All @@ -135,19 +135,19 @@ turn_params_t turn_params = {
0, /* alt_listener_port */
0, /* alt_tls_listener_port */
0, /* tcp_proxy_port */
1, /* rfc5780 */
true, /* rfc5780 */

0, /* no_udp */
0, /* no_tcp */
0, /* tcp_use_proxy */
false, /* no_udp */
false, /* no_tcp */
false, /* tcp_use_proxy */

0, /* no_tcp_relay */
0, /* no_udp_relay */
false, /* no_tcp_relay */
false, /* no_udp_relay */

"", /*listener_ifname*/

{"", ""}, /*redis_statsdb*/
0, /*use_redis_statsdb*/
false, /*use_redis_statsdb*/
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL}, /*listener*/
{NULL, 0}, /*ip_whitelist*/
{NULL, 0}, /*ip_blacklist*/
Expand All @@ -159,10 +159,10 @@ turn_params_t turn_params = {
LOW_DEFAULT_PORTS_BOUNDARY, /*min_port*/
HIGH_DEFAULT_PORTS_BOUNDARY, /*max_port*/

0, /*check_origin*/
false, /*check_origin*/

0, /*no_multicast_peers*/
0, /*allow_loopback_peers*/
false, /*no_multicast_peers*/
false, /*allow_loopback_peers*/

"", /*relay_ifname*/
0, /*relays_number*/
Expand All @@ -187,30 +187,30 @@ turn_params_t turn_params = {
{NULL, 0, {0, NULL}}, /*tls_alternate_servers_list*/

/////////////// stop server ////////////////
0, /*stop_turn_server*/
false, /*stop_turn_server*/

/////////////// MISC PARAMS ////////////////
0, /* stun_only */
0, /* no_stun */
0, /* secure_stun */
false, /* stun_only */
false, /* no_stun */
false, /* secure_stun */
0, /* server_relay */
0, /* fingerprint */
':', /* rest_api_separator */
STUN_DEFAULT_NONCE_EXPIRATION_TIME, /* stale_nonce */
STUN_DEFAULT_MAX_ALLOCATE_LIFETIME, /* max_allocate_lifetime */
STUN_DEFAULT_CHANNEL_LIFETIME, /* channel_lifetime */
STUN_DEFAULT_PERMISSION_LIFETIME, /* permission_lifetime */
0, /* mobility */
false, /* mobility */
TURN_CREDENTIALS_NONE, /* ct */
0, /* use_auth_secret_with_timestamp */
false, /* use_auth_secret_with_timestamp */
0, /* max_bps */
0, /* bps_capacity */
0, /* bps_capacity_allocated */
0, /* total_quota */
0, /* user_quota */
0, /* prometheus disabled by default */
false, /* prometheus disabled by default */
DEFAULT_PROM_SERVER_PORT, /* prometheus port */
0, /* prometheus username labelling disabled by default when prometheus is enabled */
false, /* prometheus username labelling disabled by default when prometheus is enabled */

///////////// Users DB //////////////
{(TURN_USERDB_TYPE)0, {"\0", "\0"}, {0, NULL, {NULL, 0}}},
Expand All @@ -222,14 +222,14 @@ turn_params_t turn_params = {
"", /* secret_key_file */
"", /* secret_key */
ALLOCATION_DEFAULT_ADDRESS_FAMILY_IPV4, /* allocation_default_address_family */
0, /* no_auth_pings */
0, /* no_dynamic_ip_list */
0, /* no_dynamic_realms */

0, /* log_binding */
0, /* no_stun_backward_compatibility */
0, /* response_origin_only_with_rfc5780 */
0 /* respond_http_unsupported */
false, /* no_auth_pings */
false, /* no_dynamic_ip_list */
false, /* no_dynamic_realms */

false, /* log_binding */
false, /* no_stun_backward_compatibility */
false, /* response_origin_only_with_rfc5780 */
false /* respond_http_unsupported */
};

//////////////// OpenSSL Init //////////////////////
Expand Down
71 changes: 36 additions & 35 deletions src/apps/relay/mainrelay.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#define __MAIN_RELAY__

#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -195,23 +196,23 @@ typedef struct _turn_params_ {
char tls_password[513];
char dh_file[1025];

int no_tlsv1;
int no_tlsv1_1;
int no_tlsv1_2;
int no_tls;
int no_dtls;
bool no_tlsv1;
bool no_tlsv1_1;
bool no_tlsv1_2;
bool no_tls;
bool no_dtls;

struct event *tls_ctx_update_ev;
TURN_MUTEX_DECLARE(tls_mutex)

//////////////// Common params ////////////////////

int verbose;
int turn_daemon;
int no_software_attribute;
int web_admin_listen_on_workers;
bool turn_daemon;
bool no_software_attribute;
bool web_admin_listen_on_workers;

int do_not_use_config_file;
bool do_not_use_config_file;

char pidfile[1025];
char acme_redirect[1025];
Expand All @@ -223,19 +224,19 @@ typedef struct _turn_params_ {
int alt_listener_port;
int alt_tls_listener_port;
int tcp_proxy_port;
int rfc5780;
bool rfc5780;

int no_udp;
int no_tcp;
int tcp_use_proxy;
bool no_udp;
bool no_tcp;
bool tcp_use_proxy;

vint no_tcp_relay;
vint no_udp_relay;
bool no_tcp_relay;
bool no_udp_relay;

char listener_ifname[1025];

redis_stats_db_t redis_statsdb;
int use_redis_statsdb;
bool use_redis_statsdb;

struct listener_server listener;

Expand All @@ -250,10 +251,10 @@ typedef struct _turn_params_ {
uint16_t min_port;
uint16_t max_port;

vint check_origin;
bool check_origin;

vint no_multicast_peers;
vint allow_loopback_peers;
bool no_multicast_peers;
bool allow_loopback_peers;

char relay_ifname[1025];
size_t relays_number;
Expand Down Expand Up @@ -285,31 +286,31 @@ typedef struct _turn_params_ {
turn_server_addrs_list_t tls_alternate_servers_list;

/////////////// stop server ////////////////
int stop_turn_server;
bool stop_turn_server;

////////////// MISC PARAMS ////////////////

vint stun_only;
vint no_stun;
vint secure_stun;
bool stun_only;
bool no_stun;
bool secure_stun;
int server_relay;
int fingerprint;
char rest_api_separator;
vint stale_nonce;
vint max_allocate_lifetime;
vint channel_lifetime;
vint permission_lifetime;
vint mobility;
bool mobility;
turn_credential_type ct;
int use_auth_secret_with_timestamp;
bool use_auth_secret_with_timestamp;
band_limit_t max_bps;
band_limit_t bps_capacity;
band_limit_t bps_capacity_allocated;
vint total_quota;
vint user_quota;
int prometheus;
bool prometheus;
int prometheus_port;
int prometheus_username_labels;
bool prometheus_username_labels;

/////// Users DB ///////////

Expand All @@ -323,14 +324,14 @@ typedef struct _turn_params_ {
char secret_key_file[1025];
unsigned char secret_key[1025];
ALLOCATION_DEFAULT_ADDRESS_FAMILY allocation_default_address_family;
int no_auth_pings;
int no_dynamic_ip_list;
int no_dynamic_realms;

vint log_binding;
vint no_stun_backward_compatibility;
vint response_origin_only_with_rfc5780;
vint respond_http_unsupported;
bool no_auth_pings;
bool no_dynamic_ip_list;
bool no_dynamic_realms;

bool log_binding;
bool no_stun_backward_compatibility;
bool response_origin_only_with_rfc5780;
bool respond_http_unsupported;
} turn_params_t;

extern turn_params_t turn_params;
Expand Down