Documentation ¶
Index ¶
- func GetHostGatewayIP() (string, error)
- func PMTUProbeToDestIP(dstIP string) (int, error)
- func RunDNSLookupUsingCustomResolver(nameserver, hostFQDN string) ([]string, error)
- func SendRecvHTTPMessage(url string, token string, body *[]byte) (int, error)
- func SendRecvICMPMessage(dstIP string, payloadSize int, dontFragment bool) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHostGatewayIP ¶
GetHostGatewayIP returns the IP of the default gw as listed in the route list
func PMTUProbeToDestIP ¶
PMTUProbeToDestIP runs ICMP pings to destination with varying payload size and returns the highest MTU that works. Currently works for IPv4 only
func RunDNSLookupUsingCustomResolver ¶
RunDNSLookupUsingCustomResolver sends a dns lookup for hostFQDN to DNS server specified by nameserver. run dns lookup using github.com/miekg/dns code referenced from: https://github.com/bogdanovich/dns_resolver nameserver string format: "ip:port" hostFQDN string format: "abc.def.ghi."
func SendRecvHTTPMessage ¶
SendRecvHTTPMessage sends out a HTTP GET request to the url specified add token to X-Auth-Token as a Bearer token if token is specified Return body from GET response as part of body *[]byte
func SendRecvICMPMessage ¶
SendRecvICMPMessage checks if icmp ping is successful. Looks at 2 icmp packets for required response returncode: 0 - no error. Echo reply received successfully
1 - Fragmentation required 2 - got icmp but unknwon type
Types ¶
This section is empty.