1 /* $NetBSD: isctest.h,v 1.4 2014/12/10 04:38:01 christos Exp $ */ 2 3 /* 4 * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC") 5 * 6 * Permission to use, copy, modify, and/or distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 11 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 12 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 13 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 14 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 15 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 /* Id */ 20 21 /*! \file */ 22 23 #include <config.h> 24 25 #include <isc/buffer.h> 26 #include <isc/entropy.h> 27 #include <isc/hash.h> 28 #include <isc/log.h> 29 #include <isc/mem.h> 30 #include <isc/print.h> 31 #include <isc/result.h> 32 #include <isc/string.h> 33 #include <isc/task.h> 34 #include <isc/timer.h> 35 #include <isc/util.h> 36 37 #define CHECK(r) \ 38 do { \ 39 result = (r); \ 40 if (result != ISC_R_SUCCESS) \ 41 goto cleanup; \ 42 } while (/*CONSTCOND*/0) 43 44 extern isc_mem_t *mctx; 45 extern isc_entropy_t *ectx; 46 extern isc_log_t *lctx; 47 extern isc_taskmgr_t *taskmgr; 48 extern isc_timermgr_t *timermgr; 49 extern isc_socketmgr_t *socketmgr; 50 extern int ncpus; 51 52 isc_result_t 53 isc_test_begin(FILE *logfile, isc_boolean_t start_managers); 54 55 void 56 isc_test_end(void); 57 58 void 59 isc_test_nap(isc_uint32_t usec); 60