X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fgovpn%2Fpeer.go;fp=src%2Fcypherpunks.ru%2Fgovpn%2Fpeer.go;h=a9c0aaae8dbe386dad397e2df97aaea3a7ee9d03;hb=1d2934f480f71d41eab85e7de9e97b3dafaaf81a;hp=4b48cec43ee983f082de34d8569ec8133d56dc1b;hpb=c5346a23f86bcc9fd1f8c0925618f137c454d86e;p=govpn.git diff --git a/src/cypherpunks.ru/govpn/peer.go b/src/cypherpunks.ru/govpn/peer.go index 4b48cec..a9c0aaa 100644 --- a/src/cypherpunks.ru/govpn/peer.go +++ b/src/cypherpunks.ru/govpn/peer.go @@ -64,6 +64,19 @@ func newNonceCipher(key *[32]byte) *xtea.Cipher { } type Peer struct { + // Statistics (they are at the beginning for correct int64 alignment) + BytesIn uint64 + BytesOut uint64 + BytesPayloadIn uint64 + BytesPayloadOut uint64 + FramesIn uint64 + FramesOut uint64 + FramesUnauth uint64 + FramesDup uint64 + HeartbeatRecv uint64 + HeartbeatSent uint64 + + // Basic Addr string Id *PeerId Conn io.Writer @@ -95,18 +108,6 @@ type Peer struct { LastSent time.Time willSentCycle time.Time - // Statistics - BytesIn uint64 - BytesOut uint64 - BytesPayloadIn uint64 - BytesPayloadOut uint64 - FramesIn uint64 - FramesOut uint64 - FramesUnauth uint64 - FramesDup uint64 - HeartbeatRecv uint64 - HeartbeatSent uint64 - // Receiver BusyR sync.Mutex `json:"-"` bufR []byte