]> Cypherpunks.ru repositories - govpn.git/commitdiff
Ability to decrease verbosity
authorSergey Matveev <stargrave@stargrave.org>
Sun, 10 Aug 2014 15:28:39 +0000 (19:28 +0400)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 10 Aug 2014 15:28:39 +0000 (19:28 +0400)
Signed-off-by: Sergey Matveev <stargrave@stargrave.org>
govpn.go

index fbe4969703af2dddbc67caaaa14225a8a818e702..60c8080ffb98739c63ff957d43f9b4b6afbda814 100644 (file)
--- a/govpn.go
+++ b/govpn.go
@@ -68,6 +68,7 @@ var (
        ifaceName  = flag.String("iface", "tap0", "TAP network interface")
        keyHex     = flag.String("key", "", "Authentication key")
        mtu        = flag.Int("mtu", 1500, "MTU")
        ifaceName  = flag.String("iface", "tap0", "TAP network interface")
        keyHex     = flag.String("key", "", "Authentication key")
        mtu        = flag.Int("mtu", 1500, "MTU")
+       verbose    = flag.Bool("v", false, "Increase verbosity")
 )
 
 func main() {
 )
 
 func main() {
@@ -219,7 +220,9 @@ func main() {
                        if _, err := iface.Write(buf[S20BS : S20BS+len(udpPkt.data)-NonceSize-poly1305.TagSize]); err != nil {
                                log.Println("Error writing to iface")
                        }
                        if _, err := iface.Write(buf[S20BS : S20BS+len(udpPkt.data)-NonceSize-poly1305.TagSize]); err != nil {
                                log.Println("Error writing to iface")
                        }
-                       fmt.Print("r")
+                       if *verbose {
+                               fmt.Print("r")
+                       }
                case ethPkt = <-ethSink:
                        if len(ethPkt) > maxIfacePktSize {
                                panic("Too large packet on interface")
                case ethPkt = <-ethSink:
                        if len(ethPkt) > maxIfacePktSize {
                                panic("Too large packet on interface")
@@ -239,7 +242,9 @@ func main() {
                        if err != nil {
                                log.Println("Error sending UDP", err)
                        }
                        if err != nil {
                                log.Println("Error sending UDP", err)
                        }
-                       fmt.Print("w")
+                       if *verbose {
+                               fmt.Print("w")
+                       }
                }
        }
 }
                }
        }
 }