From 0c7826e9bd8026b239d320dba49416fd603f17fd Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 25 Feb 2019 02:45:06 +0100 Subject: add osmo_sockaddr_str API For handling RTP IP addresses and ports, osmo-mgw, osmo-bsc and osmo-msc so far have their own separate shims and code duplication around inet_ntoa(), htons(), sockaddr conversions etc. Unify and standardize with this common API. In the MGW endpoint FSM that was introduced in osmo-bsc and which I would like to re-use for osmo-msc (upcoming patch moving that to osmo-mgw), it has turned out that using char* IP address and uint16_t port number types are a convenient common denominator for logging, MGCP message composition and GSM48. Ongoing osmo-msc work also uses this for MNCC. This is of course potentially useful for any other IP+port combinations besides RTP stream handling. Needless to say that most current implementations will probably stay with their current own conversion code for a long time; for current osmo-{bsc,msc,mgw} work (MGW endpoint FSM) though, I would like to move to this API here. Change-Id: Id617265337f09dfb6ddfe111ef5e578cd3dc9f63 --- tests/Makefile.am | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index ab3728f0..88bcd7e9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -30,6 +30,7 @@ check_PROGRAMS = timer/timer_test sms/sms_test ussd/ussd_test \ tdef/tdef_test tdef/tdef_vty_test_config_root \ tdef/tdef_vty_test_config_subnode \ tdef/tdef_vty_test_dynamic \ + sockaddr_str/sockaddr_str_test \ $(NULL) if ENABLE_MSGFILE @@ -236,6 +237,9 @@ tdef_tdef_vty_test_config_subnode_LDADD = $(LDADD) $(top_builddir)/src/vty/libos tdef_tdef_vty_test_dynamic_SOURCES = tdef/tdef_vty_test_dynamic.c tdef_tdef_vty_test_dynamic_LDADD = $(LDADD) $(top_builddir)/src/vty/libosmovty.la +sockaddr_str_sockaddr_str_test_SOURCES = sockaddr_str/sockaddr_str_test.c +sockaddr_str_sockaddr_str_test_LDADD = $(LDADD) + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -304,6 +308,7 @@ EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE) \ tdef/tdef_vty_test_config_root.vty \ tdef/tdef_vty_test_config_subnode.vty \ tdef/tdef_vty_test_dynamic.vty \ + sockaddr_str/sockaddr_str_test.ok \ $(NULL) DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c -- cgit v1.2.3