blob: 2c4378bca421b2afba3aa624fb3108ddcf7983fb [file] [log] [blame]
Harald Welte288be162010-05-01 16:48:27 +02001#ifndef _SGSN_H
2#define _SGSN_H
3
4#include <sys/types.h>
5
6#include <osmocore/msgb.h>
7
8#include <openbsc/gprs_ns.h>
9
10struct sgsn_config {
11 /* parsed from config file */
12 u_int32_t nsip_listen_ip;
13 u_int16_t nsip_listen_port;
14
Harald Welte2720e732010-05-17 00:44:57 +020015 char *gtp_statedir;
16 struct sockaddr_in gtp_listenaddr;
17
Harald Welte288be162010-05-01 16:48:27 +020018 /* misc */
19 struct gprs_ns_inst *nsi;
20};
21
Harald Welte2720e732010-05-17 00:44:57 +020022struct sgsn_instance {
23 char *config_file;
24 struct sgsn_config cfg;
25 /* File descriptor wrappers for LibGTP */
26 struct bsc_fd gtp_fd0;
27 struct bsc_fd gtp_fd1c;
28 struct bsc_fd gtp_fd1u;
29 /* Timer for libGTP */
30 struct timer_list gtp_timer;
31 /* GSN instance for libgtp */
32 struct gsn_t *gsn;
33};
34
Harald Welte288be162010-05-01 16:48:27 +020035
36/* sgsn_vty.c */
37
38int sgsn_vty_init(void);
39int sgsn_parse_config(const char *config_file, struct sgsn_config *cfg);
40
41/* sgsn.c */
42
43/* Main input function for Gb proxy */
44int sgsn_rcvmsg(struct msgb *msg, struct gprs_nsvc *nsvc, uint16_t ns_bvci);
45
46#endif