pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42220?usp=email )
Change subject: Introduce API osmo_asn1_tcap_set_talloc_ctx()
......................................................................
Introduce API osmo_asn1_tcap_set_talloc_ctx()
Related: SYS#5423
Related: OS#6965
Change-Id: I206d401efc7ae7680ac2eff75ee062b9b2676a58
---
A TODO-RELEASE
M include/osmocom/tcap/tcap.h
M src/tcap.c
3 files changed, 19 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-asn1-tcap refs/changes/20/42220/1
diff --git a/TODO-RELEASE b/TODO-RELEASE
new file mode 100644
index 0000000..078ec17
--- /dev/null
+++ b/TODO-RELEASE
@@ -0,0 +1,10 @@
+# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install
+# according to https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release
+# In short: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info…
+# LIBVERSION=c:r:a
+# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a.
+# If any interfaces have been added, removed, or changed since the last update: c + 1:0:a.
+# If any interfaces have been added since the last public release: c:r:a + 1.
+# If any interfaces have been removed or changed since the last public release: c:r:0.
+#library what description / commit summary line
+libosmo-asn1-tcap add osmo_asn1_tcap_set_talloc_ctx()
diff --git a/include/osmocom/tcap/tcap.h b/include/osmocom/tcap/tcap.h
index 309f283..92f05fd 100644
--- a/include/osmocom/tcap/tcap.h
+++ b/include/osmocom/tcap/tcap.h
@@ -6,6 +6,8 @@
#include <osmocom/tcap/TCAP_TCMessage.h>
+void *osmo_asn1_tcap_set_talloc_ctx(void *tall_ctx);
+
int osmo_asn1_tcap_decode(struct TCAP_TCMessage *tcapmsg, const uint8_t *data, size_t data_len);
void osmo_asn1_tcap_TCMessage_free_contents(struct TCAP_TCMessage *tcapmsg);
diff --git a/src/tcap.c b/src/tcap.c
index f5303ac..be9f960 100644
--- a/src/tcap.c
+++ b/src/tcap.c
@@ -28,6 +28,13 @@
void *tcap_talloc_asn1_ctx;
+void *osmo_asn1_tcap_set_talloc_ctx(void *tall_ctx)
+{
+ void *prev_talloc_ctx = tcap_talloc_asn1_ctx;
+ tcap_talloc_asn1_ctx = tall_ctx;
+ return prev_talloc_ctx;
+}
+
int osmo_asn1_tcap_decode(struct TCAP_TCMessage *tcapmsg, const uint8_t *data, size_t data_len)
{
--
To view, visit https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42220?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-asn1-tcap
Gerrit-Branch: master
Gerrit-Change-Id: I206d401efc7ae7680ac2eff75ee062b9b2676a58
Gerrit-Change-Number: 42220
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42218?usp=email )
Change subject: tests: Use mem alloc macro instead of direct calloc() call
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42218?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-asn1-tcap
Gerrit-Branch: master
Gerrit-Change-Id: Ia9c7cf1f958f273dd7a5e23cf7633e45fa9d577f
Gerrit-Change-Number: 42218
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 26 Feb 2026 15:40:04 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42217?usp=email )
Change subject: Makefile.am: Avoid removing tcap.h during make -C src/ regen
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42217?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-asn1-tcap
Gerrit-Branch: master
Gerrit-Change-Id: I89a34ef61e6f74ba7482a5abcf55404c157a14fb
Gerrit-Change-Number: 42217
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 26 Feb 2026 15:39:49 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: daniel, fixeria, lynxis lazus, osmith, pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42219?usp=email )
Change subject: Use talloc to allocate asn1c decoded structs
......................................................................
Patch Set 2:
(1 comment)
File src/tcap.c:
https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42219/comment/31437194_343… :
PS2, Line 29: vo
ok, this is differnt from how we havndle talloc_asn1_ctx in libasn1c so far. There we do not define the symbol, just declare it extern, and rely on the application to define it (and hopefully derive it from another, more global or thread-local talloc context).
I think requiring the application to define it forces the application developer to think about where to hook up that context, where as defining it in the library will make it easy to fortget about it.
Other topic: Naming-wise, all other symbols exported by the library are called osmo_asn1_tcap_* whereas thisone forgoes the prefix. I think at some point we wanted to makes ure all symbols have meaningful namespace prefixes, and all should start with osmo_* if it's from a library?
--
To view, visit https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42219?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-asn1-tcap
Gerrit-Branch: master
Gerrit-Change-Id: I6d885527caa5b60011b4fac341b93026ab1833d9
Gerrit-Change-Number: 42219
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Thu, 26 Feb 2026 15:39:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42219?usp=email )
Change subject: Use talloc to allocate asn1c decoded structs
......................................................................
Use talloc to allocate asn1c decoded structs
Related: SYS#5423
Related: OS#6965
Change-Id: I6d885527caa5b60011b4fac341b93026ab1833d9
---
M configure.ac
M debian/control
M include/osmocom/tcap/asn_internal.h
M libosmo-asn1-tcap.pc.in
M src/Makefile.am
M src/tcap.c
M tests/parse/Makefile.am
7 files changed, 27 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-asn1-tcap refs/changes/19/42219/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42219?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmo-asn1-tcap
Gerrit-Branch: master
Gerrit-Change-Id: I6d885527caa5b60011b4fac341b93026ab1833d9
Gerrit-Change-Number: 42219
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42216?usp=email )
Change subject: Add README.md
......................................................................
Add README.md
Change-Id: Ie3fa506cb9b40992cebe6942ea833a2e49ba2680
---
A README.md
1 file changed, 68 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-asn1-tcap refs/changes/16/42216/1
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..0a264f7
--- /dev/null
+++ b/README.md
@@ -0,0 +1,68 @@
+libosmo-asn1-tcap
+=================
+
+This repository contains C-language routing to encode and decode TCAP (ITU Q.771-Q.775).
+
+Homepage
+--------
+
+The official homepage of the project is
+https://gitea.osmocom.org/ss7-in-c/libosmo-asn1-tcap/
+
+GIT Repository
+--------------
+
+You can clone from the official osmo-cbc.git repository using
+
+ git clone https://gitea.osmocom.org/ss7-in-c/libosmo-asn1-tcap/
+
+There is a web interface at <https://gitea.osmocom.org/ss7-in-c/libosmo-asn1-tcap/>
+
+Mailing List
+------------
+
+Discussions related to osmo-cbc are happening on the
+openbsc(a)lists.osmocom.org mailing list, please see
+https://lists.osmocom.org/mailman/listinfo/openbsc for subscription
+options and the list archive.
+
+Please observe the [Osmocom Mailing List
+Rules](https://osmocom.org/projects/cellular-infrastructure/wiki/Mailing_List_Rules)
+when posting.
+
+Contributing
+------------
+
+Our coding standards are described at
+https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards
+
+We use a Gerrit based patch submission/review process for managing
+contributions. Please see
+https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for
+more details
+
+The current patch queue for libosmo-asn1-tcap can be seen at
+https://gerrit.osmocom.org/#/q/project:libosmo-asn1-tcap+status:open
+
+
+Generating asn1c code
+---------------------
+
+The upstream fork maintained by a big contributor
+[mouse07410](https://github.com/mouse07410/asn1c) of asn1c is used to generate
+TCAP code from from ASN.1 files present in src/sbcap/asn1/.
+
+In order to regenerate the code, one shall adjust the ASN1C_SKELETON_PATH and
+ASN1C_BIN_PATH in configure.ac to point to the built & installed asn1c from
+mouse07410 (usually `vlm_master` branch). Last generated code was built using
+commit hash 2c065550a5a0d08636cad64f4b067c1dcba2f339.
+
+Then, do the usual `autoreconf -fi && ./configure`, using a buildir != srcdir
+(important, in order to avoid ending up with temporary files in srcdir and
+making it difficult to stash the relevant changes).
+
+Finally, run `make -C src/ regen`, which will regenerate the files and copy over
+the skeletons, with git possibly showing changes in the following paths:
+- include/osmocom/tcap/
+- src/gen/
+- src/skel/
--
To view, visit https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42216?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-asn1-tcap
Gerrit-Branch: master
Gerrit-Change-Id: Ie3fa506cb9b40992cebe6942ea833a2e49ba2680
Gerrit-Change-Number: 42216
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42218?usp=email )
Change subject: tests: Use mem alloc macro instead of direct calloc() call
......................................................................
tests: Use mem alloc macro instead of direct calloc() call
This way we make sure the proper function to alloc is called.
Change-Id: Ia9c7cf1f958f273dd7a5e23cf7633e45fa9d577f
---
M tests/parse/tcap_parse_test.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-asn1-tcap refs/changes/18/42218/1
diff --git a/tests/parse/tcap_parse_test.c b/tests/parse/tcap_parse_test.c
index 6a52cea..0f44963 100644
--- a/tests/parse/tcap_parse_test.c
+++ b/tests/parse/tcap_parse_test.c
@@ -30,7 +30,7 @@
{
asn_dec_rval_t rc;
struct TCAP_TCMessage *tcapmsg;
- tcapmsg = calloc(1, sizeof(*tcapmsg));
+ tcapmsg = CALLOC(1, sizeof(*tcapmsg));
printf("Basic TCAP decode testing.\n");
--
To view, visit https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42218?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-asn1-tcap
Gerrit-Branch: master
Gerrit-Change-Id: Ia9c7cf1f958f273dd7a5e23cf7633e45fa9d577f
Gerrit-Change-Number: 42218
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>