mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-24 11:29:10 +00:00
Resolve conflicts after import of ISC BIND 8.3.1-REL.
This commit is contained in:
parent
c20aab4123
commit
789fda719a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=90212
File diff suppressed because it is too large
Load Diff
@ -54,7 +54,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)debug.c 5.26 (Berkeley) 3/21/91";
|
||||
static const char rcsid[] = "$Id: debug.c,v 8.17 2000/11/08 06:47:31 marka Exp $";
|
||||
static const char rcsid[] = "$Id: debug.c,v 8.19 2001/09/25 04:50:26 marka Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -115,12 +115,12 @@ Fprint_query(const u_char *msg, const u_char *eom, int printHeader, FILE *file)
|
||||
const u_char *cp;
|
||||
const HEADER *hp;
|
||||
int n;
|
||||
u_int class, type;
|
||||
u_int class, type = 0;
|
||||
|
||||
/*
|
||||
* Print header fields.
|
||||
*/
|
||||
hp = (HEADER *)msg;
|
||||
hp = (const HEADER *)msg;
|
||||
cp = msg + HFIXEDSZ;
|
||||
if (printHeader || (res.options & RES_DEBUG2)) {
|
||||
fprintf(file," HEADER:\n");
|
||||
@ -164,9 +164,9 @@ Fprint_query(const u_char *msg, const u_char *eom, int printHeader, FILE *file)
|
||||
cp = Print_cdname(cp, msg, eom, file);
|
||||
if (cp == NULL)
|
||||
return;
|
||||
type = ns_get16((u_char*)cp);
|
||||
type = ns_get16((const u_char*)cp);
|
||||
cp += INT16SZ;
|
||||
class = ns_get16((u_char*)cp);
|
||||
class = ns_get16((const u_char*)cp);
|
||||
cp += INT16SZ;
|
||||
fprintf(file,", type = %s", p_type(type));
|
||||
fprintf(file,", class = %s\n", p_class(class));
|
||||
@ -219,7 +219,7 @@ Fprint_query(const u_char *msg, const u_char *eom, int printHeader, FILE *file)
|
||||
fprintf(file,"\n------------\n");
|
||||
}
|
||||
|
||||
const u_char *
|
||||
static const u_char *
|
||||
Print_cdname_sub(const u_char *cp, const u_char *msg, const u_char *eom,
|
||||
FILE *file, int format)
|
||||
{
|
||||
@ -325,16 +325,16 @@ Print_rr(const u_char *ocp, const u_char *msg, const u_char *eom, FILE *file) {
|
||||
|
||||
case T_MX:
|
||||
BOUNDS_CHECK(cp, INT16SZ);
|
||||
fprintf(file,"\tpreference = %u",ns_get16((u_char*)cp));
|
||||
fprintf(file,"\tpreference = %u",ns_get16((const u_char*)cp));
|
||||
cp += INT16SZ;
|
||||
fprintf(file,", mail exchanger = ");
|
||||
goto doname;
|
||||
|
||||
case T_NAPTR:
|
||||
BOUNDS_CHECK(cp, 2 * INT16SZ);
|
||||
fprintf(file, "\torder = %u",ns_get16((u_char*)cp));
|
||||
fprintf(file, "\torder = %u",ns_get16((const u_char*)cp));
|
||||
cp += INT16SZ;
|
||||
fprintf(file,", preference = %u\n", ns_get16((u_char*)cp));
|
||||
fprintf(file,", preference = %u\n", ns_get16((const u_char*)cp));
|
||||
cp += INT16SZ;
|
||||
/* Flags */
|
||||
BOUNDS_CHECK(cp, 1);
|
||||
@ -366,11 +366,11 @@ Print_rr(const u_char *ocp, const u_char *msg, const u_char *eom, FILE *file) {
|
||||
|
||||
case T_SRV:
|
||||
BOUNDS_CHECK(cp, 3 * INT16SZ);
|
||||
fprintf(file, "\tpriority = %u",ns_get16((u_char*)cp));
|
||||
fprintf(file, "\tpriority = %u",ns_get16((const u_char*)cp));
|
||||
cp += INT16SZ;
|
||||
fprintf(file,", weight = %u", ns_get16((u_char*)cp));
|
||||
fprintf(file,", weight = %u", ns_get16((const u_char*)cp));
|
||||
cp += INT16SZ;
|
||||
fprintf(file,", port= %u\n", ns_get16((u_char*)cp));
|
||||
fprintf(file,", port= %u\n", ns_get16((const u_char*)cp));
|
||||
cp += INT16SZ;
|
||||
|
||||
fprintf(file,"\thost = ");
|
||||
@ -378,7 +378,7 @@ Print_rr(const u_char *ocp, const u_char *msg, const u_char *eom, FILE *file) {
|
||||
|
||||
case T_PX:
|
||||
BOUNDS_CHECK(cp, INT16SZ);
|
||||
fprintf(file,"\tpreference = %u",ns_get16((u_char*)cp));
|
||||
fprintf(file,"\tpreference = %u",ns_get16((const u_char*)cp));
|
||||
cp += INT16SZ;
|
||||
fprintf(file,", RFC 822 = ");
|
||||
cp = Print_cdname(cp, msg, eom, file);
|
||||
@ -397,14 +397,14 @@ Print_rr(const u_char *ocp, const u_char *msg, const u_char *eom, FILE *file) {
|
||||
|
||||
case T_RT:
|
||||
BOUNDS_CHECK(cp, INT16SZ);
|
||||
fprintf(file,"\tpreference = %u",ns_get16((u_char*)cp));
|
||||
fprintf(file,"\tpreference = %u",ns_get16((const u_char*)cp));
|
||||
cp += INT16SZ;
|
||||
fprintf(file,", router = ");
|
||||
goto doname;
|
||||
|
||||
case T_AFSDB:
|
||||
BOUNDS_CHECK(cp, INT16SZ);
|
||||
fprintf(file,"\tsubtype = %d",ns_get16((u_char*)cp));
|
||||
fprintf(file,"\tsubtype = %d",ns_get16((const u_char*)cp));
|
||||
cp += INT16SZ;
|
||||
fprintf(file,", DCE/AFS server = ");
|
||||
goto doname;
|
||||
@ -471,18 +471,18 @@ Print_rr(const u_char *ocp, const u_char *msg, const u_char *eom, FILE *file) {
|
||||
return (NULL); /* compression error */
|
||||
}
|
||||
BOUNDS_CHECK(cp, 5 * INT32SZ);
|
||||
fprintf(file,"\n\tserial = %lu", ns_get32((u_char*)cp));
|
||||
fprintf(file,"\n\tserial = %lu", ns_get32((const u_char*)cp));
|
||||
cp += INT32SZ;
|
||||
ttl = ns_get32((u_char*)cp);
|
||||
ttl = ns_get32((const u_char*)cp);
|
||||
fprintf(file,"\n\trefresh = %lu (%s)", ttl, p_time(ttl));
|
||||
cp += INT32SZ;
|
||||
ttl = ns_get32((u_char*)cp);
|
||||
ttl = ns_get32((const u_char*)cp);
|
||||
fprintf(file,"\n\tretry = %lu (%s)", ttl, p_time(ttl));
|
||||
cp += INT32SZ;
|
||||
ttl = ns_get32((u_char*)cp);
|
||||
ttl = ns_get32((const u_char*)cp);
|
||||
fprintf(file,"\n\texpire = %lu (%s)", ttl, p_time(ttl));
|
||||
cp += INT32SZ;
|
||||
ttl = ns_get32((u_char*)cp);
|
||||
ttl = ns_get32((const u_char*)cp);
|
||||
fprintf(file,
|
||||
"\n\tminimum ttl = %lu (%s)\n", ttl, p_time(ttl));
|
||||
cp += INT32SZ;
|
||||
|
@ -54,7 +54,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)getinfo.c 5.26 (Berkeley) 3/21/91";
|
||||
static const char rcsid[] = "$Id: getinfo.c,v 8.18 2001/02/27 06:03:40 vixie Exp $";
|
||||
static const char rcsid[] = "$Id: getinfo.c,v 8.20 2001/06/20 12:30:33 marka Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -89,8 +89,6 @@ static const char rcsid[] = "$Id: getinfo.c,v 8.18 2001/02/27 06:03:40 vixie Exp
|
||||
|
||||
#include "res.h"
|
||||
|
||||
extern char *res_skip();
|
||||
|
||||
static char *addr_list[MAXADDRS + 1];
|
||||
|
||||
static char *host_aliases[MAXALIASES];
|
||||
@ -149,7 +147,7 @@ GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer)
|
||||
Boolean isServer;
|
||||
{
|
||||
register HEADER *headerPtr;
|
||||
register u_char *cp;
|
||||
register const u_char *cp;
|
||||
querybuf answer;
|
||||
char **aliasPtr;
|
||||
u_char *eom, *bp;
|
||||
@ -158,7 +156,7 @@ GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer)
|
||||
char *dnamePtr;
|
||||
int type, class;
|
||||
int qdcount, ancount, arcount, nscount, buflen;
|
||||
int origClass;
|
||||
int origClass = 0;
|
||||
int numAliases = 0;
|
||||
int numAddresses = 0;
|
||||
int n, i, j;
|
||||
@ -239,8 +237,8 @@ GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer)
|
||||
|
||||
if (queryType != T_A && !(iquery && queryType == T_PTR)) {
|
||||
while (--ancount >= 0 && cp < eom) {
|
||||
if ((cp = (u_char *)Print_rr(cp,
|
||||
(u_char *)&answer, eom, stdout)) == NULL) {
|
||||
if ((cp = Print_rr(cp, (u_char *)&answer,
|
||||
eom, stdout)) == NULL) {
|
||||
return(ERROR);
|
||||
}
|
||||
}
|
||||
@ -392,7 +390,7 @@ GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer)
|
||||
printf("Authoritative answers can be found from:\n");
|
||||
}
|
||||
|
||||
cp = (u_char *)res_skip((char *) &answer, 2, eom);
|
||||
cp = res_skip((u_char *)&answer, 2, eom);
|
||||
|
||||
numServers = 0;
|
||||
if (queryType != T_A) {
|
||||
@ -400,8 +398,8 @@ GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer)
|
||||
* If we don't need to save the record, just print it.
|
||||
*/
|
||||
while (--nscount >= 0 && cp < eom) {
|
||||
if ((cp = (u_char *)Print_rr(cp,
|
||||
(u_char *) &answer, eom, stdout)) == NULL) {
|
||||
if ((cp = Print_rr(cp, (u_char *) &answer,
|
||||
eom, stdout)) == NULL) {
|
||||
return(ERROR);
|
||||
}
|
||||
}
|
||||
@ -477,15 +475,15 @@ GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer)
|
||||
/*
|
||||
* Additional resource records contain addresses of servers.
|
||||
*/
|
||||
cp = (u_char *)res_skip((char *) &answer, 3, eom);
|
||||
cp = res_skip((u_char*)&answer, 3, eom);
|
||||
|
||||
if (queryType != T_A) {
|
||||
/*
|
||||
* If we don't need to save the record, just print it.
|
||||
*/
|
||||
while (--arcount >= 0 && cp < eom) {
|
||||
if ((cp = (u_char *)Print_rr(cp,
|
||||
(u_char *) &answer, eom, stdout)) == NULL) {
|
||||
if ((cp = Print_rr(cp, (u_char *) &answer,
|
||||
eom, stdout)) == NULL) {
|
||||
return(ERROR);
|
||||
}
|
||||
}
|
||||
@ -593,7 +591,7 @@ GetHostInfoByName(nsAddrPtr, queryClass, queryType, name, hostPtr, isServer)
|
||||
struct in_addr *nsAddrPtr;
|
||||
int queryClass;
|
||||
int queryType;
|
||||
char *name;
|
||||
const char *name;
|
||||
HostInfo *hostPtr;
|
||||
Boolean isServer;
|
||||
{
|
||||
@ -699,13 +697,14 @@ GetHostDomain(nsAddrPtr, queryClass, queryType, name, domain, hostPtr, isServer)
|
||||
struct in_addr *nsAddrPtr;
|
||||
int queryClass;
|
||||
int queryType;
|
||||
char *name, *domain;
|
||||
const char *name;
|
||||
char *domain;
|
||||
HostInfo *hostPtr;
|
||||
Boolean isServer;
|
||||
{
|
||||
querybuf buf;
|
||||
char nbuf[2*MAXDNAME+2];
|
||||
char *longname = nbuf;
|
||||
const char *longname = nbuf;
|
||||
int n;
|
||||
|
||||
if (domain == NULL) {
|
||||
@ -714,7 +713,7 @@ GetHostDomain(nsAddrPtr, queryClass, queryType, name, domain, hostPtr, isServer)
|
||||
* copy without '.' if present.
|
||||
*/
|
||||
n = strlen(name) - 1;
|
||||
if (name[n] == '.' && n < sizeof(nbuf) - 1) {
|
||||
if (name[n] == '.' && n < (int)sizeof(nbuf) - 1) {
|
||||
memcpy(nbuf, name, n);
|
||||
nbuf[n] = '\0';
|
||||
} else
|
||||
|
@ -78,7 +78,7 @@ char copyright[] =
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)main.c 5.42 (Berkeley) 3/3/91";
|
||||
static const char rcsid[] = "$Id: main.c,v 8.16 2000/12/23 08:14:47 vixie Exp $";
|
||||
static const char rcsid[] = "$Id: main.c,v 8.20 2001/06/20 12:40:06 marka Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -169,7 +169,7 @@ int queryClass = C_IN;
|
||||
* Stuff for Interrupt (control-C) signal handler.
|
||||
*/
|
||||
|
||||
extern SIG_FN IntrHandler();
|
||||
extern SIG_FN IntrHandler(int);
|
||||
FILE *filePtr;
|
||||
jmp_buf env;
|
||||
|
||||
@ -177,10 +177,10 @@ jmp_buf env;
|
||||
/*
|
||||
* Browser command for help.
|
||||
*/
|
||||
char *pager;
|
||||
const char *pager;
|
||||
|
||||
static void CvtAddrToPtr();
|
||||
static void ReadRC();
|
||||
static void CvtAddrToPtr(char *name);
|
||||
static void ReadRC(void);
|
||||
|
||||
/*
|
||||
* Forward declarations.
|
||||
@ -189,6 +189,7 @@ static void LocalServer(HostInfo *defaultPtr);
|
||||
static void res_re_init(void);
|
||||
static void res_dnsrch(char *cp);
|
||||
static void Usage(void);
|
||||
static void ShowOptions(void);
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
@ -377,7 +378,7 @@ main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
static void
|
||||
LocalServer(defaultPtr)
|
||||
HostInfo *defaultPtr;
|
||||
{
|
||||
@ -432,10 +433,10 @@ Usage(void) {
|
||||
|
||||
Boolean
|
||||
IsAddr(host, addrPtr)
|
||||
char *host;
|
||||
const char *host;
|
||||
struct in_addr *addrPtr; /* If return TRUE, contains IP address */
|
||||
{
|
||||
register char *cp;
|
||||
register const char *cp;
|
||||
|
||||
if (isdigit(host[0])) {
|
||||
/* Make sure it has only digits and dots. */
|
||||
@ -1024,7 +1025,7 @@ SetOption(option)
|
||||
/*
|
||||
* Fake a reinitialization when the domain is changed.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
res_re_init(void) {
|
||||
register char *cp, **pp;
|
||||
int n;
|
||||
@ -1046,7 +1047,7 @@ res_re_init(void) {
|
||||
|
||||
#define SRCHLIST_SEP '/'
|
||||
|
||||
void
|
||||
static void
|
||||
res_dnsrch(char *cp) {
|
||||
char **pp;
|
||||
int n;
|
||||
@ -1089,8 +1090,8 @@ res_dnsrch(char *cp) {
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
void
|
||||
ShowOptions()
|
||||
static void
|
||||
ShowOptions(void)
|
||||
{
|
||||
register char **cp;
|
||||
|
||||
@ -1140,7 +1141,7 @@ ShowOptions()
|
||||
*/
|
||||
|
||||
void
|
||||
PrintHelp()
|
||||
PrintHelp(void)
|
||||
{
|
||||
char cmd[PATH_MAX];
|
||||
|
||||
@ -1189,7 +1190,7 @@ CvtAddrToPtr(name)
|
||||
*/
|
||||
|
||||
static void
|
||||
ReadRC()
|
||||
ReadRC(void)
|
||||
{
|
||||
register FILE *fp;
|
||||
register char *cp;
|
||||
|
@ -33,6 +33,10 @@
|
||||
#if (!defined(BSD)) || (BSD < 199306)
|
||||
#include <sys/bitypes.h>
|
||||
#endif
|
||||
#include <netinet/in.h>
|
||||
#ifdef __KAME__
|
||||
#define HAS_INET6_STRUCTS
|
||||
#endif
|
||||
#include <sys/time.h>
|
||||
|
||||
/*
|
||||
@ -75,9 +79,97 @@ struct sockaddr_in6 {
|
||||
struct in6_addr sin6_addr; /* IPv6 address */
|
||||
u_int32_t sin6_scope_id; /* set of interfaces for a scope */
|
||||
};
|
||||
|
||||
#ifndef IN6ADDR_ANY_INIT
|
||||
#define IN6ADDR_ANY_INIT {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}
|
||||
#endif
|
||||
#ifndef IN6ADDR_LOOPBACK_INIT
|
||||
#define IN6ADDR_LOOPBACK_INIT {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}}
|
||||
#endif
|
||||
#endif /* HAS_INET6_STRUCTS */
|
||||
|
||||
#if defined(NEED_SOCKADDR_STORAGE) || !defined(HAS_INET6_STRUCTS)
|
||||
#define __SS_MAXSIZE 128
|
||||
#define __SS_ALLIGSIZE (sizeof (long))
|
||||
|
||||
struct sockaddr_storage {
|
||||
#ifdef HAVE_SA_LEN
|
||||
u_int8_t ss_len; /* address length */
|
||||
u_int8_t ss_family; /* address family */
|
||||
char __ss_pad1[__SS_ALLIGSIZE - 2 * sizeof(u_int8_t)];
|
||||
long __ss_align;
|
||||
char __ss_pad2[__SS_MAXSIZE - 2 * __SS_ALLIGSIZE];
|
||||
#else
|
||||
u_int16_t ss_family; /* address family */
|
||||
char __ss_pad1[__SS_ALLIGSIZE - sizeof(u_int16_t)];
|
||||
long __ss_align;
|
||||
char __ss_pad2[__SS_MAXSIZE - 2 * __SS_ALLIGSIZE];
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(HAS_INET6_STRUCTS) || defined(NEED_IN6ADDR_ANY)
|
||||
#define in6addr_any isc_in6addr_any
|
||||
extern const struct in6_addr in6addr_any;
|
||||
#endif
|
||||
|
||||
#ifndef IN6_ARE_ADDR_EQUAL
|
||||
#define IN6_ARE_ADDR_EQUAL(a,b) \
|
||||
(memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0)
|
||||
#endif
|
||||
|
||||
#ifndef IN6_IS_ADDR_UNSPECIFIED
|
||||
#define IN6_IS_ADDR_UNSPECIFIED(a) \
|
||||
IN6_ARE_ADDR_EQUAL(a, &in6addr_any)
|
||||
#endif
|
||||
|
||||
#ifndef IN6_IS_ADDR_SITELOCAL
|
||||
#define IN6_IS_ADDR_SITELOCAL(a) \
|
||||
(((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
|
||||
#endif
|
||||
|
||||
#ifndef IN6_IS_ADDR_MULTICAST
|
||||
#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff)
|
||||
#endif
|
||||
|
||||
#ifndef __IPV6_ADDR_MC_SCOPE
|
||||
#define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
|
||||
#endif
|
||||
|
||||
#ifndef __IPV6_ADDR_SCOPE_SITELOCAL
|
||||
#define __IPV6_ADDR_SCOPE_SITELOCAL 0x05
|
||||
#endif
|
||||
|
||||
#ifndef __IPV6_ADDR_SCOPE_ORGLOCAL
|
||||
#define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08
|
||||
#endif
|
||||
|
||||
#ifndef IN6_IS_ADDR_MC_SITELOCAL
|
||||
#define IN6_IS_ADDR_MC_SITELOCAL(a) \
|
||||
(IN6_IS_ADDR_MULTICAST(a) && \
|
||||
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL))
|
||||
#endif
|
||||
|
||||
#ifndef IN6_IS_ADDR_MC_ORGLOCAL
|
||||
#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
|
||||
(IN6_IS_ADDR_MULTICAST(a) && \
|
||||
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL))
|
||||
#endif
|
||||
|
||||
#ifndef INET6_ADDRSTRLEN
|
||||
#define INET6_ADDRSTRLEN 46
|
||||
#endif
|
||||
|
||||
#ifndef ISC_FACILITY
|
||||
#define ISC_FACILITY LOG_DAEMON
|
||||
#endif
|
||||
|
||||
#define UNUSED(x) (x) = (x)
|
||||
#define DE_CONST(konst, var) \
|
||||
do { \
|
||||
union { const void *k; void *v; } _u; \
|
||||
_u.k = konst; \
|
||||
var = _u.v; \
|
||||
} while (0)
|
||||
#endif /* ! PORT_AFTER_H */
|
||||
|
Loading…
Reference in New Issue
Block a user