Documentation ¶
Index ¶
- Constants
- func AccessProc() bool
- func DoNetstat(path string, peers map[string]int, result map[string]*SockTabEntry) error
- func FindAllProcesses() (map[int]bool, error)
- func GetComm(pid int) (string, error)
- func GetCommandLine(pid int) (string, error)
- func GetContainerIDFromCGroup(pid int) (string, error)
- func GetExeName(pid int) (string, error)
- func GetHostName(pid int) (string, error)
- func GetNetNamespace(pid int) (string, error)
- func ListVMMatchNetSocks(peers map[string]int) (map[string]*SockTabEntry, error)
- func Path(pid int, subpath ...string) string
- func SkipBlackCmdline(cmdLine string) bool
- func SkipBlackComm(comm string) bool
- type ProcInfo
- type Process
- type SockAddr
- type SockTabEntry
Constants ¶
View Source
const ( PATH_ROOT = "/proc" PREFIX_SOCKET = "socket:[" )
Variables ¶
This section is empty.
Functions ¶
func AccessProc ¶
func AccessProc() bool
func FindAllProcesses ¶
func GetCommandLine ¶
reads the command line arguments of a Linux process from the cmdline file in the /proc filesystem and converts them into a string
func GetContainerIDFromCGroup ¶
getContainerIDFromCGroup returns the id of the container from the cgroup file. If no container id found, an empty string will be returned.
func GetExeName ¶
The exe Symbolic Link: Inside each process's directory in /proc, there is a symbolic link named exe. This link points to the executable file that was used to start the process. For instance, if a process was started from /usr/bin/python, the exe symbolic link in that process's /proc directory will point to /usr/bin/python.
func GetHostName ¶
func GetNetNamespace ¶
func ListVMMatchNetSocks ¶
func ListVMMatchNetSocks(peers map[string]int) (map[string]*SockTabEntry, error)
func SkipBlackCmdline ¶
func SkipBlackComm ¶
Types ¶
type ProcInfo ¶
type ProcInfo struct { ProcessID int ExeName string CmdLine string Comm string HostName string ContainerId string NetNamespace string Ignore bool }
func (*ProcInfo) GetMatchNetSockets ¶
func (p *ProcInfo) GetMatchNetSockets(socks map[string]*SockTabEntry) []string
func (*ProcInfo) ListMatchNetSocks ¶
type SockTabEntry ¶
SockTabEntry type represents each line of the /proc/net/[tcp|udp]
Click to show internal directories.
Click to hide internal directories.