# Functions
AdjustFileACLs takes the given fs path, tries to load the access file acl of that path and adds ACL rules rwx for the SUDO_UID and r-x for the SUDO_GID group.
BridgeByName returns a *netlink.Bridge referenced by its name.
ContainerNSToPID resolves the name of a container via the "/run/netns/<CONTAINERNAME>" to its PID.
ConvertEnvs converts env variables passed as a map to a list of them.
CopyFile copies a file from src to dst.
CopyFileContents copies the contents of the file named src to the file named by dst.
CreateDirectory creates a directory by a path with a mode/permission specified by perm.
CreateFile writes content to a file by path `file`.
DeleteNetnsSymlink deletes a network namespace and removes the symlink created by LinkContainerNS func.
DirExists returns true if a dir referenced by path exists & accessible.
EthtoolTXOff disables TX checksum offload on specified interface.
ExpandEnvVarsInStrSlice makes an in-place expansion of env vars in a slice of strings.
ExpandHome expands `~` char in the path to home path of a current user in provided path p.
ExtractDNSServersFromResolvConf extracts IP addresses of the DNS servers from the resolv.conf-formatted files passed in filenames list.
FileExists returns true if a file referenced by filename exists & accessible.
FileLines opens a file by the `path` and returns a slice of strings for each line excluding lines that start with `commentStr` or are empty.
FilenameForURL extracts a filename from a given url returns "undefined" when unsuccessful.
FileOrDirExists returns true if a file or dir referenced by path exists & accessible.
FirstLinkIPs returns string representation of the first IPv4/v6 address found for a link referenced by name.
GenerateIPv6ULASubnet creates a random /64 ULA (Unique Local Address) IPv6 subnet in the fd00::/8 range.
GenMac generates a random MAC address for a given OUI.
GetCanonicalImageName produces a canonical image name.
GetKernelVersion returns the parsed OS kernel version.
GetLinksByNamePrefix returns a list of links whose name matches a prefix.
No description provided by the author
No description provided by the author
GetSSHVersion returns the version of the ssh client that is installed on the host.
IsHttpURL checks if the url is a downloadable HTTP URL.
IsKernelModuleLoaded checks if a kernel module is loaded by parsing /proc/modules file.
LinkContainerNS creates a symlink for containers network namespace so that it can be managed by iproute2 utility.
LinkIPs returns IPv4/IPv6 addresses assigned to a link referred by its name.
LoadEnvVarFiles load EnvVars from the given files, resolving relative paths.
LoadSSHPubKeysFromFiles parses openssh keys from the files referenced by the paths and returns a slice of ssh.PublicKey pointers.
MergeMaps merges all dictionaries and return a new dictionary recursively if matching keys are both dictionaries.
MergeStringMaps merges all string maps and return a new map maps that are passed for merging will not be changed merging to empty maps return an empty map merging nils return nil.
MergeStringSlices merges string slices with duplicates removed.
NewHTTPClient creates a new HTTP client with insecure skip verify set to true and min TLS version set to 1.2.
NSEthtoolTXOff EthtoolTXOff wrapper that can be handed straight to Node.ExecFunc().
PauseProcessGroup sends the SIGSTOP signal to a process group, causing all the processes within the group to be Paused e.g.
Pointer returns a pointer to a value of any type.
No description provided by the author
No description provided by the author
ResolvePath resolves a string path by expanding `~` to home dir or resolving a relative path by joining it with the base path.
SetUIDAndGID changes the UID and GID of the given path recursively to the values taken from SUDO_UID and SUDO_GID.
SpawnCLIviaExec spawns a CLI session over container runtime exec function end ensures the CLI is available to be used for sending commands over.
StringInSlice checks if a slice contains `val` string and returns slice index if true.
ToEnvKey capitalizes and removes special chars from a string to is used as an environment variable key.
UnpauseProcessGroup send the SIGCONT to the given ProcessGroup identified by its ID.
# Constants
linux/ethtool.h.
linux/ethtool.h.
linux/if.h.
linux/sockios.h.
No description provided by the author
# Variables
map of the cli exec command and its argument per runtime which is used to spawn CLI session.
IfWaitScript is used in ENTRYPOINT/CMD of the nodes that need to ensure that all of the clab links/interfaces are available in the container before calling the main process.
map of commands per platform which start a CLI app.
# Structs
EthtoolValue linux/ethtool.h 'struct ethtool_value'.
IFReqData linux/if.h 'struct ifreq'.
KernelVersion holds the parsed OS kernel version.