blob: 933de249a2d1fd5a65e254f9eff4b49ba871c698 [file] [log] [blame]
Pau Espin Pedrola469a902019-05-31 15:37:50 +02001/*
Harald Welte632e8432017-09-05 18:12:14 +02002 * OsmoGGSN - Gateway GPRS Support Node
jjako0fe0df02004-09-17 11:30:40 +00003 * Copyright (C) 2002, 2003, 2004 Mondru AB.
Pau Espin Pedrola469a902019-05-31 15:37:50 +02004 *
jjako52c24142002-12-16 13:33:51 +00005 * The contents of this file may be used under the terms of the GNU
6 * General Public License Version 2, provided that the above copyright
7 * notice and this permission notice is included in all copies or
8 * substantial portions of the software.
Pau Espin Pedrola469a902019-05-31 15:37:50 +02009 *
jjako52c24142002-12-16 13:33:51 +000010 */
11
12#ifndef _GTP_H
13#define _GTP_H
14
Maxe6612772018-01-11 18:25:37 +010015#include <osmocom/core/utils.h>
16
Pau Espin Pedrolf32c6a92021-05-03 17:58:55 +020017#include "gtpie.h"
Pau Espin Pedroleefa30d2019-05-31 15:42:49 +020018#include "pdp.h"
Pau Espin Pedrol724ecc62022-11-02 14:57:24 +010019#include "gsn.h"
jjako1db1c812003-07-06 20:53:57 +000020
jjako52c24142002-12-16 13:33:51 +000021#define GTP0_PORT 3386
22#define GTP1C_PORT 2123
23#define GTP1U_PORT 2152
24#define PACKET_MAX 8196
25
Harald Weltebed35df2011-11-02 13:06:18 +010026#define GTP_MAX 0xffff /* TODO: Choose right number */
jjako52c24142002-12-16 13:33:51 +000027#define GTP0_HEADER_SIZE 20
28#define GTP1_HEADER_SIZE_SHORT 8
29#define GTP1_HEADER_SIZE_LONG 12
30
Pau Espin Pedrol724ecc62022-11-02 14:57:24 +010031#define NAMESIZE 1024
jjako52c24142002-12-16 13:33:51 +000032#define SYSLOG_PRINTSIZE 255
33#define ERRMSG_SIZE 255
34
jjako2c381332003-10-21 19:09:53 +000035/* GTP version 1 extension header type definitions. */
Harald Weltebed35df2011-11-02 13:06:18 +010036#define GTP_EXT_PDCP_PDU 0xC0 /* PDCP PDU Number */
jjako2c381332003-10-21 19:09:53 +000037
jjako52c24142002-12-16 13:33:51 +000038/* GTP version 1 message type definitions. Also covers version 0 except *
39 * for anonymous PDP context which was superceded in version 1 */
40
41/* 0 For future use. */
Harald Weltebed35df2011-11-02 13:06:18 +010042#define GTP_ECHO_REQ 1 /* Echo Request */
43#define GTP_ECHO_RSP 2 /* Echo Response */
44#define GTP_NOT_SUPPORTED 3 /* Version Not Supported */
45#define GTP_ALIVE_REQ 4 /* Node Alive Request */
46#define GTP_ALIVE_RSP 5 /* Node Alive Response */
47#define GTP_REDIR_REQ 6 /* Redirection Request */
48#define GTP_REDIR_RSP 7 /* Redirection Response */
jjako52c24142002-12-16 13:33:51 +000049/* 8-15 For future use. */
Harald Weltebed35df2011-11-02 13:06:18 +010050#define GTP_CREATE_PDP_REQ 16 /* Create PDP Context Request */
51#define GTP_CREATE_PDP_RSP 17 /* Create PDP Context Response */
52#define GTP_UPDATE_PDP_REQ 18 /* Update PDP Context Request */
53#define GTP_UPDATE_PDP_RSP 19 /* Update PDP Context Response */
54#define GTP_DELETE_PDP_REQ 20 /* Delete PDP Context Request */
55#define GTP_DELETE_PDP_RSP 21 /* Delete PDP Context Response */
Daniel Willmann77734ac2023-11-29 16:34:09 +010056/* 22-25 For future use. *//* In version GTP 1 anonomous PDP context */
Harald Weltebed35df2011-11-02 13:06:18 +010057#define GTP_ERROR 26 /* Error Indication */
58#define GTP_PDU_NOT_REQ 27 /* PDU Notification Request */
59#define GTP_PDU_NOT_RSP 28 /* PDU Notification Response */
60#define GTP_PDU_NOT_REJ_REQ 29 /* PDU Notification Reject Request */
61#define GTP_PDU_NOT_REJ_RSP 30 /* PDU Notification Reject Response */
62#define GTP_SUPP_EXT_HEADER 31 /* Supported Extension Headers Notification */
63#define GTP_SND_ROUTE_REQ 32 /* Send Routeing Information for GPRS Request */
64#define GTP_SND_ROUTE_RSP 33 /* Send Routeing Information for GPRS Response */
65#define GTP_FAILURE_REQ 34 /* Failure Report Request */
66#define GTP_FAILURE_RSP 35 /* Failure Report Response */
67#define GTP_MS_PRESENT_REQ 36 /* Note MS GPRS Present Request */
68#define GTP_MS_PRESENT_RSP 37 /* Note MS GPRS Present Response */
69/* 38-47 For future use. */
70#define GTP_IDEN_REQ 48 /* Identification Request */
71#define GTP_IDEN_RSP 49 /* Identification Response */
72#define GTP_SGSN_CONTEXT_REQ 50 /* SGSN Context Request */
73#define GTP_SGSN_CONTEXT_RSP 51 /* SGSN Context Response */
74#define GTP_SGSN_CONTEXT_ACK 52 /* SGSN Context Acknowledge */
75#define GTP_FWD_RELOC_REQ 53 /* Forward Relocation Request */
76#define GTP_FWD_RELOC_RSP 54 /* Forward Relocation Response */
77#define GTP_FWD_RELOC_COMPL 55 /* Forward Relocation Complete */
78#define GTP_RELOC_CANCEL_REQ 56 /* Relocation Cancel Request */
79#define GTP_RELOC_CANCEL_RSP 57 /* Relocation Cancel Response */
80#define GTP_FWD_SRNS 58 /* Forward SRNS Context */
81#define GTP_FWD_RELOC_ACK 59 /* Forward Relocation Complete Acknowledge */
82#define GTP_FWD_SRNS_ACK 60 /* Forward SRNS Context Acknowledge */
Pau Espin Pedrolf32c6a92021-05-03 17:58:55 +020083#define GTP_RAN_INFO_RELAY 70 /* RAN Information Relay */
jjako52c24142002-12-16 13:33:51 +000084/* 61-239 For future use. */
Harald Weltebed35df2011-11-02 13:06:18 +010085#define GTP_DATA_TRAN_REQ 240 /* Data Record Transfer Request */
86#define GTP_DATA_TRAN_RSP 241 /* Data Record Transfer Response */
jjako52c24142002-12-16 13:33:51 +000087/* 242-254 For future use. */
Harald Weltebed35df2011-11-02 13:06:18 +010088#define GTP_GPDU 255 /* G-PDU */
jjako08d331d2003-10-13 20:33:30 +000089
Maxe6612772018-01-11 18:25:37 +010090extern const struct value_string gtp_type_names[];
91static inline const char *gtp_type_name(uint8_t val)
92{ return get_value_string(gtp_type_names, val); }
93
jjako08d331d2003-10-13 20:33:30 +000094/* GTP information element cause codes from 29.060 v3.9.0 7.7 */
95/* */
Harald Weltebed35df2011-11-02 13:06:18 +010096#define GTPCAUSE_REQ_IMSI 0 /* Request IMSI */
97#define GTPCAUSE_REQ_IMEI 1 /* Request IMEI */
98#define GTPCAUSE_REQ_IMSI_IMEI 2 /* Request IMSI and IMEI */
99#define GTPCAUSE_NO_ID_NEEDED 3 /* No identity needed */
100#define GTPCAUSE_MS_REFUSES_X 4 /* MS refuses */
101#define GTPCAUSE_MS_NOT_RESP_X 5 /* MS is not GPRS responding */
Daniel Willmann77734ac2023-11-29 16:34:09 +0100102/* 6-48 For future use */
103/* 49-63 Cause values reserved for GPRS charging protocol use (See GTP' in GSM 12.15) */
104/* 64-127 For future use */
Harald Weltebed35df2011-11-02 13:06:18 +0100105#define GTPCAUSE_ACC_REQ 128 /* Request accepted */
Daniel Willmanna625bdd2023-11-21 17:10:41 +0100106#define GTPCAUSE_NEW_PDP_NET_PREF 129 /* New PDP type due to network preference */
107#define GTPCAUSE_NEW_PDP_ADDR_BEAR 130 /* New PDP type due to single address bearer only */
Daniel Willmann77734ac2023-11-29 16:34:09 +0100108/* 131-176 For future use */
109/* 177-191 Cause values reserved for GPRS charging protocol use (See GTP' In GSM 12.15) */
Harald Weltebed35df2011-11-02 13:06:18 +0100110#define GTPCAUSE_NON_EXIST 192 /* Non-existent */
111#define GTPCAUSE_INVALID_MESSAGE 193 /* Invalid message format */
112#define GTPCAUSE_IMSI_NOT_KNOWN 194 /* IMSI not known */
113#define GTPCAUSE_MS_DETACHED 195 /* MS is GPRS detached */
114#define GTPCAUSE_MS_NOT_RESP 196 /* MS is not GPRS responding */
115#define GTPCAUSE_MS_REFUSES 197 /* MS refuses */
Daniel Willmann77734ac2023-11-29 16:34:09 +0100116/* 198 For future use */
Harald Weltebed35df2011-11-02 13:06:18 +0100117#define GTPCAUSE_NO_RESOURCES 199 /* No resources available */
118#define GTPCAUSE_NOT_SUPPORTED 200 /* Service not supported */
119#define GTPCAUSE_MAN_IE_INCORRECT 201 /* Mandatory IE incorrect */
120#define GTPCAUSE_MAN_IE_MISSING 202 /* Mandatory IE missing */
121#define GTPCAUSE_OPT_IE_INCORRECT 203 /* Optional IE incorrect */
122#define GTPCAUSE_SYS_FAIL 204 /* System failure */
123#define GTPCAUSE_ROAMING_REST 205 /* Roaming Restriction */
124#define GTPCAUSE_PTIMSI_MISMATCH 206 /* P-TMSI signature mismatch */
125#define GTPCAUSE_CONN_SUSP 207 /* GPRS connection suspended */
126#define GTPCAUSE_AUTH_FAIL 208 /* Authentication failure */
127#define GTPCAUSE_USER_AUTH_FAIL 209 /* User authentication failed */
128#define GTPCAUSE_CONTEXT_NOT_FOUND 210 /* Context not found */
129#define GTPCAUSE_ADDR_OCCUPIED 211 /* All dynamic PDP addresses are occupied */
130#define GTPCAUSE_NO_MEMORY 212 /* No memory is available */
131#define GTPCAUSE_RELOC_FAIL 213 /* Relocation failure */
132#define GTPCAUSE_UNKNOWN_MAN_EXTHEADER 214 /* Unknown mandatory extension header */
133#define GTPCAUSE_SEM_ERR_TFT 215 /* Semantic error in the TFT operation */
134#define GTPCAUSE_SYN_ERR_TFT 216 /* Syntactic error in the TFT operation */
135#define GTPCAUSE_SEM_ERR_FILTER 217 /* Semantic errors in packet filter(s) */
136#define GTPCAUSE_SYN_ERR_FILTER 218 /* Syntactic errors in packet filter(s) */
137#define GTPCAUSE_MISSING_APN 219 /* Missing or unknown APN */
138#define GTPCAUSE_UNKNOWN_PDP 220 /* Unknown PDP address or PDP type */
Daniel Willmann77734ac2023-11-29 16:34:09 +0100139/* 221-240 For future use */
140/* 241-255 Cause Values Reserved For Gprs Charging Protocol Use (See Gtp' In Gsm 12.15) */
jjako08d331d2003-10-13 20:33:30 +0000141
Daniel Willmanna625bdd2023-11-21 17:10:41 +0100142static inline bool gtp_cause_successful(uint8_t cause)
143{
144 return cause == GTPCAUSE_ACC_REQ ||
145 cause == GTPCAUSE_NEW_PDP_NET_PREF ||
146 cause == GTPCAUSE_NEW_PDP_ADDR_BEAR;
147}
148
Holger Hans Peter Freyther03829962013-07-27 20:01:15 +0200149struct ul66_t;
150struct ul16_t;
Holger Hans Peter Freyther3a9befb2016-01-23 10:15:43 +0100151struct pdp_t;
Holger Hans Peter Freyther03829962013-07-27 20:01:15 +0200152
Pau Espin Pedrola469a902019-05-31 15:37:50 +0200153/* GTP 0 header.
jjako52c24142002-12-16 13:33:51 +0000154 * Explanation to some of the fields:
155 * SNDCP NPDU Number flag = 0 except for inter SGSN handover situations
156 * SNDCP N-PDU LCC Number 0 = 0xff except for inter SGSN handover situations
157 * Sequence number. Used for reliable delivery of signalling messages, and
158 * to discard "illegal" data messages.
159 * Flow label. Is used to point a particular PDP context. Is used in data
160 * messages as well as signalling messages related to a particular context.
161 * Tunnel ID is IMSI+NSAPI. Unique identifier of PDP context. Is somewhat
162 * redundant because the header also includes flow. */
163
Harald Weltebed35df2011-11-02 13:06:18 +0100164struct gtp0_header { /* Descriptions from 3GPP 09.60 */
165 uint8_t flags; /* 01 bitfield, with typical values */
166 /* 000..... Version: 1 (0) */
167 /* ...1111. Spare (7) */
168 /* .......0 SNDCP N-PDU Number flag (0) */
169 uint8_t type; /* 02 Message type. T-PDU = 0xff */
170 uint16_t length; /* 03 Length (of G-PDU excluding header) */
171 uint16_t seq; /* 05 Sequence Number */
172 uint16_t flow; /* 07 Flow Label ( = 0 for signalling) */
173 uint8_t number; /* 09 SNDCP N-PDU LCC Number ( 0 = 0xff) */
174 uint8_t spare1; /* 10 Spare */
175 uint8_t spare2; /* 11 Spare */
176 uint8_t spare3; /* 12 Spare */
177 uint64_t tid; /* 13 Tunnel ID */
Pablo Neira Ayuso0674f0b2014-03-19 22:55:29 +0100178} __attribute__((packed)); /* 20 */
jjako52c24142002-12-16 13:33:51 +0000179
Harald Weltefed598f2017-09-24 16:39:22 +0800180#define GTP1HDR_F_NPDU 0x01
181#define GTP1HDR_F_SEQ 0x02
182#define GTP1HDR_F_EXT 0x04
183#define GTP1HDR_F_GTP1 0x10
184#define GTPHDR_F_VER(n) ((n) << 5)
185#define GTPHDR_F_GET_VER(flags) ((flags)>>5)
186
Harald Weltebed35df2011-11-02 13:06:18 +0100187struct gtp1_header_short { /* Descriptions from 3GPP 29060 */
188 uint8_t flags; /* 01 bitfield, with typical values */
189 /* 001..... Version: 1 */
190 /* ...1.... Protocol Type: GTP=1, GTP'=0 */
191 /* ....0... Spare = 0 */
192 /* .....0.. Extension header flag: 0 */
193 /* ......0. Sequence number flag: 0 */
194 /* .......0 PN: N-PDU Number flag */
195 uint8_t type; /* 02 Message type. T-PDU = 0xff */
196 uint16_t length; /* 03 Length (of IP packet or signalling) */
197 uint32_t tei; /* 05 - 08 Tunnel Endpoint ID */
Pablo Neira Ayuso0674f0b2014-03-19 22:55:29 +0100198} __attribute__((packed));
jjako52c24142002-12-16 13:33:51 +0000199
Harald Weltebed35df2011-11-02 13:06:18 +0100200struct gtp1_header_long { /* Descriptions from 3GPP 29060 */
201 uint8_t flags; /* 01 bitfield, with typical values */
202 /* 001..... Version: 1 */
203 /* ...1.... Protocol Type: GTP=1, GTP'=0 */
204 /* ....0... Spare = 0 */
205 /* .....0.. Extension header flag: 0 */
206 /* ......1. Sequence number flag: 1 */
207 /* .......0 PN: N-PDU Number flag */
208 uint8_t type; /* 02 Message type. T-PDU = 0xff */
209 uint16_t length; /* 03 Length (of IP packet or signalling) */
210 uint32_t tei; /* 05 Tunnel Endpoint ID */
211 uint16_t seq; /* 10 Sequence Number */
212 uint8_t npdu; /* 11 N-PDU Number */
213 uint8_t next; /* 12 Next extension header type. Empty = 0 */
Pablo Neira Ayuso0674f0b2014-03-19 22:55:29 +0100214} __attribute__((packed));
jjako52c24142002-12-16 13:33:51 +0000215
216struct gtp0_packet {
Harald Weltebed35df2011-11-02 13:06:18 +0100217 struct gtp0_header h;
218 uint8_t p[GTP_MAX];
219} __attribute__ ((packed));
jjako52c24142002-12-16 13:33:51 +0000220
221struct gtp1_packet_short {
Harald Weltebed35df2011-11-02 13:06:18 +0100222 struct gtp1_header_short h;
223 uint8_t p[GTP_MAX];
224} __attribute__ ((packed));
jjako52c24142002-12-16 13:33:51 +0000225
226struct gtp1_packet_long {
Harald Weltebed35df2011-11-02 13:06:18 +0100227 struct gtp1_header_long h;
228 uint8_t p[GTP_MAX];
229} __attribute__ ((packed));
jjako52c24142002-12-16 13:33:51 +0000230
231union gtp_packet {
Harald Weltebed35df2011-11-02 13:06:18 +0100232 uint8_t flags;
233 struct gtp0_packet gtp0;
234 struct gtp1_packet_short gtp1s;
235 struct gtp1_packet_long gtp1l;
236} __attribute__ ((packed));
jjako52c24142002-12-16 13:33:51 +0000237
jjako52c24142002-12-16 13:33:51 +0000238/* External API functions */
239
Harald Weltebed35df2011-11-02 13:06:18 +0100240extern const char *gtp_version();
jjako52c24142002-12-16 13:33:51 +0000241
Harald Weltebed35df2011-11-02 13:06:18 +0100242extern int gtp_create_context_req(struct gsn_t *gsn, struct pdp_t *pdp,
jjako193e8b12003-11-10 12:31:41 +0000243 void *cbp);
jjako52c24142002-12-16 13:33:51 +0000244
Harald Weltebed35df2011-11-02 13:06:18 +0100245extern int gtp_create_context_resp(struct gsn_t *gsn, struct pdp_t *pdp,
jjako08d331d2003-10-13 20:33:30 +0000246 int cause);
247
Harald Weltebed35df2011-11-02 13:06:18 +0100248extern int gtp_update_context(struct gsn_t *gsn, struct pdp_t *pdp,
249 void *cbp, struct in_addr *inetaddr);
jjako08d331d2003-10-13 20:33:30 +0000250
Harald Weltebed35df2011-11-02 13:06:18 +0100251extern int gtp_delete_context_req(struct gsn_t *gsn, struct pdp_t *pdp,
Pau Espin Pedrol8e8c7ef2018-07-16 16:47:12 +0200252 void *cbp, int teardown)
253 OSMO_DEPRECATED("Use gtp_delete_context_req2() instead, to avoid freeing pdp ctx before reply");
254extern int gtp_delete_context_req2(struct gsn_t *gsn, struct pdp_t *pdp,
255 void *cbp, int teardown);
jjako08d331d2003-10-13 20:33:30 +0000256
257extern int gtp_data_req(struct gsn_t *gsn, struct pdp_t *pdp,
258 void *pack, unsigned len);
259
Pau Espin Pedrolf32c6a92021-05-03 17:58:55 +0200260extern int gtp_ran_info_relay_req(struct gsn_t *gsn, const struct sockaddr_in *peer,
261 const uint8_t *ran_container, size_t ran_container_len,
262 const uint8_t *rim_route_addr, size_t rim_route_addr_len,
263 uint8_t rim_route_addr_discr);
264
Daniel Willmann65363762024-01-26 16:36:20 +0100265extern int gtp_sgsn_context_req(struct gsn_t *gsn, const struct in_addr *peer,
Daniel Willmann54fcd642024-03-06 11:53:37 +0100266 const struct osmo_mobile_identity *mi, uint16_t tlli, uint32_t teic,
Daniel Willmann65363762024-01-26 16:36:20 +0100267 const struct ul16_t *sgsn_addr, const struct ul255_t *rai, void *cbp);
268extern int gtp_sgsn_context_conf(struct gsn_t *gsn, struct sockaddr_in *peer, uint16_t seq,
Daniel Willmann54fcd642024-03-06 11:53:37 +0100269 uint32_t teic, uint8_t cause, uint64_t imsi, const struct in_addr *sgsn_addr, struct pdp_t *pdpctx, uint16_t sapi, uint8_t *mmctx, int mm_len, void *cbp);
Daniel Willmann65363762024-01-26 16:36:20 +0100270
jjako08d331d2003-10-13 20:33:30 +0000271extern int gtp_decaps0(struct gsn_t *gsn);
272extern int gtp_decaps1c(struct gsn_t *gsn);
273extern int gtp_decaps1u(struct gsn_t *gsn);
Pau Espin Pedrol724ecc62022-11-02 14:57:24 +0100274/* Internal functions (not part of the API) */
jjako52c24142002-12-16 13:33:51 +0000275
jjako08d331d2003-10-13 20:33:30 +0000276extern int gtp_echo_req(struct gsn_t *gsn, int version, void *cbp,
277 struct in_addr *inetaddrs);
Harald Weltebed35df2011-11-02 13:06:18 +0100278extern int gtp_echo_resp(struct gsn_t *gsn, int version,
jjako08d331d2003-10-13 20:33:30 +0000279 struct sockaddr_in *peer, int fd,
jjako52c24142002-12-16 13:33:51 +0000280 void *pack, unsigned len);
Harald Weltebed35df2011-11-02 13:06:18 +0100281extern int gtp_echo_ind(struct gsn_t *gsn, int version,
282 struct sockaddr_in *peer, int fd,
jjako52c24142002-12-16 13:33:51 +0000283 void *pack, unsigned len);
Harald Weltebed35df2011-11-02 13:06:18 +0100284extern int gtp_echo_conf(struct gsn_t *gsn, int version,
285 struct sockaddr_in *peer, void *pack, unsigned len);
jjako52c24142002-12-16 13:33:51 +0000286
Harald Weltebed35df2011-11-02 13:06:18 +0100287extern int gtp_unsup_req(struct gsn_t *gsn, int version,
jjako08d331d2003-10-13 20:33:30 +0000288 struct sockaddr_in *peer,
289 int fd, void *pack, unsigned len);
290extern int gtp_unsup_ind(struct gsn_t *gsn, struct sockaddr_in *peer,
291 void *pack, unsigned len);
jjako52c24142002-12-16 13:33:51 +0000292
Harald Weltebed35df2011-11-02 13:06:18 +0100293extern int gtp_create_pdp_resp(struct gsn_t *gsn, int version,
jjako52c24142002-12-16 13:33:51 +0000294 struct pdp_t *pdp, uint8_t cause);
295
296extern int gtp_create_pdp_ind(struct gsn_t *gsn, int version,
jjako08d331d2003-10-13 20:33:30 +0000297 struct sockaddr_in *peer, int fd,
jjako52c24142002-12-16 13:33:51 +0000298 void *pack, unsigned len);
299
300extern int gtp_create_pdp_conf(struct gsn_t *gsn, int version,
301 struct sockaddr_in *peer,
302 void *pack, unsigned len);
303
jjako08d331d2003-10-13 20:33:30 +0000304extern int gtp_update_pdp_req(struct gsn_t *gsn, int version, void *cbp,
Harald Weltebed35df2011-11-02 13:06:18 +0100305 struct in_addr *inetaddr, struct pdp_t *pdp);
jjako52c24142002-12-16 13:33:51 +0000306
jjako08d331d2003-10-13 20:33:30 +0000307extern int gtp_delete_pdp_req(struct gsn_t *gsn, int version, void *cbp,
jjako52c24142002-12-16 13:33:51 +0000308 struct pdp_t *pdp);
309
310extern int gtp_delete_pdp_resp(struct gsn_t *gsn, int version,
jjako08d331d2003-10-13 20:33:30 +0000311 struct sockaddr_in *peer, int fd,
Harald Weltebed35df2011-11-02 13:06:18 +0100312 void *pack, unsigned len,
jjako2c381332003-10-21 19:09:53 +0000313 struct pdp_t *pdp, struct pdp_t *linked_pdp,
314 uint8_t cause, int teardown);
jjako52c24142002-12-16 13:33:51 +0000315
316extern int gtp_delete_pdp_ind(struct gsn_t *gsn, int version,
jjako08d331d2003-10-13 20:33:30 +0000317 struct sockaddr_in *peer, int fd,
jjako52c24142002-12-16 13:33:51 +0000318 void *pack, unsigned len);
319
320extern int gtp_delete_pdp_conf(struct gsn_t *gsn, int version,
321 struct sockaddr_in *peer,
322 void *pack, unsigned len);
323
jjako52c24142002-12-16 13:33:51 +0000324extern int ipv42eua(struct ul66_t *eua, struct in_addr *src);
325extern int eua2ipv4(struct in_addr *dst, struct ul66_t *eua);
326extern int gsna2in_addr(struct in_addr *dst, struct ul16_t *gsna);
327extern int in_addr2gsna(struct ul16_t *gsna, struct in_addr *src);
Harald Welteb10ee082017-08-12 19:29:16 +0200328extern const char *imsi_gtp2str(const uint64_t *imsi);
Keithfb2a7292020-10-12 15:32:07 +0200329extern uint64_t gtp_imsi_str2gtp(const char *str);
jjako52c24142002-12-16 13:33:51 +0000330
Harald Weltebed35df2011-11-02 13:06:18 +0100331#endif /* !_GTP_H */