MCPcopy
hub / github.com/google/gopacket / BenchmarkEncodePacketGRE

Function BenchmarkEncodePacketGRE

layers/gre_test.go:122–132  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

120}
121
122func BenchmarkEncodePacketGRE(b *testing.B) {
123 buf := gopacket.NewSerializeBuffer()
124 opts := gopacket.SerializeOptions{
125 ComputeChecksums: true,
126 FixLengths: true,
127 }
128 for i := 0; i < b.N; i++ {
129 gopacket.SerializeLayers(buf, opts, testIPv4OverGRE...)
130 buf.Clear()
131 }
132}
133
134// testPacketEthernetOverGRE is the packet:
135// 11:01:38.124768 IP 192.168.1.1 > 192.168.1.2: GREv0, length 102: IP 172.16.1.1 > 172.16.1.2: ICMP echo request, id 3842, seq 1, length 64

Callers

nothing calls this directly

Calls 3

ClearMethod · 0.95
NewSerializeBufferFunction · 0.92
SerializeLayersFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…