Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
ex_network.c File Reference
#include <stdio.h>
#include <errno.h>
#include "ex_network.h"
+ Include dependency graph for ex_network.c:

Go to the source code of this file.

Macros

#define CLIENT   1
 
#define SERVER   0
 

Functions

int main (int argc, char **argv)
 
void process_args (int argc, char **argv, char **address, char **server, char **port, int *nb, int *ip_version, int *udp_mode)
 
void usage (void)
 

Variables

int ip_mode = 0
 
int mode = -1
 Network for managing conenctions.
 
int NB_ATTEMPTS = 3
 
NETWORKnetw = NULL
 Network for server mode, accepting incomming.
 
NETWORKnetw_server = NULL
 
static pthread_t netw_thr
 
int use_udp = 0
 

Macro Definition Documentation

◆ CLIENT

#define CLIENT   1
Examples
ex_network.c.

Definition at line 33 of file ex_network.c.

◆ SERVER

#define SERVER   0
Examples
ex_network.c.

Definition at line 32 of file ex_network.c.

Function Documentation

◆ main()

◆ process_args()

void process_args ( int  argc,
char **  argv,
char **  address,
char **  server,
char **  port,
int *  nb,
int *  ip_version,
int *  udp_mode 
)

Definition at line 58 of file ex_network.c.

References getoptret, LOG_DEBUG, LOG_ERR, LOG_INFO, log_level, LOG_NOTICE, LOG_NULL, n_log, NETWORK_IPV4, NETWORK_IPV6, set_log_level(), and usage().

+ Here is the call graph for this function:

◆ usage()

void usage ( void  )

Definition at line 45 of file ex_network.c.

Variable Documentation

◆ ip_mode

int ip_mode = 0
Examples
ex_network.c.

Definition at line 40 of file ex_network.c.

Referenced by main().

◆ mode

int mode = -1

Network for managing conenctions.

Definition at line 40 of file ex_network.c.

◆ NB_ATTEMPTS

int NB_ATTEMPTS = 3
Examples
ex_network.c.

Definition at line 35 of file ex_network.c.

Referenced by main().

◆ netw

NETWORK * netw = NULL

Network for server mode, accepting incomming.

Examples
ex_accept_pool_client.c, ex_clock_sync.c, ex_gui_network.c, ex_network.c, ex_network.h, ex_network_ssl.c, and ex_network_ssl_hardened.c.

Definition at line 38 of file ex_network.c.

Referenced by _netw_capture_error(), _sse_read_byte(), _sse_write(), client_worker_echo(), client_worker_fast(), main(), main(), manage_client(), n_netw_clear_errors(), n_netw_get_error(), n_netw_get_error_count(), netw_accept_from_ex(), netw_add_msg(), netw_add_msg_ex(), netw_bind_udp(), netw_close(), netw_connect(), netw_connect_ex(), netw_connect_udp(), netw_get_msg(), netw_get_queue_status(), netw_get_state(), netw_make_listening(), netw_new(), netw_pool_add(), netw_pool_broadcast(), netw_pool_netw_close(), netw_pool_remove(), netw_recv_func(), netw_send_func(), netw_send_ident(), netw_send_ping(), netw_send_position(), netw_send_quit(), netw_send_string_to(), netw_send_string_to_all(), netw_set(), netw_set_blocking(), netw_set_crypto(), netw_set_crypto_chain(), netw_set_crypto_chain_pem(), netw_set_crypto_pem(), netw_set_user_id(), netw_setsockopt(), netw_ssl_connect(), netw_ssl_connect_client(), netw_ssl_do_handshake(), netw_ssl_set_ca(), netw_ssl_set_client_cert(), netw_ssl_set_verify(), netw_start_thr_engine(), netw_stop_thr_engine(), netw_udp_recvfrom(), netw_udp_sendto(), netw_wait_msg(), poll_network_msgs(), recv_data(), recv_ssl_data(), recv_udp_data(), run_client(), run_server(), send_data(), send_net_datas(), send_ssl_data(), send_udp_data(), and userlist_add_user().

◆ netw_server

NETWORK* netw_server = NULL

Definition at line 37 of file ex_network.c.

◆ netw_thr

pthread_t netw_thr
static
Examples
ex_network.c.

Definition at line 43 of file ex_network.c.

Referenced by main().

◆ use_udp

int use_udp = 0
Examples
ex_network.c.

Definition at line 41 of file ex_network.c.

Referenced by main().