|
|
|
@ -18,7 +18,7 @@ func init() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var nattestc NatTesterClient
|
|
|
|
|
var nettests NatTesterServer
|
|
|
|
|
var nattests NatTesterServer
|
|
|
|
|
|
|
|
|
|
var natc NatClient
|
|
|
|
|
var nats NatServer
|
|
|
|
@ -61,6 +61,13 @@ func init() {
|
|
|
|
|
CmdNatClient.Flags().IntVarP(&nattestc.Timeout, "timeout", "t", 2, "超时时间")
|
|
|
|
|
CmdNatClient.Flags().StringSliceVarP(&nattestc.dns, "dns", "d", nil, "自定义dns服务器")
|
|
|
|
|
Cmd.AddCommand(CmdNatClient)
|
|
|
|
|
|
|
|
|
|
CmdNatServer.Flags().StringVarP(&nattests.MainIP, "main-ip", "m", "10.0.0.5", "主IP")
|
|
|
|
|
CmdNatServer.Flags().StringVarP(&nattests.AltIP, "alt-ip", "a", "10.0.0.2", "备用IP")
|
|
|
|
|
CmdNatServer.Flags().StringVarP(&nattests.MainPort, "main-port", "M", "41127", "主端口")
|
|
|
|
|
CmdNatServer.Flags().StringVarP(&nattests.AltPort, "alt-port", "A", "46610", "备用端口")
|
|
|
|
|
CmdNatServer.Flags().StringVarP(&nattests.LogPath, "log", "l", "", "日志文件")
|
|
|
|
|
Cmd.AddCommand(CmdNatServer)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var CmdNatPClient = &cobra.Command{
|
|
|
|
@ -86,8 +93,8 @@ var CmdNatPServer = &cobra.Command{
|
|
|
|
|
|
|
|
|
|
var CmdNatClient = &cobra.Command{
|
|
|
|
|
Use: "natc",
|
|
|
|
|
Short: "nat类型测试工具",
|
|
|
|
|
Long: "基于RFC3489的nat类型测试工具",
|
|
|
|
|
Short: "nat类型测试工具 - 客户端",
|
|
|
|
|
Long: "基于RFC3489的nat类型测试工具(客户端)",
|
|
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
|
if nattestc.dns != nil {
|
|
|
|
|
UseCustomeDNS(nattestc.dns)
|
|
|
|
@ -112,6 +119,15 @@ var CmdNatClient = &cobra.Command{
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var CmdNatServer = &cobra.Command{
|
|
|
|
|
Use: "nats",
|
|
|
|
|
Short: "nat类型测试工具 - 服务端",
|
|
|
|
|
Long: "基于RFC3489的nat类型测试工具(服务端)",
|
|
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
|
nattests.Run()
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var CmdNetTrace = &cobra.Command{
|
|
|
|
|
Use: "trace",
|
|
|
|
|
Short: "网络路径追踪",
|
|
|
|
|