pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-bsc/+/27931 )
Change subject: Rename functions generating OML SetAttr messages
......................................................................
Rename functions generating OML SetAttr messages
Its name is totally misleading, since they seem to be related to
GetAttributes messages rather than SetAttributes.
Change-Id: I306cb407dbd9b98e301b5d93046bdadcb466b82b
---
M include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h
M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
M src/osmo-bsc/nm_bts_fsm.c
M src/osmo-bsc/nm_gprs_cell_fsm.c
M src/osmo-bsc/nm_gprs_nse_fsm.c
M src/osmo-bsc/nm_gprs_nsvc_fsm.c
M src/osmo-bsc/nm_rcarrier_fsm.c
M tests/nanobts_omlattr/nanobts_omlattr_test.c
M tests/nanobts_omlattr/nanobts_omlattr_test.ok
9 files changed, 47 insertions(+), 47 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/31/27931/1
diff --git a/include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h
b/include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h
index 687f16a..d6933fc 100644
--- a/include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h
+++ b/include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h
@@ -28,9 +28,9 @@
struct gsm_bts;
struct gsm_bts_trx;
-struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts);
-struct msgb *nanobts_attr_nse_get(struct gsm_bts_sm *bts_sm);
-struct msgb *nanobts_attr_cell_get(struct gsm_bts *bts);
-struct msgb *nanobts_attr_nsvc_get(struct gsm_bts *bts);
-struct msgb *nanobts_attr_radio_get(struct gsm_bts *bts,
+struct msgb *nanobts_gen_set_bts_attr(struct gsm_bts *bts);
+struct msgb *nanobts_gen_set_nse_attr(struct gsm_bts_sm *bts_sm);
+struct msgb *nanobts_gen_set_cell_attr(struct gsm_bts *bts);
+struct msgb *nanobts_gen_set_nsvc_attr(struct gsm_bts *bts);
+struct msgb *nanobts_gen_set_radio_attr(struct gsm_bts *bts,
struct gsm_bts_trx *trx);
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
index 517cfd3..4f7a487 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
@@ -27,7 +27,7 @@
#include <osmocom/gsm/bts_features.h>
/* 3GPP TS 52.021 section 8.6.1 Set BTS Attributes */
-struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts)
+struct msgb *nanobts_gen_set_bts_attr(struct gsm_bts *bts)
{
struct msgb *msgb;
uint8_t buf[256];
@@ -108,7 +108,7 @@
return msgb;
}
-struct msgb *nanobts_attr_nse_get(struct gsm_bts_sm *bts_sm)
+struct msgb *nanobts_gen_set_nse_attr(struct gsm_bts_sm *bts_sm)
{
struct msgb *msgb;
uint8_t buf[256];
@@ -147,7 +147,7 @@
return msgb;
}
-struct msgb *nanobts_attr_cell_get(struct gsm_bts *bts)
+struct msgb *nanobts_gen_set_cell_attr(struct gsm_bts *bts)
{
struct msgb *msgb;
uint8_t buf[256];
@@ -206,7 +206,7 @@
return msgb;
}
-struct msgb *nanobts_attr_nsvc_get(struct gsm_bts *bts)
+struct msgb *nanobts_gen_set_nsvc_attr(struct gsm_bts *bts)
{
struct msgb *msgb;
uint8_t buf[256];
@@ -251,7 +251,7 @@
return msgb;
}
-struct msgb *nanobts_attr_radio_get(struct gsm_bts *bts,
+struct msgb *nanobts_gen_set_radio_attr(struct gsm_bts *bts,
struct gsm_bts_trx *trx)
{
struct msgb *msgb;
diff --git a/src/osmo-bsc/nm_bts_fsm.c b/src/osmo-bsc/nm_bts_fsm.c
index b9ed5a0..bb4fe3e 100644
--- a/src/osmo-bsc/nm_bts_fsm.c
+++ b/src/osmo-bsc/nm_bts_fsm.c
@@ -105,7 +105,7 @@
if (bts->mo.get_attr_rep_received &&
!bts->mo.set_attr_sent && !bts->mo.set_attr_ack_received) {
bts->mo.set_attr_sent = true;
- msgb = nanobts_attr_bts_get(bts);
+ msgb = nanobts_gen_set_bts_attr(bts);
abis_nm_set_bts_attr(bts, msgb->data, msgb->len);
msgb_free(msgb);
}
diff --git a/src/osmo-bsc/nm_gprs_cell_fsm.c b/src/osmo-bsc/nm_gprs_cell_fsm.c
index 4df3a3e..b3f960c 100644
--- a/src/osmo-bsc/nm_gprs_cell_fsm.c
+++ b/src/osmo-bsc/nm_gprs_cell_fsm.c
@@ -95,7 +95,7 @@
if (!cell->mo.set_attr_sent && !cell->mo.set_attr_ack_received) {
cell->mo.set_attr_sent = true;
- msgb = nanobts_attr_cell_get(bts);
+ msgb = nanobts_gen_set_cell_attr(bts);
OSMO_ASSERT(msgb);
abis_nm_ipaccess_set_attr(bts, NM_OC_GPRS_CELL, bts->bts_nr,
0, 0xff, msgb->data, msgb->len);
diff --git a/src/osmo-bsc/nm_gprs_nse_fsm.c b/src/osmo-bsc/nm_gprs_nse_fsm.c
index 8a63f56..5994f32 100644
--- a/src/osmo-bsc/nm_gprs_nse_fsm.c
+++ b/src/osmo-bsc/nm_gprs_nse_fsm.c
@@ -94,7 +94,7 @@
if (!nse->mo.set_attr_sent && !nse->mo.set_attr_ack_received) {
nse->mo.set_attr_sent = true;
- msgb = nanobts_attr_nse_get(bts_sm);
+ msgb = nanobts_gen_set_nse_attr(bts_sm);
abis_nm_ipaccess_set_attr(bts, NM_OC_GPRS_NSE, bts->bts_nr,
0xff, 0xff, msgb->data,
msgb->len);
diff --git a/src/osmo-bsc/nm_gprs_nsvc_fsm.c b/src/osmo-bsc/nm_gprs_nsvc_fsm.c
index 5f0c5de..b11c2a6 100644
--- a/src/osmo-bsc/nm_gprs_nsvc_fsm.c
+++ b/src/osmo-bsc/nm_gprs_nsvc_fsm.c
@@ -107,7 +107,7 @@
return;
}
nsvc->mo.set_attr_sent = true;
- msgb = nanobts_attr_nsvc_get(nsvc->bts);
+ msgb = nanobts_gen_set_nsvc_attr(nsvc->bts);
OSMO_ASSERT(msgb);
abis_nm_ipaccess_set_attr(nsvc->bts, NM_OC_GPRS_NSVC, nsvc->bts->bts_nr,
nsvc->id, 0xff, msgb->data, msgb->len);
diff --git a/src/osmo-bsc/nm_rcarrier_fsm.c b/src/osmo-bsc/nm_rcarrier_fsm.c
index b9e67c1..325ec56 100644
--- a/src/osmo-bsc/nm_rcarrier_fsm.c
+++ b/src/osmo-bsc/nm_rcarrier_fsm.c
@@ -92,7 +92,7 @@
if (!trx->mo.set_attr_sent && !trx->mo.set_attr_ack_received) {
trx->mo.set_attr_sent = true;
- msgb = nanobts_attr_radio_get(trx->bts, trx);
+ msgb = nanobts_gen_set_radio_attr(trx->bts, trx);
abis_nm_set_radio_attr(trx, msgb->data, msgb->len);
msgb_free(msgb);
}
diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c
b/tests/nanobts_omlattr/nanobts_omlattr_test.c
index ecf5f82..32e2c53 100644
--- a/tests/nanobts_omlattr/nanobts_omlattr_test.c
+++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c
@@ -34,13 +34,13 @@
extern struct gsm_bts_model bts_model_nanobts;
-static void test_nanobts_attr_bts_get(struct gsm_bts *bts, uint8_t *expected)
+static void test_nanobts_gen_set_bts_attr(struct gsm_bts *bts, uint8_t *expected)
{
struct msgb *msgb;
- printf("Testing nanobts_attr_bts_get()...\n");
+ printf("Testing nanobts_gen_set_bts_attr()...\n");
- msgb = nanobts_attr_bts_get(bts);
+ msgb = nanobts_gen_set_bts_attr(bts);
printf("result= %s\n", osmo_hexdump_nospc(msgb->data, msgb->len));
printf("expected=%s\n", osmo_hexdump_nospc(expected, msgb->len));
OSMO_ASSERT(msgb_eq_data_print(msgb, expected, msgb->len));
@@ -50,13 +50,13 @@
printf("\n");
}
-static void test_nanobts_attr_nse_get(struct gsm_bts *bts, uint8_t *expected)
+static void test_nanobts_gen_set_nse_attr(struct gsm_bts *bts, uint8_t *expected)
{
struct msgb *msgb;
- printf("Testing nanobts_attr_nse_get()...\n");
+ printf("Testing nanobts_gen_set_nse_attr()...\n");
- msgb = nanobts_attr_nse_get(bts->site_mgr);
+ msgb = nanobts_gen_set_nse_attr(bts->site_mgr);
printf("result= %s\n", osmo_hexdump_nospc(msgb->data, msgb->len));
printf("expected=%s\n", osmo_hexdump_nospc(expected, msgb->len));
OSMO_ASSERT(msgb_eq_data_print(msgb, expected, msgb->len));
@@ -66,13 +66,13 @@
printf("\n");
}
-static void test_nanobts_attr_cell_get(struct gsm_bts *bts, uint8_t *expected)
+static void test_nanobts_gen_set_cell_attr(struct gsm_bts *bts, uint8_t *expected)
{
struct msgb *msgb;
- printf("Testing nanobts_attr_cell_get()...\n");
+ printf("Testing nanobts_gen_set_cell_attr()...\n");
- msgb = nanobts_attr_cell_get(bts);
+ msgb = nanobts_gen_set_cell_attr(bts);
printf("result= %s\n", osmo_hexdump_nospc(msgb->data, msgb->len));
printf("expected=%s\n", osmo_hexdump_nospc(expected, msgb->len));
OSMO_ASSERT(msgb_eq_data_print(msgb, expected, msgb->len));
@@ -82,13 +82,13 @@
printf("\n");
}
-static void test_nanobts_attr_nsvc_get(struct gsm_bts *bts, uint8_t *expected)
+static void test_nanobts_gen_set_nsvc_attr(struct gsm_bts *bts, uint8_t *expected)
{
struct msgb *msgb;
- printf("Testing nanobts_attr_nsvc_get()...\n");
+ printf("Testing nanobts_gen_set_nsvc_attr()...\n");
- msgb = nanobts_attr_nsvc_get(bts);
+ msgb = nanobts_gen_set_nsvc_attr(bts);
printf("result= %s\n", osmo_hexdump_nospc(msgb->data, msgb->len));
printf("expected=%s\n", osmo_hexdump_nospc(expected, msgb->len));
OSMO_ASSERT(msgb_eq_data_print(msgb, expected, msgb->len));
@@ -98,15 +98,15 @@
printf("\n");
}
-static void test_nanobts_attr_radio_get(struct gsm_bts *bts,
+static void test_nanobts_gen_set_radio_attr(struct gsm_bts *bts,
struct gsm_bts_trx *trx,
uint8_t *expected)
{
struct msgb *msgb;
- printf("Testing nanobts_attr_nsvc_get()...\n");
+ printf("Testing nanobts_gen_set_nsvc_attr()...\n");
- msgb = nanobts_attr_radio_get(bts, trx);
+ msgb = nanobts_gen_set_radio_attr(bts, trx);
printf("result= %s\n", osmo_hexdump_nospc(msgb->data, msgb->len));
printf("expected=%s\n", osmo_hexdump_nospc(expected, msgb->len));
OSMO_ASSERT(msgb_eq_data_print(msgb, expected, msgb->len));
@@ -154,7 +154,7 @@
bts->network = net;
trx = talloc_zero(ctx, struct gsm_bts_trx);
- /* Parameters needed by nanobts_attr_bts_get() */
+ /* Parameters needed by nanobts_gen_set_bts_attr() */
bts->rach_b_thresh = -1;
bts->rach_ldavg_slots = -1;
bts->c0->arfcn = 866;
@@ -173,7 +173,7 @@
0x01, 0x05, 0x39
};
- /* Parameters needed to test nanobts_attr_nse_get() */
+ /* Parameters needed to test nanobts_gen_set_nse_attr() */
bts->site_mgr->gprs.nse.nsei = 101;
uint8_t attr_nse_expected[] =
{ 0x9d, 0x00, 0x02, 0x00, 0x65, 0xa0, 0x00, 0x07, 0x03, 0x03, 0x03,
@@ -182,7 +182,7 @@
0x0a, 0x03, 0x0a, 0x03
};
- /* Parameters needed to test nanobts_attr_cell_get() */
+ /* Parameters needed to test nanobts_gen_set_cell_attr() */
bts->gprs.rac = 0x00;
bts->gprs.cell.bvci = 2;
bts->gprs.mode = BTS_GPRS_GPRS;
@@ -194,7 +194,7 @@
0xfa, 0x00, 0xfa, 0x02
};
- /* Parameters needed to test nanobts_attr_nsvc_get() */
+ /* Parameters needed to test nanobts_gen_set_nsvc_attr() */
struct osmo_sockaddr_str addr;
osmo_sockaddr_str_from_str(&addr, "10.9.1.101", 23000);
osmo_sockaddr_str_to_sockaddr(&addr,
&bts->site_mgr->gprs.nsvc[0].remote.u.sas);
@@ -205,7 +205,7 @@
0x09, 0x01, 0x65, 0x5a, 0x3c
};
- /* Parameters needed to test nanobts_attr_radio_get() */
+ /* Parameters needed to test nanobts_gen_set_radio_attr() */
trx->arfcn = 866;
trx->max_power_red = 22;
bts->c0->max_power_red = 22;
@@ -213,11 +213,11 @@
{ 0x2d, 0x0b, 0x05, 0x00, 0x02, 0x03, 0x62 };
/* Run tests */
- test_nanobts_attr_bts_get(bts, attr_bts_expected);
- test_nanobts_attr_nse_get(bts, attr_nse_expected);
- test_nanobts_attr_cell_get(bts, attr_cell_expected);
- test_nanobts_attr_nsvc_get(bts, attr_nscv_expected);
- test_nanobts_attr_radio_get(bts, trx, attr_radio_expected);
+ test_nanobts_gen_set_bts_attr(bts, attr_bts_expected);
+ test_nanobts_gen_set_nse_attr(bts, attr_nse_expected);
+ test_nanobts_gen_set_cell_attr(bts, attr_cell_expected);
+ test_nanobts_gen_set_nsvc_attr(bts, attr_nscv_expected);
+ test_nanobts_gen_set_radio_attr(bts, trx, attr_radio_expected);
/* NSVC IPv6 test */
struct osmo_sockaddr_str addr6;
@@ -234,7 +234,7 @@
0xfd, 0x00, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56,
0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12,
};
- test_nanobts_attr_nsvc_get(bts, attr_nscv6_expected);
+ test_nanobts_gen_set_nsvc_attr(bts, attr_nscv6_expected);
printf("Done\n");
diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.ok
b/tests/nanobts_omlattr/nanobts_omlattr_test.ok
index faeac7b..b011ed4 100644
--- a/tests/nanobts_omlattr/nanobts_omlattr_test.ok
+++ b/tests/nanobts_omlattr/nanobts_omlattr_test.ok
@@ -1,29 +1,29 @@
-Testing nanobts_attr_bts_get()...
+Testing nanobts_gen_set_bts_attr()...
result=
19736d67615b5518060e00020120331e2424a83421a81f3f2500010a0c0a0b012a5a2b03e80a01230a080362093f99000700f11000010539
expected=19736d67615b5518060e00020120331e2424a83421a81f3f2500010a0c0a0b012a5a2b03e80a01230a080362093f99000700f11000010539
ok.
-Testing nanobts_attr_nse_get()...
+Testing nanobts_gen_set_nse_attr()...
result= 9d00020065a00007030303031e030aa1000b03030303030a030a030a03
expected=9d00020065a00007030303031e030aa1000b03030303030a030a030a03
ok.
-Testing nanobts_attr_cell_get()...
+Testing nanobts_gen_set_cell_attr()...
result= 9a0001009c000205039e00020002a30009140505a0050a04080fa800020f00a9000500fa00fa02
expected=9a0001009c000205039e00020002a30009140505a0050a04080fa800020f00a9000500fa00fa02
ok.
-Testing nanobts_attr_nsvc_get()...
+Testing nanobts_gen_set_nsvc_attr()...
result= 9f00020065a2000859d80a0901655a3c
expected=9f00020065a2000859d80a0901655a3c
ok.
-Testing nanobts_attr_nsvc_get()...
+Testing nanobts_gen_set_nsvc_attr()...
result= 2d0b0500020362
expected=2d0b0500020362
ok.
-Testing nanobts_attr_nsvc_get()...
+Testing nanobts_gen_set_nsvc_attr()...
result= 9f00020065fd001629005a3c59e2fd005678901234567890123456789012
expected=9f00020065fd001629005a3c59e2fd005678901234567890123456789012
ok.
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bsc/+/27931
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I306cb407dbd9b98e301b5d93046bdadcb466b82b
Gerrit-Change-Number: 27931
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange