pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30888 )
Change subject: Move gtp related functions to gtp.h ......................................................................
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 --- M include/osmocom/sgsn/gtp.h M include/osmocom/sgsn/sgsn.h 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 M src/sgsn/sgsn_rim.c 9 files changed, 29 insertions(+), 12 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/88/30888/1
diff --git a/include/osmocom/sgsn/gtp.h b/include/osmocom/sgsn/gtp.h index e835b53..d679ccc 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); \ No newline at end of file diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h index bbeaed4..7e78eee 100644 --- a/include/osmocom/sgsn/sgsn.h +++ b/include/osmocom/sgsn/sgsn.h @@ -168,18 +168,6 @@ /* 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 6aa479b..b385ff1 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 b1604f8..d0e9ffc 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 72d744d..af1a61c 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 9ce632c..c157625 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 182528d..157e279 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 f8e09e8..be07d13 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 f28ba60..57f6ea7 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>