@@ -95,15 +95,15 @@ func (w *wireguard) updateConnectionForPeer(p *wgtypes.Peer, connection *v1.Conn
95
95
if lc > handshakeTimeout .Milliseconds () {
96
96
// No initial handshake for too long.
97
97
connection .SetStatus (v1 .ConnectionError , "no initial handshake for %.1f seconds" , lcSec )
98
- cable .RecordConnection (CableDriverName , & w .localEndpoint .Spec , & connection .Endpoint , string (connection .Status ), false )
98
+ cable .RecordConnection (cableDriverName , & w .localEndpoint .Spec , & connection .Endpoint , string (connection .Status ), false )
99
99
100
100
return
101
101
}
102
102
103
103
if tx > 0 || rx > 0 {
104
104
// No handshake, but at least some communication in progress.
105
105
connection .SetStatus (v1 .Connecting , "no initial handshake yet" )
106
- cable .RecordConnection (CableDriverName , & w .localEndpoint .Spec , & connection .Endpoint , string (connection .Status ), false )
106
+ cable .RecordConnection (cableDriverName , & w .localEndpoint .Spec , & connection .Endpoint , string (connection .Status ), false )
107
107
108
108
return
109
109
}
@@ -112,7 +112,7 @@ func (w *wireguard) updateConnectionForPeer(p *wgtypes.Peer, connection *v1.Conn
112
112
if tx > 0 || rx > 0 {
113
113
// All is good.
114
114
connection .SetStatus (v1 .Connected , "Rx=%d Bytes, Tx=%d Bytes" , p .ReceiveBytes , p .TransmitBytes )
115
- cable .RecordConnection (CableDriverName , & w .localEndpoint .Spec , & connection .Endpoint , string (connection .Status ), false )
115
+ cable .RecordConnection (cableDriverName , & w .localEndpoint .Spec , & connection .Endpoint , string (connection .Status ), false )
116
116
saveAndRecordPeerTraffic (& w .localEndpoint .Spec , & connection .Endpoint , now , p .TransmitBytes , p .ReceiveBytes )
117
117
118
118
return
@@ -124,7 +124,7 @@ func (w *wireguard) updateConnectionForPeer(p *wgtypes.Peer, connection *v1.Conn
124
124
// Hard error, really long time since handshake.
125
125
connection .SetStatus (v1 .ConnectionError , "no handshake for %.1f seconds" ,
126
126
handshakeDelta .Seconds ())
127
- cable .RecordConnection (CableDriverName , & w .localEndpoint .Spec , & connection .Endpoint , string (connection .Status ), false )
127
+ cable .RecordConnection (cableDriverName , & w .localEndpoint .Spec , & connection .Endpoint , string (connection .Status ), false )
128
128
129
129
return
130
130
}
@@ -138,14 +138,14 @@ func (w *wireguard) updateConnectionForPeer(p *wgtypes.Peer, connection *v1.Conn
138
138
// Soft error, no traffic, stale handshake.
139
139
connection .SetStatus (v1 .ConnectionError , "no bytes sent or received for %.1f seconds" ,
140
140
lcSec )
141
- cable .RecordConnection (CableDriverName , & w .localEndpoint .Spec , & connection .Endpoint , string (connection .Status ), false )
141
+ cable .RecordConnection (cableDriverName , & w .localEndpoint .Spec , & connection .Endpoint , string (connection .Status ), false )
142
142
}
143
143
144
144
func (w * wireguard ) updatePeerStatus (c * v1.Connection , key * wgtypes.Key ) {
145
145
p , err := w .peerByKey (key )
146
146
if err != nil {
147
147
c .SetStatus (v1 .ConnectionError , "cannot fetch status for peer %s: %v" , key , err )
148
- cable .RecordConnection (CableDriverName , & w .localEndpoint .Spec , & c .Endpoint , string (c .Status ), false )
148
+ cable .RecordConnection (cableDriverName , & w .localEndpoint .Spec , & c .Endpoint , string (c .Status ), false )
149
149
150
150
return
151
151
}
@@ -174,6 +174,6 @@ func saveAndRecordPeerTraffic(localEndpoint, remoteEndpoint *v1.EndpointSpec, lc
174
174
remoteEndpoint .BackendConfig [transmitBytes ] = strconv .FormatInt (tx , 10 )
175
175
remoteEndpoint .BackendConfig [receiveBytes ] = strconv .FormatInt (rx , 10 )
176
176
177
- cable .RecordTxBytes (CableDriverName , localEndpoint , remoteEndpoint , int (tx ))
178
- cable .RecordRxBytes (CableDriverName , localEndpoint , remoteEndpoint , int (rx ))
177
+ cable .RecordTxBytes (cableDriverName , localEndpoint , remoteEndpoint , int (tx ))
178
+ cable .RecordRxBytes (cableDriverName , localEndpoint , remoteEndpoint , int (rx ))
179
179
}
0 commit comments