Documentation ¶
Index ¶
- Constants
- type Header
- func (h Header) ACK() bool
- func (h Header) AckNumber() uint32
- func (h Header) AppendFlags(b *bytes.Buffer)
- func (h Header) CWR() bool
- func (h Header) Checksum() uint16
- func (h Header) DataOffset() int
- func (h Header) DestinationPort() uint16
- func (h Header) ECE() bool
- func (h Header) FIN() bool
- func (h Header) NS() bool
- func (h Header) NoFlags() bool
- func (h Header) OptionBytes() []byte
- func (h Header) PSH() bool
- func (h Header) Payload() []byte
- func (h Header) RST() bool
- func (h Header) SYN() bool
- func (h Header) Sequence() uint32
- func (h Header) SetACK(flag bool)
- func (h Header) SetAckNumber(aq uint32)
- func (h Header) SetCWR(flag bool)
- func (h Header) SetChecksum(ipHdr ip.Header)
- func (h Header) SetDataOffset(offset int)
- func (h Header) SetDestinationPort(port uint16)
- func (h Header) SetECE(flag bool)
- func (h Header) SetFIN(flag bool)
- func (h Header) SetNS(flag bool)
- func (h Header) SetPSH(flag bool)
- func (h Header) SetRST(flag bool)
- func (h Header) SetSYN(flag bool)
- func (h Header) SetSequence(sq uint32)
- func (h Header) SetSourcePort(port uint16)
- func (h Header) SetURG(flag bool)
- func (h Header) SetUrgentPointer(up uint16)
- func (h Header) SetWindowSize(sz uint16)
- func (h Header) SourcePort() uint16
- func (h Header) URG() bool
- func (h Header) UrgentPointer() uint16
- func (h Header) WindowSize() uint16
- type Packet
- type PacketHandler
- type StreamCreator
Constants ¶
View Source
const HeaderLen = 20
HeaderLen is the length of a TCP header that doesn't have any options
View Source
const HeaderMaxLen = 60
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header []byte
Header represents a TCP header. The header is obtained by simply casting the IP header's payload.
func (Header) AppendFlags ¶
AppendFlags appends a comma separated list of all flags that are currently set.
func (Header) DataOffset ¶
func (Header) DestinationPort ¶
func (Header) OptionBytes ¶
func (Header) SetAckNumber ¶
func (Header) SetChecksum ¶
func (Header) SetDataOffset ¶
func (Header) SetDestinationPort ¶
func (Header) SetSequence ¶
func (Header) SetSourcePort ¶
func (Header) SetUrgentPointer ¶
func (Header) SetWindowSize ¶
func (Header) SourcePort ¶
func (Header) UrgentPointer ¶
func (Header) WindowSize ¶
type PacketHandler ¶
type PacketHandler interface { tunnel.Handler // HandlePacket handles a packet that was read from the TUN device HandlePacket(ctx context.Context, pkt Packet) }
func NewHandler ¶
func NewHandler( streamCreator StreamCreator, dispatcherClosing *int32, toTun ip.Writer, id tunnel.ConnID, remove func(), rndSource rand.Source, ) PacketHandler
Click to show internal directories.
Click to hide internal directories.