Hello community, here is the log from the commit of package libosmo-abis for openSUSE:Factory checked in at 2016-11-11 14:33:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libosmo-abis (Old) and /work/SRC/openSUSE:Factory/.libosmo-abis.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libosmo-abis" Changes: -------- --- /work/SRC/openSUSE:Factory/libosmo-abis/libosmo-abis.changes 2016-02-01 19:55:36.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.libosmo-abis.new/libosmo-abis.changes 2016-11-11 14:33:53.000000000 +0100 @@ -1,0 +2,15 @@ +Sat Oct 1 12:30:41 UTC 2016 - [email protected] + +- Update to new upstream snapshot 0.3.2.24 +* No visible changes +- Add ortp27.diff + +------------------------------------------------------------------- +Sat Jul 30 17:54:58 UTC 2016 - [email protected] + +- Update to new upstream snapshot 0.3.2.19 +* ipa driver: make bind address vty configurable +* Do not send RTP to port 0 +* Add defines for FN to SAMPLE conversion + +------------------------------------------------------------------- Old: ---- libosmo-abis-0.3.2.3.tar.xz New: ---- _service libosmo-abis-0.3.2.24.tar.xz ortp27.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libosmo-abis.spec ++++++ --- /var/tmp/diff_new_pack.HJ2tIs/_old 2016-11-11 14:33:54.000000000 +0100 +++ /var/tmp/diff_new_pack.HJ2tIs/_new 2016-11-11 14:33:54.000000000 +0100 @@ -16,8 +16,10 @@ # +%define version_unconverted 0.3.2.24 + Name: libosmo-abis -Version: 0.3.2.3 +Version: 0.3.2.24 Release: 0 Summary: Osmocom library for A-bis interface between BTS and BSC License: AGPL-3.0+ and GPL-2.0+ @@ -29,6 +31,7 @@ Source: %name-%version.tar.xz Patch1: osmo-talloc.diff Patch2: 0001-build-resolve-compiler-warnings.patch +Patch3: ortp27.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf BuildRequires: automake >= 1.6 @@ -39,7 +42,7 @@ BuildRequires: pkgconfig(libosmocore) >= 0.3.0 BuildRequires: pkgconfig(libosmogsm) >= 0.3.10 BuildRequires: pkgconfig(libosmovty) >= 0.3.0 -BuildRequires: pkgconfig(ortp) >= 0.13.1 +BuildRequires: pkgconfig(ortp) >= 0.22 %description In GSM, A-bis is a BSS-internal interface link between the BTS and @@ -98,8 +101,8 @@ applications that want to make use of libosmotrau. %prep -%setup -qn %name -%patch -P 1 -P 2 -p1 +%setup -q +%patch -P 1 -P 2 -P 3 -p1 %build echo "%version" >.tarball-version ++++++ _service ++++++ <services> <service name="tar_scm" mode="localonly"> <param name="scm">git</param> <param name="url">git://git.osmocom.org/libosmo-abis</param> <param name="parent-tag">v0.3.2</param> <param name="versionformat">0.3.2.@TAG_OFFSET@</param> </service> <service name="recompress" mode="localonly"> <param name="file">*.tar</param> <param name="compression">xz</param> </service> <service name="set_version" mode="localonly"/> </services> ++++++ libosmo-abis-0.3.2.3.tar.xz -> libosmo-abis-0.3.2.24.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/.gitignore new/libosmo-abis-0.3.2.24/.gitignore --- old/libosmo-abis/.gitignore 2015-03-01 02:14:11.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/.gitignore 1970-01-01 01:00:00.000000000 +0100 @@ -1,44 +0,0 @@ -Makefile -Makefile.in -.deps -.libs -*.o -*.lo -*.la -*.pc -aclocal.m4 -m4/*.m4 -autom4te.cache -config.h* -config.sub -config.log -config.status -config.guess -configure -compile -depcomp -missing -ltmain.sh -install-sh -stamp-h1 -libtool -#libosmo-abis-* -tests/*_test - -.tarball-version -.version -.dirstamp - -# tests -tests/atconfig -tests/package.m4 -tests/testsuite -tests/testsuite.log -tests/subchan_demux/.dirstamp -tests/subchan_demux/subchan_demux_test -tests/ipa_recv/ipa_recv_test - - - -# vi/vim files -*.sw? diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/Makefile.am new/libosmo-abis-0.3.2.24/Makefile.am --- old/libosmo-abis/Makefile.am 2015-03-01 02:14:11.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/Makefile.am 2016-10-01 14:13:47.000000000 +0200 @@ -11,3 +11,5 @@ echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version + +EXTRA_DIST = .version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/TODO-RELEASE new/libosmo-abis-0.3.2.24/TODO-RELEASE --- old/libosmo-abis/TODO-RELEASE 2015-03-01 02:14:11.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/TODO-RELEASE 2016-10-01 14:13:47.000000000 +0200 @@ -1 +1,2 @@ #library what description / commit summary line +libosmo-abis API change major: add parameter to rx_cb() callack in osmo_ortp.h diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/configure.ac new/libosmo-abis-0.3.2.24/configure.ac --- old/libosmo-abis/configure.ac 2015-12-23 18:32:12.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/configure.ac 2016-10-01 14:13:47.000000000 +0200 @@ -33,15 +33,7 @@ PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.0) PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.10) -PKG_CHECK_MODULES([ORTP], [ortp >= 0.13.1], - [ - PKG_CHECK_MODULES([ORTP_VERSION], [ortp >= 0.21], - [AC_DEFINE(HAVE_ORTP_021, 1, - [libortp >= 0.21])], - [AC_DEFINE(HAVE_ORTP_021, 0, - [libortp < 0.21])]) - ] -) +PKG_CHECK_MODULES(ORTP, ortp >= 0.22.0) AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/contrib/jenkins.sh new/libosmo-abis-0.3.2.24/contrib/jenkins.sh --- old/libosmo-abis/contrib/jenkins.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/contrib/jenkins.sh 2016-10-01 14:13:47.000000000 +0200 @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -ex + +rm -rf deps/install +mkdir deps || true +cd deps +osmo-deps.sh libosmocore + +cd libosmocore +autoreconf --install --force +./configure --prefix=$PWD/../install +$MAKE $PARALLEL_MAKE install + +cd ../../ +autoreconf --install --force +PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH ./configure +PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH $MAKE $PARALLEL_MAKE +PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE distcheck diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/debian/changelog new/libosmo-abis-0.3.2.24/debian/changelog --- old/libosmo-abis/debian/changelog 2015-12-23 18:32:12.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/debian/changelog 2016-10-01 14:13:47.000000000 +0200 @@ -1,4 +1,10 @@ -libosmo-abis (0.3.2) UNRELEASED; urgency=medium +libosmo-abis (0.3.3) UNRELEASED; urgency=medium + + * Move forward towards a new release. + + -- Holger Hans Peter Freyther <[email protected]> Tue, 24 May 2016 23:02:47 +0200 + +libosmo-abis (0.3.2) unstable; urgency=medium * Bump so version to re-link libosmovty diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/include/internal.h new/libosmo-abis-0.3.2.24/include/internal.h --- old/libosmo-abis/include/internal.h 2015-03-01 02:14:11.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/include/internal.h 2016-10-01 14:13:47.000000000 +0200 @@ -13,6 +13,9 @@ /* use libosmo_abis_init, this is only for internal use. */ void e1inp_init(void); +void e1inp_ipa_set_bind_addr(const char *ip_bind_addr); +const char *e1inp_ipa_get_bind_addr(void); + /* ipaccess.c requires these functions defined here */ struct msgb; struct msgb *ipa_msg_alloc(int headroom); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/include/osmocom/abis/e1_input.h new/libosmo-abis-0.3.2.24/include/osmocom/abis/e1_input.h --- old/libosmo-abis/include/osmocom/abis/e1_input.h 2015-03-01 02:14:11.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/include/osmocom/abis/e1_input.h 2016-10-01 14:13:47.000000000 +0200 @@ -139,6 +139,7 @@ void (*vty_show)(struct vty *vty, struct e1inp_line *line); int default_delay; int has_keepalive; + const char *bind_addr; }; struct e1inp_line_ops { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/include/osmocom/abis/ipa.h new/libosmo-abis-0.3.2.24/include/osmocom/abis/ipa.h --- old/libosmo-abis/include/osmocom/abis/ipa.h 2015-03-01 02:14:11.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/include/osmocom/abis/ipa.h 2016-10-01 14:13:47.000000000 +0200 @@ -35,9 +35,14 @@ struct osmo_fd ofd; struct llist_head tx_queue; int (*closed_cb)(struct ipa_server_conn *peer); + int (*ccm_cb)(struct ipa_server_conn *peer, struct msgb *msg, + struct tlv_parsed *tlvp, struct ipaccess_unit *ud); int (*cb)(struct ipa_server_conn *peer, struct msgb *msg); void *data; struct msgb *pending_msg; + /* remote address information */ + const char *addr; + uint16_t port; }; struct ipa_server_conn * @@ -48,6 +53,7 @@ void ipa_server_conn_destroy(struct ipa_server_conn *peer); void ipa_server_conn_send(struct ipa_server_conn *peer, struct msgb *msg); +int ipa_server_conn_ccm(struct ipa_server_conn *conn, struct msgb *msg); enum ipa_client_conn_state { IPA_CLIENT_LINK_STATE_NONE = 0, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/include/osmocom/abis/lapd_pcap.h new/libosmo-abis-0.3.2.24/include/osmocom/abis/lapd_pcap.h --- old/libosmo-abis/include/osmocom/abis/lapd_pcap.h 2015-03-01 02:14:11.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/include/osmocom/abis/lapd_pcap.h 2016-10-01 14:13:47.000000000 +0200 @@ -5,6 +5,7 @@ #define OSMO_LAPD_PCAP_OUTPUT 1 int osmo_pcap_lapd_open(char *filename, mode_t mode); +int osmo_pcap_lapd_set_fd(int fd); int osmo_pcap_lapd_write(int fd, int direction, struct msgb *msg); int osmo_pcap_lapd_close(int fd); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/include/osmocom/trau/osmo_ortp.h new/libosmo-abis-0.3.2.24/include/osmocom/trau/osmo_ortp.h --- old/libosmo-abis/include/osmocom/trau/osmo_ortp.h 2015-12-23 18:32:12.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/include/osmocom/trau/osmo_ortp.h 2016-10-01 14:13:47.000000000 +0200 @@ -2,6 +2,7 @@ #define _OSMO_ORTP_H #include <stdint.h> +#include <stdbool.h> #include <osmocom/core/linuxlist.h> #include <osmocom/core/select.h> @@ -21,6 +22,15 @@ /*! \brief Osmocom pseudo-static paylaod type for Adaptive Multi Rate (AMR) */ #define RTP_PT_AMR 98 +#define GSM_VOICE_SAMPLE_RATE_HZ 8000 +#define GSM_VOICE_SAMPLES_PER_MS (GSM_VOICE_SAMPLE_RATE_HZ / 1000) +#define GSM_VOICE_MULTIFRAME 26 +#define GSM_RTP_FRAME_DURATION_MS 20 +#define GSM_SAMPLES_PER_RTP_FRAME (GSM_RTP_FRAME_DURATION_MS * GSM_VOICE_SAMPLES_PER_MS) +#define GSM_TDMA_FRAME_MS (120 / GSM_VOICE_MULTIFRAME) +#define GSM_MS_TO_SAMPLES(ms) ((ms) * GSM_VOICE_SAMPLES_PER_MS) +#define GSM_FN_TO_MS(fn) ((fn) * GSM_TDMA_FRAME_MS) + /*! \brief Parameter to osmo_rtp_socket_param_set() */ enum osmo_rtp_param { OSMO_RTP_P_JITBUF = 1, @@ -29,6 +39,7 @@ /*! \brief Flag to indicate the socket is in polling-only mode */ #define OSMO_RTP_F_POLL 0x0001 +#define OSMO_RTP_F_DISABLED 0x0002 /*! \brief A structure representing one RTP socket */ struct osmo_rtp_socket { @@ -44,7 +55,7 @@ /*! \brief callback for incoming data */ void (*rx_cb)(struct osmo_rtp_socket *rs, const uint8_t *payload, - unsigned int payload_len); + unsigned int payload_len, bool marker); /*! \brief Receive user timestamp, to be incremented by user */ uint32_t rx_user_ts; @@ -66,6 +77,9 @@ int osmo_rtp_socket_free(struct osmo_rtp_socket *rs); int osmo_rtp_send_frame(struct osmo_rtp_socket *rs, const uint8_t *payload, unsigned int payload_len, unsigned int duration); +int osmo_rtp_send_frame_ext(struct osmo_rtp_socket *rs, const uint8_t *payload, + unsigned int payload_len, unsigned int duration, + bool marker); int osmo_rtp_socket_poll(struct osmo_rtp_socket *rs); int osmo_rtp_get_bound_ip_port(struct osmo_rtp_socket *rs, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/m4/.gitignore new/libosmo-abis-0.3.2.24/m4/.gitignore --- old/libosmo-abis/m4/.gitignore 2015-03-01 02:14:11.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/m4/.gitignore 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -/libtool.m4 -/lt*.m4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/src/e1_input.c new/libosmo-abis-0.3.2.24/src/e1_input.c --- old/libosmo-abis/src/e1_input.c 2015-03-01 02:14:11.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/src/e1_input.c 2016-10-01 14:13:47.000000000 +0200 @@ -249,8 +249,14 @@ } msgb_enqueue(&sign_link->tx_list, msg); - /* dump it */ - write_pcap_packet(PCAP_OUTPUT, sign_link->sapi, sign_link->tei, msg); + /* we only need to write a 'Fake LAPD' packet here, if the + * underlying driver hides LAPD from us. If we use the + * libosmocore LAPD implementation, it will take care of writing + * the _actual_ LAPD packet */ + if (!e1i_ts->lapd) { + write_pcap_packet(PCAP_OUTPUT, sign_link->sapi, + sign_link->tei, msg); + } return 0; } @@ -499,8 +505,13 @@ switch (ts->type) { case E1INP_TS_TYPE_SIGN: + /* we only need to write a 'Fake LAPD' packet here, if + * the underlying driver hides LAPD from us. If we use + * the libosmocore LAPD implementation, it will take + * care of writing the _actual_ LAPD packet */ + if (!ts->lapd) + write_pcap_packet(PCAP_INPUT, sapi, tei, msg); /* consult the list of signalling links */ - write_pcap_packet(PCAP_INPUT, sapi, tei, msg); link = e1inp_lookup_sign_link(ts, tei, sapi); if (!link) { LOGP(DLMI, LOGL_ERROR, "didn't find signalling link for " @@ -712,7 +723,7 @@ int e1inp_line_update(struct e1inp_line *line) { struct input_signal_data isd; - int rc; + int i, rc; e1inp_line_get(line); @@ -721,6 +732,15 @@ } else rc = 0; + /* Set the PCAP file descriptor for all timeslots that have + * software LAPD instances, to ensure the osmo_lapd_pcap code is + * used to write PCAP files (if requested) */ + for (i = 0; i < ARRAY_SIZE(line->ts); i++) { + struct e1inp_ts *e1i_ts = &line->ts[i]; + if (e1i_ts->lapd) + e1i_ts->lapd->pcap_fd = pcap_fd; + } + /* Send a signal to anyone who is interested in new lines being * configured */ memset(&isd, 0, sizeof(isd)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/src/e1_input_vty.c new/libosmo-abis-0.3.2.24/src/e1_input_vty.c --- old/libosmo-abis/src/e1_input_vty.c 2015-03-01 02:14:11.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/src/e1_input_vty.c 2016-10-01 14:13:47.000000000 +0200 @@ -168,6 +168,17 @@ return CMD_SUCCESS; } +DEFUN(cfg_ipa_bind, + cfg_ipa_bind_cmd, + "ipa bind A.B.C.D", + "ipa driver config\n" + "Set ipa local bind address\n" + "Listen on this IP address (default 0.0.0.0)\n") +{ + e1inp_ipa_set_bind_addr(argv[0]); + return CMD_SUCCESS; +} + static int e1inp_config_write(struct vty *vty) { struct e1inp_line *line; @@ -202,6 +213,12 @@ VTY_NEWLINE); } + + const char *ipa_bind = e1inp_ipa_get_bind_addr(); + if (ipa_bind && (strcmp(ipa_bind, "0.0.0.0") != 0)) + vty_out(vty, " ipa bind %s%s", + ipa_bind, VTY_NEWLINE); + return CMD_SUCCESS; } @@ -351,6 +368,8 @@ install_element(L_E1INP_NODE, &cfg_e1_line_keepalive_params_cmd); install_element(L_E1INP_NODE, &cfg_e1_line_no_keepalive_cmd); + install_element(L_E1INP_NODE, &cfg_ipa_bind_cmd); + install_element_ve(&show_e1drv_cmd); install_element_ve(&show_e1line_cmd); install_element_ve(&show_e1ts_cmd); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/src/input/ipa.c new/libosmo-abis-0.3.2.24/src/input/ipa.c --- old/libosmo-abis/src/input/ipa.c 2015-03-01 02:14:11.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/src/input/ipa.c 2016-10-01 14:13:47.000000000 +0200 @@ -401,6 +401,8 @@ int (*closed_cb)(struct ipa_server_conn *conn), void *data) { struct ipa_server_conn *conn; + struct sockaddr_in sa; + socklen_t sa_len = sizeof(sa); conn = talloc_zero(ctx, struct ipa_server_conn); if (conn == NULL) { @@ -418,6 +420,12 @@ conn->data = data; INIT_LLIST_HEAD(&conn->tx_queue); + if (!getpeername(fd, (struct sockaddr *)&sa, &sa_len)) { + char *str = inet_ntoa(sa.sin_addr); + conn->addr = talloc_strdup(conn, str); + conn->port = ntohs(sa.sin_port); + } + if (osmo_fd_register(&conn->ofd) < 0) { LOGP(DLINP, LOGL_ERROR, "could not register FD\n"); talloc_free(conn); @@ -426,6 +434,73 @@ return conn; } +int ipa_server_conn_ccm(struct ipa_server_conn *conn, struct msgb *msg) +{ + struct tlv_parsed tlvp; + uint8_t msg_type = *(msg->l2h); + struct ipaccess_unit unit_data = {}; + char *unitid; + int len, rc; + + /* shared CCM handling on both server and client */ + rc = ipa_ccm_rcvmsg_base(msg, &conn->ofd); + switch (rc) { + case -1: + /* error in IPA CCM processing */ + goto err; + case 1: + /* IPA CCM message that was handled in _base */ + return 0; + case 0: + /* IPA CCM message that we need to handle */ + break; + default: + /* Error */ + LOGP(DLINP, LOGL_ERROR, "Unexpected return from " + "ipa_ccm_rcvmsg_base: %d\n", rc); + goto err; + } + + switch (msg_type) { + case IPAC_MSGT_ID_RESP: + rc = ipa_ccm_idtag_parse(&tlvp, (uint8_t *)msg->l2h + 2, + msgb_l2len(msg)-2); + if (rc < 0) { + LOGP(DLINP, LOGL_ERROR, "IPA CCM RESPonse with " + "malformed TLVs\n"); + goto err; + } + if (!TLVP_PRESENT(&tlvp, IPAC_IDTAG_UNIT)) { + LOGP(DLINP, LOGL_ERROR, "IPA CCM RESP without " + "unit ID\n"); + goto err; + } + len = TLVP_LEN(&tlvp, IPAC_IDTAG_UNIT); + if (len < 1) { + LOGP(DLINP, LOGL_ERROR, "IPA CCM RESP with short" + "unit ID\n"); + goto err; + } + unitid = (char *) TLVP_VAL(&tlvp, IPAC_IDTAG_UNIT); + unitid[len-1] = '\0'; + ipa_parse_unitid(unitid, &unit_data); + + /* FIXME */ + rc = conn->ccm_cb(conn, msg, &tlvp, &unit_data); + if (rc < 0) + goto err; + break; + default: + LOGP(DLINP, LOGL_ERROR, "Unknown IPA message type\n"); + break; + } + return 0; +err: + /* in case of any error, we close the connection */ + ipa_server_conn_destroy(conn); + return -1; +} + void ipa_server_conn_destroy(struct ipa_server_conn *conn) { close(conn->ofd.fd); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/src/input/ipaccess.c new/libosmo-abis-0.3.2.24/src/input/ipaccess.c --- old/libosmo-abis/src/input/ipaccess.c 2015-03-01 02:14:11.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/src/input/ipaccess.c 2016-10-01 14:13:47.000000000 +0200 @@ -570,6 +570,8 @@ char str[IPA_STRING_MAX]; uint8_t *tag; + memset(str, 0, sizeof(str)); + nmsg = ipa_msg_alloc(0); if (!nmsg) return NULL; @@ -595,16 +597,20 @@ dev->mac_addr[4], dev->mac_addr[5]); break; case IPAC_IDTAG_LOCATION1: - strncpy(str, dev->location1, IPA_STRING_MAX); + if (dev->location1) + strncpy(str, dev->location1, IPA_STRING_MAX); break; case IPAC_IDTAG_LOCATION2: - strncpy(str, dev->location2, IPA_STRING_MAX); + if (dev->location2) + strncpy(str, dev->location2, IPA_STRING_MAX); break; case IPAC_IDTAG_EQUIPVERS: - strncpy(str, dev->equipvers, IPA_STRING_MAX); + if (dev->equipvers) + strncpy(str, dev->equipvers, IPA_STRING_MAX); break; case IPAC_IDTAG_SWVERSION: - strncpy(str, dev->swversion, IPA_STRING_MAX); + if (dev->swversion) + strncpy(str, dev->swversion, IPA_STRING_MAX); break; case IPAC_IDTAG_UNITNAME: snprintf(str, sizeof(str), @@ -615,7 +621,8 @@ dev->mac_addr[4], dev->mac_addr[5]); break; case IPAC_IDTAG_SERNR: - strncpy(str, dev->serno, IPA_STRING_MAX); + if (dev->serno) + strncpy(str, dev->serno, IPA_STRING_MAX); break; default: LOGP(DLINP, LOGL_NOTICE, @@ -831,7 +838,8 @@ LOGP(DLINP, LOGL_NOTICE, "enabling ipaccess BSC mode\n"); oml_link = ipa_server_link_create(tall_ipa_ctx, line, - "0.0.0.0", IPA_TCP_PORT_OML, + e1inp_ipa_get_bind_addr(), + IPA_TCP_PORT_OML, ipaccess_bsc_oml_cb, NULL); if (oml_link == NULL) { LOGP(DLINP, LOGL_ERROR, "cannot create OML " @@ -845,7 +853,8 @@ return -EIO; } rsl_link = ipa_server_link_create(tall_ipa_ctx, line, - "0.0.0.0", IPA_TCP_PORT_RSL, + e1inp_ipa_get_bind_addr(), + IPA_TCP_PORT_RSL, ipaccess_bsc_rsl_cb, NULL); if (rsl_link == NULL) { LOGP(DLINP, LOGL_ERROR, "cannot create RSL " @@ -944,3 +953,20 @@ tall_ipa_ctx = talloc_named_const(libosmo_abis_ctx, 1, "ipa"); e1inp_driver_register(&ipaccess_driver); } + +void e1inp_ipa_set_bind_addr(const char *ip_bind_addr) +{ + talloc_free((char*)ipaccess_driver.bind_addr); + ipaccess_driver.bind_addr = NULL; + + if (ip_bind_addr) + ipaccess_driver.bind_addr = talloc_strdup(tall_ipa_ctx, + ip_bind_addr); +} + +const char *e1inp_ipa_get_bind_addr(void) +{ + return ipaccess_driver.bind_addr? + ipaccess_driver.bind_addr + : "0.0.0.0"; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/src/input/lapd_pcap.c new/libosmo-abis-0.3.2.24/src/input/lapd_pcap.c --- old/libosmo-abis/src/input/lapd_pcap.c 2015-03-01 02:14:11.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/src/input/lapd_pcap.c 2016-10-01 14:13:47.000000000 +0200 @@ -43,6 +43,8 @@ * pcap format is from http://wiki.wireshark.org/Development/LibpcapFileFormat */ #define DLT_LINUX_LAPD 177 +#define LINUX_SLL_HOST 0 +#define LINUX_SLL_OUTGOING 4 struct pcap_hdr { uint32_t magic_number; @@ -65,7 +67,7 @@ uint16_t pkttype; uint16_t hatype; uint16_t halen; - uint64_t addr; + uint8_t addr[8]; int16_t protocol; } __attribute__((packed)); @@ -75,10 +77,9 @@ osmo_static_assert(offsetof(struct pcap_lapdhdr, protocol) == 14, proto_offset); osmo_static_assert(sizeof(struct pcap_lapdhdr) == 16, lapd_header_size); -int osmo_pcap_lapd_open(char *filename, mode_t mode) +int osmo_pcap_lapd_set_fd(int fd) { - int fd; - struct pcap_hdr pcap_header = { + struct pcap_hdr pcap_header = { .magic_number = 0xa1b2c3d4, .version_major = 2, .version_minor = 4, @@ -88,6 +89,21 @@ .network = DLT_LINUX_LAPD, }; + if (write(fd, &pcap_header, sizeof(pcap_header)) + != sizeof(pcap_header)) { + LOGP(DLLAPD, LOGL_ERROR, "cannot write PCAP header: %s\n", + strerror(errno)); + close(fd); + return -1; + } + + return 0; +} + +int osmo_pcap_lapd_open(char *filename, mode_t mode) +{ + int fd, rc; + LOGP(DLLAPD, LOGL_NOTICE, "opening LAPD pcap file `%s'\n", filename); fd = open(filename, O_WRONLY|O_TRUNC|O_CREAT, mode); @@ -96,13 +112,13 @@ strerror(errno)); return -1; } - if (write(fd, &pcap_header, sizeof(pcap_header)) - != sizeof(pcap_header)) { - LOGP(DLLAPD, LOGL_ERROR, "cannot write PCAP header: %s\n", - strerror(errno)); + + rc = osmo_pcap_lapd_set_fd(fd); + if (rc < 0) { close(fd); - return -1; + return rc; } + return fd; } @@ -125,10 +141,13 @@ pcap_rechdr.incl_len = msg->len + sizeof(struct pcap_lapdhdr); pcap_rechdr.orig_len = msg->len + sizeof(struct pcap_lapdhdr); - header.pkttype = 4; + if (direction == OSMO_LAPD_PCAP_OUTPUT) + header.pkttype = htons(LINUX_SLL_OUTGOING); + else + header.pkttype = htons(LINUX_SLL_HOST); header.hatype = 0; header.halen = 0; - header.addr = direction == OSMO_LAPD_PCAP_OUTPUT ? 0x0 : 0x1; + header.addr[0] = 0x01; /* we are the network side */ header.protocol = ntohs(48); gettimeofday(&tv, NULL); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis/src/trau/osmo_ortp.c new/libosmo-abis-0.3.2.24/src/trau/osmo_ortp.c --- old/libosmo-abis/src/trau/osmo_ortp.c 2015-12-23 18:32:32.000000000 +0100 +++ new/libosmo-abis-0.3.2.24/src/trau/osmo_ortp.c 2016-10-01 14:13:47.000000000 +0200 @@ -23,6 +23,7 @@ */ #include <stdint.h> +#include <stdbool.h> #include <inttypes.h> #include <netdb.h> @@ -149,6 +150,8 @@ int osmo_rtp_socket_poll(struct osmo_rtp_socket *rs) { mblk_t *mblk; + if (rs->flags & OSMO_RTP_F_DISABLED) + return 0; mblk = rtp_session_recvm_with_ts(rs->sess, rs->rx_user_ts); if (mblk) { @@ -156,7 +159,8 @@ /* hand into receiver */ if (rs->rx_cb) rs->rx_cb(rs, mblk->b_rptr, - mblk->b_wptr - mblk->b_rptr); + mblk->b_wptr - mblk->b_rptr, + rtp_get_markbit(mblk)); //rs->rx_user_ts += 160; freemsg(mblk); return 1; @@ -186,7 +190,8 @@ /* hand into receiver */ if (rs->rx_cb) rs->rx_cb(rs, mblk->b_rptr, - mblk->b_wptr - mblk->b_rptr); + mblk->b_wptr - mblk->b_rptr, + rtp_get_markbit(mblk)); freemsg(mblk); } else LOGP(DLMIB, LOGL_INFO, "recvm_with_ts(%u): ERROR!\n", @@ -213,7 +218,6 @@ rs->rtp_bfd.fd = rtp_session_get_rtp_socket(rs->sess); rs->rtcp_bfd.fd = rtp_session_get_rtcp_socket(rs->sess); rs->rtp_bfd.when = rs->rtcp_bfd.when = BSC_FD_READ; - rs->rtp_bfd.when = rs->rtcp_bfd.when = 0; rs->rtp_bfd.data = rs->rtcp_bfd.data = rs; rs->rtp_bfd.cb = osmo_rtp_fd_cb; rs->rtcp_bfd.cb = osmo_rtcp_fd_cb; @@ -313,7 +317,7 @@ if (!rs) return NULL; - rs->flags = flags; + rs->flags = OSMO_RTP_F_DISABLED | flags; rs->sess = rtp_session_new(RTP_SESSION_SENDRECV); if (!rs->sess) { talloc_free(rs); @@ -353,12 +357,9 @@ */ int osmo_rtp_socket_bind(struct osmo_rtp_socket *rs, const char *ip, int port) { - int rc; -#if HAVE_ORTP_021 - rc = rtp_session_set_local_addr(rs->sess, ip, port, port+1); -#else - rc = rtp_session_set_local_addr(rs->sess, ip, port); -#endif + int rc, rtcp = (-1 != port) ? port + 1 : -1; + rc = rtp_session_set_local_addr(rs->sess, ip, port, rtcp); + if (rc < 0) return rc; @@ -382,12 +383,20 @@ int osmo_rtp_socket_connect(struct osmo_rtp_socket *rs, const char *ip, uint16_t port) { int rc; + if (!port) { + LOGP(DLMIB, LOGL_INFO, "osmo_rtp_socket_connect() refused to " + "set remote %s:%u\n", ip, port); + return 0; + } /* enable the use of connect() so later getsockname() will * actually return the IP address that was chosen for the local * sid of the connection */ rtp_session_set_connected_mode(rs->sess, 1); + rs->flags &= ~OSMO_RTP_F_DISABLED; + /* This call attempts to connect to the remote address, so make sure to + * set all other rtp session configuration before this call. */ rc = rtp_session_set_remote_addr(rs->sess, ip, port); if (rc < 0) return rc; @@ -408,14 +417,34 @@ int osmo_rtp_send_frame(struct osmo_rtp_socket *rs, const uint8_t *payload, unsigned int payload_len, unsigned int duration) { + return osmo_rtp_send_frame_ext(rs, payload, payload_len, duration, + false); +} + +/*! \brief Send one RTP frame via a RTP socket + * \param[in] rs OsmoRTP socket + * \param[in] payload pointer to buffer with RTP payload data + * \param[in] payload_len length of \a payload in bytes + * \param[in] duration duration in number of RTP clock ticks + * \param[in] marker the status of Marker bit in RTP header + * \returns 0 on success, <0 in case of error. + */ +int osmo_rtp_send_frame_ext(struct osmo_rtp_socket *rs, const uint8_t *payload, + unsigned int payload_len, unsigned int duration, + bool marker) +{ mblk_t *mblk; int rc; + if (rs->flags & OSMO_RTP_F_DISABLED) + return 0; + mblk = rtp_session_create_packet(rs->sess, RTP_FIXED_HEADER_SIZE, payload, payload_len); if (!mblk) return -ENOMEM; + rtp_set_markbit(mblk, marker); rc = rtp_session_sendm_with_ts(rs->sess, mblk, rs->tx_timestamp); rs->tx_timestamp += duration; @@ -567,11 +596,9 @@ *recv_lost = stats->cum_packet_loss; } -#if HAVE_ORTP_021 const jitter_stats_t *jitter; jitter = rtp_session_get_jitter_stats(rs->sess); if (jitter) *last_jitter = jitter->jitter; -#endif } ++++++ ortp27.diff ++++++ From: Jan Engelhardt <[email protected]> Date: 2016-10-01 14:30:22.066588957 +0200 build: make libosmo-abis build with ortp-0.27 --- src/trau/osmo_ortp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: libosmo-abis-0.3.2.24/src/trau/osmo_ortp.c =================================================================== --- libosmo-abis-0.3.2.24.orig/src/trau/osmo_ortp.c +++ libosmo-abis-0.3.2.24/src/trau/osmo_ortp.c @@ -94,7 +94,7 @@ static int ortp_to_osmo_lvl(OrtpLogLevel return LOGL_ERROR; } -static void my_ortp_logfn(OrtpLogLevel lev, const char *fmt, +static void my_ortp_logfn(const char *domain, OrtpLogLevel lev, const char *fmt, va_list args) { osmo_vlogp(DLMIB, ortp_to_osmo_lvl(lev), __FILE__, 0, @@ -271,7 +271,7 @@ void osmo_rtp_init(void *ctx) tall_rtp_ctx = ctx; ortp_set_memory_functions(&osmo_ortp_memfn); ortp_init(); - ortp_set_log_level_mask(0xffff); + ortp_set_log_level_mask(ORTP_LOG_DOMAIN, 0xffff); ortp_set_log_handler(my_ortp_logfn); create_payload_types(); } ++++++ osmo-talloc.diff ++++++ --- /var/tmp/diff_new_pack.HJ2tIs/_old 2016-11-11 14:33:54.000000000 +0100 +++ /var/tmp/diff_new_pack.HJ2tIs/_new 2016-11-11 14:33:54.000000000 +0100 @@ -9,23 +9,23 @@ src/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) -Index: libosmo-abis/configure.ac +Index: libosmo-abis-0.3.2.24/configure.ac =================================================================== ---- libosmo-abis.orig/configure.ac -+++ libosmo-abis/configure.ac -@@ -33,6 +33,7 @@ AM_CONFIG_HEADER(config.h) +--- libosmo-abis-0.3.2.24.orig/configure.ac ++++ libosmo-abis-0.3.2.24/configure.ac +@@ -30,6 +30,7 @@ AC_SUBST(SYMBOL_VISIBILITY) + dnl Generate the output + AM_CONFIG_HEADER(config.h) + ++PKG_CHECK_MODULES([TALLOC], [talloc]) PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.0) PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.10) -+PKG_CHECK_MODULES([TALLOC], [talloc]) - PKG_CHECK_MODULES([ORTP], [ortp >= 0.13.1], - [ - PKG_CHECK_MODULES([ORTP_VERSION], [ortp >= 0.21], -Index: libosmo-abis/src/Makefile.am +Index: libosmo-abis-0.3.2.24/src/Makefile.am =================================================================== ---- libosmo-abis.orig/src/Makefile.am -+++ libosmo-abis/src/Makefile.am -@@ -6,7 +6,7 @@ TRAU_LIBVERSION=0:0:0 +--- libosmo-abis-0.3.2.24.orig/src/Makefile.am ++++ libosmo-abis-0.3.2.24/src/Makefile.am +@@ -6,7 +6,7 @@ TRAU_LIBVERSION=1:0:0 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS= -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS) AM_LDFLAGS = $(COVERAGE_LDFLAGS)
