r23790: LGPLv3+ conversion for our LGPLv2+ library code
[Samba.git] / source / lib / replace / system / network.h
blob4594f2237d3f8182d3a281ed0977a035471f5131
1 #ifndef _system_network_h
2 #define _system_network_h
3 /*
4 Unix SMB/CIFS implementation.
6 networking system include wrappers
8 Copyright (C) Andrew Tridgell 2004
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
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 3 of the License, or (at your option) any later version.
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.
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
30 #ifdef HAVE_SYS_SOCKET_H
31 #include <sys/socket.h>
32 #endif
34 #ifdef HAVE_UNIXSOCKET
35 #include <sys/un.h>
36 #endif
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
45 #ifdef HAVE_NETDB_H
46 #include <netdb.h>
47 #endif
49 #ifdef HAVE_NETINET_TCP_H
50 #include <netinet/tcp.h>
51 #endif
54 * The next three defines are needed to access the IPTOS_* options
55 * on some systems.
58 #ifdef HAVE_NETINET_IN_SYSTM_H
59 #include <netinet/in_systm.h>
60 #endif
62 #ifdef HAVE_NETINET_IN_IP_H
63 #include <netinet/in_ip.h>
64 #endif
66 #ifdef HAVE_NETINET_IP_H
67 #include <netinet/ip.h>
68 #endif
70 #ifdef HAVE_NET_IF_H
71 #include <net/if.h>
72 #endif
74 #ifdef HAVE_UNISTD_H
75 #include <unistd.h>
76 #endif
78 #ifdef HAVE_SYS_IOCTL_H
79 #include <sys/ioctl.h>
80 #endif
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
89 #ifdef REPLACE_INET_NTOA
90 char *rep_inet_ntoa(struct in_addr ip);
91 #define inet_ntoa rep_inet_ntoa
92 #endif
95 * glibc on linux doesn't seem to have MSG_WAITALL
96 * defined. I think the kernel has it though..
98 #ifndef MSG_WAITALL
99 #define MSG_WAITALL 0
100 #endif
103 * Some older systems seem not to have MAXHOSTNAMELEN
104 * defined.
106 #ifndef MAXHOSTNAMELEN
107 #define MAXHOSTNAMELEN 254
108 #endif
110 #ifndef INADDR_LOOPBACK
111 #define INADDR_LOOPBACK 0x7f000001
112 #endif
114 #ifndef INADDR_NONE
115 #define INADDR_NONE 0xffffffff
116 #endif
118 #endif