Documentation ¶
Overview ¶
This file was generated by DoU robots at 2019-09-30 13:49:35.285532536 -0500 CDT m=+1.331221596
Index ¶
- Constants
- Variables
- func GetExtendedUDPTable(order bool, af uint32, cl UDPTableClass) ([]byte, error)
- func NoopFilter(*SockTabEntry) bool
- func Process32First(handle syscall.Handle, pe *Processentry32) error
- func Process32Next(handle syscall.Handle, pe *Processentry32) error
- func StringFromNullTerminated(b []byte) string
- type AcceptFn
- type MibTCP6Row2
- type MibTCP6Table2
- type MibTCPRow2
- type MibTCPTable2
- type MibUDP6RowOwnerPID
- type MibUDP6TableOwnerPID
- type MibUDPRowOwnerPID
- type MibUDPTableOwnerPID
- type Process
- type ProcessSnapshot
- type Processentry32
- type SkState
- type SockAddr
- type SockTabEntry
- type UDPTableClass
- type WinPid
- type WinSock
- type WinSock6
Constants ¶
const ( Th32csSnapProcess = uint32(0x00000002) InvalidHandleValue = ^uintptr(0) MaxPath = 260 )
const ( Close SkState = 0x01 Listen = 0x02 SynSent = 0x03 SynRecv = 0x04 Established = 0x05 FinWait1 = 0x06 FinWait2 = 0x07 CloseWait = 0x08 Closing = 0x09 LastAck = 0x0a TimeWait = 0x0b DeleteTcb = 0x0c )
Socket states
Variables ¶
var Ports = map[uint16]string{}/* 5888 elements not displayed */
Functions ¶
func GetExtendedUDPTable ¶
func GetExtendedUDPTable(order bool, af uint32, cl UDPTableClass) ([]byte, error)
GetExtendedUDPTable function retrieves a table that contains a list of UDP endpoints available to the application
func NoopFilter ¶
func NoopFilter(*SockTabEntry) bool
NoopFilter - a test function returning true for all elements
func Process32First ¶
func Process32First(handle syscall.Handle, pe *Processentry32) error
Process32First retrieves information about the first process encountered in a system snapshot
func Process32Next ¶
func Process32Next(handle syscall.Handle, pe *Processentry32) error
Process32Next retrieves information about the next process recorded in a system snapshot
func StringFromNullTerminated ¶
StringFromNullTerminated returns a string from a nul-terminated byte slice
Types ¶
type AcceptFn ¶
type AcceptFn func(*SockTabEntry) bool
AcceptFn is used to filter socket entries. The value returned indicates whether the element is to be appended to the socket list.
type MibTCP6Row2 ¶
type MibTCP6Row2 struct { LocalAddr WinSock6 RemoteAddr WinSock6 State uint32 WinPid OffloadState uint32 }
MibTCP6Row2 structure contains information that describes an IPv6 TCP connection.
func (*MibTCP6Row2) LocalSock ¶
func (m *MibTCP6Row2) LocalSock() *SockAddr
func (*MibTCP6Row2) RemoteSock ¶
func (m *MibTCP6Row2) RemoteSock() *SockAddr
func (*MibTCP6Row2) SockState ¶
func (m *MibTCP6Row2) SockState() SkState
type MibTCP6Table2 ¶
type MibTCP6Table2 struct { NumEntries uint32 Table [1]MibTCP6Row2 }
MibTCP6Table2 structure contains a table of IPv6 TCP connections on the local computer.
func GetTCP6Table2 ¶
func GetTCP6Table2(order bool) (*MibTCP6Table2, error)
GetTCP6Table2 function retrieves the IPv6 TCP connection table
func (*MibTCP6Table2) Rows ¶
func (t *MibTCP6Table2) Rows() []MibTCP6Row2
type MibTCPRow2 ¶
type MibTCPRow2 struct { State uint32 LocalAddr WinSock RemoteAddr WinSock WinPid OffloadState uint32 }
func (*MibTCPRow2) LocalSock ¶
func (m *MibTCPRow2) LocalSock() *SockAddr
func (*MibTCPRow2) RemoteSock ¶
func (m *MibTCPRow2) RemoteSock() *SockAddr
func (*MibTCPRow2) SockState ¶
func (m *MibTCPRow2) SockState() SkState
type MibTCPTable2 ¶
type MibTCPTable2 struct { NumEntries uint32 Table [1]MibTCPRow2 }
func GetTCPTable2 ¶
func GetTCPTable2(order bool) (*MibTCPTable2, error)
GetTCPTable2 function retrieves the IPv4 TCP connection table
func (*MibTCPTable2) Rows ¶
func (t *MibTCPTable2) Rows() []MibTCPRow2
type MibUDP6RowOwnerPID ¶
MibUDP6RowOwnerPID serves the same purpose as MibUDPRowOwnerPID, except that the information in this case is for IPv6.
func (*MibUDP6RowOwnerPID) LocalSock ¶
func (m *MibUDP6RowOwnerPID) LocalSock() *SockAddr
func (*MibUDP6RowOwnerPID) RemoteSock ¶
func (m *MibUDP6RowOwnerPID) RemoteSock() *SockAddr
func (*MibUDP6RowOwnerPID) SockState ¶
func (m *MibUDP6RowOwnerPID) SockState() SkState
type MibUDP6TableOwnerPID ¶
type MibUDP6TableOwnerPID struct { NumEntries uint32 Table [1]MibUDP6RowOwnerPID }
MibUDP6TableOwnerPID serves the same purpose as MibUDPTableOwnerPID for IPv6
func GetUDP6TableOwnerPID ¶
func GetUDP6TableOwnerPID(order bool) (*MibUDP6TableOwnerPID, error)
func (*MibUDP6TableOwnerPID) Rows ¶
func (t *MibUDP6TableOwnerPID) Rows() []MibUDP6RowOwnerPID
type MibUDPRowOwnerPID ¶
MibUDPRowOwnerPID structure contains an entry from the User Datagram Protocol (UDP) listener table for IPv4 on the local computer. The entry also includes the process ID (PID) that issued the call to the bind function for the UDP endpoint
func (*MibUDPRowOwnerPID) LocalSock ¶
func (m *MibUDPRowOwnerPID) LocalSock() *SockAddr
func (*MibUDPRowOwnerPID) RemoteSock ¶
func (m *MibUDPRowOwnerPID) RemoteSock() *SockAddr
func (*MibUDPRowOwnerPID) SockState ¶
func (m *MibUDPRowOwnerPID) SockState() SkState
type MibUDPTableOwnerPID ¶
type MibUDPTableOwnerPID struct { NumEntries uint32 Table [1]MibUDPRowOwnerPID }
MibUDPTableOwnerPID structure contains the User Datagram Protocol (UDP) listener table for IPv4 on the local computer. The table also includes the process ID (PID) that issued the call to the bind function for each UDP endpoint.
func GetUDPTableOwnerPID ¶
func GetUDPTableOwnerPID(order bool) (*MibUDPTableOwnerPID, error)
func (*MibUDPTableOwnerPID) Rows ¶
func (t *MibUDPTableOwnerPID) Rows() []MibUDPRowOwnerPID
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
Process holds the PID and process name to which each socket belongs
type ProcessSnapshot ¶
ProcessSnapshot wraps the syscall.Handle, which represents a snapshot of the specified processes.
func CreateToolhelp32Snapshot ¶
func CreateToolhelp32Snapshot(flags uint32, pid uint32) (ProcessSnapshot, error)
CreateToolhelp32Snapshot takes a snapshot of the specified processes, as well as the heaps, modules, and threads used by these processes
func (ProcessSnapshot) Close ¶
func (snp ProcessSnapshot) Close() error
Close releases underlying win32 handle
func (ProcessSnapshot) ProcPIDToName ¶
func (snp ProcessSnapshot) ProcPIDToName(pid uint32) string
ProcPIDToName translates PID to a name
type Processentry32 ¶
type Processentry32 struct { Size uint32 CntUsage uint32 Th32ProcessID uint32 Th32DefaultHeapID uintptr Th32ModuleID uint32 CntThreads uint32 Th32ParentProcessID uint32 PriClassBase int32 Flags uint32 ExeFile [MaxPath]byte }
Processentry32 describes an entry from a list of the processes residing in the system address space when a snapshot was taken
type SockTabEntry ¶
type SockTabEntry struct { LocalAddr *SockAddr RemoteAddr *SockAddr State SkState UID uint32 Process *Process // contains filtered or unexported fields }
SockTabEntry type represents each line of the /proc/net/[tcp|udp]
func TCP6Socks ¶
func TCP6Socks(accept AcceptFn) ([]SockTabEntry, error)
TCP6Socks returns a slice of active TCP IPv4 sockets containing only those elements that satisfy the accept function
func TCPSocks ¶
func TCPSocks(accept AcceptFn) ([]SockTabEntry, error)
TCPSocks returns a slice of active TCP sockets containing only those elements that satisfy the accept function
func UDP6Socks ¶
func UDP6Socks(accept AcceptFn) ([]SockTabEntry, error)
UDP6Socks returns a slice of active UDP IPv6 sockets containing only those elements that satisfy the accept function
func UDPSocks ¶
func UDPSocks(accept AcceptFn) ([]SockTabEntry, error)
UDPSocks returns a slice of active UDP sockets containing only those elements that satisfy the accept function
type UDPTableClass ¶
type UDPTableClass uint
The UDPTableClass enumeration defines the set of values used to indicate the type of table returned by calls to GetExtendedUDPTable
const ( UDPTableBasic UDPTableClass = iota UDPTableOwnerPID UDPTableOwnerModule )
Possible table class values
type WinPid ¶
type WinPid uint32
func (WinPid) Process ¶
func (pid WinPid) Process(snp ProcessSnapshot) *Process