]> Sergey Matveev's repositories - vors.git/blobdiff - internal/var.go
Consider overhead length in statistics
[vors.git] / internal / var.go
index b4cb3ff551c66779fcb787a259d7a09c0377167c4497a2fa08391e93723349ca..8236a4d77bfcf305a1e86c1c3201cb42a27b3bf287ce5c3a35b4d883dd030402 100644 (file)
@@ -1,6 +1,9 @@
 package internal
 
-import "time"
+import (
+       "net"
+       "time"
+)
 
 const (
        TagLen = 8
@@ -15,3 +18,10 @@ var (
        PingTime      = 10 * time.Second
        ScreenRefresh = 200 * time.Millisecond
 )
+
+func IPHdrLen(ip net.IP) uint64 {
+       if ip.To4() == nil {
+               return 40
+       }
+       return 20
+}