Commit graph

212 commits

Author SHA1 Message Date
Andreas Gustafsson
12dd8db40b don't indent comments by one space 2000-06-16 21:45:51 +00:00
David Lawrence
003a40178f make DNS_RDATACOMMON_INIT work again. structure elemnts had the same name as
the downcased macro argument names
2000-06-07 00:11:51 +00:00
David Lawrence
fccbca2cdf style lint; macro parameter names are lowercase 2000-06-06 15:23:26 +00:00
Mark Andrews
ba6f0d85b4 Add macro to initalise the common part of a rdata struct. 2000-06-06 02:03:23 +00:00
David Lawrence
6d12fdf966 Megacommit of many files.
Mostly, several functions that take pointers as arguments, almost
always char * pointers, had those pointers qualified with "const".
Those that returned pointers to previously const-qualified arguments
had their return values qualified as const.  Some structure members
were qualified as const to retain that attribute from the variables
from which they were assigned.

The macro DE_CONST is used to deal with a handful of very special
places where something is qualified as const but really needs to have
its const qualifier removed.

rdata.c now defines macros for the prototypes of the basic rdata functions,
and all of the lib/dns/rdata/**/*.c files now use them.

Some minor integer-compatibility issues.  (IE, ~0x03 is a signed int,
so assigning it to an unsigned int should use a cast.  The type of an
enum member is int, so there are some conversion issues there, too.)

A pointers-to-function should not be cast to a pointer-to-object.

Variables should not be named for C reserved identifiers.

One or two set-but-not-used variables removed.

Minor other ISC style cleanups.
2000-06-01 18:26:56 +00:00
Andreas Gustafsson
fd6de7af32 refer to RFC2845, not draft-ietf-dnsext-tsig-00.txt 2000-06-01 16:47:26 +00:00
Brian Wellington
5d83b561ad Added dns_tsigrcode_totext/fromtext 2000-05-25 00:46:32 +00:00
David Lawrence
ed019cabc1 fixed lines > 79 columns wide 2000-05-24 05:10:00 +00:00
Andreas Gustafsson
1ac4b2a1da when printing a SIG record with covers==0, print it as 0,
not RESERVED0
2000-05-22 21:42:47 +00:00
Mark Andrews
373ce67419 Implement dns_rdata_fromstruct() where not already done.
Add missing REQUIRE tests to existing implementations.
2000-05-22 12:38:12 +00:00
Mark Andrews
389e24909e return ISC_R_SUCCESS from tostruct(). 2000-05-19 13:28:36 +00:00
Mark Andrews
a2b5255212 remove INSIST(ISC_FALSE) from freestruct(). 2000-05-19 13:27:45 +00:00
Mark Andrews
1e2cf7696f tostruct() initalise region from rdata. 2000-05-19 13:05:51 +00:00
Mark Andrews
e7514afccb Convert tostruct() to new API. 2000-05-19 13:04:45 +00:00
Mark Andrews
e6caf43a0b ctype.h is now included in rdata.c 2000-05-19 02:12:56 +00:00
Mark Andrews
251705f683 Lowercase the service string as some getservbyname() are case sensitive
and the database is usually in lowercase.
2000-05-19 02:07:16 +00:00
Mark Andrews
4333126a5c Name structures were not being initialized. 2000-05-19 02:06:00 +00:00
Mark Andrews
1bb227b988 dns_name_dup() -> name_duporclone() in tostruct(). 2000-05-19 02:03:56 +00:00
Mark Andrews
3ef59f5561 Fix bad REQUIRE in tostruct(). 2000-05-19 02:02:11 +00:00
Mark Andrews
2b24b1909f remove REQUIRE(mctx != NULL) from tostruct 2000-05-18 06:27:07 +00:00
Mark Andrews
206c71aae4 handle freestruct(.. mctx = NULL); 2000-05-18 05:46:52 +00:00
Mark Andrews
e7359c3a86 Implement totext(). RFC 2671 does *not* specify a presentation format.
[option length [base64string] ] ...
2000-05-17 03:39:29 +00:00
David Lawrence
34b394b43e DNS_R_RANGE -> ISC_R_RANGE 2000-05-15 21:14:38 +00:00
David Lawrence
71f88e821c Fixed IRIX warnings:
"./rdata/any_255/tsig_250.c", line 74: remark(1506): implicit conversion from
          "unsigned long" to "int":  rounding, sign extension, or loss of
          accuracy may result
"./rdata/any_255/tsig_250.c", line 95: remark(1506): implicit conversion from
          "unsigned long" to "int":  rounding, sign extension, or loss of
          accuracy may result

The values in question were already being checked to be within the range of
a short, so where the warnings were occuring they were just cast to int.
2000-05-13 22:50:49 +00:00
David Lawrence
652c80435a Fixed IRIX warnings:
"./rdata/generic/tkey_249.c", line 89: remark(1506): implicit conversion from
          "unsigned long" to "int":  rounding, sign extension, or loss of
          accuracy may result
"./rdata/generic/tkey_249.c", line 98: remark(1506): implicit conversion from
          "unsigned long" to "int":  rounding, sign extension, or loss of
          accuracy may result

The values in question were already being checked to be within the range of
a short, so where the warnings were occuring they were just cast to int.
2000-05-13 22:46:07 +00:00
David Lawrence
e14969d293 Fixed IRIX warning:
"./rdata/generic/unspec_103.c", line 138: warning(1184): possible use of "="
          where "==" was intended
by changing to ==, which is clearly what was intended.
2000-05-13 22:39:03 +00:00
David Lawrence
17547ed8c9 Fixed IRIX warning:
"./rdata/generic/opt_41.c", line 73: remark(1552): variable "option" was set
          but never used
by removing option, because there was nothing to do with its value.
2000-05-13 22:33:29 +00:00
David Lawrence
7c7d67b5d8 Fixed IRIX warning:
"./rdata/in_1/a6_38.c", line 259: remark(1552): variable "octets" was set but
          never used
by using UNUSED() on this stack variable.  I didn't take it out altogether
because this function is not yet finished, but someone was starting to
do some work on it and I didn't want to undo that.
2000-05-13 22:07:57 +00:00
David Lawrence
873484b40d Fixed IRIX warning:
"./rdata/generic/nxt_30.c", line 66: warning(1042): operand types are
          incompatible ("char *" and "void *")
by casting to char *, as already being done with several other uses of
token.value.as_pointer.
2000-05-13 22:05:39 +00:00
David Lawrence
22520194de Fixed several instances of this IRIX warning:
"./rdata/generic/loc_29.c", line ??: remark(1506): implicit conversion from
          "unsigned long" to "int":  rounding, sign extension, or loss of
          accuracy may result
by making sure that the range was suitable for an int and casting to
int in each case.  (This appeared to be more desirable than changing
all of the variables in question to longs.)
2000-05-13 21:24:37 +00:00
David Lawrence
f1f3bb3aa0 Fixed IRIX warning:
"./rdata/generic/mx_15.c", line 202: warning(1184): possible use of "=" where
          "==" was intended
by changing to == since it was clear that test was desired, not assignment.
2000-05-13 20:52:13 +00:00
David Lawrence
44d74084ff Fixed IRIX warnings:
"./rdata/in_1/a_1.c", line 178: warning(1184): possible use of "=" where "=="
          was intended
"./rdata/in_1/a_1.c", line 179: warning(1184): possible use of "=" where "=="
          was intended

By chaning them to ==, because (a) we don't allow side-effects in REQUIRE()
and (b) it is clear from the rest of the code that it really was a test that
was desired and not an assignment.
2000-05-13 20:50:35 +00:00
Mark Andrews
c661868379 Add missing range checks in fromtext(). 2000-05-12 12:59:35 +00:00
Andreas Gustafsson
fd9f6afdff use the UNUSED() macro 2000-05-11 22:47:00 +00:00
David Lawrence
8abddcd3f2 rdata.c needs to include string.h before memcpy is used.
since rdata.c is including string.h, the individual rdata files do not need to.
2000-05-08 16:12:30 +00:00
David Lawrence
1a69a1a78c Megacommit of dozens of files.
Cleanup of redundant/useless header file inclusion.

ISC style lint, primarily for function declarations and standalone
comments -- ie, those that appear on a line without any code, which
should be written as follows:
   /*
    * This is a comment.
    */
2000-05-08 14:38:29 +00:00
Mark Andrews
5159c42783 153. [func] dns_rdata_tostruct() 'mxtc' is now optional. If 'mctx'
is NULL then you need to preserve the 'rdata' until
                      you have finished using the structure as there may be
                      references to the associated memory.  If 'mctx' is non
                      NULL it is guarenteed that there are no references to
                      to memory addsociated with 'rdata'.

                      dns_rdata_freestruct() must be called if 'mctx' was
                      non NULL and may safely be called if 'mctx' was NULL.

Finish implementing 153 for IN specific types.
naptr_35.h some of the lengths should be 8 bits.
2000-05-05 23:20:10 +00:00
Andreas Gustafsson
5466ce3f27 fromstruct_* functions needlessly used dns_name_towire() to do
a simple name data copy, thereby requiring a non-NULL mctx
2000-05-05 18:15:02 +00:00
Andreas Gustafsson
8d501088b7 tostruct_ns() used the wrong mctx 2000-05-05 17:24:21 +00:00
Mark Andrews
9281e7aa77 Implement / convert to new API for tostuct() and freestruct().
Define dns_rdata_loc_t structure.
x25 length is only 8 bits.
2000-05-05 05:50:14 +00:00
Michael Graff
8e3e48ff56 use isc_uint8_t rather than isc_int8_t for string lengths, and don't call a structure member sa_len 2000-05-04 23:50:56 +00:00
Andreas Gustafsson
94a08e09db Check for edns1 and strict decompression once and for all in
dns_[de]compress_setmethods instead of separately in every caller
2000-05-04 22:19:34 +00:00
Andreas Gustafsson
59a6d9effd omit DNS_RDATATYPEATTR_SINGLETON from RRTYPE_NXT_ATTRIBUTES
so that we can cope with parent/child NXT pairs.  DNSSEC sucks.
2000-05-03 23:52:35 +00:00
David Lawrence
a1f16c81a1 removed unused stack variable "result" from totext_nxt 2000-05-01 18:27:43 +00:00
David Lawrence
4be63b1fd8 144. [cleanup] libdns header files too numerous to name were made
to conform to the same style for multiple inclusion
                        protection.
2000-04-29 02:02:38 +00:00
Andreas Gustafsson
5436ac5553 cope with dns_rdatatype_totext() succeeding for
unknown RR types
2000-04-29 01:51:39 +00:00
David Lawrence
358628c8f4 138. [cleanup] isc_strtouq moved from str.[ch] to string.[ch] and
renamed isc_string_touint64.  isc_strsep moved from
                        strsep.c to string.c and renamed isc_string_separate.
2000-04-28 22:40:10 +00:00
Mark Andrews
b186f1ab91 Add structure definitions so they can be documented.
Support functions to follow soon.
2000-04-28 21:49:03 +00:00
Mark Andrews
b8dd48ecf8 119. [cleanup] structure definitions for generic rdata stuctures do
not have _generic_ in their names.
2000-04-28 02:08:37 +00:00
Andreas Gustafsson
82ca33427b declare arguments as UNUSED() when used in assertions only 2000-04-28 01:24:18 +00:00