mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -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"
|
"github.com/google/gopacket"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Serialize(layers ...gopacket.SerializableLayer) (error, []byte) {
|
var SerializationOptions = gopacket.SerializeOptions{
|
||||||
// Set up buffer and options for serialization.
|
FixLengths: true,
|
||||||
buf := gopacket.NewSerializeBuffer()
|
ComputeChecksums: true,
|
||||||
opts := 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 err, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, buf.Bytes()
|
return nil, buf.Bytes()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue