Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/bind/dist/lib/isc Export all the necessary func...
details: https://anonhg.NetBSD.org/src/rev/7623f7905b76
branches: trunk
changeset: 785667:7623f7905b76
user: christos <christos%NetBSD.org@localhost>
date: Sun Mar 24 18:41:59 2013 +0000
description:
Export all the necessary functions via the registry API instead of playing
namespace games with cpp. Remove the BIND9 ifdef. Now the bind programs
don't need a special build of libisc.
diffstat:
external/bsd/bind/dist/lib/isc/hash.c | 12 +-
external/bsd/bind/dist/lib/isc/include/isc/app.h | 4 +-
external/bsd/bind/dist/lib/isc/include/isc/bind9.h | 4 +-
external/bsd/bind/dist/lib/isc/include/isc/mem.h | 11 +-
external/bsd/bind/dist/lib/isc/include/isc/namespace.h | 9 +-
external/bsd/bind/dist/lib/isc/include/isc/socket.h | 53 +++++-
external/bsd/bind/dist/lib/isc/include/isc/task.h | 3 +-
external/bsd/bind/dist/lib/isc/include/isc/timer.h | 5 +-
external/bsd/bind/dist/lib/isc/lib.c | 4 +-
external/bsd/bind/dist/lib/isc/mem.c | 73 +++-----
external/bsd/bind/dist/lib/isc/mem_api.c | 28 ++-
external/bsd/bind/dist/lib/isc/socket_api.c | 138 ++++++++++++++++-
external/bsd/bind/dist/lib/isc/task.c | 67 +++-----
external/bsd/bind/dist/lib/isc/task_api.c | 19 ++-
external/bsd/bind/dist/lib/isc/task_p.h | 5 +-
external/bsd/bind/dist/lib/isc/timer.c | 29 +--
external/bsd/bind/dist/lib/isc/timer_api.c | 9 +-
external/bsd/bind/dist/lib/isc/unix/app.c | 96 ++--------
external/bsd/bind/dist/lib/isc/unix/socket.c | 103 ++++++------
19 files changed, 371 insertions(+), 301 deletions(-)
diffs (truncated from 1698 to 300 lines):
diff -r 86cbb4eb6fee -r 7623f7905b76 external/bsd/bind/dist/lib/isc/hash.c
--- a/external/bsd/bind/dist/lib/isc/hash.c Sun Mar 24 17:50:26 2013 +0000
+++ b/external/bsd/bind/dist/lib/isc/hash.c Sun Mar 24 18:41:59 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hash.c,v 1.3 2012/06/05 00:42:27 christos Exp $ */
+/* $NetBSD: hash.c,v 1.4 2013/03/24 18:41:59 christos Exp $ */
/*
* Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
@@ -196,12 +196,8 @@
hctx->vectorlen = vlen;
hctx->rndvector = rv;
-#ifdef BIND9
if (entropy != NULL)
isc_entropy_attach(entropy, &hctx->entropy);
-#else
- UNUSED(entropy);
-#endif
*hctxp = hctx;
return (ISC_R_SUCCESS);
@@ -248,16 +244,12 @@
goto out;
if (hctx->entropy) {
-#ifdef BIND9
isc_result_t result;
result = isc_entropy_getdata(hctx->entropy,
hctx->rndvector, hctx->vectorlen,
NULL, 0);
INSIST(result == ISC_R_SUCCESS);
-#else
- INSIST(0);
-#endif
} else {
isc_uint32_t pr;
unsigned int i, copylen;
@@ -314,10 +306,8 @@
isc_refcount_destroy(&hctx->refcnt);
mctx = hctx->mctx;
-#ifdef BIND9
if (hctx->entropy != NULL)
isc_entropy_detach(&hctx->entropy);
-#endif
if (hctx->rndvector != NULL)
isc_mem_put(mctx, hctx->rndvector, hctx->vectorlen);
diff -r 86cbb4eb6fee -r 7623f7905b76 external/bsd/bind/dist/lib/isc/include/isc/app.h
--- a/external/bsd/bind/dist/lib/isc/include/isc/app.h Sun Mar 24 17:50:26 2013 +0000
+++ b/external/bsd/bind/dist/lib/isc/include/isc/app.h Sun Mar 24 18:41:59 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: app.h,v 1.3 2012/06/05 00:42:33 christos Exp $ */
+/* $NetBSD: app.h,v 1.4 2013/03/24 18:42:00 christos Exp $ */
/*
* Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
@@ -347,7 +347,6 @@
*\li 'timermgr' is a valid timer manager.
*/
-#ifdef USE_APPIMPREGISTER
/*%<
* See isc_appctx_create() above.
*/
@@ -370,7 +369,6 @@
* usually do not have to care about this function: it would call
* isc_lib_register(), which internally calls this function.
*/
-#endif /* USE_APPIMPREGISTER */
ISC_LANG_ENDDECLS
diff -r 86cbb4eb6fee -r 7623f7905b76 external/bsd/bind/dist/lib/isc/include/isc/bind9.h
--- a/external/bsd/bind/dist/lib/isc/include/isc/bind9.h Sun Mar 24 17:50:26 2013 +0000
+++ b/external/bsd/bind/dist/lib/isc/include/isc/bind9.h Sun Mar 24 18:41:59 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bind9.h,v 1.3 2012/06/05 00:42:34 christos Exp $ */
+/* $NetBSD: bind9.h,v 1.4 2013/03/24 18:42:00 christos Exp $ */
/*
* Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
@@ -27,6 +27,4 @@
* standard BIND9 build defines BIND9; the version included with the
* exportable libraries does not.
*/
-#define BIND9 1
-
#endif /* ISC_BIND9_H */
diff -r 86cbb4eb6fee -r 7623f7905b76 external/bsd/bind/dist/lib/isc/include/isc/mem.h
--- a/external/bsd/bind/dist/lib/isc/include/isc/mem.h Sun Mar 24 17:50:26 2013 +0000
+++ b/external/bsd/bind/dist/lib/isc/include/isc/mem.h Sun Mar 24 18:41:59 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mem.h,v 1.8 2012/06/05 00:42:37 christos Exp $ */
+/* $NetBSD: mem.h,v 1.9 2013/03/24 18:42:00 christos Exp $ */
/*
* Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
@@ -720,14 +720,18 @@
void
ISCMEMPOOLFUNC(put)(isc_mempool_t *, void * _ISC_MEM_FLARG);
-#ifdef USE_MEMIMPREGISTER
+void *
+isc_default_memalloc(void *arg, size_t len);
+void
+isc_default_memfree(void *arg, void *ptr);
/*%<
* See isc_mem_create2() above.
*/
typedef isc_result_t
(*isc_memcreatefunc_t)(size_t init_max_size, size_t target_size,
- isc_mem_t **ctxp, unsigned int flags);
+ isc_memalloc_t memalloc, isc_memfree_t memfree,
+ void *arg, isc_mem_t **ctxp, unsigned int flags);
isc_result_t
isc_mem_register(isc_memcreatefunc_t createfunc);
@@ -745,7 +749,6 @@
* usually do not have to care about this function: it would call
* isc_lib_register(), which internally calls this function.
*/
-#endif /* USE_MEMIMPREGISTER */
ISC_LANG_ENDDECLS
diff -r 86cbb4eb6fee -r 7623f7905b76 external/bsd/bind/dist/lib/isc/include/isc/namespace.h
--- a/external/bsd/bind/dist/lib/isc/include/isc/namespace.h Sun Mar 24 17:50:26 2013 +0000
+++ b/external/bsd/bind/dist/lib/isc/include/isc/namespace.h Sun Mar 24 18:41:59 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: namespace.h,v 1.5 2012/12/04 23:38:44 spz Exp $ */
+/* $NetBSD: namespace.h,v 1.6 2013/03/24 18:42:00 christos Exp $ */
/*
* Copyright (C) 2009-2012 Internet Systems Consortium, Inc. ("ISC")
@@ -24,9 +24,7 @@
/*%
* name space conversions
*/
-
-#ifdef BIND9
-
+#if 0
#define isc_app_start isc__app_start
#define isc_app_ctxstart isc__app_ctxstart
#define isc_app_onrun isc__app_onrun
@@ -169,7 +167,6 @@
#define isc_timermgr_create isc__timermgr_create
#define isc_timermgr_poke isc__timermgr_poke
#define isc_timermgr_destroy isc__timermgr_destroy
-
-#endif /* BIND9 */
+#endif
#endif /* ISCAPI_NAMESPACE_H */
diff -r 86cbb4eb6fee -r 7623f7905b76 external/bsd/bind/dist/lib/isc/include/isc/socket.h
--- a/external/bsd/bind/dist/lib/isc/include/isc/socket.h Sun Mar 24 17:50:26 2013 +0000
+++ b/external/bsd/bind/dist/lib/isc/include/isc/socket.h Sun Mar 24 18:41:59 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: socket.h,v 1.4 2012/06/05 00:42:40 christos Exp $ */
+/* $NetBSD: socket.h,v 1.5 2013/03/24 18:42:00 christos Exp $ */
/*
* Copyright (C) 2004-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
@@ -265,6 +265,7 @@
/*% Socket and socket manager methods */
typedef struct isc_socketmgrmethods {
void (*destroy)(isc_socketmgr_t **managerp);
+ void (*_maxudp)(isc_socketmgr_t *mgr, int maxudp);
isc_result_t (*socketcreate)(isc_socketmgr_t *manager, int pf,
isc_sockettype_t type,
isc_socket_t **socketp);
@@ -276,21 +277,16 @@
} isc_socketmgrmethods_t;
typedef struct isc_socketmethods {
+ isc_result_t (*open)(isc_socket_t *socket);
+ isc_result_t (*close)(isc_socket_t *socket);
void (*attach)(isc_socket_t *socket,
isc_socket_t **socketp);
void (*detach)(isc_socket_t **socketp);
isc_result_t (*bind)(isc_socket_t *sock, isc_sockaddr_t *sockaddr,
unsigned int options);
- isc_result_t (*sendto)(isc_socket_t *sock, isc_region_t *region,
- isc_task_t *task, isc_taskaction_t action,
- const void *arg, isc_sockaddr_t *address,
- struct in6_pktinfo *pktinfo);
isc_result_t (*connect)(isc_socket_t *sock, isc_sockaddr_t *addr,
isc_task_t *task, isc_taskaction_t action,
const void *arg);
- isc_result_t (*recv)(isc_socket_t *sock, isc_region_t *region,
- unsigned int minimum, isc_task_t *task,
- isc_taskaction_t action, const void *arg);
void (*cancel)(isc_socket_t *sock, isc_task_t *task,
unsigned int how);
isc_result_t (*getsockname)(isc_socket_t *sock,
@@ -301,6 +297,42 @@
isc_result_t (*dup)(isc_socket_t *socket,
isc_socket_t **socketp);
int (*getfd)(isc_socket_t *socket);
+ void (*setname)(isc_socket_t *socket, const char *, void *);
+ isc_result_t (*accept)(isc_socket_t *sock, isc_task_t *task,
+ isc_taskaction_t action, const void *arg);
+ isc_result_t (*filter)(isc_socket_t *sock, const char *filter);
+ isc_result_t (*getpeername)(isc_socket_t *sock,
+ isc_sockaddr_t *addressp);
+ isc_result_t (*listen)(isc_socket_t *sock, unsigned int backlog);
+ isc_result_t (*recv)(isc_socket_t *sock, isc_region_t *region,
+ unsigned int minimum, isc_task_t *task,
+ isc_taskaction_t action, const void *arg);
+ isc_result_t (*recvv)(isc_socket_t *sock, isc_bufferlist_t *buflist,
+ unsigned int minimum, isc_task_t *task,
+ isc_taskaction_t action, const void *arg);
+ isc_result_t (*recv2)(isc_socket_t *sock, isc_region_t *region,
+ unsigned int minimum, isc_task_t *task,
+ isc_socketevent_t *event, unsigned int flags);
+ isc_result_t (*send)(isc_socket_t *sock, isc_region_t *region,
+ isc_task_t *task, isc_taskaction_t action,
+ const void *arg);
+ isc_result_t (*sendv)(isc_socket_t *sock, isc_bufferlist_t *buflist,
+ isc_task_t *task, isc_taskaction_t action,
+ const void *arg);
+ isc_result_t (*sendto)(isc_socket_t *sock, isc_region_t *region,
+ isc_task_t *task, isc_taskaction_t action,
+ const void *arg, isc_sockaddr_t *address,
+ struct in6_pktinfo *pktinfo);
+ isc_result_t (*sendtov)(isc_socket_t *sock,
+ isc_bufferlist_t *buflist, isc_task_t *task,
+ isc_taskaction_t action, const void *arg,
+ isc_sockaddr_t *address,
+ struct in6_pktinfo *pktinfo);
+ isc_result_t (*sendto2)(isc_socket_t *sock, isc_region_t *region,
+ isc_task_t *task, isc_sockaddr_t *address,
+ struct in6_pktinfo *pktinfo,
+ isc_socketevent_t *event,
+ unsigned int flags);
} isc_socketmethods_t;
/*%
@@ -1140,12 +1172,12 @@
#endif /* HAVE_LIBXML2 */
-#ifdef USE_SOCKETIMPREGISTER
/*%<
* See isc_socketmgr_create() above.
*/
typedef isc_result_t
-(*isc_socketmgrcreatefunc_t)(isc_mem_t *mctx, isc_socketmgr_t **managerp);
+(*isc_socketmgrcreatefunc_t)(isc_mem_t *mctx, isc_socketmgr_t **managerp,
+ unsigned int maxsocks);
isc_result_t
isc_socket_register(isc_socketmgrcreatefunc_t createfunc);
@@ -1163,7 +1195,6 @@
* usually do not have to care about this function: it would call
* isc_lib_register(), which internally calls this function.
*/
-#endif /* USE_SOCKETIMPREGISTER */
ISC_LANG_ENDDECLS
diff -r 86cbb4eb6fee -r 7623f7905b76 external/bsd/bind/dist/lib/isc/include/isc/task.h
--- a/external/bsd/bind/dist/lib/isc/include/isc/task.h Sun Mar 24 17:50:26 2013 +0000
+++ b/external/bsd/bind/dist/lib/isc/include/isc/task.h Sun Mar 24 18:41:59 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: task.h,v 1.6 2012/12/04 23:38:44 spz Exp $ */
+/* $NetBSD: task.h,v 1.7 2013/03/24 18:42:01 christos Exp $ */
/*
* Copyright (C) 2004-2007, 2009-2012 Internet Systems Consortium, Inc. ("ISC")
@@ -142,6 +142,7 @@
void (*endexclusive)(isc_task_t *task);
void (*setprivilege)(isc_task_t *task, isc_boolean_t priv);
isc_boolean_t (*privilege)(isc_task_t *task);
+ void (*getcurrenttime)(isc_task_t *task, isc_stdtime_t *t);
} isc_taskmethods_t;
/*%
diff -r 86cbb4eb6fee -r 7623f7905b76 external/bsd/bind/dist/lib/isc/include/isc/timer.h
--- a/external/bsd/bind/dist/lib/isc/include/isc/timer.h Sun Mar 24 17:50:26 2013 +0000
+++ b/external/bsd/bind/dist/lib/isc/include/isc/timer.h Sun Mar 24 18:41:59 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: timer.h,v 1.3 2012/06/05 00:42:41 christos Exp $ */
+/* $NetBSD: timer.h,v 1.4 2013/03/24 18:42:01 christos Exp $ */
/*
* Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
@@ -116,6 +116,7 @@
isc_taskaction_t action,
const void *arg,
isc_timer_t **timerp);
+ void (*poke)(isc_timermgr_t *mgr);
} isc_timermgrmethods_t;
typedef struct {
@@ -403,7 +404,6 @@
Home |
Main Index |
Thread Index |
Old Index