| 127 | } |
| 128 | |
| 129 | static void ShowTraffic (std::stringstream& s, uint64_t bytes) |
| 130 | { |
| 131 | s << std::fixed << std::setprecision(2); |
| 132 | auto numKBytes = (double) bytes / 1024; |
| 133 | if (numKBytes < 1024) |
| 134 | /* Kibibyte */ |
| 135 | s << numKBytes << " KiB"; |
| 136 | else if (numKBytes < 1024 * 1024) |
| 137 | /* Mebibyte */ |
| 138 | s << (numKBytes / 1024) << " MiB" ; |
| 139 | else |
| 140 | /* Gibibyte */ |
| 141 | s << (numKBytes / 1024 / 1024) << " GiB"; |
| 142 | } |
| 143 | |
| 144 | static void ShowTunnelDetails (std::stringstream& s, enum i2p::tunnel::TunnelState eState, bool explr, int bytes) |
| 145 | { |
no outgoing calls
no test coverage detected