Special Version for my friends - missuo

This commit is contained in:
sjlleo
2022-05-24 10:59:38 +08:00
parent b59f0eb9da
commit 738ff949b1
2 changed files with 18 additions and 0 deletions

10
main.go
View File

@@ -25,9 +25,14 @@ var rdnsenable = flag.Bool("rdns", false, "Set whether rDNS will be display")
var routePath = flag.Bool("report", false, "Route Path")
var realtimePrint = flag.Bool("realtime", false, "Output trace results in runtime")
var tablePrint = flag.Bool("table", false, "Output trace results as table")
var version = flag.Bool("V", false, "Check Version")
func flagApply() string {
flag.Parse()
if *version {
printer.Version()
os.Exit(0)
}
ipArg := flag.Args()
if flag.NArg() != 1 {
fmt.Println("Args Error\nUsage : ./nexttrace [-T] [-rdns] [-displayMode <displayMode>] [-d <dataOrigin> ] [ -m <hops> ] [ -p <port> ] [ -q <probes> ] [ -r <parallelrequests> ] <hostname>")
@@ -37,11 +42,13 @@ func flagApply() string {
}
func main() {
if os.Getuid() != 0 {
log.Fatalln("Traceroute requires root/sudo privileges.")
}
domain := flagApply()
ip := util.DomainLookUp(domain)
printer.PrintTraceRouteNav(ip, domain, *dataOrigin)
@@ -98,4 +105,7 @@ func main() {
printer.TracerouteTablePrinter(res)
}
}
printer.SpecialThanks()
}

View File

@@ -5,6 +5,14 @@ import (
"net"
)
func SpecialThanks() {
fmt.Println("\nSpecial thanks to Vincent Young (OwO Network / vincent.moe) for his help and support for this project.")
}
func Version() {
fmt.Println("NextTrace v0.1.2-Beta.missuo-special-version")
}
func PrintTraceRouteNav(ip net.IP, domain string, dataOrigin string) {
fmt.Println("IP Geo Data Provider: " + dataOrigin)