This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
add UDP, rustify IPv4 #4
Open
bestouff
wants to merge
63
commits into
moosingin3space:master
Choose a base branch
from
bestouff:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
Improvements & fixes from @deniskolodin.
Fix test_tcp_parse
Add arp support
Port from nom 2.2 to nom 3.2 Thanks @kpcyrd !
This bumps the minimum rust version to 1.34.0
Port to 2018 rust
Add ipv6 support
In order to handle potentially tagged traffic, a new struct and function were created: `VlanEthernetFrame` and `parse_vlan_ethernet_frame`. This is to keep the public interface of the `EthernetFrame` struct the same and remove the overhead of parsing for potentially tagged traffic in the common use case where traffic is guaranteed to be untagged.
* Change nom version to 5.1 * Fix compilation error * Rewrite ipv4 in nom 5 fn style * Rework derive feature by removing macro_use obsolete feature & Added From for IPProtocol * Rewrite ipv6 in nom 5 fn style & move some commun code from ipv4 and ipv6 to ip * Fix clippy hint * Rewrite arp in nom 5 fn style * Rewrite ethernet in nom 5 fn style * Rewrite tcp in nom 5 fn style * Rewrite udp in nom 5 fn style * Fix clippy hint * Remove internal utils public function & Remove to_x public function in favor of From implementation * Add Clone & Copy trait when possible See https://doc.rust-lang.org/std/marker/trait.Copy.html#when-should-my-type-be-copy Only TcpHeader is non Copy cause it have a vector option. * Delete derive feature, now it's named serde
The Internet Header Length is expressed in 32bits words; previously we were automagically multiplying IHL by 4 to return a bytes length, but as discussed in issue #14 this was probably a bad idea so now we just return it straight. NB: maybe this should have been a breaking change, if it causes some problem please report, I'll yank this version and publish a sermver change.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Yes I know, I know, I should have done 2 separate pull requests.
The first commit is a small UDP "parser".
The second one uses Rust's
std::net::Ipv4Addr
instead of a custom struct (easier for reusing it).