ns_updrec *minires_mkupdrec (int, const char *, unsigned int,
unsigned int, unsigned long);
void minires_freeupdrec (ns_updrec *);
-int minires_nmkupdate (res_state, ns_updrec *, unsigned char *, unsigned *);
+int minires_nmkupdate (res_state, ns_updrec *, double *, unsigned *);
ns_rcode minires_nupdate (res_state, ns_updrec *);
int minires_ninit (res_state);
ns_rcode res_findzonecut (res_state, const char *, ns_class, int, char *,
size_t, struct in_addr *, int, int *, void *);
int res_nsend (res_state,
- unsigned char *, unsigned, unsigned char *, unsigned);
-int res_nsendsigned (res_state, unsigned char *,
- unsigned, ns_tsig_key *, unsigned char *, unsigned);
+ double *, unsigned, double *, unsigned);
+int res_nsendsigned (res_state, double *,
+ unsigned, ns_tsig_key *, double *, unsigned);
int ns_samename (const char *, const char *);
int res_nameinquery (const char *, int, int,
const unsigned char *, const unsigned char *);
const u_char *, char *, size_t);
int res_nmkquery (res_state, int,
const char *, ns_class, ns_type, const unsigned char *,
- unsigned, const unsigned char *, unsigned char *, unsigned);
+ unsigned, const unsigned char *, double *, unsigned);
int ns_initparse (const unsigned char *, unsigned, ns_msg *);
int res_nquery(res_state, const char *,
- ns_class, ns_type, unsigned char *, unsigned anslen);
+ ns_class, ns_type, double *, unsigned anslen);
int res_nsearch(res_state, const char *,
- ns_class, ns_type, unsigned char *, unsigned);
+ ns_class, ns_type, double *, unsigned);
const char *res_hostalias (const res_state, const char *, char *, size_t);
int res_nquerydomain(res_state, const char *, const char *,
- ns_class class, ns_type type, unsigned char *, unsigned);
+ ns_class class, ns_type type, double *, unsigned);
int ns_skiprr(const unsigned char *, const unsigned char *, ns_sect, int);
int dn_skipname (const unsigned char *, const unsigned char *);
/*
* @(#)resolv.h 8.1 (Berkeley) 6/2/93
- * $Id: resolv.h,v 1.2 2000/02/02 07:37:17 mellon Exp $
+ * $Id: resolv.h,v 1.3 2000/07/17 20:54:12 mellon Exp $
*/
#ifndef _RESOLV_H_
res_sendhookact;
typedef res_sendhookact (*res_send_qhook) (struct sockaddr_in * const *ns,
- u_char **query,
+ double **query,
unsigned *querylen,
- u_char *ans,
+ double *ans,
unsigned anssiz,
int *resplen);
typedef res_sendhookact (*res_send_rhook) (const struct sockaddr_in *ns,
- u_char *query,
- unsigned querylen,
- u_char *ans,
- unsigned anssiz,
- int *resplen);
+ double *query,
+ unsigned querylen,
+ double *ans,
+ unsigned anssiz,
+ int *resplen);
struct res_sym {
int number; /* Identifying number, like T_MX */
#if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: res_findzonecut.c,v 1.8 2000/07/06 10:10:12 mellon Exp $";
+static const char rcsid[] = "$Id: res_findzonecut.c,v 1.9 2000/07/17 20:51:11 mellon Exp $";
#endif /* not lint */
/*
static void free_nsrr(rrset_ns *, rr_ns *);
static rr_ns * find_ns(rrset_ns *, const char *);
static ns_rcode do_query(res_state, const char *, ns_class, ns_type,
- u_char *, ns_msg *, int *);
+ double *, ns_msg *, int *);
/* Public. */
rrset_ns *nsrrsp)
{
char tname[NS_MAXDNAME];
- u_char resp[NS_PACKETSZ];
+ double resp[NS_PACKETSZ / sizeof (double)];
int n, i, ancount, nscount;
ns_sect sect;
ns_msg msg;
strcpy(zname, t);
rdata = ns_rr_rdata(rr);
rdlen = ns_rr_rdlen(rr);
- if (ns_name_uncompress(resp, ns_msg_end(msg), rdata,
+ if (ns_name_uncompress((u_char *)resp,
+ ns_msg_end(msg), rdata,
mname, msize) < 0) {
DPRINTF(("get_soa: ns_name_uncompress failed"));
return ns_r_servfail;
static int
get_ns(res_state statp, const char *zname, ns_class class, rrset_ns *nsrrsp) {
- u_char resp[NS_PACKETSZ];
+ double resp[NS_PACKETSZ / sizeof (double)];
ns_msg msg;
int n;
ns_rcode rcode;
/* Go and get the A RRs for each empty NS RR on our list. */
for (nsrr = ISC_LIST_HEAD(*nsrrsp); nsrr != NULL; nsrr = nsrr_n) {
- u_char resp[NS_PACKETSZ];
+ double resp[NS_PACKETSZ / sizeof (double)];
ns_msg msg;
int n;
ns_rcode rcode;
static ns_rcode
do_query(res_state statp, const char *dname, ns_class class, ns_type qtype,
- u_char *resp, ns_msg *msg, int *alias_count)
+ double *resp, ns_msg *msg, int *alias_count)
{
- u_char req[NS_PACKETSZ];
+ double req[NS_PACKETSZ / sizeof (double)];
int i;
unsigned n;
errno = EMSGSIZE;
return ns_r_servfail;
}
- if (ns_initparse(resp, n, msg) < 0) {
+ if (ns_initparse((u_char *)resp, n, msg) < 0) {
DPRINTF(("do_query: ns_initparse failed"));
return ns_r_servfail;
}
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_mkquery.c,v 1.2 2000/02/02 19:59:16 mellon Exp $";
+static const char rcsid[] = "$Id: res_mkquery.c,v 1.3 2000/07/17 20:51:13 mellon Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
const u_char *data, /* resource record data */
unsigned datalen, /* length of data */
const u_char *newrr_in, /* new rr for modify or append */
- u_char *buf, /* buffer to put query */
+ double *buf, /* buffer to put query */
unsigned buflen) /* size of buffer */
{
register HEADER *hp;
hp->opcode = op;
hp->rd = (statp->options & RES_RECURSE) != 0;
hp->rcode = NOERROR;
- cp = buf + HFIXEDSZ;
+ cp = ((u_char *)buf) + HFIXEDSZ;
buflen -= HFIXEDSZ;
dpp = dnptrs;
- *dpp++ = buf;
+ *dpp++ = (u_char *)buf;
*dpp++ = NULL;
lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0];
/*
default:
return (-1);
}
- return (cp - buf);
+ return (cp - ((u_char *)buf));
}
*/
#if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: res_mkupdate.c,v 1.4 2000/04/06 22:59:25 mellon Exp $";
+static const char rcsid[] = "$Id: res_mkupdate.c,v 1.5 2000/07/17 20:51:14 mellon Exp $";
#endif /* not lint */
#include <sys/types.h>
*/
int
res_nmkupdate(res_state statp,
- ns_updrec *rrecp_in, u_char *buf, unsigned *blp) {
+ ns_updrec *rrecp_in, double *bp, unsigned *blp) {
ns_updrec *rrecp_start = rrecp_in;
HEADER *hp;
u_char *cp, *sp1, *sp2, *startp, *endp;
u_char *dnptrs[20], **dpp, **lastdnptr;
unsigned siglen, keylen, certlen;
unsigned buflen = *blp;
+ u_char *buf = (unsigned char *)bp;
/*
* Initialize header fields.
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_query.c,v 1.2 2000/02/02 19:59:16 mellon Exp $";
+static const char rcsid[] = "$Id: res_query.c,v 1.3 2000/07/17 20:51:16 mellon Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
res_nquery(res_state statp,
const char *name, /* domain name */
ns_class class, ns_type type, /* class and type of query */
- u_char *answer, /* buffer to put answer */
+ double *answer, /* buffer to put answer */
unsigned anslen) /* size of answer buffer */
{
- u_char buf[MAXPACKET];
+ double buf[MAXPACKET / sizeof (double)];
HEADER *hp = (HEADER *) answer;
unsigned n;
res_nsearch(res_state statp,
const char *name, /* domain name */
ns_class class, ns_type type, /* class and type of query */
- u_char *answer, /* buffer to put answer */
+ double *answer, /* buffer to put answer */
unsigned anslen) /* size of answer */
{
const char *cp, * const *domain;
const char *name,
const char *domain,
ns_class class, ns_type type,
- u_char *answer,
+ double *answer,
unsigned anslen)
{
char nbuf[MAXDNAME];
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_send.c,v 1.3 2000/02/03 03:43:50 mellon Exp $";
+static const char rcsid[] = "$Id: res_send.c,v 1.4 2000/07/17 20:51:17 mellon Exp $";
#endif /* LIBC_SCCS and not lint */
/*
int
res_nsend(res_state statp,
- u_char *buf, unsigned buflen, u_char *ans, unsigned anssiz)
+ double *buf, unsigned buflen, double *ans, unsigned anssiz)
{
HEADER *hp = (HEADER *) buf;
HEADER *anhp = (HEADER *) ans;
* Receive length & response
*/
read_len:
- cp = ans;
+ cp = (u_char *)ans;
len = INT16SZ;
while ((n = read(statp->_sock,
(char *)cp, (unsigned)len)) > 0) {
res_nclose(statp);
goto next_ns;
}
- resplen = getUShort (ans);
+ resplen = getUShort ((unsigned char *)ans);
if (resplen > anssiz) {
Dprint(statp->options & RES_DEBUG,
(stdout, ";; response truncated\n")
res_nclose(statp);
goto next_ns;
}
- cp = ans;
+ cp = (u_char *)ans;
while (len != 0 &&
(n = read(statp->_sock,
(char *)cp, (unsigned)len))
}
#endif
if (!(statp->options & RES_INSECURE2) &&
- !res_queriesmatch(buf, buf + buflen,
- ans, ans + anssiz)) {
+ !res_queriesmatch((u_char *)buf,
+ ((u_char *)buf) + buflen,
+ (u_char *)ans,
+ ((u_char *)ans) + anssiz)) {
/*
* response contains wrong query? ignore it.
* XXX - potential security hazard could
/* res_nsendsigned */
int
-res_nsendsigned(res_state statp, u_char *msg, unsigned msglen,
- ns_tsig_key *key, u_char *answer, unsigned anslen)
+res_nsendsigned(res_state statp, double *msg, unsigned msglen,
+ ns_tsig_key *key, double *answer, unsigned anslen)
{
res_state nstatp;
DST_KEY *dstkey;
int usingTCP = 0;
- u_char *newmsg;
+ double *newmsg;
unsigned newmsglen;
unsigned bufsize, siglen;
u_char sig[64];
memcpy(nstatp, statp, sizeof(*statp));
bufsize = msglen + 1024;
- newmsg = (u_char *) malloc(bufsize);
+ newmsg = (double *) malloc(bufsize);
if (newmsg == NULL) {
errno = ENOMEM;
return (-1);
nstatp->nscount = 1;
siglen = sizeof(sig);
- ret = ns_sign(newmsg, &newmsglen, bufsize, NOERROR, dstkey, NULL, 0,
+ ret = ns_sign((u_char *)newmsg, &newmsglen, bufsize,
+ NOERROR, dstkey, NULL, 0,
sig, &siglen, 0);
if (ret < 0) {
free (nstatp);
}
anslen = ret;
- ret = ns_verify(answer, &anslen, dstkey, sig, siglen,
+ ret = ns_verify((u_char *)answer, &anslen, dstkey, sig, siglen,
NULL, NULL, &tsig_time,
(nstatp->options & RES_KEEPTSIG) ? 1 : 0);
if (ret != 0) {
#if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: res_update.c,v 1.7 2000/07/06 06:23:09 mellon Exp $";
+static const char rcsid[] = "$Id: res_update.c,v 1.8 2000/07/17 20:51:19 mellon Exp $";
#endif /* not lint */
/*
ns_rcode
res_nupdate(res_state statp, ns_updrec *rrecp_in) {
ns_updrec *rrecp;
- u_char answer[PACKETSZ], packet[2*PACKETSZ];
+ double answer[PACKETSZ / sizeof (double)];
+ double packet[2*PACKETSZ / sizeof (double)];
struct zonegrp *zptr, tgrp;
int nzones = 0, nscount = 0;
unsigned n;