util.h revision e1d05d323526e7e65df13a6d3dfbec30f6ddb500
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff/*
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff * Copyright (C) 2001 Internet Software Consortium.
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff *
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff * Permission to use, copy, modify, and distribute this software for any
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff * purpose with or without fee is hereby granted, provided that the above
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff * copyright notice and this permission notice appear in all copies.
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff *
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff */
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff/* $Id: util.h,v 1.2 2001/07/01 17:36:47 bwelling Exp $ */
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#ifndef RNDC_UTIL_H
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#define RNDC_UTIL_H 1
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#include <isc/lang.h>
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#include <isc/formatcheck.h>
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#define NS_CONTROL_PORT 953
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff#undef DO
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff#define DO(name, function) \
213973a334f92d4aef4ef62b4538fc2e4d0e8082Michael Graff do { \
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff result = function; \
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff if (result != ISC_R_SUCCESS) \
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff fatal("%s: %s", name, isc_result_totext(result)); \
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff else \
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff notify(name); \
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff } while (0)
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael GraffISC_LANG_BEGINDECLS
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graffvoid
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graffnotify(const char *fmt, ...);
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graffvoid
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Grafffatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael GraffISC_LANG_ENDDECLS
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff#endif /* RNDC_UTIL_H */
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff