r23309: sync lib/replace with SAMBA_4_0
[ira/wip.git] / source3 / 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      ** NOTE! The following LGPL license applies to the replace
11      ** library. This does NOT imply that all of Samba is released
12      ** under the LGPL
13    
14    This library is free software; you can redistribute it and/or
15    modify it under the terms of the GNU Lesser General Public
16    License as published by the Free Software Foundation; either
17    version 2 of the License, or (at your option) any later version.
18
19    This library is distributed in the hope that it will be useful,
20    but WITHOUT ANY WARRANTY; without even the implied warranty of
21    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22    Lesser General Public License for more details.
23
24    You should have received a copy of the GNU Lesser General Public
25    License along with this library; if not, write to the Free Software
26    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27
28 */
29
30 #ifdef HAVE_SYS_SOCKET_H
31 #include <sys/socket.h>
32 #endif
33
34 #ifdef HAVE_UNIXSOCKET
35 #include <sys/un.h>
36 #endif
37
38 #ifdef HAVE_NETINET_IN_H
39 #include <netinet/in.h>
40 #endif
41 #ifdef HAVE_ARPA_INET_H
42 #include <arpa/inet.h>
43 #endif
44
45 #ifdef HAVE_NETDB_H
46 #include <netdb.h>
47 #endif
48
49 #ifdef HAVE_NETINET_TCP_H
50 #include <netinet/tcp.h>
51 #endif
52
53 /*
54  * The next three defines are needed to access the IPTOS_* options
55  * on some systems.
56  */
57
58 #ifdef HAVE_NETINET_IN_SYSTM_H
59 #include <netinet/in_systm.h>
60 #endif
61
62 #ifdef HAVE_NETINET_IN_IP_H
63 #include <netinet/in_ip.h>
64 #endif
65
66 #ifdef HAVE_NETINET_IP_H
67 #include <netinet/ip.h>
68 #endif
69
70 #ifdef HAVE_NET_IF_H
71 #include <net/if.h>
72 #endif
73
74 #ifdef HAVE_UNISTD_H
75 #include <unistd.h>
76 #endif
77
78 #ifdef HAVE_SYS_IOCTL_H
79 #include <sys/ioctl.h>
80 #endif
81
82 #ifdef SOCKET_WRAPPER
83 #ifndef SOCKET_WRAPPER_NOT_REPLACE
84 #define SOCKET_WRAPPER_REPLACE
85 #endif
86 #include "lib/socket_wrapper/socket_wrapper.h"
87 #endif
88
89 #ifdef REPLACE_INET_NTOA
90 char *rep_inet_ntoa(struct in_addr ip);
91 #define inet_ntoa rep_inet_ntoa
92 #endif
93
94 /*
95  * glibc on linux doesn't seem to have MSG_WAITALL
96  * defined. I think the kernel has it though..
97  */
98 #ifndef MSG_WAITALL
99 #define MSG_WAITALL 0
100 #endif
101
102 /*
103  * Some older systems seem not to have MAXHOSTNAMELEN
104  * defined.
105  */
106 #ifndef MAXHOSTNAMELEN
107 #define MAXHOSTNAMELEN 254
108 #endif
109
110 #ifndef INADDR_LOOPBACK
111 #define INADDR_LOOPBACK 0x7f000001
112 #endif
113
114 #ifndef INADDR_NONE
115 #define INADDR_NONE 0xffffffff
116 #endif
117
118 #endif