28 Commits

Author SHA1 Message Date
Vadim Yanitskiy
9494bd12af contrib/jenkins.sh: use https:// instead of git://
Change-Id: I5f184fd100230e1b9c0076739f49901ab2782b4f
2025-08-22 16:18:39 +07:00
Vadim Yanitskiy
1a98d7c32b contrib/jenkins.sh: specify --with-unitdir for nftables
Since recently (see the related commit), libnftables installs
a systemd unit file that loads a ruleset from a file on boot.

contrib/jenkins.sh currently fails with the following error:

  /usr/bin/install: cannot create regular file
                    '/lib/systemd/system/nftables.service':
                    Permission denied

Let's specify the unit directory like we do for other projects.

Change-Id: I9ab473dd6f734606518a980152fd4b00c2e23690
Related: nftables.git c4b17cf8305108f91d8e63880317a59e8e806c80
2025-08-22 16:18:39 +07:00
Neels Janosch Hofmeyr
33061164f3 contrib/pfcp-tool-scripts: adjust tunend_session_est.vty and upf cfg to match up
Change-Id: I3d6a26b45f084c281887bee541cf01b690c9d1de
2024-08-16 02:20:44 +02:00
Oliver Smith
7713d784c9 contrib: remove rpm spec file
Related: https://osmocom.org/news/255
Related: OS#6446
Change-Id: I0cc8d753b26648efa7c9fb5798f7c4227c328547
2024-05-13 08:39:06 +00:00
Oliver Smith
a21bcec358 contrib/systemd: AmbientCapabilities=CAP_NET_ADMIN
Set CAP_NET_ADMIN so osmo-upf can set up GTP tunends and tunmaps even if
running as user.

Fix for:
  Operation not permitted (you must be root)
  netlink: Error: cache initialization failed: Operation not permitted
  20240430095022378 DNFT ERROR error running nft ruleset: rc=-1 ruleset="add table inet osmo-upf { flags owner; };\n" (upf_nft.c:79)
  20240430095022378 DNFT ERROR Failed to create nft table "osmo-upf" (upf_nft.c:111)

Fixes: OS#6444
Change-Id: I17b21ad92837ad360d667248f3f002d44251891c
2024-04-30 09:55:13 +02:00
Oliver Smith
9395752540 .deb/.rpm: various fixes related to non-root
* Explicitly chown /var/lib/osmocom to osmocom:osmocom, instead of
  relying on systemd to do it when the service starts up. This does not
  work with the systemd versions in debian 10 and almalinux 8.
* deb: Use "useradd" instead of the interactive "adduser" perl script
  from Debian. This makes it consistent with how we do it in rpm, and
  avoids the dependency on "adduser".
* deb: Consistently use tabs through the file, instead of mixing tabs
  and spaces.
* deb: Remove support for the "dpkg-statoverride --list" logic. This
  seems to be a rather obscure feature to override permissions for
  certain files or directories, for which it does not seem to be a good
  idea to make the postinst script less maintainable. Something similar
  can be achieved by using your own Osmocom config file in a different
  path with different permissions.

Related: OS#4107
Change-Id: Ib129217f6aff713d1d0e7aa831b4b54823e9bade
2024-04-26 15:08:47 +02:00
Max
0b83ceb20d .deb/.rpm: add osmocom user during package install
Create osmocom user & group during package installation.
Fix the configuration dir/files permission to match.

Related: OS#4107
Tweaked-By: Oliver Smith <osmith@sysmocom.de>
Change-Id: I6caa561eff63d6ee58b5c7b0f8c69bfd2d134eb3
2024-04-24 11:53:19 +02:00
Andreas Eversberg
166bba4532 Use uniform log format for default config files
Related: OS#6272
Change-Id: I5f364aa88a020dd8a0de501b3547ad077457c616
2023-12-05 09:07:30 +01:00
Oliver Smith
e6c65defac systemd: depend on networking-online.target
Related: SYS#6400
Change-Id: Idadcbbf55e976ae035cfac4b85ccd870e0f27b82
2023-05-26 14:10:49 +02:00
Vadim Yanitskiy
1d422d6283 contrib/jenkins.sh: clone libnftnl and libnftables via git://
From time to time we see sporadic master build failures on Jenkins
because git fails to clone one of the repositories:

```
Cloning into 'nftables'...
error: garbage at end of loose object '0ca03ecd6ab3cfdc94f8f9ef6e3a7c40d1aa7195'
fatal: loose object 0ca03ecd6ab3cfdc94f8f9ef6e3a7c40d1aa7195
(stored in /build/libnftnl/nftables/.git/objects/0c/a03ecd6ab3cfdc94f8f9ef6e3a7c40d1aa7195) is corrupt

Cloning into 'libnftnl'...
fatal: unable to access 'https://git.netfilter.org/libnftnl/':
Failed to connect to git.netfilter.org port 443: Connection timed out
```

Running git with GIT_CURL_VERBOSE=true reveals that the server is using
an old "dumb" git protocol, so the client is sending hundreds of HTTP
requests to the server.  I also noticed that cloning via http[s]://
takes significantly more time than cloning via git://, because of the
old protocol being used.

```
$ time git clone https://git.netfilter.org/nftables
...
real    1m16.848s
user    0m4.867s
sys     0m1.883s

$ time git clone git://git.netfilter.org/nftables
...
real    0m2.453s
user    0m1.180s
sys     0m0.158s
```

According to [1], there is a more modern "smart" protocol, which is
relatively more stable and fast.  However it's not supported by the
remote server, so let's use git:// as a workaround.

[1] https://www.git-scm.com/docs/http-protocol

Change-Id: I8e943c74052cc74eae8dc1d80ab243f792a90156
2023-04-09 18:10:12 +07:00
Oliver Smith
8e5fa9ef7b contrib/jenkins: netfilter: use PARALLEL_MAKE
Change-Id: Ia707f7411548c6d82bbb06b835a1930b30c447ec
2023-03-16 11:55:53 +01:00
Oliver Smith
1670321cdc contrib/jenkins: clone netfilter repos with https
Change-Id: Id50c5dac3cfebdf5cf33467ef24d7c4cf5984cdc
2023-03-16 11:55:53 +01:00
Oliver Smith
a3e85aefcb contrib/jenkins: build nftables without python
We don't use the python bindings of nftables with osmo-upf, so don't
build them. Without this, it tries to build them with python2 for some
reason and since a recent nftables commit it fails with:

  running install
  Checking .pth file support in /build/deps/install/stow/nftables/lib/python2.7/site-packages/
  /usr/bin/python -E -c pass
  TEST FAILED: /build/deps/install/stow/nftables/lib/python2.7/site-packages/ does NOT support .pth files
  error: bad install directory or PYTHONPATH

Change-Id: Ie172dca3e6953c353239173bca07b1f62fbf4c34
2023-03-16 11:55:49 +01:00
Neels Janosch Hofmeyr
d8742f79ca osmo_pfcp_tool: make usable again
Some things in osmo-upf and libosmo-pfcp have changed without accounting
for that in osmo-pfcp-tool. (This tool is not that important, forgive me
for submitting various changes in one patch.)

Properly represent all of {access,core} x {local,remote} GTP F-TEIDs in
the internal osmo-pfcp-tool state.

Adjust and clarify osmo-pfcp-tool script commands.

Adjust the osmo-pfcp-tool scripts in contrib so that they work again.

Change-Id: I22cfaa4aedd465c81de85e673b9960eaf99c426b
2023-02-10 03:27:19 +01:00
Neels Janosch Hofmeyr
cd3f25cc20 osmo-pfcp-tool VTY: rename 'endecaps' to 'tunend'
We're establishing 'tunend' as short name for
encapsulation/decapsulation, also do this in osmo-pfcp-tool.

Keep a hidden "session endecaps" VTY cmd as backwards compat alias.

Related: SYS#6192
Change-Id: I0b44429cd6762fe401a4dced22ae2a3fd9bbe93b
2022-11-18 23:49:14 +01:00
Neels Janosch Hofmeyr
701bb8addc VTY: rename 'nft' to 'tunmap'
So far the config nodes were named after the implementation:
"GTP kernel module" = "gtp" and
"netfilter" = "nft"

We found that this is confusing, since both are related to handling GTP.
Rename "nft" to "tunmap"; a previous patch already renamed "gtp" to
"tunend".

Keep a hidden "nft" VTY cmd as backwards compat alias.

Related: SYS#6192
Change-Id: Ia3c5224dd3b5f5c9437bbdec997d02176818cc97
2022-11-18 23:49:14 +01:00
Neels Janosch Hofmeyr
95eb2c6a89 VTY: rename 'gtp' to 'tunend'
So far the config nodes were named after the implementation:
"GTP kernel module" = "gtp" and
"netfilter" = "nft"

We found that this is confusing, since both are related to handling GTP.
Rename "gtp" to "tunend"; a subsequent patch will rename "nft" to
"tunmap".

Keep a hidden "gtp" VTY cmd as backwards compat alias.

In log output, also print "tunend" instead of "endecaps"
(up_gtp_action_to_str_buf()).

Related: SYS#6192
Change-Id: I49ac7b1f8b5b74f586edfed1dfb29f9af55a521b
2022-11-18 23:49:14 +01:00
Max
c88dc7866f Set working directory in systemd service file
By default systemd will execute service with root directory (or home directory for user instance) which might result in
attempts to create files in unexpected place. Let's set it to 'osmocom' subdir of state directory (/var/lib for system instance) instead.

Related: OS#4821
Change-Id: I786e4a655c35617bbea523275a709e865fc86689
2022-09-05 13:05:43 +00:00
Neels Hofmeyr
22006ba039 debian,RPM,configure: fix packaging (deps etc)
Related: SYS#5599
Change-Id: I068736d513ddb54b9a62c1d7970a0fbff3095b4b
2022-08-24 16:11:21 +02:00
Harald Welte
581f5c63dc add missing dependencies to libosmo-{gtlv,pfcp} to rpm + dpkg
This should hopefully fix the many daily build error mails about
failed package builds on a dozen of distributions/architectures:

[  148s] No package 'libosmo-gtlv' found
[  148s] configure:12570: error: Package requirements (libosmo-gtlv >= 0.1.0) were not met:

Change-Id: Iac551616a9831dfd9e3203d1f40e312c4dd286b6
2022-08-21 12:59:10 +02:00
Vadim Yanitskiy
0db788aecd Fix missing dash in Redmine project URL
Change-Id: I2e3fd2ec734799098fed1ea361b8236746c97812
2022-08-18 03:41:45 +07:00
Neels Hofmeyr
1b3e2711cd add contrib/set_cap_net_admin.sh
Related: SYS#5599
Change-Id: If31c304e2602d3c37d5d8a5a2705417b2fc4686c
2022-08-08 20:23:51 +00:00
Neels Hofmeyr
7493d6db71 add osmo-pfcp-tool
A tool for quick testing of PFCP interaction with a UPF, based on VTY
scripts / interaction.

The main motivation to create this tool was to test both the CPF and UPF
sides of the new PFCP protocol encoding and decoding, and then to test
interaction of osmo-upf with the kernel modules. It may also come in
handy as a fast way to verify basic operation in a production
environment.

Related: SYS#5599
Change-Id: I34a80d43a14c7b68952c7d337d8042d6f28ceae7
2022-07-22 12:18:29 +02:00
Neels Hofmeyr
d87748957a add netfilter deps: libnftnl, libnftables
Will be used by subsequent patch to implement GTP tunnel mapping via
netfilter.

Related: SYS#5599
Change-Id: Ia8be861fe1303e82e57fe83a50cfa4ff0280db02
2022-06-19 14:13:28 +02:00
Neels Hofmeyr
6c7261640f add libgtpnl dependency
Related: SYS#5599
Change-Id: I9928be6f62f5a89d98bdac63428f7a046c95c855
2022-06-18 13:52:36 +02:00
Neels Hofmeyr
3574c79194 move libosmo-gtlv to libosmo-pfcp.git
Related: SYS#5599
Change-Id: Id72cdf94da60d4b6d09d0044c74e672c4412c15d
2022-06-17 16:59:15 +02:00
Neels Hofmeyr
c8898587f3 contrib: add PFCP cause and IEI string maps
These help to build enums and value_strings using regexes. They are a
verbatim copy from 3GPP TS 29.244 version 16.6.0 Release 16, paired with
C-compatible and possibly abbreviated name strings.

Related: SYS#5599
Change-Id: I7f37efd3cfc4c7b0ae49740ac15e461c52fae6e8
2022-03-22 00:27:08 +01:00
Neels Hofmeyr
103b69d99c initial osmocom boilerplate source tree
Related: SYS#5599
Depends: I0a46b147ec6a76d909df28136cfd2b764b2c75ea (libosmocore)
Change-Id: I4352dd8738a1a9de6ba2fc250ee8eef69c65ff1e
2022-01-21 01:45:44 +01:00