From 856221fd3d8ad306bf3a361bbee82ce49c44dfd5 Mon Sep 17 00:00:00 2001 From: Ivan Kluchnikov Date: Fri, 15 Jun 2012 09:31:29 +0400 Subject: [PATCH] Removed all OpenBTS dependencies. We don't use OpenBTS cout and gsmtap anymore. --- src/gprs_bssgp_pcu.cpp | 1 - src/gprs_rlcmac.cpp | 17 +++++++---------- src/pcu_l1_if.cpp | 39 --------------------------------------- src/pcu_l1_if.h | 2 -- 4 files changed, 7 insertions(+), 52 deletions(-) diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index f0f71d89..82e483c3 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -76,7 +76,6 @@ int gprs_bssgp_pcu_rx_dl_ud(struct msgb *msg, struct tlv_parsed *tp) LOGPC(DBSSGP, LOGL_NOTICE, "\n"); } - gsmtap_send_llc(tbf->rlc_data,tbf->data_index); gprs_rlcmac_packet_downlink_assignment(tbf); } diff --git a/src/gprs_rlcmac.cpp b/src/gprs_rlcmac.cpp index b0aa4a1e..7e9a0321 100644 --- a/src/gprs_rlcmac.cpp +++ b/src/gprs_rlcmac.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -101,7 +100,7 @@ static void tbf_timer_cb(void *_tbf) // TODO: We should add timers for TBF. break; default: - COUT("Timer expired in unknown mode" << tbf->T); + LOGP(DRLCMAC, LOGL_NOTICE, "Timer expired in unknown mode: %u \n", tbf->T); } } @@ -109,7 +108,8 @@ static void tbf_timer_start(struct gprs_rlcmac_tbf *tbf, unsigned int T, unsigned int seconds) { if (osmo_timer_pending(&tbf->timer)) - COUT("Starting TBF timer %u while old timer %u pending" << T << tbf->T); + LOGP(DRLCMAC, LOGL_NOTICE, "Starting TBF timer %u while old timer %u pending \n", T, tbf->T); + tbf->T = T; tbf->num_T_exp = 0; @@ -135,7 +135,7 @@ static void tbf_gsm_timer_cb(void *_tbf) tbf_free(tbf); break; default: - COUT("Timer expired in unknown mode" << tbf->fT); + LOGP(DRLCMAC, LOGL_NOTICE, "Timer expired in unknown mode: %u \n", tbf->fT); } } @@ -143,7 +143,7 @@ static void tbf_gsm_timer_start(struct gprs_rlcmac_tbf *tbf, unsigned int fT, int frames) { if (osmo_gsm_timer_pending(&tbf->gsm_timer)) - COUT("Starting TBF timer %u while old timer %u pending" << fT << tbf->fT); + LOGP(DRLCMAC, LOGL_NOTICE, "Starting TBF timer %u while old timer %u pending \n", fT, tbf->fT); tbf->fT = fT; tbf->num_fT_exp = 0; @@ -501,7 +501,6 @@ void gprs_rlcmac_data_block_parse(gprs_rlcmac_tbf* tbf, RlcMacUplinkDataBlock_t // New LLC PDU starts after the current LLC PDU if (ul_data_block->M[num] == 1) { - gsmtap_send_llc(tbf->rlc_data, tbf->data_index); gprs_rlcmac_tx_ul_ud(tbf); tbf->data_index = 0; // New LLC PDU continues until the end of the RLC information field, no more extension octets. @@ -549,7 +548,6 @@ int gprs_rlcmac_rcv_data_block(bitvec *rlc_block) gprs_rlcmac_tx_ul_ack(tbf->tfi, tbf->tlli, ul_data_block); if (ul_data_block->CV == 0) { // Recieved last Data Block in this sequence. - gsmtap_send_llc(tbf->rlc_data, tbf->data_index); tbf->state = GPRS_RLCMAC_WAIT_NEXT_DATA_SEQ; gprs_rlcmac_tx_ul_ud(tbf); } else { @@ -564,7 +562,6 @@ int gprs_rlcmac_rcv_data_block(bitvec *rlc_block) gprs_rlcmac_tx_ul_ack(tbf->tfi, tbf->tlli, ul_data_block); if (ul_data_block->CV == 0) { // Recieved last Data Block in this sequence. - gsmtap_send_llc(tbf->rlc_data, tbf->data_index); tbf->state = GPRS_RLCMAC_WAIT_NEXT_DATA_SEQ; gprs_rlcmac_tx_ul_ud(tbf); } else { @@ -639,9 +636,9 @@ void gprs_rlcmac_rcv_block(bitvec *rlc_block) gprs_rlcmac_rcv_control_block(rlc_block); break; case GPRS_RLCMAC_CONTROL_BLOCK_OPT: - COUT("GPRS_RLCMAC_CONTROL_BLOCK_OPT block payload is not supported.\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "GPRS_RLCMAC_CONTROL_BLOCK_OPT block payload is not supported.\n"); default: - COUT("Unknown RLCMAC block payload.\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "Unknown RLCMAC block payload.\n"); } } diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index b95c512a..fe933b93 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -17,17 +17,12 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include #include #include #include #define MAX_UDP_LENGTH 1500 -// TODO: We should take ports and IP from config. -UDPSocket pcu_gsmtap_socket(5077, "127.0.0.1", 4729); - // Variable for storage current FN. int frame_number; @@ -177,37 +172,3 @@ int pcu_l1if_handle_l1prim(struct femtol1_hdl *fl1, struct msgb *msg) return rc; } - -void gsmtap_send_llc(uint8_t * data, unsigned len) -{ - char buffer[MAX_UDP_LENGTH]; - int ofs = 0; - - // Build header - struct gsmtap_hdr *header = (struct gsmtap_hdr *)buffer; - header->version = 2; - header->hdr_len = sizeof(struct gsmtap_hdr) >> 2; - header->type = 0x08; - header->timeslot = 5; - header->arfcn = 0; - header->signal_dbm = 0; - header->snr_db = 0; - header->frame_number = 0; - header->sub_type = 0; - header->antenna_nr = 0; - header->sub_slot = 0; - header->res = 0; - - ofs += sizeof(*header); - - // Add frame data - unsigned j = 0; - for (unsigned i = ofs; i < len+ofs; i++) - { - buffer[i] = (char)data[j]; - j++; - } - ofs += len; - // Write the GSMTAP packet - pcu_gsmtap_socket.write(buffer, ofs); -} diff --git a/src/pcu_l1_if.h b/src/pcu_l1_if.h index 60bc72bf..efe533e7 100644 --- a/src/pcu_l1_if.h +++ b/src/pcu_l1_if.h @@ -74,6 +74,4 @@ void pcu_l1if_tx(bitvec * block, GsmL1_Sapi_t sapi, int len = 23); int pcu_l1if_handle_l1prim(struct femtol1_hdl *fl1h, struct msgb *msg); -void gsmtap_send_llc(uint8_t * data, unsigned len); - #endif // PCU_L1_IF_H