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

Method SerializeTo

layers/eapol.go:41–47  ·  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

39// SerializeTo writes the serialized form of this layer into the
40// SerializationBuffer, implementing gopacket.SerializableLayer
41func (e *EAPOL) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
42 bytes, _ := b.PrependBytes(4)
43 bytes[0] = e.Version
44 bytes[1] = byte(e.Type)
45 binary.BigEndian.PutUint16(bytes[2:], e.Length)
46 return nil
47}
48
49// CanDecode returns the set of layer types that this DecodingLayer can decode.
50func (e *EAPOL) CanDecode() gopacket.LayerClass {

Callers

nothing calls this directly

Calls 1

PrependBytesMethod · 0.65

Tested by

no test coverage detected