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 osmocom-bb[master]: modem: Initial integration of libosmo-gprs-{llc,sndcp}
by osmith 26 Jan '23

26 Jan '23
Attention is currently required from: pespin, fixeria. osmith 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: (3 comments) File src/host/layer23/src/modem/app_modem.c: https://gerrit.osmocom.org/c/osmocom-bb/+/31007/comment/00747fcd_90d6ec12 PS5, Line 556: DLGLOBAL DLLC? https://gerrit.osmocom.org/c/osmocom-bb/+/31007/comment/646802cb_8c487c73 PS5, Line 561: DLGLOBAL DSNDCP? File src/host/layer23/src/modem/llc.c: https://gerrit.osmocom.org/c/osmocom-bb/+/31007/comment/2e1d0021_8168adeb PS5, Line 68: //TODO: free msg? intentionally keeping these? there are more TODOs below, but these below look like they were kept on purpose. -- 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-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Thu, 26 Jan 2023 08:43:31 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in libosmocore[master]: d/control: libosmocore-dev: depend on libmnl-dev
by osmith 26 Jan '23

26 Jan '23
osmith has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/libosmocore/+/31078 ) Change subject: d/control: libosmocore-dev: depend on libmnl-dev ...................................................................... d/control: libosmocore-dev: depend on libmnl-dev Let libosmocore-dev depend on libmnl-dev, as we build the debian package without --disable-libmnl and so libosmocore.pc lists libmnl in requires. This patch should fix the following error when trying to build any debien package depending on libosmocore-dev: Package 'libmnl', required by 'libosmocore', not found A similar change in the rpm spec is not be needed, as rpm adds depends from pc files automatically. Fixes: 4eb89afa ("configure --enable-libmnl: Add libmnl to libosmocore.pc.in Requires") Change-Id: I7fd578fcc22c0ea6ac04bdc26dc1741e4e26767c --- M debian/control 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/31078/2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31078 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I7fd578fcc22c0ea6ac04bdc26dc1741e4e26767c Gerrit-Change-Number: 31078 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
Change in libosmocore[master]: d/control: libosmocore-dev: depend on libmnl-dev
by osmith 26 Jan '23

26 Jan '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/31078 ) Change subject: d/control: libosmocore-dev: depend on libmnl-dev ...................................................................... d/control: libosmocore-dev: depend on libmnl-dev Let libosmocore-dev depend on libmnl-dev, as we build the debian package without --disable-libmnl and so libosmocore.pc lists libmnl in requires. This patch should fix the following error when trying to build any debien package depending on libosmocore-dev: Package 'libmnl', required by 'libosmocore', not found Fixes: 4eb89afa ("configure --enable-libmnl: Add libmnl to libosmocore.pc.in Requires") Change-Id: I7fd578fcc22c0ea6ac04bdc26dc1741e4e26767c --- M debian/control 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/31078/1 diff --git a/debian/control b/debian/control index 2b8504a..bbf9244 100644 --- a/debian/control +++ b/debian/control @@ -357,6 +357,7 @@ libtalloc-dev (>= 2.1.0), libsctp-dev, libusb-1.0-0-dev, + libmnl-dev, ${misc:Depends} Description: Development headers for Open Source MObile COMmunications CORE library The header files provided by this package may be used to develop -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31078 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I7fd578fcc22c0ea6ac04bdc26dc1741e4e26767c Gerrit-Change-Number: 31078 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
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
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/31076 ) Change subject: rlcmac: Introduce primitives for SAPs towards higher layers ...................................................................... Patch Set 4: (1 comment) File include/osmocom/gprs/rlcmac/rlcmac_prim.h: https://gerrit.osmocom.org/c/libosmo-gprs/+/31076/comment/ed6c933b_6d9213c9 PS3, Line 40: osmo_gprs_rlcmac_grr_prim > Please add a comment here stating that "any changes to this structure should be synchronized with li […] Done -- 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-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 25 Jan 2023 22:46:01 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> 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
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/31075 ) 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(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved fixeria: Looks good to me, but someone else must approve diff --git a/include/osmocom/gprs/rlcmac/Makefile.am b/include/osmocom/gprs/rlcmac/Makefile.am index ab67d13..0182bfd 100644 --- a/include/osmocom/gprs/rlcmac/Makefile.am +++ b/include/osmocom/gprs/rlcmac/Makefile.am @@ -1,4 +1,9 @@ +noinst_HEADERS = \ + rlcmac_private.h \ + $(NULL) + rlcmac_HEADERS = \ + rlcmac.h \ gprs_rlcmac.h \ $(NULL) diff --git a/include/osmocom/gprs/rlcmac/gprs_rlcmac.h b/include/osmocom/gprs/rlcmac/gprs_rlcmac.h index 2be01b2..a68267d 100644 --- a/include/osmocom/gprs/rlcmac/gprs_rlcmac.h +++ b/include/osmocom/gprs/rlcmac/gprs_rlcmac.h @@ -5433,5 +5433,3 @@ const uint8_t *data, size_t data_len); int osmo_gprs_rlcmac_decode_imm_ass_ro(IA_RestOctets_t *storage, const uint8_t *data, size_t data_len); - -void osmo_gprs_rlcmac_set_log_cat(int cat); diff --git a/include/osmocom/gprs/rlcmac/rlcmac.h b/include/osmocom/gprs/rlcmac/rlcmac.h new file mode 100644 index 0000000..0497643 --- /dev/null +++ b/include/osmocom/gprs/rlcmac/rlcmac.h @@ -0,0 +1,10 @@ +#pragma once + +/* Radio Link Control / Medium Access Control (RLCMAC) definitions from 3GPP TS 44.060 */ + +enum osmo_gprs_rlcmac_log_cat { + OSMO_GPRS_RLCMAC_LOGC_RLCMAC, + _OSMO_GPRS_RLCMAC_LOGC_MAX, +}; + +void osmo_gprs_rlcmac_set_log_cat(enum osmo_gprs_rlcmac_log_cat logc, int logc_num); diff --git a/include/osmocom/gprs/rlcmac/rlcmac_private.h b/include/osmocom/gprs/rlcmac/rlcmac_private.h new file mode 100644 index 0000000..17bc745 --- /dev/null +++ b/include/osmocom/gprs/rlcmac/rlcmac_private.h @@ -0,0 +1,10 @@ +#pragma once + +/* RLCMAC private header */ + +#include <osmocom/gprs/rlcmac/rlcmac.h> + +extern int g_rlcmac_log_cat[_OSMO_GPRS_RLCMAC_LOGC_MAX]; + +#define LOGRLCMAC(lvl, fmt, args...) LOGP(g_rlcmac_log_cat[OSMO_GPRS_RLCMAC_LOGC_RLCMAC], lvl, fmt, ## args) +#define LOGRLCMACC(lvl, fmt, args...) LOGPC(g_rlcmac_log_cat[OSMO_GPRS_RLCMAC_LOGC_RLCMAC], lvl, fmt, ## args) diff --git a/src/rlcmac/misc.c b/src/rlcmac/misc.c index 0aecbfd..4885bbf 100644 --- a/src/rlcmac/misc.c +++ b/src/rlcmac/misc.c @@ -15,11 +15,16 @@ * GNU General Public License for more details. */ +#include <osmocom/core/utils.h> #include <osmocom/core/logging.h> +#include <osmocom/gprs/rlcmac/rlcmac.h> -int g_log_cat = DLGLOBAL; +int g_rlcmac_log_cat[_OSMO_GPRS_RLCMAC_LOGC_MAX] = { + [0 ... _OSMO_GPRS_RLCMAC_LOGC_MAX - 1] = DLGLOBAL +}; -void osmo_gprs_rlcmac_set_log_cat(int cat) +void osmo_gprs_rlcmac_set_log_cat(enum osmo_gprs_rlcmac_log_cat logc, int logc_num) { - g_log_cat = cat; + OSMO_ASSERT(logc < _OSMO_GPRS_RLCMAC_LOGC_MAX); + g_rlcmac_log_cat[logc] = logc_num; } diff --git a/src/rlcmac/ts_24_008.c b/src/rlcmac/ts_24_008.c index 1d64499..6dece2a 100644 --- a/src/rlcmac/ts_24_008.c +++ b/src/rlcmac/ts_24_008.c @@ -26,8 +26,7 @@ #include <osmocom/csn1/csn1.h> #include <osmocom/gprs/rlcmac/gprs_rlcmac.h> - -extern int g_log_cat; +#include <osmocom/gprs/rlcmac/rlcmac_private.h> /*< MS Classmark 3 IE >*/ #if 0 @@ -364,7 +363,7 @@ LOGPC(DLCSN1, LOGL_INFO, "\n"); if (ret > 0) { - LOGP(g_log_cat, LOGL_NOTICE, "RAcap: Got %d remaining bits unhandled by decoder at the end of bitvec\n", ret); + LOGRLCMAC(LOGL_NOTICE, "RAcap: Got %d remaining bits unhandled by decoder at the end of bitvec\n", ret); ret = 0; } return ret; @@ -384,8 +383,8 @@ LOGPC(DLCSN1, LOGL_INFO, "\n"); if (ret > 0 || ret == CSN_ERROR_NEED_MORE_BITS_TO_UNPACK) { - LOGP(g_log_cat, LOGL_ERROR, "Failed to encode MS RA Capability IE: not enough bits " - "in the output buffer (rc=%d)\n", ret); + LOGRLCMAC(LOGL_ERROR, "Failed to encode MS RA Capability IE: not enough bits " + "in the output buffer (rc=%d)\n", ret); ret = CSN_ERROR_NEED_MORE_BITS_TO_UNPACK; } diff --git a/src/rlcmac/ts_44_018.c b/src/rlcmac/ts_44_018.c index 48ab5ea..c869ad8 100644 --- a/src/rlcmac/ts_44_018.c +++ b/src/rlcmac/ts_44_018.c @@ -26,8 +26,7 @@ #include <osmocom/csn1/csn1.h> #include <osmocom/gprs/rlcmac/gprs_rlcmac.h> - -extern int g_log_cat; +#include <osmocom/gprs/rlcmac/rlcmac_private.h> CSN_DESCR_EXTERN(GPRS_Mobile_Allocation_t); CSN_DESCR_EXTERN(PBCCH_Not_present_t); @@ -648,9 +647,8 @@ LOGPC(DLCSN1, LOGL_INFO, "\n"); if (ret > 0) { - LOGP(g_log_cat, LOGL_NOTICE, - "%s: %d remaining bits unhandled by decoder\n", - descr_name, ret); + LOGRLCMAC(LOGL_NOTICE, "%s: %d remaining bits unhandled by decoder\n", + descr_name, ret); ret = 0; } diff --git a/src/rlcmac/ts_44_060.c b/src/rlcmac/ts_44_060.c index fb2dd08..33514e9 100644 --- a/src/rlcmac/ts_44_060.c +++ b/src/rlcmac/ts_44_060.c @@ -30,8 +30,7 @@ #include <osmocom/csn1/csn1.h> #include <osmocom/gprs/rlcmac/gprs_rlcmac.h> - -extern int g_log_cat; +#include <osmocom/gprs/rlcmac/rlcmac_private.h> /* Payload type as defined in TS 44.060 / 10.4.7 */ #define PAYLOAD_TYPE_DATA 0 @@ -4476,12 +4475,12 @@ if (payload_type == PAYLOAD_TYPE_DATA) { - LOGP(g_log_cat, LOGL_NOTICE, "Payload Type: DATA (0), not implemented\n"); + LOGRLCMAC(LOGL_NOTICE, "Payload Type: DATA (0), not implemented\n"); return CSN_ERROR_GENERAL; } else if (payload_type == PAYLOAD_TYPE_RESERVED) { - LOGP(g_log_cat, LOGL_NOTICE, "Payload Type: RESERVED (3)\n"); + LOGRLCMAC(LOGL_NOTICE, "Payload Type: RESERVED (3)\n"); return CSN_ERROR_GENERAL; } @@ -4583,7 +4582,7 @@ LOGPC(DLCSN1, LOGL_INFO, "\n"); if (ret > 0) { - LOGP(g_log_cat, LOGL_NOTICE, "%s: Got %d remaining bits unhandled by decoder at the end of bitvec\n", msg_type_name, ret); + LOGRLCMAC(LOGL_NOTICE, "%s: Got %d remaining bits unhandled by decoder at the end of bitvec\n", msg_type_name, ret); ret = 0; } @@ -4608,12 +4607,12 @@ if (data->PAYLOAD_TYPE == PAYLOAD_TYPE_DATA) { - LOGP(g_log_cat, LOGL_NOTICE, "Payload Type: DATA (0), not implemented\n"); + LOGRLCMAC(LOGL_NOTICE, "Payload Type: DATA (0), not implemented\n"); return CSN_ERROR_GENERAL; } else if (data->PAYLOAD_TYPE == PAYLOAD_TYPE_RESERVED) { - LOGP(g_log_cat, LOGL_NOTICE, "Payload Type: RESERVED (3)\n"); + LOGRLCMAC(LOGL_NOTICE, "Payload Type: RESERVED (3)\n"); return CSN_ERROR_GENERAL; } /* We can decode the message */ @@ -4795,7 +4794,7 @@ LOGPC(DLCSN1, LOGL_INFO, "\n"); if (ret > 0) { - LOGP(g_log_cat, LOGL_NOTICE, "%s: Got %d remaining bits unhandled by decoder at the end of bitvec\n", msg_type_name, ret); + LOGRLCMAC(LOGL_NOTICE, "%s: Got %d remaining bits unhandled by decoder at the end of bitvec\n", msg_type_name, ret); ret = 0; } @@ -4906,8 +4905,8 @@ LOGPC(DLCSN1, LOGL_INFO, "\n"); if (ret > 0 || ret == CSN_ERROR_NEED_MORE_BITS_TO_UNPACK) { - LOGP(g_log_cat, LOGL_ERROR, "Failed to encode an Uplink block: not enough bits " - "in the output buffer (rc=%d)\n", ret); + LOGRLCMAC(LOGL_ERROR, "Failed to encode an Uplink block: not enough bits " + "in the output buffer (rc=%d)\n", ret); ret = CSN_ERROR_NEED_MORE_BITS_TO_UNPACK; } @@ -4927,12 +4926,12 @@ if (data->PAYLOAD_TYPE == PAYLOAD_TYPE_DATA) { - LOGP(g_log_cat, LOGL_NOTICE, "Payload Type: DATA (0), not implemented\n"); + LOGRLCMAC(LOGL_NOTICE, "Payload Type: DATA (0), not implemented\n"); return CSN_ERROR_GENERAL; } else if (data->PAYLOAD_TYPE == PAYLOAD_TYPE_RESERVED) { - LOGP(g_log_cat, LOGL_NOTICE, "Payload Type: RESERVED (3)\n"); + LOGRLCMAC(LOGL_NOTICE, "Payload Type: RESERVED (3)\n"); return CSN_ERROR_GENERAL; } /* We can encode the message */ @@ -5116,8 +5115,8 @@ LOGPC(DLCSN1, LOGL_INFO, "\n"); if (ret > 0 || ret == CSN_ERROR_NEED_MORE_BITS_TO_UNPACK) { - LOGP(g_log_cat, LOGL_ERROR, "Failed to encode a Downlink block: not enough bits " - "in the output buffer (rc=%d)\n", ret); + LOGRLCMAC(LOGL_ERROR, "Failed to encode a Downlink block: not enough bits " + "in the output buffer (rc=%d)\n", ret); ret = CSN_ERROR_NEED_MORE_BITS_TO_UNPACK; } @@ -5138,25 +5137,25 @@ data->CV = bitvec_read_field(vector, &readIndex, 4); data->SI = bitvec_read_field(vector, &readIndex, 1); data->R = bitvec_read_field(vector, &readIndex, 1); - LOGPC(g_log_cat, LOGL_NOTICE, "PAYLOAD_TYPE = %u ", (unsigned)(data->PAYLOAD_TYPE)); - LOGPC(g_log_cat, LOGL_NOTICE, "CV = %u ", (unsigned)(data->CV)); - LOGPC(g_log_cat, LOGL_NOTICE, "SI = %u ", (unsigned)(data->SI)); - LOGPC(g_log_cat, LOGL_NOTICE, "R = %u ", (unsigned)(data->R)); + LOGRLCMACC(LOGL_NOTICE, "PAYLOAD_TYPE = %u ", (unsigned)(data->PAYLOAD_TYPE)); + LOGRLCMACC(LOGL_NOTICE, "CV = %u ", (unsigned)(data->CV)); + LOGRLCMACC(LOGL_NOTICE, "SI = %u ", (unsigned)(data->SI)); + LOGRLCMACC(LOGL_NOTICE, "R = %u ", (unsigned)(data->R)); // Octet 1 data->spare = bitvec_read_field(vector, &readIndex, 1); data->PI = bitvec_read_field(vector, &readIndex, 1); data->TFI = bitvec_read_field(vector, &readIndex, 5); data->TI = bitvec_read_field(vector, &readIndex, 1); - LOGPC(g_log_cat, LOGL_NOTICE, "spare = %u ", (unsigned)(data->spare)); - LOGPC(g_log_cat, LOGL_NOTICE, "PI = %u ", (unsigned)(data->PI)); - LOGPC(g_log_cat, LOGL_NOTICE, "TFI = %u ", (unsigned)(data->TFI)); - LOGPC(g_log_cat, LOGL_NOTICE, "TI = %u ", (unsigned)(data->TI)); + LOGRLCMACC(LOGL_NOTICE, "spare = %u ", (unsigned)(data->spare)); + LOGRLCMACC(LOGL_NOTICE, "PI = %u ", (unsigned)(data->PI)); + LOGRLCMACC(LOGL_NOTICE, "TFI = %u ", (unsigned)(data->TFI)); + LOGRLCMACC(LOGL_NOTICE, "TI = %u ", (unsigned)(data->TI)); // Octet 2 data->BSN = bitvec_read_field(vector, &readIndex, 7); data->E_1 = bitvec_read_field(vector, &readIndex, 1); - LOGPC(g_log_cat, LOGL_NOTICE, "BSN = %u ", (unsigned)(data->BSN)); - LOGPC(g_log_cat, LOGL_NOTICE, "E_1 = %u ", (unsigned)(data->E_1)); + LOGRLCMACC(LOGL_NOTICE, "BSN = %u ", (unsigned)(data->BSN)); + LOGRLCMACC(LOGL_NOTICE, "E_1 = %u ", (unsigned)(data->E_1)); if (data->E_1 == 0) // Extension octet follows immediately @@ -5168,37 +5167,37 @@ data->LENGTH_INDICATOR[i] = bitvec_read_field(vector, &readIndex, 6); data->M[i] = bitvec_read_field(vector, &readIndex, 1); data->E[i] = bitvec_read_field(vector, &readIndex, 1); - LOGPC(g_log_cat, LOGL_NOTICE, "LENGTH_INDICATOR[%u] = %u ", i, (unsigned)(data->LENGTH_INDICATOR[i])); - LOGPC(g_log_cat, LOGL_NOTICE, "M[%u] = %u ", i, (unsigned)(data->M[i])); - LOGPC(g_log_cat, LOGL_NOTICE, "E[%u] = %u ", i, (unsigned)(data->E[i])); + LOGRLCMACC(LOGL_NOTICE, "LENGTH_INDICATOR[%u] = %u ", i, (unsigned)(data->LENGTH_INDICATOR[i])); + LOGRLCMACC(LOGL_NOTICE, "M[%u] = %u ", i, (unsigned)(data->M[i])); + LOGRLCMACC(LOGL_NOTICE, "E[%u] = %u ", i, (unsigned)(data->E[i])); i++; } while((data->M[i-1] == 1)&&(data->E[i-1] == 0)); } if (data->TI == 1) // TLLI field is present { data->TLLI = bitvec_read_field(vector, &readIndex, 32); - LOGPC(g_log_cat, LOGL_NOTICE, "TLLI = %08x ", data->TLLI); + LOGRLCMACC(LOGL_NOTICE, "TLLI = %08x ", data->TLLI); if (data->PI == 1) // PFI is present if TI field indicates presence of TLLI { data->PFI = bitvec_read_field(vector, &readIndex, 7); data->E_2 = bitvec_read_field(vector, &readIndex, 1); - LOGPC(g_log_cat, LOGL_NOTICE, "PFI = %u ", (unsigned)(data->PFI)); - LOGPC(g_log_cat, LOGL_NOTICE, "E_2 = %u ", (unsigned)(data->E_2)); + LOGRLCMACC(LOGL_NOTICE, "PFI = %u ", (unsigned)(data->PFI)); + LOGRLCMACC(LOGL_NOTICE, "E_2 = %u ", (unsigned)(data->E_2)); } } unsigned dataLen = 23 - readIndex/8; - LOGPC(g_log_cat, LOGL_NOTICE, "DATA[%u] = ", dataLen); + LOGRLCMACC(LOGL_NOTICE, "DATA[%u] = ", dataLen); OSMO_ASSERT(dataLen <= 20); for (i = 0; i < dataLen; i++) { data->RLC_DATA[i] = bitvec_read_field(vector, &readIndex, 8); - LOGPC(g_log_cat, LOGL_NOTICE, "%02x", (unsigned)(data->RLC_DATA[i])); + LOGRLCMACC(LOGL_NOTICE, "%02x", (unsigned)(data->RLC_DATA[i])); } - LOGPC(g_log_cat, LOGL_NOTICE, "\n"); + LOGRLCMACC(LOGL_NOTICE, "\n"); } else { - LOGP(g_log_cat, LOGL_NOTICE, "Payload Type: RESERVED (3)\n"); + LOGRLCMAC(LOGL_NOTICE, "Payload Type: RESERVED (3)\n"); return; } } @@ -5215,24 +5214,24 @@ bitvec_write_field(vector, &writeIndex, data->RRBP, 2); bitvec_write_field(vector, &writeIndex, data->SP, 1); bitvec_write_field(vector, &writeIndex, data->USF, 3); - LOGPC(g_log_cat, LOGL_NOTICE, "PAYLOAD_TYPE = %u ", (unsigned)(data->PAYLOAD_TYPE)); - LOGPC(g_log_cat, LOGL_NOTICE, "RRBP = %u ", (unsigned)(data->RRBP)); - LOGPC(g_log_cat, LOGL_NOTICE, "SP = %u ", (unsigned)(data->SP)); - LOGPC(g_log_cat, LOGL_NOTICE, "USF = %u ", (unsigned)(data->USF)); + LOGRLCMACC(LOGL_NOTICE, "PAYLOAD_TYPE = %u ", (unsigned)(data->PAYLOAD_TYPE)); + LOGRLCMACC(LOGL_NOTICE, "RRBP = %u ", (unsigned)(data->RRBP)); + LOGRLCMACC(LOGL_NOTICE, "SP = %u ", (unsigned)(data->SP)); + LOGRLCMACC(LOGL_NOTICE, "USF = %u ", (unsigned)(data->USF)); // Octet 1 bitvec_write_field(vector, &writeIndex, data->PR, 2); bitvec_write_field(vector, &writeIndex, data->TFI, 5); bitvec_write_field(vector, &writeIndex, data->FBI, 1); - LOGPC(g_log_cat, LOGL_NOTICE, "PR = %u ", (unsigned)(data->PR)); - LOGPC(g_log_cat, LOGL_NOTICE, "TFI = %u ", (unsigned)(data->TFI)); - LOGPC(g_log_cat, LOGL_NOTICE, "FBI = %u ", (unsigned)(data->FBI)); + LOGRLCMACC(LOGL_NOTICE, "PR = %u ", (unsigned)(data->PR)); + LOGRLCMACC(LOGL_NOTICE, "TFI = %u ", (unsigned)(data->TFI)); + LOGRLCMACC(LOGL_NOTICE, "FBI = %u ", (unsigned)(data->FBI)); // Octet 2 bitvec_write_field(vector, &writeIndex, data->BSN, 7); bitvec_write_field(vector, &writeIndex, data->E_1, 1); - LOGPC(g_log_cat, LOGL_NOTICE, "BSN = %u ", (unsigned)(data->BSN)); - LOGPC(g_log_cat, LOGL_NOTICE, "E_1 = %u ", (unsigned)(data->E_1)); + LOGRLCMACC(LOGL_NOTICE, "BSN = %u ", (unsigned)(data->BSN)); + LOGRLCMACC(LOGL_NOTICE, "E_1 = %u ", (unsigned)(data->E_1)); // Octet 3 (optional) if (data->E_1 == 0) @@ -5243,22 +5242,22 @@ bitvec_write_field(vector, &writeIndex, data->LENGTH_INDICATOR[i], 6); bitvec_write_field(vector, &writeIndex, data->M[i], 1); bitvec_write_field(vector, &writeIndex, data->E[i], 1); - LOGPC(g_log_cat, LOGL_NOTICE, "LENGTH_INDICATOR[%u] = %u ", i, (unsigned)(data->LENGTH_INDICATOR[i])); - LOGPC(g_log_cat, LOGL_NOTICE, "M[%u] = %u ", i, (unsigned)(data->M[i])); - LOGPC(g_log_cat, LOGL_NOTICE, "E[%u] = %u ", i, (unsigned)(data->E[i])); + LOGRLCMACC(LOGL_NOTICE, "LENGTH_INDICATOR[%u] = %u ", i, (unsigned)(data->LENGTH_INDICATOR[i])); + LOGRLCMACC(LOGL_NOTICE, "M[%u] = %u ", i, (unsigned)(data->M[i])); + LOGRLCMACC(LOGL_NOTICE, "E[%u] = %u ", i, (unsigned)(data->E[i])); i++; } while ((data->M[i-1] == 1) && (data->E[i-1] == 0)); } unsigned dataNumOctets = 23 - writeIndex/8; - LOGPC(g_log_cat, LOGL_NOTICE, "DATA[%u] = ", dataNumOctets); + LOGRLCMACC(LOGL_NOTICE, "DATA[%u] = ", dataNumOctets); OSMO_ASSERT(dataNumOctets <= 20); for (i = 0; i < dataNumOctets; i++) { bitvec_write_field(vector, &writeIndex, data->RLC_DATA[i], 8); - LOGPC(g_log_cat, LOGL_NOTICE, "%02x", (unsigned)(data->RLC_DATA[i])); + LOGRLCMACC(LOGL_NOTICE, "%02x", (unsigned)(data->RLC_DATA[i])); } - LOGPC(g_log_cat, LOGL_NOTICE, "\n"); + LOGRLCMACC(LOGL_NOTICE, "\n"); } } -- 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-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
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
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/31076 ) 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(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/include/osmocom/gprs/llc/llc_prim.h b/include/osmocom/gprs/llc/llc_prim.h index 378a4a6..1a317e1 100644 --- a/include/osmocom/gprs/llc/llc_prim.h +++ b/include/osmocom/gprs/llc/llc_prim.h @@ -197,6 +197,7 @@ }; /* Parameters for OSMO_GPRS_LLC_GRR_* prims */ +/* This is expected to stay ABI compatible with libosmo-gprs-rlcmac struct osmo_gprs_rlcmac_grr_prim */ struct osmo_gprs_llc_grr_prim { /* Common fields */ uint32_t tlli; diff --git a/include/osmocom/gprs/rlcmac/Makefile.am b/include/osmocom/gprs/rlcmac/Makefile.am index 0182bfd..db16d94 100644 --- a/include/osmocom/gprs/rlcmac/Makefile.am +++ b/include/osmocom/gprs/rlcmac/Makefile.am @@ -4,6 +4,7 @@ rlcmac_HEADERS = \ rlcmac.h \ + rlcmac_prim.h \ gprs_rlcmac.h \ $(NULL) diff --git a/include/osmocom/gprs/rlcmac/rlcmac.h b/include/osmocom/gprs/rlcmac/rlcmac.h index 0497643..2b5f208 100644 --- a/include/osmocom/gprs/rlcmac/rlcmac.h +++ b/include/osmocom/gprs/rlcmac/rlcmac.h @@ -2,6 +2,33 @@ /* Radio Link Control / Medium Access Control (RLCMAC) definitions from 3GPP TS 44.060 */ +#include <stdint.h> +#include <stddef.h> + +#include <osmocom/core/msgb.h> + +enum osmo_gprs_rlcmac_location { + OSMO_GPRS_RLCMAC_LOCATION_UNSET, + OSMO_GPRS_RLCMAC_LOCATION_MS, + OSMO_GPRS_RLCMAC_LOCATION_PCU, +}; + +/* Section TS 44.064 6.2.3 Service Access Point Identifier (SAPI) */ +enum osmo_gprs_rlcmac_llc_sapi { + OSMO_GPRS_RLCMAC_LLC_SAPI_GMM = 1, + OSMO_GPRS_RLCMAC_LLC_SAPI_TOM2 = 2, + OSMO_GPRS_RLCMAC_LLC_SAPI_SNDCP3 = 3, + OSMO_GPRS_RLCMAC_LLC_SAPI_SNDCP5 = 5, + OSMO_GPRS_RLCMAC_LLC_SAPI_SMS = 7, + OSMO_GPRS_RLCMAC_LLC_SAPI_TOM8 = 8, + OSMO_GPRS_RLCMAC_LLC_SAPI_SNDCP9 = 9, + OSMO_GPRS_RLCMAC_LLC_SAPI_SNDCP11 = 11, +}; + +extern const struct value_string osmo_gprs_rlcmac_llc_sapi_names[]; + +int osmo_gprs_rlcmac_init(enum osmo_gprs_rlcmac_location location); + enum osmo_gprs_rlcmac_log_cat { OSMO_GPRS_RLCMAC_LOGC_RLCMAC, _OSMO_GPRS_RLCMAC_LOGC_MAX, diff --git a/include/osmocom/gprs/rlcmac/rlcmac_prim.h b/include/osmocom/gprs/rlcmac/rlcmac_prim.h new file mode 100644 index 0000000..443dede --- /dev/null +++ b/include/osmocom/gprs/rlcmac/rlcmac_prim.h @@ -0,0 +1,115 @@ +#pragma once + +/* GPRS Radio Resource SAP as per: + * 3GPP TS 44.060 4.3 + * 3GPP TS 24.007 9.3 + * 3GPP TS 44.064 7.2.3 + */ + +#include <osmocom/core/prim.h> +#include <osmocom/core/utils.h> +#include <osmocom/gsm/gsm48.h> +#include <osmocom/gprs/rlcmac/rlcmac.h> + +/* TS 24.007 Section 9.3 */ +enum osmo_gprs_rlcmac_prim_sap { + OSMO_GPRS_RLCMAC_SAP_GRR, + OSMO_GPRS_RLCMAC_SAP_GMMRR, +}; + +extern const struct value_string osmo_gprs_rlcmac_prim_sap_names[]; +static inline const char *osmo_gprs_rlcmac_prim_sap_name(enum osmo_gprs_rlcmac_prim_sap val) +{ + return get_value_string(osmo_gprs_rlcmac_prim_sap_names, val); +} + +/* TS 24.007 Section 9.3.1 "Service primitives for GRR-SAP (GSM only)" + * TS 04.64 Section 7.2.3 "LLE - RLC/MAC primitives" (MS side) */ +enum osmo_gprs_rlcmac_grr_prim_type { + OSMO_GPRS_RLCMAC_GRR_DATA, /* Req/Ind: TLLI, LL-PDU, SAPI, Cause, QoS, Radio Prio */ + OSMO_GPRS_RLCMAC_GRR_UNITDATA, /* Req/Ind: TLLI, LL-PDU, SAPI, QoS, Radio Prio */ +}; + +extern const struct value_string osmo_gprs_rlcmac_grr_prim_type_names[]; +static inline const char *osmo_gprs_rlcmac_grr_prim_type_name(enum osmo_gprs_rlcmac_grr_prim_type val) +{ + return get_value_string(osmo_gprs_rlcmac_grr_prim_type_names, val); +} + +/* Parameters for OSMO_GPRS_RLCMAC_GRR_* prims */ +struct osmo_gprs_rlcmac_grr_prim { + /* Common fields */ + uint32_t tlli; + uint8_t *ll_pdu; + size_t ll_pdu_len; + /* Specific fields */ + union { + /* OSMO_GPRS_RLCMAC_GRR_DATA | Req */ + struct { + uint8_t sapi; + uint8_t radio_prio; + uint8_t qos_params[3]; + } data_req; + /* OSMO_GPRS_RLCMAC_GRR_UNITDATA | Req */ + struct { + uint8_t sapi; + uint8_t radio_prio; + uint8_t qos_params[3]; + uint8_t cause; + } unitdata_req; + }; +}; + +/* TS 24.007 Section 9.3.2 "Service primitives for GMMRR-SAP (GSM only)" */ +enum osmo_gprs_rlcmac_gmmrr_prim_type { + OSMO_GPRS_RLCMAC_GMMRR_ASSIGN, /* Req: newTLLI */ + OSMO_GPRS_RLCMAC_GMMRR_PAGE, /* Ind: TLLI */ +}; + +extern const struct value_string osmo_gprs_rlcmac_gmmrr_prim_type_names[]; +static inline const char *osmo_gprs_rlcmac_gmmrr_prim_type_name(enum osmo_gprs_rlcmac_gmmrr_prim_type val) +{ + return get_value_string(osmo_gprs_rlcmac_gmmrr_prim_type_names, val); +} + +/* Parameters for OSMO_GPRS_RLCMAC_GRR_* prims */ +struct osmo_gprs_rlcmac_gmmrr_prim { + /* Common fields (none) */ + union { + /* OSMO_GPRS_RLCMAC_GMMRR_ASSIGN | Req */ + struct { + uint32_t new_tlli; + } assign_req; + /* OSMO_GPRS_RLCMAC_GMMRR_PAGE | Ind */ + struct { + uint32_t tlli; + } page_ind; + }; +}; + +struct osmo_gprs_rlcmac_prim { + struct osmo_prim_hdr oph; + union { + struct osmo_gprs_rlcmac_grr_prim grr; + struct osmo_gprs_rlcmac_gmmrr_prim gmmrr; + }; +}; + +typedef int (*osmo_gprs_rlcmac_prim_up_cb)(struct osmo_gprs_rlcmac_prim *rlcmac_prim, void *up_user_data); +void osmo_gprs_rlcmac_prim_set_up_cb(osmo_gprs_rlcmac_prim_up_cb up_cb, void *up_user_data); + +typedef int (*osmo_gprs_rlcmac_prim_down_cb)(struct osmo_gprs_rlcmac_prim *rlcmac_prim, void *down_user_data); +void osmo_gprs_rlcmac_prim_set_down_cb(osmo_gprs_rlcmac_prim_down_cb down_cb, void *down_user_data); + +int osmo_gprs_rlcmac_prim_upper_down(struct osmo_gprs_rlcmac_prim *rlcmac_prim); +int osmo_gprs_rlcmac_prim_lower_up(struct osmo_gprs_rlcmac_prim *rlcmac_prim); + +const char *osmo_gprs_rlcmac_prim_name(const struct osmo_gprs_rlcmac_prim *rlcmac_prim); + +/* Alloc primitive for GRR SAP: */ +struct osmo_gprs_rlcmac_prim *osmo_gprs_rlcmac_prim_alloc_grr_unitdata_req( + uint32_t tlli, uint8_t *ll_pdu, size_t ll_pdu_len); + +/* Alloc primitive for GMMRR SAP: */ +struct osmo_gprs_rlcmac_prim *osmo_gprs_rlcmac_prim_alloc_gmmrr_asign_req( + uint32_t new_tlli); diff --git a/include/osmocom/gprs/rlcmac/rlcmac_private.h b/include/osmocom/gprs/rlcmac/rlcmac_private.h index 17bc745..fb3ec7a 100644 --- a/include/osmocom/gprs/rlcmac/rlcmac_private.h +++ b/include/osmocom/gprs/rlcmac/rlcmac_private.h @@ -2,9 +2,36 @@ /* RLCMAC private header */ +#include <stdint.h> +#include <stddef.h> + +#include <osmocom/core/msgb.h> + +#include <osmocom/gprs/rlcmac/rlcmac_prim.h> #include <osmocom/gprs/rlcmac/rlcmac.h> extern int g_rlcmac_log_cat[_OSMO_GPRS_RLCMAC_LOGC_MAX]; #define LOGRLCMAC(lvl, fmt, args...) LOGP(g_rlcmac_log_cat[OSMO_GPRS_RLCMAC_LOGC_RLCMAC], lvl, fmt, ## args) #define LOGRLCMACC(lvl, fmt, args...) LOGPC(g_rlcmac_log_cat[OSMO_GPRS_RLCMAC_LOGC_RLCMAC], lvl, fmt, ## args) + +#define msgb_rlcmac_prim(msg) ((struct osmo_gprs_rlcmac_prim *)(msg)->l1h) + +struct gprs_rlcmac_ctx { + enum osmo_gprs_rlcmac_location location; + osmo_gprs_rlcmac_prim_up_cb rlcmac_up_cb; + void *rlcmac_up_cb_user_data; + + osmo_gprs_rlcmac_prim_down_cb rlcmac_down_cb; + void *rlcmac_down_cb_user_data; +}; + +extern struct gprs_rlcmac_ctx *g_ctx; + +/* rlcmac_prim.c */ +int gprs_rlcmac_prim_call_up_cb(struct osmo_gprs_rlcmac_prim *rlcmac_prim); +int gprs_rlcmac_prim_call_down_cb(struct osmo_gprs_rlcmac_prim *rlcmac_prim); + +struct osmo_gprs_rlcmac_prim *gprs_rlcmac_prim_alloc_grr_unitdata_ind( + uint32_t tlli, uint8_t *ll_pdu, size_t ll_pdu_len); +struct osmo_gprs_rlcmac_prim *gprs_rlcmac_prim_alloc_gmmrr_page_ind(uint32_t tlli); diff --git a/src/rlcmac/Makefile.am b/src/rlcmac/Makefile.am index 8aa8dc2..2e82e25 100644 --- a/src/rlcmac/Makefile.am +++ b/src/rlcmac/Makefile.am @@ -22,9 +22,12 @@ $(NULL) libosmo_gprs_rlcmac_la_SOURCES = \ + rlcmac.c \ + rlcmac_prim.c \ ts_24_008.c \ ts_44_018.c \ ts_44_060.c \ + ts_44_064.c \ misc.c \ $(NULL) diff --git a/src/rlcmac/rlcmac.c b/src/rlcmac/rlcmac.c new file mode 100644 index 0000000..faf3489 --- /dev/null +++ b/src/rlcmac/rlcmac.c @@ -0,0 +1,39 @@ +/* GPRS RLCMAC as per 3GPP TS 44.060 */ +/* + * (C) 2023 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <osmocom/gprs/rlcmac/rlcmac.h> +#include <osmocom/gprs/rlcmac/rlcmac_prim.h> +#include <osmocom/gprs/rlcmac/rlcmac_private.h> + +struct gprs_rlcmac_ctx *g_ctx; + +int osmo_gprs_rlcmac_init(enum osmo_gprs_rlcmac_location location) +{ + OSMO_ASSERT(location == OSMO_GPRS_RLCMAC_LOCATION_MS || location == OSMO_GPRS_RLCMAC_LOCATION_PCU) + + if (g_ctx) + talloc_free(g_ctx); + + g_ctx = talloc_zero(NULL, struct gprs_rlcmac_ctx); + g_ctx->location = location; + + return 0; +} diff --git a/src/rlcmac/rlcmac_prim.c b/src/rlcmac/rlcmac_prim.c new file mode 100644 index 0000000..1d5dcc9 --- /dev/null +++ b/src/rlcmac/rlcmac_prim.c @@ -0,0 +1,329 @@ +/* GPRS Radio Resource SAP as per: + * 3GPP TS 44.060 4.3 + * 3GPP TS 24.007 9.3 + * 3GPP TS 44.064 7.2.3 + */ +/* + * (C) 2023 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <stdint.h> +#include <errno.h> + +#include <osmocom/core/msgb.h> +#include <osmocom/core/utils.h> +#include <osmocom/core/logging.h> +#include <osmocom/crypt/gprs_cipher.h> +#include <osmocom/gsm/gsm_utils.h> + +#include <osmocom/gprs/rlcmac/rlcmac.h> +#include <osmocom/gprs/rlcmac/rlcmac_prim.h> +#include <osmocom/gprs/rlcmac/rlcmac_private.h> + +#define RLCMAC_MSGB_HEADROOM 0 + +const struct value_string osmo_gprs_rlcmac_prim_sap_names[] = { + { OSMO_GPRS_RLCMAC_SAP_GRR, "GRR" }, + { OSMO_GPRS_RLCMAC_SAP_GMMRR, "GMMRR" }, + { 0, NULL } +}; + +const struct value_string osmo_gprs_rlcmac_grr_prim_type_names[] = { + { OSMO_GPRS_RLCMAC_GRR_DATA, "DATA" }, + { OSMO_GPRS_RLCMAC_GRR_UNITDATA, "UNITDATA" }, + { 0, NULL } +}; + +const struct value_string osmo_gprs_rlcmac_gmmrr_prim_type_names[] = { + { OSMO_GPRS_RLCMAC_GMMRR_ASSIGN, "ASSIGN" }, + { OSMO_GPRS_RLCMAC_GMMRR_PAGE, "PAGE" }, + { 0, NULL } +}; + +const char *osmo_gprs_rlcmac_prim_name(const struct osmo_gprs_rlcmac_prim *rlcmac_prim) +{ + static char name_buf[256]; + const char *sap = osmo_gprs_rlcmac_prim_sap_name(rlcmac_prim->oph.sap); + const char *op = get_value_string(osmo_prim_op_names, rlcmac_prim->oph.operation); + const char *type; + + switch (rlcmac_prim->oph.sap) { + case OSMO_GPRS_RLCMAC_SAP_GRR: + type = osmo_gprs_rlcmac_grr_prim_type_name(rlcmac_prim->oph.primitive); + break; + case OSMO_GPRS_RLCMAC_SAP_GMMRR: + type = osmo_gprs_rlcmac_gmmrr_prim_type_name(rlcmac_prim->oph.primitive); + break; + default: + type = "unsupported-rlcmac-sap"; + } + + snprintf(name_buf, sizeof(name_buf), "%s-%s.%s", sap, type, op); + return name_buf; +} + +static int rlcmac_up_cb_dummy(struct osmo_gprs_rlcmac_prim *rlcmac_prim, void *user_data) +{ + LOGRLCMAC(LOGL_INFO, "rlcmac_up_cb_dummy(%s)\n", osmo_gprs_rlcmac_prim_name(rlcmac_prim)); + return 0; +} + +static int rlcmac_down_cb_dummy(struct osmo_gprs_rlcmac_prim *rlcmac_prim, void *user_data) +{ + LOGRLCMAC(LOGL_INFO, "rlcmac_down_cb_dummy(%s)\n", osmo_gprs_rlcmac_prim_name(rlcmac_prim)); + return 0; +} + +/* Set callback used by LLC layer to push primitives to higher layers in protocol stack */ +void osmo_gprs_rlcmac_prim_set_up_cb(osmo_gprs_rlcmac_prim_up_cb up_cb, void *up_user_data) +{ + g_ctx->rlcmac_up_cb = up_cb; + g_ctx->rlcmac_up_cb_user_data = up_user_data; +} + +/* Set callback used by LLC layer to push primitives to lower layers in protocol stack */ +void osmo_gprs_rlcmac_prim_set_down_cb(osmo_gprs_rlcmac_prim_down_cb down_cb, void *down_user_data) +{ + g_ctx->rlcmac_down_cb = down_cb; + g_ctx->rlcmac_down_cb_user_data = down_user_data; +} + +/******************************** + * Primitive allocation: + ********************************/ + +/* allocate a msgb containing a struct osmo_gprs_rlcmac_prim + optional l3 data */ +static struct msgb *gprs_rlcmac_prim_msgb_alloc(unsigned int l3_len) +{ + const int headroom = RLCMAC_MSGB_HEADROOM; + const int size = headroom + sizeof(struct osmo_gprs_rlcmac_prim) + l3_len; + struct msgb *msg = msgb_alloc_headroom(size, headroom, "rlcmac_prim"); + + if (!msg) + return NULL; + + msg->l1h = msgb_put(msg, sizeof(struct osmo_gprs_rlcmac_prim)); + + return msg; +} + +static struct osmo_gprs_rlcmac_prim *gprs_rlcmac_prim_alloc(enum osmo_gprs_rlcmac_prim_sap sap, + unsigned int type, + enum osmo_prim_operation operation, + unsigned int l3_len) +{ + struct msgb *msg = gprs_rlcmac_prim_msgb_alloc(l3_len); + struct osmo_gprs_rlcmac_prim *rlcmac_prim = msgb_rlcmac_prim(msg); + + osmo_prim_init(&rlcmac_prim->oph, sap, type, operation, msg); + return rlcmac_prim; +} + +static inline +struct osmo_gprs_rlcmac_prim *rlcmac_prim_grr_alloc(enum osmo_gprs_rlcmac_grr_prim_type type, + enum osmo_prim_operation operation, + unsigned int l3_len) +{ + return gprs_rlcmac_prim_alloc(OSMO_GPRS_RLCMAC_SAP_GRR, type, operation, l3_len); +} + +static inline +struct osmo_gprs_rlcmac_prim *rlcmac_prim_gmmrr_alloc(enum osmo_gprs_rlcmac_gmmrr_prim_type type, + enum osmo_prim_operation operation, + unsigned int l3_len) +{ + return gprs_rlcmac_prim_alloc(OSMO_GPRS_RLCMAC_SAP_GMMRR, type, operation, l3_len); +} + +/* 3GPP TS 44.064 7.2.3.2 GRR-UNITDATA.ind (MS):*/ +struct osmo_gprs_rlcmac_prim *gprs_rlcmac_prim_alloc_grr_unitdata_ind( + uint32_t tlli, uint8_t *ll_pdu, + size_t ll_pdu_len) +{ + struct osmo_gprs_rlcmac_prim *rlcmac_prim; + rlcmac_prim = rlcmac_prim_grr_alloc(OSMO_GPRS_RLCMAC_GRR_UNITDATA, PRIM_OP_INDICATION, ll_pdu_len); + rlcmac_prim->grr.tlli = tlli; + rlcmac_prim->grr.ll_pdu = ll_pdu; + rlcmac_prim->grr.ll_pdu_len = ll_pdu_len; + return rlcmac_prim; +} + +/* 3GPP TS 44.064 7.2.3.2 GRR-UL-UNITDATA.req (MS):*/ +struct osmo_gprs_rlcmac_prim *osmo_gprs_rlcmac_prim_alloc_grr_unitdata_req( + uint32_t tlli, uint8_t *ll_pdu, size_t ll_pdu_len) +{ + struct osmo_gprs_rlcmac_prim *rlcmac_prim; + rlcmac_prim = rlcmac_prim_grr_alloc(OSMO_GPRS_RLCMAC_GRR_UNITDATA, PRIM_OP_REQUEST, ll_pdu_len); + rlcmac_prim->grr.tlli = tlli; + rlcmac_prim->grr.ll_pdu = ll_pdu; + rlcmac_prim->grr.ll_pdu_len = ll_pdu_len; + return rlcmac_prim; +} + +/* 3GPP TS 24.007 9.3.2.1 GMMRR-ASSIGN-REQ:*/ +struct osmo_gprs_rlcmac_prim *osmo_gprs_rlcmac_prim_alloc_gmmrr_assign_req(uint32_t new_tlli) +{ + struct osmo_gprs_rlcmac_prim *rlcmac_prim; + rlcmac_prim = rlcmac_prim_gmmrr_alloc(OSMO_GPRS_RLCMAC_GMMRR_ASSIGN, PRIM_OP_REQUEST, 0); + rlcmac_prim->gmmrr.assign_req.new_tlli = new_tlli; + return rlcmac_prim; +} + +/* 3GPP TS 24.007 9.3.2.2 GMMRR-PAGE-IND:*/ +struct osmo_gprs_rlcmac_prim *gprs_rlcmac_prim_alloc_gmmrr_page_ind(uint32_t tlli) +{ + struct osmo_gprs_rlcmac_prim *rlcmac_prim; + rlcmac_prim = rlcmac_prim_gmmrr_alloc(OSMO_GPRS_RLCMAC_GMMRR_PAGE, PRIM_OP_INDICATION, 0); + rlcmac_prim->gmmrr.page_ind.tlli = tlli; + return rlcmac_prim; +} + +int gprs_rlcmac_prim_handle_unsupported(struct osmo_gprs_rlcmac_prim *rlcmac_prim) +{ + LOGRLCMAC(LOGL_ERROR, "Unsupported rlcmac_prim! %s\n", osmo_gprs_rlcmac_prim_name(rlcmac_prim)); + msgb_free(rlcmac_prim->oph.msg); + return -ENOTSUP; +} + +/******************************** + * Handling from/to upper layers: + ********************************/ + +static int rlcmac_prim_handle_grr_data_req(struct osmo_gprs_rlcmac_prim *rlcmac_prim) +{ + int rc = gprs_rlcmac_prim_handle_unsupported(rlcmac_prim); + return rc; +} + +static int rlcmac_prim_handle_grr_unitdata_req(struct osmo_gprs_rlcmac_prim *rlcmac_prim) +{ + int rc = gprs_rlcmac_prim_handle_unsupported(rlcmac_prim); + return rc; +} + +int gprs_rlcmac_prim_call_up_cb(struct osmo_gprs_rlcmac_prim *rlcmac_prim) +{ + int rc; + if (g_ctx->rlcmac_up_cb) + rc = g_ctx->rlcmac_up_cb(rlcmac_prim, g_ctx->rlcmac_up_cb_user_data); + else + rc = rlcmac_up_cb_dummy(rlcmac_prim, g_ctx->rlcmac_up_cb_user_data); + /* Special return value '1' means: do not free */ + if (rc != 1) + msgb_free(rlcmac_prim->oph.msg); + return rc; +} + +static int gprs_rlcmac_prim_grr_upper_down(struct osmo_gprs_rlcmac_prim *rlcmac_prim) +{ + int rc; + + switch (OSMO_PRIM_HDR(&rlcmac_prim->oph)) { + case OSMO_PRIM(OSMO_GPRS_RLCMAC_GRR_DATA, PRIM_OP_REQUEST): + rc = rlcmac_prim_handle_grr_data_req(rlcmac_prim); + break; + case OSMO_PRIM(OSMO_GPRS_RLCMAC_GRR_UNITDATA, PRIM_OP_REQUEST): + rc = rlcmac_prim_handle_grr_unitdata_req(rlcmac_prim); + break; + default: + rc = -ENOTSUP; + } + return rc; +} + +static int rlcmac_prim_handle_gmmrr_assign_req(struct osmo_gprs_rlcmac_prim *rlcmac_prim) +{ + int rc = gprs_rlcmac_prim_handle_unsupported(rlcmac_prim); + return rc; +} + +static int gprs_rlcmac_prim_gmmrr_upper_down(struct osmo_gprs_rlcmac_prim *rlcmac_prim) +{ + int rc; + + switch (OSMO_PRIM_HDR(&rlcmac_prim->oph)) { + case OSMO_PRIM(OSMO_GPRS_RLCMAC_GMMRR_ASSIGN, PRIM_OP_REQUEST): + rc = rlcmac_prim_handle_gmmrr_assign_req(rlcmac_prim); + break; + default: + rc = -ENOTSUP; + } + return rc; +} + +/* RLC/MAC higher layers (RLCMAC) push GRR/GMMRR primitive down to RLC/MAC layer: */ +int osmo_gprs_rlcmac_prim_upper_down(struct osmo_gprs_rlcmac_prim *rlcmac_prim) +{ + int rc; + + LOGRLCMAC(LOGL_INFO, "Rx from upper layers: %s\n", osmo_gprs_rlcmac_prim_name(rlcmac_prim)); + + switch (rlcmac_prim->oph.sap) { + case OSMO_GPRS_RLCMAC_SAP_GRR: + rc = gprs_rlcmac_prim_grr_upper_down(rlcmac_prim); + break; + case OSMO_GPRS_RLCMAC_SAP_GMMRR: + rc = gprs_rlcmac_prim_gmmrr_upper_down(rlcmac_prim); + break; + default: + rc = gprs_rlcmac_prim_handle_unsupported(rlcmac_prim); + } + return rc; +} + +/******************************** + * Handling from/to lower layers: + ********************************/ + +int gprs_rlcmac_prim_call_down_cb(struct osmo_gprs_rlcmac_prim *rlcmac_prim) +{ + int rc; + if (g_ctx->rlcmac_down_cb) + rc = g_ctx->rlcmac_down_cb(rlcmac_prim, g_ctx->rlcmac_down_cb_user_data); + else + rc = rlcmac_down_cb_dummy(rlcmac_prim, g_ctx->rlcmac_down_cb_user_data); + /* Special return value '1' means: do not free */ + if (rc != 1) + msgb_free(rlcmac_prim->oph.msg); + return rc; +} + +int osmo_gprs_rlcmac_prim_lower_up(struct osmo_gprs_rlcmac_prim *rlcmac_prim) +{ + OSMO_ASSERT(g_ctx); + OSMO_ASSERT(rlcmac_prim); + struct msgb *msg = rlcmac_prim->oph.msg; + int rc; + + LOGRLCMAC(LOGL_INFO, "Rx from lower layers: %s\n", osmo_gprs_rlcmac_prim_name(rlcmac_prim)); + + switch (rlcmac_prim->oph.sap) { + // TODO + //case OSMO_GPRS_LLC_SAP_GRR: + // OSMO_ASSERT(g_ctx->location == OSMO_GPRS_LLC_LOCATION_MS); + // rc = gprs_rlcmac_prim_lower_up_grr(rlcmac_prim); + default: + rc = -EINVAL; + } + + /* Special return value '1' means: do not free */ + if (rc != 1) + msgb_free(msg); + return rc; +} diff --git a/src/rlcmac/ts_44_064.c b/src/rlcmac/ts_44_064.c new file mode 100644 index 0000000..5ad9af5 --- /dev/null +++ b/src/rlcmac/ts_44_064.c @@ -0,0 +1,35 @@ +/* GPRS RLC/MAC definitions from TS 44.064 (LLC) */ +/* + * (C) 2023 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <osmocom/core/utils.h> +#include <osmocom/gprs/rlcmac/rlcmac.h> + +const struct value_string osmo_gprs_rlcmac_llc_sapi_names[] = { + { OSMO_GPRS_RLCMAC_LLC_SAPI_GMM, "GMM" }, + { OSMO_GPRS_RLCMAC_LLC_SAPI_TOM2, "TOM2" }, + { OSMO_GPRS_RLCMAC_LLC_SAPI_SNDCP3, "SNDCP3" }, + { OSMO_GPRS_RLCMAC_LLC_SAPI_SNDCP5, "SNDCP5" }, + { OSMO_GPRS_RLCMAC_LLC_SAPI_SMS, "SMS" }, + { OSMO_GPRS_RLCMAC_LLC_SAPI_TOM8, "TOM8" }, + { OSMO_GPRS_RLCMAC_LLC_SAPI_SNDCP9, "SNDCP9" }, + { OSMO_GPRS_RLCMAC_LLC_SAPI_SNDCP11, "SNDCP11" }, + { 0, NULL } +}; -- 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-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
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
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/31076 ) Change subject: rlcmac: Introduce primitives for SAPs towards higher layers ...................................................................... Patch Set 4: Code-Review+2 (1 comment) Patchset: PS4: Combine votes after adding the suggested comment. -- 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-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 25 Jan 2023 22:43:24 +0000 Gerrit-HasComments: Yes 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 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/libosmo-gprs/+/31075 ) Change subject: rlcmac: Support extending log categories in the future ...................................................................... Patch Set 3: Code-Review+1 (4 comments) File src/rlcmac/ts_24_008.c: https://gerrit.osmocom.org/c/libosmo-gprs/+/31075/comment/a7417d22_c6d40808 PS2, Line 386: LOGRLCMAC > alignment Done File src/rlcmac/ts_44_018.c: https://gerrit.osmocom.org/c/libosmo-gprs/+/31075/comment/7686c446_c58ccf1e PS2, Line 650: LOGRLCMAC > alignment Done File src/rlcmac/ts_44_060.c: https://gerrit.osmocom.org/c/libosmo-gprs/+/31075/comment/2f7209b7_ceb3ead6 PS2, Line 4908: LOGRLCMAC > alignment Done https://gerrit.osmocom.org/c/libosmo-gprs/+/31075/comment/4fc4b8a4_d12920ab PS2, Line 5118: LOGRLCMAC > alignment Done -- 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-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 25 Jan 2023 22:43:11 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> 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
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/31075 ) Change subject: rlcmac: Support extending log categories in the future ...................................................................... Patch Set 3: Code-Review+2 (1 comment) Patchset: PS3: Combine votes after fixing indentation issues. -- 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-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 25 Jan 2023 22:42:57 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
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 submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31071 ) Change subject: netdev: Fix compilation building with --disable-libmnl ...................................................................... netdev: Fix compilation building with --disable-libmnl netdev.h doesn't expose its use of libmnl publicly. It could actually be implemented using other subsystems internally, such as ioctl() or other OS-dependent APIs. Hence, if --disable-libmnl is used, still make the API available but make it fail with -ENOTSUP on functionalities which are only implemented through libmnl so far. Change-Id: I62bdea075afb9e0cc2bbcec6dd3a930e8f7bbc40 --- M src/core/netdev.c 1 file changed, 31 insertions(+), 1 deletion(-) Approvals: daniel: Looks good to me, but someone else must approve 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 Jenkins Builder: Verified diff --git a/src/core/netdev.c b/src/core/netdev.c index c0097fe..28eafbd 100644 --- a/src/core/netdev.c +++ b/src/core/netdev.c @@ -94,10 +94,13 @@ #include <osmocom/core/linuxlist.h> #include <osmocom/core/logging.h> #include <osmocom/core/socket.h> -#include <osmocom/core/mnl.h> #include <osmocom/core/netns.h> #include <osmocom/core/netdev.h> +#if ENABLE_LIBMNL +#include <osmocom/core/mnl.h> +#endif + #define IFINDEX_UNUSED 0 #define LOGNETDEV(netdev, lvl, fmt, args ...) \ @@ -114,7 +117,9 @@ unsigned int refcount; /* Number of osmo_netdev currently registered on this netns */ const char *netns_name; /* default netns has empty string "" (never NULL!) */ int netns_fd; /* FD to the netns with name "netns_name" above */ +#if ENABLE_LIBMNL struct osmo_mnl *omnl; +#endif }; static struct netdev_netns_ctx *netdev_netns_ctx_alloc(void *ctx, const char *netns_name) @@ -141,10 +146,12 @@ llist_del(&netns_ctx->entry); +#if ENABLE_LIBMNL if (netns_ctx->omnl) { osmo_mnl_destroy(netns_ctx->omnl); netns_ctx->omnl = NULL; } +#endif if (netns_ctx->netns_fd != -1) { close(netns_ctx->netns_fd); @@ -153,7 +160,9 @@ talloc_free(netns_ctx); } +#if ENABLE_LIBMNL static int netdev_netns_ctx_mnl_cb(const struct nlmsghdr *nlh, void *data); +#endif static int netdev_netns_ctx_init(struct netdev_netns_ctx *netns_ctx) { @@ -179,8 +188,12 @@ } } +#if ENABLE_LIBMNL netns_ctx->omnl = osmo_mnl_init(NULL, NETLINK_ROUTE, RTMGRP_LINK, netdev_netns_ctx_mnl_cb, netns_ctx); rc = (netns_ctx->omnl ? 0 : -EFAULT); +#else + rc = 0; +#endif /* switch back to default namespace */ if (netns_ctx->netns_name[0] != '\0') { @@ -312,6 +325,7 @@ } \ } while (0) +#if ENABLE_LIBMNL /* validate the netlink attributes */ static int netdev_mnl_data_attr_cb(const struct nlattr *attr, void *data) { @@ -596,6 +610,7 @@ return 0; } +#endif /* if ENABLE_LIBMNL */ /*! Allocate a new netdev object. * \param[in] ctx talloc context to use as a parent when allocating the netdev object @@ -833,8 +848,13 @@ NETDEV_NETNS_ENTER(netdev, &switch_state, "ifupdown"); +#if ENABLE_LIBMNL rc = netdev_mnl_set_ifupdown(netdev->netns_ctx->omnl, netdev->ifindex, netdev->dev_name, ifupdown); +#else + LOGNETDEV(netdev, LOGL_ERROR, "%s: NOT SUPPORTED. Build libosmocore with --enable-libmnl.\n", __func__); + rc = -ENOTSUP; +#endif NETDEV_NETNS_EXIT(netdev, &switch_state, "ifupdown"); @@ -861,7 +881,12 @@ NETDEV_NETNS_ENTER(netdev, &switch_state, "Add address"); +#if ENABLE_LIBMNL rc = netdev_mnl_add_addr(netdev->netns_ctx->omnl, netdev->ifindex, addr, prefixlen); +#else + LOGNETDEV(netdev, LOGL_ERROR, "%s: NOT SUPPORTED. Build libosmocore with --enable-libmnl.\n", __func__); + rc = -ENOTSUP; +#endif NETDEV_NETNS_EXIT(netdev, &switch_state, "Add address"); @@ -893,7 +918,12 @@ NETDEV_NETNS_ENTER(netdev, &switch_state, "Add route"); +#if ENABLE_LIBMNL rc = netdev_mnl_add_route(netdev->netns_ctx->omnl, netdev->ifindex, dst_addr, dst_prefixlen, gw_addr); +#else + LOGNETDEV(netdev, LOGL_ERROR, "%s: NOT SUPPORTED. Build libosmocore with --enable-libmnl.\n", __func__); + rc = -ENOTSUP; +#endif NETDEV_NETNS_EXIT(netdev, &switch_state, "Add route"); -- 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-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • ...
  • 221
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.