summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/lib/dns/rdata.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bind/lib/dns/rdata.c')
-rw-r--r--usr.sbin/bind/lib/dns/rdata.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/usr.sbin/bind/lib/dns/rdata.c b/usr.sbin/bind/lib/dns/rdata.c
index 6715c4f2251..c3b135dd149 100644
--- a/usr.sbin/bind/lib/dns/rdata.c
+++ b/usr.sbin/bind/lib/dns/rdata.c
@@ -15,7 +15,9 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: rdata.c,v 1.147.2.11.2.22 2006/07/21 02:05:56 marka Exp $ */
+/* $ISC: rdata.c,v 1.184.18.9 2006/07/21 02:05:57 marka Exp $ */
+
+/*! \file */
#include <config.h>
#include <ctype.h>
@@ -100,16 +102,16 @@
#define ARGS_CHECKNAMES dns_rdata_t *rdata, dns_name_t *owner, dns_name_t *bad
-/*
+/*%
* Context structure for the totext_ functions.
* Contains formatting options for rdata-to-text
* conversion.
*/
typedef struct dns_rdata_textctx {
- dns_name_t *origin; /* Current origin, or NULL. */
- unsigned int flags; /* DNS_STYLEFLAG_* */
- unsigned int width; /* Width of rdata column. */
- const char *linebreak; /* Line break string. */
+ dns_name_t *origin; /*%< Current origin, or NULL. */
+ unsigned int flags; /*%< DNS_STYLEFLAG_* */
+ unsigned int width; /*%< Width of rdata column. */
+ const char *linebreak; /*%< Line break string. */
} dns_rdata_textctx_t;
static isc_result_t
@@ -195,6 +197,10 @@ static void
warn_badname(dns_name_t *name, isc_lex_t *lexer,
dns_rdatacallbacks_t *callbacks);
+static void
+warn_badmx(isc_token_t *token, isc_lex_t *lexer,
+ dns_rdatacallbacks_t *callbacks);
+
static inline int
getquad(const void *src, struct in_addr *dst,
isc_lex_t *lexer, dns_rdatacallbacks_t *callbacks)
@@ -1580,6 +1586,22 @@ fromtext_warneof(isc_lex_t *lexer, dns_rdatacallbacks_t *callbacks) {
}
static void
+warn_badmx(isc_token_t *token, isc_lex_t *lexer,
+ dns_rdatacallbacks_t *callbacks)
+{
+ const char *file;
+ unsigned long line;
+
+ if (lexer != NULL) {
+ file = isc_lex_getsourcename(lexer);
+ line = isc_lex_getsourceline(lexer);
+ (*callbacks->warn)(callbacks, "%s:%u: warning: '%s': %s",
+ file, line, DNS_AS_STR(*token),
+ dns_result_totext(DNS_R_MXISADDRESS));
+ }
+}
+
+static void
warn_badname(dns_name_t *name, isc_lex_t *lexer,
dns_rdatacallbacks_t *callbacks)
{