This file contains 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
// So this code looks wrong to me. What the correct way to "switch" on ethertype to get the next layer? | |
let packet = // some bytes from a PCAP file | |
let ether = EthernetPacket::new(&packet).expect("could not parse Ethernet frame"); | |
// I don't know if the next line is valid; what if there's no Vlan layer and it doesn't parse ether.payload()? | |
let vlan = VlanPacket::new(ether.payload()).expect("could not parse Vlan frame"); | |
let payload = if ether.get_ethertype() == ethernet::EtherTypes::Vlan { | |
vlan.payload() | |
} else { | |
ether.payload() |
This file contains 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
BEFORE: | |
PS C:\Users\ipc\tmp\tonic> D:\apps\ghz.exe --insecure --proto .\examples\proto\helloworld\helloworld.proto --call helloworld.Greeter.SayHello -d '{\"name\":\"Joe\"}' -n 100000 --connections=1 localhost:50051 | |
Summary: | |
Count: 100000 | |
Total: 3.89 s | |
Slowest: 13.00 ms | |
Fastest: 0 ns | |
Average: 1.87 ms | |
Requests/sec: 25674.03 |
OlderNewer