TT#111150 Stop exposing ASN1C symbols

These are data types and symbols for which we do not have any control
over their API/ABI guarantees and means we cannot update to newer
ASN1C versions w/o continuously bumping the SONAME. Stop exposing them
as part of our public interface, which requires a SONAME bump as this
is an API and ABI breaking change.

Add a version script to control the ABI that we expose.

Change-Id: I4077da7b47bb48007a17027215ca33bfb201a3b7
coverity_scan
Guillem Jover 4 years ago
parent c624c61c74
commit 2e515dd48a

@ -1,5 +1,5 @@
export LIBNAME=libtcap export LIBNAME=libtcap
export VERSION=0 export VERSION=1
export LIBSO=$(LIBNAME).so export LIBSO=$(LIBNAME).so
export LIBSOVER=$(LIBNAME).so.$(VERSION) export LIBSOVER=$(LIBNAME).so.$(VERSION)
@ -29,7 +29,6 @@ clean:
install: all install: all
mkdir -p $(DESTDIR)/$(HDR) mkdir -p $(DESTDIR)/$(HDR)
cp include/*.h $(DESTDIR)/$(HDR) cp include/*.h $(DESTDIR)/$(HDR)
cp asn1-compiled/*.h $(DESTDIR)/$(HDR)
mkdir -p $(DESTDIR)/$(LIBDIR) mkdir -p $(DESTDIR)/$(LIBDIR)
cp src/$(LIBSOVER) $(DESTDIR)/$(LIBDIR)/$(LIBSOVER) cp src/$(LIBSOVER) $(DESTDIR)/$(LIBDIR)/$(LIBSOVER)
ln -s $(LIBSOVER) $(DESTDIR)/$(LIBDIR)/$(LIBSO) ln -s $(LIBSOVER) $(DESTDIR)/$(LIBDIR)/$(LIBSO)

2
debian/.gitignore vendored

@ -5,4 +5,4 @@
/debhelper-build-stamp /debhelper-build-stamp
/files /files
/ngcp-libtcap-dev/ /ngcp-libtcap-dev/
/ngcp-libtcap0/ /ngcp-libtcap1/

4
debian/control vendored

@ -7,7 +7,7 @@ Standards-Version: 3.9.8
Build-Depends: Build-Depends:
debhelper-compat (= 12), debhelper-compat (= 12),
Package: ngcp-libtcap0 Package: ngcp-libtcap1
Architecture: any Architecture: any
Depends: Depends:
${misc:Depends}, ${misc:Depends},
@ -20,7 +20,7 @@ Package: ngcp-libtcap-dev
Architecture: any Architecture: any
Section: libdevel Section: libdevel
Depends: Depends:
ngcp-libtcap0 (= ${binary:Version}), ngcp-libtcap1 (= ${binary:Version}),
${misc:Depends}, ${misc:Depends},
Description: Headers for ngcp-libtcap0 Description: Headers for ngcp-libtcap0
Library providing handling ASN.1-coded TCAP and INAP messages Library providing handling ASN.1-coded TCAP and INAP messages

@ -4,11 +4,6 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include "TCMessage.h"
#include "Invoke.h"
#include "constr_TYPE.h"
struct output_buffer { struct output_buffer {
char *buf; char *buf;
size_t buf_size; size_t buf_size;
@ -23,15 +18,9 @@ static inline void output_buffer_init(struct output_buffer *o, char *i, size_t s
int tcap_encode_with_routing(char **out, const uint8_t *routing, size_t routing_len); int tcap_encode_with_routing(char **out, const uint8_t *routing, size_t routing_len);
TCMessage_t *tcap_decode(const char *buf, size_t len);
void *inap_decode(Invoke_t *invoke, asn_TYPE_descriptor_t **);
int tcap_extract(const char *buf, size_t len, const char *spec, struct output_buffer *out); int tcap_extract(const char *buf, size_t len, const char *spec, struct output_buffer *out);
int inap_extract(const char *buf, size_t len, const char *spec, struct output_buffer *out); int inap_extract(const char *buf, size_t len, const char *spec, struct output_buffer *out);
int isup_convert_number(const char *inp, int inlen, char *out); int isup_convert_number(const char *inp, int inlen, char *out);
int isup_convert_number_hex(const char *inp, int inlen, char *out); int isup_convert_number_hex(const char *inp, int inlen, char *out);
int tcap_encode(char **out, TCMessage_t *msg);
#endif #endif

2
src/.gitignore vendored

@ -1,4 +1,4 @@
*.sw? *.sw?
*.so *.so
*.so.0 *.so.*
*.o *.o

@ -5,6 +5,7 @@ CFLAGS := -g -Wall -O3
CFLAGS += -fPIC CFLAGS += -fPIC
LDFLAGS := -O3 LDFLAGS := -O3
LDFLAGS += -shared -fPIC -Wl,-soname,$(LIBNAME).so.$(VERSION) LDFLAGS += -shared -fPIC -Wl,-soname,$(LIBNAME).so.$(VERSION)
LDFLAGS += -Wl,--version-script=libtcap.map
OBJS=tcap.o OBJS=tcap.o

@ -0,0 +1,11 @@
LIBTCAP_1 {
global:
tcap_encode_with_routing;
tcap_extract;
inap_extract;
isup_convert_number;
isup_convert_number_hex;
local:
*;
};

@ -48,7 +48,7 @@ static int buf_append(const void *buffer, size_t size, void *app_key) {
return (ret == 1) ? 0 : -1; return (ret == 1) ? 0 : -1;
} }
int tcap_encode(char **out, TCMessage_t *msg) { static int tcap_encode(char **out, TCMessage_t *msg) {
FILE *fp; FILE *fp;
char *str; char *str;
size_t len; size_t len;
@ -118,7 +118,7 @@ int tcap_encode_with_routing(char **out, const uint8_t *routing, size_t routing_
return ret; return ret;
} }
TCMessage_t *tcap_decode(const char *buf, size_t len) { static TCMessage_t *tcap_decode(const char *buf, size_t len) {
TCMessage_t *ret = NULL; TCMessage_t *ret = NULL;
asn_dec_rval_t rv; asn_dec_rval_t rv;
@ -131,7 +131,7 @@ TCMessage_t *tcap_decode(const char *buf, size_t len) {
return NULL; return NULL;
} }
void *inap_decode(Invoke_t *invoke, asn_TYPE_descriptor_t **type) { static void *inap_decode(Invoke_t *invoke, asn_TYPE_descriptor_t **type) {
long opcode; long opcode;
int rv; int rv;
void *arg = 0; void *arg = 0;

Loading…
Cancel
Save