libproc

package module
v0.0.0-...-7896a74 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Rendered for darwin/amd64

Index

Constants

View Source
const (
	ProcPidpathinfoSize    = 0x400
	ProcPidpathinfoMaxsize = 0x1000
)
View Source
const (
	ProcListpidspathPathIsVolume = 0x1

	ProcListpidspathExcludeEvtonly = 0x2
)
View Source
const (
	SockinfoGeneric   = 0x0
	SockinfoIn        = 0x1
	SockinfoKernCtl   = 0x6
	SockinfoKernEvent = 0x5
	SockinfoNdrv      = 0x4
	SockinfoTCP       = 0x2
	SockinfoUn        = 0x3
	SockinfoVsock     = 0x7
)
View Source
const MaxComLen = 0x10
View Source
const (
	MaxMsgBSize = 0x100000
)

Variables

This section is empty.

Functions

func ProcListallpids

func ProcListallpids() (numPids int, err error)

ProcListallpids retursn the list all pids.

func ProcPidpath

func ProcPidpath(pid PID) (path string, err error)

ProcPidpath given a pid, returns the full executable name including directory paths and the longer-than-16-chars executable name.

Types

type In4In6Addr

type In4In6Addr struct {
	Pad32 [3]uint32
	Addr4 [4]byte // in_addr
}

type InSockinfo

type InSockinfo struct {
	Insi_fport  int32
	Insi_lport  int32
	Insi_gencnt uint64
	Insi_flags  uint32
	Insi_flow   uint32
	Insi_vflag  uint8
	Insi_ip_ttl uint8
	Rfu_1       uint32
	Insi_faddr  [16]byte
	Insi_laddr  [16]byte
	Insi_v4     InsiV4 // insi_v4
	Insi_v6     InsiV6 // insi_v6
}

type InsiLaddr

type InsiLaddr [16]byte

type InsiV4

type InsiV4 struct {
	Tos uint8
}

type InsiV6

type InsiV6 struct {
	Hlim    uint8
	Cksum   int32
	Ifindex uint16
	Hops    int16
}

type KernCTLInfo

type KernCTLInfo struct {
	Id          uint32
	Reg_unit    uint32
	Flags       uint32
	Recvbufsize uint32
	Sendbufsize uint32
	Unit        uint32
	Name        [96]int8
}

type KernEventInfo

type KernEventInfo struct {
	Vendor_code_filter uint32
	Class_filter       uint32
	Subclass_filter    uint32
}

type NdrvInfo

type NdrvInfo struct {
	If_family uint32
	If_unit   uint32
	If_name   [16]int8
}

type PID

type PID int32

type ProcBsdinfo

type ProcBsdinfo struct {
	Pbi_flags        uint32
	Pbi_status       uint32
	Pbi_xstatus      uint32
	Pbi_pid          uint32
	Pbi_ppid         uint32
	Pbi_uid          uint32
	Pbi_gid          uint32
	Pbi_ruid         uint32
	Pbi_rgid         uint32
	Pbi_svuid        uint32
	Pbi_svgid        uint32
	Rfu_1            uint32
	Pbi_comm         [16]int8
	Pbi_name         [32]int8
	Pbi_nfiles       uint32
	Pbi_pgid         uint32
	Pbi_pjobc        uint32
	E_tdev           uint32
	E_tpgid          uint32
	Pbi_nice         int32
	Pbi_start_tvsec  uint64
	Pbi_start_tvusec uint64
}

type ProcFDType

type ProcFDType uint32
const (
	ProxFDTypeAtalk     ProcFDType = 0x0
	ProxFDTypeVnode     ProcFDType = 0x1
	ProxFDTypeSocket    ProcFDType = 0x2
	ProxFDTypePshm      ProcFDType = 0x3
	ProxFDTypePsem      ProcFDType = 0x4
	ProxFDTypeKqueue    ProcFDType = 0x5
	ProxFDTypePipe      ProcFDType = 0x6
	ProxFDTypeFsevents  ProcFDType = 0x7
	ProxFDTypeNetpolicy ProcFDType = 0x9
)

type ProcFileinfo

type ProcFileinfo struct {
	Openflags  uint32
	Status     uint32
	Offset     int64
	Type       int32
	Guardflags uint32
}

type ProcTaskInfo

type ProcTaskInfo struct {
	Virtual_size      uint64
	Resident_size     uint64
	Total_user        uint64
	Total_system      uint64
	Threads_user      uint64
	Threads_system    uint64
	Policy            int32
	Faults            int32
	Pageins           int32
	Cow_faults        int32
	Messages_sent     int32
	Messages_received int32
	Syscalls_mach     int32
	Syscalls_unix     int32
	Csw               int32
	Threadnum         int32
	Numrunning        int32
	Priority          int32
}

type ProcType

type ProcType uint32
const (
	ProcAllPids  ProcType = 0x1
	ProcPgrpOnly ProcType = 0x2
	ProcTtyOnly  ProcType = 0x3
	ProcUidOnly  ProcType = 0x4
	ProcRUIDOnly ProcType = 0x5
	ProcPPIDOnly ProcType = 0x6
	ProcKDBGOnly ProcType = 0x7
)

type SockProto

type SockProto struct {
	Family   uint16
	Protocol uint16
}

type SockbufInfo

type SockbufInfo struct {
	Cc    uint32
	Hiwat uint32
	Mbcnt uint32
	Mbmax uint32
	Lowat uint32
	Flags int16
	Timeo int16
}

type SocketFDinfo

type SocketFDinfo struct {
	Pfi ProcFileinfo
	Psi SocketInfo
}

type SocketInfo

type SocketInfo struct {
	Soi_stat     VInfoStat
	Soi_so       uint64
	Soi_pcb      uint64
	Soi_type     int32
	Soi_protocol int32
	Soi_family   int32
	Soi_options  int16
	Soi_linger   int16
	Soi_state    int16
	Soi_qlen     int16
	Soi_incqlen  int16
	Soi_qlimit   int16
	Soi_timeo    int16
	Soi_error    uint16
	Soi_oobmark  uint32
	Soi_rcv      SockbufInfo
	Soi_snd      SockbufInfo
	Soi_kind     int32
	Rfu_1        uint32
	Soi_proto    [528]byte
}

type TCPSIState

type TCPSIState int32
const (
	TSI_S_CLOSED       TCPSIState = 0x0
	TSI_S_LISTEN       TCPSIState = 0x1
	TSI_S_SYN_SENT     TCPSIState = 0x2
	TSI_S_SYN_RECEIVED TCPSIState = 0x3
	TSI_S_ESTABLISHED  TCPSIState = 0x4
	TSI_S__CLOSE_WAIT  TCPSIState = 0x5
	TSI_S_FIN_WAIT_1   TCPSIState = 0x6
	TSI_S_CLOSING      TCPSIState = 0x7
	TSI_S_LAST_ACK     TCPSIState = 0x8
	TSI_S_FIN_WAIT_2   TCPSIState = 0x9
	TSI_S_TIME_WAIT    TCPSIState = 0xa
	TSI_S_RESERVED     TCPSIState = 0xb
)

type TCPSockinfo

type TCPSockinfo struct {
	Tcpsi_ini   InSockinfo
	Tcpsi_state int32
	Tcpsi_timer [4]int32
	Tcpsi_mss   int32
	Tcpsi_flags uint32
	Rfu_1       uint32
	Tcpsi_tp    uint64
}

type UnSocinfo

type UnSocinfo struct {
	Conn_so   uint64
	Conn_pcb  uint64
	Addr      [255]byte
	Caddr     [255]byte
	Pad_cgo_0 [2]byte
}

type VInfoStat

type VInfoStat struct {
	Dev           uint32
	Mode          uint16
	Nlink         uint16
	Ino           uint64
	Uid           uint32
	Gid           uint32
	Atime         int64
	Atimensec     int64
	Mtime         int64
	Mtimensec     int64
	Ctime         int64
	Ctimensec     int64
	Birthtime     int64
	Birthtimensec int64
	Size          int64
	Blocks        int64
	Blksize       int32
	Flags         uint32
	Gen           uint32
	Rdev          uint32
	Qspare        [2]int64
}

type VsockSockinfo

type VsockSockinfo struct {
	Local_cid   uint32
	Local_port  uint32
	Remote_cid  uint32
	Remote_port uint32
}

Jump to

Keyboard shortcuts

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