4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence/*
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (C) 2000, 2001, 2004, 2005, 2007, 2009, 2016 Internet Systems Consortium, Inc. ("ISC")
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence *
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * file, You can obtain one at http://mozilla.org/MPL/2.0/.
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence */
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence
61dd99bfae0ffa8ec193cf48fc86e4fa246a06e2Automatic Updater/* $Id: util.h,v 1.12 2009/09/29 23:48:03 tbox Exp $ */
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence#ifndef RNDC_UTIL_H
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence#define RNDC_UTIL_H 1
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*! \file */
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence#include <isc/lang.h>
debd489a44363870f96f75818e89ec27d3cab736Francis Dupont#include <isc/platform.h>
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence
e1d05d323526e7e65df13a6d3dfbec30f6ddb500Brian Wellington#include <isc/formatcheck.h>
e1d05d323526e7e65df13a6d3dfbec30f6ddb500Brian Wellington
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence#define NS_CONTROL_PORT 953
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence#undef DO
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence#define DO(name, function) \
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence do { \
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence result = function; \
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence if (result != ISC_R_SUCCESS) \
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence fatal("%s: %s", name, isc_result_totext(result)); \
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence else \
a769eca4e3b223866b01dc8f7a4dde8d9e49bab0Mark Andrews notify("%s", name); \
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence } while (0)
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence
4cd765650776027d05fe7fca248478918e02e63bDavid LawrenceISC_LANG_BEGINDECLS
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrencevoid
1744ed40429d4cb9d2397367c117657ac64b16e3Brian Wellingtonnotify(const char *fmt, ...) ISC_FORMAT_PRINTF(1, 2);
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence
61dd99bfae0ffa8ec193cf48fc86e4fa246a06e2Automatic UpdaterISC_PLATFORM_NORETURN_PRE void
debd489a44363870f96f75818e89ec27d3cab736Francis Dupontfatal(const char *format, ...)
debd489a44363870f96f75818e89ec27d3cab736Francis DupontISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence
4cd765650776027d05fe7fca248478918e02e63bDavid LawrenceISC_LANG_ENDDECLS
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence#endif /* RNDC_UTIL_H */