Documentation
¶
Index ¶
- Constants
- type ChecksumFlag
- type Direction
- type Event
- type Filter
- type Flag
- type Layer
- type Packet
- type Param
- type Priority
- type Shutdown
- type WinDivertAddress
- func (a *WinDivertAddress) Direction() Direction
- func (a *WinDivertAddress) Event() Event
- func (a *WinDivertAddress) Flow() WinDivertDataFlow
- func (a *WinDivertAddress) IPChecksumValid() bool
- func (a *WinDivertAddress) IPv6() bool
- func (a *WinDivertAddress) Impostor() bool
- func (a *WinDivertAddress) Layer() Layer
- func (a *WinDivertAddress) Loopback() bool
- func (a *WinDivertAddress) Network() WinDivertDataNetwork
- func (a *WinDivertAddress) Reflect() WinDivertDataReflect
- func (a *WinDivertAddress) Sniffed() bool
- func (a *WinDivertAddress) Socket() WinDivertDataSocket
- func (a *WinDivertAddress) TCPChecksumValid() bool
- func (a *WinDivertAddress) UDPChecksumValid() bool
- type WinDivertDataFlow
- func (d *WinDivertDataFlow) Endpoint() uint64
- func (d *WinDivertDataFlow) LocalAddr() netip.Addr
- func (d *WinDivertDataFlow) LocalPort() uint16
- func (d *WinDivertDataFlow) ParentEndpoint() uint64
- func (d *WinDivertDataFlow) ProcessId() uint32
- func (d *WinDivertDataFlow) Protocol() uint8
- func (d *WinDivertDataFlow) RemoteAddr() netip.Addr
- func (d *WinDivertDataFlow) RemotePort() uint16
- type WinDivertDataNetwork
- type WinDivertDataReflect
- type WinDivertDataSocket
- func (d *WinDivertDataSocket) Endpoint() uint64
- func (d *WinDivertDataSocket) LocalAddr() netip.Addr
- func (d *WinDivertDataSocket) LocalPort() uint16
- func (d *WinDivertDataSocket) ParentEndpoint() uint64
- func (d *WinDivertDataSocket) ProcessId() uint32
- func (d *WinDivertDataSocket) Protocol() uint8
- func (d *WinDivertDataSocket) RemoteAddr() netip.Addr
- func (d *WinDivertDataSocket) RemotePort() uint16
Constants ¶
const WinDivertBatchMax = 0xFF /* 255 */
const WinDivertMTUMax = 40 + 0xFFFF
const WinDivertParamQueueLengthDefault = 4096
const WinDivertParamQueueLengthMax = 16384
const WinDivertParamQueueLengthMin = 32
const WinDivertParamQueueSizeDefault = 4194304 /* 4MB */
const WinDivertParamQueueSizeMax = 33554432 /* 32MB */
const WinDivertParamQueueSizeMin = 65535 /* 64KB */
const WinDivertParamQueueTimeDefault = 2000 /* 2s */
const WinDivertParamQueueTimeMax = 16000 /* 16s */
const WinDivertParamQueueTimeMin = 100 /* 100ms */
const WinDivertPriorityDefault = Priority(0)
const WinDivertPriorityHighest = Priority(30000)
const WinDivertPriorityLowest = Priority(-WinDivertPriorityHighest)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChecksumFlag ¶
type ChecksumFlag int64
const ( All ChecksumFlag = 0x00 NoIP ChecksumFlag = 0x01 NoICMP ChecksumFlag = 0x02 NoICMPv6 ChecksumFlag = 0x04 NoTCP ChecksumFlag = 0x08 NoUDP ChecksumFlag = 0x10 )
func (ChecksumFlag) String ¶
func (i ChecksumFlag) String() string
type Packet ¶
type Packet struct { Address *WinDivertAddress Length uint Content []byte }
Wrapped packet
type Priority ¶
type Priority int16
Priority of the handles Multiple handles should not have the same priority.
type WinDivertAddress ¶
type WinDivertAddress struct { // A timestamp indicating when event occurred. Timestamp int64 // contains filtered or unexported fields }
WINDIVERT_ADDRESS https://reqrypt.org/windivert-doc.html#divert_address
func (*WinDivertAddress) Direction ¶
func (a *WinDivertAddress) Direction() Direction
Direction returns the direction of the packet
func (*WinDivertAddress) Event ¶
func (a *WinDivertAddress) Event() Event
The captured event (WINDIVERT_EVENT_*).
func (*WinDivertAddress) Flow ¶
func (a *WinDivertAddress) Flow() WinDivertDataFlow
func (*WinDivertAddress) IPChecksumValid ¶
func (a *WinDivertAddress) IPChecksumValid() bool
Set to 1 if the IPv4 checksum is valid, 0 otherwise.
func (*WinDivertAddress) IPv6 ¶
func (a *WinDivertAddress) IPv6() bool
Set to 1 for IPv6 packets/events, 0 otherwise.
func (*WinDivertAddress) Impostor ¶
func (a *WinDivertAddress) Impostor() bool
Set to 1 for impostor packets, 0 otherwise.
func (*WinDivertAddress) Layer ¶
func (a *WinDivertAddress) Layer() Layer
The handle's layer (WINDIVERT_LAYER_*).
func (*WinDivertAddress) Loopback ¶
func (a *WinDivertAddress) Loopback() bool
Set to 1 for loopback packets, 0 otherwise.
func (*WinDivertAddress) Network ¶
func (a *WinDivertAddress) Network() WinDivertDataNetwork
func (*WinDivertAddress) Reflect ¶
func (a *WinDivertAddress) Reflect() WinDivertDataReflect
func (*WinDivertAddress) Sniffed ¶
func (a *WinDivertAddress) Sniffed() bool
Set to 1 if the event was sniffed (i.e., not blocked), 0 otherwise.
func (*WinDivertAddress) Socket ¶
func (a *WinDivertAddress) Socket() WinDivertDataSocket
func (*WinDivertAddress) TCPChecksumValid ¶
func (a *WinDivertAddress) TCPChecksumValid() bool
Set to 1 if the TCP checksum is valid, 0 otherwise.
func (*WinDivertAddress) UDPChecksumValid ¶
func (a *WinDivertAddress) UDPChecksumValid() bool
Set to 1 if the UDP checksum is valid, 0 otherwise.
type WinDivertDataFlow ¶
type WinDivertDataFlow addressInternalUnion
WINDIVERT_DATA_FLOW
func (*WinDivertDataFlow) Endpoint ¶
func (d *WinDivertDataFlow) Endpoint() uint64
The endpoint ID of the flow.
func (*WinDivertDataFlow) LocalAddr ¶
func (d *WinDivertDataFlow) LocalAddr() netip.Addr
func (*WinDivertDataFlow) LocalPort ¶
func (d *WinDivertDataFlow) LocalPort() uint16
func (*WinDivertDataFlow) ParentEndpoint ¶
func (d *WinDivertDataFlow) ParentEndpoint() uint64
The parent endpoint ID of the flow.
func (*WinDivertDataFlow) ProcessId ¶
func (d *WinDivertDataFlow) ProcessId() uint32
The ID of the process associated with the flow.
func (*WinDivertDataFlow) Protocol ¶
func (d *WinDivertDataFlow) Protocol() uint8
func (*WinDivertDataFlow) RemoteAddr ¶
func (d *WinDivertDataFlow) RemoteAddr() netip.Addr
func (*WinDivertDataFlow) RemotePort ¶
func (d *WinDivertDataFlow) RemotePort() uint16
type WinDivertDataNetwork ¶
type WinDivertDataNetwork addressInternalUnion
WINDIVERT_DATA_NETWORK
func (*WinDivertDataNetwork) IfIdx ¶
func (d *WinDivertDataNetwork) IfIdx() uint32
The interface index on which the packet arrived (for inbound packets), or is to be sent (for outbound packets).
func (*WinDivertDataNetwork) SubIfIdx ¶
func (d *WinDivertDataNetwork) SubIfIdx() uint32
The sub-interface index for IfIdx.
type WinDivertDataReflect ¶
type WinDivertDataReflect addressInternalUnion
WINDIVERT_DATA_REFLECT
func (*WinDivertDataReflect) Flags ¶
func (d *WinDivertDataReflect) Flags() Flag
func (*WinDivertDataReflect) Layer ¶
func (d *WinDivertDataReflect) Layer() Layer
func (*WinDivertDataReflect) Priority ¶
func (d *WinDivertDataReflect) Priority() int16
func (*WinDivertDataReflect) ProcessId ¶
func (d *WinDivertDataReflect) ProcessId() uint32
The ID of the process that opened the handle.
func (*WinDivertDataReflect) Timestamp ¶
func (d *WinDivertDataReflect) Timestamp() int64
A timestamp indicating when the handle was opened.
type WinDivertDataSocket ¶
type WinDivertDataSocket addressInternalUnion
WINDIVERT_DATA_SOCKET
func (*WinDivertDataSocket) Endpoint ¶
func (d *WinDivertDataSocket) Endpoint() uint64
The endpoint ID of the socket operation.
func (*WinDivertDataSocket) LocalAddr ¶
func (d *WinDivertDataSocket) LocalAddr() netip.Addr
func (*WinDivertDataSocket) LocalPort ¶
func (d *WinDivertDataSocket) LocalPort() uint16
func (*WinDivertDataSocket) ParentEndpoint ¶
func (d *WinDivertDataSocket) ParentEndpoint() uint64
The parent endpoint ID of the socket operation.
func (*WinDivertDataSocket) ProcessId ¶
func (d *WinDivertDataSocket) ProcessId() uint32
The ID of the process associated with the socket operation.
func (*WinDivertDataSocket) Protocol ¶
func (d *WinDivertDataSocket) Protocol() uint8
func (*WinDivertDataSocket) RemoteAddr ¶
func (d *WinDivertDataSocket) RemoteAddr() netip.Addr
func (*WinDivertDataSocket) RemotePort ¶
func (d *WinDivertDataSocket) RemotePort() uint16