Commit Graph

32 Commits

Author SHA1 Message Date
Daniel Willmann 4e934bb546 osmo_{client,server}_main: Remove is_config_node in vty_app_info
This member is deprcated/unused so simply remove it:

> 'is_config_node' is deprecated: Implicit parent node tracking has
> replaced the use of this callback. This callback is no longer called,
> ever, and can be left NULL.

Change-Id: I34295950557d9009b0d8d3378deb3b1263476f82
2023-02-28 11:39:05 +01:00
Daniel Willmann 50cc638ac7 osmo_{client,server}_main: Remove tall_ctr_ctx and tall_msgb_ctx
tall_ctr_ctx is only used by the obsolete osmo_counters which are not
used anymore.
tall_msgb_ctx is now set through msgb_tallox_ctx_init().

Fixes undefined reference errors since libosmocore.map was introduced in
I13169c00a59fb59513dfc598de5a71d094492422:

```
osmo-pcap/src/osmo_client_main.c:226: undefined reference to `tall_msgb_ctx'
/usr/bin/ld: osmo-pcap/src/osmo_client_main.c:226: undefined reference to `tall_msgb_ctx'
/usr/bin/ld: osmo-pcap/src/osmo_client_main.c:227: undefined reference to `tall_ctr_ctx'
/usr/bin/ld: osmo-pcap/src/osmo_client_main.c:227: undefined reference to `tall_ctr_ctx'
```

Change-Id: Idcbb96fd070f5ad20d3091ce886dc6130968538f
2023-02-28 11:07:59 +01:00
arehbein 9d7556a73e Transition to use of 'telnet_init_default'
Related: OS#5809
Change-Id: Icc57c68337d55c6594c1c36e9bf41624d11dab0a
2023-02-25 17:48:58 +01:00
Harald Welte 8b73a2a530 vty: call telnet_init_dynif() after config file is read
In case the config file specifies a vty bind address, we must read
it before we start the telnet server.

Change-Id: I44561754d4beaad5c74cb66994ca4ef38960ea78
2021-04-24 16:09:09 +02:00
Harald Welte dd1389c3d3 use telnet_init_dynif() to allow VTY bind to non-loopack address
Prior to this patch, you could configure 'bind 1.2.3.4' in the
config file, but the telnet interface still binds to 127.0.0.1.

Change-Id: I9b86b2cf6949917c55ea15277619cfa2b745185d
2021-04-24 13:00:41 +02:00
Harald Welte b0b2a2d542 add "--version" to osmo-pcap-client and -server
Change-Id: Ib82ee1a784a657f7274d78ba5f7a8afe6cfab395
2021-04-18 14:24:15 +02:00
Vadim Yanitskiy ff3f4b3bef vty_{client,server}_init(): remove unused argument
Change-Id: I65256c8602e91bcdbe5fe9e532b6ce7d347d3980
2021-04-16 20:30:18 +02:00
Vadim Yanitskiy d59783e601 vty: register commands for talloc context introspection
Change-Id: I3774cfd483102993340bd6e96f8512af61085679
2021-04-16 19:36:29 +02:00
Joachim Steiger 52f06fd54b manuals: generate VTY reference for osmo-pcap-{client,server}
Change-Id: I28353f51de798535a3bb6efdc6c2da443d96ddfb
Tweaked-By: Vadim Yanitskiy <vyanitskiy@sysmocom.de>
2021-04-16 19:29:31 +02:00
Pau Espin 716a4db54c main: generate coredump and exit upon SIGABRT received
Previous code relied on abort() switching sigaction to SIG_FDL +
retriggering SIGABRT in case the signal handler returns, which would
then generate the coredump + terminate the process.
However, if a SIGABRT is received from somewhere else (kill -SIGABRT),
then the process would print the talloc report and continue running,
which is not desired.

Fixes: OS#4865
Change-Id: I39367aa480445fe961dcfa308789b3fc0cf759a1
2020-11-25 19:11:43 +01:00
Pau Espin 210ed934bb Remove undefined param passed to {logging,osmo_stats}_vty_add_cmds
Since March 15th 2017, libosmocore API logging_vty_add_cmds() had its
parameter removed (c65c5b4ea075ef6cef11fff9442ae0b15c1d6af7). However,
definition in C file doesn't contain "(void)", which means number of
parameters is undefined and thus compiler doesn't complain. Let's remove
parameters from all callers before enforcing "(void)" on it.
API osmo_stats_vty_add_cmds never had a param list but has seem problem
(no "void"), so some users decided to pass a parameter to it.

Change-Id: I2e1ab7005514f1a06cac03e967aa5c8ea472e671
Related: OS#4138
2019-08-05 16:28:11 +02:00
Pau Espin f946fa21ee client: Add pcap snaplen VTY cmd
Change-Id: I84fda9f27b725e031c218187ab679392dfa7ec3d
2018-10-08 20:20:43 +02:00
Pau Espin f10c57801a Replace '.' in counter names with ':'
The '.' is illegal character in counter names, as they are exported
via CTRL interface, where '.' has a special meaning that cannot be
used by strings comprising the variable name.

Change-Id: Icec5338d3242137980fa05d2c7ae2db940afb542
2018-10-08 20:20:43 +02:00
Pau Espin dc27ca85aa Drop osmo_init_logging and use osmo_init_logging2
Change-Id: Ib1c38f6134b3c1988477caa0f2c281b1ef01d5e0
2018-10-08 13:29:52 +02:00
Pau Espin 2828690633 client: Properly name main talloc ctx
Change-Id: Ibaa7f0e0add5f5e61cc0bb82341ee3b6b5c0cf07
2018-10-08 13:29:52 +02:00
Harald Welte 2aea8704f3 Use TCP port numbers for VTY that don't overlap with other Osmocom Software
osmo-pcap for historical reasons uses the same port numbers as
OsmoPCU and OsmoBTS.  This leads to problems when wanting to run related
software together on one system.  Let's break the historical assumptions
and start with non-overlapping port numbers that are allocated/assigned
from https://osmocom.org/projects/cellular-infrastructure/wiki/Port_Numbers

Change-Id: I638ac0534517931d0987ce9f72f5db4f5b6c16b7
2017-07-21 15:18:02 +02:00
Holger Hans Peter Freyther d7ab53dc16 client: Do not connect default connection if no ip/port present
Ignore the default connection if no srv_port and has been specified.

Change-Id: I6a3a9a0af73a9183a6b233937af3357d15a07f25
2016-11-09 01:04:04 +01:00
Holger Hans Peter Freyther 1448f50db4 client: Allow to configure and connect multiple servers
Allow to configure multiple servers and connect. Introduce a new VTY
node to allow multiple servers. Add an explicit connect. Do not put
the main connection into the same list but assume it exists.

Change-Id: I9448ad4a005dd7c7eb1c615d03e57d6cb058ae4d
2016-11-09 01:04:04 +01:00
Holger Hans Peter Freyther e3d7c3e154 client: Prepare to work with a list of servers
There is no VTY code yet and no servers in the list but it looks
good client this.

Change-Id: Ic35748f1a95a880a9fa49dd18361592d8ac941ba
2016-11-09 00:20:29 +01:00
Holger Hans Peter Freyther 13f397c68c client: Prepare to have multiple server connections
Take out various fields into a new connection class. We will have the
option to connect to multiple servers.

Change-Id: I820176d133fbdb0240a16eb4e1a6d505e5c080c6
2016-11-09 00:20:29 +01:00
Holger Hans Peter Freyther c266796caa client: Initial support for TLS in the client
Use GNUtls because it is GPL compatible and instead of mbedTLS seems
to have a working non-blocking I/O integration. GNUtls has various
issues that could not be resolved easily:

* Pick spdy as sub protocol
* gmt_time not randomized
* private key loaded to RAM (but not verified)

This is the beginning and not the end. Client support might need more
work with actual tls verification. Maybe more manual x509 cert
verification is needed and maybe client certs don't work at all. I try
to ignore renegotiation as I threw away the key.

Reload x509 creds and keys as they might have changed from one
connection to another.

Change-Id: I9128e14084da1fc2705f858393f98b8133996172
2016-09-08 16:16:55 +02:00
Holger Hans Peter Freyther fa5572e2af client: Use pcap_stats and export them as statistics
Attempt to write code that detects the wrap and is doing the
right thing when it happens.

Change-Id: I501ebc49d3e86b0605ec1fbe2f62aee3f362aa36
2016-08-19 20:28:21 +02:00
Holger Hans Peter Freyther c3455dcb79 client: Additional counters for the statistics
Add more counters and start counting them when reading from the
PCAP library and when trying to write to the socket.

Change-Id: I52d3064a265b402ac849d8578a14f718156c0805
2016-08-19 17:31:01 +02:00
Holger Hans Peter Freyther f416463a3c client: First round of statistics in the pcap client
Count certain events that can help to understand what is going on.
This includes OOM, failure to queues.

Change-Id: I4a2dad32afb577822c7181d2813ea5a7e693c704
2016-08-18 18:39:53 +02:00
Holger Hans Peter Freyther 86282d65db client: Fail to start if it can't bind the telnet interface
Change-Id: Ic628dd348f8fce978691aaa331b0e67ee13f10c6
2016-08-18 18:34:27 +02:00
Holger Hans Peter Freyther 6e938eda1c stats: Initialize the stats(d) backend in the client/server
Initialize the stats backend allowing key performance indicators
to be pushed out of the system.

Change-Id: Id652b60d230f705b927e49d81cd3731432156c7e
2016-08-13 10:36:58 +02:00
Holger Hans Peter Freyther f8ff41e0f9 misc: Address compiler warning about deprecated header
In file included from osmo_client_main.c:27:0:
/home/ich/install/openbsc/include/osmocom/core/process.h:1:2: warning: #warning "Update from osmocom/core/process.h to osmocom/core/application.h" [-Wcpp]
 #warning "Update from osmocom/core/process.h to osmocom/core/application.h"

Change-Id: Id60cf90ebb7255d79f8e3bdb81f099f1362d538b
2016-08-13 10:31:02 +02:00
Holger Hans Peter Freyther 77288207fa osmo-pcap-client: Connect to a server, send the data to it 2011-05-31 21:19:52 +02:00
Holger Hans Peter Freyther cd2d3db3b7 osmo-pcap-client: Set the filter string on the pcap device.. 2011-05-31 21:19:51 +02:00
Holger Hans Peter Freyther 3b9b38ca68 osmo-pcap-client: Work on the client code, be able to open the device
Add vty code to allow changing the device, this will just attempt
to open and close the device. Nothing else is done.
2011-05-31 17:42:53 +02:00
Holger Hans Peter Freyther 530ecc0879 osmo_pcap_client: Start with the framework for the pcap client
This is just the normal skeleton for the osmocom code.
2011-05-31 15:47:44 +02:00
Holger Hans Peter Freyther 430366a2c5 osmo-pcap: Create a dummy client. 2011-05-31 11:16:55 +02:00