aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-01-05 19:19:32 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2023-01-05 19:20:43 +0100
commit8ec269a0e0bffc53b2447f50bb54f8d6f6bb8fd4 (patch)
treeb28bbf68a57b882992621c226e2135099533834f
parent4bd6f663a78148ce144bf0b728e4344e2546dc0d (diff)
Move gtp related functions to gtp.h
The functions are implemented in sgsn_libgtp.c and hence belong to header file gtp.h Change-Id: I7f5cf2895b05e03435769548b61051e6284ccb3c
-rw-r--r--include/osmocom/sgsn/gtp.h22
-rw-r--r--include/osmocom/sgsn/sgsn.h12
-rw-r--r--src/sgsn/gprs_gmm.c1
-rw-r--r--src/sgsn/gprs_mm_state_iu_fsm.c1
-rw-r--r--src/sgsn/gprs_ranap.c1
-rw-r--r--src/sgsn/gprs_sgsn.c1
-rw-r--r--src/sgsn/gprs_sm.c1
-rw-r--r--src/sgsn/gtp_ggsn.c1
-rw-r--r--src/sgsn/sgsn_rim.c1
9 files changed, 29 insertions, 12 deletions
diff --git a/include/osmocom/sgsn/gtp.h b/include/osmocom/sgsn/gtp.h
index e835b536a..2aec55333 100644
--- a/include/osmocom/sgsn/gtp.h
+++ b/include/osmocom/sgsn/gtp.h
@@ -1,8 +1,30 @@
#pragma once
+#include <stddef.h>
+#include <stdint.h>
+
+#include <osmocom/gsm/tlv.h>
+#include <osmocom/gprs/gprs_bssgp_rim.h>
+
+struct gprs_ra_id;
struct sgsn_instance;
+struct sgsn_ggsn_ctx;
+struct sgsn_pdp_ctx;
+struct sgsn_mm_ctx;
+struct sgsn_mme_ctx;
int sgsn_gtp_init(struct sgsn_instance *sgi);
+int sgsn_mme_ran_info_req(struct sgsn_mme_ctx *mme, const struct bssgp_ran_information_pdu *pdu);
+
+void sgsn_ggsn_echo_req(struct sgsn_ggsn_ctx *ggc);
+struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
+ struct sgsn_mm_ctx *mmctx,
+ uint16_t nsapi,
+ struct tlv_parsed *tp);
+
int sgsn_gtp_data_req(struct gprs_ra_id *ra_id, int32_t tlli, uint8_t nsapi,
struct msgb *msg, uint32_t npdu_len, uint8_t *npdu);
+int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx);
+void sgsn_pdp_upd_gtp_u(struct sgsn_pdp_ctx *pdp, void *addr, size_t alen);
+int send_act_pdp_cont_acc(struct sgsn_pdp_ctx *pctx);
diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h
index bbeaed44a..7e78eeea0 100644
--- a/include/osmocom/sgsn/sgsn.h
+++ b/include/osmocom/sgsn/sgsn.h
@@ -168,18 +168,6 @@ char *sgsn_gtp_ntoa(struct ul16_t *ul);
/* sgsn.c */
struct sgsn_instance *sgsn_instance_alloc(void *talloc_ctx);
int sgsn_inst_init(struct sgsn_instance *sgsn);
-
-/* sgsn_libgtp.c */
-struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
- struct sgsn_mm_ctx *mmctx,
- uint16_t nsapi,
- struct tlv_parsed *tp);
-int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx);
-void sgsn_pdp_upd_gtp_u(struct sgsn_pdp_ctx *pdp, void *addr, size_t alen);
-void sgsn_ggsn_echo_req(struct sgsn_ggsn_ctx *ggc);
-int send_act_pdp_cont_acc(struct sgsn_pdp_ctx *pctx);
-int sgsn_mme_ran_info_req(struct sgsn_mme_ctx *mme, const struct bssgp_ran_information_pdu *pdu);
-
/*
* CDR related functionality
*/
diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c
index 6aa479bb3..b385ff11c 100644
--- a/src/sgsn/gprs_gmm.c
+++ b/src/sgsn/gprs_gmm.c
@@ -61,6 +61,7 @@
#include <osmocom/sgsn/gprs_sndcp.h>
#include <osmocom/sgsn/gprs_ranap.h>
#include <osmocom/sgsn/gprs_sm.h>
+#include <osmocom/sgsn/gtp.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 b1604f83b..d0e9ffcdc 100644
--- a/src/sgsn/gprs_mm_state_iu_fsm.c
+++ b/src/sgsn/gprs_mm_state_iu_fsm.c
@@ -29,6 +29,7 @@
#include <osmocom/sgsn/debug.h>
#include <osmocom/sgsn/sgsn.h>
#include <osmocom/sgsn/gprs_ranap.h>
+#include <osmocom/sgsn/gtp.h>
#define X(s) (1 << (s))
diff --git a/src/sgsn/gprs_ranap.c b/src/sgsn/gprs_ranap.c
index 72d744d09..af1a61c02 100644
--- a/src/sgsn/gprs_ranap.c
+++ b/src/sgsn/gprs_ranap.c
@@ -38,6 +38,7 @@
#include <osmocom/sgsn/gprs_gmm_attach.h>
#include <osmocom/sgsn/gprs_mm_state_iu_fsm.h>
#include <osmocom/sgsn/gtp_ggsn.h>
+#include <osmocom/sgsn/gtp.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 9ce632c67..c1576253a 100644
--- a/src/sgsn/gprs_sgsn.c
+++ b/src/sgsn/gprs_sgsn.c
@@ -51,6 +51,7 @@
#include <osmocom/sgsn/gprs_llc.h>
#include <osmocom/sgsn/gprs_sndcp.h>
#include <osmocom/sgsn/gtp_ggsn.h>
+#include <osmocom/sgsn/gtp.h>
#include <pdp.h>
diff --git a/src/sgsn/gprs_sm.c b/src/sgsn/gprs_sm.c
index 182528d04..157e27972 100644
--- a/src/sgsn/gprs_sm.c
+++ b/src/sgsn/gprs_sm.c
@@ -42,6 +42,7 @@
#include <osmocom/sgsn/gprs_llc.h>
#include <osmocom/sgsn/gprs_sndcp.h>
#include <osmocom/sgsn/gprs_ranap.h>
+#include <osmocom/sgsn/gtp.h>
extern void *tall_sgsn_ctx;
diff --git a/src/sgsn/gtp_ggsn.c b/src/sgsn/gtp_ggsn.c
index f8e09e892..be07d13e9 100644
--- a/src/sgsn/gtp_ggsn.c
+++ b/src/sgsn/gtp_ggsn.c
@@ -29,6 +29,7 @@
#include <osmocom/core/stats.h>
#include <osmocom/sgsn/gtp_ggsn.h>
+#include <osmocom/sgsn/gtp.h>
#include <osmocom/sgsn/sgsn.h>
#include <osmocom/sgsn/debug.h>
#include <osmocom/sgsn/gprs_gmm_fsm.h>
diff --git a/src/sgsn/sgsn_rim.c b/src/sgsn/sgsn_rim.c
index f28ba60bf..57f6ea70b 100644
--- a/src/sgsn/sgsn_rim.c
+++ b/src/sgsn/sgsn_rim.c
@@ -12,6 +12,7 @@
#include <osmocom/gprs/gprs_bssgp_rim.h>
#include <osmocom/sgsn/sgsn_rim.h>
#include <osmocom/sgsn/gtp_mme.h>
+#include <osmocom/sgsn/gtp.h>
#include <osmocom/sgsn/debug.h>
#include <osmocom/sgsn/sgsn.h>