Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

19 lines (15 sloc) 411 Bytes
package packets
import (
"github.com/google/gopacket"
)
var SerializationOptions = gopacket.SerializeOptions{
FixLengths: true,
ComputeChecksums: true,
}
func Serialize(layers ...gopacket.SerializableLayer) (error, []byte) {
buf := gopacket.NewSerializeBuffer()
if err := gopacket.SerializeLayers(buf, SerializationOptions, layers...); err != nil {
return err, nil
}
return nil, buf.Bytes()
}
You can’t perform that action at this time.