Files
weave-scope/vendor/github.com/google/gopacket/layers/stp.go
Damien Lespiau 6bb6d4dd5a vendoring: Update gopacket to latest master
We'd like to benefit from the memory reduction from:

  https://github.com/google/gopacket/pull/377

I just ran:

  $ gvt update github.com/google/gopacket

Fixes: https://github.com/weaveworks/scope/issues/2905
2017-10-27 12:32:05 +01:00

28 lines
687 B
Go

// 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
}