Skip to content

Arp#1

Closed
kgrubb wants to merge 11 commits into
mainfrom
arp
Closed

Arp#1
kgrubb wants to merge 11 commits into
mainfrom
arp

Conversation

@kgrubb

@kgrubb kgrubb commented Jun 10, 2025

Copy link
Copy Markdown

CHANGES:

  • implement all of arp get/set
  • add tests for each field

@kgrubb kgrubb self-assigned this Jun 10, 2025
Comment thread src/arp.rs
Comment thread src/arp.rs Outdated
Comment thread src/arp.rs
jecsand838 and others added 10 commits July 1, 2025 17:42
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.
@kgrubb kgrubb closed this Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants