iphelper

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2020 License: AGPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	IPv4 uint8 = 4
	IPv6 uint8 = 6

	TCP uint8 = 6
	UDP uint8 = 17
)

IP and Protocol constants

Variables

This section is empty.

Functions

func GetActiveConnectionIDs

func GetActiveConnectionIDs() (connections []string)

GetActiveConnectionIDs returns all currently active connection IDs.

func GetTCP4PacketInfo

func GetTCP4PacketInfo(localIP net.IP, localPort uint16, remoteIP net.IP, remotePort uint16, pktDirection bool) (pid int, direction bool, err error)

GetTCP4PacketInfo returns the pid of the given IPv4/TCP connection.

func GetTCP6PacketInfo

func GetTCP6PacketInfo(localIP net.IP, localPort uint16, remoteIP net.IP, remotePort uint16, pktDirection bool) (pid int, direction bool, err error)

GetTCP6PacketInfo returns the pid of the given IPv6/TCP connection.

func GetUDP4PacketInfo

func GetUDP4PacketInfo(localIP net.IP, localPort uint16, remoteIP net.IP, remotePort uint16, pktDirection bool) (pid int, direction bool, err error)

GetUDP4PacketInfo returns the pid of the given IPv4/UDP connection.

func GetUDP6PacketInfo

func GetUDP6PacketInfo(localIP net.IP, localPort uint16, remoteIP net.IP, remotePort uint16, pktDirection bool) (pid int, direction bool, err error)

GetUDP6PacketInfo returns the pid of the given IPv6/UDP connection.

Types

type ConnectionEntry added in v0.2.5

type ConnectionEntry struct {
	// contains filtered or unexported fields
}

ConnectionEntry describes a connection state table entry.

func (*ConnectionEntry) String added in v0.2.5

func (entry *ConnectionEntry) String() string

type IPHelper

type IPHelper struct {
	// contains filtered or unexported fields
}

IPHelper represents a subset of the Windows iphlpapi.dll.

func New

func New() (*IPHelper, error)

New returns a new IPHelper API (with an instance of iphlpapi.dll loaded).

func (*IPHelper) GetTables

func (ipHelper *IPHelper) GetTables(protocol uint8, ipVersion uint8) (connections []*ConnectionEntry, listeners []*ConnectionEntry, err error)

GetTables returns the current connection state table of Windows of the given protocol and IP version.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL