core

package
v0.0.0-...-2ec37ed Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name    = "opensnitch-daemon"
	Version = "1.7.0"
	Author  = "Simone 'evilsocket' Margaritelli"
	Website = "https://github.com/evilsocket/opensnitch"
)

version related consts

Variables

View Source
var (
	// IPv6Enabled indicates if IPv6 protocol is enabled in the system
	IPv6Enabled = Exists("/proc/sys/net/ipv6")
)

Functions

func CheckSysRequirements

func CheckSysRequirements()

CheckSysRequirements checks system features we need to work properly

func ConcatStrings

func ConcatStrings(args ...string) string

ConcatStrings joins the provided strings.

func Exec

func Exec(executable string, args []string) (string, error)

Exec spawns a new process and reurns the output.

func Exists

func Exists(path string) bool

Exists checks if a path exists.

func ExpandPath

func ExpandPath(path string) (string, error)

ExpandPath replaces '~' shorthand with the user's home directory.

func GetFileModTime

func GetFileModTime(filepath string) (time.Time, error)

GetFileModTime checks if a file has been modified.

func GetHostname

func GetHostname() string

GetHostname returns the name of the host where the daemon is running.

func GetKernelVersion

func GetKernelVersion() string

GetKernelVersion returns the kernel version.

func IsAbsPath

func IsAbsPath(path string) bool

IsAbsPath verifies if a path is absolute or not

func LoadEbpfModule

func LoadEbpfModule(module, path string) (m *elf.Module, err error)

LoadEbpfModule loads the given eBPF module, from the given path if specified. Otherwise t'll try to load the module from several default paths.

func ReadGzipFile

func ReadGzipFile(filename string) ([]byte, error)

ReadGzipFile reads a gzip to text.

func Trim

func Trim(s string) string

Trim remove trailing spaces from a string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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