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

Expose the various values in the TcpOption structure for external program access #640

Merged
merged 1 commit into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions pnet_packet/src/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,13 @@ pub mod TcpOptionNumbers {
#[packet]
pub struct TcpOption {
#[construct_with(u8)]
number: TcpOptionNumber,
pub number: TcpOptionNumber,
#[length_fn = "tcp_option_length"]
// The length field is an optional field, using a Vec is a way to implement
// it
length: Vec<u8>,
// The length field is an optional field, using a Vec is a way to implement it.
pub length: Vec<u8>,
#[length_fn = "tcp_option_payload_length"]
#[payload]
data: Vec<u8>,
pub data: Vec<u8>,
}

impl TcpOption {
Expand Down