Skip to content
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

[net] Add Ethernet lengths and Header/Address types #1014

Draft
wants to merge 1 commit into
base: rust
Choose a base branch
from

Commits on Jun 15, 2023

  1. Add ethernet lengths and types, and header

    This patch adds a module to the `net` module of `kernel` that provides
    constants for ethernet lengths (address length, type length, etc), as
    well as the enumeration of all protocols currently understood by the
    network stack. The latter are represented as 16-bit integers in memory
    to simplify conversion to and from the types read directly from Ethernet
    II frames. This patch also contains a conversion from/to `u16`.
    
    The `ethernet` module also contains a `Header` abstraction that just
    wraps around `struct ethhdr` defined in the UAPI. There is a simple
    builder function implemented as well as getters for src/dst address, and
    protocol number.
    
    Signed-off-by: Amélie Gonzalez <lymkwi@vulpinecitrus.info>
    Lymkwi committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    a131f67 View commit details
    Browse the repository at this point in the history