]>
Commit | Line | Data |
---|---|---|
a8513aef | 1 | /* alphaosf.h |
b610e24a | 2 | |
a8513aef | 3 | System dependencies for DEC Alpha/OSF1... */ |
b610e24a TL |
4 | |
5 | /* | |
98311e4b DH |
6 | * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") |
7 | * Copyright (c) 1996-2003 by Internet Software Consortium | |
b610e24a | 8 | * |
98311e4b DH |
9 | * Permission to use, copy, modify, and distribute this software for any |
10 | * purpose with or without fee is hereby granted, provided that the above | |
11 | * copyright notice and this permission notice appear in all copies. | |
b610e24a | 12 | * |
98311e4b DH |
13 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES |
14 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
15 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR | |
16 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
17 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
18 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT | |
19 | * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
b610e24a | 20 | * |
98311e4b DH |
21 | * Internet Systems Consortium, Inc. |
22 | * 950 Charter Street | |
23 | * Redwood City, CA 94063 | |
24 | * <info@isc.org> | |
25 | * http://www.isc.org/ | |
49733f31 | 26 | * |
98311e4b | 27 | * This software has been written for Internet Systems Consortium |
49733f31 | 28 | * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc. |
98311e4b | 29 | * To learn more about Internet Systems Consortium, see |
49733f31 TL |
30 | * ``http://www.isc.org/''. To learn more about Vixie Enterprises, |
31 | * see ``http://www.vix.com''. To learn more about Nominum, Inc., see | |
32 | * ``http://www.nominum.com''. | |
b610e24a TL |
33 | */ |
34 | ||
3060073a | 35 | #include <syslog.h> |
b610e24a | 36 | #include <sys/types.h> |
b610e24a TL |
37 | #include <string.h> |
38 | #include <paths.h> | |
39 | #include <errno.h> | |
40 | #include <malloc.h> | |
41 | #include <unistd.h> | |
42 | #include <setjmp.h> | |
43 | #include <limits.h> | |
44 | ||
45 | #include <sys/wait.h> | |
46 | #include <signal.h> | |
47 | ||
b610e24a TL |
48 | extern int h_errno; |
49 | ||
50 | #include <net/if.h> | |
51 | #include <net/if_dl.h> | |
52 | ||
5deaeee1 TL |
53 | /* Define the basic integer types... */ |
54 | #if !defined (__BIT_TYPES_DEFINED__) | |
55 | typedef char int8_t; | |
56 | typedef short int16_t; | |
57 | typedef int int32_t; | |
58 | ||
59 | typedef unsigned char u_int8_t; | |
60 | typedef unsigned short u_int16_t; | |
61 | typedef unsigned int u_int32_t; | |
62 | typedef unsigned long u_int64_t; | |
63 | #endif | |
64 | ||
b610e24a | 65 | /* Varargs stuff... */ |
47ebb948 TL |
66 | #include <stdarg.h> |
67 | #define VA_DOTDOTDOT ... | |
c859d3b8 TL |
68 | #undef va_dcl |
69 | #define va_dcl | |
47ebb948 | 70 | #define VA_start(list, last) va_start (list, last) |
b610e24a | 71 | |
98311e4b DH |
72 | /* Our reports say that OSF/1 versions 4.0G and later have v/snprintf |
73 | * implementations. 4.0F and previous do not. This is detected at | |
74 | * ./configure time from 'sizer -v'. | |
75 | */ | |
76 | #ifndef HAVE_SNPRINTF | |
77 | # define NO_SNPRINTF | |
78 | #endif | |
79 | ||
911af7a5 | 80 | #ifndef _PATH_DHCPD_PID |
b610e24a | 81 | #define _PATH_DHCPD_PID "/var/run/dhcpd.pid" |
911af7a5 | 82 | #endif |
d432c972 TL |
83 | #ifndef _PATH_DHCLIENT_PID |
84 | #define _PATH_DHCLIENT_PID "/var/run/dhclient.pid" | |
85 | #endif | |
b610e24a TL |
86 | |
87 | #define EOL '\n' | |
88 | #define VOIDPTR void * | |
89 | ||
90 | /* Time stuff... */ | |
91 | #include <sys/time.h> | |
92 | #define TIME time_t | |
93 | #define GET_TIME(x) time ((x)) | |
b610e24a | 94 | |
a8513aef | 95 | /* The jmp_buf type is an array on OSF/1, so we can't dereference it |
b610e24a TL |
96 | and must declare it differently. */ |
97 | #define jbp_decl(x) jmp_buf x | |
98 | #define jref(x) (x) | |
99 | #define jdref(x) (x) | |
100 | #define jrefproto jmp_buf | |
101 | ||
b610e24a TL |
102 | #define NEED_OSF_PFILT_HACKS |
103 | #define BPF_FORMAT "/dev/pf/pfilt%d" | |
104 | ||
105 | #if defined (USE_DEFAULT_NETWORK) | |
106 | # define USE_BPF | |
6c54d798 TL |
107 | # define DEC_FDDI |
108 | # define FDDI_HEADER_SIZE 14 | |
b610e24a | 109 | #endif |
e6ba52d4 TL |
110 | |
111 | #define PTRSIZE_64BIT | |
32e99078 | 112 | |
125ab69a TL |
113 | #define SOCKLEN_T int |
114 | ||
32e99078 TL |
115 | #ifdef NEED_PRAND_CONF |
116 | const char *cmds[] = { | |
117 | "/bin/ps -ef 2>&1", | |
118 | "/usr/sbin/arp -an 2>&1", | |
119 | "/usr/sbin/netstat -an 2>&1", | |
120 | "/bin/df 2>&1", | |
121 | "/usr/bin/dig com. soa +ti=1 +retry=0 2>&1", | |
122 | "/usr/ucb/uptime 2>&1", | |
123 | "/usr/sbin/netstat -an 2>&1", | |
124 | "/bin/iostat 2>&1", | |
125 | NULL | |
126 | }; | |
127 | ||
128 | const char *dirs[] = { | |
129 | "/tmp", | |
130 | "/var/tmp", | |
131 | ".", | |
132 | "/", | |
133 | "/var/spool", | |
134 | "/var/adm", | |
135 | "/dev", | |
136 | "/var/spool/mail", | |
137 | "/home", | |
138 | NULL | |
139 | }; | |
140 | ||
141 | const char *files[] = { | |
142 | "/var/adm/messages", | |
143 | "/var/adm/wtmp", | |
144 | "/var/adm/lastlog", | |
145 | NULL | |
146 | }; | |
147 | #endif /* NEED_PRAND_CONF */ |