count and show transit traffic

This commit is contained in:
orignal 2017-04-27 16:11:37 -04:00
parent 474d52f805
commit cfd3c3628e
3 changed files with 27 additions and 15 deletions

View file

@ -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 ()