Pau Espin Pedrol | 5f5fcff | 2018-01-25 18:09:02 +0100 | [diff] [blame] | 1 | /* |
Harald Welte | 632e843 | 2017-09-05 18:12:14 +0200 | [diff] [blame] | 2 | * OsmoGGSN - Gateway GPRS Support Node |
jjako | a7cd249 | 2003-04-11 09:40:12 +0000 | [diff] [blame] | 3 | * Copyright (C) 2002, 2003 Mondru AB. |
Harald Welte | 632e843 | 2017-09-05 18:12:14 +0200 | [diff] [blame] | 4 | * Copyright (C) 2017 Harald Welte <laforge@gnumonks.org> |
Pau Espin Pedrol | 5f5fcff | 2018-01-25 18:09:02 +0100 | [diff] [blame] | 5 | * |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 6 | * The contents of this file may be used under the terms of the GNU |
| 7 | * General Public License Version 2, provided that the above copyright |
| 8 | * notice and this permission notice is included in all copies or |
| 9 | * substantial portions of the software. |
Pau Espin Pedrol | 5f5fcff | 2018-01-25 18:09:02 +0100 | [diff] [blame] | 10 | * |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 11 | */ |
| 12 | |
| 13 | #ifndef _PDP_H |
| 14 | #define _PDP_H |
| 15 | |
Harald Welte | 3c1cce2 | 2017-09-24 16:40:12 +0800 | [diff] [blame] | 16 | #include <stdbool.h> |
| 17 | |
Harald Welte | e257be1 | 2017-08-12 14:55:09 +0200 | [diff] [blame] | 18 | struct gsn_t; |
| 19 | |
Max | 6a21527 | 2017-09-25 10:35:34 +0200 | [diff] [blame] | 20 | #define LOGPDPX(ss, level, pdp, fmt, args...) \ |
| 21 | LOGP(ss, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) |
| 22 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 23 | #define PDP_MAX 1024 /* Max number of PDP contexts */ |
| 24 | #define PDP_MAXNSAPI 16 /* Max number of NSAPI */ |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 25 | |
Harald Welte | cee7546 | 2017-09-24 17:45:05 +0800 | [diff] [blame] | 26 | #define PDP_EUA_ORG_IETF 0xF1 |
| 27 | #define PDP_EUA_TYPE_v4 0x21 |
| 28 | #define PDP_EUA_TYPE_v6 0x57 |
Pau Espin Pedrol | 2d6a69e | 2017-12-06 19:26:25 +0100 | [diff] [blame] | 29 | #define PDP_EUA_TYPE_v4v6 0x8D |
Harald Welte | cee7546 | 2017-09-24 17:45:05 +0800 | [diff] [blame] | 30 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 31 | /* GTP Information elements from 29.060 v3.9.0 7.7 Information Elements */ |
| 32 | /* Also covers version 0. Note that version 0 6: QOS Profile was superceded * |
| 33 | * by 135: QOS Profile in version 1 */ |
| 34 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 35 | struct sl_t { |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 36 | unsigned int l; |
| 37 | char *v; |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 38 | }; |
| 39 | |
| 40 | struct ul_t { |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 41 | unsigned int l; |
| 42 | unsigned char *v; |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | struct ul16_t { |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 46 | unsigned int l; |
| 47 | unsigned char v[16]; |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | struct ul66_t { |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 51 | unsigned int l; |
| 52 | unsigned char v[66]; |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 53 | }; |
| 54 | |
| 55 | struct ul255_t { |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 56 | unsigned int l; |
| 57 | unsigned char v[255]; |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 58 | }; |
| 59 | |
jjako | 2c38133 | 2003-10-21 19:09:53 +0000 | [diff] [blame] | 60 | /* ***************************************************************** |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 61 | * Information storage for each PDP context |
| 62 | * |
jjako | 2c38133 | 2003-10-21 19:09:53 +0000 | [diff] [blame] | 63 | * Information storage for each PDP context is defined in 23.060 |
| 64 | * section 13.3 and 03.60. Includes IMSI, MSISDN, APN, PDP-type, |
| 65 | * PDP-address (IP address), sequence numbers, charging ID. For the |
| 66 | * SGSN it also includes radio related mobility information. |
| 67 | * |
| 68 | * The following structure is a combination of the storage |
| 69 | * requirements for each PDP context for the GGSN and SGSN. It |
| 70 | * contains both 23.060 as well as 03.60 parameters. Information is |
| 71 | * stored in the format for information elements described in 29.060 |
| 72 | * and 09.60. |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 73 | * 31 * 4 + 15 structs + = 120 + 15 structs ~ 2k / context |
| 74 | * Structs: IP address 16+4 bytes (6), APN 255 bytes (2) |
Pau Espin Pedrol | 5f5fcff | 2018-01-25 18:09:02 +0100 | [diff] [blame] | 75 | * QOS: 255 bytes (3), msisdn 16 bytes (1), |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 76 | * |
| 77 | * TODO: We need to consider who manages the pdp_t hash tables |
| 78 | * Is it gtp_lib, or is it the application? |
Pau Espin Pedrol | 5f5fcff | 2018-01-25 18:09:02 +0100 | [diff] [blame] | 79 | * I suppose that it will be gtp_lib. |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 80 | * SGSN will ask gtplib for new pdp_t. Fill out the fields, |
| 81 | * and pass it on to gtp_create_pdp_req. |
| 82 | * GGSN will receive gtp_create_pdp_ind, create new pdp_t and |
| 83 | * send responce to SGSN. |
Pau Espin Pedrol | 5f5fcff | 2018-01-25 18:09:02 +0100 | [diff] [blame] | 84 | * SGSN will receive response and gtplib will find the |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 85 | * original pdp_t corresponding to the request. This will be |
| 86 | * passed on to the application. |
| 87 | * Eventually the SGSN will close the connection, and the |
| 88 | * pdp_t will be freed by gtplib in SGSN and GGSN |
| 89 | * This means that gtplib need to have functions to |
| 90 | * allocate, free, sort and find pdp_t |
| 91 | * (newpdp, freepdp, getpdp) |
Pau Espin Pedrol | 5f5fcff | 2018-01-25 18:09:02 +0100 | [diff] [blame] | 92 | * Hash tables: TID, IMSI, IP etc.) |
jjako | 2c38133 | 2003-10-21 19:09:53 +0000 | [diff] [blame] | 93 | * |
| 94 | * |
Pau Espin Pedrol | 5f5fcff | 2018-01-25 18:09:02 +0100 | [diff] [blame] | 95 | * Secondary PDP Context Activation Procedure |
jjako | 2c38133 | 2003-10-21 19:09:53 +0000 | [diff] [blame] | 96 | * |
| 97 | * With GTP version 1 it is possible to establish multiple PDP |
| 98 | * contexts with the same IP address. With this scheme the first |
| 99 | * context is established as normal. Following contexts are |
| 100 | * established by referencing one of the allready existing ones. Each |
| 101 | * context is uniquely identified by IMSI and NSAPI. Each context is |
| 102 | * allocated an tei_di, but they all share the same tei_c. |
| 103 | * |
| 104 | * For Delete PDP Context the context is referenced by tei_c and |
| 105 | * nsapi. As an option it is possible to include a teardown indicater, |
| 106 | * in which case all PDP contexts with the same tei_c (IP address) are |
| 107 | * deleted. |
| 108 | * |
| 109 | * For Update PDP Context the context is normally referenced by tei_c |
| 110 | * and nsapi. If moving from GTP0 to GTP1 during an update the context |
| 111 | * is referenced instead by IMSI and NSAPI. |
| 112 | *****************************************************************/ |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 113 | |
| 114 | struct pdp_t { |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 115 | /* Parameter determining if this PDP is in use. */ |
| 116 | uint8_t inuse; /* 0=free. 1=used by somebody */ |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 117 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 118 | /* Pointers related to hash tables */ |
| 119 | struct pdp_t *tidnext; |
| 120 | struct pdp_t *ipnext; |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 121 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 122 | /* Parameters shared by all PDP context belonging to the same MS */ |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 123 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 124 | void *ipif; /* IP network interface */ |
Pau Espin Pedrol | 2d6a69e | 2017-12-06 19:26:25 +0100 | [diff] [blame] | 125 | void *peer[2]; /* Pointer to peer protocol */ |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 126 | void *asap; /* Application specific service access point */ |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 127 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 128 | uint64_t imsi; /* International Mobile Subscriber Identity. */ |
| 129 | struct ul16_t msisdn; /* The basic MSISDN of the MS. */ |
| 130 | uint8_t mnrg; /* Indicates whether the MS is marked as not reachable for PS at the HLR. (1 bit, not transmitted) */ |
| 131 | uint8_t cch_sub; /* The charging characteristics for the MS, e.g. normal, prepaid, flat-rate, and/or hot billing subscription. (not transmitted) */ |
| 132 | uint16_t traceref; /* Identifies a record or a collection of records for a particular trace. */ |
| 133 | uint16_t tracetype; /* Indicates the type of trace. */ |
| 134 | struct ul_t triggerid; /* Identifies the entity that initiated the trace. */ |
| 135 | struct ul_t omcid; /* Identifies the OMC that shall receive the trace record(s). */ |
| 136 | uint8_t rec_hlr; /* Indicates if HLR or VLR is performing database recovery. (1 bit, not transmitted) */ |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 137 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 138 | /* Parameters specific to each individual PDP context */ |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 139 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 140 | uint8_t pdp_id; /* Index of the PDP context. (PDP context identifier) */ |
| 141 | uint8_t pdp_state; /* PDP State Packet data protocol state, INACTIVE or ACTIVE. (1 bit, not transmitted) */ |
| 142 | /* struct ul_t pdp_type; * PDP type; e.g. PPP or IP. */ |
| 143 | /* struct ul_t pdp_addr; * PDP address; e.g. an IP address. */ |
| 144 | struct ul66_t eua; /* End user address. PDP type and address combined */ |
| 145 | uint8_t pdp_dyn; /* Indicates whether PDP Address is static or dynamic. (1 bit, not transmitted) */ |
| 146 | struct ul255_t apn_req; /* The APN requested. */ |
| 147 | struct ul255_t apn_sub; /* The APN received from the HLR. */ |
| 148 | struct ul255_t apn_use; /* The APN Network Identifier currently used. */ |
| 149 | uint8_t nsapi; /* Network layer Service Access Point Identifier. (4 bit) */ |
| 150 | uint16_t ti; /* Transaction Identifier. (4 or 12 bit) */ |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 151 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 152 | uint32_t teic_own; /* (Own Tunnel Endpoint Identifier Control) */ |
| 153 | uint32_t teid_own; /* (Own Tunnel Endpoint Identifier Data I) */ |
| 154 | uint32_t teic_gn; /* Tunnel Endpoint Identifier for the Gn and Gp interfaces. (Control plane) */ |
| 155 | uint32_t teid_gn; /* Tunnel Endpoint Identifier for the Gn and Gp interfaces. (Data I) */ |
| 156 | uint32_t tei_iu; /* Tunnel Endpoint Identifier for the Iu interface. */ |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 157 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 158 | uint16_t fllc; /* (Local Flow Label Control, gtp0) */ |
| 159 | uint16_t fllu; /* (Local Flow Label Data I, gtp0) */ |
| 160 | uint16_t flrc; /* (Remote gn/gp Flow Label Control, gtp0) */ |
| 161 | uint16_t flru; /* (Remote gn/gp Flow Label Data I, gtp0) */ |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 162 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 163 | struct ul255_t tft; /* Traffic flow template. */ |
| 164 | /*struct ul16_t sgsnc; * The IP address of the SGSN currently serving this MS. (Control plane) */ |
| 165 | /*struct ul16_t sgsnu; * The IP address of the SGSN currently serving this MS. (User plane) */ |
| 166 | /*struct ul16_t ggsnc; * The IP address of the GGSN currently used. (Control plane) */ |
| 167 | /*struct ul16_t ggsnu; * The IP address of the GGSN currently used. (User plane) */ |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 168 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 169 | struct ul16_t gsnlc; /* The IP address of the local GSN. (Control plane) */ |
| 170 | struct ul16_t gsnlu; /* The IP address of the local GSN. (User plane) */ |
| 171 | struct ul16_t gsnrc; /* The IP address of the remote GSN. (Control plane) */ |
| 172 | struct ul16_t gsnru; /* The IP address of the remote GSN. (User plane) */ |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 173 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 174 | uint8_t vplmn_allow; /* Specifies whether the MS is allowed to use the APN in the domain of the HPLMN only, or additionally the APN in the domain of the VPLMN. (1 bit) */ |
| 175 | uint8_t qos_sub0[3]; /* The quality of service profile subscribed. */ |
| 176 | uint8_t qos_req0[3]; /* The quality of service profile requested. */ |
| 177 | uint8_t qos_neg0[3]; /* The quality of service profile negotiated. */ |
| 178 | struct ul255_t qos_sub; /* The quality of service profile subscribed. */ |
| 179 | struct ul255_t qos_req; /* The quality of service profile requested. */ |
| 180 | struct ul255_t qos_neg; /* The quality of service profile negotiated. */ |
| 181 | uint8_t radio_pri; /* The RLC/MAC radio priority level for uplink user data transmission. (4 bit) */ |
| 182 | uint16_t flow_id; /* Packet flow identifier. */ |
| 183 | /* struct ul_t bssqos_neg; * The aggregate BSS quality of service profile negotiated for the packet flow that this PDP context belongs to. (NOT GTP) */ |
| 184 | uint8_t sndcpd; /* SNDCP sequence number of the next downlink N-PDU to be sent to the MS. */ |
| 185 | uint8_t sndcpu; /* SNDCP sequence number of the next uplink N-PDU expected from the MS. */ |
| 186 | uint8_t rec_sgsn; /* Indicates if the SGSN is performing database recovery. (1 bit, not transmitted) */ |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 187 | /* uint16_t gtpsnd; GTP-U sequence number of the next downlink N-PDU to be sent to the SGSN / received from the GGSN. */ |
| 188 | /* uint16_t gtpsnu; GTP-U sequence number of the next uplink N-PDU to be received from the SGSN / sent to the GGSN */ |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 189 | uint16_t gtpsntx; /* GTP-U sequence number of the next downlink N-PDU to be sent (09.60 section 8.1.1.1) */ |
| 190 | uint16_t gtpsnrx; /* GTP-U sequence number of the next uplink N-PDU to be received (09.60 section 8.1.1.1) */ |
| 191 | uint8_t pdcpsndd; /* Sequence number of the next downlink in-sequence PDCP-PDU to be sent to the MS. */ |
| 192 | uint8_t pdcpsndu; /* Sequence number of the next uplink in-sequence PDCP-PDU expected from the MS. */ |
| 193 | uint32_t cid; /* Charging identifier, identifies charging records generated by SGSN and GGSN. */ |
| 194 | uint16_t cch_pdp; /* The charging characteristics for this PDP context, e.g. normal, prepaid, flat-rate, and/or hot billing. */ |
| 195 | struct ul16_t rnc_addr; /* The IP address of the RNC currently used. */ |
| 196 | uint8_t reorder; /* Specifies whether the GGSN shall reorder N-PDUs received from the SGSN / Specifies whether the SGSN shall reorder N-PDUs before delivering the N-PSUs to the MS. (1 bit) */ |
| 197 | struct ul255_t pco_req; /* Requested packet control options. */ |
| 198 | struct ul255_t pco_neg; /* Negotiated packet control options. */ |
| 199 | uint32_t selmode; /* Selection mode. */ |
| 200 | struct ul255_t rattype; /* Radio Access Technology Type */ |
| 201 | int rattype_given; /* Radio Access Technology Type given */ |
| 202 | struct ul255_t userloc; /* User Location Information */ |
| 203 | int userloc_given; /* User Location Information given */ |
| 204 | struct ul255_t rai; /* Routing Area Information */ |
| 205 | int rai_given; /* Routing Area Information given */ |
| 206 | struct ul255_t mstz; /* MS Time Zone */ |
| 207 | int mstz_given; /* MS Time Zone given */ |
| 208 | struct ul255_t imeisv; /* IMEI Software Version */ |
| 209 | int imeisv_given; /* IMEI Software Version given */ |
| 210 | int norecovery_given; /* norecovery given */ |
jjako | 08d331d | 2003-10-13 20:33:30 +0000 | [diff] [blame] | 211 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 212 | /* Additional parameters used by library */ |
jjako | 08d331d | 2003-10-13 20:33:30 +0000 | [diff] [blame] | 213 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 214 | int version; /* Protocol version currently in use. 0 or 1 */ |
jjako | 08d331d | 2003-10-13 20:33:30 +0000 | [diff] [blame] | 215 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 216 | uint64_t tid; /* Combination of imsi and nsapi */ |
| 217 | uint16_t seq; /* Sequence number of last request */ |
| 218 | struct sockaddr_in sa_peer; /* Address of last request */ |
| 219 | int fd; /* File descriptor request was received on */ |
jjako | 2c38133 | 2003-10-21 19:09:53 +0000 | [diff] [blame] | 220 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 221 | uint8_t teic_confirmed; /* 0: Not confirmed. 1: Confirmed */ |
jjako | 2c38133 | 2003-10-21 19:09:53 +0000 | [diff] [blame] | 222 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 223 | /* Parameters used for secondary activation procedure (tei data) */ |
| 224 | /* If (secondary == 1) then teic_own indicates linked PDP context */ |
| 225 | uint8_t secondary; /* 0: Primary (control). 1: Secondary (data only) */ |
| 226 | uint8_t nodata; /* 0: User plane PDP context. 1: No user plane */ |
jjako | 2c38133 | 2003-10-21 19:09:53 +0000 | [diff] [blame] | 227 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 228 | /* Secondary contexts of this primary context */ |
| 229 | uint32_t secondary_tei[PDP_MAXNSAPI]; |
jjako | 193e8b1 | 2003-11-10 12:31:41 +0000 | [diff] [blame] | 230 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 231 | /* IP address used for Create and Update PDP Context Requests */ |
| 232 | struct in_addr hisaddr0; /* Server address */ |
| 233 | struct in_addr hisaddr1; /* Server address */ |
jjako | 193e8b1 | 2003-11-10 12:31:41 +0000 | [diff] [blame] | 234 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 235 | /* to be used by libgtp callers/users (to attach their own private state) */ |
| 236 | void *priv; |
Harald Welte | e257be1 | 2017-08-12 14:55:09 +0200 | [diff] [blame] | 237 | |
| 238 | struct gsn_t *gsn; |
Harald Welte | 3c1cce2 | 2017-09-24 16:40:12 +0800 | [diff] [blame] | 239 | |
| 240 | bool tx_gpdu_seq; /* Transmit (true) or suppress G-PDU sequence numbers */ |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 241 | }; |
| 242 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 243 | /* functions related to pdp_t management */ |
| 244 | int pdp_init(); |
| 245 | int pdp_newpdp(struct pdp_t **pdp, uint64_t imsi, uint8_t nsapi, |
| 246 | struct pdp_t *pdp_old); |
| 247 | int pdp_freepdp(struct pdp_t *pdp); |
| 248 | int pdp_getpdp(struct pdp_t **pdp); |
| 249 | |
| 250 | int pdp_getgtp0(struct pdp_t **pdp, uint16_t fl); |
jjako | 08d331d | 2003-10-13 20:33:30 +0000 | [diff] [blame] | 251 | int pdp_getgtp1(struct pdp_t **pdp, uint32_t tei); |
Harald Welte | 37d5b15 | 2017-08-12 23:58:29 +0200 | [diff] [blame] | 252 | int pdp_getgtp1_peer_d(struct pdp_t **pdp, const struct sockaddr_in *peer, uint32_t teid_gn); |
jjako | 08d331d | 2003-10-13 20:33:30 +0000 | [diff] [blame] | 253 | |
| 254 | int pdp_getimsi(struct pdp_t **pdp, uint64_t imsi, uint8_t nsapi); |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 255 | |
| 256 | int pdp_tidhash(uint64_t tid); |
| 257 | int pdp_tidset(struct pdp_t *pdp, uint64_t tid); |
| 258 | int pdp_tiddel(struct pdp_t *pdp); |
| 259 | int pdp_tidget(struct pdp_t **pdp, uint64_t tid); |
| 260 | |
Pablo Neira Ayuso | 746b944 | 2014-03-24 17:58:27 +0100 | [diff] [blame] | 261 | void pdp_set_imsi_nsapi(struct pdp_t *pdp, uint64_t teid); |
| 262 | |
Pau Espin Pedrol | 9ee8d32 | 2019-05-30 14:11:22 +0200 | [diff] [blame] | 263 | unsigned int pdp_count_secondary(struct pdp_t *pdp); |
| 264 | |
jjako | a7cd249 | 2003-04-11 09:40:12 +0000 | [diff] [blame] | 265 | /* |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 266 | int pdp_iphash(void* ipif, struct ul66_t *eua); |
| 267 | int pdp_ipset(struct pdp_t *pdp, void* ipif, struct ul66_t *eua); |
| 268 | int pdp_ipdel(struct pdp_t *pdp); |
| 269 | int pdp_ipget(struct pdp_t **pdp, void* ipif, struct ul66_t *eua); |
jjako | a7cd249 | 2003-04-11 09:40:12 +0000 | [diff] [blame] | 270 | */ |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 271 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 272 | uint64_t pdp_gettid(uint64_t imsi, uint8_t nsapi); |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 273 | |
Harald Welte | bed35df | 2011-11-02 13:06:18 +0100 | [diff] [blame] | 274 | #endif /* !_PDP_H */ |