cosmetic: more consistent param/arg/var ordering re Port
This commit is contained in:
1 parent
065b632f91
commit
e89e3adc69
2 files changed
+3
-3
No files matched your search
+1
-1
@@ -18,6 +18,7 @@ const macMaxAge = 10 * time.Minute // [1]
|
|||||||
// /proc/sys/net/ipv4_neigh/*/base_reachable_time_ms on Linux
|
// /proc/sys/net/ipv4_neigh/*/base_reachable_time_ms on Linux
|
||||||
|
|
||||||
type Router struct {
|
type Router struct {
|
||||||
|
Port int
|
||||||
Iface *net.Interface
|
Iface *net.Interface
|
||||||
Ourself *LocalPeer
|
Ourself *LocalPeer
|
||||||
Macs *MacCache
|
Macs *MacCache
|
||||||
@@ -31,7 +32,6 @@ type Router struct {
|
|||||||
ConnLimit int
|
ConnLimit int
|
||||||
BufSz int
|
BufSz int
|
||||||
LogFrame func(string, []byte, *layers.Ethernet)
|
LogFrame func(string, []byte, *layers.Ethernet)
|
||||||
Port int
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type PacketSource interface {
|
type PacketSource interface {
|
||||||
|
|||||||
+2
-2
@@ -36,6 +36,7 @@ func main() {
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
justVersion bool
|
justVersion bool
|
||||||
|
port int
|
||||||
ifaceName string
|
ifaceName string
|
||||||
routerName string
|
routerName string
|
||||||
nickName string
|
nickName string
|
||||||
@@ -46,11 +47,11 @@ func main() {
|
|||||||
peers []string
|
peers []string
|
||||||
connLimit int
|
connLimit int
|
||||||
bufSz int
|
bufSz int
|
||||||
port int
|
|
||||||
httpAddr string
|
httpAddr string
|
||||||
)
|
)
|
||||||
|
|
||||||
flag.BoolVar(&justVersion, "version", false, "print version and exit")
|
flag.BoolVar(&justVersion, "version", false, "print version and exit")
|
||||||
|
flag.IntVar(&port, "port", weave.Port, "router port")
|
||||||
flag.StringVar(&ifaceName, "iface", "", "name of interface to capture/inject from (disabled if blank)")
|
flag.StringVar(&ifaceName, "iface", "", "name of interface to capture/inject from (disabled if blank)")
|
||||||
flag.StringVar(&routerName, "name", "", "name of router (defaults to MAC of interface)")
|
flag.StringVar(&routerName, "name", "", "name of router (defaults to MAC of interface)")
|
||||||
flag.StringVar(&nickName, "nickname", "", "nickname of peer (defaults to hostname)")
|
flag.StringVar(&nickName, "nickname", "", "nickname of peer (defaults to hostname)")
|
||||||
@@ -60,7 +61,6 @@ func main() {
|
|||||||
flag.StringVar(&prof, "profile", "", "enable profiling and write profiles to given path")
|
flag.StringVar(&prof, "profile", "", "enable profiling and write profiles to given path")
|
||||||
flag.IntVar(&connLimit, "connlimit", 30, "connection limit (0 for unlimited)")
|
flag.IntVar(&connLimit, "connlimit", 30, "connection limit (0 for unlimited)")
|
||||||
flag.IntVar(&bufSz, "bufsz", 8, "capture buffer size in MB")
|
flag.IntVar(&bufSz, "bufsz", 8, "capture buffer size in MB")
|
||||||
flag.IntVar(&port, "port", weave.Port, "router port")
|
|
||||||
flag.StringVar(&httpAddr, "httpaddr", fmt.Sprintf(":%d", weave.HTTPPort), "address to bind HTTP interface to (disabled if blank, absolute path indicates unix domain socket)")
|
flag.StringVar(&httpAddr, "httpaddr", fmt.Sprintf(":%d", weave.HTTPPort), "address to bind HTTP interface to (disabled if blank, absolute path indicates unix domain socket)")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
peers = flag.Args()
|
peers = flag.Args()
|
||||||
|
|||||||
Reference in new issue
Block a user