mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
count and show transit traffic
This commit is contained in:
parent
474d52f805
commit
cfd3c3628e
3 changed files with 27 additions and 15 deletions
|
@ -11,6 +11,13 @@ namespace i2p
|
|||
{
|
||||
namespace tunnel
|
||||
{
|
||||
static uint64_t m_TotalTransitTrasmittedBytes = 0;
|
||||
|
||||
uint64_t GetTotalTrasitTransmittedBytes ()
|
||||
{
|
||||
return m_TotalTransitTrasmittedBytes;
|
||||
}
|
||||
|
||||
TransitTunnel::TransitTunnel (uint32_t receiveTunnelID,
|
||||
const uint8_t * nextIdent, uint32_t nextTunnelID,
|
||||
const uint8_t * layerKey,const uint8_t * ivKey):
|
||||
|
@ -22,6 +29,7 @@ namespace tunnel
|
|||
void TransitTunnel::EncryptTunnelMsg (std::shared_ptr<const I2NPMessage> in, std::shared_ptr<I2NPMessage> out)
|
||||
{
|
||||
m_Encryption.Encrypt (in->GetPayload () + 4, out->GetPayload () + 4);
|
||||
m_TotalTransitTrasmittedBytes += TUNNEL_DATA_MSG_SIZE;
|
||||
}
|
||||
|
||||
TransitTunnelParticipant::~TransitTunnelParticipant ()
|
||||
|
|
|
@ -99,6 +99,8 @@ namespace tunnel
|
|||
const uint8_t * nextIdent, uint32_t nextTunnelID,
|
||||
const uint8_t * layerKey,const uint8_t * ivKey,
|
||||
bool isGateway, bool isEndpoint);
|
||||
|
||||
uint64_t GetTotalTrasitTransmittedBytes ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue