summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/res_mkquery.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/net/res_mkquery.c')
-rw-r--r--lib/libc/net/res_mkquery.c52
1 files changed, 22 insertions, 30 deletions
diff --git a/lib/libc/net/res_mkquery.c b/lib/libc/net/res_mkquery.c
index 76786db..61d5825e 100644
--- a/lib/libc/net/res_mkquery.c
+++ b/lib/libc/net/res_mkquery.c
@@ -1,9 +1,7 @@
-/*
- * ++Copyright++ 1985, 1993
- * -
+/*-
* Copyright (c) 1985, 1993
- * The Regents of the University of California. All rights reserved.
- *
+ * The Regents of the University of California. All rights reserved.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -14,12 +12,12 @@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -33,14 +31,14 @@
* SUCH DAMAGE.
* -
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
+ *
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies, and that
* the name of Digital Equipment Corporation not be used in advertising or
* publicity pertaining to distribution of the document or software without
* specific, written prior permission.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
@@ -55,7 +53,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id: res_mkquery.c,v 8.3 1995/06/29 09:26:28 vixie Exp $";
+static char rcsid[] = "$Id: res_mkquery.c,v 1.5 1995/08/20 20:02:56 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -63,17 +61,11 @@ static char rcsid[] = "$Id: res_mkquery.c,v 8.3 1995/06/29 09:26:28 vixie Exp $"
#include <arpa/nameser.h>
#include <stdio.h>
-#include <netdb.h>
#include <resolv.h>
-#if defined(BSD) && (BSD >= 199103)
-# include <string.h>
-#else
-# include "../conf/portability.h"
-#endif
+#include <string.h>
+#include <netdb.h>
-#if defined(USE_OPTIONS_H)
-# include <../conf/options.h>
-#endif
+#include "res_config.h"
/*
* Form all types of queries.
@@ -111,7 +103,7 @@ res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
* Initialize header fields.
*/
if ((buf == NULL) || (buflen < HFIXEDSZ))
- return (-1);
+ return(-1);
bzero(buf, HFIXEDSZ);
hp = (HEADER *) buf;
hp->id = htons(++_res.id);
@@ -131,7 +123,7 @@ res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
case QUERY: /*FALLTHROUGH*/
case NS_NOTIFY_OP:
if ((buflen -= QFIXEDSZ) < 0)
- return (-1);
+ return(-1);
if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
return (-1);
cp += n;
@@ -205,13 +197,13 @@ res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
return (-1);
cp += n;
__putshort(type, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
+ cp += INT16SZ;
+ __putshort(class, cp);
+ cp += INT16SZ;
__putlong(0, cp);
cp += INT32SZ;
__putshort(datalen, cp);
- cp += INT16SZ;
+ cp += INT16SZ;
if (datalen) {
bcopy(data, cp, datalen);
cp += datalen;
@@ -228,13 +220,13 @@ res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
return (-1);
cp += n;
__putshort(newrr->r_type, cp);
- cp += INT16SZ;
- __putshort(newrr->r_class, cp);
- cp += INT16SZ;
+ cp += INT16SZ;
+ __putshort(newrr->r_class, cp);
+ cp += INT16SZ;
__putlong(0, cp);
cp += INT32SZ;
__putshort(newrr->r_size, cp);
- cp += INT16SZ;
+ cp += INT16SZ;
if (newrr->r_size) {
bcopy(newrr->r_data, cp, newrr->r_size);
cp += newrr->r_size;
OpenPOWER on IntegriCloud