BIND 10 #2148: extendable LabelSequence
BIND 10 Development
do-not-reply at isc.org
Tue Jul 24 07:32:00 UTC 2012
#2148: extendable LabelSequence
-------------------------------------+-------------------------------------
Reporter: jinmei | Owner:
Type: task | UnAssigned
Priority: medium | Status: new
Component: libdns++ | Milestone:
Sensitive: 0 | Sprint-20120731
Sub-Project: DNS | Keywords:
Estimated Difficulty: 0 | Defect Severity: N/A
Total Hours: 0 | Feature Depending on Ticket:
| scalable inmemory
| Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
While working on other tickets, I've come up with an idea of
possible extension mentioned in #2093. It's a two-fold extension
to `LabelSequence`:
- Allow constructing the object with an external buffer:
{{{#!cpp
LabelSequence(const LabelSequence& src, uint8_t
buf[MAX_SERIALIZED_LENGTH]);
// MAX_SERIALIZED_LENGTH is the constant introduced in trac2091a. It
// should have a sufficient space to internally hold the name and
// offset data.
}}}
this constructor makes a "deep copy" of the "src" (LabelSequence),
copying name and offset data to `buf` (name data would start
at buf[0], and offsets would start at buf[Name::MAX_WIRE]).
- Introduce another method "extend" to `LabelSequence`
{{{
void extend(const LabelSequence labels, uint8_t
buf[MAX_SERIALIZED_LENGTH]);
}}}
This works only for `LabelSequence` constructed with the external
buffer. This method checks the condition by comparing the passed
buf and internal pointers, and if it's okay, it appends the data of
`labels` to `buf` and adjusts `last_label_` as long as the total
length allows the extension.
With these extensions, `getAbsoluteLabelSequence` of #2093 will be
easily implemented by starting with the new construct and repeated
calls to `extend`.
--
Ticket URL: <http://bind10.isc.org/ticket/2148>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list