Repository navigation
feat(application): dissect DHCP and BOOTP over UDP ports 67 and 68 (#2959) - #3199
Conversation
Documentation build overview
61 files changed ·
|
|
Decision needed: should BOOTP and DHCPv4 share a base? #3199 groups them under an abstract
Recommendation: (A). Separately, needs changes. A DHCP message cut short by snaplen, such as a DISCOVER truncated at 244–260 bytes, classifies as BOOTP even though option 53 is present. The fix is to classify by the first complete option 53 and parse the incomplete tail raw. The page's mermaid chart and table also still show version-less octets as refused. Repeated options concatenated per RFC 3396 are filed as #3200, in 1.10.0's Batch 2. |
f491e31 to
91e21fe
Compare
|
Good to go at
|
|
Coverage: 94.88% (unit tier, Python 3.15,
Per-file detail: the |
|
take recommendations |
|
Reconciled: you've taken the recommendation, (A). BOOTP and DHCPv4 keep their shared |
…2959) - pcapkit.protocols.application.dhcp: DHCP, the dispatching base of BOOTP (RFC 951, 1542) and DHCPv4 (RFC 2131), which share its header schema and option data models; UDP ports 67 and 68 bind it, and it picks DHCPv4 where the options carry the DHCP Message Type option whole before any option runs past its field. Fields through the base are refused; each member builds itself. An option a capture cut leaves is kept raw and the cut recorded. - Options decode through DHCP.__option__ (register_dhcp_option): RFC 2132's, User Class, Client FQDN, Relay Agent Information, the PXE options, Domain Search, Classless Static Route, Vendor-Identifying and others, each as its RFC defines it; BOOTP decodes the vendor extensions alone, DHCPv4 the overloaded sname and file fields, and a repeated code keeps its octets. - pcapkit.const.dhcp and pcapkit.vendor.dhcp: op codes, options, message types and relay agent sub-options, crawled from IANA's BOOTP/DHCP tables. - Export the classes, remove NotImplemented/dhcp.py, document the family, and record the rule it dispatches by on protocol-family-grouping.rst. New modules at 100% statement and branch coverage; tests pass.
91e21fe to
699b85a
Compare
|
Rebased onto
|
Please follow the guide below
Put an
xinto every box [ ] that applies to your pull request (like this: [x])Use the Preview tab to see how your pull request will look
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeDescribed the user-visible change below and left its changelog entry to the maintainer, keeping
docs/source/changelog/andCHANGELOG.mdout of the diff, if the change is user-visible: N/A — centralisedWhat is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseAlso tick if it regenerates constant or registry tables, members keeping their numeric values (the
constlabel)Description of your pull request and other information
Closes #2959.
DHCPis a dispatching base overBOOTP(RFC 951, 1542) andDHCPv4(RFC 2131), which share its schema; UDP 67 and 68 bind it, and it picksDHCPv4where the options carry the DHCP Message Type option whole before any option runs past its field. A base may join protocols where one is the RFC-defined extension of the other on the same format and port (RFC 2131 §1), recorded onprotocol-family-grouping.rst; with no version, fields through the base raise and each member builds itself. An option a capture cut leaves is kept raw as padding and the cut recorded, so the message rebuilds as captured.DHCPv4.id()is('DHCP',), as ICMPv4's is('ICMP',).DHCP.__option__(register_dhcp_option) decodes RFC 2132's options and User Class, Client FQDN, Relay Agent Information, PXE, Domain Search, Classless Static Route and Vendor-Identifying, each as its RFC defines it; BOOTP decodes RFC 2132 §3–8 alone, DHCPv4 also the overloadedsname/file, and a repeated code keeps its octets (RFC 3396 §7; concatenating them is feat(application): concatenate repeated DHCP options per RFC 3396 #3200). Domain names reusecorekit.schema.domain_name.const/vendordhcp: options, message types and relay agent sub-options crawled from IANA; op codes from aDATAliteral (RFC 951).dhcp*.pcapngchains toEthernet:IPv4:UDP:DHCPand adds UDP 67/68 to the port pin; feat(application): dissect SMTP over TCP ports 25 and 587 (#2960) #3195 (feat(application): dissect SMTP over TCP ports 25 and 587 #2960) adds TCP rows there, so this rebases onto it as release: 1.10.0 scope #2948 rules.Tests:
tests/protocols/application/test_dhcp_unit.pyandtests/vendor/test_vendor_dhcp_2959_unit.pyfail on anorigin/developexport; new modules at 100% statement and branch coverage.tests/protocols/*.py,tests/project,tests/*.py,tests/integrationand the touched directories pass.