* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
- *
- * $Id: listener.h 6 2005-09-10 01:02:21Z nenolod $
*/
#ifndef INCLUDED_listener_h
struct Client;
-struct Listener\r
-{\r
- struct Listener *next; /* list node pointer */\r
- const char *name; /* listener name */\r
- rb_fde_t *F; /* file descriptor */\r
- int ref_count; /* number of connection references */\r
- int active; /* current state of listener */\r
- int ssl; /* ssl listener */\r
- struct rb_sockaddr_storage addr;\r
- struct DNSQuery *dns_query;\r
- char vhost[HOSTLEN + 1]; /* virtual name of listener */\r
+struct Listener
+{
+ rb_dlink_node lnode; /* list node */
+ const char *name; /* listener name */
+ rb_fde_t *F; /* file descriptor */
+ int ref_count; /* number of connection references */
+ int active; /* current state of listener */
+ int ssl; /* ssl listener */
+ int defer_accept; /* use TCP_DEFER_ACCEPT */
+ bool sctp; /* use SCTP */
+ int wsock; /* wsock listener */
+ struct rb_sockaddr_storage addr[2];
+ char vhost[(HOSTLEN * 2) + 1]; /* virtual name of listener */
};
-extern void add_listener(int port, const char *vaddr_ip, int family, int ssl);
+extern void add_tcp_listener(int port, const char *vaddr_ip, int family, int ssl, int defer_accept, int wsock);
+extern void add_sctp_listener(int port, const char *vaddr_ip1, const char *vaddr_ip2, int ssl, int wsock);
extern void close_listener(struct Listener *listener);
extern void close_listeners(void);
extern const char *get_listener_name(const struct Listener *listener);