]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/socket.h
e62a2dc419a31f5da7731bcb76e145a53e9f0b57
[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 #include "inspircd_config.h"
31
32 /* macros to the relevant system address description structs */
33 #ifdef IPV6
34
35 typedef struct sockaddr_in6 insp_sockaddr;
36 typedef struct in6_addr     insp_inaddr;
37
38 #else
39
40 typedef struct sockaddr_in  insp_sockaddr;
41 typedef struct in_addr      insp_inaddr;
42
43 #endif
44
45 int OpenTCPSocket(); 
46 bool BindSocket(int sockfd, insp_sockaddr client, insp_sockaddr server, int port, char* addr);
47 int BindPorts(bool bail);
48
49 #endif