Commit fdb16fae authored by Cedric Roux's avatar Cedric Roux

T: macpdu2wireshark: add SIBs tracing

Only schedule_SI is done, not schedule_SIB1_BR and not schedule_SI_BR.
parent 7b264ac9
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
#define DEFAULT_IP "127.0.0.1" #define DEFAULT_IP "127.0.0.1"
#define DEFAULT_PORT 9999 #define DEFAULT_PORT 9999
int no_sib = 0;
typedef struct { typedef struct {
int socket; int socket;
struct sockaddr_in to; struct sockaddr_in to;
...@@ -76,21 +78,27 @@ void dl(void *_d, event e) ...@@ -76,21 +78,27 @@ void dl(void *_d, event e)
int fsf; int fsf;
int i; int i;
if (e.e[d->dl_rnti].i == 0xffff && no_sib) return;
d->buf.osize = 0; d->buf.osize = 0;
PUTS(&d->buf, MAC_LTE_START_STRING); PUTS(&d->buf, MAC_LTE_START_STRING);
PUTC(&d->buf, FDD_RADIO); PUTC(&d->buf, FDD_RADIO);
PUTC(&d->buf, DIRECTION_DOWNLINK); PUTC(&d->buf, DIRECTION_DOWNLINK);
PUTC(&d->buf, C_RNTI); if (e.e[d->dl_rnti].i != 0xffff) {
PUTC(&d->buf, C_RNTI);
PUTC(&d->buf, MAC_LTE_RNTI_TAG);
PUTC(&d->buf, (e.e[d->dl_rnti].i>>8) & 255); PUTC(&d->buf, MAC_LTE_RNTI_TAG);
PUTC(&d->buf, e.e[d->dl_rnti].i & 255); PUTC(&d->buf, (e.e[d->dl_rnti].i>>8) & 255);
PUTC(&d->buf, e.e[d->dl_rnti].i & 255);
} else {
PUTC(&d->buf, SI_RNTI);
}
/* for newer version of wireshark? */ /* for newer version of wireshark? */
fsf = (e.e[d->dl_frame].i << 4) + e.e[d->dl_subframe].i; fsf = (e.e[d->dl_frame].i << 4) + e.e[d->dl_subframe].i;
/* for older version? */ /* for older version? */
fsf = e.e[d->dl_subframe].i; //fsf = e.e[d->dl_subframe].i;
PUTC(&d->buf, MAC_LTE_FRAME_SUBFRAME_TAG); PUTC(&d->buf, MAC_LTE_FRAME_SUBFRAME_TAG);
PUTC(&d->buf, (fsf>>8) & 255); PUTC(&d->buf, (fsf>>8) & 255);
PUTC(&d->buf, fsf & 255); PUTC(&d->buf, fsf & 255);
...@@ -231,7 +239,8 @@ void usage(void) ...@@ -231,7 +239,8 @@ void usage(void)
" -i <dump file> read events from this dump file\n" " -i <dump file> read events from this dump file\n"
" -ip <IP address> send packets to this IP address (default %s)\n" " -ip <IP address> send packets to this IP address (default %s)\n"
" -p <port> send packets to this port (default %d)\n" " -p <port> send packets to this port (default %d)\n"
" -no-mib do not report MIB\n", " -no-mib do not report MIB\n"
" -no-sib do not report SIBs\n",
DEFAULT_IP, DEFAULT_IP,
DEFAULT_PORT DEFAULT_PORT
); );
...@@ -263,6 +272,7 @@ int main(int n, char **v) ...@@ -263,6 +272,7 @@ int main(int n, char **v)
if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; } if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; }
if (!strcmp(v[i], "-p")) {if(i>n-2)usage(); port=atoi(v[++i]); continue; } if (!strcmp(v[i], "-p")) {if(i>n-2)usage(); port=atoi(v[++i]); continue; }
if (!strcmp(v[i], "-no-mib")) { do_mib = 0; continue; } if (!strcmp(v[i], "-no-mib")) { do_mib = 0; continue; }
if (!strcmp(v[i], "-no-sib")) { no_sib = 1; continue; }
usage(); usage();
} }
......
...@@ -758,6 +758,9 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -758,6 +758,9 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
module_idP, CC_id, frameP, subframeP); module_idP, CC_id, frameP, subframeP);
} }
T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(0xffff),
T_INT(frameP), T_INT(subframeP), T_INT(0), T_BUFFER(cc->BCCH_pdu.payload, bcch_sdu_length));
if (opt_enabled == 1) { if (opt_enabled == 1) {
trace_pdu(DIRECTION_DOWNLINK, trace_pdu(DIRECTION_DOWNLINK,
&cc->BCCH_pdu.payload[0], &cc->BCCH_pdu.payload[0],
......
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