Module: Kamailio TLS support. More...
#include <stdio.h>
#include "../tcp_conn.h"


Go to the source code of this file.
Functions | |
| size_t | tls_blocking_write (struct tcp_connection *c, int fd, const char *buf, size_t len) |
| This is shamelessly stolen tsend_stream from tsend.c. | |
| void | tls_close (struct tcp_connection *c, int fd) |
| perform one-way shutdown, do not wait fro notify from the remote peer | |
| int | tls_fix_read_conn (struct tcp_connection *c) |
| called before tls_read, the this function should attempt tls_accept or tls_connect depending on the state of the connection, if this function does not transit a connection into S_CONN_OK then tcp layer would not call tcp_read | |
| void | tls_print_errstack (void) |
| dump ssl error stack | |
| size_t | tls_read (struct tcp_connection *c) |
| called only when a connection is in S_CONN_OK, we do not have to care about accepting or connecting here, each modification of ssl data structures has to be protected, another process might ask for the same connection and attempt write to it which would result in updating the ssl structures | |
| void | tls_tcpconn_clean (struct tcp_connection *c) |
| clean the extra data upon connection shut down | |
| int | tls_tcpconn_init (struct tcp_connection *c, int sock) |
| Called when new tcp connection is accepted or connected, create ssl data structures here, there is no need to acquire any lock, because the connection is being created by a new process and no other process has access to it yet, this is called before adding the tcp_connection structure into the hash. | |
Module: Kamailio TLS support.
Definition in file tls_server.h.
| size_t tls_blocking_write | ( | struct tcp_connection * | c, | |
| int | fd, | |||
| const char * | buf, | |||
| size_t | len | |||
| ) |
This is shamelessly stolen tsend_stream from tsend.c.
Definition at line 761 of file tls_server.c.
References LM_ERR, S_CONN_ACCEPT, S_CONN_CONNECT, S_CONN_OK, tcp_connection::state, timeout, tls_accept(), tls_connect(), tls_handshake_timeout, tls_send_timeout, tls_update_fd(), and tls_write().
| void tls_close | ( | struct tcp_connection * | c, | |
| int | fd | |||
| ) |
perform one-way shutdown, do not wait fro notify from the remote peer
Definition at line 744 of file tls_server.c.
References LM_DBG, tls_shutdown(), and tls_update_fd().
| int tls_fix_read_conn | ( | struct tcp_connection * | c | ) |
called before tls_read, the this function should attempt tls_accept or tls_connect depending on the state of the connection, if this function does not transit a connection into S_CONN_OK then tcp layer would not call tcp_read
Definition at line 919 of file tls_server.c.
References tcp_connection::fd, S_CONN_ACCEPT, S_CONN_CONNECT, tcp_connection::state, tls_accept(), tls_connect(), tls_update_fd(), and tcp_connection::write_lock.
| void tls_print_errstack | ( | void | ) |
dump ssl error stack
Definition at line 102 of file tls_server.c.
References LM_ERR.
Referenced by _tls_read(), tls_accept(), tls_connect(), tls_shutdown(), and tls_write().
| size_t tls_read | ( | struct tcp_connection * | c | ) |
called only when a connection is in S_CONN_OK, we do not have to care about accepting or connecting here, each modification of ssl data structures has to be protected, another process might ask for the same connection and attempt write to it which would result in updating the ssl structures
Definition at line 875 of file tls_server.c.
References _tls_read(), tcp_req::buf, tcp_req::error, tcp_connection::fd, LM_ERR, tcp_req::pos, tcp_connection::req, TCP_BUF_SIZE, TCP_REQ_OVERRUN, tls_update_fd(), and tcp_connection::write_lock.
| void tls_tcpconn_clean | ( | struct tcp_connection * | c | ) |
clean the extra data upon connection shut down
Definition at line 726 of file tls_server.c.
References tcp_connection::extra_data, and LM_DBG.
| int tls_tcpconn_init | ( | struct tcp_connection * | c, | |
| int | sock | |||
| ) |
Called when new tcp connection is accepted or connected, create ssl data structures here, there is no need to acquire any lock, because the connection is being created by a new process and no other process has access to it yet, this is called before adding the tcp_connection structure into the hash.
Definition at line 580 of file tls_server.c.
References tls_domain::addr, tls_domain::ctx, DEFAULT_TCP_CONNECTION_LIFETIME, receive_info::dst_ip, receive_info::dst_port, tcp_connection::extra_data, tcp_connection::flags, get_ticks(), ip_addr2a(), _str::len, LM_DBG, LM_ERR, int_str::n, NULL, pkg_free, pkg_malloc, tls_domain::port, receive_info::proto, PROTO_TLS, tcp_connection::rcv, _str::s, int_str::s, S_CONN_ACCEPT, S_CONN_CONNECT, search_first_avp(), receive_info::src_ip, receive_info::src_port, tcp_connection::state, tcp_connection::timeout, tls_client_domain_avp, tls_find_client_domain(), tls_find_client_domain_name(), tls_find_server_domain(), tls_server_name_avp, tcp_connection::type, and ZSW.
1.5.6