Age | Commit message (Collapse) | Author | Files | Lines |
|
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
|
|
On (at least) Debian unstable I'm seeing the following compiler
warninig:
/usr/include/features.h:184:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
Apparently this was deprecated in glibc 2.20 released in 2014 (!)
Change-Id: I826189dec4107e7c3e8cf4c013316ef3014b7857
|
|
Change-Id: I8fdcdc1a58926ec66a1dc5dc7a5e57ed4dceb4b4
|
|
Take the chance to define SERVER_MAX_DATA_SIZE as pcap payload, which we
can later match to configurable snaplen parameter.
Change-Id: I45d4c59026faf1108c0976eb6ad8c270e3577dbf
|
|
We don't send any pkt data, so no need to allocate snaplen bytes extra.
Change-Id: I8d6385f6ff265564492121812a7a9f2bcfea3d5f
|
|
Change-Id: I84fda9f27b725e031c218187ab679392dfa7ec3d
|
|
Despite this value not being exported publicly, the truth is that
tcpdump and wireshark nowadays avoid processing any file with snaplen
bigger than this value:
"tcpdump: pcap_loop: invalid packet capture length 861244, bigger than
snaplen of 262144"
It also fails to set snaplen to values bigger than that:
"tcpdump -s 262145" --> "tcpdump: invalid snaplen 262145"
pcapfix also warns about wrong packet length if bigger than same value
(defined as PCAP_MAX_SNAPLEN there).
MAXIMUM_SPANPLEN is defined in tcpdump's netdissect.h and libpcap's
pcap-int.h. It is also defined as WTAP_MAX_PACKET_SIZE in
wireshark/wiretap/wtap.h (this one being the only publicly available).
Change-Id: Ib7449d5aba9da342c150704ebd0e1f09e7f7276c
|
|
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
|
|
According to pcap.h, type bpf_u_int32 can be 32 bits on some systems,
so better cast explicitly to size_t to make sure always correct size is
used by log function.
Fixes warning:
osmo-pcap/src/osmo_client_network.c:175:4: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 7 has type ‘bpf_u_int32’ {aka ‘unsigned int’} [-Wformat=]
"Capture len too big %zu\n", in_hdr->caplen);
^~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
Change-Id: I98654da143218d3e57da4e57781252eb3d3f3d5b
|
|
Change-Id: Ib1c38f6134b3c1988477caa0f2c281b1ef01d5e0
|
|
Change-Id: I810417d84c6a6ebcbc4b75a9bc41607bb0637228
|
|
Change-Id: Ibaa7f0e0add5f5e61cc0bb82341ee3b6b5c0cf07
|
|
Fixes following compilation warning:
osmo-pcap/src/osmo_client_vty.c:511:2: warning: ‘install_default’ is deprecated: Now happens implicitly with install_node() [-Wdeprecated-declarations]
Depends: libosmocore I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b
Change-Id: I943f68dbafd7906313ad9e59f4adb289ae23cdec
|
|
Function only checks if packet should be forwarded, it doesn't forward
any packet.
Change-Id: I87cd64290245db134b17bc0d6665c58f1cde17b6
|
|
This allows the user to change the configuration between either using
a) the classic OsmoPCAP protocol (over TCP with or without TLS)
which is used when you want to talk to an osmo-pcap-server
b) the (new) IPIP encapsulation, which will simply take the IP
packet (without Ethernet or pcap header) and transmit it inside IPIP
to the specified server IP address. This is useful for gettin
real-time streaming into wireshark.
Change-Id: I8056fc163ac2f15adcb964d867dd5e51df4e4710
|
|
We can simplify the code even further by using the osmo_fd version
of osmo_sock_init2() called osmo_sock_init2_ofd(), which takes care
of filling the osmo_fd.fd member and registering the socket in the
select loop.
Change-Id: Ibf1480e7dee287db77a19bb9f0254edddf7706ab
|
|
A related function for "create a socket, bind it locally and connect
remotely" has meanwhile been introduced in libosmocore, so the local
implementation can go.
Change-Id: Ieda77ad8b3f7b89faa09882c0037562ce4d0fc89
|
|
This naming is more in line with what all the other osmocom programs are
doing (e.g. osmo-pcu, osmo-bts-sysmo, osmo-bsc, ...). We don't
generally use osmo_ anywhere else, so I suggest to change it for more
uniformity.
Change-Id: If1e3ce76f93266e0f01c801204769432b571fdb1
|
|
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
|
|
src_result is only valid "if (src)", so we cannot unconditionally
free it:
(gdb) bt
host=0x52 <error: Cannot access memory at address 0x52>, src=0x0)
at /usr/src/debug/osmo-pcap/0.0.6+gitrAUTOINC+4776b2972e-r1d/git/src/osmo_client_network.c:165
Change-Id: I3b6778d9110583ecb1daec59ef2c86465d5818b9
|
|
Modify the osmo_sock_init (code clone to be integrated upstream)
to allow binding to a specific source ip and source port. Allow
the source ip to be configured but allow the kernel to pick a
random port for us.
This is necessary for systems with multiple interfaces where the
default route is not necessarily the right one to connect to the
pcap server.
Change-Id: I84e728b0752213d28f970fcbbfd6565c441ccfeb
|
|
When not running as root the opening might fail and then we would
crash when sending the link information. Do not crash. This could
have crashed before the re-factoring but due the async connect it
seems more likely we hit it now.
Change-Id: I26a10c401a9a8998acc50a4bd4432d2ac7fceaeb
|
|
With the VTY a user can write connect, connect, connect and this
would lead to leaking fds. Always close the connection.
Change-Id: Iab94dc2fd28496bf5fd8ceb5611f9e6505ccae1b
|
|
Change-Id: I2118723345caf6a68f03de74a4182506e7bf105c
|
|
Ignore the default connection if no srv_port and has been specified.
Change-Id: I6a3a9a0af73a9183a6b233937af3357d15a07f25
|
|
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
|
|
If we want to have multiple servers we should not block when trying to
connect to one of them. Enable non blocking mode and handle the fd
specially until it is connected. E.g. on failed connect the read will
become readable but fail, otherwise it becomes writable.
Clear the write queue to make sure that the link data is sent first.
We might be able to introduce a osmo_wqueue_prepend.
Change-Id: Iae2bc264d15aa8598beefc194e3b8c4ebe87320a
|
|
There is no VTY code yet and no servers in the list but it looks
good client this.
Change-Id: Ic35748f1a95a880a9fa49dd18361592d8ac941ba
|
|
Change-Id: I3c7c499c921b03752cbbcdda3eac8ca360323a22
|
|
Take out various fields into a new connection class. We will have the
option to connect to multiple servers.
Change-Id: I820176d133fbdb0240a16eb4e1a6d505e5c080c6
|
|
Make the priority configurable, load DH params, allow to specify
certificates or anonymous operations.
Change-Id: I8ec3c0f8e1ee2089e1b7dacd9de842260930032f
|
|
Add simple vty command to enable tls per client or not. We still
need a lot more tls commands for the server.
Change-Id: I583b7d5c999ed01c135882895fb2a8f04739ad00
|
|
Using tls priority of NORMAL:+ANON-ECDH:+ANON-DH already allows a
client to connect to a server and protect the data using tls.
Generate the dh params on load (and do that for the client right
now as well) but that will go away soon.
Change-Id: Ifa2ad24c0a631573c259a3bf94b91a946ad9ec9d
|
|
In preparation of TLS let's not call close_connection from
within the dispatch but return an error and then close the
connection from the outside.
Change-Id: I607fed0191907cfbc8887d749c88f7f4ffb87166
|
|
Change-Id: I4295854c749d86ca8c34a979c877363d9f48e176
|
|
We are only reading from the socket and never write but the osmo_tls
code is integrated with it. We will never write and the queue size is
set to 0. Simplify the read_cb.
Change-Id: I32335b1f7b7ed06b92c6222516c185301ce13781
|
|
Change-Id: I8861acaaec5465de620637b7fdf3341517133c4f
|
|
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
|
|
Change-Id: Ib4e17948ffa84e73c1c81734e6002a73251d744b
|
|
Attempt to write code that detects the wrap and is doing the
right thing when it happens.
Change-Id: I501ebc49d3e86b0605ec1fbe2f62aee3f362aa36
|
|
Add the basics for getting a picture what a client and the server
is doing. We need to create unique descriptions as the code is
working with names and not numbers for clients.
Change-Id: I4a9be5bdd815d280cccf0199efc2ca79fc77d393
|
|
Add more counters and start counting them when reading from the
PCAP library and when trying to write to the socket.
Change-Id: I52d3064a265b402ac849d8578a14f718156c0805
|
|
Count certain events that can help to understand what is going on.
This includes OOM, failure to queues.
Change-Id: I4a2dad32afb577822c7181d2813ea5a7e693c704
|
|
Change-Id: Ibd14da3e7f62065f5d28d4a90d2b55eed609b64f
|
|
Change-Id: Ic628dd348f8fce978691aaa331b0e67ee13f10c6
|
|
Initialize the stats backend allowing key performance indicators
to be pushed out of the system.
Change-Id: Id652b60d230f705b927e49d81cd3731432156c7e
|
|
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
|
|
osmo_client_main.c:57:2: warning: initialization from incompatible pointer type
.go_parent_cb = osmopcap_go_parent,
^
osmo_client_main.c:57:2: warning: (near initialization for ‘vty_info.go_parent_cb’)
CCLD osmo_pcap_client
CC osmo_server_main.o
osmo_server_main.c:56:2: warning: initialization from incompatible pointer type
.go_parent_cb = osmopcap_go_parent,
^
osmo_server_main.c:56:2: warning: (near initialization for ‘vty_info.go_parent_cb’)
Change-Id: If73c85a64789ef4bff63dcfe008e918e650b428f
|
|
To allow easily extracting or streaming the data to an external
analysis system, zeromq can be configured (and reconfigured). The
system works as fire and forget and no loss detection is present.
A simple go based client application is provided to subscribe to
the publisher.
Change-Id: I4f3e6d675023a81b7d2ee19bf1f44a2be0ca003c
|
|
Change-Id: I383558bb9aad3cb149f35e13910a1d6aa79afc84
|