[EPC] Support ePDG Interface (#1039)

This commit is contained in:
Sukchan Lee 2021-06-21 22:36:38 +09:00
parent e0869104c6
commit 4537142929
160 changed files with 8717 additions and 1905 deletions

View File

@ -25,29 +25,24 @@ If you find Open5GS useful for work, please consider supporting this Open Source
<table>
<tbody>
<tr>
<td align="center" valign="middle" height="100px" width="222px">
<td align="center" valign="middle" width="222px">
<a href="https://www.auctionsoftware.com/" target="_blank">
<img src="https://open5gs.org/assets/img/asLogonew.png">
</a>
</td>
<td align="center" valign="middle" height="100px" width="222px">
<td align="center" valign="middle" width="222px">
<a href="https://www.wearetriple.com/" target="_blank">
<img src="https://open5gs.org/assets/img/triple_logo.png">
</a>
</td>
<td align="center" valign="middle" height="100px" width="222px">
<a href="https://www.accessparks.com/" target="_blank">
<img src="https://open5gs.org/assets/img/AccessParks.png">
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle" height="100px" width="222px">
<td align="center" valign="middle" width="222px">
<a href="https://skylarkwireless.com/" target="_blank">
<img src="https://open5gs.org/assets/img/SkylarkWireless-420x78-Web2-R.png">
</a>
</td>
<td align="center" valign="middle" height="100px" width="222px">
</tr>
<tr>
<td align="center" valign="middle" height="60px" width="222px">
<a href="https://sysmocom.de/" target="_blank">
<img src="https://open5gs.org/assets/img/sysmocom-logo.png">
</a>

View File

@ -24,6 +24,7 @@ mme:
identity: mme.localdomain
realm: localdomain
listen_on: 127.0.0.2
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -90,6 +91,7 @@ smf:
identity: smf.localdomain
realm: localdomain
listen_on: 127.0.0.4
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -153,6 +155,7 @@ hss:
identity: hss.localdomain
realm: localdomain
listen_on: 127.0.0.8
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -170,6 +173,7 @@ pcrf:
identity: pcrf.localdomain
realm: localdomain
listen_on: 127.0.0.9
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888

View File

@ -24,6 +24,7 @@ mme:
identity: mme.localdomain
realm: localdomain
listen_on: 127.0.0.2
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -124,6 +125,7 @@ smf:
identity: smf.localdomain
realm: localdomain
listen_on: 127.0.0.4
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -187,6 +189,7 @@ hss:
identity: hss.localdomain
realm: localdomain
listen_on: 127.0.0.8
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -204,6 +207,7 @@ pcrf:
identity: pcrf.localdomain
realm: localdomain
listen_on: 127.0.0.9
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888

View File

@ -175,6 +175,7 @@ TLS_CA = "@sysconfdir@/freeDiameter/cacert.pem";
# exchanges.
# Default: Relaying is enabled.
#NoRelay;
NoRelay;
# Number of server threads that can handle incoming messages at the same time.
# Default: 4

View File

@ -175,6 +175,7 @@ TLS_CA = "@sysconfdir@/freeDiameter/cacert.pem";
# exchanges.
# Default: Relaying is enabled.
#NoRelay;
NoRelay;
# Number of server threads that can handle incoming messages at the same time.
# Default: 4

View File

@ -175,6 +175,7 @@ TLS_CA = "@sysconfdir@/freeDiameter/cacert.pem";
# exchanges.
# Default: Relaying is enabled.
#NoRelay;
NoRelay;
# Number of server threads that can handle incoming messages at the same time.
# Default: 4

View File

@ -175,6 +175,7 @@ TLS_CA = "@sysconfdir@/freeDiameter/cacert.pem";
# exchanges.
# Default: Relaying is enabled.
#NoRelay;
NoRelay;
# Number of server threads that can handle incoming messages at the same time.
# Default: 4

View File

@ -42,6 +42,7 @@ example_conf = '''
slice.yaml
srslte.yaml
sample.yaml
non3gpp.yaml
'''.split()
foreach file : example_conf

233
configs/non3gpp.yaml.in Normal file
View File

@ -0,0 +1,233 @@
db_uri: mongodb://localhost/open5gs
logger:
parameter:
# no_nrf: true
# no_amf: true
# no_smf: true
# no_upf: true
# no_ausf: true
# no_udm: true
# no_pcf: true
# no_nssf: true
# no_bsf: true
# no_udr: true
# no_mme: true
# no_sgwc: true
# no_sgwu: true
# no_pcrf: true
# no_hss: true
mme:
freeDiameter:
identity: mme.localdomain
realm: localdomain
listen_on: 127.0.0.2
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
- module: @freediameter_extensions_builddir@/dict_rfc5777.fdx
- module: @freediameter_extensions_builddir@/dict_mip6i.fdx
- module: @freediameter_extensions_builddir@/dict_nasreq.fdx
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
connect:
- identity: hss.localdomain
addr: 127.0.0.8
s1ap:
- addr: 127.0.0.2
gtpc:
- addr: 127.0.0.2
gummei:
plmn_id:
mcc: 901
mnc: 70
mme_gid: 2
mme_code: 1
tai:
plmn_id:
mcc: 901
mnc: 70
tac: 1
security:
integrity_order : [ EIA2, EIA1, EIA0 ]
ciphering_order : [ EEA0, EEA1, EEA2 ]
network_name:
full: Open5GS
sgwc:
gtpc:
- addr: 127.0.0.3
pfcp:
- addr: 127.0.0.3
smf:
sbi:
- addr: 127.0.0.4
port: 7777
pfcp:
- addr: 127.0.0.4
gtpc:
- addr: 127.0.0.4
- addr: ::1
gtpu:
- addr: 127.0.0.4
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
- 2001:4860:4860::8888
- 2001:4860:4860::8844
mtu: 1400
freeDiameter:
identity: smf.localdomain
realm: localdomain
listen_on: 127.0.0.4
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
- module: @freediameter_extensions_builddir@/dict_rfc5777.fdx
- module: @freediameter_extensions_builddir@/dict_mip6i.fdx
- module: @freediameter_extensions_builddir@/dict_nasreq.fdx
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
connect:
- identity: pcrf.localdomain
addr: 127.0.0.9
- identity: aaa.localdomain
addr: 127.0.0.1
amf:
sbi:
- addr: 127.0.0.5
port: 7777
ngap:
- addr: 127.0.0.5
guami:
- plmn_id:
mcc: 901
mnc: 70
amf_id:
region: 2
set: 1
tai:
- plmn_id:
mcc: 901
mnc: 70
tac: 1
plmn_support:
- plmn_id:
mcc: 901
mnc: 70
s_nssai:
- sst: 1
security:
integrity_order : [ NIA2, NIA1, NIA0 ]
ciphering_order : [ NEA0, NEA1, NEA2 ]
network_name:
full: Open5GS
amf_name: open5gs-amf0
sgwu:
pfcp:
- addr: 127.0.0.6
gtpu:
- addr: 127.0.0.6
upf:
pfcp:
- addr: 127.0.0.7
gtpu:
- addr: 127.0.0.7
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
hss:
freeDiameter:
identity: hss.localdomain
realm: localdomain
listen_on: 127.0.0.8
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
- module: @freediameter_extensions_builddir@/dict_rfc5777.fdx
- module: @freediameter_extensions_builddir@/dict_mip6i.fdx
- module: @freediameter_extensions_builddir@/dict_nasreq.fdx
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
connect:
- identity: mme.localdomain
addr: 127.0.0.2
- identity: aaa.localdomain
addr: 127.0.0.1
pcrf:
freeDiameter:
identity: pcrf.localdomain
realm: localdomain
listen_on: 127.0.0.9
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
- module: @freediameter_extensions_builddir@/dict_rfc5777.fdx
- module: @freediameter_extensions_builddir@/dict_mip6i.fdx
- module: @freediameter_extensions_builddir@/dict_nasreq.fdx
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
connect:
- identity: smf.localdomain
addr: 127.0.0.4
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
ausf:
sbi:
- addr: 127.0.0.11
port: 7777
udm:
sbi:
- addr: 127.0.0.12
port: 7777
pcf:
sbi:
- addr: 127.0.0.13
port: 7777
nssf:
sbi:
- addr: 127.0.0.14
port: 7777
nsi:
- addr: ::1
port: 7777
s_nssai:
sst: 1
bsf:
sbi:
- addr: 127.0.0.15
port: 7777
udr:
sbi:
- addr: 127.0.0.20
port: 7777

View File

@ -24,6 +24,7 @@ mme:
identity: mme.localdomain
realm: localdomain
listen_on: 127.0.0.2
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -90,6 +91,7 @@ smf:
identity: smf.localdomain
realm: localdomain
listen_on: 127.0.0.4
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -153,6 +155,7 @@ hss:
identity: hss.localdomain
realm: localdomain
listen_on: 127.0.0.8
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -170,6 +173,7 @@ pcrf:
identity: pcrf.localdomain
realm: localdomain
listen_on: 127.0.0.9
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888

View File

@ -24,6 +24,7 @@ mme:
identity: mme.localdomain
realm: localdomain
listen_on: 127.0.0.2
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -90,6 +91,7 @@ smf:
identity: smf.localdomain
realm: localdomain
listen_on: 127.0.0.4
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -157,6 +159,7 @@ hss:
identity: hss.localdomain
realm: localdomain
listen_on: 127.0.0.8
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -174,6 +177,7 @@ pcrf:
identity: pcrf.localdomain
realm: localdomain
listen_on: 127.0.0.9
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888

View File

@ -24,6 +24,7 @@ mme:
identity: mme.localdomain
realm: localdomain
listen_on: 127.0.0.2
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -90,6 +91,7 @@ smf:
identity: smf.localdomain
realm: localdomain
listen_on: 127.0.0.4
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -153,6 +155,7 @@ hss:
identity: hss.localdomain
realm: localdomain
listen_on: 127.0.0.8
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -170,6 +173,7 @@ pcrf:
identity: pcrf.localdomain
realm: localdomain
listen_on: 127.0.0.9
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888

View File

@ -24,6 +24,7 @@ mme:
identity: mme.localdomain
realm: localdomain
listen_on: 127.0.0.2
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -93,6 +94,7 @@ smf:
identity: smf.localdomain
realm: localdomain
listen_on: 127.0.0.4
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -156,6 +158,7 @@ hss:
identity: hss.localdomain
realm: localdomain
listen_on: 127.0.0.8
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -175,6 +178,7 @@ pcrf:
identity: pcrf.localdomain
realm: localdomain
listen_on: 127.0.0.9
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888

View File

@ -24,6 +24,7 @@ mme:
identity: mme.localdomain
realm: localdomain
listen_on: 127.0.0.2
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -93,6 +94,7 @@ smf:
identity: smf.localdomain
realm: localdomain
listen_on: 127.0.0.4
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -156,6 +158,7 @@ hss:
identity: hss.localdomain
realm: localdomain
listen_on: 127.0.0.8
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
@ -173,6 +176,7 @@ pcrf:
identity: pcrf.localdomain
realm: localdomain
listen_on: 127.0.0.9
no_fwd: true
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888

View File

@ -43,9 +43,12 @@ typedef struct ogs_diam_config_s {
/* the local port for Diameter/TLS (default: 5658) in host byte order */
uint16_t cnf_port_tls;
struct {
unsigned no_sctp: 1; /* disable the use of SCTP */
} cnf_flags;
struct {
/* the peer does not relay messages (0xffffff app id) */
unsigned no_fwd: 1;
/* disable the use of SCTP */
unsigned no_sctp: 1;
} cnf_flags;
#define MAX_NUM_OF_FD_EXTENSION 32
struct {
@ -66,10 +69,11 @@ typedef struct ogs_diam_config_s {
} ogs_diam_config_t;
int ogs_diam_init(int mode, const char *conffile, ogs_diam_config_t *fd_config);
int ogs_diam_start(void);
void ogs_diam_final(void);
int ogs_diam_config_init(ogs_diam_config_t *fd_config);
bool ogs_diam_peer_connected(void);
bool ogs_diam_app_connected(uint32_t app_id);
int fd_avp_search_avp ( struct avp * groupedavp,
struct dict_object * what, struct avp ** avp );

View File

@ -66,6 +66,9 @@ static int diam_config_apply(ogs_diam_config_t *fd_config)
if (fd_config->cnf_flags.no_sctp)
fd_g_config->cnf_flags.no_sctp = fd_config->cnf_flags.no_sctp;
if (fd_config->cnf_flags.no_fwd)
fd_g_config->cnf_flags.no_fwd = fd_config->cnf_flags.no_fwd;
/********************************************************************
* Diameter Client
*/

View File

@ -57,6 +57,16 @@ int ogs_diam_init(int mode, const char *conffile, ogs_diam_config_t *fd_config)
/* Initialize FD logger */
CHECK_FCT_DO( ogs_diam_logger_init(mode), goto error );
return 0;
error:
CHECK_FCT_DO( fd_core_shutdown(), );
CHECK_FCT_DO( fd_core_wait_shutdown_complete(), );
return -1;
}
int ogs_diam_start(void)
{
/* Start the servers */
CHECK_FCT_DO( fd_core_start(), goto error );

View File

@ -28,6 +28,9 @@ struct dict_object *ogs_diam_origin_realm = NULL;
struct dict_object *ogs_diam_destination_host = NULL;
struct dict_object *ogs_diam_destination_realm = NULL;
struct dict_object *ogs_diam_user_name = NULL;
struct dict_object *ogs_diam_subscription_id = NULL;
struct dict_object *ogs_diam_subscription_id_type = NULL;
struct dict_object *ogs_diam_subscription_id_data = NULL;
struct dict_object *ogs_diam_auth_session_state = NULL;
struct dict_object *ogs_diam_auth_application_id = NULL;
struct dict_object *ogs_diam_auth_request_type = NULL;
@ -41,6 +44,10 @@ struct dict_object *ogs_diam_mip_home_agent_address = NULL;
struct dict_object *ogs_diam_authorization_lifetime = NULL;
struct dict_object *ogs_diam_auth_grace_period = NULL;
struct dict_object *ogs_diam_session_timeout = NULL;
struct dict_object *ogs_diam_rat_type = NULL;
struct dict_object *ogs_diam_service_selection = NULL;
struct dict_object *ogs_diam_visited_plmn_id = NULL;
struct dict_object *ogs_diam_visited_network_identifier = NULL;
struct dict_object *ogs_diam_vendor = NULL;
struct dict_object *ogs_diam_vendor_id = NULL;
@ -62,6 +69,9 @@ int ogs_diam_message_init()
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Destination-Host", &ogs_diam_destination_host);
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Destination-Realm", &ogs_diam_destination_realm);
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "User-Name", &ogs_diam_user_name);
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Subscription-Id", &ogs_diam_subscription_id);
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Subscription-Id-Type", &ogs_diam_subscription_id_type);
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Subscription-Id-Data", &ogs_diam_subscription_id_data);
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Auth-Session-State", &ogs_diam_auth_session_state);
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Auth-Application-Id", &ogs_diam_auth_application_id);
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Auth-Request-Type", &ogs_diam_auth_request_type);
@ -75,6 +85,10 @@ int ogs_diam_message_init()
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Authorization-Lifetime", &ogs_diam_authorization_lifetime);
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Auth-Grace-Period", &ogs_diam_auth_grace_period);
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Session-Timeout", &ogs_diam_session_timeout);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RAT-Type", &ogs_diam_rat_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Service-Selection", &ogs_diam_service_selection);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Visited-PLMN-Id", &ogs_diam_visited_plmn_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Visited-Network-Identifier", &ogs_diam_visited_network_identifier);
return 0;
}

View File

@ -47,6 +47,13 @@ extern struct dict_object *ogs_diam_origin_realm;
extern struct dict_object *ogs_diam_destination_host;
extern struct dict_object *ogs_diam_destination_realm;
extern struct dict_object *ogs_diam_user_name;
extern struct dict_object *ogs_diam_subscription_id;
#define OGS_DIAM_SUBSCRIPTION_ID_TYPE_END_USER_E164 0
#define OGS_DIAM_SUBSCRIPTION_ID_TYPE_END_USER_IMSI 1
#define OGS_DIAM_SUBSCRIPTION_ID_TYPE_END_USER_SIP_URI 2
#define OGS_DIAM_SUBSCRIPTION_ID_TYPE_END_USER_NAI 3
extern struct dict_object *ogs_diam_subscription_id_type;
extern struct dict_object *ogs_diam_subscription_id_data;
#define OGS_DIAM_AUTH_SESSION_STATE_MAINTAINED 0
#define OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED 1
extern struct dict_object *ogs_diam_auth_session_state;
@ -67,6 +74,22 @@ extern struct dict_object *ogs_diam_mip_home_agent_address;
extern struct dict_object *ogs_diam_authorization_lifetime;
extern struct dict_object *ogs_diam_auth_grace_period;
extern struct dict_object *ogs_diam_session_timeout;
#define OGS_DIAM_RAT_TYPE_WLAN 0
#define OGS_DIAM_RAT_TYPE_VIRTUAL 1
#define OGS_DIAM_RAT_TYPE_UTRAN 1000
#define OGS_DIAM_RAT_TYPE_GERAN 1001
#define OGS_DIAM_RAT_TYPE_GAN 1002
#define OGS_DIAM_RAT_TYPE_HSPA_EVOLUTION 1003
#define OGS_DIAM_RAT_TYPE_EUTRAN 1004
#define OGS_DIAM_RAT_TYPE_EUTRAN_NB_IoT 1005
#define OGS_DIAM_RAT_TYPE_CDMA2000_1X 2000
#define OGS_DIAM_RAT_TYPE_HRPD 2001
#define OGS_DIAM_RAT_TYPE_UMB 2002
#define OGS_DIAM_RAT_TYPE_EHRPD 2003
extern struct dict_object *ogs_diam_rat_type;
extern struct dict_object *ogs_diam_service_selection;
extern struct dict_object *ogs_diam_visited_plmn_id;
extern struct dict_object *ogs_diam_visited_network_identifier;
extern struct dict_object *ogs_diam_vendor;
extern struct dict_object *ogs_diam_vendor_id;

View File

@ -19,10 +19,10 @@
#include "ogs-diameter-common.h"
bool ogs_diam_peer_connected(void)
bool ogs_diam_app_connected(uint32_t app_id)
{
struct fd_list *li;
bool connected = false;
struct fd_list *li = NULL;
struct fd_app *found = NULL;
CHECK_POSIX( pthread_rwlock_rdlock(&fd_g_peers_rw) );
for (li = fd_g_peers.next; li != &fd_g_peers; li = li->next) {
@ -35,13 +35,19 @@ bool ogs_diam_peer_connected(void)
if (state == STATE_OPEN) {
ogs_debug("'%s' STATE is OPEN", p->info.pi_diamid);
connected = true;
/* Check if the remote peer advertised the message's appli */
fd_app_check(&p->info.runtime.pir_apps, app_id, &found);
if (found) break;
} else {
ogs_debug("'%s' STATE[%d] is NOT open ", p->info.pi_diamid, state);
}
}
CHECK_POSIX( pthread_rwlock_unlock(&fd_g_peers_rw) );
return connected;
if (found)
return true;
else
return false;
}

View File

@ -151,8 +151,10 @@ int ogs_dict_cx_entry(char *conffile)
{
struct dict_object * vendor;
CHECK_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_VENDOR, VENDOR_BY_NAME, "3GPP", &vendor, ENOENT));
struct dict_application_data app_data = { 16777216, "Cx" };
CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_APPLICATION, &app_data, vendor, NULL));
struct dict_application_data cx = { 16777216, "Cx" };
struct dict_application_data swx = { 16777265, "SWx" };
CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_APPLICATION, &cx, vendor, NULL));
CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_APPLICATION, &swx, vendor, NULL));
}
}
@ -312,10 +314,18 @@ int ogs_dict_cx_entry(char *conffile)
{ { .avp_name = "Destination-Host" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "User-Name" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
#if 0 /* modified by acetcom */
{ { .avp_vendor = 10415, .avp_name = "Public-Identity" }, RULE_REQUIRED, -1, 1 },
#else
{ { .avp_vendor = 10415, .avp_name = "Public-Identity" }, RULE_OPTIONAL, -1, 1 },
#endif
{ { .avp_vendor = 10415, .avp_name = "SIP-Auth-Data-Item" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "SIP-Number-Auth-Items" }, RULE_REQUIRED, -1, 1 },
#if 0 /* modified by acetcom */
{ { .avp_vendor = 10415, .avp_name = "Server-Name" }, RULE_REQUIRED, -1, 1 },
#else
{ { .avp_vendor = 10415, .avp_name = "Server-Name" }, RULE_OPTIONAL, -1, 1 },
#endif
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 },
};
@ -380,9 +390,17 @@ int ogs_dict_cx_entry(char *conffile)
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Public-Identity" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Wildcarded-Public-Identity" }, RULE_OPTIONAL, -1, 1 },
#if 0 /* modified by acetcom */
{ { .avp_vendor = 10415, .avp_name = "Server-Name" }, RULE_REQUIRED, -1, 1 },
#else
{ { .avp_vendor = 10415, .avp_name = "Server-Name" }, RULE_OPTIONAL, -1, 1 },
#endif
{ { .avp_vendor = 10415, .avp_name = "Server-Assignment-Type" }, RULE_REQUIRED, -1, 1 },
#if 0 /* modified by acetcom */
{ { .avp_vendor = 10415, .avp_name = "User-Data-Already-Available" }, RULE_REQUIRED, -1, 1 },
#else
{ { .avp_vendor = 10415, .avp_name = "User-Data-Already-Available" }, RULE_OPTIONAL, -1, 1 },
#endif
{ { .avp_vendor = 10415, .avp_name = "SCSCF-Restoration-Info" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Multiple-Registration-Indication" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Session-Priority" }, RULE_OPTIONAL, -1, 1 },

View File

@ -17,7 +17,6 @@
libdiameter_cx_sources = files('''
ogs-diameter-cx.h
message.h
dict.c

View File

@ -37,7 +37,6 @@ struct dict_object *ogs_diam_cx_cmd_lir = NULL;
struct dict_object *ogs_diam_cx_cmd_lia = NULL;
struct dict_object *ogs_diam_cx_public_identity = NULL;
struct dict_object *ogs_diam_cx_visited_network_identifier = NULL;
struct dict_object *ogs_diam_cx_server_name = NULL;
struct dict_object *ogs_diam_cx_sip_number_auth_items = NULL;
@ -170,9 +169,6 @@ int ogs_diam_cx_init(void)
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS,
"Public-Identity", &ogs_diam_cx_public_identity);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS,
"Visited-Network-Identifier",
&ogs_diam_cx_visited_network_identifier);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS,
"Server-Name", &ogs_diam_cx_server_name);

View File

@ -42,7 +42,6 @@ extern struct dict_object *ogs_diam_cx_cmd_lir;
extern struct dict_object *ogs_diam_cx_cmd_lia;
extern struct dict_object *ogs_diam_cx_public_identity;
extern struct dict_object *ogs_diam_cx_visited_network_identifier;
extern struct dict_object *ogs_diam_cx_server_name;
extern struct dict_object *ogs_diam_cx_sip_number_auth_items;

View File

@ -32,16 +32,12 @@ struct dict_object *ogs_diam_gx_cmd_raa = NULL;
struct dict_object *ogs_diam_gx_cc_request_type = NULL;
struct dict_object *ogs_diam_gx_cc_request_number = NULL;
struct dict_object *ogs_diam_gx_network_request_support = NULL;
struct dict_object *ogs_diam_gx_subscription_id = NULL;
struct dict_object *ogs_diam_gx_subscription_id_type = NULL;
struct dict_object *ogs_diam_gx_subscription_id_data = NULL;
struct dict_object *ogs_diam_gx_supported_features = NULL;
struct dict_object *ogs_diam_gx_feature_list_id = NULL;
struct dict_object *ogs_diam_gx_feature_list = NULL;
struct dict_object *ogs_diam_gx_framed_ip_address = NULL;
struct dict_object *ogs_diam_gx_framed_ipv6_prefix = NULL;
struct dict_object *ogs_diam_gx_ip_can_type = NULL;
struct dict_object *ogs_diam_gx_rat_type = NULL;
struct dict_object *ogs_diam_gx_qos_information = NULL;
struct dict_object *ogs_diam_gx_qos_class_identifier = NULL;
struct dict_object *ogs_diam_gx_max_requested_bandwidth_ul = NULL;
@ -82,6 +78,14 @@ struct dict_object *ogs_diam_gx_codec_data = NULL;
struct dict_object *ogs_diam_gx_media_sub_component = NULL;
struct dict_object *ogs_diam_gx_flow_number = NULL;
struct dict_object *ogs_diam_gx_flow_usage = NULL;
struct dict_object *ogs_diam_gx_3gpp_sgsn_mcc_mnc = NULL;
struct dict_object *ogs_diam_gx_an_gw_address = NULL;
struct dict_object *ogs_diam_gx_online = NULL;
struct dict_object *ogs_diam_gx_offline = NULL;
struct dict_object *ogs_diam_gx_access_network_charging_address = NULL;
struct dict_object *ogs_diam_gx_access_network_charging_identifier_gx = NULL;
struct dict_object *ogs_diam_gx_access_network_charging_identifier_value = NULL;
struct dict_object *ogs_diam_gx_an_trusted = NULL;
extern int ogs_dict_gx_entry(char *conffile);
@ -101,16 +105,12 @@ int ogs_diam_gx_init(void)
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Request-Type", &ogs_diam_gx_cc_request_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Request-Number", &ogs_diam_gx_cc_request_number);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Network-Request-Support", &ogs_diam_gx_network_request_support);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id", &ogs_diam_gx_subscription_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id-Type", &ogs_diam_gx_subscription_id_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id-Data", &ogs_diam_gx_subscription_id_data);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Supported-Features", &ogs_diam_gx_supported_features);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Feature-List-ID", &ogs_diam_gx_feature_list_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Feature-List", &ogs_diam_gx_feature_list);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Framed-IP-Address", &ogs_diam_gx_framed_ip_address);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Framed-IPv6-Prefix", &ogs_diam_gx_framed_ipv6_prefix);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "IP-CAN-Type", &ogs_diam_gx_ip_can_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RAT-Type", &ogs_diam_gx_rat_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Information", &ogs_diam_gx_qos_information);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Class-Identifier" , &ogs_diam_gx_qos_class_identifier);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-UL" , &ogs_diam_gx_max_requested_bandwidth_ul);
@ -154,6 +154,14 @@ int ogs_diam_gx_init(void)
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Sub-Component", &ogs_diam_gx_media_sub_component);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Number", &ogs_diam_gx_flow_number);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Usage", &ogs_diam_gx_flow_usage);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-SGSN-MCC-MNC", &ogs_diam_gx_3gpp_sgsn_mcc_mnc);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "AN-GW-Address", &ogs_diam_gx_an_gw_address);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Online", &ogs_diam_gx_online);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Offline", &ogs_diam_gx_offline);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Access-Network-Charging-Address", &ogs_diam_gx_access_network_charging_address);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Access-Network-Charging-Identifier-Gx", &ogs_diam_gx_access_network_charging_identifier_gx);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Access-Network-Charging-Identifier-Value", &ogs_diam_gx_access_network_charging_identifier_value);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "AN-Trusted", &ogs_diam_gx_an_trusted);
return 0;
}

View File

@ -54,13 +54,6 @@ extern struct dict_object *ogs_diam_gx_cmd_raa;
extern struct dict_object *ogs_diam_gx_cc_request_type;
extern struct dict_object *ogs_diam_gx_cc_request_number;
extern struct dict_object *ogs_diam_gx_network_request_support;
extern struct dict_object *ogs_diam_gx_subscription_id;
#define OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_E164 0
#define OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_IMSI 1
#define OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_SIP_URI 2
#define OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_NAI 3
extern struct dict_object *ogs_diam_gx_subscription_id_type;
extern struct dict_object *ogs_diam_gx_subscription_id_data;
extern struct dict_object *ogs_diam_gx_supported_features;
extern struct dict_object *ogs_diam_gx_feature_list_id;
extern struct dict_object *ogs_diam_gx_feature_list;
@ -72,21 +65,8 @@ extern struct dict_object *ogs_diam_gx_framed_ipv6_prefix;
#define OGS_DIAM_GX_IP_CAN_TYPE_WiMAX 3
#define OGS_DIAM_GX_IP_CAN_TYPE_3GPP2 4
#define OGS_DIAM_GX_IP_CAN_TYPE_3GPP_EPS 5
#define OGS_DIAM_GX_IP_CAN_TYPE_Non_3GPP_EPS 6
#define OGS_DIAM_GX_IP_CAN_TYPE_NON_3GPP_EPS 6
extern struct dict_object *ogs_diam_gx_ip_can_type;
#define OGS_DIAM_GX_RAT_TYPE_WLAN 0
#define OGS_DIAM_GX_RAT_TYPE_VIRTUAL 1
#define OGS_DIAM_GX_RAT_TYPE_UTRAN 1000
#define OGS_DIAM_GX_RAT_TYPE_GERAN 1001
#define OGS_DIAM_GX_RAT_TYPE_GAN 1002
#define OGS_DIAM_GX_RAT_TYPE_HSPA_EVOLUTION 1003
#define OGS_DIAM_GX_RAT_TYPE_EUTRAN 1004
#define OGS_DIAM_GX_RAT_TYPE_EUTRAN_NB_IoT 1005
#define OGS_DIAM_GX_RAT_TYPE_CDMA2000_1X 2000
#define OGS_DIAM_GX_RAT_TYPE_HRPD 2001
#define OGS_DIAM_GX_RAT_TYPE_UMB 2002
#define OGS_DIAM_GX_RAT_TYPE_EHRPD 2003
extern struct dict_object *ogs_diam_gx_rat_type;
extern struct dict_object *ogs_diam_gx_qos_information;
extern struct dict_object *ogs_diam_gx_qos_class_identifier;
extern struct dict_object *ogs_diam_gx_max_requested_bandwidth_ul;
@ -128,6 +108,20 @@ extern struct dict_object *ogs_diam_gx_codec_data;
extern struct dict_object *ogs_diam_gx_media_sub_component;
extern struct dict_object *ogs_diam_gx_flow_number;
extern struct dict_object *ogs_diam_gx_flow_usage;
extern struct dict_object *ogs_diam_gx_3gpp_sgsn_mcc_mnc;
extern struct dict_object *ogs_diam_gx_an_gw_address;
#define OGS_DIAM_GX_DISABLE_ONLINE 0
#define OGS_DIAM_GX_ENABLE_ONLINE 1
extern struct dict_object *ogs_diam_gx_online;
#define OGS_DIAM_GX_DISABLE_OFFLINE 0
#define OGS_DIAM_GX_ENABLE_OFFLINE 1
extern struct dict_object *ogs_diam_gx_offline;
extern struct dict_object *ogs_diam_gx_access_network_charging_address;
extern struct dict_object *ogs_diam_gx_access_network_charging_identifier_gx;
extern struct dict_object *ogs_diam_gx_access_network_charging_identifier_value;
#define OGS_DIAM_GX_AN_TRUSTED 0
#define OGS_DIAM_GX_AN_UNTRUSTED 1
extern struct dict_object *ogs_diam_gx_an_trusted;
typedef struct ogs_diam_gx_message_s {
#define OGS_DIAM_GX_CMD_CODE_CREDIT_CONTROL 272

View File

@ -20,3 +20,5 @@ subdir('gx')
subdir('rx')
subdir('s6a')
subdir('cx')
subdir('swx')
subdir('s6b')

View File

@ -151,8 +151,10 @@ int ogs_dict_rx_entry(char *conffile)
{
struct dict_object * vendor;
CHECK_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_VENDOR, VENDOR_BY_NAME, "3GPP", &vendor, ENOENT));
struct dict_application_data app_data = { 16777236, "Rx" };
CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_APPLICATION, &app_data, vendor, NULL));
struct dict_application_data rx = { 16777236, "Rx" };
struct dict_application_data s6b = { 16777272, "S6b" };
CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_APPLICATION, &rx, vendor, NULL));
CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_APPLICATION, &s6b, vendor, NULL));
}
}

View File

@ -55,7 +55,6 @@ struct dict_object *ogs_diam_rx_specific_action = NULL;
struct dict_object *ogs_diam_rx_framed_ip_address = NULL;
struct dict_object *ogs_diam_rx_framed_ipv6_prefix = NULL;
struct dict_object *ogs_diam_rx_ip_can_type = NULL;
struct dict_object *ogs_diam_rx_rat_type = NULL;
struct dict_object *ogs_diam_rx_abort_cause = NULL;
struct dict_object *ogs_diam_rx_termination_cause = NULL;
@ -100,7 +99,6 @@ int ogs_diam_rx_init(void)
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Framed-IP-Address", &ogs_diam_rx_framed_ip_address);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Framed-IPv6-Prefix", &ogs_diam_rx_framed_ipv6_prefix);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "IP-CAN-Type", &ogs_diam_rx_ip_can_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RAT-Type", &ogs_diam_rx_rat_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Abort-Cause", &ogs_diam_rx_abort_cause);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Termination-Cause", &ogs_diam_rx_termination_cause);

View File

@ -115,19 +115,6 @@ extern struct dict_object *ogs_diam_rx_framed_ipv6_prefix;
#define OGS_DIAM_RX_IP_CAN_TYPE_3GPP_EPS 5
#define OGS_DIAM_RX_IP_CAN_TYPE_Non_3GPP_EPS 6
extern struct dict_object *ogs_diam_rx_ip_can_type;
#define OGS_DIAM_RX_RAT_TYPE_WLAN 0
#define OGS_DIAM_RX_RAT_TYPE_VIRTUAL 1
#define OGS_DIAM_RX_RAT_TYPE_UTRAN 1000
#define OGS_DIAM_RX_RAT_TYPE_GERAN 1001
#define OGS_DIAM_RX_RAT_TYPE_GAN 1002
#define OGS_DIAM_RX_RAT_TYPE_HSPA_EVOLUTION 1003
#define OGS_DIAM_RX_RAT_TYPE_EUTRAN 1004
#define OGS_DIAM_RX_RAT_TYPE_EUTRAN_NB_IoT 1005
#define OGS_DIAM_RX_RAT_TYPE_CDMA2000_1X 2000
#define OGS_DIAM_RX_RAT_TYPE_HRPD 2001
#define OGS_DIAM_RX_RAT_TYPE_UMB 2002
#define OGS_DIAM_RX_RAT_TYPE_EHRPD 2003
extern struct dict_object *ogs_diam_rx_rat_type;
#define OGS_DIAM_RX_ABORT_CAUSE_BEARER_RELEASED 0
#define OGS_DIAM_RX_ABORT_CAUSE_INSUFFICIENT_SERVER_RESOURCES 1
#define OGS_DIAM_RX_ABORT_CAUSE_INSUFFICIENT_BEARER_RESOURCES 2

View File

@ -31,8 +31,6 @@ struct dict_object *ogs_diam_s6a_cmd_ula = NULL;
struct dict_object *ogs_diam_s6a_cmd_pur = NULL;
struct dict_object *ogs_diam_s6a_cmd_pua = NULL;
struct dict_object *ogs_diam_s6a_visited_plmn_id = NULL;
struct dict_object *ogs_diam_s6a_rat_type = NULL;
struct dict_object *ogs_diam_s6a_ulr_flags = NULL;
struct dict_object *ogs_diam_s6a_ula_flags = NULL;
struct dict_object *ogs_diam_s6a_subscription_data = NULL;
@ -41,7 +39,6 @@ struct dict_object *ogs_diam_s6a_number_of_requested_vectors = NULL;
struct dict_object *ogs_diam_s6a_immediate_response_preferred = NULL;
struct dict_object *ogs_diam_s6a_authentication_info = NULL;
struct dict_object *ogs_diam_s6a_re_synchronization_info = NULL;
struct dict_object *ogs_diam_s6a_service_selection = NULL;
struct dict_object *ogs_diam_s6a_ue_srvcc_capability = NULL;
struct dict_object *ogs_diam_s6a_e_utran_vector = NULL;
struct dict_object *ogs_diam_s6a_rand = NULL;
@ -67,6 +64,8 @@ struct dict_object *ogs_diam_s6a_allocation_retention_priority = NULL;
struct dict_object *ogs_diam_s6a_priority_level = NULL;
struct dict_object *ogs_diam_s6a_pre_emption_capability = NULL;
struct dict_object *ogs_diam_s6a_pre_emption_vulnerability = NULL;
struct dict_object *ogs_diam_s6a_pdn_gw_allocation_type = NULL;
struct dict_object *ogs_diam_s6a_vplmn_dynamic_address_allowed = NULL;
struct dict_object *ogs_diam_s6a_terminal_information = NULL;
struct dict_object *ogs_diam_s6a_imei = NULL;
@ -92,8 +91,6 @@ int ogs_diam_s6a_init(void)
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Purge-UE-Request", &ogs_diam_s6a_cmd_pur);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Purge-UE-Answer", &ogs_diam_s6a_cmd_pua);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Visited-PLMN-Id", &ogs_diam_s6a_visited_plmn_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RAT-Type", &ogs_diam_s6a_rat_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "ULR-Flags", &ogs_diam_s6a_ulr_flags);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "ULA-Flags", &ogs_diam_s6a_ula_flags);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "UE-SRVCC-Capability", &ogs_diam_s6a_ue_srvcc_capability);
@ -116,6 +113,8 @@ int ogs_diam_s6a_init(void)
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Priority-Level", &ogs_diam_s6a_priority_level);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Capability", &ogs_diam_s6a_pre_emption_capability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Vulnerability", &ogs_diam_s6a_pre_emption_vulnerability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "PDN-GW-Allocation-Type", &ogs_diam_s6a_pdn_gw_allocation_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "VPLMN-Dynamic-Address-Allowed", &ogs_diam_s6a_vplmn_dynamic_address_allowed);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "AMBR", &ogs_diam_s6a_ambr);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-UL", &ogs_diam_s6a_max_bandwidth_ul);
@ -125,7 +124,6 @@ int ogs_diam_s6a_init(void)
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Context-Identifier", &ogs_diam_s6a_context_identifier);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "All-APN-Configurations-Included-Indicator", &ogs_diam_s6a_all_apn_configuration_included_indicator);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Configuration", &ogs_diam_s6a_apn_configuration);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Service-Selection", &ogs_diam_s6a_service_selection);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "PDN-Type", &ogs_diam_s6a_pdn_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Served-Party-IP-Address", &ogs_diam_s6a_served_party_ip_address);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Data", &ogs_diam_s6a_subscription_data);

View File

@ -62,6 +62,12 @@ extern "C" {
#define OGS_DIAM_S6A_UE_SRVCC_NOT_SUPPORTED (0)
#define OGS_DIAM_S6A_UE_SRVCC_SUPPORTED (1)
#define OGS_DIAM_S6A_PDN_GW_ALLOCATION_STATIC (0)
#define OGS_DIAM_S6A_PDN_GW_ALLOCATION_DYNAMIC (1)
#define OGS_DIAM_S6A_VPLMN_DYNAMIC_ADDRESS_NOTALLOWED (0)
#define OGS_DIAM_S6A_VPLMN_DYNAMIC_ADDRESS_ALLOWED (1)
extern struct dict_object *ogs_diam_s6a_application;
extern struct dict_object *ogs_diam_s6a_cmd_air;
@ -71,8 +77,6 @@ extern struct dict_object *ogs_diam_s6a_cmd_ula;
extern struct dict_object *ogs_diam_s6a_cmd_pur;
extern struct dict_object *ogs_diam_s6a_cmd_pua;
extern struct dict_object *ogs_diam_s6a_visited_plmn_id;
extern struct dict_object *ogs_diam_s6a_rat_type;
extern struct dict_object *ogs_diam_s6a_ulr_flags;
extern struct dict_object *ogs_diam_s6a_ula_flags;
extern struct dict_object *ogs_diam_s6a_subscription_data;
@ -81,7 +85,6 @@ extern struct dict_object *ogs_diam_s6a_number_of_requested_vectors;
extern struct dict_object *ogs_diam_s6a_immediate_response_preferred;
extern struct dict_object *ogs_diam_s6a_authentication_info;
extern struct dict_object *ogs_diam_s6a_re_synchronization_info;
extern struct dict_object *ogs_diam_s6a_service_selection;
extern struct dict_object *ogs_diam_s6a_ue_srvcc_capability;
extern struct dict_object *ogs_diam_s6a_e_utran_vector;
extern struct dict_object *ogs_diam_s6a_rand;
@ -107,6 +110,8 @@ extern struct dict_object *ogs_diam_s6a_allocation_retention_priority;
extern struct dict_object *ogs_diam_s6a_priority_level;
extern struct dict_object *ogs_diam_s6a_pre_emption_capability;
extern struct dict_object *ogs_diam_s6a_pre_emption_vulnerability;
extern struct dict_object *ogs_diam_s6a_pdn_gw_allocation_type;
extern struct dict_object *ogs_diam_s6a_vplmn_dynamic_address_allowed;
extern struct dict_object *ogs_diam_s6a_terminal_information;
extern struct dict_object *ogs_diam_s6a_imei;

View File

@ -0,0 +1,38 @@
# Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
# This file is part of Open5GS.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
libdiameter_s6b_sources = files('''
ogs-diameter-s6b.h
message.h
message.c
'''.split())
libdiameter_s6b_inc = include_directories('.')
libdiameter_s6b = library('ogsdiameter-s6b',
sources : libdiameter_s6b_sources,
version : libogslib_version,
c_args : libdiameter_common_cc_flags,
include_directories : libdiameter_s6b_inc,
dependencies : libdiameter_rx_dep,
install : true)
libdiameter_s6b_dep = declare_dependency(
link_with : libdiameter_s6b,
include_directories : libdiameter_s6b_inc,
dependencies : libdiameter_rx_dep)

View File

@ -0,0 +1,40 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ogs-diameter-s6b.h"
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
struct dict_object *ogs_diam_s6b_application = NULL;
struct dict_object *ogs_diam_s6b_mip6_feature_vector = NULL;
int ogs_diam_s6b_init(void)
{
application_id_t id = OGS_DIAM_S6B_APPLICATION_ID;
CHECK_dict_search(DICT_APPLICATION, APPLICATION_BY_ID,
(void *)&id, &ogs_diam_s6b_application);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS,
"MIP6-Feature-Vector", &ogs_diam_s6b_mip6_feature_vector);
return 0;
}

View File

@ -0,0 +1,43 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined(OGS_DIAMETER_INSIDE) && !defined(OGS_DIAMETER_COMPILATION)
#error "This header cannot be included directly."
#endif
#ifndef OGS_DIAM_S6B_MESSAGE_H
#define OGS_DIAM_S6B_MESSAGE_H
#ifdef __cplusplus
extern "C" {
#endif
#define OGS_DIAM_S6B_APPLICATION_ID 16777272
extern struct dict_object *ogs_diam_s6b_application;
extern struct dict_object *ogs_diam_s6b_mip6_feature_vector;
int ogs_diam_s6b_init(void);
#ifdef __cplusplus
}
#endif
#endif /* OGS_DIAM_OGS_DIAM_S6B_MESSAGE_H */

View File

@ -0,0 +1,41 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef OGS_DIAMETER_S6B_H
#define OGS_DIAMETER_S6B_H
#include "ogs-diameter-common.h"
#define OGS_DIAMETER_INSIDE
#include "diameter/s6b/message.h"
#undef OGS_DIAMETER_INSIDE
#ifdef __cplusplus
extern "C" {
#endif
/* Nothing */
#ifdef __cplusplus
}
#endif
#endif /* OGS_DIAMETER_S6B_H */

View File

@ -0,0 +1,38 @@
# Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
# This file is part of Open5GS.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
libdiameter_swx_sources = files('''
ogs-diameter-swx.h
message.h
message.c
'''.split())
libdiameter_swx_inc = include_directories('.')
libdiameter_swx = library('ogsdiameter-swx',
sources : libdiameter_swx_sources,
version : libogslib_version,
c_args : libdiameter_common_cc_flags,
include_directories : libdiameter_swx_inc,
dependencies : [libdiameter_cx_dep, libdiameter_s6a_dep],
install : true)
libdiameter_swx_dep = declare_dependency(
link_with : libdiameter_swx,
include_directories : libdiameter_swx_inc,
dependencies : [libdiameter_cx_dep, libdiameter_s6a_dep])

View File

@ -0,0 +1,46 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ogs-diameter-swx.h"
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
struct dict_object *ogs_diam_swx_application = NULL;
struct dict_object *ogs_diam_swx_non_3gpp_user_data = NULL;
struct dict_object *ogs_diam_swx_non_3gpp_ip_access = NULL;
struct dict_object *ogs_diam_swx_non_3gpp_ip_access_apn = NULL;
int ogs_diam_swx_init(void)
{
application_id_t id = OGS_DIAM_SWX_APPLICATION_ID;
CHECK_dict_search(DICT_APPLICATION, APPLICATION_BY_ID,
(void *)&id, &ogs_diam_swx_application);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS,
"Non-3GPP-User-Data", &ogs_diam_swx_non_3gpp_user_data);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS,
"Non-3GPP-IP-Access", &ogs_diam_swx_non_3gpp_ip_access);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS,
"Non-3GPP-IP-Access-APN", &ogs_diam_swx_non_3gpp_ip_access_apn);
return 0;
}

View File

@ -0,0 +1,52 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined(OGS_DIAMETER_INSIDE) && !defined(OGS_DIAMETER_COMPILATION)
#error "This header cannot be included directly."
#endif
#ifndef OGS_DIAM_SWX_MESSAGE_H
#define OGS_DIAM_SWX_MESSAGE_H
#ifdef __cplusplus
extern "C" {
#endif
#define OGS_DIAM_SWX_APPLICATION_ID 16777265
extern struct dict_object *ogs_diam_swx_application;
extern struct dict_object *ogs_diam_swx_non_3gpp_user_data;
#define OGS_DIAM_SWX_NON_3GPP_SUBSCRIPTION_ALLOWED 0
#define OGS_DIAM_SWX_NON_3GPP_SUBSCRIPTION_BARRED 1
extern struct dict_object *ogs_diam_swx_non_3gpp_ip_access;
#define OGS_DIAM_SWX_NON_3GPP_APNS_ENABLE 0
#define OGS_DIAM_SWX_NON_3GPP_APNS_DISABLE 1
extern struct dict_object *ogs_diam_swx_non_3gpp_ip_access_apn;
#define OGS_DIAM_SWX_AUTH_SCHEME_EAP_AKA "EAP-AKA"
#define OGS_DIAM_SWX_AUTH_SCHEME_EAP_AKA_QUOT "EAP-AKA'"
int ogs_diam_swx_init(void);
#ifdef __cplusplus
}
#endif
#endif /* OGS_DIAM_OGS_DIAM_SWX_MESSAGE_H */

View File

@ -0,0 +1,41 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef OGS_DIAMETER_SWX_H
#define OGS_DIAMETER_SWX_H
#include "ogs-diameter-common.h"
#define OGS_DIAMETER_INSIDE
#include "diameter/swx/message.h"
#undef OGS_DIAMETER_INSIDE
#ifdef __cplusplus
extern "C" {
#endif
/* Nothing */
#ifdef __cplusplus
}
#endif
#endif /* OGS_DIAMETER_SWX_H */

View File

@ -39,7 +39,6 @@ typedef struct ogs_gtp_context_s {
ogs_sockaddr_t *gtpc_addr; /* GTPC IPv4 Address */
ogs_sockaddr_t *gtpc_addr6; /* GTPC IPv6 Address */
ogs_list_t gtpu_list; /* GTPU IPv4/IPv6 Server List */
ogs_sock_t *gtpu_sock; /* GTPU IPv4 Socket */
ogs_sock_t *gtpu_sock6; /* GTPU IPv6 Socket */

View File

@ -20,7 +20,7 @@
/*******************************************************************************
* This file had been created by gtp-tlv.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2020-10-14 13:48:14.476575 by acetcom
* Created on: 2021-06-15 11:28:13.532535 by acetcom
* from 29274-g30.docx
******************************************************************************/
@ -490,10 +490,10 @@ ogs_tlv_desc_t ogs_gtp_tlv_desc_delay_value_0 =
ogs_tlv_desc_t ogs_gtp_tlv_desc_charging_id_0 =
{
OGS_TLV_VAR_STR,
OGS_TLV_UINT32,
"Charging ID",
OGS_GTP_CHARGING_ID_TYPE,
0,
4,
0,
sizeof(ogs_gtp_tlv_charging_id_t),
{ NULL }

View File

@ -20,7 +20,7 @@
/*******************************************************************************
* This file had been created by gtp-tlv.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2020-10-14 13:48:14.468022 by acetcom
* Created on: 2021-06-15 11:28:13.527903 by acetcom
* from 29274-g30.docx
******************************************************************************/
@ -525,7 +525,7 @@ typedef ogs_tlv_octet_t ogs_gtp_tlv_global_cn_id_t;
typedef ogs_tlv_octet_t ogs_gtp_tlv_s103pdf_t;
typedef ogs_tlv_octet_t ogs_gtp_tlv_s1udf_t;
typedef ogs_tlv_octet_t ogs_gtp_tlv_delay_value_t;
typedef ogs_tlv_octet_t ogs_gtp_tlv_charging_id_t;
typedef ogs_tlv_uint32_t ogs_gtp_tlv_charging_id_t;
typedef ogs_tlv_octet_t ogs_gtp_tlv_charging_characteristics_t;
typedef ogs_tlv_octet_t ogs_gtp_tlv_trace_information_t;
typedef ogs_tlv_octet_t ogs_gtp_tlv_bearer_flags_t;

View File

@ -1,16 +1,12 @@
* Install python-pip
user@host ~/Documents/git/open5gs/lib/gtp/support$ \
sudo apt-get install python-pip
* Install python-docx
user@host ~/Documents/git/open5gs/lib/gtp/support$ \
sudo pip install python-docx
sudo pip3 install python-docx
* Change the format of standard specification
from 29274-g30.doc to 29274-g30.docx
using Microsoft Office 2007+
* Generate TLV support files
user@host ~/Documents/git/open5gs/lib/s1ap/support$ \
python gtp-tlv.py -f 29274-g30.docx -o ..
user@host ~/Documents/git/open5gs/lib/gtp/support$ \
python3 gtp-tlv.py -f 29274-g30.docx -o ..

View File

@ -5,9 +5,7 @@ ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Contexts", "pres
ies.append({ "ie_type" : "Recovery", "ie_value" : "Recovery", "presence" : "C", "instance" : "0", "comment" : "This IE shall be included on the S4/S11, S5/S8 and S2a/S2b interfaces if contacting the peer for the first time "})
ies.append({ "ie_type" : "FQ-CSID", "ie_value" : "MME-FQ-CSID", "presence" : "C", "instance" : "0", "comment" : "This IE shall be included by MME the on S11 interface and shall be forwarded by the SGW on S5/S8 interface according to the requirements in 3GPP TS 23.007 [17]."})
ies.append({ "ie_type" : "FQ-CSID", "ie_value" : "SGW-FQ-CSID", "presence" : "C", "instance" : "1", "comment" : "This IE shall be included by the SGW on the S5/S8 interface according to the requirements in 3GPP TS 23.007 [17]."})
type_list["FQ-CSID"]["max_instance"] = "2"
ies.append({ "ie_type" : "FQ-CSID", "ie_value" : "ePDG-FQ-CSID", "presence" : "C", "instance" : "2", "comment" : "This IE shall be included by the ePDG on the S2b interface according to the requirements in 3GPP TS 23.007 [17]."})
type_list["FQ-CSID"]["max_instance"] = "3"
ies.append({ "ie_type" : "FQ-CSID", "ie_value" : "TWAN-FQ-CSID", "presence" : "C", "instance" : "3", "comment" : "This IE shall be included by the TWAN on the S2a interface according to the requirements in 3GPP TS 23.007 [17]."})
ies.append({ "ie_type" : "PCO", "ie_value" : "Protocol Configuration Options", "presence" : "CO", "instance" : "0", "comment" : "An MME/SGSN shall include the PCO IE if such information was received from the UE. If the SGW receives this IE, the SGW shall forward it to PGW on the S5/S8 interface."})
ies.append({ "ie_type" : "UE Time Zone", "ie_value" : "UE Time Zone", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included, if available, by the MME on the S11 interface or by the SGSN on the S4 interface."})
@ -19,9 +17,7 @@ ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "MME/S4-SG
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "SGW's Overload Control Information", "presence" : "O", "instance" : "1", "comment" : "During an overload condition, the SGW may include this IE over the S5/S8 interface if the overload control feature is supported by the SGW and is activated for the PLMN to which the PGW belongs (see clause 12.3.11).When present, the SGW shall provide only one instance of this IE, representing its overload information."})
ies.append({ "ie_type" : "IP Address", "ie_value" : "MME/S4-SGSN Identifier", "presence" : "CO", "instance" : "0", "comment" : "If the overload control feature is supported by the MME/S4-SGSN and is activated for the PLMN to which the PGW belongs (see clause 12.3.11), the MME/S4-SGSN shall include this IE on the S11/S4 interface when there is at least one bearer remaining for the given PDN connection after the bearer deletion, and the PGW has not been updated with the identity of the currently serving MME/S4-SGSN, i.e. if no other message carrying MME/S4-SGSN identity has been sent to the PGW during/after an inter-MME/S4-SGSN intra-SGW mobility procedure."})
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "TWAN/ePDG's Overload Control Information", "presence" : "O", "instance" : "2", "comment" : "During an overload condition, the TWAN/ePDG may include this IE over the S2a/S2b interface if the overload control feature is supported by the TWAN/ePDG and is activated for the PLMN to which the PGW belongs (see clause 12.3.11).When present, the TWAN/ePDG shall provide only one instance of this IE, representing its overload information."})
type_list["TWAN Identifier"]["max_instance"] = "1"
ies.append({ "ie_type" : "TWAN Identifier", "ie_value" : "WLAN Location Information", "presence" : "CO", "instance" : "1", "comment" : "The ePDG shall include this IE on the S2b interface if the WLAN Location Information is available. "})
type_list["TWAN Identifier Timestamp"]["max_instance"] = "1"
ies.append({ "ie_type" : "TWAN Identifier Timestamp", "ie_value" : "WLAN Location Timestamp", "presence" : "CO", "instance" : "1", "comment" : "The ePDG shall include this IE on the S2b interface, if the WLAN Location Timestamp is available. "})
ies.append({ "ie_type" : "Port Number", "ie_value" : "UE UDP Port", "presence" : "CO", "instance" : "0", "comment" : "The ePDG shall include this IE on the S2b interface if NAT is detected and UDP encapsulation is used."})
ies.append({ "ie_type" : "F-Container", "ie_value" : "NBIFOM Container", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included on the S11/S4 or S2a/S2b interfaces if the MME/S4-SGSN or the TWAN/ePDG receives a NBIFOM Container from the UE as specified in 3GPP TS 24.161 73]. The Container Type shall be set to 4."})

View File

@ -18,17 +18,22 @@ ies.append({ "ie_type" : "EBI", "ie_value" : "Linked EPS Bearer ID", "presence"
ies.append({ "ie_type" : "TWMI", "ie_value" : "Trusted WLAN Mode Indication", "presence" : "CO", "instance" : "0", "comment" : "The TWAN shall include this IE on S2a interface (during initial attach, handover to TWAN with GTP on S2a procedure, UE-initiated additional PDN connectivity procedures), if the single-connection mode or multiple-connection mode is used.The TWAN shall not include this IE if transparent single-connection mode is used. The PGW shall assume that transparent single-connection mode is used if it receives this message without this IE from the TWAN."})
ies.append({ "ie_type" : "PCO", "ie_value" : "Protocol Configuration Options", "presence" : "C", "instance" : "0", "comment" : "If MME/SGSN receives PCO from the UE during the Attach, PDN connectivity or Handover to 3GPP access procedures, the MME/SGSN shall forward the PCO IE to SGW. The SGW shall also forward it to PGW."})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Contexts to be created", "presence" : "M", "instance" : "0", "comment" : "Several IEs with the same type and instance value shall be included on the S4/S11 and S5/S8 interfaces as necessary to represent a list of Bearers. One single IE shall be included on the S2a/S2b interface.One bearer shall be included for E-UTRAN Initial Attach, PDP Context Activation, UE requested PDN Connectivity, Attach with GTP on S2b, UE initiated Connectivity to Additional PDN with GTP on S2b, Handovers between Untrusted Non-3GPP IP Access with GTP on S2b and 3GPP Access, Initial Attach for emergency session (GTP on S2b), Initial Attach in WLAN on GTP S2a, an Initial Attach in WLAN for Emergency Service on GTP S2a, Handovers between TWAN with GTP on S2a and 3GPP Access and UE initiated Connectivity to Additional PDN with GTP on S2a.One or more bearers shall be included for a Handover/TAU/RAU with an SGW change. See NOTE 6 and NOTE 7."})
type_list["Bearer Context"]["max_instance"] = "1"
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Contexts to be removed", "presence" : "C", "instance" : "1", "comment" : "This IE shall be included on the S4/S11 interfaces for the TAU/RAU/Handover cases where any of the bearers existing before the TAU/RAU/Handover procedure will be deactivated as consequence of the TAU/RAU/Handover procedure.For each of those bearers, an IE with the same type and instance value shall be included.See NOTE 6 and NOTE 7."})
ies.append({ "ie_type" : "Trace Information", "ie_value" : "Trace Information", "presence" : "C", "instance" : "0", "comment" : "This IE shall be included on the S4/S11 interface if an SGW trace is activated, and/or on the S5/S8 and S2a/2b interfaces if a PGW trace is activated. See 3GPP TS 32.422 [18]."})
ies.append({ "ie_type" : "Recovery", "ie_value" : "Recovery", "presence" : "C", "instance" : "0", "comment" : "This IE shall be included on the S4/S11, S5/S8 and S S2a/2b interfaces if contacting the peer node for the first time."})
ies.append({ "ie_type" : "FQ-CSID", "ie_value" : "MME-FQ-CSID", "presence" : "C", "instance" : "0", "comment" : "This IE shall be included by the MME on the S11 interface and shall be forwarded by an SGW on the S5/S8 interfaces according to the requirements in 3GPP TS 23.007 [17]."})
type_list["FQ-CSID"]["max_instance"] = "1"
ies.append({ "ie_type" : "FQ-CSID", "ie_value" : "SGW-FQ-CSID", "presence" : "C", "instance" : "1", "comment" : "This IE shall be included by the SGW on the S5/S8 interfaces according to the requirements in 3GPP TS 23.007 [17]."})
type_list["FQ-CSID"]["max_instance"] = "2"
ies.append({ "ie_type" : "FQ-CSID", "ie_value" : "ePDG-FQ-CSID", "presence" : "C", "instance" : "2", "comment" : "This IE shall be included by the ePDG on the S2b interface according to the requirements in 3GPP TS 23.007 [17]."})
type_list["FQ-CSID"]["max_instance"] = "3"
ies.append({ "ie_type" : "FQ-CSID", "ie_value" : "TWAN-FQ-CSID", "presence" : "C", "instance" : "3", "comment" : "This IE shall be included by the TWAN on the S2a interface according to the requirements in 3GPP TS 23.007 [17]."})
ies.append({ "ie_type" : "UE Time Zone", "ie_value" : "UE Time Zone", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included by the MME over S11 during Initial Attach, a Handover from Trusted or Untrusted Non-3GPP IP Access to E-UTRAN and UE Requested PDN Connectivity procedure.This IE shall be included by the SGSN over S4 during PDP Context Activation procedure and a Handover from Trusted or Untrusted Non-3GPP IP Access to UTRAN/GERAN.This IE shall be included by the MME/SGSN over S11/S4 TAU/RAU/Handover with SGW relocation."})
ies.append({ "ie_type" : "UCI", "ie_value" : "User CSG Information", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included on the S4/S11 interface for E-UTRAN Initial Attach, a Handover from Trusted or Untrusted Non-3GPP IP Access to E-UTRAN, UE-requested PDN Connectivity, PDP Context Activation and a Handover from Trusted or Untrusted Non-3GPP IP Access to UTRAN using S4 procedures, if the UE is accessed via CSG cell or hybrid cell. The MME/SGSN shall also include it for TAU/RAU/Handover procedures with SGW relocation if the UE is accessed via a CSG cell or hybrid cell or leaves a CSG or hybrid cell and the PGW/PCRF has requested CSG info reporting and MME/SGSN support CSG info reporting. NOTE 11.The SGW shall include this IE on S5/S8 if it receives the User CSG information from MME/SGSN.See NOTE 10."})
ies.append({ "ie_type" : "Charging Characteristics", "ie_value" : "Charging Characteristics", "presence" : "C", "instance" : "0", "comment" : "This IE shall be included on the S4/S11, S5/S8 and S2a/S2b interfaces according to 3GPP TS 32.251 [8]"})
ies.append({ "ie_type" : "LDN", "ie_value" : "MME/S4-SGSN LDN", "presence" : "O", "instance" : "0", "comment" : "This IE is optionally sent by the MME to the SGW on the S11 interface and by the S4-SGSN to the SGW on the S4 interface (see 3GPP TS 32.423 [44]), when communicating the LDN to the peer node for the first time."})
type_list["LDN"]["max_instance"] = "1"
ies.append({ "ie_type" : "LDN", "ie_value" : "SGW LDN", "presence" : "O", "instance" : "1", "comment" : "This IE is optionally sent by the SGW to the PGW on the S5/S8 interfaces (see 3GPP TS 32.423 [44]), when communicating the LDN to the peer node for the first time."})
type_list["LDN"]["max_instance"] = "2"
ies.append({ "ie_type" : "LDN", "ie_value" : "ePDG LDN", "presence" : "O", "instance" : "2", "comment" : "This IE is optionally sent by the ePDG to the PGW on the S2b interfaces (see 3GPP TS 32.423 [44]), when contacting the peer node for the first time. "})
@ -39,7 +44,9 @@ ies.append({ "ie_type" : "IP Address", "ie_value" : "UE Local IP Address", "pres
ies.append({ "ie_type" : "Port Number", "ie_value" : "UE UDP Port", "presence" : "CO", "instance" : "0", "comment" : "The ePDG shall include this IE on the S2b interface if NAT is detected, the UDP encapsulation is used and the UE Local IP Address is present."})
ies.append({ "ie_type" : "APCO", "ie_value" : "Additional Protocol Configuration Options", "presence" : "CO", "instance" : "0", "comment" : "If multiple authentications are supported by the ePDG, the ePDG shall include this IE on the S2b interface and perform the corresponding procedures as specified for PAP and CHAP authentication of the UE with external networks in 3GPP TS 33.402 [50]."})
ies.append({ "ie_type" : "IP Address", "ie_value" : "HNB Local IP Address", "presence" : "CO", "instance" : "1", "comment" : "The MME/SGSN shall include this IE on S11/S4 interface if the MME/SGSN receives this information from H(e)NB in UE associated S1/Iu signalling according (see 3GPP TS 23.139 [51]) during: E-UTRAN Initial Attach, a Handover from Trusted or Untrusted Non-3GPP IP Access to E-UTRAN, UE-requested PDN Connectivity, PDP Context Activation and a a Handover from Trusted or Untrusted Non-3GPP IP Access to UTRAN using S4;TAU/RAU/X2-based handover/Enhanced Serving RNS Relocation Procedure with SGW change, if the PGW/PCRF has requested H(e)NB information reporting for the PDN connection.The SGW shall forward this IE on S5/S8 interface if the SGW receives it from the MME/SGSN."})
type_list["Port Number"]["max_instance"] = "1"
ies.append({ "ie_type" : "Port Number", "ie_value" : "HNB UDP Port", "presence" : "CO", "instance" : "1", "comment" : "The MME/SGSN shall include this IE on S11/S4 interface if the MME/SGSN receives this information from H(e)NB in UE associated S1/Iu signalling according (see 3GPP TS 23.139 [51]) during: E-UTRAN Initial Attach, a Handover from Trusted or Untrusted Non-3GPP IP Access to E-UTRAN, UE-requested PDN Connectivity, PDP Context Activation and a Handover from Trusted or Untrusted Non-3GPP IP Access to UTRAN using S4;TAU/RAU/X2-based handover/Enhanced Serving RNS Relocation Procedure with SGW relocation, if the PGW/PCRF has requested H(e)NB information reporting for the PDN connection.The SGW shall forward this IE on S5/S8 interface if the SGW receives it from the MME/SGSN."})
type_list["IP Address"]["max_instance"] = "2"
ies.append({ "ie_type" : "IP Address", "ie_value" : "MME/S4-SGSN Identifier", "presence" : "CO", "instance" : "2", "comment" : "If the PGW triggered SGW restoration procedure is supported, the MME/S4-SGSN shall include this IE on S11/S4 interface and the SGW shall forward this IE on S5 interface in the existing signalling as specified in 3GPP TS 23.007 [17].If the overload control feature is supported by the MME/S4-SGSN and is activated for the PLMN to which the PGW belongs (see clause 12.3.11), the MME/S4-SGSN shall include this IE on the S11/S4 interface. In that case, the SGW shall forward this IE on the S5/S8 interface."})
ies.append({ "ie_type" : "TWAN Identifier", "ie_value" : "TWAN Identifier", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included on the S2a interface for Initial Attach in WLAN procedure, UE-initiated Connectivity to Additional PDN with GTP on S2a and handover to TWAN with GTP on S2a procedure as specified in 3GPP TS 23.402 [45]. "})
type_list["IP Address"]["max_instance"] = "3"
@ -47,10 +54,13 @@ ies.append({ "ie_type" : "IP Address", "ie_value" : "ePDG IP Address", "presence
ies.append({ "ie_type" : "CN Operator Selection Entity", "ie_value" : "CN Operator Selection Entity", "presence" : "CO", "instance" : "0", "comment" : "In shared networks, the SGSN shall include this IE on the S4 interface for a PDP Context Activation, a Handover from Trusted or Untrusted Non-3GPP IP Access to UTRAN/GERAN and RAU with SGW relocation procedures, if the information is available, to indicate whether the Serving Network has been selected by the UE or by the network."})
ies.append({ "ie_type" : "Presence Reporting Area Information", "ie_value" : "Presence Reporting Area Information", "presence" : "CO", "instance" : "0", "comment" : "The MME/SGSN shall include this IE in the following procedures, if the PGW/PCRF/OCS requested reporting changes of UE presence in the Presence Reporting Area(s) and the MME/SGSN supports such reporting:- TAU/RAU/X2 Handover/Enhanced SRNS Relocation procedures with SGW relocation and MME/SGSN change. The new MME/SGSN shall then indicate whether the UE is inside or outside the PRA for each of the active Presence Reporting Area(s), or indicate that the Presence Reporting Area (s) is inactive; - TAU/RAU/X2 Handover/Enhanced SRNS Relocation procedures with SGW relocation and without MME/SGSN change, if the UE enters or leaves the Presence Reporting Area(s). In this case, this IE shall only include the active PRA(s) that the UE has newly entered or left.Several IEs with the same type and instance value may be included as necessary to represent a list of Presence Reporting Area Actions. See NOTE 20."})
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "MME/S4-SGSN's Overload Control Information", "presence" : "O", "instance" : "0", "comment" : "During an overload condition, the MME/S4-SGSN may include this IE on the S11/S4 interface if the overload control feature is supported by the MME/S4-SGSN and is activated for the PLMN to which the PGW belongs (see clause 12.3.11).When present, the MME/S4-SGSN shall provide only one instance of this IE, representing its overload information."})
type_list["Overload Control Information"]["max_instance"] = "1"
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "SGW's Overload Control Information", "presence" : "O", "instance" : "1", "comment" : "During an overload condition, the SGW may include this IE over the S5/S8 interface if the overload control feature is supported by the SGW and is activated for the PLMN to which the PGW belongs (see clause 12.3.11).When present, the SGW shall provide only one instance of this IE, representing its overload information."})
type_list["Overload Control Information"]["max_instance"] = "2"
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "TWAN/ePDG's Overload Control Information", "presence" : "O", "instance" : "2", "comment" : "During an overload condition, the TWAN/ePDG may include this IE over the S2a/S2b interface if the overload control feature is supported by the TWAN/ePDG and is activated for the PLMN to which the PGW belongs (see clause 12.3.11).When present, the TWAN/ePDG shall provide only one instance of this IE, representing its overload information."})
ies.append({ "ie_type" : "Millisecond Time Stamp", "ie_value" : "Origination Time Stamp", "presence" : "CO", "instance" : "0", "comment" : "The MME/SGSN and the TWAN/ePDG shall include this IE on the S11/S4 and S2a/S2b interface respectively, in the conditions specified in clause 13.2.When present, the Origination Time Stamp shall contain the UTC time when the originating entity initiated the request."})
ies.append({ "ie_type" : "Integer Number", "ie_value" : "Maximum Wait Time", "presence" : "CO", "instance" : "0", "comment" : "The MME/SGSN and the TWAN/ePDG shall include this IE on the S11/S4 and S2a/S2b interface respectively, in the conditions specified in clause 13.3.When present, the Maximum Wait Time shall contain the duration (number of milliseconds since the Origination Time Stamp) during which the originator of the request waits for a response."})
type_list["TWAN Identifier"]["max_instance"] = "1"
ies.append({ "ie_type" : "TWAN Identifier", "ie_value" : "WLAN Location Information", "presence" : "CO", "instance" : "1", "comment" : "This IE shall be included on the S2b interface if the WLAN Location Information is available. "})
ies.append({ "ie_type" : "TWAN Identifier Timestamp", "ie_value" : "WLAN Location Timestamp", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included on the S2b interface, if the WLAN Location Timestamp is available. "})
ies.append({ "ie_type" : "F-Container", "ie_value" : "NBIFOM Container", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included on the S11/S4 or S2a/S2b interfaces if the MME/S4-SGSN or the TWAN/ePDG receives an NBIFOM Container from the UE as specified in TS 24.161 73]. The Container Type shall be set to 4."})
@ -62,6 +72,7 @@ ies.append({ "ie_type" : "Counter", "ie_value" : "MO Exception Data Counter", "p
type_list["Port Number"]["max_instance"] = "2"
ies.append({ "ie_type" : "Port Number", "ie_value" : "UE TCP Port", "presence" : "CO", "instance" : "2", "comment" : "The ePDG shall include this IE on the S2b interface if NAT is detected, the TCP encapsulation is used and the UE Local IP Address is present."})
ies.append({ "ie_type" : "Mapped UE Usage Type", "ie_value" : "Mapped UE Usage Type", "presence" : "CO", "instance" : "0", "comment" : "The MME/SGSN shall include this IE on the S11/S4 interface, if available. When present, this IE shall contain the mapped UE usage type applicable to the PDN connection. See NOTE 21. "})
type_list["ULI"]["max_instance"] = "1"
ies.append({ "ie_type" : "ULI", "ie_value" : "User Location Information for SGW ", "presence" : "CO", "instance" : "1", "comment" : "The MME/SGSN shall include this IE on the S11/S4 interface, based on operator policy for the User Location Information to be sent to the SGW, if the user location information to be passed to the SGW is not already reported in the ULI IE in this message.When present, this IE shall include the ECGI, TAI, eNodeB ID, RAI and/or RNC-ID, based on local policy.See NOTE 21."})
ies.append({ "ie_type" : "FQDN", "ie_value" : "SGW-U node name", "presence" : "CO", "instance" : "0", "comment" : "The SGW-C shall include this IE on the S5 interface, if available. See NOTE 21. "})
ies.append({ "ie_type" : "Secondary RAT Usage Data Report", "ie_value" : "Secondary RAT Usage Data Report", "presence" : "CO", "instance" : "0", "comment" : "If the PLMN has configured secondary RAT usage reporting and PDN GW Secondary RAT reporting is active, the MME shall include this IE on the S11 interface if it has received Secondary RAT usage data from eNodeB in an X2-based handover with Serving GW relocation. The MME shall also set the IRSGW flag to 0, to indicate that the Secondary RAT usage data is reported for the Source SGW, and sent via the Target SGW to the PGW.Several IEs with the same type and instance value may be included, to represent multiple usage data reports."})

View File

@ -25,7 +25,9 @@ ies.append({ "ie_type" : "IP4CP", "ie_value" : "Trusted WLAN IPv4 Parameters ",
ies.append({ "ie_type" : "Indication", "ie_value" : "Indication Flags", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included if any one of the applicable flags is set to 1.Applicable flags are:PDN Pause Support Indication: this flag shall be set to 1 on the S5/S8 interface if the PGW supports the PGW Pause of Charging procedure.PDN Pause Enable Indication: this flag shall be set to 1 on the S5/S8 interface if the PGW enables the SGW to use the PGW Pause of Charging procedure for this PDN connection.Associate OCI with PGW nodes identity: The PGW shall set this flag to 1 on the S5/S8 interface or S2a/S2b interface if it has included the PGWs Overload Control Information and if this information is to be associated with the node identity (i.e. FQDN or the IP address received from the HSS or DNS during the PGW selection) of the serving PGW. This flag shall be set to 1 by the PGW if the PGWs Overload Control Information is included and the Cause IE is set to a rejection cause code. The SGW shall set this flag on the S11/S4 interface if it supports the overload control feature and if the flag is set on the S5/S8 interface.Associate OCI with SGW nodes identity: The SGW shall set this flag to 1 on the S11/S4 interface if it has included the SGWs Overload Control Information and if this information is to be associated with the node identity (i.e. FQDN or the IP address received from the DNS during the SGW selection) of the serving SGW. This flag shall be set to 1 by the SGW if the SGWs Overload Control Information is included and the Cause IE is set to a rejection cause code. Delay Tolerant Connection Indication: the flag shall be set to 1 on the S5/S8 and S11/S4 interface if the PDN connection is Delay Tolerant (see clause 8.12).Triggering SGSN initiated PDP Context Creation/Modification Indication: this flag shall be set to 1 on the S5/S8 interfaces if the network-initiated NBIFOM mode is used for this PDN connection. The SGW shall set this flag on the S4 interface if it supports the NBIFOM feature and the flag is set on the S5/S8 interface."})
ies.append({ "ie_type" : "Presence Reporting Area Action", "ie_value" : "Presence Reporting Area Action", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included on the S5/S8 and S11/S4 interfaces with the appropriate Action field if reporting changes of UE presence in a Presence Routing Area is to be started, stopped or modified for this subscriber in the MME/SGSN.Several IEs with the same type and instance value may be included as necessary to represent a list of Presence Reporting Area Actions. One IE shall be included per PRA to be started, stopped or modified."})
ies.append({ "ie_type" : "Load Control Information", "ie_value" : "PGW's node level Load Control Information", "presence" : "O", "instance" : "0", "comment" : "The PGW may include this IE on the S5/S8 or S2a/S2b interface, providing its node level load information, if the load control feature is supported by the PGW and is activated for the PLMN to which the access network node, i.e. MME/S4-SGSN for 3GPP access network, ePDG/TWAN for non-3GPP access network, belongs (see clause 12.2.6)."})
type_list["Load Control Information"]["max_instance"] = "1"
ies.append({ "ie_type" : "Load Control Information", "ie_value" : "PGW's APN level Load Control Information", "presence" : "O", "instance" : "1", "comment" : "The PGW may include this IE on the S5/S8 or S2a/S2b interface, providing APN level load information, if the APN level load control feature is supported by the PGW and is activated for the PLMN to which the access network node, i.e. MME/S4-SGSN for 3GPP access network, ePDG/TWAN for non-3GPP access based network, belongs (see clause 12.2.6).When present, the PGW shall provide one or more instances of this IE, up to maximum of 10, with the same type and instance value, each representing the load information for a list of APN(s).See NOTE 9, NOTE 11."})
type_list["Load Control Information"]["max_instance"] = "2"
ies.append({ "ie_type" : "Load Control Information", "ie_value" : "SGW's node level Load Control Information", "presence" : "O", "instance" : "2", "comment" : "The SGW may include this IE, over the S11/S4 interface if the load control feature is supported by the SGW and is activated in the network (see clause 12.2.6).When present, the SGW shall provide only one instance of this IE, representing its node level load information."})
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "PGW's Overload Control Information", "presence" : "O", "instance" : "0", "comment" : "During an overload condition, the PGW may include this IE on the S5/S8 or S2a/S2b interface, if the overload control feature is supported by the PGW and is activated for the PLMN to which the access network node, i.e. MME/S4-SGSN for 3GPP access based network, ePDG/TWAN for non-3GPP access based network, belongs (see clause 12.3.11).When present, the PGW shall provide: node level overload control, in one instance of this IE; and/orAPN level overload control , in one or more instances of this IE, up to maximum of 10, with the same type and instance value, each representing the overload information for a list of APN(s).See NOTE 10, NOTE 12."})
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "SGW's Overload Control Information", "presence" : "O", "instance" : "1", "comment" : "During an overload condition, the SGW may include this IE over the S11/S4 interface if the overload control feature is supported by the SGW and is activated in the network (see clause 12.3.11).When present, the SGW shall provide only one instance of this IE, representing its overload information."})

View File

@ -8,32 +8,26 @@ ies.append({ "ie_type" : "F-TEID", "ie_value" : "Sender F-TEID for Control Plane
ies.append({ "ie_type" : "AMBR", "ie_value" : "Aggregate Maximum Bit Rate", "presence" : "C", "instance" : "0", "comment" : "The APN-AMBR shall be sent for TAU/RAU/Handover from the Gn/Gp SGSN to the S4 SGSN/MME procedures."})
ies.append({ "ie_type" : "Delay Value", "ie_value" : "Delay Downlink Packet Notification Request", "presence" : "C", "instance" : "0", "comment" : "his IE shall be sent on the S11 interface for a UE triggered Service Request and UE initiated Connection Resume procedures. It shall contain the delay the SGW shall apply between receiving downlink data and sending Downlink Data Notification for all UEs served by that MME (see clause 5.3.4.2 of 3GPP TS 23.401 [3])."})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Contexts to be modified", "presence" : "C", "instance" : "0", "comment" : "This IE shall be sent on the S4/S11 interface and S5/S8 interface, except on the S5/S8 interface for a UE triggered Service Request and UE initiated Connection Resume procedures. on the S5/S8 interface for a TAU/RAU/HO without SGW change procedure. See NOTE 10. .on the S5/S8 interface when requesting the PGW to pause or unpause charging for the PDN connection. on the S5/S8 interface for any other procedure without SGW change which requires to send a Modify Bearer Request to the PGW, e.g. HSS-based P-CSCF restoration for 3GPP access, reporting of UE presence in a Presence Reporting Area, implicit resume of suspended bearers.(see NOTE 6).When Handover Indication flag is set to 1 (i.e., for a Handover from Trusted or Untrusted Non-3GPP IP Access to E-UTRAN or a Handover from Trusted or Untrusted Non-3GPP IP Access to UTRAN/GERAN procedures), the PGW shall ignore this IE. See NOTE 1.Several IEs with the same type and instance value may be included as necessary to represent a list of Bearers to be modified.During a TAU/RAU/Handover procedure with an SGW change, the SGW includes all bearers it received from the MME/SGSN (Bearer Contexts to be created, or Bearer Contexts to be modified and also Bearer Contexts to be removed) into the list of Bearer Contexts to be modified IEs, which are then sent on the S5/S8 interface to the PGW (see NOTE 2, see NOTE 10). During an E-UTRAN Initiated E-RAB modification procedure the MME shall send a Modify Bearer Request, including all the bearers (those modified and those not modified), per PDN connection for which at least one bearer has changed. See NOTE 11."})
type_list["Bearer Context"]["max_instance"] = "1"
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Contexts to be removed", "presence" : "C", "instance" : "1", "comment" : "This IE shall be included on the S4 and S11 interfaces for the TAU/RAU/Handover, UE initiated Connection Resume and Service Request procedures where any of the bearers existing before the TAU/RAU/Handover procedure, UE initiated Connection Resume and Service Request procedures will be deactivated as consequence of the TAU/RAU/Handover procedure, UE initiated Connection Resume and Service Request procedures. See NOTE 3 and NOTE 6.For each of those bearers, an IE with the same type and instance value, shall be included. See NOTE 11."})
ies.append({ "ie_type" : "Recovery", "ie_value" : "Recovery", "presence" : "C", "instance" : "0", "comment" : "This IE shall be included if contacting the peer for the first time "})
ies.append({ "ie_type" : "UE Time Zone", "ie_value" : "UE Time Zone", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included by the MME/SGSN on the S11/S4 interfaces if the UE Time Zone has changed in the case of TAU/RAU/Handover or UE initiated Service Request procedure. See NOTE 5."})
ies.append({ "ie_type" : "FQ-CSID", "ie_value" : "MME-FQ-CSID", "presence" : "C", "instance" : "0", "comment" : "This IE shall be included by MME on S11 and shall be forwarded by SGW on S5/S8 according to the requirements in 3GPP TS 23.007 [17]."})
ies.append({ "ie_type" : "UCI", "ie_value" : "User CSG Information", "presence" : "CO", "instance" : "0", "comment" : "The MME/SGSN shall include this IE for Handover procedures, UE initiated Connection Resume and UE-initiated Service Request procedure if the PGW/PCRF has requested CSG Info reporting and the MME/SGSN support the CSG information reporting and the User CSG information has changed (i.e. the UE is accessed via a new CSG cell or hybrid cell or leaves a CSG or hybrid cell).In TAU/RAU procedure without SGW change, this IE shall also be sent if the PGW/PCRF has requested CSG info reporting and MME/SGSN supports CSG info reporting and the User CSG information has changed (i.e. the UE is accessed via a new CSG cell or hybrid cell or leaves a CSG or hybrid cell) when UE requested to activate E-RAB for all the active EPS bearers in TAU procedure or to keep the Iu connection after the completion of the RAU procedure. See NOTE 5. See NOTE 10. See NOTE 16.The SGW shall include this IE on S5/S8 if it receives the User CSG Information from MME/SGSN. See NOTE 15."})
ies.append({ "ie_type" : "IP Address", "ie_value" : "UE Local IP Address", "presence" : "CO", "instance" : "1", "comment" : "If the UE local IP Address has changed, the ePDG shall include this IE on S2b interface based on local policy for Fixed Broadband access network interworking (see 3GPP TS 23.139 [51]). "})
type_list["Port Number"]["max_instance"] = "1"
ies.append({ "ie_type" : "Port Number", "ie_value" : "UE UDP Port", "presence" : "CO", "instance" : "1", "comment" : "The ePDG shall include this IE on S2b interface if NAT is detected and UE Local IP Address is present for Fixed Broadband access network interworking (see 3GPP TS 23.139 [51]). "})
ies.append({ "ie_type" : "LDN", "ie_value" : "MME/S4-SGSN LDN", "presence" : "O", "instance" : "0", "comment" : "This IE is optionally sent by the MME to the SGW on the S11 interface and by the SGSN to the SGW on the S4 interface (see 3GPP TS 32.423 [44]), when communicating the LDN to the peer node for the first time."})
type_list["LDN"]["max_instance"] = "1"
ies.append({ "ie_type" : "LDN", "ie_value" : "SGW LDN", "presence" : "O", "instance" : "1", "comment" : "This IE is optionally sent by the SGW to the PGW on the S5/S8 interfaces (see 3GPP TS 32.423 [44]), for inter-SGW mobity, when communicating the LDN to the peer node for the first time."})
ies.append({ "ie_type" : "IP Address", "ie_value" : "HNB Local IP Address", "presence" : "CO", "instance" : "0", "comment" : "The MME/SGSN shall include this IE on S11/S4 interface if the PGW/PCRF has requested H(e)NB information reporting and the MME/SGSN has received this information from H(e)NB in UE associated S1/Iu signalling (see 3GPP TS 23.139 [51]). The SGW shall forward this IE on S5/S8 interface if it is received from the MME/SGSN and the Modify Bearer Request message needs to be sent to the PGW as specified in the 3GPP TS 23.401 [3]; orthe Propagate BBAI information change flag is received from the MME/SGSN.(NOTE 7)"})
ies.append({ "ie_type" : "Port Number", "ie_value" : "HNB UDP Port", "presence" : "CO", "instance" : "0", "comment" : "The MME/SGSN shall include this IE on S11/S4 interface if the PGW/PCRF has requested H(e)NB information reporting and the MME/SGSN has received this information from H(e)NB in UE associated S1/Iu signalling (see 3GPP TS 23.139 [51]). The SGW shall forward this IE on S5/S8 interface if it is received from the MME/SGSN and the Modify Bearer Request message needs to be sent to the PGW as specified in the 3GPP TS 23.401 [3]; orthe Propagate BBAI information change flag is received from the MME/SGSN.(NOTE 7)"})
type_list["IP Address"]["max_instance"] = "2"
ies.append({ "ie_type" : "IP Address", "ie_value" : "MME/S4-SGSN Identifier", "presence" : "CO", "instance" : "2", "comment" : "If the PGW triggered SGW restoration procedure is supported, the MME/S4-SGSN shall include this IE on S11/S4 interface and the SGW shall forward this IE on S5 interface in the existing signalling as specified in 3GPP TS 23.007 [17].If the overload control feature is supported by the MME/S4-SGSN and is activated for the PLMN to which the PGW belongs(see clause 12.3.11), the MME/S4-SGSN shall include this IE on the S11/S4 interface during mobility procedures with MME/S4-SGSN change."})
ies.append({ "ie_type" : "CN Operator Selection Entity", "ie_value" : "CN Operator Selection Entity", "presence" : "CO", "instance" : "0", "comment" : "In shared networks, the SGSN shall include this IE on the S4 interface for the RAU procedure, if the information is available, and if the Serving Network IE is present in the message or if the CN Operator Selection Entity has changed, to indicate whether the Serving Network has been selected by the UE or by the network."})
ies.append({ "ie_type" : "Presence Reporting Area Information", "ie_value" : "Presence Reporting Area Information", "presence" : "CO", "instance" : "0", "comment" : "The MME/SGSN shall include this IE: - if the PGW/PCRF/OCS has just requested to start or modify reporting changes of UE presence in a Presence Reporting Area and the MME/SGSN supports such reporting. The MME/SGSN shall then indicate whether the UE is inside or outside the newly started or modified Presence Reporting Area(s), or indicate the Presence Reporting Area(s) is inactive. Several IEs with the same type and instance value may be included as necessary to represent a list of Presence Reporting Area Information. One IE shall be included for each Presence Reporting Area newly started or modified.The MME/SGSN shall also include this IE in the following procedures, if the PGW/PCRF requested to report changes of UE presence in a Presence Reporting Area and the MME/SGSN supports such reporting: - TAU/RAU/Handover procedures without SGW change and with MME/SGSN change and S1-based handover procedure with SGW change. The MME/SGSN shall then indicate whether the UE is inside or outside the Presence Reporting Area(s) for each of the active Presence Reporting Area(s), or indicate that the Presence Reporting Area(s) is inactive. Several IEs with the same type and instance value may be included as necessary to represent a list of Presence Reporting Area Information.- TAU/RAU/Handover/Cell Update procedures without MME/SGSN change, UE initiated Connection Resume and UE-initiated Service Request procedure if the UE enters or leaves the Presence Reporting Area(s). Several IEs with the same type and instance value may be included as necessary to represent a list of Presence Reporting Area Information. One IE shall be included for each active Presence Reporting Area that the UE has newly entered or left. See NOTE 5, NOTE 10.- UE initiated Service Request, if ISR is active; See NOTE 22."})
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "MME/S4-SGSN's Overload Control Information", "presence" : "O", "instance" : "0", "comment" : "During an overload condition, the MME/S4-SGSN may include this IE on the S11/S4 interface if the overload control feature is supported by the MME/S4-SGSN and is activated for the PLMN to which the PGW belongs (see clause 12.3.11).When present, the MME/S4-SGSN shall provide only one instance of this IE, representing its overload information."})
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "SGW's Overload Control Information", "presence" : "O", "instance" : "1", "comment" : "During an overload condition, the SGW may include this IE over the S5/S8 interface if the overload control feature is supported by the SGW and is activated for the PLMN to which the PGW belongs (see clause 12.3.11).When present, the SGW shall provide only one instance of this IE, representing its overload information."})
type_list["Overload Control Information"]["max_instance"] = "2"
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "ePDG's Overload Control Information", "presence" : "O", "instance" : "2", "comment" : "During an overload condition, the ePDG may include this IE over the S2b interface if the overload control feature is supported by the ePDG and is activated for the PLMN to which the PGW belongs (see clause 12.3.11).When present, the ePDG shall provide only one instance of this IE, representing its overload information."})
ies.append({ "ie_type" : "Serving PLMN Rate Control", "ie_value" : "Serving PLMN Rate Control", "presence" : "CO", "instance" : "0", "comment" : "The MME shall include this IE on the S11 interface if the Serving PLMN Rate is changed.The target MME shall also include this IE on the S11 interface during an Inter-MME mobility procedure if the Serving PLMN Rate control is configured, and if the configured value is different from the one received from the old MME. See NOTE 20.The SGW shall include this IE on S5/S8 if it receives this IE from MME via the Create Session Request or the Modify Bearer Request message. "})
ies.append({ "ie_type" : "Counter", "ie_value" : "MO Exception Data Counter", "presence" : "CO", "instance" : "0", "comment" : "The MME shall include this IE on the S11 interface when it needs to send a non-zero counter value for the MO Exception Data Counter. The timestamp in the counter shall be set with the time at which the counter value increased from 0 to 1."})
ies.append({ "ie_type" : "IMSI", "ie_value" : "IMSI", "presence" : "O", "instance" : "0", "comment" : "The MME/SGSN should include the IMSI if available. See NOTE 23."})
type_list["ULI"]["max_instance"] = "1"
ies.append({ "ie_type" : "ULI", "ie_value" : "User Location Information for SGW ", "presence" : "CO", "instance" : "1", "comment" : "The MME/SGSN shall include this IE on the S11/S4 interface, based on operator policy for the User Location Information to be sent to the SGW, if the user location information to be passed to the SGW is not already reported in the ULI IE in this message.When present, this IE shall include the ECGI, TAI, eNodeB ID, RAI and/or RNC-ID, based on local policy.See NOTE 25."})
ies.append({ "ie_type" : "TWAN Identifier", "ie_value" : "WLAN Location Information", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included on the S2b interface, during a UE initiated IPsec tunnel update procedure, if the WLAN Location Information is available. "})
ies.append({ "ie_type" : "TWAN Identifier Timestamp", "ie_value" : "WLAN Location Timestamp", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included on the S2b interface, during a UE initiated IPsec tunnel update procedure, if the WLAN Location Timestamp is available. "})

View File

@ -15,6 +15,7 @@ ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "MME/S4-SG
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "SGW's Overload Control Information", "presence" : "O", "instance" : "1", "comment" : "During an overload condition, the SGW may include this IE over the S5/S8 interface if the overload control feature is supported by the SGW and is activated for the PLMN to which the PGW belongs (see clause 12.3.11).When present, the SGW shall provide only one instance of this IE, representing its overload information."})
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "TWAN/ePDG's Overload Control Information", "presence" : "O", "instance" : "2", "comment" : "During an overload condition, the TWAN/ePDG may include this IE over the S2a/S2b interface if the overload control feature is supported by the TWAN/ePDG and is activated for the PLMN to which the PGW belongs (see clause 12.3.11).When present, the TWAN/ePDG shall provide only one instance of this IE, representing its overload information."})
ies.append({ "ie_type" : "TWAN Identifier", "ie_value" : "WLAN Location Information", "presence" : "CO", "instance" : "1", "comment" : "The ePDG shall include this IE on the S2b interface if the WLAN Location Information is available. "})
type_list["TWAN Identifier Timestamp"]["max_instance"] = "1"
ies.append({ "ie_type" : "TWAN Identifier Timestamp", "ie_value" : "WLAN Location Timestamp", "presence" : "CO", "instance" : "1", "comment" : "The ePDG shall include this IE on the S2b interface, if the WLAN Location Timestamp is available. "})
ies.append({ "ie_type" : "IP Address", "ie_value" : "UE Local IP Address", "presence" : "CO", "instance" : "0", "comment" : "The ePDG shall include this IE on the S2b interface. "})
ies.append({ "ie_type" : "Port Number", "ie_value" : "UE UDP Port", "presence" : "CO", "instance" : "0", "comment" : "The ePDG shall include this IE on the S2b interface if NAT is detected and UDP encapsulation is used."})

View File

@ -14,7 +14,6 @@ ies.append({ "ie_type" : "F-TEID", "ie_value" : "S12 RNC F-TEID", "presence" : "
ies.append({ "ie_type" : "PCO", "ie_value" : "Protocol Configuration Options", "presence" : "O", "instance" : "0", "comment" : "If the UE includes the PCO IE, then the MME/SGSN shall copy the content of this IE transparently from the PCO IE included by the UE. If the SGW receives PCO from the MME/SGSN, the SGW shall forward it to the PGW."})
ies.append({ "ie_type" : "Signalling Priority Indication", "ie_value" : "Signalling Priority Indication ", "presence" : "CO", "instance" : "0", "comment" : "The SGSN/MME shall include this IE on the S4/S11 interface if the UE indicates low access priority during the procedure. The SGW shall forward this IE on the S5/S8 interfaces if received from the MME/SGSN. "})
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "MME/S4-SGSN's Overload Control Information", "presence" : "O", "instance" : "0", "comment" : "During an overload condition, the MME/S4-SGSN may include this IE on the S11/S4 interface if the overload control feature is supported by the MME/S4-SGSN and is activated for the PLMN to which the PGW belongs (see clause 12.3.11).When present, the MME/S4-SGSN shall provide only one instance of this IE, representing its overload information."})
type_list["Overload Control Information"]["max_instance"] = "1"
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "SGW's Overload Control Information", "presence" : "O", "instance" : "1", "comment" : "During an overload condition, the SGW may include this IE over the S5/S8 interface if the overload control feature is supported by the SGW and is activated for the PLMN to which the PGW belongs (see clause 12.3.11).When present, the SGW shall provide only one instance of this IE, representing its overload information."})
ies.append({ "ie_type" : "F-Container", "ie_value" : "NBIFOM Container", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included on the S11/S4 or S2a/S2b interfaces if the MME/S4-SGSN or the TWAN/ePDG receives an NBIFOM Container from the UE as specified in 3GPP TS 24.161 73]. The Container Type shall be set to 4."})
ies.append({ "ie_type" : "ePCO", "ie_value" : "Extended Protocol Configuration Options", "presence" : "O", "instance" : "0", "comment" : "If the UE includes the ePCO IE, then the MME shall copy the content of this IE transparently from the ePCO IE included by the UE. If the SGW receives ePCO from the MME, the SGW shall forward it to the PGW."})

View File

@ -4,7 +4,6 @@ ies.append({ "ie_type" : "EBI", "ie_value" : "Linked EPS Bearer ID", "presence"
ies.append({ "ie_type" : "PCO", "ie_value" : "Protocol Configuration Options", "presence" : "O", "instance" : "0", "comment" : "This IE may be sent on the S5/S8 and S4/S11 interfaces if ePCO is not supported by the UE or the network."})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Contexts", "presence" : "M", "instance" : "0", "comment" : "Several IEs with this type and instance values shall be included as necessary to represent a list of Bearers."})
ies.append({ "ie_type" : "FQ-CSID", "ie_value" : "PGW-FQ-CSID", "presence" : "C", "instance" : "0", "comment" : "This IE shall be included by the PGW on the S5/S8 and S2a/S2b interfaces and, when received from S5/S8 be forwarded by the SGW on the S11 interface according to the requirements in 3GPP TS 23.007 [17]."})
type_list["FQ-CSID"]["max_instance"] = "1"
ies.append({ "ie_type" : "FQ-CSID", "ie_value" : "SGW-FQ-CSID", "presence" : "C", "instance" : "1", "comment" : "This IE shall be included by the SGW on the S11 interface according to the requirements in 3GPP TS 23.007 [17]."})
ies.append({ "ie_type" : "Change Reporting Action", "ie_value" : "Change Reporting Action", "presence" : "C", "instance" : "0", "comment" : "This IE shall be included on the S5/S8 and S4/S11 interfaces with the appropriate Action field If the location Change Reporting mechanism is to be started or stopped for this subscriber in the SGSN/MME."})
ies.append({ "ie_type" : "CSG Information Reporting Action", "ie_value" : "CSG Information Reporting Action", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included on the S5/S8 and S4/S11 interfaces with the appropriate Action field if the CSG Info reporting mechanism is to be started or stopped for this subscriber in the SGSN/MME."})
@ -12,9 +11,7 @@ ies.append({ "ie_type" : "eNB Information Reporting", "ie_value" : "HNB Informat
ies.append({ "ie_type" : "Presence Reporting Area Action", "ie_value" : "Presence Reporting Area Action", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included on the S5/S8 and S11/S4 interfaces with the appropriate Action field if reporting changes of UE presence in a Presence Routing Area is to be started, stopped or modified for this subscriber in the MME/SGSN.Several IEs with the same type and instance value may be included as necessary to represent a list of Presence Reporting Area Actions. One IE shall be included per PRA to be started, stopped or modified."})
ies.append({ "ie_type" : "Indication", "ie_value" : "Indication Flags", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included if any one of the applicable flags is set to 1.Applicable flags are:Associate OCI with PGW nodes identity: The PGW shall set this flag to 1 on the S5/S8 interface or S2a/S2b interface if it has included the PGWs Overload Control Information and if this information is to be associated with the node identity (i.e. FQDN or the IP address received from the HSS or DNS during the PGW selection) of the serving PGW. The SGW shall set this flag on the S11/S4 interface if it supports the overload control feature and if the flag is set on the S5/S8 interface.Associate OCI with SGW nodes identity: The SGW shall set this flag to 1 on the S11/S4 interface if it has included the SGWs Overload Control Information and if this information is to be associated with the node identity (i.e. FQDN or the IP address received from the DNS during the SGW selection) of the serving SGW. Extended EBI Value Range Support Indication: The PGW shall set this flag to 1 if it supports the 15 EPS Bearers."})
ies.append({ "ie_type" : "Load Control Information", "ie_value" : "PGW's node level Load Control Information", "presence" : "O", "instance" : "0", "comment" : "The PGW may include this IE on the S5/S8 or S2a/S2b interface, providing its node level load information, if the load control feature is supported by the PGW and is activated for the PLMN to which the access network node, i.e. MME/S4-SGSN for 3GPP access network, ePDG/TWAN for non-3GPP access network, belongs (see clause 12.2.6)."})
type_list["Load Control Information"]["max_instance"] = "1"
ies.append({ "ie_type" : "Load Control Information", "ie_value" : "PGW's APN level Load Control Information", "presence" : "O", "instance" : "1", "comment" : "The PGW may include this IE on the S5/S8 or S2a/S2b interface, providing APN level load information, if the APN level load control feature is supported by the PGW and is activated for the PLMN to which the access network node, i.e. MME/S4-SGSN for 3GPP access network, ePDG/TWAN for non-3GPP access based network, belongs (see clause 12.2.6).When present, the PGW shall provide one or more instances of this IE, up to maximum of 10, with the same type and instance value, each representing the load information for a list of APN(s).See NOTE 2, NOTE 4."})
type_list["Load Control Information"]["max_instance"] = "2"
ies.append({ "ie_type" : "Load Control Information", "ie_value" : "SGW's node level Load Control Information", "presence" : "O", "instance" : "2", "comment" : "The SGW may include this IE, over the S11/S4 interface if the load control feature is supported by the SGW and is activated in the network (see clause 12.2.6).When present, the SGW shall provide only one instance of this IE, representing its node level load information."})
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "PGW's Overload Control Information", "presence" : "O", "instance" : "0", "comment" : "During an overload condition, the PGW may include this IE on the S5/S8 or S2a/S2b interface, if the overload control feature is supported by the PGW and is activated for the PLMN to which the access network node, i.e. MME/S4-SGSN for 3GPP access based network, ePDG/TWAN for non-3GPP access based network, belongs (see clause 12.3.11).When present, the PGW shall provide node level overload control, in one instance of this IE; and/orAPN level overload control, in one or more instances of this IE, up to maximum of 10, with the same type and instance value, each representing the overload information for a list of APN(s).See NOTE 3, NOTE 5."})
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "SGW's Overload Control Information", "presence" : "O", "instance" : "1", "comment" : "During an overload condition, the SGW may include this IE over the S11/S4 interface if the overload control feature is supported by the SGW and is activated in the network (see clause 12.3.11).When present, the SGW shall provide only one instance of this IE, representing its overload information."})

View File

@ -80,14 +80,14 @@ def output_header_to_file(f):
f.write(" ******************************************************************************/\n\n")
def usage():
print "Python generating TLV build/parser for GTPv2-C v%s" % (version)
print "Usage: python gtp-tlv.py [options]"
print "Available options:"
print "-d Enable script debug"
print "-f [file] Input file to parse"
print "-o [dir] Output files to given directory"
print "-c [dir] Cache files to given directory"
print "-h Print this help and return"
print("Python generating TLV build/parser for GTPv2-C v%s" % (version))
print("Usage: python gtp-tlv.py [options]")
print("Available options:")
print("-d Enable script debug")
print("-f [file] Input file to parse")
print("-o [dir] Output files to given directory")
print("-c [dir] Cache files to given directory")
print("-h Print this help and return")
def v_upper(v):
return re.sub('3GPP', '', re.sub('\'', '_', re.sub('/', '_', re.sub('-', '_', re.sub(' ', '_', v)))).upper())
@ -96,10 +96,10 @@ def v_lower(v):
return re.sub('3gpp', '', re.sub('\'', '_', re.sub('/', '_', re.sub('-', '_', re.sub(' ', '_', v)))).lower())
def get_cells(cells):
instance = cells[4].text.encode('ascii', 'ignore')
instance = cells[4].text
if instance.isdigit() is not True:
return None
ie_type = re.sub('\s*$', '', re.sub('\s*\n*\s*\([A-z]*\s*NOTE.*\)*', '', cells[3].text.encode('ascii', 'ignore')))
ie_type = re.sub('\s*$', '', re.sub('\s*\n*\s*\([A-z]*\s*NOTE.*\)*', '', cells[3].text))
if ie_type.find('LDN') != -1:
ie_type = 'LDN'
elif ie_type.find('APCO') != -1:
@ -119,10 +119,10 @@ def get_cells(cells):
if ie_type not in type_list.keys():
assert False, "Unknown IE type : [" \
+ cells[3].text + "]" + "(" + ie_type + ")"
presence = cells[1].text.encode('ascii', 'ignore')
presence = cells[1].text
presence = re.sub('\n', '', presence);
ie_value = re.sub('\s*\n*\s*\([^\)]*\)*', '', cells[0].text).encode('ascii', 'ignore')
comment = cells[2].text.encode('ascii', 'ignore')
ie_value = re.sub('\s*\n*\s*\([^\)]*\)*', '', cells[0].text)
comment = cells[2].text.encode('ascii', 'ignore').decode('utf-8')
comment = re.sub('\n|\"|\'|\\\\', '', comment);
if int(instance) > int(type_list[ie_type]["max_instance"]):
@ -163,15 +163,15 @@ for o, a in opts:
sys.exit(2)
if os.path.isfile(filename) and os.access(filename, os.R_OK):
file = open(filename, 'r')
file = open(filename, 'r')
else:
d_error("Cannot find file : " + filename)
d_info("[Message List]")
cachefile = cachedir + 'tlv-msg-list.py'
if os.path.isfile(cachefile) and os.access(cachefile, os.R_OK):
execfile(cachefile)
print "Read from " + cachefile
exec(open(cachefile).read())
print("Read from " + cachefile)
else:
document = Document(filename)
f = open(cachefile, 'w')
@ -184,8 +184,8 @@ else:
d_print("Table Index = %d\n" % i)
for row in msg_table.rows[2:-4]:
key = row.cells[1].text.encode('ascii', 'ignore')
type = row.cells[0].text.encode('ascii', 'ignore')
key = row.cells[1].text
type = row.cells[0].text
if type.isdigit() is False:
continue
if int(type) in range(128, 160):
@ -202,8 +202,8 @@ else:
d_info("[IE Type List]")
cachefile = cachedir + 'tlv-type-list.py'
if os.path.isfile(cachefile) and os.access(cachefile, os.R_OK):
execfile(cachefile)
print "Read from " + cachefile
exec(open(cachefile).read())
print("Read from " + cachefile)
else:
document = Document(filename)
f = open(cachefile, 'w')
@ -216,7 +216,7 @@ else:
d_print("Table Index = %d\n" % i)
for row in ie_table.rows[1:-5]:
key = row.cells[1].text.encode('ascii', 'ignore')
key = row.cells[1].text
if key.find('Reserved') != -1:
continue
if key.find('MM Context') != -1:
@ -234,10 +234,10 @@ else:
elif key.find('Procedure Transaction ID') != -1:
key = 'PTI'
else:
key = re.sub('.*\(', '', row.cells[1].text.encode('ascii', 'ignore'))
key = re.sub('.*\(', '', row.cells[1].text)
key = re.sub('\)', '', key)
key = re.sub('\s*$', '', key)
type = row.cells[0].text.encode('ascii', 'ignore')
type = row.cells[0].text
type_list[key] = { "type": type , "max_instance" : "0" }
write_file(f, "type_list[\"" + key + "\"] = { \"type\" : \"" + type)
write_file(f, "\", \"max_instance\" : \"0\" }\n")
@ -247,8 +247,8 @@ type_list['MM Context'] = { "type": "107", "max_instance" : "0" }
d_info("[Group IE List]")
cachefile = cachedir + 'tlv-group-list.py'
if os.path.isfile(cachefile) and os.access(cachefile, os.R_OK):
execfile(cachefile)
print "Read from " + cachefile
exec(open(cachefile).read())
print("Read from " + cachefile)
else:
document = Document(filename)
f = open(cachefile, 'w')
@ -262,8 +262,8 @@ else:
if len(re.findall('\d+', row.cells[2].text)) == 0:
continue;
ie_type = re.findall('\d+', row.cells[2].text)[0].encode('ascii', 'ignore')
ie_name = re.sub('\s*IE Type.*', '', row.cells[2].text.encode('ascii', 'ignore'))
ie_type = re.findall('\d+', row.cells[2].text)[0]
ie_name = re.sub('\s*IE Type.*', '', row.cells[2].text)
if ie_name not in group_list.keys():
ies = []
@ -347,8 +347,8 @@ for key in msg_list.keys():
d_info("[" + key + "]")
cachefile = cachedir + "tlv-msg-" + msg_list[key]["type"] + ".py"
if os.path.isfile(cachefile) and os.access(cachefile, os.R_OK):
execfile(cachefile)
print "Read from " + cachefile
exec(open(cachefile).read())
print("Read from " + cachefile)
else:
document = Document(filename)
f = open(cachefile, 'w')
@ -375,6 +375,7 @@ for key in msg_list.keys():
type_list["Recovery"]["size"] = 1 # Type : 3
type_list["EBI"]["size"] = 1 # Type : 73
type_list["RAT Type"]["size"] = 1 # Type : 82
type_list["Charging ID"]["size"] = 4 # Type : 94
type_list["PDN Type"]["size"] = 1 # Type : 99
type_list["PTI"]["size"] = 1 # Type : 100
type_list["Port Number"]["size"] = 2 # Type : 126

View File

@ -69,7 +69,7 @@ typedef struct ogs_gtp_extension_header_s {
} __attribute__ ((packed)) ogs_gtp_extension_header_t;
/* 8.4 Cause */
#define OGS_GTP_CAUSE_INVALID_VALUE 0
#define OGS_GTP_CAUSE_UNDEFINED_VALUE 0
#define OGS_GTP_CAUSE_LOCAL_DETACH 2
#define OGS_GTP_CAUSE_COMPLETE_DETACH_3
#define OGS_GTP_CAUSE_RAT_CHANGED_FROM_3GPP_TO_NON_3GPP 4

View File

@ -560,7 +560,7 @@ int ogs_gtp_xact_commit(ogs_gtp_xact_t *xact)
rv = ogs_gtp_sendto(xact->gnode, pkbuf);
ogs_expect(rv == OGS_OK);
return OGS_OK;
return rv;
}
static void response_timeout(void *data)

View File

@ -28,7 +28,7 @@
/*******************************************************************************
* This file had been created by nas-message.py script v0.2.0
* Please do not modify this file but regenerate it via script.
* Created on: 2021-05-30 21:57:39.474183 by acetcom
* Created on: 2021-06-15 11:11:47.244075 by acetcom
* from 24501-g41.docx
******************************************************************************/

View File

@ -28,7 +28,7 @@
/*******************************************************************************
* This file had been created by nas-message.py script v0.2.0
* Please do not modify this file but regenerate it via script.
* Created on: 2021-05-30 21:57:39.484594 by acetcom
* Created on: 2021-06-15 11:11:47.251176 by acetcom
* from 24501-g41.docx
******************************************************************************/

View File

@ -28,7 +28,7 @@
/*******************************************************************************
* This file had been created by nas-message.py script v0.2.0
* Please do not modify this file but regenerate it via script.
* Created on: 2021-05-30 21:57:39.457575 by acetcom
* Created on: 2021-06-15 11:11:47.232648 by acetcom
* from 24501-g41.docx
******************************************************************************/

View File

@ -28,7 +28,7 @@
/*******************************************************************************
* This file had been created by nas-message.py script v0.2.0
* Please do not modify this file but regenerate it via script.
* Created on: 2021-05-30 21:57:39.454963 by acetcom
* Created on: 2021-06-15 11:11:47.230677 by acetcom
* from 24501-g41.docx
******************************************************************************/

View File

@ -28,7 +28,7 @@
/*******************************************************************************
* This file had been created by nas-message.py script v0.2.0
* Please do not modify this file but regenerate it via script.
* Created on: 2021-05-30 21:57:39.466799 by acetcom
* Created on: 2021-06-15 11:11:47.238937 by acetcom
* from 24501-g41.docx
******************************************************************************/

View File

@ -1,16 +1,12 @@
* Install python-pip
user@host ~/Documents/git/open5gs/lib/gtp/support$ \
sudo apt-get install python-pip
* Install python-docx
user@host ~/Documents/git/open5gs/lib/gtp/support$ \
sudo pip install python-docx
user@host ~/Documents/git/open5gs/lib/nas/5gs/support$ \
sudo pip3 install python-docx
* Change the format of standard specification
from 24301-d80.doc to 24301-d80.docx
using Microsoft Office 2007+
* Generate Message support files
user@host ~/Documents/git/open5gs/lib/s1ap/support$ \
python nas-message.py -f 24501-g41.docx -o ..
user@host ~/Documents/git/open5gs/lib/nas/5gs/support$ \
python3 nas-message.py -f 24501-g41.docx -o ..

View File

@ -96,14 +96,14 @@ def output_header_to_file(f):
f.write(" ******************************************************************************/\n\n")
def usage():
print "Python generating NAS Message encoder/decoder v%s" % (version)
print "Usage: python nas-message.py [options]"
print "Available options:"
print "-d Enable script debug"
print "-f [file] Input file to parse"
print "-o [dir] Output files to given directory"
print "-c [dir] Cache files to given directory"
print "-h Print this help and return"
print("Python generating NAS Message encoder/decoder v%s" % (version))
print("Usage: python nas-message.py [options]")
print("Available options:")
print("-d Enable script debug")
print("-f [file] Input file to parse")
print("-o [dir] Output files to given directory")
print("-c [dir] Cache files to given directory")
print("-h Print this help and return")
def v_upper(v):
return re.sub('_TO_UE', '', re.sub('_FROM_UE', '', re.sub('\'', '_', re.sub('/', '_', re.sub('-', '_', re.sub(' ', '_', v)))).upper()))
@ -115,13 +115,13 @@ def get_value(v):
return re.sub('5gs_', '', re.sub('5g_', '', re.sub('5gsm', 'gsm', re.sub('5gmm', 'gmm', re.sub('\'', '_', re.sub('/', '_', re.sub('-', '_', re.sub(' ', '_', v)))).lower()))))
def get_cells(cells):
iei = cells[0].text.encode('ascii', 'ignore')
value = re.sub("\s*$", "", re.sub("\s*\n*\s*\([^\)]*\)*", "", re.sub("'s", "", cells[1].text))).encode('ascii', 'ignore')
type = re.sub("^NAS ", "", re.sub("'s", "", re.sub('\s*\n\s*[a-zA-Z0-9.]*', '', cells[2].text))).encode('ascii', 'ignore')
reference = re.sub('[a-zA-Z0-9\'\-\s]*\n\s*', '', cells[2].text).encode('ascii', 'ignore')
presence = cells[3].text.encode('ascii', 'ignore')
format = cells[4].text.encode('ascii', 'ignore')
length = cells[5].text.encode('ascii', 'ignore')
iei = cells[0].text
value = re.sub("\s*$", "", re.sub("\s*\n*\s*\([^\)]*\)*", "", re.sub("'s", "", cells[1].text)))
type = re.sub("^NAS ", "", re.sub("'s", "", re.sub('\s*\n\s*[a-zA-Z0-9.]*', '', cells[2].text)))
reference = re.sub('[a-zA-Z0-9\'\-\s]*\n\s*', '', cells[2].text)
presence = cells[3].text
format = cells[4].text
length = cells[5].text
# Spec errata - workaround
if (type == "Request type" and value == "Request type"):
@ -264,8 +264,8 @@ for key in msg_list.keys():
d_info("[" + key + "]")
cachefile = cachedir + "nas-msg-" + msg_list[key]["type"] + ".py"
if os.path.isfile(cachefile) and os.access(cachefile, os.R_OK):
execfile(cachefile)
print "Read from " + cachefile
exec(open(cachefile).read())
print("Read from " + cachefile)
else:
document = Document(filename)
f = open(cachefile, 'w')
@ -326,8 +326,8 @@ for (k, v) in sorted_msg_list:
d_info("[Type List]")
typefile = currentdir + "type-list.py"
if os.path.isfile(typefile) and os.access(typefile, os.R_OK):
execfile(typefile)
print "Read from " + typefile
exec(open(typefile).read())
print("Read from " + typefile)
tmp = [(k, v["reference"]) for k, v in type_list.items()]
sorted_type_list = sorted(tmp, key=lambda tup: tup[1])

View File

@ -28,7 +28,7 @@
/*******************************************************************************
* This file had been created by nas-message.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2021-05-30 21:57:00.074257 by acetcom
* Created on: 2021-06-15 11:19:58.629247 by acetcom
* from 24301-g40.docx
******************************************************************************/

View File

@ -28,7 +28,7 @@
/*******************************************************************************
* This file had been created by nas-message.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2021-05-30 21:57:00.085478 by acetcom
* Created on: 2021-06-15 11:19:58.637113 by acetcom
* from 24301-g40.docx
******************************************************************************/

View File

@ -28,7 +28,7 @@
/*******************************************************************************
* This file had been created by nas-message.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2021-05-30 21:57:00.058358 by acetcom
* Created on: 2021-06-15 11:19:58.617999 by acetcom
* from 24301-g40.docx
******************************************************************************/

View File

@ -28,7 +28,7 @@
/*******************************************************************************
* This file had been created by nas-message.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2021-05-30 21:57:00.055906 by acetcom
* Created on: 2021-06-15 11:19:58.616283 by acetcom
* from 24301-g40.docx
******************************************************************************/

View File

@ -28,7 +28,7 @@
/*******************************************************************************
* This file had been created by nas-message.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2021-05-30 21:57:00.065569 by acetcom
* Created on: 2021-06-15 11:19:58.623021 by acetcom
* from 24301-g40.docx
******************************************************************************/

View File

@ -1,16 +1,12 @@
* Install python-pip
user@host ~/Documents/git/open5gs/lib/gtp/support$ \
sudo apt-get install python-pip
* Install python-docx
user@host ~/Documents/git/open5gs/lib/gtp/support$ \
sudo pip install python-docx
user@host ~/Documents/git/open5gs/lib/nas/eps/support$ \
sudo pip3 install python-docx
* Change the format of standard specification
from 24301-d80.doc to 24301-d80.docx
using Microsoft Office 2007+
* Generate Message support files
user@host ~/Documents/git/open5gs/lib/s1ap/support$ \
python nas-message.py -f 24301-g40.docx -o ..
user@host ~/Documents/git/open5gs/lib/nas/eps/support$ \
python3 nas-message.py -f 24301-g40.docx -o ..

View File

@ -96,14 +96,14 @@ def output_header_to_file(f):
f.write(" ******************************************************************************/\n\n")
def usage():
print "Python generating NAS Message encoder/decoder v%s" % (version)
print "Usage: python nas-message.py [options]"
print "Available options:"
print "-d Enable script debug"
print "-f [file] Input file to parse"
print "-o [dir] Output files to given directory"
print "-c [dir] Cache files to given directory"
print "-h Print this help and return"
print("Python generating NAS Message encoder/decoder v%s" % (version))
print("Usage: python nas-message.py [options]")
print("Available options:")
print("-d Enable script debug")
print("-f [file] Input file to parse")
print("-o [dir] Output files to given directory")
print("-c [dir] Cache files to given directory")
print("-h Print this help and return")
def v_upper(v):
return re.sub('_TO_UE', '', re.sub('_FROM_UE', '', re.sub('3GPP', '', re.sub('\'', '_', re.sub('/', '_', re.sub('-', '_', re.sub(' ', '_', v)))).upper())))
@ -112,15 +112,15 @@ def v_lower(v):
return re.sub('3gpp', '', re.sub('\'', '_', re.sub('/', '_', re.sub('-', '_', re.sub(' ', '_', v)))).lower())
def get_cells(cells):
iei = cells[0].text.encode('ascii', 'ignore')
value = re.sub("\s*$", "", re.sub("\s*\n*\s*\([^\)]*\)*", "", re.sub("'s", "", cells[1].text))).encode('ascii', 'ignore')
type = re.sub("^NAS ", "", re.sub("'s", "", re.sub('\s*\n\s*[a-zA-Z0-9.]*', '', cells[2].text))).encode('ascii', 'ignore')
iei = cells[0].text
value = re.sub("\s*$", "", re.sub("\s*\n*\s*\([^\)]*\)*", "", re.sub("'s", "", cells[1].text)))
type = re.sub("^NAS ", "", re.sub("'s", "", re.sub('\s*\n\s*[a-zA-Z0-9.]*', '', cells[2].text)))
if type == "message container":
type = "EPS message container"
reference = re.sub('[a-zA-Z0-9\'\-\s]*\n\s*', '', cells[2].text).encode('ascii', 'ignore')
presence = cells[3].text.encode('ascii', 'ignore')
format = cells[4].text.encode('ascii', 'ignore')
length = cells[5].text.encode('ascii', 'ignore')
reference = re.sub('[a-zA-Z0-9\'\-\s]*\n\s*', '', cells[2].text)
presence = cells[3].text
format = cells[4].text
length = cells[5].text
return { "iei" : iei, "value" : value, "type" : type, "reference" : reference, "presence" : presence, "format" : format, "length" : length }
@ -278,8 +278,8 @@ for key in msg_list.keys():
d_info("[" + key + "]")
cachefile = cachedir + "nas-msg-" + msg_list[key]["type"] + ".py"
if os.path.isfile(cachefile) and os.access(cachefile, os.R_OK):
execfile(cachefile)
print "Read from " + cachefile
exec(open(cachefile).read())
print("Read from " + cachefile)
else:
document = Document(filename)
f = open(cachefile, 'w')
@ -340,8 +340,8 @@ for (k, v) in sorted_msg_list:
d_info("[Type List]")
typefile = currentdir + "type-list.py"
if os.path.isfile(typefile) and os.access(typefile, os.R_OK):
execfile(typefile)
print "Read from " + typefile
exec(open(typefile).read())
print("Read from " + typefile)
tmp = [(k, v["reference"]) for k, v in type_list.items()]
sorted_type_list = sorted(tmp, key=lambda tup: tup[1])

View File

@ -20,7 +20,7 @@
/*******************************************************************************
* This file had been created by pfcp-tlv.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2020-08-28 21:50:38.885547 by acetcom
* Created on: 2021-06-15 10:58:38.385939 by acetcom
* from 29244-g10.docx
******************************************************************************/

View File

@ -20,7 +20,7 @@
/*******************************************************************************
* This file had been created by pfcp-tlv.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2020-08-28 21:50:38.876204 by acetcom
* Created on: 2021-06-15 10:58:38.379862 by acetcom
* from 29244-g10.docx
******************************************************************************/

View File

@ -1,11 +1,7 @@
* Install python-pip
user@host ~/Documents/git/open5gs/lib/gtp/support$ \
sudo apt-get install python-pip
* Install python-docx
user@host ~/Documents/git/open5gs/lib/gtp/support$ \
sudo pip install python-docx
user@host ~/Documents/git/open5gs/lib/pfcp/support$ \
sudo pip3 install python-docx
* Change the format of standard specification
from 29244-f40.doc to 29274-f40.docx
@ -13,4 +9,4 @@ user@host ~/Documents/git/open5gs/lib/gtp/support$ \
* Generate TLV support files
user@host ~/Documents/git/open5gs/lib/pfcp/support$ \
python pfcp-tlv.py -f 29244-g10.docx -o ..
python3 pfcp-tlv.py -f 29244-g10.docx -o ..

View File

@ -1,9 +1,13 @@
ies = []
ies.append({ "ie_type" : "Node ID", "ie_value" : "Node ID", "presence" : "M", "tlv_more" : "0", "comment" : "This IE shall contain the unique identifier of the sending Node."})
ies.append({ "ie_type" : "F-SEID", "ie_value" : "CP F-SEID", "presence" : "M", "tlv_more" : "0", "comment" : "This IE shall contain the unique identifier allocated by the CP function identifying the session."})
type_list["Create PDR"]["max_tlv_more"] = "7"
ies.append({ "ie_type" : "Create PDR", "ie_value" : "Create PDR", "presence" : "M", "tlv_more" : "7", "comment" : "This IE shall be present for at least one PDR to be associated to the PFCP session.Several IEs with the same IE type may be present to represent multiple PDRs.See Table 7.5.2.2-1."})
type_list["Create FAR"]["max_tlv_more"] = "7"
ies.append({ "ie_type" : "Create FAR", "ie_value" : "Create FAR", "presence" : "M", "tlv_more" : "7", "comment" : "This IE shall be present for at least one FAR to be associated to the PFCP session.Several IEs with the same IE type may be present to represent multiple FARs.See Table 7.5.2.3-1."})
type_list["Create URR"]["max_tlv_more"] = "1"
ies.append({ "ie_type" : "Create URR", "ie_value" : "Create URR", "presence" : "C", "tlv_more" : "1", "comment" : "This IE shall be present if a measurement action shall be applied to packets matching one or more PDR(s) of this PFCP session.Several IEs within the same IE type may be present to represent multiple URRs.See Table 7.5.2.4-1."})
type_list["Create QER"]["max_tlv_more"] = "3"
ies.append({ "ie_type" : "Create QER", "ie_value" : "Create QER", "presence" : "C", "tlv_more" : "3", "comment" : "This IE shall be present if a QoS enforcement or QoS marking action shall be applied to packets matching one or more PDR(s) of this PFCP session.Several IEs within the same IE type may be present to represent multiple QERs.See Table 7.5.2.5-1."})
ies.append({ "ie_type" : "Create BAR", "ie_value" : "Create BAR", "presence" : "O", "tlv_more" : "0", "comment" : "When present, this IE shall contain the buffering instructions to be applied by the UP function to any FAR of this PFCP session set with the Apply Action requesting the packets to be buffered and with a BAR ID IE referring to this BAR. See table 7.5.2.6-1."})
ies.append({ "ie_type" : "Create Traffic Endpoint", "ie_value" : "Create Traffic Endpoint", "presence" : "C", "tlv_more" : "0", "comment" : "This IE may be present if the UP function has indicated support of PDI optimization.Several IEs within the same IE type may be present to represent multiple Traffic Endpoints.See Table 7.5.2.7-1."})

View File

@ -10,13 +10,9 @@ type_list["Remove QER"]["max_tlv_more"] = "3"
ies.append({ "ie_type" : "Remove QER", "ie_value" : "Remove QER", "presence" : "C", "tlv_more" : "3", "comment" : "When present, this IE shall contain the QER Rule which is requested to be removed. See Table 7.5.4-9-1.Several IEs within the same IE type may be present to represent a list of QERs to remove."})
ies.append({ "ie_type" : "Remove BAR", "ie_value" : "Remove BAR", "presence" : "C", "tlv_more" : "0", "comment" : "When present, this IE shall contain the BAR Rule which is requested to be removed. See Table 7.5.4.12-1."})
ies.append({ "ie_type" : "Remove Traffic Endpoint", "ie_value" : "Remove Traffic Endpoint", "presence" : "C", "tlv_more" : "0", "comment" : "When present, this IE shall contain the Traffic Endpoint ID identifying the traffic endpoint to be removed, if the UP function has indicated support of PDI optimization.All the PDRs that refer to the removed Traffic Endpoint shall be deleted.See Table 7.5.4.14-1."})
type_list["Create PDR"]["max_tlv_more"] = "7"
ies.append({ "ie_type" : "Create PDR", "ie_value" : "Create PDR", "presence" : "C", "tlv_more" : "7", "comment" : "This IE shall be present if the CP function requests the UP function to create a new PDR.See Table 7.5.2.2-1.Several IEs within the same IE type may be present to represent a list of PDRs to create."})
type_list["Create FAR"]["max_tlv_more"] = "7"
ies.append({ "ie_type" : "Create FAR", "ie_value" : "Create FAR", "presence" : "C", "tlv_more" : "7", "comment" : "This IE shall be present if the CP function requests the UP function to create a new FAR.See Table 7.5.2.3-1.Several IEs within the same IE type may be present to represent a list of FARs to create."})
type_list["Create URR"]["max_tlv_more"] = "1"
ies.append({ "ie_type" : "Create URR", "ie_value" : "Create URR", "presence" : "C", "tlv_more" : "1", "comment" : "This IE shall be present if the CP function requests the UP function to create a new URR. See Table 7.5.2.4-1.Several IEs within the same IE type may be present to represent a list of URRs to create."})
type_list["Create QER"]["max_tlv_more"] = "3"
ies.append({ "ie_type" : "Create QER", "ie_value" : "Create QER", "presence" : "C", "tlv_more" : "3", "comment" : "This IE shall be present if the CP function requests the UP function to create a new QER. See Table 7.5.2.5-1.Several IEs within the same IE type may be present to represent a list of QERs to create."})
ies.append({ "ie_type" : "Create BAR", "ie_value" : "Create BAR", "presence" : "C", "tlv_more" : "0", "comment" : "This IE shall be present if the CP function requests the UP function to create a new BAR.See Table 7.5.2.6-1."})
ies.append({ "ie_type" : "Create Traffic Endpoint", "ie_value" : "Create Traffic Endpoint", "presence" : "C", "tlv_more" : "0", "comment" : "When present this IE shall contain the information associated with the Traffic Endpoint to be created, if the UP function has indicated support of PDI optimization. See Table 7.5.2.7-1."})

View File

@ -80,14 +80,14 @@ def output_header_to_file(f):
f.write(" ******************************************************************************/\n\n")
def usage():
print "Python generating TLV build/parser for PFCP v%s" % (version)
print "Usage: python pfcp-tlv.py [options]"
print "Available options:"
print "-d Enable script debug"
print "-f [file] Input file to parse"
print "-o [dir] Output files to given directory"
print "-c [dir] Cache files to given directory"
print "-h Print this help and return"
print("Python generating TLV build/parser for PFCP v%s" % (version))
print("Usage: python pfcp-tlv.py [options]")
print("Available options:")
print("-d Enable script debug")
print("-f [file] Input file to parse")
print("-o [dir] Output files to given directory")
print("-c [dir] Cache files to given directory")
print("-h Print this help and return")
def v_upper(v):
return re.sub('3GPP', '', re.sub('\'', '_', re.sub('/', '_', re.sub('-', '_', re.sub(' ', '_', v)))).upper())
@ -96,13 +96,13 @@ def v_lower(v):
return re.sub('3gpp', '', re.sub('\'', '_', re.sub('/', '_', re.sub('-', '_', re.sub(' ', '_', v)))).lower())
def get_cells(cells):
note = cells[0].text.encode('ascii', 'ignore')
note = cells[0].text
if note.find('NOTE') != -1:
return None
comment = cells[2].text.encode('ascii', 'ignore')
comment = cells[2].text.encode('ascii', 'ignore').decode('utf-8')
comment = re.sub('\n|\"|\'|\\\\', '', comment);
#print comment
ie_type = re.sub('\s*$', '', re.sub('\'\s*\n*\s*\(NOTE.*\)*', '', cells[-1].text.encode('ascii', 'ignore')))
ie_type = re.sub('\s*$', '', re.sub('\'\s*\n*\s*\(NOTE.*\)*', '', cells[-1].text))
#if ie_type.find('Usage Report') != -1:
if ie_type == 'Usage Report':
@ -136,8 +136,8 @@ def get_cells(cells):
if ie_type not in type_list.keys():
assert False, "Unknown IE type : [" \
+ cells[-1].text + "]" + "(" + ie_type + ")"
presence = cells[1].text.encode('ascii', 'ignore')
ie_value = re.sub('\s*\n*\s*\([^\)]*\)*', '', cells[0].text).encode('ascii', 'ignore')
presence = cells[1].text
ie_value = re.sub('\s*\n*\s*\([^\)]*\)*', '', cells[0].text)
if ie_value[len(ie_value)-1] == ' ':
ie_value = ie_value[:len(ie_value)-1]
@ -200,8 +200,8 @@ else:
d_info("[Message List]")
cachefile = cachedir + 'tlv-msg-list.py'
if os.path.isfile(cachefile) and os.access(cachefile, os.R_OK):
execfile(cachefile)
print "Read from " + cachefile
exec(open(cachefile).read())
print("Read from " + cachefile)
else:
document = Document(filename)
f = open(cachefile, 'w')
@ -218,8 +218,8 @@ else:
d_print("Table Index = %d\n" % i)
for row in msg_table.rows[2:-3]:
key = row.cells[1].text.encode('ascii', 'ignore')
type = row.cells[0].text.encode('ascii', 'ignore')
key = row.cells[1].text
type = row.cells[0].text
if type.isdigit() is False:
continue
if key.find('Reserved') != -1:
@ -232,8 +232,8 @@ else:
d_info("[IE Type List]")
cachefile = cachedir + 'tlv-type-list.py'
if os.path.isfile(cachefile) and os.access(cachefile, os.R_OK):
execfile(cachefile)
print "Read from " + cachefile
exec(open(cachefile).read())
print("Read from " + cachefile)
else:
document = Document(filename)
f = open(cachefile, 'w')
@ -250,14 +250,14 @@ else:
d_print("Table Index = %d\n" % i)
for row in ie_table.rows[1:-1]:
key = row.cells[1].text.encode('ascii', 'ignore')
key = row.cells[1].text
if key.find('Reserved') != -1:
continue
key = re.sub('\(', '', key)
key = re.sub('\)', '', key)
key = re.sub('\s*$', '', key)
type = row.cells[0].text.encode('ascii', 'ignore')
type = row.cells[0].text
type_list[key] = { "type": type , "max_tlv_more" : "0" }
write_file(f, "type_list[\"" + key + "\"] = { \"type\" : \"" + type)
write_file(f, "\", \"max_tlv_more\" : \"0\" }\n")
@ -266,8 +266,8 @@ else:
d_info("[Group IE List]")
cachefile = cachedir + 'tlv-group-list.py'
if os.path.isfile(cachefile) and os.access(cachefile, os.R_OK):
execfile(cachefile)
print "Read from " + cachefile
exec(open(cachefile).read())
print("Read from " + cachefile)
else:
document = Document(filename)
f = open(cachefile, 'w')
@ -298,8 +298,8 @@ else:
if len(re.findall('\d+', row.cells[num].text)) == 0:
continue;
ie_type = re.findall('\d+', row.cells[num].text)[-1].encode('ascii', 'ignore')
ie_name = re.sub('\s*IE Type.*', '', row.cells[num].text.encode('ascii', 'ignore'))
ie_type = re.findall('\d+', row.cells[num].text)[-1]
ie_name = re.sub('\s*IE Type.*', '', row.cells[num].text)
d_print("TYPE:%s NAME:%s\n" % (ie_type, ie_name))
@ -366,8 +366,8 @@ for key in msg_list.keys():
d_info("[" + key + "]")
cachefile = cachedir + "tlv-msg-" + msg_list[key]["type"] + ".py"
if os.path.isfile(cachefile) and os.access(cachefile, os.R_OK):
execfile(cachefile)
print "Read from " + cachefile
exec(open(cachefile).read())
print("Read from " + cachefile)
else:
document = Document(filename)
f = open(cachefile, 'w')

View File

@ -208,6 +208,9 @@ int hss_context_parse_config(void)
} else if (!strcmp(fd_key, "listen_on")) {
self.diam_config->cnf_addr =
ogs_yaml_iter_value(&fd_iter);
} else if (!strcmp(fd_key, "no_fwd")) {
self.diam_config->cnf_flags.no_fwd =
ogs_yaml_iter_bool(&fd_iter);
} else if (!strcmp(fd_key, "load_extension")) {
ogs_yaml_iter_t ext_array, ext_iter;
ogs_yaml_iter_recurse(&fd_iter, &ext_array);

View File

@ -22,6 +22,7 @@
#include "ogs-diameter-s6a.h"
#include "ogs-diameter-cx.h"
#include "ogs-diameter-swx.h"
#include "ogs-dbi.h"
#include "ogs-app.h"

View File

@ -129,7 +129,7 @@ static int hss_ogs_diam_cx_uar_cb( struct msg **msg, struct avp *avp,
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = 1;
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
@ -176,7 +176,7 @@ out:
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = 1;
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
@ -429,7 +429,7 @@ static int hss_ogs_diam_cx_mar_cb( struct msg **msg, struct avp *avp,
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = 1;
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
@ -567,7 +567,7 @@ out:
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = 1;
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
@ -711,7 +711,7 @@ static int hss_ogs_diam_cx_sar_cb( struct msg **msg, struct avp *avp,
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = 1;
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
@ -824,7 +824,7 @@ out:
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = 1;
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
@ -893,7 +893,7 @@ static int hss_ogs_diam_cx_lir_cb( struct msg **msg, struct avp *avp,
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = 1;
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
@ -941,7 +941,7 @@ out:
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = 1;
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);

View File

@ -34,6 +34,11 @@ int hss_fd_init(void)
ogs_assert(rv == OGS_OK);
rv = hss_cx_init();
ogs_assert(rv == OGS_OK);
rv = hss_swx_init();
ogs_assert(rv == OGS_OK);
rv = ogs_diam_start();
ogs_assert(rv == 0);
return OGS_OK;
}
@ -42,6 +47,7 @@ void hss_fd_final(void)
{
hss_s6a_final();
hss_cx_final();
hss_swx_final();
ogs_diam_final();
}

View File

@ -31,6 +31,8 @@ int hss_s6a_init(void);
void hss_s6a_final(void);
int hss_cx_init(void);
void hss_cx_final(void);
int hss_swx_init(void);
void hss_swx_final(void);
#ifdef __cplusplus
}

View File

@ -30,7 +30,7 @@ static struct disp_hdl *hdl_s6a_air = NULL;
static struct disp_hdl *hdl_s6a_ulr = NULL;
/* Default callback for the application. */
static int hss_ogs_diam_s6a_fb_cb(struct msg **msg, struct avp *avp,
static int hss_ogs_diam_s6a_fb_cb(struct msg **msg, struct avp *avp,
struct session *session, void *opaque, enum disp_action *act)
{
/* This CB should never be called */
@ -153,7 +153,7 @@ static int hss_ogs_diam_s6a_air_cb( struct msg **msg, struct avp *avp,
goto out;
}
ret = fd_msg_search_avp(qry, ogs_diam_s6a_visited_plmn_id, &avp);
ret = fd_msg_search_avp(qry, ogs_diam_visited_plmn_id, &avp);
ogs_assert(ret == 0);
ret = fd_msg_avp_hdr(avp, &hdr);
ogs_assert(ret == 0);
@ -220,7 +220,7 @@ static int hss_ogs_diam_s6a_air_cb( struct msg **msg, struct avp *avp,
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = 1;
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
@ -251,7 +251,7 @@ out:
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = 1;
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
@ -269,7 +269,7 @@ out:
}
/* Callback for incoming Update-Location-Request messages */
static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp,
static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp,
struct session *session, void *opaque, enum disp_action *act)
{
int ret;
@ -316,7 +316,7 @@ static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp,
goto out;
}
ret = fd_msg_search_avp(qry, ogs_diam_s6a_visited_plmn_id, &avp);
ret = fd_msg_search_avp(qry, ogs_diam_visited_plmn_id, &avp);
ogs_assert(ret == 0);
ret = fd_msg_avp_hdr(avp, &hdr);
ogs_assert(ret == 0);
@ -331,7 +331,7 @@ static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp,
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = 1;
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
@ -410,7 +410,7 @@ static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp,
val.i32 = subscription_data.access_restriction_data;
ret = fd_msg_avp_setvalue( avp_access_restriction_data, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(avp, MSG_BRW_LAST_CHILD,
ret = fd_msg_avp_add(avp, MSG_BRW_LAST_CHILD,
avp_access_restriction_data);
ogs_assert(ret == 0);
}
@ -520,6 +520,8 @@ static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp,
struct avp *allocation_retention_priority, *priority_level;
struct avp *pre_emption_capability, *pre_emption_vulnerability;
struct avp *mip6_agent_info, *mip_home_agent_address;
struct avp *pdn_gw_allocation_type;
struct avp *vplmn_dynamic_address_allowed;
ogs_session_t *session = &slice_data->session[i];
ogs_assert(session);
@ -583,7 +585,7 @@ static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp,
}
/* Set Service-Selection */
ret = fd_msg_avp_new(ogs_diam_s6a_service_selection, 0,
ret = fd_msg_avp_new(ogs_diam_service_selection, 0,
&service_selection);
ogs_assert(ret == 0);
ogs_assert(session->name);
@ -606,7 +608,7 @@ static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp,
val.i32 = session->qos.index;
ret = fd_msg_avp_setvalue(qos_class_identifier, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(eps_subscribed_qos_profile,
ret = fd_msg_avp_add(eps_subscribed_qos_profile,
MSG_BRW_LAST_CHILD, qos_class_identifier);
ogs_assert(ret == 0);
@ -694,11 +696,36 @@ static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp,
ogs_assert(ret == 0);
}
ret = fd_msg_avp_add(apn_configuration,
ret = fd_msg_avp_add(apn_configuration,
MSG_BRW_LAST_CHILD, mip6_agent_info);
ogs_assert(ret == 0);
ret = fd_msg_avp_new(ogs_diam_s6a_pdn_gw_allocation_type, 0,
&pdn_gw_allocation_type);
ogs_assert(ret == 0);
val.u32 = OGS_DIAM_S6A_PDN_GW_ALLOCATION_DYNAMIC;
ret = fd_msg_avp_setvalue(pdn_gw_allocation_type, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(apn_configuration,
MSG_BRW_LAST_CHILD, pdn_gw_allocation_type);
ogs_assert(ret == 0);
}
/* Set VPLMN-Dynamic-Address-Allowed */
ret = fd_msg_avp_new(ogs_diam_s6a_vplmn_dynamic_address_allowed, 0,
&vplmn_dynamic_address_allowed);
ogs_assert(ret == 0);
val.u32 = OGS_DIAM_S6A_VPLMN_DYNAMIC_ADDRESS_ALLOWED;
ret = fd_msg_avp_setvalue(vplmn_dynamic_address_allowed, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(apn_configuration,
MSG_BRW_LAST_CHILD, vplmn_dynamic_address_allowed);
ogs_assert(ret == 0);
/* Set AMBR */
if (session->ambr.downlink || session->ambr.uplink) {
ret = fd_msg_avp_new(ogs_diam_s6a_ambr, 0, &avp_ambr);
@ -722,7 +749,7 @@ static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp,
avp_max_bandwidth_dl);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(apn_configuration,
ret = fd_msg_avp_add(apn_configuration,
MSG_BRW_LAST_CHILD, avp_ambr);
ogs_assert(ret == 0);
}
@ -766,7 +793,7 @@ out:
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = 1;
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
@ -810,7 +837,7 @@ int hss_s6a_init(void)
/* Specific handler for Location-Update-Request */
data.command = ogs_diam_s6a_cmd_ulr;
ret = fd_disp_register(hss_ogs_diam_s6a_ulr_cb, DISP_HOW_CC, &data, NULL,
ret = fd_disp_register(hss_ogs_diam_s6a_ulr_cb, DISP_HOW_CC, &data, NULL,
&hdl_s6a_ulr);
ogs_assert(ret == 0);

927
src/hss/hss-swx-path.c Normal file
View File

@ -0,0 +1,927 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ogs-crypt.h"
#include "hss-context.h"
#include "hss-fd-path.h"
/* handler for fallback cb */
static struct disp_hdl *hdl_swx_fb = NULL;
/* handler for Multimedia-Auth-Request cb */
static struct disp_hdl *hdl_swx_mar = NULL;
/* handler for Server-Assignment-Request cb */
static struct disp_hdl *hdl_swx_sar = NULL;
/* Default callback for the application. */
static int hss_ogs_diam_swx_fb_cb(struct msg **msg, struct avp *avp,
struct session *session, void *opaque, enum disp_action *act)
{
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
}
/* Callback for incoming Multimedia-Auth-Request messages */
static int hss_ogs_diam_swx_mar_cb( struct msg **msg, struct avp *avp,
struct session *session, void *opaque, enum disp_action *act)
{
int rv, ret;
uint32_t result_code = 0;
struct msg *ans, *qry;
struct avp *sip_auth_data_item_avp = NULL;
struct avp *authentication_scheme_avp = NULL;
struct avp *sip_authorization_avp = NULL;
struct avp *avpch = NULL;
struct avp_hdr *hdr;
union avp_value val;
char *user_name = NULL;
char *authentication_scheme = NULL;
char imsi_bcd[OGS_MAX_IMSI_BCD_LEN+1];
ogs_dbi_auth_info_t auth_info;
uint8_t zero[OGS_RAND_LEN];
uint8_t authenticate[OGS_KEY_LEN*2];
uint8_t opc[OGS_KEY_LEN];
uint8_t sqn[OGS_SQN_LEN];
uint8_t autn[OGS_AUTN_LEN];
uint8_t ik[OGS_KEY_LEN];
uint8_t ck[OGS_KEY_LEN];
uint8_t ak[OGS_AK_LEN];
uint8_t xres[OGS_MAX_RES_LEN];
size_t xres_len = 8;
uint8_t mac_s[OGS_MAC_S_LEN];
ogs_assert(msg);
ogs_debug("Multimedia-Auth-Request");
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
/* Get User-Name AVP (Mandatory) */
ret = fd_msg_search_avp(qry, ogs_diam_user_name, &avp);
ogs_assert(ret == 0);
ret = fd_msg_avp_hdr(avp, &hdr);
ogs_assert(ret == 0);
user_name = ogs_strndup(
(char*)hdr->avp_value->os.data, hdr->avp_value->os.len);
ogs_assert(user_name);
ogs_extract_digit_from_string(imsi_bcd, user_name);
/* Get the SIP-Auth-Data-Item AVP (Mandatory) */
ret = fd_msg_search_avp(
qry, ogs_diam_cx_sip_auth_data_item, &sip_auth_data_item_avp);
ogs_assert(ret == 0);
ret = fd_msg_avp_hdr(sip_auth_data_item_avp, &hdr);
ogs_assert(ret == 0);
/* Get the Authentication-Scheme AVP */
ret = fd_msg_search_avp(sip_auth_data_item_avp,
ogs_diam_cx_sip_authentication_scheme, &authentication_scheme_avp);
ogs_assert(ret == 0);
if (authentication_scheme_avp) {
ret = fd_msg_avp_hdr(authentication_scheme_avp, &hdr);
ogs_assert(ret == 0);
authentication_scheme = ogs_strndup(
(char*)hdr->avp_value->os.data, hdr->avp_value->os.len);
ogs_assert(authentication_scheme);
}
/* EAP-AKA is only supported */
if (authentication_scheme &&
ogs_strcasecmp(authentication_scheme,
OGS_DIAM_SWX_AUTH_SCHEME_EAP_AKA) != 0) {
ogs_error("Authentication-Scheme[%s] is not supported",
authentication_scheme);
result_code = OGS_DIAM_CX_ERROR_AUTH_SCHEME_NOT_SUPPORTED;
goto out;
}
/* DB : HSS Auth-Info */
rv = hss_db_auth_info(imsi_bcd, &auth_info);
if (rv != OGS_OK) {
ogs_error("Cannot get IMS-Data for IMSI:'%s'", imsi_bcd);
result_code = OGS_DIAM_CX_ERROR_USER_UNKNOWN;
goto out;
}
memset(zero, 0, sizeof(zero));
if (memcmp(auth_info.rand, zero, OGS_RAND_LEN) == 0) {
ogs_random(auth_info.rand, OGS_RAND_LEN);
}
if (auth_info.use_opc)
memcpy(opc, auth_info.opc, sizeof(opc));
else
milenage_opc(auth_info.k, auth_info.op, opc);
/* Get the SIP-Authorization AVP */
ret = fd_msg_search_avp(sip_auth_data_item_avp,
ogs_diam_cx_sip_authorization, &sip_authorization_avp);
ogs_assert(ret == 0);
if (sip_authorization_avp) {
ret = fd_msg_avp_hdr(sip_authorization_avp, &hdr);
ogs_assert(ret == 0);
ogs_auc_sqn(opc, auth_info.k,
hdr->avp_value->os.data,
hdr->avp_value->os.data + OGS_RAND_LEN,
sqn, mac_s);
if (memcmp(mac_s, hdr->avp_value->os.data +
OGS_RAND_LEN + OGS_SQN_LEN, OGS_MAC_S_LEN) == 0) {
ogs_random(auth_info.rand, OGS_RAND_LEN);
auth_info.sqn = ogs_buffer_to_uint64(sqn, OGS_SQN_LEN);
/* 33.102 C.3.4 Guide : IND + 1 */
auth_info.sqn = (auth_info.sqn + 32 + 1) & OGS_MAX_SQN;
} else {
ogs_error("Re-synch MAC failed for IMSI:`%s`", imsi_bcd);
ogs_log_print(OGS_LOG_ERROR, "MAC_S: ");
ogs_log_hexdump(OGS_LOG_ERROR, mac_s, OGS_MAC_S_LEN);
ogs_log_hexdump(OGS_LOG_ERROR,
(void*)(hdr->avp_value->os.data +
OGS_RAND_LEN + OGS_SQN_LEN),
OGS_MAC_S_LEN);
ogs_log_print(OGS_LOG_ERROR, "SQN: ");
ogs_log_hexdump(OGS_LOG_ERROR, sqn, OGS_SQN_LEN);
result_code = OGS_DIAM_CX_ERROR_AUTH_SCHEME_NOT_SUPPORTED;
goto out;
}
}
rv = hss_db_update_sqn(imsi_bcd, auth_info.rand, auth_info.sqn);
if (rv != OGS_OK) {
ogs_error("Cannot update rand and sqn for IMSI:'%s'", imsi_bcd);
result_code = OGS_DIAM_CX_ERROR_IN_ASSIGNMENT_TYPE;
goto out;
}
rv = hss_db_increment_sqn(imsi_bcd);
if (rv != OGS_OK) {
ogs_error("Cannot increment sqn for IMSI:'%s'", imsi_bcd);
result_code = OGS_DIAM_CX_ERROR_IN_ASSIGNMENT_TYPE;
goto out;
}
milenage_generate(opc, auth_info.amf, auth_info.k,
ogs_uint64_to_buffer(auth_info.sqn, OGS_SQN_LEN, sqn), auth_info.rand,
autn, ik, ck, ak, xres, &xres_len);
memcpy(authenticate, auth_info.rand, OGS_RAND_LEN);
memcpy(authenticate + OGS_RAND_LEN, autn, OGS_AUTN_LEN);
ogs_log_print(OGS_LOG_DEBUG, "K - ");
ogs_log_hexdump(OGS_LOG_DEBUG, auth_info.k, OGS_KEY_LEN);
ogs_log_print(OGS_LOG_DEBUG, "AMF - ");
ogs_log_hexdump(OGS_LOG_DEBUG, auth_info.amf, OGS_AMF_LEN);
ogs_log_print(OGS_LOG_DEBUG, "OPc - ");
ogs_log_hexdump(OGS_LOG_DEBUG, opc, OGS_KEY_LEN);
ogs_log_print(OGS_LOG_DEBUG, "RAND - ");
ogs_log_hexdump(OGS_LOG_DEBUG, auth_info.rand, OGS_RAND_LEN);
ogs_log_print(OGS_LOG_DEBUG, "SQN - ");
ogs_log_hexdump(OGS_LOG_DEBUG, sqn, OGS_SQN_LEN);
ogs_log_print(OGS_LOG_DEBUG, "AUTN - ");
ogs_log_hexdump(OGS_LOG_DEBUG, autn, OGS_KEY_LEN);
ogs_log_print(OGS_LOG_DEBUG, "ck - ");
ogs_log_hexdump(OGS_LOG_DEBUG, ck, OGS_KEY_LEN);
ogs_log_print(OGS_LOG_DEBUG, "ik - ");
ogs_log_hexdump(OGS_LOG_DEBUG, ik, OGS_KEY_LEN);
ogs_log_print(OGS_LOG_DEBUG, "ak - ");
ogs_log_hexdump(OGS_LOG_DEBUG, ak, OGS_KEY_LEN);
ogs_log_print(OGS_LOG_DEBUG, "xles - ");
ogs_log_hexdump(OGS_LOG_DEBUG, xres, xres_len);
/* Set Vendor-Specific-Application-Id AVP */
ret = ogs_diam_message_vendor_specific_appid_set(
ans, OGS_DIAM_CX_APPLICATION_ID);
ogs_assert(ret == 0);
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Set the Origin-Host, Origin-Realm, and Result-Code AVPs */
ret = fd_msg_rescode_set(ans, (char*)"DIAMETER_SUCCESS", NULL, NULL, 1);
ogs_assert(ret == 0);
/* Set the User-Name AVP */
ret = fd_msg_avp_new(ogs_diam_user_name, 0, &avp);
ogs_assert(ret == 0);
val.os.data = (uint8_t *)user_name;
val.os.len = strlen(user_name);
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Set the SIP-Number-Auth-Items AVP */
ret = fd_msg_avp_new(ogs_diam_cx_sip_number_auth_items, 0, &avp);
ogs_assert(ret == 0);
val.u32 = 1;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Set the SIP-Auth-Data-Item AVP */
ret = fd_msg_avp_new(ogs_diam_cx_sip_auth_data_item, 0, &avp);
ogs_assert(ret == 0);
/* Set the SIP-Item-Number AVP */
ret = fd_msg_avp_new(ogs_diam_cx_sip_item_number, 0, &avpch);
ogs_assert(ret == 0);
val.u32 = 1;
ret = fd_msg_avp_setvalue(avpch, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(avp, MSG_BRW_LAST_CHILD, avpch);
ogs_assert(ret == 0);
/* Set the SIP-Authentication-Scheme AVP */
ret = fd_msg_avp_new(ogs_diam_cx_sip_authentication_scheme, 0, &avpch);
ogs_assert(ret == 0);
val.os.data = (uint8_t *)OGS_DIAM_SWX_AUTH_SCHEME_EAP_AKA;
val.os.len = strlen(OGS_DIAM_SWX_AUTH_SCHEME_EAP_AKA);
ret = fd_msg_avp_setvalue(avpch, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(avp, MSG_BRW_LAST_CHILD, avpch);
ogs_assert(ret == 0);
/* Set the SIP-Authenticatie AVP */
ret = fd_msg_avp_new(ogs_diam_cx_sip_authenticate, 0, &avpch);
ogs_assert(ret == 0);
val.os.data = authenticate;
val.os.len = OGS_KEY_LEN * 2;
ret = fd_msg_avp_setvalue(avpch, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(avp, MSG_BRW_LAST_CHILD, avpch);
ogs_assert(ret == 0);
/* Set the SIP-Authorization AVP */
ret = fd_msg_avp_new(ogs_diam_cx_sip_authorization, 0, &avpch);
ogs_assert(ret == 0);
val.os.data = xres;
val.os.len = xres_len;
ret = fd_msg_avp_setvalue(avpch, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(avp, MSG_BRW_LAST_CHILD, avpch);
ogs_assert(ret == 0);
/* Set the Confidentiality-Key AVP */
ret = fd_msg_avp_new(ogs_diam_cx_confidentiality_key, 0, &avpch);
ogs_assert(ret == 0);
val.os.data = ck;
val.os.len = OGS_KEY_LEN;
ret = fd_msg_avp_setvalue(avpch, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(avp, MSG_BRW_LAST_CHILD, avpch);
ogs_assert(ret == 0);
/* Set the Integirty-Key AVP */
ret = fd_msg_avp_new(ogs_diam_cx_integrity_key, 0, &avpch);
ogs_assert(ret == 0);
val.os.data = ik;
val.os.len = OGS_KEY_LEN;
ret = fd_msg_avp_setvalue(avpch, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(avp, MSG_BRW_LAST_CHILD, avpch);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_debug("Multimedia-Auth-Answer");
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
if (authentication_scheme)
ogs_free(authentication_scheme);
ogs_free(user_name);
return 0;
out:
/* Set Vendor-Specific-Application-Id AVP */
ret = ogs_diam_message_vendor_specific_appid_set(
ans, OGS_DIAM_CX_APPLICATION_ID);
ogs_assert(ret == 0);
/* Set the Experimental-Result, Origin-Host and Origin-Realm AVPs */
ret = ogs_diam_message_experimental_rescode_set(ans, result_code);
ogs_assert(ret == 0);
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
if (authentication_scheme)
ogs_free(authentication_scheme);
ogs_free(user_name);
return 0;
}
/* Callback for incoming Server-Assignment-Request messages */
static int hss_ogs_diam_swx_sar_cb( struct msg **msg, struct avp *avp,
struct session *session, void *opaque, enum disp_action *act)
{
int rv, ret;
uint32_t result_code = 0;
struct msg *ans, *qry;
struct avp_hdr *hdr;
union avp_value val;
char *user_name = NULL;
ogs_s_nssai_t s_nssai;
char imsi_bcd[OGS_MAX_IMSI_BCD_LEN+1];
ogs_subscription_data_t subscription_data;
ogs_slice_data_t *slice_data = NULL;
struct sockaddr_in sin;
struct sockaddr_in6 sin6;
ogs_assert(msg);
ogs_debug("Server-Assignment-Request");
memset(&subscription_data, 0, sizeof(ogs_subscription_data_t));
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
/* Get User-Name AVP (Mandatory) */
ret = fd_msg_search_avp(qry, ogs_diam_user_name, &avp);
ogs_assert(ret == 0);
ret = fd_msg_avp_hdr(avp, &hdr);
ogs_assert(ret == 0);
user_name = ogs_strndup(
(char*)hdr->avp_value->os.data, hdr->avp_value->os.len);
ogs_assert(user_name);
ogs_extract_digit_from_string(imsi_bcd, user_name);
/* DB : HSS Subscription Data */
rv = hss_db_subscription_data(imsi_bcd, &subscription_data);
if (rv != OGS_OK) {
ogs_error("Cannot get Subscription-Data for IMSI:'%s'", imsi_bcd);
result_code = OGS_DIAM_S6A_ERROR_USER_UNKNOWN;
goto out;
}
/* Set Vendor-Specific-Application-Id AVP */
ret = ogs_diam_message_vendor_specific_appid_set(
ans, OGS_DIAM_CX_APPLICATION_ID);
ogs_assert(ret == 0);
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Set the Origin-Host, Origin-Realm, and Result-Code AVPs */
ret = fd_msg_rescode_set(ans, (char*)"DIAMETER_SUCCESS", NULL, NULL, 1);
ogs_assert(ret == 0);
/* Set the User-Name AVP */
ret = fd_msg_avp_new(ogs_diam_user_name, 0, &avp);
ogs_assert(ret == 0);
val.os.data = (uint8_t *)user_name;
val.os.len = strlen(user_name);
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Get Server-Assignment-Type AVP (Mandatory) */
ret = fd_msg_search_avp(qry,
ogs_diam_cx_server_assignment_type, &avp);
ogs_assert(ret == 0);
ret = fd_msg_avp_hdr(avp, &hdr);
ogs_assert(ret == 0);
if (hdr->avp_value->i32 == OGS_DIAM_CX_SERVER_ASSIGNMENT_REGISTRATION ||
hdr->avp_value->i32 ==
OGS_DIAM_CX_SERVER_ASSIGNMENT_AAA_USER_DATA_REQUEST) {
struct avp *avp_subscription_id;
struct avp *avp_subscription_id_type, *avp_subscription_id_data;
struct avp *avp_non_3gpp_ip_access, *avp_non_3gpp_ip_access_apn;
struct avp *avp_ambr, *avp_max_bandwidth_ul, *avp_max_bandwidth_dl;
/* Set the APN Configuration Profile */
struct avp *context_identifier;
int i;
/* Set the Non-3GPP-User-Data */
ret = fd_msg_avp_new(ogs_diam_swx_non_3gpp_user_data, 0, &avp);
ogs_assert(ret == 0);
/* Set Subscription-Id */
if (subscription_data.num_of_msisdn >= 1) {
ret = fd_msg_avp_new(ogs_diam_subscription_id, 0,
&avp_subscription_id);
ogs_assert(ret == 0);
ret = fd_msg_avp_new(ogs_diam_subscription_id_type, 0,
&avp_subscription_id_type);
ogs_assert(ret == 0);
val.i32 = OGS_DIAM_SUBSCRIPTION_ID_TYPE_END_USER_E164;
ret = fd_msg_avp_setvalue (avp_subscription_id_type, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(avp_subscription_id, MSG_BRW_LAST_CHILD,
avp_subscription_id_type);
ogs_assert(ret == 0);
ret = fd_msg_avp_new(ogs_diam_subscription_id_data, 0,
&avp_subscription_id_data);
ogs_assert(ret == 0);
val.os.data = (uint8_t *)subscription_data.msisdn[0].bcd;
val.os.len = strlen(subscription_data.msisdn[0].bcd);
ret = fd_msg_avp_setvalue (avp_subscription_id_data, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add (avp_subscription_id, MSG_BRW_LAST_CHILD,
avp_subscription_id_data);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(avp, MSG_BRW_LAST_CHILD, avp_subscription_id);
ogs_assert(ret == 0);
}
/* Set Non-3GPP-IP-Access */
ret = fd_msg_avp_new(ogs_diam_swx_non_3gpp_ip_access, 0,
&avp_non_3gpp_ip_access);
ogs_assert(ret == 0);
val.i32 = OGS_DIAM_SWX_NON_3GPP_SUBSCRIPTION_ALLOWED;
ret = fd_msg_avp_setvalue(avp_non_3gpp_ip_access, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(avp, MSG_BRW_LAST_CHILD, avp_non_3gpp_ip_access);
ogs_assert(ret == 0);
/* Set Non-3GPP-IP-Access-APN */
ret = fd_msg_avp_new(ogs_diam_swx_non_3gpp_ip_access_apn, 0,
&avp_non_3gpp_ip_access_apn);
ogs_assert(ret == 0);
val.i32 = OGS_DIAM_SWX_NON_3GPP_APNS_ENABLE;
ret = fd_msg_avp_setvalue(avp_non_3gpp_ip_access_apn, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(avp, MSG_BRW_LAST_CHILD,
avp_non_3gpp_ip_access_apn);
ogs_assert(ret == 0);
/* Set the AMBR */
ret = fd_msg_avp_new(ogs_diam_s6a_ambr, 0, &avp_ambr);
ogs_assert(ret == 0);
ret = fd_msg_avp_new(
ogs_diam_s6a_max_bandwidth_ul, 0, &avp_max_bandwidth_ul);
ogs_assert(ret == 0);
val.u32 = ogs_uint64_to_uint32(subscription_data.ambr.uplink);
ret = fd_msg_avp_setvalue(avp_max_bandwidth_ul, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(
avp_ambr, MSG_BRW_LAST_CHILD, avp_max_bandwidth_ul);
ogs_assert(ret == 0);
ret = fd_msg_avp_new(
ogs_diam_s6a_max_bandwidth_dl, 0, &avp_max_bandwidth_dl);
ogs_assert(ret == 0);
val.u32 = ogs_uint64_to_uint32(subscription_data.ambr.downlink);
ret = fd_msg_avp_setvalue(avp_max_bandwidth_dl, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(
avp_ambr, MSG_BRW_LAST_CHILD, avp_max_bandwidth_dl);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(avp, MSG_BRW_LAST_CHILD, avp_ambr);
ogs_assert(ret == 0);
/* For EPC, we'll use SST:1 */
s_nssai.sst = 1;
s_nssai.sd.v = OGS_S_NSSAI_NO_SD_VALUE;
slice_data = ogs_slice_find_by_s_nssai(
subscription_data.slice, subscription_data.num_of_slice,
&s_nssai);
if (!slice_data) {
ogs_error("[%s] Cannot find S-NSSAI", imsi_bcd);
result_code = OGS_DIAM_S6A_ERROR_UNKNOWN_EPS_SUBSCRIPTION;
goto out;
}
if (!slice_data->num_of_session) {
ogs_error("[%s] No PDN", imsi_bcd);
result_code = OGS_DIAM_S6A_ERROR_UNKNOWN_EPS_SUBSCRIPTION;
goto out;
}
ret = fd_msg_avp_new(ogs_diam_s6a_context_identifier, 0,
&context_identifier);
ogs_assert(ret == 0);
val.i32 = 1; /* Context Identifier : 1 */
ret = fd_msg_avp_setvalue(context_identifier, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(avp, MSG_BRW_LAST_CHILD, context_identifier);
ogs_assert(ret == 0);
for (i = 0; i < slice_data->num_of_session; i++) {
/* Set the APN Configuration */
struct avp *apn_configuration, *context_identifier, *pdn_type;
struct avp *served_party_ip_address, *service_selection;
struct avp *eps_subscribed_qos_profile, *qos_class_identifier;
struct avp *allocation_retention_priority, *priority_level;
struct avp *pre_emption_capability, *pre_emption_vulnerability;
struct avp *mip6_agent_info, *mip_home_agent_address;
struct avp *pdn_gw_allocation_type;
struct avp *vplmn_dynamic_address_allowed;
ogs_session_t *session = &slice_data->session[i];
ogs_assert(session);
session->context_identifier = i+1;
ret = fd_msg_avp_new(ogs_diam_s6a_apn_configuration, 0,
&apn_configuration);
ogs_assert(ret == 0);
/* Set Context-Identifier */
ret = fd_msg_avp_new(ogs_diam_s6a_context_identifier, 0,
&context_identifier);
ogs_assert(ret == 0);
val.i32 = session->context_identifier;
ret = fd_msg_avp_setvalue(context_identifier, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(apn_configuration,
MSG_BRW_LAST_CHILD, context_identifier);
ogs_assert(ret == 0);
/* Set PDN-Type */
ret = fd_msg_avp_new(ogs_diam_s6a_pdn_type, 0, &pdn_type);
ogs_assert(ret == 0);
val.i32 = OGS_PDU_SESSION_TYPE_TO_DIAMETER(session->session_type);
ret = fd_msg_avp_setvalue(pdn_type, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(apn_configuration,
MSG_BRW_LAST_CHILD, pdn_type);
ogs_assert(ret == 0);
/* Set Served-Party-IP-Address */
if ((session->session_type == OGS_PDU_SESSION_TYPE_IPV4 ||
session->session_type == OGS_PDU_SESSION_TYPE_IPV4V6) &&
session->ue_ip.ipv4) {
ret = fd_msg_avp_new(ogs_diam_s6a_served_party_ip_address,
0, &served_party_ip_address);
ogs_assert(ret == 0);
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = session->ue_ip.addr;
ret = fd_msg_avp_value_encode(&sin, served_party_ip_address);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(apn_configuration, MSG_BRW_LAST_CHILD,
served_party_ip_address);
ogs_assert(ret == 0);
}
if ((session->session_type == OGS_PDU_SESSION_TYPE_IPV6 ||
session->session_type == OGS_PDU_SESSION_TYPE_IPV4V6) &&
session->ue_ip.ipv6) {
ret = fd_msg_avp_new(ogs_diam_s6a_served_party_ip_address,
0, &served_party_ip_address);
ogs_assert(ret == 0);
sin6.sin6_family = AF_INET6;
memcpy(sin6.sin6_addr.s6_addr,
session->ue_ip.addr6, OGS_IPV6_LEN);
ret = fd_msg_avp_value_encode(&sin6, served_party_ip_address);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(apn_configuration, MSG_BRW_LAST_CHILD,
served_party_ip_address);
ogs_assert(ret == 0);
}
/* Set Service-Selection */
ret = fd_msg_avp_new(ogs_diam_service_selection, 0,
&service_selection);
ogs_assert(ret == 0);
ogs_assert(session->name);
val.os.data = (uint8_t *)session->name;
val.os.len = strlen(session->name);
ret = fd_msg_avp_setvalue(service_selection, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(apn_configuration,
MSG_BRW_LAST_CHILD, service_selection);
ogs_assert(ret == 0);
/* Set the EPS Subscribed QoS Profile */
ret = fd_msg_avp_new(ogs_diam_s6a_eps_subscribed_qos_profile, 0,
&eps_subscribed_qos_profile);
ogs_assert(ret == 0);
ret = fd_msg_avp_new(ogs_diam_s6a_qos_class_identifier, 0,
&qos_class_identifier);
ogs_assert(ret == 0);
val.i32 = session->qos.index;
ret = fd_msg_avp_setvalue(qos_class_identifier, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(eps_subscribed_qos_profile,
MSG_BRW_LAST_CHILD, qos_class_identifier);
ogs_assert(ret == 0);
/* Set Allocation retention priority */
ret = fd_msg_avp_new(ogs_diam_s6a_allocation_retention_priority, 0,
&allocation_retention_priority);
ogs_assert(ret == 0);
ret = fd_msg_avp_new(
ogs_diam_s6a_priority_level, 0, &priority_level);
ogs_assert(ret == 0);
val.u32 = session->qos.arp.priority_level;
ret = fd_msg_avp_setvalue(priority_level, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(allocation_retention_priority,
MSG_BRW_LAST_CHILD, priority_level);
ogs_assert(ret == 0);
ret = fd_msg_avp_new(ogs_diam_s6a_pre_emption_capability, 0,
&pre_emption_capability);
ogs_assert(ret == 0);
val.u32 = OGS_EPC_PRE_EMPTION_DISABLED;
if (session->qos.arp.pre_emption_capability ==
OGS_5GC_PRE_EMPTION_ENABLED)
val.u32 = OGS_EPC_PRE_EMPTION_ENABLED;
ret = fd_msg_avp_setvalue(pre_emption_capability, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(allocation_retention_priority,
MSG_BRW_LAST_CHILD, pre_emption_capability);
ogs_assert(ret == 0);
ret = fd_msg_avp_new(ogs_diam_s6a_pre_emption_vulnerability, 0,
&pre_emption_vulnerability);
ogs_assert(ret == 0);
val.u32 = OGS_EPC_PRE_EMPTION_DISABLED;
if (session->qos.arp.pre_emption_vulnerability ==
OGS_5GC_PRE_EMPTION_ENABLED)
val.u32 = OGS_EPC_PRE_EMPTION_ENABLED;
ret = fd_msg_avp_setvalue(pre_emption_vulnerability, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(allocation_retention_priority,
MSG_BRW_LAST_CHILD, pre_emption_vulnerability);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(eps_subscribed_qos_profile,
MSG_BRW_LAST_CHILD, allocation_retention_priority);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(apn_configuration,
MSG_BRW_LAST_CHILD, eps_subscribed_qos_profile);
ogs_assert(ret == 0);
/* Set MIP6-Agent-Info */
if (session->smf_ip.ipv4 || session->smf_ip.ipv6) {
ret = fd_msg_avp_new(ogs_diam_mip6_agent_info, 0,
&mip6_agent_info);
ogs_assert(ret == 0);
if (session->smf_ip.ipv4) {
ret = fd_msg_avp_new(ogs_diam_mip_home_agent_address, 0,
&mip_home_agent_address);
ogs_assert(ret == 0);
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = session->smf_ip.addr;
ret = fd_msg_avp_value_encode (
&sin, mip_home_agent_address );
ogs_assert(ret == 0);
ret = fd_msg_avp_add(mip6_agent_info,
MSG_BRW_LAST_CHILD, mip_home_agent_address);
ogs_assert(ret == 0);
}
if (session->smf_ip.ipv6) {
ret = fd_msg_avp_new(ogs_diam_mip_home_agent_address, 0,
&mip_home_agent_address);
ogs_assert(ret == 0);
sin6.sin6_family = AF_INET6;
memcpy(sin6.sin6_addr.s6_addr, session->smf_ip.addr6,
sizeof session->smf_ip.addr6);
ret = fd_msg_avp_value_encode (
&sin6, mip_home_agent_address );
ogs_assert(ret == 0);
ret = fd_msg_avp_add(mip6_agent_info,
MSG_BRW_LAST_CHILD, mip_home_agent_address);
ogs_assert(ret == 0);
}
ret = fd_msg_avp_add(apn_configuration,
MSG_BRW_LAST_CHILD, mip6_agent_info);
ogs_assert(ret == 0);
ret = fd_msg_avp_new(ogs_diam_s6a_pdn_gw_allocation_type, 0,
&pdn_gw_allocation_type);
ogs_assert(ret == 0);
val.u32 = OGS_DIAM_S6A_PDN_GW_ALLOCATION_DYNAMIC;
ret = fd_msg_avp_setvalue(pdn_gw_allocation_type, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(apn_configuration,
MSG_BRW_LAST_CHILD, pdn_gw_allocation_type);
ogs_assert(ret == 0);
}
/* Set VPLMN-Dynamic-Address-Allowed */
ret = fd_msg_avp_new(ogs_diam_s6a_vplmn_dynamic_address_allowed, 0,
&vplmn_dynamic_address_allowed);
ogs_assert(ret == 0);
val.u32 = OGS_DIAM_S6A_VPLMN_DYNAMIC_ADDRESS_ALLOWED;
ret = fd_msg_avp_setvalue(vplmn_dynamic_address_allowed, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(apn_configuration,
MSG_BRW_LAST_CHILD, vplmn_dynamic_address_allowed);
ogs_assert(ret == 0);
/* Set AMBR */
if (session->ambr.downlink || session->ambr.uplink) {
ret = fd_msg_avp_new(ogs_diam_s6a_ambr, 0, &avp_ambr);
ogs_assert(ret == 0);
ret = fd_msg_avp_new(ogs_diam_s6a_max_bandwidth_ul, 0,
&avp_max_bandwidth_ul);
ogs_assert(ret == 0);
val.u32 = ogs_uint64_to_uint32(session->ambr.uplink);
ret = fd_msg_avp_setvalue(avp_max_bandwidth_ul, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(avp_ambr, MSG_BRW_LAST_CHILD,
avp_max_bandwidth_ul);
ogs_assert(ret == 0);
ret = fd_msg_avp_new(ogs_diam_s6a_max_bandwidth_dl, 0,
&avp_max_bandwidth_dl);
ogs_assert(ret == 0);
val.u32 = ogs_uint64_to_uint32(session->ambr.downlink);
ret = fd_msg_avp_setvalue(avp_max_bandwidth_dl, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(avp_ambr, MSG_BRW_LAST_CHILD,
avp_max_bandwidth_dl);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(apn_configuration,
MSG_BRW_LAST_CHILD, avp_ambr);
ogs_assert(ret == 0);
}
ret = fd_msg_avp_add(avp,
MSG_BRW_LAST_CHILD, apn_configuration);
ogs_assert(ret == 0);
}
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
}
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_debug("Server-Assignment-Answer");
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_subscription_data_free(&subscription_data);
ogs_free(user_name);
return 0;
out:
/* Set Vendor-Specific-Application-Id AVP */
ret = ogs_diam_message_vendor_specific_appid_set(
ans, OGS_DIAM_CX_APPLICATION_ID);
ogs_assert(ret == 0);
/* Set the Experimental-Result, Origin-Host and Origin-Realm AVPs */
ret = ogs_diam_message_experimental_rescode_set(ans, result_code);
ogs_assert(ret == 0);
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_subscription_data_free(&subscription_data);
ogs_free(user_name);
return 0;
}
int hss_swx_init(void)
{
int ret;
struct disp_when data;
/* Install objects definitions for this application */
ret = ogs_diam_swx_init();
ogs_assert(ret == 0);
memset(&data, 0, sizeof(data));
data.app = ogs_diam_swx_application;
/* Fallback CB if command != unexpected message received */
ret = fd_disp_register(hss_ogs_diam_swx_fb_cb, DISP_HOW_APPID,
&data, NULL, &hdl_swx_fb);
ogs_assert(ret == 0);
/* Specific handler for Multimedia-Auth-Request */
data.command = ogs_diam_cx_cmd_mar;
ret = fd_disp_register(hss_ogs_diam_swx_mar_cb, DISP_HOW_CC, &data, NULL,
&hdl_swx_mar);
ogs_assert(ret == 0);
/* Specific handler for Server-Assignment-Request */
data.command = ogs_diam_cx_cmd_sar;
ret = fd_disp_register(hss_ogs_diam_swx_sar_cb, DISP_HOW_CC, &data, NULL,
&hdl_swx_sar);
ogs_assert(ret == 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_swx_application, ogs_diam_vendor, 1, 0);
ogs_assert(ret == 0);
return OGS_OK;
}
void hss_swx_final(void)
{
if (hdl_swx_fb)
(void) fd_disp_unregister(&hdl_swx_fb, NULL);
if (hdl_swx_mar)
(void) fd_disp_unregister(&hdl_swx_mar, NULL);
if (hdl_swx_sar)
(void) fd_disp_unregister(&hdl_swx_sar, NULL);
}

View File

@ -21,21 +21,32 @@ libhss_sources = files('''
hss-init.c
hss-context.c
hss-s6a-path.c
hss-cx-path.c
hss-swx-path.c
hss-fd-path.c
'''.split())
libhss = static_library('hss',
sources : libhss_sources,
dependencies : [libapp_dep, libcrypt_dep, libdbi_dep,
libdiameter_s6a_dep, libdiameter_cx_dep],
dependencies : [libapp_dep,
libcrypt_dep,
libdbi_dep,
libdiameter_s6a_dep,
libdiameter_cx_dep,
libdiameter_swx_dep],
install : false)
libhss_dep = declare_dependency(
link_with : libhss,
dependencies : [libapp_dep, libcrypt_dep, libdbi_dep,
libdiameter_s6a_dep, libdiameter_cx_dep])
dependencies : [libapp_dep,
libcrypt_dep,
libdbi_dep,
libdiameter_s6a_dep,
libdiameter_cx_dep,
libdiameter_swx_dep])
hss_sources = files('''
app-init.c

View File

@ -295,6 +295,9 @@ int mme_context_parse_config()
} else if (!strcmp(fd_key, "listen_on")) {
self.diam_config->cnf_addr =
ogs_yaml_iter_value(&fd_iter);
} else if (!strcmp(fd_key, "no_fwd")) {
self.diam_config->cnf_flags.no_fwd =
ogs_yaml_iter_bool(&fd_iter);
} else if (!strcmp(fd_key, "load_extension")) {
ogs_yaml_iter_t ext_array, ext_iter;
ogs_yaml_iter_recurse(&fd_iter, &ext_array);

View File

@ -80,7 +80,7 @@ void mme_s6a_send_air(mme_ue_t *mme_ue,
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = 1;
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
@ -147,7 +147,7 @@ void mme_s6a_send_air(mme_ue_t *mme_ue,
ogs_assert(ret == 0);
/* Set the Visited-PLMN-Id AVP */
ret = fd_msg_avp_new(ogs_diam_s6a_visited_plmn_id, 0, &avp);
ret = fd_msg_avp_new(ogs_diam_visited_plmn_id, 0, &avp);
ogs_assert(ret == 0);
val.os.data = ogs_nas_from_plmn_id(&nas_plmn_id, &mme_ue->tai.plmn_id);
val.os.len = OGS_PLMN_ID_LEN;
@ -476,7 +476,7 @@ void mme_s6a_send_ulr(mme_ue_t *mme_ue)
/* Set the Auth-Session-State AVP */
ret = fd_msg_avp_new(ogs_diam_auth_session_state, 0, &avp);
ogs_assert(ret == 0);
val.i32 = 1;
val.i32 = OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
@ -534,9 +534,9 @@ void mme_s6a_send_ulr(mme_ue_t *mme_ue)
}
/* Set the RAT-Type */
ret = fd_msg_avp_new(ogs_diam_s6a_rat_type, 0, &avp);
ret = fd_msg_avp_new(ogs_diam_rat_type, 0, &avp);
ogs_assert(ret == 0);
val.u32 = OGS_DIAM_S6A_RAT_TYPE_EUTRAN;
val.u32 = OGS_DIAM_RAT_TYPE_EUTRAN;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
@ -552,7 +552,7 @@ void mme_s6a_send_ulr(mme_ue_t *mme_ue)
ogs_assert(ret == 0);
/* Set the Visited-PLMN-Id */
ret = fd_msg_avp_new(ogs_diam_s6a_visited_plmn_id, 0, &avp);
ret = fd_msg_avp_new(ogs_diam_visited_plmn_id, 0, &avp);
ogs_assert(ret == 0);
val.os.data = ogs_nas_from_plmn_id(&nas_plmn_id, &mme_ue->tai.plmn_id);
val.os.len = OGS_PLMN_ID_LEN;
@ -837,7 +837,7 @@ static void mme_s6a_ula_cb(void *data, struct msg **msg)
&slice_data->session[slice_data->num_of_session];
ogs_assert(session);
ret = fd_avp_search_avp(
avpch2, ogs_diam_s6a_service_selection, &avpch3);
avpch2, ogs_diam_service_selection, &avpch3);
ogs_assert(ret == 0);
if (avpch3) {
ret = fd_msg_avp_hdr(avpch3, &hdr);
@ -1177,6 +1177,9 @@ int mme_fd_init(void)
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_s6a_application, ogs_diam_vendor, 1, 0);
ogs_assert(ret == 0);
ret = ogs_diam_start();
ogs_assert(ret == 0);
return 0;
}

View File

@ -157,19 +157,16 @@ ogs_pkbuf_t *mme_s11_build_create_session_request(
req->selection_mode.presence = 1;
req->selection_mode.u8 =
OGS_GTP_SELECTION_MODE_MS_OR_NETWORK_PROVIDED_APN | 0xfc;
OGS_GTP_SELECTION_MODE_MS_OR_NETWORK_PROVIDED_APN;
ogs_assert(sess->request_type.type == OGS_NAS_EPS_PDN_TYPE_IPV4 ||
sess->request_type.type == OGS_NAS_EPS_PDN_TYPE_IPV6 ||
sess->request_type.type == OGS_NAS_EPS_PDN_TYPE_IPV4V6);
req->pdn_type.u8 = ((session->session_type + 1) &
sess->request_type.type);
if (session->session_type == OGS_PDU_SESSION_TYPE_IPV4 ||
session->session_type == OGS_PDU_SESSION_TYPE_IPV6 ||
session->session_type == OGS_PDU_SESSION_TYPE_IPV4V6) {
req->pdn_type.u8 =
(session->session_type & sess->request_type.type);
req->pdn_type.u8 = (session->session_type & sess->request_type.type);
if (req->pdn_type.u8 == 0) {
ogs_fatal("Cannot derive PDN Type [UE:%d,HSS:%d]",
sess->request_type.type, session->session_type);
@ -196,9 +193,16 @@ ogs_pkbuf_t *mme_s11_build_create_session_request(
memcpy(session->paa.addr6, &addr, OGS_IPV6_LEN);
}
memset(&indication, 0, sizeof(ogs_gtp_indication_t));
if (req->pdn_type.u8 == OGS_PDU_SESSION_TYPE_IPV4V6) {
memset(&indication, 0, sizeof(ogs_gtp_indication_t));
indication.daf = 1;
}
if (sess->request_type.value == OGS_NAS_EPS_REQUEST_TYPE_HANDOVER) {
indication.hi = 1;
}
if (indication.daf || indication.hi) {
req->indication_flags.presence = 1;
req->indication_flags.data = &indication;
req->indication_flags.len = sizeof(ogs_gtp_indication_t);
@ -293,10 +297,15 @@ ogs_pkbuf_t *mme_s11_build_modify_bearer_request(
ogs_gtp_uli_t uli;
char uli_buf[OGS_GTP_MAX_ULI_LEN];
ogs_gtp_indication_t indication;
mme_ue_t *mme_ue = NULL;
mme_sess_t *sess = NULL;
ogs_assert(bearer);
mme_ue = bearer->mme_ue;
sess = bearer->sess;
ogs_assert(sess);
mme_ue = sess->mme_ue;
ogs_assert(mme_ue);
ogs_debug("Modifty Bearer Request");
@ -307,6 +316,14 @@ ogs_pkbuf_t *mme_s11_build_modify_bearer_request(
memset(&gtp_message, 0, sizeof(ogs_gtp_message_t));
if (sess->request_type.value == OGS_NAS_EPS_REQUEST_TYPE_HANDOVER) {
memset(&indication, 0, sizeof(ogs_gtp_indication_t));
indication.hi = 1;
req->indication_flags.presence = 1;
req->indication_flags.data = &indication;
req->indication_flags.len = sizeof(ogs_gtp_indication_t);
}
/* Bearer Context : EBI */
req->bearer_contexts_to_be_modified.presence = 1;
req->bearer_contexts_to_be_modified.eps_bearer_id.presence = 1;
@ -598,15 +615,47 @@ ogs_pkbuf_t *mme_s11_build_delete_bearer_response(
rsp->cause.data = &cause;
if (cause_value == OGS_GTP_CAUSE_REQUEST_ACCEPTED) {
/* Bearer Context : EBI */
rsp->bearer_contexts.presence = 1;
rsp->bearer_contexts.eps_bearer_id.presence = 1;
rsp->bearer_contexts.eps_bearer_id.u8 = bearer->ebi;
mme_bearer_t *linked_bearer = mme_linked_bearer(bearer);
ogs_assert(linked_bearer);
/* Bearer Context : Cause */
rsp->bearer_contexts.cause.presence = 1;
rsp->bearer_contexts.cause.len = sizeof(cause);
rsp->bearer_contexts.cause.data = &cause;
if (bearer->ebi == linked_bearer->ebi) {
/*
* << Linked EPS Bearer ID >>
*
* 1. SMF sends Delete Bearer Request(DEFAULT BEARER) to SGW/MME.
* 2. MME sends Delete Bearer Response to SGW/SMF.
*
* OR
*
* 1. SMF sends Delete Bearer Request(DEFAULT BEARER) to ePDG.
* 2. ePDG sends Delete Bearer Response(DEFAULT BEARER) to SMF.
*/
rsp->linked_eps_bearer_id.presence = 1;
rsp->linked_eps_bearer_id.u8 = bearer->ebi;
} else {
/*
* << EPS Bearer IDs >>
*
* 1. MME sends Bearer Resource Command to SGW/SMF.
* 2. SMF sends Delete Bearer Request(DEDICATED BEARER) to SGW/MME.
* 3. MME sends Delete Bearer Response(DEDICATED BEARER) to SGW/SMF.
*
* OR
*
* 1. SMF sends Delete Bearer Request(DEDICATED BEARER) to SGW/MME.
* 2. MME sends Delete Bearer Response(DEDICATED BEARER) to SGW/SMF.
*/
/* Bearer Context : EBI */
rsp->bearer_contexts.presence = 1;
rsp->bearer_contexts.eps_bearer_id.presence = 1;
rsp->bearer_contexts.eps_bearer_id.u8 = bearer->ebi;
/* Bearer Context : Cause */
rsp->bearer_contexts.cause.presence = 1;
rsp->bearer_contexts.cause.len = sizeof(cause);
rsp->bearer_contexts.cause.data = &cause;
}
}
/* User Location Information(ULI) */

View File

@ -675,11 +675,34 @@ void mme_s11_handle_delete_bearer_request(
ogs_debug("Delete Bearer Request");
if (mme_ue && req->linked_eps_bearer_id.presence == 1) {
/*
* << Linked EPS Bearer ID >>
*
* 1. SMF sends Delete Bearer Request(DEFAULT BEARER) to SGW/MME.
* 2. MME sends Delete Bearer Response to SGW/SMF.
*
* OR
*
* 1. SMF sends Delete Bearer Request(DEFAULT BEARER) to ePDG.
* 2. ePDG sends Delete Bearer Response(DEFAULT BEARER) to SMF.
*/
bearer = mme_bearer_find_by_ue_ebi(
mme_ue, req->linked_eps_bearer_id.u8);
if (!bearer)
ogs_error("Cannot find Bearer [%d]", req->linked_eps_bearer_id.u8);
} else if (mme_ue && req->eps_bearer_ids.presence == 1) {
/*
* << EPS Bearer IDs >>
*
* 1. MME sends Bearer Resource Command to SGW/SMF.
* 2. SMF sends Delete Bearer Request(DEDICATED BEARER) to SGW/MME.
* 3. MME sends Delete Bearer Response(DEDICATED BEARER) to SGW/SMF.
*
* OR
*
* 1. SMF sends Delete Bearer Request(DEDICATED BEARER) to SGW/MME.
* 2. MME sends Delete Bearer Response(DEDICATED BEARER) to SGW/SMF.
*/
bearer = mme_bearer_find_by_ue_ebi(
mme_ue, req->eps_bearer_ids.u8);
if (!bearer)

View File

@ -140,6 +140,9 @@ int pcrf_context_parse_config(void)
} else if (!strcmp(fd_key, "listen_on")) {
self.diam_config->cnf_addr =
ogs_yaml_iter_value(&fd_iter);
} else if (!strcmp(fd_key, "no_fwd")) {
self.diam_config->cnf_flags.no_fwd =
ogs_yaml_iter_bool(&fd_iter);
} else if (!strcmp(fd_key, "load_extension")) {
ogs_yaml_iter_t ext_array, ext_iter;
ogs_yaml_iter_recurse(&fd_iter, &ext_array);

View File

@ -33,6 +33,9 @@ int pcrf_fd_init(void)
rv = pcrf_rx_init();
ogs_assert(rv == OGS_OK);
rv = ogs_diam_start();
ogs_assert(rv == 0);
return OGS_OK;
}

View File

@ -358,18 +358,18 @@ static int pcrf_gx_ccr_cb( struct msg **msg, struct avp *avp,
}
/* Get IMSI + APN */
ret = fd_msg_search_avp(qry, ogs_diam_gx_subscription_id, &avp);
ret = fd_msg_search_avp(qry, ogs_diam_subscription_id, &avp);
ogs_assert(ret == 0);
if (avp) {
ret = fd_msg_avp_hdr(avp, &hdr);
ogs_assert(ret == 0);
ret = fd_avp_search_avp(avp, ogs_diam_gx_subscription_id_type, &avpch1);
ret = fd_avp_search_avp(avp, ogs_diam_subscription_id_type, &avpch1);
ogs_assert(ret == 0);
if (avpch1) {
ret = fd_msg_avp_hdr(avpch1, &hdr);
ogs_assert(ret == 0);
if (hdr->avp_value->i32 !=
OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_IMSI) {
OGS_DIAM_SUBSCRIPTION_ID_TYPE_END_USER_IMSI) {
ogs_error("Not implemented Subscription-Id-Type(%d)",
hdr->avp_value->i32);
result_code = OGS_DIAM_AVP_UNSUPPORTED;
@ -380,7 +380,7 @@ static int pcrf_gx_ccr_cb( struct msg **msg, struct avp *avp,
result_code = OGS_DIAM_MISSING_AVP;
goto out;
}
ret = fd_avp_search_avp(avp, ogs_diam_gx_subscription_id_data, &avpch1);
ret = fd_avp_search_avp(avp, ogs_diam_subscription_id_data, &avpch1);
ogs_assert(ret == 0);
if (avpch1) {
ret = fd_msg_avp_hdr(avpch1, &hdr);

View File

@ -149,7 +149,7 @@ static int pcrf_rx_aar_cb( struct msg **msg, struct avp *avp,
/* Set the Auth-Request-Type AVP */
ret = fd_msg_avp_new(ogs_diam_auth_request_type, 0, &avp);
ogs_assert(ret == 0);
val.i32 = 1;
val.i32 = OGS_DIAM_AUTH_REQUEST_TYPE_AUTHENTICATE_ONLY;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
@ -448,9 +448,9 @@ static int pcrf_rx_aar_cb( struct msg **msg, struct avp *avp,
ogs_assert(ret == 0);
/* Set RAT-Type */
ret = fd_msg_avp_new(ogs_diam_rx_rat_type, 0, &avp);
ret = fd_msg_avp_new(ogs_diam_rat_type, 0, &avp);
ogs_assert(ret == 0);
val.i32 = OGS_DIAM_RX_RAT_TYPE_EUTRAN;
val.i32 = OGS_DIAM_RAT_TYPE_EUTRAN;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
@ -743,7 +743,7 @@ static int pcrf_rx_str_cb( struct msg **msg, struct avp *avp,
/* Set the Auth-Request-Type AVP */
ret = fd_msg_avp_new(ogs_diam_auth_request_type, 0, &avp);
ogs_assert(ret == 0);
val.i32 = 1;
val.i32 = OGS_DIAM_AUTH_REQUEST_TYPE_AUTHENTICATE_ONLY;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);

View File

@ -42,7 +42,7 @@ ogs_pkbuf_t *sgwc_s11_build_downlink_data_notification(
* 0 : Reserved. Shall not be sent and
* if received the Cause shall be treated as an invalid IE
*/
if (cause_value != OGS_GTP_CAUSE_INVALID_VALUE) {
if (cause_value != OGS_GTP_CAUSE_UNDEFINED_VALUE) {
memset(&cause, 0, sizeof(cause));
cause.value = cause_value;
noti->cause.presence = 1;

View File

@ -772,24 +772,15 @@ void sgwc_s11_handle_delete_bearer_response(
cause_value = OGS_GTP_CAUSE_REQUEST_ACCEPTED;
rv = ogs_gtp_xact_commit(s11_xact);
ogs_expect(rv == OGS_OK);
if (rsp->bearer_contexts.presence == 0) {
ogs_error("No Bearer");
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
}
if (rsp->bearer_contexts.eps_bearer_id.presence == 0) {
ogs_error("No EPS Bearer ID");
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
}
if (s11_xact->xid & OGS_GTP_CMD_XACT_ID)
/* MME received Bearer Resource Modification Request */
bearer = s5c_xact->data;
else
bearer = s11_xact->data;
rv = ogs_gtp_xact_commit(s11_xact);
ogs_expect(rv == OGS_OK);
ogs_assert(bearer);
sess = bearer->sess;
ogs_assert(sess);
@ -803,37 +794,88 @@ void sgwc_s11_handle_delete_bearer_response(
cause_value = OGS_GTP_CAUSE_CONTEXT_NOT_FOUND;
}
if (rsp->cause.presence) {
ogs_gtp_cause_t *cause = rsp->cause.data;
ogs_assert(cause);
if (rsp->linked_eps_bearer_id.presence) {
/*
* << Linked EPS Bearer ID >>
*
* 1. SMF sends Delete Bearer Request(DEFAULT BEARER) to SGW/MME.
* 2. MME sends Delete Bearer Response to SGW/SMF.
*
* OR
*
* 1. SMF sends Delete Bearer Request(DEFAULT BEARER) to ePDG.
* 2. ePDG sends Delete Bearer Response(DEFAULT BEARER) to SMF.
*/
if (rsp->cause.presence) {
ogs_gtp_cause_t *cause = rsp->cause.data;
ogs_assert(cause);
cause_value = cause->value;
if (cause_value == OGS_GTP_CAUSE_REQUEST_ACCEPTED) {
if (rsp->bearer_contexts.cause.presence) {
cause = rsp->bearer_contexts.cause.data;
ogs_assert(cause);
cause_value = cause->value;
cause_value = cause->value;
if (cause_value == OGS_GTP_CAUSE_REQUEST_ACCEPTED) {
} else {
ogs_error("No Cause");
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
ogs_error("GTP Failed [CAUSE:%d]", cause_value);
}
} else {
ogs_warn("GTP Failed [CAUSE:%d]", cause_value);
ogs_error("No Cause");
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
}
ogs_assert(OGS_OK ==
sgwc_pfcp_send_session_deletion_request(sess, s5c_xact, gtpbuf));
} else {
ogs_error("No Cause");
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
/*
* << EPS Bearer IDs >>
*
* 1. MME sends Bearer Resource Command to SGW/SMF.
* 2. SMF sends Delete Bearer Request(DEDICATED BEARER) to SGW/MME.
* 3. MME sends Delete Bearer Response(DEDICATED BEARER) to SGW/SMF.
*
* OR
*
* 1. SMF sends Delete Bearer Request(DEDICATED BEARER) to SGW/MME.
* 2. MME sends Delete Bearer Response(DEDICATED BEARER) to SGW/SMF.
*/
if (rsp->bearer_contexts.presence == 0) {
ogs_error("No Bearer");
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
}
if (rsp->bearer_contexts.eps_bearer_id.presence == 0) {
ogs_error("No EPS Bearer ID");
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
}
if (rsp->cause.presence) {
ogs_gtp_cause_t *cause = rsp->cause.data;
ogs_assert(cause);
cause_value = cause->value;
if (cause_value == OGS_GTP_CAUSE_REQUEST_ACCEPTED) {
if (rsp->bearer_contexts.cause.presence) {
cause = rsp->bearer_contexts.cause.data;
ogs_assert(cause);
cause_value = cause->value;
} else {
ogs_error("No Cause");
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
}
} else {
ogs_warn("GTP Failed [CAUSE:%d]", cause_value);
}
} else {
ogs_error("No Cause");
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
}
ogs_debug(" MME_S11_TEID[%d] SGW_S11_TEID[%d]",
sgwc_ue->mme_s11_teid, sgwc_ue->sgw_s11_teid);
ogs_debug(" SGW_S5C_TEID[0x%x] PGW_S5C_TEID[0x%x]",
sess->sgw_s5c_teid, sess->pgw_s5c_teid);
ogs_assert(OGS_OK ==
sgwc_pfcp_send_bearer_modification_request(
bearer, s5c_xact, gtpbuf, OGS_PFCP_MODIFY_REMOVE));
}
ogs_debug(" MME_S11_TEID[%d] SGW_S11_TEID[%d]",
sgwc_ue->mme_s11_teid, sgwc_ue->sgw_s11_teid);
ogs_debug(" SGW_S5C_TEID[0x%x] PGW_S5C_TEID[0x%x]",
sess->sgw_s5c_teid, sess->pgw_s5c_teid);
ogs_assert(OGS_OK ==
sgwc_pfcp_send_bearer_modification_request(
bearer, s5c_xact, gtpbuf, OGS_PFCP_MODIFY_REMOVE));
}
void sgwc_s11_handle_release_access_bearers_request(

View File

@ -180,8 +180,6 @@ void sgwc_s5c_handle_create_session_response(
}
if (cause_value != OGS_GTP_CAUSE_REQUEST_ACCEPTED) {
ogs_assert(OGS_OK ==
sgwc_pfcp_send_session_deletion_request(sess, NULL, NULL));
ogs_gtp_send_error_message(
s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0,
OGS_GTP_CREATE_SESSION_RESPONSE_TYPE, cause_value);
@ -294,10 +292,85 @@ void sgwc_s5c_handle_delete_session_response(
ogs_debug(" SGW_S5C_TEID[0x%x] PGW_S5C_TEID[0x%x]",
sess->sgw_s5c_teid, sess->pgw_s5c_teid);
/*
* 1. MME sends Delete Session Request to SGW/SMF.
* 2. SMF sends Delete Session Response to SGW/MME.
*/
ogs_assert(OGS_OK ==
sgwc_pfcp_send_session_deletion_request(sess, s11_xact, gtpbuf));
}
void sgwc_s5c_handle_modify_bearer_response(
sgwc_sess_t *sess, ogs_gtp_xact_t *s5c_xact,
ogs_pkbuf_t *gtpbuf, ogs_gtp_message_t *message)
{
int rv;
uint8_t cause_value;
sgwc_ue_t *sgwc_ue = NULL;
ogs_pkbuf_t *pkbuf = NULL;
ogs_gtp_xact_t *s11_xact = NULL;
ogs_gtp_modify_bearer_response_t *rsp = NULL;
ogs_assert(s5c_xact);
s11_xact = s5c_xact->assoc_xact;
ogs_assert(s11_xact);
ogs_assert(message);
rsp = &message->modify_bearer_response;
ogs_assert(rsp);
ogs_debug("Modify Bearer Response");
cause_value = OGS_GTP_CAUSE_REQUEST_ACCEPTED;
rv = ogs_gtp_xact_commit(s5c_xact);
ogs_expect(rv == OGS_OK);
if (!sess) {
ogs_warn("No Context in TEID");
sess = s5c_xact->data;
ogs_assert(sess);
}
sgwc_ue = sess->sgwc_ue;
ogs_assert(sgwc_ue);
if (rsp->cause.presence) {
ogs_gtp_cause_t *cause = rsp->cause.data;
ogs_assert(cause);
cause_value = cause->value;
} else {
ogs_error("No Cause");
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
}
if (cause_value != OGS_GTP_CAUSE_REQUEST_ACCEPTED) {
ogs_gtp_send_error_message(
s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0,
OGS_GTP_MODIFY_BEARER_RESPONSE_TYPE, cause_value);
return;
}
ogs_debug(" MME_S11_TEID[%d] SGW_S11_TEID[%d]",
sgwc_ue->mme_s11_teid, sgwc_ue->sgw_s11_teid);
ogs_debug(" SGW_S5C_TEID[0x%x] PGW_S5C_TEID[0x%x]",
sess->sgw_s5c_teid, sess->pgw_s5c_teid);
message->h.type = OGS_GTP_MODIFY_BEARER_RESPONSE_TYPE;
message->h.teid = sgwc_ue->mme_s11_teid;
pkbuf = ogs_gtp_build_msg(message);
ogs_expect_or_return(pkbuf);
rv = ogs_gtp_xact_update_tx(s11_xact, &message->h, pkbuf);
ogs_expect_or_return(rv == OGS_OK);
rv = ogs_gtp_xact_commit(s11_xact);
ogs_expect(rv == OGS_OK);
}
void sgwc_s5c_handle_create_bearer_request(
sgwc_sess_t *sess, ogs_gtp_xact_t *s5c_xact,
ogs_pkbuf_t *gtpbuf, ogs_gtp_message_t *message)
@ -516,10 +589,41 @@ void sgwc_s5c_handle_delete_bearer_request(
}
if (cause_value == OGS_GTP_CAUSE_REQUEST_ACCEPTED) {
bearer = sgwc_bearer_find_by_sess_ebi(sess, req->eps_bearer_ids.u8);
uint8_t ebi;
if (req->linked_eps_bearer_id.presence) {
/*
* << Linked EPS Bearer ID >>
*
* 1. SMF sends Delete Bearer Request(DEFAULT BEARER) to SGW/MME.
* 2. MME sends Delete Bearer Response to SGW/SMF.
*
* OR
*
* 1. SMF sends Delete Bearer Request(DEFAULT BEARER) to ePDG.
* 2. ePDG sends Delete Bearer Response(DEFAULT BEARER) to SMF.
*/
ebi = req->linked_eps_bearer_id.u8;
} else if (req->eps_bearer_ids.presence) {
/*
* << EPS Bearer IDs >>
*
* 1. MME sends Bearer Resource Command to SGW/SMF.
* 2. SMF sends Delete Bearer Request(DEDICATED BEARER) to SGW/MME.
* 3. MME sends Delete Bearer Response(DEDICATED BEARER) to SGW/SMF.
*
* OR
*
* 1. SMF sends Delete Bearer Request(DEDICATED BEARER) to SGW/MME.
* 2. MME sends Delete Bearer Response(DEDICATED BEARER) to SGW/SMF.
*/
ebi = req->eps_bearer_ids.u8;
} else
ogs_assert_if_reached();
bearer = sgwc_bearer_find_by_sess_ebi(sess, ebi);
if (!bearer)
ogs_error("No Context for EPS Bearer ID[%d]",
req->eps_bearer_ids.u8);
ogs_error("No Context for EPS Bearer ID[%d]", ebi);
}
if (!bearer) {
ogs_warn("No Context");
@ -552,12 +656,31 @@ void sgwc_s5c_handle_delete_bearer_request(
s11_xact = s5c_xact->assoc_xact;
if (!s11_xact) {
/*
* 1. SMF sends Delete Bearer Request(DEFAULT BEARER) to SGW/MME.
* 2. MME sends Delete Bearer Response to SGW/SMF.
*
* OR
*
* 1. SMF sends Delete Bearer Request(DEFAULT BEARER) to ePDG.
* 2. ePDG sends Delete Bearer Response(DEFAULT BEARER) to SMF.
*
* OR
*
* 1. SMF sends Delete Bearer Request(DEDICATED BEARER) to SGW/MME.
* 2. MME sends Delete Bearer Response(DEDICATED BEARER) to SGW/SMF.
*/
s11_xact = ogs_gtp_xact_local_create(
sgwc_ue->gnode, &message->h, pkbuf, bearer_timeout, bearer);
ogs_expect_or_return(s11_xact);
ogs_gtp_xact_associate(s5c_xact, s11_xact);
} else {
/*
* 1. MME sends Bearer Resource Command to SGW/SMF.
* 2. SMF sends Delete Bearer Request(DEDICATED BEARER) to SGW/MME.
* 3. MME sends Delete Bearer Response(DEDICATED BEARER) to SGW/SMF.
*/
rv = ogs_gtp_xact_update_tx(s11_xact, &message->h, pkbuf);
ogs_expect_or_return(rv == OGS_OK);
}

View File

@ -32,6 +32,9 @@ void sgwc_s5c_handle_create_session_response(
void sgwc_s5c_handle_delete_session_response(
sgwc_sess_t *sess, ogs_gtp_xact_t *s5c_xact,
ogs_pkbuf_t *gtpbuf, ogs_gtp_message_t *message);
void sgwc_s5c_handle_modify_bearer_response(
sgwc_sess_t *sess, ogs_gtp_xact_t *s5c_xact,
ogs_pkbuf_t *gtpbuf, ogs_gtp_message_t *message);
void sgwc_s5c_handle_create_bearer_request(
sgwc_sess_t *sess, ogs_gtp_xact_t *s5c_xact,
ogs_pkbuf_t *gtpbuf, ogs_gtp_message_t *message);

View File

@ -272,6 +272,10 @@ void sgwc_state_operational(ogs_fsm_t *s, sgwc_event_t *e)
sgwc_s5c_handle_delete_session_response(
sess, gtp_xact, recvbuf, &gtp_message);
break;
case OGS_GTP_MODIFY_BEARER_RESPONSE_TYPE:
sgwc_s5c_handle_modify_bearer_response(
sess, gtp_xact, recvbuf, &gtp_message);
break;
case OGS_GTP_CREATE_BEARER_REQUEST_TYPE:
sgwc_s5c_handle_create_bearer_request(
sess, gtp_xact, recvbuf, &gtp_message);

View File

@ -890,21 +890,48 @@ void sgwc_sxa_handle_session_modification_response(
ogs_gtp_modify_bearer_request_t *gtp_req = NULL;
ogs_gtp_modify_bearer_response_t *gtp_rsp = NULL;
ogs_gtp_indication_t *indication = NULL;
ogs_assert(recv_message);
gtp_req = &recv_message->modify_bearer_request;
ogs_assert(gtp_req);
gtp_rsp = &send_message.modify_bearer_response;
ogs_assert(gtp_rsp);
if (gtp_req->indication_flags.presence &&
gtp_req->indication_flags.data &&
gtp_req->indication_flags.len) {
indication = gtp_req->indication_flags.data;
}
memset(&send_message, 0, sizeof(ogs_gtp_message_t));
if (indication && indication->hi) {
recv_message->h.type = OGS_GTP_MODIFY_BEARER_REQUEST_TYPE;
recv_message->h.teid = sess->pgw_s5c_teid;
memset(&cause, 0, sizeof(cause));
cause.value = OGS_GTP_CAUSE_REQUEST_ACCEPTED;
pkbuf = ogs_gtp_build_msg(recv_message);
ogs_expect_or_return(pkbuf);
gtp_rsp->cause.presence = 1;
gtp_rsp->cause.data = &cause;
gtp_rsp->cause.len = sizeof(cause);
ogs_assert(sess->gnode);
s5c_xact = ogs_gtp_xact_local_create(
sess->gnode, &recv_message->h, pkbuf,
sess_timeout, sess);
ogs_expect_or_return(s5c_xact);
ogs_gtp_xact_associate(s11_xact, s5c_xact);
rv = ogs_gtp_xact_commit(s5c_xact);
ogs_expect(rv == OGS_OK);
} else {
gtp_rsp = &send_message.modify_bearer_response;
ogs_assert(gtp_rsp);
memset(&send_message, 0, sizeof(ogs_gtp_message_t));
memset(&cause, 0, sizeof(cause));
cause.value = OGS_GTP_CAUSE_REQUEST_ACCEPTED;
gtp_rsp->cause.presence = 1;
gtp_rsp->cause.data = &cause;
gtp_rsp->cause.len = sizeof(cause);
/* Copy Bearer-Contexts-Modified from Modify-Bearer-Request
*
@ -919,31 +946,35 @@ void sgwc_sxa_handle_session_modification_response(
* both an IPv4 address and an IPv6 address
* (see also subclause 8.22 "F-TEID").
*/
gtp_rsp->bearer_contexts_modified.presence = 1;
gtp_rsp->bearer_contexts_modified.eps_bearer_id.presence = 1;
gtp_rsp->bearer_contexts_modified.eps_bearer_id.u8 =
gtp_req->bearer_contexts_to_be_modified.eps_bearer_id.u8;
gtp_rsp->bearer_contexts_modified.s1_u_enodeb_f_teid.presence = 1;
gtp_rsp->bearer_contexts_modified.s1_u_enodeb_f_teid.data =
gtp_req->bearer_contexts_to_be_modified.s1_u_enodeb_f_teid.data;
gtp_rsp->bearer_contexts_modified.s1_u_enodeb_f_teid.len =
gtp_req->bearer_contexts_to_be_modified.s1_u_enodeb_f_teid.len;
gtp_rsp->bearer_contexts_modified.presence = 1;
gtp_rsp->bearer_contexts_modified.eps_bearer_id.presence = 1;
gtp_rsp->bearer_contexts_modified.eps_bearer_id.u8 =
gtp_req->bearer_contexts_to_be_modified.eps_bearer_id.u8;
gtp_rsp->bearer_contexts_modified.
s1_u_enodeb_f_teid.presence = 1;
gtp_rsp->bearer_contexts_modified.s1_u_enodeb_f_teid.data =
gtp_req->bearer_contexts_to_be_modified.
s1_u_enodeb_f_teid.data;
gtp_rsp->bearer_contexts_modified.s1_u_enodeb_f_teid.len =
gtp_req->bearer_contexts_to_be_modified.
s1_u_enodeb_f_teid.len;
gtp_rsp->bearer_contexts_modified.cause.presence = 1;
gtp_rsp->bearer_contexts_modified.cause.len = sizeof(cause);
gtp_rsp->bearer_contexts_modified.cause.data = &cause;
gtp_rsp->bearer_contexts_modified.cause.presence = 1;
gtp_rsp->bearer_contexts_modified.cause.len = sizeof(cause);
gtp_rsp->bearer_contexts_modified.cause.data = &cause;
send_message.h.type = OGS_GTP_MODIFY_BEARER_RESPONSE_TYPE;
send_message.h.teid = sgwc_ue->mme_s11_teid;
send_message.h.type = OGS_GTP_MODIFY_BEARER_RESPONSE_TYPE;
send_message.h.teid = sgwc_ue->mme_s11_teid;
pkbuf = ogs_gtp_build_msg(&send_message);
ogs_expect_or_return(pkbuf);
pkbuf = ogs_gtp_build_msg(&send_message);
ogs_expect_or_return(pkbuf);
rv = ogs_gtp_xact_update_tx(s11_xact, &send_message.h, pkbuf);
ogs_expect_or_return(rv == OGS_OK);
rv = ogs_gtp_xact_update_tx(s11_xact, &send_message.h, pkbuf);
ogs_expect_or_return(rv == OGS_OK);
rv = ogs_gtp_xact_commit(s11_xact);
ogs_expect(rv == OGS_OK);
rv = ogs_gtp_xact_commit(s11_xact);
ogs_expect(rv == OGS_OK);
}
} else {
ogs_fatal("Invalid modify_flags[0x%llx]", (long long)flags);
@ -1017,18 +1048,18 @@ void sgwc_sxa_handle_session_deletion_response(
{
int rv;
uint8_t cause_value = 0;
uint32_t teid = 0;
sgwc_ue_t *sgwc_ue = NULL;
ogs_gtp_xact_t *s11_xact = NULL;
ogs_gtp_xact_t *gtp_xact = NULL;
ogs_pkbuf_t *pkbuf = NULL;
ogs_debug("Session Deletion Response");
ogs_assert(pfcp_xact);
ogs_assert(pfcp_rsp);
ogs_pfcp_xact_commit(pfcp_xact);
ogs_assert(gtp_message);
cause_value = OGS_GTP_CAUSE_REQUEST_ACCEPTED;
@ -1047,14 +1078,44 @@ void sgwc_sxa_handle_session_deletion_response(
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
}
s11_xact = pfcp_xact->assoc_xact;
gtp_xact = pfcp_xact->assoc_xact;
ogs_pfcp_xact_commit(pfcp_xact);
switch (gtp_message->h.type) {
case OGS_GTP_DELETE_SESSION_RESPONSE_TYPE:
/*
* 1. MME sends Delete Session Request to SGW/SMF.
* 2. SMF sends Delete Session Response to SGW/MME.
*/
if (sess) sgwc_ue = sess->sgwc_ue;
teid = sgwc_ue ? sgwc_ue->mme_s11_teid : 0;
break;
case OGS_GTP_DELETE_BEARER_RESPONSE_TYPE:
/*
* 1. SMF sends Delete Bearer Request(DEFAULT BEARER) to SGW/MME.
* 2. MME sends Delete Bearer Response to SGW/SMF.
*
* OR
*
* 1. SMF sends Delete Bearer Request(DEFAULT BEARER) to ePDG.
* 2. ePDG sends Delete Bearer Response(DEFAULT BEARER) to SMF.
*
* Note that the following messages are not processed here.
* - Bearer Resource Command
* - Delete Bearer Request/Response with DEDICATED BEARER.
*/
teid = sess ? sess->pgw_s5c_teid : 0;
break;
default:
ogs_fatal("Unknown GTP message type [%d]", gtp_message->h.type);
ogs_assert_if_reached();
}
if (cause_value != OGS_GTP_CAUSE_REQUEST_ACCEPTED) {
if (sess) sgwc_ue = sess->sgwc_ue;
if (s11_xact) {
if (gtp_xact) {
ogs_gtp_send_error_message(
s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0,
OGS_GTP_DELETE_SESSION_RESPONSE_TYPE, cause_value);
gtp_xact, teid, gtp_message->h.type, cause_value);
}
return;
}
@ -1063,17 +1124,23 @@ void sgwc_sxa_handle_session_deletion_response(
sgwc_ue = sess->sgwc_ue;
ogs_assert(sgwc_ue);
if (s11_xact) {
gtp_message->h.type = OGS_GTP_DELETE_SESSION_RESPONSE_TYPE;
gtp_message->h.teid = sgwc_ue->mme_s11_teid;
if (gtp_xact) {
/*
* If gtp_message->h.type == OGS_GTP_DELETE_SESSION_RESPONSE_TYPE
* Then gtp_xact is S11-XACT
*
* If gtp_message->h.type == OGS_GTP_DELETE_BEARER_RESPONSE_TYPE
* Then gtp_xact is S5C-XACT
*/
gtp_message->h.teid = teid;
pkbuf = ogs_gtp_build_msg(gtp_message);
ogs_expect_or_return(pkbuf);
rv = ogs_gtp_xact_update_tx(s11_xact, &gtp_message->h, pkbuf);
rv = ogs_gtp_xact_update_tx(gtp_xact, &gtp_message->h, pkbuf);
ogs_expect_or_return(rv == OGS_OK);
rv = ogs_gtp_xact_commit(s11_xact);
rv = ogs_gtp_xact_commit(gtp_xact);
ogs_expect(rv == OGS_OK);
}
@ -1153,7 +1220,7 @@ void sgwc_sxa_handle_session_report_request(
if (tunnel->pdr->id == pdr_id) {
ogs_assert(OGS_OK ==
sgwc_gtp_send_downlink_data_notification(
OGS_GTP_CAUSE_INVALID_VALUE, bearer));
OGS_GTP_CAUSE_UNDEFINED_VALUE, bearer));
return;
}
}

View File

@ -20,6 +20,7 @@
#include "binding.h"
#include "s5c-build.h"
#include "pfcp-path.h"
#include "gtp-path.h"
#include "ipfw/ipfw2.h"
@ -52,17 +53,6 @@ static void bearer_timeout(ogs_gtp_xact_t *xact, void *data)
case OGS_GTP_UPDATE_BEARER_REQUEST_TYPE:
ogs_error("[%s] No Update Bearer Response", smf_ue->imsi_bcd);
break;
case OGS_GTP_DELETE_BEARER_REQUEST_TYPE:
ogs_error("[%s] No Delete Bearer Response", smf_ue->imsi_bcd);
if (!smf_bearer_cycle(bearer)) {
ogs_warn("[%s] Bearer has already been removed", smf_ue->imsi_bcd);
break;
}
ogs_assert(OGS_OK ==
smf_epc_pfcp_send_bearer_modification_request(
bearer, OGS_PFCP_MODIFY_REMOVE));
break;
default:
ogs_error("GTP Timeout : IMSI[%s] Message-Type[%d]",
smf_ue->imsi_bcd, type);
@ -384,20 +374,10 @@ void smf_bearer_binding(smf_sess_t *sess)
continue;
}
memset(&h, 0, sizeof(ogs_gtp_header_t));
h.type = OGS_GTP_DELETE_BEARER_REQUEST_TYPE;
h.teid = sess->sgw_s5c_teid;
pkbuf = smf_s5c_build_delete_bearer_request(h.type, bearer,
OGS_NAS_PROCEDURE_TRANSACTION_IDENTITY_UNASSIGNED);
ogs_expect_or_return(pkbuf);
xact = ogs_gtp_xact_local_create(
sess->gnode, &h, pkbuf, bearer_timeout, bearer);
ogs_expect_or_return(xact);
rv = ogs_gtp_xact_commit(xact);
ogs_expect(rv == OGS_OK);
ogs_assert(OGS_OK ==
smf_gtp_send_delete_bearer_request(
bearer, OGS_NAS_PROCEDURE_TRANSACTION_IDENTITY_UNASSIGNED,
OGS_GTP_CAUSE_UNDEFINED_VALUE));
} else {
ogs_error("Invalid Type[%d]", pcc_rule->type);
}

View File

@ -217,6 +217,9 @@ int smf_context_parse_config(void)
} else if (!strcmp(fd_key, "listen_on")) {
self.diam_config->cnf_addr =
ogs_yaml_iter_value(&fd_iter);
} else if (!strcmp(fd_key, "no_fwd")) {
self.diam_config->cnf_flags.no_fwd =
ogs_yaml_iter_bool(&fd_iter);
} else if (!strcmp(fd_key, "load_extension")) {
ogs_yaml_iter_t ext_array, ext_iter;
ogs_yaml_iter_recurse(&fd_iter, &ext_array);
@ -949,7 +952,7 @@ void smf_sess_select_upf(smf_sess_t *sess)
OGS_ADDR(&ogs_pfcp_self()->pfcp_node->addr, buf));
}
smf_sess_t *smf_sess_add_by_apn(smf_ue_t *smf_ue, char *apn)
smf_sess_t *smf_sess_add_by_apn(smf_ue_t *smf_ue, char *apn, uint8_t rat_type)
{
smf_event_t e;
@ -977,6 +980,9 @@ smf_sess_t *smf_sess_add_by_apn(smf_ue_t *smf_ue, char *apn)
sess->smf_n4_teid = sess->index;
sess->smf_n4_seid = sess->index;
/* Set Charging ID */
sess->charging.id = sess->index;
/* Create BAR in PFCP Session */
ogs_pfcp_bar_new(&sess->pfcp);
@ -984,6 +990,10 @@ smf_sess_t *smf_sess_add_by_apn(smf_ue_t *smf_ue, char *apn)
sess->session.name = ogs_strdup(apn);
ogs_assert(sess->session.name);
/* Set RAT-Type */
sess->gtp_rat_type = rat_type;
ogs_assert(sess->gtp_rat_type);
/* Setup Timer */
sess->t_release_holding = ogs_timer_add(
ogs_app()->timer_mgr, smf_timer_release_holding_expire, sess);
@ -1018,6 +1028,10 @@ smf_sess_t *smf_sess_add_by_gtp_message(ogs_gtp_message_t *message)
ogs_error("No APN");
return NULL;
}
if (req->rat_type.presence == 0) {
ogs_error("No RAT Type");
return NULL;
}
ogs_fqdn_parse(apn,
req->access_point_name.data, req->access_point_name.len);
@ -1049,14 +1063,14 @@ smf_sess_t *smf_sess_add_by_gtp_message(ogs_gtp_message_t *message)
ogs_assert(smf_ue);
}
sess = smf_sess_find_by_apn(smf_ue, apn);
sess = smf_sess_find_by_apn(smf_ue, apn, req->rat_type.u8);
if (sess) {
ogs_warn("OLD Session Release [IMSI:%s,APN:%s]",
smf_ue->imsi_bcd, sess->session.name);
smf_sess_remove(sess);
}
sess = smf_sess_add_by_apn(smf_ue, apn);
sess = smf_sess_add_by_apn(smf_ue, apn, req->rat_type.u8);
return sess;
}
@ -1088,6 +1102,7 @@ smf_sess_t *smf_sess_add_by_psi(smf_ue_t *smf_ue, uint8_t psi)
sess->index = ogs_pool_index(&smf_sess_pool, sess);
ogs_assert(sess->index > 0 && sess->index <= ogs_app()->pool.sess);
/* Set SmContextRef in 5GC */
sess->sm_context_ref = ogs_msprintf("%d",
(int)ogs_pool_index(&smf_sess_pool, sess));
ogs_assert(sess->sm_context_ref);
@ -1108,6 +1123,9 @@ smf_sess_t *smf_sess_add_by_psi(smf_ue_t *smf_ue, uint8_t psi)
sess->smf_n4_teid = sess->index;
sess->smf_n4_seid = sess->index;
/* Set Charging Id */
sess->charging.id = sess->index;
/* Setup Timer */
sess->t_release_holding = ogs_timer_add(
ogs_app()->timer_mgr, smf_timer_release_holding_expire, sess);
@ -1472,7 +1490,7 @@ smf_sess_t *smf_sess_find_by_seid(uint64_t seid)
return smf_sess_find(seid);
}
smf_sess_t *smf_sess_find_by_apn(smf_ue_t *smf_ue, char *apn)
smf_sess_t *smf_sess_find_by_apn(smf_ue_t *smf_ue, char *apn, uint8_t rat_type)
{
smf_sess_t *sess = NULL;
@ -1480,7 +1498,8 @@ smf_sess_t *smf_sess_find_by_apn(smf_ue_t *smf_ue, char *apn)
ogs_assert(apn);
ogs_list_for_each(&smf_ue->sess_list, sess) {
if (!ogs_strcasecmp(sess->session.name, apn))
if (ogs_strcasecmp(sess->session.name, apn) == 0 &&
sess->gtp_rat_type == rat_type)
return sess;
}
@ -1502,6 +1521,12 @@ smf_sess_t *smf_sess_find_by_psi(smf_ue_t *smf_ue, uint8_t psi)
return NULL;
}
smf_sess_t *smf_sess_find_by_charging_id(uint32_t charging_id)
{
ogs_assert(charging_id);
return smf_sess_find(charging_id);
}
smf_sess_t *smf_sess_find_by_sm_context_ref(char *sm_context_ref)
{
ogs_assert(sm_context_ref);
@ -2066,35 +2091,11 @@ smf_bearer_t *smf_bearer_find_by_pdr_id(
}
smf_bearer_t *smf_default_bearer_in_sess(smf_sess_t *sess)
{
return smf_bearer_first(sess);
}
bool smf_bearer_is_default(smf_bearer_t *bearer)
{
smf_sess_t *sess = NULL;
smf_bearer_t *default_bearer = NULL;
ogs_assert(bearer);
sess = bearer->sess;
ogs_assert(sess);
default_bearer = smf_default_bearer_in_sess(sess);
ogs_assert(default_bearer);
return bearer == default_bearer;
}
smf_bearer_t *smf_bearer_first(smf_sess_t *sess)
{
ogs_assert(sess);
return ogs_list_first(&sess->bearer_list);
}
smf_bearer_t *smf_bearer_next(smf_bearer_t *bearer)
{
return ogs_list_next(bearer);
}
smf_ue_t *smf_ue_cycle(smf_ue_t *smf_ue)
{
return ogs_pool_cycle(&smf_ue_pool, smf_ue);

View File

@ -24,6 +24,8 @@
#include "ogs-gtp.h"
#include "ogs-diameter-gx.h"
#include "ogs-diameter-rx.h"
#include "ogs-diameter-s6b.h"
#include "ogs-pfcp.h"
#include "ogs-sbi.h"
#include "ogs-app.h"
@ -168,8 +170,8 @@ typedef struct smf_bearer_s {
ogs_ip_t sgw_s5u_ip; /* SGW-S5U IPv4/IPv6 */
struct {
char *name; /* EPC: PCC Rule Name */
char *id; /* 5GC: PCC Rule Id */
char *name; /* EPC: PCC Rule Name */
char *id; /* 5GC: PCC Rule Id */
} pcc_rule;
ogs_qos_t qos; /* QoS Infomration */
@ -193,7 +195,9 @@ typedef struct smf_sess_s {
uint64_t smpolicycontrol_features; /* SBI features */
uint32_t smf_n4_teid; /* SMF-N4-TEID is derived from INDEX */
uint32_t sgw_s5c_teid; /* SGW-S5C-TEID is received from SGW */
ogs_ip_t sgw_s5c_ip; /* SGW-S5C IPv4/IPv6 */
uint64_t smf_n4_seid; /* SMF SEID is dervied from INDEX */
uint64_t upf_n4_seid; /* UPF SEID is received from Peer */
@ -206,6 +210,7 @@ typedef struct smf_sess_s {
ogs_ip_t gnb_n3_ip; /* gNB-N3 IPv4/IPv6 */
char *gx_sid; /* Gx Session ID */
char *s6b_sid; /* S6b Session ID */
OGS_POOL(pf_precedence_pool, uint8_t);
@ -237,9 +242,6 @@ typedef struct smf_sess_s {
ogs_eps_tai_t e_tai;
ogs_e_cgi_t e_cgi;
/* Rat Type */
OpenAPI_rat_type_e rat_type;
/* NR Location */
ogs_5gs_tai_t nr_tai;
ogs_nr_cgi_t nr_cgi;
@ -266,6 +268,10 @@ typedef struct smf_sess_s {
ogs_pfcp_ue_ip_t *ipv4;
ogs_pfcp_ue_ip_t *ipv6;
/* RAT Type */
uint8_t gtp_rat_type;
OpenAPI_rat_type_e sbi_rat_type;
struct {
ogs_tlv_octet_t ue_pco;
ogs_tlv_octet_t user_location_information;
@ -316,6 +322,11 @@ typedef struct smf_sess_s {
ogs_ip_t gnb_dl_ip;
} handover;
/* Charging */
struct {
uint32_t id;
} charging;
/* Data Forwarding between the CP and UP functions */
ogs_pfcp_pdr_t *cp2up_pdr;
ogs_pfcp_pdr_t *up2cp_pdr;
@ -344,7 +355,7 @@ smf_ue_t *smf_ue_find_by_supi(char *supi);
smf_ue_t *smf_ue_find_by_imsi(uint8_t *imsi, int imsi_len);
smf_sess_t *smf_sess_add_by_gtp_message(ogs_gtp_message_t *message);
smf_sess_t *smf_sess_add_by_apn(smf_ue_t *smf_ue, char *apn);
smf_sess_t *smf_sess_add_by_apn(smf_ue_t *smf_ue, char *apn, uint8_t rat_type);
smf_sess_t *smf_sess_add_by_sbi_message(ogs_sbi_message_t *message);
smf_sess_t *smf_sess_add_by_psi(smf_ue_t *smf_ue, uint8_t psi);
@ -360,8 +371,9 @@ void smf_sess_remove_all(smf_ue_t *smf_ue);
smf_sess_t *smf_sess_find(uint32_t index);
smf_sess_t *smf_sess_find_by_teid(uint32_t teid);
smf_sess_t *smf_sess_find_by_seid(uint64_t seid);
smf_sess_t *smf_sess_find_by_apn(smf_ue_t *smf_ue, char *apn);
smf_sess_t *smf_sess_find_by_apn(smf_ue_t *smf_ue, char *apn, uint8_t rat_type);
smf_sess_t *smf_sess_find_by_psi(smf_ue_t *smf_ue, uint8_t psi);
smf_sess_t *smf_sess_find_by_charging_id(uint32_t charging_id);
smf_sess_t *smf_sess_find_by_sm_context_ref(char *sm_context_ref);
smf_sess_t *smf_sess_find_by_ipv4(uint32_t addr);
smf_sess_t *smf_sess_find_by_ipv6(uint32_t *addr6);
@ -394,9 +406,6 @@ smf_bearer_t *smf_bearer_find_by_pcc_rule_name(
smf_bearer_t *smf_bearer_find_by_pdr_id(
smf_sess_t *sess, ogs_pfcp_pdr_id_t pdr_id);
smf_bearer_t *smf_default_bearer_in_sess(smf_sess_t *sess);
bool smf_bearer_is_default(smf_bearer_t *bearer);
smf_bearer_t *smf_bearer_first(smf_sess_t *sess);
smf_bearer_t *smf_bearer_next(smf_bearer_t *bearer);
smf_ue_t *smf_ue_cycle(smf_ue_t *smf_ue);
smf_sess_t *smf_sess_cycle(smf_sess_t *sess);

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More