tcp

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2018 License: GPL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PacketHandler

func PacketHandler(packet gopacket.Packet)

TCP包处理

func SetSendChannel

func SetSendChannel(channel *pcap.Handle)

Types

type Connection

type Connection struct {

	// 数据包channel
	Channel *chan gopacket.Packet
	// 连接状态
	State State
	// contains filtered or unexported fields
}

TCP Connection

func NewConnection

func NewConnection(channel *chan gopacket.Packet, request gopacket.Packet) *Connection

新建TCP连接

func (*Connection) Rewrite

func (conn *Connection) Rewrite(hs *stream.HttpStream, startSeq uint32)

重发数据

func (*Connection) Update

func (conn *Connection) Update(rawPacket gopacket.Packet)

更新Connect数据

func (*Connection) WriteWindow

func (conn *Connection) WriteWindow(hs *stream.HttpStream, startSeq uint32)

TCP写入数据接口 每次最多发送接收方窗口大小的数据

type State

type State uint8

TCP State

const (
	UNCONNECT   State = 0
	CONNECTED   State = 1
	WAITSYNACK  State = 3
	SENDDATA    State = 4
	RECEIVEDATA State = 5
	WAITACK     State = 6
	SENDFIN     State = 7
	RECEIVEFIN  State = 8
	WAITFINACK  State = 9
)

Jump to

Keyboard shortcuts

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