diff --git a/README b/README index d84de02..037e3fd 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ * ot290-gsmtap -This is a command line utility which reads the trace frames sent by the Sagem OT-290 trough the serial line and forwards the GSM L2/L3 and GPRS RLC/MAC messages to a host as GSMTAP packets so that you can use Wireshark to analyze them. +This is a command line utility which reads the trace frames sent by the Sagem OT-290 trough the serial line and forwards the GSM/GPRS ones to the specified host as GSMTAP packets so that you can use Wireshark to analyze them. In order for this tool to run, you have to set on the phone the Trace or Data/Trace mode (Main Menu -> Test Tool -> Info & Settings -> Serial links setup). diff --git a/src/main.c b/src/main.c index a6c7e34..6cf9956 100644 --- a/src/main.c +++ b/src/main.c @@ -104,16 +104,13 @@ void testgsmtap(unsigned char *AppMsg, unsigned short AppMsgLength) { int format = (AppMsg[2] >> 1 & 0b1111); length = AppMsg[3] << 8 | AppMsg[4]; - /*int i = 0; - printf("* L%d format:%d, Length:%d, FreqBit:%d, U/D: %d, LayerMessageFrame: [", (AppMsg[1] == 0x00) ? 3 : 2, format, length, AppMsg[2] >> 5, (AppMsg[2] & 1)); - for (i=0; iversion = GSMTAP_VERSION; gh->hdr_len = sizeof(*gh)/4; + if ((AppMsg[2] & 1) == 1) gh->arfcn = htons(GSMTAP_ARFCN_F_UPLINK); if ((format == 0) || (format == 2)) gh->type = GSMTAP_TYPE_UM_BURST; else gh->type = GSMTAP_TYPE_UM; gh->sub_type = GSMTAP_CHANNEL_UNKNOWN; @@ -214,5 +211,5 @@ int main(int argc, char **argv) myreq[9] = 0; myreq[10] = 25; //LayerMessage-disable request req(myreq, sizeof(myreq)); printf("[*] Checksum errors: %d/%d | Total errors: %d/%d\n", s.checksumErrors, s.packets, s.totalErrors, s.packets); - return 0; + return (s.totalErrors == 0) ? 0 : 1; }