capsule-rs / capsule

A framework for network function development. Written in Rust, inspired by NetBricks and built on DPDK.
Apache License 2.0
393 stars 35 forks source link

add support for datalinks other than ethernet #145

Open drunkirishcoder opened 2 years ago

drunkirishcoder commented 2 years ago

Description

Add a trait Datalink that makes it possible to support a different datalink for IP packets. The only other applicable datalink supported by DPDK is InfiniBand through Mellanox NICs. #144

This is a breaking change. Previously it was assumed that IP packets (both v4 and v6) will only be encapsulated inside an Ethernet frame, which is the overwhelming majority of the use case of DPDK. After the change, the struct becomes a generic struct, Ipv4<E: Datalink>.

Type of change

Checklist

codecov[bot] commented 2 years ago

Codecov Report

Merging #145 (b1e9b9d) into master (87ecc82) will increase coverage by 8.04%. The diff coverage is 70.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #145      +/-   ##
==========================================
+ Coverage   68.40%   76.44%   +8.04%     
==========================================
  Files          66       50      -16     
  Lines        5972     5048     -924     
==========================================
- Hits         4085     3859     -226     
+ Misses       1887     1189     -698     
Impacted Files Coverage Δ
core/src/packets/size_of.rs 0.00% <0.00%> (ø)
core/src/testils/criterion.rs 0.00% <ø> (ø)
core/src/testils/proptest/arbitrary.rs 50.00% <ø> (ø)
core/src/runtime/mod.rs 12.32% <12.85%> (+12.32%) :arrow_up:
core/src/testils/packet.rs 55.55% <27.27%> (ø)
core/src/testils/proptest/strategy.rs 81.86% <39.13%> (-0.85%) :arrow_down:
core/src/runtime/pcap_dump.rs 39.75% <39.75%> (ø)
core/src/runtime/lcore.rs 58.00% <58.00%> (ø)
core/src/runtime/port.rs 59.46% <59.46%> (ø)
core/src/packets/icmp/v4/echo_reply.rs 70.66% <71.42%> (-1.49%) :arrow_down:
... and 63 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 87ecc82...b1e9b9d. Read the comment docs.