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