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 sockaddr_in *bindaddr, int tos, int cos, ast_io_cb callback, void *data) |
struct sockaddr_in * | 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 sockaddr_in *sa) |
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 netsocket, int tos, int cos, const char *desc) |
int | ast_netsock_sockfd (const struct ast_netsock *ns) |
void | ast_netsock_unref (struct ast_netsock *ns) |
Network socket handling.
Definition in file netsock.h.
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 178 of file netsock.c.
References ast_netsock_bindaddr(), ast_strdupa, inet_aton(), and strsep().
Referenced by peer_set_srcaddr(), and set_config().
struct ast_netsock* ast_netsock_bindaddr | ( | struct ast_netsock_list * | list, |
struct io_context * | ioc, | ||
struct sockaddr_in * | bindaddr, | ||
int | tos, | ||
int | cos, | ||
ast_io_cb | callback, | ||
void * | data | ||
) |
Definition at line 108 of file netsock.c.
References ast_calloc, ast_enable_packet_fragmentation(), ast_free, ast_inet_ntoa(), ast_io_add(), AST_IO_IN, ast_log(), ast_netsock_set_qos(), ASTOBJ_CONTAINER_LINK, ASTOBJ_INIT, ast_netsock::bindaddr, ast_netsock::data, errno, ast_netsock::ioc, ast_netsock::ioref, LOG_ERROR, LOG_WARNING, netsocket, and ast_netsock::sockfd.
Referenced by ast_netsock_bind().
struct sockaddr_in* ast_netsock_boundaddr | ( | const struct ast_netsock * | ns | ) |
void* ast_netsock_data | ( | const struct ast_netsock * | ns | ) |
Definition at line 212 of file netsock.c.
References ast_netsock::data.
struct ast_netsock* ast_netsock_find | ( | struct ast_netsock_list * | list, |
struct sockaddr_in * | sa | ||
) |
Definition at line 93 of file netsock.c.
References ASTOBJ_CONTAINER_TRAVERSE, ASTOBJ_RDLOCK, ASTOBJ_UNLOCK, and inaddrcmp().
Referenced by peer_set_srcaddr().
int ast_netsock_init | ( | struct ast_netsock_list * | list | ) |
Definition at line 76 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 71 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 84 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 | netsocket, |
int | tos, | ||
int | cos, | ||
const char * | desc | ||
) |
Definition at line 158 of file netsock.c.
References ast_log(), ast_verb, and LOG_WARNING.
Referenced by ast_netsock_bindaddr(), ast_udptl_setqos(), config_load(), load_module(), and reload_config().
int ast_netsock_sockfd | ( | const struct ast_netsock * | ns | ) |
Definition at line 202 of file netsock.c.
Referenced by peer_set_srcaddr(), and set_config().
void ast_netsock_unref | ( | struct ast_netsock * | ns | ) |
Definition at line 217 of file netsock.c.
References ast_netsock_destroy(), and ASTOBJ_UNREF.
Referenced by peer_set_srcaddr(), and set_config().