helpers

package
v0.0.0-...-d4ca6f9 Latest Latest
Warning

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

Go to latest
Published: May 27, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFamilyFromRawAddr

func GetFamilyFromRawAddr(addr map[string]string) (string, error)

func GetIPFromRawAddr

func GetIPFromRawAddr(addr map[string]string) (string, error)

func GetPathFromRawAddr

func GetPathFromRawAddr(addr map[string]string) (string, error)

func GetPortFromRawAddr

func GetPortFromRawAddr(addr map[string]string) (string, error)

func GetProtoDNSByName

func GetProtoDNSByName(
	event trace.Event,
	argName string,
) (
	trace.ProtoDNS, error,
)

GetProtoDNSByName converts json to ProtoDNS

func GetProtoHTTPByName

func GetProtoHTTPByName(
	event trace.Event,
	argName string,
) (
	trace.ProtoHTTP, error,
)

func GetProtoICMPByName

func GetProtoICMPByName(
	event trace.Event, argName string) (
	trace.ProtoICMP, error)

GetProtoICMPByName converts json to ProtoICMP

func GetProtoICMPv6ByName

func GetProtoICMPv6ByName(
	event trace.Event,
	argName string) (
	trace.ProtoICMPv6,
	error)

GetProtoICMPv6ByName converts json to ProtoICMPv6

func GetProtoIPv4ByName

func GetProtoIPv4ByName(
	event trace.Event,
	argName string) (
	trace.ProtoIPv4,
	error)

GetProtoIPv4ByName converts json to ProtoIPv4

func GetProtoIPv6ByName

func GetProtoIPv6ByName(
	event trace.Event,
	argName string) (
	trace.ProtoIPv6,
	error)

GetProtoIPv6ByName converts json to ProtoIPv6

func GetProtoTCPByName

func GetProtoTCPByName(
	event trace.Event, argName string) (
	trace.ProtoTCP, error)

GetProtoTCPByName converts json to ProtoTCP

func GetProtoUDPByName

func GetProtoUDPByName(
	event trace.Event, argName string) (
	trace.ProtoUDP, error)

GetProtoUDPByName converts json to ProtoUDP

func GetRawAddrArgumentByName

func GetRawAddrArgumentByName(event trace.Event, argName string) (map[string]string, error)

GetRawAddrArgumentByName returns map[string]string of addr argument

func GetTraceeArgumentByName

func GetTraceeArgumentByName(event trace.Event, argName string, opts GetArgOps) (trace.Argument, error)

GetTraceeArgumentByName fetches the argument in event with `Name` that matches argName

func GetTraceeBytesSliceArgumentByName

func GetTraceeBytesSliceArgumentByName(event trace.Event, argName string) ([]byte, error)

GetTraceeBytesSliceArgumentByName gets the argument matching the "argName" given from the event "argv" field, casted as []byte.

func GetTraceeHookedSymbolDataArgumentByName

func GetTraceeHookedSymbolDataArgumentByName(event trace.Event, argName string) ([]trace.HookedSymbolData, error)

GetTraceeHookedSymbolDataArgumentByName returns []trace.HookedSymbolData of hooked symbols for arg

func GetTraceeIntArgumentByName

func GetTraceeIntArgumentByName(event trace.Event, argName string) (int, error)

GetTraceeIntArgumentByName gets the argument matching the "argName" given from the event "argv" field, casted as int.

func GetTraceeSliceStringArgumentByName

func GetTraceeSliceStringArgumentByName(event trace.Event, argName string) ([]string, error)

GetTraceeSliceStringArgumentByName gets the argument matching the "argName" given from the event "argv" field, casted as []string.

func GetTraceeStringArgumentByName

func GetTraceeStringArgumentByName(event trace.Event, argName string) (string, error)

GetTraceeStringArgumentByName gets the argument matching the "argName" given from the event "argv" field, casted as string.

func IsElf

func IsElf(bytesArray []byte) bool

IsElf checks if the file starts with an ELF magic.

func IsFileRead

func IsFileRead(flags string) bool

IsFileRead returns whether the passed file permissions string contains o_rdonly or o_rdwr

func IsFileWrite

func IsFileWrite(flags string) bool

IsFileWrite returns whether the passed file permissions string contains o_wronly or o_rdwr

func IsInternetFamily

func IsInternetFamily(addr map[string]string) (bool, error)

func IsMemoryPath

func IsMemoryPath(pathname string) bool

IsMemoryPath checks if a given file path is located under "memfd", "/run/shm/" or "/dev/shm/".

func IsUnixFamily

func IsUnixFamily(addr map[string]string) (bool, error)

Types

type GetArgOps

type GetArgOps struct {
	DefaultArgs bool // Receive default args value (value equals 'nil'). If set to false, will return error if arg not initialized.
}

GetArgOps represents options for arguments getters

Jump to

Keyboard shortcuts

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