Documentation
¶
Overview ¶
Package cmd commands
Package cmd commands
Index ¶
Constants ¶
View Source
const ( // API is the URL of ifconfig network info API API string = "https://ifconfig.is/json/" )
Variables ¶
View Source
var ( // IPType4 is the type of IP address to use for IPv4 IPType4 = IPType{ Type: "4", ListenAddr: "0.0.0.0", Network: "ip4", ICMPNetwork: "ip4:icmp", ProtocolNumber: 1, RequestMessageType: ipv4.ICMPTypeEcho, ReplyMessageType: ipv4.ICMPTypeEchoReply, } // IPType6 is the type of IP address to use for IPv6 IPType6 = IPType{ Type: "6", ListenAddr: "::", Network: "ip6", ICMPNetwork: "ip6:ipv6-icmp", ProtocolNumber: 58, RequestMessageType: ipv6.ICMPTypeEchoRequest, ReplyMessageType: ipv6.ICMPTypeEchoReply, } )
View Source
var ( Name = configName Version = "- not set -" Commit = "snapshot" Date = "" )
Version, Build Commit and Date are filled in during build by the Makefile noinspection GoUnusedGlobalVariable
View Source
var ( QueryCmd = &cobra.Command{ Use: "query", Short: "Query host ip information", Long: ``, RunE: runQuery, SilenceUsage: true, } )
View Source
var ( // RootCmd function to execute in tests RootCmd = &cobra.Command{ Use: "tcping2", Short: "tcping2 – open port probe and ip info command line tool, supporting ICMP, TCP and HTTP protocols", Long: `Tcping2 is a ip probe command line tool, supporting ICMP and TCP protocols It may also run an httptrace and ip traces (using system mtr installation). You can also use it to query IP network information from https://ifconfig.is. it has an echo server and client function to check not yet available service ports`, } )
Functions ¶
Types ¶
type DescMTR ¶
type DescMTR struct { Src string `json:"src"` Dst string `json:"dst"` Tos int `json:"tos"` Tests int `json:"tests"` Psize string `json:"psize"` Bitpattern string `json:"bitpattern"` }
DescMTR is a struct that contains the MTR call information
type HTTPing ¶
type HTTPing struct { URL string Proxy bool Scheme string DNS int64 TCP int64 TLS int64 Process int64 Transfer int64 Total int64 }
HTTPing is a struct that contains the statistics of the httping
type HopsMTR ¶
type HopsMTR struct { Count int `json:"count"` Host string `json:"host"` Loss float64 `json:"Loss%"` Snt int `json:"Snt"` Last float64 `json:"Last"` Avg float64 `json:"Avg"` Best float64 `json:"Best"` Wrst float64 `json:"Wrst"` StDev float64 `json:"StDev"` }
HopsMTR is a struct that contains the MTR hop information
type IPInfo ¶
type IPInfo struct { IP string Continent string `json:"Continent"` Country string `json:"Country"` City string `json:"City"` Latitude float64 `json:"Latitude"` Longitude float64 `json:"Longitude"` TimeZone string `json:"TimeZone"` ASN uint `json:"ASN"` ORG string `json:"Organization"` }
IPInfo is the struct of IP information
type IPType ¶
type IPType struct { Type string ListenAddr string Network string ICMPNetwork string ProtocolNumber int RequestMessageType icmp.Type ReplyMessageType icmp.Type }
IPType is a struct that contains the type of IP address to use
type MTR ¶
type MTR struct {
Report ReportMTR `json:"report"`
}
MTR is a struct that contains the MTR report
Source Files
¶
Click to show internal directories.
Click to hide internal directories.