aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/sgsn
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-01-05 17:45:25 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2023-01-05 17:45:28 +0100
commitffd6e37eb537d93ce0e60793c14c149cfc76214e (patch)
treeaf7b7149b038fce8919278816310056882a81a65 /include/osmocom/sgsn
parent44bde6b85a0ceb4041ca7fd91d47614a446fbb91 (diff)
Move struct apn_ctx and APN related definitions to its own file
This allows further shrinking of gprs_sgsn.{c,h} and also being able to use GSM_APN_LENGTH on different headers easily (needed by follow-up patch). Change-Id: Id225ed8b84e1376f4a30f17dd4b153b6b1a6efa8
Diffstat (limited to 'include/osmocom/sgsn')
-rw-r--r--include/osmocom/sgsn/Makefile.am1
-rw-r--r--include/osmocom/sgsn/apn.h22
-rw-r--r--include/osmocom/sgsn/gprs_sgsn.h16
-rw-r--r--include/osmocom/sgsn/gprs_subscriber.h2
4 files changed, 26 insertions, 15 deletions
diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am
index fc4f5978c..4d43c6dde 100644
--- a/include/osmocom/sgsn/Makefile.am
+++ b/include/osmocom/sgsn/Makefile.am
@@ -1,4 +1,5 @@
noinst_HEADERS = \
+ apn.h \
common.h \
crc24.h \
debug.h \
diff --git a/include/osmocom/sgsn/apn.h b/include/osmocom/sgsn/apn.h
new file mode 100644
index 000000000..adf62e21f
--- /dev/null
+++ b/include/osmocom/sgsn/apn.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include <osmocom/core/linuxlist.h>
+
+struct sgsn_ggsn_ctx;
+
+#define GSM_APN_LENGTH 102
+
+extern struct llist_head sgsn_apn_ctxts;
+
+struct apn_ctx {
+ struct llist_head list;
+ struct sgsn_ggsn_ctx *ggsn;
+ char *name;
+ char *imsi_prefix;
+ char *description;
+};
+
+struct apn_ctx *sgsn_apn_ctx_find_alloc(const char *name, const char *imsi_prefix);
+void sgsn_apn_ctx_free(struct apn_ctx *actx);
+struct apn_ctx *sgsn_apn_ctx_by_name(const char *name, const char *imsi_prefix);
+struct apn_ctx *sgsn_apn_ctx_match(const char *name, const char *imsi_prefix);
diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h
index 541d854ae..6d51b303e 100644
--- a/include/osmocom/sgsn/gprs_sgsn.h
+++ b/include/osmocom/sgsn/gprs_sgsn.h
@@ -14,10 +14,10 @@
#include <osmocom/gsm/protocol/gsm_23_003.h>
#include <osmocom/crypt/auth.h>
+#include <osmocom/sgsn/apn.h>
#include <osmocom/sgsn/gprs_subscriber.h>
#define GSM_EXTENSION_LENGTH 15
-#define GSM_APN_LENGTH 102
struct gprs_llc_lle;
struct ctrl_handle;
@@ -362,21 +362,7 @@ struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm,
void sgsn_pdp_ctx_terminate(struct sgsn_pdp_ctx *pdp);
void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp);
-struct apn_ctx {
- struct llist_head list;
- struct sgsn_ggsn_ctx *ggsn;
- char *name;
- char *imsi_prefix;
- char *description;
-};
-
-struct apn_ctx *sgsn_apn_ctx_find_alloc(const char *name, const char *imsi_prefix);
-void sgsn_apn_ctx_free(struct apn_ctx *actx);
-struct apn_ctx *sgsn_apn_ctx_by_name(const char *name, const char *imsi_prefix);
-struct apn_ctx *sgsn_apn_ctx_match(const char *name, const char *imsi_prefix);
-
extern struct llist_head sgsn_mm_ctxts;
-extern struct llist_head sgsn_apn_ctxts;
extern struct llist_head sgsn_pdp_ctxts;
uint32_t sgsn_alloc_ptmsi(void);
diff --git a/include/osmocom/sgsn/gprs_subscriber.h b/include/osmocom/sgsn/gprs_subscriber.h
index a961c4581..2e53bdf26 100644
--- a/include/osmocom/sgsn/gprs_subscriber.h
+++ b/include/osmocom/sgsn/gprs_subscriber.h
@@ -6,6 +6,8 @@
#include <osmocom/core/linuxlist.h>
#include <osmocom/gsm/protocol/gsm_23_003.h>
+#include <osmocom/sgsn/apn.h>
+
struct sgsn_instance;
struct sgsn_mm_ctx;