Skip to content

Commit 9617833

Browse files
committed
ISC library
svn path=/branches/nslookup/; revision=43761
1 parent cdf8fa1 commit 9617833

File tree

282 files changed

+64035
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+64035
-0
lines changed

dll/3rdparty/isc/Makefile.in

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
2+
# Copyright (C) 1998-2003 Internet Software Consortium.
3+
#
4+
# Permission to use, copy, modify, and/or distribute this software for any
5+
# purpose with or without fee is hereby granted, provided that the above
6+
# copyright notice and this permission notice appear in all copies.
7+
#
8+
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9+
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10+
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11+
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12+
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13+
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14+
# PERFORMANCE OF THIS SOFTWARE.
15+
16+
# $Id: Makefile.in,v 1.96.50.3 2009/02/16 01:02:58 marka Exp $
17+
18+
srcdir = @srcdir@
19+
VPATH = @srcdir@
20+
top_srcdir = @top_srcdir@
21+
22+
@BIND9_VERSION@
23+
24+
@LIBISC_API@
25+
26+
CINCLUDES = -I${srcdir}/unix/include \
27+
-I${srcdir}/@ISC_THREAD_DIR@/include \
28+
-I${srcdir}/@ISC_ARCH_DIR@/include \
29+
-I./include \
30+
-I${srcdir}/include
31+
CDEFINES =
32+
CWARNINGS =
33+
34+
# Alphabetically
35+
UNIXOBJS = @ISC_ISCIPV6_O@ \
36+
unix/app.@O@ unix/dir.@O@ unix/entropy.@O@ \
37+
unix/errno2result.@O@ unix/file.@O@ unix/fsaccess.@O@ \
38+
unix/interfaceiter.@O@ unix/keyboard.@O@ unix/net.@O@ \
39+
unix/os.@O@ unix/resource.@O@ unix/socket.@O@ unix/stdio.@O@ \
40+
unix/stdtime.@O@ unix/strerror.@O@ unix/syslog.@O@ unix/time.@O@
41+
42+
43+
NLSOBJS = nls/msgcat.@O@
44+
45+
THREADOBJS = @ISC_THREAD_DIR@/condition.@O@ @ISC_THREAD_DIR@/mutex.@O@ \
46+
@ISC_THREAD_DIR@/thread.@O@
47+
48+
WIN32OBJS = win32/condition.@O@ win32/dir.@O@ win32/file.@O@ \
49+
win32/fsaccess.@O@ win32/once.@O@ win32/stdtime.@O@ \
50+
win32/thread.@O@ win32/time.@O@
51+
52+
# Alphabetically
53+
OBJS = @ISC_EXTRA_OBJS@ \
54+
assertions.@O@ base32.@O@ base64.@O@ bitstring.@O@ buffer.@O@ \
55+
bufferlist.@O@ commandline.@O@ error.@O@ event.@O@ \
56+
hash.@O@ heap.@O@ hex.@O@ hmacmd5.@O@ hmacsha.@O@ \
57+
httpd.@O@ inet_aton.@O@ iterated_hash.@O@ \
58+
lex.@O@ lfsr.@O@ lib.@O@ log.@O@ \
59+
md5.@O@ mem.@O@ mutexblock.@O@ \
60+
netaddr.@O@ netscope.@O@ ondestroy.@O@ \
61+
parseint.@O@ portset.@O@ quota.@O@ radix.@O@ random.@O@ \
62+
ratelimiter.@O@ refcount.@O@ region.@O@ result.@O@ rwlock.@O@ \
63+
serial.@O@ sha1.@O@ sha2.@O@ sockaddr.@O@ stats.@O@ \
64+
string.@O@ strtoul.@O@ symtab.@O@ task.@O@ taskpool.@O@ \
65+
timer.@O@ version.@O@ ${UNIXOBJS} ${NLSOBJS} ${THREADOBJS}
66+
67+
# Alphabetically
68+
SRCS = @ISC_EXTRA_SRCS@ \
69+
assertions.c base32.c base64.c bitstring.c buffer.c \
70+
bufferlist.c commandline.c error.c event.c \
71+
heap.c hex.c hmacmd5.c hmacsha.c \
72+
httpd.c inet_aton.c iterated_hash.c \
73+
lex.c lfsr.c lib.c log.c \
74+
md5.c mem.c mutexblock.c \
75+
netaddr.c netscope.c ondestroy.c \
76+
parseint.c portset.c quota.c radix.c random.c \
77+
ratelimiter.c refcount.c region.c result.c rwlock.c \
78+
serial.c sha1.c sha2.c sockaddr.c stats.c string.c strtoul.c \
79+
symtab.c task.c taskpool.c timer.c version.c
80+
81+
LIBS = @LIBS@
82+
83+
SUBDIRS = include unix nls @ISC_THREAD_DIR@ @ISC_ARCH_DIR@
84+
TARGETS = timestamp
85+
86+
@BIND9_MAKE_RULES@
87+
88+
version.@O@: version.c
89+
${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
90+
-DVERSION=\"${VERSION}\" \
91+
-DLIBINTERFACE=${LIBINTERFACE} \
92+
-DLIBREVISION=${LIBREVISION} \
93+
-DLIBAGE=${LIBAGE} \
94+
-c ${srcdir}/version.c
95+
96+
libisc.@SA@: ${OBJS}
97+
${AR} ${ARFLAGS} $@ ${OBJS}
98+
${RANLIB} $@
99+
100+
libisc.la: ${OBJS}
101+
${LIBTOOL_MODE_LINK} \
102+
${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libisc.la -rpath ${libdir} \
103+
-version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \
104+
${OBJS} ${LIBS}
105+
106+
timestamp: libisc.@A@
107+
touch timestamp
108+
109+
installdirs:
110+
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir}
111+
112+
install:: timestamp installdirs
113+
${LIBTOOL_MODE_INSTALL} ${INSTALL_DATA} libisc.@A@ ${DESTDIR}${libdir}
114+
115+
clean distclean::
116+
rm -f libisc.@A@ libisc.la timestamp

dll/3rdparty/isc/alpha/Makefile.in

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
2+
#
3+
# Permission to use, copy, modify, and/or distribute this software for any
4+
# purpose with or without fee is hereby granted, provided that the above
5+
# copyright notice and this permission notice appear in all copies.
6+
#
7+
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
8+
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9+
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
10+
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11+
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
12+
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13+
# PERFORMANCE OF THIS SOFTWARE.
14+
15+
# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
16+
17+
srcdir = @srcdir@
18+
VPATH = @srcdir@
19+
top_srcdir = @top_srcdir@
20+
21+
SUBDIRS = include
22+
TARGETS =
23+
24+
@BIND9_MAKE_RULES@
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
2+
#
3+
# Permission to use, copy, modify, and/or distribute this software for any
4+
# purpose with or without fee is hereby granted, provided that the above
5+
# copyright notice and this permission notice appear in all copies.
6+
#
7+
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
8+
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9+
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
10+
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11+
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
12+
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13+
# PERFORMANCE OF THIS SOFTWARE.
14+
15+
# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
16+
17+
srcdir = @srcdir@
18+
VPATH = @srcdir@
19+
top_srcdir = @top_srcdir@
20+
21+
SUBDIRS = isc
22+
TARGETS =
23+
24+
@BIND9_MAKE_RULES@
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
2+
#
3+
# Permission to use, copy, modify, and/or distribute this software for any
4+
# purpose with or without fee is hereby granted, provided that the above
5+
# copyright notice and this permission notice appear in all copies.
6+
#
7+
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
8+
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9+
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
10+
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11+
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
12+
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13+
# PERFORMANCE OF THIS SOFTWARE.
14+
15+
# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
16+
17+
srcdir = @srcdir@
18+
VPATH = @srcdir@
19+
top_srcdir = @top_srcdir@
20+
21+
@BIND9_VERSION@
22+
23+
HEADERS = atomic.h
24+
25+
SUBDIRS =
26+
TARGETS =
27+
28+
@BIND9_MAKE_RULES@
29+
30+
installdirs:
31+
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir}/isc
32+
33+
install:: installdirs
34+
for i in ${HEADERS}; do \
35+
${INSTALL_DATA} $(srcdir)/$$i ${DESTDIR}${includedir}/isc ; \
36+
done
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
/*
2+
* Copyright (C) 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
3+
*
4+
* Permission to use, copy, modify, and/or distribute this software for any
5+
* purpose with or without fee is hereby granted, provided that the above
6+
* copyright notice and this permission notice appear in all copies.
7+
*
8+
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9+
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10+
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11+
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12+
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14+
* PERFORMANCE OF THIS SOFTWARE.
15+
*/
16+
17+
/* $Id: atomic.h,v 1.5.332.2 2009/04/08 06:47:32 tbox Exp $ */
18+
19+
/*
20+
* This code was written based on FreeBSD's kernel source whose copyright
21+
* follows:
22+
*/
23+
24+
/*-
25+
* Copyright (c) 1998 Doug Rabson
26+
* All rights reserved.
27+
*
28+
* Redistribution and use in source and binary forms, with or without
29+
* modification, are permitted provided that the following conditions
30+
* are met:
31+
* 1. Redistributions of source code must retain the above copyright
32+
* notice, this list of conditions and the following disclaimer.
33+
* 2. Redistributions in binary form must reproduce the above copyright
34+
* notice, this list of conditions and the following disclaimer in the
35+
* documentation and/or other materials provided with the distribution.
36+
*
37+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
38+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
39+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
40+
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
41+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
42+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
43+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
44+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
45+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
46+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47+
* SUCH DAMAGE.
48+
*
49+
* $FreeBSD: src/sys/alpha/include/atomic.h,v 1.18.6.1 2004/09/13 21:52:04 wilko Exp $
50+
*/
51+
52+
#ifndef ISC_ATOMIC_H
53+
#define ISC_ATOMIC_H 1
54+
55+
#include <isc/platform.h>
56+
#include <isc/types.h>
57+
58+
#ifdef ISC_PLATFORM_USEOSFASM
59+
#include <c_asm.h>
60+
61+
#pragma intrinsic(asm)
62+
63+
/*
64+
* This routine atomically increments the value stored in 'p' by 'val', and
65+
* returns the previous value. Memory access ordering around this function
66+
* can be critical, so we add explicit memory block instructions at the
67+
* beginning and the end of it (same for other functions).
68+
*/
69+
static inline isc_int32_t
70+
isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
71+
return (asm("mb;"
72+
"1:"
73+
"ldl_l %t0, 0(%a0);" /* load old value */
74+
"mov %t0, %v0;" /* copy the old value */
75+
"addl %t0, %a1, %t0;" /* calculate new value */
76+
"stl_c %t0, 0(%a0);" /* attempt to store */
77+
"beq %t0, 1b;" /* spin if failed */
78+
"mb;",
79+
p, val));
80+
}
81+
82+
/*
83+
* This routine atomically stores the value 'val' in 'p'.
84+
*/
85+
static inline void
86+
isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
87+
(void)asm("mb;"
88+
"1:"
89+
"ldl_l %t0, 0(%a0);" /* load old value */
90+
"mov %a1, %t0;" /* value to store */
91+
"stl_c %t0, 0(%a0);" /* attempt to store */
92+
"beq %t0, 1b;" /* spin if failed */
93+
"mb;",
94+
p, val);
95+
}
96+
97+
/*
98+
* This routine atomically replaces the value in 'p' with 'val', if the
99+
* original value is equal to 'cmpval'. The original value is returned in any
100+
* case.
101+
*/
102+
static inline isc_int32_t
103+
isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
104+
105+
return(asm("mb;"
106+
"1:"
107+
"ldl_l %t0, 0(%a0);" /* load old value */
108+
"mov %t0, %v0;" /* copy the old value */
109+
"cmpeq %t0, %a1, %t0;" /* compare */
110+
"beq %t0, 2f;" /* exit if not equal */
111+
"mov %a2, %t0;" /* value to store */
112+
"stl_c %t0, 0(%a0);" /* attempt to store */
113+
"beq %t0, 1b;" /* if it failed, spin */
114+
"2:"
115+
"mb;",
116+
p, cmpval, val));
117+
}
118+
#elif defined (ISC_PLATFORM_USEGCCASM)
119+
static inline isc_int32_t
120+
isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
121+
isc_int32_t temp, prev;
122+
123+
__asm__ volatile(
124+
"mb;"
125+
"1:"
126+
"ldl_l %0, %1;" /* load old value */
127+
"mov %0, %2;" /* copy the old value */
128+
"addl %0, %3, %0;" /* calculate new value */
129+
"stl_c %0, %1;" /* attempt to store */
130+
"beq %0, 1b;" /* spin if failed */
131+
"mb;"
132+
: "=&r"(temp), "+m"(*p), "=&r"(prev)
133+
: "r"(val)
134+
: "memory");
135+
136+
return (prev);
137+
}
138+
139+
static inline void
140+
isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
141+
isc_int32_t temp;
142+
143+
__asm__ volatile(
144+
"mb;"
145+
"1:"
146+
"ldl_l %0, %1;" /* load old value */
147+
"mov %2, %0;" /* value to store */
148+
"stl_c %0, %1;" /* attempt to store */
149+
"beq %0, 1b;" /* if it failed, spin */
150+
"mb;"
151+
: "=&r"(temp), "+m"(*p)
152+
: "r"(val)
153+
: "memory");
154+
}
155+
156+
static inline isc_int32_t
157+
isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
158+
isc_int32_t temp, prev;
159+
160+
__asm__ volatile(
161+
"mb;"
162+
"1:"
163+
"ldl_l %0, %1;" /* load old value */
164+
"mov %0, %2;" /* copy the old value */
165+
"cmpeq %0, %3, %0;" /* compare */
166+
"beq %0, 2f;" /* exit if not equal */
167+
"mov %4, %0;" /* value to store */
168+
"stl_c %0, %1;" /* attempt to store */
169+
"beq %0, 1b;" /* if it failed, spin */
170+
"2:"
171+
"mb;"
172+
: "=&r"(temp), "+m"(*p), "=&r"(prev)
173+
: "r"(cmpval), "r"(val)
174+
: "memory");
175+
176+
return (prev);
177+
}
178+
#else
179+
180+
#error "unsupported compiler. disable atomic ops by --disable-atomic"
181+
182+
#endif
183+
184+
#endif /* ISC_ATOMIC_H */

dll/3rdparty/isc/api

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
LIBINTERFACE = 51
2+
LIBREVISION = 1
3+
LIBAGE = 1

0 commit comments

Comments
 (0)