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
This commit is contained in:
Pau Espin 2022-04-25 17:06:09 +02:00
parent 3a46ae5962
commit 201eb29616
9 changed files with 47 additions and 47 deletions

View File

@ -28,9 +28,9 @@ struct gsm_bts_sm;
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);

View File

@ -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 @@ struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts)
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 @@ struct msgb *nanobts_attr_nse_get(struct gsm_bts_sm *bts_sm)
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 @@ struct msgb *nanobts_attr_cell_get(struct gsm_bts *bts)
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 @@ struct msgb *nanobts_attr_nsvc_get(struct gsm_bts *bts)
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;

View File

@ -105,7 +105,7 @@ static void configure_loop(struct gsm_bts *bts, struct gsm_nm_state *state, bool
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);
}

View File

@ -95,7 +95,7 @@ static void configure_loop(struct gsm_gprs_cell *cell, struct gsm_nm_state *stat
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);

View File

@ -94,7 +94,7 @@ static void configure_loop(struct gsm_gprs_nse *nse, struct gsm_nm_state *state,
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);

View File

@ -107,7 +107,7 @@ static void configure_loop(struct gsm_gprs_nsvc *nsvc, struct gsm_nm_state *stat
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);

View File

@ -92,7 +92,7 @@ static void configure_loop(struct gsm_bts_trx *trx, struct gsm_nm_state *state,
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);
}

View File

@ -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 @@ static void test_nanobts_attr_bts_get(struct gsm_bts *bts, uint8_t *expected)
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 @@ static void test_nanobts_attr_nse_get(struct gsm_bts *bts, uint8_t *expected)
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 @@ static void test_nanobts_attr_cell_get(struct gsm_bts *bts, uint8_t *expected)
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 @@ static void test_nanobts_attr_nsvc_get(struct gsm_bts *bts, uint8_t *expected)
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 @@ int main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
{ 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 @@ int main(int argc, char **argv)
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");

View File

@ -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.