//'syntax = "proto2";' 
package protocol;

import "stats_messages.proto";
import "header.proto";
import "time_common.proto";
import "controller_commands.proto";

message progran_message {
       optional progran_direction msg_dir = 100;
	oneof msg {
              prp_hello hello_msg = 1;
              prp_echo_request echo_request_msg = 2;
	      prp_echo_reply echo_reply_msg = 3;
	      prp_stats_request stats_request_msg = 4;
	      prp_stats_reply stats_reply_msg = 5;
	      prp_sf_trigger sf_trigger_msg = 6;
	      prp_ul_sr_info ul_sr_info_msg = 7;
	      prp_dl_mac_config dl_mac_config_msg = 8;
	}
}

enum progran_direction {
     //option allow_alias = true;
     NOT_SET = 0;
     INITIATING_MESSAGE = 1;
     SUCCESSFUL_OUTCOME=2;
     UNSUCCESSFUL_OUTCOME=3;	
}
	
enum progran_err {
        option allow_alias = true;
	// message errors
	NO_ERR = 0;	
	MSG_DEQUEUING = -1;
	MSG_ENQUEUING = -2;
	MSG_DECODING = -3;
	MSG_ENCODING = -4;
	MSG_BUILD = -5;
	MSG_NOT_SUPPORTED = -6; 
	MSG_NOT_HANDLED = -7;
	MSG_NOT_VALIDATED = -8;
	MSG_OUT_DATED = -9;

	
	// other erros
	UNEXPECTED = -100;	
}	

//
// Maintenance and discovery messages
//

message prp_hello {
	optional prp_header header = 1;
}

message prp_echo_request {
	optional prp_header header = 1;
	extensions 100 to 199;
}


message prp_echo_reply {
	optional prp_header header = 1;
	extensions 100 to 199;
}


//
// Statistics request and reply message
//

message prp_stats_request {
	optional prp_header header = 1;
	optional prp_stats_type type = 2;
	oneof body {
	      prp_complete_stats_request complete_stats_request = 3;
	      prp_cell_stats_request cell_stats_request = 4;
	      prp_ue_stats_request ue_stats_request = 5;
	}
}

message prp_stats_reply {
	optional prp_header header = 1;
	repeated prp_ue_stats_report ue_report = 2;
	repeated prp_cell_stats_report cell_report = 3;
}

//
// Time indication messages
//

message prp_sf_trigger {
	optional prp_header header = 1;
	optional uint32 sfn_sf = 2;
	repeated prp_dl_info dl_info = 3;
	repeated prp_ul_info ul_info = 4;	
}

//
// Asynchronous messages
//

message prp_ul_sr_info {
	optional prp_header header = 1;
	optional uint32 sfn_sf = 2;
	repeated uint32 rnti = 3;
}

//
// Controller command messages
//

message prp_dl_mac_config {
	optional prp_header header = 1;
	optional uint32 sfn_sf = 2;
	repeated prp_dl_data dl_ue_data = 3;
	repeated prp_dl_rar dl_rar = 4;
	repeated prp_dl_broadcast dl_broadcast = 5;
	repeated prp_pdcch_ofdm_sym_count ofdm_sym = 6; // OFDM symbol count for each CC
}

// Extensions of the echo request and reply
// messages for carrying a latency value in ms
message prp_echo_request_latency {
	extend prp_echo_request {
	       optional uint32 latency = 100;
	}
}

message prp_echo_reply_latency {
	extend prp_echo_reply {
	       optional uint32 latency = 100;
	}
}