|
Packit |
5ce601 |
/*
|
|
Packit |
5ce601 |
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
|
Packit |
5ce601 |
*
|
|
Packit |
5ce601 |
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
Packit |
5ce601 |
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
Packit Service |
704ed8 |
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
|
Packit |
5ce601 |
*
|
|
Packit |
5ce601 |
* See the COPYRIGHT file distributed with this work for additional
|
|
Packit |
5ce601 |
* information regarding copyright ownership.
|
|
Packit |
5ce601 |
*/
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
#ifndef RNDC_UTIL_H
|
|
Packit |
5ce601 |
#define RNDC_UTIL_H 1
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
/*! \file */
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
#include <isc/lang.h>
|
|
Packit |
5ce601 |
#include <isc/platform.h>
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
#include <isc/formatcheck.h>
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
#define NS_CONTROL_PORT 953
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
#undef DO
|
|
Packit |
5ce601 |
#define DO(name, function) \
|
|
Packit |
5ce601 |
do { \
|
|
Packit |
5ce601 |
result = function; \
|
|
Packit |
5ce601 |
if (result != ISC_R_SUCCESS) \
|
|
Packit |
5ce601 |
fatal("%s: %s", name, isc_result_totext(result)); \
|
|
Packit |
5ce601 |
else \
|
|
Packit |
5ce601 |
notify("%s", name); \
|
|
Packit |
5ce601 |
} while (0)
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
ISC_LANG_BEGINDECLS
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
void
|
|
Packit |
5ce601 |
notify(const char *fmt, ...) ISC_FORMAT_PRINTF(1, 2);
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
ISC_PLATFORM_NORETURN_PRE void
|
|
Packit |
5ce601 |
fatal(const char *format, ...)
|
|
Packit |
5ce601 |
ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
ISC_LANG_ENDDECLS
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
#endif /* RNDC_UTIL_H */
|