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

Function serialize

layers/ip4_test.go:94–101  ·  view source on GitHub ↗
(ip *IPv4)

Source from the content-addressed store, hash-verified

92}
93
94func serialize(ip *IPv4) ([]byte, error) {
95 buffer := gopacket.NewSerializeBuffer()
96 err := ip.SerializeTo(buffer, gopacket.SerializeOptions{
97 FixLengths: true,
98 ComputeChecksums: true,
99 })
100 return buffer.Bytes(), err
101}
102
103// Test the function checksum
104func TestChecksum(t *testing.T) {

Callers 1

Calls 3

BytesMethod · 0.95
NewSerializeBufferFunction · 0.92
SerializeToMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…