option cc_generic_services = false;

enum ESteamDatagramMsgID {
	k_ESteamDatagramMsg_Invalid = 0;
	k_ESteamDatagramMsg_RouterPingRequest = 1;
	k_ESteamDatagramMsg_RouterPingReply = 2;
	k_ESteamDatagramMsg_GameserverPingRequest = 3;
	k_ESteamDatagramMsg_GameserverPingReply = 4;
	k_ESteamDatagramMsg_GameserverSessionRequest = 5;
	k_ESteamDatagramMsg_GameserverSessionEstablished = 6;
	k_ESteamDatagramMsg_NoSession = 7;
	k_ESteamDatagramMsg_Diagnostic = 8;
	k_ESteamDatagramMsg_DataClientToRouter = 9;
	k_ESteamDatagramMsg_DataRouterToServer = 10;
	k_ESteamDatagramMsg_DataServerToRouter = 11;
	k_ESteamDatagramMsg_DataRouterToClient = 12;
	k_ESteamDatagramMsg_Stats = 13;
	k_ESteamDatagramMsg_ClientPingSampleRequest = 14;
	k_ESteamDatagramMsg_ClientPingSampleReply = 15;
	k_ESteamDatagramMsg_ClientToRouterSwitchedPrimary = 16;
	k_ESteamDatagramMsg_RelayHealth = 17;
}

message CMsgSteamDatagramRouterPingReply {
	optional fixed32 client_timestamp = 1;
	repeated fixed32 latency_datacenter_ids = 2 [packed = true];
	repeated uint32 latency_ping_ms = 3 [packed = true];
	optional fixed32 your_public_ip = 4;
	optional fixed32 server_time = 5;
	optional fixed64 challenge = 6;
	optional uint32 seconds_until_shutdown = 7;
	optional fixed32 client_cookie = 8;
	optional uint32 scoring_penalty_relay_cluster = 9;
	repeated fixed32 scoring_penalty_datacenter_ids = 10 [packed = true];
	repeated uint32 scoring_penalty_values = 11 [packed = true];
}

message CMsgSteamDatagramGameserverPing {
	optional uint32 client_session = 1;
	optional fixed64 client_steam_id = 2;
	optional fixed32 client_timestamp = 3;
	optional fixed32 router_timestamp = 4;
	optional uint32 router_gameserver_latency = 5;
	optional uint32 seq_number_router = 6;
	optional uint32 seq_number_e2e = 7;
}

message CMsgSteamDatagramGameServerAuthTicket {
	message ExtraField {
		optional string name = 1;
		optional string string_value = 2;
		optional sint32 int32_value = 3;
		optional fixed32 fixed32_value = 4;
		optional fixed64 fixed64_value = 5;
	}

	optional fixed32 time_expiry = 1;
	optional fixed64 authorized_steam_id = 2;
	optional fixed32 authorized_public_ip = 3;
	optional fixed64 gameserver_steam_id = 4;
	optional fixed64 gameserver_net_id = 5;
	optional bytes signature = 6;
	optional uint32 app_id = 7;
	repeated .CMsgSteamDatagramGameServerAuthTicket.ExtraField extra_fields = 8;
}

message CMsgSteamDatagramGameserverSessionRequest {
	optional .CMsgSteamDatagramGameServerAuthTicket ticket = 1;
	optional fixed32 challenge_time = 3;
	optional fixed64 challenge = 4;
	optional fixed32 client_cookie = 5;
	optional uint32 network_config_version = 6;
}

message CMsgSteamDatagramGameserverSessionEstablished {
	optional fixed32 client_cookie = 1;
	optional fixed64 gameserver_steam_id = 3;
	optional uint32 seconds_until_shutdown = 4;
	optional uint32 session_id = 5;
}

message CMsgSteamDatagramNoSession {
	optional fixed32 client_cookie = 7;
	optional fixed32 your_public_ip = 2;
	optional fixed32 server_time = 3;
	optional fixed64 challenge = 4;
	optional uint32 seconds_until_shutdown = 5;
}

message CMsgSteamDatagramDiagnostic {
	optional uint32 severity = 1;
	optional string text = 2;
}

message CMsgSteamDatagramDataCenterState {
	message Server {
		optional string address = 1;
		optional uint32 ping_ms = 2;
	}

	message DataCenter {
		optional string code = 1;
		repeated .CMsgSteamDatagramDataCenterState.Server server_sample = 2;
	}

	repeated .CMsgSteamDatagramDataCenterState.DataCenter data_centers = 1;
}

message CMsgSteamDatagramLinkInstantaneousStats {
	optional uint32 out_packets_per_sec_x10 = 1;
	optional uint32 out_bytes_per_sec = 2;
	optional uint32 in_packets_per_sec_x10 = 3;
	optional uint32 in_bytes_per_sec = 4;
	optional uint32 ping_ms = 5;
	optional uint32 packets_dropped_pct = 6;
	optional uint32 packets_weird_sequence_pct = 7;
	optional uint32 peak_jitter_usec = 8;
}

message CMsgSteamDatagramLinkLifetimeStats {
	optional uint64 packets_sent = 3;
	optional uint64 kb_sent = 4;
	optional uint64 packets_recv = 5;
	optional uint64 kb_recv = 6;
	optional uint64 packets_recv_sequenced = 7;
	optional uint64 packets_recv_dropped = 8;
	optional uint64 packets_recv_out_of_order = 9;
	optional uint64 packets_recv_duplicate = 10;
	optional uint64 packets_recv_lurch = 11;
	optional uint32 quality_histogram_100 = 21;
	optional uint32 quality_histogram_99 = 22;
	optional uint32 quality_histogram_97 = 23;
	optional uint32 quality_histogram_95 = 24;
	optional uint32 quality_histogram_90 = 25;
	optional uint32 quality_histogram_75 = 26;
	optional uint32 quality_histogram_50 = 27;
	optional uint32 quality_histogram_1 = 28;
	optional uint32 quality_histogram_dead = 29;
	optional uint32 quality_ntile_2nd = 30;
	optional uint32 quality_ntile_5th = 31;
	optional uint32 quality_ntile_25th = 32;
	optional uint32 quality_ntile_50th = 33;
	optional uint32 ping_histogram_25 = 41;
	optional uint32 ping_histogram_50 = 42;
	optional uint32 ping_histogram_75 = 43;
	optional uint32 ping_histogram_100 = 44;
	optional uint32 ping_histogram_125 = 45;
	optional uint32 ping_histogram_150 = 46;
	optional uint32 ping_histogram_200 = 47;
	optional uint32 ping_histogram_300 = 48;
	optional uint32 ping_histogram_max = 49;
	optional uint32 ping_ntile_5th = 50;
	optional uint32 ping_ntile_50th = 51;
	optional uint32 ping_ntile_75th = 52;
	optional uint32 ping_ntile_95th = 53;
	optional uint32 ping_ntile_98th = 54;
	optional uint32 jitter_histogram_negligible = 61;
	optional uint32 jitter_histogram_1 = 62;
	optional uint32 jitter_histogram_2 = 63;
	optional uint32 jitter_histogram_5 = 64;
	optional uint32 jitter_histogram_10 = 65;
	optional uint32 jitter_histogram_20 = 66;
}

message CMsgSteamDatagramConnectionQuality {
	optional .CMsgSteamDatagramLinkInstantaneousStats instantaneous = 1;
	optional .CMsgSteamDatagramLinkLifetimeStats lifetime = 2;
}

message CMsgSteamDatagramConnectionStatsClientToRouter {
	optional .CMsgSteamDatagramConnectionQuality c2r = 1;
	optional .CMsgSteamDatagramConnectionQuality c2s = 2;
	optional fixed32 client_timestamp = 3;
	optional fixed32 client_cookie = 8;
	optional uint32 seq_num_c2r = 9;
	optional uint32 seq_num_c2s = 10;
}

message CMsgSteamDatagramConnectionStatsRouterToClient {
	optional .CMsgSteamDatagramConnectionQuality r2c = 1;
	optional .CMsgSteamDatagramConnectionQuality s2c = 2;
	optional fixed32 client_timestamp_from_router = 3;
	optional fixed32 client_timestamp_from_server = 4;
	optional uint32 router_gameserver_latency = 5;
	optional uint32 seconds_until_shutdown = 6;
	optional fixed32 migrate_request_ip = 10;
	optional uint32 migrate_request_port = 11;
	optional uint32 scoring_penalty_relay_cluster = 12;
	optional fixed32 client_cookie = 7;
	optional uint32 seq_num_r2c = 8;
	optional uint32 seq_num_s2c = 9;
}

message CMsgSteamDatagramConnectionStatsRouterToServer {
	optional .CMsgSteamDatagramConnectionQuality r2s = 1;
	optional .CMsgSteamDatagramConnectionQuality c2s = 2;
	optional fixed32 client_timestamp = 3;
	optional fixed32 router_timestamp = 4;
	optional uint32 seq_num_r2s = 5;
	optional uint32 seq_num_c2s = 6;
	optional fixed64 client_steam_id = 7;
	optional uint32 client_session_id = 8;
}

message CMsgSteamDatagramConnectionStatsServerToRouter {
	optional .CMsgSteamDatagramConnectionQuality s2r = 1;
	optional .CMsgSteamDatagramConnectionQuality s2c = 2;
	optional uint32 seq_num_s2r = 3;
	optional uint32 seq_num_s2c = 4;
	optional fixed64 client_steam_id = 5;
	optional uint32 client_session_id = 6;
}

message CMsgSteamDatagramClientPingSampleRequest {
	optional fixed32 client_cookie = 1;
}

message CMsgSteamDatagramClientPingSampleReply {
	message RoutingCluster {
		optional fixed32 id = 1;
		optional uint32 front_ping_ms = 2;
		optional uint32 e2e_ping_ms = 3;
	}

	message DataCenter {
		optional fixed32 data_center_id = 1;
		optional fixed32 via_relay_id = 2;
		optional uint32 e2e_ping_ms = 3;
	}

	optional fixed32 client_cookie = 1;
	repeated .CMsgSteamDatagramClientPingSampleReply.RoutingCluster routing_clusters = 2;
	repeated .CMsgSteamDatagramClientPingSampleReply.DataCenter data_centers = 3;
}

message CMsgSteamDatagramClientSwitchedPrimary {
	message RouterQuality {
		optional uint32 score = 1;
		optional uint32 front_ping = 2;
		optional uint32 back_ping = 3;
		optional uint32 seconds_until_down = 4;
	}

	optional fixed32 client_cookie = 1;
	optional fixed32 from_ip = 2;
	optional uint32 from_port = 3;
	optional fixed32 from_router_cluster = 4;
	optional uint32 from_active_time = 5;
	optional uint32 from_active_packets_recv = 6;
	optional string from_dropped_reason = 7;
	optional uint32 gap_ms = 8;
	optional .CMsgSteamDatagramClientSwitchedPrimary.RouterQuality from_quality_now = 9;
	optional .CMsgSteamDatagramClientSwitchedPrimary.RouterQuality to_quality_now = 10;
	optional .CMsgSteamDatagramClientSwitchedPrimary.RouterQuality from_quality_then = 11;
	optional .CMsgSteamDatagramClientSwitchedPrimary.RouterQuality to_quality_then = 12;
}

message CMsgSteamDatagramRouterHealth {
	message DataCenter {
		optional fixed32 datacenter_id = 1;
		optional uint32 state = 2;
	}

	optional float cpu_load = 1;
	optional uint32 active_sessions = 2;
	optional uint32 data_pkts_sec = 3;
	optional uint32 other_pkts_sec = 4;
	optional uint32 seconds_until_shutdown = 5;
	optional float cpu_cost_per_user = 8;
	optional float cpu_cost_per_packet = 9;
	repeated .CMsgSteamDatagramRouterHealth.DataCenter data_centers = 6;
	optional fixed64 magic = 7;
}

