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: passive decoding of SI{3,4,13} and IA Rest Octets
by fixeria 05 Jan '23

05 Jan '23
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30870 ) Change subject: modem: passive decoding of SI{3,4,13} and IA Rest Octets ...................................................................... modem: passive decoding of SI{3,4,13} and IA Rest Octets Change-Id: I8566a3cdc9f818bed7e28ea4b1957dce735c298b Related: SYS#5500 --- M src/host/layer23/src/modem/Makefile.am A src/host/layer23/src/modem/app_modem.c D src/host/layer23/src/modem/modem_main.c 3 files changed, 324 insertions(+), 170 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/70/30870/1 diff --git a/src/host/layer23/src/modem/Makefile.am b/src/host/layer23/src/modem/Makefile.am index 4fb3c11..522456a 100644 --- a/src/host/layer23/src/modem/Makefile.am +++ b/src/host/layer23/src/modem/Makefile.am @@ -13,7 +13,11 @@ bin_PROGRAMS = modem -modem_SOURCES = modem_main.c +modem_SOURCES = \ + $(top_srcdir)/src/common/main.c \ + $(top_srcdir)/src/misc/rslms.c \ + app_modem.c \ + $(NULL) modem_LDADD = \ $(top_builddir)/src/common/liblayer23.a \ $(LIBOSMOCORE_LIBS) \ diff --git a/src/host/layer23/src/modem/app_modem.c b/src/host/layer23/src/modem/app_modem.c new file mode 100644 index 0000000..c19bfda --- /dev/null +++ b/src/host/layer23/src/modem/app_modem.c @@ -0,0 +1,319 @@ +/* modem app (gprs) */ + +/* (C) 2022 by sysmocom - s.m.f.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/lienses/>. + * + */ + +#include <stdbool.h> +#include <stdint.h> +#include <errno.h> +#include <stdio.h> + +#include <osmocom/core/msgb.h> +#include <osmocom/core/signal.h> +#include <osmocom/core/application.h> + +#include <osmocom/gsm/rsl.h> +#include <osmocom/gsm/tlv.h> +#include <osmocom/gsm/gsm48_ie.h> +#include <osmocom/gsm/gsm48.h> +#include <osmocom/gsm/protocol/gsm_04_08.h> +#include <osmocom/gprs/rlcmac/gprs_rlcmac.h> + +#include <osmocom/bb/common/osmocom_data.h> +#include <osmocom/bb/common/logging.h> +#include <osmocom/bb/common/l1ctl.h> +#include <osmocom/bb/common/l23_app.h> +#include <osmocom/bb/common/sysinfo.h> +#include <osmocom/bb/misc/rslms.h> +#include <osmocom/bb/misc/layer3.h> + +#include <l1ctl_proto.h> + +static struct { + enum ccch_mode ccch_mode; + struct gsm48_sysinfo si; +} app_data; + +static int handle_si1(struct osmocom_ms *ms, struct msgb *msg) +{ + int rc; + + if (msgb_l3len(msg) != GSM_MACBLOCK_LEN) + return -EINVAL; + if (!memcmp(&app_data.si.si1_msg[0], msgb_l3(msg), msgb_l3len(msg))) + return 0; /* this message is already handled */ + + rc = gsm48_decode_sysinfo1(&app_data.si, msgb_l3(msg), msgb_l3len(msg)); + if (rc != 0) { + LOGP(DRR, LOGL_ERROR, "Failed to decode SI1 message\n"); + return rc; + } + + return 0; +} + +static int handle_si3(struct osmocom_ms *ms, struct msgb *msg) +{ + int rc; + + if (msgb_l3len(msg) != GSM_MACBLOCK_LEN) + return -EINVAL; + if (!memcmp(&app_data.si.si3_msg[0], msgb_l3(msg), msgb_l3len(msg))) + return 0; /* this message is already handled */ + + rc = gsm48_decode_sysinfo3(&app_data.si, msgb_l3(msg), msgb_l3len(msg)); + if (rc != 0) { + LOGP(DRR, LOGL_ERROR, "Failed to decode SI3 message\n"); + return rc; + } + + if (app_data.ccch_mode == CCCH_MODE_NONE) { + if (app_data.si.ccch_conf == RSL_BCCH_CCCH_CONF_1_C) + app_data.ccch_mode = CCCH_MODE_COMBINED; + else + app_data.ccch_mode = CCCH_MODE_NON_COMBINED; + l1ctl_tx_ccch_mode_req(ms, app_data.ccch_mode); + } + + if (!app_data.si.gprs.supported) { + LOGP(DRR, LOGL_NOTICE, "SI3 Rest Octets IE contains no GPRS Indicator\n"); + return 0; + } + + LOGP(DRR, LOGL_NOTICE, "Found GPRS Indicator (RA Colour %u, SI13 on BCCH %s)\n", + app_data.si.gprs.ra_colour, app_data.si.gprs.si13_pos ? "Ext" : "Norm"); + + return 0; +} + +static int handle_si4(struct osmocom_ms *ms, struct msgb *msg) +{ + int rc; + + if (msgb_l3len(msg) != GSM_MACBLOCK_LEN) + return -EINVAL; + if (!memcmp(&app_data.si.si4_msg[0], msgb_l3(msg), msgb_l3len(msg))) + return 0; /* this message is already handled */ + + rc = gsm48_decode_sysinfo4(&app_data.si, msgb_l3(msg), msgb_l3len(msg)); + if (rc != 0) { + LOGP(DRR, LOGL_ERROR, "Failed to decode SI4 message\n"); + return rc; + } + + if (!app_data.si.gprs.supported) { + LOGP(DRR, LOGL_NOTICE, "SI4 Rest Octets IE contains no GPRS Indicator\n"); + return 0; + } + + LOGP(DRR, LOGL_NOTICE, "Found GPRS Indicator (RA Colour %u, SI13 on BCCH %s)\n", + app_data.si.gprs.ra_colour, app_data.si.gprs.si13_pos ? "Ext" : "Norm"); + + return 0; +} + +static int handle_si13(struct osmocom_ms *ms, struct msgb *msg) +{ + int rc; + + if (msgb_l3len(msg) != GSM_MACBLOCK_LEN) + return -EINVAL; + if (!memcmp(&app_data.si.si13_msg[0], msgb_l3(msg), msgb_l3len(msg))) + return 0; /* this message is already handled */ + + rc = gsm48_decode_sysinfo13(&app_data.si, msgb_l3(msg), msgb_l3len(msg)); + if (rc != 0) + return rc; + + return 0; +} + +int gsm48_rx_bcch(struct msgb *msg, struct osmocom_ms *ms) +{ + const struct gsm48_system_information_type_header *si_hdr = msgb_l3(msg); + const uint8_t si_type = si_hdr->system_information; + + LOGP(DRR, LOGL_INFO, "BCCH message (type=0x%02x): %s\n", + si_type, gsm48_rr_msg_name(si_type)); + + switch (si_type) { + case GSM48_MT_RR_SYSINFO_1: + return handle_si1(ms, msg); + case GSM48_MT_RR_SYSINFO_3: + return handle_si3(ms, msg); + case GSM48_MT_RR_SYSINFO_4: + return handle_si4(ms, msg); + case GSM48_MT_RR_SYSINFO_13: + return handle_si13(ms, msg); + default: + return 0; + }; +} + +static int gsm48_rx_imm_ass(struct msgb *msg, struct osmocom_ms *ms) +{ + const struct gsm48_imm_ass *ia = msgb_l3(msg); + uint8_t ch_type, ch_subch, ch_ts; + int rc; + + /* Discard CS channel assignment */ + if ((ia->page_mode >> 4) == 0) + return 0; + + if (rsl_dec_chan_nr(ia->chan_desc.chan_nr, &ch_type, &ch_subch, &ch_ts) != 0) { + LOGP(DRR, LOGL_ERROR, + "%s(): rsl_dec_chan_nr(chan_nr=0x%02x) failed\n", + __func__, ia->chan_desc.chan_nr); + return -EINVAL; + } + + if (!ia->chan_desc.h0.h) { + /* Non-hopping */ + uint16_t arfcn; + + arfcn = ia->chan_desc.h0.arfcn_low | (ia->chan_desc.h0.arfcn_high << 8); + + LOGP(DRR, LOGL_INFO, "GSM48 IMM ASS (ra=0x%02x, chan_nr=0x%02x, " + "ARFCN=%u, TS=%u, SS=%u, TSC=%u)\n", ia->req_ref.ra, + ia->chan_desc.chan_nr, arfcn, ch_ts, ch_subch, + ia->chan_desc.h0.tsc); + } else { + /* Hopping */ + uint8_t maio, hsn; + + hsn = ia->chan_desc.h1.hsn; + maio = ia->chan_desc.h1.maio_low | (ia->chan_desc.h1.maio_high << 2); + + LOGP(DRR, LOGL_INFO, "GSM48 IMM ASS (ra=0x%02x, chan_nr=0x%02x, " + "HSN=%u, MAIO=%u, TS=%u, SS=%u, TSC=%u)\n", ia->req_ref.ra, + ia->chan_desc.chan_nr, hsn, maio, ch_ts, ch_subch, + ia->chan_desc.h1.tsc); + } + + const uint8_t *data = msgb_l3(msg) + sizeof(*ia) + ia->mob_alloc_len; + size_t data_len = msgb_l3len(msg) - (sizeof(*ia) + ia->mob_alloc_len); + IA_RestOctets_t iaro; + + rc = osmo_gprs_rlcmac_decode_imm_ass_ro(&iaro, data, data_len); + if (rc != 0) { + LOGP(DRR, LOGL_ERROR, "Failed to decode IA Rest Octets IE\n"); + return rc; + } + + return 0; +} + +/* Dummy Paging Request 1 with "no identity" */ +static const uint8_t paging_fill[] = { + 0x15, 0x06, 0x21, 0x00, 0x01, 0xf0, 0x2b, + /* The rest part may be randomized */ +}; + +/* LAPDm func=UI fill frame (for the BTS side) */ +static const uint8_t lapdm_fill[] = { + 0x03, 0x03, 0x01, 0x2b, + /* The rest part may be randomized */ +}; + +/* TODO: share / generalize this code */ +static bool is_fill_frame(const struct msgb *msg) +{ + const uint8_t *l2 = msgb_l3(msg); + + if (!memcmp(l2, paging_fill, sizeof(paging_fill))) + return true; + if (!memcmp(l2, lapdm_fill, sizeof(lapdm_fill))) + return true; + + return false; +} + +int gsm48_rx_ccch(struct msgb *msg, struct osmocom_ms *ms) +{ + const struct gsm48_system_information_type_header *sih = msgb_l3(msg); + + /* Skip frames with wrong length */ + if (msgb_l3len(msg) != GSM_MACBLOCK_LEN) { + LOGP(DRR, LOGL_ERROR, "Rx CCCH message with odd length=%u: %s\n", + msgb_l3len(msg), msgb_hexdump_l3(msg)); + return -EINVAL; + } + + /* Skip dummy (fill) frames */ + if (is_fill_frame(msg)) + return 0; + + if (sih->rr_protocol_discriminator != GSM48_PDISC_RR) { + LOGP(DRR, LOGL_ERROR, "PCH pdisc (%s) != RR\n", + gsm48_pdisc_name(sih->rr_protocol_discriminator)); + } + + switch (sih->system_information) { + case GSM48_MT_RR_IMM_ASS: + return gsm48_rx_imm_ass(msg, ms); + default: + return 0; + } +} + +void layer3_app_reset(void) +{ + memset(&app_data, 0x00, sizeof(app_data)); +} + +static int signal_cb(unsigned int subsys, unsigned int signal, + void *handler_data, void *signal_data) +{ + struct osmocom_ms *ms; + + if (subsys != SS_L1CTL) + return 0; + + switch (signal) { + case S_L1CTL_RESET: + ms = signal_data; + layer3_app_reset(); + return l1ctl_tx_fbsb_req(ms, ms->test_arfcn, + L1CTL_FBSB_F_FB01SB, 100, 0, + CCCH_MODE_NONE, dbm2rxlev(-85)); + } + + return 0; +} + + +int l23_app_init(struct osmocom_ms *ms) +{ + log_set_category_filter(osmo_stderr_target, DLGLOBAL, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DLCSN1, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DRR, 1, LOGL_INFO); + + osmo_signal_register_handler(SS_L1CTL, &signal_cb, NULL); + l1ctl_tx_reset_req(ms, L1CTL_RES_T_FULL); + + return layer3_init(ms); +} + +static struct l23_app_info info = { + .copyright = "Copyright (C) 2022 by sysmocom - s.m.f.c. GmbH <info(a)sysmocom.de>\n", +}; + +struct l23_app_info *l23_app_info(void) +{ + return &info; +} diff --git a/src/host/layer23/src/modem/modem_main.c b/src/host/layer23/src/modem/modem_main.c deleted file mode 100644 index 438c1fe..0000000 --- a/src/host/layer23/src/modem/modem_main.c +++ /dev/null @@ -1,169 +0,0 @@ -/* modem app (gprs) */ - -/* (C) 2022 by sysmocom - s.m.f.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/lienses/>. - * - */ - -#include <osmocom/bb/common/osmocom_data.h> -#include <osmocom/bb/common/logging.h> -#include <osmocom/bb/modem/modem.h> - -#include <osmocom/core/talloc.h> -#include <osmocom/core/linuxlist.h> -#include <osmocom/core/signal.h> -#include <osmocom/core/application.h> - -#include <arpa/inet.h> - -#define _GNU_SOURCE -#include <getopt.h> - -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <time.h> -#include <unistd.h> - -void *tall_modem_ctx = NULL; -int daemonize = 0; - -static void print_usage(const char *app) -{ - printf("Usage: %s\n", app); -} - -static void print_help(void) -{ - printf(" Some help...\n"); - printf(" -h --help this text\n"); - printf(" -d --debug Change debug flags.\n"); - printf(" -D --daemonize Run as daemon\n"); -} - -static int handle_options(int argc, char **argv) -{ - while (1) { - int option_index = 0, c; - static struct option long_options[] = { - {"help", 0, 0, 'h'}, - {"debug", 1, 0, 'd'}, - {"daemonize", 0, 0, 'D'}, - {0, 0, 0, 0}, - }; - - c = getopt_long(argc, argv, "hi:u:c:v:d:Dm", - long_options, &option_index); - if (c == -1) - break; - - switch (c) { - case 'h': - print_usage(argv[0]); - print_help(); - exit(0); - break; - case 'd': - log_parse_category_mask(osmo_stderr_target, optarg); - break; - case 'D': - daemonize = 1; - break; - default: - /* Unknown parameter passed */ - return -EINVAL; - } - } - - return 0; -} - -void signal_handler(int signum) -{ - fprintf(stdout, "signal %u received\n", signum); - - switch (signum) { - case SIGINT: - case SIGTERM: - exit(0); - break; - case SIGABRT: - /* in case of abort, we want to obtain a talloc report and - * then run default SIGABRT handler, who will generate coredump - * and abort the process. abort() should do this for us after we - * return, but program wouldn't exit if an external SIGABRT is - * received. - */ - talloc_report_full(tall_modem_ctx, stderr); - signal(SIGABRT, SIG_DFL); - raise(SIGABRT); - break; - case SIGUSR1: - talloc_report(tall_modem_ctx, stderr); - break; - case SIGUSR2: - talloc_report_full(tall_modem_ctx, stderr); - break; - default: - break; - } -} - -int modem_start(void) -{ - printf("Nothing to be done yet\n"); - return 0; -} - -int main(int argc, char **argv) -{ - int rc; - - tall_modem_ctx = talloc_named_const(NULL, 1, "modem"); - msgb_talloc_ctx_init(tall_modem_ctx, 0); - osmo_signal_talloc_ctx_init(tall_modem_ctx); - - osmo_init_logging2(tall_modem_ctx, &log_info); - - rc = handle_options(argc, argv); - if (rc) { /* Abort in case of parsing errors */ - fprintf(stderr, "Error in command line options. Exiting.\n"); - return 1; - } - - signal(SIGINT, &signal_handler); - signal(SIGTERM, &signal_handler); - signal(SIGABRT, &signal_handler); - signal(SIGUSR1, &signal_handler); - signal(SIGUSR2, &signal_handler); - osmo_init_ignore_signals(); - - if (daemonize) { - printf("Running as daemon\n"); - rc = osmo_daemonize(); - if (rc) - fprintf(stderr, "Failed to run as daemon\n"); - } - - modem_start(); - - while (!osmo_select_shutdown_done()) { - osmo_select_main_ctx(0); - } - - talloc_report_full(tall_modem_ctx, stderr); - return 0; -} -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30870 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I8566a3cdc9f818bed7e28ea4b1957dce735c298b Gerrit-Change-Number: 30870 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-sgsn[master]: Fix -Werror=old-style-definition
by pespin 05 Jan '23

05 Jan '23
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30869 ) Change subject: Fix -Werror=old-style-definition ...................................................................... Fix -Werror=old-style-definition Change-Id: I119d4ba58d9c68df12b433b0cee924468a1473d8 --- M include/osmocom/sgsn/gprs_sgsn.h M src/gtphub/gtphub.c M src/sgsn/gprs_sgsn.c M tests/gprs/gprs_test.c M tests/gtphub/gtphub_test.c M tests/sgsn/sgsn_test.c 6 files changed, 16 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/69/30869/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30869 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I119d4ba58d9c68df12b433b0cee924468a1473d8 Gerrit-Change-Number: 30869 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-sgsn[master]: Fix -Werror=old-style-definition
by Jenkins Builder 05 Jan '23

05 Jan '23
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30869 ) Change subject: Fix -Werror=old-style-definition ...................................................................... Patch Set 1: (1 comment) File src/sgsn/gprs_sgsn.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-2435): https://gerrit.osmocom.org/c/osmo-sgsn/+/30869/comment/34d1337b_58e6348b PS1, Line 148: void sgsn_rate_ctr_init(void) { open brace '{' following function definitions go on the next line -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30869 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I119d4ba58d9c68df12b433b0cee924468a1473d8 Gerrit-Change-Number: 30869 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Thu, 05 Jan 2023 13:24:04 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in osmo-sgsn[master]: Fix -Werror=old-style-definition
by pespin 05 Jan '23

05 Jan '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30869 ) Change subject: Fix -Werror=old-style-definition ...................................................................... Fix -Werror=old-style-definition Change-Id: I119d4ba58d9c68df12b433b0cee924468a1473d8 --- M include/osmocom/sgsn/gprs_sgsn.h M src/gtphub/gtphub.c M src/sgsn/gprs_sgsn.c M tests/gprs/gprs_test.c M tests/gtphub/gtphub_test.c M tests/sgsn/sgsn_test.c 6 files changed, 15 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/69/30869/1 diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index 034aebc..e34a019 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -460,6 +460,6 @@ /* Called on subscriber data updates */ void sgsn_update_subscriber_data(struct sgsn_mm_ctx *mmctx); -void sgsn_rate_ctr_init(); +void sgsn_rate_ctr_init(void); #endif /* _GPRS_SGSN_H */ diff --git a/src/gtphub/gtphub.c b/src/gtphub/gtphub.c index 09d01fc..89ca676 100644 --- a/src/gtphub/gtphub.c +++ b/src/gtphub/gtphub.c @@ -971,7 +971,7 @@ static void gtphub_mapping_del_cb(struct expiring_item *expi); -static struct nr_mapping *gtphub_mapping_new() +static struct nr_mapping *gtphub_mapping_new(void) { struct nr_mapping *nrm; nrm = talloc_zero(osmo_gtphub_ctx, struct nr_mapping); @@ -995,7 +995,7 @@ char *pos = buf; int left = sizeof(buf); int l; - + struct gtphub_tunnel_endpoint *c, *u; c = &tun->endpoint[side_idx][GTPH_PLANE_CTRL]; u = &tun->endpoint[side_idx][GTPH_PLANE_USER]; @@ -1104,7 +1104,7 @@ /* rate counter index for hubs: [7; 10] */ #define CTR_IDX_HUB(s, p) CTR_IDX(s, p, 3, 2) -static struct gtphub_tunnel *gtphub_tunnel_new() +static struct gtphub_tunnel *gtphub_tunnel_new(void) { struct gtphub_tunnel *tun; tun = talloc_zero(osmo_gtphub_ctx, struct gtphub_tunnel); @@ -2283,7 +2283,7 @@ != 0) return -1; } - + /* Either to_peer was resolved from an existing tunnel, * or a PDP Ctx and thus a tunnel has just been created, * or the tunnel has been deleted due to this message. */ @@ -2690,7 +2690,7 @@ struct gtphub_peer *peer = gtphub_peer_new(hub, bind); a = gtphub_peer_add_addr(peer, addr); - + LOG(LOGL_DEBUG, "New peer address: %s %s\n", bind->label, gsn_addr_to_str(&a->addr)); diff --git a/src/sgsn/gprs_sgsn.c b/src/sgsn/gprs_sgsn.c index 8cfee69..76a5743 100644 --- a/src/sgsn/gprs_sgsn.c +++ b/src/sgsn/gprs_sgsn.c @@ -145,7 +145,7 @@ sgsn_ctr_description, }; -void sgsn_rate_ctr_init() { +void sgsn_rate_ctr_init(void) { sgsn->rate_ctrs = rate_ctr_group_alloc(tall_sgsn_ctx, &sgsn_ctrg_desc, 0); OSMO_ASSERT(sgsn->rate_ctrs); } diff --git a/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c index 89dac07..f239b70 100644 --- a/tests/gprs/gprs_test.c +++ b/tests/gprs/gprs_test.c @@ -24,7 +24,7 @@ return ret; } -static void test_8_4_2() +static void test_8_4_2(void) { printf("Testing gprs_llc_is_retransmit.\n"); diff --git a/tests/gtphub/gtphub_test.c b/tests/gtphub/gtphub_test.c index dab3977..13d2636 100644 --- a/tests/gtphub/gtphub_test.c +++ b/tests/gtphub/gtphub_test.c @@ -577,7 +577,7 @@ static struct gtphub _hub; static struct gtphub *hub = &_hub; -static int setup_test_hub() +static int setup_test_hub(void) { /* Not really needed, but to make 100% sure... */ ZERO_STRUCT(hub); @@ -613,7 +613,7 @@ return 1; } -static int clear_test_hub() +static int clear_test_hub(void) { /* expire all */ gtphub_gc(hub, now + (60 * GTPH_EXPIRE_SLOWLY_MINUTES) + 1); @@ -817,7 +817,7 @@ "87" /* 135: Quality of Service (QoS) Profile */ \ "0004" /* length */ \ "00" /* priority */ \ - "0b921f" /* QoS profile data */ + "0b921f" /* QoS profile data */ #define MSG_PDP_CTX_RSP(len, tei_h, seq, restart, tei_u, tei_c, gsn_c, gsn_u) \ "32" \ @@ -898,7 +898,7 @@ return 1; } -static int create_pdp_ctx() +static int create_pdp_ctx(void) { const char *gtp_req_from_sgsn = MSG_PDP_CTX_REQ("0068", diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index 44218de..18d3c19 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -58,7 +58,7 @@ struct msgb *last_msg = NULL; struct gprs_gb_parse_context last_dl_parse_ctx; -static void reset_last_msg() +static void reset_last_msg(void) { if (last_msg) msgb_free(last_msg); @@ -67,7 +67,7 @@ memset(&last_dl_parse_ctx, 0, sizeof(last_dl_parse_ctx)); } -static void cleanup_test() +static void cleanup_test(void) { reset_last_msg(); } @@ -284,7 +284,7 @@ } } -static void assert_no_subscrs() +static void assert_no_subscrs(void) { show_subscrs(stdout); fflush(stdout); -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30869 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I119d4ba58d9c68df12b433b0cee924468a1473d8 Gerrit-Change-Number: 30869 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-sgsn[master]: gprs_subscriber: Move API declarations to correct header
by pespin 05 Jan '23

05 Jan '23
Attention is currently required from: pespin. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30866 to look at the new patch set (#2). Change subject: gprs_subscriber: Move API declarations to correct header ...................................................................... gprs_subscriber: Move API declarations to correct header Change-Id: Iaa1032c38fa54ad57c472d9120cfbb34b2ae90e9 --- M include/osmocom/sgsn/gprs_sgsn.h M include/osmocom/sgsn/gprs_subscriber.h M src/sgsn/sgsn_main.c 3 files changed, 29 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/66/30866/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30866 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Iaa1032c38fa54ad57c472d9120cfbb34b2ae90e9 Gerrit-Change-Number: 30866 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-sgsn[master]: Introduce new header file sgsn/gtp.h
by pespin 05 Jan '23

05 Jan '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30868 ) Change subject: Introduce new header file sgsn/gtp.h ...................................................................... Introduce new header file sgsn/gtp.h It will be used to store all stuff relatd to libgtp use and GTP protocol, similar to what we already do for other protocols. Change-Id: I4aae35cd0ea401856cd822cb507d668350d07a89 --- M include/osmocom/sgsn/Makefile.am M include/osmocom/sgsn/gprs_sgsn.h A include/osmocom/sgsn/gtp.h M src/sgsn/sgsn_main.c 4 files changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/68/30868/1 diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am index dbbc0c6..fc4f597 100644 --- a/include/osmocom/sgsn/Makefile.am +++ b/include/osmocom/sgsn/Makefile.am @@ -21,6 +21,7 @@ gprs_sndcp_xid.h \ gprs_subscriber.h \ gprs_utils.h \ + gtp.h \ gtphub.h \ gtp_ggsn.h \ gtp_mme.h \ diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index a979e68..034aebc 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -460,9 +460,6 @@ /* Called on subscriber data updates */ void sgsn_update_subscriber_data(struct sgsn_mm_ctx *mmctx); -struct sgsn_instance; -int sgsn_gtp_init(struct sgsn_instance *sgi); - void sgsn_rate_ctr_init(); #endif /* _GPRS_SGSN_H */ diff --git a/include/osmocom/sgsn/gtp.h b/include/osmocom/sgsn/gtp.h new file mode 100644 index 0000000..85a50d3 --- /dev/null +++ b/include/osmocom/sgsn/gtp.h @@ -0,0 +1,5 @@ +#pragma once + +struct sgsn_instance; + +int sgsn_gtp_init(struct sgsn_instance *sgi); diff --git a/src/sgsn/sgsn_main.c b/src/sgsn/sgsn_main.c index 362e7aa..3ad0881 100644 --- a/src/sgsn/sgsn_main.c +++ b/src/sgsn/sgsn_main.c @@ -65,6 +65,7 @@ #include <osmocom/sgsn/gprs_ns.h> #include <osmocom/sgsn/gprs_bssgp.h> #include <osmocom/sgsn/gprs_subscriber.h> +#include <osmocom/sgsn/gtp.h> #include <osmocom/ctrl/control_if.h> #include <osmocom/ctrl/ports.h> -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30868 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I4aae35cd0ea401856cd822cb507d668350d07a89 Gerrit-Change-Number: 30868 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-pcu[master]: bts: use GSM_TDMA_FN_ macros and uint32_t in bts_rfn_to_fn
by fixeria 05 Jan '23

05 Jan '23
Attention is currently required from: pespin, dexter. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30864 ) Change subject: bts: use GSM_TDMA_FN_ macros and uint32_t in bts_rfn_to_fn ...................................................................... Patch Set 1: Code-Review-1 (1 comment) File src/bts.cpp: https://gerrit.osmocom.org/c/osmo-pcu/+/30864/comment/3195e275_bef7ba02 PS1, Line 36: #include <osmocom/gsm/gsm0502.h> You're including a C header file from a C++ file, so it should go to the 'extern "C"' block below. -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30864 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: Iedd493bb30dd1c342dec031883060c545432e740 Gerrit-Change-Number: 30864 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Thu, 05 Jan 2023 13:10:51 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-sgsn[master]: Move gprs_sndcp_vty_init() declaration to gprs_sndcp.h
by pespin 05 Jan '23

05 Jan '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30867 ) Change subject: Move gprs_sndcp_vty_init() declaration to gprs_sndcp.h ...................................................................... Move gprs_sndcp_vty_init() declaration to gprs_sndcp.h Change-Id: Iea9692e7ef9bd017d89ef654d2f2ae5b30cc4550 --- M include/osmocom/sgsn/gprs_sgsn.h M include/osmocom/sgsn/gprs_sndcp.h M src/sgsn/sgsn_main.c 3 files changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/67/30867/1 diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index d464f8b..a979e68 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -460,7 +460,6 @@ /* Called on subscriber data updates */ void sgsn_update_subscriber_data(struct sgsn_mm_ctx *mmctx); -int gprs_sndcp_vty_init(void); struct sgsn_instance; int sgsn_gtp_init(struct sgsn_instance *sgi); diff --git a/include/osmocom/sgsn/gprs_sndcp.h b/include/osmocom/sgsn/gprs_sndcp.h index ad192fe..caf675c 100644 --- a/include/osmocom/sgsn/gprs_sndcp.h +++ b/include/osmocom/sgsn/gprs_sndcp.h @@ -60,6 +60,8 @@ extern struct llist_head gprs_sndcp_entities; +int gprs_sndcp_vty_init(void); + /* Set of SNDCP-XID negotiation (See also: TS 144 065, * Section 6.8 XID parameter negotiation) */ int sndcp_sn_xid_req(struct gprs_llc_lle *lle, uint8_t nsapi); diff --git a/src/sgsn/sgsn_main.c b/src/sgsn/sgsn_main.c index 36ff78d..362e7aa 100644 --- a/src/sgsn/sgsn_main.c +++ b/src/sgsn/sgsn_main.c @@ -59,6 +59,7 @@ #include <osmocom/sgsn/vty.h> #include <osmocom/sgsn/sgsn.h> #include <osmocom/sgsn/gprs_llc.h> +#include <osmocom/sgsn/gprs_sndcp.h> #include <osmocom/sgsn/gprs_gmm.h> #include <osmocom/sgsn/gprs_ranap.h> #include <osmocom/sgsn/gprs_ns.h> -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30867 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Iea9692e7ef9bd017d89ef654d2f2ae5b30cc4550 Gerrit-Change-Number: 30867 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-sgsn[master]: gprs_subscriber: Move API declarations to correct header
by Jenkins Builder 05 Jan '23

05 Jan '23
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30866 ) Change subject: gprs_subscriber: Move API declarations to correct header ...................................................................... Patch Set 1: (1 comment) File include/osmocom/sgsn/gprs_subscriber.h: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-2429): https://gerrit.osmocom.org/c/osmo-sgsn/+/30866/comment/ad9b156e_eb24e36c PS1, Line 54: struct gprs_subscr *gprs_subscr_get_or_create_by_mmctx( struct sgsn_mm_ctx *mmctx); space prohibited after that open parenthesis '(' -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30866 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Iaa1032c38fa54ad57c472d9120cfbb34b2ae90e9 Gerrit-Change-Number: 30866 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Thu, 05 Jan 2023 13:05:29 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in osmo-sgsn[master]: gprs_subscriber: Move API declarations to correct header
by pespin 05 Jan '23

05 Jan '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30866 ) Change subject: gprs_subscriber: Move API declarations to correct header ...................................................................... gprs_subscriber: Move API declarations to correct header Change-Id: Iaa1032c38fa54ad57c472d9120cfbb34b2ae90e9 --- M include/osmocom/sgsn/gprs_sgsn.h M include/osmocom/sgsn/gprs_subscriber.h M src/sgsn/sgsn_main.c 3 files changed, 29 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/66/30866/1 diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index 47983e2..d464f8b 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -457,36 +457,6 @@ struct gsm_auth_tuple *sgsn_auth_get_tuple(struct sgsn_mm_ctx *mmctx, unsigned key_seq); -/* - * GPRS subscriber data - */ -#define GPRS_SUBSCRIBER_FIRST_CONTACT 0x00000001 -#define GPRS_SUBSCRIBER_UPDATE_AUTH_INFO_PENDING (1 << 16) -#define GPRS_SUBSCRIBER_UPDATE_LOCATION_PENDING (1 << 17) -#define GPRS_SUBSCRIBER_CANCELLED (1 << 18) -#define GPRS_SUBSCRIBER_ENABLE_PURGE (1 << 19) - -#define GPRS_SUBSCRIBER_UPDATE_PENDING_MASK ( \ - GPRS_SUBSCRIBER_UPDATE_LOCATION_PENDING | \ - GPRS_SUBSCRIBER_UPDATE_AUTH_INFO_PENDING \ -) - -int gprs_subscr_init(struct sgsn_instance *sgi); -int gprs_subscr_request_update_location(struct sgsn_mm_ctx *mmctx); -int gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, - const uint8_t *auts, - const uint8_t *auts_rand); -int gprs_subscr_auth_sync(struct gprs_subscr *subscr, - const uint8_t *auts, const uint8_t *auts_rand); -void gprs_subscr_cleanup(struct gprs_subscr *subscr); -struct gprs_subscr *gprs_subscr_get_or_create(const char *imsi); -struct gprs_subscr *gprs_subscr_get_or_create_by_mmctx( struct sgsn_mm_ctx *mmctx); -struct gprs_subscr *gprs_subscr_get_by_imsi(const char *imsi); -void gprs_subscr_cancel(struct gprs_subscr *subscr); -void gprs_subscr_update(struct gprs_subscr *subscr); -void gprs_subscr_update_auth_info(struct gprs_subscr *subscr); -int gprs_subscr_rx_gsup_message(struct msgb *msg); - /* Called on subscriber data updates */ void sgsn_update_subscriber_data(struct sgsn_mm_ctx *mmctx); diff --git a/include/osmocom/sgsn/gprs_subscriber.h b/include/osmocom/sgsn/gprs_subscriber.h index d36db75..48c2970 100644 --- a/include/osmocom/sgsn/gprs_subscriber.h +++ b/include/osmocom/sgsn/gprs_subscriber.h @@ -6,8 +6,22 @@ #include <osmocom/core/linuxlist.h> #include <osmocom/gsm/protocol/gsm_23_003.h> +struct sgsn_instance; +struct sgsn_mm_ctx; + extern struct llist_head * const gprs_subscribers; +#define GPRS_SUBSCRIBER_FIRST_CONTACT 0x00000001 +#define GPRS_SUBSCRIBER_UPDATE_AUTH_INFO_PENDING (1 << 16) +#define GPRS_SUBSCRIBER_UPDATE_LOCATION_PENDING (1 << 17) +#define GPRS_SUBSCRIBER_CANCELLED (1 << 18) +#define GPRS_SUBSCRIBER_ENABLE_PURGE (1 << 19) + +#define GPRS_SUBSCRIBER_UPDATE_PENDING_MASK ( \ + GPRS_SUBSCRIBER_UPDATE_LOCATION_PENDING | \ + GPRS_SUBSCRIBER_UPDATE_AUTH_INFO_PENDING \ +) + struct gprs_subscr { struct llist_head entry; int use_count; @@ -29,3 +43,17 @@ const char *file, int line); #define gprs_subscr_get(gsub) _gprs_subscr_get(gsub, __FILE__, __LINE__) #define gprs_subscr_put(gsub) _gprs_subscr_put(gsub, __FILE__, __LINE__) + +int gprs_subscr_init(struct sgsn_instance *sgi); +int gprs_subscr_request_update_location(struct sgsn_mm_ctx *mmctx); +int gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, + const uint8_t *auts, + const uint8_t *auts_rand); +void gprs_subscr_cleanup(struct gprs_subscr *subscr); +struct gprs_subscr *gprs_subscr_get_or_create(const char *imsi); +struct gprs_subscr *gprs_subscr_get_or_create_by_mmctx( struct sgsn_mm_ctx *mmctx); +struct gprs_subscr *gprs_subscr_get_by_imsi(const char *imsi); +void gprs_subscr_cancel(struct gprs_subscr *subscr); +void gprs_subscr_update(struct gprs_subscr *subscr); +void gprs_subscr_update_auth_info(struct gprs_subscr *subscr); +int gprs_subscr_rx_gsup_message(struct msgb *msg); diff --git a/src/sgsn/sgsn_main.c b/src/sgsn/sgsn_main.c index b744310..36ff78d 100644 --- a/src/sgsn/sgsn_main.c +++ b/src/sgsn/sgsn_main.c @@ -63,6 +63,7 @@ #include <osmocom/sgsn/gprs_ranap.h> #include <osmocom/sgsn/gprs_ns.h> #include <osmocom/sgsn/gprs_bssgp.h> +#include <osmocom/sgsn/gprs_subscriber.h> #include <osmocom/ctrl/control_if.h> #include <osmocom/ctrl/ports.h> -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30866 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Iaa1032c38fa54ad57c472d9120cfbb34b2ae90e9 Gerrit-Change-Number: 30866 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • ...
  • 221
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.