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

January 2023

  • 1 participants
  • 2205 discussions
Change in libosmocore[master]: configure --enable-libmnl: Add libmnl to libosmocore.pc.in Requires
by pespin 25 Jan '23

25 Jan '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31072 ) Change subject: configure --enable-libmnl: Add libmnl to libosmocore.pc.in Requires ...................................................................... configure --enable-libmnl: Add libmnl to libosmocore.pc.in Requires Change-Id: I8ad8418ada95e79bb6079f34c6b57817c6f6ab11 --- M configure.ac M libosmocore.pc.in 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified msuraev: Looks good to me, but someone else must approve fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/configure.ac b/configure.ac index 1a87ec1..ee1c6f0 100644 --- a/configure.ac +++ b/configure.ac @@ -233,7 +233,7 @@ )], [mnl=$enableval], [mnl="yes"]) AS_IF([test "x$mnl" = "xyes"], [ - PKG_CHECK_MODULES(LIBMNL, libmnl) + PKG_CHECK_MODULES(LIBMNL, libmnl, [AC_SUBST(LIBMNL_PC, [libmnl])]) AC_DEFINE([ENABLE_LIBMNL], [1], [Enable netlink socket support via libmnl]) ]) AM_CONDITIONAL(ENABLE_LIBMNL, test "x$mnl" = "xyes") diff --git a/libosmocore.pc.in b/libosmocore.pc.in index d804b8e..6479221 100644 --- a/libosmocore.pc.in +++ b/libosmocore.pc.in @@ -6,7 +6,7 @@ Name: Osmocom Core Library Description: C Utility Library Version: @VERSION@ -Requires: talloc +Requires: talloc @LIBMNL_PC@ Requires.private: @LIBSCTP_PC@ Libs: -L${libdir} -losmocore Libs.private: @PTHREAD_LIBS@ @LIBSCTP_LIBS@ -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31072 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I8ad8418ada95e79bb6079f34c6b57817c6f6ab11 Gerrit-Change-Number: 31072 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in libosmocore[master]: netdev: Fix compilation building with --disable-libmnl
by pespin 25 Jan '23

25 Jan '23
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31071 ) Change subject: netdev: Fix compilation building with --disable-libmnl ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31071 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I62bdea075afb9e0cc2bbcec6dd3a930e8f7bbc40 Gerrit-Change-Number: 31071 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 25 Jan 2023 22:38:04 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in libosmocore[master]: configure --enable-libmnl: Add libmnl to libosmocore.pc.in Requires
by pespin 25 Jan '23

25 Jan '23
Attention is currently required from: laforge, daniel. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31072 ) Change subject: configure --enable-libmnl: Add libmnl to libosmocore.pc.in Requires ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31072 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I8ad8418ada95e79bb6079f34c6b57817c6f6ab11 Gerrit-Change-Number: 31072 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Wed, 25 Jan 2023 22:37:59 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in libosmo-gprs[master]: rlcmac: Support extending log categories in the future
by pespin 25 Jan '23

25 Jan '23
Attention is currently required from: pespin. Hello Jenkins Builder, laforge, fixeria, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-gprs/+/31075 to look at the new patch set (#3). Change subject: rlcmac: Support extending log categories in the future ...................................................................... rlcmac: Support extending log categories in the future An initial header structure and LOG defines is created in a similar way to those already existing for libosmo-gprs-llc and sndcp. Related: OS#5500 Change-Id: Ic9ba207cafeada1b174f1b085e0d1d9a38c66b0a --- M include/osmocom/gprs/rlcmac/Makefile.am M include/osmocom/gprs/rlcmac/gprs_rlcmac.h A include/osmocom/gprs/rlcmac/rlcmac.h A include/osmocom/gprs/rlcmac/rlcmac_private.h M src/rlcmac/misc.c M src/rlcmac/ts_24_008.c M src/rlcmac/ts_44_018.c M src/rlcmac/ts_44_060.c 8 files changed, 88 insertions(+), 64 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/75/31075/3 -- To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/31075 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-gprs Gerrit-Branch: master Gerrit-Change-Id: Ic9ba207cafeada1b174f1b085e0d1d9a38c66b0a Gerrit-Change-Number: 31075 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in libosmo-gprs[master]: rlcmac: Introduce primitives for SAPs towards higher layers
by pespin 25 Jan '23

25 Jan '23
Attention is currently required from: pespin. Hello Jenkins Builder, laforge, fixeria, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-gprs/+/31076 to look at the new patch set (#4). Change subject: rlcmac: Introduce primitives for SAPs towards higher layers ...................................................................... rlcmac: Introduce primitives for SAPs towards higher layers The GRR primitives and types are kept 1-to-1 ABI compatible to those at libosmo-gprs-llc so that they can be forwarded as pointers. Still, we want to keep the types duplicated in order to avoid having to depend one library on another, since the forwarding of one layer to the other is done by the app and can use whatever it wishes on either side. Related: OS#5500 Change-Id: I1870fa6a264612c5a669bfb832e6e8c0a892cb74 --- M include/osmocom/gprs/llc/llc_prim.h M include/osmocom/gprs/rlcmac/Makefile.am M include/osmocom/gprs/rlcmac/rlcmac.h A include/osmocom/gprs/rlcmac/rlcmac_prim.h M include/osmocom/gprs/rlcmac/rlcmac_private.h M src/rlcmac/Makefile.am A src/rlcmac/rlcmac.c A src/rlcmac/rlcmac_prim.c A src/rlcmac/ts_44_064.c 9 files changed, 577 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/76/31076/4 -- To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/31076 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-gprs Gerrit-Branch: master Gerrit-Change-Id: I1870fa6a264612c5a669bfb832e6e8c0a892cb74 Gerrit-Change-Number: 31076 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmocom-bb[master]: modem: Initial integration of libosmo-gprs-{llc,sndcp}
by pespin 25 Jan '23

25 Jan '23
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/31007 ) Change subject: modem: Initial integration of libosmo-gprs-{llc,sndcp} ...................................................................... Patch Set 5: This change is ready for review. -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/31007 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I820328009ccdd1f8112aeb163efa064ec1465d2a Gerrit-Change-Number: 31007 Gerrit-PatchSet: 5 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 25 Jan 2023 22:28:35 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in osmocom-bb[master]: Depend on libosmo-gprs-{llc,sndcp}
by pespin 25 Jan '23

25 Jan '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30999 ) Change subject: Depend on libosmo-gprs-{llc,sndcp} ...................................................................... Depend on libosmo-gprs-{llc,sndcp} These will be needed for the MS to speak SNDCP and LLC. Change-Id: I80811f73b798151257107bc94aedabe71fee0300 --- M src/host/layer23/configure.ac M src/host/layer23/src/common/Makefile.am M src/host/layer23/src/misc/Makefile.am M src/host/layer23/src/mobile/Makefile.am M src/host/layer23/src/modem/Makefile.am 5 files changed, 16 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified dexter: Looks good to me, approved laforge: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve diff --git a/src/host/layer23/configure.ac b/src/host/layer23/configure.ac index 81c0e65..459065c 100644 --- a/src/host/layer23/configure.ac +++ b/src/host/layer23/configure.ac @@ -47,6 +47,8 @@ PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm) PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec) PKG_CHECK_MODULES(LIBOSMOGPRSRLCMAC, libosmo-gprs-rlcmac) +PKG_CHECK_MODULES(LIBOSMOGPRSLLC, libosmo-gprs-llc) +PKG_CHECK_MODULES(LIBOSMOGPRSSNDCP, libosmo-gprs-sndcp) AC_CHECK_LIB(gps, gps_waiting, LIBGPS_CFLAGS=" -D_HAVE_GPSD" LIBGPS_LIBS=" -lgps ",,) AC_SUBST([LIBGPS_CFLAGS]) AC_SUBST([LIBGPS_LIBS]) diff --git a/src/host/layer23/src/common/Makefile.am b/src/host/layer23/src/common/Makefile.am index 94eeec8..60af3b8 100644 --- a/src/host/layer23/src/common/Makefile.am +++ b/src/host/layer23/src/common/Makefile.am @@ -8,6 +8,8 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOGPRSRLCMAC_CFLAGS) \ + $(LIBOSMOGPRSLLC_CFLAGS) \ + $(LIBOSMOGPRSSNDCP_CFLAGS) \ $(LIBGPS_CFLAGS) \ $(NULL) diff --git a/src/host/layer23/src/misc/Makefile.am b/src/host/layer23/src/misc/Makefile.am index 358be74..05995c3 100644 --- a/src/host/layer23/src/misc/Makefile.am +++ b/src/host/layer23/src/misc/Makefile.am @@ -9,6 +9,8 @@ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOGPRSRLCMAC_CFLAGS) \ + $(LIBOSMOGPRSLLC_CFLAGS) \ + $(LIBOSMOGPRSSNDCP_CFLAGS) \ $(LIBGPS_CFLAGS) \ $(NULL) @@ -19,6 +21,8 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOCODEC_LIBS) \ $(LIBOSMOGPRSRLCMAC_LIBS) \ + $(LIBOSMOGPRSLLC_LIBS) \ + $(LIBOSMOGPRSSNDCP_LIBS) \ $(LIBGPS_LIBS) \ $(NULL) diff --git a/src/host/layer23/src/mobile/Makefile.am b/src/host/layer23/src/mobile/Makefile.am index b87063b..55df667 100644 --- a/src/host/layer23/src/mobile/Makefile.am +++ b/src/host/layer23/src/mobile/Makefile.am @@ -9,6 +9,8 @@ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOGPRSRLCMAC_CFLAGS) \ + $(LIBOSMOGPRSLLC_CFLAGS) \ + $(LIBOSMOGPRSSNDCP_CFLAGS) \ $(LIBOSMOCODEC_CFLAGS) \ $(LIBOSMOGAPK_CFLAGS) \ $(LIBGPS_CFLAGS) \ @@ -42,6 +44,8 @@ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGPRSRLCMAC_LIBS) \ + $(LIBOSMOGPRSLLC_LIBS) \ + $(LIBOSMOGPRSSNDCP_LIBS) \ $(LIBOSMOCODEC_LIBS) \ $(LIBOSMOGAPK_LIBS) \ $(LIBGPS_LIBS) \ diff --git a/src/host/layer23/src/modem/Makefile.am b/src/host/layer23/src/modem/Makefile.am index 3f4c261..4f369ad 100644 --- a/src/host/layer23/src/modem/Makefile.am +++ b/src/host/layer23/src/modem/Makefile.am @@ -9,6 +9,8 @@ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOGPRSRLCMAC_CFLAGS) \ + $(LIBOSMOGPRSLLC_CFLAGS) \ + $(LIBOSMOGPRSSNDCP_CFLAGS) \ $(NULL) bin_PROGRAMS = modem @@ -24,4 +26,6 @@ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGPRSRLCMAC_LIBS) \ + $(LIBOSMOGPRSLLC_LIBS) \ + $(LIBOSMOGPRSSNDCP_LIBS) \ $(NULL) 2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30999 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I80811f73b798151257107bc94aedabe71fee0300 Gerrit-Change-Number: 30999 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmocom-bb[master]: layer23: Initial integration of tun device
by pespin 25 Jan '23

25 Jan '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30996 ) Change subject: layer23: Initial integration of tun device ...................................................................... layer23: Initial integration of tun device Use the new tundev API from libosmocore to create tun devices for each configured (and enbled) APN. No address nor routes are yet set on the tun devices because we still lack GMM/SNDCP/LLC/RLCMAC layers to negotiate them. A follow up patch will add some code to interact with the SNDCP layer. Depends: libosmocore.git Change-Id I3463271666df1e85746fb7b06ec45a17024b8c53 Change-Id: I86cac406843157aa2e51727cf8ccac9804d7961d --- M src/host/layer23/include/osmocom/bb/common/apn.h M src/host/layer23/include/osmocom/bb/common/l23_app.h M src/host/layer23/include/osmocom/bb/common/logging.h M src/host/layer23/src/common/apn.c M src/host/layer23/src/common/logging.c M src/host/layer23/src/mobile/app_mobile.c M src/host/layer23/src/modem/app_modem.c 7 files changed, 124 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved diff --git a/src/host/layer23/include/osmocom/bb/common/apn.h b/src/host/layer23/include/osmocom/bb/common/apn.h index 4a92a62..94784ef 100644 --- a/src/host/layer23/include/osmocom/bb/common/apn.h +++ b/src/host/layer23/include/osmocom/bb/common/apn.h @@ -19,6 +19,7 @@ #include <osmocom/core/linuxlist.h> #include <osmocom/core/select.h> +#include <osmocom/core/tun.h> struct osmocom_ms; @@ -48,9 +49,16 @@ /* transmit G-PDU sequence numbers (true) or not (false) */ bool tx_gpdu_seq; } cfg; + struct osmo_tundev *tun; }; struct osmobb_apn *apn_alloc(struct osmocom_ms *ms, const char *name); void apn_free(struct osmobb_apn *apn); int apn_start(struct osmobb_apn *apn); int apn_stop(struct osmobb_apn *apn); + +#define LOGPAPN(level, apn, fmt, args...) \ + LOGP(DTUN, level, "APN(%s): " fmt, (apn)->cfg.name, ## args) + +#define LOGTUN(level, tun, fmt, args...) \ + LOGP(DTUN, level, "TUN(%s): " fmt, osmo_tundev_get_name(tun), ## args) diff --git a/src/host/layer23/include/osmocom/bb/common/l23_app.h b/src/host/layer23/include/osmocom/bb/common/l23_app.h index 46c3f44..d442e7e 100644 --- a/src/host/layer23/include/osmocom/bb/common/l23_app.h +++ b/src/host/layer23/include/osmocom/bb/common/l23_app.h @@ -1,6 +1,8 @@ #ifndef _L23_APP_H #define _L23_APP_H +#include <osmocom/core/tun.h> + struct option; struct vty_app_info; @@ -37,6 +39,7 @@ int (*cfg_getopt_opt)(struct option **options); int (*cfg_handle_opt)(int c,const char *optarg); int (*vty_init)(void); + osmo_tundev_data_ind_cb_t tun_data_ind_cb; }; extern struct l23_app_info *l23_app_info(); diff --git a/src/host/layer23/include/osmocom/bb/common/logging.h b/src/host/layer23/include/osmocom/bb/common/logging.h index e968528..5259f35 100644 --- a/src/host/layer23/include/osmocom/bb/common/logging.h +++ b/src/host/layer23/include/osmocom/bb/common/logging.h @@ -26,6 +26,7 @@ DPRIM, DLUA, DGAPK, + DTUN, }; extern const struct log_info log_info; diff --git a/src/host/layer23/src/common/apn.c b/src/host/layer23/src/common/apn.c index f60053d..169e30e 100644 --- a/src/host/layer23/src/common/apn.c +++ b/src/host/layer23/src/common/apn.c @@ -18,13 +18,15 @@ #include <stdint.h> #include <errno.h> #include <string.h> -#include <arpa/inet.h> +#include <netinet/ip.h> +#include <netinet/ip6.h> #include <talloc.h> #include <osmocom/bb/common/logging.h> #include <osmocom/bb/common/apn.h> #include <osmocom/bb/common/ms.h> +#include <osmocom/bb/common/l23_app.h> struct osmobb_apn *apn_alloc(struct osmocom_ms *ms, const char *name) { @@ -38,6 +40,13 @@ apn->cfg.shutdown = true; apn->cfg.tx_gpdu_seq = true; + apn->tun = osmo_tundev_alloc(apn, name); + if (!apn->tun) { + talloc_free(apn); + return NULL; + } + osmo_tundev_set_priv_data(apn->tun, apn); + apn->ms = ms; llist_add_tail(&apn->list, &ms->gprs.apn_list); return apn; @@ -46,15 +55,53 @@ void apn_free(struct osmobb_apn *apn) { llist_del(&apn->list); + osmo_tundev_free(apn->tun); talloc_free(apn); } int apn_start(struct osmobb_apn *apn) { + struct l23_app_info *app_info = l23_app_info(); + int rc; + + if (apn->started) + return 0; + + LOGPAPN(LOGL_INFO, apn, "Opening TUN device %s\n", apn->cfg.dev_name); + /* Set TUN library callback. Must have been configured by the app: */ + OSMO_ASSERT(app_info && app_info->tun_data_ind_cb); + osmo_tundev_set_data_ind_cb(apn->tun, app_info->tun_data_ind_cb); + osmo_tundev_set_dev_name(apn->tun, apn->cfg.dev_name); + osmo_tundev_set_netns_name(apn->tun, apn->cfg.dev_netns_name); + + rc = osmo_tundev_open(apn->tun); + if (rc < 0) { + LOGPAPN(LOGL_ERROR, apn, "Failed to configure tun device\n"); + return -1; + } + + LOGPAPN(LOGL_INFO, apn, "Opened TUN device %s\n", osmo_tundev_get_dev_name(apn->tun)); + + /* TODO: set IP addresses on the tun device once we receive them from GGSN. See + osmo-ggsn.git's apn_start() */ + + LOGPAPN(LOGL_NOTICE, apn, "Successfully started\n"); + apn->started = true; return 0; } int apn_stop(struct osmobb_apn *apn) { + LOGPAPN(LOGL_NOTICE, apn, "Stopping\n"); + + /* shutdown whatever old state might be left */ + if (apn->tun) { + /* release tun device */ + LOGPAPN(LOGL_INFO, apn, "Closing TUN device %s\n", + osmo_tundev_get_dev_name(apn->tun)); + osmo_tundev_close(apn->tun); + } + + apn->started = false; return 0; } diff --git a/src/host/layer23/src/common/logging.c b/src/host/layer23/src/common/logging.c index 56f0322..34c171f 100644 --- a/src/host/layer23/src/common/logging.c +++ b/src/host/layer23/src/common/logging.c @@ -147,6 +147,12 @@ .color = "\033[0;36m", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DTUN] = { + .name = "DTUN", + .description = "Tunnel interface", + .color = "\033[0;37m", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, }; const struct log_info log_info = { diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c index 5bb1920..285672d 100644 --- a/src/host/layer23/src/mobile/app_mobile.c +++ b/src/host/layer23/src/mobile/app_mobile.c @@ -508,6 +508,11 @@ return 0; } +struct l23_app_info *l23_app_info(void) +{ + return NULL; /* TODO: implement mobile as a full l23_app. */ +} + void mobile_set_started(struct osmocom_ms *ms, bool state) { ms->started = state; diff --git a/src/host/layer23/src/modem/app_modem.c b/src/host/layer23/src/modem/app_modem.c index d7c9a29..6b8466d 100644 --- a/src/host/layer23/src/modem/app_modem.c +++ b/src/host/layer23/src/modem/app_modem.c @@ -23,9 +23,14 @@ #include <errno.h> #include <stdio.h> +#include <netinet/ip.h> +#include <netinet/ip6.h> + #include <osmocom/core/msgb.h> #include <osmocom/core/signal.h> #include <osmocom/core/application.h> +#include <osmocom/core/socket.h> +#include <osmocom/core/tun.h> #include <osmocom/vty/vty.h> #include <osmocom/gsm/rsl.h> @@ -42,6 +47,7 @@ #include <osmocom/bb/common/l23_app.h> #include <osmocom/bb/common/l1l2_interface.h> #include <osmocom/bb/common/sysinfo.h> +#include <osmocom/bb/common/apn.h> #include <osmocom/bb/modem/vty.h> #include <l1ctl_proto.h> @@ -60,6 +66,52 @@ } chan_req; } app_data; +/* Local network-originated IP packet, needs to be sent via SNDCP/LLC (GPRS) towards GSM network */ +static int modem_tun_data_ind_cb(struct osmo_tundev *tun, struct msgb *msg) +{ + struct osmobb_apn *apn = (struct osmobb_apn *)osmo_tundev_get_priv_data(tun); + struct osmo_sockaddr dst; + struct iphdr *iph = (struct iphdr *)msgb_data(msg); + struct ip6_hdr *ip6h = (struct ip6_hdr *)msgb_data(msg); + size_t pkt_len = msgb_length(msg); + uint8_t pref_offset; + char addrstr[INET6_ADDRSTRLEN]; + int rc = 0; + + switch (iph->version) { + case 4: + if (pkt_len < sizeof(*iph) || pkt_len < 4*iph->ihl) + return -1; + dst.u.sin.sin_family = AF_INET; + dst.u.sin.sin_addr.s_addr = iph->daddr; + break; + case 6: + /* Due to the fact that 3GPP requires an allocation of a + * /64 prefix to each MS, we must instruct + * ippool_getip() below to match only the leading /64 + * prefix, i.e. the first 8 bytes of the address. If the ll addr + * is used, then the match should be done on the trailing 64 + * bits. */ + dst.u.sin6.sin6_family = AF_INET6; + pref_offset = IN6_IS_ADDR_LINKLOCAL(&ip6h->ip6_dst) ? 8 : 0; + memcpy(&dst.u.sin6.sin6_addr, ((uint8_t *)&ip6h->ip6_dst) + pref_offset, 8); + break; + default: + LOGTUN(LOGL_NOTICE, tun, "non-IPv%u packet received\n", iph->version); + rc = -1; + goto free_ret; + } + + LOGPAPN(LOGL_DEBUG, apn, "system wants to transmit IPv%c pkt to %s (%zu bytes)\n", + iph->version == 4 ? '4' : '6', osmo_sockaddr_ntop(&dst.u.sa, addrstr), pkt_len); + + /* TODO: prepare & transmit SNDCP UNITDATA.req */ + +free_ret: + msgb_free(msg); + return rc; +} + /* Generate a 8-bit CHANNEL REQUEST message as per 3GPP TS 44.018, 9.1.8 */ static uint8_t gen_chan_req(bool single_block) { @@ -517,6 +569,7 @@ .cfg_supported = &l23_cfg_supported, .vty_info = &_modem_vty_info, .vty_init = modem_vty_init, + .tun_data_ind_cb = modem_tun_data_ind_cb, }; struct l23_app_info *l23_app_info(void) -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30996 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I86cac406843157aa2e51727cf8ccac9804d7961d Gerrit-Change-Number: 30996 Gerrit-PatchSet: 6 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmocom-bb[master]: layer23: Initial integration of tun device
by fixeria 25 Jan '23

25 Jan '23
Attention is currently required from: pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30996 ) Change subject: layer23: Initial integration of tun device ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30996 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I86cac406843157aa2e51727cf8ccac9804d7961d Gerrit-Change-Number: 30996 Gerrit-PatchSet: 6 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 25 Jan 2023 21:51:17 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmocom-bb[master]: layer23: Initial integration of tun device
by laforge 25 Jan '23

25 Jan '23
Attention is currently required from: pespin, fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30996 ) Change subject: layer23: Initial integration of tun device ...................................................................... Patch Set 6: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30996 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I86cac406843157aa2e51727cf8ccac9804d7961d Gerrit-Change-Number: 30996 Gerrit-PatchSet: 6 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Wed, 25 Jan 2023 21:45:14 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • ...
  • 221
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.