MCPcopy Create free account
hub / github.com/encodeous/nylon / encode

Method encode

polyamide/tun/offload_linux.go:46–52  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

44}
45
46func (v *virtioNetHdr) encode(b []byte) error {
47 if len(b) < virtioNetHdrLen {
48 return io.ErrShortBuffer
49 }
50 copy(b[:virtioNetHdrLen], unsafe.Slice((*byte)(unsafe.Pointer(v)), virtioNetHdrLen))
51 return nil
52}
53
54const (
55 // virtioNetHdrLen is the length in bytes of virtioNetHdr. This matches the

Callers 4

handleGROFunction · 0.95
Test_handleVirtioReadFunction · 0.80

Calls

no outgoing calls

Tested by 1

Test_handleVirtioReadFunction · 0.64