Example #1
0
func putSerializeBuffer(buf gopacket.SerializeBuffer) {
	if buf == nil {
		return
	}

	buf.Clear()
	serializeBufferPool.Put(buf)
}
Example #2
0
func (self Dot11NoFCS) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
	dot11 := append([]byte{}, b.Bytes()...)
	if err := b.Clear(); err != nil {
		return err
	}
	bytes, err := b.AppendBytes(len(dot11) - 4) // remove FCS
	if err != nil {
		return err
	}
	copy(bytes, dot11)
	return nil
}