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

Method SerializeTo

layers/icmp6msg.go:200–212  ·  view source on GitHub ↗

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions)

Source from the content-addressed store, hash-verified

198// SerializationBuffer, implementing gopacket.SerializableLayer.
199// See the docs for gopacket.SerializableLayer for more info.
200func (i *ICMPv6RouterSolicitation) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
201 if err := i.Options.SerializeTo(b, opts); err != nil {
202 return err
203 }
204
205 buf, err := b.PrependBytes(4)
206 if err != nil {
207 return err
208 }
209
210 copy(buf, lotsOfZeros[:4])
211 return nil
212}
213
214// CanDecode returns the set of layer types that this DecodingLayer can decode.
215func (i *ICMPv6RouterSolicitation) CanDecode() gopacket.LayerClass {

Callers

nothing calls this directly

Calls 2

SerializeToMethod · 0.65
PrependBytesMethod · 0.65

Tested by

no test coverage detected