lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

November 2022

  • 2 participants
  • 2503 discussions
Change in osmo-upf[master]: drop unused upf_gtp_dev_is_tunnel_active()
by neels 18 Nov '22

18 Nov '22
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-upf/+/30236 ) Change subject: drop unused upf_gtp_dev_is_tunnel_active() ...................................................................... drop unused upf_gtp_dev_is_tunnel_active() Change-Id: Ia8517f702118af55ce47a4f63fb08ac5ee284217 --- M include/osmocom/upf/upf_gtp.h 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/36/30236/1 diff --git a/include/osmocom/upf/upf_gtp.h b/include/osmocom/upf/upf_gtp.h index ec0046d..c553730 100644 --- a/include/osmocom/upf/upf_gtp.h +++ b/include/osmocom/upf/upf_gtp.h @@ -78,7 +78,6 @@ struct upf_gtp_dev *upf_gtp_dev_first(); int upf_gtp_dev_tunnel_add(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *t); -bool upf_gtp_dev_is_tunnel_active(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *t); int upf_gtp_dev_tunnel_del(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *t); int upf_gtp_dev_to_str_buf(char *buf, size_t buflen, const struct upf_gtp_dev *dev); -- To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/30236 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-upf Gerrit-Branch: master Gerrit-Change-Id: Ia8517f702118af55ce47a4f63fb08ac5ee284217 Gerrit-Change-Number: 30236 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-upf[master]: cosmetic: rename upf_gtp_dev_tunnel_* to upf_gtp_dev_tunend_*
by neels 18 Nov '22

18 Nov '22
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-upf/+/30237 ) Change subject: cosmetic: rename upf_gtp_dev_tunnel_* to upf_gtp_dev_tunend_* ...................................................................... cosmetic: rename upf_gtp_dev_tunnel_* to upf_gtp_dev_tunend_* Change-Id: I73e7b3c4841520909185aaba3ec41c6cf1e3ff51 --- M include/osmocom/upf/upf_gtp.h M src/osmo-upf/up_gtp_action.c M src/osmo-upf/upf_gtp.c 3 files changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/37/30237/1 diff --git a/include/osmocom/upf/upf_gtp.h b/include/osmocom/upf/upf_gtp.h index c553730..77ea623 100644 --- a/include/osmocom/upf/upf_gtp.h +++ b/include/osmocom/upf/upf_gtp.h @@ -77,8 +77,8 @@ struct upf_gtp_dev *upf_gtp_dev_find_by_name(const char *name); struct upf_gtp_dev *upf_gtp_dev_first(); -int upf_gtp_dev_tunnel_add(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *t); -int upf_gtp_dev_tunnel_del(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *t); +int upf_gtp_dev_tunend_add(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *t); +int upf_gtp_dev_tunend_del(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *t); int upf_gtp_dev_to_str_buf(char *buf, size_t buflen, const struct upf_gtp_dev *dev); char *upf_gtp_dev_to_str_c(void *ctx, const struct upf_gtp_dev *dev); diff --git a/src/osmo-upf/up_gtp_action.c b/src/osmo-upf/up_gtp_action.c index 2471a61..81b74b3 100644 --- a/src/osmo-upf/up_gtp_action.c +++ b/src/osmo-upf/up_gtp_action.c @@ -99,9 +99,9 @@ } if (enable) - rc = upf_gtp_dev_tunnel_add(gtp_dev, &a->tunend); + rc = upf_gtp_dev_tunend_add(gtp_dev, &a->tunend); else - rc = upf_gtp_dev_tunnel_del(gtp_dev, &a->tunend); + rc = upf_gtp_dev_tunend_del(gtp_dev, &a->tunend); if (rc) { LOG_UP_GTP_ACTION(a, LOGL_ERROR, "Failed to %s GTP tunnel: %d %s\n", enable ? "enable" : "disable", rc, strerror(-rc)); diff --git a/src/osmo-upf/upf_gtp.c b/src/osmo-upf/upf_gtp.c index 6794a25..ae1eaf0 100644 --- a/src/osmo-upf/upf_gtp.c +++ b/src/osmo-upf/upf_gtp.c @@ -381,7 +381,7 @@ return rc; } -static struct upf_gtp_tunend *upf_gtp_dev_tunnel_find(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *tun_desc) +static struct upf_gtp_tunend *upf_gtp_dev_tunend_find(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *tun_desc) { struct upf_gtp_tunend *tun; llist_for_each_entry(tun, &dev->tunnels, entry) { @@ -392,10 +392,10 @@ return NULL; } -int upf_gtp_dev_tunnel_add(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *tun_desc) +int upf_gtp_dev_tunend_add(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *tun_desc) { struct upf_gtp_tunend *tun; - tun = upf_gtp_dev_tunnel_find(dev, tun_desc); + tun = upf_gtp_dev_tunend_find(dev, tun_desc); if (!tun) tun = upf_gtp_tunend_alloc(dev, tun_desc); if (tun->active) @@ -403,11 +403,11 @@ return upf_gtp_tunend_activate(tun); } -int upf_gtp_dev_tunnel_del(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *tun_desc) +int upf_gtp_dev_tunend_del(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *tun_desc) { struct upf_gtp_tunend *tun; int rc; - tun = upf_gtp_dev_tunnel_find(dev, tun_desc); + tun = upf_gtp_dev_tunend_find(dev, tun_desc); if (!tun) return 0; if (tun->active) { -- To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/30237 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-upf Gerrit-Branch: master Gerrit-Change-Id: I73e7b3c4841520909185aaba3ec41c6cf1e3ff51 Gerrit-Change-Number: 30237 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-upf[master]: cosmetic: rename upf_gtp_tun to upf_gtp_tunend
by neels 18 Nov '22

18 Nov '22
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-upf/+/30235 to look at the new patch set (#2). Change subject: cosmetic: rename upf_gtp_tun to upf_gtp_tunend ...................................................................... cosmetic: rename upf_gtp_tun to upf_gtp_tunend Change-Id: I0815012679237838a031e28c0afb98b7e0d184bd --- M include/osmocom/upf/up_gtp_action.h M include/osmocom/upf/upf_gtp.h M src/osmo-upf/upf_gtp.c 3 files changed, 37 insertions(+), 37 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/35/30235/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/30235 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-upf Gerrit-Branch: master Gerrit-Change-Id: I0815012679237838a031e28c0afb98b7e0d184bd Gerrit-Change-Number: 30235 Gerrit-PatchSet: 2 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-upf[master]: cosmetic: rename upf_gtp_tun_desc to upf_gtp_tunend_desc
by neels 18 Nov '22

18 Nov '22
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-upf/+/30235 ) Change subject: cosmetic: rename upf_gtp_tun_desc to upf_gtp_tunend_desc ...................................................................... cosmetic: rename upf_gtp_tun_desc to upf_gtp_tunend_desc Change-Id: I0815012679237838a031e28c0afb98b7e0d184bd --- M include/osmocom/upf/up_gtp_action.h M include/osmocom/upf/upf_gtp.h M src/osmo-upf/upf_gtp.c 3 files changed, 12 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/35/30235/1 diff --git a/include/osmocom/upf/up_gtp_action.h b/include/osmocom/upf/up_gtp_action.h index 5b4d5ee..8e291b7 100644 --- a/include/osmocom/upf/up_gtp_action.h +++ b/include/osmocom/upf/up_gtp_action.h @@ -54,7 +54,7 @@ enum up_gtp_action_kind kind; union { /* En-/De-capsulate GTP: add/remove a GTP header and forward the GTP payload from/to plain IP. */ - struct upf_gtp_tun_desc tunend; + struct upf_gtp_tunend_desc tunend; /* Tunnel-map GTP: translate from one TEID to another and forward */ struct upf_nft_tunmap_desc tunmap; diff --git a/include/osmocom/upf/upf_gtp.h b/include/osmocom/upf/upf_gtp.h index 1e0df5e..ed4c5f8 100644 --- a/include/osmocom/upf/upf_gtp.h +++ b/include/osmocom/upf/upf_gtp.h @@ -60,14 +60,14 @@ struct llist_head tunnels; }; -struct upf_gtp_tun_desc { +struct upf_gtp_tunend_desc { uint32_t local_teid; uint32_t remote_teid; struct osmo_sockaddr ue_addr; struct osmo_sockaddr gtp_remote_addr; }; -int upf_gtp_tun_desc_cmp(const struct upf_gtp_tun_desc *a, const struct upf_gtp_tun_desc *b); +int upf_gtp_tun_desc_cmp(const struct upf_gtp_tunend_desc *a, const struct upf_gtp_tunend_desc *b); int upf_gtp_genl_ensure_open(); void upf_gtp_genl_close(); @@ -77,9 +77,9 @@ struct upf_gtp_dev *upf_gtp_dev_find_by_name(const char *name); struct upf_gtp_dev *upf_gtp_dev_first(); -int upf_gtp_dev_tunnel_add(struct upf_gtp_dev *dev, const struct upf_gtp_tun_desc *t); -bool upf_gtp_dev_is_tunnel_active(struct upf_gtp_dev *dev, const struct upf_gtp_tun_desc *t); -int upf_gtp_dev_tunnel_del(struct upf_gtp_dev *dev, const struct upf_gtp_tun_desc *t); +int upf_gtp_dev_tunnel_add(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *t); +bool upf_gtp_dev_is_tunnel_active(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *t); +int upf_gtp_dev_tunnel_del(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *t); int upf_gtp_dev_to_str_buf(char *buf, size_t buflen, const struct upf_gtp_dev *dev); char *upf_gtp_dev_to_str_c(void *ctx, const struct upf_gtp_dev *dev); diff --git a/src/osmo-upf/upf_gtp.c b/src/osmo-upf/upf_gtp.c index 880e587..c99788a 100644 --- a/src/osmo-upf/upf_gtp.c +++ b/src/osmo-upf/upf_gtp.c @@ -291,7 +291,7 @@ struct llist_head entry; struct upf_gtp_dev *dev; - struct upf_gtp_tun_desc desc; + struct upf_gtp_tunend_desc desc; bool active; }; @@ -322,7 +322,7 @@ return 0; } -static struct upf_gtp_tun *upf_gtp_tun_alloc(struct upf_gtp_dev *dev, const struct upf_gtp_tun_desc *desc) +static struct upf_gtp_tun *upf_gtp_tun_alloc(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *desc) { struct upf_gtp_tun *tun = talloc(dev, struct upf_gtp_tun); OSMO_ASSERT(tun); @@ -381,7 +381,7 @@ return rc; } -static struct upf_gtp_tun *upf_gtp_dev_tunnel_find(struct upf_gtp_dev *dev, const struct upf_gtp_tun_desc *tun_desc) +static struct upf_gtp_tun *upf_gtp_dev_tunnel_find(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *tun_desc) { struct upf_gtp_tun *tun; llist_for_each_entry(tun, &dev->tunnels, entry) { @@ -392,7 +392,7 @@ return NULL; } -int upf_gtp_dev_tunnel_add(struct upf_gtp_dev *dev, const struct upf_gtp_tun_desc *tun_desc) +int upf_gtp_dev_tunnel_add(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *tun_desc) { struct upf_gtp_tun *tun; tun = upf_gtp_dev_tunnel_find(dev, tun_desc); @@ -403,7 +403,7 @@ return upf_gtp_tun_activate(tun); } -int upf_gtp_dev_tunnel_del(struct upf_gtp_dev *dev, const struct upf_gtp_tun_desc *tun_desc) +int upf_gtp_dev_tunnel_del(struct upf_gtp_dev *dev, const struct upf_gtp_tunend_desc *tun_desc) { struct upf_gtp_tun *tun; int rc; @@ -458,7 +458,7 @@ return 0; } -int upf_gtp_tun_desc_cmp(const struct upf_gtp_tun_desc *a, const struct upf_gtp_tun_desc *b) +int upf_gtp_tun_desc_cmp(const struct upf_gtp_tunend_desc *a, const struct upf_gtp_tunend_desc *b) { int r; -- To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/30235 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-upf Gerrit-Branch: master Gerrit-Change-Id: I0815012679237838a031e28c0afb98b7e0d184bd Gerrit-Change-Number: 30235 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-upf[master]: cosmetic: in code, rename 'endecaps' to 'tunend'
by neels 18 Nov '22

18 Nov '22
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/30234 ) Change subject: cosmetic: in code, rename 'endecaps' to 'tunend' ...................................................................... cosmetic: in code, rename 'endecaps' to 'tunend' Change-Id: I55ce7cc842f36b2528e6a1a15d6f3bcb960f492b --- M include/osmocom/upf/up_gtp_action.h M src/osmo-pfcp-tool/pfcp_tool_vty.c M src/osmo-upf/up_gtp_action.c M src/osmo-upf/up_session.c 4 files changed, 18 insertions(+), 18 deletions(-) Approvals: Jenkins Builder: Verified diff --git a/include/osmocom/upf/up_gtp_action.h b/include/osmocom/upf/up_gtp_action.h index 1907ed1..5b4d5ee 100644 --- a/include/osmocom/upf/up_gtp_action.h +++ b/include/osmocom/upf/up_gtp_action.h @@ -40,7 +40,7 @@ enum up_gtp_action_kind { UP_GTP_DROP, - UP_GTP_U_ENDECAPS, + UP_GTP_U_TUNEND, UP_GTP_U_TUNMAP, }; @@ -54,7 +54,7 @@ enum up_gtp_action_kind kind; union { /* En-/De-capsulate GTP: add/remove a GTP header and forward the GTP payload from/to plain IP. */ - struct upf_gtp_tun_desc endecaps; + struct upf_gtp_tun_desc tunend; /* Tunnel-map GTP: translate from one TEID to another and forward */ struct upf_nft_tunmap_desc tunmap; diff --git a/src/osmo-pfcp-tool/pfcp_tool_vty.c b/src/osmo-pfcp-tool/pfcp_tool_vty.c index 70bca18..fcdbd67 100644 --- a/src/osmo-pfcp-tool/pfcp_tool_vty.c +++ b/src/osmo-pfcp-tool/pfcp_tool_vty.c @@ -261,7 +261,7 @@ { struct pfcp_tool_peer *peer = vty->index; struct pfcp_tool_session *session; - enum up_gtp_action_kind gtp_action = UP_GTP_U_ENDECAPS; + enum up_gtp_action_kind gtp_action = UP_GTP_U_TUNEND; if (argc > 0 && !strcmp(argv[0], "tunmap")) gtp_action = UP_GTP_U_TUNMAP; @@ -661,7 +661,7 @@ { struct pfcp_tool_session *session = vty->index; switch (session->gtp_action) { - case UP_GTP_U_ENDECAPS: + case UP_GTP_U_TUNEND: return session_tunend_tx_est_req(vty, argv, argc); case UP_GTP_U_TUNMAP: return session_tunmap_tx_est_req(vty, argv, argc); diff --git a/src/osmo-upf/up_gtp_action.c b/src/osmo-upf/up_gtp_action.c index 0f55ded..2471a61 100644 --- a/src/osmo-upf/up_gtp_action.c +++ b/src/osmo-upf/up_gtp_action.c @@ -47,15 +47,15 @@ return cmp; switch (a->kind) { - case UP_GTP_U_ENDECAPS: - if ((cmp = CMP_MEMB(endecaps.local_teid))) + case UP_GTP_U_TUNEND: + if ((cmp = CMP_MEMB(tunend.local_teid))) return cmp; - if ((cmp = CMP_MEMB(endecaps.remote_teid))) + if ((cmp = CMP_MEMB(tunend.remote_teid))) return cmp; - cmp = osmo_sockaddr_cmp(&a->endecaps.gtp_remote_addr, &b->endecaps.gtp_remote_addr); + cmp = osmo_sockaddr_cmp(&a->tunend.gtp_remote_addr, &b->tunend.gtp_remote_addr); if (cmp) return cmp; - cmp = osmo_sockaddr_cmp(&a->endecaps.ue_addr, &b->endecaps.ue_addr); + cmp = osmo_sockaddr_cmp(&a->tunend.ue_addr, &b->tunend.ue_addr); if (cmp) return cmp; break; @@ -82,7 +82,7 @@ int rc; switch (a->kind) { - case UP_GTP_U_ENDECAPS: + case UP_GTP_U_TUNEND: if (g_upf->gtp.mockup) { LOG_UP_GTP_ACTION(a, LOGL_NOTICE, "tunend/mockup active, skipping GTP action %s\n", enable ? "enable" : "disable"); @@ -99,9 +99,9 @@ } if (enable) - rc = upf_gtp_dev_tunnel_add(gtp_dev, &a->endecaps); + rc = upf_gtp_dev_tunnel_add(gtp_dev, &a->tunend); else - rc = upf_gtp_dev_tunnel_del(gtp_dev, &a->endecaps); + rc = upf_gtp_dev_tunnel_del(gtp_dev, &a->tunend); if (rc) { LOG_UP_GTP_ACTION(a, LOGL_ERROR, "Failed to %s GTP tunnel: %d %s\n", enable ? "enable" : "disable", rc, strerror(-rc)); @@ -165,12 +165,12 @@ { struct osmo_strbuf sb = { .buf = buf, .len = buflen }; switch (a->kind) { - case UP_GTP_U_ENDECAPS: + case UP_GTP_U_TUNEND: OSMO_STRBUF_PRINTF(sb, "GTP:tunend GTP-access:"); - OSMO_STRBUF_APPEND(sb, osmo_sockaddr_to_str_buf2, &a->endecaps.gtp_remote_addr); + OSMO_STRBUF_APPEND(sb, osmo_sockaddr_to_str_buf2, &a->tunend.gtp_remote_addr); OSMO_STRBUF_PRINTF(sb, " TEID-r:0x%"PRIx32" TEID-l:0x%"PRIx32" IP-core:", - a->endecaps.remote_teid, a->endecaps.local_teid); - OSMO_STRBUF_APPEND(sb, osmo_sockaddr_to_str_buf2, &a->endecaps.ue_addr); + a->tunend.remote_teid, a->tunend.local_teid); + OSMO_STRBUF_APPEND(sb, osmo_sockaddr_to_str_buf2, &a->tunend.ue_addr); break; case UP_GTP_U_TUNMAP: OSMO_STRBUF_PRINTF(sb, "GTP:tunmap GTP-access:"); diff --git a/src/osmo-upf/up_session.c b/src/osmo-upf/up_session.c index f35a6eb..e77fe6b 100644 --- a/src/osmo-upf/up_session.c +++ b/src/osmo-upf/up_session.c @@ -1129,8 +1129,8 @@ .session = session, .pdr_core = pdr->desc.pdr_id, .pdr_access = rpdr->desc.pdr_id, - .kind = UP_GTP_U_ENDECAPS, - .endecaps = { + .kind = UP_GTP_U_TUNEND, + .tunend = { .local_teid = pdr->local_f_teid->fixed.teid, .remote_teid = rfar_forw->outer_header_creation.teid, .gtp_remote_addr = rfar_forw->outer_header_creation.ip_addr.v4, null-- To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/30234 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-upf Gerrit-Branch: master Gerrit-Change-Id: I55ce7cc842f36b2528e6a1a15d6f3bcb960f492b Gerrit-Change-Number: 30234 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: merged
1 0
0 0
Change in osmo-upf[master]: VTY: rename 'nft' to 'tunmap'
by neels 18 Nov '22

18 Nov '22
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/30230 ) Change subject: VTY: rename 'nft' to 'tunmap' ...................................................................... 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 --- M contrib/osmo-pfcp-tool-scripts/osmo-upf-11.cfg M contrib/osmo-pfcp-tool-scripts/osmo-upf-12.cfg M doc/examples/osmo-upf/osmo-upf-mockup.cfg M src/osmo-upf/up_gtp_action.c M src/osmo-upf/upf_nft.c M src/osmo-upf/upf_vty.c M tests/upf.vty 7 files changed, 41 insertions(+), 28 deletions(-) Approvals: Jenkins Builder: Verified diff --git a/contrib/osmo-pfcp-tool-scripts/osmo-upf-11.cfg b/contrib/osmo-pfcp-tool-scripts/osmo-upf-11.cfg index 2e5baa3..10ecd8d 100644 --- a/contrib/osmo-pfcp-tool-scripts/osmo-upf-11.cfg +++ b/contrib/osmo-pfcp-tool-scripts/osmo-upf-11.cfg @@ -23,5 +23,5 @@ local-addr 127.0.0.11 tunend dev create apn11 127.0.0.11 -nft +tunmap table-name osmo-upf-11 diff --git a/contrib/osmo-pfcp-tool-scripts/osmo-upf-12.cfg b/contrib/osmo-pfcp-tool-scripts/osmo-upf-12.cfg index fcfd5be..272301a 100644 --- a/contrib/osmo-pfcp-tool-scripts/osmo-upf-12.cfg +++ b/contrib/osmo-pfcp-tool-scripts/osmo-upf-12.cfg @@ -23,5 +23,5 @@ local-addr 127.0.0.12 tunend dev create apn12 127.0.0.12 -nft +tunmap table-name osmo-upf-12 diff --git a/doc/examples/osmo-upf/osmo-upf-mockup.cfg b/doc/examples/osmo-upf/osmo-upf-mockup.cfg index 36682a0..1150c34 100644 --- a/doc/examples/osmo-upf/osmo-upf-mockup.cfg +++ b/doc/examples/osmo-upf/osmo-upf-mockup.cfg @@ -13,5 +13,5 @@ local-addr 127.0.0.1 tunend mockup -nft +tunmap mockup diff --git a/src/osmo-upf/up_gtp_action.c b/src/osmo-upf/up_gtp_action.c index 568df48..0f55ded 100644 --- a/src/osmo-upf/up_gtp_action.c +++ b/src/osmo-upf/up_gtp_action.c @@ -112,7 +112,7 @@ case UP_GTP_U_TUNMAP: if (g_upf->nft.mockup) { - LOG_UP_GTP_ACTION(a, LOGL_NOTICE, "nft/mockup active, skipping nftables ruleset %s\n", + LOG_UP_GTP_ACTION(a, LOGL_NOTICE, "tunmap/mockup active, skipping nftables ruleset %s\n", enable ? "enable" : "disable"); return 0; } diff --git a/src/osmo-upf/upf_nft.c b/src/osmo-upf/upf_nft.c index bcb6a70..4a2ca23 100644 --- a/src/osmo-upf/upf_nft.c +++ b/src/osmo-upf/upf_nft.c @@ -40,7 +40,7 @@ int rc; if (g_upf->nft.mockup) { - LOGP(DNFT, LOGL_NOTICE, "nft/mockup active: not running nft ruleset: '%s'\n", ruleset); + LOGP(DNFT, LOGL_NOTICE, "tunmap/mockup active: not running nft ruleset: '%s'\n", ruleset); return 0; } @@ -64,7 +64,7 @@ int rc; if (g_upf->nft.mockup) { LOGP(DNFT, LOGL_NOTICE, - "nft/mockup active: not allocating libnftables nft_ctx. FOR TESTING PURPOSES ONLY.\n"); + "tunmap/mockup active: not allocating libnftables nft_ctx. FOR TESTING PURPOSES ONLY.\n"); return 0; } diff --git a/src/osmo-upf/upf_vty.c b/src/osmo-upf/upf_vty.c index c43b382..f92ab05 100644 --- a/src/osmo-upf/upf_vty.c +++ b/src/osmo-upf/upf_vty.c @@ -41,7 +41,7 @@ enum upf_vty_node { PFCP_NODE = _LAST_OSMOVTY_NODE + 1, TUNEND_NODE, - NFT_NODE, + TUNMAP_NODE, }; static struct cmd_node cfg_pfcp_node = { @@ -194,23 +194,26 @@ return CMD_SUCCESS; } -static struct cmd_node cfg_nft_node = { - NFT_NODE, - "%s(config-nft)# ", +static struct cmd_node cfg_tunmap_node = { + TUNMAP_NODE, + "%s(config-tunmap)# ", 1, }; -DEFUN(cfg_nft, cfg_nft_cmd, - "nft", - "Enter the 'nft' node to configure nftables usage\n") +#define TUNMAP_NODE_STR "Enter the 'tunmap' node to configure nftables usage\n" + +DEFUN(cfg_tunmap, cfg_tunmap_cmd, "tunmap", TUNMAP_NODE_STR) { - vty->node = NFT_NODE; + vty->node = TUNMAP_NODE; return CMD_SUCCESS; } -static int config_write_nft(struct vty *vty) +/* legacy compat: "tunmap" was originally named "nft" */ +DEFUN_CMD_ELEMENT(cfg_tunmap, cfg_nft_cmd, "nft", TUNMAP_NODE_STR, CMD_ATTR_HIDDEN, 0); + +static int config_write_tunmap(struct vty *vty) { - vty_out(vty, "nft%s", VTY_NEWLINE); + vty_out(vty, "tunmap%s", VTY_NEWLINE); if (g_upf->nft.mockup) vty_out(vty, " mockup%s", VTY_NEWLINE); @@ -220,7 +223,7 @@ return CMD_SUCCESS; } -DEFUN(cfg_nft_mockup, cfg_nft_mockup_cmd, +DEFUN(cfg_tunmap_mockup, cfg_tunmap_mockup_cmd, "mockup", "don't actually send rulesets to nftables, just return success\n") { @@ -228,7 +231,7 @@ return CMD_SUCCESS; } -DEFUN(cfg_nft_no_mockup, cfg_nft_no_mockup_cmd, +DEFUN(cfg_tunmap_no_mockup, cfg_tunmap_no_mockup_cmd, "no mockup", NO_STR "operate nftables rulesets normally\n") @@ -237,7 +240,7 @@ return CMD_SUCCESS; } -DEFUN(cfg_nft_table_name, cfg_nft_table_name_cmd, +DEFUN(cfg_tunmap_table_name, cfg_tunmap_table_name_cmd, "table-name 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" @@ -366,10 +369,11 @@ install_element(TUNEND_NODE, &cfg_tunend_dev_use_cmd); install_element(TUNEND_NODE, &cfg_tunend_dev_del_cmd); - install_node(&cfg_nft_node, config_write_nft); + install_node(&cfg_tunmap_node, config_write_tunmap); + install_element(CONFIG_NODE, &cfg_tunmap_cmd); install_element(CONFIG_NODE, &cfg_nft_cmd); - install_element(NFT_NODE, &cfg_nft_mockup_cmd); - install_element(NFT_NODE, &cfg_nft_no_mockup_cmd); - install_element(NFT_NODE, &cfg_nft_table_name_cmd); + 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); } diff --git a/tests/upf.vty b/tests/upf.vty index 427209c..5100b17 100644 --- a/tests/upf.vty +++ b/tests/upf.vty @@ -45,19 +45,28 @@ DEVNAME device name, e.g. 'apn0' OsmoUPF(config-tunend)# exit +OsmoUPF(config)# # ensure its old name "nft" enters the tunmap node OsmoUPF(config)# nft -OsmoUPF(config-nft)# list +OsmoUPF(config-tunmap)# list +... + mockup + no mockup + table-name TABLE_NAME +OsmoUPF(config-tunmap)# exit + +OsmoUPF(config)# tunmap +OsmoUPF(config-tunmap)# list ... mockup no mockup table-name TABLE_NAME -OsmoUPF(config-nft)# mockup? +OsmoUPF(config-tunmap)# mockup? mockup don't actually send rulesets to nftables, just return success -OsmoUPF(config-nft)# no ? +OsmoUPF(config-tunmap)# no ? mockup operate nftables rulesets normally -OsmoUPF(config-nft)# table-name? +OsmoUPF(config-tunmap)# table-name? 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-nft)# table-name ? +OsmoUPF(config-tunmap)# table-name ? TABLE_NAME nft inet table name null-- To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/30230 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-upf Gerrit-Branch: master Gerrit-Change-Id: Ia3c5224dd3b5f5c9437bbdec997d02176818cc97 Gerrit-Change-Number: 30230 Gerrit-PatchSet: 2 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-upf[master]: osmo-pfcp-tool VTY: rename 'endecaps' to 'tunend'
by neels 18 Nov '22

18 Nov '22
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/30233 ) Change subject: osmo-pfcp-tool VTY: rename 'endecaps' to 'tunend' ...................................................................... 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 --- M contrib/osmo-pfcp-tool-scripts/session_est_without_assoc.vty R contrib/osmo-pfcp-tool-scripts/tunend_plus_tunmap.vty R contrib/osmo-pfcp-tool-scripts/tunend_session_est.vty M src/osmo-pfcp-tool/pfcp_tool_vty.c 4 files changed, 18 insertions(+), 10 deletions(-) Approvals: Jenkins Builder: Verified diff --git a/contrib/osmo-pfcp-tool-scripts/session_est_without_assoc.vty b/contrib/osmo-pfcp-tool-scripts/session_est_without_assoc.vty index 2472292..4ca669a 100644 --- a/contrib/osmo-pfcp-tool-scripts/session_est_without_assoc.vty +++ b/contrib/osmo-pfcp-tool-scripts/session_est_without_assoc.vty @@ -1,4 +1,4 @@ timer pfcp x23 0 pfcp-peer 127.0.0.1 - session endecaps + session tunend tx session-est-req diff --git a/contrib/osmo-pfcp-tool-scripts/encaps_plus_tunmap.vty b/contrib/osmo-pfcp-tool-scripts/tunend_plus_tunmap.vty similarity index 97% rename from contrib/osmo-pfcp-tool-scripts/encaps_plus_tunmap.vty rename to contrib/osmo-pfcp-tool-scripts/tunend_plus_tunmap.vty index e84deee..1cfcd6d 100644 --- a/contrib/osmo-pfcp-tool-scripts/encaps_plus_tunmap.vty +++ b/contrib/osmo-pfcp-tool-scripts/tunend_plus_tunmap.vty @@ -11,7 +11,7 @@ pfcp-peer 127.0.0.11 tx assoc-setup-req sleep 1 - session endecaps 42 + session tunend 42 ue ip 192.168.100.42 gtp access ip 127.0.0.12 gtp access teid local 42 remote 142 diff --git a/contrib/osmo-pfcp-tool-scripts/endecaps_session_est.vty b/contrib/osmo-pfcp-tool-scripts/tunend_session_est.vty similarity index 87% rename from contrib/osmo-pfcp-tool-scripts/endecaps_session_est.vty rename to contrib/osmo-pfcp-tool-scripts/tunend_session_est.vty index 9a19d8c..3862c15 100644 --- a/contrib/osmo-pfcp-tool-scripts/endecaps_session_est.vty +++ b/contrib/osmo-pfcp-tool-scripts/tunend_session_est.vty @@ -2,7 +2,7 @@ pfcp-peer 127.0.0.1 tx assoc-setup-req sleep 1 - session endecaps + session tunend tx session-est-req forw sleep 5 tx session-del-req diff --git a/src/osmo-pfcp-tool/pfcp_tool_vty.c b/src/osmo-pfcp-tool/pfcp_tool_vty.c index 4b402a3..70bca18 100644 --- a/src/osmo-pfcp-tool/pfcp_tool_vty.c +++ b/src/osmo-pfcp-tool/pfcp_tool_vty.c @@ -250,12 +250,14 @@ 1, }; +#define SESSION_STR "Enter the 'session' node for the given SEID\n" +#define TUNEND_STR "Set up GTP tunnel encapsulation/decapsulation (default)\n" +#define TUNMAP_STR "Set up GTP tunnel mapping\n" +#define SEID_STR "local Session Endpoint ID\n" + DEFUN(session, session_cmd, - "session [(endecaps|tunmap)] [<0-18446744073709551615>]", - "Enter the 'session' node for the given SEID\n" - "Set up GTP tunnel encapsulation/decapsulation (default)\n" - "Set up GTP tunnel mapping\n" - "local Session Endpoint ID\n") + "session [(tunend|tunmap)] [<0-18446744073709551615>]", + SESSION_STR TUNEND_STR TUNMAP_STR SEID_STR) { struct pfcp_tool_peer *peer = vty->index; struct pfcp_tool_session *session; @@ -275,6 +277,11 @@ return CMD_SUCCESS; } +/* legacy compat: "tunend" was originally named "endecaps" */ +DEFUN_CMD_ELEMENT(session, session_endecaps_cmd, + "session (endecaps) [<0-18446744073709551615>]", + SESSION_STR TUNEND_STR SEID_STR, CMD_ATTR_HIDDEN, 0); + DEFUN(s_ue, s_ue_cmd, "ue ip A.B.C.D", "Setup the UE as it appears towards the Core network in plain IP traffic\n" @@ -332,7 +339,7 @@ return CMD_SUCCESS; } -int session_endecaps_tx_est_req(struct vty *vty, const char **argv, int argc) +int session_tunend_tx_est_req(struct vty *vty, const char **argv, int argc) { struct pfcp_tool_session *session = vty->index; struct pfcp_tool_peer *peer = session->peer; @@ -655,7 +662,7 @@ struct pfcp_tool_session *session = vty->index; switch (session->gtp_action) { case UP_GTP_U_ENDECAPS: - return session_endecaps_tx_est_req(vty, argv, argc); + return session_tunend_tx_est_req(vty, argv, argc); case UP_GTP_U_TUNMAP: return session_tunmap_tx_est_req(vty, argv, argc); default: @@ -776,6 +783,7 @@ install_element(PEER_NODE, &peer_retrans_req_cmd); install_element(PEER_NODE, &session_cmd); + install_element(PEER_NODE, &session_endecaps_cmd); install_node(&session_node, NULL); install_element(SESSION_NODE, &c_sleep_cmd); install_element(SESSION_NODE, &session_tx_est_req_cmd); null-- To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/30233 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-upf Gerrit-Branch: master Gerrit-Change-Id: I0b44429cd6762fe401a4dced22ae2a3fd9bbe93b Gerrit-Change-Number: 30233 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: merged
1 0
0 0
Change in osmo-upf[master]: tests/upf.vty: add some missing nodes to the test
by neels 18 Nov '22

18 Nov '22
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/30228 ) Change subject: tests/upf.vty: add some missing nodes to the test ...................................................................... tests/upf.vty: add some missing nodes to the test Change-Id: I93c49dce23efaf9c533619112fb7a8114e258fa0 --- M tests/upf.vty 1 file changed, 24 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/tests/upf.vty b/tests/upf.vty index d1cebe5..6d40841 100644 --- a/tests/upf.vty +++ b/tests/upf.vty @@ -16,10 +16,17 @@ OsmoUPF(config)# gtp OsmoUPF(config-gtp)# list ... + mockup + no mockup dev create DEVNAME [LISTEN_ADDR] dev use DEVNAME dev delete DEVNAME +OsmoUPF(config-gtp)# mockup? + mockup don't actually send commands to the GTP kernel module, just return success +OsmoUPF(config-gtp)# no ? + mockup operate GTP kernel module normally + OsmoUPF(config-gtp)# dev? dev Configure the GTP device to use for encaps/decaps. OsmoUPF(config-gtp)# dev ? @@ -33,3 +40,20 @@ OsmoUPF(config-gtp)# dev delete ? DEVNAME device name, e.g. 'apn0' OsmoUPF(config-gtp)# exit + +OsmoUPF(config)# nft +OsmoUPF(config-nft)# list +... + mockup + no mockup + table-name TABLE_NAME + +OsmoUPF(config-nft)# mockup? + mockup don't actually send rulesets to nftables, just return success +OsmoUPF(config-nft)# no ? + mockup operate nftables rulesets normally + +OsmoUPF(config-nft)# table-name? + 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-nft)# table-name ? + TABLE_NAME nft inet table name null-- To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/30228 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-upf Gerrit-Branch: master Gerrit-Change-Id: I93c49dce23efaf9c533619112fb7a8114e258fa0 Gerrit-Change-Number: 30228 Gerrit-PatchSet: 2 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-upf[master]: VTY: rename 'gtp' to 'tunend'
by neels 18 Nov '22

18 Nov '22
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/30229 ) Change subject: VTY: rename 'gtp' to 'tunend' ...................................................................... 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 --- M contrib/osmo-pfcp-tool-scripts/osmo-upf-11.cfg M contrib/osmo-pfcp-tool-scripts/osmo-upf-12.cfg M doc/examples/osmo-upf/osmo-upf-create-dev.cfg M doc/examples/osmo-upf/osmo-upf-mockup.cfg M include/osmocom/upf/upf.h M src/osmo-upf/up_gtp_action.c M src/osmo-upf/upf.c M src/osmo-upf/upf_gtp.c M src/osmo-upf/upf_vty.c M tests/upf.vty 10 files changed, 65 insertions(+), 57 deletions(-) Approvals: Jenkins Builder: Verified diff --git a/contrib/osmo-pfcp-tool-scripts/osmo-upf-11.cfg b/contrib/osmo-pfcp-tool-scripts/osmo-upf-11.cfg index 0184d46..2e5baa3 100644 --- a/contrib/osmo-pfcp-tool-scripts/osmo-upf-11.cfg +++ b/contrib/osmo-pfcp-tool-scripts/osmo-upf-11.cfg @@ -21,7 +21,7 @@ timer pfcp x24 5000 pfcp local-addr 127.0.0.11 -gtp +tunend dev create apn11 127.0.0.11 nft table-name osmo-upf-11 diff --git a/contrib/osmo-pfcp-tool-scripts/osmo-upf-12.cfg b/contrib/osmo-pfcp-tool-scripts/osmo-upf-12.cfg index 1fa620d..fcfd5be 100644 --- a/contrib/osmo-pfcp-tool-scripts/osmo-upf-12.cfg +++ b/contrib/osmo-pfcp-tool-scripts/osmo-upf-12.cfg @@ -21,7 +21,7 @@ timer pfcp x24 5000 pfcp local-addr 127.0.0.12 -gtp +tunend dev create apn12 127.0.0.12 nft table-name osmo-upf-12 diff --git a/doc/examples/osmo-upf/osmo-upf-create-dev.cfg b/doc/examples/osmo-upf/osmo-upf-create-dev.cfg index e4e25f9..e69f49c 100644 --- a/doc/examples/osmo-upf/osmo-upf-create-dev.cfg +++ b/doc/examples/osmo-upf/osmo-upf-create-dev.cfg @@ -11,5 +11,5 @@ timer pfcp x24 5000 pfcp local-addr 127.0.0.1 -gtp +tunend dev create apn23 diff --git a/doc/examples/osmo-upf/osmo-upf-mockup.cfg b/doc/examples/osmo-upf/osmo-upf-mockup.cfg index f1aafa9..36682a0 100644 --- a/doc/examples/osmo-upf/osmo-upf-mockup.cfg +++ b/doc/examples/osmo-upf/osmo-upf-mockup.cfg @@ -11,7 +11,7 @@ timer pfcp x24 5000 pfcp local-addr 127.0.0.1 -gtp +tunend mockup nft mockup diff --git a/include/osmocom/upf/upf.h b/include/osmocom/upf/upf.h index 1f8355d..1597e2c 100644 --- a/include/osmocom/upf/upf.h +++ b/include/osmocom/upf/upf.h @@ -44,7 +44,7 @@ uint16_t local_port; }; -struct gtp_vty_cfg_dev { +struct tunend_vty_cfg_dev { struct llist_head entry; /* If true, osmo-upf creates the GTP device on startup. If false, the GTP device was created by the user, and we @@ -60,8 +60,8 @@ char *local_addr; }; -struct gtp_vty_cfg { - /* list of struct gtp_vty_cfg_dev, GTP devices as in the config file. The actual GTP devices in use are in +struct tunend_vty_cfg { + /* list of struct tunend_vty_cfg_dev, GTP devices as in the config file. The actual GTP devices in use are in * g_upf->gtp.devs. */ struct llist_head devs; }; @@ -80,7 +80,7 @@ bool mockup; /* GTP devices as in osmo-upf.cfg */ - struct gtp_vty_cfg vty_cfg; + struct tunend_vty_cfg vty_cfg; /* GTP devices actually in use, list of struct upf_gtp_dev. */ struct llist_head devs; diff --git a/src/osmo-upf/up_gtp_action.c b/src/osmo-upf/up_gtp_action.c index 9b8d528..568df48 100644 --- a/src/osmo-upf/up_gtp_action.c +++ b/src/osmo-upf/up_gtp_action.c @@ -84,7 +84,7 @@ switch (a->kind) { case UP_GTP_U_ENDECAPS: if (g_upf->gtp.mockup) { - LOG_UP_GTP_ACTION(a, LOGL_NOTICE, "gtp/mockup active, skipping GTP action %s\n", + LOG_UP_GTP_ACTION(a, LOGL_NOTICE, "tunend/mockup active, skipping GTP action %s\n", enable ? "enable" : "disable"); return 0; } @@ -166,7 +166,7 @@ struct osmo_strbuf sb = { .buf = buf, .len = buflen }; switch (a->kind) { case UP_GTP_U_ENDECAPS: - OSMO_STRBUF_PRINTF(sb, "GTP:endecaps GTP-access:"); + OSMO_STRBUF_PRINTF(sb, "GTP:tunend GTP-access:"); OSMO_STRBUF_APPEND(sb, osmo_sockaddr_to_str_buf2, &a->endecaps.gtp_remote_addr); OSMO_STRBUF_PRINTF(sb, " TEID-r:0x%"PRIx32" TEID-l:0x%"PRIx32" IP-core:", a->endecaps.remote_teid, a->endecaps.local_teid); diff --git a/src/osmo-upf/upf.c b/src/osmo-upf/upf.c index db699c7..3b8bfeb 100644 --- a/src/osmo-upf/upf.c +++ b/src/osmo-upf/upf.c @@ -87,8 +87,8 @@ int upf_gtp_devs_open() { - struct gtp_vty_cfg *c = &g_upf->gtp.vty_cfg; - struct gtp_vty_cfg_dev *d; + struct tunend_vty_cfg *c = &g_upf->gtp.vty_cfg; + struct tunend_vty_cfg_dev *d; llist_for_each_entry(d, &c->devs, entry) { if (upf_gtp_dev_open(d->dev_name, d->create, d->local_addr, false, false)) diff --git a/src/osmo-upf/upf_gtp.c b/src/osmo-upf/upf_gtp.c index d75e8d7..880e587 100644 --- a/src/osmo-upf/upf_gtp.c +++ b/src/osmo-upf/upf_gtp.c @@ -173,7 +173,7 @@ struct upf_gtp_dev *dev; if (g_upf->gtp.mockup) { - LOGP(DGTP, LOGL_NOTICE, "gtp/mockup active: not opening GTP device '%s'\n", name); + LOGP(DGTP, LOGL_NOTICE, "tunend/mockup active: not opening GTP device '%s'\n", name); return 0; } diff --git a/src/osmo-upf/upf_vty.c b/src/osmo-upf/upf_vty.c index cfc65ea..c43b382 100644 --- a/src/osmo-upf/upf_vty.c +++ b/src/osmo-upf/upf_vty.c @@ -40,7 +40,7 @@ enum upf_vty_node { PFCP_NODE = _LAST_OSMOVTY_NODE + 1, - GTP_NODE, + TUNEND_NODE, NFT_NODE, }; @@ -51,7 +51,7 @@ }; #define pfcp_vty (g_upf->pfcp.vty_cfg) -#define gtp_vty (g_upf->gtp.vty_cfg) +#define tunend_vty (g_upf->gtp.vty_cfg) DEFUN(cfg_pfcp, cfg_pfcp_cmd, "pfcp", @@ -78,29 +78,32 @@ return CMD_SUCCESS; } -static struct cmd_node cfg_gtp_node = { - GTP_NODE, - "%s(config-gtp)# ", +static struct cmd_node cfg_tunend_node = { + TUNEND_NODE, + "%s(config-tunend)# ", 1, }; -DEFUN(cfg_gtp, cfg_gtp_cmd, - "gtp", - "Enter the 'gtp' node to configure Linux GTP kernel module usage\n") +#define TUNEND_NODE_STR "Enter the 'tunend' node to configure Linux GTP kernel module usage\n" + +DEFUN(cfg_tunend, cfg_tunend_cmd, "tunend", TUNEND_NODE_STR) { - vty->node = GTP_NODE; + vty->node = TUNEND_NODE; return CMD_SUCCESS; } -static int config_write_gtp(struct vty *vty) +/* legacy compat: "tunend" was originally named "gtp" */ +DEFUN_CMD_ELEMENT(cfg_tunend, cfg_gtp_cmd, "gtp", TUNEND_NODE_STR, CMD_ATTR_HIDDEN, 0); + +static int config_write_tunend(struct vty *vty) { - struct gtp_vty_cfg_dev *d; - vty_out(vty, "gtp%s", VTY_NEWLINE); + struct tunend_vty_cfg_dev *d; + vty_out(vty, "tunend%s", VTY_NEWLINE); if (g_upf->gtp.mockup) vty_out(vty, " mockup%s", VTY_NEWLINE); - llist_for_each_entry(d, &gtp_vty.devs, entry) { + llist_for_each_entry(d, &tunend_vty.devs, entry) { if (d->create) { vty_out(vty, " dev create %s", d->dev_name); if (d->local_addr) @@ -115,7 +118,7 @@ #define DEV_STR "Configure the GTP device to use for encaps/decaps.\n" -DEFUN(cfg_gtp_mockup, cfg_gtp_mockup_cmd, +DEFUN(cfg_tunend_mockup, cfg_tunend_mockup_cmd, "mockup", "don't actually send commands to the GTP kernel module, just return success\n") { @@ -123,7 +126,7 @@ return CMD_SUCCESS; } -DEFUN(cfg_gtp_no_mockup, cfg_gtp_no_mockup_cmd, +DEFUN(cfg_tunend_no_mockup, cfg_tunend_no_mockup_cmd, "no mockup", NO_STR "operate GTP kernel module normally\n") @@ -132,7 +135,7 @@ return CMD_SUCCESS; } -DEFUN(cfg_gtp_dev_create, cfg_gtp_dev_create_cmd, +DEFUN(cfg_tunend_dev_create, cfg_tunend_dev_create_cmd, "dev create DEVNAME [LISTEN_ADDR]", DEV_STR "Add GTP device, creating a new Linux kernel GTP device. Will listen on GTPv1 port " @@ -142,42 +145,42 @@ "device name, e.g. 'apn0'\n" "IPv4 or IPv6 address to listen on, omit for ANY\n") { - struct gtp_vty_cfg_dev *d = talloc_zero(g_upf, struct gtp_vty_cfg_dev); + struct tunend_vty_cfg_dev *d = talloc_zero(g_upf, struct tunend_vty_cfg_dev); d->create = true; d->dev_name = talloc_strdup(d, argv[0]); if (argc > 1) d->local_addr = talloc_strdup(d, argv[1]); - llist_add(&d->entry, &gtp_vty.devs); + llist_add(&d->entry, &tunend_vty.devs); vty_out(vty, "Added GTP device %s (create new)%s", d->dev_name, VTY_NEWLINE); return CMD_SUCCESS; } -DEFUN(cfg_gtp_dev_use, cfg_gtp_dev_use_cmd, +DEFUN(cfg_tunend_dev_use, cfg_tunend_dev_use_cmd, "dev use DEVNAME", DEV_STR "Add GTP device, using an existing Linux kernel GTP device, e.g. created by 'gtp-link'\n" "device name, e.g. 'apn0'\n") { - struct gtp_vty_cfg_dev *d = talloc_zero(g_upf, struct gtp_vty_cfg_dev); + struct tunend_vty_cfg_dev *d = talloc_zero(g_upf, struct tunend_vty_cfg_dev); d->create = false; d->dev_name = talloc_strdup(d, argv[0]); - llist_add(&d->entry, &gtp_vty.devs); + llist_add(&d->entry, &tunend_vty.devs); vty_out(vty, "Added GTP device %s (use existing)%s", d->dev_name, VTY_NEWLINE); return CMD_SUCCESS; } -DEFUN(cfg_gtp_dev_del, cfg_gtp_dev_del_cmd, +DEFUN(cfg_tunend_dev_del, cfg_tunend_dev_del_cmd, "dev delete DEVNAME", DEV_STR "Remove a GTP device from the configuration, and delete the Linux kernel GTP device if it was created here.\n" "device name, e.g. 'apn0'\n") { const char *dev_name = argv[0]; - struct gtp_vty_cfg_dev *d; + struct tunend_vty_cfg_dev *d; struct upf_gtp_dev *dev; /* remove from VTY cfg */ - llist_for_each_entry(d, &gtp_vty.devs, entry) { + llist_for_each_entry(d, &tunend_vty.devs, entry) { if (strcmp(d->dev_name, dev_name)) continue; llist_del(&d->entry); @@ -280,8 +283,8 @@ return CMD_SUCCESS; } -DEFUN(show_gtp, show_gtp_cmd, - "show gtp", +DEFUN(show_tunend, show_tunend_cmd, + "show tunend", SHOW_STR "Active GTP tunnels and forwardings\n") { @@ -345,7 +348,7 @@ OSMO_ASSERT(g_upf != NULL); install_element_ve(&show_pdr_cmd); - install_element_ve(&show_gtp_cmd); + install_element_ve(&show_tunend_cmd); install_element_ve(&show_session_cmd); install_node(&cfg_pfcp_node, config_write_pfcp); @@ -353,14 +356,15 @@ install_element(PFCP_NODE, &cfg_pfcp_local_addr_cmd); - install_node(&cfg_gtp_node, config_write_gtp); + install_node(&cfg_tunend_node, config_write_tunend); + install_element(CONFIG_NODE, &cfg_tunend_cmd); install_element(CONFIG_NODE, &cfg_gtp_cmd); - install_element(GTP_NODE, &cfg_gtp_mockup_cmd); - install_element(GTP_NODE, &cfg_gtp_no_mockup_cmd); - install_element(GTP_NODE, &cfg_gtp_dev_create_cmd); - install_element(GTP_NODE, &cfg_gtp_dev_use_cmd); - install_element(GTP_NODE, &cfg_gtp_dev_del_cmd); + install_element(TUNEND_NODE, &cfg_tunend_mockup_cmd); + install_element(TUNEND_NODE, &cfg_tunend_no_mockup_cmd); + install_element(TUNEND_NODE, &cfg_tunend_dev_create_cmd); + install_element(TUNEND_NODE, &cfg_tunend_dev_use_cmd); + install_element(TUNEND_NODE, &cfg_tunend_dev_del_cmd); install_node(&cfg_nft_node, config_write_nft); install_element(CONFIG_NODE, &cfg_nft_cmd); diff --git a/tests/upf.vty b/tests/upf.vty index 6d40841..427209c 100644 --- a/tests/upf.vty +++ b/tests/upf.vty @@ -13,8 +13,9 @@ IP_ADDR IP address OsmoUPF(config-pfcp)# exit +OsmoUPF(config)# # ensure its old name "gtp" enters the tunend node OsmoUPF(config)# gtp -OsmoUPF(config-gtp)# list +OsmoUPF(config-tunend)# list ... mockup no mockup @@ -22,24 +23,27 @@ dev use DEVNAME dev delete DEVNAME -OsmoUPF(config-gtp)# mockup? - mockup don't actually send commands to the GTP kernel module, just return success -OsmoUPF(config-gtp)# no ? - mockup operate GTP kernel module normally +OsmoUPF(config-tunend)# exit +OsmoUPF(config)# tunend +OsmoUPF(config-tunend)# list +... + dev create DEVNAME [LISTEN_ADDR] + dev use DEVNAME + dev delete DEVNAME -OsmoUPF(config-gtp)# dev? +OsmoUPF(config-tunend)# dev? dev Configure the GTP device to use for encaps/decaps. -OsmoUPF(config-gtp)# dev ? +OsmoUPF(config-tunend)# dev ? create Add GTP device, creating a new Linux kernel GTP device. Will listen on GTPv1 port 2152 and GTPv0 port 3386 on the specified interface, or on ANY if LISTEN_ADDR is omitted. use Add GTP device, using an existing Linux kernel GTP device, e.g. created by 'gtp-link' delete Remove a GTP device from the configuration, and delete the Linux kernel GTP device if it was created here. -OsmoUPF(config-gtp)# dev create ? +OsmoUPF(config-tunend)# dev create ? DEVNAME device name, e.g. 'apn0' -OsmoUPF(config-gtp)# dev create foo ? +OsmoUPF(config-tunend)# dev create foo ? [LISTEN_ADDR] IPv4 or IPv6 address to listen on, omit for ANY -OsmoUPF(config-gtp)# dev delete ? +OsmoUPF(config-tunend)# dev delete ? DEVNAME device name, e.g. 'apn0' -OsmoUPF(config-gtp)# exit +OsmoUPF(config-tunend)# exit OsmoUPF(config)# nft OsmoUPF(config-nft)# list null-- To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/30229 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-upf Gerrit-Branch: master Gerrit-Change-Id: I49ac7b1f8b5b74f586edfed1dfb29f9af55a521b Gerrit-Change-Number: 30229 Gerrit-PatchSet: 2 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-upf[master]: drop unused enum up_session_kind
by neels 18 Nov '22

18 Nov '22
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/30232 ) Change subject: drop unused enum up_session_kind ...................................................................... drop unused enum up_session_kind Change-Id: I10e17338485b11d6c03da209c70323f69f93fc2e --- M include/osmocom/upf/up_session.h 1 file changed, 0 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified diff --git a/include/osmocom/upf/up_session.h b/include/osmocom/upf/up_session.h index 5b514a7..e201954 100644 --- a/include/osmocom/upf/up_session.h +++ b/include/osmocom/upf/up_session.h @@ -41,12 +41,6 @@ UP_SESSION_EV_USE_COUNT_ZERO, }; -enum up_session_kind { - UP_SESSION_DROP, - UP_SESSION_GTP_U_ENDECAPS, - UP_SESSION_GTP_U_FORW, -}; - struct up_session { struct hlist_node node_by_up_seid; struct hlist_node node_by_cp_seid; null-- To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/30232 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-upf Gerrit-Branch: master Gerrit-Change-Id: I10e17338485b11d6c03da209c70323f69f93fc2e Gerrit-Change-Number: 30232 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • ...
  • 251
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.