osmith has submitted this change. ( https://gerrit.osmocom.org/c/asn1c/+/33762 )
Change subject: skeletons: fix misleading indentations
......................................................................
skeletons: fix misleading indentations
After upgrading our CI environment to use Debian 12 with
GCC 12, it complains about the following misleading indentations in
generated code in osmo-remsim.git. Fix it to be able to compile with
--enable-werror again.
../../../../src/osmo-remsim/src/rspro/INTEGER.c: In function ‘INTEGER_decode_aper’:
../../../../src/osmo-remsim/src/rspro/INTEGER.c:774:33: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
774 | if((specs && specs->field_unsigned)
| ^~
../../../../src/osmo-remsim/src/rspro/INTEGER.c:778:41: note: ...this statement, but the latter is misleadingly indented as if it were guarded by t
he ‘if’
778 | ASN_DEBUG("Got value %ld + low %lld",
| ^~~~~~~~~
cc1: all warnings being treated as errors
../../../../src/osmo-remsim/src/rspro/constr_CHOICE.c: In function ‘CHOICE_encode_aper’:
../../../../src/osmo-remsim/src/rspro/constr_CHOICE.c:1134:17: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
1134 | if(per_put_few_bits(po, present, ct->range_bits))
| ^~
../../../../src/osmo-remsim/src/rspro/constr_CHOICE.c:1137:25: note: ...this statement, but the latter is misleadingly indented as if it were guard
ed by the ‘if’
1137 | return elm->type->aper_encoder(elm->type, elm->per_constraints,
| ^~~~~~
cc1: all warnings being treated as errors
../../../../src/osmo-remsim/src/rspro/per_decoder.c: In function ‘aper_decode’:
../../../../src/osmo-remsim/src/rspro/per_decoder.c:161:9: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
161 | if(!td->aper_decoder)
| ^~
../../../../src/osmo-remsim/src/rspro/per_decoder.c:163:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded
by the ‘if’
163 | rval = td->aper_decoder(opt_codec_ctx, td, 0, sptr, &pd);
| ^~~~
Related: OS#6057
Change-Id: I2260df8f8ab8eaf5c2aac3c330f87dba4691c01e
---
M skeletons/INTEGER.c
M skeletons/constr_CHOICE.c
M skeletons/per_decoder.c
3 files changed, 47 insertions(+), 5 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
diff --git a/skeletons/INTEGER.c b/skeletons/INTEGER.c
index b3f0da1..042fd75 100644
--- a/skeletons/INTEGER.c
+++ b/skeletons/INTEGER.c
@@ -775,8 +775,8 @@
? asn_ulong2INTEGER(st, value)
: asn_long2INTEGER(st, value))
_ASN_DECODE_FAILED;
- ASN_DEBUG("Got value %ld + low %lld",
- value, ct->lower_bound);
+ ASN_DEBUG("Got value %ld + low %lld",
+ value, ct->lower_bound);
}
return rval;
} else {
diff --git a/skeletons/constr_CHOICE.c b/skeletons/constr_CHOICE.c
index 6a88b29..4e95e1d 100644
--- a/skeletons/constr_CHOICE.c
+++ b/skeletons/constr_CHOICE.c
@@ -1134,8 +1134,8 @@
if(per_put_few_bits(po, present, ct->range_bits))
_ASN_ENCODE_FAILED;
- return elm->type->aper_encoder(elm->type, elm->per_constraints,
- memb_ptr, po);
+ return elm->type->aper_encoder(elm->type, elm->per_constraints,
+ memb_ptr, po);
} else {
asn_enc_rval_t rval;
if(specs->ext_start == -1)
diff --git a/skeletons/per_decoder.c b/skeletons/per_decoder.c
index 20fe1a1..b5056b5 100644
--- a/skeletons/per_decoder.c
+++ b/skeletons/per_decoder.c
@@ -160,7 +160,7 @@
*/
if(!td->aper_decoder)
_ASN_DECODE_FAILED; /* PER is not compiled in */
- rval = td->aper_decoder(opt_codec_ctx, td, 0, sptr, &pd);
+ rval = td->aper_decoder(opt_codec_ctx, td, 0, sptr, &pd);
if(rval.code == RC_OK) {
/* Return the number of consumed bits */
rval.consumed = ((pd.buffer - (const uint8_t *)buffer) << 3)
--
To view, visit https://gerrit.osmocom.org/c/asn1c/+/33762
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: asn1c
Gerrit-Branch: osmo-iuh/master
Gerrit-Change-Id: I2260df8f8ab8eaf5c2aac3c330f87dba4691c01e
Gerrit-Change-Number: 33762
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/33766 )
Change subject: paging: also accept IMSI strings shorter than 3
......................................................................
paging: also accept IMSI strings shorter than 3
When an IMMEDIATE ASSIGNMENT MAC block (from PCUIF) is added to the
paging queue, then also an IMSI is required. The paging queue uses the
last three digits of the IMSI to calculate the paging group. In case no
IMSI or an IMSI shorter than 3 digits is given, the MAC block is
rejected. This was handeled differently before. Even an IMSI of length
0 would still be interpreted as "000" and not rejected. See also:
I9f3799916e8102bf1ce0f21891f2d24f43091f01
Let's restore the behaviour we had before and accept short IMSI
strings again.
Change-Id: Iab1c3f1c39dd59bb53aa74b2c9e9e135e3985e0b
Related: OS#6099
---
M src/common/paging.c
1 file changed, 47 insertions(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/66/33766/1
diff --git a/src/common/paging.c b/src/common/paging.c
index b1aad7c..ee1b201 100644
--- a/src/common/paging.c
+++ b/src/common/paging.c
@@ -270,6 +270,30 @@
return 0;
}
+/* Convert the last three digits of a given IMSI string to their decimal representation. In case the given IMSI string
+ * is shorter than three digits, the missing digits will be assumed to be 0. */
+static uint16_t convert_imsi_to_decimal(const char *imsi)
+{
+ uint16_t _imsi = 0;
+ size_t imsi_len = strlen(imsi);
+
+ if (imsi_len >= 3) {
+ imsi = imsi + imsi_len - 3;
+ _imsi = 100 * ((*(imsi++)) - '0');
+ _imsi += 10 * ((*(imsi++)) - '0');
+ _imsi += (*(imsi++)) - '0';
+ } else if (imsi_len == 2) {
+ imsi = imsi + imsi_len - 2;
+ _imsi += 10 * ((*(imsi++)) - '0');
+ _imsi += (*(imsi++)) - '0';
+ } else if (imsi_len == 1) {
+ imsi = imsi + imsi_len - 1;
+ _imsi += (*(imsi++)) - '0';
+ }
+
+ return _imsi;
+}
+
/* Add a ready formatted MAC block message to the paging queue, this can be an IMMEDIATE ASSIGNMENT, or a
* PAGING COMMAND (from the PCU) */
int paging_add_macblock(struct paging_state *ps, uint32_t tlli, const char *imsi, bool confirm, const uint8_t *macblock)
@@ -278,7 +302,6 @@
struct paging_record *pr;
uint16_t paging_group;
uint16_t _imsi;
- size_t imsi_len = strlen(imsi);
check_congestion(ps);
@@ -289,15 +312,7 @@
return -ENOSPC;
}
- /* Tha paging group is calculated from the last three digits of the IMSI */
- if (imsi_len < 3) {
- LOGP(DPAG, LOGL_ERROR, "IMSI with invalid length %zu (expecting at least the last 3 digits)\n", imsi_len);
- return -EINVAL;
- }
- imsi = imsi + imsi_len - 3;
- _imsi = 100 * ((*(imsi++)) - '0');
- _imsi += 10 * ((*(imsi++)) - '0');
- _imsi += (*(imsi++)) - '0';
+ _imsi = convert_imsi_to_decimal(imsi);
paging_group = gsm0502_calc_paging_group(&ps->chan_desc, _imsi);
group_q = &ps->paging_queue[paging_group];
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33766
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iab1c3f1c39dd59bb53aa74b2c9e9e135e3985e0b
Gerrit-Change-Number: 33766
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
osmith has submitted this change. ( https://gerrit.osmocom.org/c/asn1c/+/33761 )
Change subject: skeletons: fix various typos
......................................................................
skeletons: fix various typos
These typos have been fixed in the generated rspro code in
osmo-remsim.git. Fix them here as well, so when regenerating the code we
don't re-introduce the typos.
Change-Id: I9e2fa5a2e0c2bf153f67c1ae363baa1abb44f7ad
---
M skeletons/INTEGER.h
M skeletons/NativeInteger.c
M skeletons/OCTET_STRING.c
M skeletons/ber_tlv_tag.c
M skeletons/constr_CHOICE.c
M skeletons/constr_SEQUENCE.c
M skeletons/constr_SET.c
M skeletons/constr_SET_OF.c
M skeletons/constr_TYPE.h
M skeletons/converter-sample.c
M skeletons/per_opentype.c
M skeletons/per_support.h
12 files changed, 27 insertions(+), 14 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
diff --git a/skeletons/INTEGER.h b/skeletons/INTEGER.h
index e8b36c7..c8edf12 100644
--- a/skeletons/INTEGER.h
+++ b/skeletons/INTEGER.h
@@ -68,8 +68,8 @@
ASN_STRTOL_ERROR_RANGE = -3, /* Input outside of numeric range for long type */
ASN_STRTOL_ERROR_INVAL = -2, /* Invalid data encountered (e.g., "+-") */
ASN_STRTOL_EXPECT_MORE = -1, /* More data expected (e.g. "+") */
- ASN_STRTOL_OK = 0, /* Conversion succeded, number ends at (*end) */
- ASN_STRTOL_EXTRA_DATA = 1, /* Conversion succeded, but the string has extra stuff */
+ ASN_STRTOL_OK = 0, /* Conversion succeeded, number ends at (*end) */
+ ASN_STRTOL_EXTRA_DATA = 1, /* Conversion succeeded, but the string has extra stuff */
};
enum asn_strtol_result_e asn_strtol_lim(const char *str, const char **end, long *l);
diff --git a/skeletons/NativeInteger.c b/skeletons/NativeInteger.c
index ef17bee..17a58ea 100644
--- a/skeletons/NativeInteger.c
+++ b/skeletons/NativeInteger.c
@@ -94,7 +94,7 @@
/*
* ASN.1 encoded INTEGER: buf_ptr, length
* Fill the native, at the same time checking for overflow.
- * If overflow occured, return with RC_FAIL.
+ * If overflow occurred, return with RC_FAIL.
*/
{
INTEGER_t tmp;
diff --git a/skeletons/OCTET_STRING.c b/skeletons/OCTET_STRING.c
index 3e424e7..6df9a0a 100644
--- a/skeletons/OCTET_STRING.c
+++ b/skeletons/OCTET_STRING.c
@@ -109,7 +109,7 @@
/*
* The main reason why ASN.1 is still alive is that too much time and effort
* is necessary for learning it more or less adequately, thus creating a gut
- * necessity to demonstrate that aquired skill everywhere afterwards.
+ * necessity to demonstrate that acquired skill everywhere afterwards.
* No, I am not going to explain what the following stuff is.
*/
struct _stack_el {
diff --git a/skeletons/ber_tlv_tag.c b/skeletons/ber_tlv_tag.c
index 4270876..adf3a25 100644
--- a/skeletons/ber_tlv_tag.c
+++ b/skeletons/ber_tlv_tag.c
@@ -42,7 +42,7 @@
*/
if(val >> ((8 * sizeof(val)) - 9)) {
/*
- * We would not be able to accomodate
+ * We would not be able to accommodate
* any more tag bits.
*/
return -1;
diff --git a/skeletons/constr_CHOICE.c b/skeletons/constr_CHOICE.c
index 18c24cd..6a88b29 100644
--- a/skeletons/constr_CHOICE.c
+++ b/skeletons/constr_CHOICE.c
@@ -156,7 +156,7 @@
}
if(ctx->left >= 0) {
- /* ?Substracted below! */
+ /* ?Subtracted below! */
ctx->left += rval.consumed;
}
ADVANCE(rval.consumed);
diff --git a/skeletons/constr_SEQUENCE.c b/skeletons/constr_SEQUENCE.c
index 21e5190..0ffa282 100644
--- a/skeletons/constr_SEQUENCE.c
+++ b/skeletons/constr_SEQUENCE.c
@@ -166,7 +166,7 @@
}
if(ctx->left >= 0)
- ctx->left += rval.consumed; /* ?Substracted below! */
+ ctx->left += rval.consumed; /* ?Subtracted below! */
ADVANCE(rval.consumed);
NEXT_PHASE(ctx);
diff --git a/skeletons/constr_SET.c b/skeletons/constr_SET.c
index 8a124c0..cc195dd 100644
--- a/skeletons/constr_SET.c
+++ b/skeletons/constr_SET.c
@@ -154,7 +154,7 @@
}
if(ctx->left >= 0)
- ctx->left += rval.consumed; /* ?Substracted below! */
+ ctx->left += rval.consumed; /* ?Subtracted below! */
ADVANCE(rval.consumed);
NEXT_PHASE(ctx);
diff --git a/skeletons/constr_SET_OF.c b/skeletons/constr_SET_OF.c
index 2fd530e..eb1d481 100644
--- a/skeletons/constr_SET_OF.c
+++ b/skeletons/constr_SET_OF.c
@@ -122,7 +122,7 @@
}
if(ctx->left >= 0)
- ctx->left += rval.consumed; /* ?Substracted below! */
+ ctx->left += rval.consumed; /* ?Subtracted below! */
ADVANCE(rval.consumed);
ASN_DEBUG("Structure consumes %ld bytes, "
diff --git a/skeletons/constr_TYPE.h b/skeletons/constr_TYPE.h
index 13c60f3..e244d20 100644
--- a/skeletons/constr_TYPE.h
+++ b/skeletons/constr_TYPE.h
@@ -158,8 +158,8 @@
typedef struct asn_TYPE_tag2member_s {
ber_tlv_tag_t el_tag; /* Outmost tag of the member */
int el_no; /* Index of the associated member, base 0 */
- int toff_first; /* First occurence of the el_tag, relative */
- int toff_last; /* Last occurence of the el_tag, relatvie */
+ int toff_first; /* First occurrence of the el_tag, relative */
+ int toff_last; /* Last occurrence of the el_tag, relatvie */
} asn_TYPE_tag2member_t;
/*
diff --git a/skeletons/converter-sample.c b/skeletons/converter-sample.c
index 2f74a80..6047273 100644
--- a/skeletons/converter-sample.c
+++ b/skeletons/converter-sample.c
@@ -390,7 +390,7 @@
/*
* Move the buffer content left N bits, possibly joining it with
- * preceeding content.
+ * preceding content.
*/
static void
buffer_shift_left(size_t offset, int bits) {
diff --git a/skeletons/per_opentype.c b/skeletons/per_opentype.c
index 8c42f8b..e697cbb 100644
--- a/skeletons/per_opentype.c
+++ b/skeletons/per_opentype.c
@@ -154,7 +154,7 @@
} else {
FREEMEM(buf);
/* rv.code could be RC_WMORE, nonsense in this context */
- rv.code = RC_FAIL; /* Noone would give us more */
+ rv.code = RC_FAIL; /* No one would give us more */
}
return rv;
diff --git a/skeletons/per_support.h b/skeletons/per_support.h
index 181fe24..ed945ce 100644
--- a/skeletons/per_support.h
+++ b/skeletons/per_support.h
@@ -53,7 +53,7 @@
*/
int32_t per_get_few_bits(asn_per_data_t *per_data, int get_nbits);
-/* Undo the immediately preceeding "get_few_bits" operation */
+/* Undo the immediately preceding "get_few_bits" operation */
void per_get_undo(asn_per_data_t *per_data, int get_nbits);
/*
--
To view, visit https://gerrit.osmocom.org/c/asn1c/+/33761
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: asn1c
Gerrit-Branch: osmo-iuh/master
Gerrit-Change-Id: I9e2fa5a2e0c2bf153f67c1ae363baa1abb44f7ad
Gerrit-Change-Number: 33761
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: neels, pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/33732 )
Change subject: Tx Loc UPD ACC: Use PLMN provided by subscr
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
I would welcome a more verbose commit message explaining what this change is doing.
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/33732
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I421bd63a264db2bf6e1c4a4eea976f389e87b332
Gerrit-Change-Number: 33732
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 17 Jul 2023 10:21:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/33737 )
Change subject: USRPDevice:updateAlignment: remove byteswap code
......................................................................
USRPDevice:updateAlignment: remove byteswap code
After upgrading our CI environment to use Debian 12 with GCC 12, the
byteswap code fails the build with the following. I've talked to Eric
about this and he recommended to just remove the code as practically
nobody will use osmo-trx with a big endian system.
USRPDevice.cpp:591:30: error: 'data' is used uninitialized [-Werror=uninitialized]
591 | *wordPtr = host_to_usrp_u32(*wordPtr);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~
Related: OS#6057
Change-Id: I806d8c1432cb20efca1830a2752a4cbc70384b54
---
M Transceiver52M/device/usrp1/USRPDevice.cpp
1 file changed, 20 insertions(+), 2 deletions(-)
Approvals:
Hoernchen: Looks good to me, but someone else must approve
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
Objections:
pespin: I would prefer this is not merged as is
diff --git a/Transceiver52M/device/usrp1/USRPDevice.cpp b/Transceiver52M/device/usrp1/USRPDevice.cpp
index 5c40aa8..852b715 100644
--- a/Transceiver52M/device/usrp1/USRPDevice.cpp
+++ b/Transceiver52M/device/usrp1/USRPDevice.cpp
@@ -587,8 +587,7 @@
{
#ifndef SWLOOPBACK
short data[] = {0x00,0x02,0x00,0x00};
- uint32_t *wordPtr = (uint32_t *) data;
- *wordPtr = host_to_usrp_u32(*wordPtr);
+ /* FIXME: big endian */
bool tmpUnderrun;
std::vector<short *> buf(1, data);
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/33737
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I806d8c1432cb20efca1830a2752a4cbc70384b54
Gerrit-Change-Number: 33737
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged