Documentation ¶
Index ¶
- Constants
- Variables
- type CbId
- type CnMsg
- type InetDiagMsg
- type InetDiagReqV2
- type InetDiagSockId
- type NetlinkProtocol
- type NetlinkRequest
- type NetlinkRequestData
- type NetlinkSocket
- func (ns *NetlinkSocket) Close()
- func (ns *NetlinkSocket) EPollReceive(tv *syscall.Timeval) ([]syscall.NetlinkMessage, error)
- func (ns *NetlinkSocket) EPollReceiveFrom(tv *syscall.Timeval) ([]syscall.NetlinkMessage, syscall.Sockaddr, error)
- func (ns *NetlinkSocket) Receive() ([]syscall.NetlinkMessage, error)
- func (ns *NetlinkSocket) ReceiveFrom() ([]syscall.NetlinkMessage, syscall.Sockaddr, error)
- func (ns *NetlinkSocket) Send(request *NetlinkRequest) error
- func (ns *NetlinkSocket) SetFilter(filters []bpf.Instruction) error
- func (ns *NetlinkSocket) SetTimeout(timeout time.Duration) error
- func (ns *NetlinkSocket) Write(request *NetlinkRequest) error
- type ProcCnMcastOp
- type ProcEvent
- type ProcEventAck
- type ProcEventComm
- type ProcEventCoreDump
- type ProcEventData
- type ProcEventExec
- type ProcEventExit
- type ProcEventFork
- type ProcEventGid
- type ProcEventNone
- type ProcEventPtrace
- type ProcEventSid
- type ProcEventType
- type ProcEventUid
Constants ¶
View Source
const ( SizeofCnMsg = 0x14 SizeofProcCnMcastOp = 0x04 SizeofProcEventHeader = 0x10 SizeofProcEventData = 0x18 )
View Source
const ( CN_IDX_PROC = 0x1 CN_VAL_PROC = 0x1 )
View Source
const ( PROC_EVENT_NONE = 0x00000000 PROC_EVENT_FORK = 0x00000001 PROC_EVENT_EXEC = 0x00000002 PROC_EVENT_UID = 0x00000004 PROC_EVENT_GID = 0x00000040 PROC_EVENT_SID = 0x00000080 PROC_EVENT_PTRACE = 0x00000100 PROC_EVENT_COMM = 0x00000200 PROC_EVENT_COREDUMP = 0x40000000 PROC_EVENT_EXIT = 0x80000000 )
View Source
const ( TCP_ESTABLISHED = iota TCP_SYN_SENT TCP_SYN_RECV TCP_FIN_WAIT1 TCP_FIN_WAIT2 TCP_TIME_WAIT TCP_CLOSE TCP_CLOSE_WAIT TCP_LAST_ACK TCP_LISTEN TCP_CLOSING )
netinet/tcp.h
View Source
const (
SOCK_DIAG_BY_FAMILY = 20 // linux/sock_diag.h
)
View Source
const (
SizeofInetDiagReqV2 = 0x38
)
View Source
const (
TCP_ALL = 0xFFF
)
Variables ¶
View Source
var DiagFamilyMap = map[uint8]string{ syscall.AF_INET: "tcp", syscall.AF_INET6: "tcp6", }
View Source
var TcpStatesMap = map[uint8]string{ TCP_ESTABLISHED: "established", TCP_SYN_SENT: "syn_sent", TCP_SYN_RECV: "syn_recv", TCP_FIN_WAIT1: "fin_wait1", TCP_FIN_WAIT2: "fin_wait2", TCP_TIME_WAIT: "time_wait", TCP_CLOSE: "close", TCP_CLOSE_WAIT: "close_wait", TCP_LAST_ACK: "last_ack", TCP_LISTEN: "listen", TCP_CLOSING: "closing", }
Functions ¶
This section is empty.
Types ¶
type InetDiagMsg ¶
type InetDiagMsg struct { IDiagFamily uint8 IDiagState uint8 IDiagTimer uint8 IDiagRetrans uint8 Id InetDiagSockId IDiagExpires uint32 IDiagRqueue uint32 IDiagWqueue uint32 IDiagUid uint32 IDiagInode uint32 }
func ParseInetDiagMsg ¶
func ParseInetDiagMsg(data []byte) *InetDiagMsg
func (*InetDiagMsg) String ¶
func (msg *InetDiagMsg) String() string
type InetDiagReqV2 ¶
type InetDiagReqV2 struct { SDiagFamily uint8 SDiagProtocol uint8 IDiagExt uint8 Pad uint8 IDiagStates uint32 Id InetDiagSockId }
func NewInetDiagReqV2 ¶
func NewInetDiagReqV2(family, protocol uint8, states uint32) *InetDiagReqV2
func (*InetDiagReqV2) Len ¶
func (req *InetDiagReqV2) Len() int
func (*InetDiagReqV2) Serialize ¶
func (req *InetDiagReqV2) Serialize() []byte
type InetDiagSockId ¶
type InetDiagSockId struct { IDiagSPort be16 IDiagDPort be16 IDiagSrc [4]be32 IDiagDst [4]be32 IDiagIf uint32 IDiagCookie [2]uint32 }
linux/inet_diag.h
func (*InetDiagSockId) DstIP ¶
func (id *InetDiagSockId) DstIP() net.IP
func (*InetDiagSockId) DstIPv4 ¶
func (id *InetDiagSockId) DstIPv4() net.IP
func (*InetDiagSockId) DstIPv6 ¶
func (id *InetDiagSockId) DstIPv6() net.IP
func (*InetDiagSockId) SrcIP ¶
func (id *InetDiagSockId) SrcIP() net.IP
func (*InetDiagSockId) SrcIPv4 ¶
func (id *InetDiagSockId) SrcIPv4() net.IP
func (*InetDiagSockId) SrcIPv6 ¶
func (id *InetDiagSockId) SrcIPv6() net.IP
func (*InetDiagSockId) String ¶
func (id *InetDiagSockId) String() string
type NetlinkProtocol ¶
type NetlinkProtocol int
type NetlinkRequest ¶
type NetlinkRequest struct { syscall.NlMsghdr Data []NetlinkRequestData }
linux/netlink.h
func NewNetlinkRequest ¶
func NewNetlinkRequest(nlmsg, flags int) *NetlinkRequest
func (*NetlinkRequest) AddData ¶
func (req *NetlinkRequest) AddData(data NetlinkRequestData)
func (*NetlinkRequest) Serialize ¶
func (req *NetlinkRequest) Serialize() []byte
type NetlinkRequestData ¶
type NetlinkSocket ¶
type NetlinkSocket struct {
// contains filtered or unexported fields
}
func NewNetlinkSocket ¶
func NewNetlinkSocket(protocol NetlinkProtocol, bufSize uint, groups ...uint) (*NetlinkSocket, error)
func (*NetlinkSocket) Close ¶
func (ns *NetlinkSocket) Close()
func (*NetlinkSocket) EPollReceive ¶
func (ns *NetlinkSocket) EPollReceive(tv *syscall.Timeval) ([]syscall.NetlinkMessage, error)
/////
func (*NetlinkSocket) EPollReceiveFrom ¶
func (ns *NetlinkSocket) EPollReceiveFrom(tv *syscall.Timeval) ([]syscall.NetlinkMessage, syscall.Sockaddr, error)
/////
func (*NetlinkSocket) Receive ¶
func (ns *NetlinkSocket) Receive() ([]syscall.NetlinkMessage, error)
func (*NetlinkSocket) ReceiveFrom ¶
func (ns *NetlinkSocket) ReceiveFrom() ([]syscall.NetlinkMessage, syscall.Sockaddr, error)
func (*NetlinkSocket) Send ¶
func (ns *NetlinkSocket) Send(request *NetlinkRequest) error
func (*NetlinkSocket) SetFilter ¶
func (ns *NetlinkSocket) SetFilter(filters []bpf.Instruction) error
func (*NetlinkSocket) SetTimeout ¶
func (ns *NetlinkSocket) SetTimeout(timeout time.Duration) error
func (*NetlinkSocket) Write ¶
func (ns *NetlinkSocket) Write(request *NetlinkRequest) error
type ProcCnMcastOp ¶
type ProcCnMcastOp int
const ( PROC_CN_MCAST_LISTEN ProcCnMcastOp PROC_CN_MCAST_IGNORE )
func (*ProcCnMcastOp) Len ¶
func (op *ProcCnMcastOp) Len() int
func (*ProcCnMcastOp) Serialize ¶
func (op *ProcCnMcastOp) Serialize() []byte
type ProcEvent ¶
type ProcEvent struct { What ProcEventType Cpu uint32 Timestamp uint64 Data ProcEventData }
linux/cn_proc.h
func ParseProcEvent ¶
type ProcEventAck ¶
type ProcEventAck struct {
Err uint32
}
type ProcEventComm ¶
type ProcEventCoreDump ¶
type ProcEventData ¶
type ProcEventData interface { }
type ProcEventExec ¶
type ProcEventExit ¶
type ProcEventFork ¶
type ProcEventGid ¶
type ProcEventNone ¶
type ProcEventNone struct{}
type ProcEventPtrace ¶
type ProcEventSid ¶
type ProcEventType ¶
type ProcEventType uint32
Click to show internal directories.
Click to hide internal directories.