Documentation ¶
Index ¶
- Constants
- type Address
- func (a *Address) Event() Event
- func (a *Address) Flow() *Flow
- func (a *Address) IPChecksum() bool
- func (a *Address) IPv6() bool
- func (a *Address) Impostor() bool
- func (a *Address) Layer() Layer
- func (a *Address) Length() uint32
- func (a *Address) Loopback() bool
- func (a *Address) Network() *Network
- func (a *Address) Outbound() bool
- func (a *Address) Reflect() *Reflect
- func (a *Address) SetEvent(event Event)
- func (a *Address) SetIPChecksum()
- func (a *Address) SetIPv6()
- func (a *Address) SetImpostor()
- func (a *Address) SetLayer(layer Layer)
- func (a *Address) SetLength(n uint32)
- func (a *Address) SetLoopback()
- func (a *Address) SetOutbound()
- func (a *Address) SetSniffed()
- func (a *Address) SetTCPChecksum()
- func (a *Address) SetUDPChecksum()
- func (a *Address) Sniffed() bool
- func (a *Address) Socket() *Socket
- func (a *Address) TCPChecksum() bool
- func (a *Address) UDPChecksum() bool
- func (a *Address) UnsetIPChecksum()
- func (a *Address) UnsetIPv6()
- func (a *Address) UnsetImpostor()
- func (a *Address) UnsetLoopback()
- func (a *Address) UnsetOutbound()
- func (a *Address) UnsetSniffed()
- func (a *Address) UnsetTCPChecksum()
- func (a *Address) UnsetUDPChecksum()
- type Error
- type Event
- type Flow
- type Handle
- func (h Handle) Close() error
- func (h Handle) GetParam(param Param) (uint64, error)
- func (h Handle) Recv(packet []byte, address *Address) (int, error)
- func (h Handle) RecvEx(_ []byte, _ *Address, _ uint64) (int, error)
- func (h Handle) Send(packet []byte, address *Address) (int, error)
- func (h Handle) SendEx(_ []byte, _ *Address, _ uint64) (int, error)
- func (h Handle) SetParam(param Param, value uint64) error
- func (h Handle) Shutdown(how Shutdown) error
- type Layer
- type Network
- type Param
- type Reflect
- type Shutdown
- type Socket
Constants ¶
View Source
const ( FlagDefault = 0x0000 FlagSniff = 0x0001 FlagDrop = 0x0002 FlagRecvOnly = 0x0004 FlagReadOnly = FlagRecvOnly FlagSendOnly = 0x0008 FlagWriteOnly = FlagSendOnly FlagNoInstall = 0x0010 FlagFragments = 0x0020 )
WinDivert flags.
View Source
const ( PriorityDefault = 0 PriorityHighest = 3000 PriorityLowest = -PriorityHighest QueueLengthDefault = 4096 QueueLengthMin = 32 QueueLengthMax = 16384 QueueTimeDefault = 2000 /* 2s */ QueueTimeMin = 100 /* 100ms */ QueueTimeMax = 16000 /* 16s */ QueueSizeDefault = 4194304 /* 4MB */ QueueSizeMin = 65535 /* 64KB */ QueueSizeMax = 33554432 /* 32MB */ BatchMax = 0xff /* 255 */ MTUMax = 40 + 0xffff )
WinDivert constants.
View Source
const ( ChecksumDefault = 0 NoIPChecksum = 1 NoICMPChecksum = 2 NoICMPV6Checksum = 4 NoTCPChecksum = 8 NoUDPChecksum = 16 )
View Source
const ( ErrInsufficientBuffer = Error(windows.ERROR_INSUFFICIENT_BUFFER) ErrNoData = Error(windows.ERROR_NO_DATA) ErrIOPending = Error(windows.ERROR_IO_PENDING) ErrHostUnreachable = Error(windows.ERROR_HOST_UNREACHABLE) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { Timestamp int64 /* Packet's timestamp. */ Flags uint8 // contains filtered or unexported fields }
func (*Address) IPChecksum ¶
func (*Address) SetIPChecksum ¶
func (a *Address) SetIPChecksum()
func (*Address) SetImpostor ¶
func (a *Address) SetImpostor()
func (*Address) SetLoopback ¶
func (a *Address) SetLoopback()
func (*Address) SetOutbound ¶
func (a *Address) SetOutbound()
func (*Address) SetSniffed ¶
func (a *Address) SetSniffed()
func (*Address) SetTCPChecksum ¶
func (a *Address) SetTCPChecksum()
func (*Address) SetUDPChecksum ¶
func (a *Address) SetUDPChecksum()
func (*Address) TCPChecksum ¶
func (*Address) UDPChecksum ¶
func (*Address) UnsetIPChecksum ¶
func (a *Address) UnsetIPChecksum()
func (*Address) UnsetImpostor ¶
func (a *Address) UnsetImpostor()
func (*Address) UnsetLoopback ¶
func (a *Address) UnsetLoopback()
func (*Address) UnsetOutbound ¶
func (a *Address) UnsetOutbound()
func (*Address) UnsetSniffed ¶
func (a *Address) UnsetSniffed()
func (*Address) UnsetTCPChecksum ¶
func (a *Address) UnsetTCPChecksum()
func (*Address) UnsetUDPChecksum ¶
func (a *Address) UnsetUDPChecksum()
type Event ¶
type Event int
WinDivert events.
const ( EventNetworkPacket Event = iota /* Network packet. */ EventFlowEstablished /* Flow established. */ EventFlowDeleted /* Flow deleted. */ EventSocketBind /* Socket bind. */ EventSocketConnect /* Socket connect. */ EventSocketListen /* Socket listen. */ EventSocketAccept /* Socket accept. */ EventSocketClose /* Socket close. */ EventReflectOpen /* WinDivert handle opened. */ EventReflectClose /* WinDivert handle closed. */ )
type Flow ¶
type Flow struct { EndpointID uint64 /* Endpoint ID. */ ParentEndpointID uint64 /* Parent endpoint ID. */ ProcessID uint32 /* Process ID. */ LocalAddress [16]uint8 /* Local address. */ RemoteAddress [16]uint8 /* Remote address. */ LocalPort uint16 /* Local port. */ RemotePort uint16 /* Remote port. */ Protocol uint8 /* Protocol. */ // contains filtered or unexported fields }
type Reflect ¶
type Socket ¶
type Socket struct { EndpointID uint64 /* Endpoint ID. */ ParentEndpointID uint64 /* Parent endpoint ID. */ ProcessID uint32 /* Process ID. */ LocalAddress [16]uint8 /* Local address. */ RemoteAddress [16]uint8 /* Remote address. */ LocalPort uint16 /* Local port. */ RemotePort uint16 /* Remote port. */ Protocol uint8 /* Protocol. */ // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.