]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/socket.h
...
[user/henk/code/inspircd.git] / include / socket.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
6  *                       E-mail:
7  *                <brain@chatspike.net>
8  *                <Craig@chatspike.net>
9  *     
10  * Written by Craig Edwards, Craig McLure, and others.
11  * This program is free but copyrighted software; see
12  *            the file COPYING for details.
13  *
14  * ---------------------------------------------------
15  */
16
17 #ifndef INSPIRCD_SOCKET_H
18 #define INSPIRCD_SOCKET_H
19
20 /* This is where we'll define wrappers for socket IO stuff, for neat winsock compatability */
21
22 #include <sys/time.h>
23 #include <sys/resource.h>
24 #include <sys/types.h>
25 #include <sys/socket.h>
26 #include <netinet/in.h>
27 #include <unistd.h>
28 #include <fcntl.h>
29 #include <poll.h>
30
31 #include "inspircd_config.h"
32
33 /* macros to the relevant system address description structs */
34 #ifdef IPV6
35
36 typedef struct sockaddr_in6 insp_sockaddr;
37 typedef struct in6_addr     insp_inaddr;
38
39 #else
40
41 typedef struct sockaddr_in  insp_sockaddr;
42 typedef struct in_addr      insp_inaddr;
43
44 #endif
45
46 int OpenTCPSocket(); 
47 bool BindSocket(int sockfd, insp_sockaddr client, insp_sockaddr server, int port, char* addr);
48 int BindPorts(bool bail);
49
50 #endif