client.c revision e6729997141e0ed3e8dc80119b4a13948ddbf0d4
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (C) 1999-2001 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Permission to use, copy, modify, and distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * purpose with or without fee is hereby granted, provided that the above
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * copyright notice and this permission notice appear in all copies.
761d135ed686601f36fe3d0d4aaa6bf41287bb0fEvan Hunt * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
761d135ed686601f36fe3d0d4aaa6bf41287bb0fEvan Hunt * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
761d135ed686601f36fe3d0d4aaa6bf41287bb0fEvan Hunt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
761d135ed686601f36fe3d0d4aaa6bf41287bb0fEvan Hunt * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
761d135ed686601f36fe3d0d4aaa6bf41287bb0fEvan Hunt * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
761d135ed686601f36fe3d0d4aaa6bf41287bb0fEvan Hunt * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
/* $Id: client.c,v 1.152 2001/02/22 23:16:59 gson Exp $ */
#include <config.h>
#ifdef DNS_OPT_NEWCODES
#define NS_CLIENT_TRACE
#ifdef NS_CLIENT_TRACE
#define CTRACE(m) ((void)(m))
#define MTRACE(m) ((void)(m))
struct ns_clientmgr {
unsigned int magic;
#define NS_CLIENTSTATE_FREED 0
#ifdef DNS_OPT_NEWCODES
static isc_boolean_t
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_TRUE);
if (! need_another_client) {
int newstate;
static isc_result_t
unsigned char **datap)
unsigned char *data;
goto done;
goto done;
goto done;
done:
return (result);
static isc_result_t
isc_region_t r;
int match;
match > 0)
return (DNS_R_BLACKHOLED);
return (result);
unsigned char *data;
isc_region_t r;
goto done;
goto done;
goto done;
done:
unsigned char *data;
isc_region_t r;
goto done;
goto done;
goto done;
DNS_SECTION_QUESTION, 0);
goto renderend;
goto done;
DNS_SECTION_ANSWER, 0);
goto renderend;
goto done;
goto renderend;
goto done;
goto done;
goto done;
done:
#ifdef DNS_OPT_NEWCODES
static isc_result_t
int i, sizeneeded = 0;
goto fail1;
for (i=0; i<CLIENT_NUMATTRS; i++) {
goto fail2;
goto fail2;
if (sizeneeded == 0) {
goto fail2;
goto fail2;
goto fail2;
return (result);
static inline isc_result_t
return (result);
return (result);
return (result);
#ifdef DNS_OPT_NEWCODES
return (ISC_R_SUCCESS);
#ifdef DNS_OPT_NEWCODES
case DNS_OPTCODE_ZONE:
goto zonefail1;
&zonebuf,
NULL);
case DNS_OPTCODE_VIEW:
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
unsigned int version;
#ifdef DNS_OPT_NEWCODES
goto cleanup;
if (version != 0) {
goto cleanup;
goto cleanup;
int match;
match > 0))
isc_buffer_t b;
isc_region_t *r;
sizeof(classname));
goto cleanup;
goto cleanup;
goto cleanup;
case dns_opcode_query:
case dns_opcode_update:
case dns_opcode_notify:
case dns_opcode_iquery:
static isc_result_t
return (ISC_R_NOMEMORY);
goto cleanup_client;
goto cleanup_task;
goto cleanup_task;
goto cleanup_timer;
goto cleanup_message;
sizeof(isc_socketevent_t));
goto cleanup_sendbuf;
goto cleanup_sendevent;
sizeof(isc_socketevent_t));
goto cleanup_recvbuf;
#ifdef DNS_OPT_NEWCODES
goto cleanup_recvevent;
return (ISC_R_SUCCESS);
return (result);
goto fail;
fail:
goto freeevent;
int match;
match > 0)
goto freeevent;
isc_region_t r;
return (result);
return (ISC_R_SUCCESS);
return (ISC_R_NOMEMORY);
goto cleanup_manager;
return (ISC_R_SUCCESS);
return (result);
if (need_destroy)
REQUIRE(n > 0);
if (tcp) {
return (result);
int match;
if (default_allow)
goto allow;
goto deny;
if (match > 0)
goto allow;
return (ISC_R_SUCCESS);
deny:
return (DNS_R_REFUSED);