mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
e57b94ee5d
commit
f4baac69a5
1 changed files with 7 additions and 9 deletions
|
@ -4,17 +4,15 @@ import (
|
|||
"github.com/google/gopacket"
|
||||
)
|
||||
|
||||
func Serialize(layers ...gopacket.SerializableLayer) (error, []byte) {
|
||||
// Set up buffer and options for serialization.
|
||||
buf := gopacket.NewSerializeBuffer()
|
||||
opts := gopacket.SerializeOptions{
|
||||
FixLengths: true,
|
||||
ComputeChecksums: true,
|
||||
}
|
||||
var SerializationOptions = gopacket.SerializeOptions{
|
||||
FixLengths: true,
|
||||
ComputeChecksums: true,
|
||||
}
|
||||
|
||||
if err := gopacket.SerializeLayers(buf, opts, layers...); err != nil {
|
||||
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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue