r18947: overload listen() and ioctl() in socket_wrapper
[samba.git] / source4 / lib / replace / system / network.h
1 #ifndef _system_network_h
2 #define _system_network_h
3 /* 
4    Unix SMB/CIFS implementation.
5
6    networking system include wrappers
7
8    Copyright (C) Andrew Tridgell 2004
9    
10    This program is free software; you can redistribute it and/or modify
11    it under the terms of the GNU General Public License as published by
12    the Free Software Foundation; either version 2 of the License, or
13    (at your option) any later version.
14    
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License for more details.
19    
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
25 #ifdef HAVE_SYS_SOCKET_H
26 #include <sys/socket.h>
27 #endif
28
29 #ifdef HAVE_UNIXSOCKET
30 #include <sys/un.h>
31 #endif
32
33 #ifdef HAVE_NETINET_IN_H
34 #include <netinet/in.h>
35 #endif
36 #ifdef HAVE_ARPA_INET_H
37 #include <arpa/inet.h>
38 #endif
39
40 #ifdef HAVE_NETDB_H
41 #include <netdb.h>
42 #endif
43
44 #ifdef HAVE_NETINET_TCP_H
45 #include <netinet/tcp.h>
46 #endif
47
48 /*
49  * The next three defines are needed to access the IPTOS_* options
50  * on some systems.
51  */
52
53 #ifdef HAVE_NETINET_IN_SYSTM_H
54 #include <netinet/in_systm.h>
55 #endif
56
57 #ifdef HAVE_NETINET_IN_IP_H
58 #include <netinet/in_ip.h>
59 #endif
60
61 #ifdef HAVE_NETINET_IP_H
62 #include <netinet/ip.h>
63 #endif
64
65 #ifdef HAVE_NET_IF_H
66 #include <net/if.h>
67 #endif
68
69 #ifdef HAVE_SYS_IOCTL_H
70 #include <sys/ioctl.h>
71 #endif
72
73 #ifdef SOCKET_WRAPPER
74 #ifndef SOCKET_WRAPPER_NOT_REPLACE
75 #define SOCKET_WRAPPER_REPLACE
76 #endif
77 #include "lib/socket_wrapper/socket_wrapper.h"
78 #endif
79
80 #ifdef REPLACE_INET_NTOA
81 char *rep_inet_ntoa(struct in_addr ip);
82 #define inet_ntoa rep_inet_ntoa
83 #endif
84
85 /*
86  * glibc on linux doesn't seem to have MSG_WAITALL
87  * defined. I think the kernel has it though..
88  */
89 #ifndef MSG_WAITALL
90 #define MSG_WAITALL 0
91 #endif
92
93 /*
94  * Some older systems seem not to have MAXHOSTNAMELEN
95  * defined.
96  */
97 #ifndef MAXHOSTNAMELEN
98 #define MAXHOSTNAMELEN 254
99 #endif
100
101 #ifndef INADDR_LOOPBACK
102 #define INADDR_LOOPBACK 0x7f000001
103 #endif
104
105 #ifndef INADDR_NONE
106 #define INADDR_NONE 0xffffffff
107 #endif
108
109 #endif