osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-iuh/+/30088 )
Change subject: asn1tostruct: fix defines getting redefined
......................................................................
asn1tostruct: fix defines getting redefined
Do not write the same define twice for two files in a struct, e.g.:
#define ENHANCEDRELOCATIONCOMPLETEREQUESTIES_RANAP_EXTENDEDRNC_ID_PRESENT (1 << 0)
#define ENHANCEDRELOCATIONCOMPLETEREQUESTIES_RANAP_EXTENDEDRNC_ID_PRESENT (1 << 1)
#define ENHANCEDRELOCATIONCOMPLETEREQUESTIES_RANAP_RAB_SETUPLIST_ENHANCEDRELOCCOMPLETEREQ_PRESENT (1 << 2)
typedef struct RANAP_EnhancedRelocationCompleteRequestIEs_s {
uint16_t presenceMask;
RANAP_IuSignallingConnectionIdentifier_t oldIuSigConId;
RANAP_IuSignallingConnectionIdentifier_t iuSigConId;
RANAP_GlobalRNC_ID_t relocation_SourceRNC_ID;
RANAP_ExtendedRNC_ID_t relocation_SourceExtendedRNC_ID; ///< Optional field
RANAP_GlobalRNC_ID_t relocation_TargetRNC_ID;
RANAP_ExtendedRNC_ID_t relocation_TargetExtendedRNC_ID; ///< Optional field
RANAP_RAB_SetupList_EnhancedRelocCompleteReq_t raB_SetupList_EnhancedRelocCompleteReq; ///< Optional field
} RANAP_EnhancedRelocationCompleteRequestIEs_t;
The problem is that the type is used and it may not be unique inside a
struct. Change the code to use the name of the field if the type is not
unique. Keep using the type otherwise so existing code doesn't need to
be modified a lot to fix this.
Fix for:
../include/osmocom/ranap/ranap_ies_defs.h:514: warning: "RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_IUSIGNALLINGCONNECTIONIDENTIFIER_PRESENT" redefined
Change-Id: I2ecae6789899952d1dc5691ab76907abeaa71c12
---
M TODO-RELEASE
M asn1/utils/asn1tostruct.py
2 files changed, 28 insertions(+), 4 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, approved
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 3ecddae..0ca9114 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -8,3 +8,4 @@
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
libosmo-ranap API/ABI change deprecate ranap_cn_rx_{cl,co}_decode, use ranap_cn_rx_{cl,co}_decode2 instead
+all API change rename duplicate generated defines from asn1tostruct
diff --git a/asn1/utils/asn1tostruct.py b/asn1/utils/asn1tostruct.py
index 220517d..d71d87d 100755
--- a/asn1/utils/asn1tostruct.py
+++ b/asn1/utils/asn1tostruct.py
@@ -79,6 +79,29 @@
print("-p [pfx] Prefix all types with given prefix")
print("-h Print this help and return")
+def getUniqueIENameForDefine(ies, ie):
+ """ Usually the type of the IE is used for defines. However a struct may
+ use the same type multiple times, in that case we use the actual name
+ of the field. """
+ unique = True
+
+ for ie_other in ies:
+ if ie_other == ie:
+ continue
+ if ie_other[2] == ie[2]:
+ unique = False
+ assert ie[0] != ie_other[0], "failed to find a unique name for" \
+ f" IE {ie}. Found another entry in ies {ie_other}" \
+ " that has the same ie[0] value."
+
+ if unique:
+ ret = ie[2]
+ else:
+ ret = ie[0]
+
+ ret = re.sub('-', '_', ret.upper())
+ return ret
+
try:
opts, args = getopt.getopt(sys.argv[1:], "df:ho:p:", ["debug", "file", "help", "outdir", "prefix"])
except getopt.GetoptError as err:
@@ -167,7 +190,7 @@
# Presence mask
for ie in iesDefs[key]["ies"]:
- ieupperunderscore = re.sub('-', '_', ie[2].upper())
+ ieupperunderscore = getUniqueIENameForDefine(iesDefs[key]["ies"], ie)
if ie[3] == "optional" or ie[3] == "conditional":
f.write("#define {0:<{pad}} {1}\n".format("%s_%s%s_PRESENT" % (keyupperunderscore, prefix, ieupperunderscore), "(1 << %d)" % shift,
pad=iesDefs[key]["length"] + len(keyupperunderscore) + 9))
@@ -328,7 +351,7 @@
ienameunderscorefirstlower = lowerFirstCamelWord(ienameunderscore)
ietypesubst = prefix + re.sub('-', '', ie[2])
ietypeunderscore = prefix + re.sub('-', '_', ie[2])
- ieupperunderscore = prefix + re.sub('-', '_', ie[2]).upper()
+ ieupperunderscore = prefix + getUniqueIENameForDefine(iesDefs[key]["ies"], ie)
if ie[3] == "optional":
f.write(" /* Optional field */\n")
elif ie[3] == "conditional":
@@ -377,7 +400,7 @@
for ie in iesDefs[key]["ies"]:
ietypeunderscore = prefix + re.sub('-', '_', ie[2])
- ieupperunderscore = prefix + re.sub('-', '_', ie[2]).upper()
+ ieupperunderscore = prefix + getUniqueIENameForDefine(iesDefs[key]["ies"], ie)
if ie[3] != "mandatory":
if ie[3] == "optional":
f.write(" /* Optional field */\n")
@@ -471,7 +494,7 @@
iename = re.sub('-', '_', re.sub('id-', '', ie[0]))
ienameunderscore = prefix + re.sub('-', '_', iename)
ienamefirstwordlower = lowerFirstCamelWord(iename)
- ieupperunderscore = prefix + re.sub('-', '_', ie[2]).upper()
+ ieupperunderscore = prefix + getUniqueIENameForDefine(iesDefs[key]["ies"], ie)
ietypeunderscore = prefix + re.sub('-', '_', ie[2])
if ie[3] != "mandatory":
if ie[3] == "optional":
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/30088
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I2ecae6789899952d1dc5691ab76907abeaa71c12
Gerrit-Change-Number: 30088
Gerrit-PatchSet: 4
Gerrit-Owner: osmith <osmith(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
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-iuh/+/30087 )
Change subject: hnbap_common: hnbap_cause_str: handle nothing val
......................................................................
hnbap_common: hnbap_cause_str: handle nothing val
Fix for:
../../../src/osmo-iuh/src/hnbap_common.c:85:9: error: enumeration value ‘HNBAP_Cause_PR_NOTHING’ not handled in switch [-Werror=switch]
Change-Id: Icab3052e27d1951129e3809e61357ee23c4cb588
---
M src/hnbap_common.c
1 file changed, 3 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/src/hnbap_common.c b/src/hnbap_common.c
index be7d570..67cc30c 100644
--- a/src/hnbap_common.c
+++ b/src/hnbap_common.c
@@ -103,6 +103,9 @@
get_value_string(hnbap_cause_misc_vals,
cause->choice.misc));
break;
+ case HNBAP_Cause_PR_NOTHING:
+ snprintf(buf, sizeof(buf), "NOTHING");
+ break;
}
return buf;
}
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/30087
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Icab3052e27d1951129e3809e61357ee23c4cb588
Gerrit-Change-Number: 30087
Gerrit-PatchSet: 4
Gerrit-Owner: osmith <osmith(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
Attention is currently required from: pespin.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-iuh/+/30088 )
Change subject: asn1tostruct: fix defines getting redefined
......................................................................
Patch Set 4: Code-Review+2
(2 comments)
Patchset:
PS4:
re-applying and combining votes after rebase
File asn1/utils/asn1tostruct.py:
https://gerrit.osmocom.org/c/osmo-iuh/+/30088/comment/03f8c5f3_44c3c42a
PS3, Line 84: use the same type multiple times, in that case we use the actual name
> If somebody needs to actually use them / or debug the generated code for whatever reason, I think it […]
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/30088
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I2ecae6789899952d1dc5691ab76907abeaa71c12
Gerrit-Change-Number: 30088
Gerrit-PatchSet: 4
Gerrit-Owner: osmith <osmith(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-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 15 Nov 2022 10:37:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: Hoernchen.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/simtrace2/+/30153 )
Change subject: conrtrib/upload : upload elf files
......................................................................
Patch Set 2: Code-Review-1
(3 comments)
Commit Message:
https://gerrit.osmocom.org/c/simtrace2/+/30153/comment/ff02b776_528cf67f
PS2, Line 15: device will end up in DFU mode upon reset.
I suggest to put this warning visibly elsewhere too (in a manual that already explains how to upgrade the firmware or something?), not many people will read it here in this commit message.
Patchset:
PS2:
-1: might be a | missing
File contrib/prepare_upload.sh:
https://gerrit.osmocom.org/c/simtrace2/+/30153/comment/9d0039f3_6f03e6cd
PS2, Line 12: b
is a | missing here?
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/30153
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ifceb16d385388356ac1bf8b13f5df62c643bebf8
Gerrit-Change-Number: 30153
Gerrit-PatchSet: 2
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 15 Nov 2022 10:34:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment