isc_loopmgr_run(loopmgr);
}
-void
-dig_query_start(void) {
- start_lookup();
-}
-
void
dig_shutdown(void) {
destroy_lookup(default_lookup);
void
dig_startup(void);
-/*%
- * Initiates the next lookup cycle
- */
-void
-dig_query_start(void);
-
/*%
* Activate/deactivate IDN filtering of output.
*/
result = isc_file_mktemplate(output, tempfile, tempfilelen);
check_result(result, "isc_file_mktemplate");
- if (outputformat == dns_masterformat_text) {
- result = isc_file_openunique(tempfile, &outfp);
- } else {
- result = isc_file_bopenunique(tempfile, &outfp);
- }
+ result = isc_file_openunique(tempfile, &outfp);
if (result != ISC_R_SUCCESS) {
fatal("failed to open temporary output file: %s",
isc_result_totext(result));
}
static isc_result_t
-opentmp(isc_mem_t *mctx, dns_masterformat_t format, const char *file,
- char **tempp, FILE **fp) {
+opentmp(isc_mem_t *mctx, const char *file, char **tempp, FILE **fp) {
FILE *f = NULL;
isc_result_t result;
char *tempname = NULL;
goto cleanup;
}
- if (format == dns_masterformat_text) {
- result = isc_file_openunique(tempname, &f);
- } else {
- result = isc_file_bopenunique(tempname, &f);
- }
+ result = isc_file_openunique(tempname, &f);
if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, ISC_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTERDUMP, ISC_LOG_ERROR,
file = isc_mem_strdup(mctx, filename);
- result = opentmp(mctx, format, filename, &tempname, &f);
+ result = opentmp(mctx, filename, &tempname, &f);
if (result != ISC_R_SUCCESS) {
goto cleanup_file;
}
char *tempname;
dns_dumpctx_t *dctx = NULL;
- result = opentmp(mctx, format, filename, &tempname, &f);
+ result = opentmp(mctx, filename, &tempname, &f);
if (result != ISC_R_SUCCESS) {
return (result);
}
return (ISC_R_NOTIMPLEMENTED);
#endif /* ifdef HAVE_CHROOT */
}
-
-isc_result_t
-isc_dir_createunique(char *templet) {
- isc_result_t result;
- char *x;
- char *p;
- int i;
- int pid;
-
- REQUIRE(templet != NULL);
-
- /*!
- * \brief mkdtemp is not portable, so this emulates it.
- */
-
- pid = getpid();
-
- /*
- * Replace trailing Xs with the process-id, zero-filled.
- */
- for (x = templet + strlen(templet) - 1; *x == 'X' && x >= templet;
- x--, pid /= 10)
- {
- *x = pid % 10 + '0';
- }
-
- x++; /* Set x to start of ex-Xs. */
-
- do {
- i = mkdir(templet, 0700);
- if (i == 0 || errno != EEXIST) {
- break;
- }
-
- /*
- * The BSD algorithm.
- */
- p = x;
- while (*p != '\0') {
- if (isdigit((unsigned char)*p)) {
- *p = 'a';
- } else if (*p != 'z') {
- ++*p;
- } else {
- /*
- * Reset character and move to next.
- */
- *p++ = 'a';
- continue;
- }
-
- break;
- }
-
- if (*p == '\0') {
- /*
- * Tried all combinations. errno should already
- * be EEXIST, but ensure it is anyway for
- * isc__errno2result().
- */
- errno = EEXIST;
- break;
- }
- } while (1);
-
- if (i == -1) {
- result = isc__errno2result(errno);
- } else {
- result = ISC_R_SUCCESS;
- }
-
- return (result);
-}
return (result);
}
-isc_result_t
-isc_file_bopenunique(char *templet, FILE **fp) {
- int mode = S_IWUSR | S_IRUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
- return (isc_file_openuniquemode(templet, mode, fp));
-}
-
-isc_result_t
-isc_file_bopenuniqueprivate(char *templet, FILE **fp) {
- int mode = S_IWUSR | S_IRUSR;
- return (isc_file_openuniquemode(templet, mode, fp));
-}
-
-isc_result_t
-isc_file_bopenuniquemode(char *templet, int mode, FILE **fp) {
- return (isc_file_openuniquemode(templet, mode, fp));
-}
-
isc_result_t
isc_file_remove(const char *filename) {
int r;
isc_result_t
isc_dir_chroot(const char *dirname);
-isc_result_t
-isc_dir_createunique(char *templet);
-/*!<
- * Use a templet (such as from isc_file_mktemplate()) to create a uniquely
- * named, empty directory. The templet string is modified in place.
- * If result == ISC_R_SUCCESS, it is the name of the directory that was
- * created.
- */
-
ISC_LANG_ENDDECLS
isc_file_openuniqueprivate(char *templet, FILE **fp);
isc_result_t
isc_file_openuniquemode(char *templet, int mode, FILE **fp);
-isc_result_t
-isc_file_bopenunique(char *templet, FILE **fp);
-isc_result_t
-isc_file_bopenuniqueprivate(char *templet, FILE **fp);
-isc_result_t
-isc_file_bopenuniquemode(char *templet, int mode, FILE **fp);
/*!<
* \brief Create and open a file with a unique name based on 'templet'.
- * isc_file_bopen*() open the file in binary mode in Windows.
- * isc_file_open*() open the file in text mode in Windows.
*
* Notes:
*\li 'template' is a reserved work in C++. If you want to complain
isc_file_splitpath(isc_mem_t *mctx, const char *path, char **dirname,
char const **basename);
/*%<
- * Split a path into dirname and basename. If 'path' contains no slash
- * (or, on windows, backslash), then '*dirname' is set to ".".
+ * Split a path into dirname and basename. If 'path' contains no slash,
+ * then '*dirname' is set to ".".
*
* Allocates memory for '*dirname', which can be freed with isc_mem_free().
*
* Set the size of the listen() backlog queue.
*/
-bool
-ns_interfacemgr_islistening(ns_interfacemgr_t *mgr);
-/*%<
- * Return if the manager is listening on any interface. It can be called
- * after a scan or adjust.
- */
-
isc_result_t
ns_interfacemgr_scan(ns_interfacemgr_t *mgr, bool verbose, bool config);
/*%<
* ACL forming the second element in a 2-element top-level
* sortlist statement.
*/
-
-void
-ns_sortlist_byaddrsetup(dns_acl_t *sortlist_acl, dns_aclenv_t *env,
- isc_netaddr_t *client_addr,
- dns_addressorderfunc_t *orderp, void **argp);
-/*%<
- * Find the sortlist statement in 'acl' that applies to 'clientaddr', if any.
- * If a sortlist statement applies, return in '*orderp' a pointer to a function
- * for ranking network addresses based on that sortlist statement, and in
- * '*argp' an argument to pass to said function. If no sortlist statement
- * applies, set '*orderp' and '*argp' to NULL.
- */
return (result);
}
-bool
-ns_interfacemgr_islistening(ns_interfacemgr_t *mgr) {
- REQUIRE(NS_INTERFACEMGR_VALID(mgr));
-
- return (ISC_LIST_EMPTY(mgr->interfaces) ? false : true);
-}
-
void
ns_interfacemgr_setlistenon4(ns_interfacemgr_t *mgr, ns_listenlist_t *value) {
REQUIRE(NS_INTERFACEMGR_VALID(mgr));
return (INT_MAX);
}
-
-void
-ns_sortlist_byaddrsetup(dns_acl_t *sortlist_acl, dns_aclenv_t *env,
- isc_netaddr_t *client_addr,
- dns_addressorderfunc_t *orderp, void **argp) {
- ns_sortlisttype_t sortlisttype;
-
- sortlisttype = ns_sortlist_setup(sortlist_acl, env, client_addr, argp);
-
- switch (sortlisttype) {
- case NS_SORTLISTTYPE_1ELEMENT:
- *orderp = ns_sortlist_addrorder1;
- break;
- case NS_SORTLISTTYPE_2ELEMENT:
- *orderp = ns_sortlist_addrorder2;
- break;
- case NS_SORTLISTTYPE_NONE:
- *orderp = NULL;
- break;
- default:
- UNEXPECTED_ERROR(
- "unexpected return from ns_sortlist_setup(): %d",
- sortlisttype);
- break;
- }
-}