|
|
# libknot refactoring
|
|
|
|
|
|
## RRSet refactoring
|
|
|
|
|
|
* ~~Add a possibility to use custom allocators :hourglass:~~
|
|
|
* ~~Rewrite unittests~~
|
|
|
* ~~Refactor functions~~
|
|
|
* ~~The `free` functions need a bit of work (i.e. get rid of the 1,0 parameters)~~
|
|
|
* Remove, in this order:
|
|
|
* ~~`rrset->rrsigs` - This bloats the code big time, and is a source of endless stream of bugs. Hopefully, performance drop will be negligible. Amount of work to do this: a lot.~~
|
|
|
* ~~Do not store `rrset->owner` in `knot_rrset_t` structure, or create a new structure `knot_node_rr_t` without the `owner` field.~~
|
|
|
* ~~I'd like to see `node = (owner, meta, rdataset_t)` and `rrset = (owner, rdataset_t)` we can use rrsets when we parse packets and then take only the `rdataset_t` part if you want to keep libknot tidy by using `rrset_t` as it is now. @mvavrusa~~
|
|
|
* ~~Get rid of RDATA helper fields, store RDATA indices into `rrset->rdata` field,~~ end with '\0' - this gets rid of `rrset->rdata_count`, since we usually (but not always, e.g. when deleting particular RR) want to access all RRs in RRSet.
|
|
|
* ~~move `rrset-dump.c` from `libknot` to `knot` - it is used only by the server @jkadlec : I think this is a neat functionality to have in the library, if nothing else, our future resolver will use it (if we're talking about actual text dump, if we're talking about a debug function, that one can be deleted without looking back twice)~~ rrset-dump is used in knot utils!
|
|
|
* ~~Move `rrset->additionals` out of libknot (be it node or the refactored structure)~~ The field is still there, but the actual information is stored elsewhere, the field is only used for passing the information. Should still drop if we want clean libknot.
|
|
|
|
|
|
## Node refactoring
|
|
|
|
|
|
* Add a possibility to use custom allocators
|
|
|
* ~~Rewrite unittests~~
|
|
|
* ~~Remove:~~
|
|
|
* ~~`node->wildcard_child`, store it as a flag.~~
|
|
|
~~@lslovak: I don't really get how this could be stored as a flag. The reference to the wildcard child is used in several places. Or this should be replaced by searching in zone for * ancestor of the node? Then even the flag is not necessary.~~
|
|
|
~~Will drop the reference. The flag will mark a node whose wildcard child exists, thus should be searched for. This reduces the amount of searches to minimum (only in case there actually is a wildcard child). That's reasonable. (see issue #216)~~
|
|
|
* ~~`node->rrset_count` - `node->rrset_tree` will be ended by NULL pointer, iterations will need to change. @lslovak OK, sounds reasonable. It seems that only values which are ever checked are 0, 1 and > 0, and all would be easily checked also after this change.~~ Due to alignment issues this will not reduce memory footprint.
|
|
|
* On the other hand, if the `rrset_tree` is ordered by type and we know the count, we could search it using binary search if that is of any help. @lslovak: IMHO not very useful, there aren't many types of RRSets in each node.
|
|
|
* `node->parent` + `node->children_count` - this is questionable, but it might be possible.
|
|
|
* I wouldn't bother with this so much, you can use refcounting for this purpose and a `refcount > 1 => has children` @lslovak: I don't get it. References may be anywhere in the code, so > 1 doesn't necessarily mean that besides reference from zone tree there is also a reference from child. I don't see an easy way to get rid of these two fields.
|
|
|
|
|
|
## Zone refactoring
|
|
|
|
|
|
* ~~Remove `zone->contents->zone->contents` ...~~ 791d0da8c @jkadlec: :love_letter:
|
|
|
* **Following stuff only valid if we remove zones from libknot:** :white_check_mark:
|
|
|
* ~~`flags` field not needed in zone contents. Some relicts from XFR are stored there,~~ and ~~ANY on/off - can be extracted from config.~~ a067337d0
|
|
|
* Remove `zone->name`, stored in config.
|
|
|
~~Remove `zone->data` and destructor, `zonedata_t` can be a direct part of the structure.~~ !158
|
|
|
* Zone lookup provides too much data and too many functions
|
|
|
* Zone should have _NO_ concept of encloser or previous authoritative, as they are needed only for denial of existence proofs
|
|
|
* Zone should find an exact match or canonical/lexicographical previous node (this is what every answer needs)
|
|
|
* Proof function should look up encloser or previous authoritative, should it be needed (this is what some answers need)
|
|
|
* Merge `zone_t` and `contents_t` - but only after new zone API is done. |
|
|
\ No newline at end of file |