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)
| 365 | // SerializationBuffer, implementing gopacket.SerializableLayer. |
| 366 | // See the docs for gopacket.SerializableLayer for more info. |
| 367 | func (i *ICMPv6NeighborAdvertisement) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { |
| 368 | if err := i.Options.SerializeTo(b, opts); err != nil { |
| 369 | return err |
| 370 | } |
| 371 | |
| 372 | buf, err := b.PrependBytes(20) |
| 373 | if err != nil { |
| 374 | return err |
| 375 | } |
| 376 | |
| 377 | buf[0] = byte(i.Flags) |
| 378 | copy(buf[1:], lotsOfZeros[:3]) |
| 379 | copy(buf[4:], i.TargetAddress) |
| 380 | return nil |
| 381 | } |
| 382 | |
| 383 | // CanDecode returns the set of layer types that this DecodingLayer can decode. |
| 384 | func (i *ICMPv6NeighborAdvertisement) CanDecode() gopacket.LayerClass { |
nothing calls this directly
no test coverage detected