Documentation
¶
Index ¶
- Constants
- func Accept(fd FdPtr) (FdPtr, Sockaddr, error)
- func Bind(fd FdPtr, addr Sockaddr) error
- func Close(fd FdPtr) error
- func Connect(fd FdPtr, addr Sockaddr) error
- func Csum(data []byte, srcip, dstip []byte) uint16
- func DefaultRawOptions() []byte
- func Listen(fd FdPtr, n int) error
- func PortReuse(fd FdPtr) error
- func PortReuseControl(network string, address string, c syscall.RawConn) error
- func RawSockSendTcpMessage(fd *FdPtr, b []byte, network, raddr, laddr string, fn func(th *TCPHeader)) (err error)
- func RawSockSendTcpSYNMessage(fd *FdPtr, b []byte, network, raddr, laddr string) (err error)
- func RawSockSendTo(fd *FdPtr, b []byte, network, raddr string) (err error)
- func Read(fd FdPtr, b []byte) (n int, err error)
- func Send(fd FdPtr, b []byte) error
- func SendTo(fd FdPtr, b []byte, raddr Sockaddr) error
- func Write(fd FdPtr, b []byte) (n int, err error)
- type FdPtr
- type Sockaddr
- type TCPHeader
- type TCPOption
Constants ¶
View Source
const ( FIN = 1 // 00 0001 SYN = 2 // 00 0010 RST = 4 // 00 0100 PSH = 8 // 00 1000 ACK = 16 // 01 0000 URG = 32 // 10 0000 )
Variables ¶
This section is empty.
Functions ¶
func DefaultRawOptions ¶
func DefaultRawOptions() []byte
func PortReuseControl ¶
func RawSockSendTcpMessage ¶
Types ¶
type Sockaddr ¶
func RawSockRecvFrom ¶
type TCPHeader ¶
type TCPHeader struct { SrcIp net.IP DstIp net.IP Source uint16 Destination uint16 SeqNum uint32 AckNum uint32 DataOffset uint8 // 4 bits Reserved uint8 // 3 bits ECN uint8 // 3 bits Ctrl uint8 // 6 bits Window uint16 Checksum uint16 // Kernel will set this if it's 0 Urgent uint16 Options []TCPOption RawOptions []byte }
func ParseTCPHeader ¶
func (*TCPHeader) HeaderSize ¶
Click to show internal directories.
Click to hide internal directories.