On 03.03.2025 16:08, Stefan Hanreich wrote:
Maybe we should think about internally representing the Network Entity
Title and its parts as bytes rather than strings? So [u8; n]? Since in
practice it's exactly that. I think this would simplify a lot of the
methods here, and obsolete some stuff like e.g. length validation. I've
noted some parts below where I think we could benefit from that.

We could also provide conversion methods for MAC addresses easily then,
although IP addresses might be a bit awkward since they map to network
entity titles as binary-coded decimal and there's no std support for
that so we'd have to brew our own conversions...

Also, theoretically, the Area ID is of variable length, but for our use
case the current additional constraints are fine imo and not worth the
hassle of implementing variable length Area IDs. Might be good to note
this though.

Just to keep the mailing list in the loop: We discussed this offlist a
bit and turns out it's a little bit tricky as some sections (systemid
especially) have a weird length (not a power of two). This makes the
whole handling a bit weird and we're probably not gonna gain any
performance here anyway.

So this is something to maybe revisit later.

The hex-part is still valid though, will fix that for the next version!


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to