diff --git a/Makefile b/Makefile index 478ba65..1302688 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ export LIBNAME=libtcap -export VERSION=0 +export VERSION=1 export LIBSO=$(LIBNAME).so export LIBSOVER=$(LIBNAME).so.$(VERSION) @@ -29,7 +29,6 @@ clean: install: all mkdir -p $(DESTDIR)/$(HDR) cp include/*.h $(DESTDIR)/$(HDR) - cp asn1-compiled/*.h $(DESTDIR)/$(HDR) mkdir -p $(DESTDIR)/$(LIBDIR) cp src/$(LIBSOVER) $(DESTDIR)/$(LIBDIR)/$(LIBSOVER) ln -s $(LIBSOVER) $(DESTDIR)/$(LIBDIR)/$(LIBSO) diff --git a/debian/.gitignore b/debian/.gitignore index c999930..a7b9d21 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -5,4 +5,4 @@ /debhelper-build-stamp /files /ngcp-libtcap-dev/ -/ngcp-libtcap0/ +/ngcp-libtcap1/ diff --git a/debian/control b/debian/control index 78d34ec..846481f 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.9.8 Build-Depends: debhelper-compat (= 12), -Package: ngcp-libtcap0 +Package: ngcp-libtcap1 Architecture: any Depends: ${misc:Depends}, @@ -20,7 +20,7 @@ Package: ngcp-libtcap-dev Architecture: any Section: libdevel Depends: - ngcp-libtcap0 (= ${binary:Version}), + ngcp-libtcap1 (= ${binary:Version}), ${misc:Depends}, Description: Headers for ngcp-libtcap0 Library providing handling ASN.1-coded TCAP and INAP messages diff --git a/debian/ngcp-libtcap0.install b/debian/ngcp-libtcap1.install similarity index 100% rename from debian/ngcp-libtcap0.install rename to debian/ngcp-libtcap1.install diff --git a/include/libtcap.h b/include/libtcap.h index 2ed1b36..0042c40 100644 --- a/include/libtcap.h +++ b/include/libtcap.h @@ -4,11 +4,6 @@ #include #include -#include "TCMessage.h" -#include "Invoke.h" -#include "constr_TYPE.h" - - struct output_buffer { char *buf; 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); - -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 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_hex(const char *inp, int inlen, char *out); -int tcap_encode(char **out, TCMessage_t *msg); - - #endif diff --git a/src/.gitignore b/src/.gitignore index 3f05b2d..74e0493 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1,4 +1,4 @@ *.sw? *.so -*.so.0 +*.so.* *.o diff --git a/src/Makefile b/src/Makefile index c0d5973..e481410 100644 --- a/src/Makefile +++ b/src/Makefile @@ -5,6 +5,7 @@ CFLAGS := -g -Wall -O3 CFLAGS += -fPIC LDFLAGS := -O3 LDFLAGS += -shared -fPIC -Wl,-soname,$(LIBNAME).so.$(VERSION) +LDFLAGS += -Wl,--version-script=libtcap.map OBJS=tcap.o diff --git a/src/libtcap.map b/src/libtcap.map new file mode 100644 index 0000000..a3ea0d2 --- /dev/null +++ b/src/libtcap.map @@ -0,0 +1,11 @@ +LIBTCAP_1 { +global: + tcap_encode_with_routing; + tcap_extract; + inap_extract; + isup_convert_number; + isup_convert_number_hex; + +local: + *; +}; diff --git a/src/tcap.c b/src/tcap.c index 67c9d2b..02ec309 100644 --- a/src/tcap.c +++ b/src/tcap.c @@ -48,7 +48,7 @@ static int buf_append(const void *buffer, size_t size, void *app_key) { return (ret == 1) ? 0 : -1; } -int tcap_encode(char **out, TCMessage_t *msg) { +static int tcap_encode(char **out, TCMessage_t *msg) { FILE *fp; char *str; size_t len; @@ -118,7 +118,7 @@ int tcap_encode_with_routing(char **out, const uint8_t *routing, size_t routing_ 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; asn_dec_rval_t rv; @@ -131,7 +131,7 @@ TCMessage_t *tcap_decode(const char *buf, size_t len) { 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; int rv; void *arg = 0;