2005-07-19 23:17:02 +00:00
|
|
|
/*
|
2005-08-30 18:32:10 +00:00
|
|
|
* Asterisk -- An open source telephony toolkit.
|
2005-07-19 23:17:02 +00:00
|
|
|
*
|
2005-08-30 18:32:10 +00:00
|
|
|
* Copyright (C) 1999 - 2005, Digium, Inc.
|
2005-07-19 23:17:02 +00:00
|
|
|
*
|
|
|
|
* Mark Spencer <markster@digium.com>
|
|
|
|
* Kevin P. Fleming <kpfleming@digium.com>
|
|
|
|
*
|
2005-08-30 18:32:10 +00:00
|
|
|
* See http://www.asterisk.org for more information about
|
|
|
|
* the Asterisk project. Please do not directly contact
|
|
|
|
* any of the maintainers of this project for assistance;
|
|
|
|
* the project provides a web site, mailing lists and IRC
|
|
|
|
* channels for your use.
|
|
|
|
*
|
2005-07-19 23:17:02 +00:00
|
|
|
* This program is free software, distributed under the terms of
|
2005-08-30 18:32:10 +00:00
|
|
|
* the GNU General Public License Version 2. See the LICENSE file
|
|
|
|
* at the top of the source tree.
|
|
|
|
*/
|
|
|
|
|
2005-10-24 20:12:06 +00:00
|
|
|
/*! \file
|
|
|
|
* \brief Network socket handling
|
2014-06-24 02:50:15 +00:00
|
|
|
*
|
|
|
|
* \deprecated Use netsock2.h instead
|
2005-07-19 23:17:02 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ASTERISK_NETSOCK_H
|
|
|
|
#define _ASTERISK_NETSOCK_H
|
|
|
|
|
|
|
|
#if defined(__cplusplus) || defined(c_plusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2007-11-17 14:11:53 +00:00
|
|
|
#include "asterisk/network.h"
|
2005-07-19 23:17:02 +00:00
|
|
|
#include "asterisk/io.h"
|
2012-02-27 16:31:24 +00:00
|
|
|
#include "asterisk/netsock2.h"
|
2005-07-19 23:17:02 +00:00
|
|
|
|
|
|
|
struct ast_netsock;
|
|
|
|
|
|
|
|
struct ast_netsock_list;
|
|
|
|
|
|
|
|
struct ast_netsock_list *ast_netsock_list_alloc(void);
|
|
|
|
|
|
|
|
int ast_netsock_init(struct ast_netsock_list *list);
|
|
|
|
|
|
|
|
struct ast_netsock *ast_netsock_bind(struct ast_netsock_list *list, struct io_context *ioc,
|
2007-04-30 16:16:26 +00:00
|
|
|
const char *bindinfo, int defaultport, int tos, int cos, ast_io_cb callback, void *data);
|
2005-07-19 23:17:02 +00:00
|
|
|
|
|
|
|
struct ast_netsock *ast_netsock_bindaddr(struct ast_netsock_list *list, struct io_context *ioc,
|
2012-02-27 16:31:24 +00:00
|
|
|
struct ast_sockaddr *bindaddr, int tos, int cos, ast_io_cb callback, void *data);
|
2005-07-19 23:17:02 +00:00
|
|
|
|
|
|
|
int ast_netsock_release(struct ast_netsock_list *list);
|
|
|
|
|
|
|
|
struct ast_netsock *ast_netsock_find(struct ast_netsock_list *list,
|
2012-02-27 16:31:24 +00:00
|
|
|
struct ast_sockaddr *addr);
|
2005-07-19 23:17:02 +00:00
|
|
|
|
2012-02-27 14:13:58 +00:00
|
|
|
/*!
|
2012-02-27 14:15:24 +00:00
|
|
|
* \deprecated Use ast_seq_qos in netsock2.h which properly handles IPv4 and IPv6
|
2012-02-27 14:13:58 +00:00
|
|
|
* sockets, instead.
|
|
|
|
*/
|
2012-02-27 14:57:23 +00:00
|
|
|
int ast_netsock_set_qos(int sockfd, int tos, int cos, const char *desc);
|
2007-04-30 16:16:26 +00:00
|
|
|
|
2005-07-19 23:17:02 +00:00
|
|
|
int ast_netsock_sockfd(const struct ast_netsock *ns);
|
|
|
|
|
2012-02-27 16:31:24 +00:00
|
|
|
const struct ast_sockaddr *ast_netsock_boundaddr(const struct ast_netsock *ns);
|
2005-07-19 23:17:02 +00:00
|
|
|
|
|
|
|
void *ast_netsock_data(const struct ast_netsock *ns);
|
|
|
|
|
2005-10-31 23:16:27 +00:00
|
|
|
void ast_netsock_unref(struct ast_netsock *ns);
|
|
|
|
|
2005-07-19 23:17:02 +00:00
|
|
|
#if defined(__cplusplus) || defined(c_plusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-08-30 18:32:10 +00:00
|
|
|
#endif /* _ASTERISK_NETSOCK_H */
|