forked from acouzens/open5gs
[SMF] Handle APCO IE in S2b GTPv2C CreateSessionRequest/Response
This IE is used by UEs registering through S2b interface (ePDG) to obtain DNS and P-CSCF server address information.
This commit is contained in:
parent
5b1edb816a
commit
c06303ec54
|
@ -335,6 +335,7 @@ typedef struct smf_sess_s {
|
|||
struct {
|
||||
uint8_t version; /* GTPC version */
|
||||
ogs_tlv_octet_t ue_pco;
|
||||
ogs_tlv_octet_t ue_apco;
|
||||
ogs_tlv_octet_t ue_epco;
|
||||
ogs_tlv_octet_t user_location_information;
|
||||
ogs_tlv_octet_t ue_timezone;
|
||||
|
|
|
@ -47,6 +47,8 @@ ogs_pkbuf_t *smf_s5c_build_create_session_response(
|
|||
int len;
|
||||
uint8_t pco_buf[OGS_MAX_PCO_LEN];
|
||||
int16_t pco_len;
|
||||
uint8_t apco_buf[OGS_MAX_PCO_LEN];
|
||||
int16_t apco_len;
|
||||
uint8_t *epco_buf = NULL;
|
||||
int16_t epco_len;
|
||||
|
||||
|
@ -145,6 +147,17 @@ ogs_pkbuf_t *smf_s5c_build_create_session_response(
|
|||
rsp->protocol_configuration_options.len = pco_len;
|
||||
}
|
||||
|
||||
/* APCO */
|
||||
if (sess->gtp.ue_apco.presence &&
|
||||
sess->gtp.ue_apco.len && sess->gtp.ue_apco.data) {
|
||||
apco_len = smf_pco_build(
|
||||
apco_buf, sess->gtp.ue_apco.data, sess->gtp.ue_apco.len);
|
||||
ogs_assert(apco_len > 0);
|
||||
rsp->additional_protocol_configuration_options.presence = 1;
|
||||
rsp->additional_protocol_configuration_options.data = apco_buf;
|
||||
rsp->additional_protocol_configuration_options.len = apco_len;
|
||||
}
|
||||
|
||||
/* ePCO */
|
||||
if (sess->gtp.ue_epco.presence &&
|
||||
sess->gtp.ue_epco.len && sess->gtp.ue_epco.data) {
|
||||
|
|
|
@ -378,6 +378,12 @@ uint8_t smf_s5c_handle_create_session_request(
|
|||
&req->protocol_configuration_options);
|
||||
}
|
||||
|
||||
/* APCO */
|
||||
if (req->additional_protocol_configuration_options.presence) {
|
||||
OGS_TLV_STORE_DATA(&sess->gtp.ue_apco,
|
||||
&req->additional_protocol_configuration_options);
|
||||
}
|
||||
|
||||
/* Set User Location Information */
|
||||
if (req->user_location_information.presence) {
|
||||
OGS_TLV_STORE_DATA(&sess->gtp.user_location_information,
|
||||
|
@ -452,6 +458,8 @@ uint8_t smf_s5c_handle_delete_session_request(
|
|||
OGS_TLV_CLEAR_DATA(&sess->gtp.ue_pco);
|
||||
}
|
||||
|
||||
/* APCO not present in Session deletion procedure, hence no need to clear it here. */
|
||||
|
||||
if (req->extended_protocol_configuration_options.presence) {
|
||||
OGS_TLV_STORE_DATA(&sess->gtp.ue_epco,
|
||||
&req->extended_protocol_configuration_options);
|
||||
|
|
Loading…
Reference in New Issue