mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 05:57:52 +00:00
bitstring assertion addition; doc fixes
This commit is contained in:
parent
f63a6079d3
commit
3302ed8d6e
5
CHANGES
5
CHANGES
@ -1,3 +1,8 @@
|
||||
449. [bug] isc_bitstring_copy() only works correctly if the
|
||||
two bitstrings have the same lsb0 value, but this
|
||||
requirement was not documented, nor was there a
|
||||
REQUIRE for it.
|
||||
|
||||
448. [bug] Host output formatting change, to match v8. [RT #255]
|
||||
|
||||
447. [bug] Dig didn't properly retry in TCP mode after
|
||||
|
@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: bitstring.c,v 1.9 2000/09/12 23:27:44 gson Exp $ */
|
||||
/* $Id: bitstring.c,v 1.10 2000/09/13 00:11:29 halley Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@ -89,6 +89,7 @@ isc_bitstring_copy(isc_bitstring_t *source, unsigned int sbitpos,
|
||||
|
||||
REQUIRE(VALID_BITSTRING(source));
|
||||
REQUIRE(VALID_BITSTRING(target));
|
||||
REQUIRE(source->lsb0 == target->lsb0);
|
||||
if (source->lsb0) {
|
||||
REQUIRE(sbitpos <= source->length);
|
||||
sbitpos = PADDED(source->size) - sbitpos;
|
||||
|
@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: bitstring.h,v 1.5 2000/08/01 01:30:00 tale Exp $ */
|
||||
/* $Id: bitstring.h,v 1.6 2000/09/13 00:11:30 halley Exp $ */
|
||||
|
||||
#ifndef ISC_BITSTRING_H
|
||||
#define ISC_BITSTRING_H 1
|
||||
@ -24,6 +24,45 @@
|
||||
***** Module Info
|
||||
*****/
|
||||
|
||||
/*
|
||||
* Bitstring
|
||||
*
|
||||
* A bitstring is a packed array of bits, stored in a contiguous
|
||||
* sequence of octets. The "most significant bit" (msb) of a bitstring
|
||||
* is the high bit of the first octet. The "least significant bit" of a
|
||||
* bitstring is the low bit of the last octet.
|
||||
*
|
||||
* Two bit numbering schemes are supported, "msb0" and "lsb0".
|
||||
*
|
||||
* In the "msb0" scheme, bit number 0 designates the most significant bit,
|
||||
* and any padding bits required to make the bitstring a multiple of 8 bits
|
||||
* long are added to the least significant end of the last octet.
|
||||
*
|
||||
* In the "lsb0" scheme, bit number 0 designates the least significant bit,
|
||||
* and any padding bits required to make the bitstring a multiple of 8 bits
|
||||
* long are added to the most significant end of the first octet.
|
||||
*
|
||||
* E.g., consider the bitstring "11010001111". This bitstring is 11 bits
|
||||
* long and will take two octets. Let "p" denote a pad bit. In the msb0
|
||||
* encoding, it would be
|
||||
*
|
||||
* Octet 0 Octet 1
|
||||
* |
|
||||
* 1 1 0 1 0 0 0 1 | 1 1 1 p p p p p
|
||||
* ^ | ^
|
||||
* | |
|
||||
* bit 0 bit 15
|
||||
*
|
||||
* In the lsb0 encoding, it would be
|
||||
*
|
||||
* Octet 0 Octet 1
|
||||
* |
|
||||
* p p p p p 1 1 0 | 1 0 0 0 1 1 1 1
|
||||
* ^ | ^
|
||||
* | |
|
||||
* bit 15 bit 0
|
||||
*/
|
||||
|
||||
/***
|
||||
*** Imports
|
||||
***/
|
||||
@ -96,7 +135,7 @@ isc_bitstring_copy(isc_bitstring_t *source, unsigned int sbitpos,
|
||||
*
|
||||
* Requires:
|
||||
*
|
||||
* 'source' and target are valid bitstring.
|
||||
* 'source' and target are valid bitstrings with the same lsb0 setting.
|
||||
*
|
||||
* 'sbitpos' + 'n' is less than or equal to the length of 'source'.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user