Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
ex_network_ssl.c File Reference
#include "nilorea/n_list.h"
#include "nilorea/n_str.h"
#include "nilorea/n_log.h"
#include "nilorea/n_network.h"
#include "nilorea/n_thread_pool.h"
#include "nilorea/n_signals.h"
#include <sys/stat.h>
Include dependency graph for ex_network_ssl.c:

Go to the source code of this file.

Data Structures

struct  NETWORK_SSL_THREAD_PARAMS
 structure of a NETWORK_SSL_THREAD_PARAMS More...

Functions

void action_on_sig (int recvd_signal)
void handle_request (NETWORK *netw_ptr, LIST *routes_ptr)
int main (int argc, char *argv[])
void process_args (int argc_nb, char **argv_ptr, char **addr_ptr, char **port_ptr, char **key_ptr, char **cert_ptr, char **ca_file_ptr, int *ssl_verify_ptr, LIST *routes_ptr, int *ip_version_ptr, int *max_http_request_size_ptr, char **root_dir_ptr)
void * ssl_network_thread (void *params)
void usage (void)
 Network for managing connections.

Variables

int accept_timeout = 30
char * addr = NULL
char * ca_file = NULL
char * cert = NULL
volatile sig_atomic_t done = 0
int ip_version = 0
char * key = NULL
 TRUE while the key is held.
volatile sig_atomic_t killed_by_signal = 0
int max_connections = 0
int max_http_request_size = 16384
NETWORK * netw = NULL
 Network for server mode, accepting incomming.
char * port = NULL
char * root_dir = NULL
LIST * routes = NULL
NETWORK * server = NULL
int ssl_verify = 0

Data Structure Documentation

◆ NETWORK_SSL_THREAD_PARAMS

struct NETWORK_SSL_THREAD_PARAMS

structure of a NETWORK_SSL_THREAD_PARAMS

Examples
ex_network_ssl.c, and ex_network_ssl_hardened.c.

Definition at line 431 of file ex_network_ssl.c.

Collaboration diagram for NETWORK_SSL_THREAD_PARAMS:
Data Fields
NETWORK * netw network to use for the receiving thread
LIST * routes virtual routes for the server

Function Documentation

◆ action_on_sig()

void action_on_sig ( int recvd_signal)
Examples
ex_network_ssl.c, and ex_network_ssl_hardened.c.

Definition at line 205 of file ex_network_ssl.c.

References done, killed_by_signal, LOG_ERR, LOG_NOTICE, and n_log.

Referenced by main().

Here is the caller graph for this function:

◆ handle_request()

◆ main()

◆ process_args()

void process_args ( int argc_nb,
char ** argv_ptr,
char ** addr_ptr,
char ** port_ptr,
char ** key_ptr,
char ** cert_ptr,
char ** ca_file_ptr,
int * ssl_verify_ptr,
LIST * routes_ptr,
int * ip_version_ptr,
int * max_http_request_size_ptr,
char ** root_dir_ptr )

Definition at line 78 of file ex_network_ssl.c.

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

Here is the call graph for this function:

◆ ssl_network_thread()

void * ssl_network_thread ( void * params)
Examples
ex_network_ssl.c, and ex_network_ssl_hardened.c.

Definition at line 438 of file ex_network_ssl.c.

References __n_assert, Free, handle_request(), NETWORK_SSL_THREAD_PARAMS::netw, netw_close(), and NETWORK_SSL_THREAD_PARAMS::routes.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usage()

void usage ( void )

Network for managing connections.

Definition at line 59 of file ex_network_ssl.c.

References max_http_request_size.

Variable Documentation

◆ accept_timeout

int accept_timeout = 30
Examples
ex_network_ssl.c, and ex_network_ssl_hardened.c.

Definition at line 51 of file ex_network_ssl.c.

Referenced by main(), netw_accept_pool_create(), and process_args().

◆ addr

◆ ca_file

char* ca_file = NULL
Examples
ex_network_ssl.c, and ex_network_ssl_hardened.c.

Definition at line 41 of file ex_network_ssl.c.

Referenced by main(), netw_set_crypto_chain(), and netw_ssl_set_ca().

◆ cert

◆ done

◆ ip_version

◆ killed_by_signal

volatile sig_atomic_t killed_by_signal = 0
Examples
ex_network_ssl.c, and ex_network_ssl_hardened.c.

Definition at line 54 of file ex_network_ssl.c.

Referenced by action_on_sig(), and main().

◆ max_connections

int max_connections = 0
Examples
ex_network_ssl.c, and ex_network_ssl_hardened.c.

Definition at line 47 of file ex_network_ssl.c.

Referenced by main(), and process_args().

◆ max_http_request_size

int max_http_request_size = 16384
Examples
ex_network_ssl.c, and ex_network_ssl_hardened.c.

Definition at line 45 of file ex_network_ssl.c.

Referenced by handle_request(), main(), and usage().

◆ netw

NETWORK * netw = NULL

Network for server mode, accepting incomming.

Definition at line 57 of file ex_network_ssl.c.

◆ port

◆ root_dir

char* root_dir = NULL
Examples
ex_network_ssl.c, and ex_network_ssl_hardened.c.

Definition at line 42 of file ex_network_ssl.c.

Referenced by handle_request(), and main().

◆ routes

LIST* routes = NULL
Examples
ex_network_ssl.c, and ex_network_ssl_hardened.c.

Definition at line 43 of file ex_network_ssl.c.

Referenced by main().

◆ server

◆ ssl_verify

int ssl_verify = 0
Examples
ex_network_ssl.c, and ex_network_ssl_hardened.c.

Definition at line 46 of file ex_network_ssl.c.

Referenced by main().