Esempio n. 1
0
void DisplayStatistics(const RECT& rect, const Stats& stats, HDC& hdc) {
	int xpos = rect.left + 1;
	int ypos = rect.top + 1;
	DisplayElapsedTime(stats.ElapsedTransferTime(), hdc, xpos, ypos);
	DisplaySendProtocolEfficiency(stats.SendProtocolEfficiency(), hdc, xpos, ypos);
	DisplayReceiveProtocolEfficiency(stats.ReceiveProtocolEfficiency(), hdc, xpos, ypos);
	DisplayEffectiveSendBPS(stats.EffectiveSendBPS(), hdc, xpos, ypos);
	DisplayEffectiveReceiveBPS(stats.EffectiveReceiveBPS(), hdc, xpos, ypos);
	DisplayNumPacketsSent(stats.NumPacketsSent(), hdc, xpos, ypos);
	DisplayBitErrorRate(stats.BitErrorRate(), hdc, xpos, ypos);
	//DisplayNumACKs(stats.NumACKs(), hdc, xpos, ypos);
	//DisplayNumNAKs(stats.NumNAKs(), hdc, xpos, ypos);
	DisplayTotalBitsSent(stats.TotalBitsSent(), hdc, xpos, ypos);
	DisplayTotalBitsReceived(stats.TotalBitsReceived(), hdc, xpos, ypos);
	DisplayResponseTime(stats.ResponseTime(), hdc, xpos, ypos);
	DisplayTotalTimeouts(stats.TotalTimeouts(), hdc, xpos, ypos);
	DisplayTotalRequests(stats.TotalRequests(), hdc, xpos, ypos);
	DisplayAverageSendPadding(stats.AverageSendPadding(), hdc, xpos, ypos);
	DisplayAverageReceivePadding(stats.AverageReceivePadding(), hdc, xpos, ypos);
	DisplayPacketsSentPerSecond(stats.PacketsSentPerSecond(), hdc, xpos, ypos);
	DisplayPacketsReceivedPerSecond(stats.PacketsReceivedPerSecond(), hdc, xpos, ypos);
}
Esempio n. 2
0
int HandleStats(CRITICAL_SECTION& section, Stats& stats, int cmd, int value) {
	EnterCriticalSection(&section);
	switch(cmd) {
	case 1:
		stats.SetTotalPacketsSent(value);
	break;
	case 2:
		stats.SetTotalPacketsReceived(value);
	break;
	case 3:
		stats.SetTotalErrors(value);
	break;
	case 4:
		stats.SetTotalACKsReceived(value);
	break;
	case 5:
		stats.SetTotalACKsSent(value);
	break;
	case 6:
		stats.SetTotalNAKsReceived(value);
	break;
	case 7:
		stats.SetTotalNAKsSent(value);
	break;
	case 8:
		stats.SetTotalTimeouts(value);
	break;
	case 9:
		stats.SetTotalPadding(value);
	break;
	case 10:
		stats.SetTotalRequests(value);
	break;
	case 11:
		stats.SetElapsedTime(value);
	break;
	case 12:
		stats.SetUsefulBitsSent(value);
	break;
	case 13:
		stats.SetUsefulBitsReceived(value);
	break;
	case 14:
		stats.SetTotalResponseTime(value);
	break;
	case 15:
		return stats.GetTotalPacketsSent();
	break;
	case 16:
		return stats.GetTotalPacketsReceived();
	break;
	case 17:
		return stats.GetTotalErrors();
	break;
	case 18:
		return stats.GetTotalACKsReceived();
	break;
	case 19:
		return stats.GetTotalACKsSent();
	break;
	case 20:
		return stats.GetTotalNAKsReceived();
	break;
	case 21:
		return stats.GetTotalNAKsSent();
	break;
	case 22:
		return stats.GetTotalTimeouts();
	break;
	case 23:
		return stats.GetTotalPadding();
	break;
	case 24:
		return stats.GetTotalRequests();
	break;
	case 25:
		return stats.GetElapsedTime();
	break;
	case 26:
		return stats.GetUsefulBitsSent();
	break;
	case 27:
		return stats.GetUsefulBitsReceived();
	break;
	case 28:
		return stats.GetTotalResponseTime();
	break;
	case 29:
		return stats.SendProtocolEfficiency();
	break;
	case 30:
		return stats.ReceiveProtocolEfficiency();
	break;
	case 31:
		return stats.EffectiveSendBPS();
	break;
	case 32:
		return stats.EffectiveReceiveBPS();
	break;
	case 33:
		return stats.NumPacketsSent();
	break;
	case 34:
		return stats.BitErrorRate();
	break;
	case 35:
		return stats.NumACKsReceived();
	break;
	case 36:
		return stats.NumACKsSent();
	break;
	case 37:
		return stats.NumNAKsReceived();
	break;
	case 38:
		return stats.NumNAKsSent();
	break;
	case 39:
		return stats.TotalBitsSent();
	break;
	case 40:
		return stats.TotalBitsReceived();
	break;
	case 41:
		return stats.ResponseTime();
	break;
	case 42:
		return stats.ElapsedTransferTime();
	break;
	case 43:
		return stats.TotalTimeouts();
	break;
	case 44:
		return stats.TotalRequests();
	break;
	case 45:
		return stats.AverageSendPadding();
	break;
	case 46:
		return stats.AverageReceivePadding();
	break;
	case 47:
		return stats.PacketsSentPerSecond();
	break;
	case 48:
		return stats.PacketsReceivedPerSecond();
	break;
	default:
	break;
	}
	LeaveCriticalSection(&section);
	return 0;
}