Commit af454ffd authored by Fabrice Nabet's avatar Fabrice Nabet

Merge branch '6-bugfix-wireshark-sfn' into 'develop1B'

Resolve "OAI wireshark log can now display system frame number"

Merge and Closes #6: Resolve "OAI wireshark log can now display system frame number"

See merge request !5
parents af09f298 2e76cb7e
...@@ -651,7 +651,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un ...@@ -651,7 +651,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
if (opt_enabled==1) { if (opt_enabled==1) {
trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0], trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0],
rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id), rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id),
eNB->subframe,0,0); eNB->frame, eNB->subframe,0,0);
LOG_D(OPT,"[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n", LOG_D(OPT,"[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n",
module_idP, CC_id, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length); module_idP, CC_id, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length);
} }
......
...@@ -319,6 +319,7 @@ schedule_SI( ...@@ -319,6 +319,7 @@ schedule_SI(
0xffff, 0xffff,
4, 4,
0xffff, 0xffff,
eNB->frame,
eNB->subframe, eNB->subframe,
0, 0,
0); 0);
......
...@@ -1122,7 +1122,7 @@ schedule_ue_spec( ...@@ -1122,7 +1122,7 @@ schedule_ue_spec(
if (opt_enabled == 1) { if (opt_enabled == 1) {
trace_pdu(1, (uint8_t *)UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0], trace_pdu(1, (uint8_t *)UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0],
TBS, module_idP, 3, UE_RNTI(module_idP,UE_id), TBS, module_idP, 3, UE_RNTI(module_idP,UE_id),
eNB->subframe,0,0); eNB->frame, eNB->subframe,0,0);
LOG_D(OPT,"[eNB %d][DLSCH] CC_id %d Frame %d rnti %x with size %d\n", LOG_D(OPT,"[eNB %d][DLSCH] CC_id %d Frame %d rnti %x with size %d\n",
module_idP, CC_id, frameP, UE_RNTI(module_idP,UE_id), TBS); module_idP, CC_id, frameP, UE_RNTI(module_idP,UE_id), TBS);
} }
......
...@@ -629,7 +629,7 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra ...@@ -629,7 +629,7 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
if (opt_enabled ==1 ) { if (opt_enabled ==1 ) {
trace_pdu(1, (uint8_t *)eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.payload, trace_pdu(1, (uint8_t *)eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.payload,
TBS, module_idP, 6, 0xffff, // M_RNTI = 6 in wirehsark TBS, module_idP, 6, 0xffff, // M_RNTI = 6 in wirehsark
eNB_mac_inst[module_idP].subframe,0,0); eNB_mac_inst[module_idP].frame, eNB_mac_inst[module_idP].subframe,0,0);
LOG_D(OPT,"[eNB %d][MCH] CC_id %d Frame %d : MAC PDU with size %d\n", LOG_D(OPT,"[eNB %d][MCH] CC_id %d Frame %d : MAC PDU with size %d\n",
module_idP, CC_id, frameP, TBS); module_idP, CC_id, frameP, TBS);
} }
......
...@@ -101,7 +101,7 @@ void rx_sdu(const module_id_t enb_mod_idP, ...@@ -101,7 +101,7 @@ void rx_sdu(const module_id_t enb_mod_idP,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_SDU,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_SDU,1);
if (opt_enabled == 1) { if (opt_enabled == 1) {
trace_pdu(0, sduP,sdu_lenP, 0, 3, rntiP,subframeP, 0,0); trace_pdu(0, sduP,sdu_lenP, 0, 3, rntiP, frameP, subframeP, 0,0);
LOG_D(OPT,"[eNB %d][ULSCH] Frame %d rnti %x with size %d\n", LOG_D(OPT,"[eNB %d][ULSCH] Frame %d rnti %x with size %d\n",
enb_mod_idP, frameP, rntiP, sdu_lenP); enb_mod_idP, frameP, rntiP, sdu_lenP);
} }
......
...@@ -280,7 +280,7 @@ void Msg1_tx(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id ...@@ -280,7 +280,7 @@ void Msg1_tx(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id
if (opt_enabled) { if (opt_enabled) {
trace_pdu(0, NULL, 0, module_idP, 2, UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex, trace_pdu(0, NULL, 0, module_idP, 2, UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex,
UE_mac_inst[module_idP].subframe, 0, UE_mac_inst[module_idP].RA_attempt_number); UE_mac_inst[module_idP].frame, UE_mac_inst[module_idP].subframe, 0, UE_mac_inst[module_idP].RA_attempt_number);
LOG_D(OPT,"[UE %d][RAPROC] TX MSG1 Frame %d trace pdu for rnti %x with size %d\n", LOG_D(OPT,"[UE %d][RAPROC] TX MSG1 Frame %d trace pdu for rnti %x with size %d\n",
module_idP, frameP, 1, UE_mac_inst[module_idP].RA_Msg3_size); module_idP, frameP, 1, UE_mac_inst[module_idP].RA_Msg3_size);
} }
...@@ -304,7 +304,7 @@ void Msg3_tx(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id ...@@ -304,7 +304,7 @@ void Msg3_tx(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id
if (opt_enabled) { // msg3 if (opt_enabled) { // msg3
trace_pdu(0, &UE_mac_inst[module_idP].CCCH_pdu.payload[0], UE_mac_inst[module_idP].RA_Msg3_size, trace_pdu(0, &UE_mac_inst[module_idP].CCCH_pdu.payload[0], UE_mac_inst[module_idP].RA_Msg3_size,
module_idP, 3, UE_mac_inst[module_idP].crnti, UE_mac_inst[module_idP].subframe, 0, 0); module_idP, 3, UE_mac_inst[module_idP].crnti, UE_mac_inst[module_idP].frame, UE_mac_inst[module_idP].subframe, 0, 0);
LOG_D(OPT,"[UE %d][RAPROC] MSG3 Frame %d trace pdu Preamble %d with size %d\n", LOG_D(OPT,"[UE %d][RAPROC] MSG3 Frame %d trace pdu Preamble %d with size %d\n",
module_idP, frameP, UE_mac_inst[module_idP].crnti /*UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex*/, UE_mac_inst[module_idP].RA_Msg3_size); module_idP, frameP, UE_mac_inst[module_idP].crnti /*UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex*/, UE_mac_inst[module_idP].RA_Msg3_size);
} }
......
...@@ -126,7 +126,7 @@ unsigned short fill_rar( ...@@ -126,7 +126,7 @@ unsigned short fill_rar(
if (opt_enabled) { if (opt_enabled) {
trace_pdu(1, dlsch_buffer, input_buffer_length, module_idP, 2, 1, trace_pdu(1, dlsch_buffer, input_buffer_length, module_idP, 2, 1,
eNB_mac_inst[module_idP].subframe, 0, 0); eNB_mac_inst[module_idP].frame, eNB_mac_inst[module_idP].subframe, 0, 0);
LOG_D(OPT,"[eNB %d][RAPROC] CC_id %d RAR Frame %d trace pdu for rnti %x and rapid %d size %d\n", LOG_D(OPT,"[eNB %d][RAPROC] CC_id %d RAR Frame %d trace pdu for rnti %x and rapid %d size %d\n",
module_idP, CC_id, frameP, eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].rnti, module_idP, CC_id, frameP, eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].rnti,
rarh->RAPID, input_buffer_length); rarh->RAPID, input_buffer_length);
......
...@@ -347,7 +347,7 @@ ue_send_sdu(module_id_t module_idP, ...@@ -347,7 +347,7 @@ ue_send_sdu(module_id_t module_idP,
if (opt_enabled) { if (opt_enabled) {
trace_pdu(1, sdu, sdu_len, module_idP, 3, UE_mac_inst[module_idP].crnti, trace_pdu(1, sdu, sdu_len, module_idP, 3, UE_mac_inst[module_idP].crnti,
UE_mac_inst[module_idP].subframe, 0, 0); UE_mac_inst[module_idP].frame, UE_mac_inst[module_idP].subframe, 0, 0);
LOG_D(OPT,"[UE %d][DLSCH] Frame %d trace pdu for rnti %x with size %d\n", LOG_D(OPT,"[UE %d][DLSCH] Frame %d trace pdu for rnti %x with size %d\n",
module_idP, frameP, UE_mac_inst[module_idP].crnti, sdu_len); module_idP, frameP, UE_mac_inst[module_idP].crnti, sdu_len);
} }
...@@ -528,6 +528,7 @@ void ue_decode_si(module_id_t module_idP,int CC_id,frame_t frameP, uint8_t eNB_i ...@@ -528,6 +528,7 @@ void ue_decode_si(module_id_t module_idP,int CC_id,frame_t frameP, uint8_t eNB_i
module_idP, module_idP,
4, 4,
0xffff, 0xffff,
UE_mac_inst[module_idP].frame,
UE_mac_inst[module_idP].subframe, UE_mac_inst[module_idP].subframe,
0, 0,
0); 0);
...@@ -1527,9 +1528,9 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf ...@@ -1527,9 +1528,9 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
stop_meas(&UE_mac_inst[module_idP].tx_ulsch_sdu); stop_meas(&UE_mac_inst[module_idP].tx_ulsch_sdu);
if (opt_enabled) { if (opt_enabled) {
trace_pdu(0, ulsch_buffer, buflen, module_idP, 3, UE_mac_inst[module_idP].crnti, UE_mac_inst[module_idP].subframe, 0, 0); trace_pdu(0, ulsch_buffer, buflen, module_idP, 3, UE_mac_inst[module_idP].crnti, UE_mac_inst[module_idP].frame, UE_mac_inst[module_idP].subframe, 0, 0);
LOG_D(OPT,"[UE %d][ULSCH] Frame %d trace pdu for rnti %x with size %d\n", LOG_D(OPT,"[UE %d][ULSCH] Frame %d trace pdu for rnti %x with size %d\n",
module_idP, UE_mac_inst[module_idP].subframe, UE_mac_inst[module_idP].crnti, buflen); module_idP, UE_mac_inst[module_idP].frame, UE_mac_inst[module_idP].subframe, UE_mac_inst[module_idP].crnti, buflen);
} }
} }
......
...@@ -85,7 +85,7 @@ extern char in_path[100]; ...@@ -85,7 +85,7 @@ extern char in_path[100];
*/ */
void trace_pdu(int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size, void trace_pdu(int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size,
int ueid, int rntiType, int rnti, uint8_t subframe, int ueid, int rntiType, int rnti, uint16_t sysFrame, uint8_t subframe,
int oob_event, int oob_event_value); int oob_event, int oob_event_value);
int init_opt(char *path, char *ip, char *port, radio_type_t radio_type_p); int init_opt(char *path, char *ip, char *port, radio_type_t radio_type_p);
......
...@@ -260,7 +260,7 @@ int opt_create_listener_socket(char *ip_address, uint16_t port) ...@@ -260,7 +260,7 @@ int opt_create_listener_socket(char *ip_address, uint16_t port)
*/ */
/* Add framing header to MAC PDU and send. */ /* Add framing header to MAC PDU and send. */
static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType, static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
guint16 rnti, guint16 ueid, guint16 subframeNumber, guint16 rnti, guint16 ueid, guint16 sfnSf,
guint8 isPredefinedData, guint8 retx, guint8 crcStatus, guint8 isPredefinedData, guint8 retx, guint8 crcStatus,
guint8 oob_event, guint8 oob_event_value, guint8 oob_event, guint8 oob_event_value,
uint8_t *pdu_buffer, unsigned int pdu_buffer_size) uint8_t *pdu_buffer, unsigned int pdu_buffer_size)
...@@ -308,7 +308,7 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType, ...@@ -308,7 +308,7 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
/* Subframe number */ /* Subframe number */
frameBuffer[frameOffset++] = MAC_LTE_SUBFRAME_TAG; frameBuffer[frameOffset++] = MAC_LTE_SUBFRAME_TAG;
tmp16 = htons(subframeNumber); // frame counter : this will give an expert info as wireshark expects SF and not F tmp16 = htons(sfnSf); // frame counter : this will give an expert info as wireshark expects SF and not F
memcpy(frameBuffer+frameOffset, &tmp16, 2); memcpy(frameBuffer+frameOffset, &tmp16, 2);
frameOffset += 2; frameOffset += 2;
...@@ -317,7 +317,7 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType, ...@@ -317,7 +317,7 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
#ifdef WIRESHARK_DEV #ifdef WIRESHARK_DEV
frameOffset += 2; frameOffset += 2;
tmp16 = htons(subframeNumber); // subframe tmp16 = htons(sfnSf); // subframe
memcpy(frameBuffer+frameOffset, &tmp16, 2); memcpy(frameBuffer+frameOffset, &tmp16, 2);
frameOffset += 2; frameOffset += 2;
#endif #endif
...@@ -458,7 +458,7 @@ static int MAC_LTE_PCAP_WritePDU(MAC_Context_Info_t *context, ...@@ -458,7 +458,7 @@ static int MAC_LTE_PCAP_WritePDU(MAC_Context_Info_t *context,
/* Remote serveraddress (where Wireshark is running) */ /* Remote serveraddress (where Wireshark is running) */
void trace_pdu(int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size, void trace_pdu(int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size,
int ueid, int rntiType, int rnti, uint8_t subframe, int oob_event, int ueid, int rntiType, int rnti, uint16_t sysFrameNumber, uint8_t subFrameNumber, int oob_event,
int oob_event_value) int oob_event_value)
{ {
MAC_Context_Info_t pdu_context; MAC_Context_Info_t pdu_context;
...@@ -471,7 +471,7 @@ void trace_pdu(int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size, ...@@ -471,7 +471,7 @@ void trace_pdu(int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size,
SendFrame(radio_type, SendFrame(radio_type,
(direction == DIRECTION_DOWNLINK) ? DIRECTION_DOWNLINK : DIRECTION_UPLINK, (direction == DIRECTION_DOWNLINK) ? DIRECTION_DOWNLINK : DIRECTION_UPLINK,
rntiType, rnti, ueid, subframe, rntiType, rnti, ueid, (sysFrameNumber<<4) + subFrameNumber,
1, 0, 1, //guint8 isPredefinedData, guint8 retx, guint8 crcStatus 1, 0, 1, //guint8 isPredefinedData, guint8 retx, guint8 crcStatus
oob_event,oob_event_value, oob_event,oob_event_value,
pdu_buffer, pdu_buffer_size); pdu_buffer, pdu_buffer_size);
...@@ -490,8 +490,8 @@ void trace_pdu(int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size, ...@@ -490,8 +490,8 @@ void trace_pdu(int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size,
pdu_context.ueid = ueid; pdu_context.ueid = ueid;
pdu_context.isRetx = 0; pdu_context.isRetx = 0;
pdu_context.crcStatusOK =1; pdu_context.crcStatusOK =1;
pdu_context.sysFrameNumber = subframe; pdu_context.sysFrameNumber = sysFrameNumber;
pdu_context.subFrameNumber = 0; pdu_context.subFrameNumber = subFrameNumber;
pdu_context.subframesSinceCaptureStart = subframesSinceCaptureStart++; pdu_context.subframesSinceCaptureStart = subframesSinceCaptureStart++;
MAC_LTE_PCAP_WritePDU( &pdu_context, pdu_buffer, pdu_buffer_size); MAC_LTE_PCAP_WritePDU( &pdu_context, pdu_buffer, pdu_buffer_size);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment