http2

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LayerTypeHTTP2 = gopacket.RegisterLayerType(12345, gopacket.LayerTypeMetadata{Name: "HTTP2", Decoder: gopacket.DecodeFunc(decodeHTTP2)})

Create a layer type, should be unique and high, so it doesn't conflict, giving it a name and a decoder to use.

View Source
var State = &HeadersState{state: map[ipTcpConn]map[string]string{}}

Functions

func Headers

func Headers(h2 HTTP2) map[string]string

Types

type HTTP2

type HTTP2 struct {
	layers.BaseLayer
	// contains filtered or unexported fields
}

Implement my layer

func (*HTTP2) CanDecode

func (h *HTTP2) CanDecode() gopacket.LayerClass

func (*HTTP2) DecodeFromBytes

func (h *HTTP2) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*HTTP2) Frames

func (h *HTTP2) Frames() []http2.Frame

func (HTTP2) LayerType

func (h HTTP2) LayerType() gopacket.LayerType

func (*HTTP2) NextLayerType

func (h *HTTP2) NextLayerType() gopacket.LayerType

func (*HTTP2) Payload

func (h *HTTP2) Payload() []byte

func (HTTP2) String

func (h HTTP2) String() string

type HeadersState

type HeadersState struct {
	// contains filtered or unexported fields
}

func (*HeadersState) Headers

func (s *HeadersState) Headers(srcip string, srctcp uint16, dstip string, dsttcp uint16) map[string]string

func (*HeadersState) SetHeaders

func (s *HeadersState) SetHeaders(srcip string, srctcp uint16, dstip string, dsttcp uint16, key string, value string)

func (*HeadersState) UpdateState

func (s *HeadersState) UpdateState(srcip string, srctcp uint16, dstip string, dsttcp uint16, headers map[string]string)

type InterceptedPacket

type InterceptedPacket struct {
	SrcIP, DstIP   net.IP
	SrcTCP, DstTCP layers.TCPPort
	HTTP2          HTTP2
}

type PacketInterceptor

type PacketInterceptor struct {
	// contains filtered or unexported fields
}

func NewPacketInterceptor

func NewPacketInterceptor(device string, snapshotLen int32, isPromiscuous bool, timeout time.Duration) *PacketInterceptor

func (*PacketInterceptor) Close

func (i *PacketInterceptor) Close()

func (*PacketInterceptor) Packets

func (i *PacketInterceptor) Packets() chan InterceptedPacket

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL