Commit Graph

36 Commits

Author SHA1 Message Date
Daniel Willmann c20af05bfc ipaccess: Add connect timeout in e1inp_line
* VTY command e1_line N connect-timeout T to set the connect() timeout
* use ipa_client_conn_open2 to connect with timeout

Related: SYS#6237
Change-Id: I7379102d19c172bed2aa00377d92bc885f54b640
2022-12-15 16:10:36 +01:00
Oliver Smith ef0f7c25f0 e1_input: enable tcp keepalive by default
Set the keepalive parameters to E1INP_USE_DEFAULT initially instead
of 0. Do this independent of the driver (the only driver making use of
this is ipaccess).

Closes: OS#5785
Change-Id: Ia7659c209aea0d26eb37d31e771adc91b17ae668
2022-11-23 12:34:00 +01:00
Keith Whyte df088b0ea9 Fix up vty 'show' commands for E1 line/timeslots
Change-Id: I6af92ae2808713c74afeecaa1f500443fb2b7795
2021-05-05 14:07:40 -05:00
Harald Welte 41547559da e1_input: Allow (vty) configuration of IP DSCP and socket priority
Change-Id: I8991dd6eb406a5b9a70498974fc1ad339452f871
Related: SYS#5427
2021-04-29 21:24:28 +02:00
Keith Whyte 2672a2a2a7 Configure E1 pcap file per line
In order to allow configuration of pcap files per e1_line
the vty command is now (for example line 0):

  e1_line 0 pcap /tmp/e1cap.pcap

in place of:

  pcap /tmp/e1cap.pcap

Also ensures that a configured pcap appears in 'show running-config'
and is written to the config file on issuing 'write'

This commit deprecates e1_set_pcap_fd()

Change-Id: I316c3d6a839e84c2f52a148c6b8dd6f5933cf4bf
2021-04-13 23:28:02 +02:00
Philipp Maier ef5b839e23 vty: add attributes to VTY commands indicating when they apply
Change-Id: Ie0182351bd8a10085563c403dfab04c4d1b4305c
Depends: libosmocore I0efc57f2cb54798ba207ae6fef9af4771d96bfa9
Related: SYS#4937, OS#1601
2020-10-08 17:40:41 +02:00
Vadim Yanitskiy 82ef2a24e3 vty: use install_lib_element() and install_lib_element_ve()
See https://lists.osmocom.org/pipermail/openbsc/2020-October/013278.html.

Change-Id: I22a8075852ba97edf819b368e3af4eddbf1dbae0
Depends: I8baf31ace93c536421893c2aa4e3d9d298dcbcc6
Related: SYS#4937
2020-10-04 16:45:59 +07:00
Harald Welte 1f9228434e e1_input_vty: Fix VTY help strings
* HSL was never fully supported, not sure why it's in the help
* E1D was neglected to add to the help string

Change-Id: I4a5e503676618171e59550774892816b61adecae
2020-08-02 11:29:46 +02:00
Sylvain Munaut eb55e2f8d9 e1_input: Add VTY command to enable PCAP debug output
This command is also usable at run-time to dynamically
enable / disable e1 tracing on all active lines

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I0b4251702aecd6721b9d63c320351ef6cb513454
2020-05-09 10:45:20 +02:00
Eric Wild ef1f327c96 add ipa ping/pong keepalive for OML/RSL links between bts and bsc
Patch-by: ewild, osmith
Related: OS#4070
Change-Id: I30e3bd601e55355aaf738ee2f2c44c1ec2c46c6a
Depends: (libosmo-abis) Ie453fdee8bfd7fc1a3f1ed67ef0331f0abb1d59b
2020-01-24 14:35:09 +01:00
Sylvain Munaut b559a53263 e1d: Initial osmo-e1d support
osmo-e1d is part of the Osmocom 'software defined E1 interface,
which consists of a USB device for the actual E1 hardware interfacing,
and a daemon (osmo-e1d) implementing a libusb-based driver.

This commit adds initial support for talking to osmo-e1d using
the related libosmoe1d library.  You need to use '--enable-e1d'
at configure time to enable it.

Change-Id: Ia0431c124e3b5b4108aee7b109d8c4bb0d8b45d4
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2020-01-12 14:22:18 +01:00
Stefan Sperling 0d7d0b0a86 ensure unix socket paths are NUL-terminated for bind/connect
The unix(7) man page recommends that sun_path is NUL-terminated
when struct sockaddr_un is passed to a bind() or connect() call.
Non-NUL-terminated paths only need to be dealt with at the
receiving end of a UNIX domain socket.

Commit b24efa5 erroneously assumed otherwise.

Change-Id: I9beecfa500db75cb679b1edcc352c893bf098b13
Fixes: b24efa551d
Related: OS#2673
2018-09-20 17:40:59 +02:00
Stefan Sperling b24efa551d Properly deal with sockaddr_un socket path length limitations.
When parsing the configuration, reject a socket path which
exceeds the maximum size supported by the operating system.

In unixsocket_line_update() stop copying the line's socket path to a
local buffer. The path will be copied again in osmo_sock_unix_init().

Both changes are portable; we don't assume any particular socket
path length since the size differs between implementations of Unix,
and we rely only on information from the generic sys/un.h header.

Change-Id: I36344805a825f5d0e0c9d218d438d8fd985ed9ca
Related: OS#2673
2018-09-04 11:51:47 +02:00
Harald Welte 323d39d784 Add SPDX-License-Identifier to all source files
Change-Id: I9f2bc8c5d8a2c0bb0dd6caa4de5e2cb11be210e7
2017-11-13 01:09:21 +09:00
Neels Hofmeyr e2d33bf02d vty: skip installing cmds now always installed by default
vty_install_default() and install_default() will soon be deprecated.

Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b
Change-Id: I7771131a27d0b7ad0397715ceb3be035062bc010
2017-11-01 00:44:19 +01:00
Alexander Couzens beb10ef02a add basic unixsocket support
Allow to connect to a unix socket for communicating with LAPD.

Change-Id: Ia5723b09a5c68a0505829dc732def981e60a907a
2017-03-08 10:14:05 +00:00
Neels Hofmeyr 0db1d43c0d ipa driver: make bind address vty configurable
Add VTY function to set the ipa bind address:
    e1_input
     ipa bind A.B.C.D

Add a priv pointer to struct e1inp_driver in order to communicate the bind
address parameter to ipaccess_line_update(). Add two "internal.h" functions to
get/set it in the ipa driver struct.

Add static ip_bind_addr() to use the IP address set from the VTY or, if NULL,
use "0.0.0.0". Apply in ipaccess_line_update().
2016-02-25 12:12:28 +01:00
Jacob Erlbeck 86dae84bed input: Make keep alive configurable (generic)
This patch adds a generic keep alive configuration layer that mainly
consists of additional fields in e1_input structs and VTY commands
and extensions.

Ticket: OW#1060
Sponsored-by: On-Waves ehf
2014-01-20 08:10:43 +01:00
Jacob Erlbeck 1c9dcc1236 vty: Use same prompt string format like in libosmocore
Ensures a single blank after the '#'. Use (config-foo) instead (foo)
for config nodes.
2013-11-11 14:54:53 +01:00
Jacob Erlbeck 37f0695626 vty: Use new vty_install_default() function
This patch removes the local 'end' and 'exit' implementations and
uses the generic ones provided by libosmocore instead, which are
enabled automatically when vty_install_default() is used.
2013-11-11 14:54:53 +01:00
Holger Hans Peter Freyther 8cbd9f4d09 e1_input_vty: Help coverity in understanding this code
In theory argc could be negative and this code would crash with
a null pointer dereference on the line pointer. Check for <= to
avoid this warning.

Fixes: Coverity CID 1040699
2013-07-04 20:00:33 +02:00
Holger Hans Peter Freyther 9d4fe51424 hsl: Remove the input handling for the HSL BTS
I have removed HSL support from OpenBSC, the E1/Abis code is now
unused and can be removed.

Fixes: Coverity CID 1040693
2013-07-04 19:50:09 +02:00
Holger Hans Peter Freyther 9e8f1c0362 doc: Describe the optional 'stats' parameter 2012-07-21 00:09:52 +02:00
Holger Hans Peter Freyther 36bac9a8b1 doc: Add a newline to fix the documentation of the HSL option 2012-07-20 23:49:52 +02:00
Harald Welte fe05cf5b39 DAHDI: add information on span number, timeslot count to VTY 2011-09-26 23:18:41 +02:00
Harald Welte 356918fed4 fix parsing error during "e1_line N port M"
A misplaced comma in the DEFUN macro argument list resulted in
part of the help message becoming part of the command syntax ;)
2011-09-26 22:58:07 +02:00
Harald Welte c2889512c4 e1_input: add 'port_nr' field and support DAHDI T1 cards
the "e1_line <0-255> port <0-255>" vty command allows the user to
set which physical port/card number should be represented by the
given virtual e1_line.

Furthermore, we now actually query the DAHDI hardware to determine the
number of ports of a given span (e.g. only 24 in case of T1) instead of
blindly assuming there are 31 timeslots on each port.

This specifically will fix T1 timeslot (/dev/dahdi/%u) calculation in
setups with multiple DAHDI spans/ports and a T1 span != span 1.
2011-09-25 23:37:47 +02:00
Harald Welte ce307b4420 mISDN: optionally bypass kernel LAPD code and use userspace LAPD
The problem with kernel LAPD mainly is that you can only have one
signalling timeslot in each E1 line/interface.  However, with many BTS
attached to the same line, we need multiple signalling slots per line.

This allows the user to have a per-line selection between kernel-LAPD
(misdn) and userspace-LAPD (misdn_lapd) drivers in the config file.
2011-08-21 13:03:24 +02:00
Harald Welte d4f8f68e16 add string.h include to fix compiler warning 2011-08-19 13:28:48 +02:00
Harald Welte f2737fcd64 E1 Input: Add rate counters for events related to E1 lines 2011-08-16 14:35:34 +02:00
Harald Welte 6e37c591f9 E1 Input: Move 'show e1_*' command to e1_input_vty.c 2011-08-16 14:20:37 +02:00
Harald Welte 601a9c7d32 E1 Input: Add VTY command to specify the name of a Line
So far, there was no way to set the line->name field at all.
2011-08-16 14:18:53 +02:00
Harald Welte cc2241bf1c update to comply with libosmocore namespace fixes
This updates the code and brings it in sync to
libosmocore git commit 892e621fec571c7cba3573caa0d328ed1b25d8ee
2011-07-19 16:06:06 +02:00
Harald Welte 71d87b2597 talloc: revert to use talloc inside libosmocore
It's not a good idea to confuse the two changes with each other.  Moving the
Abis part into a separate library is independent from the question whether we
have talloc inside libosmocore or use a stand-alone talloc library.
2011-07-18 14:51:16 +02:00
Pablo Neira Ayuso 3832c4f908 e1_input: add new refcounting scheme to avoid leaking E1 lines
This patch 's/e1inp_line_get/e1inp_line_find/g' since we need this
function name for the new refcounting scheme.

Basically, I have added a new function to clone lines that is used
by the ipaccess driver:

struct e1inp_line *e1inp_line_clone(void *ctx, struct e1inp_line *line);

And two functions to bump and decrement the refcount:

void e1inp_line_get(struct e1inp_line *line);
void e1inp_line_put(struct e1inp_line *line);

This is useful to avoid leaking virtual E1 lines in the ipaccess
case, since we have two sockets for OML and RSL respectively, we
have to release the line *once* both sockets have been closed.

Without this patch, there are cases in which we don't know if it's
time to release the virtual E1 line.

This patch also includes a fix to avoid crashing if we open a
connection with OML/RSL port without sending any ID_RESP message
(in that case, we have no chance to set the signal link). I tested
these situations with netcat.
2011-07-07 19:33:24 +02:00
Pablo Neira Ayuso 262aee80ac src: add e1_input_vty.c to libosmo-abis
This file provides the VTY interface for E1 lines, I have moved
it to libosmo-abis since it belongs here.
2011-07-05 19:17:08 +02:00