pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/41583?usp=email )
Change subject: Only export needed wrapper API
......................................................................
Only export needed wrapper API
Otherwise the asn_* symbols collide with other generated skeletons on
apps/library clients (eg. libasn1c.git).
Related: OS#6895
Related: OS#6896
Change-Id: I6d97ac94be91064be7203b11cffa4de9056afce1
---
M include/osmocom/tcap/Makefile.am
A include/osmocom/tcap/tcap.h
M src/Makefile.am
A src/tcap.c
M tests/parse/Makefile.am
5 files changed, 62 insertions(+), 3 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, approved
daniel: Looks good to me, but someone else must approve
diff --git a/include/osmocom/tcap/Makefile.am b/include/osmocom/tcap/Makefile.am
index d0a425a..304958b 100644
--- a/include/osmocom/tcap/Makefile.am
+++ b/include/osmocom/tcap/Makefile.am
@@ -98,6 +98,7 @@
osmo_asn1_tcap_HEADERS = \
$(SKEL_HEADER_FILES) \
$(GEN_HEADER_FILES) \
+ tcap.h \
version.h \
$(NULL)
diff --git a/include/osmocom/tcap/tcap.h b/include/osmocom/tcap/tcap.h
new file mode 100644
index 0000000..309f283
--- /dev/null
+++ b/include/osmocom/tcap/tcap.h
@@ -0,0 +1,11 @@
+/* libosmo-asn1-tcap public API */
+#pragma once
+
+#include <stdint.h>
+#include <unistd.h>
+
+#include <osmocom/tcap/TCAP_TCMessage.h>
+
+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/Makefile.am b/src/Makefile.am
index fd5a167..de48e4a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,3 +1,5 @@
+AM_CFLAGS = -I$(top_srcdir)/include/ -I$(top_srcdir)/src/skel $(ASN_MODULE_CFLAGS)
+
SKEL_SRC = \
skel/ANY.c \
skel/ANY_ber.c \
@@ -197,10 +199,10 @@
# documentation before making any modification
LIBVERSION=0:0:0
-#INCLUDES = $(all_includes) -I/usr/local/include/asn1c -I$(top_srcdir)/include
-AM_CFLAGS = -I$(top_srcdir)/include/ -I$(top_srcdir)/src/skel $(ASN_MODULE_CFLAGS)
+libosmo_asn1_tcap_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined -export-symbols-regex '^osmo_'
libosmo_asn1_tcap_la_SOURCES = \
+ tcap.c \
$(ASN_MODULE_SRC)
lib_LTLIBRARIES=libosmo-asn1-tcap.la
diff --git a/src/tcap.c b/src/tcap.c
new file mode 100644
index 0000000..68c7d9c
--- /dev/null
+++ b/src/tcap.c
@@ -0,0 +1,45 @@
+/* libosmo-asn1-tcap public API */
+/* (C) 2025 by sysmocom s.f.m.c. GmbH <info(a)sysmocom.de>
+ * All Rights Reserved
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <stdint.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <osmocom/tcap/asn_codecs.h>
+#include <osmocom/tcap/TCAP_TCMessage.h>
+
+int osmo_asn1_tcap_decode(struct TCAP_TCMessage *tcapmsg, const uint8_t *data, size_t data_len)
+{
+
+ asn_dec_rval_t asn_rc;
+
+ memset(tcapmsg, 0, sizeof(struct TCAP_TCMessage));
+
+ asn_rc = ber_decode(0, &asn_DEF_TCAP_TCMessage, (void **)&tcapmsg, data, data_len);
+ if (asn_rc.code != RC_OK)
+ return -EINVAL;
+ return 0;
+}
+
+void osmo_asn1_tcap_TCMessage_free_contents(struct TCAP_TCMessage *tcapmsg)
+{
+ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_TCAP_TCMessage, tcapmsg);
+}
diff --git a/tests/parse/Makefile.am b/tests/parse/Makefile.am
index 4a502b8..821865d 100644
--- a/tests/parse/Makefile.am
+++ b/tests/parse/Makefile.am
@@ -2,7 +2,7 @@
AM_CFLAGS = -Wall
AM_LDFLAGS = -no-install
-LDADD = $(top_builddir)/src/libosmo-asn1-tcap.la
+LDADD = $(top_builddir)/src/.libs/libosmo-asn1-tcap.a
check_PROGRAMS = \
tcap_parse_test \
--
To view, visit https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/41583?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-asn1-tcap
Gerrit-Branch: master
Gerrit-Change-Id: I6d97ac94be91064be7203b11cffa4de9056afce1
Gerrit-Change-Number: 41583
Gerrit-PatchSet: 4
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: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: daniel, fixeria, laforge, osmith, pespin.
Hello Jenkins Builder, daniel, fixeria, laforge, osmith,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-sigtran/+/41584?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Code-Review+1 by daniel, Verified-1 by Jenkins Builder
Change subject: tcap: use libosmo-asn1-tcap public API
......................................................................
tcap: use libosmo-asn1-tcap public API
Depends: libosmo-asn1-tcap.git Change-Id I6d97ac94be91064be7203b11cffa4de9056afce1
Related: OS#6895
Related: OS#6896
Change-Id: Ic00aa609f412a230c9e04aec280c0c4c1c81f32f
---
M src/tcap_as_loadshare.c
1 file changed, 7 insertions(+), 13 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/84/41584/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/41584?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Ic00aa609f412a230c9e04aec280c0c4c1c81f32f
Gerrit-Change-Number: 41584
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: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Attention is currently required from: daniel, fixeria, laforge, osmith.
daniel has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/41584?usp=email )
Change subject: tcap: use libosmo-asn1-tcap public API
......................................................................
Patch Set 1:
(1 comment)
File src/tcap_as_loadshare.c:
https://gerrit.osmocom.org/c/libosmo-sigtran/+/41584/comment/165f83be_ac037… :
PS1, Line 73: struct TCAP_TCMessage tcap = { 0 };
No more need to initialize tcap here
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/41584?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Ic00aa609f412a230c9e04aec280c0c4c1c81f32f
Gerrit-Change-Number: 41584
Gerrit-PatchSet: 1
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: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 04 Dec 2025 17:28:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: pespin.
daniel has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/41583?usp=email )
Change subject: Only export needed wrapper API
......................................................................
Patch Set 4: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/41583?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: I6d97ac94be91064be7203b11cffa4de9056afce1
Gerrit-Change-Number: 41583
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 04 Dec 2025 17:25:16 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/41583?usp=email
to look at the new patch set (#4).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: Only export needed wrapper API
......................................................................
Only export needed wrapper API
Otherwise the asn_* symbols collide with other generated skeletons on
apps/library clients (eg. libasn1c.git).
Related: OS#6895
Related: OS#6896
Change-Id: I6d97ac94be91064be7203b11cffa4de9056afce1
---
M include/osmocom/tcap/Makefile.am
A include/osmocom/tcap/tcap.h
M src/Makefile.am
A src/tcap.c
M tests/parse/Makefile.am
5 files changed, 62 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-asn1-tcap refs/changes/83/41583/4
--
To view, visit https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/41583?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: I6d97ac94be91064be7203b11cffa4de9056afce1
Gerrit-Change-Number: 41583
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: pespin <pespin(a)sysmocom.de>