Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _ASTERISK_NETSOCK_H
00025 #define _ASTERISK_NETSOCK_H
00026
00027 #if defined(__cplusplus) || defined(c_plusplus)
00028 extern "C" {
00029 #endif
00030
00031 #include "asterisk/network.h"
00032 #include "asterisk/io.h"
00033
00034 struct ast_netsock;
00035
00036 struct ast_netsock_list;
00037
00038 struct ast_netsock_list *ast_netsock_list_alloc(void);
00039
00040 int ast_netsock_init(struct ast_netsock_list *list);
00041
00042 struct ast_netsock *ast_netsock_bind(struct ast_netsock_list *list, struct io_context *ioc,
00043 const char *bindinfo, int defaultport, int tos, int cos, ast_io_cb callback, void *data);
00044
00045 struct ast_netsock *ast_netsock_bindaddr(struct ast_netsock_list *list, struct io_context *ioc,
00046 struct sockaddr_in *bindaddr, int tos, int cos, ast_io_cb callback, void *data);
00047
00048 int ast_netsock_release(struct ast_netsock_list *list);
00049
00050 struct ast_netsock *ast_netsock_find(struct ast_netsock_list *list,
00051 struct sockaddr_in *sa);
00052
00053 int ast_netsock_set_qos(int netsocket, int tos, int cos, const char *desc);
00054
00055 int ast_netsock_sockfd(const struct ast_netsock *ns);
00056
00057 const struct sockaddr_in *ast_netsock_boundaddr(const struct ast_netsock *ns);
00058
00059 void *ast_netsock_data(const struct ast_netsock *ns);
00060
00061 void ast_netsock_unref(struct ast_netsock *ns);
00062
00063 #if defined(__cplusplus) || defined(c_plusplus)
00064 }
00065 #endif
00066
00067 #endif