]> git.ipfire.org Git - thirdparty/dhcp.git/blob - includes/cf/qnx.h
Go back to the BSD license.
[thirdparty/dhcp.git] / includes / cf / qnx.h
1 /* qnx.h
2
3 System dependencies for QNX... */
4
5 /*
6 * Copyright (c) 1996-1999 Internet Software Consortium.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of The Internet Software Consortium nor the names
19 * of its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
23 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
27 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
30 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
33 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * This software has been written for the Internet Software Consortium
37 * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
38 * To learn more about the Internet Software Consortium, see
39 * ``http://www.isc.org/''. To learn more about Vixie Enterprises,
40 * see ``http://www.vix.com''. To learn more about Nominum, Inc., see
41 * ``http://www.nominum.com''.
42 */
43
44 #include <sys/types.h>
45 #include <stdlib.h>
46 #include <string.h>
47 #include <errno.h>
48 #include <unistd.h>
49 #include <setjmp.h>
50 #include <limits.h>
51 #include <syslog.h>
52 #include <sys/select.h>
53
54 #include <sys/wait.h>
55 #include <signal.h>
56
57 #include <netdb.h>
58 extern int h_errno;
59
60 #include <net/if.h>
61 #define INADDR_LOOPBACK ((u_long)0x7f000001)
62
63 /* Varargs stuff... */
64 #include <stdarg.h>
65 #define VA_DOTDOTDOT ...
66 #define va_dcl
67 #define VA_start(list, last) va_start (list, last)
68
69 #ifndef _PATH_DHCPD_PID
70 #define _PATH_DHCPD_PID "/etc/dhcpd.pid"
71 #endif
72 #ifndef _PATH_DHCLIENT_PID
73 #define _PATH_DHCLIENT_PID "/etc/dhclient.pid"
74 #endif
75 #ifndef _PATH_DHCRELAY_PID
76 #define _PATH_DHCRELAY_PID "/etc/dhcrelay.pid"
77 #endif
78
79 #define EOL '\n'
80 #define VOIDPTR void *
81
82 /* Time stuff... */
83 #include <sys/time.h>
84 #define TIME time_t
85 #define GET_TIME(x) time ((x))
86 #define TIME_DIFF(high, low) (*(high) - *(low))
87 #define SET_TIME(x, y) (*(x) = (y))
88 #define ADD_TIME(d, s1, s2) (*(d) = *(s1) + *(s2))
89 #define SET_MAX_TIME(x) (*(x) = INT_MAX)
90
91 typedef unsigned char u_int8_t;
92 typedef unsigned short u_int16_t;
93 typedef unsigned long u_int32_t;
94 typedef signed short int16_t;
95 typedef signed long int32_t;
96
97 #define strcasecmp( s1, s2 ) stricmp( s1, s2 )
98 #define strncasecmp( s1, s2, n ) strnicmp( s1, s2, n )
99 #define vsnprintf( buf, size, fmt, list ) vsprintf( buf, fbuf, list )
100 #define random() rand()
101
102 #define HAVE_SA_LEN
103 #define BROKEN_TM_GMT
104 #define USE_SOCKETS
105 #define NO_SNPRINTF
106 #undef AF_LINK
107
108 /*
109 NOTE: to get the routing of the 255.255.255.255 broadcasts to work
110 under QNX, you need to issue the following command before starting
111 the daemon:
112
113 route add -interface 255.255.255.0 <hostname>
114
115 where <hostname> is replaced by the hostname or IP number of the
116 machine that dhcpd is running on.
117 */
118
119 #if defined (NSUPDATE)
120 #error NSUPDATE is not supported on QNX at this time!!
121 #endif
122 #ifdef NEED_PRAND_CONF
123 UHOH... (this isn't present in the BIND distribution either)
124 #endif /* NEED_PRAND_CONF */