Asterisk - The Open Source Telephony Project
18.5.0
|
Network socket handling. More...
#include "asterisk.h"
#include <ifaddrs.h>
#include "include/netsock.h"
#include "asterisk/netsock2.h"
#include "asterisk/utils.h"
#include "include/astobj.h"
Go to the source code of this file.
Data Structures | |
struct | ast_netsock |
struct | ast_netsock_list |
Network socket handling.
Definition in file netsock.c.
struct ast_netsock* ast_netsock_bind | ( | struct ast_netsock_list * | list, |
struct io_context * | ioc, | ||
const char * | bindinfo, | ||
int | defaultport, | ||
int | tos, | ||
int | cos, | ||
ast_io_cb | callback, | ||
void * | data | ||
) |
Definition at line 167 of file netsock.c.
References ast_netsock_bindaddr(), ast_sockaddr_parse(), ast_sockaddr_port, ast_sockaddr_set_port, and NULL.
Referenced by peer_set_srcaddr().
struct ast_netsock* ast_netsock_bindaddr | ( | struct ast_netsock_list * | list, |
struct io_context * | ioc, | ||
struct ast_sockaddr * | bindaddr, | ||
int | tos, | ||
int | cos, | ||
ast_io_cb | callback, | ||
void * | data | ||
) |
Definition at line 109 of file netsock.c.
References AST_AF_INET, AST_AF_INET6, ast_bind(), ast_calloc, ast_enable_packet_fragmentation(), ast_free, ast_io_add(), AST_IO_IN, ast_log, ast_set_qos(), ast_sockaddr_copy(), ast_sockaddr_is_ipv6(), ast_sockaddr_stringify(), ASTOBJ_CONTAINER_LINK, ASTOBJ_INIT, ast_netsock::bindaddr, ast_netsock::data, errno, ast_netsock::ioc, ast_netsock::ioref, LOG_ERROR, LOG_WARNING, netsocket, NULL, and ast_netsock::sockfd.
Referenced by ast_netsock_bind(), and set_config().
const struct ast_sockaddr* ast_netsock_boundaddr | ( | const struct ast_netsock * | ns | ) |
void* ast_netsock_data | ( | const struct ast_netsock * | ns | ) |
Definition at line 193 of file netsock.c.
References ast_netsock::data.
|
static |
Definition at line 65 of file netsock.c.
References ast_free, ast_io_remove(), ast_netsock::ioc, ast_netsock::ioref, and ast_netsock::sockfd.
Referenced by ast_netsock_release(), and ast_netsock_unref().
struct ast_netsock* ast_netsock_find | ( | struct ast_netsock_list * | list, |
struct ast_sockaddr * | addr | ||
) |
Definition at line 94 of file netsock.c.
References ast_sockaddr_cmp(), ASTOBJ_CONTAINER_TRAVERSE, ASTOBJ_RDLOCK, ASTOBJ_UNLOCK, and NULL.
Referenced by peer_set_srcaddr().
int ast_netsock_init | ( | struct ast_netsock_list * | list | ) |
Definition at line 77 of file netsock.c.
References ASTOBJ_CONTAINER_INIT.
Referenced by load_module(), and set_config().
struct ast_netsock_list* ast_netsock_list_alloc | ( | void | ) |
Definition at line 72 of file netsock.c.
References ast_calloc.
Referenced by load_module(), and set_config().
int ast_netsock_release | ( | struct ast_netsock_list * | list | ) |
Definition at line 85 of file netsock.c.
References ast_free, ast_netsock_destroy(), ASTOBJ_CONTAINER_DESTROY, and ASTOBJ_CONTAINER_DESTROYALL.
Referenced by __unload_module(), and set_config().
int ast_netsock_set_qos | ( | int | sockfd, |
int | tos, | ||
int | cos, | ||
const char * | desc | ||
) |
Definition at line 162 of file netsock.c.
References ast_set_qos().
int ast_netsock_sockfd | ( | const struct ast_netsock * | ns | ) |
Definition at line 183 of file netsock.c.
References ast_netsock::sockfd.
Referenced by peer_set_srcaddr(), and set_config().
void ast_netsock_unref | ( | struct ast_netsock * | ns | ) |
Definition at line 198 of file netsock.c.
References ast_netsock_destroy(), and ASTOBJ_UNREF.
Referenced by peer_set_srcaddr(), and set_config().