TUN-6666: Define packet package

This package defines IP and ICMP packet, decoders, encoder and flow
This commit is contained in:
cthuang
2022-08-17 16:46:49 +01:00
parent 20ed7557f9
commit bad2e8e812
242 changed files with 49761 additions and 2642 deletions

27
vendor/github.com/google/gopacket/layers/stp.go generated vendored Normal file
View File

@@ -0,0 +1,27 @@
// Copyright 2017 Google, Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file in the root of the source
// tree.
package layers
import (
"github.com/google/gopacket"
)
// STP decode spanning tree protocol packets to transport BPDU (bridge protocol data unit) message.
type STP struct {
BaseLayer
}
// LayerType returns gopacket.LayerTypeSTP.
func (s *STP) LayerType() gopacket.LayerType { return LayerTypeSTP }
func decodeSTP(data []byte, p gopacket.PacketBuilder) error {
stp := &STP{}
stp.Contents = data[:]
// TODO: parse the STP protocol into actual subfields.
p.AddLayer(stp)
return nil
}