summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-04-05 17:55:27 +0200
committerHarald Welte <laforge@gnumonks.org>2017-04-08 07:44:47 +0000
commit15596e2a7f101c5db7454d21aabf16dd3878de15 (patch)
treee618587e06031ecccb2ebf8b6aec224c0ab5c0ae
parentc6144a24481ecb75621410b144663d20f6e246fd (diff)
gsm0808: make gsm0808_create_reset_ack() accessible
The create function to generate the RESET ACKNOWLEDGE message is not accessible from outside, as it does not appear in limosmogsm.map. It also has not testcase. This commit adds gsm0808_create_reset_ack() to the map file and also adds a testcase. Change-Id: I82d3411484f82b4a9205d407fa0442244678f183
-rw-r--r--src/gsm/libosmogsm.map1
-rw-r--r--tests/gsm0808/gsm0808_test.c13
-rw-r--r--tests/gsm0808/gsm0808_test.ok1
3 files changed, 15 insertions, 0 deletions
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index a4e6083b..c825dd5f 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -141,6 +141,7 @@ gsm0808_create_dtap;
gsm0808_create_layer3;
gsm0808_create_layer3_aoip;
gsm0808_create_reset;
+gsm0808_create_reset_ack;
gsm0808_create_sapi_reject;
gsm0808_prepend_dtap_header;
gsm0808_enc_aoip_trasp_addr;
diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index a0ff6d52..8304052d 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -123,6 +123,18 @@ static void test_create_reset()
msgb_free(msg);
}
+static void test_create_reset_ack()
+{
+ static const uint8_t res[] = { 0x00, 0x01, 0x31 };
+ struct msgb *msg;
+
+ printf("Testing creating Reset Ack\n");
+ msg = gsm0808_create_reset_ack();
+ VERIFY(msg, res, ARRAY_SIZE(res));
+ msgb_free(msg);
+}
+
+
static void test_create_clear_command()
{
static const uint8_t res[] = { 0x20, 0x04, 0x01, 0x23 };
@@ -828,6 +840,7 @@ int main(int argc, char **argv)
test_create_layer3();
test_create_layer3_aoip();
test_create_reset();
+ test_create_reset_ack();
test_create_clear_command();
test_create_clear_complete();
test_create_cipher();
diff --git a/tests/gsm0808/gsm0808_test.ok b/tests/gsm0808/gsm0808_test.ok
index 52af1342..e101d657 100644
--- a/tests/gsm0808/gsm0808_test.ok
+++ b/tests/gsm0808/gsm0808_test.ok
@@ -2,6 +2,7 @@ Testing generation of GSM0808 messages
Testing creating Layer3
Testing creating Layer3 (AoIP)
Testing creating Reset
+Testing creating Reset Ack
Testing creating Clear Command
Testing creating Clear Complete
Testing creating Chipher Mode Command