2010-05-01 14:48:27 +00:00
|
|
|
#ifndef _SGSN_H
|
|
|
|
#define _SGSN_H
|
|
|
|
|
|
|
|
|
2011-03-22 15:47:59 +00:00
|
|
|
#include <osmocom/core/msgb.h>
|
2010-05-01 14:48:27 +00:00
|
|
|
|
2012-06-16 06:59:56 +00:00
|
|
|
#include <osmocom/gprs/gprs_ns.h>
|
2010-05-18 08:35:06 +00:00
|
|
|
#include <openbsc/gprs_sgsn.h>
|
2010-05-01 14:48:27 +00:00
|
|
|
|
|
|
|
struct sgsn_config {
|
|
|
|
/* parsed from config file */
|
|
|
|
|
2010-05-16 22:44:57 +00:00
|
|
|
char *gtp_statedir;
|
|
|
|
struct sockaddr_in gtp_listenaddr;
|
|
|
|
|
2010-05-01 14:48:27 +00:00
|
|
|
/* misc */
|
|
|
|
struct gprs_ns_inst *nsi;
|
|
|
|
};
|
|
|
|
|
2010-05-16 22:44:57 +00:00
|
|
|
struct sgsn_instance {
|
|
|
|
char *config_file;
|
|
|
|
struct sgsn_config cfg;
|
|
|
|
/* File descriptor wrappers for LibGTP */
|
2011-05-06 10:11:23 +00:00
|
|
|
struct osmo_fd gtp_fd0;
|
|
|
|
struct osmo_fd gtp_fd1c;
|
|
|
|
struct osmo_fd gtp_fd1u;
|
2010-05-16 22:44:57 +00:00
|
|
|
/* Timer for libGTP */
|
2011-05-06 10:11:06 +00:00
|
|
|
struct osmo_timer_list gtp_timer;
|
2010-05-16 22:44:57 +00:00
|
|
|
/* GSN instance for libgtp */
|
|
|
|
struct gsn_t *gsn;
|
|
|
|
};
|
|
|
|
|
2010-05-16 22:53:10 +00:00
|
|
|
extern struct sgsn_instance *sgsn;
|
2010-05-01 14:48:27 +00:00
|
|
|
|
|
|
|
/* sgsn_vty.c */
|
|
|
|
|
|
|
|
int sgsn_vty_init(void);
|
|
|
|
int sgsn_parse_config(const char *config_file, struct sgsn_config *cfg);
|
|
|
|
|
|
|
|
/* sgsn.c */
|
|
|
|
|
|
|
|
/* Main input function for Gb proxy */
|
|
|
|
int sgsn_rcvmsg(struct msgb *msg, struct gprs_nsvc *nsvc, uint16_t ns_bvci);
|
|
|
|
|
2010-05-18 08:35:06 +00:00
|
|
|
|
2010-05-18 12:32:29 +00:00
|
|
|
struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
|
2010-05-18 08:35:06 +00:00
|
|
|
struct sgsn_mm_ctx *mmctx,
|
|
|
|
uint16_t nsapi,
|
|
|
|
struct tlv_parsed *tp);
|
2010-05-18 12:32:29 +00:00
|
|
|
int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx);
|
|
|
|
|
2010-06-01 16:28:10 +00:00
|
|
|
/* gprs_sndcp.c */
|
|
|
|
|
|
|
|
/* Entry point for the SNSM-ACTIVATE.indication */
|
|
|
|
int sndcp_sm_activate_ind(struct gprs_llc_lle *lle, uint8_t nsapi);
|
2010-06-03 19:21:21 +00:00
|
|
|
/* Entry point for the SNSM-DEACTIVATE.indication */
|
|
|
|
int sndcp_sm_deactivate_ind(struct gprs_llc_lle *lle, uint8_t nsapi);
|
2010-06-01 16:28:10 +00:00
|
|
|
/* Called by SNDCP when it has received/re-assembled a N-PDU */
|
2010-07-01 17:56:19 +00:00
|
|
|
int sgsn_rx_sndcp_ud_ind(struct gprs_ra_id *ra_id, int32_t tlli, uint8_t nsapi,
|
|
|
|
struct msgb *msg, uint32_t npdu_len, uint8_t *npdu);
|
2010-06-03 04:38:38 +00:00
|
|
|
int sndcp_unitdata_req(struct msgb *msg, struct gprs_llc_lle *lle, uint8_t nsapi,
|
|
|
|
void *mmcontext);
|
2011-10-14 21:42:13 +00:00
|
|
|
int sndcp_llunitdata_ind(struct msgb *msg, struct gprs_llc_lle *lle,
|
|
|
|
uint8_t *hdr, uint16_t len);
|
2010-06-01 16:28:10 +00:00
|
|
|
|
2010-05-01 14:48:27 +00:00
|
|
|
#endif
|