Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Network socket handling. More...
Go to the source code of this file.
Functions | |
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) |
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) |
const struct ast_sockaddr * | ast_netsock_boundaddr (const struct ast_netsock *ns) |
void * | ast_netsock_data (const struct ast_netsock *ns) |
struct ast_netsock * | ast_netsock_find (struct ast_netsock_list *list, struct ast_sockaddr *addr) |
int | ast_netsock_init (struct ast_netsock_list *list) |
struct ast_netsock_list * | ast_netsock_list_alloc (void) |
int | ast_netsock_release (struct ast_netsock_list *list) |
int | ast_netsock_set_qos (int sockfd, int tos, int cos, const char *desc) |
int | ast_netsock_sockfd (const struct ast_netsock *ns) |
void | ast_netsock_unref (struct ast_netsock *ns) |
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, cos, NULL, and tos.
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, bindaddr, ast_netsock::bindaddr, cos, ast_netsock::data, errno, ast_netsock::ioc, ast_netsock::ioref, LOG_ERROR, LOG_WARNING, netsocket, NULL, ast_netsock::sockfd, and tos.
Referenced by ast_netsock_bind(), and set_config().
const struct ast_sockaddr * ast_netsock_boundaddr | ( | const struct ast_netsock * | ns | ) |
Definition at line 188 of file netsock.c.
References ast_netsock::bindaddr.
void * ast_netsock_data | ( | const struct ast_netsock * | ns | ) |
Definition at line 193 of file netsock.c.
References ast_netsock::data.
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(), cos, desc, ast_netsock::sockfd, and tos.
int ast_netsock_sockfd | ( | const struct ast_netsock * | ns | ) |
Definition at line 183 of file netsock.c.
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().