IPv6, ARP, Project file structure changes #2
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.
Hey there @O-Luhishi , nice to meet you!
I've been tweaking your library since october for a Computer Networks II class for my Computer Science degree on Universidade de Caxias do Sul - Brazil (figured it'd be cool to share it, as I just discovered that they do have an english translated page LOL).
I have added the IPv6 packet recognition and all the protocols guided by the Next Header field in such packets (Hop-by-Hop, destination options, routing...). RFC references were added throughout the code as well, to justify my choices of implementation.
The only one that I did not touch was the Encapsulating Security Payload, due to its complexity [1] and my semester time constraints.
A simple ARP recognition/outputting was added as well, since it was mainly only adding the correct number returned on the eth_proto variable, from the eternet_frame breakdown.
I also tried my best to separate the structure of the project in a more semantic and responsibility oriented way, leaving ipv4/ipv6 in their own files, as well as the shared protocols/formatting options, leaving the main file mostly for iterating over the sniffed packets.
I do reckon that the main Packet-Sniffer.py file could use another revamp, since I did not remove all the outputting options from it, which could be inserted in a file of its own (maybe? I'm spitballing ideas for future contributors here :) )
Readme.md was also touched up to reflect the current state of the project.
The changes were tested only on a linux (Ubuntu 18.04.4 LTS) machine. :)
I see that there was a recent merge on your repository that adds up IPv6, however, I do think the structure I present here better leverages of a more responsibility oriented approach when it comes to separating files, making it easier to semantically reference/use them along the code.
Future contributors could also switch up the code to use classes (to actually call it responsibility separated lol instead of a plethora of functions as it is being used now) from what is implemented here. Again, just spitballing ideas.
I'll leave my fork untouched on my repositories for now, but I'd be totally willing to help you out on merging some of the changes from your repo's last merge, mainly to keep the protocol oriented execution (e.g. python3 Packet-Sniffer.py ICMP) as an additional way to run the lib, that was recently added.
Please feel free to reach out over here or over email ([email protected]) with any questions or considerations you might have, as I'll be accessible over both. Albeit I do check my emails more frequently.
Again, I'd be totally willing to help as needed in pulling together the MR. Otherwise the fork will happily exist on my repos :pp.
Anyway, thank you for your time/attention and for getting this lib together. I did find way easier to work on it and learn along the way compared to others around github/gitlab.
Have a great one ahead of ya o/
[1] https://tools.ietf.org/html/rfc4303