Documentation ¶
Index ¶
- Constants
- Variables
- func CloseMutex(mutex windows.Handle)
- func DialIPv4(wg *sync.WaitGroup)
- func DialIPv6(wg *sync.WaitGroup)
- func Download() error
- func GetDriverFileName() (string, error)
- func GetInterfaceIndex() (uint32, uint32, error)
- func InstallDriver() error
- func IoControl(h windows.Handle, code CtlCode, ioctl unsafe.Pointer, buf *byte, bufLen uint32) (iolen uint32, err error)
- func IoControlEx(h windows.Handle, code CtlCode, ioctl unsafe.Pointer, buf *byte, bufLen uint32, ...) (iolen uint32, err error)
- func RegisterEventSource(sys string) error
- func RemoveDriver() error
- type Address
- func (a *Address) Ethernet() *Ethernet
- 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 CtlCode
- type Device
- func (d *Device) CheckIPv4(b []byte) bool
- func (d *Device) CheckIPv6(b []byte) bool
- func (d *Device) CheckTCP4(b []byte) bool
- func (d *Device) CheckTCP6(b []byte) bool
- func (d *Device) CheckUDP4(b []byte) bool
- func (d *Device) CheckUDP6(b []byte) bool
- func (d *Device) Close() error
- func (d *Device) Write(b []byte) (int, error)
- func (d *Device) WriteTo(w io.Writer) (n int64, err error)
- type Error
- type Ethernet
- type Event
- type Flow
- type Handle
- func (h *Handle) Close() error
- func (h *Handle) GetParam(p Param) (uint64, error)
- func (h *Handle) Recv(buffer []byte, address *Address) (uint, error)
- func (h *Handle) RecvEx(buffer []byte, address []Address, overlapped *windows.Overlapped) (uint, uint, error)
- func (h *Handle) Send(buffer []byte, address *Address) (uint, error)
- func (h *Handle) SendEx(buffer []byte, address []Address, overlapped *windows.Overlapped) (uint, error)
- func (h *Handle) SetParam(p Param, v uint64) error
- func (h *Handle) Shutdown(how Shutdown) error
- type IoCtl
- type Layer
- type Network
- type Param
- type Reflect
- type Shutdown
- type Socket
Constants ¶
View Source
const ( FlagDefault = 0x0000 FlagSniff = 0x0001 FlagDrop = 0x0002 FlagRecvOnly = 0x0004 FlagSendOnly = 0x0008 FlagNoInstall = 0x0010 FlagFragments = 0x0020 )
View Source
const ( PriorityDefault = 0 PriorityHighest = 3000 PriorityLowest = -3000 QueueLengthDefault = 4096 QueueLengthMin = 32 QueueLengthMax = 16384 QueueTimeDefault = 2000 QueueTimeMin = 100 QueueTimeMax = 16000 QueueSizeDefault = 4194304 QueueSizeMin = 65535 QueueSizeMax = 33554432 )
View Source
const ( ChecksumDefault = 0 NoIPChecksum = 1 NoICMPChekcsum = 2 NoICMPV6Checksum = 4 NoTCPChekcsum = 8 NoUDPChecksum = 16 )
View Source
const ( BatchMax = 0xff MTUMax = 40 + 0xffff )
View Source
const ( FIN = 1 << 0 SYN = 1 << 1 RST = 1 << 2 PSH = 1 << 3 ACK = 1 << 4 UGR = 1 << 5 ECE = 1 << 6 CWR = 1 << 7 )
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) )
View Source
const ( METHOD_BUFFERED = 0 METHOD_IN_DIRECT = 1 METHOD_OUT_DIRECT = 2 METHOD_NEITHER = 3 )
View Source
const ( FILE_READ_DATA = 1 FILE_WRITE_DATA = 2 )
View Source
const ( FILE_DEVICE_NETWORK = 0x00000012 FILE_DEVICE_NETWORK_BROWSER = 0x00000013 FILE_DEVICE_NETWORK_FILE_SYSTEM = 0x00000014 FILE_DEVICE_NETWORK_REDIRECTOR = 0x00000028 )
Variables ¶
View Source
var ( IoCtlInitialize = CTL_CODE(FILE_DEVICE_NETWORK, 0x921, METHOD_OUT_DIRECT, FILE_READ_DATA|FILE_WRITE_DATA) IoCtlStartup = CTL_CODE(FILE_DEVICE_NETWORK, 0x922, METHOD_IN_DIRECT, FILE_READ_DATA|FILE_WRITE_DATA) IoCtlRecv = CTL_CODE(FILE_DEVICE_NETWORK, 0x923, METHOD_OUT_DIRECT, FILE_READ_DATA) IoCtlSend = CTL_CODE(FILE_DEVICE_NETWORK, 0x924, METHOD_IN_DIRECT, FILE_READ_DATA|FILE_WRITE_DATA) IoCtlSetParam = CTL_CODE(FILE_DEVICE_NETWORK, 0x925, METHOD_IN_DIRECT, FILE_READ_DATA|FILE_WRITE_DATA) IoCtlGetParam = CTL_CODE(FILE_DEVICE_NETWORK, 0x926, METHOD_OUT_DIRECT, FILE_READ_DATA) IoCtlShutdown = CTL_CODE(FILE_DEVICE_NETWORK, 0x927, METHOD_IN_DIRECT, FILE_READ_DATA|FILE_WRITE_DATA) )
View Source
var (
DeviceName = windows.StringToUTF16Ptr("WinDivert")
)
Functions ¶
func CloseMutex ¶
func GetDriverFileName ¶
func GetInterfaceIndex ¶
func InstallDriver ¶
func InstallDriver() error
func IoControlEx ¶
func RegisterEventSource ¶
func RemoveDriver ¶
func RemoveDriver() error
Types ¶
type Address ¶
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 Device ¶
type Event ¶
type Event int
const ( EventNetworkPacket Event = 0 EventFlowEstablished Event = 1 EventFlowDeleted Event = 2 EventSocketBind Event = 3 EventSocketConnect Event = 4 EventSocketListen Event = 5 EventSocketAccept Event = 6 EventSocketClose Event = 7 EventReflectOpen Event = 8 EventReflectClose Event = 9 EventEthernetFrame Event = 10 )
type Reflect ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
iana
Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA).
|
Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA). |
utils/iptree
Package iptree implements radix tree data structure for IPv4 and IPv6 networks.
|
Package iptree implements radix tree data structure for IPv4 and IPv6 networks. |
Click to show internal directories.
Click to hide internal directories.