-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/add-ptp-protocol #4640
base: master
Are you sure you want to change the base?
Feature/add-ptp-protocol #4640
Conversation
- Implement PTP header structure based on IEEE 1588-2008 - Implement Sync message type class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
A few comments. It's a good start !
ByteField("logMessageInterval", 0) | ||
] | ||
|
||
def guess_payload_class(self, payload): # type: (bytes) -> Type[Packet] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We typically reserve guess_payloaf
for complex cases. Here a simpler approach with bind_layers
is enough, and it also handles building.
""" | ||
|
||
|
||
class FollowUp(Packet): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the packets really are empty, you don't need to include them. Having an enum in the parent that shows this type is enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's not empty., I have to implement fields in those packets.
@polybassa @gpotter2
Here is the draft PR to add PTP protocol.
Currently this includes basic PTP header and Sync message type.
Planned additions in future commits:
post_build
function to calculate and insert message length field.Let me know if I have followed the correct approach.
fixes #4637