-
Notifications
You must be signed in to change notification settings - Fork 33
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
IP options and TCP #21
Conversation
Current coverage is 82.10% (diff: 84.46%)@@ master #21 diff @@
==========================================
Files 11 13 +2
Lines 411 531 +120
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 326 436 +110
- Misses 85 95 +10
Partials 0 0
|
Hello @cristiklein, thanks for the PR. Can you add tests and add yourself to the AUTHORS file? |
Hello @kisom . Good point. It even helped me find a few bugs in my original contribution. 😄 |
return packet | ||
|
||
def __len__(self): | ||
return self.udp_header_size + len(self.payload) |
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.
This doesn't seem right. Can you add a test to check the length of the packet?
@kisom Nice catch! BTW, I hope I'm not opening a can of worms, but I tend to dislike the fact that the payload is stored hexlified, which means that it needs to be divided by two for some length computations. I would rather store everything as original bytes and let the application present the data as it sees fit. |
@cristiklein I don't have a strong preference either way; when I first wrote this, the hexlified payload was better for what I was doing (and for debugging). I guess the biggest question now would be whether anyone is relying on the payload being hexlified now. |
I am leaning towards de-hexlification, due to the fact that upper decoding layers need to call There is also the option of a "soft transition". Having a new field, |
That sounds like a good way forward. It should probably go in a separate PR, though. Does that work for you? |
Of course, separate PR. Will open one, once I find some time. 2016-09-08 15:24 GMT+02:00 Kyle Isom notifications@github.com:
|
Okay, thanks. I'll merge this now, then. |
Follow up: this was released as v0.12.0 and is now on PyPI. |
Hi,
I added some infrastructure for parsing IP options, with an example of an IP option that I was interested in. I also added support for decoding TCP/IPv4 packets.
Cheers,
Cristian