Repository navigation
fix(protocols)!: make NTPTimestamp and PMIPv6Timestamp Info classes (#1886) - #1887
Merged
Merged
Conversation
…1886) - Define both as Data models in protocols.data.internet.mh, beside the options that hold them, so from_dict resolves their annotations and rebuilds them; export them as MH_NTPTimestamp and MH_PMIPv6Timestamp - Read the Timestamp option's pair by attribute when rebuilding it, since an Info unpacks to its keys - Add versionchanged on both classes, the module and its docs page, and versionremoved for NTPTimestamp's 1.4.x path - Correct the 1.5.0 changelog's claim that no NamedTuple remains, since TCPSegment is one, and regenerate CHANGELOG.md from it - Point the tests at the new home and register both names as moved BREAKING CHANGE: NTPTimestamp is no longer a tuple, and protocols.internet.mh no longer binds it; the dumpers write both timestamps keyed by field. Closes #1886
Owner
Author
|
Verdict: GOOD TO GO at
Not blocking: the byte-exact round-trip test also passes on |
Contributor
|
Coverage: 90.05% (unit tier, Python 3.15,
Per-file detail: the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please follow the guide below
You will be asked some questions, please read them carefully and answer honestly
Put an
xinto all the boxes [ ] relevant to your pull request (like that [x])Use Preview tab to see how your pull request will actually look like
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the change. Narrow runs only, listed below.Added a changelog entry under
docs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible: N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What 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 elseAs ruled on #1869,
NTPTimestampandPMIPv6TimestampbecomeInfoclasses. Breaking:NTPTimestampshipped as a tuple in every 1.4.x release.pcapkit/protocols/data/internet/mh.pyasDatasubclasses, modelled onhip.Lifetime. That is where every nestedInfoheld by a data model lives. It is also the only placeInfo.from_dictcan rebuild them: frommh.py, the import cycle makesfrom_dict(to_dict())return anOrderedMultiInfo.NTPTimestampgetsversionremovedthere.PMIPv6Timestampwas beta-only, so it gets none..seconds/.fractionstill work. The dumpers now write{"seconds": …, "fraction": …}.versionchanged:: 1.5.0notes this on both classes and onmh.rst.mh.py:8985unpackedpmip_timestamp; it now reads attributes. The tests that usedtuple(...)do the same.NamedTupleremains is corrected, sinceTCPSegmentstays one, andCHANGELOG.mdis regenerated to match.tests/protocols/internet/test_mh_timestamp_info_1886_unit.pycoversInfobehaviour, byte-exact parse→rebuild, field-keyed JSON and plist output, and pickling at every protocol. It fails 18 subtests onmain. Fulltests/project: 1005 passed.Closes #1886