Attention is currently required from: jolly.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/30448 )
Change subject: Remove mISDN header from received channel data
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/30448
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I37f12baa1013cd1cfc6f6531b132669071eec926
Gerrit-Change-Number: 30448
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Comment-Date: Mon, 12 Dec 2022 09:47:20 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: jolly.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/30446 )
Change subject: Fix support for HDLC/RAW type channels at mISDN.c
......................................................................
Patch Set 1:
(3 comments)
Patchset:
PS1:
fine with me now, except for the TODO-RELEASE.
File include/osmocom/abis/e1_input.h:
https://gerrit.osmocom.org/c/libosmo-abis/+/30446/comment/908c9714_f671453d
PS1, Line 120: in
please add an entry to TOOD-RELEASE as this breaks the ABI towards applications, i.e. we need a related .so-version change of the library when we tag the next versions.
File src/input/misdn.c:
https://gerrit.osmocom.org/c/libosmo-abis/+/30446/comment/113998da_3df20a4e
PS1, Line 690: /* TS 16 is the D-channel, so we use D-channel proto */
: bfd->fd = socket(PF_ISDN, SOCK_DGRAM,
: (ts == 16) ? ISDN_P_NT_E1 : ISDN_P_B_HDLC);
> mISDN handles TS 16 different, so that ISDN_P_NT_E1 must be given instead of ISDN_P_B_HDLC. […]
Oh my, that's sad. I sometimes feel like we should remove mISDN support with all its constraints. Or at least not build it by default, to avoid users falling into traps. Nobody except you seems to know/understand them, and we have no piece of documentation explaining to users that you cannot use TS16 for e.g. TRAU frames on a mISDN line.
In any case, all unrelated to this patch.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/30446
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Ie9a2a3f6ae1ad7da1711b6ff2f0aeda39839a427
Gerrit-Change-Number: 30446
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Comment-Date: Mon, 12 Dec 2022 09:47:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: jolly <andreas(a)eversberg.eu>
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: comment
Attention is currently required from: fixeria.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-pfcp/+/30502 )
Change subject: gtlv: decoding error: log size limited hexdump of IE
......................................................................
Patch Set 4:
(1 comment)
File src/libosmo-gtlv/gtlv_dec_enc.c:
https://gerrit.osmocom.org/c/libosmo-pfcp/+/30502/comment/677d6f05_300be5fd
PS4, Line 224: osmo_hexdump
> We may want to have a special version of osmo_hexdump_max() in libosmocore.
would fit well, but i think this here is simple enough that we don't need to extend the API.
(btw i'm using the "legacy" version returning a static buffer because libosmo-gtlv must not make assumptions on allocation handling = cannot use OTC_SELECT)
--
To view, visit https://gerrit.osmocom.org/c/libosmo-pfcp/+/30502
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-pfcp
Gerrit-Branch: master
Gerrit-Change-Id: Ie814a117db3dfea32cf3f01cf124a2e472cb869f
Gerrit-Change-Number: 30502
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Sun, 11 Dec 2022 23:00:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/30498 )
Change subject: nft: allow to get the ruleset string without running
......................................................................
nft: allow to get the ruleset string without running
Separate string composition of the nftables ruleset from the actual
actvation of the ruleset to nftables.
For a 'show' VTY command added in upcoming patch, I'd like to be able to
vty_out() an nftables rule set. Provide API for that.
Change-Id: I0124a68ccf1ac7b90c5cc32d0cbf58d0cc219ccc
---
M include/osmocom/upf/upf_nft.h
M src/osmo-upf/upf_nft.c
2 files changed, 8 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
diff --git a/include/osmocom/upf/upf_nft.h b/include/osmocom/upf/upf_nft.h
index fe8bb12..4cdcb51 100644
--- a/include/osmocom/upf/upf_nft.h
+++ b/include/osmocom/upf/upf_nft.h
@@ -49,5 +49,6 @@
int upf_nft_init();
int upf_nft_free();
+char *upf_nft_tunmap_get_ruleset_str(void *ctx, struct upf_nft_tunmap_desc *tunmap);
int upf_nft_tunmap_create(struct upf_nft_tunmap_desc *tunmap);
int upf_nft_tunmap_delete(struct upf_nft_tunmap_desc *tunmap);
diff --git a/src/osmo-upf/upf_nft.c b/src/osmo-upf/upf_nft.c
index 8f59d01..7c1ec53 100644
--- a/src/osmo-upf/upf_nft.c
+++ b/src/osmo-upf/upf_nft.c
@@ -215,7 +215,7 @@
};
}
-int upf_nft_tunmap_create(struct upf_nft_tunmap_desc *tunmap)
+char *upf_nft_tunmap_get_ruleset_str(void *ctx, struct upf_nft_tunmap_desc *tunmap)
{
struct upf_nft_args args;
@@ -228,7 +228,12 @@
}
upf_nft_args_from_tunmap_desc(&args, tunmap);
- return upf_nft_run(upf_nft_ruleset_tunmap_create_c(OTC_SELECT, &args));
+ return upf_nft_ruleset_tunmap_create_c(ctx, &args);
+}
+
+int upf_nft_tunmap_create(struct upf_nft_tunmap_desc *tunmap)
+{
+ return upf_nft_run(upf_nft_tunmap_get_ruleset_str(OTC_SELECT, tunmap));
}
int upf_nft_tunmap_delete(struct upf_nft_tunmap_desc *tunmap)
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/30498
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I0124a68ccf1ac7b90c5cc32d0cbf58d0cc219ccc
Gerrit-Change-Number: 30498
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: merged
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/30499 )
Change subject: vty: add: show nft-rule tunmap example
......................................................................
vty: add: show nft-rule tunmap example
Add VTY command to print out an nftables ruleset that osmo-upf produces,
with arbitrary IP addrs / TEIDs inserted. This allows tracking in *.vty
tests how the nftables rulesets are changed by patches.
future:
- Adding the 'tunmap' keyword to allow adding show commands for
different uses of nftables.
- Adding the 'example' keyword to allow adding show commands for
actual tunmap IDs / PFCP session IDs / ...
- Matches upcoming vty commands
'nft-rule tunmap append .NFT_RULE'
'no nft-rule tunmap append'
'show nft-rule tunmap append'
Add new separate nft-rule.vty -- more to come here in upcoming patch.
Change-Id: I9b57aa492c051e480c9bd819ae58f8f59a13af40
---
M src/osmo-upf/upf_nft.c
M src/osmo-upf/upf_vty.c
A tests/nft-rule.vty
M tests/upf.vty
4 files changed, 65 insertions(+), 3 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
neels: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
diff --git a/src/osmo-upf/upf_nft.c b/src/osmo-upf/upf_nft.c
index 7c1ec53..81ca9d0 100644
--- a/src/osmo-upf/upf_nft.c
+++ b/src/osmo-upf/upf_nft.c
@@ -64,6 +64,12 @@
int upf_nft_init()
{
int rc;
+
+ /* Always set up the default settings, also in mockup mode, so that the VTY reflects sane values */
+ if (!g_upf->nft.table_name)
+ g_upf->nft.table_name = talloc_strdup(g_upf, "osmo-upf");
+
+ /* When in mockup mode, do not set up nft_ctx and netfilter table */
if (g_upf->nft.mockup) {
LOGP(DNFT, LOGL_NOTICE,
"tunmap/mockup active: not allocating libnftables nft_ctx. FOR TESTING PURPOSES ONLY.\n");
@@ -76,9 +82,6 @@
return -EIO;
}
- if (!g_upf->nft.table_name)
- g_upf->nft.table_name = talloc_strdup(g_upf, "osmo-upf");
-
rc = upf_nft_run(upf_nft_ruleset_table_create(OTC_SELECT, g_upf->nft.table_name));
if (rc) {
LOGP(DNFT, LOGL_ERROR, "Failed to create nft table %s\n",
diff --git a/src/osmo-upf/upf_vty.c b/src/osmo-upf/upf_vty.c
index aff7590..6d74b21 100644
--- a/src/osmo-upf/upf_vty.c
+++ b/src/osmo-upf/upf_vty.c
@@ -254,6 +254,43 @@
return CMD_SUCCESS;
}
+#define NFT_RULE_STR "nftables rule specifics\n"
+#define TUNMAP_STR "GTP tunmap use case (a.k.a. forwarding between two GTP tunnels)\n"
+
+DEFUN(show_nft_rule_tunmap_example, show_nft_rule_tunmap_example_cmd,
+ "show nft-rule tunmap example",
+ SHOW_STR NFT_RULE_STR TUNMAP_STR
+ "Print a complete nftables ruleset for a tunmap filled with example IP addresses and TEIDs\n")
+{
+ struct osmo_sockaddr_str str = {};
+ struct upf_nft_tunmap_desc d = {
+ .access = {
+ .local_teid = 0x201,
+ .remote_teid = 0x102,
+ },
+ .core = {
+ .local_teid = 0x203,
+ .remote_teid = 0x302,
+ },
+ .id = 123,
+ };
+
+ osmo_sockaddr_str_from_str2(&str, "1.1.1.1");
+ osmo_sockaddr_str_to_sockaddr(&str, &d.access.gtp_remote_addr.u.sas);
+
+ osmo_sockaddr_str_from_str2(&str, "2.2.2.1");
+ osmo_sockaddr_str_to_sockaddr(&str, &d.access.gtp_local_addr.u.sas);
+
+ osmo_sockaddr_str_from_str2(&str, "2.2.2.3");
+ osmo_sockaddr_str_to_sockaddr(&str, &d.core.gtp_local_addr.u.sas);
+
+ osmo_sockaddr_str_from_str2(&str, "3.3.3.3");
+ osmo_sockaddr_str_to_sockaddr(&str, &d.core.gtp_remote_addr.u.sas);
+
+ vty_out(vty, "%s%s", upf_nft_tunmap_get_ruleset_str(OTC_SELECT, &d), VTY_NEWLINE);
+ return CMD_SUCCESS;
+}
+
static struct cmd_node cfg_netinst_node = {
NETINST_NODE,
"%s(config-netinst)# ",
@@ -435,6 +472,7 @@
install_element(TUNMAP_NODE, &cfg_tunmap_mockup_cmd);
install_element(TUNMAP_NODE, &cfg_tunmap_no_mockup_cmd);
install_element(TUNMAP_NODE, &cfg_tunmap_table_name_cmd);
+ install_element(TUNMAP_NODE, &show_nft_rule_tunmap_example_cmd);
install_node(&cfg_netinst_node, config_write_netinst);
install_element(CONFIG_NODE, &cfg_netinst_cmd);
diff --git a/tests/nft-rule.vty b/tests/nft-rule.vty
new file mode 100644
index 0000000..f328871
--- /dev/null
+++ b/tests/nft-rule.vty
@@ -0,0 +1,8 @@
+OsmoUPF> enable
+OsmoUPF# configure terminal
+OsmoUPF(config)# tunmap
+
+OsmoUPF(config-tunmap)# show nft-rule tunmap example
+add chain inet osmo-upf tunmap123 { type filter hook prerouting priority -300; }
+add rule inet osmo-upf tunmap123 meta l4proto udp ip daddr 2.2.2.1 @ih,32,32 0x00000201 ip saddr set 2.2.2.3 ip daddr set 3.3.3.3 @ih,32,32 set 0x00000302 counter;
+add rule inet osmo-upf tunmap123 meta l4proto udp ip daddr 2.2.2.3 @ih,32,32 0x00000203 ip saddr set 2.2.2.1 ip daddr set 1.1.1.1 @ih,32,32 set 0x00000102 counter;
diff --git a/tests/upf.vty b/tests/upf.vty
index 5100b17..8931719 100644
--- a/tests/upf.vty
+++ b/tests/upf.vty
@@ -52,6 +52,7 @@
mockup
no mockup
table-name TABLE_NAME
+ show nft-rule tunmap example
OsmoUPF(config-tunmap)# exit
OsmoUPF(config)# tunmap
@@ -60,6 +61,7 @@
mockup
no mockup
table-name TABLE_NAME
+ show nft-rule tunmap example
OsmoUPF(config-tunmap)# mockup?
mockup don't actually send rulesets to nftables, just return success
@@ -70,3 +72,14 @@
table-name Set the nft inet table name to create and place GTP tunnel forwarding chains in (as in 'nft add table inet foo'). If multiple instances of osmo-upf are running on the same system, each osmo-upf must have its own table name. Otherwise the names of created forwarding chains will collide. The default table name is "osmo-upf".
OsmoUPF(config-tunmap)# table-name ?
TABLE_NAME nft inet table name
+
+OsmoUPF(config-tunmap)# show?
+ show Show running system information
+OsmoUPF(config-tunmap)# show ?
+...
+ nft-rule nftables rule specifics
+...
+OsmoUPF(config-tunmap)# show nft-rule ?
+ tunmap GTP tunmap use case (a.k.a. forwarding between two GTP tunnels)
+OsmoUPF(config-tunmap)# show nft-rule tunmap ?
+ example Print a complete nftables ruleset for a tunmap filled with example IP addresses and TEIDs
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/30499
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I9b57aa492c051e480c9bd819ae58f8f59a13af40
Gerrit-Change-Number: 30499
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: merged
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/30496 )
Change subject: nft: ensure to assign rule id only once
......................................................................
nft: ensure to assign rule id only once
Make sure an assigned id is not overwritten.
So far this function was guaranteed to be called only once. But I would
like to allow getting the nftables ruleset string more than once in a
future patch. Prepare that.
Change-Id: I4e8c48c01fb2f5d4cfd223fe03abbf15b1a55670
---
M include/osmocom/upf/upf_nft.h
M src/osmo-upf/upf_nft.c
2 files changed, 7 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
diff --git a/include/osmocom/upf/upf_nft.h b/include/osmocom/upf/upf_nft.h
index 9108a4f..fe8bb12 100644
--- a/include/osmocom/upf/upf_nft.h
+++ b/include/osmocom/upf/upf_nft.h
@@ -42,6 +42,7 @@
struct osmo_sockaddr gtp_remote_addr;
uint32_t remote_teid;
} core;
+ /* id as in ruleset name 'tunmap<id>'. If zero, no id has been assigned yet. */
uint32_t id;
};
diff --git a/src/osmo-upf/upf_nft.c b/src/osmo-upf/upf_nft.c
index 4dfea6c..c34cbfb 100644
--- a/src/osmo-upf/upf_nft.c
+++ b/src/osmo-upf/upf_nft.c
@@ -215,8 +215,12 @@
struct upf_nft_args args;
/* Give this tunnel mapping a new id, returned to the caller so that the tunnel mapping can be deleted later */
- g_upf->nft.next_id_state++;
- tunmap->id = g_upf->nft.next_id_state;
+ if (!tunmap->id) {
+ g_upf->nft.next_id_state++;
+ if (!g_upf->nft.next_id_state)
+ g_upf->nft.next_id_state++;
+ tunmap->id = g_upf->nft.next_id_state;
+ }
upf_nft_args_from_tunmap_desc(&args, tunmap);
return upf_nft_run(upf_nft_ruleset_tunmap_create_c(OTC_SELECT, &args));
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/30496
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I4e8c48c01fb2f5d4cfd223fe03abbf15b1a55670
Gerrit-Change-Number: 30496
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: merged