Target: 2.1.0 (Tier 3 — make typing the product)
The 1.3.0 option work landed the hard part — TCP.parsed_options
returns tuple[TCPOption, ...] and TCPOption.value decodes MSS,
window scale, SACK and timestamps into real types. Four places still
stop at a display string or raw bytes:
1. DNS RDATA is a rendered string. DNSResourceRecord.rdata_text
handles A, AAAA, NS/CNAME/PTR, MX, TXT and SOA, then falls back to
rdata.hex() — but it returns str for all of them. An A record
should give an ipaddress.IPv4Address, TXT a list[str], SOA a
structured record. Related: only the first question is exposed
(question_name/question_type/question_class); there is no
questions tuple.
2. DHCP has no option type. DHCP.option_map returns
dict[int, bytes] — the only accessor in the library that returns a
bare dict rather than typed objects. There is no DHCPOption class.
Only option 53 is interpreted, via message_type.
3. IPv4 options are named but not decoded. IPv4Option has
kind_name and no value. Record Route (7), Timestamp (68) and
Router Alert (148) are named, and their contents left raw — unlike
TCPOption, which does decode its values.
4. IPv6Routing.data is entirely unparsed. No segment-list
extraction for RH0, RPL or Mobile IPv6. IPv6Option likewise decodes
no values (Router Alert, Jumbo Payload stay raw).
Note on scope
This is four independent pieces of work sharing one theme. Split into
separate PRs — probably one per numbered item — rather than one large
change. DNS (1) is the highest value; IPv6 Routing (4) the lowest.
Whatever is added must not break bytes(decode(x)) == x: the raw bytes
stay authoritative, and typed values are derived lazily from them, as
parsed_options already does.
Acceptance criteria
Target: 2.1.0 (Tier 3 — make typing the product)
The 1.3.0 option work landed the hard part —
TCP.parsed_optionsreturns
tuple[TCPOption, ...]andTCPOption.valuedecodes MSS,window scale, SACK and timestamps into real types. Four places still
stop at a display string or raw bytes:
1. DNS RDATA is a rendered string.
DNSResourceRecord.rdata_texthandles A, AAAA, NS/CNAME/PTR, MX, TXT and SOA, then falls back to
rdata.hex()— but it returnsstrfor all of them. An A recordshould give an
ipaddress.IPv4Address, TXT alist[str], SOA astructured record. Related: only the first question is exposed
(
question_name/question_type/question_class); there is noquestionstuple.2. DHCP has no option type.
DHCP.option_mapreturnsdict[int, bytes]— the only accessor in the library that returns abare dict rather than typed objects. There is no
DHCPOptionclass.Only option 53 is interpreted, via
message_type.3. IPv4 options are named but not decoded.
IPv4Optionhaskind_nameand novalue. Record Route (7), Timestamp (68) andRouter Alert (148) are named, and their contents left raw — unlike
TCPOption, which does decode its values.4.
IPv6Routing.datais entirely unparsed. No segment-listextraction for RH0, RPL or Mobile IPv6.
IPv6Optionlikewise decodesno values (Router Alert, Jumbo Payload stay raw).
Note on scope
This is four independent pieces of work sharing one theme. Split into
separate PRs — probably one per numbered item — rather than one large
change. DNS (1) is the highest value; IPv6 Routing (4) the lowest.
Whatever is added must not break
bytes(decode(x)) == x: the raw bytesstay authoritative, and typed values are derived lazily from them, as
parsed_optionsalready does.Acceptance criteria
questionstuple.DHCPOptiontype replaces the bare dict, or the dict isdocumented as deliberate.
IPv4Option.valuedecodes the three named kinds.