mirror of
https://github.com/bettercap/bettercap
synced 2025-07-16 10:03:39 -07:00
refact: refactored to use islazy and updated deps
This commit is contained in:
parent
a2b3ee79fb
commit
d070445225
238 changed files with 12662 additions and 1586 deletions
9
vendor/github.com/google/gopacket/parser.go
generated
vendored
9
vendor/github.com/google/gopacket/parser.go
generated
vendored
|
@ -158,6 +158,9 @@ func (l *DecodingLayerParser) DecodeLayers(data []byte, decoded *[]LayerType) (e
|
|||
for len(data) > 0 {
|
||||
decoder, ok := l.decoders[typ]
|
||||
if !ok {
|
||||
if l.IgnoreUnsupported {
|
||||
return nil
|
||||
}
|
||||
return UnsupportedLayerType(typ)
|
||||
} else if err = decoder.DecodeFromBytes(data, l.df); err != nil {
|
||||
return err
|
||||
|
@ -195,4 +198,10 @@ type DecodingLayerParserOptions struct {
|
|||
// callers. IgnorePanic defaults to false, thus if the caller does
|
||||
// nothing decode panics will be returned as errors.
|
||||
IgnorePanic bool
|
||||
// IgnoreUnsupported will stop parsing and return a nil error when it
|
||||
// encounters a layer it doesn't have a parser for, instead of returning an
|
||||
// UnsupportedLayerType error. If this is true, it's up to the caller to make
|
||||
// sure that all expected layers have been parsed (by checking the decoded
|
||||
// slice).
|
||||
IgnoreUnsupported bool
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue