Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 1 | #ifndef _GPRS_SGSN_H |
| 2 | #define _GPRS_SGSN_H |
| 3 | |
Harald Welte | eaa614c | 2010-05-02 11:26:34 +0200 | [diff] [blame] | 4 | #include <stdint.h> |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 5 | #include <netinet/in.h> |
| 6 | |
Holger Hans Peter Freyther | 26d0fe3 | 2012-01-06 17:29:06 +0100 | [diff] [blame] | 7 | #include <osmocom/core/timer.h> |
| 8 | |
Pablo Neira Ayuso | 136f453 | 2011-03-22 16:47:59 +0100 | [diff] [blame] | 9 | #include <osmocom/gsm/gsm48.h> |
Harald Welte | eaa614c | 2010-05-02 11:26:34 +0200 | [diff] [blame] | 10 | |
Harald Welte | 496aee4 | 2010-06-30 19:59:55 +0200 | [diff] [blame] | 11 | #include <osmocom/crypt/gprs_cipher.h> |
Harald Welte | d3fa84d | 2016-04-20 17:50:17 +0200 | [diff] [blame] | 12 | #include <osmocom/gsm/protocol/gsm_23_003.h> |
Neels Hofmeyr | ee6cfdc | 2017-07-13 02:03:50 +0200 | [diff] [blame] | 13 | #include <osmocom/crypt/auth.h> |
Jacob Erlbeck | bd0cf11 | 2014-12-01 12:33:33 +0100 | [diff] [blame] | 14 | |
Harald Welte | 2720e73 | 2010-05-17 00:44:57 +0200 | [diff] [blame] | 15 | #define GSM_EXTENSION_LENGTH 15 |
Jacob Erlbeck | 0e8add6 | 2014-12-17 14:03:35 +0100 | [diff] [blame] | 16 | #define GSM_APN_LENGTH 102 |
Harald Welte | 2720e73 | 2010-05-17 00:44:57 +0200 | [diff] [blame] | 17 | |
Harald Welte | 807a5d8 | 2010-06-01 11:53:01 +0200 | [diff] [blame] | 18 | struct gprs_llc_lle; |
Holger Hans Peter Freyther | a273030 | 2014-03-23 18:08:26 +0100 | [diff] [blame] | 19 | struct ctrl_handle; |
Neels Hofmeyr | 0e5d807 | 2017-01-10 00:49:56 +0100 | [diff] [blame] | 20 | struct gprs_subscr; |
Harald Welte | 807a5d8 | 2010-06-01 11:53:01 +0200 | [diff] [blame] | 21 | |
Jacob Erlbeck | 277b71e | 2015-02-02 18:03:05 +0100 | [diff] [blame] | 22 | enum gsm48_gsm_cause; |
| 23 | |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 24 | /* TS 04.08 4.1.3.3 GMM mobility management states on the network side */ |
Daniel Willmann | 0f46f9c | 2016-05-21 00:00:51 +0200 | [diff] [blame] | 25 | enum gprs_gmm_state { |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 26 | GMM_DEREGISTERED, /* 4.1.3.3.1.1 */ |
| 27 | GMM_COMMON_PROC_INIT, /* 4.1.3.3.1.2 */ |
| 28 | GMM_REGISTERED_NORMAL, /* 4.1.3.3.2.1 */ |
| 29 | GMM_REGISTERED_SUSPENDED, /* 4.1.3.3.2.2 */ |
| 30 | GMM_DEREGISTERED_INIT, /* 4.1.3.3.1.4 */ |
| 31 | }; |
| 32 | |
Daniel Willmann | 5b2363e | 2016-05-21 00:01:21 +0200 | [diff] [blame] | 33 | /* TS 23.060 6.1.1 and 6.1.2 Mobility management states A/Gb and Iu mode */ |
| 34 | enum gprs_pmm_state { |
| 35 | PMM_DETACHED, |
| 36 | PMM_CONNECTED, |
| 37 | PMM_IDLE, |
Alexander Couzens | 4f8da6d | 2017-01-31 15:34:26 +0100 | [diff] [blame] | 38 | MM_IDLE, |
| 39 | MM_READY, |
| 40 | MM_STANDBY, |
Daniel Willmann | 5b2363e | 2016-05-21 00:01:21 +0200 | [diff] [blame] | 41 | }; |
| 42 | |
Harald Welte | c2e8cc4 | 2010-05-31 20:23:38 +0200 | [diff] [blame] | 43 | enum gprs_mm_ctr { |
Harald Welte | 8acd88f | 2010-05-18 10:57:45 +0200 | [diff] [blame] | 44 | GMM_CTR_PKTS_SIG_IN, |
| 45 | GMM_CTR_PKTS_SIG_OUT, |
| 46 | GMM_CTR_PKTS_UDATA_IN, |
| 47 | GMM_CTR_PKTS_UDATA_OUT, |
| 48 | GMM_CTR_BYTES_UDATA_IN, |
| 49 | GMM_CTR_BYTES_UDATA_OUT, |
| 50 | GMM_CTR_PDP_CTX_ACT, |
| 51 | GMM_CTR_SUSPEND, |
| 52 | GMM_CTR_PAGING_PS, |
| 53 | GMM_CTR_PAGING_CS, |
| 54 | GMM_CTR_RA_UPDATE, |
| 55 | }; |
| 56 | |
Harald Welte | efbdee9 | 2010-06-10 00:20:12 +0200 | [diff] [blame] | 57 | enum gprs_pdp_ctx { |
| 58 | PDP_CTR_PKTS_UDATA_IN, |
| 59 | PDP_CTR_PKTS_UDATA_OUT, |
| 60 | PDP_CTR_BYTES_UDATA_IN, |
| 61 | PDP_CTR_BYTES_UDATA_OUT, |
| 62 | }; |
| 63 | |
Harald Welte | c2e8cc4 | 2010-05-31 20:23:38 +0200 | [diff] [blame] | 64 | enum gprs_t3350_mode { |
Jacob Erlbeck | 93eae8e | 2014-10-28 12:23:29 +0100 | [diff] [blame] | 65 | GMM_T3350_MODE_NONE, |
Harald Welte | c2e8cc4 | 2010-05-31 20:23:38 +0200 | [diff] [blame] | 66 | GMM_T3350_MODE_ATT, |
| 67 | GMM_T3350_MODE_RAU, |
| 68 | GMM_T3350_MODE_PTMSI_REALL, |
| 69 | }; |
| 70 | |
Jacob Erlbeck | 423f8bf | 2014-10-24 18:09:54 +0200 | [diff] [blame] | 71 | /* Authorization/ACL handling */ |
| 72 | enum sgsn_auth_state { |
| 73 | SGSN_AUTH_UNKNOWN, |
Jacob Erlbeck | 4adb136 | 2014-12-02 09:47:26 +0100 | [diff] [blame] | 74 | SGSN_AUTH_AUTHENTICATE, |
Neels Hofmeyr | 058cd57 | 2017-02-24 06:24:45 +0100 | [diff] [blame] | 75 | SGSN_AUTH_UMTS_RESYNC, |
Jacob Erlbeck | 423f8bf | 2014-10-24 18:09:54 +0200 | [diff] [blame] | 76 | SGSN_AUTH_ACCEPTED, |
| 77 | SGSN_AUTH_REJECTED |
| 78 | }; |
| 79 | |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 80 | #define MS_RADIO_ACCESS_CAPA |
| 81 | |
Holger Hans Peter Freyther | 39c430e | 2015-05-25 12:26:49 +0800 | [diff] [blame] | 82 | enum sgsn_ggsn_lookup_state { |
| 83 | SGSN_GGSN_2DIGIT, |
| 84 | SGSN_GGSN_3DIGIT, |
| 85 | }; |
| 86 | |
| 87 | struct sgsn_ggsn_lookup { |
| 88 | int state; |
| 89 | |
| 90 | struct sgsn_mm_ctx *mmctx; |
| 91 | |
| 92 | /* APN string */ |
| 93 | char apn_str[GSM_APN_LENGTH]; |
| 94 | |
| 95 | /* the original data */ |
| 96 | struct msgb *orig_msg; |
| 97 | struct tlv_parsed tp; |
| 98 | |
| 99 | /* for dealing with re-transmissions */ |
| 100 | uint8_t nsapi; |
| 101 | uint8_t sapi; |
| 102 | uint8_t ti; |
| 103 | }; |
| 104 | |
Harald Welte | f97ee04 | 2015-12-25 19:12:21 +0100 | [diff] [blame] | 105 | enum sgsn_ran_type { |
| 106 | /* GPRS/EDGE via Gb */ |
| 107 | MM_CTX_T_GERAN_Gb, |
| 108 | /* UMTS via Iu */ |
| 109 | MM_CTX_T_UTRAN_Iu, |
| 110 | /* GPRS/EDGE via Iu */ |
| 111 | MM_CTX_T_GERAN_Iu, |
| 112 | }; |
| 113 | |
| 114 | struct service_info { |
| 115 | uint8_t type; |
| 116 | uint16_t pdp_status; |
| 117 | }; |
| 118 | |
Neels Hofmeyr | a7a3947 | 2017-07-05 15:19:52 +0200 | [diff] [blame] | 119 | struct ranap_ue_conn_ctx; |
Harald Welte | f97ee04 | 2015-12-25 19:12:21 +0100 | [diff] [blame] | 120 | |
Neels Hofmeyr | ee6cfdc | 2017-07-13 02:03:50 +0200 | [diff] [blame] | 121 | struct gsm_auth_tuple { |
| 122 | int use_count; |
| 123 | int key_seq; |
| 124 | struct osmo_auth_vector vec; |
| 125 | }; |
| 126 | #define GSM_KEY_SEQ_INVAL 7 /* GSM 04.08 - 10.5.1.2 */ |
| 127 | |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 128 | /* According to TS 03.60, Table 5: SGSN MM and PDP Contexts */ |
Harald Welte | f533e13 | 2010-05-01 16:45:46 +0200 | [diff] [blame] | 129 | /* Extended by 3GPP TS 23.060, Table 6: SGSN MM and PDP Contexts */ |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 130 | struct sgsn_mm_ctx { |
| 131 | struct llist_head list; |
| 132 | |
Harald Welte | f97ee04 | 2015-12-25 19:12:21 +0100 | [diff] [blame] | 133 | enum sgsn_ran_type ran_type; |
| 134 | |
Harald Welte | d3fa84d | 2016-04-20 17:50:17 +0200 | [diff] [blame] | 135 | char imsi[GSM23003_IMSI_MAX_DIGITS+1]; |
Alexander Couzens | 4f8da6d | 2017-01-31 15:34:26 +0100 | [diff] [blame] | 136 | enum gprs_gmm_state gmm_state; |
Daniel Willmann | 5b2363e | 2016-05-21 00:01:21 +0200 | [diff] [blame] | 137 | enum gprs_pmm_state pmm_state; /* Iu: page when in PMM-IDLE mode */ |
Harald Welte | eaa614c | 2010-05-02 11:26:34 +0200 | [diff] [blame] | 138 | uint32_t p_tmsi; |
Harald Welte | c2e8cc4 | 2010-05-31 20:23:38 +0200 | [diff] [blame] | 139 | uint32_t p_tmsi_old; /* old P-TMSI before new is confirmed */ |
Harald Welte | eaa614c | 2010-05-02 11:26:34 +0200 | [diff] [blame] | 140 | uint32_t p_tmsi_sig; |
Harald Welte | d3fa84d | 2016-04-20 17:50:17 +0200 | [diff] [blame] | 141 | char imei[GSM23003_IMEISV_NUM_DIGITS+1]; |
Harald Welte | f533e13 | 2010-05-01 16:45:46 +0200 | [diff] [blame] | 142 | /* Opt: Software Version Numbber / TS 23.195 */ |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 143 | char msisdn[GSM_EXTENSION_LENGTH]; |
| 144 | struct gprs_ra_id ra; |
Harald Welte | f97ee04 | 2015-12-25 19:12:21 +0100 | [diff] [blame] | 145 | struct { |
| 146 | uint16_t cell_id; /* Gb only */ |
| 147 | uint32_t cell_id_age; /* Gb only */ |
| 148 | uint8_t radio_prio_sms; |
| 149 | |
| 150 | /* Additional bits not present in the GSM TS */ |
| 151 | uint16_t nsei; |
| 152 | uint16_t bvci; |
| 153 | struct gprs_llc_llme *llme; |
| 154 | uint32_t tlli; |
| 155 | uint32_t tlli_new; |
| 156 | } gb; |
| 157 | struct { |
| 158 | int new_key; |
| 159 | uint16_t sac; /* Iu: Service Area Code */ |
| 160 | uint32_t sac_age; /* Iu: Service Area Code age */ |
| 161 | /* CSG ID */ |
| 162 | /* CSG Membership */ |
| 163 | /* Access Mode */ |
| 164 | /* Seelected CN Operator ID (TS 23.251) */ |
| 165 | /* CSG Subscription Data */ |
| 166 | /* LIPA Allowed */ |
| 167 | /* Voice Support Match Indicator */ |
Neels Hofmeyr | a7a3947 | 2017-07-05 15:19:52 +0200 | [diff] [blame] | 168 | struct ranap_ue_conn_ctx *ue_ctx; |
Harald Welte | f97ee04 | 2015-12-25 19:12:21 +0100 | [diff] [blame] | 169 | struct service_info service; |
| 170 | } iu; |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 171 | /* VLR number */ |
Harald Welte | eaa614c | 2010-05-02 11:26:34 +0200 | [diff] [blame] | 172 | uint32_t new_sgsn_addr; |
Jacob Erlbeck | bd0cf11 | 2014-12-01 12:33:33 +0100 | [diff] [blame] | 173 | /* Authentication Triplet */ |
| 174 | struct gsm_auth_tuple auth_triplet; |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 175 | /* Kc */ |
Harald Welte | f533e13 | 2010-05-01 16:45:46 +0200 | [diff] [blame] | 176 | /* Iu: CK, IK, KSI */ |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 177 | /* CKSN */ |
| 178 | enum gprs_ciph_algo ciph_algo; |
Max | 4011e72 | 2016-07-05 15:19:12 +0200 | [diff] [blame] | 179 | /* Auth & Ciphering Request reference from 3GPP TS 24.008 § 10.5.5.19: */ |
| 180 | uint8_t ac_ref_nr_used; |
Harald Welte | f97ee04 | 2015-12-25 19:12:21 +0100 | [diff] [blame] | 181 | |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 182 | struct { |
Harald Welte | eaa614c | 2010-05-02 11:26:34 +0200 | [diff] [blame] | 183 | uint8_t len; |
Alexander Chemeris | 84402c0 | 2013-07-03 10:12:23 +0400 | [diff] [blame] | 184 | uint8_t buf[50]; /* GSM 04.08 10.5.5.12a, extended in TS 24.008 */ |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 185 | } ms_radio_access_capa; |
Harald Welte | f97ee04 | 2015-12-25 19:12:21 +0100 | [diff] [blame] | 186 | /* Supported Codecs (SRVCC) */ |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 187 | struct { |
Harald Welte | eaa614c | 2010-05-02 11:26:34 +0200 | [diff] [blame] | 188 | uint8_t len; |
Alexander Chemeris | 84402c0 | 2013-07-03 10:12:23 +0400 | [diff] [blame] | 189 | uint8_t buf[8]; /* GSM 04.08 10.5.5.12, extended in TS 24.008 */ |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 190 | } ms_network_capa; |
Harald Welte | f97ee04 | 2015-12-25 19:12:21 +0100 | [diff] [blame] | 191 | /* UE Netowrk Capability (E-UTRAN) */ |
Harald Welte | eaa614c | 2010-05-02 11:26:34 +0200 | [diff] [blame] | 192 | uint16_t drx_parms; |
Harald Welte | f97ee04 | 2015-12-25 19:12:21 +0100 | [diff] [blame] | 193 | /* Active Time value for PSM */ |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 194 | int mnrg; /* MS reported to HLR? */ |
| 195 | int ngaf; /* MS reported to MSC/VLR? */ |
| 196 | int ppf; /* paging for GPRS + non-GPRS? */ |
Harald Welte | f97ee04 | 2015-12-25 19:12:21 +0100 | [diff] [blame] | 197 | /* Subscribed Charging Characteristics */ |
| 198 | /* Trace Reference */ |
| 199 | /* Trace Type */ |
| 200 | /* Trigger ID */ |
| 201 | /* OMC Identity */ |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 202 | /* SMS Parameters */ |
| 203 | int recovery; |
Harald Welte | f97ee04 | 2015-12-25 19:12:21 +0100 | [diff] [blame] | 204 | /* Access Restriction */ |
| 205 | /* GPRS CSI (CAMEL) */ |
| 206 | /* MG-CSI (CAMEL) */ |
| 207 | /* Subscribed UE-AMBR */ |
| 208 | /* UE-AMBR */ |
| 209 | /* APN Subscribed */ |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 210 | |
| 211 | struct llist_head pdp_list; |
| 212 | |
Harald Welte | 8acd88f | 2010-05-18 10:57:45 +0200 | [diff] [blame] | 213 | struct rate_ctr_group *ctrg; |
Pablo Neira Ayuso | bf540cb | 2011-05-06 12:11:06 +0200 | [diff] [blame] | 214 | struct osmo_timer_list timer; |
Harald Welte | c2e8cc4 | 2010-05-31 20:23:38 +0200 | [diff] [blame] | 215 | unsigned int T; /* Txxxx number */ |
| 216 | unsigned int num_T_exp; /* number of consecutive T expirations */ |
| 217 | |
| 218 | enum gprs_t3350_mode t3350_mode; |
| 219 | uint8_t t3370_id_type; |
Jacob Erlbeck | 93eae8e | 2014-10-28 12:23:29 +0100 | [diff] [blame] | 220 | uint8_t pending_req; /* the request's message type */ |
| 221 | /* TODO: There isn't much semantic difference between t3350_mode |
| 222 | * (refers to the timer) and pending_req (refers to the procedure), |
| 223 | * where mm->T == 3350 => mm->t3350_mode == f(mm->pending_req). Check |
| 224 | * whether one of them can be dropped. */ |
Jacob Erlbeck | 0c06f98 | 2014-10-29 22:12:20 +0100 | [diff] [blame] | 225 | |
Jacob Erlbeck | 423f8bf | 2014-10-24 18:09:54 +0200 | [diff] [blame] | 226 | enum sgsn_auth_state auth_state; |
Neels Hofmeyr | aa4ed67 | 2018-04-22 19:29:41 +0200 | [diff] [blame] | 227 | enum osmo_sub_auth_type sec_ctx; |
Jacob Erlbeck | 02ab91e | 2014-11-12 09:53:45 +0100 | [diff] [blame] | 228 | |
Holger Hans Peter Freyther | 8ee13e2 | 2015-05-18 10:00:03 +0200 | [diff] [blame] | 229 | /* the string representation of the current hlr */ |
| 230 | char hlr[GSM_EXTENSION_LENGTH]; |
| 231 | |
Holger Hans Peter Freyther | 39c430e | 2015-05-25 12:26:49 +0800 | [diff] [blame] | 232 | /* the current GGSN look-up operation */ |
| 233 | struct sgsn_ggsn_lookup *ggsn_lookup; |
| 234 | |
Neels Hofmeyr | 0e5d807 | 2017-01-10 00:49:56 +0100 | [diff] [blame] | 235 | struct gprs_subscr *subscr; |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 236 | }; |
| 237 | |
Neels Hofmeyr | aa4ed67 | 2018-04-22 19:29:41 +0200 | [diff] [blame] | 238 | static inline bool sgsn_mm_ctx_is_authenticated(struct sgsn_mm_ctx *ctx) |
| 239 | { |
| 240 | switch (ctx->sec_ctx) { |
| 241 | case OSMO_AUTH_TYPE_GSM: |
| 242 | case OSMO_AUTH_TYPE_UMTS: |
| 243 | return true; |
| 244 | default: |
| 245 | return false; |
| 246 | } |
| 247 | } |
| 248 | |
Daniel Willmann | b15ceec | 2014-09-03 15:57:49 +0200 | [diff] [blame] | 249 | #define LOGMMCTXP(level, mm, fmt, args...) \ |
Jacob Erlbeck | 5a38f64 | 2014-10-21 13:09:55 +0200 | [diff] [blame] | 250 | LOGP(DMM, level, "MM(%s/%08x) " fmt, (mm) ? (mm)->imsi : "---", \ |
| 251 | (mm) ? (mm)->p_tmsi : GSM_RESERVED_TMSI, ## args) |
Daniel Willmann | b15ceec | 2014-09-03 15:57:49 +0200 | [diff] [blame] | 252 | |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 253 | /* look-up a SGSN MM context based on TLLI + RAI */ |
Harald Welte | eaa614c | 2010-05-02 11:26:34 +0200 | [diff] [blame] | 254 | struct sgsn_mm_ctx *sgsn_mm_ctx_by_tlli(uint32_t tlli, |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 255 | const struct gprs_ra_id *raid); |
Harald Welte | eaa614c | 2010-05-02 11:26:34 +0200 | [diff] [blame] | 256 | struct sgsn_mm_ctx *sgsn_mm_ctx_by_ptmsi(uint32_t tmsi); |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 257 | struct sgsn_mm_ctx *sgsn_mm_ctx_by_imsi(const char *imsi); |
Daniel Willmann | 6292c8d | 2016-05-21 17:35:57 +0200 | [diff] [blame] | 258 | struct sgsn_mm_ctx *sgsn_mm_ctx_by_ue_ctx(const void *uectx); |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 259 | |
Jacob Erlbeck | 5ac4aad | 2016-01-04 18:43:38 +0100 | [diff] [blame] | 260 | /* look-up by matching TLLI and P-TMSI (think twice before using this) */ |
| 261 | struct sgsn_mm_ctx *sgsn_mm_ctx_by_tlli_and_ptmsi(uint32_t tlli, |
| 262 | const struct gprs_ra_id *raid); |
| 263 | |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 264 | /* Allocate a new SGSN MM context */ |
Alexander Couzens | 2b5fb8e | 2017-02-04 06:01:00 +0100 | [diff] [blame] | 265 | struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_gb(uint32_t tlli, |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 266 | const struct gprs_ra_id *raid); |
Daniel Willmann | 6292c8d | 2016-05-21 17:35:57 +0200 | [diff] [blame] | 267 | struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_iu(void *uectx); |
| 268 | |
Jacob Erlbeck | e671d25 | 2015-01-26 14:43:07 +0100 | [diff] [blame] | 269 | void sgsn_mm_ctx_cleanup_free(struct sgsn_mm_ctx *ctx); |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 270 | |
Jacob Erlbeck | 277b71e | 2015-02-02 18:03:05 +0100 | [diff] [blame] | 271 | struct sgsn_ggsn_ctx *sgsn_mm_ctx_find_ggsn_ctx(struct sgsn_mm_ctx *mmctx, |
| 272 | struct tlv_parsed *tp, |
Holger Hans Peter Freyther | 39c430e | 2015-05-25 12:26:49 +0800 | [diff] [blame] | 273 | enum gsm48_gsm_cause *gsm_cause, |
| 274 | char *apn_str); |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 275 | |
| 276 | enum pdp_ctx_state { |
| 277 | PDP_STATE_NONE, |
Harald Welte | 6abf94e | 2010-05-18 10:35:06 +0200 | [diff] [blame] | 278 | PDP_STATE_CR_REQ, |
| 279 | PDP_STATE_CR_CONF, |
Harald Welte | a9b473a | 2010-12-24 21:13:26 +0100 | [diff] [blame] | 280 | |
| 281 | /* 04.08 / Figure 6.2 / 6.1.2.2 */ |
| 282 | PDP_STATE_INACT_PEND, |
| 283 | PDP_STATE_INACTIVE = PDP_STATE_NONE, |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 284 | }; |
| 285 | |
| 286 | enum pdp_type { |
| 287 | PDP_TYPE_NONE, |
Harald Welte | 6abf94e | 2010-05-18 10:35:06 +0200 | [diff] [blame] | 288 | PDP_TYPE_ETSI_PPP, |
| 289 | PDP_TYPE_IANA_IPv4, |
| 290 | PDP_TYPE_IANA_IPv6, |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 291 | }; |
| 292 | |
| 293 | struct sgsn_pdp_ctx { |
| 294 | struct llist_head list; /* list_head for mmctx->pdp_list */ |
| 295 | struct llist_head g_list; /* list_head for global list */ |
| 296 | struct sgsn_mm_ctx *mm; /* back pointer to MM CTX */ |
Holger Hans Peter Freyther | 39c430e | 2015-05-25 12:26:49 +0800 | [diff] [blame] | 297 | int destroy_ggsn; /* destroy it on destruction */ |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 298 | struct sgsn_ggsn_ctx *ggsn; /* which GGSN serves this PDP */ |
Pau Espin Pedrol | a98fead | 2018-07-09 14:39:47 +0200 | [diff] [blame] | 299 | struct llist_head ggsn_list; /* list_head for ggsn->pdp_list */ |
Harald Welte | efbdee9 | 2010-06-10 00:20:12 +0200 | [diff] [blame] | 300 | struct rate_ctr_group *ctrg; |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 301 | |
| 302 | //unsigned int id; |
| 303 | struct pdp_t *lib; /* pointer to libgtp PDP ctx */ |
| 304 | enum pdp_ctx_state state; |
| 305 | enum pdp_type type; |
| 306 | uint32_t address; |
| 307 | char *apn_subscribed; |
| 308 | //char *apn_used; |
Harald Welte | 6abf94e | 2010-05-18 10:35:06 +0200 | [diff] [blame] | 309 | uint16_t nsapi; /* SNDCP */ |
| 310 | uint16_t sapi; /* LLC */ |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 311 | uint8_t ti; /* transaction identifier */ |
| 312 | int vplmn_allowed; |
| 313 | uint32_t qos_profile_subscr; |
| 314 | //uint32_t qos_profile_req; |
| 315 | //uint32_t qos_profile_neg; |
| 316 | uint8_t radio_prio; |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 317 | //uint32_t charging_id; |
Harald Welte | a9b473a | 2010-12-24 21:13:26 +0100 | [diff] [blame] | 318 | |
Pablo Neira Ayuso | bf540cb | 2011-05-06 12:11:06 +0200 | [diff] [blame] | 319 | struct osmo_timer_list timer; |
Harald Welte | a9b473a | 2010-12-24 21:13:26 +0100 | [diff] [blame] | 320 | unsigned int T; /* Txxxx number */ |
| 321 | unsigned int num_T_exp; /* number of consecutive T expirations */ |
Holger Hans Peter Freyther | 4f5b823 | 2015-05-05 22:25:48 +0200 | [diff] [blame] | 322 | |
| 323 | struct osmo_timer_list cdr_timer; /* CDR record wird timer */ |
| 324 | struct timespec cdr_start; /* The start of the CDR */ |
| 325 | uint64_t cdr_bytes_in; |
| 326 | uint64_t cdr_bytes_out; |
Holger Hans Peter Freyther | 77ff1c4 | 2015-05-12 21:08:42 +0200 | [diff] [blame] | 327 | uint32_t cdr_charging_id; |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 328 | }; |
| 329 | |
Daniel Willmann | b15ceec | 2014-09-03 15:57:49 +0200 | [diff] [blame] | 330 | #define LOGPDPCTXP(level, pdp, fmt, args...) \ |
Jacob Erlbeck | 99985b5 | 2014-10-13 10:32:00 +0200 | [diff] [blame] | 331 | LOGP(DGPRS, level, "PDP(%s/%u) " \ |
| 332 | fmt, (pdp)->mm ? (pdp)->mm->imsi : "---", (pdp)->ti, ## args) |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 333 | |
Harald Welte | 96df606 | 2010-06-03 06:37:26 +0200 | [diff] [blame] | 334 | /* look up PDP context by MM context and NSAPI */ |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 335 | struct sgsn_pdp_ctx *sgsn_pdp_ctx_by_nsapi(const struct sgsn_mm_ctx *mm, |
| 336 | uint8_t nsapi); |
Harald Welte | 96df606 | 2010-06-03 06:37:26 +0200 | [diff] [blame] | 337 | /* look up PDP context by MM context and transaction ID */ |
Harald Welte | 77289c2 | 2010-05-18 14:32:29 +0200 | [diff] [blame] | 338 | struct sgsn_pdp_ctx *sgsn_pdp_ctx_by_tid(const struct sgsn_mm_ctx *mm, |
| 339 | uint8_t tid); |
Harald Welte | 96df606 | 2010-06-03 06:37:26 +0200 | [diff] [blame] | 340 | |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 341 | struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm, |
Pau Espin Pedrol | a98fead | 2018-07-09 14:39:47 +0200 | [diff] [blame] | 342 | struct sgsn_ggsn_ctx *ggsn, |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 343 | uint8_t nsapi); |
Jacob Erlbeck | 99985b5 | 2014-10-13 10:32:00 +0200 | [diff] [blame] | 344 | void sgsn_pdp_ctx_terminate(struct sgsn_pdp_ctx *pdp); |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 345 | void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp); |
| 346 | |
| 347 | |
Harald Welte | 77289c2 | 2010-05-18 14:32:29 +0200 | [diff] [blame] | 348 | struct sgsn_ggsn_ctx { |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 349 | struct llist_head list; |
| 350 | uint32_t id; |
| 351 | unsigned int gtp_version; |
| 352 | struct in_addr remote_addr; |
Harald Welte | a9b473a | 2010-12-24 21:13:26 +0100 | [diff] [blame] | 353 | int remote_restart_ctr; |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 354 | struct gsn_t *gsn; |
Pau Espin Pedrol | a98fead | 2018-07-09 14:39:47 +0200 | [diff] [blame] | 355 | struct llist_head pdp_list; /* list of associated pdp ctx (struct sgsn_pdp_ctx*) */ |
Pau Espin Pedrol | fa12010 | 2018-07-09 20:37:47 +0200 | [diff] [blame] | 356 | struct osmo_timer_list echo_timer; |
| 357 | int echo_interval; |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 358 | }; |
Harald Welte | cd4dd4d | 2010-05-18 17:20:49 +0200 | [diff] [blame] | 359 | struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id); |
Jacob Erlbeck | f345612 | 2015-02-03 19:53:15 +0100 | [diff] [blame] | 360 | void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc); |
Harald Welte | cd4dd4d | 2010-05-18 17:20:49 +0200 | [diff] [blame] | 361 | struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id); |
Harald Welte | a9b473a | 2010-12-24 21:13:26 +0100 | [diff] [blame] | 362 | struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr); |
Harald Welte | cd4dd4d | 2010-05-18 17:20:49 +0200 | [diff] [blame] | 363 | struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id); |
Pau Espin Pedrol | 2cf70e0 | 2018-07-16 11:31:23 +0200 | [diff] [blame] | 364 | void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx); |
Pau Espin Pedrol | a98fead | 2018-07-09 14:39:47 +0200 | [diff] [blame] | 365 | int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn); |
Pau Espin Pedrol | fa12010 | 2018-07-09 20:37:47 +0200 | [diff] [blame] | 366 | void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); |
| 367 | void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 368 | |
| 369 | struct apn_ctx { |
| 370 | struct llist_head list; |
Harald Welte | 77289c2 | 2010-05-18 14:32:29 +0200 | [diff] [blame] | 371 | struct sgsn_ggsn_ctx *ggsn; |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 372 | char *name; |
Jacob Erlbeck | cb1db8b | 2015-02-03 13:47:53 +0100 | [diff] [blame] | 373 | char *imsi_prefix; |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 374 | char *description; |
| 375 | }; |
| 376 | |
Jacob Erlbeck | cb1db8b | 2015-02-03 13:47:53 +0100 | [diff] [blame] | 377 | struct apn_ctx *sgsn_apn_ctx_find_alloc(const char *name, const char *imsi_prefix); |
| 378 | void sgsn_apn_ctx_free(struct apn_ctx *actx); |
| 379 | struct apn_ctx *sgsn_apn_ctx_by_name(const char *name, const char *imsi_prefix); |
| 380 | struct apn_ctx *sgsn_apn_ctx_match(const char *name, const char *imsi_prefix); |
| 381 | |
Harald Welte | d193cb3 | 2010-05-17 22:58:03 +0200 | [diff] [blame] | 382 | extern struct llist_head sgsn_mm_ctxts; |
| 383 | extern struct llist_head sgsn_ggsn_ctxts; |
| 384 | extern struct llist_head sgsn_apn_ctxts; |
| 385 | extern struct llist_head sgsn_pdp_ctxts; |
| 386 | |
Harald Welte | 6463c07 | 2010-05-18 17:04:55 +0200 | [diff] [blame] | 387 | uint32_t sgsn_alloc_ptmsi(void); |
Jacob Erlbeck | 81ffb74 | 2015-01-23 11:33:51 +0100 | [diff] [blame] | 388 | void sgsn_inst_init(void); |
Harald Welte | 6463c07 | 2010-05-18 17:04:55 +0200 | [diff] [blame] | 389 | |
Holger Hans Peter Freyther | a273030 | 2014-03-23 18:08:26 +0100 | [diff] [blame] | 390 | char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len); |
| 391 | |
| 392 | /* |
| 393 | * ctrl interface related work |
| 394 | */ |
| 395 | struct gsm_network; |
Neels Hofmeyr | 7382815 | 2016-02-23 15:10:33 +0100 | [diff] [blame] | 396 | struct ctrl_handle *sgsn_controlif_setup(struct gsm_network *, |
| 397 | const char *bind_addr, uint16_t port); |
Holger Hans Peter Freyther | a273030 | 2014-03-23 18:08:26 +0100 | [diff] [blame] | 398 | int sgsn_ctrl_cmds_install(void); |
| 399 | |
Holger Hans Peter Freyther | 1768a57 | 2014-04-04 12:40:34 +0200 | [diff] [blame] | 400 | /* |
Jacob Erlbeck | 423f8bf | 2014-10-24 18:09:54 +0200 | [diff] [blame] | 401 | * Authorization/ACL handling |
Holger Hans Peter Freyther | 1768a57 | 2014-04-04 12:40:34 +0200 | [diff] [blame] | 402 | */ |
Jacob Erlbeck | 3b5d407 | 2014-10-24 15:11:03 +0200 | [diff] [blame] | 403 | struct imsi_acl_entry { |
| 404 | struct llist_head list; |
| 405 | char imsi[16+1]; |
| 406 | }; |
Jacob Erlbeck | 423f8bf | 2014-10-24 18:09:54 +0200 | [diff] [blame] | 407 | |
Jacob Erlbeck | 0e8add6 | 2014-12-17 14:03:35 +0100 | [diff] [blame] | 408 | /* see GSM 09.02, 17.7.1, PDP-Context and GPRSSubscriptionData */ |
| 409 | /* see GSM 09.02, B.1, gprsSubscriptionData */ |
| 410 | struct sgsn_subscriber_pdp_data { |
| 411 | struct llist_head list; |
| 412 | |
| 413 | unsigned int context_id; |
| 414 | uint16_t pdp_type; |
| 415 | char apn_str[GSM_APN_LENGTH]; |
Holger Hans Peter Freyther | 8cedded | 2015-04-23 11:33:35 -0400 | [diff] [blame] | 416 | uint8_t qos_subscribed[20]; |
| 417 | size_t qos_subscribed_len; |
Holger Hans Peter Freyther | 5db6857 | 2017-07-09 13:18:17 +0200 | [diff] [blame] | 418 | uint8_t pdp_charg[2]; |
| 419 | bool has_pdp_charg; |
Jacob Erlbeck | 0e8add6 | 2014-12-17 14:03:35 +0100 | [diff] [blame] | 420 | }; |
| 421 | |
Jacob Erlbeck | 423f8bf | 2014-10-24 18:09:54 +0200 | [diff] [blame] | 422 | struct sgsn_subscriber_data { |
Jacob Erlbeck | 2e5e94c | 2014-12-08 15:26:47 +0100 | [diff] [blame] | 423 | struct sgsn_mm_ctx *mm; |
Jacob Erlbeck | 7921ab1 | 2014-12-08 15:52:00 +0100 | [diff] [blame] | 424 | struct gsm_auth_tuple auth_triplets[5]; |
| 425 | int auth_triplets_updated; |
Jacob Erlbeck | 0e8add6 | 2014-12-17 14:03:35 +0100 | [diff] [blame] | 426 | struct llist_head pdp_list; |
Jacob Erlbeck | af3d5c5 | 2015-01-05 17:51:17 +0100 | [diff] [blame] | 427 | int error_cause; |
Holger Hans Peter Freyther | 9ba273d | 2015-04-23 09:53:53 -0400 | [diff] [blame] | 428 | |
| 429 | uint8_t msisdn[9]; |
| 430 | size_t msisdn_len; |
Holger Hans Peter Freyther | 10c0f56 | 2015-05-17 20:58:40 +0200 | [diff] [blame] | 431 | |
| 432 | uint8_t hlr[9]; |
| 433 | size_t hlr_len; |
Holger Hans Peter Freyther | 5db6857 | 2017-07-09 13:18:17 +0200 | [diff] [blame] | 434 | |
| 435 | uint8_t pdp_charg[2]; |
| 436 | bool has_pdp_charg; |
Jacob Erlbeck | 423f8bf | 2014-10-24 18:09:54 +0200 | [diff] [blame] | 437 | }; |
| 438 | |
Jacob Erlbeck | d6267d1 | 2015-01-19 11:10:04 +0100 | [diff] [blame] | 439 | #define SGSN_ERROR_CAUSE_NONE (-1) |
| 440 | |
Jacob Erlbeck | 4275578 | 2015-01-08 12:02:12 +0100 | [diff] [blame] | 441 | #define LOGGSUBSCRP(level, subscr, fmt, args...) \ |
Jacob Erlbeck | 9999fd9 | 2015-01-15 17:08:30 +0100 | [diff] [blame] | 442 | LOGP(DGPRS, level, "SUBSCR(%s) " fmt, \ |
| 443 | (subscr) ? (subscr)->imsi : "---", \ |
Jacob Erlbeck | 4275578 | 2015-01-08 12:02:12 +0100 | [diff] [blame] | 444 | ## args) |
| 445 | |
Jacob Erlbeck | 3b5d407 | 2014-10-24 15:11:03 +0200 | [diff] [blame] | 446 | struct sgsn_config; |
| 447 | struct sgsn_instance; |
Jacob Erlbeck | f951a01 | 2014-11-07 14:17:44 +0100 | [diff] [blame] | 448 | extern const struct value_string *sgsn_auth_state_names; |
Jacob Erlbeck | 3b5d407 | 2014-10-24 15:11:03 +0200 | [diff] [blame] | 449 | |
Jacob Erlbeck | a0b6efb | 2014-11-13 10:48:39 +0100 | [diff] [blame] | 450 | void sgsn_auth_init(void); |
Jacob Erlbeck | 3b5d407 | 2014-10-24 15:11:03 +0200 | [diff] [blame] | 451 | struct imsi_acl_entry *sgsn_acl_lookup(const char *imsi, struct sgsn_config *cfg); |
| 452 | int sgsn_acl_add(const char *imsi, struct sgsn_config *cfg); |
| 453 | int sgsn_acl_del(const char *imsi, struct sgsn_config *cfg); |
Jacob Erlbeck | 423f8bf | 2014-10-24 18:09:54 +0200 | [diff] [blame] | 454 | /* Request authorization */ |
Jacob Erlbeck | a0b6efb | 2014-11-13 10:48:39 +0100 | [diff] [blame] | 455 | int sgsn_auth_request(struct sgsn_mm_ctx *mm); |
| 456 | enum sgsn_auth_state sgsn_auth_state(struct sgsn_mm_ctx *mm); |
| 457 | void sgsn_auth_update(struct sgsn_mm_ctx *mm); |
Jacob Erlbeck | 7921ab1 | 2014-12-08 15:52:00 +0100 | [diff] [blame] | 458 | struct gsm_auth_tuple *sgsn_auth_get_tuple(struct sgsn_mm_ctx *mmctx, |
| 459 | unsigned key_seq); |
Jacob Erlbeck | 423f8bf | 2014-10-24 18:09:54 +0200 | [diff] [blame] | 460 | |
Jacob Erlbeck | 33b6dad | 2014-11-12 10:12:11 +0100 | [diff] [blame] | 461 | /* |
| 462 | * GPRS subscriber data |
| 463 | */ |
Neels Hofmeyr | 0e5d807 | 2017-01-10 00:49:56 +0100 | [diff] [blame] | 464 | #define GPRS_SUBSCRIBER_FIRST_CONTACT 0x00000001 |
Jacob Erlbeck | 98a95ac | 2014-11-28 14:55:25 +0100 | [diff] [blame] | 465 | #define GPRS_SUBSCRIBER_UPDATE_AUTH_INFO_PENDING (1 << 16) |
| 466 | #define GPRS_SUBSCRIBER_UPDATE_LOCATION_PENDING (1 << 17) |
| 467 | #define GPRS_SUBSCRIBER_CANCELLED (1 << 18) |
Jacob Erlbeck | 65fa3f7 | 2015-01-06 16:32:41 +0100 | [diff] [blame] | 468 | #define GPRS_SUBSCRIBER_ENABLE_PURGE (1 << 19) |
Jacob Erlbeck | 98a95ac | 2014-11-28 14:55:25 +0100 | [diff] [blame] | 469 | |
| 470 | #define GPRS_SUBSCRIBER_UPDATE_PENDING_MASK ( \ |
| 471 | GPRS_SUBSCRIBER_UPDATE_LOCATION_PENDING | \ |
| 472 | GPRS_SUBSCRIBER_UPDATE_AUTH_INFO_PENDING \ |
| 473 | ) |
Jacob Erlbeck | 33b6dad | 2014-11-12 10:12:11 +0100 | [diff] [blame] | 474 | |
Jacob Erlbeck | 39f040d | 2014-12-18 12:46:47 +0100 | [diff] [blame] | 475 | int gprs_subscr_init(struct sgsn_instance *sgi); |
Jacob Erlbeck | 98a95ac | 2014-11-28 14:55:25 +0100 | [diff] [blame] | 476 | int gprs_subscr_request_update_location(struct sgsn_mm_ctx *mmctx); |
Neels Hofmeyr | 058cd57 | 2017-02-24 06:24:45 +0100 | [diff] [blame] | 477 | int gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, |
| 478 | const uint8_t *auts, |
| 479 | const uint8_t *auts_rand); |
| 480 | int gprs_subscr_auth_sync(struct gprs_subscr *subscr, |
| 481 | const uint8_t *auts, const uint8_t *auts_rand); |
Neels Hofmeyr | 0e5d807 | 2017-01-10 00:49:56 +0100 | [diff] [blame] | 482 | void gprs_subscr_cleanup(struct gprs_subscr *subscr); |
| 483 | struct gprs_subscr *gprs_subscr_get_or_create(const char *imsi); |
| 484 | struct gprs_subscr *gprs_subscr_get_or_create_by_mmctx( struct sgsn_mm_ctx *mmctx); |
| 485 | struct gprs_subscr *gprs_subscr_get_by_imsi(const char *imsi); |
| 486 | void gprs_subscr_cancel(struct gprs_subscr *subscr); |
| 487 | void gprs_subscr_update(struct gprs_subscr *subscr); |
| 488 | void gprs_subscr_update_auth_info(struct gprs_subscr *subscr); |
Jacob Erlbeck | a6ddc2d | 2014-12-12 15:01:37 +0100 | [diff] [blame] | 489 | int gprs_subscr_rx_gsup_message(struct msgb *msg); |
Jacob Erlbeck | 33b6dad | 2014-11-12 10:12:11 +0100 | [diff] [blame] | 490 | |
Jacob Erlbeck | 423f8bf | 2014-10-24 18:09:54 +0200 | [diff] [blame] | 491 | /* Called on subscriber data updates */ |
Jacob Erlbeck | 555b2e5 | 2015-01-26 13:52:42 +0100 | [diff] [blame] | 492 | void sgsn_update_subscriber_data(struct sgsn_mm_ctx *mmctx); |
Holger Hans Peter Freyther | 1768a57 | 2014-04-04 12:40:34 +0200 | [diff] [blame] | 493 | |
Holger Hans Peter Freyther | 90e9a44 | 2014-04-04 12:51:28 +0200 | [diff] [blame] | 494 | int gprs_sndcp_vty_init(void); |
| 495 | struct sgsn_instance; |
| 496 | int sgsn_gtp_init(struct sgsn_instance *sgi); |
| 497 | |
Alexander Couzens | 14314bd | 2016-07-05 09:52:52 +0200 | [diff] [blame] | 498 | void sgsn_rate_ctr_init(); |
| 499 | |
Harald Welte | 9b455bf | 2010-03-14 15:45:01 +0800 | [diff] [blame] | 500 | #endif /* _GPRS_SGSN_H */ |