]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/socket.h
Remove an extern, partly because it's unused, partly because it then gets shadowed...
[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 #ifndef WIN32
23
24 #include <arpa/inet.h>
25 #include <sys/time.h>
26 #include <sys/resource.h>
27 #include <sys/types.h>
28 #include <sys/socket.h>
29 #include <sys/stat.h>
30 #include <netinet/in.h>
31 #include <unistd.h>
32 #include <fcntl.h>
33 #include <poll.h>
34 #include <netdb.h>
35 #include <errno.h>
36
37 #else
38
39 #include <windef.h>
40 #include <winsock2.h>
41 typedef int socklen_t;
42
43 #endif
44
45 #include "inspircd_config.h"
46
47 /* macros to the relevant system address description structs */
48 #ifdef IPV6
49
50 typedef struct sockaddr_in6 insp_sockaddr;
51 typedef struct in6_addr     insp_inaddr;
52
53 #else
54
55 typedef struct sockaddr_in  insp_sockaddr;
56 typedef struct in_addr      insp_inaddr;
57
58 #endif
59
60 int OpenTCPSocket(); 
61 bool BindSocket(int sockfd, insp_sockaddr client, insp_sockaddr server, int port, char* addr);
62 int BindPorts(bool bail);
63
64 #endif