Skip to content

Commit

Permalink
Fixing example packet_sculpting
Browse files Browse the repository at this point in the history
Signed-off-by: Abhijit Gadgil <gabhijit@iitbombay.org>
  • Loading branch information
gabhijit committed May 5, 2024
1 parent 3e4f151 commit dd2c984
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/packet_sculpting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ fn main() -> Result<(), Box<dyn Error>> {

let res_string = result[0]
.iter()
.fold(String::new(), |acc, num| format!("{}{:02x}", acc, num))
.trim_end()
.to_string();
.map(|num| format!("{:02x}", num))
.collect::<Vec<_>>()
.join("");

println!("Packet Data: {:#?}", res_string);

Expand Down
6 changes: 6 additions & 0 deletions src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ pub static ENCAP_TYPE_ETH: EncapType = 1;
pub static ENCAP_TYPE_LINUX_SLL: EncapType = 113;

pub static ENCAP_TYPE_LINUX_SLL2: EncapType = 276;

#[cfg(features = "wasm")]
mod wasm_types;

#[cfg(features = "wasm")]
pub use wasm_types::EncapType;

0 comments on commit dd2c984

Please sign in to comment.