Harald Welte | b77c697 | 2010-05-01 11:28:43 +0200 | [diff] [blame] | 1 | #ifndef _GB_PROXY_H |
| 2 | #define _GB_PROXY_H |
| 3 | |
Harald Welte | b77c697 | 2010-05-01 11:28:43 +0200 | [diff] [blame] | 4 | |
Pablo Neira Ayuso | 136f453 | 2011-03-22 16:47:59 +0100 | [diff] [blame] | 5 | #include <osmocom/core/msgb.h> |
Harald Welte | b77c697 | 2010-05-01 11:28:43 +0200 | [diff] [blame] | 6 | |
Harald Welte | ea34a4e | 2012-06-16 14:59:56 +0800 | [diff] [blame] | 7 | #include <osmocom/gprs/gprs_ns.h> |
Harald Welte | 4b037e4 | 2010-05-19 19:45:32 +0200 | [diff] [blame] | 8 | #include <osmocom/vty/command.h> |
Harald Welte | b77c697 | 2010-05-01 11:28:43 +0200 | [diff] [blame] | 9 | |
Jacob Erlbeck | 91fb680 | 2014-05-28 10:59:10 +0200 | [diff] [blame^] | 10 | enum gbproxy_patch_mode { |
| 11 | GBPROX_PATCH_DEFAULT, |
| 12 | GBPROX_PATCH_BSSGP, /*!< BSGGP messages only */ |
| 13 | GBPROX_PATCH_LLC_ATTACH_REQ, /*!< BSSGP and Attach Request */ |
| 14 | GBPROX_PATCH_LLC_ATTACH, /*!< BSSGP and Attach Request/Response */ |
| 15 | GBPROX_PATCH_LLC_GMM, /*!< BSSGP and all GMM msgs */ |
| 16 | GBPROX_PATCH_LLC, /*!< BSSGP and all supported LLC msgs */ |
| 17 | }; |
| 18 | |
Harald Welte | b77c697 | 2010-05-01 11:28:43 +0200 | [diff] [blame] | 19 | struct gbproxy_config { |
| 20 | /* parsed from config file */ |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 21 | uint16_t nsip_sgsn_nsei; |
Harald Welte | b77c697 | 2010-05-01 11:28:43 +0200 | [diff] [blame] | 22 | |
| 23 | /* misc */ |
| 24 | struct gprs_ns_inst *nsi; |
Jacob Erlbeck | 67a4445 | 2014-05-19 10:14:58 +0200 | [diff] [blame] | 25 | |
| 26 | /* force mcc/mnc */ |
| 27 | int core_mnc; |
| 28 | int core_mcc; |
Jacob Erlbeck | 91fb680 | 2014-05-28 10:59:10 +0200 | [diff] [blame^] | 29 | enum gbproxy_patch_mode patch_mode; |
Harald Welte | b77c697 | 2010-05-01 11:28:43 +0200 | [diff] [blame] | 30 | }; |
| 31 | |
Harald Welte | 672f5c4 | 2010-05-03 18:54:58 +0200 | [diff] [blame] | 32 | extern struct gbproxy_config gbcfg; |
Harald Welte | 85801d0 | 2010-05-11 05:49:43 +0200 | [diff] [blame] | 33 | extern struct cmd_element show_gbproxy_cmd; |
Jacob Erlbeck | 4211d79 | 2013-10-24 12:48:23 +0200 | [diff] [blame] | 34 | extern struct cmd_element delete_gb_bvci_cmd; |
| 35 | extern struct cmd_element delete_gb_nsei_cmd; |
Harald Welte | b77c697 | 2010-05-01 11:28:43 +0200 | [diff] [blame] | 36 | |
| 37 | /* gb_proxy_vty .c */ |
| 38 | |
| 39 | int gbproxy_vty_init(void); |
| 40 | int gbproxy_parse_config(const char *config_file, struct gbproxy_config *cfg); |
| 41 | |
| 42 | |
| 43 | /* gb_proxy.c */ |
| 44 | |
| 45 | /* Main input function for Gb proxy */ |
Jacob Erlbeck | e75fec6 | 2013-10-15 12:00:27 +0200 | [diff] [blame] | 46 | int gbprox_rcvmsg(struct msgb *msg, uint16_t nsei, uint16_t ns_bvci, uint16_t nsvci); |
Harald Welte | b77c697 | 2010-05-01 11:28:43 +0200 | [diff] [blame] | 47 | |
Harald Welte | c1c1dd2 | 2010-05-11 06:34:24 +0200 | [diff] [blame] | 48 | int gbprox_signal(unsigned int subsys, unsigned int signal, |
| 49 | void *handler_data, void *signal_data); |
Harald Welte | 1ccbf44 | 2010-05-14 11:53:08 +0000 | [diff] [blame] | 50 | |
| 51 | /* Reset all persistent NS-VC's */ |
| 52 | int gbprox_reset_persistent_nsvcs(struct gprs_ns_inst *nsi); |
| 53 | |
Jacob Erlbeck | b32d3c0 | 2014-07-07 10:45:59 +0200 | [diff] [blame] | 54 | int gbprox_dump_global(FILE *stream, int indent); |
| 55 | int gbprox_dump_peers(FILE *stream, int indent); |
Jacob Erlbeck | 72b401f | 2013-10-24 12:48:55 +0200 | [diff] [blame] | 56 | void gbprox_reset(); |
Harald Welte | b77c697 | 2010-05-01 11:28:43 +0200 | [diff] [blame] | 57 | #endif |