aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2019-02-18 20:42:42 +0100
committerMax <msuraev@sysmocom.de>2019-02-19 18:58:04 +0100
commit7426c5f95727647523720992ae4610d61efd2abd (patch)
tree2c19cdf728f3e2cb939f0dfcaf7cfc389ec716cc
parent0c55bf19a55ae2ec2bcf0fa005c7aa6da8ea02a6 (diff)
Add define for dummy burst string
-rw-r--r--src/gprs_rlcmac.cpp2
-rw-r--r--src/gprs_rlcmac.h1
-rw-r--r--src/tbf.cpp9
-rw-r--r--src/tbf_ul.cpp3
-rw-r--r--tests/rlcmac/RLCMACTest.cpp10
-rw-r--r--tests/types/TypesTest.cpp7
6 files changed, 15 insertions, 17 deletions
diff --git a/src/gprs_rlcmac.cpp b/src/gprs_rlcmac.cpp
index da5c541..5a223c1 100644
--- a/src/gprs_rlcmac.cpp
+++ b/src/gprs_rlcmac.cpp
@@ -33,7 +33,7 @@ int gprs_rlcmac_paging_request(uint8_t *ptmsi, uint16_t ptmsi_len,
{
LOGP(DRLCMAC, LOGL_NOTICE, "TX: [PCU -> BTS] Paging Request (CCCH)\n");
bitvec *paging_request = bitvec_alloc(23, tall_pcu_ctx);
- bitvec_unhex(paging_request, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b");
+ bitvec_unhex(paging_request, DUMMY_VEC);
int plen = Encoding::write_paging_request(paging_request, ptmsi, ptmsi_len);
pcu_l1if_tx_pch(paging_request, plen, (char *)imsi);
bitvec_free(paging_request);
diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h
index 8ff3c90..7a3a7af 100644
--- a/src/gprs_rlcmac.h
+++ b/src/gprs_rlcmac.h
@@ -40,6 +40,7 @@ extern "C" {
*/
//#define DEBUG_DL_ASS_IDLE
+#define DUMMY_VEC "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"
struct gprs_rlcmac_tbf;
struct gprs_rlcmac_bts;
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 6792d08..233ae91 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -1270,8 +1270,7 @@ struct msgb *gprs_rlcmac_tbf::create_dl_ass(uint32_t fn, uint8_t ts)
msgb_free(msg);
return NULL;
}
- bitvec_unhex(ass_vec,
- "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b");
+ bitvec_unhex(ass_vec, DUMMY_VEC);
LOGPTBF(new_dl_tbf, LOGL_INFO, "start Packet Downlink Assignment (PACCH)\n");
RlcMacDownlink_t * mac_control_block = (RlcMacDownlink_t *)talloc_zero(tall_pcu_ctx, RlcMacDownlink_t);
Encoding::write_packet_downlink_assignment(mac_control_block,
@@ -1310,8 +1309,7 @@ struct msgb *gprs_rlcmac_tbf::create_packet_access_reject()
bitvec *packet_access_rej = bitvec_alloc(23, tall_pcu_ctx);
- bitvec_unhex(packet_access_rej,
- "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b");
+ bitvec_unhex(packet_access_rej, DUMMY_VEC);
Encoding::write_packet_access_reject(
packet_access_rej, tlli());
@@ -1368,8 +1366,7 @@ struct msgb *gprs_rlcmac_tbf::create_ul_ass(uint32_t fn, uint8_t ts)
msgb_free(msg);
return NULL;
}
- bitvec_unhex(ass_vec,
- "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b");
+ bitvec_unhex(ass_vec, DUMMY_VEC);
Encoding::write_packet_uplink_assignment(bts_data(), ass_vec, m_tfi,
(direction == GPRS_RLCMAC_DL_TBF), tlli(),
is_tlli_valid(), new_tbf, 1, rrbp, bts_data()->alpha,
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index 02f4ddb..7937f8b 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -151,8 +151,7 @@ struct msgb *gprs_rlcmac_ul_tbf::create_ul_ack(uint32_t fn, uint8_t ts)
msgb_free(msg);
return NULL;
}
- bitvec_unhex(ack_vec,
- "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b");
+ bitvec_unhex(ack_vec, DUMMY_VEC);
Encoding::write_packet_uplink_ack(bts_data(), ack_vec, this, final, rrbp);
bitvec_pack(ack_vec, msgb_put(msg, 23));
bitvec_free(ack_vec);
diff --git a/tests/rlcmac/RLCMACTest.cpp b/tests/rlcmac/RLCMACTest.cpp
index 3de4fac..bf7a605 100644
--- a/tests/rlcmac/RLCMACTest.cpp
+++ b/tests/rlcmac/RLCMACTest.cpp
@@ -25,6 +25,8 @@
#include <cstring>
#include "csn1.h"
#include "gsm_rlcmac.h"
+#include "gprs_rlcmac.h"
+
extern "C" {
extern const struct log_info gprs_log_info;
#include "pcu_vty.h"
@@ -86,7 +88,7 @@ void printSizeofRLCMAC()
void testRlcMacDownlink(void *test_ctx)
{
struct bitvec *resultVector = bitvec_alloc(23, test_ctx);
- bitvec_unhex(resultVector, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b");
+ bitvec_unhex(resultVector, DUMMY_VEC);
std::string testData[] = {
"4e082500e3f1a81d080820800b2b2b2b2b2b2b2b2b2b2b", // Packet Downlink Assignment
@@ -141,7 +143,7 @@ void testRlcMacDownlink(void *test_ctx)
{
cout << "vector1 == vector2 : FALSE" << endl;
}
- bitvec_unhex(resultVector, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b");
+ bitvec_unhex(resultVector, DUMMY_VEC);
bitvec_free(vector);
free(data);
}
@@ -153,7 +155,7 @@ void testRlcMacDownlink(void *test_ctx)
void testRlcMacUplink(void *test_ctx)
{
struct bitvec *resultVector = bitvec_alloc(23, test_ctx);
- bitvec_unhex(resultVector, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b");
+ bitvec_unhex(resultVector, DUMMY_VEC);
std::string testData[] = {
"400e1e61d11d2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b", // Packet Uplink Dummy Control Block
@@ -204,7 +206,7 @@ void testRlcMacUplink(void *test_ctx)
{
cout << "vector1 == vector2 : FALSE" << endl;
}
- bitvec_unhex(resultVector, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b");
+ bitvec_unhex(resultVector, DUMMY_VEC);
bitvec_free(vector);
free(data);
}
diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp
index 1bc911f..90d3981 100644
--- a/tests/types/TypesTest.cpp
+++ b/tests/types/TypesTest.cpp
@@ -25,6 +25,7 @@
#include "gprs_debug.h"
#include "encoding.h"
#include "decoding.h"
+#include "gprs_rlcmac.h"
extern "C" {
#include <osmocom/core/application.h>
@@ -435,8 +436,7 @@ void test_immediate_assign_rej()
uint8_t plen;
bitvec *immediate_assignment_rej = bitvec_alloc(22, tall_pcu_ctx);
- bitvec_unhex(immediate_assignment_rej,
- "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b");
+ bitvec_unhex(immediate_assignment_rej, DUMMY_VEC);
plen = Encoding::write_immediate_assignment_reject(
immediate_assignment_rej, 112, 100,
GSM_L1_BURST_TYPE_ACCESS_1);
@@ -450,8 +450,7 @@ void test_immediate_assign_rej()
/* Extended RA value */
OSMO_ASSERT(immediate_assignment_rej->data[19] == 0xc0);
- bitvec_unhex(immediate_assignment_rej,
- "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b");
+ bitvec_unhex(immediate_assignment_rej, DUMMY_VEC);
plen = Encoding::write_immediate_assignment_reject(
immediate_assignment_rej, 112, 100,