Generate SI2bis Rest Octets

According to the spec it's an empty 1-byte element reserved for future
extension but we still have to generate padding properly. Add stub
function similar to the used for SI2ter and adjust test output
accordingly.

Related: OS#2711
Change-Id: I3c278c57880a173df3c4648c9724339d23ce94fd
This commit is contained in:
Max 2017-12-11 12:24:18 +01:00 committed by Harald Welte
parent d382bf63e2
commit 61b0c30cca
4 changed files with 20 additions and 2 deletions

View File

@ -10,6 +10,7 @@ struct gsm_bts;
int rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net);
int rest_octets_si2quater(uint8_t *data, struct gsm_bts *bts);
int rest_octets_si2ter(uint8_t *data);
int rest_octets_si2bis(uint8_t *data);
int rest_octets_si6(uint8_t *data, bool is1800_net);
struct gsm48_si_selection_params {

View File

@ -478,6 +478,20 @@ int rest_octets_si2ter(uint8_t *data)
return bv.data_len;
}
/* Generate SI2bis Rest Octests 3GPP TS 44.018 Table 10.5.2.33.1 */
int rest_octets_si2bis(uint8_t *data)
{
struct bitvec bv;
memset(&bv, 0, sizeof(bv));
bv.data = data;
bv.data_len = 1;
bitvec_spare_padding(&bv, (bv.data_len * 8) - 1);
return bv.data_len;
}
/* Generate SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72) */
int rest_octets_si3(uint8_t *data, const struct gsm48_si_ro_info *si3)
{

View File

@ -739,7 +739,10 @@ static int generate_si2bis(enum osmo_sysinfo_type t, struct gsm_bts *bts)
si2b->rach_control = bts->si_common.rach_control;
return sizeof(*si2b);
/* SI2bis Rest Octets as per 3GPP TS 44.018 §10.5.2.33 */
rc = rest_octets_si2bis(si2b->rest_octets);
return sizeof(*si2b) + rc;
}
static int generate_si2ter(enum osmo_sysinfo_type t, struct gsm_bts *bts)

View File

@ -203,7 +203,7 @@ generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 6
generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b
Testing if BA-IND is set as expected in SI2xxx and SI5xxx
SI2: 59 06 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SI2bis: 59 06 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SI2bis: 59 06 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2b
SI2ter: 59 06 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2b 2b 2b 2b
SI5: 06 1d 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SI5bis: 06 05 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00