2010-05-01 14:48:27 +00:00
|
|
|
#ifndef _SGSN_H
|
|
|
|
#define _SGSN_H
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#include <osmocore/msgb.h>
|
|
|
|
|
|
|
|
#include <openbsc/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 */
|
|
|
|
struct bsc_fd gtp_fd0;
|
|
|
|
struct bsc_fd gtp_fd1c;
|
|
|
|
struct bsc_fd gtp_fd1u;
|
|
|
|
/* Timer for libGTP */
|
|
|
|
struct timer_list gtp_timer;
|
|
|
|
/* 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-05-01 14:48:27 +00:00
|
|
|
#endif
|