BIND 10 #1602: Introduce dns::LabelSequence class
BIND 10 Development
do-not-reply at isc.org
Thu Jan 19 01:17:11 UTC 2012
#1602: Introduce dns::LabelSequence class
-------------------------------------+-------------------------------------
Reporter: jinmei | Owner:
Type: task | UnAssigned
Priority: major | Status: new
Component: libdns++ | Milestone: Year
Sensitive: 0 | 3 Task Backlog
Sub-Project: DNS | Keywords:
Estimated Difficulty: 0 | Defect Severity: N/A
Total Hours: 0 | Feature Depending on Ticket: auth
| performance
| Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
This is a subtask for "Replace the name compression logic"
described in
https://lists.isc.org/pipermail/bind10-dev/2012-January/002985.html
(I was a bit incorrect in the email. This one slightly depended on
the "more advanced" LabelSequence class. We could implement this
optimization without it, but I'm afraid it's less efficient).
The `LabelSequence` class is a lightweight accessor to a name object.
It internally maintains wire-format name data and offsets to each
label, and allow the caller to "split" it by simply switching some
internal pointers.
It (for the purpose of this task) offers the following methods:
- equals(other, case_sensitive): check equality with another
`LabelSequence`. can be case sensitive (off by default)
- split(n): if n > 0, strip the first n labels of the sequence. if n
< 0, strip the last n labels of the sequence. The result can be
"non absolute" sequence, i.e, a sequence not terminated by a null
label (this is different from Name)
- getLabelCount(): return the number of labels
- getData(): similar to string::c_str().
We also add a generator from a Name object: Name::toLabelSequence(),
which will create and return a `LabelSequence` corresponding to the
name (so the underlying name object must be retained throughout the
lifetime of the label sequence).
--
Ticket URL: <http://bind10.isc.org/ticket/1602>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list