Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bb68b2cb7 | ||
|
|
6611c18046 | ||
|
|
fde8269185 | ||
|
|
53a96ddd53 | ||
|
|
e0bffa6517 |
@@ -1,135 +1,12 @@
|
||||
1191. [bug] A dynamic update removing the last non-apex name in
|
||||
a secure zone would fail. [RT #2399]
|
||||
--- 9.2.0-P2 released ---
|
||||
|
||||
1189. [bug] On some systems, malloc(0) returns NULL, which
|
||||
could cause the caller to report an out of memory
|
||||
error. [RT #2398]
|
||||
2203. [security] Query id generation was cryptographically weak.
|
||||
[RT # 16915]
|
||||
|
||||
1188. [bug] Dynamic updates of a signed zone would fail if
|
||||
some of the zone private keys were unavailable.
|
||||
--- 9.2.0-P1 released ---
|
||||
|
||||
1186. [bug] isc_hex_tobuffer(,,length = 0) failed to unget the
|
||||
EOL token when reading to end of line.
|
||||
|
||||
1185. [bug] libbind: don't assume statp->_u._ext.ext is valid
|
||||
unless RES_INIT is set when calling res_*init().
|
||||
|
||||
1184. [bug] libbind: call res_ndestroy() if RES_INIT is set
|
||||
when res_*init() is called.
|
||||
|
||||
1183. [bug] Handle ENOSR error when writing to the internal
|
||||
control pipe. [RT #2395]
|
||||
|
||||
1182. [bug] The server could throw an assertion failure when
|
||||
constructing a negative response packet.
|
||||
|
||||
1176. [doc] Document that allow-v6-synthesis is only performed
|
||||
for clients that are supplied recursive service.
|
||||
[RT #2260]
|
||||
|
||||
1175. [bug] named-checkzone failed to call dns_result_register()
|
||||
at startup which could result in runtime
|
||||
exceptions when printing "out of memory" errors.
|
||||
[RT #2335]
|
||||
|
||||
1174. [bug] Win32: add WSAECONNRESET to the expected errors
|
||||
from connect(). [RT #2308]
|
||||
|
||||
1173. [bug] Potential memory leaks in isc_log_create() and
|
||||
isc_log_settag(). [RT #2336]
|
||||
|
||||
1172. [doc] Add CERT, GPOS, KX, NAPTR, NSAP, PX and TXT to
|
||||
table of RR types in ARM.
|
||||
|
||||
1170. [bug] Don't attempt to print the token when a I/O error
|
||||
occurs when parsing named.conf. [RT #2275]
|
||||
|
||||
1168. [bug] Empty also-notify clauses were not handled. [RT #2309]
|
||||
|
||||
1167. [contrib] nslint-2.1a3 (from author).
|
||||
|
||||
1166. [bug] "Not Implemented" should be reported as NOTIMP,
|
||||
not NOTIMPL. [RT #2281]
|
||||
|
||||
1165. [bug] We were rejecting notify-source{-v6} in zone clauses.
|
||||
|
||||
1164. [bug] Empty masters clauses in slave / stub zones were not
|
||||
handled gracefully. [RT #2262]
|
||||
|
||||
1162. [bug] The allow-notify option was not accepted in slave
|
||||
zone statements.
|
||||
|
||||
1161. [bug] named-checkzone looped on unbalanced brackets.
|
||||
[RT #2248]
|
||||
|
||||
1160. [bug] Generating Diffie-Hellman keys longer than 1024
|
||||
bits could fail. [RT #2241]
|
||||
|
||||
1156. [port] The configure test for strsep() incorrectly
|
||||
succeeded on certain patched versions of
|
||||
AIX 4.3.3. [RT #2190]
|
||||
|
||||
1154. [bug] Don't attempt to obtain the netmask of a interface
|
||||
if there is no address configured. [RT #2176]
|
||||
|
||||
1152. [bug] libbind: read buffer overflows.
|
||||
|
||||
1144. [bug] rndc-confgen would crash if both the -a and -t
|
||||
options were specified. [RT #2159]
|
||||
|
||||
1142. [bug] dnssec-signzone would fail to delete temporary files
|
||||
in some failure cases. [RT #2144]
|
||||
|
||||
1141. [bug] When named rejected a control message, it would
|
||||
leak a file descriptor and memory. It would also
|
||||
fail to respond, causing rndc to hang.
|
||||
[RT #2139, #2164]
|
||||
|
||||
1140. [bug] rndc-confgen did not accept IPv6 addresses as arguments
|
||||
to the -s option. [RT #2138]
|
||||
|
||||
1136. [bug] CNAME records synthesized from DNAMEs did not
|
||||
have a TTL of zero as required by RFC2672.
|
||||
[RT #2129]
|
||||
|
||||
1125. [bug] rndc: -k option was missing from usage message.
|
||||
[RT #2057]
|
||||
|
||||
1124. [doc] dig: +[no]dnssec, +[no]besteffort and +[no]fail
|
||||
are now documented. [RT #2052]
|
||||
|
||||
1123. [bug] dig +[no]fail did not match description. [RT #2052]
|
||||
|
||||
1109. [bug] nsupdate accepted illegal ttl values.
|
||||
|
||||
1108. [bug] On Win32, rndc was hanging when named was not running
|
||||
due to failure to select for exceptional conditions
|
||||
in select(). [RT #1870]
|
||||
|
||||
1081. [bug] Multicast queries were incorrectly identified
|
||||
based on the source address, not the destination
|
||||
address.
|
||||
|
||||
1072. [bug] The TCP client quota could be exceeded when
|
||||
recursion occurred. [RT #1937]
|
||||
|
||||
1071. [bug] Sockets listening for TCP DNS connections
|
||||
specified an excessive listen backlog. [RT #1937]
|
||||
|
||||
1070. [bug] Copy DNSSEC OK (DO) to response as specified by
|
||||
draft-ietf-dnsext-dnssec-okbit-03.txt.
|
||||
|
||||
1014. [bug] Some queries would cause statistics counters to
|
||||
increment more than once or not at all. [RT #1321]
|
||||
|
||||
1012. [bug] The -p option to named did not behave as documented.
|
||||
|
||||
988. [bug] 'additional-from-auth no;' did not work reliably
|
||||
in the case of queries answered from the cache.
|
||||
[RT #1436]
|
||||
|
||||
995. [bug] dig, host, nslookup: using a raw IPv6 address as a
|
||||
target address should be fatal on a IPv4 only system.
|
||||
1243. [bug] It was possible to trigger a REQUIRE() in
|
||||
dns_message_findtype(). [RT #2659]
|
||||
|
||||
--- 9.2.0 released ---
|
||||
|
||||
@@ -396,7 +273,6 @@
|
||||
|
||||
--- 9.2.0rc4 released ---
|
||||
|
||||
|
||||
1013. [bug] It was possible to cancel a query twice when marking
|
||||
a server as bogus or by having a blackhole acl.
|
||||
[RT #1776]
|
||||
|
||||
@@ -13,7 +13,6 @@ FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
$Id: COPYRIGHT,v 1.6.2.1 2002/02/08 03:56:56 marka Exp $
|
||||
|
||||
Portions Copyright (C) 1996-2001 Nominum, Inc.
|
||||
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
1007. [port] config.guess, config.sub from autoconf-2.52.
|
||||
|
||||
1008. [port] libtool.m4, ltmain.sh from libtool-1.4.2.
|
||||
|
||||
1009. [port] OpenUNIX 8 support. [RT #1728]
|
||||
|
||||
1024. [port] Compilation failed on HP-UX 11.11 due to
|
||||
incompatible use of the SIOCGLIFCONF macro
|
||||
name. [RT #1831]
|
||||
[needs more work]
|
||||
|
||||
1073. [bug] The ADB cache cleaning should also be space driven.
|
||||
[RT #1915, #1938]
|
||||
[ New function dns_adb_setadbsize() ]
|
||||
|
||||
1105. [port] OpenUNIX 8 enable threads by default. [RT #1970]
|
||||
[Functional change]
|
||||
|
||||
1110. [bug] dig should only accept valid abbreviations of +options.
|
||||
[RT #2003]
|
||||
[Potentially breaks scripts. Leave to 9.3.0.]
|
||||
|
||||
1143. [bug] When a trusted-keys statement was present and named
|
||||
was built without crypto support, it would leak memory.
|
||||
[ Not applicable to 9.2 ]
|
||||
|
||||
1150. [bug] named incorrectly accepted TTL values
|
||||
containing plus or minus signs, such as
|
||||
1d+1h-1s.
|
||||
[ Uses new function isc_parse_uint32() ]
|
||||
|
||||
1151. [bug] nslookup failed to check that the arguments to
|
||||
the port, timeout, and retry options were
|
||||
valid integers and in range. [RT #2099]
|
||||
[ Uses new function isc_parse_uint32() ]
|
||||
|
||||
1159. [bug] MD and MF are not permitted to be loaded by RFC1123
|
||||
[ Could cause zones that loaded in 9.2.0 to fail
|
||||
to load. Leave such breakages to 9.3.0. ]
|
||||
|
||||
1187. [bug] named was incorrectly returning DNSSEC records
|
||||
in negative responses when the DO bit was not set.
|
||||
[ Requires API change (new arguement) to
|
||||
dns_rdataset_towire(), dns_rdataset_towirepartial()
|
||||
and dns_rdataset_towirepartial() ]
|
||||
|
||||
1025. [bug] Don't use multicast addresses to resolve iterative
|
||||
queries. [RT #101]
|
||||
|
||||
1034. [bug] Ignore the RD bit on multicast queries as specified
|
||||
in RFC 1123. [RT #137]
|
||||
|
||||
1035. [bug] If we respond to multicast queries (which we
|
||||
currently do not), respond from a unicast address
|
||||
as specified in RFC 1123. [RT #137]
|
||||
|
||||
1037. [bug] Negative responses whose authority section contain
|
||||
SOA or NS records whose owner names are not equal
|
||||
equal to or parents of the query name should be
|
||||
rejected. [RT #1862]
|
||||
|
||||
1079. [bug] BIND 8 compatibility: accept bare elements at top
|
||||
level of sort list treating them as if they were
|
||||
a single element list. [RT #1963]
|
||||
|
||||
1080. [bug] BIND 8 compatibility: accept bare IP prefixes
|
||||
as the second element of a two-element top level
|
||||
sort list statement. [RT #1964]
|
||||
|
||||
@@ -265,33 +265,3 @@ address 127.0.0.1 and the IPv6 loopback address ::1, and you do not
|
||||
have IPv6 fully operational. Change the "default-server localhost" to
|
||||
"default-server 127.0.0.1" to make sure rdnc does not try to contact
|
||||
the name server using IPv6.
|
||||
|
||||
|
||||
Q: I have Freebsd 4.4 and "rndc-confgen -a" just sits there.
|
||||
|
||||
A: /dev/random is not configured. Use rndcontrol(8) to tell the kernel
|
||||
to use certian interupts as a source of random events. You can make this
|
||||
permanent by setting rand_irqs in /etc/rc.conf.
|
||||
|
||||
e.g.
|
||||
/etc/rc.conf
|
||||
rand_irqs="3 14 15"
|
||||
|
||||
|
||||
Q: Why is named listening on UDP port other than 53?
|
||||
|
||||
A: Named uses a system selected port to make queries of other nameservers.
|
||||
This behaviour can be overridden by using query-source to lock down the
|
||||
port and/or address.
|
||||
|
||||
|
||||
Q: I get error messages like "multiple RRs of singleton type" and
|
||||
"CNAME and other data" when transfering a zone. What does this mean?
|
||||
|
||||
A: These indicate a malformed master zone. You can identify the
|
||||
exact records involved by transfering the zone using dig then
|
||||
running named-checkzone on it.
|
||||
|
||||
e.g.
|
||||
dig axfr example.com @master-server > tmp
|
||||
named-checkzone example.com tmp
|
||||
|
||||
@@ -44,15 +44,6 @@ BIND 9
|
||||
Nominum, Inc.
|
||||
|
||||
|
||||
BIND 9.2.1
|
||||
|
||||
BIND 9.2.1 is a maintenance release, containing fixes for
|
||||
a number of bugs in 9.2.0 but no new features.
|
||||
|
||||
NOTE: dig, nslookup name. now report "Not Implemented" as
|
||||
NOTIMP rather than NOTIMPL. This will have impact on scripts
|
||||
that are looking for NOTIMPL.
|
||||
|
||||
BIND 9.2.0
|
||||
|
||||
BIND 9.2.0 introduces a number of new features over 9.1,
|
||||
@@ -172,13 +163,11 @@ Building
|
||||
SuSE Linux 7.0
|
||||
Slackware Linux 7.x, 8.0
|
||||
Red Hat Linux 7.1
|
||||
Debian GNU/Linux 2.2 and 3.0
|
||||
OpenBSD 2.6, 2.8, 2.9
|
||||
UnixWare 7.1.1
|
||||
HP-UX 10.20
|
||||
BSD/OS 4.2
|
||||
OpenUNIX 8
|
||||
Mac OS X 10.1
|
||||
|
||||
To build, just
|
||||
|
||||
@@ -252,9 +241,6 @@ Building
|
||||
should also "make depend". If you're using Emacs, you might find
|
||||
"make tags" helpful.
|
||||
|
||||
If you need to re-run configure please run "make distclean" first.
|
||||
This will ensure that all the option changes take.
|
||||
|
||||
Building with gcc is not supported, unless gcc is the vendor's usual
|
||||
compiler (e.g. the various BSD systems, Linux).
|
||||
|
||||
@@ -289,10 +275,6 @@ Bug Reports and Mailing Lists
|
||||
To join the BIND 9 Users mailing list, send mail to
|
||||
|
||||
bind9-users-request@isc.org
|
||||
|
||||
archives of which can be found via
|
||||
|
||||
http://www.isc.org/ml-archives/
|
||||
|
||||
If you're planning on making changes to the BIND 9 source
|
||||
code, you might want to join the BIND 9 Workers mailing list.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
|
||||
<!--
|
||||
- Copyright (C) 2001, 2002 Internet Software Consortium.
|
||||
- Copyright (C) 2001 Internet Software Consortium.
|
||||
-
|
||||
- Permission to use, copy, modify, and distribute this software for any
|
||||
- purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -16,7 +16,7 @@
|
||||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: named-checkconf.docbook,v 1.3.2.1 2002/02/08 03:56:57 marka Exp $ -->
|
||||
<!-- $Id: named-checkconf.docbook,v 1.3 2001/06/29 01:04:56 gson Exp $ -->
|
||||
|
||||
<refentry>
|
||||
<refentryinfo>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1999-2002 Internet Software Consortium.
|
||||
* Copyright (C) 1999-2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: named-checkzone.c,v 1.13.2.2 2002/02/08 03:56:58 marka Exp $ */
|
||||
/* $Id: named-checkzone.c,v 1.13 2001/06/29 01:04:59 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -157,8 +157,6 @@ main(int argc, char **argv) {
|
||||
dns_log_setcontext(lctx);
|
||||
}
|
||||
|
||||
dns_result_register();
|
||||
|
||||
origin = argv[isc_commandline_index++];
|
||||
filename = argv[isc_commandline_index++];
|
||||
result = setup(origin, filename, classname);
|
||||
|
||||
+1
-14
@@ -274,7 +274,7 @@ Sets the timeout for a query to
|
||||
An attempt to set \fIT\fR to less than 1 will result
|
||||
in a query timeout of 1 second being applied.
|
||||
.TP
|
||||
\fB+tries=T\fR
|
||||
\fB+tries=A\fR
|
||||
Sets the number of times to retry UDP queries to server to
|
||||
\fIT\fR instead of the default, 3. If
|
||||
\fIT\fR is less than or equal to zero, the number of
|
||||
@@ -301,19 +301,6 @@ Print records like the SOA records in a verbose multi-line
|
||||
format with human-readable comments. The default is to print
|
||||
each record on a single line, to facilitate machine parsing
|
||||
of the \fBdig\fR output.
|
||||
.TP
|
||||
\fB+[no]fail\fR
|
||||
Do not try the next server if you receive a SERVFAIL. The default is
|
||||
to not try the next server which is the reverse of normal stub resolver
|
||||
behaviour.
|
||||
.TP
|
||||
\fB+[no]besteffort\fR
|
||||
Attempt to display the contents of messages which are malformed.
|
||||
The default is to not display malformed answers.
|
||||
.TP
|
||||
\fB+[no]dnssec\fR
|
||||
Requests DNSSEC records be sent by setting the DNSSEC OK bit (DO)
|
||||
in the the OPT record in the additional section of the query.
|
||||
.SH "MULTIPLE QUERIES"
|
||||
.PP
|
||||
The BIND 9 implementation of \fBdig \fR supports
|
||||
|
||||
+5
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2000-2002 Internet Software Consortium.
|
||||
* Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: dig.c,v 1.157.2.6 2002/02/08 03:57:00 marka Exp $ */
|
||||
/* $Id: dig.c,v 1.157.2.3 2001/11/15 01:24:10 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
@@ -111,7 +111,7 @@ static const char *rcodetext[] = {
|
||||
"FORMERR",
|
||||
"SERVFAIL",
|
||||
"NXDOMAIN",
|
||||
"NOTIMP",
|
||||
"NOTIMPL",
|
||||
"REFUSED",
|
||||
"YXDOMAIN",
|
||||
"YXRRSET",
|
||||
@@ -156,11 +156,9 @@ help(void) {
|
||||
" -x dot-notation (shortcut for in-addr lookups)\n"
|
||||
" -n (nibble form for reverse IPv6 lookups)\n"
|
||||
" -f filename (batch mode)\n"
|
||||
" -b address (bind to source address)\n"
|
||||
" -p port (specify port number)\n"
|
||||
" -t type (specify query type)\n"
|
||||
" -c class (specify query class)\n"
|
||||
" -k keyfile (specify tsig key file)\n"
|
||||
" -y name:key (specify named base64 tsig key)\n"
|
||||
" d-opt is of the form +keyword[=value], where keyword is:\n"
|
||||
" +[no]vc (TCP mode)\n"
|
||||
@@ -169,7 +167,6 @@ help(void) {
|
||||
" +tries=### (Set number of UDP attempts) [3]\n"
|
||||
" +domain=### (Set default domainname)\n"
|
||||
" +bufsize=### (Set EDNS0 Max UDP packet size)\n"
|
||||
" +ndots=### (Set NDOTS value)\n"
|
||||
" +[no]search (Set whether to use searchlist)\n"
|
||||
" +[no]defname (Ditto)\n"
|
||||
" +[no]recursive (Recursive mode)\n"
|
||||
@@ -180,6 +177,7 @@ help(void) {
|
||||
" +[no]aaonly (Set AA flag in query)\n"
|
||||
" +[no]adflag (Set AD flag in query)\n"
|
||||
" +[no]cdflag (Set CD flag in query)\n"
|
||||
" +ndots=### (Set NDOTS value)\n"
|
||||
" +[no]cmd (Control display of command line)\n"
|
||||
" +[no]comments (Control display of comment lines)\n"
|
||||
" +[no]question (Control display of question)\n"
|
||||
@@ -190,7 +188,7 @@ help(void) {
|
||||
" +[no]short (Disable everything except short\n"
|
||||
" form of answer)\n"
|
||||
" +[no]all (Set or clear all display flags)\n"
|
||||
" +[no]qr (Print question before sending)\n"
|
||||
" +qr (Print question before sending)\n"
|
||||
" +[no]nssearch (Search all authoritative nameservers)\n"
|
||||
" +[no]identify (ID responders in short answers)\n"
|
||||
" +[no]trace (Trace delegation down from root)\n"
|
||||
|
||||
+2
-23
@@ -16,7 +16,7 @@
|
||||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: dig.docbook,v 1.4.2.2 2001/11/28 23:35:02 gson Exp $ -->
|
||||
<!-- $Id: dig.docbook,v 1.4.2.1 2001/11/08 00:15:23 gson Exp $ -->
|
||||
|
||||
<refentry>
|
||||
|
||||
@@ -414,7 +414,7 @@ An attempt to set <parameter>T</parameter> to less than 1 will result
|
||||
in a query timeout of 1 second being applied.
|
||||
</para></listitem></varlistentry>
|
||||
|
||||
<varlistentry><term><option>+tries=T</option></term>
|
||||
<varlistentry><term><option>+tries=A</option></term>
|
||||
<listitem><para>
|
||||
Sets the number of times to retry UDP queries to server to
|
||||
<parameter>T</parameter> instead of the default, 3. If
|
||||
@@ -452,27 +452,6 @@ of the <command>dig</command> output.
|
||||
</para>
|
||||
</listitem></varlistentry>
|
||||
|
||||
<varlistentry><term><option>+[no]fail</option></term>
|
||||
<listitem><para>
|
||||
Do not try the next server if you receive a SERVFAIL. The default is
|
||||
to not try the next server which is the reverse of normal stub resolver
|
||||
behaviour.
|
||||
</para>
|
||||
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><option>+[no]besteffort</option></term>
|
||||
<listitem><para>
|
||||
Attempt to display the contents of messages which are malformed.
|
||||
The default is to not display malformed answers.
|
||||
</para>
|
||||
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><option>+[no]dnssec</option></term>
|
||||
<listitem><para>
|
||||
Requests DNSSEC records be sent by setting the DNSSEC OK bit (DO)
|
||||
in the the OPT record in the additional section of the query.
|
||||
</para>
|
||||
|
||||
</variablelist>
|
||||
|
||||
</para>
|
||||
|
||||
+5
-36
@@ -870,7 +870,7 @@ in a query timeout of 1 second being applied.</P
|
||||
><DT
|
||||
><TT
|
||||
CLASS="OPTION"
|
||||
>+tries=T</TT
|
||||
>+tries=A</TT
|
||||
></DT
|
||||
><DD
|
||||
><P
|
||||
@@ -959,37 +959,6 @@ CLASS="COMMAND"
|
||||
>dig</B
|
||||
> output.</P
|
||||
></DD
|
||||
><DT
|
||||
><TT
|
||||
CLASS="OPTION"
|
||||
>+[no]fail</TT
|
||||
></DT
|
||||
><DD
|
||||
><P
|
||||
>Do not try the next server if you receive a SERVFAIL. The default is
|
||||
to not try the next server which is the reverse of normal stub resolver
|
||||
behaviour.</P
|
||||
></DD
|
||||
><DT
|
||||
><TT
|
||||
CLASS="OPTION"
|
||||
>+[no]besteffort</TT
|
||||
></DT
|
||||
><DD
|
||||
><P
|
||||
>Attempt to display the contents of messages which are malformed.
|
||||
The default is to not display malformed answers.</P
|
||||
></DD
|
||||
><DT
|
||||
><TT
|
||||
CLASS="OPTION"
|
||||
>+[no]dnssec</TT
|
||||
></DT
|
||||
><DD
|
||||
><P
|
||||
>Requests DNSSEC records be sent by setting the DNSSEC OK bit (DO)
|
||||
in the the OPT record in the additional section of the query.</P
|
||||
></DD
|
||||
></DL
|
||||
></DIV
|
||||
> </P
|
||||
@@ -997,7 +966,7 @@ in the the OPT record in the additional section of the query.</P
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN335"
|
||||
NAME="AEN320"
|
||||
></A
|
||||
><H2
|
||||
>MULTIPLE QUERIES</H2
|
||||
@@ -1081,7 +1050,7 @@ CLASS="LITERAL"
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN353"
|
||||
NAME="AEN338"
|
||||
></A
|
||||
><H2
|
||||
>FILES</H2
|
||||
@@ -1094,7 +1063,7 @@ CLASS="FILENAME"
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN357"
|
||||
NAME="AEN342"
|
||||
></A
|
||||
><H2
|
||||
>SEE ALSO</H2
|
||||
@@ -1128,7 +1097,7 @@ CLASS="CITETITLE"
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN370"
|
||||
NAME="AEN355"
|
||||
></A
|
||||
><H2
|
||||
>BUGS </H2
|
||||
|
||||
+12
-13
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2000-2002 Internet Software Consortium.
|
||||
* Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: dighost.c,v 1.221.2.10 2002/02/08 03:57:02 marka Exp $ */
|
||||
/* $Id: dighost.c,v 1.221.2.7 2001/11/15 01:24:12 marka Exp $ */
|
||||
|
||||
/*
|
||||
* Notice to programmers: Do not use this code as an example of how to
|
||||
@@ -363,7 +363,7 @@ make_empty_lookup(void) {
|
||||
looknew->identify = ISC_FALSE;
|
||||
looknew->identify_previous_line = ISC_FALSE;
|
||||
looknew->ignore = ISC_FALSE;
|
||||
looknew->servfail_stops = ISC_TRUE;
|
||||
looknew->servfail_stops = ISC_FALSE;
|
||||
looknew->besteffort = ISC_TRUE;
|
||||
looknew->dnssec = ISC_FALSE;
|
||||
looknew->udpsize = 0;
|
||||
@@ -2208,7 +2208,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
|
||||
UNLOCK_LOOKUP;
|
||||
return;
|
||||
}
|
||||
if (msg->rcode == dns_rcode_servfail && !l->servfail_stops) {
|
||||
if (msg->rcode == dns_rcode_servfail && l->servfail_stops) {
|
||||
dig_query_t *next = ISC_LIST_NEXT(query, link);
|
||||
if (l->current_query == query)
|
||||
l->current_query = NULL;
|
||||
@@ -2393,16 +2393,15 @@ get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr) {
|
||||
|
||||
debug("get_address()");
|
||||
|
||||
if (inet_pton(AF_INET6, host, &in6) == 1) {
|
||||
if (!have_ipv6)
|
||||
fatal("Protocol family INET6 not supported '%s'", host);
|
||||
/*
|
||||
* Assume we have v4 if we don't have v6, since setup_libs
|
||||
* fatal()'s out if we don't have either.
|
||||
*/
|
||||
if (have_ipv6 && inet_pton(AF_INET6, host, &in6) == 1)
|
||||
isc_sockaddr_fromin6(sockaddr, &in6, port);
|
||||
} else if (inet_pton(AF_INET, host, &in4) == 1) {
|
||||
if (have_ipv4)
|
||||
isc_sockaddr_fromin(sockaddr, &in4, port);
|
||||
else
|
||||
isc_sockaddr_v6fromin(sockaddr, &in4, port);
|
||||
} else {
|
||||
else if (inet_pton(AF_INET, host, &in4) == 1)
|
||||
isc_sockaddr_fromin(sockaddr, &in4, port);
|
||||
else {
|
||||
#ifdef USE_GETADDRINFO
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
if (!have_ipv6)
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2000-2002 Internet Software Consortium.
|
||||
* Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: host.c,v 1.76.2.2 2002/02/08 03:57:04 marka Exp $ */
|
||||
/* $Id: host.c,v 1.76 2001/08/27 21:31:29 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
@@ -78,7 +78,7 @@ static const char *rcodetext[] = {
|
||||
"FORMERR",
|
||||
"SERVFAIL",
|
||||
"NXDOMAIN",
|
||||
"NOTIMP",
|
||||
"NOTIMPL",
|
||||
"REFUSED",
|
||||
"YXDOMAIN",
|
||||
"YXRRSET",
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2000-2002 Internet Software Consortium.
|
||||
* Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: nslookup.c,v 1.90.2.2 2002/02/08 03:57:05 marka Exp $ */
|
||||
/* $Id: nslookup.c,v 1.90 2001/07/30 01:09:14 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -80,7 +80,7 @@ static const char *rcodetext[] = {
|
||||
"FORMERR",
|
||||
"SERVFAIL",
|
||||
"NXDOMAIN",
|
||||
"NOTIMP",
|
||||
"NOTIMPL",
|
||||
"REFUSED",
|
||||
"YXDOMAIN",
|
||||
"YXRRSET",
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: dnssectool.c,v 1.31.2.2 2001/11/27 22:41:49 gson Exp $ */
|
||||
/* $Id: dnssectool.c,v 1.31.2.1 2001/09/06 00:14:15 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -65,8 +65,11 @@ setfatalcallback(fatalcallback_t *callback) {
|
||||
|
||||
void
|
||||
check_result(isc_result_t result, const char *message) {
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("%s: %s", message, isc_result_totext(result));
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "%s: %s: %s\n", program, message,
|
||||
isc_result_totext(result));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
+11
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1999-2002 Internet Software Consortium.
|
||||
* Copyright (C) 1999-2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: client.c,v 1.176.2.10 2002/02/08 03:57:07 marka Exp $ */
|
||||
/* $Id: client.c,v 1.176.2.8.2.1 2007/08/12 23:33:23 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -1014,7 +1014,7 @@ client_addopt(ns_client_t *client) {
|
||||
/*
|
||||
* Set EXTENDED-RCODE, VERSION, and Z to 0.
|
||||
*/
|
||||
rdatalist->ttl = (client->extflags & DNS_MESSAGEEXTFLAG_REPLYPRESERVE);
|
||||
rdatalist->ttl = 0;
|
||||
|
||||
/*
|
||||
* No ENDS options in the default case.
|
||||
@@ -1203,6 +1203,14 @@ client_request(isc_task_t *task, isc_event_t *event) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Hash the incoming request here as it is after
|
||||
* dns_dispatch_importrecv().
|
||||
*/
|
||||
dns_dispatch_hash(&client->now, sizeof(client->now));
|
||||
dns_dispatch_hash(isc_buffer_base(buffer),
|
||||
isc_buffer_usedlength(buffer));
|
||||
|
||||
/*
|
||||
* It's a request. Parse it.
|
||||
*/
|
||||
|
||||
+7
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2001, 2002 Internet Software Consortium.
|
||||
* Copyright (C) 2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: config.c,v 1.11.2.3 2002/02/08 03:57:09 marka Exp $ */
|
||||
/* $Id: config.c,v 1.11.2.1 2001/09/21 20:30:32 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -419,6 +419,11 @@ ns_config_getport(cfg_obj_t *config, in_port_t *portp) {
|
||||
isc_result_t result;
|
||||
int i;
|
||||
|
||||
if (ns_g_port != 0) {
|
||||
*portp = ns_g_port;
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
cfg_map_get(config, "options", &options);
|
||||
i = 0;
|
||||
if (options != NULL)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: controlconf.c,v 1.28.2.7 2001/11/27 22:38:14 gson Exp $ */
|
||||
/* $Id: controlconf.c,v 1.28.2.6 2001/10/31 23:00:44 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -539,7 +539,6 @@ control_newconn(isc_task_t *task, isc_event_t *event) {
|
||||
NS_LOGMODULE_CONTROL, ISC_LOG_WARNING,
|
||||
"rejected command channel message from %s",
|
||||
socktext);
|
||||
isc_socket_detach(&sock);
|
||||
goto restart;
|
||||
}
|
||||
|
||||
@@ -551,7 +550,6 @@ control_newconn(isc_task_t *task, isc_event_t *event) {
|
||||
NS_LOGMODULE_CONTROL, ISC_LOG_WARNING,
|
||||
"dropped command channel from %s: %s",
|
||||
socktext, isc_result_totext(result));
|
||||
isc_socket_detach(&sock);
|
||||
goto restart;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1999-2002 Internet Software Consortium.
|
||||
* Copyright (C) 1999-2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: query.h,v 1.28.2.3 2002/02/08 03:57:17 marka Exp $ */
|
||||
/* $Id: query.h,v 1.28 2001/03/14 19:33:00 halley Exp $ */
|
||||
|
||||
#ifndef NAMED_QUERY_H
|
||||
#define NAMED_QUERY_H 1
|
||||
@@ -46,9 +46,6 @@ struct ns_query {
|
||||
unsigned int fetchoptions;
|
||||
dns_db_t * gluedb;
|
||||
dns_db_t * authdb;
|
||||
dns_zone_t * authzone;
|
||||
isc_boolean_t authdbset;
|
||||
isc_boolean_t isreferral;
|
||||
dns_fetch_t * fetch;
|
||||
dns_a6context_t a6ctx;
|
||||
isc_bufferlist_t namebufs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1999-2002 Internet Software Consortium.
|
||||
* Copyright (C) 1999-2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: interfacemgr.c,v 1.59.2.5 2002/02/08 03:57:10 marka Exp $ */
|
||||
/* $Id: interfacemgr.c,v 1.59.2.3 2001/10/22 17:42:05 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -301,7 +301,7 @@ ns_interface_accepttcp(ns_interface_t *ifp) {
|
||||
isc_result_totext(result));
|
||||
goto tcp_bind_failure;
|
||||
}
|
||||
result = isc_socket_listen(ifp->tcpsocket, 3);
|
||||
result = isc_socket_listen(ifp->tcpsocket, 0);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_log_write(IFMGR_COMMON_LOGARGS, ISC_LOG_ERROR,
|
||||
"listening on TCP socket: %s",
|
||||
|
||||
+91
-95
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1999-2002 Internet Software Consortium.
|
||||
* Copyright (C) 1999-2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: query.c,v 1.198.2.6 2002/02/08 03:57:12 marka Exp $ */
|
||||
/* $Id: query.c,v 1.198.2.1 2001/11/15 01:24:17 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -143,55 +143,20 @@ synth_rev_respond(ns_client_t *client, dns_byaddrevent_t *bevent);
|
||||
* Increment query statistics counters.
|
||||
*/
|
||||
static inline void
|
||||
inc_stats(ns_client_t *client, dns_statscounter_t counter) {
|
||||
dns_zone_t *zone = client->query.authzone;
|
||||
|
||||
count_query(dns_zone_t *zone, isc_boolean_t is_zone,
|
||||
dns_statscounter_t counter)
|
||||
{
|
||||
REQUIRE(counter < DNS_STATS_NCOUNTERS);
|
||||
|
||||
ns_g_server->querystats[counter]++;
|
||||
|
||||
if (zone != NULL) {
|
||||
if (is_zone && zone != NULL) {
|
||||
isc_uint64_t *zonestats = dns_zone_getstatscounters(zone);
|
||||
if (zonestats != NULL)
|
||||
zonestats[counter]++;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
query_send(ns_client_t *client) {
|
||||
dns_statscounter_t counter;
|
||||
if (client->message->rcode == dns_rcode_noerror) {
|
||||
if (ISC_LIST_EMPTY(client->message->sections[DNS_SECTION_ANSWER])) {
|
||||
if (client->query.isreferral) {
|
||||
counter = dns_statscounter_referral;
|
||||
} else {
|
||||
counter = dns_statscounter_nxrrset;
|
||||
}
|
||||
} else {
|
||||
counter = dns_statscounter_success;
|
||||
}
|
||||
} else if (client->message->rcode == dns_rcode_nxdomain) {
|
||||
counter = dns_statscounter_nxdomain;
|
||||
} else {
|
||||
/* We end up here in case of YXDOMAIN, and maybe others */
|
||||
counter = dns_statscounter_failure;
|
||||
}
|
||||
inc_stats(client, counter);
|
||||
ns_client_send(client);
|
||||
}
|
||||
|
||||
static void
|
||||
query_error(ns_client_t *client, isc_result_t result) {
|
||||
inc_stats(client, dns_statscounter_failure);
|
||||
ns_client_error(client, result);
|
||||
}
|
||||
|
||||
static void
|
||||
query_next(ns_client_t *client, isc_result_t result) {
|
||||
inc_stats(client, dns_statscounter_failure);
|
||||
ns_client_next(client, result);
|
||||
}
|
||||
|
||||
static inline void
|
||||
query_maybeputqname(ns_client_t *client) {
|
||||
if (client->query.restarts > 0) {
|
||||
@@ -240,8 +205,6 @@ query_reset(ns_client_t *client, isc_boolean_t everything) {
|
||||
|
||||
if (client->query.authdb != NULL)
|
||||
dns_db_detach(&client->query.authdb);
|
||||
if (client->query.authzone != NULL)
|
||||
dns_zone_detach(&client->query.authzone);
|
||||
|
||||
/*
|
||||
* Clean up free versions.
|
||||
@@ -283,12 +246,11 @@ query_reset(ns_client_t *client, isc_boolean_t everything) {
|
||||
client->query.dboptions = 0;
|
||||
client->query.fetchoptions = 0;
|
||||
client->query.gluedb = NULL;
|
||||
client->query.authdbset = ISC_FALSE;
|
||||
client->query.isreferral = ISC_FALSE;
|
||||
client->query.authdb = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
query_next_callback(ns_client_t *client) {
|
||||
query_next(ns_client_t *client) {
|
||||
query_reset(client, ISC_FALSE);
|
||||
}
|
||||
|
||||
@@ -511,9 +473,6 @@ ns_query_init(ns_client_t *client) {
|
||||
client->query.qname = NULL;
|
||||
client->query.fetch = NULL;
|
||||
client->query.authdb = NULL;
|
||||
client->query.authzone = NULL;
|
||||
client->query.authdbset = ISC_FALSE;
|
||||
client->query.isreferral = ISC_FALSE;
|
||||
query_reset(client, ISC_FALSE);
|
||||
result = query_newdbversion(client, 3);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
@@ -591,15 +550,25 @@ query_getzonedb(ns_client_t *client, dns_name_t *name, unsigned int options,
|
||||
goto fail;
|
||||
|
||||
/*
|
||||
* If this is the first time we are called (that is, looking up
|
||||
* the actual name in the query section) remember this database.
|
||||
*
|
||||
* If authdb is non-NULL, we have been here before, and the
|
||||
* found database is always returned.
|
||||
*
|
||||
* This limits our searching to the zone where the first name
|
||||
* (the query target) was looked for. This prevents following
|
||||
* CNAMES or DNAMES into other zones and prevents returning
|
||||
* additional data from other zones.
|
||||
* (the query target) is found. This prevents following CNAMES
|
||||
* or DNAMES into other zones and prevents returning additional
|
||||
* data from other zones.
|
||||
*/
|
||||
if (!client->view->additionalfromauth &&
|
||||
client->query.authdbset &&
|
||||
db != client->query.authdb)
|
||||
goto refuse;
|
||||
if (!client->view->additionalfromauth) {
|
||||
if (client->query.authdb != NULL) {
|
||||
if (db != client->query.authdb)
|
||||
goto refuse;
|
||||
} else {
|
||||
dns_db_attach(db, &client->query.authdb);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If the zone has an ACL, we'll check it, otherwise
|
||||
@@ -878,6 +847,7 @@ query_simplefind(void *arg, dns_name_t *name, dns_rdatatype_t type,
|
||||
dns_rdataset_isassociated(sigrdataset))
|
||||
dns_rdataset_disassociate(sigrdataset);
|
||||
if (is_zone) {
|
||||
count_query(zone, is_zone, dns_statscounter_referral);
|
||||
if (USECACHE(client)) {
|
||||
/*
|
||||
* Either the answer is in the cache, or we
|
||||
@@ -942,8 +912,11 @@ query_simplefind(void *arg, dns_name_t *name, dns_rdatatype_t type,
|
||||
}
|
||||
/*
|
||||
* If we get here, the result is ISC_R_SUCCESS, and we found the
|
||||
* answer we were looking for in the zone.
|
||||
* answer we were looking for in the zone. Update the zone's
|
||||
* query counter.
|
||||
*/
|
||||
if (result == ISC_R_SUCCESS)
|
||||
count_query(zone, is_zone, dns_statscounter_success);
|
||||
|
||||
cleanup:
|
||||
if (dns_rdataset_isassociated(&zrdataset)) {
|
||||
@@ -2068,7 +2041,7 @@ query_resume(isc_task_t *task, isc_event_t *event) {
|
||||
if (devent->sigrdataset != NULL)
|
||||
query_putrdataset(client, &devent->sigrdataset);
|
||||
isc_event_free(&event);
|
||||
query_next(client, ISC_R_CANCELED);
|
||||
ns_client_next(client, ISC_R_CANCELED);
|
||||
/*
|
||||
* This may destroy the client.
|
||||
*/
|
||||
@@ -2085,23 +2058,18 @@ query_recurse(ns_client_t *client, dns_rdatatype_t qtype, dns_name_t *qdomain,
|
||||
isc_result_t result;
|
||||
dns_rdataset_t *rdataset, *sigrdataset;
|
||||
|
||||
inc_stats(client, dns_statscounter_recursion);
|
||||
|
||||
/*
|
||||
* We are about to recurse, which means that this client will
|
||||
* be unavailable for serving new requests for an indeterminate
|
||||
* amount of time. If this client is currently responsible
|
||||
* for handling incoming queries, set up a new client
|
||||
* object to handle them while we are waiting for a
|
||||
* response. There is no need to replace TCP clients
|
||||
* because those have already been replaced when the
|
||||
* connection was accepted (if allowed by the TCP quota).
|
||||
* response.
|
||||
*/
|
||||
if (! client->mortal) {
|
||||
result = isc_quota_attach(&ns_g_server->recursionquota,
|
||||
&client->recursionquota);
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
(client->attributes & NS_CLIENTATTR_TCP) == 0)
|
||||
if (result == ISC_R_SUCCESS)
|
||||
result = ns_client_replace(client);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
ns_client_log(client, NS_LOGCATEGORY_CLIENT,
|
||||
@@ -2417,17 +2385,20 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
*/
|
||||
dbuf = query_getnamebuf(client);
|
||||
if (dbuf == NULL) {
|
||||
count_query(zone, is_zone, dns_statscounter_failure);
|
||||
QUERY_ERROR(DNS_R_SERVFAIL);
|
||||
goto cleanup;
|
||||
}
|
||||
fname = query_newname(client, dbuf, &b);
|
||||
if (fname == NULL) {
|
||||
count_query(zone, is_zone, dns_statscounter_failure);
|
||||
QUERY_ERROR(DNS_R_SERVFAIL);
|
||||
goto cleanup;
|
||||
}
|
||||
tname = dns_fixedname_name(&event->foundname);
|
||||
result = dns_name_copy(tname, fname, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
count_query(zone, is_zone, dns_statscounter_failure);
|
||||
QUERY_ERROR(DNS_R_SERVFAIL);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -2461,6 +2432,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
result = query_getdb(client, client->query.qname, 0, &zone, &db,
|
||||
&version, &is_zone);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
count_query(NULL, ISC_FALSE, dns_statscounter_failure);
|
||||
if (result == DNS_R_REFUSED)
|
||||
QUERY_ERROR(DNS_R_REFUSED);
|
||||
else
|
||||
@@ -2470,14 +2442,6 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
|
||||
if (is_zone)
|
||||
authoritative = ISC_TRUE;
|
||||
|
||||
if (event == NULL && client->query.restarts == 0) {
|
||||
if (is_zone) {
|
||||
dns_zone_attach(zone, &client->query.authzone);
|
||||
dns_db_attach(db, &client->query.authdb);
|
||||
}
|
||||
client->query.authdbset = ISC_TRUE;
|
||||
}
|
||||
|
||||
db_find:
|
||||
CTRACE("query_find: db_find");
|
||||
@@ -2486,18 +2450,21 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
*/
|
||||
dbuf = query_getnamebuf(client);
|
||||
if (dbuf == NULL) {
|
||||
count_query(zone, is_zone, dns_statscounter_failure);
|
||||
QUERY_ERROR(DNS_R_SERVFAIL);
|
||||
goto cleanup;
|
||||
}
|
||||
fname = query_newname(client, dbuf, &b);
|
||||
rdataset = query_newrdataset(client);
|
||||
if (fname == NULL || rdataset == NULL) {
|
||||
count_query(zone, is_zone, dns_statscounter_failure);
|
||||
QUERY_ERROR(DNS_R_SERVFAIL);
|
||||
goto cleanup;
|
||||
}
|
||||
if (WANTDNSSEC(client)) {
|
||||
sigrdataset = query_newrdataset(client);
|
||||
if (sigrdataset == NULL) {
|
||||
count_query(zone, is_zone, dns_statscounter_failure);
|
||||
QUERY_ERROR(DNS_R_SERVFAIL);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -2554,6 +2521,8 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
result = dns_name_copy(client->query.qname,
|
||||
fname, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
count_query(zone, is_zone,
|
||||
dns_statscounter_failure);
|
||||
QUERY_ERROR(DNS_R_SERVFAIL);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -2571,6 +2540,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
CTRACE("query_find: resume");
|
||||
switch (result) {
|
||||
case ISC_R_SUCCESS:
|
||||
count_query(zone, is_zone, dns_statscounter_success);
|
||||
/*
|
||||
* This case is handled in the main line below.
|
||||
*/
|
||||
@@ -2620,6 +2590,8 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
* recurse anyway.
|
||||
*/
|
||||
if (RECURSIONOK(client)) {
|
||||
count_query(zone, is_zone,
|
||||
dns_statscounter_recursion);
|
||||
result = query_recurse(client, qtype,
|
||||
NULL, NULL);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
@@ -2627,11 +2599,15 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
NS_QUERYATTR_RECURSING;
|
||||
else {
|
||||
/* Unable to recurse. */
|
||||
count_query(zone, is_zone,
|
||||
dns_statscounter_failure);
|
||||
QUERY_ERROR(DNS_R_SERVFAIL);
|
||||
}
|
||||
goto cleanup;
|
||||
} else {
|
||||
/* Unable to give root server referral. */
|
||||
count_query(zone, is_zone,
|
||||
dns_statscounter_failure);
|
||||
QUERY_ERROR(DNS_R_SERVFAIL);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -2663,7 +2639,6 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
* database by setting client->query.gluedb.
|
||||
*/
|
||||
client->query.gluedb = db;
|
||||
client->query.isreferral = ISC_TRUE;
|
||||
/*
|
||||
* We must ensure NOADDITIONAL is off,
|
||||
* because the generation of
|
||||
@@ -2676,9 +2651,9 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
sigrdatasetp = &sigrdataset;
|
||||
else
|
||||
sigrdatasetp = NULL;
|
||||
query_addrrset(client, &fname,
|
||||
&rdataset, sigrdatasetp,
|
||||
dbuf, DNS_SECTION_AUTHORITY);
|
||||
query_addrrset(client, &fname, &rdataset,
|
||||
sigrdatasetp, dbuf,
|
||||
DNS_SECTION_AUTHORITY);
|
||||
client->query.gluedb = NULL;
|
||||
} else {
|
||||
/*
|
||||
@@ -2739,6 +2714,8 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
/*
|
||||
* Recurse!
|
||||
*/
|
||||
count_query(zone, is_zone,
|
||||
dns_statscounter_recursion);
|
||||
if (type == dns_rdatatype_key)
|
||||
result = query_recurse(client, qtype,
|
||||
NULL, NULL);
|
||||
@@ -2748,16 +2725,20 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
if (result == ISC_R_SUCCESS)
|
||||
client->query.attributes |=
|
||||
NS_QUERYATTR_RECURSING;
|
||||
else
|
||||
else {
|
||||
count_query(zone, is_zone,
|
||||
dns_statscounter_failure);
|
||||
QUERY_ERROR(DNS_R_SERVFAIL);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* This is the best answer.
|
||||
*/
|
||||
count_query(zone, is_zone,
|
||||
dns_statscounter_referral);
|
||||
client->query.gluedb = zdb;
|
||||
client->query.attributes |=
|
||||
NS_QUERYATTR_CACHEGLUEOK;
|
||||
client->query.gluedb = zdb;
|
||||
client->query.isreferral = ISC_TRUE;
|
||||
/*
|
||||
* We must ensure NOADDITIONAL is off,
|
||||
* because the generation of
|
||||
@@ -2781,6 +2762,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
goto cleanup;
|
||||
case DNS_R_NXRRSET:
|
||||
INSIST(is_zone);
|
||||
count_query(zone, is_zone, dns_statscounter_nxrrset);
|
||||
if (dns_rdataset_isassociated(rdataset)) {
|
||||
/*
|
||||
* If we've got a NXT record, we need to save the
|
||||
@@ -2801,6 +2783,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
*/
|
||||
result = query_addsoa(client, db, ISC_FALSE);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
count_query(zone, is_zone, dns_statscounter_failure);
|
||||
QUERY_ERROR(result);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -2816,6 +2799,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
goto cleanup;
|
||||
case DNS_R_NXDOMAIN:
|
||||
INSIST(is_zone);
|
||||
count_query(zone, is_zone, dns_statscounter_nxdomain);
|
||||
if (dns_rdataset_isassociated(rdataset)) {
|
||||
/*
|
||||
* If we've got a NXT record, we need to save the
|
||||
@@ -2842,6 +2826,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
else
|
||||
result = query_addsoa(client, db, ISC_FALSE);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
count_query(zone, is_zone, dns_statscounter_failure);
|
||||
QUERY_ERROR(result);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -2860,8 +2845,13 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
client->message->rcode = dns_rcode_nxdomain;
|
||||
goto cleanup;
|
||||
case DNS_R_NCACHENXDOMAIN:
|
||||
INSIST(!is_zone);
|
||||
count_query(NULL, is_zone, dns_statscounter_nxdomain);
|
||||
goto ncachenxrrset;
|
||||
case DNS_R_NCACHENXRRSET:
|
||||
INSIST(!is_zone);
|
||||
count_query(NULL, is_zone, dns_statscounter_nxrrset);
|
||||
ncachenxrrset:
|
||||
authoritative = ISC_FALSE;
|
||||
/*
|
||||
* Set message rcode, if required.
|
||||
@@ -3034,7 +3024,8 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
*/
|
||||
dns_name_init(tname, NULL);
|
||||
query_addcnamelike(client, client->query.qname, fname,
|
||||
0, &tname, dns_rdatatype_cname);
|
||||
trdataset->ttl, &tname,
|
||||
dns_rdatatype_cname);
|
||||
if (tname != NULL)
|
||||
dns_message_puttempname(client->message, &tname);
|
||||
/*
|
||||
@@ -3049,6 +3040,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
/*
|
||||
* Something has gone wrong.
|
||||
*/
|
||||
count_query(zone, is_zone, dns_statscounter_failure);
|
||||
QUERY_ERROR(DNS_R_SERVFAIL);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -3062,6 +3054,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
rdsiter = NULL;
|
||||
result = dns_db_allrdatasets(db, node, version, 0, &rdsiter);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
count_query(zone, is_zone, dns_statscounter_failure);
|
||||
QUERY_ERROR(DNS_R_SERVFAIL);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -3137,11 +3130,14 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
/*
|
||||
* Something went wrong.
|
||||
*/
|
||||
count_query(zone, is_zone,
|
||||
dns_statscounter_failure);
|
||||
result = DNS_R_SERVFAIL;
|
||||
}
|
||||
}
|
||||
dns_rdatasetiter_destroy(&rdsiter);
|
||||
if (result != ISC_R_NOMORE) {
|
||||
count_query(zone, is_zone, dns_statscounter_failure);
|
||||
QUERY_ERROR(DNS_R_SERVFAIL);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -3237,7 +3233,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
* or if the client requested recursion and thus wanted
|
||||
* the complete answer, send an error response.
|
||||
*/
|
||||
query_error(client, eresult);
|
||||
ns_client_error(client, eresult);
|
||||
ns_client_detach(&client);
|
||||
} else if (!RECURSING(client)) {
|
||||
/*
|
||||
@@ -3252,7 +3248,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
|
||||
client->view->auth_nxdomain == ISC_TRUE)
|
||||
client->message->flags |= DNS_MESSAGEFLAG_AA;
|
||||
|
||||
query_send(client);
|
||||
ns_client_send(client);
|
||||
ns_client_detach(&client);
|
||||
}
|
||||
CTRACE("query_find: done");
|
||||
@@ -3292,7 +3288,7 @@ ns_query_start(ns_client_t *client) {
|
||||
/*
|
||||
* Ensure that appropriate cleanups occur.
|
||||
*/
|
||||
client->next = query_next_callback;
|
||||
client->next = query_next;
|
||||
|
||||
if ((message->flags & DNS_MESSAGEFLAG_RD) != 0)
|
||||
client->query.attributes |= NS_QUERYATTR_WANTRECURSION;
|
||||
@@ -3329,7 +3325,7 @@ ns_query_start(ns_client_t *client) {
|
||||
*/
|
||||
result = dns_message_firstname(message, DNS_SECTION_QUESTION);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
query_error(client, result);
|
||||
ns_client_error(client, result);
|
||||
return;
|
||||
}
|
||||
dns_message_currentname(message, DNS_SECTION_QUESTION,
|
||||
@@ -3342,9 +3338,9 @@ ns_query_start(ns_client_t *client) {
|
||||
* There's more than one QNAME in the question
|
||||
* section.
|
||||
*/
|
||||
query_error(client, DNS_R_FORMERR);
|
||||
ns_client_error(client, DNS_R_FORMERR);
|
||||
} else
|
||||
query_error(client, result);
|
||||
ns_client_error(client, result);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3355,7 +3351,7 @@ ns_query_start(ns_client_t *client) {
|
||||
* Check for multiple question queries, since edns1 is dead.
|
||||
*/
|
||||
if (message->counts[DNS_SECTION_QUESTION] > 1) {
|
||||
query_error(client, DNS_R_FORMERR);
|
||||
ns_client_error(client, DNS_R_FORMERR);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3375,19 +3371,19 @@ ns_query_start(ns_client_t *client) {
|
||||
return;
|
||||
case dns_rdatatype_maila:
|
||||
case dns_rdatatype_mailb:
|
||||
query_error(client, DNS_R_NOTIMP);
|
||||
ns_client_error(client, DNS_R_NOTIMP);
|
||||
return;
|
||||
case dns_rdatatype_tkey:
|
||||
result = dns_tkey_processquery(client->message,
|
||||
ns_g_server->tkeyctx,
|
||||
client->view->dynamickeys);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
query_send(client);
|
||||
ns_client_send(client);
|
||||
else
|
||||
query_error(client, result);
|
||||
ns_client_error(client, result);
|
||||
return;
|
||||
default: /* TSIG, etc. */
|
||||
query_error(client, DNS_R_FORMERR);
|
||||
ns_client_error(client, DNS_R_FORMERR);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -3409,7 +3405,7 @@ ns_query_start(ns_client_t *client) {
|
||||
*/
|
||||
result = dns_message_reply(message, ISC_TRUE);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
query_next(client, result);
|
||||
ns_client_next(client, result);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3678,9 +3674,9 @@ synth_fwd_respond(ns_client_t *client, dns_adbfind_t *find) {
|
||||
static void
|
||||
synth_finish(ns_client_t *client, isc_result_t result) {
|
||||
if (result == ISC_R_SUCCESS)
|
||||
query_send(client);
|
||||
ns_client_send(client);
|
||||
else
|
||||
query_error(client, result);
|
||||
ns_client_error(client, result);
|
||||
ns_client_detach(&client);
|
||||
}
|
||||
|
||||
|
||||
+9
-19
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1999-2002 Internet Software Consortium.
|
||||
* Copyright (C) 1999-2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: server.c,v 1.339.2.4 2002/02/08 03:57:13 marka Exp $ */
|
||||
/* $Id: server.c,v 1.339.2.1 2001/09/28 05:35:47 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -1088,10 +1088,7 @@ configure_forward(cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
|
||||
/*
|
||||
* Determine which port to send forwarded requests to.
|
||||
*/
|
||||
if (ns_g_lwresdonly && ns_g_port != 0)
|
||||
port = ns_g_port;
|
||||
else
|
||||
CHECKM(ns_config_getport(config, &port), "port");
|
||||
CHECKM(ns_config_getport(config, &port), "port");
|
||||
|
||||
if (forwarders != NULL) {
|
||||
portobj = cfg_tuple_get(forwarders, "port");
|
||||
@@ -1730,10 +1727,7 @@ load_configuration(const char *filename, ns_server_t *server,
|
||||
/*
|
||||
* Determine which port to use for listening for incoming connections.
|
||||
*/
|
||||
if (ns_g_port != 0)
|
||||
listen_port = ns_g_port;
|
||||
else
|
||||
CHECKM(ns_config_getport(config, &listen_port), "port");
|
||||
CHECKM(ns_config_getport(config, &listen_port), "port");
|
||||
|
||||
/*
|
||||
* Configure the interface manager according to the "listen-on"
|
||||
@@ -2677,13 +2671,9 @@ ns_listenelt_fromconfig(cfg_obj_t *listener, cfg_obj_t *config,
|
||||
|
||||
portobj = cfg_tuple_get(listener, "port");
|
||||
if (!cfg_obj_isuint32(portobj)) {
|
||||
if (ns_g_port != 0) {
|
||||
port = ns_g_port;
|
||||
} else {
|
||||
result = ns_config_getport(config, &port);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
}
|
||||
result = ns_config_getport(config, &port);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
} else {
|
||||
if (cfg_obj_asuint32(portobj) >= ISC_UINT16_MAX) {
|
||||
cfg_obj_log(portobj, ns_g_lctx, ISC_LOG_ERROR,
|
||||
@@ -2861,7 +2851,7 @@ ns_server_flushcache(ns_server_t *server, char *args) {
|
||||
isc_result_t
|
||||
ns_server_status(ns_server_t *server, isc_buffer_t *text) {
|
||||
int zonecount, xferrunning, xferdeferred, soaqueries;
|
||||
unsigned int n;
|
||||
int n;
|
||||
|
||||
zonecount = dns_zonemgr_getcount(server->zonemgr, DNS_ZONESTATE_ANY);
|
||||
xferrunning = dns_zonemgr_getcount(server->zonemgr,
|
||||
@@ -2881,7 +2871,7 @@ ns_server_status(ns_server_t *server, isc_buffer_t *text) {
|
||||
"server is up and running",
|
||||
zonecount, ns_g_debuglevel, xferrunning, xferdeferred,
|
||||
soaqueries, server->log_queries ? "ON" : "OFF");
|
||||
if (n >= isc_buffer_availablelength(text))
|
||||
if (n < 0)
|
||||
return (ISC_R_NOSPACE);
|
||||
isc_buffer_add(text, n);
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
+8
-13
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1999-2002 Internet Software Consortium.
|
||||
* Copyright (C) 1999-2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: update.c,v 1.88.2.3 2002/02/08 03:57:15 marka Exp $ */
|
||||
/* $Id: update.c,v 1.88 2001/05/31 10:37:58 tale Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -151,10 +151,6 @@ static void forward_done(isc_task_t *task, isc_event_t *event);
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
static void
|
||||
update_log(ns_client_t *client, dns_zone_t *zone,
|
||||
int level, const char *fmt, ...) ISC_FORMAT_PRINTF(4, 5);
|
||||
|
||||
static void
|
||||
update_log(ns_client_t *client, dns_zone_t *zone,
|
||||
int level, const char *fmt, ...)
|
||||
@@ -1417,7 +1413,6 @@ next_active(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *oldname,
|
||||
|
||||
/*
|
||||
* Add a NXT record for "name", recording the change in "diff".
|
||||
* The existing NXT is removed.
|
||||
*/
|
||||
static isc_result_t
|
||||
add_nxt(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name, dns_diff_t *diff)
|
||||
@@ -1433,6 +1428,7 @@ add_nxt(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name, dns_diff_t *diff)
|
||||
dns_fixedname_init(&fixedname);
|
||||
target = dns_fixedname_name(&fixedname);
|
||||
|
||||
|
||||
/*
|
||||
* Find the successor name, aka NXT target.
|
||||
*/
|
||||
@@ -1447,12 +1443,7 @@ add_nxt(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name, dns_diff_t *diff)
|
||||
dns_db_detachnode(db, &node);
|
||||
|
||||
/*
|
||||
* Delete the old NXT and record the change.
|
||||
*/
|
||||
CHECK(delete_if(true_p, db, ver, name, dns_rdatatype_nxt, 0,
|
||||
NULL, diff));
|
||||
/*
|
||||
* Add the new NXT and record the change.
|
||||
* Create a diff tuple, update the database, and record the change.
|
||||
*/
|
||||
CHECK(dns_difftuple_create(diff->mctx, DNS_DIFFOP_ADD, name,
|
||||
3600, /* XXXRTH */
|
||||
@@ -1803,6 +1794,9 @@ update_signatures(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *oldver,
|
||||
* there is other data, and if there is other data,
|
||||
* there are other SIGs.
|
||||
*/
|
||||
CHECK(delete_if(true_p, db, newver, &t->name,
|
||||
dns_rdatatype_nxt, 0,
|
||||
NULL, &nxt_diff));
|
||||
CHECK(add_nxt(db, newver, &t->name, &nxt_diff));
|
||||
}
|
||||
}
|
||||
@@ -2413,6 +2407,7 @@ update_action(isc_task_t *task, isc_event_t *event) {
|
||||
}
|
||||
|
||||
if (dns_db_issecure(db)) {
|
||||
|
||||
result = update_signatures(mctx, db, oldver, ver,
|
||||
&diff, dns_zone_getsigvalidityinterval(zone));
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
|
||||
@@ -296,7 +296,7 @@ The newly-added record has a 1 day TTL (86400 seconds)
|
||||
.nf
|
||||
# nsupdate
|
||||
> prereq nxdomain nickname.example.com
|
||||
> update add nickname.example.com 86400 CNAME somehost.example.com
|
||||
> update add nickname.example.com CNAME somehost.example.com
|
||||
>
|
||||
.sp
|
||||
.fi
|
||||
|
||||
+16
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2000-2002 Internet Software Consortium.
|
||||
* Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: nsupdate.c,v 1.103.2.9 2002/02/08 03:57:18 marka Exp $ */
|
||||
/* $Id: nsupdate.c,v 1.103.2.6 2001/11/06 21:50:35 bwelling Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -1101,7 +1101,7 @@ static isc_uint16_t
|
||||
update_addordelete(char *cmdline, isc_boolean_t isdelete) {
|
||||
isc_result_t result;
|
||||
dns_name_t *name = NULL;
|
||||
unsigned long ttl;
|
||||
long ttl;
|
||||
char *word;
|
||||
dns_rdataclass_t rdataclass;
|
||||
dns_rdatatype_t rdatatype;
|
||||
@@ -1147,20 +1147,29 @@ update_addordelete(char *cmdline, isc_boolean_t isdelete) {
|
||||
goto doneparsing;
|
||||
}
|
||||
}
|
||||
ttl = strtoul(word, &endp, 10);
|
||||
if (!isdigit((unsigned char)*word) || *endp != '\0') {
|
||||
errno = 0;
|
||||
ttl = strtol(word, &endp, 0);
|
||||
if (*endp != '\0') {
|
||||
if (isdelete) {
|
||||
ttl = 0;
|
||||
goto parseclass;
|
||||
} else {
|
||||
fprintf(stderr, "ttl '%s' is not legal\n", word);
|
||||
fprintf(stderr, "ttl '%s' is not numeric\n", word);
|
||||
goto failure;
|
||||
}
|
||||
}
|
||||
|
||||
if (isdelete)
|
||||
ttl = 0;
|
||||
else if (ttl > TTL_MAX) {
|
||||
else if (ttl < 0 || ttl > TTL_MAX ||
|
||||
(ttl == LONG_MAX && errno == ERANGE))
|
||||
{
|
||||
/*
|
||||
* The errno test is needed to catch when strtol()
|
||||
* overflows on a platform where sizeof(int) ==
|
||||
* sizeof(long), because ttl will be set to LONG_MAX,
|
||||
* which will be equal to TTL_MAX.
|
||||
*/
|
||||
fprintf(stderr, "ttl '%s' is out of range (0 to %d)\n",
|
||||
word, TTL_MAX);
|
||||
goto failure;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: nsupdate.docbook,v 1.8.2.1 2001/11/27 18:57:40 gson Exp $ -->
|
||||
<!-- $Id: nsupdate.docbook,v 1.8 2001/07/14 18:30:01 bwelling Exp $ -->
|
||||
|
||||
<refentry>
|
||||
<refentryinfo>
|
||||
@@ -463,7 +463,7 @@ The newly-added record has a 1 day TTL (86400 seconds)
|
||||
<programlisting>
|
||||
# nsupdate
|
||||
> prereq nxdomain nickname.example.com
|
||||
> update add nickname.example.com 86400 CNAME somehost.example.com
|
||||
> update add nickname.example.com CNAME somehost.example.com
|
||||
>
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
@@ -801,7 +801,7 @@ The newly-added record has a 1 day TTL (86400 seconds)
|
||||
CLASS="PROGRAMLISTING"
|
||||
># nsupdate
|
||||
> prereq nxdomain nickname.example.com
|
||||
> update add nickname.example.com 86400 CNAME somehost.example.com
|
||||
> update add nickname.example.com CNAME somehost.example.com
|
||||
></PRE
|
||||
></P
|
||||
><P
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
.\" Copyright (C) 2001 Internet Software Consortium.
|
||||
.\"
|
||||
.\" Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and distribute this software for any
|
||||
.\" purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -13,8 +14,6 @@
|
||||
.\" NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
.\" WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
.\"
|
||||
.\" $Id: rndc-confgen.8,v 1.3.2.1 2002/02/08 03:57:20 marka Exp $
|
||||
|
||||
.TH "RNDC-CONFGEN" "8" "Aug 27, 2001" "BIND9" ""
|
||||
.SH NAME
|
||||
rndc-confgen \- rndc key generation tool
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: rndc-confgen.c,v 1.9.2.4 2001/11/30 01:10:09 gson Exp $ */
|
||||
/* $Id: rndc-confgen.c,v 1.9.2.1 2001/09/06 00:14:16 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -66,7 +66,7 @@ Usage:\n\
|
||||
[-s addr] [-t chrootdir] [-u user]\n\
|
||||
-a: generate just the key clause and write it to keyfile (%s)\n\
|
||||
-b bits: from 1 through 512, default %d; total length of the secret\n\
|
||||
-c keyfile: specify an alternate key file (requires -a)\n\
|
||||
-c keyfile: specify a alterate keyfile (requires -a)\n\
|
||||
-k keyname: the name as it will be used in named.conf and rndc.conf\n\
|
||||
-p port: the port named will listen on and rndc will connect to\n\
|
||||
-r randomfile: a file containing random data\n\
|
||||
@@ -139,8 +139,7 @@ main(int argc, char **argv) {
|
||||
int keysize;
|
||||
int entropy_flags = 0;
|
||||
int open_keyboard = ISC_ENTROPY_KEYBOARDMAYBE;
|
||||
struct in_addr addr4_dummy;
|
||||
struct in6_addr addr6_dummy;
|
||||
struct in_addr addr;
|
||||
char *chrootdir = NULL;
|
||||
char *user = NULL;
|
||||
isc_boolean_t keyonly = ISC_FALSE;
|
||||
@@ -198,9 +197,9 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
case 's':
|
||||
serveraddr = isc_commandline_argument;
|
||||
if (inet_pton(AF_INET, serveraddr, &addr4_dummy) != 1 &&
|
||||
inet_pton(AF_INET6, serveraddr, &addr6_dummy) != 1)
|
||||
if (inet_aton(serveraddr, &addr) == 0)
|
||||
fatal("-s should be an IPv4 or IPv6 address");
|
||||
|
||||
break;
|
||||
case 't':
|
||||
chrootdir = isc_commandline_argument;
|
||||
@@ -280,9 +279,8 @@ main(int argc, char **argv) {
|
||||
char *buf;
|
||||
len = strlen(chrootdir) + strlen(keyfile) + 2;
|
||||
buf = isc_mem_get(mctx, len);
|
||||
if (buf == NULL) {
|
||||
fprintf(stderr, "isc_mem_get(%d) failed\n",
|
||||
len);
|
||||
if (buf != NULL) {
|
||||
fprintf(stderr, "isc_mem_get(%d) failed\n", len);
|
||||
goto cleanup;
|
||||
}
|
||||
snprintf(buf, len, "%s/%s", chrootdir, keyfile);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<!--
|
||||
- Copyright (C) 2001 Internet Software Consortium.
|
||||
-
|
||||
- Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
-
|
||||
- Permission to use, copy, modify, and distribute this software for any
|
||||
- purpose with or without fee is hereby granted, provided that the above
|
||||
- copyright notice and this permission notice appear in all copies.
|
||||
-
|
||||
-
|
||||
- THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
||||
- DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||
@@ -14,9 +14,6 @@
|
||||
- NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: rndc-confgen.html,v 1.3.2.1 2002/02/08 03:57:21 marka Exp $ -->
|
||||
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
|
||||
+2
-3
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: rndc.c,v 1.77.2.2 2001/11/28 23:37:50 gson Exp $ */
|
||||
/* $Id: rndc.c,v 1.77.2.1 2001/10/17 18:26:01 gson Exp $ */
|
||||
|
||||
/*
|
||||
* Principal Author: DCL
|
||||
@@ -89,8 +89,7 @@ static isc_socket_t *sock = NULL;
|
||||
static void
|
||||
usage(int status) {
|
||||
fprintf(stderr, "\
|
||||
Usage: %s [-c config] [-s server] [-p port]\n\
|
||||
[-k key-file ] [-y key] [-V] command\n\
|
||||
Usage: %s [-c config] [-s server] [-p port] [-y key] [-V] command\n\
|
||||
\n\
|
||||
command is one of the following:\n\
|
||||
\n\
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1998-2002 Internet Software Consortium.
|
||||
* Copyright (C) 1998-2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: printmsg.c,v 1.25.2.2 2002/02/08 03:57:23 marka Exp $ */
|
||||
/* $Id: printmsg.c,v 1.25 2001/05/09 18:47:49 bwelling Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -51,7 +51,7 @@ static const char *rcodetext[] = {
|
||||
"FORMERR",
|
||||
"SERVFAIL",
|
||||
"NXDOMAIN",
|
||||
"NOTIMP",
|
||||
"NOTIMPL",
|
||||
"REFUSED",
|
||||
"YXDOMAIN",
|
||||
"YXRRSET",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# From configure.in Revision: 1.294.2.7
|
||||
# From configure.in Revision: 1.294.2.6
|
||||
|
||||
# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
|
||||
## Copyright 1996, 1997, 1998, 1999, 2000, 2001
|
||||
@@ -8624,41 +8624,62 @@ rm -f conftest*
|
||||
#
|
||||
# Check for some other useful functions that are not ever-present.
|
||||
#
|
||||
|
||||
# We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
|
||||
# because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
|
||||
# reportedly defines strsep() without declaring it in <string.h> when
|
||||
# -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
|
||||
# AC_CHECK_FUNC() incorrectly succeeds because it declares
|
||||
# the function itself.
|
||||
echo $ac_n "checking for correctly declared strsep()""... $ac_c" 1>&6
|
||||
echo "configure:8636: checking for correctly declared strsep()" >&5
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8638 "configure"
|
||||
echo $ac_n "checking for strsep""... $ac_c" 1>&6
|
||||
echo "configure:8629: checking for strsep" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_strsep'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8634 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <string.h>
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char strsep(); below. */
|
||||
#include <assert.h>
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char strsep();
|
||||
|
||||
int main() {
|
||||
char *sp; char *foo = strsep(&sp, ".");
|
||||
|
||||
/* The GNU C library defines this for functions which it implements
|
||||
to always fail with ENOSYS. Some functions are actually named
|
||||
something starting with __ and the normal name is an alias. */
|
||||
#if defined (__stub_strsep) || defined (__stub___strsep)
|
||||
choke me
|
||||
#else
|
||||
strsep();
|
||||
#endif
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:8645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:8657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
echo "$ac_t""yes" 1>&6; ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"
|
||||
eval "ac_cv_func_strsep=yes"
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
echo "$ac_t""no" 1>&6; ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"
|
||||
eval "ac_cv_func_strsep=no"
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
|
||||
if eval "test \"`echo '$ac_cv_func_'strsep`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for vsnprintf""... $ac_c" 1>&6
|
||||
echo "configure:8657: checking for vsnprintf" >&5
|
||||
echo "configure:8678: checking for vsnprintf" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_vsnprintf'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8662 "configure"
|
||||
#line 8683 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char vsnprintf(); below. */
|
||||
@@ -8681,7 +8702,7 @@ vsnprintf();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:8685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:8706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_vsnprintf=yes"
|
||||
else
|
||||
@@ -8706,12 +8727,12 @@ fi
|
||||
|
||||
|
||||
echo $ac_n "checking for strerror""... $ac_c" 1>&6
|
||||
echo "configure:8710: checking for strerror" >&5
|
||||
echo "configure:8731: checking for strerror" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8715 "configure"
|
||||
#line 8736 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char strerror(); below. */
|
||||
@@ -8734,7 +8755,7 @@ strerror();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:8738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:8759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_strerror=yes"
|
||||
else
|
||||
@@ -8768,17 +8789,17 @@ fi
|
||||
# but that's defined elsewhere since we don't use configure on Win32.
|
||||
#
|
||||
echo $ac_n "checking printf format modifier for 64-bit integers""... $ac_c" 1>&6
|
||||
echo "configure:8772: checking printf format modifier for 64-bit integers" >&5
|
||||
echo "configure:8793: checking printf format modifier for 64-bit integers" >&5
|
||||
if test "$cross_compiling" = yes; then
|
||||
echo "$ac_t""assuming target platform uses ll" 1>&6
|
||||
ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8778 "configure"
|
||||
#line 8799 "configure"
|
||||
#include "confdefs.h"
|
||||
main() { exit(!(sizeof(long long int) == sizeof(long int))); }
|
||||
EOF
|
||||
if { (eval echo configure:8782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
|
||||
if { (eval echo configure:8803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
echo "$ac_t""l" 1>&6
|
||||
ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
|
||||
@@ -8798,12 +8819,12 @@ fi
|
||||
# Security Stuff
|
||||
#
|
||||
echo $ac_n "checking for chroot""... $ac_c" 1>&6
|
||||
echo "configure:8802: checking for chroot" >&5
|
||||
echo "configure:8823: checking for chroot" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_chroot'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8807 "configure"
|
||||
#line 8828 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char chroot(); below. */
|
||||
@@ -8826,7 +8847,7 @@ chroot();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:8830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:8851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_chroot=yes"
|
||||
else
|
||||
@@ -8860,17 +8881,17 @@ case "$enable_linux_caps" in
|
||||
do
|
||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||
echo "configure:8864: checking for $ac_hdr" >&5
|
||||
echo "configure:8885: checking for $ac_hdr" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8869 "configure"
|
||||
#line 8890 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$ac_hdr>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:8874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:8895: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
@@ -8904,17 +8925,17 @@ for ac_hdr in sys/prctl.h
|
||||
do
|
||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||
echo "configure:8908: checking for $ac_hdr" >&5
|
||||
echo "configure:8929: checking for $ac_hdr" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8913 "configure"
|
||||
#line 8934 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$ac_hdr>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:8918: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:8939: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
@@ -8945,9 +8966,9 @@ done
|
||||
# BSD/OS, and perhaps some others, don't define rlim_t.
|
||||
#
|
||||
echo $ac_n "checking for type rlim_t""... $ac_c" 1>&6
|
||||
echo "configure:8949: checking for type rlim_t" >&5
|
||||
echo "configure:8970: checking for type rlim_t" >&5
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8951 "configure"
|
||||
#line 8972 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -8957,7 +8978,7 @@ int main() {
|
||||
rlim_t rl = 19671212; return (0);
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:8961: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:8982: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
echo "$ac_t""yes" 1>&6
|
||||
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"
|
||||
@@ -8968,44 +8989,23 @@ else
|
||||
echo "$ac_t""no" 1>&6
|
||||
|
||||
echo $ac_n "checking type of rlim_cur""... $ac_c" 1>&6
|
||||
echo "configure:8972: checking type of rlim_cur" >&5
|
||||
echo "configure:8993: checking type of rlim_cur" >&5
|
||||
if test "$cross_compiling" = yes; then
|
||||
{ echo "configure: error: cannot determine type of rlim_cur when cross compiling - define rlim_t" 1>&2; exit 1; }
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8977 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}
|
||||
EOF
|
||||
if { (eval echo configure:8985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
echo "$ac_t""int" 1>&6
|
||||
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -fr conftest*
|
||||
|
||||
if test "$cross_compiling" = yes; then
|
||||
{ echo "configure: error: this cannot happen" 1>&2; exit 1; }
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8998 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}
|
||||
main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}
|
||||
EOF
|
||||
if { (eval echo configure:9006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
echo "$ac_t""long int" 1>&6
|
||||
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"
|
||||
echo "$ac_t""int" 1>&6
|
||||
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
@@ -9021,9 +9021,30 @@ else
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}
|
||||
main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}
|
||||
EOF
|
||||
if { (eval echo configure:9027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
echo "$ac_t""long int" 1>&6
|
||||
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -fr conftest*
|
||||
|
||||
if test "$cross_compiling" = yes; then
|
||||
{ echo "configure: error: this cannot happen" 1>&2; exit 1; }
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 9040 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}
|
||||
EOF
|
||||
if { (eval echo configure:9048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
echo "$ac_t""long long int" 1>&6
|
||||
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"
|
||||
@@ -9147,7 +9168,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:9151: checking for $ac_word" >&5
|
||||
echo "configure:9172: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_OPENJADE'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -9194,7 +9215,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:9198: checking for $ac_word" >&5
|
||||
echo "configure:9219: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_JADETEX'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -9237,7 +9258,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:9241: checking for $ac_word" >&5
|
||||
echo "configure:9262: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_PDFJADETEX'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -9293,7 +9314,7 @@ test -n "$PDFJADETEX" || PDFJADETEX="pdfjadetex"
|
||||
|
||||
SGMLCATALOG=""
|
||||
echo $ac_n "checking for catalog""... $ac_c" 1>&6
|
||||
echo "configure:9297: checking for catalog" >&5
|
||||
echo "configure:9318: checking for catalog" >&5
|
||||
for d in $sgmltrees
|
||||
do
|
||||
f=$d/catalog
|
||||
@@ -9335,7 +9356,7 @@ done
|
||||
|
||||
HTMLSTYLE=""
|
||||
echo $ac_n "checking for html/docbook.dsl""... $ac_c" 1>&6
|
||||
echo "configure:9339: checking for html/docbook.dsl" >&5
|
||||
echo "configure:9360: checking for html/docbook.dsl" >&5
|
||||
for d in $stylepath
|
||||
do
|
||||
f=$d/html/docbook.dsl
|
||||
@@ -9356,7 +9377,7 @@ fi
|
||||
|
||||
PRINTSTYLE=""
|
||||
echo $ac_n "checking for print/docbook.dsl""... $ac_c" 1>&6
|
||||
echo "configure:9360: checking for print/docbook.dsl" >&5
|
||||
echo "configure:9381: checking for print/docbook.dsl" >&5
|
||||
for d in $stylepath
|
||||
do
|
||||
f=$d/print/docbook.dsl
|
||||
@@ -9382,7 +9403,7 @@ fi
|
||||
|
||||
XMLDCL=""
|
||||
echo $ac_n "checking for docbook/dsssl/modular/dtds/decls/xml.dcl""... $ac_c" 1>&6
|
||||
echo "configure:9386: checking for docbook/dsssl/modular/dtds/decls/xml.dcl" >&5
|
||||
echo "configure:9407: checking for docbook/dsssl/modular/dtds/decls/xml.dcl" >&5
|
||||
for d in $sgmltrees
|
||||
do
|
||||
f=$d/docbook/dsssl/modular/dtds/decls/xml.dcl
|
||||
@@ -9408,7 +9429,7 @@ fi
|
||||
|
||||
DOCBOOK2MANSPEC=""
|
||||
echo $ac_n "checking for docbook2X/docbook2man-spec.pl""... $ac_c" 1>&6
|
||||
echo "configure:9412: checking for docbook2X/docbook2man-spec.pl" >&5
|
||||
echo "configure:9433: checking for docbook2X/docbook2man-spec.pl" >&5
|
||||
for d in $sgmltrees
|
||||
do
|
||||
f=$d/docbook2X/docbook2man-spec.pl
|
||||
|
||||
+4
-13
@@ -13,7 +13,7 @@
|
||||
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
AC_REVISION($Revision: 1.294.2.7 $)
|
||||
AC_REVISION($Revision: 1.294.2.6 $)
|
||||
|
||||
AC_INIT(lib/dns/name.c)
|
||||
AC_PREREQ(2.13)
|
||||
@@ -1348,18 +1348,9 @@ found_rt_iflist
|
||||
#
|
||||
# Check for some other useful functions that are not ever-present.
|
||||
#
|
||||
|
||||
# We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
|
||||
# because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
|
||||
# reportedly defines strsep() without declaring it in <string.h> when
|
||||
# -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
|
||||
# AC_CHECK_FUNC() incorrectly succeeds because it declares
|
||||
# the function itself.
|
||||
AC_MSG_CHECKING(for correctly declared strsep())
|
||||
AC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
|
||||
[AC_MSG_RESULT(yes); ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
|
||||
[AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
|
||||
|
||||
AC_CHECK_FUNC(strsep,
|
||||
[ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
|
||||
[ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
|
||||
AC_CHECK_FUNC(vsnprintf,
|
||||
[ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"],
|
||||
[ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS print.$O"
|
||||
|
||||
@@ -1,200 +0,0 @@
|
||||
# $Id: DISTFILES,v 1.1 2002/02/08 05:38:30 marka Exp $
|
||||
README
|
||||
README.ja
|
||||
INSTALL
|
||||
INSTALL.ja
|
||||
ChangeLog
|
||||
DISTFILES
|
||||
LICENSE.txt
|
||||
Makefile.in
|
||||
NEWS
|
||||
make.wnt
|
||||
acconfig.h
|
||||
aclocal.m4
|
||||
config.guess
|
||||
config.sub
|
||||
ltconfig
|
||||
ltmain.sh
|
||||
configure.in
|
||||
configure
|
||||
install-sh
|
||||
mkinstalldirs
|
||||
include/Makefile.in
|
||||
include/config.h.in
|
||||
include/config.h.win
|
||||
include/mdn/Makefile.in
|
||||
include/mdn/ace.h
|
||||
include/mdn/altdude.h
|
||||
include/mdn/amcacem.h
|
||||
include/mdn/amcaceo.h
|
||||
include/mdn/amcacer.h
|
||||
include/mdn/amcacev.h
|
||||
include/mdn/amcacew.h
|
||||
include/mdn/amcacez.h
|
||||
include/mdn/api.h
|
||||
include/mdn/assert.h
|
||||
include/mdn/brace.h
|
||||
include/mdn/checker.h
|
||||
include/mdn/converter.h
|
||||
include/mdn/debug.h
|
||||
include/mdn/delimitermap.h
|
||||
include/mdn/dn.h
|
||||
include/mdn/dude.h
|
||||
include/mdn/filechecker.h
|
||||
include/mdn/filemapper.h
|
||||
include/mdn/lace.h
|
||||
include/mdn/localencoding.h
|
||||
include/mdn/log.h
|
||||
include/mdn/logmacro.h
|
||||
include/mdn/mace.h
|
||||
include/mdn/mapper.h
|
||||
include/mdn/mapselector.h
|
||||
include/mdn/msgheader.h
|
||||
include/mdn/msgtrans.h
|
||||
include/mdn/nameprep.h
|
||||
include/mdn/normalizer.h
|
||||
include/mdn/race.h
|
||||
include/mdn/res.h
|
||||
include/mdn/resconf.h
|
||||
include/mdn/result.h
|
||||
include/mdn/selectiveencode.h
|
||||
include/mdn/strhash.h
|
||||
include/mdn/ucsmap.h
|
||||
include/mdn/ucsset.h
|
||||
include/mdn/unicode.h
|
||||
include/mdn/unormalize.h
|
||||
include/mdn/utf5.h
|
||||
include/mdn/utf6.h
|
||||
include/mdn/utf8.h
|
||||
include/mdn/util.h
|
||||
include/mdn/version.h
|
||||
lib/Makefile.in
|
||||
lib/ace.c
|
||||
lib/altdude.c
|
||||
lib/amcacem.c
|
||||
lib/amcaceo.c
|
||||
lib/amcacer.c
|
||||
lib/amcacev.c
|
||||
lib/amcacew.c
|
||||
lib/amcacez.c
|
||||
lib/api.c
|
||||
lib/brace.c
|
||||
lib/checker.c
|
||||
lib/converter.c
|
||||
lib/debug.c
|
||||
lib/delimitermap.c
|
||||
lib/dn.c
|
||||
lib/dude.c
|
||||
lib/filechecker.c
|
||||
lib/filemapper.c
|
||||
lib/lace.c
|
||||
lib/localencoding.c
|
||||
lib/log.c
|
||||
lib/make.wnt
|
||||
lib/mace.c
|
||||
lib/mapper.c
|
||||
lib/mapselector.c
|
||||
lib/msgheader.c
|
||||
lib/msgtrans.c
|
||||
lib/nameprep.c
|
||||
lib/nameprep_template.c
|
||||
lib/nameprepdata.c
|
||||
lib/normalizer.c
|
||||
lib/race.c
|
||||
lib/res.c
|
||||
lib/resconf.c
|
||||
lib/result.c
|
||||
lib/selectiveencode.c
|
||||
lib/strhash.c
|
||||
lib/ucsmap.c
|
||||
lib/ucsset.c
|
||||
lib/unicode.c
|
||||
lib/unicode_template.c
|
||||
lib/unicodedata_301.c
|
||||
lib/unicodedata_310.c
|
||||
lib/unormalize.c
|
||||
lib/utf5.c
|
||||
lib/utf6.c
|
||||
lib/utf8.c
|
||||
lib/util.c
|
||||
lib/version.c
|
||||
lib/mdn.conf.sample.in
|
||||
mdnsproxy/Makefile.in
|
||||
mdnsproxy/acl.c
|
||||
mdnsproxy/logging.c
|
||||
mdnsproxy/make.wnt
|
||||
mdnsproxy/mdnsproxy.8.in
|
||||
mdnsproxy/mdnsproxy.conf.sample
|
||||
mdnsproxy/mdnsproxy.def
|
||||
mdnsproxy/mdnsproxy.h
|
||||
mdnsproxy/message.c
|
||||
mdnsproxy/os2main.c
|
||||
mdnsproxy/proxycnf.c
|
||||
mdnsproxy/proxycnf.h
|
||||
mdnsproxy/server.c
|
||||
mdnsproxy/translate.c
|
||||
mdnsproxy/unxmain.c
|
||||
mdnsproxy/winmain.c
|
||||
mdnsproxy/winserv.c
|
||||
mdnsproxy/winserv.h
|
||||
tools/Makefile.in
|
||||
tools/mdnconv/Makefile.in
|
||||
tools/mdnconv/mdnconv.c
|
||||
tools/mdnconv/util.c
|
||||
tools/mdnconv/util.h
|
||||
tools/mdnconv/mdnconv.1
|
||||
tools/mdnconv/mdnslookup.in
|
||||
tools/rpm/mdnsproxy.init
|
||||
tools/rpm/mdnkit.spec
|
||||
tools/runmdn/Makefile.in
|
||||
tools/runmdn/resolver.c
|
||||
tools/runmdn/stub.c
|
||||
tools/runmdn/stub.h
|
||||
tools/runmdn/runmdn.1
|
||||
tools/runmdn/runmdn.in
|
||||
man/Makefile.in
|
||||
man/libmdn.3.in
|
||||
man/mdn.conf.5.in
|
||||
patch/bind8/bind-8.2.3-patch
|
||||
patch/bind9/bind-9.1.3-patch
|
||||
patch/bind9/bind-9.2.0-patch
|
||||
patch/libiconv/libiconv-1.6.1.patch
|
||||
patch/squid/squid-2.4.STABLE1-patch
|
||||
win/README.WIN
|
||||
wsock/README.txt
|
||||
wsock/README_j.txt
|
||||
wsock/make.wnt
|
||||
wsock/common/checkdll.c
|
||||
wsock/common/convert.c
|
||||
wsock/common/dllmain.c
|
||||
wsock/common/dump.c
|
||||
wsock/common/encoding.c
|
||||
wsock/common/hook.c
|
||||
wsock/common/jpnicmdn.def
|
||||
wsock/common/jpnicmdn.h
|
||||
wsock/common/make.wnt
|
||||
wsock/common/printf.c
|
||||
wsock/config/make.wnt
|
||||
wsock/config/mdnconf.tcl
|
||||
wsock/wsock11/dlldef.h
|
||||
wsock/wsock11/dllfunc.c
|
||||
wsock/wsock11/dllload.c
|
||||
wsock/wsock11/dllmain.c
|
||||
wsock/wsock11/dllstub.c
|
||||
wsock/wsock11/make.wnt
|
||||
wsock/wsock11/wsock32.def
|
||||
wsock/wsock11/wsock32o.def
|
||||
wsock/wsock20/dlldef.h
|
||||
wsock/wsock20/dllfunc.c
|
||||
wsock/wsock20/dllload.c
|
||||
wsock/wsock20/dllmain.c
|
||||
wsock/wsock20/dllstub.c
|
||||
wsock/wsock20/make.wnt
|
||||
wsock/wsock20/ws2_32.def
|
||||
wsock/wsock20/ws2_32o.def
|
||||
util/SparseMap.pm
|
||||
util/UCD.pm
|
||||
util/generate_nameprep_data.pl
|
||||
util/generate_normalize_data.pl
|
||||
map/Makefile.in
|
||||
map/jp.map
|
||||
@@ -1,248 +0,0 @@
|
||||
|
||||
mDNkit
|
||||
Compilation and Installation
|
||||
Japan Network Information Center (JPNIC)
|
||||
|
||||
|
||||
This file explains how to compile and install the source package.
|
||||
These procedures take the following steps:
|
||||
|
||||
+ Prerequisite: making iconv() available
|
||||
+ System Configuration: running `configure' script
|
||||
+ Compilation: running `make'
|
||||
+ Installation: running `make install'
|
||||
+ Site Configuration: tailoring `mdn.conf'
|
||||
+ Configuration Check (optional)
|
||||
|
||||
|
||||
0. Prerequisite
|
||||
|
||||
If your system's library does not have iconv() function, which is a
|
||||
general codeset conversion utility, install it as an external library.
|
||||
You also need external library if the system's implementation cannot
|
||||
handle UTF-8 encoding, or it doesn't support some encodings which your
|
||||
client applications uses.
|
||||
|
||||
You can get a free version of iconv() implementation (under LGPL
|
||||
license, aka GNU libiconv) from:
|
||||
|
||||
http://clisp.cons.org/~haible/packages-libiconv.html
|
||||
|
||||
*Note*
|
||||
GNU libiconv-1.6.1 have a compilation problem on NetBSD 1.5. There
|
||||
is a patch file for the bug under patch/libiconv directory. If you
|
||||
are a NetBSD 1.5 user and found a problem in compiling libiconv,
|
||||
apply the patch and try again. The patch file contains brief
|
||||
instructions on how to apply it at the beginning.
|
||||
|
||||
|
||||
1. Running configure script
|
||||
|
||||
Run `configure' script in the top directory. This checks various
|
||||
characteristics of your system and it will create Makefiles and
|
||||
config.h appropriate for your system.
|
||||
|
||||
% ./configure
|
||||
|
||||
`configure' accepts many options. Here is a list of some important
|
||||
options.
|
||||
|
||||
--prefix=PREFIX
|
||||
Specifies the prefix of install directories of mDNkit. The
|
||||
default is /usr/local.
|
||||
|
||||
--with-libiconv=LIBICONV_PREFIX
|
||||
If you have installed GNU libiconv and would like to link it
|
||||
to mDNkit, specify this option. The argument LIBICONV_PREFIX
|
||||
is install prefix of GNU libiconv. If the argument is omitted,
|
||||
PREFIX (derived from --prefix=PREFIX option) is assumed.
|
||||
|
||||
--with-libiconv is shorthand option for GNU libiconv.
|
||||
|
||||
--with-libiconv=/usr/local
|
||||
|
||||
This is equivalent to:
|
||||
|
||||
--with-iconv-include='-I/usr/local/include'
|
||||
--with-iconv='-L/usr/local/lib -R/usr/local/lib -liconv'
|
||||
|
||||
If both the shorthand option (--with-libiconv) and longhand
|
||||
options (--with-iconv-include and/or --with-iconv) are specified,
|
||||
the longhand options have priority.
|
||||
|
||||
--with-iconv-include=ICONV_INCDIR
|
||||
If the header file "iconv.h" resides in a directory where your
|
||||
C compiler doesn't search by default, specify the directory as
|
||||
DIR like this:
|
||||
|
||||
--with-iconv-include=/usr/local/include
|
||||
|
||||
--with-iconv=ICONV_LIB
|
||||
If your libc doesn't contain iconv(), specify the library
|
||||
that contains iconv(). For example, if iconv() is libiconv
|
||||
in /usr/local/lib, you should specify:
|
||||
|
||||
--with-iconv="-L/usr/local/lib -liconv"
|
||||
|
||||
Note that if the library is a shared one, you might also want
|
||||
to specify -R option, like:
|
||||
|
||||
--with-iconv="-L/usr/local/lib -R/usr/local/lib -liconv"
|
||||
|
||||
--with-iconv-sofile=SOFILE_PATH
|
||||
``runmdn'' command in this kit needs to know the pathname of
|
||||
shared library file that contains iconv(), if iconv() is not
|
||||
part of libc. mDNkit tries to find out the pathname from the
|
||||
informaiton provided by ``--with-iconv'' option described
|
||||
above. But when it fails, you have to specify it with this
|
||||
option, like:
|
||||
|
||||
--with-iconv-sofile=/usr/local/lib/libiconv.so.2.0
|
||||
|
||||
--with-utf8=UTF8_NAME
|
||||
If your iconv() (precisely, iconv_open()) does not accept
|
||||
"UTF-8" as the name of UTF-8 encoding, specify the name for
|
||||
it. For example if your iconv() uses "utf8" instead, you
|
||||
should specify:
|
||||
|
||||
--with-utf8=utf8
|
||||
|
||||
|
||||
2. Other configure options
|
||||
|
||||
The configure script has many other options though they are not widely
|
||||
used:
|
||||
|
||||
--with-preference=PREFERENCE
|
||||
This option sets the preference for the sample mDNkit
|
||||
configuration file (mdn.conf.sample). Also this option
|
||||
enables to install default configuration file (mdn.conf)
|
||||
if the file didn't exist.
|
||||
The only preference supported by this version is "jp".
|
||||
|
||||
--with-amc-ace-z-prefix=AMCZ_PREFIX
|
||||
AMC-ACE-Z is a proposed encoding for multilingual domain name
|
||||
in DNS protocol data. It requires a specific prefix string
|
||||
to distinguish domain names encoded by them from normal ASCII
|
||||
domain names, but the current Internet draft of AMC-ACE-Z
|
||||
doesn't define prefix. You can specify the prefix with this
|
||||
option. Otherwise mDNkit defines "zq--" as the prefix.
|
||||
|
||||
--with-race-prefix=RACE_PREFIX
|
||||
--with-dude-prefix=DUDE_PREFIX
|
||||
Also RACE and DUDE are encodings for multilingual domain name,
|
||||
but they are obsolete. Since Internet drafts for these
|
||||
encodings defines ACE prefixes, mDNkit uses them by default,
|
||||
but you can specify prefix with these options.
|
||||
|
||||
--exec-prefix=EXEC_PREFIX
|
||||
Specifies the prefix of install directories for machine-specific
|
||||
files. The default is PREFIX (derived from ``--prefix=PREFIX''
|
||||
and its default is /usr/local).
|
||||
|
||||
--sbindir=SBINDIR
|
||||
Specifies the install directory for mdnsproxy. The default is
|
||||
EXEC_PREFIX/sbin.
|
||||
|
||||
--bindir=BINDIR
|
||||
Specifies the install directory for mdnconv and runmdn.
|
||||
The default is EXEC_PREFIX/bin.
|
||||
|
||||
--libdir=LIBDIR
|
||||
Specifies the install directory for the MDN library (libmdn).
|
||||
The default is EXEC_PREFIX/lib.
|
||||
|
||||
--includedir=INCDIR
|
||||
Specifies the install directory for the header files of the MDN
|
||||
library. The default is PREFIX/include.
|
||||
|
||||
--sysconfdir=SYSCONFDIR
|
||||
Specifies the install directory for sample configuration files
|
||||
of the MDN Library and mdnsproxy. The default is PREFIX/etc.
|
||||
|
||||
--mandir=MANDIR
|
||||
Specifies the base install directory for online manuals.
|
||||
The default is PREFIX/man.
|
||||
|
||||
--datadir=DATADIR
|
||||
Specifies the base install directory for machine independent
|
||||
data files. The default is PREFIX/share. Some data files for
|
||||
mDNkit will be put under the DATADIR/mdnkit directory.
|
||||
|
||||
--localstatedir=LOCALSTATEDIR
|
||||
--with-logdir=LOGDIR
|
||||
LOGDIR specifies the directory where mdnsproxy outputs log
|
||||
files by default. Its default value is LOCALSTATEDIR/mdnsproxy,
|
||||
and the default value of LOCALSTATEDIR is PREFIX/var.
|
||||
|
||||
--enable-debug
|
||||
Enable debugging codes. The fault is "no".
|
||||
|
||||
--enable-shared
|
||||
Build shared library. The fault is "yes".
|
||||
|
||||
--enable-static
|
||||
Build static library. The fault is "yes".
|
||||
|
||||
To see the list of available options, you should run it with --help
|
||||
option.
|
||||
|
||||
% ./configure --help
|
||||
|
||||
|
||||
3. Compiling
|
||||
|
||||
Run `make' for compilation.
|
||||
|
||||
% make
|
||||
|
||||
|
||||
4. Installation
|
||||
|
||||
Run `make install' to install binaries and manuals. Don't forget to
|
||||
become a super-user before the installation.
|
||||
|
||||
% su
|
||||
# make install
|
||||
|
||||
|
||||
5. Configuration and usage
|
||||
|
||||
mDNkit needs a configuration file `mdn.conf' to work properly. Unless
|
||||
you specified --with-preference option to the `configure' script, you
|
||||
have to create the file. Please refer the manual for `mdn.conf' for
|
||||
details. A sample configuration (`mdn.conf.sample') is also provided
|
||||
for your convenience.
|
||||
|
||||
Also online manuals for `mdnsproxy', `mdnconv' and `runmdn' commands
|
||||
are available. Please refer them for the usage and configuration of
|
||||
these commands.
|
||||
|
||||
% man mdn.conf
|
||||
% man mdnsproxy
|
||||
% man mdnconv
|
||||
% man runmdn
|
||||
|
||||
|
||||
6. Check your configuration
|
||||
|
||||
A simple shell script `mdnslookup' is available in the directory
|
||||
`tools/mdnconv', with which you can make queries for multilingual
|
||||
domain names. It may help you check your configuration.
|
||||
|
||||
The usage of `mdnslookup' is:
|
||||
|
||||
% tools/mdnconv/mdnslookup <domain-name> <dns-server>
|
||||
|
||||
Suppose that <domain-name> is an internationalized domain name written
|
||||
in the local codeset (see ``LOCAL CODESET'' in the `mdn.conf' man page
|
||||
for details), and <dns-server> is a hostname or IP address of DNS
|
||||
server.
|
||||
|
||||
`mdnslookup' inquires <mdn-domain-name> from <dns-server>, using
|
||||
`mdnconv' and `nslookup' commands. If something is wrong, you will
|
||||
see an error message output by `mdnconv', `nslookup' or `mdnslookup'
|
||||
itself.
|
||||
|
||||
|
||||
; $Id: INSTALL,v 1.1 2002/02/08 05:38:30 marka Exp $
|
||||
@@ -1,253 +0,0 @@
|
||||
|
||||
mDNkit
|
||||
$B%3%s%Q%$%k$H%$%s%9%H!<%k$NJ}K!(B
|
||||
($B<R(B) $BF|K\%M%C%H%o!<%/%$%s%U%)%a!<%7%g%s%;%s%?!<(B (JPNIC)
|
||||
|
||||
|
||||
$BK\%Q%C%1!<%8$N%3%s%Q%$%k$*$h$S%$%s%9%H!<%k$O!"<!$N$h$&$J%9%F%C%W$G9T(B
|
||||
$B$$$^$9!#(B
|
||||
|
||||
+ $BA0=`Hw(B: iconv() $B$,MxMQ$G$-$k$h$&$K$9$k(B
|
||||
+ $B%7%9%F%`@_Dj(B: `configure' $B%9%/%j%W%H$N<B9T(B
|
||||
+ $B%3%s%Q%$%k(B: `make' $B$N<B9T(B
|
||||
+ $B%$%s%9%H!<%k(B: `make install' $B$N<B9T(B
|
||||
+ $B%5%$%HKh$N@_Dj(B: `mdn.conf' $B$K$h$k@_Dj(B
|
||||
+ $B@_Dj$N3NG'(B ($B>JN,2D(B)
|
||||
|
||||
|
||||
0. $BA0=`Hw(B
|
||||
|
||||
$B$b$7$"$J$?$N;HMQ$7$F$$$k%7%9%F%`$N%i%$%V%i%j$K(B iconv() $B$,$J$$>l9g!"$"(B
|
||||
$B$k$$$O$"$C$F$b(B UTF-8 $B$r07$&$3$H$,$G$-$J$$>l9g$K$O$"$i$+$8$a(B iconv() $B$r(B
|
||||
$B%$%s%9%H!<%k$7$F$*$$$F$/$@$5$$!#(Biconv() $B$O!"Nc$($P(B GNU libiconv $B$H8F$P(B
|
||||
$B$l$k%U%j!<(B (LGPL) $B$N<BAu$,(B
|
||||
|
||||
http://clisp.cons.org/~haible/packages-libiconv.html
|
||||
|
||||
$B$+$iF~<j2DG=$G$9!#(B
|
||||
|
||||
*$BCm0U(B*
|
||||
GNU libiconv-1.6.1 $B$O(B NetBSD 1.5 $B$H$NAH9g$o$;$GLdBj$,$"$j!"%3%s%Q%$(B
|
||||
$B%k;~$K%(%i!<$,H/@8$7$^$9!#$3$N%P%0$r=$@5$9$k$?$a$N%Q%C%A$,(B
|
||||
patch/libiconv $B%G%#%l%/%H%j$N2<$KMQ0U$5$l$F$$$^$9$N$G!"$3$NLdBj$KAx(B
|
||||
$B6x$7$?>l9g$K$O(B libiconv $B$K%Q%C%A$rEv$F$F:F%$%s%9%H!<%k$7$F$/$@$5$$!#(B
|
||||
$B$J$*!"%Q%C%A$NEv$FJ}$O%Q%C%A%U%!%$%k$N@hF,$K=q$+$l$F$$$^$9!#(B
|
||||
|
||||
|
||||
1. configure $B%9%/%j%W%H$N<B9T(B
|
||||
|
||||
$B%H%C%W%G%#%l%/%H%j$K$"$k(B configure $B%9%/%j%W%H$r<B9T$7$F$/$@$5$$!#(B
|
||||
|
||||
% ./configure
|
||||
|
||||
configure $B%9%/%j%W%H$K$O!"?tB?$/$N%*%W%7%g%s$,MQ0U$5$l$F$$$^$9!#$=$N$&(B
|
||||
$B$A=EMW$H;W$o$l$k$b$N$O<!$NDL$j$G$9!#(B
|
||||
|
||||
--prefix=PREFIX
|
||||
mDNkit $B$r%$%s%9%H!<%k$9$k%G%#%l%/%H%j$N%Q%9$r;XDj$7$^$9!#%G%U%)(B
|
||||
$B%k%H$O(B /usr/local $B$G$9!#(B
|
||||
|
||||
--with-libiconv=LIBICONV_PREFIX
|
||||
$B$"$i$+$8$a%$%s%9%H!<%k$7$F$"$k(B GNU libiconv $B$r(B mDNkit $B$K%j%s%/(B
|
||||
$B$5$;$k>l9g$O!"$3$N%*%W%7%g%s$r;XDj$7$F2<$5$$!#0z?t(B LIBICONV_PREFIX
|
||||
$B$K$O!"(BGNU libiconv $B$,%$%s%9%H!<%k$5$l$F$$$k0LCV$r;XDj$7$^$9!#(B
|
||||
$B0z?t$r>JN,$9$k$H!"(BPREFIX (PREFIX $B$NCM$O(B --prefix=PREFIX $B$+$i(B
|
||||
$BF3=P$5$l$^$9(B) $B$r;XDj$7$?$b$N$H8+$J$5$l$^$9!#(B
|
||||
|
||||
--with-libiconv $B$O(B GNU libiconv $BMQ$NC;=L7A$N%*%W%7%g%s$G(B
|
||||
|
||||
--with-libiconv=/usr/local
|
||||
|
||||
$B$3$l$O<!$HEy2A$K$J$j$^$9!#(B
|
||||
|
||||
--with-iconv-include='-I/usr/local/include'
|
||||
--with-iconv='-L/usr/local/lib -R/usr/local/lib -liconv'
|
||||
|
||||
$BC;=L7A$N%*%W%7%g%s(B (--with-libiconv) $B$HDL>oMQ$N%*%W%7%g%s(B
|
||||
(--with-iconv-include, --with-iconv) $B$rN>J}$H$b;XDj$7$?>l9g$O!"(B
|
||||
$BDL>oMQ$N%*%W%7%g%s$[$&$,M%@h$5$l$^$9!#(B
|
||||
|
||||
--with-iconv-include=ICONV_INCDIR
|
||||
C $B%3%s%Q%$%i$,DL>o$G$O8!:w$7$J$$%G%#%l%/%H%j$K(B "iconv.h" $B$,CV(B
|
||||
$B$+$l$F$$$k>l9g!"<!$N$h$&$K$7$F$=$N%G%#%l%/%H%j$r;XDj$7$^$9!#(B
|
||||
|
||||
--with-iconv-include=/usr/local/include
|
||||
|
||||
--with-iconv=ICONV_LIB
|
||||
libc $B$K(B iconv $B$,F~$C$F$$$J$$>l9g(B ($B>e5-$N%Q%C%1!<%8$rF~$l$?(B
|
||||
$B>l9g$J$I(B) $B$K!"(Biconv $B$N%i%$%V%i%j$r;XDj$7$^$9!#Nc$($P(B
|
||||
|
||||
--with-iconv="-L/usr/local/lib -liconv"
|
||||
|
||||
$B$N$h$&$K;XDj$7$^$9!#$b$7(B iconv $B$,6&M-%i%$%V%i%j$K$J$C$F$$$k(B
|
||||
$B>l9g$K$O!"(B-R $B%*%W%7%g%s$b;XDj$7$F(B
|
||||
|
||||
--with-iconv="-L/usr/local/lib -R/usr/local/lib -liconv"
|
||||
|
||||
$B$H$9$kI,MW$,$"$k$+$b$7$l$^$;$s!#(B
|
||||
|
||||
--with-iconv-sofile=SOFILE_PATH
|
||||
mDNkit $B$K4^$^$l$F$$$k(B runmdn $B%3%^%s%I$O!"(Biconv() $B$,(B libc $B$N0l(B
|
||||
$BIt$H$7$FDs6!$5$l$J$$$H$-$K!"(Biconv() $B$r4^$`6&M-%i%$%V%i%j$X$N%Q(B
|
||||
$B%9L>$rCN$kI,MW$,$"$j$^$9!#(BmDNkit $B$O!"(B--with-iconv $B%*%W%7%g%s$N(B
|
||||
$B5-=R$r4p$K%Q%9L>$r8!:w$7$^$9$,!"$3$l$K<:GT$7$?$H$-$K!"0J2<$N$h(B
|
||||
$B$&$K6&M-%i%$%V%i%j$r;XDj$9$k$3$H$,$G$-$^$9!#(B
|
||||
|
||||
--with-iconv-sofile=/usr/local/lib/libiconvv.so.2.0
|
||||
|
||||
--with-utf8=UTF8_NAME
|
||||
iconv $B$K(B utf-8 $B%(%s%3!<%G%#%s%0$r;XDj$9$k>l9g!"K\%i%$%V%i%j$O(B
|
||||
$B%G%U%)%k%H$G$O(B "UTF-8" $B$H$$$&L>A0$r;XDj$7$^$9!#$b$7$"$J$?$N(B
|
||||
$B%7%9%F%`$N(B iconv $B$,(B "UTF-8" $B$H$$$&L>A0$r<u$1IU$1$J$$>l9g$K$O!"(B
|
||||
$BBe$j$NL>A0$r;XDj$7$^$9!#Nc$($P(B "UTF-8" $B$G$O$J$/(B "utf8" $B$N(B
|
||||
$B>l9g$K$O<!$N$h$&$K;XDj$7$^$9!#(B
|
||||
|
||||
--with-utf8=utf8
|
||||
|
||||
|
||||
2. $B$=$NB>$N(B configure $B$N%*%W%7%g%s(B
|
||||
|
||||
$B$=$l$[$I$h$/;H$&$o$1$G$O$"$j$^$;$s$,!"(Bconfigure $B$K$OA09`$N$b$N0J30$K(B
|
||||
$B$bMM!9$J%*%W%7%g%s$,MQ0U$5$l$F$$$^$9!#(B
|
||||
|
||||
--with-preference=PREFERENCE
|
||||
mDNkit $B$N%5%s%W%k%3%s%U%#%.%e%l!<%7%g%s%U%!%$%k(B (mdn.conf.sample)
|
||||
$B$N@_Dj$r(B PREFERENCE $B8~$1$N$b$N$K$7$^$9!#$^$?$3$N%*%W%7%g%s$r;XDj(B
|
||||
$B$9$k$H%G%U%)%k%H$N%3%s%U%#%.%e%l!<%7%g%s%U%!%$%k(B (mdn.conf) $B$,(B
|
||||
$B%$%s%9%H!<%k$5$l$^$9!#$?$@$7%U%!%$%k$,$9$G$KB8:_$7$F$$$k>l9g$K$O(B
|
||||
$B%$%s%9%H!<%k$7$^$;$s!#(B
|
||||
$B8=:_$N$H$3$m!";XDj$G$-$k(B PREFERENCE $B$O(B "jp" $B$N$_$G$9!#(B
|
||||
|
||||
--with-amc-ace-z-prefix=AMCZ_PREFIX
|
||||
AMC-ACE-Z $B$O(B DNS $B%W%m%H%3%k>e$G;HMQ$5$l$kB?8@8l%I%a%$%sL>$K4X$7(B
|
||||
$B$FDs0F$5$l$F$$$k%(%s%3!<%G%#%s%0J}<0$G$9!#$3$N%(%s%3!<%G%#%s%0(B
|
||||
$B$G%3%s%3!<%I$5$l$?%I%a%$%sL>$H=>Mh$N(B ASCII $B%I%a%$%sL>$H6hJL$9(B
|
||||
$B$k$?$a$K$O!"8GDj$N@\F,<-$rMQ0U$9$kI,MW$,$"$j$^$9!#$7$+$7$J$,$i!"(B
|
||||
$B8=:_$N(B AMCE-ACE-Z $B$N%$%s%?!<%M%C%H%I%i%U%H$G$O@\F,<-$rDj5A$7$F(B
|
||||
$B$$$^$;$s!#$3$N%*%W%7%g%s$rMQ$$$k$3$H$G!"@\F,<-$r;XDj$9$k$3$H$,(B
|
||||
$B$G$-$^$9!#;XDj$7$J$1$l$P!"(B"zq--" $B$,@\F,<-$H$7$FDj5A$5$l$^$9!#(B
|
||||
|
||||
--with-race-prefix=RACE_PREFIX
|
||||
--with-dude-prefix=DUDE_PREFIX
|
||||
RACE $B$b(B DUDE $B$b(B DNS $B%W%m%H%3%k>e$G;HMQ$5$l$kB?8@8l%I%a%$%sL>$K(B
|
||||
$B4X$7$FDs0F$5$l$F$$$k%(%s%3!<%G%#%s%0J}<0$G$9$,!"$9$G$KGQ$l$?$b(B
|
||||
$B$N$H$J$C$F$$$^$9!#%(%s%3!<%G%#%s%0J}<0$K$D$$$F5-=R$7$?%$%s%?!<(B
|
||||
$B%M%C%H%I%i%U%H$K$O@\F,<-$,Dj5A$5$l$F$$$^$9$,!"$3$l$i$N%*%W%7%g(B
|
||||
$B%s$rMQ$$$F@\F,<-$rJQ99$9$k$3$H$b2DG=$G$9!#(B
|
||||
|
||||
--exec-prefix=EXEC_PREFIX
|
||||
$B%^%7%s8GM-$N%U%!%$%k$r%$%s%9%H!<%k$9$k%G%#%l%/%H%j$N%Q%9$r;XDj(B
|
||||
$B$7$^$9!#%G%U%)%k%H$O(B PREFIX (``--prefix=PREFIX'' $B$K$h$C$F;XDj(B
|
||||
$B2DG=!"(BPREFIX $B$N%G%U%)%k%H$O(B /usr/local) $B$K$J$j$^$9!#(B
|
||||
|
||||
--sbindir=SBINDIR
|
||||
mdnsproxy $B$r%$%s%9%H!<%k$9$k%G%#%l%/%H%j$r;XDj$7$^$9!#%G%U%)%k(B
|
||||
$B%H$G$O(B EXEC_PREFIX/sbin $B$G$9!#(B
|
||||
|
||||
--bindir=BINDIR
|
||||
mdnconv $B$H(B runmdn $B$r%$%s%9%H!<%k$9$k%G%#%l%/%H%j$r;XDj$7$^$9!#(B
|
||||
$B%G%U%)%k%H$G$O(B EXEC_PREFIX/bin $B$G$9!#(B
|
||||
|
||||
--libdir=LIBDIR
|
||||
MDN $B%i%$%V%i%j(B (libmdn) $B$r%$%s%9%H!<%k$9$k%G%#%l%/%H%j$r;XDj$7(B
|
||||
$B$^$9!#%G%U%)%k%H$G$O(B EXEC_PREFIX/lib $B$G$9!#(B
|
||||
|
||||
--includedir=INCDIR
|
||||
MDN $B%i%$%V%i%j$N%X%C%@%U%!%$%k$r%$%s%9%H!<%k$9$k%G%#%l%/%H%j$r(B
|
||||
$B;XDj$7$^$9!#%G%U%)%k%H$G$O(B PREFIX/include $B$G$9!#(B
|
||||
|
||||
--sysconfdir=SYSCONFDIR
|
||||
MDN $B%i%$%V%i%j$*$h$S(B mdnsproxy $B$N@_Dj%U%!%$%k$N%5%s%W%k$r%$%s(B
|
||||
$B%9%H!<%k$9$k%G%#%l%/%H%j$r;XDj$7$^$9!#%G%U%)%k%H$G$O(B PREFIX/etc
|
||||
$B$G$9!#(B
|
||||
|
||||
--mandir=MANDIR
|
||||
$B%*%s%i%$%s%^%K%e%"%k$N%$%s%9%H!<%k%G%#%l%/%H%j$r;XDj$7$^$9!#(B
|
||||
$B%G%U%)%k%H$G$O(B PREFIX/man $B$G$9!#(B
|
||||
|
||||
--datadir=DATADIR
|
||||
$B0[$J$k%^%7%s$G6&M-2DG=$J%U%!%$%k$r%$%s%9%H!<%k$9$k%G%#%l%/%H%j(B
|
||||
$B$r;XDj$7$^$9!#%G%U%)%k%H$O(B PREFIX/share $B$G$9!#(BDATADIR/mdnkit
|
||||
$B$N2<$K!"(BmDNkit $B$G;HMQ$9$k4v$D$+$N%G!<%?%U%!%$%k$,%$%s%9%H!<%k(B
|
||||
$B$5$l$^$9!#(B
|
||||
|
||||
--localstatedir=LOCALSTATEDIR
|
||||
--with-logdir=LOGDIR
|
||||
LOGDIR $B$O(B mdnsproxy $B$N%m%0%U%!%$%k$r=PNO$9$kI8=`$N%G%#%l%/%H%j(B
|
||||
$B$r;XDj$7$^$9!#(BLOGDIR $B$N%G%U%)%k%H$O(B LOLOCALSTATEDIR/mdnsproxy
|
||||
$B$G!"(BLOLOCALSTATEDIR $B$N%G%U%)%k%H$O(B PREFIX/var $B$G$9!#(B
|
||||
|
||||
--enable-debug
|
||||
$B%G%P%C%0MQ$N%3!<%I$rM-8z$K$7$^$9!#%G%U%)%k%H$O(B "no" ($BL58z(B) $B$G$9!#(B
|
||||
|
||||
--enable-shared
|
||||
$B6&M-%i%$%V%i%j$r:n@.$7$^$9!#%G%U%)%k%H$O(B "yes" ($B:n@.$9$k(B) $B$G$9!#(B
|
||||
|
||||
--enable-static
|
||||
$B@EE*%i%$%V%i%j$r:n@.$7$^$9!#%G%U%)%k%H$O(B "yes" ($B:n@.$9$k(B) $B$G$9!#(B
|
||||
|
||||
configure $B$K$OB>$K$bB?$/$N%*%W%7%g%s$,$"$j$^$9$,!";D$j$O0lHLE*$J%*%W%7%g(B
|
||||
$B%s$J$N$G@bL@$O>J$-$^$9!#(B
|
||||
|
||||
% ./configure --help
|
||||
|
||||
$B$r<B9T$9$k$H%*%W%7%g%s$N0lMw$,I=<($5$l$^$9!#(B
|
||||
|
||||
|
||||
3. $B%3%s%Q%$%k(B
|
||||
|
||||
configure $B$r<B9T$9$k$H(B Makefile $B$J$I$,@8@.$5$l$^$9$N$G!"B3$1$F(B make$B$r(B
|
||||
$B<B9T$7$F%3%s%Q%$%k$7$^$9!#(B
|
||||
|
||||
% make
|
||||
|
||||
|
||||
4. $B%$%s%9%H!<%k(B
|
||||
|
||||
$B%9!<%Q%f!<%6$K$J$C$F%$%s%9%H!<%k$7$^$9!#(B
|
||||
|
||||
% su
|
||||
# make install
|
||||
|
||||
|
||||
5. $B@_Dj$H;HMQJ}K!(B
|
||||
|
||||
mDNkit $B$r@5$7$/F0:n$5$;$k$K$O!"@_Dj%U%!%$%k(B `mdn.conf' $B$,I,MW$G$9!#(B
|
||||
configure $B%9%/%j%W%H$K(B --with-preference $B%*%W%7%g%s$r;XDj$7$J$+$C$?>l(B
|
||||
$B9g$K$O$3$N%U%!%$%k$r:n@.$9$kI,MW$,$"$j$^$9!#$3$N@_Dj%U%!%$%k$N>\:Y$K$D(B
|
||||
$B$$$F$O(Bmdn.conf $B$N%*%s%i%$%s%^%K%e%"%k$r$4Mw$/$@$5$$!#$^$?@_DjNc$,=q$+(B
|
||||
$B$l$?%5%s%W%k%U%!%$%k(B (mdn.conf.sample) $B$b%$%s%9%H!<%k$5$l$^$9$N$G$4Mx(B
|
||||
$BMQ$/$@$5$$!#(B
|
||||
|
||||
$B$^$?!"(Bmdnsproxy$B!"(Bmdnconv$B!"(Brunmdn $B$H$$$C$?%D!<%k$N%*%s%i%$%s%^%K%e%"%k(B
|
||||
$B$bDs6!$5$l$F$$$^$9!#$3$l$i$N%3%^%s%I$N;H$$J}!"@_DjJ}K!$K4X$7$F$O$=$A$i(B
|
||||
$B$r;2>H$7$F$/$@$5$$!#(B
|
||||
|
||||
% man mdn.conf
|
||||
% man mdnsproxy
|
||||
% man mdnconv
|
||||
% man runmdn
|
||||
|
||||
|
||||
6. $B@_Dj$N3NG'(B
|
||||
|
||||
`mdnsproxy' $B$H$$$&4JC1$J%7%'%k%9%/%j%W%H$,(B tools/mdnconv $B%G%#%l%/%H%j(B
|
||||
$B$KMQ0U$5$l$F$$$^$9!#$3$N%9%/%j%W%H$r;H$&$H(B DNS $B%5!<%P$KBP$7$FB?8@8l%I(B
|
||||
$B%a%$%sL>$rLd$$9g$o$;$k$3$H$,$G$-$^$9!#@_Dj%U%!%$%k$N3NG'$KLrN)$D$+$bCN(B
|
||||
$B$l$^$;$s!#(B
|
||||
|
||||
`mdnslookup' $B$N;HMQJ}K!$O!"<!$NDL$j$G$9!#(B
|
||||
|
||||
% tools/mdnconv/mdnslookup <domain-name> <dns-server>
|
||||
|
||||
$B$3$3$G(B <domain-name> $B$O%m!<%+%k%3!<%I%;%C%H(B ($B>\$7$/$O(B mdn.conf $B$N%^%K%e(B
|
||||
$B%"%k$N(B ``LOCAL CODESET'' $B$r;2>H$N$3$H(B) $B$G=q$+$l$?B?8@8l%I%a%$%sL>$G!"(B
|
||||
<dns-server> $B$O(B DNS $B%5!<%P$N%[%9%HL>$b$7$/$O(B IP $B%"%I%l%9$G$9!#(B
|
||||
|
||||
`mdnslookup' $B$O(B `mdnconv' $B$*$h$S(B `nslookup' $B%3%^%s%I$rMQ$$$F!"(B
|
||||
<dns-server> $B$KBP$7$F(B <domain-name> $B$r0z$-$K9T$-$^$9!#@_Dj$K2?$+4V0c$$(B
|
||||
$B$,$"$l$P!"(B`mdnconv', `nslookup', $B$"$k$$$O(B `mdnslookup' $B<+?H$K$h$k%(%i!<(B
|
||||
$B%a%C%;!<%8$,=PNO$5$l$^$9!#(B
|
||||
|
||||
|
||||
; $Id: INSTALL.ja,v 1.1 2002/02/08 05:38:30 marka Exp $
|
||||
@@ -1,85 +0,0 @@
|
||||
/* $Id: amcacev.h,v 1.1 2002/02/08 05:38:59 marka Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set forth bellow.
|
||||
*
|
||||
* LICENSE TERMS AND CONDITIONS
|
||||
*
|
||||
* The following License Terms and Conditions apply, unless a different
|
||||
* license is obtained from Japan Network Information Center ("JPNIC"),
|
||||
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
|
||||
* Chiyoda-ku, Tokyo 101-0047, Japan.
|
||||
*
|
||||
* 1. Use, Modification and Redistribution (including distribution of any
|
||||
* modified or derived work) in source and/or binary forms is permitted
|
||||
* under this License Terms and Conditions.
|
||||
*
|
||||
* 2. Redistribution of source code must retain the copyright notices as they
|
||||
* appear in each source code file, this License Terms and Conditions.
|
||||
*
|
||||
* 3. Redistribution in binary form must reproduce the Copyright Notice,
|
||||
* this License Terms and Conditions, in the documentation and/or other
|
||||
* materials provided with the distribution. For the purposes of binary
|
||||
* distribution the "Copyright Notice" refers to the following language:
|
||||
* "Copyright (c) Japan Network Information Center. All rights reserved."
|
||||
*
|
||||
* 4. Neither the name of JPNIC may be used to endorse or promote products
|
||||
* derived from this Software without specific prior written approval of
|
||||
* JPNIC.
|
||||
*
|
||||
* 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* 6. Indemnification by Licensee
|
||||
* Any person or entities using and/or redistributing this Software under
|
||||
* this License Terms and Conditions shall defend indemnify and hold
|
||||
* harmless JPNIC from and against any and all judgements damages,
|
||||
* expenses, settlement liabilities, cost and other liabilities of any
|
||||
* kind as a result of use and redistribution of this Software or any
|
||||
* claim, suite, action, litigation or proceeding by any third party
|
||||
* arising out of or relates to this License Terms and Conditions.
|
||||
*
|
||||
* 7. Governing Law, Jurisdiction and Venue
|
||||
* This License Terms and Conditions shall be governed by and and
|
||||
* construed in accordance with the law of Japan. Any person or entities
|
||||
* using and/or redistributing this Software under this License Terms and
|
||||
* Conditions hereby agrees and consent to the personal and exclusive
|
||||
* jurisdiction and venue of Tokyo District Court of Japan.
|
||||
*/
|
||||
|
||||
#ifndef MDN_AMCACEV_H
|
||||
#define MDN_AMCACEV_H 1
|
||||
|
||||
/*
|
||||
* AMC-ACE-V Converter.
|
||||
*
|
||||
* See Internet Draft draft-ietf-idn-amc-ace-v-00.txt for details.
|
||||
*/
|
||||
|
||||
#include <mdn/result.h>
|
||||
#include <mdn/converter.h>
|
||||
|
||||
extern mdn_result_t
|
||||
mdn__amcacev_open(mdn_converter_t ctx, mdn_converter_dir_t dir,
|
||||
void **privdata);
|
||||
|
||||
extern mdn_result_t
|
||||
mdn__amcacev_close(mdn_converter_t ctx, void *privdata,
|
||||
mdn_converter_dir_t dir);
|
||||
|
||||
extern mdn_result_t
|
||||
mdn__amcacev_convert(mdn_converter_t ctx, void *privdata,
|
||||
mdn_converter_dir_t dir, const char *from, char *to,
|
||||
size_t tolen);
|
||||
|
||||
#endif /* MDN_AMCACEV_H */
|
||||
@@ -1,85 +0,0 @@
|
||||
/* $Id: amcacew.h,v 1.1 2002/02/08 05:39:00 marka Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set forth bellow.
|
||||
*
|
||||
* LICENSE TERMS AND CONDITIONS
|
||||
*
|
||||
* The following License Terms and Conditions apply, unless a different
|
||||
* license is obtained from Japan Network Information Center ("JPNIC"),
|
||||
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
|
||||
* Chiyoda-ku, Tokyo 101-0047, Japan.
|
||||
*
|
||||
* 1. Use, Modification and Redistribution (including distribution of any
|
||||
* modified or derived work) in source and/or binary forms is permitted
|
||||
* under this License Terms and Conditions.
|
||||
*
|
||||
* 2. Redistribution of source code must retain the copyright notices as they
|
||||
* appear in each source code file, this License Terms and Conditions.
|
||||
*
|
||||
* 3. Redistribution in binary form must reproduce the Copyright Notice,
|
||||
* this License Terms and Conditions, in the documentation and/or other
|
||||
* materials provided with the distribution. For the purposes of binary
|
||||
* distribution the "Copyright Notice" refers to the following language:
|
||||
* "Copyright (c) Japan Network Information Center. All rights reserved."
|
||||
*
|
||||
* 4. Neither the name of JPNIC may be used to endorse or promote products
|
||||
* derived from this Software without specific prior written approval of
|
||||
* JPNIC.
|
||||
*
|
||||
* 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* 6. Indemnification by Licensee
|
||||
* Any person or entities using and/or redistributing this Software under
|
||||
* this License Terms and Conditions shall defend indemnify and hold
|
||||
* harmless JPNIC from and against any and all judgements damages,
|
||||
* expenses, settlement liabilities, cost and other liabilities of any
|
||||
* kind as a result of use and redistribution of this Software or any
|
||||
* claim, suite, action, litigation or proceeding by any third party
|
||||
* arising out of or relates to this License Terms and Conditions.
|
||||
*
|
||||
* 7. Governing Law, Jurisdiction and Venue
|
||||
* This License Terms and Conditions shall be governed by and and
|
||||
* construed in accordance with the law of Japan. Any person or entities
|
||||
* using and/or redistributing this Software under this License Terms and
|
||||
* Conditions hereby agrees and consent to the personal and exclusive
|
||||
* jurisdiction and venue of Tokyo District Court of Japan.
|
||||
*/
|
||||
|
||||
#ifndef MDN_AMCACEW_H
|
||||
#define MDN_AMCACEW_H 1
|
||||
|
||||
/*
|
||||
* AMC-ACE-W Converter.
|
||||
*
|
||||
* See Internet Draft draft-ietf-idn-amc-ace-w-00.txt for details.
|
||||
*/
|
||||
|
||||
#include <mdn/result.h>
|
||||
#include <mdn/converter.h>
|
||||
|
||||
extern mdn_result_t
|
||||
mdn__amcacew_open(mdn_converter_t ctx, mdn_converter_dir_t dir,
|
||||
void **privdata);
|
||||
|
||||
extern mdn_result_t
|
||||
mdn__amcacew_close(mdn_converter_t ctx, void *privdata,
|
||||
mdn_converter_dir_t dir);
|
||||
|
||||
extern mdn_result_t
|
||||
mdn__amcacew_convert(mdn_converter_t ctx, void *privdata,
|
||||
mdn_converter_dir_t dir, const char *from, char *to,
|
||||
size_t tolen);
|
||||
|
||||
#endif /* MDN_AMCACEW_H */
|
||||
@@ -1,86 +0,0 @@
|
||||
/* $Id: amcacez.h,v 1.1 2002/02/08 05:39:00 marka Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set forth bellow.
|
||||
*
|
||||
* LICENSE TERMS AND CONDITIONS
|
||||
*
|
||||
* The following License Terms and Conditions apply, unless a different
|
||||
* license is obtained from Japan Network Information Center ("JPNIC"),
|
||||
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
|
||||
* Chiyoda-ku, Tokyo 101-0047, Japan.
|
||||
*
|
||||
* 1. Use, Modification and Redistribution (including distribution of any
|
||||
* modified or derived work) in source and/or binary forms is permitted
|
||||
* under this License Terms and Conditions.
|
||||
*
|
||||
* 2. Redistribution of source code must retain the copyright notices as they
|
||||
* appear in each source code file, this License Terms and Conditions.
|
||||
*
|
||||
* 3. Redistribution in binary form must reproduce the Copyright Notice,
|
||||
* this License Terms and Conditions, in the documentation and/or other
|
||||
* materials provided with the distribution. For the purposes of binary
|
||||
* distribution the "Copyright Notice" refers to the following language:
|
||||
* "Copyright (c) Japan Network Information Center. All rights reserved."
|
||||
*
|
||||
* 4. Neither the name of JPNIC may be used to endorse or promote products
|
||||
* derived from this Software without specific prior written approval of
|
||||
* JPNIC.
|
||||
*
|
||||
* 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* 6. Indemnification by Licensee
|
||||
* Any person or entities using and/or redistributing this Software under
|
||||
* this License Terms and Conditions shall defend indemnify and hold
|
||||
* harmless JPNIC from and against any and all judgements damages,
|
||||
* expenses, settlement liabilities, cost and other liabilities of any
|
||||
* kind as a result of use and redistribution of this Software or any
|
||||
* claim, suite, action, litigation or proceeding by any third party
|
||||
* arising out of or relates to this License Terms and Conditions.
|
||||
*
|
||||
* 7. Governing Law, Jurisdiction and Venue
|
||||
* This License Terms and Conditions shall be governed by and and
|
||||
* construed in accordance with the law of Japan. Any person or entities
|
||||
* using and/or redistributing this Software under this License Terms and
|
||||
* Conditions hereby agrees and consent to the personal and exclusive
|
||||
* jurisdiction and venue of Tokyo District Court of Japan.
|
||||
*/
|
||||
|
||||
#ifndef MDN_AMCACEZ_H
|
||||
#define MDN_AMCACEZ_H 1
|
||||
|
||||
/*
|
||||
* AMC-ACE-Z (version 0.3.1) Converter.
|
||||
*
|
||||
* See Internet Draft draft-ietf-idn-amc-ace-z-01.txt
|
||||
* for details.
|
||||
*/
|
||||
|
||||
#include <mdn/result.h>
|
||||
#include <mdn/converter.h>
|
||||
|
||||
extern mdn_result_t
|
||||
mdn__amcacez_open(mdn_converter_t ctx, mdn_converter_dir_t dir,
|
||||
void **privdata);
|
||||
|
||||
extern mdn_result_t
|
||||
mdn__amcacez_close(mdn_converter_t ctx, void *privdata,
|
||||
mdn_converter_dir_t dir);
|
||||
|
||||
extern mdn_result_t
|
||||
mdn__amcacez_convert(mdn_converter_t ctx, void *privdata,
|
||||
mdn_converter_dir_t dir, const char *from, char *to,
|
||||
size_t tolen);
|
||||
|
||||
#endif /* MDN_AMCACEZ_H */
|
||||
@@ -1,86 +0,0 @@
|
||||
/* $Id: mace.h,v 1.1 2002/02/08 05:39:19 marka Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set forth bellow.
|
||||
*
|
||||
* LICENSE TERMS AND CONDITIONS
|
||||
*
|
||||
* The following License Terms and Conditions apply, unless a different
|
||||
* license is obtained from Japan Network Information Center ("JPNIC"),
|
||||
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
|
||||
* Chiyoda-ku, Tokyo 101-0047, Japan.
|
||||
*
|
||||
* 1. Use, Modification and Redistribution (including distribution of any
|
||||
* modified or derived work) in source and/or binary forms is permitted
|
||||
* under this License Terms and Conditions.
|
||||
*
|
||||
* 2. Redistribution of source code must retain the copyright notices as they
|
||||
* appear in each source code file, this License Terms and Conditions.
|
||||
*
|
||||
* 3. Redistribution in binary form must reproduce the Copyright Notice,
|
||||
* this License Terms and Conditions, in the documentation and/or other
|
||||
* materials provided with the distribution. For the purposes of binary
|
||||
* distribution the "Copyright Notice" refers to the following language:
|
||||
* "Copyright (c) Japan Network Information Center. All rights reserved."
|
||||
*
|
||||
* 4. Neither the name of JPNIC may be used to endorse or promote products
|
||||
* derived from this Software without specific prior written approval of
|
||||
* JPNIC.
|
||||
*
|
||||
* 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* 6. Indemnification by Licensee
|
||||
* Any person or entities using and/or redistributing this Software under
|
||||
* this License Terms and Conditions shall defend indemnify and hold
|
||||
* harmless JPNIC from and against any and all judgements damages,
|
||||
* expenses, settlement liabilities, cost and other liabilities of any
|
||||
* kind as a result of use and redistribution of this Software or any
|
||||
* claim, suite, action, litigation or proceeding by any third party
|
||||
* arising out of or relates to this License Terms and Conditions.
|
||||
*
|
||||
* 7. Governing Law, Jurisdiction and Venue
|
||||
* This License Terms and Conditions shall be governed by and and
|
||||
* construed in accordance with the law of Japan. Any person or entities
|
||||
* using and/or redistributing this Software under this License Terms and
|
||||
* Conditions hereby agrees and consent to the personal and exclusive
|
||||
* jurisdiction and venue of Tokyo District Court of Japan.
|
||||
*/
|
||||
|
||||
#ifndef MDN_MACE_H
|
||||
#define MDN_MACE_H 1
|
||||
|
||||
/*
|
||||
* MACE Converter.
|
||||
*
|
||||
* See Internet Draft draft-ietf-idn-mace-00.txt (but not yet
|
||||
* published at the time of this writing) for details.
|
||||
*/
|
||||
|
||||
#include <mdn/result.h>
|
||||
#include <mdn/converter.h>
|
||||
|
||||
extern mdn_result_t
|
||||
mdn__mace_open(mdn_converter_t ctx, mdn_converter_dir_t dir,
|
||||
void **privdata);
|
||||
|
||||
extern mdn_result_t
|
||||
mdn__mace_close(mdn_converter_t ctx, void *privdata,
|
||||
mdn_converter_dir_t dir);
|
||||
|
||||
extern mdn_result_t
|
||||
mdn__mace_convert(mdn_converter_t ctx, void *privdata,
|
||||
mdn_converter_dir_t dir, const char *from, char *to,
|
||||
size_t tolen);
|
||||
|
||||
#endif /* MDN_MACE_H */
|
||||
@@ -1,545 +0,0 @@
|
||||
#ifndef lint
|
||||
static char *rcsid = "$Id: amcacev.c,v 1.1 2002/02/08 05:39:56 marka Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Japan Network Information Center.
|
||||
* All rights reserved.
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set forth bellow.
|
||||
*
|
||||
* LICENSE TERMS AND CONDITIONS
|
||||
*
|
||||
* The following License Terms and Conditions apply, unless a different
|
||||
* license is obtained from Japan Network Information Center ("JPNIC"),
|
||||
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
|
||||
* Chiyoda-ku, Tokyo 101-0047, Japan.
|
||||
*
|
||||
* 1. Use, Modification and Redistribution (including distribution of any
|
||||
* modified or derived work) in source and/or binary forms is permitted
|
||||
* under this License Terms and Conditions.
|
||||
*
|
||||
* 2. Redistribution of source code must retain the copyright notices as they
|
||||
* appear in each source code file, this License Terms and Conditions.
|
||||
*
|
||||
* 3. Redistribution in binary form must reproduce the Copyright Notice,
|
||||
* this License Terms and Conditions, in the documentation and/or other
|
||||
* materials provided with the distribution. For the purposes of binary
|
||||
* distribution the "Copyright Notice" refers to the following language:
|
||||
* "Copyright (c) Japan Network Information Center. All rights reserved."
|
||||
*
|
||||
* 4. Neither the name of JPNIC may be used to endorse or promote products
|
||||
* derived from this Software without specific prior written approval of
|
||||
* JPNIC.
|
||||
*
|
||||
* 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* 6. Indemnification by Licensee
|
||||
* Any person or entities using and/or redistributing this Software under
|
||||
* this License Terms and Conditions shall defend indemnify and hold
|
||||
* harmless JPNIC from and against any and all judgements damages,
|
||||
* expenses, settlement liabilities, cost and other liabilities of any
|
||||
* kind as a result of use and redistribution of this Software or any
|
||||
* claim, suite, action, litigation or proceeding by any third party
|
||||
* arising out of or relates to this License Terms and Conditions.
|
||||
*
|
||||
* 7. Governing Law, Jurisdiction and Venue
|
||||
* This License Terms and Conditions shall be governed by and and
|
||||
* construed in accordance with the law of Japan. Any person or entities
|
||||
* using and/or redistributing this Software under this License Terms and
|
||||
* Conditions hereby agrees and consent to the personal and exclusive
|
||||
* jurisdiction and venue of Tokyo District Court of Japan.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <mdn/result.h>
|
||||
#include <mdn/assert.h>
|
||||
#include <mdn/logmacro.h>
|
||||
#include <mdn/converter.h>
|
||||
#include <mdn/utf8.h>
|
||||
#include <mdn/debug.h>
|
||||
#include <mdn/amcacev.h>
|
||||
#include <mdn/ace.h>
|
||||
#include <mdn/util.h>
|
||||
|
||||
/*
|
||||
* Although draft-ietf-idn-amc-ace-v-00.txt doesn't specify the ACE
|
||||
* signature, we have to choose one. In order to prevent the converted
|
||||
* name from beginning with a hyphen, we should choose a prefix rather
|
||||
* than a suffix.
|
||||
*/
|
||||
#if !defined(MDN_AMCACEV_PREFIX) && !defined(MDN_AMCACEV_SUFFIX)
|
||||
#define MDN_AMCACEV_PREFIX "amc4-"
|
||||
#endif
|
||||
|
||||
#define MAX_UCS 0x10FFFF
|
||||
#define AMCACEV_BUFSIZE 64
|
||||
|
||||
typedef struct {
|
||||
unsigned long *history; /* history of non-LDH characters */
|
||||
unsigned long local_buf[AMCACEV_BUFSIZE];
|
||||
int cur; /* current index */
|
||||
int style; /* 0 or 1 */
|
||||
unsigned long refpoint[2][6]; /* refpoint[0] is not used. */
|
||||
} amcacev_ctx;
|
||||
|
||||
#define IN_WINDOW(ctx, c, st, win) \
|
||||
((c) >= (ctx)->refpoint[st][win] && \
|
||||
((c) - (ctx)->refpoint[st][win]) <= amcacev_winsize[st][win])
|
||||
|
||||
static const unsigned long amcacev_refpoint_initial[2][6] = {
|
||||
{ 0, 0xe0, 0xa0, 0, 0, 0x10000 },
|
||||
{ 0, 0, 0, 0, 0, 0x10000 },
|
||||
};
|
||||
static const unsigned long amcacev_winsize[2][6] = {
|
||||
{ 0, 0xf, 0xff, 0xfff, 0xffff, 0xfffff },
|
||||
{ 0, 0, 0xff, 0x4fff, 0xffff, 0xfffff },
|
||||
};
|
||||
|
||||
static const char *base32encode = "abcdefghijkmnpqrstuvwxyz23456789";
|
||||
static const int base32decode_ascii[26] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -1, 11, 12, -1, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23,
|
||||
};
|
||||
static const int base32decode_digit[10] = {
|
||||
-1, -1, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
};
|
||||
|
||||
static mdn_result_t amcacev_decode(const char *from, size_t fromlen,
|
||||
char *to, size_t tolen);
|
||||
static mdn_result_t amcacev_encode(const char *from, size_t fromlen,
|
||||
char *to, size_t tolen);
|
||||
static mdn_result_t init_ctx(amcacev_ctx *ctx, size_t len);
|
||||
static void release_ctx(amcacev_ctx *ctx);
|
||||
static void update_ctx(amcacev_ctx *ctx, unsigned long v);
|
||||
static unsigned long get_refpoint(unsigned long v, int st, int win);
|
||||
static int eval_compression(amcacev_ctx *ctx);
|
||||
static unsigned long encode_delta(unsigned long v,
|
||||
amcacev_ctx *ctx, int *szp);
|
||||
static int amcacev_getwc(const char *s, size_t len, int style,
|
||||
unsigned long *vp);
|
||||
static int amcacev_putwc(char *s, size_t len,
|
||||
unsigned long delta, int w);
|
||||
static int is_ldh(unsigned long v);
|
||||
|
||||
static mdn__ace_t amcacev_profile = {
|
||||
#ifdef MDN_AMCACEV_PREFIX
|
||||
mdn__ace_prefix,
|
||||
MDN_AMCACEV_PREFIX,
|
||||
#else
|
||||
mdn__ace_suffix,
|
||||
MDN_AMCACEV_SUFFIX,
|
||||
#endif
|
||||
amcacev_encode,
|
||||
amcacev_decode,
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* ARGSUSED */
|
||||
mdn_result_t
|
||||
mdn__amcacev_open(mdn_converter_t ctx, mdn_converter_dir_t dir,
|
||||
void **privdata)
|
||||
{
|
||||
return (mdn_success);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
mdn_result_t
|
||||
mdn__amcacev_close(mdn_converter_t ctx, void *privdata,
|
||||
mdn_converter_dir_t dir)
|
||||
{
|
||||
return (mdn_success);
|
||||
}
|
||||
|
||||
mdn_result_t
|
||||
mdn__amcacev_convert(mdn_converter_t ctx, void *privdata,
|
||||
mdn_converter_dir_t dir,
|
||||
const char *from, char *to, size_t tolen)
|
||||
{
|
||||
mdn_result_t r;
|
||||
|
||||
assert(ctx != NULL &&
|
||||
(dir == mdn_converter_l2u || dir == mdn_converter_u2l));
|
||||
|
||||
TRACE(("mdn__amcacev_convert(dir=%s,from=\"%s\")\n",
|
||||
dir == mdn_converter_l2u ? "l2u" : "u2l",
|
||||
mdn_debug_xstring(from, 20)));
|
||||
|
||||
r = mdn__ace_convert(&amcacev_profile, dir, from, to, tolen);
|
||||
if (r != mdn_success)
|
||||
return (r);
|
||||
|
||||
DUMP(("mdn__amcacev_convert: \"%s\"\n", mdn_debug_xstring(to, 70)));
|
||||
|
||||
return (r);
|
||||
}
|
||||
|
||||
static mdn_result_t
|
||||
amcacev_decode(const char *from, size_t fromlen, char *to, size_t tolen) {
|
||||
int literal_mode = 0;
|
||||
amcacev_ctx ctx;
|
||||
mdn_result_t r;
|
||||
|
||||
/* Initialize context. */
|
||||
if ((r = init_ctx(&ctx, fromlen)) != mdn_success)
|
||||
return (r);
|
||||
|
||||
while (fromlen > 0) {
|
||||
unsigned long v;
|
||||
int len;
|
||||
|
||||
if (from[0] == '-') {
|
||||
if (fromlen > 1 && from[1] == '-') {
|
||||
v = '-';
|
||||
from += 2;
|
||||
fromlen -= 2;
|
||||
} else {
|
||||
literal_mode = !literal_mode;
|
||||
from++;
|
||||
fromlen--;
|
||||
continue;
|
||||
}
|
||||
} else if (literal_mode) {
|
||||
v = from[0];
|
||||
from++;
|
||||
fromlen--;
|
||||
} else {
|
||||
len = amcacev_getwc(from, fromlen, ctx.style, &v);
|
||||
if (len == 0)
|
||||
goto invalid_encoding;
|
||||
from += len;
|
||||
fromlen -= len;
|
||||
|
||||
v += ctx.refpoint[ctx.style][len];
|
||||
|
||||
/* Update refpoints. */
|
||||
update_ctx(&ctx, v);
|
||||
}
|
||||
|
||||
len = mdn_utf8_putwc(to, tolen, v);
|
||||
if (len == 0)
|
||||
goto overflow;
|
||||
to += len;
|
||||
tolen -= len;
|
||||
}
|
||||
|
||||
/*
|
||||
* Terminate with NUL.
|
||||
*/
|
||||
if (tolen <= 0)
|
||||
goto overflow;
|
||||
*to = '\0';
|
||||
|
||||
ret:
|
||||
release_ctx(&ctx);
|
||||
return (r);
|
||||
|
||||
invalid_encoding:
|
||||
r = mdn_invalid_encoding;
|
||||
goto ret;
|
||||
overflow:
|
||||
r = mdn_buffer_overflow;
|
||||
goto ret;
|
||||
}
|
||||
|
||||
static mdn_result_t
|
||||
amcacev_encode(const char *from, size_t fromlen, char *to, size_t tolen) {
|
||||
int literal_mode = 0;
|
||||
amcacev_ctx ctx;
|
||||
mdn_result_t r;
|
||||
|
||||
/* Initialize context. */
|
||||
if ((r = init_ctx(&ctx, fromlen)) != mdn_success)
|
||||
return (r);
|
||||
|
||||
while (fromlen > 0) {
|
||||
unsigned long c;
|
||||
size_t len;
|
||||
|
||||
len = mdn_utf8_getwc(from, fromlen, &c);
|
||||
from += len;
|
||||
fromlen -= len;
|
||||
if (len == 0)
|
||||
goto invalid_encoding;
|
||||
|
||||
if (c >= MAX_UCS) {
|
||||
/*
|
||||
* Invalid Unicode code point.
|
||||
*/
|
||||
goto invalid_encoding;
|
||||
} else if (c == '-') {
|
||||
/*
|
||||
* Convert "-" to "--".
|
||||
*/
|
||||
if (tolen < 2)
|
||||
goto overflow;
|
||||
to[0] = to[1] = '-';
|
||||
to += 2;
|
||||
tolen -= 2;
|
||||
} else if (is_ldh(c)) {
|
||||
/*
|
||||
* LDH characters.
|
||||
*/
|
||||
if (literal_mode == 0) {
|
||||
/*
|
||||
* Go into literal mode.
|
||||
*/
|
||||
if (tolen < 1)
|
||||
goto overflow;
|
||||
*to++ = '-';
|
||||
tolen--;
|
||||
literal_mode = 1;
|
||||
}
|
||||
if (tolen < 1)
|
||||
goto overflow;
|
||||
*to++ = c;
|
||||
tolen--;
|
||||
} else {
|
||||
/*
|
||||
* Non-LDH characters.
|
||||
*/
|
||||
int sz;
|
||||
unsigned long delta;
|
||||
|
||||
if (literal_mode != 0) {
|
||||
/*
|
||||
* Get out of literal mode.
|
||||
*/
|
||||
if (tolen < 1)
|
||||
goto overflow;
|
||||
*to++ = '-';
|
||||
tolen--;
|
||||
literal_mode = 0;
|
||||
}
|
||||
delta = encode_delta(c, &ctx, &sz);
|
||||
sz = amcacev_putwc(to, tolen, delta, sz);
|
||||
if (sz == 0)
|
||||
goto overflow;
|
||||
to += sz;
|
||||
tolen -= sz;
|
||||
|
||||
/* Add to the history, and update refpoints. */
|
||||
update_ctx(&ctx, c);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Terminate with NUL.
|
||||
*/
|
||||
if (tolen <= 0)
|
||||
goto overflow;
|
||||
|
||||
*to = '\0';
|
||||
|
||||
ret:
|
||||
release_ctx(&ctx);
|
||||
return (r);
|
||||
|
||||
invalid_encoding:
|
||||
r = mdn_invalid_encoding;
|
||||
goto ret;
|
||||
overflow:
|
||||
r = mdn_buffer_overflow;
|
||||
goto ret;
|
||||
}
|
||||
|
||||
static mdn_result_t
|
||||
init_ctx(amcacev_ctx *ctx, size_t len) {
|
||||
if (len <= AMCACEV_BUFSIZE) {
|
||||
ctx->history = ctx->local_buf;
|
||||
} else {
|
||||
ctx->history = malloc(sizeof(ctx->history[0]) * len);
|
||||
if (ctx->history == NULL)
|
||||
return (mdn_nomemory);
|
||||
}
|
||||
ctx->cur = 0;
|
||||
ctx->style = 0;
|
||||
(void)memcpy(ctx->refpoint, amcacev_refpoint_initial,
|
||||
sizeof(ctx->refpoint));
|
||||
return (mdn_success);
|
||||
}
|
||||
|
||||
static void
|
||||
release_ctx(amcacev_ctx *ctx) {
|
||||
if (ctx->history != ctx->local_buf)
|
||||
free(ctx->history);
|
||||
ctx->history = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
update_ctx(amcacev_ctx *ctx, unsigned long v) {
|
||||
int st, win;
|
||||
|
||||
/* Get style */
|
||||
if (IN_WINDOW(ctx, v, 0, 1))
|
||||
ctx->style = 0;
|
||||
else if (!IN_WINDOW(ctx, v, 0, 1) &&
|
||||
!IN_WINDOW(ctx, v, 0, 2) &&
|
||||
!IN_WINDOW(ctx, v, 0, 3))
|
||||
ctx->style = 1;
|
||||
|
||||
/* Add the character to the history. */
|
||||
ctx->history[ctx->cur++] = v;
|
||||
|
||||
for (st = 0; st < 2; st++) {
|
||||
for (win = (st == 0) ? 1 : 2; win < 4; win++) {
|
||||
unsigned long oldref = ctx->refpoint[st][win];
|
||||
unsigned long newref = get_refpoint(v, st, win);
|
||||
int enclen1, enclen2;
|
||||
|
||||
if (newref == oldref)
|
||||
continue;
|
||||
|
||||
enclen1 = eval_compression(ctx);
|
||||
ctx->refpoint[st][win] = newref;
|
||||
enclen2 = eval_compression(ctx);
|
||||
if (enclen2 > enclen1)
|
||||
ctx->refpoint[st][win] = oldref;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned long
|
||||
get_refpoint(unsigned long v, int st, int win) {
|
||||
#define ROUND_BITS(v, b) (((v) >> (b)) << (b))
|
||||
if (win == 1) {
|
||||
return (ROUND_BITS(v, 3));
|
||||
} else if (win == 2) {
|
||||
if (0xa0 <= v && v <= 0x17f)
|
||||
return (0xa0);
|
||||
else
|
||||
return (ROUND_BITS(v, 8));
|
||||
} else if (win == 3) {
|
||||
if (0x3000 <= v && v <= 0x9ffff)
|
||||
return (0x4e00);
|
||||
else if (st == 1 && 0xa000 <= v && v <= 0xd7ff)
|
||||
return (0x8800);
|
||||
else
|
||||
return (ROUND_BITS(v, (st == 0) ? 19 : 20));
|
||||
} else {
|
||||
FATAL(("get_refpoint: internal error\n"));
|
||||
return (0); /* for lint */
|
||||
}
|
||||
#undef ROUND_BITS
|
||||
}
|
||||
|
||||
static int
|
||||
eval_compression(amcacev_ctx *ctx) {
|
||||
int i;
|
||||
int len = 0;
|
||||
int cur = ctx->cur;
|
||||
unsigned long *p = ctx->history;
|
||||
|
||||
for (i = 0; i < cur; i++) {
|
||||
if (!is_ldh(p[i])) {
|
||||
int sz;
|
||||
(void)encode_delta(p[i], ctx, &sz);
|
||||
len += sz;
|
||||
}
|
||||
}
|
||||
return (len);
|
||||
}
|
||||
|
||||
static unsigned long
|
||||
encode_delta(unsigned long v, amcacev_ctx *ctx, int *szp) {
|
||||
int sz;
|
||||
|
||||
for (sz = (ctx->style == 0) ? 1 : 2; sz < 6; sz++) {
|
||||
if (IN_WINDOW(ctx, v, ctx->style, sz)) {
|
||||
*szp = sz;
|
||||
return (v - ctx->refpoint[ctx->style][sz]);
|
||||
}
|
||||
}
|
||||
FATAL(("amcacev_encode_mode: internal error\n"));
|
||||
return (0); /* for lint */
|
||||
}
|
||||
|
||||
static int
|
||||
amcacev_getwc(const char *s, size_t len, int style, unsigned long *vp) {
|
||||
size_t orglen = len;
|
||||
unsigned long v = 0;
|
||||
int style1_special = 0;
|
||||
|
||||
while (len > 0) {
|
||||
int c = *s++;
|
||||
|
||||
if ('a' <= c && c <= 'z')
|
||||
c = base32decode_ascii[c - 'a'];
|
||||
else if ('A' <= c && c <= 'Z')
|
||||
c = base32decode_ascii[c - 'A'];
|
||||
else if ('0' <= c && c <= '9')
|
||||
c = base32decode_digit[c - '0'];
|
||||
else
|
||||
c = -1;
|
||||
|
||||
if (c < 0)
|
||||
return (0); /* invalid character */
|
||||
|
||||
if (style == 1 && len == orglen && (c & 0x10) == 0)
|
||||
style1_special = 3;
|
||||
|
||||
len--;
|
||||
if (style1_special != 0) {
|
||||
v = (v << 5) + (c & 0x1f);
|
||||
if (--style1_special == 0) {
|
||||
*vp = v + 0x1000;
|
||||
return (3);
|
||||
}
|
||||
} else {
|
||||
v = (v << 4) + (c & 0xf);
|
||||
|
||||
if ((c & 0x10) == 0) {
|
||||
*vp = v;
|
||||
return (orglen - len);
|
||||
}
|
||||
}
|
||||
}
|
||||
return (0); /* final character missing */
|
||||
}
|
||||
|
||||
static int
|
||||
amcacev_putwc(char *s, size_t len, unsigned long delta, int w) {
|
||||
if (len < w)
|
||||
return (0);
|
||||
|
||||
if (w == 3 && delta >= 0x1000) {
|
||||
delta -= 0x1000;
|
||||
s[0] = base32encode[(delta >> 10) & 0x1f];
|
||||
s[1] = base32encode[(delta >> 5) & 0x1f];
|
||||
s[2] = base32encode[delta & 0x1f];
|
||||
} else {
|
||||
int i, shift;
|
||||
|
||||
for (shift = 0, i = w - 1; i >= 0; i--) {
|
||||
s[i] = base32encode[(delta & 0xf) + shift];
|
||||
delta >>= 4;
|
||||
shift = 16;
|
||||
}
|
||||
}
|
||||
return (w);
|
||||
}
|
||||
|
||||
static int
|
||||
is_ldh(unsigned long v) {
|
||||
if (('a' <= v && v <= 'z') || ('A' <= v && v <= 'Z') ||
|
||||
('0' <= v && v <= '9') || v == '-')
|
||||
return (1);
|
||||
else
|
||||
return (0);
|
||||
}
|
||||
@@ -1,459 +0,0 @@
|
||||
#ifndef lint
|
||||
static char *rcsid = "$Id: amcacew.c,v 1.1 2002/02/08 05:39:57 marka Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Japan Network Information Center.
|
||||
* All rights reserved.
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set forth bellow.
|
||||
*
|
||||
* LICENSE TERMS AND CONDITIONS
|
||||
*
|
||||
* The following License Terms and Conditions apply, unless a different
|
||||
* license is obtained from Japan Network Information Center ("JPNIC"),
|
||||
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
|
||||
* Chiyoda-ku, Tokyo 101-0047, Japan.
|
||||
*
|
||||
* 1. Use, Modification and Redistribution (including distribution of any
|
||||
* modified or derived work) in source and/or binary forms is permitted
|
||||
* under this License Terms and Conditions.
|
||||
*
|
||||
* 2. Redistribution of source code must retain the copyright notices as they
|
||||
* appear in each source code file, this License Terms and Conditions.
|
||||
*
|
||||
* 3. Redistribution in binary form must reproduce the Copyright Notice,
|
||||
* this License Terms and Conditions, in the documentation and/or other
|
||||
* materials provided with the distribution. For the purposes of binary
|
||||
* distribution the "Copyright Notice" refers to the following language:
|
||||
* "Copyright (c) Japan Network Information Center. All rights reserved."
|
||||
*
|
||||
* 4. Neither the name of JPNIC may be used to endorse or promote products
|
||||
* derived from this Software without specific prior written approval of
|
||||
* JPNIC.
|
||||
*
|
||||
* 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* 6. Indemnification by Licensee
|
||||
* Any person or entities using and/or redistributing this Software under
|
||||
* this License Terms and Conditions shall defend indemnify and hold
|
||||
* harmless JPNIC from and against any and all judgements damages,
|
||||
* expenses, settlement liabilities, cost and other liabilities of any
|
||||
* kind as a result of use and redistribution of this Software or any
|
||||
* claim, suite, action, litigation or proceeding by any third party
|
||||
* arising out of or relates to this License Terms and Conditions.
|
||||
*
|
||||
* 7. Governing Law, Jurisdiction and Venue
|
||||
* This License Terms and Conditions shall be governed by and and
|
||||
* construed in accordance with the law of Japan. Any person or entities
|
||||
* using and/or redistributing this Software under this License Terms and
|
||||
* Conditions hereby agrees and consent to the personal and exclusive
|
||||
* jurisdiction and venue of Tokyo District Court of Japan.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <mdn/result.h>
|
||||
#include <mdn/assert.h>
|
||||
#include <mdn/logmacro.h>
|
||||
#include <mdn/converter.h>
|
||||
#include <mdn/utf8.h>
|
||||
#include <mdn/debug.h>
|
||||
#include <mdn/amcacew.h>
|
||||
#include <mdn/ace.h>
|
||||
#include <mdn/util.h>
|
||||
|
||||
/*
|
||||
* Although draft-ietf-idn-amc-ace-w-00.txt doesn't specify the ACE
|
||||
* signature, we have to choose one. In order to prevent the converted
|
||||
* name from beginning with a hyphen, we should choose a prefix rather
|
||||
* than a suffix.
|
||||
*/
|
||||
#if !defined(MDN_AMCACEW_PREFIX) && !defined(MDN_AMCACEW_SUFFIX)
|
||||
#define MDN_AMCACEW_PREFIX "amc5-"
|
||||
#endif
|
||||
|
||||
#define MAX_UCS 0x10FFFF
|
||||
|
||||
typedef struct {
|
||||
int style; /* 0 or 1 */
|
||||
unsigned long refpoint[6]; /* refpoint[0] is not used. */
|
||||
} amcacew_ctx;
|
||||
|
||||
static const unsigned long amcacew_refpoint_initial[6] = {
|
||||
0, 0xe0, 0xa0, 0, 0, 0x10000,
|
||||
};
|
||||
|
||||
static const char *base32encode = "abcdefghijkmnpqrstuvwxyz23456789";
|
||||
static const int base32decode_ascii[26] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -1, 11, 12, -1, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23,
|
||||
};
|
||||
static const int base32decode_digit[10] = {
|
||||
-1, -1, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
};
|
||||
|
||||
static mdn_result_t amcacew_decode(const char *from, size_t fromlen,
|
||||
char *to, size_t tolen);
|
||||
static mdn_result_t amcacew_encode(const char *from, size_t fromlen,
|
||||
char *to, size_t tolen);
|
||||
static void amcacew_init_ctx(amcacew_ctx *ctx);
|
||||
static void amcacew_update_ctx(amcacew_ctx *ctx, unsigned long v,
|
||||
int sz);
|
||||
static unsigned long amcacew_encode_delta(unsigned long v,
|
||||
amcacew_ctx *ctx, int *szp);
|
||||
static int amcacew_getwc(const char *s, size_t len, int style,
|
||||
unsigned long *vp);
|
||||
static int amcacew_putwc(char *s, size_t len,
|
||||
unsigned long delta, int w);
|
||||
static int is_ldh(unsigned long v);
|
||||
|
||||
static mdn__ace_t amcacew_profile = {
|
||||
#ifdef MDN_AMCACEW_PREFIX
|
||||
mdn__ace_prefix,
|
||||
MDN_AMCACEW_PREFIX,
|
||||
#else
|
||||
mdn__ace_suffix,
|
||||
MDN_AMCACEW_SUFFIX,
|
||||
#endif
|
||||
amcacew_encode,
|
||||
amcacew_decode,
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* ARGSUSED */
|
||||
mdn_result_t
|
||||
mdn__amcacew_open(mdn_converter_t ctx, mdn_converter_dir_t dir,
|
||||
void **privdata)
|
||||
{
|
||||
return (mdn_success);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
mdn_result_t
|
||||
mdn__amcacew_close(mdn_converter_t ctx, void *privdata,
|
||||
mdn_converter_dir_t dir)
|
||||
{
|
||||
return (mdn_success);
|
||||
}
|
||||
|
||||
mdn_result_t
|
||||
mdn__amcacew_convert(mdn_converter_t ctx, void *privdata,
|
||||
mdn_converter_dir_t dir,
|
||||
const char *from, char *to, size_t tolen)
|
||||
{
|
||||
mdn_result_t r;
|
||||
|
||||
assert(ctx != NULL &&
|
||||
(dir == mdn_converter_l2u || dir == mdn_converter_u2l));
|
||||
|
||||
TRACE(("mdn__amcacew_convert(dir=%s,from=\"%s\")\n",
|
||||
dir == mdn_converter_l2u ? "l2u" : "u2l",
|
||||
mdn_debug_xstring(from, 20)));
|
||||
|
||||
r = mdn__ace_convert(&amcacew_profile, dir, from, to, tolen);
|
||||
if (r != mdn_success)
|
||||
return (r);
|
||||
|
||||
DUMP(("mdn__amcacew_convert: \"%s\"\n", mdn_debug_xstring(to, 70)));
|
||||
|
||||
return (r);
|
||||
}
|
||||
|
||||
static mdn_result_t
|
||||
amcacew_decode(const char *from, size_t fromlen, char *to, size_t tolen) {
|
||||
int literal_mode = 0;
|
||||
amcacew_ctx ctx;
|
||||
|
||||
/* Initialize refpoints. */
|
||||
amcacew_init_ctx(&ctx);
|
||||
|
||||
while (fromlen > 0) {
|
||||
unsigned long v;
|
||||
int len;
|
||||
|
||||
if (from[0] == '-') {
|
||||
if (fromlen > 1 && from[1] == '-') {
|
||||
v = '-';
|
||||
from += 2;
|
||||
fromlen -= 2;
|
||||
} else {
|
||||
literal_mode = !literal_mode;
|
||||
from++;
|
||||
fromlen--;
|
||||
continue;
|
||||
}
|
||||
} else if (literal_mode) {
|
||||
v = from[0];
|
||||
from++;
|
||||
fromlen--;
|
||||
} else {
|
||||
len = amcacew_getwc(from, fromlen, ctx.style, &v);
|
||||
if (len == 0)
|
||||
return (mdn_invalid_encoding);
|
||||
from += len;
|
||||
fromlen -= len;
|
||||
|
||||
v += ctx.refpoint[len];
|
||||
|
||||
amcacew_update_ctx(&ctx, v, len);
|
||||
}
|
||||
|
||||
len = mdn_utf8_putwc(to, tolen, v);
|
||||
if (len == 0)
|
||||
return (mdn_buffer_overflow);
|
||||
to += len;
|
||||
tolen -= len;
|
||||
}
|
||||
|
||||
/*
|
||||
* Terminate with NUL.
|
||||
*/
|
||||
if (tolen <= 0)
|
||||
return (mdn_buffer_overflow);
|
||||
*to = '\0';
|
||||
|
||||
return (mdn_success);
|
||||
}
|
||||
|
||||
static mdn_result_t
|
||||
amcacew_encode(const char *from, size_t fromlen, char *to, size_t tolen) {
|
||||
int literal_mode = 0;
|
||||
amcacew_ctx ctx;
|
||||
|
||||
/* Initialize refpoints. */
|
||||
amcacew_init_ctx(&ctx);
|
||||
|
||||
while (fromlen > 0) {
|
||||
unsigned long c;
|
||||
size_t len;
|
||||
|
||||
len = mdn_utf8_getwc(from, fromlen, &c);
|
||||
from += len;
|
||||
fromlen -= len;
|
||||
if (len == 0)
|
||||
return (mdn_invalid_encoding);
|
||||
|
||||
if (c > MAX_UCS) {
|
||||
/*
|
||||
* Invalid Unicode code point.
|
||||
*/
|
||||
return (mdn_invalid_encoding);
|
||||
} else if (c == '-') {
|
||||
/*
|
||||
* Convert "-" to "--".
|
||||
*/
|
||||
if (tolen < 2)
|
||||
return (mdn_buffer_overflow);
|
||||
to[0] = to[1] = '-';
|
||||
to += 2;
|
||||
tolen -= 2;
|
||||
} else if (is_ldh(c)) {
|
||||
/*
|
||||
* LDH characters.
|
||||
*/
|
||||
if (literal_mode == 0) {
|
||||
/*
|
||||
* Go into literal mode.
|
||||
*/
|
||||
if (tolen < 1)
|
||||
return (mdn_buffer_overflow);
|
||||
*to++ = '-';
|
||||
tolen--;
|
||||
literal_mode = 1;
|
||||
}
|
||||
if (tolen < 1)
|
||||
return (mdn_buffer_overflow);
|
||||
*to++ = c;
|
||||
tolen--;
|
||||
} else {
|
||||
/*
|
||||
* Non-LDH characters.
|
||||
*/
|
||||
int sz;
|
||||
unsigned long delta;
|
||||
|
||||
if (literal_mode != 0) {
|
||||
/*
|
||||
* Get out of literal mode.
|
||||
*/
|
||||
if (tolen < 1)
|
||||
return (mdn_buffer_overflow);
|
||||
*to++ = '-';
|
||||
tolen--;
|
||||
literal_mode = 0;
|
||||
}
|
||||
delta = amcacew_encode_delta(c, &ctx, &sz);
|
||||
sz = amcacew_putwc(to, tolen, delta, sz);
|
||||
if (sz == 0)
|
||||
return (mdn_buffer_overflow);
|
||||
to += sz;
|
||||
tolen -= sz;
|
||||
amcacew_update_ctx(&ctx, c, sz);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Terminate with NUL.
|
||||
*/
|
||||
if (tolen <= 0)
|
||||
return (mdn_buffer_overflow);
|
||||
|
||||
*to = '\0';
|
||||
|
||||
return (mdn_success);
|
||||
}
|
||||
|
||||
static void
|
||||
amcacew_init_ctx(amcacew_ctx *ctx) {
|
||||
ctx->style = 0;
|
||||
(void)memcpy(ctx->refpoint, amcacew_refpoint_initial,
|
||||
sizeof(ctx->refpoint));
|
||||
}
|
||||
|
||||
static void
|
||||
amcacew_update_ctx(amcacew_ctx *ctx, unsigned long v, int sz) {
|
||||
if (sz != 3)
|
||||
ctx->style = (sz < 3) ? 0 : 1;
|
||||
|
||||
#define ROUND_BITS(v, b) (((v) >> (b)) << (b))
|
||||
/* Update refpoint[1] */
|
||||
ctx->refpoint[1] = ROUND_BITS(v, 4);
|
||||
|
||||
/* Update refpoint[2] */
|
||||
if (sz > 2) {
|
||||
if (0xa0 <= v && v <= 0x17f)
|
||||
ctx->refpoint[2] = 0xa0;
|
||||
else
|
||||
ctx->refpoint[2] = ROUND_BITS(v, 8);
|
||||
}
|
||||
|
||||
/* Update refpoint[3] */
|
||||
if (sz > 3) {
|
||||
if (0x3000 <= v && v <= 0x9fff)
|
||||
ctx->refpoint[3] = 0x4e00;
|
||||
else if (0xa000 <= v && v <= 0xd7ff && ctx->style == 1)
|
||||
ctx->refpoint[3] = 0x8800;
|
||||
else
|
||||
ctx->refpoint[3] = ROUND_BITS(v, 12);
|
||||
}
|
||||
#undef ROUND_BITS
|
||||
}
|
||||
|
||||
static unsigned long
|
||||
amcacew_encode_delta(unsigned long v, amcacew_ctx *ctx, int *szp) {
|
||||
int sz, szinit;
|
||||
unsigned long *maxdelta;
|
||||
unsigned long *refpoint = ctx->refpoint;
|
||||
static unsigned long maxdelta_style0[6] = {
|
||||
0, 0xf, 0xff, 0xfff, 0xffff, 0xfffff,
|
||||
};
|
||||
static unsigned long maxdelta_style1[6] = {
|
||||
0, 0, 0xff, 0x4fff, 0xffff, 0xfffff,
|
||||
};
|
||||
|
||||
if (ctx->style == 0) {
|
||||
szinit = 1;
|
||||
maxdelta = maxdelta_style0;
|
||||
} else {
|
||||
szinit = 2;
|
||||
maxdelta = maxdelta_style1;
|
||||
}
|
||||
for (sz = szinit; sz < 6; sz++) {
|
||||
if (v >= refpoint[sz] && v - refpoint[sz] <= maxdelta[sz]) {
|
||||
*szp = sz;
|
||||
return (v - refpoint[sz]);
|
||||
}
|
||||
}
|
||||
FATAL(("amcacew_encode_mode: internal error\n"));
|
||||
return (0); /* for lint */
|
||||
}
|
||||
|
||||
static int
|
||||
amcacew_getwc(const char *s, size_t len, int style, unsigned long *vp) {
|
||||
size_t orglen = len;
|
||||
unsigned long v = 0;
|
||||
int style1_special = 0;
|
||||
|
||||
while (len > 0) {
|
||||
int c = *s++;
|
||||
|
||||
if ('a' <= c && c <= 'z')
|
||||
c = base32decode_ascii[c - 'a'];
|
||||
else if ('A' <= c && c <= 'Z')
|
||||
c = base32decode_ascii[c - 'A'];
|
||||
else if ('0' <= c && c <= '9')
|
||||
c = base32decode_digit[c - '0'];
|
||||
else
|
||||
c = -1;
|
||||
|
||||
if (c < 0)
|
||||
return (0); /* invalid character */
|
||||
|
||||
if (style == 1 && len == orglen && (c & 0x10) == 0)
|
||||
style1_special = 3;
|
||||
|
||||
len--;
|
||||
if (style1_special != 0) {
|
||||
v = (v << 5) + (c & 0x1f);
|
||||
if (--style1_special == 0) {
|
||||
*vp = v + 0x1000;
|
||||
return (3);
|
||||
}
|
||||
} else {
|
||||
v = (v << 4) + (c & 0xf);
|
||||
|
||||
if ((c & 0x10) == 0) {
|
||||
*vp = v;
|
||||
return (orglen - len);
|
||||
}
|
||||
}
|
||||
}
|
||||
return (0); /* final character missing */
|
||||
}
|
||||
|
||||
static int
|
||||
amcacew_putwc(char *s, size_t len, unsigned long delta, int w) {
|
||||
if (len < w)
|
||||
return (0);
|
||||
|
||||
if (w == 3 && delta >= 0x1000) {
|
||||
delta -= 0x1000;
|
||||
s[0] = base32encode[(delta >> 10) & 0x1f];
|
||||
s[1] = base32encode[(delta >> 5) & 0x1f];
|
||||
s[2] = base32encode[delta & 0x1f];
|
||||
} else {
|
||||
int i, shift;
|
||||
|
||||
for (shift = 0, i = w - 1; i >= 0; i--) {
|
||||
s[i] = base32encode[(delta & 0xf) + shift];
|
||||
delta >>= 4;
|
||||
shift = 16;
|
||||
}
|
||||
}
|
||||
return (w);
|
||||
}
|
||||
|
||||
static int
|
||||
is_ldh(unsigned long v) {
|
||||
if (('a' <= v && v <= 'z') || ('A' <= v && v <= 'Z') ||
|
||||
('0' <= v && v <= '9') || v == '-')
|
||||
return (1);
|
||||
else
|
||||
return (0);
|
||||
}
|
||||
@@ -1,484 +0,0 @@
|
||||
#ifndef lint
|
||||
static char *rcsid = "$Id: amcacez.c,v 1.1 2002/02/08 05:39:57 marka Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Japan Network Information Center.
|
||||
* All rights reserved.
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set forth bellow.
|
||||
*
|
||||
* LICENSE TERMS AND CONDITIONS
|
||||
*
|
||||
* The following License Terms and Conditions apply, unless a different
|
||||
* license is obtained from Japan Network Information Center ("JPNIC"),
|
||||
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
|
||||
* Chiyoda-ku, Tokyo 101-0047, Japan.
|
||||
*
|
||||
* 1. Use, Modification and Redistribution (including distribution of any
|
||||
* modified or derived work) in source and/or binary forms is permitted
|
||||
* under this License Terms and Conditions.
|
||||
*
|
||||
* 2. Redistribution of source code must retain the copyright notices as they
|
||||
* appear in each source code file, this License Terms and Conditions.
|
||||
*
|
||||
* 3. Redistribution in binary form must reproduce the Copyright Notice,
|
||||
* this License Terms and Conditions, in the documentation and/or other
|
||||
* materials provided with the distribution. For the purposes of binary
|
||||
* distribution the "Copyright Notice" refers to the following language:
|
||||
* "Copyright (c) Japan Network Information Center. All rights reserved."
|
||||
*
|
||||
* 4. Neither the name of JPNIC may be used to endorse or promote products
|
||||
* derived from this Software without specific prior written approval of
|
||||
* JPNIC.
|
||||
*
|
||||
* 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* 6. Indemnification by Licensee
|
||||
* Any person or entities using and/or redistributing this Software under
|
||||
* this License Terms and Conditions shall defend indemnify and hold
|
||||
* harmless JPNIC from and against any and all judgements damages,
|
||||
* expenses, settlement liabilities, cost and other liabilities of any
|
||||
* kind as a result of use and redistribution of this Software or any
|
||||
* claim, suite, action, litigation or proceeding by any third party
|
||||
* arising out of or relates to this License Terms and Conditions.
|
||||
*
|
||||
* 7. Governing Law, Jurisdiction and Venue
|
||||
* This License Terms and Conditions shall be governed by and and
|
||||
* construed in accordance with the law of Japan. Any person or entities
|
||||
* using and/or redistributing this Software under this License Terms and
|
||||
* Conditions hereby agrees and consent to the personal and exclusive
|
||||
* jurisdiction and venue of Tokyo District Court of Japan.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <mdn/result.h>
|
||||
#include <mdn/assert.h>
|
||||
#include <mdn/logmacro.h>
|
||||
#include <mdn/converter.h>
|
||||
#include <mdn/utf8.h>
|
||||
#include <mdn/debug.h>
|
||||
#include <mdn/amcacez.h>
|
||||
#include <mdn/ace.h>
|
||||
#include <mdn/util.h>
|
||||
|
||||
/*
|
||||
* Although draft-ietf-idn-amc-ace-z-01.txt doesn't specify the ACE
|
||||
* signature, we have to choose one. In order to prevent the converted
|
||||
* name from beginning with a hyphen, we should choose a prefix rather
|
||||
* than a suffix.
|
||||
*/
|
||||
#if !defined(MDN_AMCACEZ_PREFIX) && !defined(MDN_AMCACEZ_SUFFIX)
|
||||
#define MDN_AMCACEZ_PREFIX "zq--"
|
||||
#endif
|
||||
|
||||
#define INVALID_UCS 0x80000000
|
||||
#define MAX_UCS 0x10FFFF
|
||||
|
||||
/*
|
||||
* As the draft states, it is possible that `delta' may overflow during
|
||||
* the encoding. The upper bound of 'delta' is:
|
||||
* <# of chars. of input string> + <max. difference in code point> *
|
||||
* <# of chars. of input string + 1>
|
||||
* For this value not to be greater than 0xffffffff (since the calculation
|
||||
* is done using unsigned long, which is at least 32bit long), the maxmum
|
||||
* input string size is about 3850 characters, which is long enough for
|
||||
* a domain label...
|
||||
*/
|
||||
#define AMCACEZ_MAXINPUT 3800
|
||||
|
||||
/*
|
||||
* Parameters.
|
||||
*/
|
||||
#define AMCACEZ_BASE 36
|
||||
#define AMCACEZ_TMIN 1
|
||||
#define AMCACEZ_TMAX 26
|
||||
#define AMCACEZ_SKEW 38
|
||||
#define AMCACEZ_DAMP 700
|
||||
#define AMCACEZ_INITIAL_BIAS 72
|
||||
#define AMCACEZ_INITIAL_N 0x80
|
||||
|
||||
static mdn_result_t amcacez_decode(const char *from, size_t fromlen,
|
||||
char *to, size_t tolen);
|
||||
static mdn_result_t amcacez_encode(const char *from, size_t fromlen,
|
||||
char *to, size_t tolen);
|
||||
static int amcacez_getwc(const char *s, size_t len,
|
||||
int bias, unsigned long *vp);
|
||||
static int amcacez_putwc(char *s, size_t len,
|
||||
unsigned long delta, int bias);
|
||||
static int amcacez_update_bias(unsigned long delta,
|
||||
size_t npoints, int first);
|
||||
|
||||
static mdn__ace_t amcacez_profile = {
|
||||
#ifdef MDN_AMCACEZ_PREFIX
|
||||
mdn__ace_prefix,
|
||||
MDN_AMCACEZ_PREFIX,
|
||||
#else
|
||||
mdn__ace_suffix,
|
||||
MDN_AMCACEZ_SUFFIX,
|
||||
#endif
|
||||
amcacez_encode,
|
||||
amcacez_decode,
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* ARGSUSED */
|
||||
mdn_result_t
|
||||
mdn__amcacez_open(mdn_converter_t ctx, mdn_converter_dir_t dir,
|
||||
void **privdata)
|
||||
{
|
||||
return (mdn_success);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
mdn_result_t
|
||||
mdn__amcacez_close(mdn_converter_t ctx, void *privdata,
|
||||
mdn_converter_dir_t dir)
|
||||
{
|
||||
return (mdn_success);
|
||||
}
|
||||
|
||||
mdn_result_t
|
||||
mdn__amcacez_convert(mdn_converter_t ctx, void *privdata,
|
||||
mdn_converter_dir_t dir,
|
||||
const char *from, char *to, size_t tolen)
|
||||
{
|
||||
mdn_result_t r;
|
||||
|
||||
assert(ctx != NULL &&
|
||||
(dir == mdn_converter_l2u || dir == mdn_converter_u2l));
|
||||
|
||||
TRACE(("mdn__amcacez_convert(dir=%s,from=\"%s\")\n",
|
||||
dir == mdn_converter_l2u ? "l2u" : "u2l",
|
||||
mdn_debug_xstring(from, 20)));
|
||||
|
||||
r = mdn__ace_convert(&amcacez_profile, dir, from, to, tolen);
|
||||
if (r != mdn_success)
|
||||
return (r);
|
||||
|
||||
DUMP(("mdn__amcacez_convert: \"%s\"\n", mdn_debug_xstring(to, 70)));
|
||||
|
||||
return (r);
|
||||
}
|
||||
|
||||
static mdn_result_t
|
||||
amcacez_decode(const char *from, size_t fromlen, char *to, size_t tolen) {
|
||||
unsigned long *ucs, ucs_tmp[64], c, idx;
|
||||
size_t uidx, fidx, ucslen;
|
||||
int first, bias;
|
||||
mdn_result_t r;
|
||||
|
||||
/*
|
||||
* Allocate enough memory for UCS-4 code point array 'ucs'.
|
||||
*/
|
||||
if (fromlen > 64) {
|
||||
ucs = malloc(fromlen * sizeof(unsigned long));
|
||||
if (ucs == NULL)
|
||||
return (mdn_nomemory);
|
||||
} else {
|
||||
ucs = ucs_tmp;
|
||||
}
|
||||
ucslen = 0;
|
||||
|
||||
/*
|
||||
* Find the last delimiter, and copy the characters
|
||||
* before it verbatim.
|
||||
*/
|
||||
for (fidx = fromlen; fidx > 0; fidx--) {
|
||||
if (from[fidx - 1] == '-') {
|
||||
for (uidx = 0; uidx < fidx - 1; uidx++) {
|
||||
ucs[uidx] = from[uidx];
|
||||
}
|
||||
ucslen = uidx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
first = 1;
|
||||
bias = AMCACEZ_INITIAL_BIAS;
|
||||
c = AMCACEZ_INITIAL_N;
|
||||
idx = 0;
|
||||
while (fidx < fromlen) {
|
||||
int len;
|
||||
unsigned long delta;
|
||||
int i;
|
||||
|
||||
len = amcacez_getwc(from + fidx, fromlen - fidx, bias, &delta);
|
||||
if (len == 0)
|
||||
return (mdn_invalid_encoding);
|
||||
fidx += len;
|
||||
|
||||
bias = amcacez_update_bias(delta, ucslen + 1, first);
|
||||
first = 0;
|
||||
idx += delta;
|
||||
c += idx / (ucslen + 1);
|
||||
uidx = idx % (ucslen + 1);
|
||||
|
||||
/* Insert 'c' at uidx. */
|
||||
for (i = ucslen; i > uidx; i--)
|
||||
ucs[i] = ucs[i - 1];
|
||||
ucs[uidx] = c;
|
||||
|
||||
ucslen++;
|
||||
idx = uidx + 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert from UCS-4 to UTF-8.
|
||||
*/
|
||||
for (uidx = 0; uidx < ucslen; uidx++) {
|
||||
int len = mdn_utf8_putwc(to, tolen, ucs[uidx]);
|
||||
if (len == 0)
|
||||
goto overflow;
|
||||
to += len;
|
||||
tolen -= len;
|
||||
}
|
||||
/* Terminate with NUL. */
|
||||
if (tolen <= 0)
|
||||
goto overflow;
|
||||
*to = '\0';
|
||||
|
||||
r = mdn_success;
|
||||
ret:
|
||||
if (ucs != ucs_tmp)
|
||||
free(ucs);
|
||||
return (r);
|
||||
|
||||
overflow:
|
||||
r = mdn_buffer_overflow;
|
||||
goto ret;
|
||||
}
|
||||
|
||||
static mdn_result_t
|
||||
amcacez_encode(const char *from, size_t fromlen, char *to, size_t tolen) {
|
||||
unsigned long *ucs, ucs_tmp[64];
|
||||
unsigned long cur_code, next_code, delta;
|
||||
size_t ucslen, ucsdone;
|
||||
size_t toidx;
|
||||
int uidx, bias, first;
|
||||
mdn_result_t r;
|
||||
|
||||
/*
|
||||
* Convert UTF-8 string 'from' to UCS-4 code point array 'ucs'.
|
||||
*/
|
||||
if (fromlen > 64) {
|
||||
ucs = malloc(fromlen * sizeof(unsigned long));
|
||||
if (ucs == NULL)
|
||||
return (mdn_nomemory);
|
||||
} else {
|
||||
ucs = ucs_tmp;
|
||||
}
|
||||
ucslen = 0;
|
||||
while (fromlen > 0) {
|
||||
unsigned long c;
|
||||
int len;
|
||||
|
||||
len = mdn_utf8_getwc(from, fromlen, &c);
|
||||
if (len == 0 || c > MAX_UCS)
|
||||
goto invalid;
|
||||
ucs[ucslen++] = c;
|
||||
from += len;
|
||||
fromlen -= len;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the input string is too long (actually too long to be sane),
|
||||
* return failure in order to prevent possible overflow.
|
||||
*/
|
||||
if (ucslen > AMCACEZ_MAXINPUT)
|
||||
return (mdn_failure);
|
||||
|
||||
ucsdone = 0; /* number of characters processed */
|
||||
toidx = 0;
|
||||
|
||||
/*
|
||||
* First, pick up basic code points and copy them to 'to'.
|
||||
*/
|
||||
for (uidx = 0; uidx < ucslen; uidx++) {
|
||||
if (ucs[uidx] < 0x80) {
|
||||
if (toidx >= tolen)
|
||||
goto overflow;
|
||||
to[toidx++] = ucs[uidx];
|
||||
ucsdone++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If there are any basic code points, output a delimiter
|
||||
* (hyphen-minus).
|
||||
*/
|
||||
if (toidx > 0) {
|
||||
if (toidx >= tolen)
|
||||
goto overflow;
|
||||
to[toidx++] = '-';
|
||||
to += toidx;
|
||||
tolen -= toidx;
|
||||
}
|
||||
|
||||
/*
|
||||
* Then encode non-basic characters.
|
||||
*/
|
||||
first = 1;
|
||||
cur_code = AMCACEZ_INITIAL_N;
|
||||
bias = AMCACEZ_INITIAL_BIAS;
|
||||
delta = 0;
|
||||
while (ucsdone < ucslen) {
|
||||
int limit = -1, rest;
|
||||
|
||||
/*
|
||||
* Find the smallest code point equal to or greater
|
||||
* than 'cur_code'. Also remember the index of the
|
||||
* last occurence of the code point.
|
||||
*/
|
||||
for (next_code = MAX_UCS, uidx = ucslen - 1;
|
||||
uidx >= 0; uidx--) {
|
||||
if (ucs[uidx] >= cur_code && ucs[uidx] < next_code) {
|
||||
next_code = ucs[uidx];
|
||||
limit = uidx;
|
||||
}
|
||||
}
|
||||
/* There must be such code point. */
|
||||
assert(limit >= 0);
|
||||
|
||||
delta += (next_code - cur_code) * (ucsdone + 1);
|
||||
cur_code = next_code;
|
||||
|
||||
/*
|
||||
* Scan the input string again, and encode characters
|
||||
* whose code point is 'cur_code'. Use 'limit' to avoid
|
||||
* unnecessary scan.
|
||||
*/
|
||||
for (uidx = 0, rest = ucsdone; uidx <= limit; uidx++) {
|
||||
if (ucs[uidx] < cur_code) {
|
||||
delta++;
|
||||
rest--;
|
||||
} else if (ucs[uidx] == cur_code) {
|
||||
int sz = amcacez_putwc(to, tolen, delta, bias);
|
||||
if (sz == 0)
|
||||
goto overflow;
|
||||
to += sz;
|
||||
tolen -= sz;
|
||||
ucsdone++;
|
||||
bias = amcacez_update_bias(delta, ucsdone,
|
||||
first);
|
||||
delta = 0;
|
||||
first = 0;
|
||||
}
|
||||
}
|
||||
delta += rest + 1;
|
||||
cur_code++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Terminate with NUL.
|
||||
*/
|
||||
if (tolen <= 0)
|
||||
goto overflow;
|
||||
*to = '\0';
|
||||
|
||||
r = mdn_success;
|
||||
ret:
|
||||
if (ucs != ucs_tmp)
|
||||
free(ucs);
|
||||
return (r);
|
||||
|
||||
invalid:
|
||||
r = mdn_invalid_encoding;
|
||||
goto ret;
|
||||
overflow:
|
||||
r = mdn_buffer_overflow;
|
||||
goto ret;
|
||||
}
|
||||
|
||||
static int
|
||||
amcacez_getwc(const char *s, size_t len, int bias, unsigned long *vp) {
|
||||
size_t orglen = len;
|
||||
unsigned long v = 0, w = 1;
|
||||
int k;
|
||||
|
||||
for (k = AMCACEZ_BASE - bias; len > 0; k += AMCACEZ_BASE) {
|
||||
int c = *s++;
|
||||
int t = (k < AMCACEZ_TMIN) ? AMCACEZ_TMIN :
|
||||
(k > AMCACEZ_TMAX) ? AMCACEZ_TMAX : k;
|
||||
|
||||
len--;
|
||||
if ('a' <= c && c <= 'z')
|
||||
c = c - 'a';
|
||||
else if ('A' <= c && c <= 'Z')
|
||||
c = c - 'A';
|
||||
else if ('0' <= c && c <= '9')
|
||||
c = c - '0' + 26;
|
||||
else
|
||||
c = -1;
|
||||
|
||||
if (c < 0)
|
||||
return (0); /* invalid character */
|
||||
|
||||
v += c * w;
|
||||
|
||||
if (c < t) {
|
||||
*vp = v;
|
||||
return (orglen - len);
|
||||
}
|
||||
|
||||
w *= (AMCACEZ_BASE - t);
|
||||
}
|
||||
|
||||
return (0); /* final character missing */
|
||||
}
|
||||
|
||||
static int
|
||||
amcacez_putwc(char *s, size_t len, unsigned long delta, int bias) {
|
||||
const char *amcacez_base36 = "abcdefghijklmnopqrstuvwxyz0123456789";
|
||||
int k;
|
||||
char *sorg = s;
|
||||
|
||||
for (k = AMCACEZ_BASE - bias; 1; k += AMCACEZ_BASE) {
|
||||
int t = (k < AMCACEZ_TMIN) ? AMCACEZ_TMIN :
|
||||
(k > AMCACEZ_TMAX) ? AMCACEZ_TMAX : k;
|
||||
|
||||
if (delta < t)
|
||||
break;
|
||||
if (len < 1)
|
||||
return (0);
|
||||
*s++ = amcacez_base36[t + ((delta - t) % (AMCACEZ_BASE - t))];
|
||||
len--;
|
||||
delta = (delta - t) / (AMCACEZ_BASE - t);
|
||||
}
|
||||
if (len < 1)
|
||||
return (0);
|
||||
*s++ = amcacez_base36[delta];
|
||||
return (s - sorg);
|
||||
}
|
||||
|
||||
static int
|
||||
amcacez_update_bias(unsigned long delta, size_t npoints, int first) {
|
||||
int k = 0;
|
||||
|
||||
delta /= first ? AMCACEZ_DAMP : 2;
|
||||
delta += delta / npoints;
|
||||
|
||||
while (delta > ((AMCACEZ_BASE - AMCACEZ_TMIN) * AMCACEZ_TMAX) / 2) {
|
||||
delta /= AMCACEZ_BASE - AMCACEZ_TMIN;
|
||||
k++;
|
||||
}
|
||||
return (AMCACEZ_BASE * k +
|
||||
(((AMCACEZ_BASE - AMCACEZ_TMIN + 1) * delta) /
|
||||
(delta + AMCACEZ_SKEW)));
|
||||
}
|
||||
@@ -1,506 +0,0 @@
|
||||
#ifndef lint
|
||||
static char *rcsid = "$Id: mace.c,v 1.1 2002/02/08 05:40:14 marka Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Japan Network Information Center. All rights reserved.
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set forth bellow.
|
||||
*
|
||||
* LICENSE TERMS AND CONDITIONS
|
||||
*
|
||||
* The following License Terms and Conditions apply, unless a different
|
||||
* license is obtained from Japan Network Information Center ("JPNIC"),
|
||||
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
|
||||
* Chiyoda-ku, Tokyo 101-0047, Japan.
|
||||
*
|
||||
* 1. Use, Modification and Redistribution (including distribution of any
|
||||
* modified or derived work) in source and/or binary forms is permitted
|
||||
* under this License Terms and Conditions.
|
||||
*
|
||||
* 2. Redistribution of source code must retain the copyright notices as they
|
||||
* appear in each source code file, this License Terms and Conditions.
|
||||
*
|
||||
* 3. Redistribution in binary form must reproduce the Copyright Notice,
|
||||
* this License Terms and Conditions, in the documentation and/or other
|
||||
* materials provided with the distribution. For the purposes of binary
|
||||
* distribution the "Copyright Notice" refers to the following language:
|
||||
* "Copyright (c) Japan Network Information Center. All rights reserved."
|
||||
*
|
||||
* 4. Neither the name of JPNIC may be used to endorse or promote products
|
||||
* derived from this Software without specific prior written approval of
|
||||
* JPNIC.
|
||||
*
|
||||
* 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* 6. Indemnification by Licensee
|
||||
* Any person or entities using and/or redistributing this Software under
|
||||
* this License Terms and Conditions shall defend indemnify and hold
|
||||
* harmless JPNIC from and against any and all judgements damages,
|
||||
* expenses, settlement liabilities, cost and other liabilities of any
|
||||
* kind as a result of use and redistribution of this Software or any
|
||||
* claim, suite, action, litigation or proceeding by any third party
|
||||
* arising out of or relates to this License Terms and Conditions.
|
||||
*
|
||||
* 7. Governing Law, Jurisdiction and Venue
|
||||
* This License Terms and Conditions shall be governed by and and
|
||||
* construed in accordance with the law of Japan. Any person or entities
|
||||
* using and/or redistributing this Software under this License Terms and
|
||||
* Conditions hereby agrees and consent to the personal and exclusive
|
||||
* jurisdiction and venue of Tokyo District Court of Japan.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <mdn/result.h>
|
||||
#include <mdn/assert.h>
|
||||
#include <mdn/logmacro.h>
|
||||
#include <mdn/converter.h>
|
||||
#include <mdn/utf8.h>
|
||||
#include <mdn/debug.h>
|
||||
#include <mdn/mace.h>
|
||||
#include <mdn/ace.h>
|
||||
#include <mdn/util.h>
|
||||
|
||||
/*
|
||||
* MACE
|
||||
*/
|
||||
|
||||
#ifndef MDN_MACE_PREFIX
|
||||
#define MDN_MACE_PREFIX "mq--"
|
||||
#endif
|
||||
|
||||
/* Mode switcher */
|
||||
#define MACE_MODE_SWITCH '-' /* Literal/Non-Literal switching */
|
||||
|
||||
/* Submode introducer */
|
||||
#define MACE_SUBMODE_BMP_A 'w' /* U+0000-U+1FFF, U+A000-U+FFFF */
|
||||
#define MACE_SUBMODE_BMP_B 'x' /* U+2000-U+9FFF */
|
||||
#define MACE_SUBMODE_NONBMP 'y' /* U+10000-U+10FFFF */
|
||||
#define MACE_SUBMODE_COMP 'z' /* 4/9bit differential encoding */
|
||||
|
||||
/* Initial state */
|
||||
#define MACE_SUBMODE_INIT MACE_SUBMODE_BMP_A
|
||||
#define MACE_PREV_INIT 0
|
||||
|
||||
#define MACE_COMP_BITS_1 4
|
||||
#define MACE_COMP_BITS_2 9
|
||||
#define MACE_COMP_MASK ((1 << MACE_COMP_BITS_2) - 1)
|
||||
#define MACE_SAME_PREFIX(b, c1, c2) (((c1) ^ (c2)) < (1 << (b)))
|
||||
|
||||
#define MACE_INVALID_CHAR 0x80000000
|
||||
|
||||
static mdn_result_t mace_decode(const char *from, size_t fromlen,
|
||||
char *to, size_t tolen);
|
||||
static mdn_result_t mace_encode(const char *from, size_t fromlen,
|
||||
char *to, size_t tolen);
|
||||
static int mace_get_submode(int submode, unsigned long c,
|
||||
unsigned long prev,
|
||||
const char *rest, size_t rlen);
|
||||
static int mace_getbase32(const char *s, int w,
|
||||
unsigned long *vp);
|
||||
static int mace_encodelength(int submode);
|
||||
static int mace_getwc(const char *s, size_t len, int mode,
|
||||
unsigned long ref, unsigned long *vp);
|
||||
static int mace_putwc(char *s, size_t len, int mode,
|
||||
unsigned long ref, unsigned long v);
|
||||
static int peek_next_nonldh(const char *rest, size_t rlen,
|
||||
unsigned long *cp);
|
||||
static int letter_or_digit(unsigned long v);
|
||||
|
||||
static mdn__ace_t mace_ctx = {
|
||||
mdn__ace_prefix,
|
||||
MDN_MACE_PREFIX,
|
||||
mace_encode,
|
||||
mace_decode,
|
||||
};
|
||||
|
||||
/* ARGSUSED */
|
||||
mdn_result_t
|
||||
mdn__mace_open(mdn_converter_t ctx, mdn_converter_dir_t dir,
|
||||
void **privdata)
|
||||
{
|
||||
return (mdn_success);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
mdn_result_t
|
||||
mdn__mace_close(mdn_converter_t ctx, void *privdata,
|
||||
mdn_converter_dir_t dir)
|
||||
{
|
||||
return (mdn_success);
|
||||
}
|
||||
|
||||
mdn_result_t
|
||||
mdn__mace_convert(mdn_converter_t ctx, void *privdata,
|
||||
mdn_converter_dir_t dir,
|
||||
const char *from, char *to, size_t tolen)
|
||||
{
|
||||
mdn_result_t r;
|
||||
|
||||
assert(ctx != NULL &&
|
||||
(dir == mdn_converter_l2u || dir == mdn_converter_u2l));
|
||||
|
||||
TRACE(("mdn__mace_convert(dir=%s,from=\"%s\")\n",
|
||||
dir == mdn_converter_l2u ? "l2u" : "u2l",
|
||||
mdn_debug_xstring(from, 20)));
|
||||
|
||||
r = mdn__ace_convert(&mace_ctx, dir, from, to, tolen);
|
||||
if (r != mdn_success)
|
||||
return (r);
|
||||
|
||||
DUMP(("mdn__mace_convert: \"%s\"\n", mdn_debug_xstring(to, 70)));
|
||||
|
||||
return (r);
|
||||
}
|
||||
|
||||
static mdn_result_t
|
||||
mace_decode(const char *from, size_t fromlen, char *to, size_t tolen) {
|
||||
int literal = 0;
|
||||
int submode = MACE_SUBMODE_INIT;
|
||||
unsigned long prev = MACE_PREV_INIT;
|
||||
|
||||
while (fromlen > 0) {
|
||||
int consume = 1; /* # of input octets consumed */
|
||||
unsigned long c = MACE_INVALID_CHAR;
|
||||
|
||||
if (from[0] == MACE_MODE_SWITCH) {
|
||||
/*
|
||||
* LD/non-LD mode switcher or just a hyphen.
|
||||
*/
|
||||
if (fromlen > 1 && from[1] == MACE_MODE_SWITCH) {
|
||||
c = MACE_MODE_SWITCH;
|
||||
consume = 2;
|
||||
} else {
|
||||
literal = !literal;
|
||||
}
|
||||
} else if (literal) {
|
||||
/*
|
||||
* Now in LD mode. Just output literally.
|
||||
*/
|
||||
if (tolen < 1)
|
||||
return (mdn_buffer_overflow);
|
||||
c = from[0];
|
||||
} else if (from[0] == 'w' || from[0] == 'W') {
|
||||
submode = MACE_SUBMODE_BMP_A;
|
||||
} else if (from[0] == 'x' || from[0] == 'X') {
|
||||
submode = MACE_SUBMODE_BMP_B;
|
||||
} else if (from[0] == 'y' || from[0] == 'Y') {
|
||||
submode = MACE_SUBMODE_NONBMP;
|
||||
} else if (from[0] == 'z' || from[0] == 'Z') {
|
||||
submode = MACE_SUBMODE_COMP;
|
||||
} else {
|
||||
/*
|
||||
* Must be base32-format string.
|
||||
*/
|
||||
consume = mace_getwc(from, fromlen, submode,
|
||||
prev, &c);
|
||||
if (consume == 0)
|
||||
return (mdn_invalid_encoding);
|
||||
prev = c;
|
||||
}
|
||||
|
||||
/* Output decoded character. */
|
||||
if (c != MACE_INVALID_CHAR) {
|
||||
size_t len = mdn_utf8_putwc(to, tolen, c);
|
||||
if (len == 0)
|
||||
return (mdn_buffer_overflow);
|
||||
to += len;
|
||||
tolen -= len;
|
||||
}
|
||||
|
||||
from += consume;
|
||||
fromlen -= consume;
|
||||
}
|
||||
|
||||
/*
|
||||
* Terminate with NUL.
|
||||
*/
|
||||
if (tolen <= 0)
|
||||
return (mdn_buffer_overflow);
|
||||
*to = '\0';
|
||||
|
||||
return (mdn_success);
|
||||
}
|
||||
|
||||
static mdn_result_t
|
||||
mace_encode(const char *from, size_t fromlen, char *to, size_t tolen) {
|
||||
int literal = 0;
|
||||
int submode = MACE_SUBMODE_INIT;
|
||||
unsigned long prev = MACE_PREV_INIT;
|
||||
|
||||
while (fromlen > 0) {
|
||||
unsigned long c;
|
||||
size_t len;
|
||||
|
||||
/* Get next character. */
|
||||
len = mdn_utf8_getwc(from, fromlen, &c);
|
||||
if (len == 0 || c > 0x10ffff)
|
||||
return (mdn_invalid_encoding);
|
||||
from += len;
|
||||
fromlen -= len;
|
||||
|
||||
if (c == '-') {
|
||||
/*
|
||||
* Hyphen. Always encode as `--'.
|
||||
*/
|
||||
if (tolen < 2)
|
||||
return (mdn_buffer_overflow);
|
||||
to[0] = to[1] = '-';
|
||||
to += 2;
|
||||
tolen -= 2;
|
||||
} else if (letter_or_digit(c)) {
|
||||
/*
|
||||
* Letter or digit.
|
||||
* Shift to Literal mode if necessary, then
|
||||
* encode it as it is.
|
||||
*/
|
||||
if (!literal) {
|
||||
if (tolen < 1)
|
||||
return (mdn_buffer_overflow);
|
||||
*to++ = MACE_MODE_SWITCH;
|
||||
tolen--;
|
||||
literal = 1;
|
||||
}
|
||||
if (tolen < 1)
|
||||
return (mdn_buffer_overflow);
|
||||
*to++ = c;
|
||||
tolen--;
|
||||
} else {
|
||||
/*
|
||||
* Non-LDH character.
|
||||
*/
|
||||
int new_submode;
|
||||
|
||||
/* Move back from LD mode if necessary. */
|
||||
if (literal) {
|
||||
if (tolen < 1)
|
||||
return (mdn_buffer_overflow);
|
||||
*to++ = MACE_MODE_SWITCH;
|
||||
tolen--;
|
||||
literal = 0;
|
||||
}
|
||||
|
||||
/* Determine the new submode and shift to it. */
|
||||
new_submode = mace_get_submode(submode, c, prev,
|
||||
from, fromlen);
|
||||
if (new_submode != submode) {
|
||||
if (tolen < 1)
|
||||
return (mdn_buffer_overflow);
|
||||
*to++ = new_submode; /* introducer */
|
||||
tolen--;
|
||||
submode = new_submode;
|
||||
}
|
||||
|
||||
/* Encode and output the character. */
|
||||
len = mace_putwc(to, tolen, submode, prev, c);
|
||||
if (len == 0)
|
||||
return (mdn_buffer_overflow);
|
||||
to += len;
|
||||
tolen -= len;
|
||||
|
||||
prev = c;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Terminate with NUL.
|
||||
*/
|
||||
if (tolen < 1)
|
||||
return (mdn_buffer_overflow);
|
||||
|
||||
*to = '\0';
|
||||
return (mdn_success);
|
||||
}
|
||||
|
||||
static int
|
||||
mace_get_submode(int submode, unsigned long c, unsigned long prev,
|
||||
const char *rest, size_t rlen)
|
||||
{
|
||||
/*
|
||||
* Determine the submode.
|
||||
*/
|
||||
unsigned long nxt;
|
||||
|
||||
/*
|
||||
* First, check if we should use Compress submode.
|
||||
*/
|
||||
if (MACE_SAME_PREFIX(MACE_COMP_BITS_2, prev, c) &&
|
||||
(submode == MACE_SUBMODE_COMP ||
|
||||
c > 0xffff ||
|
||||
MACE_SAME_PREFIX(MACE_COMP_BITS_1, prev, c) ||
|
||||
(peek_next_nonldh(rest, rlen, &nxt) &&
|
||||
MACE_SAME_PREFIX(MACE_COMP_BITS_2, c, nxt))))
|
||||
return (MACE_SUBMODE_COMP);
|
||||
|
||||
/*
|
||||
* Then, determine the submode based on the code point.
|
||||
*/
|
||||
if (c > 0xffff)
|
||||
return (MACE_SUBMODE_NONBMP);
|
||||
else if (0x2000 <= c && c <= 0x9fff)
|
||||
return (MACE_SUBMODE_BMP_B);
|
||||
else
|
||||
return (MACE_SUBMODE_BMP_A);
|
||||
|
||||
}
|
||||
|
||||
static int
|
||||
mace_encodelength(int submode) {
|
||||
switch (submode) {
|
||||
case MACE_SUBMODE_BMP_A:
|
||||
case MACE_SUBMODE_BMP_B:
|
||||
return (3);
|
||||
case MACE_SUBMODE_NONBMP:
|
||||
return (4);
|
||||
default: /* MACE_SUBMODE_COMP */
|
||||
return (1); /* actually 1 or 2. caller must decide. */
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
mace_getbase32(const char *s, int w, unsigned long *vp) {
|
||||
unsigned long v = 0;
|
||||
|
||||
while (w-- > 0) {
|
||||
int c = *s++;
|
||||
|
||||
if ('a' <= c && c <= 'v')
|
||||
c = c - 'a' + 10;
|
||||
else if ('A' <= c && c <= 'V')
|
||||
c = c - 'A' + 10;
|
||||
else if ('0' <= c && c <= '9')
|
||||
c = c - '0';
|
||||
else
|
||||
return (0); /* invalid character */
|
||||
v = (v << 5) + (c & 0x1f);
|
||||
}
|
||||
*vp = v;
|
||||
return (1);
|
||||
}
|
||||
|
||||
static int
|
||||
mace_getwc(const char *s, size_t len, int submode,
|
||||
unsigned long prev, unsigned long *vp)
|
||||
{
|
||||
unsigned long v = 0;
|
||||
int w = mace_encodelength(submode);
|
||||
|
||||
if (len < w || !mace_getbase32(s, w, &v))
|
||||
return (0);
|
||||
|
||||
switch (submode) {
|
||||
case MACE_SUBMODE_BMP_A:
|
||||
if (v >= 0x2000)
|
||||
v += 0x8000;
|
||||
break;
|
||||
case MACE_SUBMODE_BMP_B:
|
||||
v += 0x2000;
|
||||
break;
|
||||
case MACE_SUBMODE_NONBMP:
|
||||
v += 0x10000;
|
||||
break;
|
||||
case MACE_SUBMODE_COMP:
|
||||
if (v > 0xf) {
|
||||
w = 2;
|
||||
if (len < w || !mace_getbase32(s, w, &v))
|
||||
return (0);
|
||||
}
|
||||
v = prev ^ (v & MACE_COMP_MASK);
|
||||
break;
|
||||
default:
|
||||
FATAL(("mace_getwc: internal error"));
|
||||
break;
|
||||
}
|
||||
*vp = v;
|
||||
|
||||
return (w);
|
||||
}
|
||||
|
||||
static int
|
||||
mace_putwc(char *s, size_t len, int submode,
|
||||
unsigned long prev, unsigned long v)
|
||||
{
|
||||
static const char *base32encode = "0123456789abcdefghijklmnopqrstuv";
|
||||
int w = mace_encodelength(submode);
|
||||
int i;
|
||||
|
||||
switch (submode) {
|
||||
case MACE_SUBMODE_BMP_A:
|
||||
if (v >= 0xa000)
|
||||
v -= 0x8000;
|
||||
break;
|
||||
case MACE_SUBMODE_BMP_B:
|
||||
v -= 0x2000;
|
||||
break;
|
||||
case MACE_SUBMODE_NONBMP:
|
||||
v -= 0x10000;
|
||||
break;
|
||||
case MACE_SUBMODE_COMP:
|
||||
v = (prev ^ v) & MACE_COMP_MASK;
|
||||
if (v > 0xf) {
|
||||
v |= 0x200;
|
||||
w++;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
FATAL(("mace_putwc: internal error"));
|
||||
break;
|
||||
}
|
||||
|
||||
if (len < w)
|
||||
return (0);
|
||||
|
||||
for (i = w - 1; i >= 0; i--) {
|
||||
s[i] = base32encode[v & 0x1f];
|
||||
v >>= 5;
|
||||
}
|
||||
return (w);
|
||||
}
|
||||
|
||||
static int
|
||||
peek_next_nonldh(const char *rest, size_t rlen, unsigned long *cp) {
|
||||
/*
|
||||
* Get the next non-LDH character from 'rest', store its
|
||||
* code point to '*cp' and return 1. If there are no
|
||||
* such character, return 0.
|
||||
*/
|
||||
while (rlen > 0) {
|
||||
unsigned long v;
|
||||
size_t len;
|
||||
|
||||
if ((len = mdn_utf8_getwc(rest, rlen, &v)) == 0) {
|
||||
break;
|
||||
} else if (v != '-' && !letter_or_digit(v)) {
|
||||
*cp = v;
|
||||
return (1);
|
||||
}
|
||||
rest += len;
|
||||
rlen -= len;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
letter_or_digit(unsigned long v) {
|
||||
if (('a' <= v && v <= 'z') ||
|
||||
('A' <= v && v <= 'Z') ||
|
||||
('0' <= v && v <= '9'))
|
||||
return (1);
|
||||
else
|
||||
return (0);
|
||||
}
|
||||
@@ -1,145 +0,0 @@
|
||||
/* $Id: unicode_template.c,v 1.1 2002/02/08 05:40:41 marka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000,2001 Japan Network Information Center.
|
||||
* All rights reserved.
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set forth bellow.
|
||||
*
|
||||
* LICENSE TERMS AND CONDITIONS
|
||||
*
|
||||
* The following License Terms and Conditions apply, unless a different
|
||||
* license is obtained from Japan Network Information Center ("JPNIC"),
|
||||
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
|
||||
* Chiyoda-ku, Tokyo 101-0047, Japan.
|
||||
*
|
||||
* 1. Use, Modification and Redistribution (including distribution of any
|
||||
* modified or derived work) in source and/or binary forms is permitted
|
||||
* under this License Terms and Conditions.
|
||||
*
|
||||
* 2. Redistribution of source code must retain the copyright notices as they
|
||||
* appear in each source code file, this License Terms and Conditions.
|
||||
*
|
||||
* 3. Redistribution in binary form must reproduce the Copyright Notice,
|
||||
* this License Terms and Conditions, in the documentation and/or other
|
||||
* materials provided with the distribution. For the purposes of binary
|
||||
* distribution the "Copyright Notice" refers to the following language:
|
||||
* "Copyright (c) Japan Network Information Center. All rights reserved."
|
||||
*
|
||||
* 4. Neither the name of JPNIC may be used to endorse or promote products
|
||||
* derived from this Software without specific prior written approval of
|
||||
* JPNIC.
|
||||
*
|
||||
* 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* 6. Indemnification by Licensee
|
||||
* Any person or entities using and/or redistributing this Software under
|
||||
* this License Terms and Conditions shall defend indemnify and hold
|
||||
* harmless JPNIC from and against any and all judgements damages,
|
||||
* expenses, settlement liabilities, cost and other liabilities of any
|
||||
* kind as a result of use and redistribution of this Software or any
|
||||
* claim, suite, action, litigation or proceeding by any third party
|
||||
* arising out of or relates to this License Terms and Conditions.
|
||||
*
|
||||
* 7. Governing Law, Jurisdiction and Venue
|
||||
* This License Terms and Conditions shall be governed by and and
|
||||
* construed in accordance with the law of Japan. Any person or entities
|
||||
* using and/or redistributing this Software under this License Terms and
|
||||
* Conditions hereby agrees and consent to the personal and exclusive
|
||||
* jurisdiction and venue of Tokyo District Court of Japan.
|
||||
*/
|
||||
|
||||
#ifndef UNICODE_TEMPLATE_INIT
|
||||
#define UNICODE_TEMPLATE_INIT
|
||||
|
||||
/*
|
||||
* Macro for multi-level index table.
|
||||
*/
|
||||
#define LOOKUPTBL(vprefix, mprefix, v) \
|
||||
DMAP(vprefix)[\
|
||||
IMAP(vprefix)[\
|
||||
IMAP(vprefix)[IDX0(mprefix, v)] + IDX1(mprefix, v)\
|
||||
]\
|
||||
].tbl[IDX2(mprefix, v)]
|
||||
|
||||
#define IDX0(mprefix, v) IDX_0(v, BITS1(mprefix), BITS2(mprefix))
|
||||
#define IDX1(mprefix, v) IDX_1(v, BITS1(mprefix), BITS2(mprefix))
|
||||
#define IDX2(mprefix, v) IDX_2(v, BITS1(mprefix), BITS2(mprefix))
|
||||
|
||||
#define IDX_0(v, bits1, bits2) ((v) >> ((bits1) + (bits2)))
|
||||
#define IDX_1(v, bits1, bits2) (((v) >> (bits2)) & ((1 << (bits1)) - 1))
|
||||
#define IDX_2(v, bits1, bits2) ((v) & ((1 << (bits2)) - 1))
|
||||
|
||||
#define BITS1(mprefix) mprefix ## _BITS_1
|
||||
#define BITS2(mprefix) mprefix ## _BITS_2
|
||||
|
||||
#define IMAP(vprefix) concat4(VERSION, _, vprefix, _imap)
|
||||
#define DMAP(vprefix) concat4(VERSION, _, vprefix, _table)
|
||||
#define SEQ(vprefix) concat4(VERSION, _, vprefix, _seq)
|
||||
#define concat4(a,b,c,d) concat4X(a, b, c, d)
|
||||
#define concat4X(a,b,c,d) a ## b ## c ## d
|
||||
|
||||
#endif /* UNICODE_TEMPLATE_INIT */
|
||||
|
||||
static int
|
||||
compose_sym(canonclass_, VERSION) (unsigned long c) {
|
||||
/* Look up canonicalclass table. */
|
||||
return (LOOKUPTBL(canon_class, CANON_CLASS, c));
|
||||
}
|
||||
|
||||
static int
|
||||
compose_sym(decompose_, VERSION) (unsigned long c, const unsigned long **seqp)
|
||||
{
|
||||
/* Look up decomposition table. */
|
||||
int seqidx = LOOKUPTBL(decompose, DECOMP, c);
|
||||
*seqp = SEQ(decompose) + (seqidx & ~DECOMP_COMPAT);
|
||||
return (seqidx);
|
||||
}
|
||||
|
||||
static int
|
||||
compose_sym(compose_, VERSION) (unsigned long c,
|
||||
const struct composition **compp)
|
||||
{
|
||||
/* Look up composition table. */
|
||||
int seqidx = LOOKUPTBL(compose, CANON_COMPOSE, c);
|
||||
*compp = SEQ(compose) + (seqidx & 0xffff);
|
||||
return (seqidx >> 16);
|
||||
}
|
||||
|
||||
static int
|
||||
compose_sym(toupper_, VERSION) (unsigned long c, const unsigned long **seqp) {
|
||||
int seqidx = LOOKUPTBL(toupper, CASEMAP, c);
|
||||
*seqp = SEQ(toupper) + seqidx;
|
||||
return (seqidx);
|
||||
}
|
||||
|
||||
static int
|
||||
compose_sym(tolower_, VERSION) (unsigned long c, const unsigned long **seqp) {
|
||||
int seqidx = LOOKUPTBL(tolower, CASEMAP, c);
|
||||
*seqp = SEQ(tolower) + seqidx;
|
||||
return (seqidx);
|
||||
}
|
||||
|
||||
static int
|
||||
compose_sym(casemapctx_, VERSION) (unsigned long c) {
|
||||
return (LOOKUPTBL(casemap_ctx, CASEMAP_CTX, c));
|
||||
}
|
||||
|
||||
static int
|
||||
compose_sym(casefolding_, VERSION) (unsigned long c,
|
||||
const unsigned long **seqp)
|
||||
{
|
||||
int seqidx = LOOKUPTBL(case_folding, CASE_FOLDING, c);
|
||||
*seqp = SEQ(case_folding) + seqidx;
|
||||
return (seqidx);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,132 +0,0 @@
|
||||
#! /bin/sh
|
||||
# $Id: mdnslookup.in,v 1.1 2002/02/08 05:41:33 marka Exp $
|
||||
#
|
||||
# Copyright (c) 2000 Japan Network Information Center. All rights reserved.
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set forth bellow.
|
||||
#
|
||||
# LICENSE TERMS AND CONDITIONS
|
||||
#
|
||||
# The following License Terms and Conditions apply, unless a different
|
||||
# license is obtained from Japan Network Information Center ("JPNIC"),
|
||||
# a Japanese association, Fuundo Bldg., 1-2 Kanda Ogawamachi, Chiyoda-ku,
|
||||
# Tokyo, Japan.
|
||||
#
|
||||
# 1. Use, Modification and Redistribution (including distribution of any
|
||||
# modified or derived work) in source and/or binary forms is permitted
|
||||
# under this License Terms and Conditions.
|
||||
#
|
||||
# 2. Redistribution of source code must retain the copyright notices as they
|
||||
# appear in each source code file, this License Terms and Conditions.
|
||||
#
|
||||
# 3. Redistribution in binary form must reproduce the Copyright Notice,
|
||||
# this License Terms and Conditions, in the documentation and/or other
|
||||
# materials provided with the distribution. For the purposes of binary
|
||||
# distribution the "Copyright Notice" refers to the following language:
|
||||
# "Copyright (c) Japan Network Information Center. All rights reserved."
|
||||
#
|
||||
# 4. Neither the name of JPNIC may be used to endorse or promote products
|
||||
# derived from this Software without specific prior written approval of
|
||||
# JPNIC.
|
||||
#
|
||||
# 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# 6. Indemnification by Licensee
|
||||
# Any person or entities using and/or redistributing this Software under
|
||||
# this License Terms and Conditions shall defend indemnify and hold
|
||||
# harmless JPNIC from and against any and all judgements damages,
|
||||
# expenses, settlement liabilities, cost and other liabilities of any
|
||||
# kind as a result of use and redistribution of this Software or any
|
||||
# claim, suite, action, litigation or proceeding by any third party
|
||||
# arising out of or relates to this License Terms and Conditions.
|
||||
#
|
||||
# 7. Governing Law, Jurisdiction and Venue
|
||||
# This License Terms and Conditions shall be governed by and and
|
||||
# construed in accordance with the law of Japan. Any person or entities
|
||||
# using and/or redistributing this Software under this License Terms and
|
||||
# Conditions hereby agrees and consent to the personal and exclusive
|
||||
# jurisdiction and venue of Tokyo District Court of Japan.
|
||||
|
||||
USAGE="Usage: $0 domain-name DNS-server"
|
||||
|
||||
#
|
||||
# Parse command line arguments.
|
||||
#
|
||||
if [ $# -lt 2 ] ; then
|
||||
echo "$0: too few argument" 1>&2
|
||||
echo $USAGE 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -gt 2 ] ; then
|
||||
echo "$0: too many argument" 1>&2
|
||||
echo $USAGE 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
-*) echo "$0: unknown option $1" 1>&2
|
||||
echo $USAGE 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
LOCAL_DOMAIN_NAME="$1"
|
||||
NAME_SERVER="$2"
|
||||
|
||||
#
|
||||
# Append some directories to PATH.
|
||||
#
|
||||
[ -d /usr/sbin ] && PATH=$PATH:/usr/sbin
|
||||
[ -d /sbin ] && PATH=$PATH:/sbin
|
||||
|
||||
#
|
||||
# Find `nslookup' command.
|
||||
#
|
||||
if [ x"$NSLOOKUP" = x ] ; then
|
||||
for I in `echo $PATH | sed -e 's/:/ /g'` ; do
|
||||
if [ -x $I/nslookup ] ; then
|
||||
NSLOOKUP="$I/nslookup"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ "$NSLOOKUP" = "" ] ; then
|
||||
echo "$0: nslookup not found" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [ ! -x "$NSLOOKUP" ] ; then
|
||||
echo "$0: nslookup not found" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# Check if `mdnconv' command exists.
|
||||
#
|
||||
MDNCONV=${MDNCONV-"@bindir@/mdnconv"}
|
||||
if [ ! -x "$MDNCONV" ] ; then
|
||||
echo "$0: mdnconv not found" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# Convert domain name to IDN encoding.
|
||||
#
|
||||
IDN_DOMAIN_NAME="`echo $LOCAL_DOMAIN_NAME | $MDNCONV -w`" || exit 1
|
||||
|
||||
#
|
||||
# Invoke nslookup.
|
||||
#
|
||||
$NSLOOKUP $IDN_DOMAIN_NAME $NAME_SERVER < /dev/null || exit 1
|
||||
|
||||
exit 0
|
||||
@@ -1,191 +0,0 @@
|
||||
@(#) $Id: CHANGES,v 1.1 2001/12/21 04:12:02 marka Exp $ (LBL)
|
||||
|
||||
v2.1 Wed Aug 22 18:30:35 PDT 2001
|
||||
|
||||
- Handle "srv" records.
|
||||
|
||||
- Fix some ttl parsing problems.
|
||||
|
||||
- Add "ignore" option
|
||||
|
||||
v2.0.2 Tue Mar 20 17:49:13 PST 2001
|
||||
|
||||
- Allow missing trailing dot in certain special cases.
|
||||
|
||||
- Include zone names when checking NS records.
|
||||
|
||||
- Document nslint.conf network keyword.
|
||||
|
||||
v2.0.1 Tue Dec 14 11:24:31 PST 1999
|
||||
|
||||
- Handle $ttl.
|
||||
|
||||
- Fix some minor portability/compiler problems for OSF 4.
|
||||
|
||||
- Correctly detect mx records that point to themselves but not a
|
||||
real "a" record.
|
||||
|
||||
- Fix file descriptor leak in doconf(). Thanks to Paul McIlfatrick
|
||||
(paul.mcilfatrick@bt.com)
|
||||
|
||||
v2.0 Wed Dec 9 16:48:54 PST 1998
|
||||
|
||||
- Add support for BIND 8 named.conf file.
|
||||
|
||||
- Support protocols in addition to tcp and udp for WKS records.
|
||||
Resulted from a bug report from Petter Reinholdtsen (pere@td.org.uit.no)
|
||||
|
||||
- Support dotted serial numbers in SOA records. Resulted from a
|
||||
bug report from Frank Ederveen (frank@our.domaintje.com)
|
||||
|
||||
- Ignore unknown statements and options in named.boot and named.conf
|
||||
(instead of issuing warnings).
|
||||
|
||||
- Handle '#' and C style named.conf comments.
|
||||
|
||||
- Handle optional "in" in named.conf zone statements. Reported by
|
||||
DJ Coster (djc@discoverbrokerage.com)
|
||||
|
||||
- Add support for include directives in named.boot and named.conf.
|
||||
|
||||
- Redo differing ttls check and do mx records in addition to a
|
||||
records. Change place where soa values gets zeroed so they don't
|
||||
get clobbered when we use includes.
|
||||
|
||||
- Allow "@" abbr. for ptr, mx, cname and ns records.
|
||||
|
||||
- Detect cname referenced by another cname or mx record.
|
||||
|
||||
- Handle chaos records (to some minor extent).
|
||||
|
||||
v1.7 Tue Jul 22 14:26:21 PDT 1997
|
||||
|
||||
- Report differing ttls in A records. Check SOA records.
|
||||
|
||||
- Detect hosts with more than one ip address on a subnet.
|
||||
|
||||
v1.6.1 Sat Jun 7 03:12:01 PDT 1997
|
||||
|
||||
- Fix "unknown service" printf format.
|
||||
|
||||
- Fix off-by-one error in the ptr parsing code. Thanks to Andreas
|
||||
Lamprecht (andreas.lamprecht@siemens.at)
|
||||
|
||||
- Fix broken $origin code.
|
||||
|
||||
v1.6 Mon Apr 7 19:09:52 PDT 1997
|
||||
|
||||
- Add support for classless delegation.
|
||||
|
||||
- Fix some case sensitive bugs.
|
||||
|
||||
- Report domain names outside the current zone.
|
||||
|
||||
- Fixed off-by-one bug that broke single character hostnames.
|
||||
|
||||
- Increase size of hash table.
|
||||
|
||||
- Make tcp and udp service name tables dynamic.
|
||||
|
||||
- Improved error message for garbage in /etc/services.
|
||||
|
||||
v1.5.1 Thu Jul 18 21:44:44 PDT 1996
|
||||
|
||||
- Use $CC when checking gcc version. Thanks to Carl Lindberg
|
||||
(carl_lindberg@blacksmith.com)
|
||||
|
||||
- Raise size of hash table to 65K.
|
||||
|
||||
v1.5 Fri Jul 12 18:58:47 PDT 1996
|
||||
|
||||
- Detect extra octets and other garbage in PTR records.
|
||||
|
||||
- Handle multi-line WKS records.
|
||||
|
||||
- Allow multple WKS records (since we can have udp and tcp).
|
||||
|
||||
- Convert to autoconf.
|
||||
|
||||
- Declare optarg, optind and opterr extern. Thanks to Howard Moftich
|
||||
(howardm@lsil.com).
|
||||
|
||||
- BS/DOS does not have malloc.h. Thanks to Jordan Hayes
|
||||
(jordan@thinkbank.com).
|
||||
|
||||
- Correctly handle named.boot comments with leading whitespace.
|
||||
|
||||
- Handle fully specified in-addr.arpa records. Resulted from a bug
|
||||
report from Joe Kelly (joe@gol.com).
|
||||
|
||||
- Fix endian problems. Thanks to Carl Lindberg (carl_lindberg@blacksmith.com).
|
||||
|
||||
- Fixed some mixed case problems.
|
||||
|
||||
- Update man page to describe how nslint.boot works.
|
||||
|
||||
v1.4 Sat Jun 3 23:38:14 PDT 1995
|
||||
|
||||
- Allow TXT records to exist with no other records.
|
||||
|
||||
- Full system prototypes.
|
||||
|
||||
- Complain about extra arguments.
|
||||
|
||||
- Detect MX record chains.
|
||||
|
||||
- Handle single line SOA records correctly. Thanks to Edward J. O'Brien
|
||||
(ejobrie@sam.wal-mart.com)
|
||||
|
||||
v1.3 Wed Mar 8 17:27:20 PST 1995
|
||||
|
||||
- Add "allowdupa" record type for use with nslint.boot. This allows ip
|
||||
addresses to have multiple A records.
|
||||
|
||||
- Fixed bug that caused dangling cname references to not be reported
|
||||
properly. Thanks to Edward J. O'Brien (ejobrie@sam.wal-mart.com).
|
||||
|
||||
v1.2 Thu Sep 1 15:55:38 PDT 1994
|
||||
|
||||
- Allow hostnames with a leading numeric as per rfc1123. Thanks to Bill
|
||||
Gianopoulos (wag@sccux1.msd.ray.com).
|
||||
|
||||
- Remove (undocumented) -u flag and allow uppercase.
|
||||
|
||||
- Support TXT records. Thanks to Paul Pomes (paul@uxc.cso.uiuc.edu).
|
||||
|
||||
- Support RP records.
|
||||
|
||||
- Ignore new bind keywords.
|
||||
|
||||
- Fix bug where we could exit with a zero status even though errors had
|
||||
been detected
|
||||
|
||||
- Complain about hosts that have smtp/tcp WKS entries but no MX records.
|
||||
|
||||
- Add -B flag to handle PTR records that point outside the domains
|
||||
listed in named.boot.
|
||||
|
||||
v1.1 Sun May 22 20:43:03 PDT 1994
|
||||
|
||||
- Allow ns records with no a records (the preferred way to go).
|
||||
|
||||
- Fix typos in the sawstr array.
|
||||
|
||||
- Use string.h instead of strings.h and add rindex(), index() and
|
||||
bzero() macros for SYSV compatibility. Thanks to Bill King
|
||||
(wrk@cle.ab.com).
|
||||
|
||||
- Handle $origin directives. Thanks to Bill Gianopoulos
|
||||
(wag@sccux1.msd.ray.com).
|
||||
|
||||
- Fix add_domain() to work for the root. Thanks to Bill Gianopoulos.
|
||||
|
||||
- Handle quotes in hinfo records. Thanks to Bill Gianopoulos.
|
||||
|
||||
- Fix endian problems in parseinaddr() and parseptr().
|
||||
|
||||
- Check non in-addr.arpa names for cname conflicts.
|
||||
|
||||
v1.0 Thu Apr 21 11:02:59 PDT 1994
|
||||
|
||||
- Initial release.
|
||||
@@ -1,24 +0,0 @@
|
||||
CHANGES
|
||||
FILES
|
||||
INSTALL
|
||||
Makefile.in
|
||||
README
|
||||
VERSION
|
||||
aclocal.m4
|
||||
config.guess
|
||||
config.sub
|
||||
configure
|
||||
configure.in
|
||||
install-sh
|
||||
lbl/gnuc.h
|
||||
lbl/os-irix5.h
|
||||
lbl/os-osf3.h
|
||||
lbl/os-solaris2.h
|
||||
lbl/os-sunos4.h
|
||||
lbl/os-ultrix4.h
|
||||
mkdep
|
||||
nslint.8
|
||||
nslint.c
|
||||
savestr.c
|
||||
savestr.h
|
||||
strerror.c
|
||||
@@ -1,42 +0,0 @@
|
||||
@(#) $Header: /u0/home/explorer/proj/ISC/git-conversion/cvsroot/bind9/contrib/nslint-2.1a3/INSTALL,v 1.1 2001/12/21 04:12:02 marka Exp $ (LBL)
|
||||
|
||||
You will need an ANSI C compiler to build nslint. The configure
|
||||
script will abort if your compiler is not ANSI compliant. If this
|
||||
happens, use the GNU C compiler, available via anonymous ftp:
|
||||
|
||||
ftp://prep.ai.mit.edu/pub/gnu/gcc.tar.gz
|
||||
|
||||
If necessary, edit the BINDEST and MANDEST paths in Makefile.in
|
||||
and run ./configure (a shell script). "configure" will determine
|
||||
your system attributes and generate an appropriate Makefile from
|
||||
Makefile.in. Now build nslint by running "make".
|
||||
|
||||
If everything builds ok, su and type "make install" (and optionally
|
||||
"make install-man). This will install nslint and its manual entry.
|
||||
|
||||
If your system is not one which we have tested nslint on, you may
|
||||
have to modify the configure script and Makefile.in. Please send
|
||||
us patches for any modifications you need to make.
|
||||
|
||||
FILES
|
||||
-----
|
||||
CHANGES - description of differences between releases
|
||||
FILES - list of files exported as part of the distribution
|
||||
INSTALL - this file
|
||||
Makefile.in - compilation rules (input to the configure script)
|
||||
README - description of distribution
|
||||
VERSION - version of this release
|
||||
aclocal.m4 - autoconf macros
|
||||
config.guess - autoconf support
|
||||
config.sub - autoconf support
|
||||
configure - configure script (run this first)
|
||||
configure.in - configure script source
|
||||
install-sh - BSD style install script
|
||||
lbl/gnuc.h - gcc macros and defines
|
||||
lbl/os-*.h - os dependent defines and prototypes
|
||||
mkdep - construct Makefile dependency list
|
||||
nslint.8 - manual entry
|
||||
nslint.c - main program
|
||||
savestr.c - strdup() replacement
|
||||
savestr.h - savestr prototypes
|
||||
strerror.c - missing routine
|
||||
@@ -1,122 +0,0 @@
|
||||
# Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997, 2000
|
||||
# The Regents of the University of California. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that: (1) source code distributions
|
||||
# retain the above copyright notice and this paragraph in its entirety, (2)
|
||||
# distributions including binary code include the above copyright notice and
|
||||
# this paragraph in its entirety in the documentation or other materials
|
||||
# provided with the distribution, and (3) all advertising materials mentioning
|
||||
# features or use of this software display the following acknowledgement:
|
||||
# ``This product includes software developed by the University of California,
|
||||
# Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
|
||||
# the University nor the names of its contributors may be used to endorse
|
||||
# or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# @(#) $Id: Makefile.in,v 1.1 2001/12/21 04:12:02 marka Exp $ (LBL)
|
||||
|
||||
#
|
||||
# Various configurable paths (remember to edit Makefile.in, not Makefile)
|
||||
#
|
||||
|
||||
# Top level hierarchy
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
# Pathname of directory to install the binary
|
||||
BINDEST = @bindir@
|
||||
# Pathname of directory to install the man page
|
||||
MANDEST = @mandir@
|
||||
|
||||
# VPATH
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
#
|
||||
# You shouldn't need to edit anything below here.
|
||||
#
|
||||
|
||||
PROG = nslint
|
||||
CC = @CC@
|
||||
CCOPT = @V_CCOPT@
|
||||
INCLS = @V_INCLS@
|
||||
DEFS = @DEFS@
|
||||
|
||||
# Standard CFLAGS
|
||||
CFLAGS = $(CCOPT) $(DEFS) $(INCLS)
|
||||
|
||||
# Standard LIBS
|
||||
LIBS = @LIBS@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
|
||||
# Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
|
||||
# Also, gcc does not remove the .o before forking 'as', which can be a
|
||||
# problem if you don't own the file but can write to the directory.
|
||||
.c.o:
|
||||
@rm -f $@
|
||||
$(CC) $(CFLAGS) -c $(srcdir)/$*.c
|
||||
|
||||
CSRC = nslint.c savestr.c
|
||||
GENSRC = version.c
|
||||
|
||||
SRC = $(CSRC) $(GENSRC)
|
||||
|
||||
# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
|
||||
# hack the extra indirection
|
||||
OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) @LIBOBJS@
|
||||
|
||||
TAGHDR = \
|
||||
/usr/include/sys/types.h \
|
||||
/usr/include/netinet/in.h
|
||||
|
||||
TAGFILES = $(SRC) $(TAGHDR)
|
||||
|
||||
CLEANFILES = $(PROG) $(OBJ) $(GENSRC)
|
||||
|
||||
$(PROG): $(OBJ)
|
||||
@rm -f $@
|
||||
$(CC) $(CFLAGS) -o $@ $(OBJ) $(LIBS)
|
||||
|
||||
version.o: version.c
|
||||
version.c: $(srcdir)/VERSION
|
||||
@rm -f $@
|
||||
sed -e 's/.*/char version[] = "&";/' $(srcdir)/VERSION > $@
|
||||
|
||||
install: force
|
||||
$(INSTALL) -m 555 -o bin -g bin $(PROG) $(DESTDIR)$(BINDEST)/$(PROG)
|
||||
|
||||
install-man: force
|
||||
$(INSTALL) -m 444 -o bin -g bin $(srcdir)/$(PROG).8 \
|
||||
$(DESTDIR)$(MANDEST)/man8/$(PROG).8
|
||||
|
||||
clean: force
|
||||
rm -f $(CLEANFILES)
|
||||
|
||||
distclean: force
|
||||
rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
|
||||
gnuc.h os-proto.h
|
||||
|
||||
tags: $(TAGFILES)
|
||||
ctags -wtd $(TAGFILES)
|
||||
|
||||
tar: force
|
||||
@cwd=`pwd` ; name=$(PROG)-`cat VERSION` ; \
|
||||
list="" ; tar="tar chf" ; temp="$$name.tar.gz" ; \
|
||||
for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
|
||||
echo \
|
||||
"rm -f $$name; ln -s . $$name" ; \
|
||||
rm -f $$name; ln -s . $$name ; \
|
||||
echo \
|
||||
"$$tar - [lots of files] | gzip > $$temp" ; \
|
||||
$$tar - $$list | gzip > $$temp ; \
|
||||
echo \
|
||||
"rm -f $$name" ; \
|
||||
rm -f $$name
|
||||
|
||||
force: /tmp
|
||||
depend: $(GENSRC) force
|
||||
./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
|
||||
@@ -1,14 +0,0 @@
|
||||
@(#) $Id: README,v 1.1 2001/12/21 04:12:02 marka Exp $ (LBL)
|
||||
|
||||
NSLINT 2.0
|
||||
Lawrence Berkeley National Laboratory
|
||||
Network Research Group
|
||||
nslint@ee.lbl.gov
|
||||
ftp://ftp.ee.lbl.gov/nslint.tar.gz
|
||||
|
||||
This directory contains source code for nslint, a lint program for dns
|
||||
files.
|
||||
|
||||
Please send bugs and comments to nslint@ee.lbl.gov.
|
||||
|
||||
- Craig Leres
|
||||
@@ -1 +0,0 @@
|
||||
2.1a3
|
||||
Vendored
-765
@@ -1,765 +0,0 @@
|
||||
dnl @(#) $Header: /u0/home/explorer/proj/ISC/git-conversion/cvsroot/bind9/contrib/nslint-2.1a3/aclocal.m4,v 1.1 2001/12/21 04:12:03 marka Exp $ (LBL)
|
||||
dnl
|
||||
dnl Copyright (c) 1995, 1996, 1997, 1998, 1999
|
||||
dnl The Regents of the University of California. All rights reserved.
|
||||
dnl
|
||||
dnl Redistribution and use in source and binary forms, with or without
|
||||
dnl modification, are permitted provided that: (1) source code distributions
|
||||
dnl retain the above copyright notice and this paragraph in its entirety, (2)
|
||||
dnl distributions including binary code include the above copyright notice and
|
||||
dnl this paragraph in its entirety in the documentation or other materials
|
||||
dnl provided with the distribution, and (3) all advertising materials mentioning
|
||||
dnl features or use of this software display the following acknowledgement:
|
||||
dnl ``This product includes software developed by the University of California,
|
||||
dnl Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
|
||||
dnl the University nor the names of its contributors may be used to endorse
|
||||
dnl or promote products derived from this software without specific prior
|
||||
dnl written permission.
|
||||
dnl THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
dnl WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
dnl
|
||||
dnl LBL autoconf macros
|
||||
dnl
|
||||
|
||||
dnl
|
||||
dnl Determine which compiler we're using (cc or gcc)
|
||||
dnl If using gcc, determine the version number
|
||||
dnl If using cc, require that it support ansi prototypes
|
||||
dnl If using gcc, use -O2 (otherwise use -O)
|
||||
dnl If using cc, explicitly specify /usr/local/include
|
||||
dnl
|
||||
dnl usage:
|
||||
dnl
|
||||
dnl AC_LBL_C_INIT(copt, incls)
|
||||
dnl
|
||||
dnl results:
|
||||
dnl
|
||||
dnl $1 (copt set)
|
||||
dnl $2 (incls set)
|
||||
dnl CC
|
||||
dnl LDFLAGS
|
||||
dnl LBL_CFLAGS
|
||||
dnl
|
||||
AC_DEFUN(AC_LBL_C_INIT,
|
||||
[AC_PREREQ(2.12)
|
||||
AC_BEFORE([$0], [AC_PROG_CC])
|
||||
AC_BEFORE([$0], [AC_LBL_FIXINCLUDES])
|
||||
AC_BEFORE([$0], [AC_LBL_DEVEL])
|
||||
AC_ARG_WITH(gcc, [ --without-gcc don't use gcc])
|
||||
$1="-O"
|
||||
$2=""
|
||||
if test "${srcdir}" != "." ; then
|
||||
$2="-I\$\(srcdir\)"
|
||||
fi
|
||||
if test "${CFLAGS+set}" = set; then
|
||||
LBL_CFLAGS="$CFLAGS"
|
||||
fi
|
||||
if test -z "$CC" ; then
|
||||
case "$target_os" in
|
||||
|
||||
bsdi*)
|
||||
AC_CHECK_PROG(SHLICC2, shlicc2, yes, no)
|
||||
if test $SHLICC2 = yes ; then
|
||||
CC=shlicc2
|
||||
export CC
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test -z "$CC" -a "$with_gcc" = no ; then
|
||||
CC=cc
|
||||
export CC
|
||||
fi
|
||||
AC_PROG_CC
|
||||
if test "$GCC" != yes ; then
|
||||
AC_MSG_CHECKING(that $CC handles ansi prototypes)
|
||||
AC_CACHE_VAL(ac_cv_lbl_cc_ansi_prototypes,
|
||||
AC_TRY_COMPILE(
|
||||
[#include <sys/types.h>],
|
||||
[int frob(int, char *)],
|
||||
ac_cv_lbl_cc_ansi_prototypes=yes,
|
||||
ac_cv_lbl_cc_ansi_prototypes=no))
|
||||
AC_MSG_RESULT($ac_cv_lbl_cc_ansi_prototypes)
|
||||
if test $ac_cv_lbl_cc_ansi_prototypes = no ; then
|
||||
case "$target_os" in
|
||||
|
||||
hpux*)
|
||||
AC_MSG_CHECKING(for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE))
|
||||
savedcflags="$CFLAGS"
|
||||
CFLAGS="-Aa -D_HPUX_SOURCE $CFLAGS"
|
||||
AC_CACHE_VAL(ac_cv_lbl_cc_hpux_cc_aa,
|
||||
AC_TRY_COMPILE(
|
||||
[#include <sys/types.h>],
|
||||
[int frob(int, char *)],
|
||||
ac_cv_lbl_cc_hpux_cc_aa=yes,
|
||||
ac_cv_lbl_cc_hpux_cc_aa=no))
|
||||
AC_MSG_RESULT($ac_cv_lbl_cc_hpux_cc_aa)
|
||||
if test $ac_cv_lbl_cc_hpux_cc_aa = no ; then
|
||||
AC_MSG_ERROR(see the INSTALL doc for more info)
|
||||
fi
|
||||
CFLAGS="$savedcflags"
|
||||
$1="-Aa $$1"
|
||||
AC_DEFINE(_HPUX_SOURCE)
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_ERROR(see the INSTALL doc for more info)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
$2="$$2 -I/usr/local/include"
|
||||
LDFLAGS="$LDFLAGS -L/usr/local/lib"
|
||||
|
||||
case "$target_os" in
|
||||
|
||||
irix*)
|
||||
$1="$$1 -xansi -signed -g3"
|
||||
;;
|
||||
|
||||
osf*)
|
||||
$1="$$1 -std1 -g3"
|
||||
;;
|
||||
|
||||
ultrix*)
|
||||
AC_MSG_CHECKING(that Ultrix $CC hacks const in prototypes)
|
||||
AC_CACHE_VAL(ac_cv_lbl_cc_const_proto,
|
||||
AC_TRY_COMPILE(
|
||||
[#include <sys/types.h>],
|
||||
[struct a { int b; };
|
||||
void c(const struct a *)],
|
||||
ac_cv_lbl_cc_const_proto=yes,
|
||||
ac_cv_lbl_cc_const_proto=no))
|
||||
AC_MSG_RESULT($ac_cv_lbl_cc_const_proto)
|
||||
if test $ac_cv_lbl_cc_const_proto = no ; then
|
||||
AC_DEFINE(const,)
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Use pfopen.c if available and pfopen() not in standard libraries
|
||||
dnl Require libpcap
|
||||
dnl Look for libpcap in ..
|
||||
dnl Use the installed libpcap if there is no local version
|
||||
dnl
|
||||
dnl usage:
|
||||
dnl
|
||||
dnl AC_LBL_LIBPCAP(pcapdep, incls)
|
||||
dnl
|
||||
dnl results:
|
||||
dnl
|
||||
dnl $1 (pcapdep set)
|
||||
dnl $2 (incls appended)
|
||||
dnl LIBS
|
||||
dnl LDFLAGS
|
||||
dnl LBL_LIBS
|
||||
dnl
|
||||
AC_DEFUN(AC_LBL_LIBPCAP,
|
||||
[AC_REQUIRE([AC_LBL_LIBRARY_NET])
|
||||
dnl
|
||||
dnl save a copy before locating libpcap.a
|
||||
dnl
|
||||
LBL_LIBS="$LIBS"
|
||||
pfopen=/usr/examples/packetfilter/pfopen.c
|
||||
if test -f $pfopen ; then
|
||||
AC_CHECK_FUNCS(pfopen)
|
||||
if test $ac_cv_func_pfopen = "no" ; then
|
||||
AC_MSG_RESULT(Using $pfopen)
|
||||
LIBS="$LIBS $pfopen"
|
||||
fi
|
||||
fi
|
||||
AC_MSG_CHECKING(for local pcap library)
|
||||
libpcap=FAIL
|
||||
lastdir=FAIL
|
||||
places=`ls .. | sed -e 's,/$,,' -e 's,^,../,' | \
|
||||
egrep '/libpcap-[[0-9]]*\.[[0-9]]*(\.[[0-9]]*)?([[ab]][[0-9]]*)?$'`
|
||||
for dir in $places ../libpcap libpcap ; do
|
||||
basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//'`
|
||||
if test $lastdir = $basedir ; then
|
||||
dnl skip alphas when an actual release is present
|
||||
continue;
|
||||
fi
|
||||
lastdir=$dir
|
||||
if test -r $dir/pcap.c ; then
|
||||
libpcap=$dir/libpcap.a
|
||||
d=$dir
|
||||
dnl continue and select the last one that exists
|
||||
fi
|
||||
done
|
||||
if test "x$libpcap" = xFAIL ; then
|
||||
AC_MSG_RESULT(not found)
|
||||
unset ac_cv_lbl_lib_pcap_pcap_open_live_
|
||||
AC_LBL_CHECK_LIB(pcap, pcap_open_live, libpcap="-lpcap")
|
||||
if test "x$libpcap" = xFAIL ; then
|
||||
unset ac_cv_lbl_lib_pcap_pcap_open_live_
|
||||
CFLAGS="$CFLAGS -I/usr/local/include"
|
||||
LIBS="$LIBS -L/usr/local/lib"
|
||||
AC_LBL_CHECK_LIB(pcap, pcap_open_live, libpcap="-lpcap")
|
||||
if test "x$libpcap" = xFAIL ; then
|
||||
AC_MSG_ERROR(see the INSTALL doc for more info)
|
||||
fi
|
||||
$2="$$2 -I/usr/local/include"
|
||||
fi
|
||||
LIBS="$LIBS -lpcap"
|
||||
else
|
||||
$1=$libpcap
|
||||
$2="-I$d $$2"
|
||||
AC_MSG_RESULT($libpcap)
|
||||
fi
|
||||
if test "x$libpcap" != "x-lpcap" ; then
|
||||
LIBS="$libpcap $LIBS"
|
||||
fi
|
||||
case "$target_os" in
|
||||
|
||||
aix*)
|
||||
pseexe="/lib/pse.exp"
|
||||
AC_MSG_CHECKING(for $pseexe)
|
||||
if test -f $pseexe ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
LIBS="$LIBS -I:$pseexe"
|
||||
fi
|
||||
;;
|
||||
esac])
|
||||
|
||||
dnl
|
||||
dnl Define RETSIGTYPE and RETSIGVAL
|
||||
dnl
|
||||
dnl usage:
|
||||
dnl
|
||||
dnl AC_LBL_TYPE_SIGNAL
|
||||
dnl
|
||||
dnl results:
|
||||
dnl
|
||||
dnl RETSIGTYPE (defined)
|
||||
dnl RETSIGVAL (defined)
|
||||
dnl
|
||||
AC_DEFUN(AC_LBL_TYPE_SIGNAL,
|
||||
[AC_BEFORE([$0], [AC_LBL_LIBPCAP])
|
||||
AC_TYPE_SIGNAL
|
||||
if test "$ac_cv_type_signal" = void ; then
|
||||
AC_DEFINE(RETSIGVAL,)
|
||||
else
|
||||
AC_DEFINE(RETSIGVAL,(0))
|
||||
fi
|
||||
case "$target_os" in
|
||||
|
||||
irix*)
|
||||
AC_DEFINE(_BSD_SIGNALS)
|
||||
;;
|
||||
|
||||
*)
|
||||
dnl prefer sigset() to sigaction()
|
||||
AC_CHECK_FUNCS(sigset)
|
||||
if test $ac_cv_func_sigset = yes ; then
|
||||
AC_DEFINE(signal,sigset)
|
||||
else
|
||||
AC_CHECK_FUNCS(sigaction)
|
||||
fi
|
||||
;;
|
||||
esac])
|
||||
|
||||
dnl
|
||||
dnl If using gcc, make sure we have ANSI ioctl definitions
|
||||
dnl
|
||||
dnl usage:
|
||||
dnl
|
||||
dnl AC_LBL_FIXINCLUDES
|
||||
dnl
|
||||
AC_DEFUN(AC_LBL_FIXINCLUDES,
|
||||
[if test "$GCC" = yes ; then
|
||||
AC_MSG_CHECKING(for ANSI ioctl definitions)
|
||||
AC_CACHE_VAL(ac_cv_lbl_gcc_fixincludes,
|
||||
AC_TRY_COMPILE(
|
||||
[/*
|
||||
* This generates a "duplicate case value" when fixincludes
|
||||
* has not be run.
|
||||
*/
|
||||
# include <sys/types.h>
|
||||
# include <sys/time.h>
|
||||
# include <sys/ioctl.h>
|
||||
# ifdef HAVE_SYS_IOCCOM_H
|
||||
# include <sys/ioccom.h>
|
||||
# endif],
|
||||
[switch (0) {
|
||||
case _IO('A', 1):;
|
||||
case _IO('B', 1):;
|
||||
}],
|
||||
ac_cv_lbl_gcc_fixincludes=yes,
|
||||
ac_cv_lbl_gcc_fixincludes=no))
|
||||
AC_MSG_RESULT($ac_cv_lbl_gcc_fixincludes)
|
||||
if test $ac_cv_lbl_gcc_fixincludes = no ; then
|
||||
# Don't cache failure
|
||||
unset ac_cv_lbl_gcc_fixincludes
|
||||
AC_MSG_ERROR(see the INSTALL for more info)
|
||||
fi
|
||||
fi])
|
||||
|
||||
dnl
|
||||
dnl Check for flex, default to lex
|
||||
dnl Require flex 2.4 or higher
|
||||
dnl Check for bison, default to yacc
|
||||
dnl Default to lex/yacc if both flex and bison are not available
|
||||
dnl Define the yy prefix string if using flex and bison
|
||||
dnl
|
||||
dnl usage:
|
||||
dnl
|
||||
dnl AC_LBL_LEX_AND_YACC(lex, yacc, yyprefix)
|
||||
dnl
|
||||
dnl results:
|
||||
dnl
|
||||
dnl $1 (lex set)
|
||||
dnl $2 (yacc appended)
|
||||
dnl $3 (optional flex and bison -P prefix)
|
||||
dnl
|
||||
AC_DEFUN(AC_LBL_LEX_AND_YACC,
|
||||
[AC_ARG_WITH(flex, [ --without-flex don't use flex])
|
||||
AC_ARG_WITH(bison, [ --without-bison don't use bison])
|
||||
if test "$with_flex" = no ; then
|
||||
$1=lex
|
||||
else
|
||||
AC_CHECK_PROGS($1, flex, lex)
|
||||
fi
|
||||
if test "$$1" = flex ; then
|
||||
# The -V flag was added in 2.4
|
||||
AC_MSG_CHECKING(for flex 2.4 or higher)
|
||||
AC_CACHE_VAL(ac_cv_lbl_flex_v24,
|
||||
if flex -V >/dev/null 2>&1; then
|
||||
ac_cv_lbl_flex_v24=yes
|
||||
else
|
||||
ac_cv_lbl_flex_v24=no
|
||||
fi)
|
||||
AC_MSG_RESULT($ac_cv_lbl_flex_v24)
|
||||
if test $ac_cv_lbl_flex_v24 = no ; then
|
||||
s="2.4 or higher required"
|
||||
AC_MSG_WARN(ignoring obsolete flex executable ($s))
|
||||
$1=lex
|
||||
fi
|
||||
fi
|
||||
if test "$with_bison" = no ; then
|
||||
$2=yacc
|
||||
else
|
||||
AC_CHECK_PROGS($2, bison, yacc)
|
||||
fi
|
||||
if test "$$2" = bison ; then
|
||||
$2="$$2 -y"
|
||||
fi
|
||||
if test "$$1" != lex -a "$$2" = yacc -o "$$1" = lex -a "$$2" != yacc ; then
|
||||
AC_MSG_WARN(don't have both flex and bison; reverting to lex/yacc)
|
||||
$1=lex
|
||||
$2=yacc
|
||||
fi
|
||||
if test "$$1" = flex -a -n "$3" ; then
|
||||
$1="$$1 -P$3"
|
||||
$2="$$2 -p $3"
|
||||
fi])
|
||||
|
||||
dnl
|
||||
dnl Checks to see if union wait is used with WEXITSTATUS()
|
||||
dnl
|
||||
dnl usage:
|
||||
dnl
|
||||
dnl AC_LBL_UNION_WAIT
|
||||
dnl
|
||||
dnl results:
|
||||
dnl
|
||||
dnl DECLWAITSTATUS (defined)
|
||||
dnl
|
||||
AC_DEFUN(AC_LBL_UNION_WAIT,
|
||||
[AC_MSG_CHECKING(if union wait is used)
|
||||
AC_CACHE_VAL(ac_cv_lbl_union_wait,
|
||||
AC_TRY_COMPILE([
|
||||
# include <sys/types.h>
|
||||
# include <sys/wait.h>],
|
||||
[int status;
|
||||
u_int i = WEXITSTATUS(status);
|
||||
u_int j = waitpid(0, &status, 0);],
|
||||
ac_cv_lbl_union_wait=no,
|
||||
ac_cv_lbl_union_wait=yes))
|
||||
AC_MSG_RESULT($ac_cv_lbl_union_wait)
|
||||
if test $ac_cv_lbl_union_wait = yes ; then
|
||||
AC_DEFINE(DECLWAITSTATUS,union wait)
|
||||
else
|
||||
AC_DEFINE(DECLWAITSTATUS,int)
|
||||
fi])
|
||||
|
||||
dnl
|
||||
dnl Checks to see if the sockaddr struct has the 4.4 BSD sa_len member
|
||||
dnl
|
||||
dnl usage:
|
||||
dnl
|
||||
dnl AC_LBL_SOCKADDR_SA_LEN
|
||||
dnl
|
||||
dnl results:
|
||||
dnl
|
||||
dnl HAVE_SOCKADDR_SA_LEN (defined)
|
||||
dnl
|
||||
AC_DEFUN(AC_LBL_SOCKADDR_SA_LEN,
|
||||
[AC_MSG_CHECKING(if sockaddr struct has sa_len member)
|
||||
AC_CACHE_VAL(ac_cv_lbl_sockaddr_has_sa_len,
|
||||
AC_TRY_COMPILE([
|
||||
# include <sys/types.h>
|
||||
# include <sys/socket.h>],
|
||||
[u_int i = sizeof(((struct sockaddr *)0)->sa_len)],
|
||||
ac_cv_lbl_sockaddr_has_sa_len=yes,
|
||||
ac_cv_lbl_sockaddr_has_sa_len=no))
|
||||
AC_MSG_RESULT($ac_cv_lbl_sockaddr_has_sa_len)
|
||||
if test $ac_cv_lbl_sockaddr_has_sa_len = yes ; then
|
||||
AC_DEFINE(HAVE_SOCKADDR_SA_LEN)
|
||||
fi])
|
||||
|
||||
dnl
|
||||
dnl Checks to see if the IFF_LOOPBACK exists as a define or enum
|
||||
dnl
|
||||
dnl (stupidly some versions of linux use an enum...)
|
||||
dnl
|
||||
dnl usage:
|
||||
dnl
|
||||
dnl AC_LBL_IFF_LOOPBACK
|
||||
dnl
|
||||
dnl results:
|
||||
dnl
|
||||
dnl HAVE_IFF_LOOPBACK (defined)
|
||||
dnl
|
||||
AC_DEFUN(AC_LBL_IFF_LOOPBACK,
|
||||
[AC_MSG_CHECKING(for IFF_LOOPBACK define/enum)
|
||||
AC_CACHE_VAL(ac_cv_lbl_have_iff_loopback,
|
||||
AC_TRY_COMPILE([
|
||||
# include <sys/param.h>
|
||||
# include <sys/file.h>
|
||||
# include <sys/ioctl.h>
|
||||
# include <sys/socket.h>
|
||||
# ifdef HAVE_SYS_SOCKIO_H
|
||||
# include <sys/sockio.h>
|
||||
# endif
|
||||
# include <sys/time.h>
|
||||
# include <net/if.h>
|
||||
# include <netinet/in.h>],
|
||||
[int i = IFF_LOOPBACK],
|
||||
ac_cv_lbl_have_iff_loopback=yes,
|
||||
ac_cv_lbl_have_iff_loopback=no))
|
||||
AC_MSG_RESULT($ac_cv_lbl_have_iff_loopback)
|
||||
if test $ac_cv_lbl_have_iff_loopback = yes ; then
|
||||
AC_DEFINE(HAVE_IFF_LOOPBACK)
|
||||
fi])
|
||||
|
||||
dnl
|
||||
dnl Checks to see if -R is used
|
||||
dnl
|
||||
dnl usage:
|
||||
dnl
|
||||
dnl AC_LBL_HAVE_RUN_PATH
|
||||
dnl
|
||||
dnl results:
|
||||
dnl
|
||||
dnl ac_cv_lbl_have_run_path (yes or no)
|
||||
dnl
|
||||
AC_DEFUN(AC_LBL_HAVE_RUN_PATH,
|
||||
[AC_MSG_CHECKING(for ${CC-cc} -R)
|
||||
AC_CACHE_VAL(ac_cv_lbl_have_run_path,
|
||||
[echo 'main(){}' > conftest.c
|
||||
${CC-cc} -o conftest conftest.c -R/a1/b2/c3 >conftest.out 2>&1
|
||||
if test ! -s conftest.out ; then
|
||||
ac_cv_lbl_have_run_path=yes
|
||||
else
|
||||
ac_cv_lbl_have_run_path=no
|
||||
fi
|
||||
rm -f conftest*])
|
||||
AC_MSG_RESULT($ac_cv_lbl_have_run_path)
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Due to the stupid way it's implemented, AC_CHECK_TYPE is nearly useless.
|
||||
dnl
|
||||
dnl usage:
|
||||
dnl
|
||||
dnl AC_LBL_CHECK_TYPE
|
||||
dnl
|
||||
dnl results:
|
||||
dnl
|
||||
dnl int32_t (defined)
|
||||
dnl u_int32_t (defined)
|
||||
dnl
|
||||
AC_DEFUN(AC_LBL_CHECK_TYPE,
|
||||
[AC_MSG_CHECKING(for $1 using $CC)
|
||||
AC_CACHE_VAL(ac_cv_lbl_have_$1,
|
||||
AC_TRY_COMPILE([
|
||||
# include "confdefs.h"
|
||||
# include <sys/types.h>
|
||||
# if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
# include <stddef.h>
|
||||
# endif],
|
||||
[$1 i],
|
||||
ac_cv_lbl_have_$1=yes,
|
||||
ac_cv_lbl_have_$1=no))
|
||||
AC_MSG_RESULT($ac_cv_lbl_have_$1)
|
||||
if test $ac_cv_lbl_have_$1 = no ; then
|
||||
AC_DEFINE($1, $2)
|
||||
fi])
|
||||
|
||||
dnl
|
||||
dnl Checks to see if unaligned memory accesses fail
|
||||
dnl
|
||||
dnl usage:
|
||||
dnl
|
||||
dnl AC_LBL_UNALIGNED_ACCESS
|
||||
dnl
|
||||
dnl results:
|
||||
dnl
|
||||
dnl LBL_ALIGN (DEFINED)
|
||||
dnl
|
||||
AC_DEFUN(AC_LBL_UNALIGNED_ACCESS,
|
||||
[AC_MSG_CHECKING(if unaligned accesses fail)
|
||||
AC_CACHE_VAL(ac_cv_lbl_unaligned_fail,
|
||||
[case "$target_cpu" in
|
||||
|
||||
alpha|hp*|mips|sparc)
|
||||
ac_cv_lbl_unaligned_fail=yes
|
||||
;;
|
||||
|
||||
*)
|
||||
cat >conftest.c <<EOF
|
||||
# include <sys/types.h>
|
||||
# include <sys/wait.h>
|
||||
# include <stdio.h>
|
||||
unsigned char a[[5]] = { 1, 2, 3, 4, 5 };
|
||||
main() {
|
||||
unsigned int i;
|
||||
pid_t pid;
|
||||
int status;
|
||||
/* avoid "core dumped" message */
|
||||
pid = fork();
|
||||
if (pid < 0)
|
||||
exit(2);
|
||||
if (pid > 0) {
|
||||
/* parent */
|
||||
pid = waitpid(pid, &status, 0);
|
||||
if (pid < 0)
|
||||
exit(3);
|
||||
exit(!WIFEXITED(status));
|
||||
}
|
||||
/* child */
|
||||
i = *(unsigned int *)&a[[1]];
|
||||
printf("%d\n", i);
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS \
|
||||
conftest.c $LIBS >/dev/null 2>&1
|
||||
if test ! -x conftest ; then
|
||||
dnl failed to compile for some reason
|
||||
ac_cv_lbl_unaligned_fail=yes
|
||||
else
|
||||
./conftest >conftest.out
|
||||
if test ! -s conftest.out ; then
|
||||
ac_cv_lbl_unaligned_fail=yes
|
||||
else
|
||||
ac_cv_lbl_unaligned_fail=no
|
||||
fi
|
||||
fi
|
||||
rm -f conftest* core core.conftest
|
||||
;;
|
||||
esac])
|
||||
AC_MSG_RESULT($ac_cv_lbl_unaligned_fail)
|
||||
if test $ac_cv_lbl_unaligned_fail = yes ; then
|
||||
AC_DEFINE(LBL_ALIGN)
|
||||
fi])
|
||||
|
||||
dnl
|
||||
dnl add all warning option to CFLAGS
|
||||
dnl
|
||||
dnl usage:
|
||||
dnl
|
||||
dnl AC_LBL_CHECK_WALL(copt)
|
||||
dnl
|
||||
dnl results:
|
||||
dnl
|
||||
dnl $1 (copt appended)
|
||||
dnl ac_cv_lbl_gcc_vers
|
||||
dnl
|
||||
AC_DEFUN(AC_LBL_CHECK_WALL,
|
||||
[ if test "$GCC" = yes ; then
|
||||
if test "$SHLICC2" = yes ; then
|
||||
ac_cv_lbl_gcc_vers=2
|
||||
$1="`echo $$1 | sed -e 's/-O/-O2/'`"
|
||||
else
|
||||
AC_MSG_CHECKING(gcc version)
|
||||
AC_CACHE_VAL(ac_cv_lbl_gcc_vers,
|
||||
ac_cv_lbl_gcc_vers=`$CC --version 2>&1 | \
|
||||
sed -e 's/\..*//'`)
|
||||
AC_MSG_RESULT($ac_cv_lbl_gcc_vers)
|
||||
if test $ac_cv_lbl_gcc_vers -gt 1 ; then
|
||||
$1="`echo $$1 | sed -e 's/-O/-O2/'`"
|
||||
fi
|
||||
fi
|
||||
if test "${LBL_CFLAGS+set}" != set; then
|
||||
if test "$ac_cv_prog_cc_g" = yes ; then
|
||||
$1="-g $$1"
|
||||
fi
|
||||
$1="$$1 -Wall"
|
||||
if test $ac_cv_lbl_gcc_vers -gt 1 ; then
|
||||
$1="$$1 -Wmissing-prototypes -Wstrict-prototypes"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
case "$target_os" in
|
||||
|
||||
irix6*)
|
||||
$1="$$1 -fullwarn -n32"
|
||||
;;
|
||||
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
fi])
|
||||
|
||||
dnl
|
||||
dnl If using gcc and the file .devel exists:
|
||||
dnl Compile with -g (if supported) and -Wall
|
||||
dnl If using gcc 2, do extra prototype checking
|
||||
dnl If an os prototype include exists, symlink os-proto.h to it
|
||||
dnl
|
||||
dnl usage:
|
||||
dnl
|
||||
dnl AC_LBL_DEVEL(copt)
|
||||
dnl
|
||||
dnl results:
|
||||
dnl
|
||||
dnl $1 (copt appended)
|
||||
dnl HAVE_OS_PROTO_H (defined)
|
||||
dnl os-proto.h (symlinked)
|
||||
dnl
|
||||
AC_DEFUN(AC_LBL_DEVEL,
|
||||
[rm -f os-proto.h
|
||||
if test "${LBL_CFLAGS+set}" = set; then
|
||||
$1="$$1 ${LBL_CFLAGS}"
|
||||
fi
|
||||
if test -f .devel ; then
|
||||
AC_LBL_CHECK_WALL($1)
|
||||
os=`echo $target_os | sed -e 's/\([[0-9]][[0-9]]*\)[[^0-9]].*$/\1/'`
|
||||
name="lbl/os-$os.h"
|
||||
if test -f $name ; then
|
||||
ln -s $name os-proto.h
|
||||
AC_DEFINE(HAVE_OS_PROTO_H)
|
||||
else
|
||||
AC_MSG_WARN(can't find $name)
|
||||
fi
|
||||
fi])
|
||||
|
||||
dnl
|
||||
dnl Improved version of AC_CHECK_LIB
|
||||
dnl
|
||||
dnl Thanks to John Hawkinson (jhawk@mit.edu)
|
||||
dnl
|
||||
dnl usage:
|
||||
dnl
|
||||
dnl AC_LBL_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [,
|
||||
dnl ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
|
||||
dnl
|
||||
dnl results:
|
||||
dnl
|
||||
dnl LIBS
|
||||
dnl
|
||||
|
||||
define(AC_LBL_CHECK_LIB,
|
||||
[AC_MSG_CHECKING([for $2 in -l$1])
|
||||
dnl Use a cache variable name containing both the library and function name,
|
||||
dnl because the test really is for library $1 defining function $2, not
|
||||
dnl just for library $1. Separate tests with the same $1 and different $2's
|
||||
dnl may have different results.
|
||||
ac_lib_var=`echo $1['_']$2['_']$5 | sed 'y%./+- %__p__%'`
|
||||
AC_CACHE_VAL(ac_cv_lbl_lib_$ac_lib_var,
|
||||
[ac_save_LIBS="$LIBS"
|
||||
LIBS="-l$1 $5 $LIBS"
|
||||
AC_TRY_LINK(dnl
|
||||
ifelse([$2], [main], , dnl Avoid conflicting decl of main.
|
||||
[/* Override any gcc2 internal prototype to avoid an error. */
|
||||
]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
])dnl
|
||||
[/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char $2();
|
||||
]),
|
||||
[$2()],
|
||||
eval "ac_cv_lbl_lib_$ac_lib_var=yes",
|
||||
eval "ac_cv_lbl_lib_$ac_lib_var=no")
|
||||
LIBS="$ac_save_LIBS"
|
||||
])dnl
|
||||
if eval "test \"`echo '$ac_cv_lbl_lib_'$ac_lib_var`\" = yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$3], ,
|
||||
[changequote(, )dnl
|
||||
ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
|
||||
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
|
||||
changequote([, ])dnl
|
||||
AC_DEFINE_UNQUOTED($ac_tr_lib)
|
||||
LIBS="-l$1 $LIBS"
|
||||
], [$3])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
ifelse([$4], , , [$4
|
||||
])dnl
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl AC_LBL_LIBRARY_NET
|
||||
dnl
|
||||
dnl This test is for network applications that need socket() and
|
||||
dnl gethostbyname() -ish functions. Under Solaris, those applications
|
||||
dnl need to link with "-lsocket -lnsl". Under IRIX, they need to link
|
||||
dnl with "-lnsl" but should *not* link with "-lsocket" because
|
||||
dnl libsocket.a breaks a number of things (for instance:
|
||||
dnl gethostbyname() under IRIX 5.2, and snoop sockets under most
|
||||
dnl versions of IRIX).
|
||||
dnl
|
||||
dnl Unfortunately, many application developers are not aware of this,
|
||||
dnl and mistakenly write tests that cause -lsocket to be used under
|
||||
dnl IRIX. It is also easy to write tests that cause -lnsl to be used
|
||||
dnl under operating systems where neither are necessary (or useful),
|
||||
dnl such as SunOS 4.1.4, which uses -lnsl for TLI.
|
||||
dnl
|
||||
dnl This test exists so that every application developer does not test
|
||||
dnl this in a different, and subtly broken fashion.
|
||||
|
||||
dnl It has been argued that this test should be broken up into two
|
||||
dnl seperate tests, one for the resolver libraries, and one for the
|
||||
dnl libraries necessary for using Sockets API. Unfortunately, the two
|
||||
dnl are carefully intertwined and allowing the autoconf user to use
|
||||
dnl them independantly potentially results in unfortunate ordering
|
||||
dnl dependancies -- as such, such component macros would have to
|
||||
dnl carefully use indirection and be aware if the other components were
|
||||
dnl executed. Since other autoconf macros do not go to this trouble,
|
||||
dnl and almost no applications use sockets without the resolver, this
|
||||
dnl complexity has not been implemented.
|
||||
dnl
|
||||
dnl The check for libresolv is in case you are attempting to link
|
||||
dnl statically and happen to have a libresolv.a lying around (and no
|
||||
dnl libnsl.a).
|
||||
dnl
|
||||
AC_DEFUN(AC_LBL_LIBRARY_NET, [
|
||||
# Most operating systems have gethostbyname() in the default searched
|
||||
# libraries (i.e. libc):
|
||||
AC_CHECK_FUNC(gethostbyname, ,
|
||||
# Some OSes (eg. Solaris) place it in libnsl:
|
||||
AC_LBL_CHECK_LIB(nsl, gethostbyname, ,
|
||||
# Some strange OSes (SINIX) have it in libsocket:
|
||||
AC_LBL_CHECK_LIB(socket, gethostbyname, ,
|
||||
# Unfortunately libsocket sometimes depends on libnsl.
|
||||
# AC_CHECK_LIB's API is essentially broken so the
|
||||
# following ugliness is necessary:
|
||||
AC_LBL_CHECK_LIB(socket, gethostbyname,
|
||||
LIBS="-lsocket -lnsl $LIBS",
|
||||
AC_CHECK_LIB(resolv, gethostbyname),
|
||||
-lnsl))))
|
||||
AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, ,
|
||||
AC_LBL_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", ,
|
||||
-lnsl)))
|
||||
# DLPI needs putmsg under HPUX so test for -lstr while we're at it
|
||||
AC_CHECK_LIB(str, putmsg)
|
||||
])
|
||||
Vendored
-693
@@ -1,693 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Written by Per Bothner <bothner@cygnus.com>.
|
||||
# The master version of this file is at the FSF in /home/gd/gnu/lib.
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
# exits with 0. Otherwise, it exits with 1.
|
||||
#
|
||||
# The plan is that this can be called by configure scripts if you
|
||||
# don't specify an explicit system type (host/target name).
|
||||
#
|
||||
# Only a few systems have been added to this list; please add others
|
||||
# (but try to keep the structure clean).
|
||||
#
|
||||
|
||||
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
|
||||
# (ghazi@noc.rutgers.edu 8/24/94.)
|
||||
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
|
||||
PATH=$PATH:/.attbin ; export PATH
|
||||
fi
|
||||
|
||||
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
|
||||
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
|
||||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
|
||||
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
||||
|
||||
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
|
||||
|
||||
# Note: order is significant - the case branches are not exclusive.
|
||||
|
||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
alpha:OSF1:*:*)
|
||||
# A Vn.n version is a released version.
|
||||
# A Tn.n version is a released field test version.
|
||||
# A Xn.n version is an unreleased experimental baselevel.
|
||||
# 1.2 uses "1.2" for uname -r.
|
||||
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`
|
||||
exit 0 ;;
|
||||
21064:Windows_NT:50:3)
|
||||
echo alpha-dec-winnt3.5
|
||||
exit 0 ;;
|
||||
Amiga*:UNIX_System_V:4.0:*)
|
||||
echo m68k-cbm-sysv4
|
||||
exit 0;;
|
||||
amiga:NetBSD:*:*)
|
||||
echo m68k-cbm-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
amiga:OpenBSD:*:*)
|
||||
echo m68k-cbm-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
exit 0;;
|
||||
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
|
||||
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
|
||||
if test "`(/bin/universe) 2>/dev/null`" = att ; then
|
||||
echo pyramid-pyramid-sysv3
|
||||
else
|
||||
echo pyramid-pyramid-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
NILE:*:*:dcosx)
|
||||
echo pyramid-pyramid-svr4
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
i86pc:SunOS:5.*:*)
|
||||
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:6*:*)
|
||||
# According to config.sub, this is the proper way to canonicalize
|
||||
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
|
||||
# it's likely to be more like Solaris than SunOS4.
|
||||
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:*:*)
|
||||
case "`/usr/bin/arch -k`" in
|
||||
Series*|S4*)
|
||||
UNAME_RELEASE=`uname -v`
|
||||
;;
|
||||
esac
|
||||
# Japanese Language versions have a version number like `4.1.3-JL'.
|
||||
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
|
||||
exit 0 ;;
|
||||
sun3*:SunOS:*:*)
|
||||
echo m68k-sun-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
aushp:SunOS:*:*)
|
||||
echo sparc-auspex-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:NetBSD:*:*)
|
||||
echo m68k-atari-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:OpenBSD:*:*)
|
||||
echo m68k-atari-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:NetBSD:*:*)
|
||||
echo m68k-sun-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:OpenBSD:*:*)
|
||||
echo m68k-sun-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:NetBSD:*:*)
|
||||
echo m68k-apple-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:OpenBSD:*:*)
|
||||
echo m68k-apple-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
powerpc:machten:*:*)
|
||||
echo powerpc-apple-machten${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RISC*:Mach:*:*)
|
||||
echo mips-dec-mach_bsd4.3
|
||||
exit 0 ;;
|
||||
RISC*:ULTRIX:*:*)
|
||||
echo mips-dec-ultrix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
VAX*:ULTRIX*:*:*)
|
||||
echo vax-dec-ultrix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mips:*:*:UMIPS | mips:*:*:RISCos)
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
int main (argc, argv) int argc; char **argv; {
|
||||
#if defined (host_mips) && defined (MIPSEB)
|
||||
#if defined (SYSTYPE_SYSV)
|
||||
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
|
||||
#endif
|
||||
#if defined (SYSTYPE_SVR4)
|
||||
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
|
||||
#endif
|
||||
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
|
||||
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
exit (-1);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy \
|
||||
&& ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
||||
&& rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
echo mips-mips-riscos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
Night_Hawk:Power_UNIX:*:*)
|
||||
echo powerpc-harris-powerunix
|
||||
exit 0 ;;
|
||||
m88k:CX/UX:7*:*)
|
||||
echo m88k-harris-cxux7
|
||||
exit 0 ;;
|
||||
m88k:*:4*:R4*)
|
||||
echo m88k-motorola-sysv4
|
||||
exit 0 ;;
|
||||
m88k:*:3*:R3*)
|
||||
echo m88k-motorola-sysv3
|
||||
exit 0 ;;
|
||||
AViiON:dgux:*:*)
|
||||
# DG/UX returns AViiON for all architectures
|
||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
||||
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
|
||||
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
|
||||
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
|
||||
echo m88k-dg-dgux${UNAME_RELEASE}
|
||||
else
|
||||
echo m88k-dg-dguxbcs${UNAME_RELEASE}
|
||||
fi
|
||||
else echo i586-dg-dgux${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
|
||||
echo m88k-dolphin-sysv3
|
||||
exit 0 ;;
|
||||
M88*:*:R3*:*)
|
||||
# Delta 88k system running SVR3
|
||||
echo m88k-motorola-sysv3
|
||||
exit 0 ;;
|
||||
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
|
||||
echo m88k-tektronix-sysv3
|
||||
exit 0 ;;
|
||||
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
|
||||
echo m68k-tektronix-bsd
|
||||
exit 0 ;;
|
||||
*:IRIX*:*:*)
|
||||
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
|
||||
exit 0 ;;
|
||||
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
|
||||
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
|
||||
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
|
||||
i?86:AIX:*:*)
|
||||
echo i386-ibm-aix
|
||||
exit 0 ;;
|
||||
*:AIX:2:3)
|
||||
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
#include <sys/systemcfg.h>
|
||||
|
||||
main()
|
||||
{
|
||||
if (!__power_pc())
|
||||
exit(1);
|
||||
puts("powerpc-ibm-aix3.2.5");
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
echo rs6000-ibm-aix3.2.5
|
||||
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
echo rs6000-ibm-aix3.2.4
|
||||
else
|
||||
echo rs6000-ibm-aix3.2
|
||||
fi
|
||||
exit 0 ;;
|
||||
*:AIX:*:4)
|
||||
if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
|
||||
IBM_ARCH=rs6000
|
||||
else
|
||||
IBM_ARCH=powerpc
|
||||
fi
|
||||
if [ -x /usr/bin/oslevel ] ; then
|
||||
IBM_REV=`/usr/bin/oslevel`
|
||||
else
|
||||
IBM_REV=4.${UNAME_RELEASE}
|
||||
fi
|
||||
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
|
||||
exit 0 ;;
|
||||
*:AIX:*:*)
|
||||
echo rs6000-ibm-aix
|
||||
exit 0 ;;
|
||||
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
|
||||
echo romp-ibm-bsd4.4
|
||||
exit 0 ;;
|
||||
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
|
||||
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
|
||||
exit 0 ;; # report: romp-ibm BSD 4.3
|
||||
*:BOSX:*:*)
|
||||
echo rs6000-bull-bosx
|
||||
exit 0 ;;
|
||||
DPX/2?00:B.O.S.:*:*)
|
||||
echo m68k-bull-sysv3
|
||||
exit 0 ;;
|
||||
9000/[34]??:4.3bsd:1.*:*)
|
||||
echo m68k-hp-bsd
|
||||
exit 0 ;;
|
||||
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
|
||||
echo m68k-hp-bsd4.4
|
||||
exit 0 ;;
|
||||
9000/[3478]??:HP-UX:*:*)
|
||||
case "${UNAME_MACHINE}" in
|
||||
9000/31? ) HP_ARCH=m68000 ;;
|
||||
9000/[34]?? ) HP_ARCH=m68k ;;
|
||||
9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
|
||||
9000/8?? ) HP_ARCH=hppa1.0 ;;
|
||||
esac
|
||||
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
|
||||
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
|
||||
exit 0 ;;
|
||||
3050*:HI-UX:*:*)
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
#include <unistd.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
long cpu = sysconf (_SC_CPU_VERSION);
|
||||
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
|
||||
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
|
||||
results, however. */
|
||||
if (CPU_IS_PA_RISC (cpu))
|
||||
{
|
||||
switch (cpu)
|
||||
{
|
||||
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
|
||||
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
|
||||
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
|
||||
default: puts ("hppa-hitachi-hiuxwe2"); break;
|
||||
}
|
||||
}
|
||||
else if (CPU_IS_HP_MC68K (cpu))
|
||||
puts ("m68k-hitachi-hiuxwe2");
|
||||
else puts ("unknown-hitachi-hiuxwe2");
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
echo unknown-hitachi-hiuxwe2
|
||||
exit 0 ;;
|
||||
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
|
||||
echo hppa1.1-hp-bsd
|
||||
exit 0 ;;
|
||||
9000/8??:4.3bsd:*:*)
|
||||
echo hppa1.0-hp-bsd
|
||||
exit 0 ;;
|
||||
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
|
||||
echo hppa1.1-hp-osf
|
||||
exit 0 ;;
|
||||
hp8??:OSF1:*:*)
|
||||
echo hppa1.0-hp-osf
|
||||
exit 0 ;;
|
||||
i?86:OSF1:*:*)
|
||||
if [ -x /usr/sbin/sysversion ] ; then
|
||||
echo ${UNAME_MACHINE}-unknown-osf1mk
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-osf1
|
||||
fi
|
||||
exit 0 ;;
|
||||
parisc*:Lites*:*:*)
|
||||
echo hppa1.1-hp-lites
|
||||
exit 0 ;;
|
||||
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
|
||||
echo c1-convex-bsd
|
||||
exit 0 ;;
|
||||
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
|
||||
if getsysinfo -f scalar_acc
|
||||
then echo c32-convex-bsd
|
||||
else echo c2-convex-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
|
||||
echo c34-convex-bsd
|
||||
exit 0 ;;
|
||||
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
|
||||
echo c38-convex-bsd
|
||||
exit 0 ;;
|
||||
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
|
||||
echo c4-convex-bsd
|
||||
exit 0 ;;
|
||||
CRAY*X-MP:*:*:*)
|
||||
echo xmp-cray-unicos
|
||||
exit 0 ;;
|
||||
CRAY*Y-MP:*:*:*)
|
||||
echo ymp-cray-unicos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
CRAY*[A-Z]90:*:*:*)
|
||||
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
|
||||
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
|
||||
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
||||
exit 0 ;;
|
||||
CRAY*TS:*:*:*)
|
||||
echo t90-cray-unicos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
CRAY-2:*:*:*)
|
||||
echo cray2-cray-unicos
|
||||
exit 0 ;;
|
||||
F300:UNIX_System_V:*:*)
|
||||
FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit 0 ;;
|
||||
F301:UNIX_System_V:*:*)
|
||||
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
|
||||
exit 0 ;;
|
||||
hp3[0-9][05]:NetBSD:*:*)
|
||||
echo m68k-hp-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hp3[0-9][05]:OpenBSD:*:*)
|
||||
echo m68k-hp-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i?86:BSD/386:*:* | *:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:FreeBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit 0 ;;
|
||||
*:NetBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
*:OpenBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo i386-pc-cygwin32
|
||||
exit 0 ;;
|
||||
p*:CYGWIN*:*)
|
||||
echo powerpcle-unknown-cygwin32
|
||||
exit 0 ;;
|
||||
prep*:SunOS:5.*:*)
|
||||
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
*:GNU:*:*)
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
exit 0 ;;
|
||||
*:Linux:*:*)
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us.
|
||||
ld_help_string=`ld --help 2>&1`
|
||||
if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0
|
||||
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0
|
||||
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0
|
||||
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
|
||||
echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0
|
||||
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
|
||||
echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0
|
||||
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then
|
||||
echo "powerpc-unknown-linux-gnu" ; exit 0
|
||||
elif test "${UNAME_MACHINE}" = "alpha" ; then
|
||||
echo alpha-unknown-linux-gnu ; exit 0
|
||||
elif test "${UNAME_MACHINE}" = "sparc" ; then
|
||||
echo sparc-unknown-linux-gnu ; exit 0
|
||||
else
|
||||
# Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us
|
||||
# useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout.
|
||||
test ! -d /usr/lib/ldscripts/. \
|
||||
&& echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
|
||||
# Determine whether the default compiler is a.out or elf
|
||||
cat >dummy.c <<EOF
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
#ifdef __ELF__
|
||||
printf ("%s-pc-linux-gnu\n", argv[1]);
|
||||
#else
|
||||
printf ("%s-pc-linux-gnuaout\n", argv[1]);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
fi ;;
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
|
||||
# are messed up and put the nodename in both sysname and nodename.
|
||||
i?86:DYNIX/ptx:4*:*)
|
||||
echo i386-sequent-sysv4
|
||||
exit 0 ;;
|
||||
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
|
||||
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
|
||||
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
i?86:*:3.2:*)
|
||||
if test -f /usr/options/cb.name; then
|
||||
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
|
||||
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
|
||||
elif /bin/uname -X 2>/dev/null >/dev/null ; then
|
||||
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
|
||||
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
|
||||
&& UNAME_MACHINE=i586
|
||||
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-sysv32
|
||||
fi
|
||||
exit 0 ;;
|
||||
Intel:Mach:3*:*)
|
||||
echo i386-pc-mach3
|
||||
exit 0 ;;
|
||||
paragon:*:*:*)
|
||||
echo i860-intel-osf1
|
||||
exit 0 ;;
|
||||
i860:*:4.*:*) # i860-SVR4
|
||||
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
|
||||
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
|
||||
else # Add other i860-SVR4 vendors below as they are discovered.
|
||||
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
|
||||
fi
|
||||
exit 0 ;;
|
||||
mini*:CTIX:SYS*5:*)
|
||||
# "miniframe"
|
||||
echo m68010-convergent-sysv
|
||||
exit 0 ;;
|
||||
M68*:*:R3V[567]*:*)
|
||||
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
|
||||
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
|
||||
OS_REL=''
|
||||
test -r /etc/.relid \
|
||||
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& echo i486-ncr-sysv4.3${OS_REL} && exit 0
|
||||
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
|
||||
&& echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
|
||||
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& echo i486-ncr-sysv4 && exit 0 ;;
|
||||
m68*:LynxOS:2.*:*)
|
||||
echo m68k-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mc68030:UNIX_System_V:4.*:*)
|
||||
echo m68k-atari-sysv4
|
||||
exit 0 ;;
|
||||
i?86:LynxOS:2.*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
TSUNAMI:LynxOS:2.*:*)
|
||||
echo sparc-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
|
||||
echo rs6000-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
SM[BE]S:UNIX_SV:*:*)
|
||||
echo mips-dde-sysv${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RM*:SINIX-*:*:*)
|
||||
echo mips-sni-sysv4
|
||||
exit 0 ;;
|
||||
*:SINIX-*:*:*)
|
||||
if uname -p 2>/dev/null >/dev/null ; then
|
||||
UNAME_MACHINE=`(uname -p) 2>/dev/null`
|
||||
echo ${UNAME_MACHINE}-sni-sysv4
|
||||
else
|
||||
echo ns32k-sni-sysv
|
||||
fi
|
||||
exit 0 ;;
|
||||
*:UNIX_System_V:4*:FTX*)
|
||||
# From Gerald Hewes <hewes@openmarket.com>.
|
||||
# How about differentiating between stratus architectures? -djm
|
||||
echo hppa1.1-stratus-sysv4
|
||||
exit 0 ;;
|
||||
*:*:*:FTX*)
|
||||
# From seanf@swdc.stratus.com.
|
||||
echo i860-stratus-sysv4
|
||||
exit 0 ;;
|
||||
mc68*:A/UX:*:*)
|
||||
echo m68k-apple-aux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
|
||||
if [ -d /usr/nec ]; then
|
||||
echo mips-nec-sysv${UNAME_RELEASE}
|
||||
else
|
||||
echo mips-unknown-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||
echo i586-unisys-sysv4
|
||||
exit 0 ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
|
||||
|
||||
cat >dummy.c <<EOF
|
||||
#ifdef _SEQUENT_
|
||||
# include <sys/types.h>
|
||||
# include <sys/utsname.h>
|
||||
#endif
|
||||
main ()
|
||||
{
|
||||
#if defined (sony)
|
||||
#if defined (MIPSEB)
|
||||
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
|
||||
I don't know.... */
|
||||
printf ("mips-sony-bsd\n"); exit (0);
|
||||
#else
|
||||
#include <sys/param.h>
|
||||
printf ("m68k-sony-newsos%s\n",
|
||||
#ifdef NEWSOS4
|
||||
"4"
|
||||
#else
|
||||
""
|
||||
#endif
|
||||
); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__arm) && defined (__acorn) && defined (__unix)
|
||||
printf ("arm-acorn-riscix"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (hp300) && !defined (hpux)
|
||||
printf ("m68k-hp-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (NeXT)
|
||||
#if !defined (__ARCHITECTURE__)
|
||||
#define __ARCHITECTURE__ "m68k"
|
||||
#endif
|
||||
int version;
|
||||
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
|
||||
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
|
||||
exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (MULTIMAX) || defined (n16)
|
||||
#if defined (UMAXV)
|
||||
printf ("ns32k-encore-sysv\n"); exit (0);
|
||||
#else
|
||||
#if defined (CMU)
|
||||
printf ("ns32k-encore-mach\n"); exit (0);
|
||||
#else
|
||||
printf ("ns32k-encore-bsd\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__386BSD__)
|
||||
printf ("i386-pc-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (sequent)
|
||||
#if defined (i386)
|
||||
printf ("i386-sequent-dynix\n"); exit (0);
|
||||
#endif
|
||||
#if defined (ns32000)
|
||||
printf ("ns32k-sequent-dynix\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (_SEQUENT_)
|
||||
struct utsname un;
|
||||
|
||||
uname(&un);
|
||||
|
||||
if (strncmp(un.version, "V2", 2) == 0) {
|
||||
printf ("i386-sequent-ptx2\n"); exit (0);
|
||||
}
|
||||
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
|
||||
printf ("i386-sequent-ptx1\n"); exit (0);
|
||||
}
|
||||
printf ("i386-sequent-ptx\n"); exit (0);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined (vax)
|
||||
#if !defined (ultrix)
|
||||
printf ("vax-dec-bsd\n"); exit (0);
|
||||
#else
|
||||
printf ("vax-dec-ultrix\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (alliant) && defined (i860)
|
||||
printf ("i860-alliant-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
exit (1);
|
||||
}
|
||||
EOF
|
||||
|
||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
|
||||
# Apollos put the system type in the environment.
|
||||
|
||||
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
|
||||
|
||||
# Convex versions that predate uname can use getsysinfo(1)
|
||||
|
||||
if [ -x /usr/convex/getsysinfo ]
|
||||
then
|
||||
case `getsysinfo -f cpu_type` in
|
||||
c1*)
|
||||
echo c1-convex-bsd
|
||||
exit 0 ;;
|
||||
c2*)
|
||||
if getsysinfo -f scalar_acc
|
||||
then echo c32-convex-bsd
|
||||
else echo c2-convex-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
c34*)
|
||||
echo c34-convex-bsd
|
||||
exit 0 ;;
|
||||
c38*)
|
||||
echo c38-convex-bsd
|
||||
exit 0 ;;
|
||||
c4*)
|
||||
echo c4-convex-bsd
|
||||
exit 0 ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
#echo '(Unable to guess system type)' 1>&2
|
||||
|
||||
exit 1
|
||||
Vendored
-927
@@ -1,927 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script, version 1.1.
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
# can handle that machine. It does not imply ALL GNU software can.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
# If it is invalid, we print an error message on stderr and exit with code 1.
|
||||
# Otherwise, we print the canonical config type on stdout and succeed.
|
||||
|
||||
# This file is supposed to be the same for all GNU packages
|
||||
# and recognize all the CPU types, system types and aliases
|
||||
# that are meaningful with *any* GNU software.
|
||||
# Each package is responsible for reporting which valid configurations
|
||||
# it does not support. The user should be able to distinguish
|
||||
# a failure to support a valid configuration from a meaningless
|
||||
# configuration.
|
||||
|
||||
# The goal of this file is to map all the various variations of a given
|
||||
# machine specification into a single specification in the form:
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or in some cases, the newer four-part form:
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
# It is wrong to echo any other type of specification.
|
||||
|
||||
if [ x$1 = x ]
|
||||
then
|
||||
echo Configuration name missing. 1>&2
|
||||
echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
|
||||
echo "or $0 ALIAS" 1>&2
|
||||
echo where ALIAS is a recognized configuration type. 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# First pass through any local machine types.
|
||||
case $1 in
|
||||
*local*)
|
||||
echo $1
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
|
||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
linux-gnu*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
*)
|
||||
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
|
||||
if [ $basic_machine != $1 ]
|
||||
then os=`echo $1 | sed 's/.*-/-/'`
|
||||
else os=; fi
|
||||
;;
|
||||
esac
|
||||
|
||||
### Let's recognize common machines as not being operating systems so
|
||||
### that things like config.sub decstation-3100 work. We also
|
||||
### recognize some manufacturers as not being operating systems, so we
|
||||
### can provide default operating systems below.
|
||||
case $os in
|
||||
-sun*os*)
|
||||
# Prevent following clause from handling this invalid input.
|
||||
;;
|
||||
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
|
||||
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
|
||||
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
|
||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||
-apple)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-hiux*)
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
-sco5)
|
||||
os=sco3.2v5
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco4)
|
||||
os=-sco3.2v4
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco3.2.[4-9]*)
|
||||
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco3.2v[4-9]*)
|
||||
# Don't forget version if it is 3.2v4 or newer.
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco*)
|
||||
os=-sco3.2v2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-isc)
|
||||
os=-isc2.2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-clix*)
|
||||
basic_machine=clipper-intergraph
|
||||
;;
|
||||
-isc*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-lynx*)
|
||||
os=-lynxos
|
||||
;;
|
||||
-ptx*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
|
||||
;;
|
||||
-windowsnt*)
|
||||
os=`echo $os | sed -e 's/windowsnt/winnt/'`
|
||||
;;
|
||||
-psos*)
|
||||
os=-psos
|
||||
;;
|
||||
esac
|
||||
|
||||
# Decode aliases for certain CPU-COMPANY combinations.
|
||||
case $basic_machine in
|
||||
# Recognize the basic CPU types without company name.
|
||||
# Some are omitted here because they have special meanings below.
|
||||
tahoe | i860 | m68k | m68000 | m88k | ns32k | arm \
|
||||
| arme[lb] | pyramid \
|
||||
| tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
|
||||
| alpha | we32k | ns16k | clipper | i370 | sh \
|
||||
| powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \
|
||||
| pdp11 | mips64el | mips64orion | mips64orionel \
|
||||
| sparc | sparclet | sparclite | sparc64)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
i[3456]86)
|
||||
basic_machine=$basic_machine-pc
|
||||
;;
|
||||
# Object if more than one company name word.
|
||||
*-*-*)
|
||||
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||
exit 1
|
||||
;;
|
||||
# Recognize the basic CPU types with company name.
|
||||
vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \
|
||||
| sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
|
||||
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
|
||||
| none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
|
||||
| hppa-* | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
|
||||
| pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
|
||||
| pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
|
||||
| mips64el-* | mips64orion-* | mips64orionel-* | f301-*)
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
|
||||
basic_machine=m68000-att
|
||||
;;
|
||||
3b*)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
alliant | fx80)
|
||||
basic_machine=fx80-alliant
|
||||
;;
|
||||
altos | altos3068)
|
||||
basic_machine=m68k-altos
|
||||
;;
|
||||
am29k)
|
||||
basic_machine=a29k-none
|
||||
os=-bsd
|
||||
;;
|
||||
amdahl)
|
||||
basic_machine=580-amdahl
|
||||
os=-sysv
|
||||
;;
|
||||
amiga | amiga-*)
|
||||
basic_machine=m68k-cbm
|
||||
;;
|
||||
amigados)
|
||||
basic_machine=m68k-cbm
|
||||
os=-amigados
|
||||
;;
|
||||
amigaunix | amix)
|
||||
basic_machine=m68k-cbm
|
||||
os=-sysv4
|
||||
;;
|
||||
apollo68)
|
||||
basic_machine=m68k-apollo
|
||||
os=-sysv
|
||||
;;
|
||||
aux)
|
||||
basic_machine=m68k-apple
|
||||
os=-aux
|
||||
;;
|
||||
balance)
|
||||
basic_machine=ns32k-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
convex-c1)
|
||||
basic_machine=c1-convex
|
||||
os=-bsd
|
||||
;;
|
||||
convex-c2)
|
||||
basic_machine=c2-convex
|
||||
os=-bsd
|
||||
;;
|
||||
convex-c32)
|
||||
basic_machine=c32-convex
|
||||
os=-bsd
|
||||
;;
|
||||
convex-c34)
|
||||
basic_machine=c34-convex
|
||||
os=-bsd
|
||||
;;
|
||||
convex-c38)
|
||||
basic_machine=c38-convex
|
||||
os=-bsd
|
||||
;;
|
||||
cray | ymp)
|
||||
basic_machine=ymp-cray
|
||||
os=-unicos
|
||||
;;
|
||||
cray2)
|
||||
basic_machine=cray2-cray
|
||||
os=-unicos
|
||||
;;
|
||||
[ctj]90-cray)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
crds | unos)
|
||||
basic_machine=m68k-crds
|
||||
;;
|
||||
da30 | da30-*)
|
||||
basic_machine=m68k-da30
|
||||
;;
|
||||
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
|
||||
basic_machine=mips-dec
|
||||
;;
|
||||
delta | 3300 | motorola-3300 | motorola-delta \
|
||||
| 3300-motorola | delta-motorola)
|
||||
basic_machine=m68k-motorola
|
||||
;;
|
||||
delta88)
|
||||
basic_machine=m88k-motorola
|
||||
os=-sysv3
|
||||
;;
|
||||
dpx20 | dpx20-*)
|
||||
basic_machine=rs6000-bull
|
||||
os=-bosx
|
||||
;;
|
||||
dpx2* | dpx2*-bull)
|
||||
basic_machine=m68k-bull
|
||||
os=-sysv3
|
||||
;;
|
||||
ebmon29k)
|
||||
basic_machine=a29k-amd
|
||||
os=-ebmon
|
||||
;;
|
||||
elxsi)
|
||||
basic_machine=elxsi-elxsi
|
||||
os=-bsd
|
||||
;;
|
||||
encore | umax | mmax)
|
||||
basic_machine=ns32k-encore
|
||||
;;
|
||||
fx2800)
|
||||
basic_machine=i860-alliant
|
||||
;;
|
||||
genix)
|
||||
basic_machine=ns32k-ns
|
||||
;;
|
||||
gmicro)
|
||||
basic_machine=tron-gmicro
|
||||
os=-sysv
|
||||
;;
|
||||
h3050r* | hiux*)
|
||||
basic_machine=hppa1.1-hitachi
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
h8300hms)
|
||||
basic_machine=h8300-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
harris)
|
||||
basic_machine=m88k-harris
|
||||
os=-sysv3
|
||||
;;
|
||||
hp300-*)
|
||||
basic_machine=m68k-hp
|
||||
;;
|
||||
hp300bsd)
|
||||
basic_machine=m68k-hp
|
||||
os=-bsd
|
||||
;;
|
||||
hp300hpux)
|
||||
basic_machine=m68k-hp
|
||||
os=-hpux
|
||||
;;
|
||||
hp9k2[0-9][0-9] | hp9k31[0-9])
|
||||
basic_machine=m68000-hp
|
||||
;;
|
||||
hp9k3[2-9][0-9])
|
||||
basic_machine=m68k-hp
|
||||
;;
|
||||
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k8[0-9][0-9] | hp8[0-9][0-9])
|
||||
basic_machine=hppa1.0-hp
|
||||
;;
|
||||
hppa-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
i370-ibm* | ibm*)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
;;
|
||||
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
||||
i[3456]86v32)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv32
|
||||
;;
|
||||
i[3456]86v4*)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv4
|
||||
;;
|
||||
i[3456]86v)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv
|
||||
;;
|
||||
i[3456]86sol2)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-solaris2
|
||||
;;
|
||||
iris | iris4d)
|
||||
basic_machine=mips-sgi
|
||||
case $os in
|
||||
-irix*)
|
||||
;;
|
||||
*)
|
||||
os=-irix4
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
isi68 | isi)
|
||||
basic_machine=m68k-isi
|
||||
os=-sysv
|
||||
;;
|
||||
m88k-omron*)
|
||||
basic_machine=m88k-omron
|
||||
;;
|
||||
magnum | m3230)
|
||||
basic_machine=mips-mips
|
||||
os=-sysv
|
||||
;;
|
||||
merlin)
|
||||
basic_machine=ns32k-utek
|
||||
os=-sysv
|
||||
;;
|
||||
miniframe)
|
||||
basic_machine=m68000-convergent
|
||||
;;
|
||||
mips3*-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
|
||||
;;
|
||||
mips3*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
|
||||
;;
|
||||
ncr3000)
|
||||
basic_machine=i486-ncr
|
||||
os=-sysv4
|
||||
;;
|
||||
news | news700 | news800 | news900)
|
||||
basic_machine=m68k-sony
|
||||
os=-newsos
|
||||
;;
|
||||
news1000)
|
||||
basic_machine=m68030-sony
|
||||
os=-newsos
|
||||
;;
|
||||
news-3600 | risc-news)
|
||||
basic_machine=mips-sony
|
||||
os=-newsos
|
||||
;;
|
||||
next | m*-next )
|
||||
basic_machine=m68k-next
|
||||
case $os in
|
||||
-nextstep* )
|
||||
;;
|
||||
-ns2*)
|
||||
os=-nextstep2
|
||||
;;
|
||||
*)
|
||||
os=-nextstep3
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
nh3000)
|
||||
basic_machine=m68k-harris
|
||||
os=-cxux
|
||||
;;
|
||||
nh[45]000)
|
||||
basic_machine=m88k-harris
|
||||
os=-cxux
|
||||
;;
|
||||
nindy960)
|
||||
basic_machine=i960-intel
|
||||
os=-nindy
|
||||
;;
|
||||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
pa-hitachi)
|
||||
basic_machine=hppa1.1-hitachi
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
paragon)
|
||||
basic_machine=i860-intel
|
||||
os=-osf
|
||||
;;
|
||||
pbd)
|
||||
basic_machine=sparc-tti
|
||||
;;
|
||||
pbb)
|
||||
basic_machine=m68k-tti
|
||||
;;
|
||||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pentium | p5)
|
||||
basic_machine=i586-intel
|
||||
;;
|
||||
pentiumpro | p6)
|
||||
basic_machine=i686-intel
|
||||
;;
|
||||
pentium-* | p5-*)
|
||||
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumpro-* | p6-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
k5)
|
||||
# We don't have specific support for AMD's K5 yet, so just call it a Pentium
|
||||
basic_machine=i586-amd
|
||||
;;
|
||||
nexen)
|
||||
# We don't have specific support for Nexgen yet, so just call it a Pentium
|
||||
basic_machine=i586-nexgen
|
||||
;;
|
||||
pn)
|
||||
basic_machine=pn-gould
|
||||
;;
|
||||
power) basic_machine=rs6000-ibm
|
||||
;;
|
||||
ppc) basic_machine=powerpc-unknown
|
||||
;;
|
||||
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppcle | powerpclittle | ppc-le | powerpc-little)
|
||||
basic_machine=powerpcle-unknown
|
||||
;;
|
||||
ppcle-* | powerpclittle-*)
|
||||
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ps2)
|
||||
basic_machine=i386-ibm
|
||||
;;
|
||||
rm[46]00)
|
||||
basic_machine=mips-siemens
|
||||
;;
|
||||
rtpc | rtpc-*)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
sequent)
|
||||
basic_machine=i386-sequent
|
||||
;;
|
||||
sh)
|
||||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sps7)
|
||||
basic_machine=m68k-bull
|
||||
os=-sysv2
|
||||
;;
|
||||
spur)
|
||||
basic_machine=spur-unknown
|
||||
;;
|
||||
sun2)
|
||||
basic_machine=m68000-sun
|
||||
;;
|
||||
sun2os3)
|
||||
basic_machine=m68000-sun
|
||||
os=-sunos3
|
||||
;;
|
||||
sun2os4)
|
||||
basic_machine=m68000-sun
|
||||
os=-sunos4
|
||||
;;
|
||||
sun3os3)
|
||||
basic_machine=m68k-sun
|
||||
os=-sunos3
|
||||
;;
|
||||
sun3os4)
|
||||
basic_machine=m68k-sun
|
||||
os=-sunos4
|
||||
;;
|
||||
sun4os3)
|
||||
basic_machine=sparc-sun
|
||||
os=-sunos3
|
||||
;;
|
||||
sun4os4)
|
||||
basic_machine=sparc-sun
|
||||
os=-sunos4
|
||||
;;
|
||||
sun4sol2)
|
||||
basic_machine=sparc-sun
|
||||
os=-solaris2
|
||||
;;
|
||||
sun3 | sun3-*)
|
||||
basic_machine=m68k-sun
|
||||
;;
|
||||
sun4)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
sun386 | sun386i | roadrunner)
|
||||
basic_machine=i386-sun
|
||||
;;
|
||||
symmetry)
|
||||
basic_machine=i386-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
tower | tower-32)
|
||||
basic_machine=m68k-ncr
|
||||
;;
|
||||
udi29k)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
ultra3)
|
||||
basic_machine=a29k-nyu
|
||||
os=-sym1
|
||||
;;
|
||||
vaxv)
|
||||
basic_machine=vax-dec
|
||||
os=-sysv
|
||||
;;
|
||||
vms)
|
||||
basic_machine=vax-dec
|
||||
os=-vms
|
||||
;;
|
||||
vpp*|vx|vx-*)
|
||||
basic_machine=f301-fujitsu
|
||||
;;
|
||||
vxworks960)
|
||||
basic_machine=i960-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
vxworks68)
|
||||
basic_machine=m68k-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
vxworks29k)
|
||||
basic_machine=a29k-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
xmp)
|
||||
basic_machine=xmp-cray
|
||||
os=-unicos
|
||||
;;
|
||||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
none)
|
||||
basic_machine=none-none
|
||||
os=-none
|
||||
;;
|
||||
|
||||
# Here we handle the default manufacturer of certain CPU types. It is in
|
||||
# some cases the only manufacturer, in others, it is the most popular.
|
||||
mips)
|
||||
basic_machine=mips-mips
|
||||
;;
|
||||
romp)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
rs6000)
|
||||
basic_machine=rs6000-ibm
|
||||
;;
|
||||
vax)
|
||||
basic_machine=vax-dec
|
||||
;;
|
||||
pdp11)
|
||||
basic_machine=pdp11-dec
|
||||
;;
|
||||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sparc)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
basic_machine=cydra-cydrome
|
||||
;;
|
||||
orion)
|
||||
basic_machine=orion-highlevel
|
||||
;;
|
||||
orion105)
|
||||
basic_machine=clipper-highlevel
|
||||
;;
|
||||
*)
|
||||
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Here we canonicalize certain aliases for manufacturers.
|
||||
case $basic_machine in
|
||||
*-digital*)
|
||||
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
|
||||
;;
|
||||
*-commodore*)
|
||||
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# Decode manufacturer-specific aliases for certain operating systems.
|
||||
|
||||
if [ x"$os" != x"" ]
|
||||
then
|
||||
case $os in
|
||||
# First match some system type aliases
|
||||
# that might get confused with valid system types.
|
||||
# -solaris* is a basic system type, with this one exception.
|
||||
-solaris1 | -solaris1.*)
|
||||
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
||||
;;
|
||||
-solaris)
|
||||
os=-solaris2
|
||||
;;
|
||||
-unixware* | svr4*)
|
||||
os=-sysv4
|
||||
;;
|
||||
-gnu/linux*)
|
||||
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
|
||||
;;
|
||||
# First accept the basic system types.
|
||||
# The portable systems comes first.
|
||||
# Each alternative MUST END IN A *, to match a version number.
|
||||
# -sysv* is not here because it comes later, after sysvr4.
|
||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
||||
| -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -linux-gnu* | -uxpv*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-linux*)
|
||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||
;;
|
||||
-sunos5*)
|
||||
os=`echo $os | sed -e 's|sunos5|solaris2|'`
|
||||
;;
|
||||
-sunos6*)
|
||||
os=`echo $os | sed -e 's|sunos6|solaris3|'`
|
||||
;;
|
||||
-osfrose*)
|
||||
os=-osfrose
|
||||
;;
|
||||
-osf*)
|
||||
os=-osf
|
||||
;;
|
||||
-utek*)
|
||||
os=-bsd
|
||||
;;
|
||||
-dynix*)
|
||||
os=-bsd
|
||||
;;
|
||||
-acis*)
|
||||
os=-aos
|
||||
;;
|
||||
-ctix* | -uts*)
|
||||
os=-sysv
|
||||
;;
|
||||
-ns2 )
|
||||
os=-nextstep2
|
||||
;;
|
||||
# Preserve the version number of sinix5.
|
||||
-sinix5.*)
|
||||
os=`echo $os | sed -e 's|sinix|sysv|'`
|
||||
;;
|
||||
-sinix*)
|
||||
os=-sysv4
|
||||
;;
|
||||
-triton*)
|
||||
os=-sysv3
|
||||
;;
|
||||
-oss*)
|
||||
os=-sysv3
|
||||
;;
|
||||
-svr4)
|
||||
os=-sysv4
|
||||
;;
|
||||
-svr3)
|
||||
os=-sysv3
|
||||
;;
|
||||
-sysvr4)
|
||||
os=-sysv4
|
||||
;;
|
||||
# This must come after -sysvr4.
|
||||
-sysv*)
|
||||
;;
|
||||
-xenix)
|
||||
os=-xenix
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
# Get rid of the `-' at the beginning of $os.
|
||||
os=`echo $os | sed 's/[^-]*-//'`
|
||||
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
|
||||
# Here we handle the default operating systems that come with various machines.
|
||||
# The value should be what the vendor currently ships out the door with their
|
||||
# machine or put another way, the most popular os provided with the machine.
|
||||
|
||||
# Note that if you're going to try to match "-MANUFACTURER" here (say,
|
||||
# "-sun"), then you have to tell the case statement up towards the top
|
||||
# that MANUFACTURER isn't an operating system. Otherwise, code above
|
||||
# will signal an error saying that MANUFACTURER isn't an operating
|
||||
# system, and we'll never get to this point.
|
||||
|
||||
case $basic_machine in
|
||||
*-acorn)
|
||||
os=-riscix1.2
|
||||
;;
|
||||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
pdp11-*)
|
||||
os=-none
|
||||
;;
|
||||
*-dec | vax-*)
|
||||
os=-ultrix4.2
|
||||
;;
|
||||
m68*-apollo)
|
||||
os=-domain
|
||||
;;
|
||||
i386-sun)
|
||||
os=-sunos4.0.2
|
||||
;;
|
||||
m68000-sun)
|
||||
os=-sunos3
|
||||
# This also exists in the configure program, but was not the
|
||||
# default.
|
||||
# os=-sunos4
|
||||
;;
|
||||
*-tti) # must be before sparc entry or we get the wrong os.
|
||||
os=-sysv3
|
||||
;;
|
||||
sparc-* | *-sun)
|
||||
os=-sunos4.1.1
|
||||
;;
|
||||
*-ibm)
|
||||
os=-aix
|
||||
;;
|
||||
*-hp)
|
||||
os=-hpux
|
||||
;;
|
||||
*-hitachi)
|
||||
os=-hiux
|
||||
;;
|
||||
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
|
||||
os=-sysv
|
||||
;;
|
||||
*-cbm)
|
||||
os=-amigados
|
||||
;;
|
||||
*-dg)
|
||||
os=-dgux
|
||||
;;
|
||||
*-dolphin)
|
||||
os=-sysv3
|
||||
;;
|
||||
m68k-ccur)
|
||||
os=-rtu
|
||||
;;
|
||||
m88k-omron*)
|
||||
os=-luna
|
||||
;;
|
||||
*-next )
|
||||
os=-nextstep
|
||||
;;
|
||||
*-sequent)
|
||||
os=-ptx
|
||||
;;
|
||||
*-crds)
|
||||
os=-unos
|
||||
;;
|
||||
*-ns)
|
||||
os=-genix
|
||||
;;
|
||||
i370-*)
|
||||
os=-mvs
|
||||
;;
|
||||
*-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
*-gould)
|
||||
os=-sysv
|
||||
;;
|
||||
*-highlevel)
|
||||
os=-bsd
|
||||
;;
|
||||
*-encore)
|
||||
os=-bsd
|
||||
;;
|
||||
*-sgi)
|
||||
os=-irix
|
||||
;;
|
||||
*-siemens)
|
||||
os=-sysv4
|
||||
;;
|
||||
*-masscomp)
|
||||
os=-rtu
|
||||
;;
|
||||
f301-fujitsu)
|
||||
os=-uxpv
|
||||
;;
|
||||
*)
|
||||
os=-none
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Here we handle the case where we know the os, and the CPU type, but not the
|
||||
# manufacturer. We pick the logical manufacturer.
|
||||
vendor=unknown
|
||||
case $basic_machine in
|
||||
*-unknown)
|
||||
case $os in
|
||||
-riscix*)
|
||||
vendor=acorn
|
||||
;;
|
||||
-sunos*)
|
||||
vendor=sun
|
||||
;;
|
||||
-aix*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-hpux*)
|
||||
vendor=hp
|
||||
;;
|
||||
-hiux*)
|
||||
vendor=hitachi
|
||||
;;
|
||||
-unos*)
|
||||
vendor=crds
|
||||
;;
|
||||
-dgux*)
|
||||
vendor=dg
|
||||
;;
|
||||
-luna*)
|
||||
vendor=omron
|
||||
;;
|
||||
-genix*)
|
||||
vendor=ns
|
||||
;;
|
||||
-mvs*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-ptx*)
|
||||
vendor=sequent
|
||||
;;
|
||||
-vxsim* | -vxworks*)
|
||||
vendor=wrs
|
||||
;;
|
||||
-aux*)
|
||||
vendor=apple
|
||||
;;
|
||||
esac
|
||||
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
|
||||
;;
|
||||
esac
|
||||
|
||||
echo $basic_machine$os
|
||||
Vendored
-1905
File diff suppressed because it is too large
Load Diff
@@ -1,47 +0,0 @@
|
||||
dnl @(#) $Header: /u0/home/explorer/proj/ISC/git-conversion/cvsroot/bind9/contrib/nslint-2.1a3/configure.in,v 1.1 2001/12/21 04:12:03 marka Exp $ (LBL)
|
||||
dnl
|
||||
dnl Copyright (c) 1995, 1996, 1997
|
||||
dnl The Regents of the University of California. All rights reserved.
|
||||
dnl
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl
|
||||
|
||||
AC_INIT(nslint.c)
|
||||
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
||||
umask 002
|
||||
|
||||
if test -z "$PWD" ; then
|
||||
PWD=`pwd`
|
||||
fi
|
||||
|
||||
AC_LBL_C_INIT(V_CCOPT, V_INCLS)
|
||||
|
||||
AC_CHECK_HEADERS(fcntl.h malloc.h memory.h)
|
||||
|
||||
AC_REPLACE_FUNCS(strerror)
|
||||
AC_CHECK_LIB(nsl, main)
|
||||
AC_CHECK_LIB(socket, main)
|
||||
|
||||
AC_CHECK_TYPE(int32_t, int)
|
||||
AC_CHECK_TYPE(u_int32_t, u_int)
|
||||
|
||||
AC_LBL_DEVEL(V_CCOPT)
|
||||
|
||||
if test -r lbl/gnuc.h ; then
|
||||
rm -f gnuc.h
|
||||
ln -s lbl/gnuc.h gnuc.h
|
||||
fi
|
||||
|
||||
AC_SUBST(V_CCOPT)
|
||||
AC_SUBST(V_INCLS)
|
||||
|
||||
AC_PROG_INSTALL
|
||||
|
||||
AC_OUTPUT(Makefile)
|
||||
|
||||
if test -f .devel ; then
|
||||
make depend
|
||||
fi
|
||||
exit 0
|
||||
@@ -1,250 +0,0 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
||||
@@ -1,43 +0,0 @@
|
||||
/* @(#) $Header: /u0/home/explorer/proj/ISC/git-conversion/cvsroot/bind9/contrib/nslint-2.1a3/lbl/gnuc.h,v 1.1 2001/12/21 04:12:05 marka Exp $ (LBL) */
|
||||
|
||||
/* Define __P() macro, if necessary */
|
||||
#ifndef __P
|
||||
#if __STDC__
|
||||
#define __P(protos) protos
|
||||
#else
|
||||
#define __P(protos) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* inline foo */
|
||||
#ifdef __GNUC__
|
||||
#define inline __inline
|
||||
#else
|
||||
#define inline
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Handle new and old "dead" routine prototypes
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* __dead void foo(void) __attribute__((volatile));
|
||||
*
|
||||
*/
|
||||
#ifdef __GNUC__
|
||||
#ifndef __dead
|
||||
#define __dead volatile
|
||||
#endif
|
||||
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
|
||||
#ifndef __attribute__
|
||||
#define __attribute__(args)
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#ifndef __dead
|
||||
#define __dead
|
||||
#endif
|
||||
#ifndef __attribute__
|
||||
#define __attribute__(args)
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1994, 1995, 1996
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that: (1) source code distributions
|
||||
* retain the above copyright notice and this paragraph in its entirety, (2)
|
||||
* distributions including binary code include the above copyright notice and
|
||||
* this paragraph in its entirety in the documentation or other materials
|
||||
* provided with the distribution, and (3) all advertising materials mentioning
|
||||
* features or use of this software display the following acknowledgement:
|
||||
* ``This product includes software developed by the University of California,
|
||||
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
|
||||
* the University nor the names of its contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior
|
||||
* written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* @(#) $Header: /u0/home/explorer/proj/ISC/git-conversion/cvsroot/bind9/contrib/nslint-2.1a3/lbl/os-irix5.h,v 1.1 2001/12/21 04:12:05 marka Exp $ (LBL)
|
||||
*/
|
||||
|
||||
/* Prototypes missing in IRIX 5 */
|
||||
#ifdef __STDC__
|
||||
struct ether_addr;
|
||||
#endif
|
||||
int ether_hostton(char *, struct ether_addr *);
|
||||
char *ether_ntoa(struct ether_addr *);
|
||||
#ifdef __STDC__
|
||||
struct utmp;
|
||||
#endif
|
||||
void login(struct utmp *);
|
||||
int setenv(const char *, const char *, int);
|
||||
int sigblock(int);
|
||||
int sigsetmask(int);
|
||||
int snprintf(char *, size_t, const char *, ...);
|
||||
time_t time(time_t *);
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1995, 1996
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that: (1) source code distributions
|
||||
* retain the above copyright notice and this paragraph in its entirety, (2)
|
||||
* distributions including binary code include the above copyright notice and
|
||||
* this paragraph in its entirety in the documentation or other materials
|
||||
* provided with the distribution, and (3) all advertising materials mentioning
|
||||
* features or use of this software display the following acknowledgement:
|
||||
* ``This product includes software developed by the University of California,
|
||||
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
|
||||
* the University nor the names of its contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior
|
||||
* written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* @(#) $Header: /u0/home/explorer/proj/ISC/git-conversion/cvsroot/bind9/contrib/nslint-2.1a3/lbl/os-osf3.h,v 1.1 2001/12/21 04:12:05 marka Exp $ (LBL)
|
||||
*/
|
||||
|
||||
/* Prototypes missing in osf3 */
|
||||
int flock(int, int);
|
||||
int ioctl(int, int, caddr_t);
|
||||
int iruserok(u_int, int, char *, char *);
|
||||
int pfopen(char *, int);
|
||||
int rcmd(char **, u_short, const char *, const char *, const char *, int *);
|
||||
int rresvport(int *);
|
||||
int snprintf(char *, size_t, const char *, ...);
|
||||
void sync(void);
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1993, 1994, 1995, 1996, 1997, 2000
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that: (1) source code distributions
|
||||
* retain the above copyright notice and this paragraph in its entirety, (2)
|
||||
* distributions including binary code include the above copyright notice and
|
||||
* this paragraph in its entirety in the documentation or other materials
|
||||
* provided with the distribution, and (3) all advertising materials mentioning
|
||||
* features or use of this software display the following acknowledgement:
|
||||
* ``This product includes software developed by the University of California,
|
||||
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
|
||||
* the University nor the names of its contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior
|
||||
* written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* @(#) $Id: os-solaris2.h,v 1.1 2001/12/21 04:12:05 marka Exp $ (LBL)
|
||||
*/
|
||||
|
||||
/* Prototypes missing in SunOS 5 */
|
||||
int daemon(int, int);
|
||||
int dn_expand(const u_char *, const u_char *, const u_char *, char *, int);
|
||||
int dn_skipname(const u_char *, const u_char *);
|
||||
int flock(int, int);
|
||||
int getdtablesize(void);
|
||||
int gethostname(char *, int);
|
||||
int getpagesize(void);
|
||||
char *getusershell(void);
|
||||
char *getwd(char *);
|
||||
int iruserok(u_int, int, char *, char *);
|
||||
#ifdef __STDC__
|
||||
struct utmp;
|
||||
void login(struct utmp *);
|
||||
#endif
|
||||
int logout(const char *);
|
||||
int res_query(const char *, int, int, u_char *, int);
|
||||
int setenv(const char *, const char *, int);
|
||||
#if defined(_STDIO_H) && defined(HAVE_SETLINEBUF)
|
||||
int setlinebuf(FILE *);
|
||||
#endif
|
||||
int sigblock(int);
|
||||
int sigsetmask(int);
|
||||
char *strerror(int);
|
||||
int snprintf(char *, size_t, const char *, ...);
|
||||
int strcasecmp(const char *, const char *);
|
||||
void unsetenv(const char *);
|
||||
@@ -1,215 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1989, 1990, 1993, 1994, 1995, 1996
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that: (1) source code distributions
|
||||
* retain the above copyright notice and this paragraph in its entirety, (2)
|
||||
* distributions including binary code include the above copyright notice and
|
||||
* this paragraph in its entirety in the documentation or other materials
|
||||
* provided with the distribution, and (3) all advertising materials mentioning
|
||||
* features or use of this software display the following acknowledgement:
|
||||
* ``This product includes software developed by the University of California,
|
||||
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
|
||||
* the University nor the names of its contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior
|
||||
* written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* @(#) $Header: /u0/home/explorer/proj/ISC/git-conversion/cvsroot/bind9/contrib/nslint-2.1a3/lbl/os-sunos4.h,v 1.1 2001/12/21 04:12:05 marka Exp $ (LBL)
|
||||
*/
|
||||
|
||||
/* Prototypes missing in SunOS 4 */
|
||||
#ifdef FILE
|
||||
int _filbuf(FILE *);
|
||||
int _flsbuf(u_char, FILE *);
|
||||
int fclose(FILE *);
|
||||
int fflush(FILE *);
|
||||
int fgetc(FILE *);
|
||||
int fprintf(FILE *, const char *, ...);
|
||||
int fputc(int, FILE *);
|
||||
int fputs(const char *, FILE *);
|
||||
u_int fread(void *, u_int, u_int, FILE *);
|
||||
int fseek(FILE *, long, int);
|
||||
u_int fwrite(const void *, u_int, u_int, FILE *);
|
||||
int pclose(FILE *);
|
||||
void rewind(FILE *);
|
||||
void setbuf(FILE *, char *);
|
||||
int setlinebuf(FILE *);
|
||||
int ungetc(int, FILE *);
|
||||
int vfprintf(FILE *, const char *, ...);
|
||||
int vprintf(const char *, ...);
|
||||
#endif
|
||||
|
||||
#if __GNUC__ <= 1
|
||||
int read(int, char *, u_int);
|
||||
int write(int, char *, u_int);
|
||||
#endif
|
||||
|
||||
long a64l(const char *);
|
||||
#ifdef __STDC__
|
||||
struct sockaddr;
|
||||
#endif
|
||||
int accept(int, struct sockaddr *, int *);
|
||||
int bind(int, struct sockaddr *, int);
|
||||
int bcmp(const void *, const void *, u_int);
|
||||
void bcopy(const void *, void *, u_int);
|
||||
void bzero(void *, int);
|
||||
int chroot(const char *);
|
||||
int close(int);
|
||||
void closelog(void);
|
||||
int connect(int, struct sockaddr *, int);
|
||||
char *crypt(const char *, const char *);
|
||||
int daemon(int, int);
|
||||
int fchmod(int, int);
|
||||
int fchown(int, int, int);
|
||||
void endgrent(void);
|
||||
void endpwent(void);
|
||||
void endservent(void);
|
||||
#ifdef __STDC__
|
||||
struct ether_addr;
|
||||
#endif
|
||||
struct ether_addr *ether_aton(const char *);
|
||||
int flock(int, int);
|
||||
#ifdef __STDC__
|
||||
struct stat;
|
||||
#endif
|
||||
int fstat(int, struct stat *);
|
||||
#ifdef __STDC__
|
||||
struct statfs;
|
||||
#endif
|
||||
int fstatfs(int, struct statfs *);
|
||||
int fsync(int);
|
||||
#ifdef __STDC__
|
||||
struct timeb;
|
||||
#endif
|
||||
int ftime(struct timeb *);
|
||||
int ftruncate(int, off_t);
|
||||
int getdtablesize(void);
|
||||
long gethostid(void);
|
||||
int gethostname(char *, int);
|
||||
int getopt(int, char * const *, const char *);
|
||||
int getpagesize(void);
|
||||
char *getpass(char *);
|
||||
int getpeername(int, struct sockaddr *, int *);
|
||||
int getpriority(int, int);
|
||||
#ifdef __STDC__
|
||||
struct rlimit;
|
||||
#endif
|
||||
int getrlimit(int, struct rlimit *);
|
||||
int getsockname(int, struct sockaddr *, int *);
|
||||
int getsockopt(int, int, int, char *, int *);
|
||||
#ifdef __STDC__
|
||||
struct timeval;
|
||||
struct timezone;
|
||||
#endif
|
||||
int gettimeofday(struct timeval *, struct timezone *);
|
||||
char *getusershell(void);
|
||||
char *getwd(char *);
|
||||
int initgroups(const char *, int);
|
||||
int ioctl(int, int, caddr_t);
|
||||
int iruserok(u_long, int, char *, char *);
|
||||
int isatty(int);
|
||||
int killpg(int, int);
|
||||
int listen(int, int);
|
||||
#ifdef __STDC__
|
||||
struct utmp;
|
||||
#endif
|
||||
void login(struct utmp *);
|
||||
int logout(const char *);
|
||||
off_t lseek(int, off_t, int);
|
||||
int lstat(const char *, struct stat *);
|
||||
int mkstemp(char *);
|
||||
char *mktemp(char *);
|
||||
int munmap(caddr_t, int);
|
||||
void openlog(const char *, int, int);
|
||||
void perror(const char *);
|
||||
int printf(const char *, ...);
|
||||
int puts(const char *);
|
||||
long random(void);
|
||||
int readlink(const char *, char *, int);
|
||||
#ifdef __STDC__
|
||||
struct iovec;
|
||||
#endif
|
||||
int readv(int, struct iovec *, int);
|
||||
int recv(int, char *, u_int, int);
|
||||
int recvfrom(int, char *, u_int, int, struct sockaddr *, int *);
|
||||
int rename(const char *, const char *);
|
||||
int rcmd(char **, u_short, char *, char *, char *, int *);
|
||||
int rresvport(int *);
|
||||
int send(int, char *, u_int, int);
|
||||
int sendto(int, char *, u_int, int, struct sockaddr *, int);
|
||||
int setenv(const char *, const char *, int);
|
||||
int seteuid(int);
|
||||
int setpriority(int, int, int);
|
||||
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
|
||||
int setpgrp(int, int);
|
||||
void setpwent(void);
|
||||
int setrlimit(int, struct rlimit *);
|
||||
void setservent(int);
|
||||
int setsockopt(int, int, int, char *, int);
|
||||
int shutdown(int, int);
|
||||
int sigblock(int);
|
||||
void (*signal (int, void (*) (int))) (int);
|
||||
int sigpause(int);
|
||||
int sigsetmask(int);
|
||||
#ifdef __STDC__
|
||||
struct sigvec;
|
||||
#endif
|
||||
int sigvec(int, struct sigvec *, struct sigvec*);
|
||||
int snprintf(char *, size_t, const char *, ...);
|
||||
int socket(int, int, int);
|
||||
int socketpair(int, int, int, int *);
|
||||
int symlink(const char *, const char *);
|
||||
void srandom(int);
|
||||
int sscanf(char *, const char *, ...);
|
||||
int stat(const char *, struct stat *);
|
||||
int statfs(char *, struct statfs *);
|
||||
char *strerror(int);
|
||||
int strcasecmp(const char *, const char *);
|
||||
#ifdef __STDC__
|
||||
struct tm;
|
||||
#endif
|
||||
int strftime(char *, int, char *, struct tm *);
|
||||
int strncasecmp(const char *, const char *, int);
|
||||
long strtol(const char *, char **, int);
|
||||
void sync(void);
|
||||
void syslog(int, const char *, ...);
|
||||
int system(const char *);
|
||||
long tell(int);
|
||||
time_t time(time_t *);
|
||||
char *timezone(int, int);
|
||||
int tolower(int);
|
||||
int toupper(int);
|
||||
int truncate(char *, off_t);
|
||||
void unsetenv(const char *);
|
||||
int vfork(void);
|
||||
int vsprintf(char *, const char *, ...);
|
||||
int writev(int, struct iovec *, int);
|
||||
#ifdef __STDC__
|
||||
struct rusage;
|
||||
#endif
|
||||
int utimes(const char *, struct timeval *);
|
||||
#if __GNUC__ <= 1
|
||||
int wait(int *);
|
||||
pid_t wait3(int *, int, struct rusage *);
|
||||
#endif
|
||||
|
||||
/* Ugly signal hacking */
|
||||
#ifdef SIG_ERR
|
||||
#undef SIG_ERR
|
||||
#define SIG_ERR (void (*)(int))-1
|
||||
#undef SIG_DFL
|
||||
#define SIG_DFL (void (*)(int))0
|
||||
#undef SIG_IGN
|
||||
#define SIG_IGN (void (*)(int))1
|
||||
|
||||
#ifdef KERNEL
|
||||
#undef SIG_CATCH
|
||||
#define SIG_CATCH (void (*)(int))2
|
||||
#endif
|
||||
#undef SIG_HOLD
|
||||
#define SIG_HOLD (void (*)(int))3
|
||||
#endif
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1990, 1993, 1994, 1995, 1996
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that: (1) source code distributions
|
||||
* retain the above copyright notice and this paragraph in its entirety, (2)
|
||||
* distributions including binary code include the above copyright notice and
|
||||
* this paragraph in its entirety in the documentation or other materials
|
||||
* provided with the distribution, and (3) all advertising materials mentioning
|
||||
* features or use of this software display the following acknowledgement:
|
||||
* ``This product includes software developed by the University of California,
|
||||
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
|
||||
* the University nor the names of its contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior
|
||||
* written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* @(#) $Header: /u0/home/explorer/proj/ISC/git-conversion/cvsroot/bind9/contrib/nslint-2.1a3/lbl/os-ultrix4.h,v 1.1 2001/12/21 04:12:05 marka Exp $ (LBL)
|
||||
*/
|
||||
|
||||
/* Prototypes missing in Ultrix 4 */
|
||||
int bcmp(const char *, const char *, u_int);
|
||||
void bcopy(const void *, void *, u_int);
|
||||
void bzero(void *, u_int);
|
||||
void endservent(void);
|
||||
int getopt(int, char * const *, const char *);
|
||||
#ifdef __STDC__
|
||||
struct timeval;
|
||||
struct timezone;
|
||||
#endif
|
||||
int gettimeofday(struct timeval *, struct timezone *);
|
||||
int ioctl(int, int, caddr_t);
|
||||
int pfopen(char *, int);
|
||||
int setlinebuf(FILE *);
|
||||
int socket(int, int, int);
|
||||
int strcasecmp(const char *, const char *);
|
||||
@@ -1,109 +0,0 @@
|
||||
#!/bin/sh -
|
||||
#
|
||||
# Copyright (c) 1994, 1996
|
||||
# The Regents of the University of California. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms are permitted
|
||||
# provided that this notice is preserved and that due credit is given
|
||||
# to the University of California at Berkeley. The name of the University
|
||||
# may not be used to endorse or promote products derived from this
|
||||
# software without specific prior written permission. This software
|
||||
# is provided ``as is'' without express or implied warranty.
|
||||
#
|
||||
# @(#)mkdep.sh 5.11 (Berkeley) 5/5/88
|
||||
#
|
||||
|
||||
PATH=/bin:/usr/bin:/usr/ucb:/usr/local:/usr/local/bin
|
||||
export PATH
|
||||
|
||||
MAKE=Makefile # default makefile name is "Makefile"
|
||||
CC=cc # default C compiler is "cc"
|
||||
|
||||
while :
|
||||
do case "$1" in
|
||||
# -c allows you to specify the C compiler
|
||||
-c)
|
||||
CC=$2
|
||||
shift; shift ;;
|
||||
|
||||
# -f allows you to select a makefile name
|
||||
-f)
|
||||
MAKE=$2
|
||||
shift; shift ;;
|
||||
|
||||
# the -p flag produces "program: program.c" style dependencies
|
||||
# so .o's don't get produced
|
||||
-p)
|
||||
SED='s;\.o;;'
|
||||
shift ;;
|
||||
*)
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ $# = 0 ] ; then
|
||||
echo 'usage: mkdep [-p] [-c cc] [-f makefile] [flags] file ...'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -w $MAKE ]; then
|
||||
echo "mkdep: no writeable file \"$MAKE\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TMP=/tmp/mkdep$$
|
||||
|
||||
trap 'rm -f $TMP ; exit 1' 1 2 3 13 15
|
||||
|
||||
cp $MAKE ${MAKE}.bak
|
||||
|
||||
sed -e '/DO NOT DELETE THIS LINE/,$d' < $MAKE > $TMP
|
||||
|
||||
cat << _EOF_ >> $TMP
|
||||
# DO NOT DELETE THIS LINE -- mkdep uses it.
|
||||
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
|
||||
|
||||
_EOF_
|
||||
|
||||
# If your compiler doesn't have -M, add it. If you can't, the next two
|
||||
# lines will try and replace the "cc -M". The real problem is that this
|
||||
# hack can't deal with anything that requires a search path, and doesn't
|
||||
# even try for anything using bracket (<>) syntax.
|
||||
#
|
||||
# egrep '^#include[ ]*".*"' /dev/null $* |
|
||||
# sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' -e 's/\.c/.o/' |
|
||||
|
||||
# XXX this doesn't work with things like "-DDECLWAITSTATUS=union\ wait"
|
||||
$CC -M $* |
|
||||
sed "
|
||||
s; \./; ;g
|
||||
$SED" |
|
||||
awk '{
|
||||
if ($1 != prev) {
|
||||
if (rec != "")
|
||||
print rec;
|
||||
rec = $0;
|
||||
prev = $1;
|
||||
}
|
||||
else {
|
||||
if (length(rec $2) > 78) {
|
||||
print rec;
|
||||
rec = $0;
|
||||
}
|
||||
else
|
||||
rec = rec " " $2
|
||||
}
|
||||
}
|
||||
END {
|
||||
print rec
|
||||
}' >> $TMP
|
||||
|
||||
cat << _EOF_ >> $TMP
|
||||
|
||||
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
|
||||
_EOF_
|
||||
|
||||
# copy to preserve permissions
|
||||
cp $TMP $MAKE
|
||||
rm -f ${MAKE}.bak $TMP
|
||||
exit 0
|
||||
@@ -1,451 +0,0 @@
|
||||
.\" @(#) $Id: nslint.8,v 1.1 2001/12/21 04:12:03 marka Exp $ (LBL)
|
||||
.\"
|
||||
.\" Copyright (c) 1994, 1996, 1997, 1999, 2001
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that: (1) source code distributions
|
||||
.\" retain the above copyright notice and this paragraph in its entirety, (2)
|
||||
.\" distributions including binary code include the above copyright notice and
|
||||
.\" this paragraph in its entirety in the documentation or other materials
|
||||
.\" provided with the distribution, and (3) all advertising materials mentioning
|
||||
.\" features or use of this software display the following acknowledgement:
|
||||
.\" ``This product includes software developed by the University of California,
|
||||
.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
|
||||
.\" the University nor the names of its contributors may be used to endorse
|
||||
.\" or promote products derived from this software without specific prior
|
||||
.\" written permission.
|
||||
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
.\"
|
||||
.TH nslint 8 "20 March 2001"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
nslint - perform consistency checks on dns files
|
||||
.SH SYNOPSIS
|
||||
.B nslint
|
||||
[
|
||||
.B -d
|
||||
] [
|
||||
.B -b
|
||||
.I named.boot
|
||||
] [
|
||||
.B -B
|
||||
.I nslint.boot
|
||||
]
|
||||
.br
|
||||
.B nslint
|
||||
[
|
||||
.B -d
|
||||
] [
|
||||
.B -c
|
||||
.I named.conf
|
||||
] [
|
||||
.B -C
|
||||
.I nslint.conf
|
||||
]
|
||||
.SH DESCRIPTION
|
||||
.B Nslint
|
||||
reads the nameserver configuration files and performs a number of
|
||||
consistency checks on the dns records. If any problems are discovered,
|
||||
error messages are displayed on
|
||||
.I stderr
|
||||
and
|
||||
.B nslint
|
||||
exits with a non-zero status.
|
||||
.LP
|
||||
Here is a short list of errors
|
||||
.B nslint
|
||||
detects:
|
||||
.IP
|
||||
Records that are malformed.
|
||||
.IP
|
||||
Names that contain dots but are missing a trailing dot.
|
||||
.IP
|
||||
.B PTR
|
||||
records with names that are missing a trailing dot.
|
||||
.IP
|
||||
Names that contain illegal characters (rfc1034).
|
||||
.IP
|
||||
.B A
|
||||
records
|
||||
without matching
|
||||
.B PTR
|
||||
records
|
||||
.IP
|
||||
.B PTR
|
||||
records
|
||||
without matching
|
||||
.B A
|
||||
records
|
||||
.IP
|
||||
Names with more than one address on the same subnet.
|
||||
.IP
|
||||
Addresses in use by more than one name.
|
||||
.IP
|
||||
Names with
|
||||
.B CNAME
|
||||
and other records (rfc1033).
|
||||
.IP
|
||||
Unknown service and/or protocol keywords in
|
||||
.B WKS
|
||||
records.
|
||||
.IP
|
||||
Missing quotes.
|
||||
.LP
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B -b
|
||||
Specify an alternate
|
||||
.I named.boot
|
||||
file. The default is
|
||||
.IR /etc/named.boot .
|
||||
.TP
|
||||
.TP
|
||||
.B -c
|
||||
Specify an alternate
|
||||
.I named.conf
|
||||
file. The default is
|
||||
.IR /etc/named.conf .
|
||||
.TP
|
||||
.B -B
|
||||
Specify an alternate
|
||||
.I nslint.boot
|
||||
file. The default is
|
||||
.I nslint.boot
|
||||
in the last
|
||||
.B directory
|
||||
line processed in
|
||||
.I named.boot
|
||||
(or the current working directory).
|
||||
This file is processed like a second
|
||||
.IR named.boot .
|
||||
The most common use is to tell
|
||||
.B nslint
|
||||
about
|
||||
.B A
|
||||
records that match
|
||||
.B PTR
|
||||
records that point outside the domains listed in
|
||||
.IR named.boot .
|
||||
.TP
|
||||
.B -C
|
||||
Specify an alternate
|
||||
.I nslint.conf
|
||||
file. The default is
|
||||
.I nslint.conf
|
||||
in the last
|
||||
.B directory
|
||||
line processed in
|
||||
.I named.conf
|
||||
(or the current working directory).
|
||||
This file is processed like a second
|
||||
.IR named.conf .
|
||||
.TP
|
||||
.B -d
|
||||
Raise the debugging level. Debugging information is
|
||||
displayed on
|
||||
.IR stdout .
|
||||
.LP
|
||||
.B Nslint
|
||||
knows how to read old style
|
||||
.I named.boot
|
||||
and BIND 8's new
|
||||
.I named.conf
|
||||
files. If both files exist,
|
||||
.B nslint
|
||||
will prefer
|
||||
.I named.conf
|
||||
(on the theory that you forgot to delete
|
||||
.I named.boot
|
||||
when you upgraded to BIND 8).
|
||||
.LP
|
||||
.SH "ADVANCED CONFIGURATION"
|
||||
There are some cases where it is necessary to use the
|
||||
advanced configuration features of
|
||||
.BR nslint .
|
||||
Advanced configuration is done with the
|
||||
.I nslint.boot
|
||||
file.
|
||||
.LP
|
||||
The most common is when a site has a demilitarized zone (DMZ).
|
||||
The problem here is that the DMZ network will have
|
||||
.B PTR
|
||||
records for hosts outside its domain. For example lets say
|
||||
we have
|
||||
.I 128.0.rev
|
||||
with:
|
||||
.LP
|
||||
.RS
|
||||
.nf
|
||||
.sp .5
|
||||
1.1 604800 in ptr gateway.lbl.gov.
|
||||
2.1 604800 in ptr gateway.es.net.
|
||||
.sp .5
|
||||
.fi
|
||||
.RE
|
||||
.LP
|
||||
Obviously we will define an
|
||||
.B A
|
||||
record for
|
||||
.I gateway.lbl.gov
|
||||
pointing to
|
||||
.I 128.0.1.1
|
||||
but we will get errors because there is no
|
||||
.B A
|
||||
record defined for
|
||||
.IR gateway.es.net .
|
||||
The solution is to create a
|
||||
.I nslint.boot
|
||||
file (in the same directory as the other dns files)
|
||||
with:
|
||||
.LP
|
||||
.RS
|
||||
.nf
|
||||
.sp .5
|
||||
primary es.net nslint.es.net
|
||||
.sp .5
|
||||
.fi
|
||||
.RE
|
||||
.LP
|
||||
And then create the file
|
||||
.I nslint.es.net
|
||||
with:
|
||||
.LP
|
||||
.RS
|
||||
.nf
|
||||
.sp .5
|
||||
gateway 1 in a 128.0.1.2
|
||||
.sp .5
|
||||
.fi
|
||||
.RE
|
||||
.LP
|
||||
Another problem occurs when there is a
|
||||
.B CNAME
|
||||
that points to a host outside the local domains. Let's say we have
|
||||
.I info.lbl.gov
|
||||
pointing to
|
||||
.IR larry.es.net :
|
||||
.LP
|
||||
.RS
|
||||
.nf
|
||||
.sp .5
|
||||
info 604800 in cname larry.es.net.
|
||||
.sp .5
|
||||
.fi
|
||||
.RE
|
||||
.LP
|
||||
In this case we would need:
|
||||
.LP
|
||||
.RS
|
||||
.nf
|
||||
.sp .5
|
||||
primary es.net nslint.es.net
|
||||
.sp .5
|
||||
.fi
|
||||
.RE
|
||||
.LP
|
||||
in
|
||||
.I nslint.boot
|
||||
and:
|
||||
.LP
|
||||
.RS
|
||||
.nf
|
||||
.sp .5
|
||||
larry 1 in txt "place holder"
|
||||
.sp .5
|
||||
.fi
|
||||
.RE
|
||||
.LP
|
||||
.IR nslint.es.net .
|
||||
.LP
|
||||
One last problem
|
||||
when a pseudo host is setup to allow two more
|
||||
more actual hosts provide a service. For, let's say that
|
||||
.I lbl.gov
|
||||
contains:
|
||||
.LP
|
||||
.RS
|
||||
.nf
|
||||
.sp .5
|
||||
server 604800 in a 128.0.6.6
|
||||
server 604800 in a 128.0.6.94
|
||||
;
|
||||
tom 604800 in a 128.0.6.6
|
||||
tom 604800 in mx 0 lbl.gov.
|
||||
;
|
||||
jerry 604800 in a 128.0.6.94
|
||||
jerry 604800 in mx 0 lbl.gov.
|
||||
.sp .5
|
||||
.fi
|
||||
.RE
|
||||
.LP
|
||||
In this case
|
||||
.B nslint
|
||||
would complain about missing
|
||||
.B PTR
|
||||
records and ip addresses in use by more than one host.
|
||||
To suppress these warnings, add you would the lines:
|
||||
.LP
|
||||
.RS
|
||||
.nf
|
||||
.sp .5
|
||||
primary lbl.gov nslint.lbl.gov
|
||||
primary 0.128.in-addr.arpa nslint.128.0.rev
|
||||
.sp .5
|
||||
.fi
|
||||
.RE
|
||||
.LP
|
||||
to
|
||||
.I nslint.boot
|
||||
and create
|
||||
.I nslint.lbl.gov
|
||||
with:
|
||||
.LP
|
||||
.RS
|
||||
.nf
|
||||
.sp .5
|
||||
server 1 in allowdupa 128.0.6.6
|
||||
server 1 in allowdupa 128.0.6.94
|
||||
.sp .5
|
||||
.fi
|
||||
.RE
|
||||
.LP
|
||||
and create
|
||||
.I nslint.128.0.rev
|
||||
with:
|
||||
.LP
|
||||
.RS
|
||||
.nf
|
||||
.sp .5
|
||||
6.6 604800 in ptr server.lbl.gov.
|
||||
94.6 604800 in ptr server.lbl.gov.
|
||||
.sp .5
|
||||
.fi
|
||||
.RE
|
||||
.LP
|
||||
In this example, the
|
||||
.B allowdupa
|
||||
keyword tells
|
||||
.B nslint
|
||||
that it's ok for
|
||||
.I 128.0.6.6
|
||||
and
|
||||
.I 128.0.6.94
|
||||
to be shared by
|
||||
.IR server.lbl.gov ,
|
||||
.IR tom.lbl.gov ,
|
||||
and
|
||||
.IR jerry.lbl.gov .
|
||||
.LP
|
||||
One last
|
||||
.B nslint
|
||||
feature helps detect hosts that have mistakenly had two ip addresses
|
||||
assigned on the same subnet. This can happen when two different
|
||||
people request an ip address for the same hostname or when someone
|
||||
forgets an address has been assigned and requests a new number.
|
||||
.LP
|
||||
To detect such
|
||||
.B A
|
||||
records, add a
|
||||
.B nslint
|
||||
section to your
|
||||
.I nslint.conf
|
||||
containing something similar to:
|
||||
.LP
|
||||
.RS
|
||||
.nf
|
||||
.sp .5
|
||||
nslint {
|
||||
.RS
|
||||
network "128.0.6/22";
|
||||
network "128.0.6 255.255.252.0";
|
||||
.RE
|
||||
};
|
||||
.sp .5
|
||||
.fi
|
||||
.RE
|
||||
.LP
|
||||
The two network lines in this example are equivalent ways of saying the same
|
||||
thing; that subnet
|
||||
.I 128.0.6
|
||||
has a 22 bit wide subnet mask.
|
||||
.LP
|
||||
If you are using
|
||||
.IR nslint.boot ,
|
||||
the syntax would be:
|
||||
.LP
|
||||
.RS
|
||||
.nf
|
||||
.sp .5
|
||||
network 128.0.6/22
|
||||
network 128.0.6 255.255.252.0
|
||||
.sp .5
|
||||
.fi
|
||||
.RE
|
||||
.LP
|
||||
Again this shows two ways of saying the same thing.
|
||||
.LP
|
||||
Using information from the above
|
||||
.B network
|
||||
statement,
|
||||
.B nslint
|
||||
would would flag the following
|
||||
.B A
|
||||
records as being in error:
|
||||
.LP
|
||||
.RS
|
||||
.nf
|
||||
.sp .5
|
||||
server 1 in a 128.0.6.48
|
||||
server 1 in a 128.0.7.16
|
||||
.sp .5
|
||||
.fi
|
||||
.RE
|
||||
.LP
|
||||
Note that if you specify any
|
||||
.B network
|
||||
lines in your
|
||||
.I nslint.conf
|
||||
or
|
||||
.I nslint.boot
|
||||
files,
|
||||
.B nslint
|
||||
requires you to include lines for all networks;
|
||||
otherwise you might forget to add
|
||||
.B network
|
||||
lines for new networks.
|
||||
.LP
|
||||
.SH FILES
|
||||
.na
|
||||
.nh
|
||||
.nf
|
||||
/etc/named.boot - default named configuration file
|
||||
nslint.boot - default nslint configuration file
|
||||
.ad
|
||||
.hy
|
||||
.fi
|
||||
.LP
|
||||
.SH "SEE ALSO"
|
||||
.na
|
||||
.nh
|
||||
.IR named (8),
|
||||
rfc1033,
|
||||
rfc1034
|
||||
.ad
|
||||
.hy
|
||||
.SH AUTHOR
|
||||
Craig Leres of the
|
||||
Lawrence Berkeley National Laboratory, University of California, Berkeley, CA.
|
||||
.LP
|
||||
The current version is available via anonymous ftp:
|
||||
.LP
|
||||
.RS
|
||||
.I ftp://ftp.ee.lbl.gov/nslint.tar.gz
|
||||
.RE
|
||||
.SH BUGS
|
||||
Please send bug reports to nslint@ee.lbl.gov.
|
||||
.LP
|
||||
Not everyone is guaranteed to agree with all the checks done.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that: (1) source code distributions
|
||||
* retain the above copyright notice and this paragraph in its entirety, (2)
|
||||
* distributions including binary code include the above copyright notice and
|
||||
* this paragraph in its entirety in the documentation or other materials
|
||||
* provided with the distribution, and (3) all advertising materials mentioning
|
||||
* features or use of this software display the following acknowledgement:
|
||||
* ``This product includes software developed by the University of California,
|
||||
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
|
||||
* the University nor the names of its contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior
|
||||
* written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /u0/home/explorer/proj/ISC/git-conversion/cvsroot/bind9/contrib/nslint-2.1a3/savestr.c,v 1.1 2001/12/21 04:12:04 marka Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "gnuc.h"
|
||||
#ifdef HAVE_OS_PROTO_H
|
||||
#include "os-proto.h"
|
||||
#endif
|
||||
|
||||
#include "savestr.h"
|
||||
|
||||
/* A replacement for strdup() that cuts down on malloc() overhead */
|
||||
char *
|
||||
savestr(register const char *str)
|
||||
{
|
||||
register u_int size;
|
||||
register char *p;
|
||||
static char *strptr = NULL;
|
||||
static u_int strsize = 0;
|
||||
|
||||
size = strlen(str) + 1;
|
||||
if (size > strsize) {
|
||||
strsize = 1024;
|
||||
if (strsize < size)
|
||||
strsize = size;
|
||||
strptr = (char *)malloc(strsize);
|
||||
if (strptr == NULL) {
|
||||
fprintf(stderr, "savestr: malloc\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
(void)strcpy(strptr, str);
|
||||
p = strptr;
|
||||
strptr += size;
|
||||
strsize -= size;
|
||||
return (p);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that: (1) source code distributions
|
||||
* retain the above copyright notice and this paragraph in its entirety, (2)
|
||||
* distributions including binary code include the above copyright notice and
|
||||
* this paragraph in its entirety in the documentation or other materials
|
||||
* provided with the distribution, and (3) all advertising materials mentioning
|
||||
* features or use of this software display the following acknowledgement:
|
||||
* ``This product includes software developed by the University of California,
|
||||
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
|
||||
* the University nor the names of its contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior
|
||||
* written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* @(#) $Header: /u0/home/explorer/proj/ISC/git-conversion/cvsroot/bind9/contrib/nslint-2.1a3/savestr.h,v 1.1 2001/12/21 04:12:05 marka Exp $ (LBL)
|
||||
*/
|
||||
|
||||
extern char *savestr(const char *);
|
||||
@@ -1,75 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static const char sccsid[] = "@(#)strerror.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "gnuc.h"
|
||||
#ifdef HAVE_OS_PROTO_H
|
||||
#include "os-proto.h"
|
||||
#endif
|
||||
|
||||
char *
|
||||
strerror(num)
|
||||
int num;
|
||||
{
|
||||
extern int sys_nerr;
|
||||
extern char *sys_errlist[];
|
||||
#define UPREFIX "Unknown error: "
|
||||
static char ebuf[40] = UPREFIX; /* 64-bit number + slop */
|
||||
register unsigned int errnum;
|
||||
register char *p, *t;
|
||||
char tmp[40];
|
||||
|
||||
errnum = num; /* convert to unsigned */
|
||||
if (errnum < sys_nerr)
|
||||
return(sys_errlist[errnum]);
|
||||
|
||||
/* Do this by hand, so we don't include stdio(3). */
|
||||
t = tmp;
|
||||
do {
|
||||
*t++ = "0123456789"[errnum % 10];
|
||||
} while (errnum /= 10);
|
||||
for (p = ebuf + sizeof(UPREFIX) - 1;;) {
|
||||
*p++ = *--t;
|
||||
if (t <= tmp)
|
||||
break;
|
||||
}
|
||||
*p = '\0';
|
||||
return(ebuf);
|
||||
}
|
||||
@@ -1,195 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
||||
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
||||
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: dirdb.c,v 1.9 2001/01/09 21:46:22 bwelling Exp $ */
|
||||
|
||||
/*
|
||||
* A simple database driver that returns basic information about
|
||||
* files and directories in the Unix file system as DNS data.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/sysmacros.h>
|
||||
|
||||
#include <isc/mem.h>
|
||||
#include <isc/print.h>
|
||||
#include <isc/result.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
#include <dns/sdb.h>
|
||||
|
||||
#include <named/globals.h>
|
||||
|
||||
#include "dirdb.h"
|
||||
|
||||
static dns_sdbimplementation_t *dirdb = NULL;
|
||||
|
||||
#define CHECK(op) \
|
||||
do { result = (op); \
|
||||
if (result != ISC_R_SUCCESS) return (result); \
|
||||
} while (0)
|
||||
|
||||
#define CHECKN(op) \
|
||||
do { n = (op); \
|
||||
if (n < 0) return (ISC_R_FAILURE); \
|
||||
} while (0)
|
||||
|
||||
|
||||
/*
|
||||
* This database operates on relative names.
|
||||
*
|
||||
* Any name will be interpreted as a pathname offset from the directory
|
||||
* specified in the configuration file.
|
||||
*/
|
||||
static isc_result_t
|
||||
dirdb_lookup(const char *zone, const char *name, void *dbdata,
|
||||
dns_sdblookup_t *lookup)
|
||||
{
|
||||
char filename[255];
|
||||
char filename2[255];
|
||||
char buf[1024];
|
||||
struct stat statbuf;
|
||||
isc_result_t result;
|
||||
int n;
|
||||
|
||||
UNUSED(zone);
|
||||
UNUSED(dbdata);
|
||||
|
||||
if (strcmp(name, "@") == 0)
|
||||
snprintf(filename, sizeof(filename), "%s", (char *)dbdata);
|
||||
else
|
||||
snprintf(filename, sizeof(filename), "%s/%s",
|
||||
(char *)dbdata, name);
|
||||
CHECKN(lstat(filename, &statbuf));
|
||||
|
||||
if (S_ISDIR(statbuf.st_mode))
|
||||
CHECK(dns_sdb_putrr(lookup, "txt", 3600, "dir"));
|
||||
else if (S_ISCHR(statbuf.st_mode) || S_ISBLK(statbuf.st_mode)) {
|
||||
CHECKN(snprintf(buf, sizeof(buf),
|
||||
"\"%sdev\" \"major %d\" \"minor %d\"",
|
||||
S_ISCHR(statbuf.st_mode) ? "chr" : "blk",
|
||||
major(statbuf.st_rdev),
|
||||
minor(statbuf.st_rdev)));
|
||||
CHECK(dns_sdb_putrr(lookup, "txt", 3600, buf));
|
||||
} else if (S_ISFIFO(statbuf.st_mode))
|
||||
CHECK(dns_sdb_putrr(lookup, "txt", 3600, "pipe"));
|
||||
else if (S_ISSOCK(statbuf.st_mode))
|
||||
CHECK(dns_sdb_putrr(lookup, "txt", 3600, "socket"));
|
||||
else if (S_ISLNK(statbuf.st_mode)) {
|
||||
CHECKN(readlink(filename, filename2, sizeof(filename2) - 1));
|
||||
buf[n] = 0;
|
||||
CHECKN(snprintf(buf, sizeof(buf), "\"symlink\" \"%s\"",
|
||||
filename2));
|
||||
CHECK(dns_sdb_putrr(lookup, "txt", 3600, buf));
|
||||
} else if (!S_ISREG(statbuf.st_mode))
|
||||
CHECK(dns_sdb_putrr(lookup, "txt", 3600, "unknown"));
|
||||
else {
|
||||
CHECKN(snprintf(buf, sizeof(buf), "\"file\" \"size = %u\"",
|
||||
(unsigned int)statbuf.st_size));
|
||||
CHECK(dns_sdb_putrr(lookup, "txt", 3600, buf));
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* lookup () does not return SOA or NS records, so authority() must be defined.
|
||||
*/
|
||||
static isc_result_t
|
||||
dirdb_authority(const char *zone, void *dbdata, dns_sdblookup_t *lookup) {
|
||||
isc_result_t result;
|
||||
|
||||
UNUSED(zone);
|
||||
UNUSED(dbdata);
|
||||
|
||||
result = dns_sdb_putsoa(lookup, "ns", "hostmaster", 0);
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
result = dns_sdb_putrr(lookup, "ns", 86400, "ns1");
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
result = dns_sdb_putrr(lookup, "ns", 86400, "ns2");
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Each database stores the top-level directory as the dbdata opaque
|
||||
* object. The create() function allocates it. argv[0] holds the top
|
||||
* level directory.
|
||||
*/
|
||||
static isc_result_t
|
||||
dirdb_create(const char *zone, int argc, char **argv,
|
||||
void *driverdata, void **dbdata)
|
||||
{
|
||||
UNUSED(zone);
|
||||
UNUSED(driverdata);
|
||||
|
||||
if (argc < 1)
|
||||
return (ISC_R_FAILURE);
|
||||
*dbdata = isc_mem_strdup((isc_mem_t *)driverdata, argv[0]);
|
||||
if (*dbdata == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* The destroy() function frees the memory allocated by create().
|
||||
*/
|
||||
static void
|
||||
dirdb_destroy(const char *zone, void *driverdata, void **dbdata) {
|
||||
UNUSED(zone);
|
||||
UNUSED(driverdata);
|
||||
isc_mem_free((isc_mem_t *)driverdata, *dbdata);
|
||||
}
|
||||
|
||||
/*
|
||||
* This zone does not support zone transfer, so allnodes() is NULL.
|
||||
*/
|
||||
static dns_sdbmethods_t dirdb_methods = {
|
||||
dirdb_lookup,
|
||||
dirdb_authority,
|
||||
NULL, /* allnodes */
|
||||
dirdb_create,
|
||||
dirdb_destroy
|
||||
};
|
||||
|
||||
/*
|
||||
* Wrapper around dns_sdb_register(). Note that the first ns_g_mctx is
|
||||
* being passed as the "driverdata" parameter, so that will it will be
|
||||
* passed to create() and destroy().
|
||||
*/
|
||||
isc_result_t
|
||||
dirdb_init(void) {
|
||||
unsigned int flags;
|
||||
flags = DNS_SDBFLAG_RELATIVEOWNER | DNS_SDBFLAG_RELATIVERDATA |
|
||||
DNS_SDBFLAG_THREADSAFE;
|
||||
return (dns_sdb_register("dir", &dirdb_methods, ns_g_mctx, flags,
|
||||
ns_g_mctx, &dirdb));
|
||||
}
|
||||
|
||||
/*
|
||||
* Wrapper around dns_sdb_unregister().
|
||||
*/
|
||||
void
|
||||
dirdb_clear(void) {
|
||||
if (dirdb != NULL)
|
||||
dns_sdb_unregister(&dirdb);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
||||
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
||||
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: dirdb.h,v 1.2 2001/01/09 21:46:23 bwelling Exp $ */
|
||||
|
||||
#include <isc/types.h>
|
||||
|
||||
isc_result_t dirdb_init(void);
|
||||
|
||||
void dirdb_clear(void);
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
This is the INSTALL file for 0.4. See
|
||||
http://www.venaas.no/ldap/bind-sdb/ for updates or other information.
|
||||
|
||||
BUILDING
|
||||
|
||||
You need the source for BIND 9.1.0 or newer (for zone transfers you
|
||||
will need at least 9.1.1rc3 due to a bug). Basically you need to follow
|
||||
the instructions in doc/misc/sdb, if my instructions doesn't make sense,
|
||||
please have a look at that as well.
|
||||
|
||||
Copy ldapdb.c to bin/named and ldapdb.h to bin/named/include in the
|
||||
source tree.
|
||||
|
||||
Next alter bin/named/Makefile.in. Add ldapdb.@O@ to DBDRIVER_OBJS and
|
||||
ldapdb.c to DBDRIVER_SRCS. You also need to add something like
|
||||
-I/usr/local/include to DBDRIVER_INCLUDES and
|
||||
-L/usr/local/lib -lldap -llber -lresolv to DBDRIVER_LIBS
|
||||
depending on what LDAP library you have and where you installed it.
|
||||
|
||||
Finally you need to edit bin/named/main.c. Below where it says
|
||||
"#include "xxdb.h"", add the line "#include <ldapdb.h>". Below where
|
||||
it says "xxdb_init();" add the line "ldapdb_init();", and finally
|
||||
below where it says "xxdb_clear();", add "ldapdb_clear();".
|
||||
|
||||
Now you should hopefully be able to build it.
|
||||
|
||||
|
||||
CONFIGURING
|
||||
|
||||
Before you do any configuring of LDAP stuff, please try to configure
|
||||
and start bind as usual to see if things work.
|
||||
|
||||
To do anything useful, you need to store a zone in some LDAP server.
|
||||
From this release on, you must use a schema called dNSZone. Note that
|
||||
it relies on some attribute definitions in the Cosine schema, so that
|
||||
must be included as well. The Cosine schema probably comes with your
|
||||
LDAP server. You can find dNSZone and further details on how to store
|
||||
the data in your LDAP server at
|
||||
http://www.venaas.no/ldap/bind-sdb/
|
||||
|
||||
For an example, have a look at my venaas.com zone. Try a subtree search
|
||||
for objectClass=* at
|
||||
ldap ldap://129.241.20.67/dc=venaas,dc=com,o=DNS,dc=venaas,dc=no
|
||||
|
||||
To use it with BIND, I've added the following to named.conf:
|
||||
zone "venaas.com" {
|
||||
type master;
|
||||
database "ldap ldap://129.241.20.67/dc=venaas,dc=com,o=DNS,dc=venaas,dc=no 172800";
|
||||
};
|
||||
|
||||
When doing lookups BIND will do a sub-tree search below the base in the
|
||||
URL. The number 172800 is the TTL which will be used for all entries that
|
||||
haven't got the dNSTTL attribute.
|
||||
|
||||
Stig Venaas <venaas@uninett.no> 2001-04-12
|
||||
@@ -1,18 +0,0 @@
|
||||
This is an attempt at an LDAP back-end for BIND 9 using the new simplified
|
||||
database interface "sdb". This is the fifth release (0.5) and is not ready
|
||||
for production use yet. Note that this version (and 0.4) uses a new schema
|
||||
and is not backwards compatible with versions before 0.4. The big changes in
|
||||
0.5 are thread support and improved connection handling. Multiple threads
|
||||
can now access the back-end simultaneously, and rather than having one
|
||||
connection per zone, there is now one connection per thread per LDAP server.
|
||||
This should help people with multiple CPUs and people with a huge number of
|
||||
zones. One final change is support for literal IPv6 addresses in LDAP URLs.
|
||||
At least OpenLDAP 2 has IPv6 support, so if you use OpenLDAP 2 libraries and
|
||||
server, you got all you need.
|
||||
|
||||
If you have bug reports, fixes, comments, questions or whatever, please
|
||||
contact me. See also http://www.venaas.no/ldap/bind-sdb/ for information.
|
||||
|
||||
See INSTALL for how to build, install and use.
|
||||
|
||||
Stig Venaas <venaas@uninett.no> 2001-05-06
|
||||
@@ -1,17 +0,0 @@
|
||||
INSTALLATION
|
||||
|
||||
To Compile zone2ldap from contrib/sdb directory:
|
||||
|
||||
gcc -g `../../isc-config.sh --cflags isc dns` -c zone2ldap.c
|
||||
gcc -g -o zone2ldap zone2ldap.o `isc-config.sh --libs isc dns` -lldap -llber -lresolv
|
||||
|
||||
USAGE:
|
||||
|
||||
See zone2ldap.1
|
||||
|
||||
BUGS:
|
||||
|
||||
Jeff McNeil <jeff@snapcase.g-rock.net>
|
||||
|
||||
|
||||
|
||||
@@ -1,466 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2001 Stig Venaas
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <isc/mem.h>
|
||||
#include <isc/print.h>
|
||||
#include <isc/result.h>
|
||||
#include <isc/util.h>
|
||||
#include <isc/thread.h>
|
||||
|
||||
#include <dns/sdb.h>
|
||||
|
||||
#include <named/globals.h>
|
||||
|
||||
#include <ldap.h>
|
||||
#include "ldapdb.h"
|
||||
|
||||
/*
|
||||
* A simple database driver for LDAP. Not production quality yet
|
||||
*/
|
||||
|
||||
static dns_sdbimplementation_t *ldapdb = NULL;
|
||||
|
||||
struct ldapdb_data {
|
||||
char *hostport;
|
||||
char *hostname;
|
||||
int portno;
|
||||
char *base;
|
||||
int defaultttl;
|
||||
};
|
||||
|
||||
/* used by ldapdb_getconn */
|
||||
|
||||
struct ldapdb_entry {
|
||||
void *index;
|
||||
size_t size;
|
||||
void *data;
|
||||
struct ldapdb_entry *next;
|
||||
};
|
||||
|
||||
static struct ldapdb_entry *ldapdb_find(struct ldapdb_entry *stack,
|
||||
const void *index, size_t size) {
|
||||
while (stack != NULL) {
|
||||
if (stack->size == size && !memcmp(stack->index, index, size))
|
||||
return stack;
|
||||
stack = stack->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void ldapdb_insert(struct ldapdb_entry **stack,
|
||||
struct ldapdb_entry *item) {
|
||||
item->next = *stack;
|
||||
*stack = item;
|
||||
}
|
||||
|
||||
static void ldapdb_lock(int what) {
|
||||
static isc_mutex_t lock;
|
||||
|
||||
switch (what) {
|
||||
case 0:
|
||||
isc_mutex_init(&lock);
|
||||
break;
|
||||
case 1:
|
||||
LOCK(&lock);
|
||||
break;
|
||||
case -1:
|
||||
UNLOCK(&lock);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* data == NULL means cleanup */
|
||||
static LDAP **
|
||||
ldapdb_getconn(struct ldapdb_data *data)
|
||||
{
|
||||
static struct ldapdb_entry *allthreadsdata = NULL;
|
||||
struct ldapdb_entry *threaddata, *conndata;
|
||||
unsigned long threadid;
|
||||
|
||||
if (data == NULL) {
|
||||
/* cleanup */
|
||||
/* lock out other threads */
|
||||
ldapdb_lock(1);
|
||||
while (allthreadsdata != NULL) {
|
||||
threaddata = allthreadsdata;
|
||||
free(threaddata->index);
|
||||
while (threaddata->data != NULL) {
|
||||
conndata = threaddata->data;
|
||||
free(conndata->index);
|
||||
if (conndata->data != NULL)
|
||||
ldap_unbind((LDAP *)conndata->data);
|
||||
threaddata->data = conndata->next;
|
||||
free(conndata);
|
||||
}
|
||||
allthreadsdata = threaddata->next;
|
||||
free(threaddata);
|
||||
}
|
||||
ldapdb_lock(-1);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* look for connection data for current thread */
|
||||
threadid = isc_thread_self();
|
||||
threaddata = ldapdb_find(allthreadsdata, &threadid, sizeof(threadid));
|
||||
if (threaddata == NULL) {
|
||||
/* no data for this thread, create empty connection list */
|
||||
threaddata = malloc(sizeof(*threaddata));
|
||||
if (threaddata == NULL)
|
||||
return (NULL);
|
||||
threaddata->index = malloc(sizeof(threadid));
|
||||
if (threaddata->index == NULL) {
|
||||
free(threaddata);
|
||||
return (NULL);
|
||||
}
|
||||
*(unsigned long *)threaddata->index = threadid;
|
||||
threaddata->size = sizeof(threadid);
|
||||
threaddata->data = NULL;
|
||||
|
||||
/* need to lock out other threads here */
|
||||
ldapdb_lock(1);
|
||||
ldapdb_insert(&allthreadsdata, threaddata);
|
||||
ldapdb_lock(-1);
|
||||
}
|
||||
|
||||
/* threaddata points at the connection list for current thread */
|
||||
/* look for existing connection to our server */
|
||||
conndata = ldapdb_find((struct ldapdb_entry *)threaddata->data,
|
||||
data->hostport, strlen(data->hostport));
|
||||
if (conndata == NULL) {
|
||||
/* no connection data structure for this server, create one */
|
||||
conndata = malloc(sizeof(*conndata));
|
||||
if (conndata == NULL)
|
||||
return (NULL);
|
||||
(char *)conndata->index = data->hostport;
|
||||
conndata->size = strlen(data->hostport);
|
||||
conndata->data = NULL;
|
||||
ldapdb_insert((struct ldapdb_entry **)&threaddata->data,
|
||||
conndata);
|
||||
}
|
||||
|
||||
return (LDAP **)&conndata->data;
|
||||
}
|
||||
|
||||
/* callback routines */
|
||||
static isc_result_t
|
||||
ldapdb_create(const char *zone, int argc, char **argv,
|
||||
void *driverdata, void **dbdata)
|
||||
{
|
||||
struct ldapdb_data *data;
|
||||
char *s;
|
||||
int defaultttl;
|
||||
|
||||
UNUSED(zone);
|
||||
UNUSED(driverdata);
|
||||
|
||||
/* we assume that only one thread will call create at a time */
|
||||
/* want to do this only once for all instances */
|
||||
|
||||
if ((argc < 2)
|
||||
|| (argv[0] != strstr( argv[0], "ldap://"))
|
||||
|| ((defaultttl = atoi(argv[1])) < 1))
|
||||
return (ISC_R_FAILURE);
|
||||
data = isc_mem_get(ns_g_mctx, sizeof(struct ldapdb_data));
|
||||
if (data == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
data->hostport = isc_mem_strdup(ns_g_mctx, argv[0] + strlen("ldap://"));
|
||||
if (data->hostport == NULL) {
|
||||
isc_mem_put(ns_g_mctx, data, sizeof(struct ldapdb_data));
|
||||
return (ISC_R_NOMEMORY);
|
||||
}
|
||||
data->defaultttl = defaultttl;
|
||||
s = strchr(data->hostport, '/');
|
||||
if (s != NULL) {
|
||||
*s++ = '\0';
|
||||
data->base = *s != '\0' ? s : NULL;
|
||||
}
|
||||
|
||||
/* support URLs with literal IPv6 addresses */
|
||||
data->hostname = isc_mem_strdup(ns_g_mctx, data->hostport +
|
||||
(*data->hostport == '[' ? 1 : 0));
|
||||
if (data->hostname == NULL) {
|
||||
isc_mem_free(ns_g_mctx, data->hostport);
|
||||
isc_mem_put(ns_g_mctx, data, sizeof(struct ldapdb_data));
|
||||
return (ISC_R_NOMEMORY);
|
||||
}
|
||||
|
||||
if (*data->hostport == '[' &&
|
||||
(s = strchr(data->hostname, ']')) != NULL )
|
||||
*s++ = '\0';
|
||||
else
|
||||
s = data->hostname;
|
||||
s = strchr(s, ':');
|
||||
if (s != NULL) {
|
||||
*s++ = '\0';
|
||||
data->portno = atoi(s);
|
||||
} else
|
||||
data->portno = LDAP_PORT;
|
||||
|
||||
*dbdata = data;
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
static void
|
||||
ldapdb_destroy(const char *zone, void *driverdata, void **dbdata) {
|
||||
struct ldapdb_data *data = *dbdata;
|
||||
|
||||
UNUSED(zone);
|
||||
UNUSED(driverdata);
|
||||
|
||||
if (data->hostport != NULL)
|
||||
isc_mem_free(ns_g_mctx, data->hostport);
|
||||
if (data->hostname != NULL)
|
||||
isc_mem_free(ns_g_mctx, data->hostname);
|
||||
isc_mem_put(ns_g_mctx, data, sizeof(struct ldapdb_data));
|
||||
}
|
||||
|
||||
static void
|
||||
ldapdb_bind(struct ldapdb_data *data, LDAP **ldp)
|
||||
{
|
||||
if (*ldp != NULL)
|
||||
ldap_unbind(*ldp);
|
||||
*ldp = ldap_open(data->hostname, data->portno);
|
||||
if (*ldp == NULL)
|
||||
return;
|
||||
if (ldap_simple_bind_s(*ldp, NULL, NULL) != LDAP_SUCCESS) {
|
||||
ldap_unbind(*ldp);
|
||||
*ldp = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
ldapdb_lookup(const char *zone, const char *name, void *dbdata,
|
||||
dns_sdblookup_t *lookup)
|
||||
{
|
||||
isc_result_t result = ISC_R_NOTFOUND;
|
||||
struct ldapdb_data *data = dbdata;
|
||||
LDAP **ldp;
|
||||
LDAPMessage *res, *e;
|
||||
char *fltr, *a, **vals;
|
||||
char type[64];
|
||||
BerElement *ptr;
|
||||
int i;
|
||||
|
||||
ldp = ldapdb_getconn(data);
|
||||
if (ldp == NULL)
|
||||
return (ISC_R_FAILURE);
|
||||
if (*ldp == NULL) {
|
||||
ldapdb_bind(data, ldp);
|
||||
if (*ldp == NULL)
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
fltr = isc_mem_get(ns_g_mctx, strlen(zone) + strlen(name) +
|
||||
strlen("(&(zoneName=)(relativeDomainName=))") + 1);
|
||||
if (fltr == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
|
||||
strcpy(fltr, "(&(zoneName=");
|
||||
strcat(fltr, zone);
|
||||
strcat(fltr, ")(relativeDomainName=");
|
||||
strcat(fltr, name);
|
||||
strcat(fltr, "))");
|
||||
|
||||
if (ldap_search_s(*ldp, data->base, LDAP_SCOPE_SUBTREE, fltr, NULL, 0,
|
||||
&res) != LDAP_SUCCESS) {
|
||||
ldapdb_bind(data, ldp);
|
||||
if (*ldp != NULL)
|
||||
ldap_search_s(*ldp, data->base, LDAP_SCOPE_SUBTREE,
|
||||
fltr, NULL, 0, &res);
|
||||
}
|
||||
|
||||
isc_mem_put(ns_g_mctx, fltr, strlen(fltr) + 1);
|
||||
|
||||
if (*ldp == NULL)
|
||||
goto exit;
|
||||
|
||||
for (e = ldap_first_entry(*ldp, res); e != NULL;
|
||||
e = ldap_next_entry(*ldp, e)) {
|
||||
LDAP *ld = *ldp;
|
||||
int ttl = data->defaultttl;
|
||||
|
||||
for (a = ldap_first_attribute(ld, e, &ptr); a != NULL;
|
||||
a = ldap_next_attribute(ld, e, ptr)) {
|
||||
if (!strcmp(a, "dNSTTL")) {
|
||||
vals = ldap_get_values(ld, e, a);
|
||||
ttl = atoi(vals[0]);
|
||||
ldap_value_free(vals);
|
||||
ldap_memfree(a);
|
||||
break;
|
||||
}
|
||||
ldap_memfree(a);
|
||||
}
|
||||
for (a = ldap_first_attribute(ld, e, &ptr); a != NULL;
|
||||
a = ldap_next_attribute(ld, e, ptr)) {
|
||||
char *s;
|
||||
|
||||
for (s = a; *s; s++)
|
||||
*s = toupper(*s);
|
||||
s = strstr(a, "RECORD");
|
||||
if ((s == NULL) || (s == a)
|
||||
|| (s - a >= (signed int)sizeof(type))) {
|
||||
ldap_memfree(a);
|
||||
continue;
|
||||
}
|
||||
strncpy(type, a, s - a);
|
||||
type[s - a] = '\0';
|
||||
vals = ldap_get_values(ld, e, a);
|
||||
for (i=0; vals[i] != NULL; i++) {
|
||||
result = dns_sdb_putrr(lookup, type, ttl,
|
||||
vals[i]);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
ldap_value_free(vals);
|
||||
ldap_memfree(a);
|
||||
result = ISC_R_FAILURE;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
ldap_value_free(vals);
|
||||
ldap_memfree(a);
|
||||
}
|
||||
}
|
||||
exit:
|
||||
ldap_msgfree(res);
|
||||
return (result);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
ldapdb_allnodes(const char *zone, void *dbdata,
|
||||
dns_sdballnodes_t *allnodes) {
|
||||
isc_result_t result = ISC_R_NOTFOUND;
|
||||
struct ldapdb_data *data = dbdata;
|
||||
LDAP **ldp;
|
||||
LDAPMessage *res, *e;
|
||||
char type[64];
|
||||
char *fltr, *a, **vals;
|
||||
BerElement *ptr;
|
||||
int i;
|
||||
|
||||
ldp = ldapdb_getconn(data);
|
||||
if (ldp == NULL)
|
||||
return (ISC_R_FAILURE);
|
||||
if (*ldp == NULL) {
|
||||
ldapdb_bind(data, ldp);
|
||||
if (*ldp == NULL)
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
fltr = isc_mem_get(ns_g_mctx, strlen(zone) + strlen("(zoneName=)") + 1);
|
||||
if (fltr == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
|
||||
strcpy(fltr, "(zoneName=");
|
||||
strcat(fltr, zone);
|
||||
strcat(fltr, ")");
|
||||
|
||||
if (ldap_search_s(*ldp, data->base, LDAP_SCOPE_SUBTREE, fltr, NULL, 0,
|
||||
&res) != LDAP_SUCCESS) {
|
||||
ldapdb_bind(data, ldp);
|
||||
if (*ldp != NULL)
|
||||
ldap_search_s(*ldp, data->base, LDAP_SCOPE_SUBTREE,
|
||||
fltr, NULL, 0, &res);
|
||||
}
|
||||
|
||||
isc_mem_put(ns_g_mctx, fltr, strlen(fltr) + 1);
|
||||
|
||||
for (e = ldap_first_entry(*ldp, res); e != NULL;
|
||||
e = ldap_next_entry(*ldp, e)) {
|
||||
LDAP *ld = *ldp;
|
||||
char *name = NULL;
|
||||
int ttl = data->defaultttl;
|
||||
|
||||
for (a = ldap_first_attribute(ld, e, &ptr); a != NULL;
|
||||
a = ldap_next_attribute(ld, e, ptr)) {
|
||||
if (!strcmp(a, "dNSTTL")) {
|
||||
vals = ldap_get_values(ld, e, a);
|
||||
ttl = atoi(vals[0]);
|
||||
ldap_value_free(vals);
|
||||
} else if (!strcmp(a, "relativeDomainName")) {
|
||||
vals = ldap_get_values(ld, e, a);
|
||||
name = isc_mem_strdup(ns_g_mctx, vals[0]);
|
||||
ldap_value_free(vals);
|
||||
}
|
||||
ldap_memfree(a);
|
||||
}
|
||||
|
||||
if (name == NULL)
|
||||
continue;
|
||||
|
||||
for (a = ldap_first_attribute(ld, e, &ptr); a != NULL;
|
||||
a = ldap_next_attribute(ld, e, ptr)) {
|
||||
char *s;
|
||||
|
||||
for (s = a; *s; s++)
|
||||
*s = toupper(*s);
|
||||
s = strstr(a, "RECORD");
|
||||
if ((s == NULL) || (s == a)
|
||||
|| (s - a >= (signed int)sizeof(type))) {
|
||||
ldap_memfree(a);
|
||||
continue;
|
||||
}
|
||||
strncpy(type, a, s - a);
|
||||
type[s - a] = '\0';
|
||||
vals = ldap_get_values(ld, e, a);
|
||||
for (i=0; vals[i] != NULL; i++) {
|
||||
result = dns_sdb_putnamedrr(allnodes, name,
|
||||
type, ttl, vals[i]);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
ldap_value_free(vals);
|
||||
ldap_memfree(a);
|
||||
isc_mem_free(ns_g_mctx, name);
|
||||
result = ISC_R_FAILURE;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
ldap_value_free(vals);
|
||||
ldap_memfree(a);
|
||||
}
|
||||
isc_mem_free(ns_g_mctx, name);
|
||||
}
|
||||
|
||||
exit:
|
||||
ldap_msgfree(res);
|
||||
return (result);
|
||||
}
|
||||
|
||||
static dns_sdbmethods_t ldapdb_methods = {
|
||||
ldapdb_lookup,
|
||||
NULL, /* authority */
|
||||
ldapdb_allnodes,
|
||||
ldapdb_create,
|
||||
ldapdb_destroy
|
||||
};
|
||||
|
||||
/* Wrapper around dns_sdb_register() */
|
||||
isc_result_t
|
||||
ldapdb_init(void) {
|
||||
unsigned int flags =
|
||||
DNS_SDBFLAG_RELATIVEOWNER |
|
||||
DNS_SDBFLAG_RELATIVERDATA |
|
||||
DNS_SDBFLAG_THREADSAFE;
|
||||
|
||||
ldapdb_lock(0);
|
||||
return (dns_sdb_register("ldap", &ldapdb_methods, NULL, flags,
|
||||
ns_g_mctx, &ldapdb));
|
||||
}
|
||||
|
||||
/* Wrapper around dns_sdb_unregister() */
|
||||
void
|
||||
ldapdb_clear(void) {
|
||||
if (ldapdb != NULL) {
|
||||
/* clean up thread data */
|
||||
ldapdb_getconn(NULL);
|
||||
dns_sdb_unregister(&ldapdb);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#include <isc/types.h>
|
||||
|
||||
isc_result_t ldapdb_init(void);
|
||||
|
||||
void ldapdb_clear(void);
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
.TH zone2ldap 1 "8 March 2001"
|
||||
.SH NAME
|
||||
zone2ldap /- Load BIND 9 Zone files into LDAP Directory
|
||||
.SH SYNOPSIS
|
||||
zone2ldap [-D Bind DN] [-w Bind Password] [-b Base DN] [-z Zone] [-f Zone File ] [-h Ldap Host] [-cd] [-v]
|
||||
.SH DESCRIPTION
|
||||
zone2ldap will parse a complete BIND 9 format DNS zone file, and load
|
||||
the contents into an LDAP directory, for use with the LDAP sdb back-end.
|
||||
|
||||
If the zone already exists, zone2ldap will exit succesfully. If the zone does not exists, or
|
||||
partially exists, zone2ldap will attempt to add all/missing zone data.
|
||||
|
||||
.SS Options
|
||||
.TP
|
||||
-b
|
||||
LDAP Base DN. LDAP systems require a "base dn", which is generally considered the LDAP Directory root.
|
||||
If the zone you are loading is different from the base, then you will need to tell zone2ldap what your LDAP
|
||||
base is.
|
||||
.TP
|
||||
-v
|
||||
Print version information, and immediatly exit.
|
||||
.TP
|
||||
-f
|
||||
Zone file. Bind 9.1 compatible zone file, from which zone information will be read.
|
||||
.TP
|
||||
-d
|
||||
Dump debug information to standard out.
|
||||
.TP
|
||||
-w
|
||||
LDAP Bind password, corresponding the the value of "-b".
|
||||
.TP
|
||||
-h
|
||||
LDAP Directory host. This is the hostname of the LDAP system you wish to store zone information on.
|
||||
An LDAP server should be listening on port 389 of the target system. This may be ommited, and will default
|
||||
to "localhost".
|
||||
.TP
|
||||
-c
|
||||
This will create the zone portion of the DN you are importing. For instance, if you are creating a domain.com zone,
|
||||
zone2ldap should first create "dc=domain,dc=com". This is useful if you are creating multiple domains.
|
||||
.TP
|
||||
-z
|
||||
This is the name of the zone specified in the SOA record.
|
||||
.SH EXAMPLES
|
||||
Following are brief examples of how to import a zone file into your LDAP DIT.
|
||||
.SS Loading zone domain.com, with an LDAP Base DN of dc=domain,dc=com
|
||||
zone2ldap -D dc=root -w secret -h localhost -z domain.com -f domain.com.zone
|
||||
|
||||
This will add Resource Records into an ALREADY EXISTING dc=domain,dc=com. The final SOA DN in this case, will be
|
||||
dc=@,dc=domain,dc=com
|
||||
|
||||
.SS Loading customer.com, if your LDAP Base DN is dc=provider,dc=net.
|
||||
zone2ldap -D dc=root -w secret -h localhost -z customer.com -b dc=provider,dc=net -f customer.com.zone -c
|
||||
|
||||
This will create dc=customer,dc=com under dc=provider,dc=net, and add all necessary Resource Records. The final
|
||||
root DN to the SOA will be dc=@,dc=customer,dc=com,dc=provider,dc=net.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
named(8) ldap(3)
|
||||
http://www.venaas.no/ldap/bind-sdb/
|
||||
.SH "BUGS"
|
||||
Send all bug reports to Jeff McNeil <jeff@snapcase.g-rock.net>
|
||||
.SH AUTHOR
|
||||
Jeff McNeil <jeff@snapcase.g-rock.net>
|
||||
|
||||
@@ -1,721 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2001 Jeff McNeil <jeff@snapcase.g-rock.net>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* Change Log
|
||||
*
|
||||
* Tue May 1 19:19:54 EDT 2001 - Jeff McNeil
|
||||
* Update to objectClass code, and add_to_rr_list function
|
||||
* (I need to rename that) to support the dNSZone schema,
|
||||
* ditched dNSDomain2 schema support. Version 0.3-ALPHA
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/print.h>
|
||||
#include <isc/result.h>
|
||||
|
||||
#include <dns/db.h>
|
||||
#include <dns/dbiterator.h>
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/name.h>
|
||||
#include <dns/rdata.h>
|
||||
#include <dns/rdataset.h>
|
||||
#include <dns/rdatasetiter.h>
|
||||
#include <dns/result.h>
|
||||
#include <dns/rdatatype.h>
|
||||
|
||||
#include <ldap.h>
|
||||
|
||||
#define DNS_OBJECT 6
|
||||
#define DNS_TOP 2
|
||||
|
||||
#define VERSION "0.4-ALPHA"
|
||||
|
||||
#define NO_SPEC 0
|
||||
#define WI_SPEC 1
|
||||
|
||||
/* Global Zone Pointer */
|
||||
char *gbl_zone = NULL;
|
||||
|
||||
typedef struct LDAP_INFO
|
||||
{
|
||||
char *dn;
|
||||
LDAPMod **attrs;
|
||||
struct LDAP_INFO *next;
|
||||
int attrcnt;
|
||||
}
|
||||
ldap_info;
|
||||
|
||||
/* usage Info */
|
||||
void usage ();
|
||||
|
||||
/* Add to the ldap dit */
|
||||
void add_ldap_values (ldap_info * ldinfo);
|
||||
|
||||
/* Init an ldap connection */
|
||||
void init_ldap_conn ();
|
||||
|
||||
/* Ldap error checking */
|
||||
void ldap_result_check (char *msg, char *dn, int err);
|
||||
|
||||
/* Put a hostname into a char ** array */
|
||||
char **hostname_to_dn_list (char *hostname, char *zone, unsigned int flags);
|
||||
|
||||
/* Find out how many items are in a char ** array */
|
||||
int get_attr_list_size (char **tmp);
|
||||
|
||||
/* Get a DN */
|
||||
char *build_dn_from_dc_list (char **dc_list, unsigned int ttl, int flag);
|
||||
|
||||
/* Add to RR list */
|
||||
void add_to_rr_list (char *dn, char *name, char *type, char *data,
|
||||
unsigned int ttl, unsigned int flags);
|
||||
|
||||
/* Error checking */
|
||||
void isc_result_check (isc_result_t res, char *errorstr);
|
||||
|
||||
/* Generate LDIF Format files */
|
||||
void generate_ldap (dns_name_t * dnsname, dns_rdata_t * rdata,
|
||||
unsigned int ttl);
|
||||
|
||||
/* head pointer to the list */
|
||||
ldap_info *ldap_info_base = NULL;
|
||||
|
||||
char *argzone, *ldapbase, *binddn, *bindpw = NULL;
|
||||
char *ldapsystem = "localhost";
|
||||
static char *objectClasses[] =
|
||||
{ "top", "dNSZone", NULL };
|
||||
static char *topObjectClasses[] = { "top", NULL };
|
||||
LDAP *conn;
|
||||
unsigned int debug = 0;
|
||||
|
||||
#ifdef DEBUG
|
||||
debug = 1;
|
||||
#endif
|
||||
|
||||
int
|
||||
main (int *argc, char **argv)
|
||||
{
|
||||
isc_mem_t *isc_ctx = NULL;
|
||||
isc_result_t result;
|
||||
char *basedn;
|
||||
ldap_info *tmp;
|
||||
LDAPMod *base_attrs[2];
|
||||
LDAPMod base;
|
||||
isc_buffer_t buff;
|
||||
char *zonefile;
|
||||
char fullbasedn[1024];
|
||||
char *ctmp;
|
||||
dns_fixedname_t fixedzone, fixedname;
|
||||
dns_rdataset_t rdataset;
|
||||
char **dc_list;
|
||||
dns_rdata_t rdata = DNS_RDATA_INIT;
|
||||
dns_rdatasetiter_t *riter;
|
||||
dns_name_t *zone, *name;
|
||||
dns_db_t *db = NULL;
|
||||
dns_dbiterator_t *dbit = NULL;
|
||||
dns_dbnode_t *node;
|
||||
extern char *optarg;
|
||||
extern int optind, opterr, optopt;
|
||||
int create_base = 0;
|
||||
int topt;
|
||||
|
||||
if ((int) argc < 2)
|
||||
{
|
||||
usage ();
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
while ((topt = getopt ((int) argc, argv, "D:w:b:z:f:h:?dcv")) != -1)
|
||||
{
|
||||
switch (topt)
|
||||
{
|
||||
case 'v':
|
||||
printf("%s\n", VERSION);
|
||||
exit(0);
|
||||
case 'c':
|
||||
create_base++;
|
||||
break;
|
||||
case 'd':
|
||||
debug++;
|
||||
break;
|
||||
case 'D':
|
||||
binddn = strdup (optarg);
|
||||
break;
|
||||
case 'w':
|
||||
bindpw = strdup (optarg);
|
||||
break;
|
||||
case 'b':
|
||||
ldapbase = strdup (optarg);
|
||||
break;
|
||||
case 'z':
|
||||
argzone = strdup (optarg);
|
||||
// We wipe argzone all to hell when we parse it for the DN */
|
||||
gbl_zone = strdup(argzone);
|
||||
break;
|
||||
case 'f':
|
||||
zonefile = strdup (optarg);
|
||||
break;
|
||||
case 'h':
|
||||
ldapsystem = strdup (optarg);
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
usage ();
|
||||
exit (0);
|
||||
}
|
||||
}
|
||||
|
||||
if ((argzone == NULL) || (zonefile == NULL))
|
||||
{
|
||||
usage ();
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
printf ("Initializing ISC Routines, parsing zone file\n");
|
||||
|
||||
result = isc_mem_create (0, 0, &isc_ctx);
|
||||
isc_result_check (result, "isc_mem_create");
|
||||
|
||||
isc_buffer_init (&buff, argzone, strlen (argzone));
|
||||
isc_buffer_add (&buff, strlen (argzone));
|
||||
dns_fixedname_init (&fixedzone);
|
||||
zone = dns_fixedname_name (&fixedzone);
|
||||
result = dns_name_fromtext (zone, &buff, dns_rootname, ISC_FALSE, NULL);
|
||||
isc_result_check (result, "dns_name_fromtext");
|
||||
|
||||
result =
|
||||
dns_db_create (isc_ctx, "rbt", zone, dns_dbtype_zone, dns_rdataclass_in,
|
||||
0, NULL, &db);
|
||||
isc_result_check (result, "dns_db_create");
|
||||
|
||||
result = dns_db_load (db, zonefile);
|
||||
isc_result_check (result, "Check Zone Syntax: dns_db_load");
|
||||
|
||||
result = dns_db_createiterator (db, ISC_FALSE, &dbit);
|
||||
isc_result_check (result, "dns_db_createiterator");
|
||||
|
||||
result = dns_dbiterator_first (dbit);
|
||||
isc_result_check (result, "dns_dbiterator_first");
|
||||
|
||||
dns_fixedname_init (&fixedname);
|
||||
name = dns_fixedname_name (&fixedname);
|
||||
dns_rdataset_init (&rdataset);
|
||||
dns_rdata_init (&rdata);
|
||||
|
||||
while (result == ISC_R_SUCCESS)
|
||||
{
|
||||
node = NULL;
|
||||
result = dns_dbiterator_current (dbit, &node, name);
|
||||
|
||||
if (result == ISC_R_NOMORE)
|
||||
break;
|
||||
|
||||
isc_result_check (result, "dns_dbiterator_current");
|
||||
|
||||
riter = NULL;
|
||||
result = dns_db_allrdatasets (db, node, NULL, 0, &riter);
|
||||
isc_result_check (result, "dns_db_allrdatasets");
|
||||
|
||||
result = dns_rdatasetiter_first (riter);
|
||||
//isc_result_check(result, "dns_rdatasetiter_first");
|
||||
|
||||
while (result == ISC_R_SUCCESS)
|
||||
{
|
||||
dns_rdatasetiter_current (riter, &rdataset);
|
||||
result = dns_rdataset_first (&rdataset);
|
||||
isc_result_check (result, "dns_rdatasetiter_current");
|
||||
|
||||
while (result == ISC_R_SUCCESS)
|
||||
{
|
||||
dns_rdataset_current (&rdataset, &rdata);
|
||||
generate_ldap (name, &rdata, rdataset.ttl);
|
||||
dns_rdata_reset (&rdata);
|
||||
result = dns_rdataset_next (&rdataset);
|
||||
}
|
||||
dns_rdataset_disassociate (&rdataset);
|
||||
result = dns_rdatasetiter_next (riter);
|
||||
|
||||
}
|
||||
dns_rdatasetiter_destroy (&riter);
|
||||
result = dns_dbiterator_next (dbit);
|
||||
|
||||
}
|
||||
|
||||
/* Initialize the LDAP Connection */
|
||||
if (debug)
|
||||
printf ("Initializing LDAP Connection to %s as %s\n", ldapsystem, binddn);
|
||||
|
||||
init_ldap_conn ();
|
||||
|
||||
if (create_base)
|
||||
{
|
||||
if (debug)
|
||||
printf ("Creating base zone DN %s\n", argzone);
|
||||
|
||||
dc_list = hostname_to_dn_list (argzone, argzone, DNS_TOP);
|
||||
basedn = build_dn_from_dc_list (dc_list, 0, NO_SPEC);
|
||||
|
||||
for (ctmp = &basedn[strlen (basedn)]; ctmp >= &basedn[0]; ctmp--)
|
||||
{
|
||||
if ((*ctmp == ',') || (ctmp == &basedn[0]))
|
||||
{
|
||||
base.mod_op = LDAP_MOD_ADD;
|
||||
base.mod_type = "objectClass";
|
||||
base.mod_values = topObjectClasses;
|
||||
base_attrs[0] = &base;
|
||||
base_attrs[1] = NULL;
|
||||
|
||||
if (ldapbase)
|
||||
{
|
||||
if (ctmp != &basedn[0])
|
||||
sprintf (fullbasedn, "%s,%s", ctmp + 1, ldapbase);
|
||||
else
|
||||
sprintf (fullbasedn, "%s,%s", ctmp, ldapbase);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ctmp != &basedn[0])
|
||||
sprintf (fullbasedn, "%s", ctmp + 1);
|
||||
else
|
||||
sprintf (fullbasedn, "%s", ctmp);
|
||||
}
|
||||
result = ldap_add_s (conn, fullbasedn, base_attrs);
|
||||
ldap_result_check ("intial ldap_add_s", fullbasedn, result);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (debug)
|
||||
printf ("Skipping zone base dn creation for %s\n", argzone);
|
||||
}
|
||||
|
||||
for (tmp = ldap_info_base; tmp != NULL; tmp = tmp->next)
|
||||
{
|
||||
|
||||
if (debug)
|
||||
printf ("Adding DN: %s\n", tmp->dn);
|
||||
|
||||
add_ldap_values (tmp);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
printf("Operation Complete.\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Check the status of an isc_result_t after any isc routines.
|
||||
* I should probably rename this function, as not to cause any
|
||||
* confusion with the isc* routines. Will exit on error. */
|
||||
void
|
||||
isc_result_check (isc_result_t res, char *errorstr)
|
||||
{
|
||||
if (res != ISC_R_SUCCESS)
|
||||
{
|
||||
fprintf (stderr, " %s: %s\n", errorstr, isc_result_totext (res));
|
||||
exit (-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Takes DNS information, in bind data structure format, and adds textual
|
||||
* zone information to the LDAP run queue. */
|
||||
void
|
||||
generate_ldap (dns_name_t * dnsname, dns_rdata_t * rdata, unsigned int ttl)
|
||||
{
|
||||
unsigned char name[DNS_NAME_MAXTEXT + 1];
|
||||
unsigned int len;
|
||||
unsigned char type[20];
|
||||
unsigned char data[2048];
|
||||
char **dc_list;
|
||||
char *dn;
|
||||
|
||||
isc_buffer_t buff;
|
||||
isc_result_t result;
|
||||
|
||||
isc_buffer_init (&buff, name, sizeof (name));
|
||||
result = dns_name_totext (dnsname, ISC_TRUE, &buff);
|
||||
isc_result_check (result, "dns_name_totext");
|
||||
name[isc_buffer_usedlength (&buff)] = 0;
|
||||
|
||||
isc_buffer_init (&buff, type, sizeof (type));
|
||||
result = dns_rdatatype_totext (rdata->type, &buff);
|
||||
isc_result_check (result, "dns_rdatatype_totext");
|
||||
type[isc_buffer_usedlength (&buff)] = 0;
|
||||
|
||||
isc_buffer_init (&buff, data, sizeof (data));
|
||||
result = dns_rdata_totext (rdata, NULL, &buff);
|
||||
isc_result_check (result, "dns_rdata_totext");
|
||||
data[isc_buffer_usedlength (&buff)] = 0;
|
||||
|
||||
dc_list = hostname_to_dn_list (name, argzone, DNS_OBJECT);
|
||||
len = (get_attr_list_size (dc_list) - 2);
|
||||
dn = build_dn_from_dc_list (dc_list, ttl, WI_SPEC);
|
||||
|
||||
if (debug)
|
||||
printf ("Adding %s (%s %s) to run queue list.\n", dn, type, data);
|
||||
|
||||
add_to_rr_list (dn, dc_list[len], type, data, ttl, DNS_OBJECT);
|
||||
}
|
||||
|
||||
|
||||
/* Locate an item in the Run queue linked list, by DN. Used by functions
|
||||
* which add items to the run queue.
|
||||
*/
|
||||
ldap_info *
|
||||
locate_by_dn (char *dn)
|
||||
{
|
||||
ldap_info *tmp;
|
||||
for (tmp = ldap_info_base; tmp != (ldap_info *) NULL; tmp = tmp->next)
|
||||
{
|
||||
if (!strncmp (tmp->dn, dn, strlen (dn)))
|
||||
return tmp;
|
||||
}
|
||||
return (ldap_info *) NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Take textual zone data, and add to the LDAP Run queue. This works like so:
|
||||
* If locate_by_dn does not return, alloc a new ldap_info structure, and then
|
||||
* calloc a LDAPMod array, fill in the default "everyone needs this" information,
|
||||
* including object classes and dc's. If it locate_by_dn does return, then we'll
|
||||
* realloc for more LDAPMod structs, and appened the new data. If an LDAPMod exists
|
||||
* for the parameter we're adding, then we'll realloc the mod_values array, and
|
||||
* add the new value to the existing LDAPMod. Finnaly, it assures linkage exists
|
||||
* within the Run queue linked ilst*/
|
||||
|
||||
void
|
||||
add_to_rr_list (char *dn, char *name, char *type,
|
||||
char *data, unsigned int ttl, unsigned int flags)
|
||||
{
|
||||
int i;
|
||||
int x;
|
||||
ldap_info *tmp;
|
||||
int attrlist;
|
||||
char ldap_type_buffer[128];
|
||||
char charttl[64];
|
||||
|
||||
|
||||
if ((tmp = locate_by_dn (dn)) == NULL)
|
||||
{
|
||||
|
||||
/* There wasn't one already there, so we need to allocate a new one,
|
||||
* and stick it on the list */
|
||||
|
||||
tmp = (ldap_info *) malloc (sizeof (ldap_info));
|
||||
if (tmp == (ldap_info *) NULL)
|
||||
{
|
||||
fprintf (stderr, "malloc: %s\n", strerror (errno));
|
||||
ldap_unbind_s (conn);
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
tmp->dn = strdup (dn);
|
||||
tmp->attrs = (LDAPMod **) calloc (sizeof (LDAPMod *), flags);
|
||||
if (tmp->attrs == (LDAPMod **) NULL)
|
||||
{
|
||||
fprintf (stderr, "calloc: %s\n", strerror (errno));
|
||||
ldap_unbind_s (conn);
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
for (i = 0; i < flags; i++)
|
||||
{
|
||||
tmp->attrs[i] = (LDAPMod *) malloc (sizeof (LDAPMod));
|
||||
if (tmp->attrs[i] == (LDAPMod *) NULL)
|
||||
{
|
||||
fprintf (stderr, "malloc: %s\n", strerror (errno));
|
||||
exit (-1);
|
||||
}
|
||||
}
|
||||
tmp->attrs[0]->mod_op = LDAP_MOD_ADD;
|
||||
tmp->attrs[0]->mod_type = "objectClass";
|
||||
|
||||
if (flags == DNS_OBJECT)
|
||||
tmp->attrs[0]->mod_values = objectClasses;
|
||||
else
|
||||
{
|
||||
tmp->attrs[0]->mod_values = topObjectClasses;
|
||||
tmp->attrs[1] = NULL;
|
||||
tmp->attrcnt = 2;
|
||||
tmp->next = ldap_info_base;
|
||||
ldap_info_base = tmp;
|
||||
return;
|
||||
}
|
||||
|
||||
tmp->attrs[1]->mod_op = LDAP_MOD_ADD;
|
||||
tmp->attrs[1]->mod_type = "relativeDomainName";
|
||||
tmp->attrs[1]->mod_values = (char **) calloc (sizeof (char *), 2);
|
||||
|
||||
if (tmp->attrs[1]->mod_values == (char **)NULL)
|
||||
exit(-1);
|
||||
|
||||
tmp->attrs[1]->mod_values[0] = strdup (name);
|
||||
tmp->attrs[1]->mod_values[2] = NULL;
|
||||
|
||||
sprintf (ldap_type_buffer, "%sRecord", type);
|
||||
|
||||
tmp->attrs[2]->mod_op = LDAP_MOD_ADD;
|
||||
tmp->attrs[2]->mod_type = strdup (ldap_type_buffer);
|
||||
tmp->attrs[2]->mod_values = (char **) calloc (sizeof (char *), 2);
|
||||
|
||||
if (tmp->attrs[2]->mod_values == (char **)NULL)
|
||||
exit(-1);
|
||||
|
||||
tmp->attrs[2]->mod_values[0] = strdup (data);
|
||||
tmp->attrs[2]->mod_values[1] = NULL;
|
||||
|
||||
tmp->attrs[3]->mod_op = LDAP_MOD_ADD;
|
||||
tmp->attrs[3]->mod_type = "dNSTTL";
|
||||
tmp->attrs[3]->mod_values = (char **) calloc (sizeof (char *), 2);
|
||||
|
||||
if (tmp->attrs[3]->mod_values == (char **)NULL)
|
||||
exit(-1);
|
||||
|
||||
sprintf (charttl, "%d", ttl);
|
||||
tmp->attrs[3]->mod_values[0] = strdup (charttl);
|
||||
tmp->attrs[3]->mod_values[1] = NULL;
|
||||
|
||||
tmp->attrs[4]->mod_op = LDAP_MOD_ADD;
|
||||
tmp->attrs[4]->mod_type = "zoneName";
|
||||
tmp->attrs[4]->mod_values = (char **)calloc(sizeof(char *), 2);
|
||||
tmp->attrs[4]->mod_values[0] = gbl_zone;
|
||||
tmp->attrs[4]->mod_values[1] = NULL;
|
||||
|
||||
tmp->attrs[5] = NULL;
|
||||
tmp->attrcnt = flags;
|
||||
tmp->next = ldap_info_base;
|
||||
ldap_info_base = tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (i = 0; tmp->attrs[i] != NULL; i++)
|
||||
{
|
||||
sprintf (ldap_type_buffer, "%sRecord", type);
|
||||
if (!strncmp
|
||||
(ldap_type_buffer, tmp->attrs[i]->mod_type,
|
||||
strlen (tmp->attrs[i]->mod_type)))
|
||||
{
|
||||
attrlist = get_attr_list_size (tmp->attrs[i]->mod_values);
|
||||
tmp->attrs[i]->mod_values =
|
||||
(char **) realloc (tmp->attrs[i]->mod_values,
|
||||
sizeof (char *) * (attrlist + 1));
|
||||
|
||||
if (tmp->attrs[i]->mod_values == (char **) NULL)
|
||||
{
|
||||
fprintf (stderr, "realloc: %s\n", strerror (errno));
|
||||
ldap_unbind_s (conn);
|
||||
exit (-1);
|
||||
}
|
||||
for (x = 0; tmp->attrs[i]->mod_values[x] != NULL; x++);
|
||||
|
||||
tmp->attrs[i]->mod_values[x] = strdup (data);
|
||||
tmp->attrs[i]->mod_values[x + 1] = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
tmp->attrs =
|
||||
(LDAPMod **) realloc (tmp->attrs,
|
||||
sizeof (LDAPMod) * ++(tmp->attrcnt));
|
||||
if (tmp->attrs == NULL)
|
||||
{
|
||||
fprintf (stderr, "realloc: %s\n", strerror (errno));
|
||||
ldap_unbind_s (conn);
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
for (x = 0; tmp->attrs[x] != NULL; x++);
|
||||
tmp->attrs[x] = (LDAPMod *) malloc (sizeof (LDAPMod));
|
||||
tmp->attrs[x]->mod_op = LDAP_MOD_ADD;
|
||||
tmp->attrs[x]->mod_type = strdup (ldap_type_buffer);
|
||||
tmp->attrs[x]->mod_values = (char **) calloc (sizeof (char *), 2);
|
||||
tmp->attrs[x]->mod_values[0] = strdup (data);
|
||||
tmp->attrs[x]->mod_values[1] = NULL;
|
||||
tmp->attrs[x + 1] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Size of a mod_values list, plus the terminating NULL field. */
|
||||
int
|
||||
get_attr_list_size (char **tmp)
|
||||
{
|
||||
int i = 0;
|
||||
char **ftmp = tmp;
|
||||
while (*ftmp != NULL)
|
||||
{
|
||||
i++;
|
||||
ftmp++;
|
||||
}
|
||||
return ++i;
|
||||
}
|
||||
|
||||
|
||||
/* take a hostname, and split it into a char ** of the dc parts,
|
||||
* example, we have www.domain.com, this function will return:
|
||||
* array[0] = com, array[1] = domain, array[2] = www. */
|
||||
|
||||
char **
|
||||
hostname_to_dn_list (char *hostname, char *zone, unsigned int flags)
|
||||
{
|
||||
char *tmp;
|
||||
static char *dn_buffer[64];
|
||||
int i = 0;
|
||||
char *zname;
|
||||
char *hnamebuff;
|
||||
|
||||
zname = strdup (hostname);
|
||||
|
||||
if (flags == DNS_OBJECT)
|
||||
{
|
||||
|
||||
if (strlen (zname) != strlen (zone))
|
||||
{
|
||||
tmp = &zname[strlen (zname) - strlen (zone)];
|
||||
*--tmp = '\0';
|
||||
hnamebuff = strdup (zname);
|
||||
zname = ++tmp;
|
||||
}
|
||||
else
|
||||
hnamebuff = "@";
|
||||
}
|
||||
else
|
||||
{
|
||||
zname = zone;
|
||||
hnamebuff = NULL;
|
||||
}
|
||||
|
||||
for (tmp = strrchr (zname, '.'); tmp != (char *) 0;
|
||||
tmp = strrchr (zname, '.'))
|
||||
{
|
||||
*tmp++ = '\0';
|
||||
dn_buffer[i++] = tmp;
|
||||
}
|
||||
dn_buffer[i++] = zname;
|
||||
dn_buffer[i++] = hnamebuff;
|
||||
dn_buffer[i] = NULL;
|
||||
|
||||
return dn_buffer;
|
||||
}
|
||||
|
||||
|
||||
/* build an sdb compatible LDAP DN from a "dc_list" (char **).
|
||||
* will append dNSTTL information to each RR Record, with the
|
||||
* exception of "@"/SOA. */
|
||||
|
||||
char *
|
||||
build_dn_from_dc_list (char **dc_list, unsigned int ttl, int flag)
|
||||
{
|
||||
int size;
|
||||
int x;
|
||||
static char dn[1024];
|
||||
char tmp[128];
|
||||
|
||||
bzero (tmp, sizeof (tmp));
|
||||
bzero (dn, sizeof (dn));
|
||||
size = get_attr_list_size (dc_list);
|
||||
for (x = size - 2; x > 0; x--)
|
||||
{
|
||||
if (flag == WI_SPEC)
|
||||
{
|
||||
if (x == (size - 2) && (strncmp (dc_list[x], "@", 1) == 0) && (ttl))
|
||||
sprintf (tmp, "relativeDomainName=%s + dNSTTL=%d,", dc_list[x], ttl);
|
||||
else if (x == (size - 2))
|
||||
sprintf(tmp, "relativeDomainName=%s,",dc_list[x]);
|
||||
else
|
||||
sprintf(tmp,"dc=%s,", dc_list[x]);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(tmp, "dc=%s,", dc_list[x]);
|
||||
}
|
||||
|
||||
|
||||
strncat (dn, tmp, sizeof (dn) - strlen (dn));
|
||||
}
|
||||
|
||||
sprintf (tmp, "dc=%s", dc_list[0]);
|
||||
strncat (dn, tmp, sizeof (dn) - strlen (dn));
|
||||
|
||||
fflush(NULL);
|
||||
return dn;
|
||||
}
|
||||
|
||||
|
||||
/* Initialize LDAP Conn */
|
||||
void
|
||||
init_ldap_conn ()
|
||||
{
|
||||
int result;
|
||||
conn = ldap_open (ldapsystem, LDAP_PORT);
|
||||
if (conn == NULL)
|
||||
{
|
||||
fprintf (stderr, "Error opening Ldap connection: %s\n",
|
||||
strerror (errno));
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
result = ldap_simple_bind_s (conn, binddn, bindpw);
|
||||
ldap_result_check ("ldap_simple_bind_s", "LDAP Bind", result);
|
||||
}
|
||||
|
||||
/* Like isc_result_check, only for LDAP */
|
||||
void
|
||||
ldap_result_check (char *msg, char *dn, int err)
|
||||
{
|
||||
if ((err != LDAP_SUCCESS) && (err != LDAP_ALREADY_EXISTS))
|
||||
{
|
||||
fprintf(stderr, "Error while adding %s (%s):\n",
|
||||
dn, msg);
|
||||
ldap_perror (conn, dn);
|
||||
ldap_unbind_s (conn);
|
||||
exit (-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* For running the ldap_info run queue. */
|
||||
void
|
||||
add_ldap_values (ldap_info * ldinfo)
|
||||
{
|
||||
int result;
|
||||
char dnbuffer[1024];
|
||||
|
||||
|
||||
if (ldapbase != NULL)
|
||||
sprintf (dnbuffer, "%s,%s", ldinfo->dn, ldapbase);
|
||||
else
|
||||
sprintf (dnbuffer, "%s", ldinfo->dn);
|
||||
|
||||
result = ldap_add_s (conn, dnbuffer, ldinfo->attrs);
|
||||
ldap_result_check ("ldap_add_s", dnbuffer, result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* name says it all */
|
||||
void
|
||||
usage ()
|
||||
{
|
||||
fprintf (stderr,
|
||||
"zone2ldap -D [BIND DN] -w [BIND PASSWORD] -b [BASE DN] -z [ZONE] -f [ZONE FILE] -h [LDAP HOST]
|
||||
[-c Create LDAP Base structure][-d Debug Output (lots !)] \n ");}
|
||||
@@ -1,348 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
||||
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
||||
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: pgsqldb.c,v 1.12 2001/02/28 23:42:37 bwelling Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <pgsql/libpq-fe.h>
|
||||
|
||||
#include <isc/mem.h>
|
||||
#include <isc/print.h>
|
||||
#include <isc/result.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
#include <dns/sdb.h>
|
||||
#include <dns/result.h>
|
||||
|
||||
#include <named/globals.h>
|
||||
|
||||
#include "pgsqldb.h"
|
||||
|
||||
/*
|
||||
* A simple database driver that interfaces to a PostgreSQL database. This
|
||||
* is not complete, and not designed for general use. It opens one
|
||||
* connection to the database per zone, which is inefficient. It also may
|
||||
* not handle quoting correctly.
|
||||
*
|
||||
* The table must contain the fields "name", "rdtype", and "rdata", and
|
||||
* is expected to contain a properly constructed zone. The program "zonetodb"
|
||||
* creates such a table.
|
||||
*/
|
||||
|
||||
static dns_sdbimplementation_t *pgsqldb = NULL;
|
||||
|
||||
struct dbinfo {
|
||||
PGconn *conn;
|
||||
char *database;
|
||||
char *table;
|
||||
char *host;
|
||||
char *user;
|
||||
char *passwd;
|
||||
};
|
||||
|
||||
static void
|
||||
pgsqldb_destroy(const char *zone, void *driverdata, void **dbdata);
|
||||
|
||||
/*
|
||||
* Canonicalize a string before writing it to the database.
|
||||
* "dest" must be an array of at least size 2*strlen(source) + 1.
|
||||
*/
|
||||
static void
|
||||
quotestring(const char *source, char *dest) {
|
||||
while (*source != 0) {
|
||||
if (*source == '\'')
|
||||
*dest++ = '\'';
|
||||
/* SQL doesn't treat \ as special, but PostgreSQL does */
|
||||
else if (*source == '\\')
|
||||
*dest++ = '\\';
|
||||
*dest++ = *source++;
|
||||
}
|
||||
*dest++ = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Connect to the database.
|
||||
*/
|
||||
static isc_result_t
|
||||
db_connect(struct dbinfo *dbi) {
|
||||
dbi->conn = PQsetdbLogin(dbi->host, NULL, NULL, NULL, dbi->database,
|
||||
dbi->user, dbi->passwd);
|
||||
|
||||
if (PQstatus(dbi->conn) == CONNECTION_OK)
|
||||
return (ISC_R_SUCCESS);
|
||||
else
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check to see if the connection is still valid. If not, attempt to
|
||||
* reconnect.
|
||||
*/
|
||||
static isc_result_t
|
||||
maybe_reconnect(struct dbinfo *dbi) {
|
||||
if (PQstatus(dbi->conn) == CONNECTION_OK)
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
return (db_connect(dbi));
|
||||
}
|
||||
|
||||
/*
|
||||
* This database operates on absolute names.
|
||||
*
|
||||
* Queries are converted into SQL queries and issued synchronously. Errors
|
||||
* are handled really badly.
|
||||
*/
|
||||
static isc_result_t
|
||||
pgsqldb_lookup(const char *zone, const char *name, void *dbdata,
|
||||
dns_sdblookup_t *lookup)
|
||||
{
|
||||
isc_result_t result;
|
||||
struct dbinfo *dbi = dbdata;
|
||||
PGresult *res;
|
||||
char str[1500];
|
||||
char *canonname;
|
||||
int i;
|
||||
|
||||
UNUSED(zone);
|
||||
|
||||
canonname = isc_mem_get(ns_g_mctx, strlen(name) * 2 + 1);
|
||||
if (canonname == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
quotestring(name, canonname);
|
||||
snprintf(str, sizeof(str),
|
||||
"SELECT TTL,RDTYPE,RDATA FROM \"%s\" WHERE "
|
||||
"lower(NAME) = lower('%s')", dbi->table, canonname);
|
||||
isc_mem_put(ns_g_mctx, canonname, strlen(name) * 2 + 1);
|
||||
|
||||
result = maybe_reconnect(dbi);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
res = PQexec(dbi->conn, str);
|
||||
if (!res || PQresultStatus(res) != PGRES_TUPLES_OK) {
|
||||
PQclear(res);
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
if (PQntuples(res) == 0) {
|
||||
PQclear(res);
|
||||
return (ISC_R_NOTFOUND);
|
||||
}
|
||||
|
||||
for (i = 0; i < PQntuples(res); i++) {
|
||||
char *ttlstr = PQgetvalue(res, i, 0);
|
||||
char *type = PQgetvalue(res, i, 1);
|
||||
char *data = PQgetvalue(res, i, 2);
|
||||
dns_ttl_t ttl;
|
||||
char *endp;
|
||||
ttl = strtol(ttlstr, &endp, 10);
|
||||
if (*endp != '\0') {
|
||||
PQclear(res);
|
||||
return (DNS_R_BADTTL);
|
||||
}
|
||||
result = dns_sdb_putrr(lookup, type, ttl, data);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
PQclear(res);
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
PQclear(res);
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Issue an SQL query to return all nodes in the database and fill the
|
||||
* allnodes structure.
|
||||
*/
|
||||
static isc_result_t
|
||||
pgsqldb_allnodes(const char *zone, void *dbdata, dns_sdballnodes_t *allnodes) {
|
||||
struct dbinfo *dbi = dbdata;
|
||||
PGresult *res;
|
||||
isc_result_t result;
|
||||
char str[1500];
|
||||
int i;
|
||||
|
||||
UNUSED(zone);
|
||||
|
||||
snprintf(str, sizeof(str),
|
||||
"SELECT TTL,NAME,RDTYPE,RDATA FROM \"%s\" ORDER BY NAME",
|
||||
dbi->table);
|
||||
|
||||
result = maybe_reconnect(dbi);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
res = PQexec(dbi->conn, str);
|
||||
if (!res || PQresultStatus(res) != PGRES_TUPLES_OK ) {
|
||||
PQclear(res);
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
if (PQntuples(res) == 0) {
|
||||
PQclear(res);
|
||||
return (ISC_R_NOTFOUND);
|
||||
}
|
||||
|
||||
for (i = 0; i < PQntuples(res); i++) {
|
||||
char *ttlstr = PQgetvalue(res, i, 0);
|
||||
char *name = PQgetvalue(res, i, 1);
|
||||
char *type = PQgetvalue(res, i, 2);
|
||||
char *data = PQgetvalue(res, i, 3);
|
||||
dns_ttl_t ttl;
|
||||
char *endp;
|
||||
ttl = strtol(ttlstr, &endp, 10);
|
||||
if (*endp != '\0') {
|
||||
PQclear(res);
|
||||
return (DNS_R_BADTTL);
|
||||
}
|
||||
result = dns_sdb_putnamedrr(allnodes, name, type, ttl, data);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
PQclear(res);
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
PQclear(res);
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a connection to the database and save any necessary information
|
||||
* in dbdata.
|
||||
*
|
||||
* argv[0] is the name of the database
|
||||
* argv[1] is the name of the table
|
||||
* argv[2] (if present) is the name of the host to connect to
|
||||
* argv[3] (if present) is the name of the user to connect as
|
||||
* argv[4] (if present) is the name of the password to connect with
|
||||
*/
|
||||
static isc_result_t
|
||||
pgsqldb_create(const char *zone, int argc, char **argv,
|
||||
void *driverdata, void **dbdata)
|
||||
{
|
||||
struct dbinfo *dbi;
|
||||
isc_result_t result;
|
||||
|
||||
UNUSED(zone);
|
||||
UNUSED(driverdata);
|
||||
|
||||
if (argc < 2)
|
||||
return (ISC_R_FAILURE);
|
||||
|
||||
dbi = isc_mem_get(ns_g_mctx, sizeof(struct dbinfo));
|
||||
if (dbi == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
dbi->conn = NULL;
|
||||
dbi->database = NULL;
|
||||
dbi->table = NULL;
|
||||
dbi->host = NULL;
|
||||
dbi->user = NULL;
|
||||
dbi->passwd = NULL;
|
||||
|
||||
#define STRDUP_OR_FAIL(target, source) \
|
||||
do { \
|
||||
target = isc_mem_strdup(ns_g_mctx, source); \
|
||||
if (target == NULL) { \
|
||||
result = ISC_R_NOMEMORY; \
|
||||
goto cleanup; \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
STRDUP_OR_FAIL(dbi->database, argv[0]);
|
||||
STRDUP_OR_FAIL(dbi->table, argv[1]);
|
||||
if (argc > 2)
|
||||
STRDUP_OR_FAIL(dbi->host, argv[2]);
|
||||
if (argc > 3)
|
||||
STRDUP_OR_FAIL(dbi->user, argv[3]);
|
||||
if (argc > 4)
|
||||
STRDUP_OR_FAIL(dbi->passwd, argv[4]);
|
||||
|
||||
result = db_connect(dbi);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
*dbdata = dbi;
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
cleanup:
|
||||
pgsqldb_destroy(zone, driverdata, (void **)&dbi);
|
||||
return (result);
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the connection to the database.
|
||||
*/
|
||||
static void
|
||||
pgsqldb_destroy(const char *zone, void *driverdata, void **dbdata) {
|
||||
struct dbinfo *dbi = *dbdata;
|
||||
|
||||
UNUSED(zone);
|
||||
UNUSED(driverdata);
|
||||
|
||||
if (dbi->conn != NULL)
|
||||
PQfinish(dbi->conn);
|
||||
if (dbi->database != NULL)
|
||||
isc_mem_free(ns_g_mctx, dbi->database);
|
||||
if (dbi->table != NULL)
|
||||
isc_mem_free(ns_g_mctx, dbi->table);
|
||||
if (dbi->host != NULL)
|
||||
isc_mem_free(ns_g_mctx, dbi->host);
|
||||
if (dbi->user != NULL)
|
||||
isc_mem_free(ns_g_mctx, dbi->user);
|
||||
if (dbi->passwd != NULL)
|
||||
isc_mem_free(ns_g_mctx, dbi->passwd);
|
||||
if (dbi->database != NULL)
|
||||
isc_mem_free(ns_g_mctx, dbi->database);
|
||||
isc_mem_put(ns_g_mctx, dbi, sizeof(struct dbinfo));
|
||||
}
|
||||
|
||||
/*
|
||||
* Since the SQL database corresponds to a zone, the authority data should
|
||||
* be returned by the lookup() function. Therefore the authority() function
|
||||
* is NULL.
|
||||
*/
|
||||
static dns_sdbmethods_t pgsqldb_methods = {
|
||||
pgsqldb_lookup,
|
||||
NULL, /* authority */
|
||||
pgsqldb_allnodes,
|
||||
pgsqldb_create,
|
||||
pgsqldb_destroy
|
||||
};
|
||||
|
||||
/*
|
||||
* Wrapper around dns_sdb_register().
|
||||
*/
|
||||
isc_result_t
|
||||
pgsqldb_init(void) {
|
||||
unsigned int flags;
|
||||
flags = 0;
|
||||
return (dns_sdb_register("pgsql", &pgsqldb_methods, NULL, flags,
|
||||
ns_g_mctx, &pgsqldb));
|
||||
}
|
||||
|
||||
/*
|
||||
* Wrapper around dns_sdb_unregister().
|
||||
*/
|
||||
void
|
||||
pgsqldb_clear(void) {
|
||||
if (pgsqldb != NULL)
|
||||
dns_sdb_unregister(&pgsqldb);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
||||
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
||||
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: pgsqldb.h,v 1.2 2001/01/09 21:46:27 bwelling Exp $ */
|
||||
|
||||
#include <isc/types.h>
|
||||
|
||||
isc_result_t pgsqldb_init(void);
|
||||
|
||||
void pgsqldb_clear(void);
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
# Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
||||
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||
# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
||||
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
# $Id: lookup.tcl,v 1.7 2001/01/09 21:46:24 bwelling Exp $
|
||||
|
||||
#
|
||||
# Sample lookup procedure for tcldb
|
||||
#
|
||||
# This lookup procedure defines zones with identical SOA, NS, and MX
|
||||
# records at the apex and a single A record that varies from zone to
|
||||
# zone at the name "www".
|
||||
#
|
||||
# Something like this could be used by a web hosting company to serve
|
||||
# a number of domains without needing to create a separate master file
|
||||
# for each domain. Instead, all per-zone data (in this case, a single
|
||||
# IP address) specified in the named.conf file like this:
|
||||
#
|
||||
# zone "a.com." { type master; database "tcl 10.0.0.42"; };
|
||||
# zone "b.com." { type master; database "tcl 10.0.0.99"; };
|
||||
#
|
||||
# Since the tcldb driver doesn't support zone transfers, there should
|
||||
# be at least two identically configured master servers. In the
|
||||
# example below, they are assumed to be called ns1.isp.nil and
|
||||
# ns2.isp.nil.
|
||||
#
|
||||
|
||||
proc lookup {zone name} {
|
||||
global dbargs
|
||||
switch -- $name {
|
||||
@ { return [list \
|
||||
{SOA 86400 "ns1.isp.nil. hostmaster.isp.nil. \
|
||||
1 3600 1800 1814400 3600"} \
|
||||
{NS 86400 "ns1.isp.nil."} \
|
||||
{NS 86400 "ns2.isp.nil."} \
|
||||
{MX 86400 "10 mail.isp.nil."} ] }
|
||||
www { return [list [list A 3600 $dbargs($zone)] ] }
|
||||
}
|
||||
return NXDOMAIN
|
||||
}
|
||||
@@ -1,232 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
||||
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
||||
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: tcldb.c,v 1.7 2001/01/09 21:46:28 bwelling Exp $ */
|
||||
|
||||
/*
|
||||
* A simple database driver that calls a Tcl procedure to define
|
||||
* the contents of the DNS namespace. The procedure is loaded
|
||||
* from the file lookup.tcl; look at the comments there for
|
||||
* more information.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <isc/mem.h>
|
||||
#include <isc/print.h>
|
||||
#include <isc/result.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
#include <dns/log.h>
|
||||
#include <dns/sdb.h>
|
||||
|
||||
#include <named/globals.h>
|
||||
|
||||
#include <tcl.h>
|
||||
|
||||
#include <tcldb.h>
|
||||
|
||||
#define CHECK(op) \
|
||||
do { result = (op); \
|
||||
if (result != ISC_R_SUCCESS) return (result); \
|
||||
} while (0)
|
||||
|
||||
typedef struct tcldb_driver {
|
||||
isc_mem_t *mctx;
|
||||
Tcl_Interp *interp;
|
||||
} tcldb_driver_t;
|
||||
|
||||
static tcldb_driver_t *the_driver = NULL;
|
||||
|
||||
static dns_sdbimplementation_t *tcldb = NULL;
|
||||
|
||||
static isc_result_t
|
||||
tcldb_driver_create(isc_mem_t *mctx, tcldb_driver_t **driverp) {
|
||||
int tclres;
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
tcldb_driver_t *driver = isc_mem_get(mctx, sizeof(tcldb_driver_t));
|
||||
if (driver == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
driver->mctx = mctx;
|
||||
driver->interp = Tcl_CreateInterp();
|
||||
|
||||
tclres = Tcl_EvalFile(driver->interp, (char *) "lookup.tcl");
|
||||
if (tclres != TCL_OK) {
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
|
||||
DNS_LOGMODULE_SDB, ISC_LOG_ERROR,
|
||||
"initializing tcldb: "
|
||||
"loading 'lookup.tcl' failed: %s",
|
||||
driver->interp->result);
|
||||
result = ISC_R_FAILURE;
|
||||
goto cleanup;
|
||||
}
|
||||
*driverp = driver;
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
cleanup:
|
||||
isc_mem_put(mctx, driver, sizeof(tcldb_driver_t));
|
||||
return (result);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
tcldb_driver_destroy(tcldb_driver_t **driverp) {
|
||||
tcldb_driver_t *driver = *driverp;
|
||||
Tcl_DeleteInterp(driver->interp);
|
||||
isc_mem_put(driver->mctx, driver, sizeof(tcldb_driver_t));
|
||||
}
|
||||
|
||||
/*
|
||||
* Perform a lookup, by invoking the Tcl procedure "lookup".
|
||||
*/
|
||||
static isc_result_t
|
||||
tcldb_lookup(const char *zone, const char *name, void *dbdata,
|
||||
dns_sdblookup_t *lookup)
|
||||
{
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
int tclres;
|
||||
int rrc; /* RR count */
|
||||
char **rrv; /* RR vector */
|
||||
int i;
|
||||
char *cmdv[3];
|
||||
char *cmd;
|
||||
|
||||
tcldb_driver_t *driver = (tcldb_driver_t *) dbdata;
|
||||
|
||||
cmdv[0] = "lookup";
|
||||
cmdv[1] = zone;
|
||||
cmdv[2] = name;
|
||||
cmd = Tcl_Merge(3, cmdv);
|
||||
tclres = Tcl_Eval(driver->interp, cmd);
|
||||
Tcl_Free(cmd);
|
||||
|
||||
if (tclres != TCL_OK) {
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
|
||||
DNS_LOGMODULE_SDB, ISC_LOG_ERROR,
|
||||
"zone '%s': tcl lookup function failed: %s",
|
||||
zone, driver->interp->result);
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
if (strcmp(driver->interp->result, "NXDOMAIN") == 0) {
|
||||
result = ISC_R_NOTFOUND;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
tclres = Tcl_SplitList(driver->interp, driver->interp->result,
|
||||
&rrc, &rrv);
|
||||
if (tclres != TCL_OK)
|
||||
goto malformed;
|
||||
|
||||
for (i = 0; i < rrc; i++) {
|
||||
isc_result_t tmpres;
|
||||
int fieldc; /* Field count */
|
||||
char **fieldv; /* Field vector */
|
||||
tclres = Tcl_SplitList(driver->interp, rrv[i],
|
||||
&fieldc, &fieldv);
|
||||
if (tclres != TCL_OK) {
|
||||
tmpres = ISC_R_FAILURE;
|
||||
goto failrr;
|
||||
}
|
||||
if (fieldc != 3)
|
||||
goto malformed;
|
||||
tmpres = dns_sdb_putrr(lookup, fieldv[0], atoi(fieldv[1]),
|
||||
fieldv[2]);
|
||||
Tcl_Free((char *) fieldv);
|
||||
failrr:
|
||||
if (tmpres != ISC_R_SUCCESS)
|
||||
result = tmpres;
|
||||
}
|
||||
Tcl_Free((char *) rrv);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
malformed:
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
|
||||
DNS_LOGMODULE_SDB, ISC_LOG_ERROR,
|
||||
"zone '%s': "
|
||||
"malformed return value from tcl lookup function: %s",
|
||||
zone, driver->interp->result);
|
||||
result = ISC_R_FAILURE;
|
||||
fail:
|
||||
return (result);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up per-zone state. In our case, the database arguments of the
|
||||
* zone are collected into a Tcl list and assigned to an element of
|
||||
* the global array "dbargs".
|
||||
*/
|
||||
static isc_result_t
|
||||
tcldb_create(const char *zone, int argc, char **argv,
|
||||
void *driverdata, void **dbdata)
|
||||
{
|
||||
tcldb_driver_t *driver = (tcldb_driver_t *) driverdata;
|
||||
|
||||
char *list = Tcl_Merge(argc, argv);
|
||||
|
||||
Tcl_SetVar2(driver->interp, (char *) "dbargs", (char *) zone, list, 0);
|
||||
|
||||
Tcl_Free(list);
|
||||
|
||||
*dbdata = driverdata;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* This driver does not support zone transfer, so allnodes() is NULL.
|
||||
*/
|
||||
static dns_sdbmethods_t tcldb_methods = {
|
||||
tcldb_lookup,
|
||||
NULL, /* authority */
|
||||
NULL, /* allnodes */
|
||||
tcldb_create,
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
/*
|
||||
* Initialize the tcldb driver.
|
||||
*/
|
||||
isc_result_t
|
||||
tcldb_init(void) {
|
||||
isc_result_t result;
|
||||
int flags = DNS_SDBFLAG_RELATIVEOWNER | DNS_SDBFLAG_RELATIVERDATA;
|
||||
|
||||
result = tcldb_driver_create(ns_g_mctx, &the_driver);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
return (dns_sdb_register("tcl", &tcldb_methods, the_driver, flags,
|
||||
ns_g_mctx, &tcldb));
|
||||
}
|
||||
|
||||
/*
|
||||
* Wrapper around dns_sdb_unregister().
|
||||
*/
|
||||
void
|
||||
tcldb_clear(void) {
|
||||
if (tcldb != NULL)
|
||||
dns_sdb_unregister(&tcldb);
|
||||
if (the_driver != NULL)
|
||||
tcldb_driver_destroy(&the_driver);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
||||
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
||||
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: tcldb.h,v 1.4 2001/01/09 21:46:29 bwelling Exp $ */
|
||||
|
||||
#include <isc/types.h>
|
||||
|
||||
isc_result_t tcldb_init(void);
|
||||
|
||||
void tcldb_clear(void);
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
||||
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
||||
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: timedb.c,v 1.7 2001/01/09 21:46:30 bwelling Exp $ */
|
||||
|
||||
/*
|
||||
* A simple database driver that enables the server to return the
|
||||
* current time in a DNS record.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <isc/print.h>
|
||||
#include <isc/result.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
#include <dns/sdb.h>
|
||||
|
||||
#include <named/globals.h>
|
||||
|
||||
#include "timedb.h"
|
||||
|
||||
static dns_sdbimplementation_t *timedb = NULL;
|
||||
|
||||
/*
|
||||
* This database operates on relative names.
|
||||
*
|
||||
* "time" and "@" return the time in a TXT record.
|
||||
* "clock" is a CNAME to "time"
|
||||
* "current" is a DNAME to "@" (try time.current.time)
|
||||
*/
|
||||
static isc_result_t
|
||||
timedb_lookup(const char *zone, const char *name, void *dbdata,
|
||||
dns_sdblookup_t *lookup)
|
||||
{
|
||||
isc_result_t result;
|
||||
|
||||
UNUSED(zone);
|
||||
UNUSED(dbdata);
|
||||
|
||||
if (strcmp(name, "@") == 0 || strcmp(name, "time") == 0) {
|
||||
time_t now = time(NULL);
|
||||
char buf[100];
|
||||
int n;
|
||||
|
||||
/*
|
||||
* Call ctime to create the string, put it in quotes, and
|
||||
* remove the trailing newline.
|
||||
*/
|
||||
n = snprintf(buf, sizeof(buf), "\"%s", ctime(&now));
|
||||
if (n < 0)
|
||||
return (ISC_R_FAILURE);
|
||||
buf[n - 1] = '\"';
|
||||
result = dns_sdb_putrr(lookup, "txt", 1, buf);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (ISC_R_FAILURE);
|
||||
} else if (strcmp(name, "clock") == 0) {
|
||||
result = dns_sdb_putrr(lookup, "cname", 1, "time");
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (ISC_R_FAILURE);
|
||||
} else if (strcmp(name, "current") == 0) {
|
||||
result = dns_sdb_putrr(lookup, "dname", 1, "@");
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (ISC_R_FAILURE);
|
||||
} else
|
||||
return (ISC_R_NOTFOUND);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* lookup() does not return SOA or NS records, so authority() must be defined.
|
||||
*/
|
||||
static isc_result_t
|
||||
timedb_authority(const char *zone, void *dbdata, dns_sdblookup_t *lookup) {
|
||||
isc_result_t result;
|
||||
|
||||
UNUSED(zone);
|
||||
UNUSED(dbdata);
|
||||
|
||||
result = dns_sdb_putsoa(lookup, "localhost.", "root.localhost.", 0);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (ISC_R_FAILURE);
|
||||
|
||||
result = dns_sdb_putrr(lookup, "ns", 86400, "ns1.localdomain.");
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (ISC_R_FAILURE);
|
||||
result = dns_sdb_putrr(lookup, "ns", 86400, "ns2.localdomain.");
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (ISC_R_FAILURE);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* This zone does not support zone transfer, so allnodes() is NULL. There
|
||||
* is no database specific data, so create() and destroy() are NULL.
|
||||
*/
|
||||
static dns_sdbmethods_t timedb_methods = {
|
||||
timedb_lookup,
|
||||
timedb_authority,
|
||||
NULL, /* allnodes */
|
||||
NULL, /* create */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
/*
|
||||
* Wrapper around dns_sdb_register().
|
||||
*/
|
||||
isc_result_t
|
||||
timedb_init(void) {
|
||||
unsigned int flags;
|
||||
flags = DNS_SDBFLAG_RELATIVEOWNER | DNS_SDBFLAG_RELATIVERDATA;
|
||||
return (dns_sdb_register("time", &timedb_methods, NULL, flags,
|
||||
ns_g_mctx, &timedb));
|
||||
}
|
||||
|
||||
/*
|
||||
* Wrapper around dns_sdb_unregister().
|
||||
*/
|
||||
void
|
||||
timedb_clear(void) {
|
||||
if (timedb != NULL)
|
||||
dns_sdb_unregister(&timedb);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
||||
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
||||
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: timedb.h,v 1.2 2001/01/09 21:46:31 bwelling Exp $ */
|
||||
|
||||
#include <isc/types.h>
|
||||
|
||||
isc_result_t timedb_init(void);
|
||||
|
||||
void timedb_clear(void);
|
||||
|
||||
+10
-59
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd">
|
||||
|
||||
<!-- File: $Id: Bv9ARM-book.xml,v 1.155.2.16 2002/01/23 01:41:17 gson Exp $ -->
|
||||
<!-- File: $Id: Bv9ARM-book.xml,v 1.155.2.10 2001/11/07 19:07:29 gson Exp $ -->
|
||||
|
||||
<book>
|
||||
<title>BIND 9 Administrator Reference Manual</title>
|
||||
@@ -2209,20 +2209,12 @@ complete set of local IPv6 addresses for a host.
|
||||
used by the <command>rndc</command> utility to send commands to
|
||||
and retrieve non-DNS results from a nameserver.</para>
|
||||
|
||||
<para>An <command>inet</command> control channel is a TCP
|
||||
socket listening at the specified
|
||||
<para>An <command>inet</command> control channel is a TCP/IP
|
||||
socket accessible to the Internet, created at the specified
|
||||
<command>ip_port</command> on the specified
|
||||
<command>ip_addr</command>, which can be an IPv4 or IPv6
|
||||
address. An <command>ip_addr</command>
|
||||
of <literal>*</literal> is interpreted as the IPv4 wildcard
|
||||
address; connections will be accepted on any of the system's
|
||||
IPv4 addresses. To listen on the IPv6 wildcard address,
|
||||
use an <command>ip_addr</command> of <literal>::</literal>.
|
||||
If you will only use <command>rndc</command> on the local host,
|
||||
using the loopback address (<literal>127.0.0.1</literal>
|
||||
or <literal>::1</literal>) is recommended for maximum
|
||||
security.
|
||||
</para>
|
||||
<command>ip_addr</command>. If no port is specified, port 953
|
||||
is used by default. "*" cannot be used for
|
||||
<command>ip_port</command>.</para>
|
||||
|
||||
<para>The ability to issue commands over the control channel is
|
||||
restricted by the <command>allow</command> and
|
||||
@@ -2265,7 +2257,7 @@ It makes it possible to use an existing <acronym>BIND</acronym> 8
|
||||
configuration file in <acronym>BIND</acronym> 9 unchanged,
|
||||
and still have <command>rndc</command> work the same way
|
||||
<command>ndc</command> worked in BIND 8, simply by executing the
|
||||
command <userinput>rndc-confgen -a</userinput> after BIND 9 is
|
||||
command <userinput>rndc-keygen -a</userinput> after BIND 9 is
|
||||
installed.
|
||||
</para>
|
||||
|
||||
@@ -2290,11 +2282,6 @@ installed.
|
||||
<acronym>BIND</acronym> 8 configuration file, it is ignored
|
||||
and a warning is logged.</para>
|
||||
|
||||
<para>
|
||||
To disable the command channel, use an empty <command>controls</command>
|
||||
statement: <command>controls { };</command>.
|
||||
</para>
|
||||
|
||||
</sect2>
|
||||
<sect2>
|
||||
<title><command>include</command> Statement Grammar</title>
|
||||
@@ -3867,9 +3854,6 @@ The results are returned as a synthetic PTR record in
|
||||
<para>The synthetic records have a TTL of zero. DNSSEC validation of
|
||||
synthetic responses is not currently supported; therefore responses
|
||||
containing synthetic RRs will not have the AD flag set.</para>
|
||||
|
||||
<note><para><command>allow-v6-synthesis</command> is only performed for
|
||||
clients that are supplied recursive service.</para></note>
|
||||
</sect3>
|
||||
|
||||
<sect3 id="tuning"><title>Tuning</title>
|
||||
@@ -4699,10 +4683,6 @@ or historical (h) and no longer in general use):</para>
|
||||
Experimental.</para></entry>
|
||||
</row>
|
||||
<row rowsep = "0">
|
||||
<entry colname = "1"><para>CERT</para></entry>
|
||||
<entry colname = "2"><para>holds a digital certificate.</para></entry>
|
||||
</row>
|
||||
<row rowsep = "0">
|
||||
<entry colname = "1"><para>CNAME</para></entry>
|
||||
<entry colname = "2"><para>identifies the canonical name of an alias.</para></entry>
|
||||
</row>
|
||||
@@ -4713,10 +4693,6 @@ Replaces the domain name specified with another name to be looked
|
||||
up. Described in RFC 2672.</para></entry>
|
||||
</row>
|
||||
<row rowsep = "0">
|
||||
<entry colname = "1"><para>GPOS</para></entry>
|
||||
<entry colname = "2"><para>Specifies the global position. Superseded by LOC.</para></entry>
|
||||
</row>
|
||||
<row rowsep = "0">
|
||||
<entry colname = "1"><para>HINFO</para></entry>
|
||||
<entry colname = "2"><para>identifies the CPU and OS used by a host.</para></entry>
|
||||
</row>
|
||||
@@ -4731,11 +4707,6 @@ Experimental.</para></entry>
|
||||
DNS name.</para></entry>
|
||||
</row>
|
||||
<row rowsep = "0">
|
||||
<entry colname = "1"><para>KX</para></entry>
|
||||
<entry colname = "2"><para>identifies a key exchanger for this
|
||||
DNS name.</para></entry>
|
||||
</row>
|
||||
<row rowsep = "0">
|
||||
<entry colname = "1"><para>LOC</para></entry>
|
||||
<entry colname = "2"><para>(x) for storing GPS info. See RFC 1876.
|
||||
Experimental.</para></entry>
|
||||
@@ -4746,14 +4717,6 @@ Experimental.</para></entry>
|
||||
See RFC 974 for details.</para></entry>
|
||||
</row>
|
||||
<row rowsep = "0">
|
||||
<entry colname = "1"><para>NAPTR</para></entry>
|
||||
<entry colname = "2"><para>name authority pointer.</para></entry>
|
||||
</row>
|
||||
<row rowsep = "0">
|
||||
<entry colname = "1"><para>NSAP</para></entry>
|
||||
<entry colname = "2"><para>a network service access point.</para></entry>
|
||||
</row>
|
||||
<row rowsep = "0">
|
||||
<entry colname = "1"><para>NS</para></entry>
|
||||
<entry colname = "2"><para>the authoritative nameserver for the
|
||||
domain.</para></entry>
|
||||
@@ -4771,11 +4734,6 @@ See RFC 2535 for details.</para></entry>
|
||||
name space.</para></entry>
|
||||
</row>
|
||||
<row rowsep = "0">
|
||||
<entry colname = "1"><para>PX</para></entry>
|
||||
<entry colname = "2"><para>provides mappings between RFC 822 and X.400
|
||||
addresses.</para></entry>
|
||||
</row>
|
||||
<row rowsep = "0">
|
||||
<entry colname = "1"><para>RP</para></entry>
|
||||
<entry colname = "2"><para>(x) information on persons responsible
|
||||
for the domain. Experimental.</para></entry>
|
||||
@@ -4800,10 +4758,6 @@ in the secure DNS. See RFC 2535 for details.</para></entry>
|
||||
services (replaces WKS).</para></entry>
|
||||
</row>
|
||||
<row rowsep = "0">
|
||||
<entry colname = "1"><para>TXT</para></entry>
|
||||
<entry colname = "2"><para>text records.</para></entry>
|
||||
</row>
|
||||
<row rowsep = "0">
|
||||
<entry colname = "1"><para>WKS</para></entry>
|
||||
<entry colname = "2"><para>(h) information about which well known
|
||||
network services, such as SMTP, that a domain supports. Historical,
|
||||
@@ -4983,17 +4937,14 @@ domain names.</para>
|
||||
</tgroup></informaltable>
|
||||
<para>This example shows two addresses for <literal>XX.LCS.MIT.EDU</literal>,
|
||||
each of a different class.</para></sect3></sect2>
|
||||
|
||||
<sect2><title>Discussion of MX Records</title>
|
||||
|
||||
<para>As described above, domain servers store information as a
|
||||
series of resource records, each of which contains a particular
|
||||
piece of information about a given domain name (which is usually,
|
||||
but not always, a host). The simplest way to think of a RR is as
|
||||
a typed pair of data, a domain name matched with a relevant datum,
|
||||
and stored with some additional type information to help systems
|
||||
determine when the RR is relevant.</para>
|
||||
|
||||
a typed pair of datum, a domain name matched with relevant data,
|
||||
and stored with some additional type information to help systems determine
|
||||
when the RR is relevant.</para>
|
||||
<para>MX records are used to control delivery of email. The data
|
||||
specified in the record is a priority and a domain name. The priority
|
||||
controls the order in which email delivery is attempted, with the
|
||||
|
||||
+62
-226
@@ -91,7 +91,7 @@ HREF="Bv9ARM.ch06.html#Configuration_File_Grammar"
|
||||
></DT
|
||||
><DT
|
||||
>6.3. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN3536"
|
||||
HREF="Bv9ARM.ch06.html#AEN3524"
|
||||
>Zone File</A
|
||||
></DT
|
||||
></DL
|
||||
@@ -1492,8 +1492,8 @@ CLASS="command"
|
||||
>An <B
|
||||
CLASS="command"
|
||||
>inet</B
|
||||
> control channel is a TCP
|
||||
socket listening at the specified
|
||||
> control channel is a TCP/IP
|
||||
socket accessible to the Internet, created at the specified
|
||||
<B
|
||||
CLASS="command"
|
||||
>ip_port</B
|
||||
@@ -1501,38 +1501,12 @@ CLASS="command"
|
||||
<B
|
||||
CLASS="command"
|
||||
>ip_addr</B
|
||||
>, which can be an IPv4 or IPv6
|
||||
address. An <B
|
||||
>. If no port is specified, port 953
|
||||
is used by default. "*" cannot be used for
|
||||
<B
|
||||
CLASS="command"
|
||||
>ip_addr</B
|
||||
>
|
||||
of <TT
|
||||
CLASS="literal"
|
||||
>*</TT
|
||||
> is interpreted as the IPv4 wildcard
|
||||
address; connections will be accepted on any of the system's
|
||||
IPv4 addresses. To listen on the IPv6 wildcard address,
|
||||
use an <B
|
||||
CLASS="command"
|
||||
>ip_addr</B
|
||||
> of <TT
|
||||
CLASS="literal"
|
||||
>::</TT
|
||||
>.
|
||||
If you will only use <B
|
||||
CLASS="command"
|
||||
>rndc</B
|
||||
> on the local host,
|
||||
using the loopback address (<TT
|
||||
CLASS="literal"
|
||||
>127.0.0.1</TT
|
||||
>
|
||||
or <TT
|
||||
CLASS="literal"
|
||||
>::1</TT
|
||||
>) is recommended for maximum
|
||||
security.
|
||||
</P
|
||||
>ip_port</B
|
||||
>.</P
|
||||
><P
|
||||
>The ability to issue commands over the control channel is
|
||||
restricted by the <B
|
||||
@@ -1663,7 +1637,7 @@ CLASS="command"
|
||||
command <TT
|
||||
CLASS="userinput"
|
||||
><B
|
||||
>rndc-confgen -a</B
|
||||
>rndc-keygen -a</B
|
||||
></TT
|
||||
> after BIND 9 is
|
||||
installed.
|
||||
@@ -1718,23 +1692,13 @@ CLASS="acronym"
|
||||
>BIND</SPAN
|
||||
> 8 configuration file, it is ignored
|
||||
and a warning is logged.</P
|
||||
><P
|
||||
> To disable the command channel, use an empty <B
|
||||
CLASS="command"
|
||||
>controls</B
|
||||
>
|
||||
statement: <B
|
||||
CLASS="command"
|
||||
>controls { };</B
|
||||
>.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN1529"
|
||||
NAME="AEN1520"
|
||||
>6.2.5. <B
|
||||
CLASS="command"
|
||||
>include</B
|
||||
@@ -1754,7 +1718,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN1534"
|
||||
NAME="AEN1525"
|
||||
>6.2.6. <B
|
||||
CLASS="command"
|
||||
>include</B
|
||||
@@ -1783,7 +1747,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN1541"
|
||||
NAME="AEN1532"
|
||||
>6.2.7. <B
|
||||
CLASS="command"
|
||||
>key</B
|
||||
@@ -1817,7 +1781,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN1548"
|
||||
NAME="AEN1539"
|
||||
>6.2.8. <B
|
||||
CLASS="command"
|
||||
>key</B
|
||||
@@ -1895,7 +1859,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN1566"
|
||||
NAME="AEN1557"
|
||||
>6.2.9. <B
|
||||
CLASS="command"
|
||||
>logging</B
|
||||
@@ -2055,7 +2019,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN1606"
|
||||
NAME="AEN1597"
|
||||
>6.2.10. <B
|
||||
CLASS="command"
|
||||
>logging</B
|
||||
@@ -2118,7 +2082,7 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN1622"
|
||||
NAME="AEN1613"
|
||||
>6.2.10.1. The <B
|
||||
CLASS="command"
|
||||
>channel</B
|
||||
@@ -2560,7 +2524,7 @@ CLASS="acronym"
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN1726"
|
||||
NAME="AEN1717"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -2931,7 +2895,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN1837"
|
||||
NAME="AEN1828"
|
||||
>6.2.11. <B
|
||||
CLASS="command"
|
||||
>lwres</B
|
||||
@@ -3028,7 +2992,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN1861"
|
||||
NAME="AEN1852"
|
||||
>6.2.12. <B
|
||||
CLASS="command"
|
||||
>lwres</B
|
||||
@@ -3102,7 +3066,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN1880"
|
||||
NAME="AEN1871"
|
||||
>6.2.13. <B
|
||||
CLASS="command"
|
||||
>options</B
|
||||
@@ -4061,7 +4025,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN2098"
|
||||
NAME="AEN2089"
|
||||
>6.2.14. <B
|
||||
CLASS="command"
|
||||
>options</B
|
||||
@@ -5044,7 +5008,7 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN2398"
|
||||
NAME="AEN2389"
|
||||
>6.2.14.2. Forwarding</A
|
||||
></H3
|
||||
><P
|
||||
@@ -5248,7 +5212,7 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN2463"
|
||||
NAME="AEN2454"
|
||||
>6.2.14.4. Interfaces</A
|
||||
></H3
|
||||
><P
|
||||
@@ -5343,7 +5307,7 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN2489"
|
||||
NAME="AEN2480"
|
||||
>6.2.14.5. Query Address</A
|
||||
></H3
|
||||
><P
|
||||
@@ -5775,7 +5739,7 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN2628"
|
||||
NAME="AEN2619"
|
||||
>6.2.14.7. Operating System Resource Limits</A
|
||||
></H3
|
||||
><P
|
||||
@@ -5895,7 +5859,7 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN2665"
|
||||
NAME="AEN2656"
|
||||
>6.2.14.8. Server Resource Limits</A
|
||||
></H3
|
||||
><P
|
||||
@@ -5979,7 +5943,7 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN2693"
|
||||
NAME="AEN2684"
|
||||
>6.2.14.9. Periodic Task Intervals</A
|
||||
></H3
|
||||
><P
|
||||
@@ -6346,7 +6310,7 @@ CLASS="command"
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN2781"
|
||||
NAME="AEN2772"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -6534,20 +6498,6 @@ CLASS="literal"
|
||||
>The synthetic records have a TTL of zero. DNSSEC validation of
|
||||
synthetic responses is not currently supported; therefore responses
|
||||
containing synthetic RRs will not have the AD flag set.</P
|
||||
><DIV
|
||||
CLASS="note"
|
||||
><BLOCKQUOTE
|
||||
CLASS="note"
|
||||
><P
|
||||
><B
|
||||
>Note: </B
|
||||
><B
|
||||
CLASS="command"
|
||||
>allow-v6-synthesis</B
|
||||
> is only performed for
|
||||
clients that are supplied recursive service.</P
|
||||
></BLOCKQUOTE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="sect3"
|
||||
@@ -6747,7 +6697,7 @@ number is identical to the number in the beginning line.</P
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN2896"
|
||||
NAME="AEN2884"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -7183,7 +7133,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN3011"
|
||||
NAME="AEN2999"
|
||||
>6.2.17. <B
|
||||
CLASS="command"
|
||||
>trusted-keys</B
|
||||
@@ -7258,7 +7208,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN3027"
|
||||
NAME="AEN3015"
|
||||
>6.2.18. <B
|
||||
CLASS="command"
|
||||
>trusted-keys</B
|
||||
@@ -7293,7 +7243,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN3035"
|
||||
NAME="AEN3023"
|
||||
>6.2.19. <B
|
||||
CLASS="command"
|
||||
>view</B
|
||||
@@ -7368,7 +7318,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN3051"
|
||||
NAME="AEN3039"
|
||||
>6.2.20. <B
|
||||
CLASS="command"
|
||||
>view</B
|
||||
@@ -8019,7 +7969,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN3202"
|
||||
NAME="AEN3190"
|
||||
>6.2.22. <B
|
||||
CLASS="command"
|
||||
>zone</B
|
||||
@@ -8030,13 +7980,13 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN3205"
|
||||
NAME="AEN3193"
|
||||
>6.2.22.1. Zone Types</A
|
||||
></H3
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN3207"
|
||||
NAME="AEN3195"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -8274,7 +8224,7 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN3262"
|
||||
NAME="AEN3250"
|
||||
>6.2.22.2. Class</A
|
||||
></H3
|
||||
><P
|
||||
@@ -8312,7 +8262,7 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN3272"
|
||||
NAME="AEN3260"
|
||||
>6.2.22.3. Zone Options</A
|
||||
></H3
|
||||
><P
|
||||
@@ -8953,7 +8903,7 @@ CLASS="varname"
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN3506"
|
||||
NAME="AEN3494"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -9060,7 +9010,7 @@ CLASS="sect1"
|
||||
><H1
|
||||
CLASS="sect1"
|
||||
><A
|
||||
NAME="AEN3536"
|
||||
NAME="AEN3524"
|
||||
>6.3. Zone File</A
|
||||
></H1
|
||||
><DIV
|
||||
@@ -9081,7 +9031,7 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN3541"
|
||||
NAME="AEN3529"
|
||||
>6.3.1.1. Resource Records</A
|
||||
></H3
|
||||
><P
|
||||
@@ -9104,7 +9054,7 @@ HREF="Bv9ARM.ch06.html#rrset_ordering"
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN3547"
|
||||
NAME="AEN3535"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -9215,7 +9165,7 @@ or historical (h) and no longer in general use):</P
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN3579"
|
||||
NAME="AEN3567"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -9295,22 +9245,6 @@ WIDTH="84"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>CERT</P
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="348"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>holds a digital certificate.</P
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="84"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>CNAME</P
|
||||
></TD
|
||||
><TD
|
||||
@@ -9345,22 +9279,6 @@ WIDTH="84"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>GPOS</P
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="348"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>Specifies the global position. Superseded by LOC.</P
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="84"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>HINFO</P
|
||||
></TD
|
||||
><TD
|
||||
@@ -9411,23 +9329,6 @@ WIDTH="84"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>KX</P
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="348"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>identifies a key exchanger for this
|
||||
DNS name.</P
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="84"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>LOC</P
|
||||
></TD
|
||||
><TD
|
||||
@@ -9462,38 +9363,6 @@ WIDTH="84"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>NAPTR</P
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="348"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>name authority pointer.</P
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="84"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>NSAP</P
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="348"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>a network service access point.</P
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="84"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>NS</P
|
||||
></TD
|
||||
><TD
|
||||
@@ -9547,23 +9416,6 @@ WIDTH="84"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>PX</P
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="348"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>provides mappings between RFC 822 and X.400
|
||||
addresses.</P
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="84"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>RP</P
|
||||
></TD
|
||||
><TD
|
||||
@@ -9648,22 +9500,6 @@ WIDTH="84"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>TXT</P
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="348"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>text records.</P
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="84"
|
||||
ALIGN="LEFT"
|
||||
VALIGN="MIDDLE"
|
||||
><P
|
||||
>WKS</P
|
||||
></TD
|
||||
><TD
|
||||
@@ -9706,7 +9542,7 @@ are currently valid in the DNS:</P
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN3726"
|
||||
NAME="AEN3679"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -9758,7 +9594,7 @@ data that describes the resource:</P
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN3742"
|
||||
NAME="AEN3695"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -9935,7 +9771,7 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN3790"
|
||||
NAME="AEN3743"
|
||||
>6.3.1.2. Textual expression of RRs</A
|
||||
></H3
|
||||
><P
|
||||
@@ -9965,7 +9801,7 @@ knowledge of the typical representation for the data.</P
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN3797"
|
||||
NAME="AEN3750"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -10174,7 +10010,7 @@ domain names.</P
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN3863"
|
||||
NAME="AEN3816"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -10265,7 +10101,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN3891"
|
||||
NAME="AEN3844"
|
||||
>6.3.2. Discussion of MX Records</A
|
||||
></H2
|
||||
><P
|
||||
@@ -10273,9 +10109,9 @@ NAME="AEN3891"
|
||||
series of resource records, each of which contains a particular
|
||||
piece of information about a given domain name (which is usually,
|
||||
but not always, a host). The simplest way to think of a RR is as
|
||||
a typed pair of data, a domain name matched with a relevant datum,
|
||||
and stored with some additional type information to help systems
|
||||
determine when the RR is relevant.</P
|
||||
a typed pair of datum, a domain name matched with relevant data,
|
||||
and stored with some additional type information to help systems determine
|
||||
when the RR is relevant.</P
|
||||
><P
|
||||
>MX records are used to control delivery of email. The data
|
||||
specified in the record is a priority and a domain name. The priority
|
||||
@@ -10298,7 +10134,7 @@ pointed to by the CNAME.</P
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN3897"
|
||||
NAME="AEN3850"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -10594,7 +10430,7 @@ used in a zone file.</P
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN3989"
|
||||
NAME="AEN3942"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -10677,7 +10513,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN4012"
|
||||
NAME="AEN3965"
|
||||
>6.3.4. Inverse Mapping in IPv4</A
|
||||
></H2
|
||||
><P
|
||||
@@ -10701,7 +10537,7 @@ CLASS="optional"
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN4017"
|
||||
NAME="AEN3970"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -10781,7 +10617,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN4039"
|
||||
NAME="AEN3992"
|
||||
>6.3.5. Other Zone File Directives</A
|
||||
></H2
|
||||
><P
|
||||
@@ -10806,7 +10642,7 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN4046"
|
||||
NAME="AEN3999"
|
||||
>6.3.5.1. The <B
|
||||
CLASS="command"
|
||||
>$ORIGIN</B
|
||||
@@ -10876,7 +10712,7 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN4066"
|
||||
NAME="AEN4019"
|
||||
>6.3.5.2. The <B
|
||||
CLASS="command"
|
||||
>$INCLUDE</B
|
||||
@@ -10958,7 +10794,7 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN4086"
|
||||
NAME="AEN4039"
|
||||
>6.3.5.3. The <B
|
||||
CLASS="command"
|
||||
>$TTL</B
|
||||
@@ -10998,7 +10834,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN4097"
|
||||
NAME="AEN4050"
|
||||
>6.3.6. <SPAN
|
||||
CLASS="acronym"
|
||||
>BIND</SPAN
|
||||
@@ -11077,7 +10913,7 @@ CLASS="literal"
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN4117"
|
||||
NAME="AEN4070"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
|
||||
@@ -86,7 +86,7 @@ HREF="Bv9ARM.ch07.html#Access_Control_Lists"
|
||||
></DT
|
||||
><DT
|
||||
>7.2. <A
|
||||
HREF="Bv9ARM.ch07.html#AEN4189"
|
||||
HREF="Bv9ARM.ch07.html#AEN4142"
|
||||
><B
|
||||
CLASS="command"
|
||||
>chroot</B
|
||||
@@ -188,7 +188,7 @@ CLASS="sect1"
|
||||
><H1
|
||||
CLASS="sect1"
|
||||
><A
|
||||
NAME="AEN4189"
|
||||
NAME="AEN4142"
|
||||
>7.2. <B
|
||||
CLASS="command"
|
||||
>chroot</B
|
||||
@@ -267,7 +267,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN4212"
|
||||
NAME="AEN4165"
|
||||
>7.2.1. The <B
|
||||
CLASS="command"
|
||||
>chroot</B
|
||||
@@ -340,7 +340,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN4230"
|
||||
NAME="AEN4183"
|
||||
>7.2.2. Using the <B
|
||||
CLASS="command"
|
||||
>setuid</B
|
||||
|
||||
@@ -78,17 +78,17 @@ CLASS="TOC"
|
||||
></DT
|
||||
><DT
|
||||
>8.1. <A
|
||||
HREF="Bv9ARM.ch08.html#AEN4251"
|
||||
HREF="Bv9ARM.ch08.html#AEN4204"
|
||||
>Common Problems</A
|
||||
></DT
|
||||
><DT
|
||||
>8.2. <A
|
||||
HREF="Bv9ARM.ch08.html#AEN4256"
|
||||
HREF="Bv9ARM.ch08.html#AEN4209"
|
||||
>Incrementing and Changing the Serial Number</A
|
||||
></DT
|
||||
><DT
|
||||
>8.3. <A
|
||||
HREF="Bv9ARM.ch08.html#AEN4261"
|
||||
HREF="Bv9ARM.ch08.html#AEN4214"
|
||||
>Where Can I Get Help?</A
|
||||
></DT
|
||||
></DL
|
||||
@@ -98,7 +98,7 @@ CLASS="sect1"
|
||||
><H1
|
||||
CLASS="sect1"
|
||||
><A
|
||||
NAME="AEN4251"
|
||||
NAME="AEN4204"
|
||||
>8.1. Common Problems</A
|
||||
></H1
|
||||
><DIV
|
||||
@@ -106,7 +106,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN4253"
|
||||
NAME="AEN4206"
|
||||
>8.1.1. It's not working; how can I figure out what's wrong?</A
|
||||
></H2
|
||||
><P
|
||||
@@ -122,7 +122,7 @@ CLASS="sect1"
|
||||
><H1
|
||||
CLASS="sect1"
|
||||
><A
|
||||
NAME="AEN4256"
|
||||
NAME="AEN4209"
|
||||
>8.2. Incrementing and Changing the Serial Number</A
|
||||
></H1
|
||||
><P
|
||||
@@ -151,7 +151,7 @@ CLASS="sect1"
|
||||
><H1
|
||||
CLASS="sect1"
|
||||
><A
|
||||
NAME="AEN4261"
|
||||
NAME="AEN4214"
|
||||
>8.3. Where Can I Get Help?</A
|
||||
></H1
|
||||
><P
|
||||
|
||||
+60
-60
@@ -72,7 +72,7 @@ CLASS="TOC"
|
||||
></DT
|
||||
><DT
|
||||
>A.1. <A
|
||||
HREF="Bv9ARM.ch09.html#AEN4277"
|
||||
HREF="Bv9ARM.ch09.html#AEN4230"
|
||||
>Acknowledgements</A
|
||||
></DT
|
||||
><DT
|
||||
@@ -85,7 +85,7 @@ CLASS="acronym"
|
||||
></DT
|
||||
><DT
|
||||
>A.3. <A
|
||||
HREF="Bv9ARM.ch09.html#AEN4318"
|
||||
HREF="Bv9ARM.ch09.html#AEN4271"
|
||||
>General <SPAN
|
||||
CLASS="acronym"
|
||||
>DNS</SPAN
|
||||
@@ -103,7 +103,7 @@ CLASS="sect1"
|
||||
><H1
|
||||
CLASS="sect1"
|
||||
><A
|
||||
NAME="AEN4277"
|
||||
NAME="AEN4230"
|
||||
>A.1. Acknowledgements</A
|
||||
></H1
|
||||
><DIV
|
||||
@@ -111,7 +111,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN4279"
|
||||
NAME="AEN4232"
|
||||
>A.1.1. A Brief History of the <SPAN
|
||||
CLASS="acronym"
|
||||
>DNS</SPAN
|
||||
@@ -246,7 +246,7 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN4309"
|
||||
NAME="AEN4262"
|
||||
>A.2.1.1. HS = hesiod</A
|
||||
></H3
|
||||
><P
|
||||
@@ -267,7 +267,7 @@ CLASS="sect3"
|
||||
><H3
|
||||
CLASS="sect3"
|
||||
><A
|
||||
NAME="AEN4314"
|
||||
NAME="AEN4267"
|
||||
>A.2.1.2. CH = chaos</A
|
||||
></H3
|
||||
><P
|
||||
@@ -285,7 +285,7 @@ CLASS="sect1"
|
||||
><H1
|
||||
CLASS="sect1"
|
||||
><A
|
||||
NAME="AEN4318"
|
||||
NAME="AEN4271"
|
||||
>A.3. General <SPAN
|
||||
CLASS="acronym"
|
||||
>DNS</SPAN
|
||||
@@ -324,7 +324,7 @@ Unicast address scheme. For more information, see RFC 2374.</P
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN4329"
|
||||
NAME="AEN4282"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -543,7 +543,7 @@ VALIGN="MIDDLE"
|
||||
<DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN4398"
|
||||
NAME="AEN4351"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -726,7 +726,7 @@ unicast address consists of:</P
|
||||
><DIV
|
||||
CLASS="informaltable"
|
||||
><A
|
||||
NAME="AEN4453"
|
||||
NAME="AEN4406"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
@@ -886,19 +886,19 @@ TARGET="_top"
|
||||
</P
|
||||
><H3
|
||||
><A
|
||||
NAME="AEN4497"
|
||||
NAME="AEN4450"
|
||||
>Bibliography</A
|
||||
></H3
|
||||
><H1
|
||||
CLASS="bibliodiv"
|
||||
><A
|
||||
NAME="AEN4498"
|
||||
NAME="AEN4451"
|
||||
>Standards</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4500"
|
||||
NAME="AEN4453"
|
||||
></A
|
||||
><P
|
||||
>[RFC974] <SPAN
|
||||
@@ -915,7 +915,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4507"
|
||||
NAME="AEN4460"
|
||||
></A
|
||||
><P
|
||||
>[RFC1034] <SPAN
|
||||
@@ -932,7 +932,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4514"
|
||||
NAME="AEN4467"
|
||||
></A
|
||||
><P
|
||||
>[RFC1035] <SPAN
|
||||
@@ -956,7 +956,7 @@ NAME="proposed_standards"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4523"
|
||||
NAME="AEN4476"
|
||||
></A
|
||||
><P
|
||||
>[RFC2181] <SPAN
|
||||
@@ -976,7 +976,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4531"
|
||||
NAME="AEN4484"
|
||||
></A
|
||||
><P
|
||||
>[RFC2308] <SPAN
|
||||
@@ -996,7 +996,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4539"
|
||||
NAME="AEN4492"
|
||||
></A
|
||||
><P
|
||||
>[RFC1995] <SPAN
|
||||
@@ -1016,7 +1016,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4547"
|
||||
NAME="AEN4500"
|
||||
></A
|
||||
><P
|
||||
>[RFC1996] <SPAN
|
||||
@@ -1033,7 +1033,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4554"
|
||||
NAME="AEN4507"
|
||||
></A
|
||||
><P
|
||||
>[RFC2136] <SPAN
|
||||
@@ -1059,7 +1059,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4571"
|
||||
NAME="AEN4524"
|
||||
></A
|
||||
><P
|
||||
>[RFC2845] <SPAN
|
||||
@@ -1088,13 +1088,13 @@ STYLE="margin-left=0.5in"
|
||||
><H1
|
||||
CLASS="bibliodiv"
|
||||
><A
|
||||
NAME="AEN4590"
|
||||
NAME="AEN4543"
|
||||
>Proposed Standards Still Under Development</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4595"
|
||||
NAME="AEN4548"
|
||||
></A
|
||||
><P
|
||||
>[RFC1886] <SPAN
|
||||
@@ -1117,7 +1117,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4607"
|
||||
NAME="AEN4560"
|
||||
></A
|
||||
><P
|
||||
>[RFC2065] <SPAN
|
||||
@@ -1137,7 +1137,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4619"
|
||||
NAME="AEN4572"
|
||||
></A
|
||||
><P
|
||||
>[RFC2137] <SPAN
|
||||
@@ -1154,7 +1154,7 @@ STYLE="margin-left=0.5in"
|
||||
><H1
|
||||
CLASS="bibliodiv"
|
||||
><A
|
||||
NAME="AEN4627"
|
||||
NAME="AEN4580"
|
||||
>Other Important RFCs About <SPAN
|
||||
CLASS="acronym"
|
||||
>DNS</SPAN
|
||||
@@ -1163,7 +1163,7 @@ CLASS="acronym"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4630"
|
||||
NAME="AEN4583"
|
||||
></A
|
||||
><P
|
||||
>[RFC1535] <SPAN
|
||||
@@ -1183,7 +1183,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4638"
|
||||
NAME="AEN4591"
|
||||
></A
|
||||
><P
|
||||
>[RFC1536] <SPAN
|
||||
@@ -1215,7 +1215,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4659"
|
||||
NAME="AEN4612"
|
||||
></A
|
||||
><P
|
||||
>[RFC1982] <SPAN
|
||||
@@ -1235,13 +1235,13 @@ STYLE="margin-left=0.5in"
|
||||
><H1
|
||||
CLASS="bibliodiv"
|
||||
><A
|
||||
NAME="AEN4670"
|
||||
NAME="AEN4623"
|
||||
>Resource Record Types</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4672"
|
||||
NAME="AEN4625"
|
||||
></A
|
||||
><P
|
||||
>[RFC1183] <SPAN
|
||||
@@ -1270,7 +1270,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4690"
|
||||
NAME="AEN4643"
|
||||
></A
|
||||
><P
|
||||
>[RFC1706] <SPAN
|
||||
@@ -1293,7 +1293,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4702"
|
||||
NAME="AEN4655"
|
||||
></A
|
||||
><P
|
||||
>[RFC2168] <SPAN
|
||||
@@ -1314,7 +1314,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4713"
|
||||
NAME="AEN4666"
|
||||
></A
|
||||
><P
|
||||
>[RFC1876] <SPAN
|
||||
@@ -1341,7 +1341,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4730"
|
||||
NAME="AEN4683"
|
||||
></A
|
||||
><P
|
||||
>[RFC2052] <SPAN
|
||||
@@ -1365,7 +1365,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4742"
|
||||
NAME="AEN4695"
|
||||
></A
|
||||
><P
|
||||
>[RFC2163] <SPAN
|
||||
@@ -1386,7 +1386,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4750"
|
||||
NAME="AEN4703"
|
||||
></A
|
||||
><P
|
||||
>[RFC2230] <SPAN
|
||||
@@ -1406,7 +1406,7 @@ STYLE="margin-left=0.5in"
|
||||
><H1
|
||||
CLASS="bibliodiv"
|
||||
><A
|
||||
NAME="AEN4758"
|
||||
NAME="AEN4711"
|
||||
><SPAN
|
||||
CLASS="acronym"
|
||||
>DNS</SPAN
|
||||
@@ -1415,7 +1415,7 @@ CLASS="acronym"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4761"
|
||||
NAME="AEN4714"
|
||||
></A
|
||||
><P
|
||||
>[RFC1101] <SPAN
|
||||
@@ -1435,7 +1435,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4769"
|
||||
NAME="AEN4722"
|
||||
></A
|
||||
><P
|
||||
>[RFC1123] <SPAN
|
||||
@@ -1452,7 +1452,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4776"
|
||||
NAME="AEN4729"
|
||||
></A
|
||||
><P
|
||||
>[RFC1591] <SPAN
|
||||
@@ -1469,7 +1469,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4783"
|
||||
NAME="AEN4736"
|
||||
></A
|
||||
><P
|
||||
>[RFC2317] <SPAN
|
||||
@@ -1492,7 +1492,7 @@ STYLE="margin-left=0.5in"
|
||||
><H1
|
||||
CLASS="bibliodiv"
|
||||
><A
|
||||
NAME="AEN4797"
|
||||
NAME="AEN4750"
|
||||
><SPAN
|
||||
CLASS="acronym"
|
||||
>DNS</SPAN
|
||||
@@ -1501,7 +1501,7 @@ CLASS="acronym"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4800"
|
||||
NAME="AEN4753"
|
||||
></A
|
||||
><P
|
||||
>[RFC1537] <SPAN
|
||||
@@ -1521,7 +1521,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4808"
|
||||
NAME="AEN4761"
|
||||
></A
|
||||
><P
|
||||
>[RFC1912] <SPAN
|
||||
@@ -1541,7 +1541,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4816"
|
||||
NAME="AEN4769"
|
||||
></A
|
||||
><P
|
||||
>[RFC1912] <SPAN
|
||||
@@ -1561,7 +1561,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4824"
|
||||
NAME="AEN4777"
|
||||
></A
|
||||
><P
|
||||
>[RFC2010] <SPAN
|
||||
@@ -1581,7 +1581,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4835"
|
||||
NAME="AEN4788"
|
||||
></A
|
||||
><P
|
||||
>[RFC2219] <SPAN
|
||||
@@ -1604,7 +1604,7 @@ STYLE="margin-left=0.5in"
|
||||
><H1
|
||||
CLASS="bibliodiv"
|
||||
><A
|
||||
NAME="AEN4847"
|
||||
NAME="AEN4800"
|
||||
>Other <SPAN
|
||||
CLASS="acronym"
|
||||
>DNS</SPAN
|
||||
@@ -1613,7 +1613,7 @@ CLASS="acronym"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4853"
|
||||
NAME="AEN4806"
|
||||
></A
|
||||
><P
|
||||
>[RFC1464] <SPAN
|
||||
@@ -1630,7 +1630,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4860"
|
||||
NAME="AEN4813"
|
||||
></A
|
||||
><P
|
||||
>[RFC1713] <SPAN
|
||||
@@ -1650,7 +1650,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4868"
|
||||
NAME="AEN4821"
|
||||
></A
|
||||
><P
|
||||
>[RFC1794] <SPAN
|
||||
@@ -1670,7 +1670,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4876"
|
||||
NAME="AEN4829"
|
||||
></A
|
||||
><P
|
||||
>[RFC2240] <SPAN
|
||||
@@ -1687,7 +1687,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4883"
|
||||
NAME="AEN4836"
|
||||
></A
|
||||
><P
|
||||
>[RFC2345] <SPAN
|
||||
@@ -1710,7 +1710,7 @@ STYLE="margin-left=0.5in"
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4897"
|
||||
NAME="AEN4850"
|
||||
></A
|
||||
><P
|
||||
>[RFC2352] <SPAN
|
||||
@@ -1727,13 +1727,13 @@ STYLE="margin-left=0.5in"
|
||||
><H1
|
||||
CLASS="bibliodiv"
|
||||
><A
|
||||
NAME="AEN4904"
|
||||
NAME="AEN4857"
|
||||
>Obsolete and Unimplemented Experimental RRs</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4906"
|
||||
NAME="AEN4859"
|
||||
></A
|
||||
><P
|
||||
>[RFC1712] <SPAN
|
||||
@@ -1784,7 +1784,7 @@ CLASS="sect2"
|
||||
><H2
|
||||
CLASS="sect2"
|
||||
><A
|
||||
NAME="AEN4927"
|
||||
NAME="AEN4880"
|
||||
>A.4.3. Other Documents About <SPAN
|
||||
CLASS="acronym"
|
||||
>BIND</SPAN
|
||||
@@ -1794,13 +1794,13 @@ CLASS="acronym"
|
||||
></P
|
||||
><H3
|
||||
><A
|
||||
NAME="AEN4931"
|
||||
NAME="AEN4884"
|
||||
>Bibliography</A
|
||||
></H3
|
||||
><DIV
|
||||
CLASS="biblioentry"
|
||||
><A
|
||||
NAME="AEN4932"
|
||||
NAME="AEN4885"
|
||||
></A
|
||||
><P
|
||||
><SPAN
|
||||
|
||||
+31
-31
@@ -446,7 +446,7 @@ CLASS="command"
|
||||
></DT
|
||||
><DT
|
||||
>6.2.5. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN1529"
|
||||
HREF="Bv9ARM.ch06.html#AEN1520"
|
||||
><B
|
||||
CLASS="command"
|
||||
>include</B
|
||||
@@ -454,7 +454,7 @@ CLASS="command"
|
||||
></DT
|
||||
><DT
|
||||
>6.2.6. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN1534"
|
||||
HREF="Bv9ARM.ch06.html#AEN1525"
|
||||
><B
|
||||
CLASS="command"
|
||||
>include</B
|
||||
@@ -462,7 +462,7 @@ CLASS="command"
|
||||
></DT
|
||||
><DT
|
||||
>6.2.7. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN1541"
|
||||
HREF="Bv9ARM.ch06.html#AEN1532"
|
||||
><B
|
||||
CLASS="command"
|
||||
>key</B
|
||||
@@ -470,7 +470,7 @@ CLASS="command"
|
||||
></DT
|
||||
><DT
|
||||
>6.2.8. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN1548"
|
||||
HREF="Bv9ARM.ch06.html#AEN1539"
|
||||
><B
|
||||
CLASS="command"
|
||||
>key</B
|
||||
@@ -478,7 +478,7 @@ CLASS="command"
|
||||
></DT
|
||||
><DT
|
||||
>6.2.9. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN1566"
|
||||
HREF="Bv9ARM.ch06.html#AEN1557"
|
||||
><B
|
||||
CLASS="command"
|
||||
>logging</B
|
||||
@@ -486,7 +486,7 @@ CLASS="command"
|
||||
></DT
|
||||
><DT
|
||||
>6.2.10. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN1606"
|
||||
HREF="Bv9ARM.ch06.html#AEN1597"
|
||||
><B
|
||||
CLASS="command"
|
||||
>logging</B
|
||||
@@ -494,7 +494,7 @@ CLASS="command"
|
||||
></DT
|
||||
><DT
|
||||
>6.2.11. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN1837"
|
||||
HREF="Bv9ARM.ch06.html#AEN1828"
|
||||
><B
|
||||
CLASS="command"
|
||||
>lwres</B
|
||||
@@ -502,7 +502,7 @@ CLASS="command"
|
||||
></DT
|
||||
><DT
|
||||
>6.2.12. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN1861"
|
||||
HREF="Bv9ARM.ch06.html#AEN1852"
|
||||
><B
|
||||
CLASS="command"
|
||||
>lwres</B
|
||||
@@ -510,7 +510,7 @@ CLASS="command"
|
||||
></DT
|
||||
><DT
|
||||
>6.2.13. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN1880"
|
||||
HREF="Bv9ARM.ch06.html#AEN1871"
|
||||
><B
|
||||
CLASS="command"
|
||||
>options</B
|
||||
@@ -518,7 +518,7 @@ CLASS="command"
|
||||
></DT
|
||||
><DT
|
||||
>6.2.14. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN2098"
|
||||
HREF="Bv9ARM.ch06.html#AEN2089"
|
||||
><B
|
||||
CLASS="command"
|
||||
>options</B
|
||||
@@ -542,7 +542,7 @@ CLASS="command"
|
||||
></DT
|
||||
><DT
|
||||
>6.2.17. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN3011"
|
||||
HREF="Bv9ARM.ch06.html#AEN2999"
|
||||
><B
|
||||
CLASS="command"
|
||||
>trusted-keys</B
|
||||
@@ -550,7 +550,7 @@ CLASS="command"
|
||||
></DT
|
||||
><DT
|
||||
>6.2.18. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN3027"
|
||||
HREF="Bv9ARM.ch06.html#AEN3015"
|
||||
><B
|
||||
CLASS="command"
|
||||
>trusted-keys</B
|
||||
@@ -559,7 +559,7 @@ and Usage</A
|
||||
></DT
|
||||
><DT
|
||||
>6.2.19. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN3035"
|
||||
HREF="Bv9ARM.ch06.html#AEN3023"
|
||||
><B
|
||||
CLASS="command"
|
||||
>view</B
|
||||
@@ -567,7 +567,7 @@ CLASS="command"
|
||||
></DT
|
||||
><DT
|
||||
>6.2.20. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN3051"
|
||||
HREF="Bv9ARM.ch06.html#AEN3039"
|
||||
><B
|
||||
CLASS="command"
|
||||
>view</B
|
||||
@@ -584,7 +584,7 @@ Statement Grammar</A
|
||||
></DT
|
||||
><DT
|
||||
>6.2.22. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN3202"
|
||||
HREF="Bv9ARM.ch06.html#AEN3190"
|
||||
><B
|
||||
CLASS="command"
|
||||
>zone</B
|
||||
@@ -594,7 +594,7 @@ CLASS="command"
|
||||
></DD
|
||||
><DT
|
||||
>6.3. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN3536"
|
||||
HREF="Bv9ARM.ch06.html#AEN3524"
|
||||
>Zone File</A
|
||||
></DT
|
||||
><DD
|
||||
@@ -606,7 +606,7 @@ HREF="Bv9ARM.ch06.html#types_of_resource_records_and_when_to_use_them"
|
||||
></DT
|
||||
><DT
|
||||
>6.3.2. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN3891"
|
||||
HREF="Bv9ARM.ch06.html#AEN3844"
|
||||
>Discussion of MX Records</A
|
||||
></DT
|
||||
><DT
|
||||
@@ -616,17 +616,17 @@ HREF="Bv9ARM.ch06.html#Setting_TTLs"
|
||||
></DT
|
||||
><DT
|
||||
>6.3.4. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN4012"
|
||||
HREF="Bv9ARM.ch06.html#AEN3965"
|
||||
>Inverse Mapping in IPv4</A
|
||||
></DT
|
||||
><DT
|
||||
>6.3.5. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN4039"
|
||||
HREF="Bv9ARM.ch06.html#AEN3992"
|
||||
>Other Zone File Directives</A
|
||||
></DT
|
||||
><DT
|
||||
>6.3.6. <A
|
||||
HREF="Bv9ARM.ch06.html#AEN4097"
|
||||
HREF="Bv9ARM.ch06.html#AEN4050"
|
||||
><SPAN
|
||||
CLASS="acronym"
|
||||
>BIND</SPAN
|
||||
@@ -656,7 +656,7 @@ HREF="Bv9ARM.ch07.html#Access_Control_Lists"
|
||||
></DT
|
||||
><DT
|
||||
>7.2. <A
|
||||
HREF="Bv9ARM.ch07.html#AEN4189"
|
||||
HREF="Bv9ARM.ch07.html#AEN4142"
|
||||
><B
|
||||
CLASS="command"
|
||||
>chroot</B
|
||||
@@ -670,7 +670,7 @@ UNIX servers)</A
|
||||
><DL
|
||||
><DT
|
||||
>7.2.1. <A
|
||||
HREF="Bv9ARM.ch07.html#AEN4212"
|
||||
HREF="Bv9ARM.ch07.html#AEN4165"
|
||||
>The <B
|
||||
CLASS="command"
|
||||
>chroot</B
|
||||
@@ -678,7 +678,7 @@ CLASS="command"
|
||||
></DT
|
||||
><DT
|
||||
>7.2.2. <A
|
||||
HREF="Bv9ARM.ch07.html#AEN4230"
|
||||
HREF="Bv9ARM.ch07.html#AEN4183"
|
||||
>Using the <B
|
||||
CLASS="command"
|
||||
>setuid</B
|
||||
@@ -702,26 +702,26 @@ HREF="Bv9ARM.ch08.html"
|
||||
><DL
|
||||
><DT
|
||||
>8.1. <A
|
||||
HREF="Bv9ARM.ch08.html#AEN4251"
|
||||
HREF="Bv9ARM.ch08.html#AEN4204"
|
||||
>Common Problems</A
|
||||
></DT
|
||||
><DD
|
||||
><DL
|
||||
><DT
|
||||
>8.1.1. <A
|
||||
HREF="Bv9ARM.ch08.html#AEN4253"
|
||||
HREF="Bv9ARM.ch08.html#AEN4206"
|
||||
>It's not working; how can I figure out what's wrong?</A
|
||||
></DT
|
||||
></DL
|
||||
></DD
|
||||
><DT
|
||||
>8.2. <A
|
||||
HREF="Bv9ARM.ch08.html#AEN4256"
|
||||
HREF="Bv9ARM.ch08.html#AEN4209"
|
||||
>Incrementing and Changing the Serial Number</A
|
||||
></DT
|
||||
><DT
|
||||
>8.3. <A
|
||||
HREF="Bv9ARM.ch08.html#AEN4261"
|
||||
HREF="Bv9ARM.ch08.html#AEN4214"
|
||||
>Where Can I Get Help?</A
|
||||
></DT
|
||||
></DL
|
||||
@@ -735,14 +735,14 @@ HREF="Bv9ARM.ch09.html"
|
||||
><DL
|
||||
><DT
|
||||
>A.1. <A
|
||||
HREF="Bv9ARM.ch09.html#AEN4277"
|
||||
HREF="Bv9ARM.ch09.html#AEN4230"
|
||||
>Acknowledgements</A
|
||||
></DT
|
||||
><DD
|
||||
><DL
|
||||
><DT
|
||||
>A.1.1. <A
|
||||
HREF="Bv9ARM.ch09.html#AEN4279"
|
||||
HREF="Bv9ARM.ch09.html#AEN4232"
|
||||
>A Brief History of the <SPAN
|
||||
CLASS="acronym"
|
||||
>DNS</SPAN
|
||||
@@ -772,7 +772,7 @@ HREF="Bv9ARM.ch09.html#classes_of_resource_records"
|
||||
></DD
|
||||
><DT
|
||||
>A.3. <A
|
||||
HREF="Bv9ARM.ch09.html#AEN4318"
|
||||
HREF="Bv9ARM.ch09.html#AEN4271"
|
||||
>General <SPAN
|
||||
CLASS="acronym"
|
||||
>DNS</SPAN
|
||||
@@ -806,7 +806,7 @@ HREF="Bv9ARM.ch09.html#internet_drafts"
|
||||
></DT
|
||||
><DT
|
||||
>A.4.3. <A
|
||||
HREF="Bv9ARM.ch09.html#AEN4927"
|
||||
HREF="Bv9ARM.ch09.html#AEN4880"
|
||||
>Other Documents About <SPAN
|
||||
CLASS="acronym"
|
||||
>BIND</SPAN
|
||||
|
||||
@@ -1,430 +0,0 @@
|
||||
|
||||
|
||||
|
||||
IETF DNSOPS working group T. Hardie
|
||||
Internet draft Nominum, Inc
|
||||
Category: Work-in-progress January, 2002
|
||||
|
||||
draft-ietf-dnsop-hardie-shared-root-server-07.txt
|
||||
|
||||
|
||||
Distributing Authoritative Name Servers via Shared Unicast Addresses
|
||||
|
||||
|
||||
|
||||
Status of this memo
|
||||
|
||||
This document is an Internet-Draft and is in full conformance with
|
||||
all provisions of Section 10 of RFC 2026.
|
||||
|
||||
Internet-Drafts are working documents of the Internet Engineering
|
||||
Task Force (IETF), its areas, and its working groups. Note that
|
||||
other groups may also distribute working documents as Internet-
|
||||
Drafts.
|
||||
|
||||
Internet-Drafts are draft documents valid for a maximum of six
|
||||
months and may be updated, replaced, or obsoleted by other
|
||||
documents at any time. It is inappropriate to use Internet-Drafts
|
||||
as reference material or to cite them other than as "work in
|
||||
progress."
|
||||
|
||||
The list of current Internet-Drafts can be accessed at
|
||||
http://www.ietf.org/ietf/1id-abstracts.txt
|
||||
|
||||
To view the list Internet-Draft Shadow Directories, see
|
||||
http://www.ietf.org/shadow.html.
|
||||
|
||||
Copyright Notice
|
||||
|
||||
Copyright (C) The Internet Society 1999. All Rights Reserved.
|
||||
|
||||
Abstract
|
||||
|
||||
This memo describes a set of practices intended to enable an
|
||||
authoritative name server operator to provide access to a single
|
||||
named server in multiple locations. The primary motivation for the
|
||||
development and deployment of these practices is to increase the
|
||||
distribution of DNS servers to previously under-served areas of the
|
||||
network topology and to reduce the latency for DNS query responses
|
||||
in those areas. This document presumes a one-to-one mapping between
|
||||
named authoritative servers and administrative entities (operators).
|
||||
This document contains no guidelines or recommendations for caching
|
||||
name servers. The shared unicast system described here is specific
|
||||
to IPv4; applicability to IPv6 is an area for further study. It
|
||||
should also be noted that the system described here is related to
|
||||
that described in [ANYCAST], but it does not require dedicated
|
||||
address space, routing changes, or the other elements of a full
|
||||
anycast infrastructure which that document describes.
|
||||
|
||||
|
||||
1. Architecture
|
||||
|
||||
1.1 Server Requirements
|
||||
|
||||
Operators of authoritative name servers may wish to refer to
|
||||
[SECONDARY] and [ROOT] for general guidance on appropriate practice
|
||||
for authoritative name servers. In addition to proper configuration
|
||||
as a standard authoritative name server, each of the hosts
|
||||
participating in a shared-unicast system should be configured with
|
||||
two network interfaces. These interfaces may be either two physical
|
||||
interfaces or one physical interface mapped to two logical
|
||||
interfaces. One of the network interfaces should use the IPv4
|
||||
shared unicast address associated with the authoritative name
|
||||
server. The other interface, referred to as the administrative
|
||||
interface below, should use a distinct IPv4 address specific to that
|
||||
host. The host should respond to DNS queries only on the
|
||||
shared-unicast interface. In order to provide the most consistent
|
||||
set of responses from the mesh of anycast hosts, it is good practice
|
||||
to limit responses on that interface to zones for which the host is
|
||||
authoritative.
|
||||
|
||||
|
||||
1.2 Zone file delivery
|
||||
|
||||
In order to minimize the risk of man-in-the-middle attacks, zone
|
||||
files should be delivered to the administrative interface of the
|
||||
servers participating in the mesh. Secure file transfer methods and
|
||||
strong authentication should be used for all transfers. If the hosts
|
||||
in the mesh make their zones available for zone transfer, the administrative
|
||||
interfaces should be used for those transfers as well, in order to avoid
|
||||
the problems with potential routing changes for TCP traffic
|
||||
noted in section 1.5 below.
|
||||
|
||||
1.3 Synchronization
|
||||
|
||||
Authoritative name servers may be loosely or tightly synchronized,
|
||||
depending on the practices set by the operating organization. As
|
||||
noted below in section 3.1.2, lack of synchronization among servers
|
||||
using the same shared unicast address could create problems for some
|
||||
users of this service. In order to minimize that risk, switch-overs
|
||||
from one data set to another data set should be coordinated as much
|
||||
as possible. The use of synchronized clocks on the participating
|
||||
hosts and set times for switch-overs provides a basic level of
|
||||
coordination. A more complete coordination process would involve:
|
||||
|
||||
a) receipt of zones at a distribution host
|
||||
b) confirmation of the integrity of zones received
|
||||
c) distribution of the zones to all of the servers in the
|
||||
mesh
|
||||
d) confirmation of the integrity of the zones at each server
|
||||
e) coordination of the switchover times for the servers in the
|
||||
mesh
|
||||
f) institution of a failure process to ensure that servers that
|
||||
did not receive correct data or could not switchover to the
|
||||
new data ceased to respond to incoming queries until the
|
||||
problem could be resolved.
|
||||
|
||||
Depending on the size of the mesh, the distribution host may also be
|
||||
a participant; for authoritative servers, it may also be the host on
|
||||
which zones are generated.
|
||||
|
||||
This document presumes that the usual DNS failover methods are the
|
||||
only ones used to ensure reachability of the data for clients. It
|
||||
does not advise that the routes be withdrawn in the case of failure;
|
||||
it advises instead the the DNS process shutdown so that servers on
|
||||
other addresses are queried. This recommendation reflects a choice
|
||||
between performance and operational complexity. While it would be
|
||||
possible to have some process withdraw the route for a specific
|
||||
server instance when it is not available, there is considerable
|
||||
operational complexity involved in ensuring that this occurs
|
||||
reliably. Given the existing DNS failover methods, the marginal
|
||||
improvement in performance will not be sufficient to justify
|
||||
the additional complexity for most uses.
|
||||
|
||||
|
||||
1.4 Server Placement
|
||||
|
||||
Though the geographic diversity of server placement helps reduce the
|
||||
effects of service disruptions due to local problems, it is
|
||||
diversity of placement in the network topology which is the driving
|
||||
force behind these distribution practices. Server placement should
|
||||
emphasize that diversity. Ideally, servers should be placed
|
||||
topologically near the points at which the operator exchanges routes
|
||||
and traffic with other networks.
|
||||
|
||||
1.5 Routing
|
||||
|
||||
The organization administering the mesh of servers sharing a unicast
|
||||
address must have an autonomous system number and speak BGP to its
|
||||
peers. To those peers, the organization announces a route to the
|
||||
network containing the shared-unicast address of the name server.
|
||||
The organization's border routers must then deliver the traffic
|
||||
destined for the name server to the nearest instantiation. Routing
|
||||
to the administrative interfaces for the servers can use the normal
|
||||
routing methods for the administering organization.
|
||||
|
||||
One potential problem with using shared unicast addresses is that
|
||||
routers forwarding traffic to them may have more than one available
|
||||
route, and those routes may, in fact, reach different instances of
|
||||
the shared unicast address. Applications like the DNS, whose
|
||||
communication typically consists of independent request-response
|
||||
messages each fitting in a single UDP packet presents no problem.
|
||||
Other applications, in which multiple packets must reach the same
|
||||
endpoint (e.g., TCP) may fail or present unworkable performance
|
||||
characteristics in some circumstances. Split-destination failures
|
||||
may occur when a router does per-packet (or round-robin) load
|
||||
sharing, a topology change occurs that changes the relative metrics
|
||||
of two paths to the same anycast destination, etc.
|
||||
|
||||
Four things mitigate the severity of this problem. The first is
|
||||
that UDP is a fairly high proportion of the query traffic to name
|
||||
servers. The second is that the aim of this proposal is to
|
||||
diversify topological placement; for most users, this means that the
|
||||
coordination of placement will ensure that new instances of a name
|
||||
server will be at a significantly different cost metric from
|
||||
existing instances. Some set of users may end up in the middle, but
|
||||
that should be relatively rare. The third is that per packet load
|
||||
sharing is only one of the possible load sharing mechanisms, and
|
||||
other mechanisms are increasing in popularity.
|
||||
|
||||
Lastly, in the case where the traffic is TCP, per packet load
|
||||
sharing is used, and equal cost routes to different instances of a
|
||||
name server are available, any DNS implementation which measures the
|
||||
performance of servers to select a preferred server will quickly
|
||||
prefer a server for which this problem does not occur. For the DNS
|
||||
failover mechanisms to reliably avoid this problem, however, those
|
||||
using shared unicast distribution mechanisms must take care that all
|
||||
of the servers for a specific zone are not participants in the same
|
||||
shared-unicast mesh. To guard even against the case where multiple
|
||||
meshes have a set of users affected by per packet load sharing along
|
||||
equal cost routes, organizations implementing these practices should
|
||||
always provide at least one authoritative server which is not a
|
||||
participant in any shared unicast mesh. Those deploying
|
||||
shared-unicast meshes should note that any specific host may become
|
||||
unreachable to a client should a server fail, a path fail, or the
|
||||
route to that host be withdrawn. These error conditions are,
|
||||
however, not specific to shared-unicast distributions, but would
|
||||
occur for standard unicast hosts.
|
||||
|
||||
Since ICMP response packets might go to a different member of the
|
||||
mesh than that sending a packet, packets sent with a shared unicast
|
||||
source address should also avoid using path MTU discovery.
|
||||
|
||||
Appendix A. contains an ASCII diagram of a example of a simple
|
||||
implementation of this system. In it, the odd numbered routers
|
||||
deliver traffic to the shared-unicast interface network and filter
|
||||
traffic from the administrative network; the even numbered routers
|
||||
deliver traffic to the administrative network and filter traffic
|
||||
from the shared-unicast network. These are depicted as separate
|
||||
routers for the ease this gives in explanation, but they could
|
||||
easily be separate interfaces on the same router. Similarly, a
|
||||
local NTP source is depicted for synchronization, but the level of
|
||||
synchronization needed would not require that source to be either
|
||||
local or a stratum one NTP server.
|
||||
|
||||
|
||||
2. Administration
|
||||
|
||||
2.1 Points of Contact
|
||||
|
||||
A single point of contact for reporting problems is crucial to the
|
||||
correct administration of this system. If an external user of the
|
||||
system needs to report a problem related to the service, there must
|
||||
be no ambiguity about whom to contact. If internal monitoring does
|
||||
not indicate a problem, the contact may, of course, need to work
|
||||
with the external user to identify which server generated the
|
||||
error.
|
||||
|
||||
|
||||
3. Security Considerations
|
||||
|
||||
As a core piece of Internet infrastructure, authoritative name
|
||||
servers are common targets of attack. The practices outlined here
|
||||
increase the risk of certain kinds of attack and reduce the risk of
|
||||
others.
|
||||
|
||||
3.1 Increased Risks
|
||||
|
||||
3.1.1 Increase in physical servers
|
||||
|
||||
The architecture outlined in this document increases the number of
|
||||
physical servers, which could increase the possibility that a
|
||||
server mis-configuration will occur which allows for a security
|
||||
breach. In general, the entity administering a mesh should ensure
|
||||
that patches and security mechanisms applied to a single member of
|
||||
the mesh are appropriate for and applied to all of the members of a
|
||||
mesh. "Genetic diversity" (code from different code bases) can be
|
||||
a useful security measure in avoiding attacks based on
|
||||
vulnerabilities in a specific code base; in order to ensure
|
||||
consistency of responses from a single named server, however, that
|
||||
diversity should be applied to different shared-unicast meshes or
|
||||
between a mesh and a related unicast authoritative server.
|
||||
|
||||
3.1.2 Data synchronization problems
|
||||
|
||||
The level of systemic synchronization described above should be
|
||||
augmented by synchronization of the data present at each of the
|
||||
servers. While the DNS itself is a loosely coupled system,
|
||||
debugging problems with data in specific zones would be far more
|
||||
difficult if two different servers sharing a single unicast address
|
||||
might return different responses to the same query. For example,
|
||||
if the data associated with www.example.com has changed and the
|
||||
administrators of the domain are testing for the changes at the
|
||||
example.com authoritative name servers, they should not need to
|
||||
check each instance of a named root server. The use of ntp to
|
||||
provide a synchronized time for switch-over eliminates some aspects
|
||||
of this problem, but mechanisms to handle failure during the
|
||||
switchover are required. In particular, a server which cannot make
|
||||
the switchover must not roll-back to a previous version; it must
|
||||
cease to respond to queries so that other servers are queried.
|
||||
|
||||
3.1.3 Distribution risks
|
||||
|
||||
If the mechanism used to distribute zone files among the servers is
|
||||
not well secured, a man-in-the-middle attack could result in the
|
||||
injection of false information. Digital signatures will alleviate
|
||||
this risk, but encrypted transport and tight access lists are a
|
||||
necessary adjunct to them. Since zone files will be distributed to
|
||||
the administrative interfaces of meshed servers, the access control
|
||||
list for distribution of the zone files should include the
|
||||
administrative interface of the server or servers, rather than
|
||||
their shared unicast addresses.
|
||||
|
||||
3.2 Decreased Risks
|
||||
|
||||
The increase in number of physical servers reduces the likelihood
|
||||
that a denial-of-service attack will take out a significant portion
|
||||
of the DNS infrastructure. The increase in servers also reduces
|
||||
the effect of machine crashes, fiber cuts, and localized disasters
|
||||
by reducing the number of users dependent on a specific machine.
|
||||
|
||||
|
||||
4. Full copyright statement
|
||||
|
||||
Copyright (C) The Internet Society 1999. All Rights Reserved.
|
||||
|
||||
This document and translations of it may be copied and furnished to
|
||||
others, and derivative works that comment on or otherwise explain
|
||||
it or assist in its implementation may be prepared, copied,
|
||||
published and distributed, in whole or in part, without restriction
|
||||
of any kind, provided that the above copyright notice and this
|
||||
paragraph are included on all such copies and derivative works.
|
||||
However, this document itself may not be modified in any way, such
|
||||
as by removing the copyright notice or references to the Internet
|
||||
Society or other Internet organizations, except as needed for the
|
||||
purpose of developing Internet standards in which case the
|
||||
procedures for copyrights defined in the Internet Standards process
|
||||
must be followed, or as required to translate it into languages
|
||||
other than English.
|
||||
|
||||
The limited permissions granted above are perpetual and will not be
|
||||
revoked by the Internet Society or its successors or assigns.
|
||||
|
||||
This document and the information contained herein is provided on
|
||||
an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET
|
||||
ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
|
||||
THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
5. Acknowledgments
|
||||
|
||||
Masataka Ohta, Bill Manning, Randy Bush, Chris Yarnell, Ray Plzak,
|
||||
Mark Andrews, Robert Elz, Geoff Houston, Bill Norton, Akira Kato,
|
||||
Suzanne Woolf, Scott Tucker, Bernard Aboba, Casey Ajalat and Gunnar
|
||||
Lindberg all provided input and commentary on this work.
|
||||
|
||||
|
||||
6. References
|
||||
|
||||
[SECONDARY] "Selection and Operation of Secondary Name Servers".
|
||||
R. Elz, R. Bush, S Bradner, M. Patton, BCP0016.
|
||||
|
||||
[ROOT] "Root Name Server Operational Requirements". R. Bush,
|
||||
D. Karrenberg, M. Kosters, R. Plzak, BCP0040.
|
||||
|
||||
[ANYCAST] "Host Anycasting Service". C. Patridge, T. Mendez, W. Milliken,
|
||||
RFC1546.
|
||||
|
||||
|
||||
7. Editor's address
|
||||
|
||||
Ted Hardie
|
||||
Nominum, Inc.
|
||||
950 Charter St.
|
||||
Redwood City, CA 94063
|
||||
Ted.Hardie@nominum.com
|
||||
Tel: 1.650.381.6226
|
||||
|
||||
|
||||
|
||||
|
||||
Appendix A.
|
||||
|
||||
|
||||
|
||||
__________________
|
||||
Peer 1-| |
|
||||
Peer 2-| |
|
||||
Peer 3-| Switch |
|
||||
Transit| | _________ _________
|
||||
etc | |--|Router1|---|----|--------------|Router2|---WAN-|
|
||||
| | --------- | | --------- |
|
||||
| | | | |
|
||||
| | | | |
|
||||
------------------ [NTP] [DNS] |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
__________________ |
|
||||
Peer 1-| | |
|
||||
Peer 2-| | |
|
||||
Peer 3-| Switch | |
|
||||
Transit| | _________ _________ |
|
||||
etc | |--|Router3|---|----|--------------|Router4|---WAN-|
|
||||
| | --------- | | --------- |
|
||||
| | | | |
|
||||
| | | | |
|
||||
------------------ [NTP] [DNS] |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
__________________ |
|
||||
Peer 1-| | |
|
||||
Peer 2-| | |
|
||||
Peer 3-| Switch | |
|
||||
Transit| | _________ _________ |
|
||||
etc | |--|Router5|---|----|--------------|Router6|---WAN-|
|
||||
| | --------- | | --------- |
|
||||
| | | | |
|
||||
| | | | |
|
||||
------------------ [NTP] [DNS] |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
__________________ |
|
||||
Peer 1-| | |
|
||||
Peer 2-| | |
|
||||
Peer 3-| Switch | |
|
||||
Transit| | _________ _________ |
|
||||
etc | |--|Router7|---|----|--------------|Router8|---WAN-|
|
||||
| | --------- | | ---------
|
||||
| | | |
|
||||
| | | |
|
||||
------------------ [NTP] [DNS]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+2
-10
@@ -1,4 +1,4 @@
|
||||
Copyright (C) 2000-2002 Internet Software Consortium.
|
||||
Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
See COPYRIGHT in the source root or http://isc.org/copyright.html for terms.
|
||||
|
||||
DNSSEC Release Notes
|
||||
@@ -80,12 +80,4 @@ an update occurs. Advanced access control is possible using the
|
||||
"update-policy" statement in the zone definition.
|
||||
|
||||
|
||||
Secure Zone Transfers
|
||||
|
||||
BIND 9 does not implement the zone transfer security mechanisms of
|
||||
RFC2535 section 5.6, and we have no plans to implement them in the
|
||||
future as we consider them inferior to the use of TSIG or SIG(0) to
|
||||
ensure the integrity of zone transfers.
|
||||
|
||||
|
||||
$Id: dnssec,v 1.14.2.3 2002/02/08 03:57:24 marka Exp $
|
||||
$Id: dnssec,v 1.14.2.1 2001/09/05 00:56:38 gson Exp $
|
||||
|
||||
+6
-14
@@ -43,6 +43,7 @@ options {
|
||||
use-id-pool <boolean>; // obsolete
|
||||
use-ixfr <boolean>;
|
||||
version <quoted_string>;
|
||||
allow-notify { <address_match_element>; ... };
|
||||
allow-recursion { <address_match_element>; ... };
|
||||
allow-v6-synthesis { <address_match_element>; ... };
|
||||
sortlist { <address_match_element>; ... };
|
||||
@@ -58,6 +59,8 @@ options {
|
||||
additional-from-cache <boolean>;
|
||||
query-source <querysource4>;
|
||||
query-source-v6 <querysource6>;
|
||||
notify-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ];
|
||||
notify-source-v6 ( <ipv6_address> | * ) [ port ( <integer> | * ) ];
|
||||
cleaning-interval <integer>;
|
||||
min-roots <integer>; // not implemented
|
||||
lame-ttl <integer>;
|
||||
@@ -70,10 +73,7 @@ options {
|
||||
allow-query { <address_match_element>; ... };
|
||||
allow-transfer { <address_match_element>; ... };
|
||||
allow-update-forwarding { <address_match_element>; ... };
|
||||
allow-notify { <address_match_element>; ... };
|
||||
notify <notifytype>;
|
||||
notify-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ];
|
||||
notify-source-v6 ( <ipv6_address> | * ) [ port ( <integer> | * ) ];
|
||||
also-notify [ port <integer> ] { ( <ipv4_address> | <ipv6_address>
|
||||
) [ port <integer> ]; ... };
|
||||
dialup <dialuptype>;
|
||||
@@ -143,12 +143,7 @@ view <string> <optional_class> {
|
||||
allow-query { <address_match_element>; ... };
|
||||
allow-transfer { <address_match_element>; ... };
|
||||
allow-update-forwarding { <address_match_element>; ... };
|
||||
allow-notify { <address_match_element>; ... };
|
||||
notify <notifytype>;
|
||||
notify-source ( <ipv4_address> | * ) [ port ( <integer> | *
|
||||
) ];
|
||||
notify-source-v6 ( <ipv6_address> | * ) [ port ( <integer>
|
||||
| * ) ];
|
||||
also-notify [ port <integer> ] { ( <ipv4_address> |
|
||||
<ipv6_address> ) [ port <integer> ]; ... };
|
||||
dialup <dialuptype>;
|
||||
@@ -184,6 +179,7 @@ view <string> <optional_class> {
|
||||
};
|
||||
trusted-keys { <string> <integer> <integer> <integer>
|
||||
<quoted_string>; ... };
|
||||
allow-notify { <address_match_element>; ... };
|
||||
allow-recursion { <address_match_element>; ... };
|
||||
allow-v6-synthesis { <address_match_element>; ... };
|
||||
sortlist { <address_match_element>; ... };
|
||||
@@ -199,6 +195,8 @@ view <string> <optional_class> {
|
||||
additional-from-cache <boolean>;
|
||||
query-source <querysource4>;
|
||||
query-source-v6 <querysource6>;
|
||||
notify-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ];
|
||||
notify-source-v6 ( <ipv6_address> | * ) [ port ( <integer> | * ) ];
|
||||
cleaning-interval <integer>;
|
||||
min-roots <integer>; // not implemented
|
||||
lame-ttl <integer>;
|
||||
@@ -211,10 +209,7 @@ view <string> <optional_class> {
|
||||
allow-query { <address_match_element>; ... };
|
||||
allow-transfer { <address_match_element>; ... };
|
||||
allow-update-forwarding { <address_match_element>; ... };
|
||||
allow-notify { <address_match_element>; ... };
|
||||
notify <notifytype>;
|
||||
notify-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ];
|
||||
notify-source-v6 ( <ipv6_address> | * ) [ port ( <integer> | * ) ];
|
||||
also-notify [ port <integer> ] { ( <ipv4_address> | <ipv6_address>
|
||||
) [ port <integer> ]; ... };
|
||||
dialup <dialuptype>;
|
||||
@@ -266,10 +261,7 @@ zone <string> <optional_class> {
|
||||
allow-query { <address_match_element>; ... };
|
||||
allow-transfer { <address_match_element>; ... };
|
||||
allow-update-forwarding { <address_match_element>; ... };
|
||||
allow-notify { <address_match_element>; ... };
|
||||
notify <notifytype>;
|
||||
notify-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ];
|
||||
notify-source-v6 ( <ipv6_address> | * ) [ port ( <integer> | * ) ];
|
||||
also-notify [ port <integer> ] { ( <ipv4_address> | <ipv6_address>
|
||||
) [ port <integer> ]; ... };
|
||||
dialup <dialuptype>;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user