utils

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArpReqWithCtx

func ArpReqWithCtx(ctx context.Context, rCh chan<- int, AdvIP net.IP, ifName string) (int, error)

ArpReqWithCtx - sends a arp req given the DIP, SIP and interface name

func ArpResolver

func ArpResolver(dIP uint32)

ArpResolver - Try to resolve ARP for given address

func FileCreate

func FileCreate(fname string) int

FileCreate - Create a file

func FileExists

func FileExists(fname string) bool

FileExists - Check if file exists

func GetIfaceIpAddr

func GetIfaceIpAddr(ifName string) (addr net.IP, err error)

GetIfaceIpAddr - Get interface IP address

func GratArpReq

func GratArpReq(AdvIP net.IP, ifName string) (int, error)

GratArpReq - sends a gratuitous arp reply given the DIP, SIP and interface name

func GratArpReqWithCtx

func GratArpReqWithCtx(ctx context.Context, rCh chan<- int, AdvIP net.IP, ifName string) (int, error)

GratArpReq - sends a gratuitous arp reply given the DIP, SIP and interface name

func HTTPSProber

func HTTPSProber(urls string, cert tls.Certificate, certPool *x509.CertPool, resp string) bool

HTTPSProber - Do a https probe for given url returns true/false depending on whether probing was successful

func IsIPHostAddr

func IsIPHostAddr(ipString string) bool

IsIPHostAddr - Check if provided address is a local address

func IsIPHostNetAddr

func IsIPHostNetAddr(ip net.IP) bool

IsIPHostNetAddr - Check if provided address is a local subnet

func Ntohll

func Ntohll(i uint64) uint64

Ntohll - Network to host byte-order long long

func ReadPIDFile

func ReadPIDFile(pf string) int

ReadPIDFile - Read a PID file

func SendArpReq

func SendArpReq(AdvIP net.IP, ifName string) (int, error)

SendArpReq - sends a arp request given the DIP, SIP and interface name

func WriteFile

func WriteFile(fname, what string) error

WriteFile - Write a string to a file

Types

This section is empty.

Jump to

Keyboard shortcuts

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