Documentation ¶
Overview ¶
Package misc are some small helper functions used throughout the xtcp code
It is perhaps poor form to name a module "misc", could be renamed to "utils"
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // KernelEnumToString maps kernel enum to human string for the IP protocol KernelEnumToString = map[uint8]string{ uint8(2): "v4", uint8(10): "v6", } )
Functions ¶
func CheckFilePermissions ¶
CheckFilePermissions checks the permission bits on a filename 0755 e.g. pass filename and the permissions you want to check This is a crude string comparisions, and does NOT look at who is running this code, or the ownership of the file in question
func DieIfNotLinux ¶
func DieIfNotLinux()
DieIfNotLinux as the name suggests kills this program if we aren't running on linux We only support Linux Although I think Darwin has netlink also TODO - test Darwin
func GetHostname ¶
func GetHostname() string
GetHostname is a little gethostname helper with fatal error check arguably this function shouldn't exist
func MaxLoopsOrForEver ¶
MaxLoopsOrForEver returns true if maxloops == 0, or pollingLoops < maxloops This function just allows us to embed if logic into the main pollingLoops for statement
func PrintMemUsage ¶
func PrintMemUsage()
PrintMemUsage uses the go runtime libary to print out current memory usage
Types ¶
This section is empty.