Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libosmo-abis for openSUSE:Factory checked in at 2021-11-20 02:39:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libosmo-abis (Old) and /work/SRC/openSUSE:Factory/.libosmo-abis.new.1895 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libosmo-abis" Sat Nov 20 02:39:28 2021 rev:15 rq:932575 version:1.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libosmo-abis/libosmo-abis.changes 2021-03-15 10:56:08.461332021 +0100 +++ /work/SRC/openSUSE:Factory/.libosmo-abis.new.1895/libosmo-abis.changes 2021-11-20 02:40:49.224447495 +0100 @@ -1,0 +2,10 @@ +Fri Nov 19 09:14:18 UTC 2021 - Martin Hauke <mar...@gmx.de> + +- Update to new upstream release 1.2.0 + * ipa: Introduce support for user-specific DSCP and priority + * e1_input: Allow (vty) configuration of IP DSCP and socket + priority +- Update patch: + * osmo-talloc.diff + +------------------------------------------------------------------- Old: ---- 1.1.1.tar.gz New: ---- 1.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libosmo-abis.spec ++++++ --- /var/tmp/diff_new_pack.utee0C/_old 2021-11-20 02:40:49.720445858 +0100 +++ /var/tmp/diff_new_pack.utee0C/_new 2021-11-20 02:40:49.728445832 +0100 @@ -17,7 +17,7 @@ Name: libosmo-abis -Version: 1.1.1 +Version: 1.2.0 Release: 0 Summary: Osmocom library for A-bis interface between BTS and BSC License: AGPL-3.0-or-later AND GPL-2.0-or-later ++++++ 1.1.1.tar.gz -> 1.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/configure.ac new/libosmo-abis-1.2.0/configure.ac --- old/libosmo-abis-1.1.1/configure.ac 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/configure.ac 2021-11-16 14:18:45.000000000 +0100 @@ -66,10 +66,10 @@ dnl Generate the output AM_CONFIG_HEADER(config.h) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.5.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.5.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.5.0) -PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 1.5.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.6.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.6.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.6.0) +PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 1.6.0) PKG_CHECK_MODULES(ORTP, ortp >= 0.22.0) AC_ARG_ENABLE([dahdi], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/contrib/libosmo-abis.spec.in new/libosmo-abis-1.2.0/contrib/libosmo-abis.spec.in --- old/libosmo-abis-1.1.1/contrib/libosmo-abis.spec.in 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/contrib/libosmo-abis.spec.in 2021-11-16 14:18:45.000000000 +0100 @@ -27,11 +27,11 @@ BuildRequires: libtool >= 2 BuildRequires: pkgconfig >= 0.20 BuildRequires: xz -BuildRequires: pkgconfig(libosmocore) >= 1.5.0 -BuildRequires: pkgconfig(libosmogsm) >= 1.5.0 -BuildRequires: pkgconfig(libosmovty) >= 1.5.0 -BuildRequires: pkgconfig(libosmocodec) >= 1.5.0 -BuildRequires: pkgconfig(ortp) >= 0.22 +BuildRequires: pkgconfig(libosmocore) >= 1.6.0 +BuildRequires: pkgconfig(libosmogsm) >= 1.6.0 +BuildRequires: pkgconfig(libosmovty) >= 1.6.0 +BuildRequires: pkgconfig(libosmocodec) >= 1.6.0 +BuildRequires: pkgconfig(ortp) >= 0.22.0 BuildRequires: pkgconfig(talloc) %description @@ -59,8 +59,8 @@ License: AGPL-3.0-or-later Group: Development/Libraries/C and C++ Requires: libosmoabis10 = %version -Requires: libosmocore-devel >= 0.3.0 -Requires: libosmogsm-devel >= 0.3.10 +Requires: libosmocore-devel >= 1.6.0 +Requires: libosmogsm-devel >= 1.6.0 %description -n libosmoabis-devel This library contains common/shared code regarding the GSM A-bis diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/debian/changelog new/libosmo-abis-1.2.0/debian/changelog --- old/libosmo-abis-1.1.1/debian/changelog 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/debian/changelog 2021-11-16 14:18:45.000000000 +0100 @@ -1,3 +1,29 @@ +libosmo-abis (1.2.0) unstable; urgency=medium + + [ Keith ] + * Configure E1 pcap file per line + * Log TRAU FSM at INFO not NOTICE + * Fix up vty 'show' commands for E1 line/timeslots + + [ Harald Welte ] + * ipa: Introduce support for user-specific DSCP and priority + * e1_input: Allow (vty) configuration of IP DSCP and socket priority + * trau: Introduce osmo_rtp_socket_set_priority() + + [ Philipp Maier ] + * ipaccess: do not block ipaccess_line_update on failure + + [ Pau Espin Pedrol ] + * Use new stat item/ctr getter APIs + * osmo_ortp: Fix seqno reset to 0 upon ssrc_changed + * e1_input: Fix line not removed from e1inp_line_list when freed + * e1_input: Document e1inp_line_create() + * ipaccess: Allow reconfiguring the ipa line during line_update() + * ipaccess: e1inp_ipa_bts_rsl_connect: Fix memleak recreating ipa_client_conn + * e1inp_input: Fix e1inp_line_clone removing original line from global list when freed + + -- Pau Espin Pedrol <pes...@sysmocom.de> Tue, 16 Nov 2021 14:18:45 +0100 + libosmo-abis (1.1.1) unstable; urgency=medium * attempt to fix RPM spec file after recent soversion bump diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/debian/control new/libosmo-abis-1.2.0/debian/control --- old/libosmo-abis-1.1.1/debian/control 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/debian/control 2021-11-16 14:18:45.000000000 +0100 @@ -11,7 +11,7 @@ dh-autoreconf, libdpkg-perl, git, - libosmocore-dev (>= 1.5.0), + libosmocore-dev (>= 1.6.0), pkg-config, libortp-dev Standards-Version: 3.9.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/include/internal.h new/libosmo-abis-1.2.0/include/internal.h --- old/libosmo-abis-1.1.1/include/internal.h 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/include/internal.h 2021-11-16 14:18:45.000000000 +0100 @@ -10,6 +10,19 @@ struct e1inp_sign_link; struct e1inp_ts; +struct ipa_proto_pars { + uint8_t dscp; + uint8_t priority; +}; + +struct ipa_pars { + struct ipa_proto_pars oml; + struct ipa_proto_pars rsl; +}; + +/* global parameters of IPA input driver */ +extern struct ipa_pars g_e1inp_ipaccess_pars; + /* talloc context for libosmo-abis. */ extern void *libosmo_abis_ctx; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/include/osmocom/abis/e1_input.h new/libosmo-abis-1.2.0/include/osmocom/abis/e1_input.h --- old/libosmo-abis-1.1.1/include/osmocom/abis/e1_input.h 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/include/osmocom/abis/e1_input.h 2021-11-16 14:18:45.000000000 +0100 @@ -223,6 +223,10 @@ void *driver_data; struct osmo_use_count use_count; + + /* file name and file descriptor of pcap for this line */ + char *pcap_file; + int pcap_fd; }; #define e1inp_line_ipa_oml_ts(line) (&line->ts[0]) #define e1inp_line_ipa_rsl_ts(line, trx_id) (&line->ts[1 + (trx_id)]) @@ -317,8 +321,11 @@ void *rx_cbdata); /* Write LAPD frames to the fd. */ +OSMO_DEPRECATED("Use e1_set_pcap_fd2() instead") int e1_set_pcap_fd(int fd); +int e1_set_pcap_fd2(struct e1inp_line *line, int fd); + /* called by TRAU muxer to obtain the destination mux entity */ struct subch_mux *e1inp_get_mux(uint8_t e1_nr, uint8_t ts_nr); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/include/osmocom/abis/ipa.h new/libosmo-abis-1.2.0/include/osmocom/abis/ipa.h --- old/libosmo-abis-1.1.1/include/osmocom/abis/ipa.h 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/include/osmocom/abis/ipa.h 2021-11-16 14:18:45.000000000 +0100 @@ -19,6 +19,8 @@ uint16_t port; int (*accept_cb)(struct ipa_server_link *link, int fd); void *data; + uint8_t dscp; + uint8_t priority; }; struct ipa_server_link * @@ -80,6 +82,8 @@ struct msgb *pending_msg; const char *local_addr; uint16_t local_port; + uint8_t dscp; + uint8_t priority; }; struct ipa_client_conn * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/include/osmocom/trau/osmo_ortp.h new/libosmo-abis-1.2.0/include/osmocom/trau/osmo_ortp.h --- old/libosmo-abis-1.1.1/include/osmocom/trau/osmo_ortp.h 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/include/osmocom/trau/osmo_ortp.h 2021-11-16 14:18:45.000000000 +0100 @@ -77,6 +77,7 @@ int osmo_rtp_socket_autoconnect(struct osmo_rtp_socket *rs); int osmo_rtp_socket_set_pt(struct osmo_rtp_socket *rs, int payload_type); int osmo_rtp_socket_set_dscp(struct osmo_rtp_socket *rs, int dscp); +int osmo_rtp_socket_set_priority(struct osmo_rtp_socket *rs, uint8_t prio); int osmo_rtp_socket_free(struct osmo_rtp_socket *rs); int osmo_rtp_skipped_frame(struct osmo_rtp_socket *rs, unsigned int duration); int osmo_rtp_send_frame(struct osmo_rtp_socket *rs, const uint8_t *payload, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/src/Makefile.am new/libosmo-abis-1.2.0/src/Makefile.am --- old/libosmo-abis-1.1.1/src/Makefile.am 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/src/Makefile.am 2021-11-16 14:18:45.000000000 +0100 @@ -1,8 +1,8 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -ABIS_LIBVERSION=10:0:0 -TRAU_LIBVERSION=6:0:4 +ABIS_LIBVERSION=11:0:1 +TRAU_LIBVERSION=7:0:5 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS= -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOE1D_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(COVERAGE_CFLAGS) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/src/e1_input.c new/libosmo-abis-1.2.0/src/e1_input.c --- old/libosmo-abis-1.1.1/src/e1_input.c 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/src/e1_input.c 2021-11-16 14:18:45.000000000 +0100 @@ -139,6 +139,40 @@ osmo_static_assert(offsetof(struct fake_linux_lapd_header, protocol) == 14, proto_offset); osmo_static_assert(sizeof(struct fake_linux_lapd_header) == 16, lapd_header_size); +int e1_set_pcap_fd2(struct e1inp_line *line, int fd) +{ + static const struct pcap_hdr header = { + .magic_number = 0xa1b2c3d4, + .version_major = 2, + .version_minor = 4, + .thiszone = 0, + .sigfigs = 0, + .snaplen = 65535, + .network = DLT_LINUX_LAPD, + }; + int i; + + /* write header */ + if (fd >= 0) { + int rc = write(fd, &header, sizeof(header)); + if (rc < 0) + return rc; + } + + /* 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 = fd; + } + /* close previous and update */ + if (line->pcap_fd >= 0) + close(line->pcap_fd); + line->pcap_fd = fd; + return 0; +} static int pcap_fd = -1; @@ -185,7 +219,7 @@ /* This currently only works for the D-Channel */ static void write_pcap_packet(int direction, int sapi, int tei, - struct msgb *msg) { + struct msgb *msg, int pcap_fd) { if (pcap_fd < 0) return; @@ -286,7 +320,7 @@ * the _actual_ LAPD packet */ if (!e1i_ts->lapd) { write_pcap_packet(PCAP_OUTPUT, sign_link->sapi, - sign_link->tei, msg); + sign_link->tei, msg, e1i_ts->line->pcap_fd); } return 0; @@ -418,6 +452,8 @@ if (line->driver_data) talloc_unlink(line, line->driver_data); } + + llist_del(&line->list); talloc_free(line); return 0; } @@ -434,6 +470,14 @@ return NULL; } +/*! Create a new e1inp line object. + * \param[in] e1_nr The line number of the new line to be created. + * \param[in] driver_name String identifying the driver (see e1inp_driver_register() for more info). + * \returns pointer to the new object created. + * + * The allocated object is returned with a count reference with name "ctor", + * which must be dropped in order to free the object [e1inp_line_put2(line, "ctor")]. + */ struct e1inp_line * e1inp_line_create(uint8_t e1_nr, const char *driver_name) { @@ -460,6 +504,7 @@ line->driver = driver; line->num = e1_nr; + line->pcap_fd = -1; line->rate_ctr = rate_ctr_group_alloc(line, &e1inp_ctr_g_d, line->num); if (!line->rate_ctr) { @@ -518,6 +563,8 @@ .use_cb = e1inp_line_use_cb, .use_counts = {0}, }; + /* initialize list so it can be safely deleted without affecting original line */ + INIT_LLIST_HEAD(&clone->list); e1inp_line_get2(clone, use); /* Clone is used internally for bfd */ return clone; } @@ -664,7 +711,7 @@ * 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); + write_pcap_packet(PCAP_INPUT, sapi, tei, msg, ts->line->pcap_fd); /* consult the list of signalling links */ link = e1inp_lookup_sign_link(ts, tei, sapi); if (!link) { @@ -901,7 +948,7 @@ 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; + e1i_ts->lapd->pcap_fd = line->pcap_fd; } /* Send a signal to anyone who is interested in new lines being @@ -916,13 +963,16 @@ static int e1i_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) { + struct e1inp_line *line; + if (subsys != SS_L_GLOBAL || signal != S_L_GLOBAL_SHUTDOWN) return 0; - if (pcap_fd) { - close(pcap_fd); - pcap_fd = -1; + llist_for_each_entry(line, &e1inp_line_list, list) { + if (line->pcap_fd >=0) + close(line->pcap_fd); + line->pcap_fd = -1; } return 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/src/e1_input_vty.c new/libosmo-abis-1.2.0/src/e1_input_vty.c --- old/libosmo-abis-1.1.1/src/e1_input_vty.c 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/src/e1_input_vty.c 2021-11-16 14:18:45.000000000 +0100 @@ -1,5 +1,5 @@ /* E1 vty interface */ -/* (C) 2011 by Harald Welte <lafo...@gnumonks.org> +/* (C) 2011-2021 by Harald Welte <lafo...@gnumonks.org> * All Rights Reserved * * SPDX-License-Identifier: AGPL-3.0+ @@ -245,33 +245,67 @@ return CMD_SUCCESS; } -DEFUN_ATTR(cfg_e1_pcap, cfg_e1_pcap_cmd, - "pcap .FILE", - "Setup a pcap recording of all E1 traffic\n" +DEFUN_ATTR(cfg_e1line_pcap, cfg_e1line_pcap_cmd, + "e1_line <0-255> pcap .FILE", + E1_LINE_HELP "Setup a pcap recording of E1 traffic for line\n" "Filename to save the packets to\n", CMD_ATTR_IMMEDIATE) { + struct e1inp_line *line; int fd; + int rc; + int e1_nr = atoi(argv[0]); + + line = e1inp_line_find(e1_nr); + if (!line) { + vty_out(vty, "%% Line %d doesn't exist%s", e1_nr, VTY_NEWLINE); + return CMD_WARNING; + } - fd = open(argv[0], O_WRONLY | O_CREAT | O_TRUNC, 0660); + fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0660); if (fd < 0) { - vty_out(vty, "Failed to setup E1 pcap recording to %s.%s", argv[0], VTY_NEWLINE); + vty_out(vty, "Failed to setup E1 pcap recording to %s%s", argv[1], VTY_NEWLINE); return CMD_WARNING; } - e1_set_pcap_fd(fd); + rc = e1_set_pcap_fd2(line, fd); + if (rc < 0) { + vty_out(vty, "Failed to write to E1 pcap file %s%s", argv[1], VTY_NEWLINE); + close(fd); + return CMD_WARNING; + } + osmo_talloc_replace_string(line, &line->pcap_file, argv[1]); return CMD_SUCCESS; } -DEFUN_ATTR(cfg_e1_no_pcap, cfg_e1_no_pcap_cmd, - "no pcap", - NO_STR "Disable pcap recording of all E1 traffic\n", +DEFUN_ATTR(cfg_e1line_no_pcap, cfg_e1line_no_pcap_cmd, + "no e1_line <0-255> pcap", + NO_STR E1_LINE_HELP "Disable pcap recording of E1 traffic for line\n", CMD_ATTR_IMMEDIATE) { - e1_set_pcap_fd(-1); + struct e1inp_line *line; + int e1_nr = atoi(argv[0]); + line = e1inp_line_find(e1_nr); + + e1_set_pcap_fd2(line, -1); + if (line->pcap_file) { + talloc_free(line->pcap_file); + line->pcap_file = NULL; + } return CMD_SUCCESS; } +DEFUN_DEPRECATED(cfg_e1_pcap_deprec, cfg_e1_pcap_deprec_cmd, + "pcap .FILE", "Legacy") +{ + vty_out(vty, "%% 'pcap' is deprecated and has no effect: use e1_line <0-255> pcap%s", + VTY_NEWLINE); + return CMD_WARNING; +} + +ALIAS_DEPRECATED(cfg_e1_pcap_deprec, cfg_e1_pcap_deprec_no_cmd, + "no pcap", NO_STR); + DEFUN_ATTR(cfg_e1inp, cfg_e1inp_cmd, "e1_input", "Configure E1/T1/J1 TDM input\n", CMD_ATTR_IMMEDIATE) @@ -293,6 +327,38 @@ return CMD_SUCCESS; } +DEFUN_USRATTR(cfg_ipa_dscp, cfg_ipa_dscp_cmd, + X(OSMO_ABIS_LIB_ATTR_IPA_NEW_LNK), + "ipa ip-dscp (oml|rsl) <0-63>", + "ipa driver config\n" + "Set IP DSCP value for outbound packets\n" + "Set IP DSCP for OML link\n" + "Set IP DSCP for RSL link\n" + "IP DSCP Value to use\n") +{ + if (!strcmp(argv[0], "oml")) + g_e1inp_ipaccess_pars.oml.dscp = atoi(argv[1]); + else + g_e1inp_ipaccess_pars.rsl.dscp = atoi(argv[1]); + return CMD_SUCCESS; +} + +DEFUN_USRATTR(cfg_ipa_priority, cfg_ipa_priority_cmd, + X(OSMO_ABIS_LIB_ATTR_IPA_NEW_LNK), + "ipa socket-priority (oml|rsl) <0-255>", + "ipa driver config\n" + "Set socket priority value for outbound packets\n" + "Set socket priority for OML link\n" + "Set socket priority for RSL link\n" + "socket priority value to use (>6 requires CAP_NET_ADMIN)\n") +{ + if (!strcmp(argv[0], "oml")) + g_e1inp_ipaccess_pars.oml.priority = atoi(argv[1]); + else + g_e1inp_ipaccess_pars.rsl.priority = atoi(argv[1]); + return CMD_SUCCESS; +} + static int e1inp_config_write(struct vty *vty) { struct e1inp_line *line; @@ -329,6 +395,9 @@ vty_out(vty, " e1_line %u ipa-keepalive %d %d%s", line->num, line->ipa_kap->interval, line->ipa_kap->wait_for_resp, VTY_NEWLINE); + if (line->pcap_file) + vty_out(vty, " e1_line %u pcap %s%s", line->num, + line->pcap_file, VTY_NEWLINE); } const char *ipa_bind = e1inp_ipa_get_bind_addr(); @@ -336,6 +405,15 @@ vty_out(vty, " ipa bind %s%s", ipa_bind, VTY_NEWLINE); + if (g_e1inp_ipaccess_pars.oml.dscp) + vty_out(vty, " ipa ip-dscp oml %u%s", g_e1inp_ipaccess_pars.oml.dscp, VTY_NEWLINE); + if (g_e1inp_ipaccess_pars.rsl.dscp) + vty_out(vty, " ipa ip-dscp rsl %u%s", g_e1inp_ipaccess_pars.rsl.dscp, VTY_NEWLINE); + if (g_e1inp_ipaccess_pars.oml.priority) + vty_out(vty, " ipa socket-priority oml %u%s", g_e1inp_ipaccess_pars.oml.priority, VTY_NEWLINE); + if (g_e1inp_ipaccess_pars.rsl.priority) + vty_out(vty, " ipa socket-priority rsl %u%s", g_e1inp_ipaccess_pars.rsl.priority, VTY_NEWLINE); + return CMD_SUCCESS; } @@ -365,6 +443,8 @@ vty_out(vty, "E1 Line Number %u, Name %s, Driver %s%s", line->num, line->name ? line->name : "", line->driver->name, VTY_NEWLINE); + if (line->pcap_file) + vty_out(vty, "PCAP %s%s", line->pcap_file, VTY_NEWLINE); if (line->driver->vty_show) line->driver->vty_show(vty, line); if (stats) @@ -373,7 +453,7 @@ DEFUN(show_e1line, show_e1line_cmd, - "show e1_line [line_nr] [stats]", + "show e1_line [<0-255>] [stats]", SHOW_STR "Display information about a E1 line\n" "E1 Line Number\n" "Include statistics\n") { @@ -407,13 +487,13 @@ if (ts->type == E1INP_TS_TYPE_NONE) return; vty_out(vty, "E1 Timeslot %2u of Line %u is Type %s%s", - ts->num, ts->line->num, e1inp_tstype_name(ts->type), + ts->num-1, ts->line->num, e1inp_tstype_name(ts->type), VTY_NEWLINE); } DEFUN(show_e1ts, show_e1ts_cmd, - "show e1_timeslot [line_nr] [ts_nr]", + "show e1_timeslot [<0-255>] [<0-31>]", SHOW_STR "Display information about a E1 timeslot\n" "E1 Line Number\n" "E1 Timeslot Number\n") { @@ -477,8 +557,10 @@ install_lib_element(CONFIG_NODE, &cfg_e1inp_cmd); install_node(&e1inp_node, e1inp_config_write); - install_lib_element(L_E1INP_NODE, &cfg_e1_pcap_cmd); - install_lib_element(L_E1INP_NODE, &cfg_e1_no_pcap_cmd); + install_lib_element(L_E1INP_NODE, &cfg_e1line_pcap_cmd); + install_lib_element(L_E1INP_NODE, &cfg_e1line_no_pcap_cmd); + install_lib_element(L_E1INP_NODE, &cfg_e1_pcap_deprec_cmd); + install_lib_element(L_E1INP_NODE, &cfg_e1_pcap_deprec_no_cmd); install_lib_element(L_E1INP_NODE, &cfg_e1_line_driver_cmd); install_lib_element(L_E1INP_NODE, &cfg_e1_line_port_cmd); @@ -491,6 +573,8 @@ install_lib_element(L_E1INP_NODE, &cfg_e1_line_no_ipa_keepalive_cmd); install_lib_element(L_E1INP_NODE, &cfg_ipa_bind_cmd); + install_lib_element(L_E1INP_NODE, &cfg_ipa_dscp_cmd); + install_lib_element(L_E1INP_NODE, &cfg_ipa_priority_cmd); install_lib_element_ve(&show_e1drv_cmd); install_lib_element_ve(&show_e1line_cmd); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/src/input/dahdi.c new/libosmo-abis-1.2.0/src/input/dahdi.c --- old/libosmo-abis-1.1.1/src/input/dahdi.c 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/src/input/dahdi.c 2021-11-16 14:18:45.000000000 +0100 @@ -146,23 +146,23 @@ case DAHDI_EVENT_ALARM: /* we should notify the code that the line is gone */ osmo_signal_dispatch(SS_L_INPUT, S_L_INP_LINE_ALARM, &isd); - rate_ctr_inc(&line->rate_ctr->ctr[E1I_CTR_ALARM]); + rate_ctr_inc(rate_ctr_group_get_ctr(line->rate_ctr, E1I_CTR_ALARM)); break; case DAHDI_EVENT_NOALARM: /* alarm has gone, we should re-start the SABM requests */ osmo_signal_dispatch(SS_L_INPUT, S_L_INP_LINE_NOALARM, &isd); break; case DAHDI_EVENT_ABORT: - rate_ctr_inc(&line->rate_ctr->ctr[E1I_CTR_HDLC_ABORT]); + rate_ctr_inc(rate_ctr_group_get_ctr(line->rate_ctr, E1I_CTR_HDLC_ABORT)); break; case DAHDI_EVENT_OVERRUN: - rate_ctr_inc(&line->rate_ctr->ctr[E1I_CTR_HDLC_OVERR]); + rate_ctr_inc(rate_ctr_group_get_ctr(line->rate_ctr, E1I_CTR_HDLC_OVERR)); break; case DAHDI_EVENT_BADFCS: - rate_ctr_inc(&line->rate_ctr->ctr[E1I_CTR_HDLC_BADFCS]); + rate_ctr_inc(rate_ctr_group_get_ctr(line->rate_ctr, E1I_CTR_HDLC_BADFCS)); break; case DAHDI_EVENT_REMOVED: - rate_ctr_inc(&line->rate_ctr->ctr[E1I_CTR_REMOVED]); + rate_ctr_inc(rate_ctr_group_get_ctr(line->rate_ctr, E1I_CTR_REMOVED)); break; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/src/input/ipa.c new/libosmo-abis-1.2.0/src/input/ipa.c --- old/libosmo-abis-1.1.1/src/input/ipa.c 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/src/input/ipa.c 2021-11-16 14:18:45.000000000 +0100 @@ -224,7 +224,8 @@ ret = osmo_sock_init2(AF_INET, SOCK_STREAM, IPPROTO_TCP, link->local_addr, link->local_port, link->addr, link->port, - OSMO_SOCK_F_BIND|OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_NONBLOCK); + OSMO_SOCK_F_BIND|OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_NONBLOCK| + OSMO_SOCK_F_DSCP(link->dscp) | OSMO_SOCK_F_PRIO(link->priority)); if (ret < 0) return ret; link->ofd->fd = ret; @@ -282,6 +283,10 @@ LOGIPA(link, LOGL_NOTICE, "accept()ed new link from %s:%u\n", inet_ntoa(sa.sin_addr), ntohs(sa.sin_port)); + /* make new fd inherit DSCP + priority of listen-socket */ + osmo_sock_set_dscp(fd, link->dscp); + osmo_sock_set_priority(fd, link->priority); + ret = link->accept_cb(link, fd); if (ret < 0) { LOGP(DLINP, LOGL_ERROR, @@ -330,7 +335,8 @@ int ret; ret = osmo_sock_init(AF_INET, SOCK_STREAM, IPPROTO_TCP, - link->addr, link->port, OSMO_SOCK_F_BIND); + link->addr, link->port, OSMO_SOCK_F_BIND| + OSMO_SOCK_F_DSCP(link->dscp) | OSMO_SOCK_F_PRIO(link->priority)); if (ret < 0) return ret; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/src/input/ipaccess.c new/libosmo-abis-1.2.0/src/input/ipaccess.c --- old/libosmo-abis-1.1.1/src/input/ipaccess.c 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/src/input/ipaccess.c 2021-11-16 14:18:45.000000000 +0100 @@ -1,6 +1,6 @@ /* OpenBSC Abis input driver for ip.access */ -/* (C) 2009 by Harald Welte <lafo...@gnumonks.org> +/* (C) 2009-2021 by Harald Welte <lafo...@gnumonks.org> * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves * @@ -51,6 +51,9 @@ #include <osmocom/core/backtrace.h> #include <osmocom/gsm/ipa.h> +/* global parameters of IPA input driver */ +struct ipa_pars g_e1inp_ipaccess_pars; + static void *tall_ipa_ctx; #define TS1_ALLOC_SIZE 900 @@ -1002,6 +1005,7 @@ struct ipaccess_line { bool line_already_initialized; + struct ipa_client_conn *ipa_cli[NUM_E1_TS]; /* 0=OML, 1+N=TRX_N */ }; static int ipaccess_line_update(struct e1inp_line *line) @@ -1018,14 +1022,11 @@ } il = line->driver_data; - /* We only initialize this line once. */ - if (il->line_already_initialized) - return 0; - - il->line_already_initialized = true; - switch(line->ops->cfg.ipa.role) { case E1INP_LINE_R_BSC: { + /* We only initialize this line once. */ + if (il->line_already_initialized) + return 0; struct ipa_server_link *oml_link, *rsl_link; const char *ipa = e1inp_ipa_get_bind_addr(); @@ -1041,6 +1042,8 @@ "BSC link: %s\n", strerror(errno)); return -ENOMEM; } + oml_link->dscp = g_e1inp_ipaccess_pars.oml.dscp; + oml_link->priority = g_e1inp_ipaccess_pars.oml.priority; if (ipa_server_link_open(oml_link) < 0) { LOGP(DLINP, LOGL_ERROR, "cannot open OML BSC link: %s\n", strerror(errno)); @@ -1055,6 +1058,8 @@ "BSC link: %s\n", strerror(errno)); return -ENOMEM; } + rsl_link->dscp = g_e1inp_ipaccess_pars.rsl.dscp; + rsl_link->priority = g_e1inp_ipaccess_pars.rsl.priority; if (ipa_server_link_open(rsl_link) < 0) { LOGP(DLINP, LOGL_ERROR, "cannot open RSL BSC link: %s\n", strerror(errno)); @@ -1072,6 +1077,13 @@ "OML connecting to %s:%u\n", line->ops->cfg.ipa.addr, IPA_TCP_PORT_OML); + /* Drop previous line */ + if (il->ipa_cli[0]) { + ipa_client_conn_close(il->ipa_cli[0]); + ipa_client_conn_destroy(il->ipa_cli[0]); + il->ipa_cli[0] = NULL; + } + link = ipa_client_conn_create2(tall_ipa_ctx, e1inp_line_ipa_oml_ts(line), E1INP_SIGN_OML, @@ -1087,6 +1099,8 @@ "BTS link: %s\n", strerror(errno)); return -ENOMEM; } + link->dscp = g_e1inp_ipaccess_pars.oml.dscp; + link->priority = g_e1inp_ipaccess_pars.oml.priority; if (ipa_client_conn_open(link) < 0) { LOGP(DLINP, LOGL_ERROR, "cannot open OML BTS link: %s\n", strerror(errno)); @@ -1097,12 +1111,15 @@ e1i_ts = e1inp_line_ipa_oml_ts(line); ipaccess_bts_keepalive_fsm_alloc(e1i_ts, link, "oml_bts_to_bsc"); + il->ipa_cli[0] = link; ret = 0; break; } default: break; } + + il->line_already_initialized = true; return ret; } @@ -1120,6 +1137,7 @@ { struct ipa_client_conn *rsl_link; struct e1inp_ts *e1i_ts = e1inp_line_ipa_rsl_ts(line, trx_nr); + struct ipaccess_line *il; if (E1INP_SIGN_RSL+trx_nr-1 >= NUM_E1_TS) { LOGP(DLINP, LOGL_ERROR, "cannot create RSL BTS link: " @@ -1127,6 +1145,17 @@ return -EINVAL; } + if (!line->driver_data) + line->driver_data = talloc_zero(line, struct ipaccess_line); + il = line->driver_data; + + /* Drop previous line */ + if (il->ipa_cli[1 + trx_nr]) { + ipa_client_conn_close(il->ipa_cli[1 + trx_nr]); + ipa_client_conn_destroy(il->ipa_cli[1 + trx_nr]); + il->ipa_cli[1 + trx_nr] = NULL; + } + rsl_link = ipa_client_conn_create2(tall_ipa_ctx, e1inp_line_ipa_rsl_ts(line, trx_nr), E1INP_SIGN_RSL+trx_nr, @@ -1141,6 +1170,8 @@ "BTS link: %s\n", strerror(errno)); return -ENOMEM; } + rsl_link->dscp = g_e1inp_ipaccess_pars.rsl.dscp; + rsl_link->priority = g_e1inp_ipaccess_pars.rsl.priority; if (ipa_client_conn_open(rsl_link) < 0) { LOGP(DLINP, LOGL_ERROR, "cannot open RSL BTS link: %s\n", strerror(errno)); @@ -1148,8 +1179,8 @@ ipa_client_conn_destroy(rsl_link); return -EIO; } - ipaccess_bts_keepalive_fsm_alloc(e1i_ts, rsl_link, "rsl_bts_to_bsc"); + il->ipa_cli[1 + trx_nr] = rsl_link; return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/src/trau/osmo_ortp.c new/libosmo-abis-1.2.0/src/trau/osmo_ortp.c --- old/libosmo-abis-1.1.1/src/trau/osmo_ortp.c 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/src/trau/osmo_ortp.c 2021-11-16 14:18:45.000000000 +0100 @@ -1,4 +1,4 @@ -/* (C) 2011 by Harald Welte <lafo...@gnumonks.org> +/* (C) 2011-2021 by Harald Welte <lafo...@gnumonks.org> * (C) 2011 by On-Waves e.h.f * All Rights Reserved * @@ -33,6 +33,7 @@ #include <osmocom/core/talloc.h> #include <osmocom/core/utils.h> #include <osmocom/core/select.h> +#include <osmocom/core/socket.h> #include <osmocom/trau/osmo_ortp.h> #include <ortp/ortp.h> @@ -141,8 +142,8 @@ uint32_t ssrc = rtp_session_get_recv_ssrc(rs); LOGP(DLMIB, LOGL_INFO, - "osmo-ortp(%d): ssrc_changed to 0x%08x, resetting\n", port, ssrc); - rtp_session_reset(rs); + "osmo-ortp(%d): ssrc_changed to 0x%08x, resyncing\n", port, ssrc); + rtp_session_resync(rs); } static void ortp_sig_cb_pt(RtpSession *rs, void *data) @@ -592,6 +593,21 @@ return rtp_session_set_dscp(rs->sess, dscp); } +/*! \brief Set the socket priority for outgoing RTP packets + * \param[in] rs OsmoRTP socket + * \param[in] prio socket priority + * \returns 0 on success, < 0 otherwise + */ +int osmo_rtp_socket_set_priority(struct osmo_rtp_socket *rs, uint8_t prio) +{ + int rc; + + rc = osmo_sock_set_priority(rs->rtp_bfd.fd, prio); + if (rc < 0) + return rc; + return osmo_sock_set_priority(rs->rtcp_bfd.fd, prio); +} + /*! \brief completely close the RTP socket and release all resources * \param[in] rs OsmoRTP socket to be released * \returns 0 on success diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/src/trau/trau_sync.c new/libosmo-abis-1.2.0/src/trau/trau_sync.c --- old/libosmo-abis-1.1.1/src/trau/trau_sync.c 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/src/trau/trau_sync.c 2021-11-16 14:18:45.000000000 +0100 @@ -487,7 +487,7 @@ if (pat_id >= ARRAY_SIZE(sync_patterns)) return NULL; - fi = osmo_fsm_inst_alloc(&trau_sync_fsm, ctx, NULL, LOGL_NOTICE, name); + fi = osmo_fsm_inst_alloc(&trau_sync_fsm, ctx, NULL, LOGL_INFO, name); if (!fi) return NULL; tss = talloc_zero(fi, struct trau_rx_sync_state); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libosmo-abis-1.1.1/tests/trau_sync/trau_sync_test.c new/libosmo-abis-1.2.0/tests/trau_sync/trau_sync_test.c --- old/libosmo-abis-1.1.1/tests/trau_sync/trau_sync_test.c 2021-02-24 09:32:30.000000000 +0100 +++ new/libosmo-abis-1.2.0/tests/trau_sync/trau_sync_test.c 2021-11-16 14:18:45.000000000 +0100 @@ -84,5 +84,6 @@ log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_NONE); log_set_print_category(osmo_stderr_target, 0); log_set_print_category_hex(osmo_stderr_target, 0); + log_set_log_level(osmo_stderr_target, LOGL_INFO); test_body(); } ++++++ osmo-talloc.diff ++++++ --- /var/tmp/diff_new_pack.utee0C/_old 2021-11-20 02:40:49.868445370 +0100 +++ /var/tmp/diff_new_pack.utee0C/_new 2021-11-20 02:40:49.868445370 +0100 @@ -14,8 +14,8 @@ --- libosmo-abis-1.1.1.orig/configure.ac +++ libosmo-abis-1.1.1/configure.ac @@ -71,6 +71,7 @@ PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty - PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.5.0) - PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 1.5.0) + PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.6.0) + PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 1.6.0) PKG_CHECK_MODULES(ORTP, ortp >= 0.22.0) +PKG_CHECK_MODULES([TALLOC], [talloc])