This file keeps track of the limit on the number of TCP connections each client makes the server. More...
Data Structures | |
struct | tcl_list |
TCP connection limit storage structure. More... | |
struct | tcl_addr |
An address span with connection limit information. More... | |
Functions | |
struct tcl_list * | tcl_list_create (void) |
Create TCP connection limit structure. More... | |
void | tcl_list_delete (struct tcl_list *tcl) |
Delete TCP connection limit structure. More... | |
int | tcl_list_apply_cfg (struct tcl_list *tcl, struct config_file *cfg) |
Process TCP connection limit config. More... | |
int | tcl_new_connection (struct tcl_addr *tcl) |
Increment TCP connection count if found, provided the count was below the limit. More... | |
void | tcl_close_connection (struct tcl_addr *tcl) |
Decrement TCP connection count if found. More... | |
struct tcl_addr * | tcl_addr_lookup (struct tcl_list *tcl, struct sockaddr_storage *addr, socklen_t addrlen) |
Lookup address to see its TCP connection limit structure. More... | |
size_t | tcl_list_get_mem (struct tcl_list *tcl) |
Get memory used by TCP connection limit structure. More... | |
This file keeps track of the limit on the number of TCP connections each client makes the server.
struct tcl_list* tcl_list_create | ( | void | ) |
Create TCP connection limit structure.
References tcl_list::region, regional_create(), and tcl_list_delete().
void tcl_list_delete | ( | struct tcl_list * | tcl | ) |
Delete TCP connection limit structure.
tcl | to delete. |
References traverse_postorder(), and tcl_list::tree.
Referenced by daemon_delete(), and tcl_list_create().
int tcl_list_apply_cfg | ( | struct tcl_list * | tcl, |
struct config_file * | cfg | ||
) |
Process TCP connection limit config.
tcl | where to store. |
cfg | config options. |
References addr_tree_init(), addr_tree_init_parents(), read_tcl_list(), tcl_list::region, regional_free_all(), and tcl_list::tree.
int tcl_new_connection | ( | struct tcl_addr * | tcl | ) |
Increment TCP connection count if found, provided the count was below the limit.
tcl | structure for tcl storage, or NULL. |
References tcl_addr::count, tcl_addr::limit, and tcl_addr::lock.
Referenced by comm_point_perform_accept().
void tcl_close_connection | ( | struct tcl_addr * | tcl | ) |
Decrement TCP connection count if found.
tcl | structure for tcl storage, or NULL. |
References tcl_addr::count, tcl_addr::lock, and log_assert.
Referenced by comm_point_close().
struct tcl_addr* tcl_addr_lookup | ( | struct tcl_list * | tcl, |
struct sockaddr_storage * | addr, | ||
socklen_t | addrlen | ||
) |
Lookup address to see its TCP connection limit structure.
tcl | structure for address storage. |
addr | address to check |
addrlen | length of addr. |
References addr_tree_lookup(), and tcl_list::tree.
Referenced by comm_point_perform_accept().
size_t tcl_list_get_mem | ( | struct tcl_list * | tcl | ) |
Get memory used by TCP connection limit structure.
tcl | structure for address storage. |
References tcl_list::region, and regional_get_mem().