peer.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 2000, 2001, 2003-2009, 2012-2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* $Id: peer.c,v 1.33 2009/09/02 23:48:02 tbox Exp $ */
/*! \file */
#include <config.h>
#include <isc/sockaddr.h>
#include <dns/fixedname.h>
/*%
* Bit positions in the dns_peer_t structure flags field
*/
#define BOGUS_BIT 0
#define SERVER_TRANSFER_FORMAT_BIT 1
#define TRANSFERS_BIT 2
#define PROVIDE_IXFR_BIT 3
#define REQUEST_IXFR_BIT 4
#define SUPPORT_EDNS_BIT 5
#define SERVER_UDPSIZE_BIT 6
#define SERVER_MAXUDP_BIT 7
#define REQUEST_NSID_BIT 8
#define SEND_COOKIE_BIT 9
#define NOTIFY_DSCP_BIT 10
#define TRANSFER_DSCP_BIT 11
#define QUERY_DSCP_BIT 12
#define REQUEST_EXPIRE_BIT 13
#define EDNS_VERSION_BIT 14
#define FORCE_TCP_BIT 15
static void
static void
dns_peerlist_t *l;
l = isc_mem_get(mem, sizeof(*l));
if (l == NULL)
return (ISC_R_NOMEMORY);
ISC_LIST_INIT(l->elements);
l->refs = 1;
l->magic = DNS_PEERLIST_MAGIC;
*list = l;
return (ISC_R_SUCCESS);
}
void
}
void
}
static void
dns_peerlist_t *l;
l = *list;
}
l->magic = 0;
isc_mem_put(l->mem, l, sizeof(*l));
}
void
dns_peer_t *p = NULL;
dns_peer_attach(peer, &p);
/*
* More specifics to front of list.
*/
p != NULL;
p = ISC_LIST_NEXT(p, next))
break;
if (p != NULL)
else
}
{
break;
}
res = ISC_R_SUCCESS;
} else {
}
return (res);
}
dns_peer_t *p = NULL;
dns_peer_attach(p, retval);
return (ISC_R_SUCCESS);
}
unsigned int prefixlen = 0;
case AF_INET:
prefixlen = 32;
break;
case AF_INET6:
prefixlen = 128;
break;
default:
INSIST(0);
}
}
{
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
}
void
}
void
dns_peer_t *p;
p = *peer;
p->refs--;
if (p->refs == 0)
peer_delete(&p);
}
static void
dns_peer_t *p;
p = *peer;
p->magic = 0;
}
if (p->query_source != NULL)
if (p->notify_source != NULL)
if (p->transfer_source != NULL)
sizeof(*p->transfer_source));
isc_mem_put(mem, p, sizeof(*p));
}
}
return (ISC_R_SUCCESS);
} else
return (ISC_R_NOTFOUND);
}
}
return (ISC_R_SUCCESS);
} else {
return (ISC_R_NOTFOUND);
}
}
}
return (ISC_R_SUCCESS);
} else
return (ISC_R_NOTFOUND);
}
}
return (ISC_R_SUCCESS);
} else
return (ISC_R_NOTFOUND);
}
}
return (ISC_R_SUCCESS);
} else
return (ISC_R_NOTFOUND);
}
}
return (ISC_R_SUCCESS);
} else
return (ISC_R_NOTFOUND);
}
}
return (ISC_R_SUCCESS);
} else
return (ISC_R_NOTFOUND);
}
}
return (ISC_R_SUCCESS);
} else
return (ISC_R_NOTFOUND);
}
}
return (ISC_R_SUCCESS);
} else {
return (ISC_R_NOTFOUND);
}
}
}
return (ISC_R_SUCCESS);
} else {
return (ISC_R_NOTFOUND);
}
}
}
}
}
}
isc_buffer_t b;
dns_rootname, 0, NULL);
if (result != ISC_R_SUCCESS)
return (result);
return (ISC_R_NOMEMORY);
if (result != ISC_R_SUCCESS) {
return (result);
}
if (result != ISC_R_SUCCESS)
return (result);
}
const isc_sockaddr_t *transfer_source)
{
sizeof(*peer->transfer_source));
}
if (transfer_source != NULL) {
sizeof(*peer->transfer_source));
return (ISC_R_NOMEMORY);
}
return (ISC_R_SUCCESS);
}
return (ISC_R_NOTFOUND);
return (ISC_R_SUCCESS);
}
const isc_sockaddr_t *notify_source)
{
sizeof(*peer->notify_source));
}
if (notify_source != NULL) {
sizeof(*peer->notify_source));
return (ISC_R_NOMEMORY);
}
return (ISC_R_SUCCESS);
}
return (ISC_R_NOTFOUND);
return (ISC_R_SUCCESS);
}
sizeof(*peer->query_source));
}
if (query_source != NULL) {
sizeof(*peer->query_source));
return (ISC_R_NOMEMORY);
}
return (ISC_R_SUCCESS);
}
return (ISC_R_NOTFOUND);
return (ISC_R_SUCCESS);
}
}
return (ISC_R_SUCCESS);
} else {
return (ISC_R_NOTFOUND);
}
}
}
return (ISC_R_SUCCESS);
} else {
return (ISC_R_NOTFOUND);
}
}
return (ISC_R_SUCCESS);
}
return (ISC_R_SUCCESS);
}
return (ISC_R_NOTFOUND);
}
return (ISC_R_SUCCESS);
}
return (ISC_R_SUCCESS);
}
return (ISC_R_NOTFOUND);
}
return (ISC_R_SUCCESS);
}
return (ISC_R_SUCCESS);
}
return (ISC_R_NOTFOUND);
}
return (ISC_R_SUCCESS);
}
return (ISC_R_SUCCESS);
} else
return (ISC_R_NOTFOUND);
}