Conversation
svencowart
reviewed
Jun 12, 2025
svencowart
reviewed
Jun 12, 2025
Introduce robust and RFC-compliant structures for Virtual eXtensible Local Area Network (RFC 7348) and headers, significantly improving VXLAN message handling. Key improvements include: * Adding vni_and_reserved2 Attribute * Removed BitfieldUnit * Added implementation method * Added Unit Tests Co-authored-by: Sven Cowart <svencowart@gmail.com>
* **`GeneveHdr` struct**: A `#[repr(C, packed)]` struct is defined to accurately model the Geneve header format, ensuring correct memory layout.
* **Field Accessors**: Provides `get` and `set` methods for all fields of the Geneve header, including:
* `ver` (Version)
* `opt_len` (Option Length)
* `o_flag` (OAM Flag)
* `c_flag` (Critical Options Present Flag)
* `protocol_type` (Encapsulated Protocol Type, handled with network byte order)
* `vni` (Virtual Network Identifier, handled with network byte order and 24-bit masking)
* **Bitfield Handling**: The methods correctly handle bitfield extraction and insertion for `ver`, `opt_len`, `o_flag`, and `c_flag`.
* **Network Byte Order**: `protocol_type` and `vni` conversions correctly handle big-endian (network byte order).
* **Unit Tests**: Comprehensive unit tests are included to verify the correct behavior of all getters, setters, bitfield operations, and byte order conversions.
This addition provides foundational support for parsing and constructing Geneve encapsulated packets within the project.
* Update `actions/checkout` action. * Use `dtolnay/rust-toolchain` action instead of `actions-rs`. * Run rustfmt and clippy. * Add cross targets. Co-authored-by: Michal Rostecki <vadorovsky@disroot.org>
Co-authored-by: Michal Rostecki <vadorovsky@disroot.org>
…d use integer types in getters and setters if the given field is an integer, represented as an array.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CHANGES: