lists.osmocom.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
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
List overview
Download
gerrit-log
January 2023
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
gerrit-log@lists.osmocom.org
1 participants
2205 discussions
Start a n
N
ew thread
Change in libosmocore[master]: gsm_utils: improve gsm_gsmtime2fn()
by fixeria
Attention is currently required from: laforge, dexter. fixeria has posted comments on this change. (
https://gerrit.osmocom.org/c/libosmocore/+/30946
) Change subject: gsm_utils: improve gsm_gsmtime2fn() ...................................................................... Patch Set 2: Code-Review+1 (1 comment) File src/gsm/gsm_utils.c:
https://gerrit.osmocom.org/c/libosmocore/+/30946/comment/6cce4a7b_635a7109
PS2, Line 893: TS 04.08 Let's better use the new spec. numbers: TS 44.008, TS 45.002. TS 48.058. -- To view, visit
https://gerrit.osmocom.org/c/libosmocore/+/30946
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ibf94bca8223f1f7858a6dd67bf27de0ab6feab20 Gerrit-Change-Number: 30946 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <pmaier(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: laforge <laforge(a)osmocom.org> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Thu, 12 Jan 2023 13:24:14 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
2 years, 5 months
1
0
0
0
Change in osmocom-bb[master]: cosmetic: layer23: Drop unnecessary space before function pointer arg...
by pespin
pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmocom-bb/+/30944
) Change subject: cosmetic: layer23: Drop unnecessary space before function pointer arguments ...................................................................... cosmetic: layer23: Drop unnecessary space before function pointer arguments As requested by linter. Change-Id: I87e1857722b9181d0187bdeabe3fa1f4e63463d0 --- M src/host/layer23/include/osmocom/bb/common/l23_app.h M src/host/layer23/src/common/main.c 2 files changed, 4 insertions(+), 4 deletions(-) Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/layer23/include/osmocom/bb/common/l23_app.h b/src/host/layer23/include/osmocom/bb/common/l23_app.h index 0b9994c..d5f0fd3 100644 --- a/src/host/layer23/include/osmocom/bb/common/l23_app.h +++ b/src/host/layer23/include/osmocom/bb/common/l23_app.h @@ -16,8 +16,8 @@ /* initialization, called once when starting the app, before entering * select loop */ extern int l23_app_init(struct osmocom_ms *ms); -extern int (*l23_app_work) (struct osmocom_ms *ms); -extern int (*l23_app_exit) (struct osmocom_ms *ms); +extern int (*l23_app_work)(struct osmocom_ms *ms); +extern int (*l23_app_exit)(struct osmocom_ms *ms); /* configuration options */ struct l23_app_info { diff --git a/src/host/layer23/src/common/main.c b/src/host/layer23/src/common/main.c index f714010..6841313 100644 --- a/src/host/layer23/src/common/main.c +++ b/src/host/layer23/src/common/main.c @@ -54,8 +54,8 @@ static char *vty_ip = "127.0.0.1"; unsigned short vty_port = 4247; -int (*l23_app_work) (struct osmocom_ms *ms) = NULL; -int (*l23_app_exit) (struct osmocom_ms *ms) = NULL; +int (*l23_app_work)(struct osmocom_ms *ms) = NULL; +int (*l23_app_exit)(struct osmocom_ms *ms) = NULL; int quit = 0; struct gsmtap_inst *gsmtap_inst; -- To view, visit
https://gerrit.osmocom.org/c/osmocom-bb/+/30944
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I87e1857722b9181d0187bdeabe3fa1f4e63463d0 Gerrit-Change-Number: 30944 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
2 years, 5 months
1
0
0
0
Change in osmocom-bb[master]: layer23: Fix gcc warning sprintf() writing on too short buf
by pespin
pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmocom-bb/+/30942
) Change subject: layer23: Fix gcc warning sprintf() writing on too short buf ...................................................................... layer23: Fix gcc warning sprintf() writing on too short buf Triggered with gcc 12.2.0: /osmocom-bb/src/host/layer23/src/common/sysinfo.c: In function ‘gsm48_sysinfo_dump’: /osmocom-bb/src/host/layer23/src/common/sysinfo.c:198:42: warning: ‘sprintf’ may write a terminating nul past the end of the destination [-Wformat-overflow=] 198 | sprintf(buffer + 69, " %d", i + 63); | ^ /osmocom-bb/src/host/layer23/src/common/sysinfo.c:198:17: note: ‘sprintf’ output between 3 and 13 bytes into a destination of size 12 198 | sprintf(buffer + 69, " %d", i + 63); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I29a64fbb7aca0d1b469b6d278d4a24ddc6f57b3a --- M src/host/layer23/src/common/sysinfo.c 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/layer23/src/common/sysinfo.c b/src/host/layer23/src/common/sysinfo.c index 392cdc3..be4e84b 100644 --- a/src/host/layer23/src/common/sysinfo.c +++ b/src/host/layer23/src/common/sysinfo.c @@ -68,7 +68,7 @@ void (*print)(void *, const char *, ...), void *priv, uint8_t *freq_map) { - char buffer[81]; + char buffer[82]; int i, j, k, index; int refer_pcs = gsm_refer_pcs(arfcn, s); @@ -173,7 +173,7 @@ /* frequency map */ for (i = 0; i < 1024; i += 64) { - sprintf(buffer, " %3d ", i); + snprintf(buffer, sizeof(buffer), " %3d ", i); for (j = 0; j < 64; j++) { index = i+j; if (refer_pcs && index >= 512 && index <= 885) @@ -195,7 +195,7 @@ } for (; j < 64; j++) buffer[j + 5] = ' '; - sprintf(buffer + 69, " %d", i + 63); + snprintf(buffer + 69, sizeof(buffer) - 69, " %d", i + 63); print(priv, "%s\n", buffer); } print(priv, " 'S' = serv. cell 'n' = SI2 (neigh.) 'r' = SI5 (rep.) " -- To view, visit
https://gerrit.osmocom.org/c/osmocom-bb/+/30942
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I29a64fbb7aca0d1b469b6d278d4a24ddc6f57b3a Gerrit-Change-Number: 30942 Gerrit-PatchSet: 2 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
2 years, 5 months
1
0
0
0
Change in osmo-sgsn[master]: Move sgsn_ctrl_cmds_install() declaration to sgsn.h
by pespin
pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-sgsn/+/30900
) Change subject: Move sgsn_ctrl_cmds_install() declaration to sgsn.h ...................................................................... Move sgsn_ctrl_cmds_install() declaration to sgsn.h sgsn.h is the main header containing all misc app related contents. This is another step towards shrinking gprs_sgsn.h mess. Change-Id: I80e3a68e2e368d8c73135c850e4728bdf6cf5f09 --- M include/osmocom/sgsn/gprs_sgsn.h M include/osmocom/sgsn/sgsn.h 2 files changed, 5 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved lynxis lazus: Looks good to me, approved diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index 3fdf45d..424e16f 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -297,11 +297,6 @@ uint32_t sgsn_alloc_ptmsi(void); /* - * ctrl interface related work - */ -int sgsn_ctrl_cmds_install(void); - -/* * Authorization/ACL handling */ struct imsi_acl_entry { diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h index a2cfa9c..c92b251 100644 --- a/include/osmocom/sgsn/sgsn.h +++ b/include/osmocom/sgsn/sgsn.h @@ -162,6 +162,11 @@ extern struct sgsn_instance *sgsn; extern void *tall_sgsn_ctx; +/* + * ctrl interface related work (sgsn_ctrl.c) + */ +int sgsn_ctrl_cmds_install(void); + /* sgsn_vty.c */ int sgsn_vty_init(struct sgsn_config *cfg); 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit
https://gerrit.osmocom.org/c/osmo-sgsn/+/30900
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I80e3a68e2e368d8c73135c850e4728bdf6cf5f09 Gerrit-Change-Number: 30900 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
2 years, 5 months
1
0
0
0
Change in osmo-sgsn[master]: Move LOGGSUBSCRP to gprs_subscriber.h
by pespin
pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-sgsn/+/30901
) Change subject: Move LOGGSUBSCRP to gprs_subscriber.h ...................................................................... Move LOGGSUBSCRP to gprs_subscriber.h The define belongs to gprs_subscriber.h header. Change-Id: Icdb7e55ca8e90dd2ba79ccdb1a8ba650a3942ab3 --- M include/osmocom/sgsn/gprs_sgsn.h M include/osmocom/sgsn/gprs_subscriber.h 2 files changed, 5 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved lynxis lazus: Looks good to me, approved diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index 424e16f..c9e301d 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -306,11 +306,6 @@ #define SGSN_ERROR_CAUSE_NONE (-1) -#define LOGGSUBSCRP(level, subscr, fmt, args...) \ - LOGP(DGPRS, level, "SUBSCR(%s) " fmt, \ - (subscr) ? (subscr)->imsi : "---", \ - ## args) - struct sgsn_config; struct sgsn_instance; extern const struct value_string *sgsn_auth_state_names; diff --git a/include/osmocom/sgsn/gprs_subscriber.h b/include/osmocom/sgsn/gprs_subscriber.h index d84a5d6..78de64a 100644 --- a/include/osmocom/sgsn/gprs_subscriber.h +++ b/include/osmocom/sgsn/gprs_subscriber.h @@ -99,3 +99,8 @@ 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); + +#define LOGGSUBSCRP(level, subscr, fmt, args...) \ + LOGP(DGPRS, level, "SUBSCR(%s) " fmt, \ + (subscr) ? (subscr)->imsi : "---", \ + ## args) 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit
https://gerrit.osmocom.org/c/osmo-sgsn/+/30901
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Icdb7e55ca8e90dd2ba79ccdb1a8ba650a3942ab3 Gerrit-Change-Number: 30901 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
2 years, 5 months
1
0
0
0
Change in osmo-sgsn[master]: Rename bscconfig.h -> config.h
by pespin
pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-sgsn/+/30902
) Change subject: Rename bscconfig.h -> config.h ...................................................................... Rename bscconfig.h -> config.h Change-Id: I007103be34c1aaab7a9375c44b226d4590fe5b24 --- M .gitignore M configure.ac M include/osmocom/sgsn/sgsn.h M src/gtphub/gtphub_main.c M src/sgsn/gprs_gmm.c M src/sgsn/gprs_ns.c M src/sgsn/gprs_ranap.c M src/sgsn/gprs_sgsn.c M src/sgsn/gprs_sm.c M src/sgsn/sgsn_libgtp.c M src/sgsn/sgsn_main.c M src/sgsn/sgsn_vty.c 12 files changed, 13 insertions(+), 13 deletions(-) Approvals: Jenkins Builder: Verified dexter: Looks good to me, approved laforge: Looks good to me, but someone else must approve lynxis lazus: Looks good to me, approved diff --git a/.gitignore b/.gitignore index 3626a5a..010f151 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,8 @@ .deps Makefile Makefile.in -bscconfig.h -bscconfig.h.in +config.h +config.h.in *.*~ *.sw? .libs diff --git a/configure.ac b/configure.ac index 2c335d7..5985cf8 100644 --- a/configure.ac +++ b/configure.ac @@ -230,7 +230,7 @@ AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"]) dnl Generate the output -AM_CONFIG_HEADER(bscconfig.h) +AM_CONFIG_HEADER(config.h) AC_OUTPUT( include/Makefile diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h index c92b251..aadb8a7 100644 --- a/include/osmocom/sgsn/sgsn.h +++ b/include/osmocom/sgsn/sgsn.h @@ -14,7 +14,7 @@ #include <osmocom/gsupclient/gsup_client.h> #include <osmocom/sgsn/common.h> -#include "../../bscconfig.h" +#include "../../config.h" #if BUILD_IU #include <osmocom/ranap/iu_client.h> diff --git a/src/gtphub/gtphub_main.c b/src/gtphub/gtphub_main.c index 0f389ab..4d1e9cf 100644 --- a/src/gtphub/gtphub_main.c +++ b/src/gtphub/gtphub_main.c @@ -44,7 +44,7 @@ #include <osmocom/gtphub/gtphub.h> #include <osmocom/sgsn/vty.h> -#include "../../bscconfig.h" +#include "../../config.h" #if BUILD_IU #include <osmocom/sigtran/osmo_ss7.h> diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c index 2630db9..2f15c92 100644 --- a/src/sgsn/gprs_gmm.c +++ b/src/sgsn/gprs_gmm.c @@ -30,7 +30,7 @@ #include <netinet/in.h> #include <arpa/inet.h> -#include "bscconfig.h" +#include "config.h" #include <osmocom/core/msgb.h> #include <osmocom/gsm/tlv.h> diff --git a/src/sgsn/gprs_ns.c b/src/sgsn/gprs_ns.c index b676917..e2ff931 100644 --- a/src/sgsn/gprs_ns.c +++ b/src/sgsn/gprs_ns.c @@ -29,7 +29,7 @@ #include <osmocom/gprs/gprs_bssgp_bss.h> #include <osmocom/sgsn/gprs_llc.h> -#include "bscconfig.h" +#include "config.h" #include <osmocom/sgsn/gprs_sgsn.h> #include <osmocom/sgsn/debug.h> diff --git a/src/sgsn/gprs_ranap.c b/src/sgsn/gprs_ranap.c index 245de4b..d3d958d 100644 --- a/src/sgsn/gprs_ranap.c +++ b/src/sgsn/gprs_ranap.c @@ -21,7 +21,7 @@ * */ -#include "bscconfig.h" +#include "config.h" #include <gtp.h> #include <osmocom/core/rate_ctr.h> diff --git a/src/sgsn/gprs_sgsn.c b/src/sgsn/gprs_sgsn.c index 40efd4a..55e1cb2 100644 --- a/src/sgsn/gprs_sgsn.c +++ b/src/sgsn/gprs_sgsn.c @@ -58,7 +58,7 @@ #include <time.h> -#include "../../bscconfig.h" +#include "../../config.h" #define GPRS_LLME_CHECK_TICK 30 diff --git a/src/sgsn/gprs_sm.c b/src/sgsn/gprs_sm.c index 9a66e0a..3a5ba3b 100644 --- a/src/sgsn/gprs_sm.c +++ b/src/sgsn/gprs_sm.c @@ -26,7 +26,7 @@ #include <arpa/inet.h> #include <netdb.h> -#include "bscconfig.h" +#include "config.h" #include <osmocom/core/rate_ctr.h> #include <osmocom/core/tdef.h> diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c index 19a0f56..e2d5670 100644 --- a/src/sgsn/sgsn_libgtp.c +++ b/src/sgsn/sgsn_libgtp.c @@ -34,7 +34,7 @@ #include <netinet/in.h> #include <arpa/inet.h> -#include "bscconfig.h" +#include "config.h" #include <osmocom/core/talloc.h> #include <osmocom/core/select.h> diff --git a/src/sgsn/sgsn_main.c b/src/sgsn/sgsn_main.c index 7253348..d9d454c 100644 --- a/src/sgsn/sgsn_main.c +++ b/src/sgsn/sgsn_main.c @@ -70,7 +70,7 @@ #include <gtp.h> #include <osmocom/sgsn/sgsn_rim.h> -#include "../../bscconfig.h" +#include "../../config.h" #if BUILD_IU #include <osmocom/sigtran/osmo_ss7.h> diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c index d8ea420..fa62561 100644 --- a/src/sgsn/sgsn_vty.c +++ b/src/sgsn/sgsn_vty.c @@ -58,7 +58,7 @@ #include <pdp.h> #include <gtp.h> -#include "../../bscconfig.h" +#include "../../config.h" #ifdef BUILD_IU #include <osmocom/ranap/iu_client.h> -- To view, visit
https://gerrit.osmocom.org/c/osmo-sgsn/+/30902
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I007103be34c1aaab7a9375c44b226d4590fe5b24 Gerrit-Change-Number: 30902 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
2 years, 5 months
1
0
0
0
Change in osmo-sgsn[master]: Move global pdp_list inside struct sgsn_instance
by pespin
pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-sgsn/+/30892
) Change subject: Move global pdp_list inside struct sgsn_instance ...................................................................... Move global pdp_list inside struct sgsn_instance This way pdp contexts are managed by the lifcycle of the main global struct sgsn_instance automatically. Change-Id: I725218fd54adcc68dceded5eb43675f25771bb96 --- M include/osmocom/sgsn/pdpctx.h M include/osmocom/sgsn/sgsn.h M src/sgsn/gprs_sgsn.c M src/sgsn/pdpctx.c M src/sgsn/sgsn_vty.c 5 files changed, 5 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified daniel: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve lynxis lazus: Looks good to me, approved diff --git a/include/osmocom/sgsn/pdpctx.h b/include/osmocom/sgsn/pdpctx.h index 1e982af..255a77d 100644 --- a/include/osmocom/sgsn/pdpctx.h +++ b/include/osmocom/sgsn/pdpctx.h @@ -90,7 +90,5 @@ void sgsn_pdp_ctx_terminate(struct sgsn_pdp_ctx *pdp); void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp); -extern struct llist_head sgsn_pdp_ctxts; - char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len, bool return_ipv6); diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h index 4326846..a2cfa9c 100644 --- a/include/osmocom/sgsn/sgsn.h +++ b/include/osmocom/sgsn/sgsn.h @@ -154,6 +154,7 @@ struct llist_head apn_list; /* list of struct sgsn_apn_ctx */ struct llist_head ggsn_list; /* list of struct sgsn_ggsn_ctx */ struct llist_head mme_list; /* list of struct sgsn_mme_ctx */ + struct llist_head pdp_list; /* list of struct sgsn_pdp_ctx */ struct ctrl_handle *ctrlh; }; diff --git a/src/sgsn/gprs_sgsn.c b/src/sgsn/gprs_sgsn.c index 9d2ed7d..40efd4a 100644 --- a/src/sgsn/gprs_sgsn.c +++ b/src/sgsn/gprs_sgsn.c @@ -704,6 +704,7 @@ INIT_LLIST_HEAD(&inst->apn_list); INIT_LLIST_HEAD(&inst->ggsn_list); INIT_LLIST_HEAD(&inst->mme_list); + INIT_LLIST_HEAD(&inst->pdp_list); osmo_timer_setup(&inst->llme_timer, sgsn_llme_check_cb, NULL); osmo_timer_schedule(&inst->llme_timer, GPRS_LLME_CHECK_TICK, 0); diff --git a/src/sgsn/pdpctx.c b/src/sgsn/pdpctx.c index 52b1c0f..77146fc 100644 --- a/src/sgsn/pdpctx.c +++ b/src/sgsn/pdpctx.c @@ -39,8 +39,6 @@ #include <osmocom/sgsn/gprs_sm.h> #include <osmocom/sgsn/gtp.h> -LLIST_HEAD(sgsn_pdp_ctxts); - static const struct rate_ctr_desc pdpctx_ctr_description[] = { { "udata:packets:in", "User Data Messages ( In)" }, { "udata:packets:out", "User Data Messages (Out)" }, @@ -67,7 +65,7 @@ if (pdp) return NULL; - pdp = talloc_zero(tall_sgsn_ctx, struct sgsn_pdp_ctx); + pdp = talloc_zero(sgsn, struct sgsn_pdp_ctx); if (!pdp) return NULL; @@ -82,7 +80,7 @@ } llist_add(&pdp->list, &mm->pdp_list); sgsn_ggsn_ctx_add_pdp(pdp->ggsn, pdp); - llist_add(&pdp->g_list, &sgsn_pdp_ctxts); + llist_add(&pdp->g_list, &sgsn->pdp_list); return pdp; } diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c index 8e94041..d8ea420 100644 --- a/src/sgsn/sgsn_vty.c +++ b/src/sgsn/sgsn_vty.c @@ -723,7 +723,7 @@ { struct sgsn_pdp_ctx *pdp; - llist_for_each_entry(pdp, &sgsn_pdp_ctxts, g_list) + llist_for_each_entry(pdp, &sgsn->pdp_list, g_list) vty_dump_pdp(vty, "", pdp); return CMD_SUCCESS; 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit
https://gerrit.osmocom.org/c/osmo-sgsn/+/30892
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I725218fd54adcc68dceded5eb43675f25771bb96 Gerrit-Change-Number: 30892 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
2 years, 5 months
1
0
0
0
Change in osmo-sgsn[master]: Move gtphub header to include/osmocom/gtphub/
by pespin
pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-sgsn/+/30899
) Change subject: Move gtphub header to include/osmocom/gtphub/ ...................................................................... Move gtphub header to include/osmocom/gtphub/ Change-Id: I82e1f2a3bc8e22b28747a540879bd661f1704cde --- M configure.ac M debian/copyright M include/osmocom/Makefile.am A include/osmocom/gtphub/Makefile.am R include/osmocom/gtphub/gtphub.h M include/osmocom/sgsn/Makefile.am M src/gtphub/gtphub.c M src/gtphub/gtphub_ares.c M src/gtphub/gtphub_main.c M src/gtphub/gtphub_sock.c M src/gtphub/gtphub_vty.c M tests/gtphub/gtphub_test.c 12 files changed, 12 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved lynxis lazus: Looks good to me, approved diff --git a/configure.ac b/configure.ac index 64b74e3..2c335d7 100644 --- a/configure.ac +++ b/configure.ac @@ -235,6 +235,7 @@ AC_OUTPUT( include/Makefile include/osmocom/Makefile + include/osmocom/gtphub/Makefile include/osmocom/sgsn/Makefile src/Makefile src/gprs/Makefile diff --git a/debian/copyright b/debian/copyright index d4e7451..cd8d7e8 100644 --- a/debian/copyright +++ b/debian/copyright @@ -74,7 +74,7 @@ include/osmocom/sgsn/gprs_sndcp_pcomp.h include/osmocom/sgsn/gprs_sndcp_xid.h include/osmocom/sgsn/gprs_utils.h - include/osmocom/sgsn/gtphub.h + include/osmocom/gtphub/gtphub.h include/osmocom/sgsn/signal.h src/gprs/gprs_llc_parse.c src/gprs/crc24.c diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am index 09db97a..f5bc76a 100644 --- a/include/osmocom/Makefile.am +++ b/include/osmocom/Makefile.am @@ -1,3 +1,4 @@ SUBDIRS = \ + gtphub \ sgsn \ $(NULL) diff --git a/include/osmocom/gtphub/Makefile.am b/include/osmocom/gtphub/Makefile.am new file mode 100644 index 0000000..c61dad9 --- /dev/null +++ b/include/osmocom/gtphub/Makefile.am @@ -0,0 +1,3 @@ +noinst_HEADERS = \ + gtphub.h \ + $(NULL) diff --git a/include/osmocom/sgsn/gtphub.h b/include/osmocom/gtphub/gtphub.h similarity index 100% rename from include/osmocom/sgsn/gtphub.h rename to include/osmocom/gtphub/gtphub.h diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am index a3bc218..017954d 100644 --- a/include/osmocom/sgsn/Makefile.am +++ b/include/osmocom/sgsn/Makefile.am @@ -23,7 +23,6 @@ gprs_subscriber.h \ gprs_utils.h \ gtp.h \ - gtphub.h \ gtp_ggsn.h \ gtp_mme.h \ pdpctx.h \ diff --git a/src/gtphub/gtphub.c b/src/gtphub/gtphub.c index 89ca676..2b00f59 100644 --- a/src/gtphub/gtphub.c +++ b/src/gtphub/gtphub.c @@ -32,7 +32,7 @@ #include <gtp.h> #include <gtpie.h> -#include <osmocom/sgsn/gtphub.h> +#include <osmocom/gtphub/gtphub.h> #include <osmocom/sgsn/debug.h> #include <osmocom/sgsn/gprs_utils.h> diff --git a/src/gtphub/gtphub_ares.c b/src/gtphub/gtphub_ares.c index 87dc860..a2d8a4a 100644 --- a/src/gtphub/gtphub_ares.c +++ b/src/gtphub/gtphub_ares.c @@ -28,7 +28,7 @@ #include <string.h> #include <unistd.h> -#include <osmocom/sgsn/gtphub.h> +#include <osmocom/gtphub/gtphub.h> #include <osmocom/sgsn/debug.h> #include <osmocom/core/utils.h> diff --git a/src/gtphub/gtphub_main.c b/src/gtphub/gtphub_main.c index a9a7529..0f389ab 100644 --- a/src/gtphub/gtphub_main.c +++ b/src/gtphub/gtphub_main.c @@ -41,7 +41,7 @@ #include <osmocom/vty/misc.h> #include <osmocom/sgsn/debug.h> -#include <osmocom/sgsn/gtphub.h> +#include <osmocom/gtphub/gtphub.h> #include <osmocom/sgsn/vty.h> #include "../../bscconfig.h" diff --git a/src/gtphub/gtphub_sock.c b/src/gtphub/gtphub_sock.c index 1837533..59a0d42 100644 --- a/src/gtphub/gtphub_sock.c +++ b/src/gtphub/gtphub_sock.c @@ -25,7 +25,7 @@ * along with this program. If not, see <
http://www.gnu.org/licenses/
>. */ -#include <osmocom/sgsn/gtphub.h> +#include <osmocom/gtphub/gtphub.h> #include <osmocom/sgsn/debug.h> /* Convenience makro, note: only within this C file. */ diff --git a/src/gtphub/gtphub_vty.c b/src/gtphub/gtphub_vty.c index abc08fd..b5f102a 100644 --- a/src/gtphub/gtphub_vty.c +++ b/src/gtphub/gtphub_vty.c @@ -31,7 +31,7 @@ #include <osmocom/vty/misc.h> #include <osmocom/sgsn/vty.h> -#include <osmocom/sgsn/gtphub.h> +#include <osmocom/gtphub/gtphub.h> /* TODO split GRX ares from sgsn into a separate struct and allow use without * globals. */ diff --git a/tests/gtphub/gtphub_test.c b/tests/gtphub/gtphub_test.c index 13d2636..4f58315 100644 --- a/tests/gtphub/gtphub_test.c +++ b/tests/gtphub/gtphub_test.c @@ -30,7 +30,7 @@ #include <osmocom/sgsn/debug.h> -#include <osmocom/sgsn/gtphub.h> +#include <osmocom/gtphub/gtphub.h> #include <gtp.h> #include <gtpie.h> 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit
https://gerrit.osmocom.org/c/osmo-sgsn/+/30899
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I82e1f2a3bc8e22b28747a540879bd661f1704cde Gerrit-Change-Number: 30899 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
2 years, 5 months
1
0
0
0
Change in osmo-sgsn[master]: Move sgsn_pdp_ctx to its own file pdpctx.{c,h}
by pespin
pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-sgsn/+/30891
) Change subject: Move sgsn_pdp_ctx to its own file pdpctx.{c,h} ...................................................................... Move sgsn_pdp_ctx to its own file pdpctx.{c,h} This further shrinks the mess in gprs_sgsn.h, and allows to easily see layer violations (like pdpctx.c requiring llc.h) Change-Id: Iad4da06efee7d8514ff48423bdaebc0f26413cc1 --- M include/osmocom/sgsn/Makefile.am M include/osmocom/sgsn/gprs_sgsn.h A include/osmocom/sgsn/pdpctx.h M src/sgsn/Makefile.am M src/sgsn/gprs_gmm.c M src/sgsn/gprs_mm_state_iu_fsm.c M src/sgsn/gprs_ranap.c M src/sgsn/gprs_sgsn.c M src/sgsn/gprs_sm.c M src/sgsn/gtp_ggsn.c A src/sgsn/pdpctx.c M src/sgsn/sgsn_cdr.c M src/sgsn/sgsn_ctrl.c M src/sgsn/sgsn_libgtp.c M src/sgsn/sgsn_vty.c M tests/sgsn/Makefile.am 16 files changed, 270 insertions(+), 193 deletions(-) Approvals: Jenkins Builder: Verified dexter: Looks good to me, but someone else must approve daniel: Looks good to me, approved pespin: Looks good to me, but someone else must approve diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am index 4d43c6d..a3bc218 100644 --- a/include/osmocom/sgsn/Makefile.am +++ b/include/osmocom/sgsn/Makefile.am @@ -26,6 +26,7 @@ gtphub.h \ gtp_ggsn.h \ gtp_mme.h \ + pdpctx.h \ sgsn.h \ sgsn_rim.h \ signal.h \ diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index 8aaabfd..3fdf45d 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -23,6 +23,7 @@ struct ctrl_handle; struct gprs_subscr; struct sgsn_ggsn_ctx; +struct sgsn_pdp_ctx; enum gsm48_gsm_cause; @@ -40,13 +41,6 @@ GMM_CTR_RA_UPDATE, }; -enum gprs_pdp_ctx { - PDP_CTR_PKTS_UDATA_IN, - PDP_CTR_PKTS_UDATA_OUT, - PDP_CTR_BYTES_UDATA_IN, - PDP_CTR_BYTES_UDATA_OUT, -}; - enum gprs_t3350_mode { GMM_T3350_MODE_NONE, GMM_T3350_MODE_ATT, @@ -291,64 +285,6 @@ enum gsm48_gsm_cause *gsm_cause, char *apn_str); -enum pdp_ctx_state { - PDP_STATE_NONE, - PDP_STATE_CR_REQ, - PDP_STATE_CR_CONF, - - /* 04.08 / Figure 6.2 / 6.1.2.2 */ - PDP_STATE_INACT_PEND, - PDP_STATE_INACTIVE = PDP_STATE_NONE, -}; - -enum pdp_type { - PDP_TYPE_NONE, - PDP_TYPE_ETSI_PPP, - PDP_TYPE_IANA_IPv4, - PDP_TYPE_IANA_IPv6, -}; - -struct sgsn_pdp_ctx { - struct llist_head list; /* list_head for mmctx->pdp_list */ - struct llist_head g_list; /* list_head for global list */ - struct sgsn_mm_ctx *mm; /* back pointer to MM CTX */ - int destroy_ggsn; /* destroy it on destruction */ - struct sgsn_ggsn_ctx *ggsn; /* which GGSN serves this PDP */ - struct llist_head ggsn_list; /* list_head for ggsn->pdp_list */ - struct rate_ctr_group *ctrg; - - //unsigned int id; - struct pdp_t *lib; /* pointer to libgtp PDP ctx */ - enum pdp_ctx_state state; - enum pdp_type type; - uint32_t address; - char *apn_subscribed; - //char *apn_used; - uint16_t nsapi; /* SNDCP */ - uint16_t sapi; /* LLC */ - uint8_t ti; /* transaction identifier */ - int vplmn_allowed; - uint32_t qos_profile_subscr; - //uint32_t qos_profile_req; - //uint32_t qos_profile_neg; - uint8_t radio_prio; - //uint32_t charging_id; - - struct osmo_timer_list timer; - unsigned int T; /* Txxxx number */ - unsigned int num_T_exp; /* number of consecutive T expirations */ - - struct osmo_timer_list cdr_timer; /* CDR record wird timer */ - struct timespec cdr_start; /* The start of the CDR */ - uint64_t cdr_bytes_in; - uint64_t cdr_bytes_out; - uint32_t cdr_charging_id; -}; - -#define LOGPDPCTXP(level, pdp, fmt, args...) \ - LOGP(DGPRS, level, "PDP(%s/%u) " \ - fmt, (pdp)->mm ? (pdp)->mm->imsi : "---", (pdp)->ti, ## args) - /* look up PDP context by MM context and NSAPI */ struct sgsn_pdp_ctx *sgsn_pdp_ctx_by_nsapi(const struct sgsn_mm_ctx *mm, uint8_t nsapi); @@ -356,19 +292,10 @@ struct sgsn_pdp_ctx *sgsn_pdp_ctx_by_tid(const struct sgsn_mm_ctx *mm, uint8_t tid); -struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm, - struct sgsn_ggsn_ctx *ggsn, - uint8_t nsapi); -void sgsn_pdp_ctx_terminate(struct sgsn_pdp_ctx *pdp); -void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp); - extern struct llist_head sgsn_mm_ctxts; -extern struct llist_head sgsn_pdp_ctxts; uint32_t sgsn_alloc_ptmsi(void); -char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len, bool return_ipv6); - /* * ctrl interface related work */ diff --git a/include/osmocom/sgsn/pdpctx.h b/include/osmocom/sgsn/pdpctx.h new file mode 100644 index 0000000..1e982af --- /dev/null +++ b/include/osmocom/sgsn/pdpctx.h @@ -0,0 +1,96 @@ +#pragma once + +#include <stdint.h> +#include <netinet/in.h> +#include <inttypes.h> + +#include <osmocom/core/timer.h> +#include <osmocom/core/rate_ctr.h> + +#include <osmocom/gsm/gsm48.h> + +#include <osmocom/crypt/gprs_cipher.h> +#include <osmocom/gsm/protocol/gsm_23_003.h> +#include <osmocom/crypt/auth.h> + +#include <osmocom/sgsn/apn.h> +#include <osmocom/sgsn/gprs_subscriber.h> + +struct sgsn_mm_ctx; +struct sgsn_ggsn_ctx; + +enum gprs_pdp_ctx { + PDP_CTR_PKTS_UDATA_IN, + PDP_CTR_PKTS_UDATA_OUT, + PDP_CTR_BYTES_UDATA_IN, + PDP_CTR_BYTES_UDATA_OUT, +}; + +enum pdp_ctx_state { + PDP_STATE_NONE, + PDP_STATE_CR_REQ, + PDP_STATE_CR_CONF, + + /* 04.08 / Figure 6.2 / 6.1.2.2 */ + PDP_STATE_INACT_PEND, + PDP_STATE_INACTIVE = PDP_STATE_NONE, +}; + +enum pdp_type { + PDP_TYPE_NONE, + PDP_TYPE_ETSI_PPP, + PDP_TYPE_IANA_IPv4, + PDP_TYPE_IANA_IPv6, +}; + +struct sgsn_pdp_ctx { + struct llist_head list; /* list_head for mmctx->pdp_list */ + struct llist_head g_list; /* list_head for global list */ + struct sgsn_mm_ctx *mm; /* back pointer to MM CTX */ + int destroy_ggsn; /* destroy it on destruction */ + struct sgsn_ggsn_ctx *ggsn; /* which GGSN serves this PDP */ + struct llist_head ggsn_list; /* list_head for ggsn->pdp_list */ + struct rate_ctr_group *ctrg; + + //unsigned int id; + struct pdp_t *lib; /* pointer to libgtp PDP ctx */ + enum pdp_ctx_state state; + enum pdp_type type; + uint32_t address; + char *apn_subscribed; + //char *apn_used; + uint16_t nsapi; /* SNDCP */ + uint16_t sapi; /* LLC */ + uint8_t ti; /* transaction identifier */ + int vplmn_allowed; + uint32_t qos_profile_subscr; + //uint32_t qos_profile_req; + //uint32_t qos_profile_neg; + uint8_t radio_prio; + //uint32_t charging_id; + + struct osmo_timer_list timer; + unsigned int T; /* Txxxx number */ + unsigned int num_T_exp; /* number of consecutive T expirations */ + + struct osmo_timer_list cdr_timer; /* CDR record wird timer */ + struct timespec cdr_start; /* The start of the CDR */ + uint64_t cdr_bytes_in; + uint64_t cdr_bytes_out; + uint32_t cdr_charging_id; +}; + +#define LOGPDPCTXP(level, pdp, fmt, args...) \ + LOGP(DGPRS, level, "PDP(%s/%u) " \ + fmt, (pdp)->mm ? (pdp)->mm->imsi : "---", (pdp)->ti, ## args) + +struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm, + struct sgsn_ggsn_ctx *ggsn, + uint8_t nsapi); +void sgsn_pdp_ctx_terminate(struct sgsn_pdp_ctx *pdp); +void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp); + +extern struct llist_head sgsn_pdp_ctxts; + +char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len, bool return_ipv6); + diff --git a/src/sgsn/Makefile.am b/src/sgsn/Makefile.am index ba752ad..75f9608 100644 --- a/src/sgsn/Makefile.am +++ b/src/sgsn/Makefile.am @@ -62,6 +62,7 @@ sgsn_libgtp.c \ gprs_llc.c \ gprs_llc_vty.c \ + pdpctx.c \ sgsn_ctrl.c \ sgsn_auth.c \ gprs_subscriber.c \ diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c index b12102e..2630db9 100644 --- a/src/sgsn/gprs_gmm.c +++ b/src/sgsn/gprs_gmm.c @@ -62,6 +62,7 @@ #include <osmocom/sgsn/gprs_ranap.h> #include <osmocom/sgsn/gprs_sm.h> #include <osmocom/sgsn/gtp.h> +#include <osmocom/sgsn/pdpctx.h> #include <pdp.h> diff --git a/src/sgsn/gprs_mm_state_iu_fsm.c b/src/sgsn/gprs_mm_state_iu_fsm.c index d0e9ffc..597507c 100644 --- a/src/sgsn/gprs_mm_state_iu_fsm.c +++ b/src/sgsn/gprs_mm_state_iu_fsm.c @@ -30,6 +30,7 @@ #include <osmocom/sgsn/sgsn.h> #include <osmocom/sgsn/gprs_ranap.h> #include <osmocom/sgsn/gtp.h> +#include <osmocom/sgsn/pdpctx.h> #define X(s) (1 << (s)) diff --git a/src/sgsn/gprs_ranap.c b/src/sgsn/gprs_ranap.c index af1a61c..245de4b 100644 --- a/src/sgsn/gprs_ranap.c +++ b/src/sgsn/gprs_ranap.c @@ -39,6 +39,7 @@ #include <osmocom/sgsn/gprs_mm_state_iu_fsm.h> #include <osmocom/sgsn/gtp_ggsn.h> #include <osmocom/sgsn/gtp.h> +#include <osmocom/sgsn/pdpctx.h> /* Send RAB activation requests for all PDP contexts */ void activate_pdp_rabs(struct sgsn_mm_ctx *ctx) diff --git a/src/sgsn/gprs_sgsn.c b/src/sgsn/gprs_sgsn.c index c911b6a..9d2ed7d 100644 --- a/src/sgsn/gprs_sgsn.c +++ b/src/sgsn/gprs_sgsn.c @@ -52,6 +52,7 @@ #include <osmocom/sgsn/gprs_sndcp.h> #include <osmocom/sgsn/gtp_ggsn.h> #include <osmocom/sgsn/gtp.h> +#include <osmocom/sgsn/pdpctx.h> #include <pdp.h> @@ -64,7 +65,6 @@ extern struct osmo_tdef sgsn_T_defs[]; LLIST_HEAD(sgsn_mm_ctxts); -LLIST_HEAD(sgsn_pdp_ctxts); const struct value_string sgsn_ran_type_names[] = { { MM_CTX_T_GERAN_Gb, "GPRS/EDGE via Gb" }, @@ -97,21 +97,6 @@ .class_id = OSMO_STATS_CLASS_SUBSCRIBER, }; -static const struct rate_ctr_desc pdpctx_ctr_description[] = { - { "udata:packets:in", "User Data Messages ( In)" }, - { "udata:packets:out", "User Data Messages (Out)" }, - { "udata:bytes:in", "User Data Bytes ( In)" }, - { "udata:bytes:out", "User Data Bytes (Out)" }, -}; - -static const struct rate_ctr_group_desc pdpctx_ctrg_desc = { - .group_name_prefix = "sgsn:pdpctx", - .group_description = "SGSN PDP Context Statistics", - .num_ctr = ARRAY_SIZE(pdpctx_ctr_description), - .ctr_desc = pdpctx_ctr_description, - .class_id = OSMO_STATS_CLASS_SUBSCRIBER, -}; - static const struct rate_ctr_desc sgsn_ctr_description[] = { { "llc:dl_bytes", "Count sent LLC bytes before giving it to the bssgp layer" }, { "llc:ul_bytes", "Count successful received LLC bytes (encrypt & fcs correct)" }, @@ -429,109 +414,6 @@ return NULL; } -/* you don't want to use this directly, call sgsn_create_pdp_ctx() */ -struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm, - struct sgsn_ggsn_ctx *ggsn, - uint8_t nsapi) -{ - struct sgsn_pdp_ctx *pdp; - - pdp = sgsn_pdp_ctx_by_nsapi(mm, nsapi); - if (pdp) - return NULL; - - pdp = talloc_zero(tall_sgsn_ctx, struct sgsn_pdp_ctx); - if (!pdp) - return NULL; - - pdp->mm = mm; - pdp->ggsn = ggsn; - pdp->nsapi = nsapi; - pdp->ctrg = rate_ctr_group_alloc(pdp, &pdpctx_ctrg_desc, nsapi); - if (!pdp->ctrg) { - LOGPDPCTXP(LOGL_ERROR, pdp, "Error allocation counter group\n"); - talloc_free(pdp); - return NULL; - } - llist_add(&pdp->list, &mm->pdp_list); - sgsn_ggsn_ctx_add_pdp(pdp->ggsn, pdp); - llist_add(&pdp->g_list, &sgsn_pdp_ctxts); - - return pdp; -} - -/* - * This function will not trigger any GSM DEACT PDP ACK messages, so you - * probably want to call sgsn_delete_pdp_ctx() instead if the connection - * isn't detached already. - */ -void sgsn_pdp_ctx_terminate(struct sgsn_pdp_ctx *pdp) -{ - struct sgsn_signal_data sig_data; - - OSMO_ASSERT(pdp->mm != NULL); - - /* There might still be pending callbacks in libgtp. So the parts of - * this object relevant to GTP need to remain intact in this case. */ - - LOGPDPCTXP(LOGL_INFO, pdp, "Forcing release of PDP context\n"); - - if (pdp->mm->ran_type == MM_CTX_T_GERAN_Gb) { - /* Force the deactivation of the SNDCP layer */ - if (pdp->mm->gb.llme) - sndcp_sm_deactivate_ind(&pdp->mm->gb.llme->lle[pdp->sapi], pdp->nsapi); - } - - memset(&sig_data, 0, sizeof(sig_data)); - sig_data.pdp = pdp; - osmo_signal_dispatch(SS_SGSN, S_SGSN_PDP_TERMINATE, &sig_data); - - /* Detach from MM context */ - pdp_ctx_detach_mm_ctx(pdp); - if (pdp->ggsn) - sgsn_delete_pdp_ctx(pdp); -} - -/* - * Don't call this function directly unless you know what you are doing. - * In normal conditions use sgsn_delete_pdp_ctx and in unspecified or - * implementation dependent abnormal ones sgsn_pdp_ctx_terminate. - */ -void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp) -{ - struct sgsn_signal_data sig_data; - - memset(&sig_data, 0, sizeof(sig_data)); - sig_data.pdp = pdp; - osmo_signal_dispatch(SS_SGSN, S_SGSN_PDP_FREE, &sig_data); - - if (osmo_timer_pending(&pdp->timer)) { - LOGPDPCTXP(LOGL_ERROR, pdp, "Freeing PDP ctx with timer %u pending\n", pdp->T); - osmo_timer_del(&pdp->timer); - } - - rate_ctr_group_free(pdp->ctrg); - if (pdp->mm) - llist_del(&pdp->list); - if (pdp->ggsn) - sgsn_ggsn_ctx_remove_pdp(pdp->ggsn, pdp); - llist_del(&pdp->g_list); - - /* _if_ we still have a library handle, at least set it to NULL - * to avoid any dereferences of the now-deleted PDP context from - * sgsn_libgtp:cb_data_ind() */ - if (pdp->lib) { - struct pdp_t *lib = pdp->lib; - LOGPDPCTXP(LOGL_NOTICE, pdp, "freeing PDP context that still " - "has a libgtp handle attached to it, this shouldn't " - "happen!\n"); - osmo_generate_backtrace(); - lib->priv = NULL; - } - - talloc_free(pdp); -} - uint32_t sgsn_alloc_ptmsi(void) { struct sgsn_mm_ctx *mm; diff --git a/src/sgsn/gprs_sm.c b/src/sgsn/gprs_sm.c index 3177a70..9a66e0a 100644 --- a/src/sgsn/gprs_sm.c +++ b/src/sgsn/gprs_sm.c @@ -43,6 +43,7 @@ #include <osmocom/sgsn/gprs_sndcp.h> #include <osmocom/sgsn/gprs_ranap.h> #include <osmocom/sgsn/gtp.h> +#include <osmocom/sgsn/pdpctx.h> /* 3GPP TS 04.08 sec 6.1.3.4.3(.a) "Abnormal cases" */ #define T339X_MAX_RETRANS 4 diff --git a/src/sgsn/gtp_ggsn.c b/src/sgsn/gtp_ggsn.c index b43fb25..7cc65f8 100644 --- a/src/sgsn/gtp_ggsn.c +++ b/src/sgsn/gtp_ggsn.c @@ -34,6 +34,7 @@ #include <osmocom/sgsn/debug.h> #include <osmocom/sgsn/gprs_gmm_fsm.h> #include <osmocom/sgsn/gprs_sm.h> +#include <osmocom/sgsn/pdpctx.h> void sgsn_ggsn_ctx_check_echo_timer(struct sgsn_ggsn_ctx *ggc) { diff --git a/src/sgsn/pdpctx.c b/src/sgsn/pdpctx.c new file mode 100644 index 0000000..52b1c0f --- /dev/null +++ b/src/sgsn/pdpctx.c @@ -0,0 +1,160 @@ +/* PDP context functionality */ + +/* (C) 2009 by Harald Welte <laforge(a)gnumonks.org> + * + * 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 <osmocom/core/linuxlist.h> +#include <osmocom/core/talloc.h> +#include <osmocom/core/timer.h> +#include <osmocom/core/rate_ctr.h> +#include <osmocom/core/stats.h> + +#include <osmocom/sgsn/pdpctx.h> +#include <osmocom/sgsn/gprs_sgsn.h> +#include <osmocom/sgsn/sgsn.h> +#include <osmocom/sgsn/debug.h> +#include <osmocom/sgsn/signal.h> +#include <osmocom/sgsn/gtp_ggsn.h> +#include <osmocom/sgsn/gprs_llc_xid.h> +#include <osmocom/sgsn/gprs_sndcp.h> +#include <osmocom/sgsn/gprs_llc.h> +#include <osmocom/sgsn/gprs_sm.h> +#include <osmocom/sgsn/gtp.h> + +LLIST_HEAD(sgsn_pdp_ctxts); + +static const struct rate_ctr_desc pdpctx_ctr_description[] = { + { "udata:packets:in", "User Data Messages ( In)" }, + { "udata:packets:out", "User Data Messages (Out)" }, + { "udata:bytes:in", "User Data Bytes ( In)" }, + { "udata:bytes:out", "User Data Bytes (Out)" }, +}; + +static const struct rate_ctr_group_desc pdpctx_ctrg_desc = { + .group_name_prefix = "sgsn:pdpctx", + .group_description = "SGSN PDP Context Statistics", + .num_ctr = ARRAY_SIZE(pdpctx_ctr_description), + .ctr_desc = pdpctx_ctr_description, + .class_id = OSMO_STATS_CLASS_SUBSCRIBER, +}; + +/* you don't want to use this directly, call sgsn_create_pdp_ctx() */ +struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm, + struct sgsn_ggsn_ctx *ggsn, + uint8_t nsapi) +{ + struct sgsn_pdp_ctx *pdp; + + pdp = sgsn_pdp_ctx_by_nsapi(mm, nsapi); + if (pdp) + return NULL; + + pdp = talloc_zero(tall_sgsn_ctx, struct sgsn_pdp_ctx); + if (!pdp) + return NULL; + + pdp->mm = mm; + pdp->ggsn = ggsn; + pdp->nsapi = nsapi; + pdp->ctrg = rate_ctr_group_alloc(pdp, &pdpctx_ctrg_desc, nsapi); + if (!pdp->ctrg) { + LOGPDPCTXP(LOGL_ERROR, pdp, "Error allocation counter group\n"); + talloc_free(pdp); + return NULL; + } + llist_add(&pdp->list, &mm->pdp_list); + sgsn_ggsn_ctx_add_pdp(pdp->ggsn, pdp); + llist_add(&pdp->g_list, &sgsn_pdp_ctxts); + + return pdp; +} + +/* + * This function will not trigger any GSM DEACT PDP ACK messages, so you + * probably want to call sgsn_delete_pdp_ctx() instead if the connection + * isn't detached already. + */ +void sgsn_pdp_ctx_terminate(struct sgsn_pdp_ctx *pdp) +{ + struct sgsn_signal_data sig_data; + + OSMO_ASSERT(pdp->mm != NULL); + + /* There might still be pending callbacks in libgtp. So the parts of + * this object relevant to GTP need to remain intact in this case. */ + + LOGPDPCTXP(LOGL_INFO, pdp, "Forcing release of PDP context\n"); + + if (pdp->mm->ran_type == MM_CTX_T_GERAN_Gb) { + /* Force the deactivation of the SNDCP layer */ + if (pdp->mm->gb.llme) + sndcp_sm_deactivate_ind(&pdp->mm->gb.llme->lle[pdp->sapi], pdp->nsapi); + } + + memset(&sig_data, 0, sizeof(sig_data)); + sig_data.pdp = pdp; + osmo_signal_dispatch(SS_SGSN, S_SGSN_PDP_TERMINATE, &sig_data); + + /* Detach from MM context */ + pdp_ctx_detach_mm_ctx(pdp); + if (pdp->ggsn) + sgsn_delete_pdp_ctx(pdp); +} + +/* + * Don't call this function directly unless you know what you are doing. + * In normal conditions use sgsn_delete_pdp_ctx and in unspecified or + * implementation dependent abnormal ones sgsn_pdp_ctx_terminate. + */ +void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp) +{ + struct sgsn_signal_data sig_data; + + memset(&sig_data, 0, sizeof(sig_data)); + sig_data.pdp = pdp; + osmo_signal_dispatch(SS_SGSN, S_SGSN_PDP_FREE, &sig_data); + + if (osmo_timer_pending(&pdp->timer)) { + LOGPDPCTXP(LOGL_ERROR, pdp, "Freeing PDP ctx with timer %u pending\n", pdp->T); + osmo_timer_del(&pdp->timer); + } + + rate_ctr_group_free(pdp->ctrg); + if (pdp->mm) + llist_del(&pdp->list); + if (pdp->ggsn) + sgsn_ggsn_ctx_remove_pdp(pdp->ggsn, pdp); + llist_del(&pdp->g_list); + + /* _if_ we still have a library handle, at least set it to NULL + * to avoid any dereferences of the now-deleted PDP context from + * sgsn_libgtp:cb_data_ind() */ + if (pdp->lib) { + struct pdp_t *lib = pdp->lib; + LOGPDPCTXP(LOGL_NOTICE, pdp, "freeing PDP context that still " + "has a libgtp handle attached to it, this shouldn't " + "happen!\n"); + osmo_generate_backtrace(); + lib->priv = NULL; + } + + talloc_free(pdp); +} diff --git a/src/sgsn/sgsn_cdr.c b/src/sgsn/sgsn_cdr.c index c22a6ac..db32644 100644 --- a/src/sgsn/sgsn_cdr.c +++ b/src/sgsn/sgsn_cdr.c @@ -28,6 +28,7 @@ #include <osmocom/sgsn/vty.h> #include <osmocom/sgsn/gtp_ggsn.h> +#include <osmocom/sgsn/pdpctx.h> #include <gtp.h> #include <pdp.h> diff --git a/src/sgsn/sgsn_ctrl.c b/src/sgsn/sgsn_ctrl.c index 278857f..8961f37 100644 --- a/src/sgsn/sgsn_ctrl.c +++ b/src/sgsn/sgsn_ctrl.c @@ -22,6 +22,7 @@ #include <osmocom/ctrl/control_if.h> #include <osmocom/ctrl/control_cmd.h> #include <osmocom/sgsn/gprs_sgsn.h> +#include <osmocom/sgsn/pdpctx.h> #include <osmocom/sgsn/sgsn.h> #include <osmocom/sgsn/debug.h> diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c index dc3f916..19a0f56 100644 --- a/src/sgsn/sgsn_libgtp.c +++ b/src/sgsn/sgsn_libgtp.c @@ -59,6 +59,7 @@ #include <osmocom/sgsn/gtp_mme.h> #include <osmocom/sgsn/sgsn_rim.h> #include <osmocom/sgsn/gprs_bssgp.h> +#include <osmocom/sgsn/pdpctx.h> #include <gtp.h> #include <pdp.h> diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c index 2313a9a..8e94041 100644 --- a/src/sgsn/sgsn_vty.c +++ b/src/sgsn/sgsn_vty.c @@ -42,6 +42,7 @@ #include <osmocom/sgsn/gtp_ggsn.h> #include <osmocom/sgsn/gtp_mme.h> #include <osmocom/sgsn/vty.h> +#include <osmocom/sgsn/pdpctx.h> #include <osmocom/gsupclient/gsup_client.h> #include <osmocom/vty/tdef_vty.h> diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index 853d8f1..8df1395 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -60,6 +60,7 @@ $(top_builddir)/src/sgsn/gprs_sgsn.o \ $(top_builddir)/src/sgsn/gtp_ggsn.o \ $(top_builddir)/src/sgsn/gtp_mme.o \ + $(top_builddir)/src/sgsn/pdpctx.o \ $(top_builddir)/src/sgsn/sgsn_cdr.o \ $(top_builddir)/src/sgsn/sgsn_ctrl.o \ $(top_builddir)/src/sgsn/sgsn_vty.o \ -- To view, visit
https://gerrit.osmocom.org/c/osmo-sgsn/+/30891
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Iad4da06efee7d8514ff48423bdaebc0f26413cc1 Gerrit-Change-Number: 30891 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: lynxis lazus <lynxis(a)fe80.eu> Gerrit-MessageType: merged
2 years, 5 months
1
0
0
0
Change in osmo-sgsn[master]: Move extern declarations of tall_sgsn_ctx to sgsn.h
by pespin
pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-sgsn/+/30930
) Change subject: Move extern declarations of tall_sgsn_ctx to sgsn.h ...................................................................... Move extern declarations of tall_sgsn_ctx to sgsn.h Change-Id: Ifbd54b2e92db8d4a0e0cd1c569cfd83dd85165b8 --- M include/osmocom/sgsn/sgsn.h M src/gprs/sgsn_ares.c M src/sgsn/apn.c M src/sgsn/gprs_gmm.c M src/sgsn/gprs_sgsn.c M src/sgsn/gprs_sm.c M src/sgsn/gprs_subscriber.c M src/sgsn/gtp_mme.c M src/sgsn/sgsn_vty.c 9 files changed, 1 insertion(+), 14 deletions(-) Approvals: Jenkins Builder: Verified dexter: Looks good to me, approved daniel: Looks good to me, but someone else must approve diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h index 0bc88a9..4326846 100644 --- a/include/osmocom/sgsn/sgsn.h +++ b/include/osmocom/sgsn/sgsn.h @@ -159,6 +159,7 @@ }; extern struct sgsn_instance *sgsn; +extern void *tall_sgsn_ctx; /* sgsn_vty.c */ diff --git a/src/gprs/sgsn_ares.c b/src/gprs/sgsn_ares.c index 87314f1..81ab835 100644 --- a/src/gprs/sgsn_ares.c +++ b/src/gprs/sgsn_ares.c @@ -24,8 +24,6 @@ #include <netdb.h> -extern void *tall_sgsn_ctx; - struct cares_event_fd { struct llist_head head; struct osmo_fd fd; diff --git a/src/sgsn/apn.c b/src/sgsn/apn.c index 8ed523e..a89d158 100644 --- a/src/sgsn/apn.c +++ b/src/sgsn/apn.c @@ -27,8 +27,6 @@ #include <osmocom/sgsn/apn.h> #include <osmocom/sgsn/sgsn.h> -extern void *tall_sgsn_ctx; - static struct apn_ctx *sgsn_apn_ctx_alloc(const char *ap_name, const char *imsi_prefix) { struct apn_ctx *actx; diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c index b385ff1..5505ba9 100644 --- a/src/sgsn/gprs_gmm.c +++ b/src/sgsn/gprs_gmm.c @@ -68,7 +68,6 @@ #define PTMSI_ALLOC extern struct sgsn_instance *sgsn; -extern void *tall_sgsn_ctx; static const struct tlv_definition gsm48_gmm_att_tlvdef = { .def = { diff --git a/src/sgsn/gprs_sgsn.c b/src/sgsn/gprs_sgsn.c index 8c2734b..9a3e983 100644 --- a/src/sgsn/gprs_sgsn.c +++ b/src/sgsn/gprs_sgsn.c @@ -62,7 +62,6 @@ #define GPRS_LLME_CHECK_TICK 30 extern struct sgsn_instance *sgsn; -extern void *tall_sgsn_ctx; extern struct osmo_tdef sgsn_T_defs[]; LLIST_HEAD(sgsn_mm_ctxts); diff --git a/src/sgsn/gprs_sm.c b/src/sgsn/gprs_sm.c index 184350d..3177a70 100644 --- a/src/sgsn/gprs_sm.c +++ b/src/sgsn/gprs_sm.c @@ -44,8 +44,6 @@ #include <osmocom/sgsn/gprs_ranap.h> #include <osmocom/sgsn/gtp.h> -extern void *tall_sgsn_ctx; - /* 3GPP TS 04.08 sec 6.1.3.4.3(.a) "Abnormal cases" */ #define T339X_MAX_RETRANS 4 diff --git a/src/sgsn/gprs_subscriber.c b/src/sgsn/gprs_subscriber.c index 943fbc3..416e6a4 100644 --- a/src/sgsn/gprs_subscriber.c +++ b/src/sgsn/gprs_subscriber.c @@ -48,8 +48,6 @@ (gsup)->imsi, \ ## args) -extern void *tall_sgsn_ctx; - LLIST_HEAD(_gprs_subscribers); struct llist_head * const gprs_subscribers = &_gprs_subscribers; diff --git a/src/sgsn/gtp_mme.c b/src/sgsn/gtp_mme.c index 948e8e8..b96c90d 100644 --- a/src/sgsn/gtp_mme.c +++ b/src/sgsn/gtp_mme.c @@ -26,8 +26,6 @@ #include <osmocom/sgsn/gtp_mme.h> #include <osmocom/sgsn/sgsn.h> -extern void *tall_sgsn_ctx; - static bool _eutran_tai_equal(const struct osmo_eutran_tai *t1, const struct osmo_eutran_tai *t2) { return t1->mcc == t2->mcc && diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c index 3d3e8cd..2313a9a 100644 --- a/src/sgsn/sgsn_vty.c +++ b/src/sgsn/sgsn_vty.c @@ -63,8 +63,6 @@ #include <osmocom/ranap/iu_client.h> #endif -extern void *tall_sgsn_ctx; - static struct sgsn_config *g_cfg = NULL; const struct value_string sgsn_auth_pol_strs[] = { -- To view, visit
https://gerrit.osmocom.org/c/osmo-sgsn/+/30930
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Ifbd54b2e92db8d4a0e0cd1c569cfd83dd85165b8 Gerrit-Change-Number: 30930 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
2 years, 5 months
1
0
0
0
← Newer
1
...
136
137
138
139
140
141
142
...
221
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
Results per page:
10
25
50
100
200