MCPcopy Index your code
hub / github.com/google/gopacket / SerializeTo

Method SerializeTo

layers/loopback.go:64–71  ·  view source on GitHub ↗

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer.

(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions)

Source from the content-addressed store, hash-verified

62// SerializeTo writes the serialized form of this layer into the
63// SerializationBuffer, implementing gopacket.SerializableLayer.
64func (l *Loopback) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
65 bytes, err := b.PrependBytes(4)
66 if err != nil {
67 return err
68 }
69 binary.LittleEndian.PutUint32(bytes, uint32(l.Family))
70 return nil
71}
72
73func decodeLoopback(data []byte, p gopacket.PacketBuilder) error {
74 l := Loopback{}

Callers

nothing calls this directly

Calls 1

PrependBytesMethod · 0.65

Tested by

no test coverage detected