Documentation ¶
Index ¶
- Constants
- func CloseBlockListener(listener net.Listener) error
- func GetConfigDir() (string, error)
- func GetProcStartTime(pid uint32) (uint64, error)
- func GetTcpRemoteAddr(conn *net.TCPConn) (*net.TCPAddr, error)
- func GuaranteeDir(path string) error
- func IsPid(pid string) bool
- func MarshalJson(v interface{}) (string, error)
- func MarshalPackage(pkg DataPackage, proto string) []byte
- func MegaAdd(src interface{}, tgt interface{}) (interface{}, bool, error)
- func MegaDel(src interface{}, tgt interface{}) (interface{}, bool, error)
- func MegaDial(network string, lAddr net.Addr, rAddr net.Addr) (net.Conn, error)
- func MegaExist(src interface{}, tgt interface{}) bool
- func MegaInsert(src interface{}, tgt interface{}, index int) (interface{}, bool, error)
- func ParseCGroup2FromBuf(in []byte) string
- func ParsePPidFromBuf(in []byte) string
- func PromotePrivilege(actionId string, uid uint32, pid uint32, time uint64) error
- func RunScript(path string, params []string) ([]byte, error)
- func SetConnOptTrn(conn net.Conn) error
- func SetSockOptTrn(fd int) error
- type BaseAddr
- type DataPackage
Constants ¶
View Source
const ( SoOriginalDst = 80 Ip6SoOriginalDst = 80 // from linux/include/uapi/linux/netfilter_ipv6/ip6_tables.h ConfigPath = "deepin-proxy" )
Variables ¶
This section is empty.
Functions ¶
func CloseBlockListener ¶
fd may block if add to file, set as non block then close
func GetProcStartTime ¶
get start time from /proc/pid/stat
func GetTcpRemoteAddr ¶
get origin destination addr
func MarshalPackage ¶
func MarshalPackage(pkg DataPackage, proto string) []byte
marshal data, now only useful for udp
func MegaExist ¶
func MegaExist(src interface{}, tgt interface{}) bool
check if target exist in slice
func MegaInsert ¶
mega insert elem to slice
func ParseCGroup2FromBuf ¶
parse cgroup v2 message from /proc/pid/cgroup
func PromotePrivilege ¶
Types ¶
type BaseAddr ¶
addr type for udp and tcp
func ParseRemoteAddrFromMsgHdr ¶
ParseRemoteAddrFromMsgHdr parse origin remote addr msg from msg_hdr
type DataPackage ¶
Click to show internal directories.
Click to hide internal directories.