opt.c revision c03bb27f0675a6e60ceea66b451548e8481bc05c
/*
* Copyright (C) 1999, 2000 Internet Software Consortium.
*
* 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.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: opt.c,v 1.4 2000/10/25 04:26:42 marka Exp $ */
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <dns/compress.h>
#include <dns/fixedname.h>
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
#define ADD_STRING(b, s, g) {if (strlen(s) >= \
{ result = ISC_R_NOSPACE; \
goto g; } else \
isc_buffer_putstr(b, s);}
static isc_result_t
{
unsigned int location;
if (result != ISC_R_SUCCESS)
return(result);
location = 0;
/*
* We don't do the test in the while loop, since I want to
* actually keep searching the list for more data until I reach
* the first one I *can't* fit in. This way, I can correctly
* decide between MOREDATA and SUCCESS.
*/
while (1) {
if (isc_buffer_remaininglength(&rdatabuf) == 0) {
return (ISC_R_SUCCESS);
}
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_UNEXPECTEDEND);
return(DNS_R_MOREDATA);
}
}
location++;
}
/* This location can never be reached. */
}
{
}
}
{
unsigned char *base;
unsigned int i;
}
return (ISC_R_NOSPACE);
}
}
}
return (ISC_R_SUCCESS);
}
char store[sizeof("012345678")];
#ifdef DNS_OPT_NEWCODES
#else /* DNS_OPT_NEWCODES */
#endif /* DNS_OPT_NEWCODES */
#ifdef DNS_OPT_NEWCODES
case DNS_OPTCODE_ZONE:
if (result != ISC_R_SUCCESS)
goto zonefail1;
target);
return (result);
case DNS_OPTCODE_VIEW:
return(ISC_R_NOSPACE);
else
return (result);
#endif /* DNS_OPT_NEWCODES */
/*
* This routine is a placekeeper, awaiting assignment of
* OPT attribute values from IANA.
*/
default:
return (result);
}
}
char buf[sizeof("1234567890")];
if ((flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
0x00ff0000 >> 16)));
do {
flags);
if (iresult != ISC_R_SUCCESS &&
}
} while (result == DNS_R_MOREDATA);
fail:
return (result);
}