| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
#ifndef _ASTERISK_NETSOCK_H |
| 27 |
#define _ASTERISK_NETSOCK_H |
| 28 |
|
| 29 |
#if defined(__cplusplus) || defined(c_plusplus) |
| 30 |
extern "C" { |
| 31 |
#endif |
| 32 |
|
| 33 |
#include "asterisk/network.h" |
| 34 |
#include "asterisk/io.h" |
| 35 |
#include "asterisk/netsock2.h" |
| 36 |
|
| 37 |
struct ast_netsock; |
| 38 |
|
| 39 |
struct ast_netsock_list; |
| 40 |
|
| 41 |
struct ast_netsock_list *ast_netsock_list_alloc(void); |
| 42 |
|
| 43 |
int ast_netsock_init(struct ast_netsock_list *list); |
| 44 |
|
| 45 |
struct ast_netsock *ast_netsock_bind(struct ast_netsock_list *list, struct io_context *ioc, |
| 46 |
const char *bindinfo, int defaultport, int tos, int cos, ast_io_cb callback, void *data); |
| 47 |
|
| 48 |
struct ast_netsock *ast_netsock_bindaddr(struct ast_netsock_list *list, struct io_context *ioc, |
| 49 |
struct ast_sockaddr *bindaddr, int tos, int cos, ast_io_cb callback, void *data); |
| 50 |
|
| 51 |
int ast_netsock_release(struct ast_netsock_list *list); |
| 52 |
|
| 53 |
struct ast_netsock *ast_netsock_find(struct ast_netsock_list *list, |
| 54 |
struct ast_sockaddr *addr); |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
int ast_netsock_set_qos(int sockfd, int tos, int cos, const char *desc); |
| 61 |
|
| 62 |
int ast_netsock_sockfd(const struct ast_netsock *ns); |
| 63 |
|
| 64 |
const struct ast_sockaddr *ast_netsock_boundaddr(const struct ast_netsock *ns); |
| 65 |
|
| 66 |
void *ast_netsock_data(const struct ast_netsock *ns); |
| 67 |
|
| 68 |
void ast_netsock_unref(struct ast_netsock *ns); |
| 69 |
|
| 70 |
#if defined(__cplusplus) || defined(c_plusplus) |
| 71 |
} |
| 72 |
#endif |
| 73 |
|
| 74 |
#endif |