1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* ***** BEGIN LICENSE BLOCK *****
3
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
5
* The contents of this file are subject to the Mozilla Public License Version
6
* 1.1 (the "License"); you may not use this file except in compliance with
7
* the License. You may obtain a copy of the License at
8
* http://www.mozilla.org/MPL/
10
* Software distributed under the License is distributed on an "AS IS" basis,
11
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
* for the specific language governing rights and limitations under the
15
* The Original Code is the Netscape Portable Runtime (NSPR).
17
* The Initial Developer of the Original Code is
18
* Netscape Communications Corporation.
19
* Portions created by the Initial Developer are Copyright (C) 1998-2000
20
* the Initial Developer. All Rights Reserved.
24
* Alternatively, the contents of this file may be used under the terms of
25
* either the GNU General Public License Version 2 or later (the "GPL"), or
26
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
* in which case the provisions of the GPL or the LGPL are applicable instead
28
* of those above. If you wish to allow use of your version of this file only
29
* under the terms of either the GPL or the LGPL, and not to allow others to
30
* use your version of this file under the terms of the MPL, indicate your
31
* decision by deleting the provisions above and replace them with the notice
32
* and other provisions required by the GPL or the LGPL. If you do not delete
33
* the provisions above, a recipient may use your version of this file under
34
* the terms of any one of the MPL, the GPL or the LGPL.
36
* ***** END LICENSE BLOCK ***** */
41
* Header file used to find the system header files for socket support.
42
* This file serves the following purposes:
43
* - A cross-platform, "get-everything" socket header file. On
44
* Unix, socket support is scattered in several header files,
45
* while Windows and Mac have a "get-everything" socket header
47
* - NSPR needs the following macro definitions and function
48
* prototype declarations from these header files:
50
* INADDR_ANY, INADDR_LOOPBACK, INADDR_BROADCAST
51
* ntohl(), ntohs(), htonl(), ntons().
52
* NSPR does not define its own versions of these macros and
53
* functions. It simply uses the native versions, which have
54
* the same names on all supported platforms.
55
* This file is intended to be included by nspr20 public header
56
* files, such as prio.h. One should not include this file directly.
62
#if defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS)
64
#undef __STRICT_ANSI__
65
#define __STRICT_ANSI__
67
#include <sys/types.h>
68
#include <sys/socket.h> /* AF_INET */
69
#include <netinet/in.h> /* INADDR_ANY, ..., ntohl(), ... */
71
#include <sys/ioctl.h>
76
* On AIX 4.3, the header <arpa/inet.h> refers to struct
77
* ether_addr and struct sockaddr_dl that are not declared.
78
* The following struct declarations eliminate the compiler
84
#include <arpa/inet.h>
88
#if defined(FREEBSD) || defined(BSDI) || defined(QNX)
89
#include <rpc/types.h> /* the only place that defines INADDR_LOOPBACK */
93
* OS/2 hack. For some reason INADDR_LOOPBACK is not defined in the
96
#if defined(OS2) && !defined(INADDR_LOOPBACK)
97
#define INADDR_LOOPBACK 0x7f000001
101
* Prototypes of ntohl() etc. are declared in <machine/endian.h>
102
* on these platforms.
104
#if defined(BSDI) || defined(OSF1)
105
#include <machine/endian.h>
110
/* Do not include any system header files. */
116
#elif defined(XP_MAC)
118
#include "macsocket.h"
122
#error Unknown platform
126
#endif /* prinet_h__ */