Documentation
¶
Rendered for windows/amd64
Index ¶
- Constants
- func CloseHandle(object HANDLE) bool
- func CreateIpForwardEntry(route *MIB_IPFORWARDROW) uint32
- func DeleteIpForwardEntry(route *MIB_IPFORWARDROW) uint32
- func GetBestRoute(destAddr, sourceAddr uint32, bestRoute *MIB_IPFORWARDROW) int
- func GetExtendedTcpTable(tcpTable uintptr, size *uint32, order int32, af uint32, ...) int
- func GetExtendedUdpTable(udpTable uintptr, size *uint32, order int32, af uint32, ...) int
- func GetIfTable(table *MIB_IFTABLE, size *uint32, order int32) int
- func GetInterfaceInfo(ifTable *IP_INTERFACE_INFO, outBufLen *uint32) int
- func GetIpForwardTable(table *MIB_IPFORWARDTABLE, size *uint32, order int32) int
- func GetTcpStatistics(statistics *MIB_TCPSTATS) int
- func IPAddrATON(addr string) uint32
- func IPAddrNTOA(addr uint32) string
- func Module32First(snapshot HANDLE, me *MODULEENTRY32) bool
- func NTOHS(port uint16) uint16
- func Process32First(snapshot HANDLE, pe *PROCESSENTRY32) bool
- func UTF16PtrToString(cstr *uint16) string
- type BOOL
- type DWORD
- type HANDLE
- type HMODULE
- type IP_ADAPTER_INDEX_MAP
- type IP_INTERFACE_INFO
- type MIB_IFROW
- type MIB_IFTABLE
- type MIB_IPFORWARDROW
- type MIB_IPFORWARDTABLE
- type MIB_TCPROW_OWNER_PID
- type MIB_TCPSTATS
- type MIB_TCPTABLE_OWNER_PID
- type MIB_UDP6ROW_OWNER_PID
- type MIB_UDP6TABLE_OWNER_PID
- type MIB_UDPROW_OWNER_PID
- type MIB_UDPTABLE_OWNER_PID
- type MODULEENTRY32
- type PDWORD
- type PROCESSENTRY32
- type TCP_TABLE_CLASS
- type UDP_TABLE_CLASS
- type ULONG
- type ULONG_PTR
Constants ¶
View Source
const ( AF_INET = 2 AF_INET6 = 23 )
View Source
const ( MAX_MODULE_NAME32 = 255 MAX_PATH = 260 )
View Source
const ( TH32CS_SNAPHEAPLIST = 0x00000001 TH32CS_SNAPPROCESS = 0x00000002 TH32CS_SNAPTHREAD = 0x00000004 TH32CS_SNAPMODULE = 0x00000008 TH32CS_SNAPMODULE32 = 0x00000010 TH32CS_INHERIT = 0x80000000 TH32CS_SNAPALL = TH32CS_SNAPHEAPLIST | TH32CS_SNAPMODULE | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD )
https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/nf-tlhelp32-createtoolhelp32snapshot
View Source
const ( MAX_ADAPTER_NAME = 128 MAX_INTERFACE_NAME_LEN = 256 MAXLEN_PHYSADDR = 8 MAXLEN_IFDESCR = 256 )
Variables ¶
This section is empty.
Functions ¶
func CloseHandle ¶
func CreateIpForwardEntry ¶
func CreateIpForwardEntry(route *MIB_IPFORWARDROW) uint32
func DeleteIpForwardEntry ¶
func DeleteIpForwardEntry(route *MIB_IPFORWARDROW) uint32
func GetBestRoute ¶
func GetBestRoute(destAddr, sourceAddr uint32, bestRoute *MIB_IPFORWARDROW) int
func GetExtendedTcpTable ¶
func GetExtendedUdpTable ¶
func GetIfTable ¶
func GetIfTable(table *MIB_IFTABLE, size *uint32, order int32) int
func GetInterfaceInfo ¶
func GetInterfaceInfo(ifTable *IP_INTERFACE_INFO, outBufLen *uint32) int
func GetIpForwardTable ¶
func GetIpForwardTable(table *MIB_IPFORWARDTABLE, size *uint32, order int32) int
func GetTcpStatistics ¶
func GetTcpStatistics(statistics *MIB_TCPSTATS) int
func Module32First ¶
func Module32First(snapshot HANDLE, me *MODULEENTRY32) bool
func Process32First ¶
func Process32First(snapshot HANDLE, pe *PROCESSENTRY32) bool
func UTF16PtrToString ¶
Types ¶
type IP_ADAPTER_INDEX_MAP ¶
type IP_ADAPTER_INDEX_MAP struct {
Index uint32
Name [MAX_ADAPTER_NAME]uint16
}
type IP_INTERFACE_INFO ¶
type IP_INTERFACE_INFO struct {
NumAdapters int32
Adapter [1024]IP_ADAPTER_INDEX_MAP // FIXME
}
type MIB_IFROW ¶
type MIB_IFROW struct {
Name [MAX_INTERFACE_NAME_LEN]uint16
Index uint32
Type uint32
Mtu uint32
Speed uint32
PhysAddrLen uint32
PhysAddr [MAXLEN_PHYSADDR]uint8
AdminStatus uint32
OperStatus uint32
LastChange uint32
InOctets uint32
InUcastPkts uint32
InNUcastPkts uint32
InDiscards uint32
InErrors uint32
InUnknownProtos uint32
OutOctets uint32
OutUcastPkts uint32
OutNUcastPkts uint32
OutDiscards uint32
OutErrors uint32
OutQLen uint32
DescrLen uint32
Descr [MAXLEN_IFDESCR]uint8
}
type MIB_IFTABLE ¶
type MIB_IPFORWARDROW ¶
type MIB_IPFORWARDROW struct {
ForwardDest uint32
ForwardMask uint32
ForwardPolicy uint32
ForwardNextHop uint32
ForwardIfIndex uint32
ForwardType uint32
ForwardProto uint32
ForwardAge uint32
ForwardNextHopAS uint32
ForwardMetric1 uint32
ForwardMetric2 uint32
ForwardMetric3 uint32
ForwardMetric4 uint32
ForwardMetric5 uint32
}
type MIB_IPFORWARDTABLE ¶
type MIB_IPFORWARDTABLE struct {
NumEntries DWORD
Table [1024]MIB_IPFORWARDROW // FIXME
}
type MIB_TCPROW_OWNER_PID ¶
type MIB_TCPSTATS ¶
type MIB_TCPTABLE_OWNER_PID ¶
type MIB_TCPTABLE_OWNER_PID struct {
NumEntries DWORD
// FIXME hard code the array size
// is not the right way to go, a
// system call will fail along
// with the needed bytes return,
// we should re-allocate sufficient
// size array and then call again.
Table [1024]MIB_TCPROW_OWNER_PID
}
type MIB_UDP6ROW_OWNER_PID ¶
type MIB_UDP6TABLE_OWNER_PID ¶
type MIB_UDP6TABLE_OWNER_PID struct {
NumEntries DWORD
Table [1024]MIB_UDP6ROW_OWNER_PID // FIXME
}
type MIB_UDPROW_OWNER_PID ¶
type MIB_UDPTABLE_OWNER_PID ¶
type MIB_UDPTABLE_OWNER_PID struct {
NumEntries DWORD
Table [1024]MIB_UDPROW_OWNER_PID // FIXME
}
type MODULEENTRY32 ¶
type PROCESSENTRY32 ¶
type TCP_TABLE_CLASS ¶
type TCP_TABLE_CLASS DWORD
const ( TCP_TABLE_BASIC_LISTENER TCP_TABLE_CLASS = iota TCP_TABLE_BASIC_CONNECTIONS TCP_TABLE_BASIC_ALL TCP_TABLE_OWNER_PID_LISTENER TCP_TABLE_OWNER_PID_CONNECTIONS TCP_TABLE_OWNER_PID_ALL TCP_TABLE_OWNER_MODULE_LISTENER TCP_TABLE_OWNER_MODULE_CONNECTIONS TCP_TABLE_OWNER_MODULE_ALL )
type UDP_TABLE_CLASS ¶
type UDP_TABLE_CLASS DWORD
const ( UDP_TABLE_BASIC UDP_TABLE_CLASS = iota UDP_TABLE_OWNER_PID UDP_TABLE_OWNER_MODULE )
Click to show internal directories.
Click to hide internal directories.