Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-AMF
Commits
4fa4f831
Commit
4fa4f831
authored
Aug 29, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code refactoring for UserLocationInformation
parent
4581a722
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
155 additions
and
221 deletions
+155
-221
src/ngap/ngapIEs/UserLocationInformation.cpp
src/ngap/ngapIEs/UserLocationInformation.cpp
+62
-78
src/ngap/ngapIEs/UserLocationInformation.hpp
src/ngap/ngapIEs/UserLocationInformation.hpp
+13
-13
src/ngap/ngapIEs/UserLocationInformationEUTRA.cpp
src/ngap/ngapIEs/UserLocationInformationEUTRA.cpp
+15
-41
src/ngap/ngapIEs/UserLocationInformationEUTRA.hpp
src/ngap/ngapIEs/UserLocationInformationEUTRA.hpp
+4
-6
src/ngap/ngapIEs/UserLocationInformationNR.cpp
src/ngap/ngapIEs/UserLocationInformationNR.cpp
+10
-34
src/ngap/ngapIEs/UserLocationInformationNR.hpp
src/ngap/ngapIEs/UserLocationInformationNR.hpp
+4
-4
src/ngap/ngapMsgs/HandoverNotifyMsg.cpp
src/ngap/ngapMsgs/HandoverNotifyMsg.cpp
+9
-10
src/ngap/ngapMsgs/InitialUEMessage.cpp
src/ngap/ngapMsgs/InitialUEMessage.cpp
+10
-10
src/ngap/ngapMsgs/PduSessionResourceReleaseResponse.cpp
src/ngap/ngapMsgs/PduSessionResourceReleaseResponse.cpp
+8
-7
src/ngap/ngapMsgs/UEContextReleaseComplete.cpp
src/ngap/ngapMsgs/UEContextReleaseComplete.cpp
+7
-7
src/ngap/ngapMsgs/UplinkNASTransport.cpp
src/ngap/ngapMsgs/UplinkNASTransport.cpp
+13
-11
No files found.
src/ngap/ngapIEs/UserLocationInformation.cpp
View file @
4fa4f831
...
...
@@ -21,130 +21,114 @@
#include "UserLocationInformation.hpp"
#include "logger.hpp"
namespace
ngap
{
//------------------------------------------------------------------------------
UserLocationInformation
::
UserLocationInformation
()
{
userLocationInformationEUTRA
=
nullptr
;
userLocationInformationNR
=
nullptr
;
// userLocationInformationN3IWF = nullptr;
present_
=
Ngap_UserLocationInformation_PR_NOTHING
;
user_location_information_eutra_
=
std
::
nullopt
;
user_location_information_nr_
=
std
::
nullopt
;
// userLocationInformationN3IWF = std::nullopt;
}
//------------------------------------------------------------------------------
UserLocationInformation
::~
UserLocationInformation
()
{}
//------------------------------------------------------------------------------
void
UserLocationInformation
::
setInformation
(
UserLocationInformationEUTRA
*
informationEUTRA
)
{
informationPresent
=
Ngap_UserLocationInformation_PR_userLocationInformationEUTRA
;
userLocationInformationEUTRA
=
informationEUTRA
;
Ngap_UserLocationInformation_PR
UserLocationInformation
::
getChoiceOfUserLocationInformation
()
{
return
present_
;
}
//------------------------------------------------------------------------------
bool
UserLocationInformation
::
getInformation
(
UserLocationInformationEUTRA
&
information_eutra
)
{
if
(
!
user_location_information_eutra_
.
has_value
())
return
false
;
information_eutra
=
user_location_information_eutra_
.
value
();
return
true
;
}
//------------------------------------------------------------------------------
void
UserLocationInformation
::
setInformation
(
UserLocationInformationNR
*
informationNR
)
{
informationPresent
=
Ngap_UserLocationInformation_PR_userLocationInformationNR
;
userLocationInformationNR
=
informationNR
;
const
UserLocationInformationEUTRA
&
information_eutra
)
{
present_
=
Ngap_UserLocationInformation_PR_userLocationInformationEUTRA
;
user_location_information_eutra_
=
std
::
optional
<
UserLocationInformationEUTRA
>
(
information_eutra
);
}
//------------------------------------------------------------------------------
bool
UserLocationInformation
::
getInformation
(
UserLocationInformationNR
&
information_nr
)
{
if
(
!
user_location_information_nr_
.
has_value
())
return
false
;
information_nr
=
user_location_information_nr_
.
value
();
return
true
;
}
//------------------------------------------------------------------------------
#if 0
void UserLocationInformation::setInformation(UserLocationInformationN3IWF* informationN3IWF)
{
informationPresent = Ngap_UserLocationInformation_PR_userLocationInformationN3IWF;
userLocationInformationN3IWF = informationN3IWF;
}
#endif
void
UserLocationInformation
::
setInformation
(
const
UserLocationInformationNR
&
information_nr
)
{
present_
=
Ngap_UserLocationInformation_PR_userLocationInformationNR
;
user_location_information_nr_
=
std
::
optional
<
UserLocationInformationNR
>
(
information_nr
);
}
//------------------------------------------------------------------------------
bool
UserLocationInformation
::
encode
fromUserLocationInformation
(
Ngap_UserLocationInformation_t
*
user
LocationI
nformation
)
{
user
LocationInformation
->
present
=
informationPresent
;
switch
(
informationPresent
)
{
bool
UserLocationInformation
::
encode
(
Ngap_UserLocationInformation_t
*
user
_location_i
nformation
)
{
user
_location_information
->
present
=
present_
;
switch
(
present_
)
{
case
Ngap_UserLocationInformation_PR_userLocationInformationEUTRA
:
{
Ngap_UserLocationInformationEUTRA
*
ie
EUTRA
=
Ngap_UserLocationInformationEUTRA
*
ie
_eutra
=
(
Ngap_UserLocationInformationEUTRA
*
)
calloc
(
1
,
sizeof
(
Ngap_UserLocationInformationEUTRA
));
userLocationInformationEUTRA
->
encode2UserLocationInformationEUTRA
(
ieEUTRA
);
userLocationInformation
->
choice
.
userLocationInformationEUTRA
=
ieEUTRA
;
user_location_information_eutra_
.
value
().
encode
(
ie_eutra
);
user_location_information
->
choice
.
userLocationInformationEUTRA
=
ie_eutra
;
break
;
}
case
Ngap_UserLocationInformation_PR_userLocationInformationNR
:
{
Ngap_UserLocationInformationNR
*
ie
NR
=
Ngap_UserLocationInformationNR
*
ie
_nr
=
(
Ngap_UserLocationInformationNR
*
)
calloc
(
1
,
sizeof
(
Ngap_UserLocationInformationNR
));
user
LocationInformationNR
->
encode2UserLocationInformationNR
(
ieNR
);
user
LocationInformation
->
choice
.
userLocationInformationNR
=
ieNR
;
user
_location_information_nr_
.
value
().
encode
(
ie_nr
);
user
_location_information
->
choice
.
userLocationInformationNR
=
ie_nr
;
break
;
}
#if 0
case Ngap_UserLocationInformation_PR_userLocationInformationN3IWF:{
Ngap_UserLocationInformationN3IWF *ieN3IWF = (Ngap_UserLocationInformationN3IWF *)calloc(1,sizeof(Ngap_UserLocationInformationN3IWF));
userLocationInformationN3IWF->encode2UserLocationInformationN3IWF(ieN3IWF);
userLocationInformation->choice.userLocationInformationN3IWF = ieN3IWF;
break;}
#endif
default:
// cout << "[Warning] UserLocationInformation encode error!" << endl
;
Logger
::
ngap
().
warn
(
"UserLocationInformation encode error!"
)
;
return
false
;
}
return
true
;
}
//------------------------------------------------------------------------------
bool
UserLocationInformation
::
decode
fromUserLocationInformation
(
Ngap_UserLocationInformation_t
*
user
LocationI
nformation
)
{
informationPresent
=
userLocationI
nformation
->
present
;
switch
(
informationPresent
)
{
bool
UserLocationInformation
::
decode
(
Ngap_UserLocationInformation_t
*
user
_location_i
nformation
)
{
present_
=
user_location_i
nformation
->
present
;
switch
(
present_
)
{
case
Ngap_UserLocationInformation_PR_userLocationInformationEUTRA
:
{
userLocationInformationEUTRA
=
new
UserLocationInformationEUTRA
();
userLocationInformationEUTRA
->
decodefromUserLocationInformationEUTRA
(
userLocationInformation
->
choice
.
userLocationInformationEUTRA
);
UserLocationInformationEUTRA
user_location_information_eutra
=
{};
user_location_information_eutra
.
decode
(
user_location_information
->
choice
.
userLocationInformationEUTRA
);
user_location_information_eutra_
=
std
::
optional
<
UserLocationInformationEUTRA
>
(
user_location_information_eutra
);
break
;
}
case
Ngap_UserLocationInformation_PR_userLocationInformationNR
:
{
userLocationInformationNR
=
new
UserLocationInformationNR
();
userLocationInformationNR
->
decodefromUserLocationInformationNR
(
userLocationInformation
->
choice
.
userLocationInformationNR
);
UserLocationInformationNR
user_location_information_nr
=
{};
user_location_information_nr
.
decode
(
user_location_information
->
choice
.
userLocationInformationNR
);
user_location_information_nr_
=
std
::
optional
<
UserLocationInformationNR
>
(
user_location_information_nr
);
break
;
}
#if 0
case Ngap_UserLocationInformation_PR_userLocationInformationN3IWF:{
userLocationInformationN3IWF = new UserLocationInformationN3IWF();
userLocationInformationN3IWF->decodefromUserLocationInformationN3IWF(userLocationInformation->choice.userLocationInformationN3IWF);
break;}
#endif
default:
// cout << "[Warning] UserLocationInformation decode error!" << endl
;
Logger
::
ngap
().
warn
(
"UserLocationInformation decode error!"
)
;
return
false
;
}
return
true
;
}
//------------------------------------------------------------------------------
Ngap_UserLocationInformation_PR
UserLocationInformation
::
getChoiceOfUserLocationInformation
()
{
return
informationPresent
;
}
//------------------------------------------------------------------------------
void
UserLocationInformation
::
getInformation
(
UserLocationInformationEUTRA
*&
informationEUTRA
)
{
informationEUTRA
=
userLocationInformationEUTRA
;
}
//------------------------------------------------------------------------------
void
UserLocationInformation
::
getInformation
(
UserLocationInformationNR
*&
informationNR
)
{
informationNR
=
userLocationInformationNR
;
}
#if 0
void UserLocationInformation::getInformation(UserLocationInformationN3IWF* &informationN3IWF)
{
informationN3IWF = userLocationInformationN3IWF;
}
#endif
}
// namespace ngap
src/ngap/ngapIEs/UserLocationInformation.hpp
View file @
4fa4f831
...
...
@@ -26,6 +26,8 @@
#include "UserLocationInformationN3IWF.hpp"
#include "UserLocationInformationNR.hpp"
#include <optional>
extern
"C"
{
#include "Ngap_UserLocationInformation.h"
}
...
...
@@ -36,25 +38,23 @@ class UserLocationInformation {
UserLocationInformation
();
virtual
~
UserLocationInformation
();
void
setInformation
(
UserLocationInformationEUTRA
*
);
void
getInformation
(
UserLocationInformationEUTRA
*
&
);
void
setInformation
(
const
UserLocationInformationEUTRA
&
);
bool
getInformation
(
UserLocationInformationEUTRA
&
);
void
setInformation
(
UserLocationInformationNR
*
);
void
getInformation
(
UserLocationInformationNR
*
&
);
void
setInformation
(
const
UserLocationInformationNR
&
);
bool
getInformation
(
UserLocationInformationNR
&
);
// void setInformation(
UserLocationInformationN3IWF*
);
// void getInformation(UserLocationInformationN3IWF
*
&);
// void setInformation(
const UserLocationInformationN3IWF&
);
// void getInformation(UserLocationInformationN3IWF&);
bool
encodefromUserLocationInformation
(
Ngap_UserLocationInformation_t
*
userLocationInformation
);
bool
decodefromUserLocationInformation
(
Ngap_UserLocationInformation_t
*
userLocationInformation
);
bool
encode
(
Ngap_UserLocationInformation_t
*
user_location_information
);
bool
decode
(
Ngap_UserLocationInformation_t
*
user_location_information
);
Ngap_UserLocationInformation_PR
getChoiceOfUserLocationInformation
();
private:
Ngap_UserLocationInformation_PR
informationPresent
;
UserLocationInformationEUTRA
*
userLocationInformationEUTRA
;
UserLocationInformationNR
*
userLocationInformationNR
;
Ngap_UserLocationInformation_PR
present_
;
std
::
optional
<
UserLocationInformationEUTRA
>
user_location_information_eutra_
;
std
::
optional
<
UserLocationInformationNR
>
user_location_information_nr_
;
// TODO: UserLocationInformationN3IWF *userLocationInformationN3IWF;
};
...
...
src/ngap/ngapIEs/UserLocationInformationEUTRA.cpp
View file @
4fa4f831
...
...
@@ -31,70 +31,44 @@ UserLocationInformationEUTRA::UserLocationInformationEUTRA() {}
UserLocationInformationEUTRA
::~
UserLocationInformationEUTRA
()
{}
//------------------------------------------------------------------------------
void
UserLocationInformationEUTRA
::
set
InformationEUTRA
(
void
UserLocationInformationEUTRA
::
set
(
const
EUTRA_CGI
&
m_eUTRA_CGI
,
const
TAI
&
m_tAI
)
{
eUTRA_CGI
=
m_eUTRA_CGI
;
tAI
=
m_tAI
;
}
//------------------------------------------------------------------------------
bool
UserLocationInformationEUTRA
::
encode2UserLocationInformationEUTRA
(
Ngap_UserLocationInformationEUTRA_t
*
userLocationInformationEUTRA
)
{
if
(
!
eUTRA_CGI
.
encode
(
userLocationInformationEUTRA
->
eUTRA_CGI
))
{
void
UserLocationInformationEUTRA
::
get
(
EUTRA_CGI
&
m_eUTRA_CGI
,
TAI
&
m_tAI
)
{
m_eUTRA_CGI
=
eUTRA_CGI
;
m_tAI
=
tAI
;
}
//------------------------------------------------------------------------------
bool
UserLocationInformationEUTRA
::
encode
(
Ngap_UserLocationInformationEUTRA_t
*
user_location_info_eutra
)
{
if
(
!
eUTRA_CGI
.
encode
(
user_location_info_eutra
->
eUTRA_CGI
))
{
Logger
::
ngap
().
warn
(
"Encode eUTRA_CGI IE error"
);
return
false
;
}
if
(
!
tAI
.
encode
(
&
user
LocationInformationEUTRA
->
tAI
))
{
if
(
!
tAI
.
encode
(
&
user
_location_info_eutra
->
tAI
))
{
Logger
::
ngap
().
warn
(
"Encode TAI IE error"
);
return
false
;
}
#if 0
if(istimeStampSet)
{
Ngap_TimeStamp_t *ieTimeStamp = (Ngap_TimeStamp_t *)calloc(1,sizeof(Ngap_TimeStamp_t));
if(!timeStamp->encodefromTimeStamp(ieTimeStamp))
{
cout<<"[Warning] timeStamp->encodefromTimeStamp() error!"<<endl;
free(ieTimeStamp);
return false;
}
userLocationInformationEUTRA->timeStamp = ieTimeStamp;
}
#endif
return
true
;
}
//------------------------------------------------------------------------------
bool
UserLocationInformationEUTRA
::
decode
fromUserLocationInformationEUTRA
(
Ngap_UserLocationInformationEUTRA_t
*
user
LocationInformationEUTRA
)
{
if
(
!
eUTRA_CGI
.
decode
(
user
LocationInformationEUTRA
->
eUTRA_CGI
))
{
bool
UserLocationInformationEUTRA
::
decode
(
Ngap_UserLocationInformationEUTRA_t
*
user
_location_info_eutra
)
{
if
(
!
eUTRA_CGI
.
decode
(
user
_location_info_eutra
->
eUTRA_CGI
))
{
Logger
::
ngap
().
warn
(
"Decode eUTRA_CGI IE error"
);
return
false
;
}
if
(
!
tAI
.
decode
(
&
user
LocationInformationEUTRA
->
tAI
))
{
if
(
!
tAI
.
decode
(
&
user
_location_info_eutra
->
tAI
))
{
Logger
::
ngap
().
warn
(
"Decode TAI IE error"
);
return
false
;
}
#if 0
if(userLocationInformationEUTRA->timeStamp)
{
istimeStampSet = true;
timeStamp = new TimeStamp();
if(!timeStamp->decodefromTimeStamp(userLocationInformationEUTRA->timeStamp))
{
cout<<"[Warning] timeStamp->decodefromTimeStamp() error!"<<endl;
return false;
}
}
#endif
return
true
;
}
//------------------------------------------------------------------------------
void
UserLocationInformationEUTRA
::
getInformationEUTRA
(
EUTRA_CGI
&
m_eUTRA_CGI
,
TAI
&
m_tAI
)
{
m_eUTRA_CGI
=
eUTRA_CGI
;
m_tAI
=
tAI
;
}
}
// namespace ngap
src/ngap/ngapIEs/UserLocationInformationEUTRA.hpp
View file @
4fa4f831
...
...
@@ -36,15 +36,13 @@ class UserLocationInformationEUTRA {
UserLocationInformationEUTRA
();
virtual
~
UserLocationInformationEUTRA
();
void
set
InformationEUTRA
(
const
EUTRA_CGI
&
m_eUTRA_CGI
,
const
TAI
&
m_tAI
);
void
get
InformationEUTRA
(
EUTRA_CGI
&
m_eUTRA_CGI
,
TAI
&
m_tAI
);
void
set
(
const
EUTRA_CGI
&
m_eUTRA_CGI
,
const
TAI
&
m_tAI
);
void
get
(
EUTRA_CGI
&
m_eUTRA_CGI
,
TAI
&
m_tAI
);
// bool getTimeStampPresence();
bool
encode2UserLocationInformationEUTRA
(
Ngap_UserLocationInformationEUTRA_t
*
userLocationInformation
);
bool
decodefromUserLocationInformationEUTRA
(
Ngap_UserLocationInformationEUTRA_t
*
userLocationInformation
);
bool
encode
(
Ngap_UserLocationInformationEUTRA_t
*
userLocationInformation
);
bool
decode
(
Ngap_UserLocationInformationEUTRA_t
*
userLocationInformation
);
private:
EUTRA_CGI
eUTRA_CGI
;
// Mandatory
...
...
src/ngap/ngapIEs/UserLocationInformationNR.cpp
View file @
4fa4f831
...
...
@@ -30,62 +30,38 @@ UserLocationInformationNR::UserLocationInformationNR() {}
UserLocationInformationNR
::~
UserLocationInformationNR
()
{}
//------------------------------------------------------------------------------
void
UserLocationInformationNR
::
setInformationNR
(
const
NR_CGI
&
m_nR_CGI
,
const
TAI
&
m_tAI
)
{
void
UserLocationInformationNR
::
set
(
const
NR_CGI
&
m_nR_CGI
,
const
TAI
&
m_tAI
)
{
nR_CGI
=
m_nR_CGI
;
tAI
=
m_tAI
;
}
//------------------------------------------------------------------------------
bool
UserLocationInformationNR
::
encode
2UserLocationInformationNR
(
Ngap_UserLocationInformationNR_t
*
user
LocationInformationNR
)
{
if
(
!
nR_CGI
.
encode2NR_CGI
(
&
user
LocationInformationNR
->
nR_CGI
))
{
bool
UserLocationInformationNR
::
encode
(
Ngap_UserLocationInformationNR_t
*
user
_location_info_nr
)
{
if
(
!
nR_CGI
.
encode2NR_CGI
(
&
user
_location_info_nr
->
nR_CGI
))
{
return
false
;
}
if
(
!
tAI
.
encode
(
&
user
LocationInformationNR
->
tAI
))
{
if
(
!
tAI
.
encode
(
&
user
_location_info_nr
->
tAI
))
{
return
false
;
}
#if 0
if(istimeStampSet)
{
Ngap_TimeStamp_t *ieTimeStamp = (Ngap_TimeStamp_t *)calloc(1,sizeof(Ngap_TimeStamp_t));
if(!timeStamp->encodefromTimeStamp(ieTimeStamp))
{
free(ieTimeStamp);
return false;
}
userLocationInformationEUTRA->timeStamp = ieTimeStamp;
}
#endif
return
true
;
}
//------------------------------------------------------------------------------
bool
UserLocationInformationNR
::
decode
fromUserLocationInformationNR
(
Ngap_UserLocationInformationNR_t
*
user
LocationInformationNR
)
{
if
(
!
nR_CGI
.
decodefromNR_CGI
(
&
user
LocationInformationNR
->
nR_CGI
))
{
bool
UserLocationInformationNR
::
decode
(
Ngap_UserLocationInformationNR_t
*
user
_location_info_nr
)
{
if
(
!
nR_CGI
.
decodefromNR_CGI
(
&
user
_location_info_nr
->
nR_CGI
))
{
return
false
;
}
if
(
!
tAI
.
decode
(
&
user
LocationInformationNR
->
tAI
))
{
if
(
!
tAI
.
decode
(
&
user
_location_info_nr
->
tAI
))
{
return
false
;
}
#if 0
if(userLocationInformationEUTRA->timeStamp)
{
istimeStampSet = true;
timeStamp = new TimeStamp();
if(!timeStamp->decodefromTimeStamp(userLocationInformationEUTRA->timeStamp))
{
return false;
}
}
#endif
return
true
;
}
//------------------------------------------------------------------------------
void
UserLocationInformationNR
::
get
InformationNR
(
NR_CGI
&
m_nR_CGI
,
TAI
&
m_tAI
)
{
void
UserLocationInformationNR
::
get
(
NR_CGI
&
m_nR_CGI
,
TAI
&
m_tAI
)
{
m_nR_CGI
=
nR_CGI
;
m_tAI
=
tAI
;
}
...
...
src/ngap/ngapIEs/UserLocationInformationNR.hpp
View file @
4fa4f831
...
...
@@ -35,11 +35,11 @@ class UserLocationInformationNR {
UserLocationInformationNR
();
virtual
~
UserLocationInformationNR
();
void
set
InformationNR
(
const
NR_CGI
&
,
const
TAI
&
);
void
get
InformationNR
(
NR_CGI
&
,
TAI
&
);
void
set
(
const
NR_CGI
&
,
const
TAI
&
);
void
get
(
NR_CGI
&
,
TAI
&
);
bool
encode
2UserLocationInformationNR
(
Ngap_UserLocationInformationNR_t
*
);
bool
decode
fromUserLocationInformationNR
(
Ngap_UserLocationInformationNR_t
*
);
bool
encode
(
Ngap_UserLocationInformationNR_t
*
);
bool
decode
(
Ngap_UserLocationInformationNR_t
*
);
private:
NR_CGI
nR_CGI
;
// Mandatory
...
...
src/ngap/ngapMsgs/HandoverNotifyMsg.cpp
View file @
4fa4f831
...
...
@@ -88,13 +88,13 @@ void HandoverNotifyMsg::setRanUeNgapId(const uint32_t& ran_ue_ngap_id) {
//------------------------------------------------------------------------------
void
HandoverNotifyMsg
::
setUserLocationInfoNR
(
const
NrCgi_t
&
cig
,
const
Tai_t
&
tai
)
{
UserLocationInformationNR
*
informationNR
=
new
UserLocationInformationNR
()
;
UserLocationInformationNR
information_nr
=
{}
;
NR_CGI
nR_CGI
=
{};
nR_CGI
.
setNR_CGI
(
cig
.
mcc
,
cig
.
mnc
,
cig
.
nrCellID
);
TAI
tai_nr
=
{};
tai_nr
.
setTAI
(
tai
);
information
NR
->
setInformationNR
(
nR_CGI
,
tai_nr
);
userLocationInformation
.
setInformation
(
information
NR
);
information
_nr
.
set
(
nR_CGI
,
tai_nr
);
userLocationInformation
.
setInformation
(
information
_nr
);
Ngap_HandoverNotifyIEs_t
*
ie
=
(
Ngap_HandoverNotifyIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverNotifyIEs_t
));
...
...
@@ -102,8 +102,8 @@ void HandoverNotifyMsg::setUserLocationInfoNR(
ie
->
criticality
=
Ngap_Criticality_ignore
;
ie
->
value
.
present
=
Ngap_HandoverNotifyIEs__value_PR_UserLocationInformation
;
int
ret
=
userLocationInformation
.
encodefromUserLocationInformation
(
&
ie
->
value
.
choice
.
UserLocationInformation
);
int
ret
=
userLocationInformation
.
encode
(
&
ie
->
value
.
choice
.
UserLocationInformation
);
if
(
!
ret
)
{
Logger
::
ngap
().
error
(
"Encode UserLocationInformation IE error"
);
free_wrapper
((
void
**
)
&
ie
);
...
...
@@ -116,9 +116,8 @@ void HandoverNotifyMsg::setUserLocationInfoNR(
//------------------------------------------------------------------------------
bool
HandoverNotifyMsg
::
getUserLocationInfoNR
(
NrCgi_t
&
cig
,
Tai_t
&
tai
)
{
UserLocationInformationNR
*
informationNR
=
nullptr
;
userLocationInformation
.
getInformation
(
informationNR
);
if
(
!
informationNR
)
return
false
;
UserLocationInformationNR
information_nr
=
{};
if
(
!
userLocationInformation
.
getInformation
(
information_nr
))
return
false
;
if
(
userLocationInformation
.
getChoiceOfUserLocationInformation
()
!=
Ngap_UserLocationInformation_PR_userLocationInformationNR
)
...
...
@@ -126,7 +125,7 @@ bool HandoverNotifyMsg::getUserLocationInfoNR(NrCgi_t& cig, Tai_t& tai) {
NR_CGI
nR_CGI
=
{};
TAI
nR_TAI
=
{};
information
NR
->
getInformationNR
(
nR_CGI
,
nR_TAI
);
information
_nr
.
get
(
nR_CGI
,
nR_TAI
);
nR_CGI
.
getNR_CGI
(
cig
);
nR_TAI
.
getTAI
(
tai
);
...
...
@@ -198,7 +197,7 @@ bool HandoverNotifyMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
*/
if
(
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverNotifyIEs__value_PR_UserLocationInformation
)
{
if
(
!
userLocationInformation
.
decode
fromUserLocationInformation
(
if
(
!
userLocationInformation
.
decode
(
&
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
UserLocationInformation
))
{
Logger
::
ngap
().
error
(
...
...
src/ngap/ngapMsgs/InitialUEMessage.cpp
View file @
4fa4f831
...
...
@@ -95,14 +95,14 @@ void InitialUEMessageMsg::setNasPdu(uint8_t* nas, size_t size) {
//------------------------------------------------------------------------------
void
InitialUEMessageMsg
::
setUserLocationInfoNR
(
const
struct
NrCgi_s
&
cig
,
const
struct
Tai_s
&
tai
)
{
UserLocationInformationNR
*
informationNR
=
new
UserLocationInformationNR
()
;
NR_CGI
nR_CGI
=
{};
UserLocationInformationNR
information_nr
;
NR_CGI
nR_CGI
=
{};
nR_CGI
.
setNR_CGI
(
cig
.
mcc
,
cig
.
mnc
,
cig
.
nrCellID
);
TAI
tai_nr
=
{};
tai_nr
.
setTAI
(
tai
);
information
NR
->
setInformationNR
(
nR_CGI
,
tai_nr
);
userLocationInformation
.
setInformation
(
information
NR
);
information
_nr
.
set
(
nR_CGI
,
tai_nr
);
userLocationInformation
.
setInformation
(
information
_nr
);
Ngap_InitialUEMessage_IEs_t
*
ie
=
(
Ngap_InitialUEMessage_IEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_InitialUEMessage_IEs_t
));
...
...
@@ -111,8 +111,8 @@ void InitialUEMessageMsg::setUserLocationInfoNR(
ie
->
value
.
present
=
Ngap_InitialUEMessage_IEs__value_PR_UserLocationInformation
;
int
ret
=
userLocationInformation
.
encodefromUserLocationInformation
(
&
ie
->
value
.
choice
.
UserLocationInformation
);
int
ret
=
userLocationInformation
.
encode
(
&
ie
->
value
.
choice
.
UserLocationInformation
);
if
(
!
ret
)
{
Logger
::
ngap
().
error
(
"Encode UserLocationInformation IE error"
);
free_wrapper
((
void
**
)
&
ie
);
...
...
@@ -234,7 +234,7 @@ bool InitialUEMessageMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
Ngap_Criticality_reject
&&
initialUEMessageIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_InitialUEMessage_IEs__value_PR_UserLocationInformation
)
{
if
(
!
userLocationInformation
.
decode
fromUserLocationInformation
(
if
(
!
userLocationInformation
.
decode
(
&
initialUEMessageIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
UserLocationInformation
))
{
Logger
::
ngap
().
error
(
...
...
@@ -322,14 +322,14 @@ bool InitialUEMessageMsg::getNasPdu(uint8_t*& nas, size_t& size) {
//------------------------------------------------------------------------------
bool
InitialUEMessageMsg
::
getUserLocationInfoNR
(
struct
NrCgi_s
&
cig
,
struct
Tai_s
&
tai
)
{
UserLocationInformationNR
*
informationNR
;
userLocationInformation
.
getInformation
(
information
NR
);
UserLocationInformationNR
information_nr
=
{}
;
userLocationInformation
.
getInformation
(
information
_nr
);
if
(
userLocationInformation
.
getChoiceOfUserLocationInformation
()
!=
Ngap_UserLocationInformation_PR_userLocationInformationNR
)
return
false
;
NR_CGI
nR_CGI
=
{};
TAI
nR_TAI
=
{};
information
NR
->
getInformationNR
(
nR_CGI
,
nR_TAI
);
information
_nr
.
get
(
nR_CGI
,
nR_TAI
);
nR_CGI
.
getNR_CGI
(
cig
);
nR_TAI
.
getTAI
(
tai
);
...
...
src/ngap/ngapMsgs/PduSessionResourceReleaseResponse.cpp
View file @
4fa4f831
...
...
@@ -172,13 +172,13 @@ void PduSessionResourceReleaseResponseMsg::setUserLocationInfoNR(
if
(
!
userLocationInformation
)
userLocationInformation
=
new
UserLocationInformation
();
UserLocationInformationNR
*
informationNR
=
new
UserLocationInformationNR
()
;
UserLocationInformationNR
information_nr
=
{}
;
NR_CGI
nR_CGI
=
{};
TAI
tai_nr
=
{};
nR_CGI
.
setNR_CGI
(
cig
.
mcc
,
cig
.
mnc
,
cig
.
nrCellID
);
tai_nr
.
setTAI
(
tai
);
information
NR
->
setInformationNR
(
nR_CGI
,
tai_nr
);
userLocationInformation
->
setInformation
(
information
NR
);
information
_nr
.
set
(
nR_CGI
,
tai_nr
);
userLocationInformation
->
setInformation
(
information
_nr
);
Ngap_PDUSessionResourceReleaseResponseIEs_t
*
ie
=
(
Ngap_PDUSessionResourceReleaseResponseIEs_t
*
)
calloc
(
...
...
@@ -188,7 +188,7 @@ void PduSessionResourceReleaseResponseMsg::setUserLocationInfoNR(
ie
->
value
.
present
=
Ngap_PDUSessionResourceReleaseResponseIEs__value_PR_UserLocationInformation
;
int
ret
=
userLocationInformation
->
encode
fromUserLocationInformation
(
int
ret
=
userLocationInformation
->
encode
(
&
ie
->
value
.
choice
.
UserLocationInformation
);
if
(
!
ret
)
{
Logger
::
nas_mm
().
warn
(
"Encode UserLocationInformation IE error"
);
...
...
@@ -206,14 +206,15 @@ void PduSessionResourceReleaseResponseMsg::setUserLocationInfoNR(
//------------------------------------------------------------------------------
bool
PduSessionResourceReleaseResponseMsg
::
getUserLocationInfoNR
(
NrCgi_t
&
cig
,
Tai_t
&
tai
)
{
UserLocationInformationNR
*
informationNR
;
userLocationInformation
->
getInformation
(
informationNR
);
UserLocationInformationNR
information_nr
=
{};
if
(
!
userLocationInformation
->
getInformation
(
information_nr
))
return
false
;
if
(
userLocationInformation
->
getChoiceOfUserLocationInformation
()
!=
Ngap_UserLocationInformation_PR_userLocationInformationNR
)
return
false
;
NR_CGI
nR_CGI
=
{};
TAI
nR_TAI
=
{};
information
NR
->
getInformationNR
(
nR_CGI
,
nR_TAI
);
information
_nr
.
get
(
nR_CGI
,
nR_TAI
);
PlmnId
cgi_plmnId
=
{};
NRCellIdentity
nRCellIdentity
=
{};
nR_CGI
.
getNR_CGI
(
cig
);
...
...
src/ngap/ngapMsgs/UEContextReleaseComplete.cpp
View file @
4fa4f831
...
...
@@ -93,14 +93,14 @@ void UEContextReleaseCompleteMsg::setUserLocationInfoNR(
if
(
!
userLocationInformation
)
userLocationInformation
=
new
UserLocationInformation
();
UserLocationInformationNR
*
informationNR
=
new
UserLocationInformationNR
()
;
UserLocationInformationNR
information_nr
=
{}
;
NR_CGI
nR_CGI
=
{};
nR_CGI
.
setNR_CGI
(
cig
.
mcc
,
cig
.
mnc
,
cig
.
nrCellID
);
TAI
tai_nr
=
{};
tai_nr
.
setTAI
(
tai
);
information
NR
->
setInformationNR
(
nR_CGI
,
tai_nr
);
userLocationInformation
->
setInformation
(
information
NR
);
information
_nr
.
set
(
nR_CGI
,
tai_nr
);
userLocationInformation
->
setInformation
(
information
_nr
);
Ngap_UEContextReleaseComplete_IEs
*
ie
=
(
Ngap_UEContextReleaseComplete_IEs
*
)
calloc
(
...
...
@@ -110,7 +110,7 @@ void UEContextReleaseCompleteMsg::setUserLocationInfoNR(
ie
->
value
.
present
=
Ngap_UEContextReleaseComplete_IEs__value_PR_UserLocationInformation
;
int
ret
=
userLocationInformation
->
encode
fromUserLocationInformation
(
int
ret
=
userLocationInformation
->
encode
(
&
ie
->
value
.
choice
.
UserLocationInformation
);
if
(
!
ret
)
{
Logger
::
ngap
().
error
(
"Encode NGAP UserLocationInformation IE error"
);
...
...
@@ -126,12 +126,12 @@ void UEContextReleaseCompleteMsg::setUserLocationInfoNR(
void
UEContextReleaseCompleteMsg
::
getUserLocationInfoNR
(
NrCgi_t
&
cig
,
Tai_t
&
tai
)
{
if
(
userLocationInformation
)
{
UserLocationInformationNR
*
informationNR
=
new
UserLocationInformationNR
()
;
userLocationInformation
->
getInformation
(
informationNR
)
;
UserLocationInformationNR
information_nr
=
{}
;
if
(
!
userLocationInformation
->
getInformation
(
information_nr
))
return
;
NR_CGI
nR_CGI
=
{};
TAI
tai_nr
=
{};
information
NR
->
getInformationNR
(
nR_CGI
,
tai_nr
);
information
_nr
.
get
(
nR_CGI
,
tai_nr
);
PlmnId
plmnId_cgi
=
{};
NRCellIdentity
nRCellIdentity
=
{};
...
...
src/ngap/ngapMsgs/UplinkNASTransport.cpp
View file @
4fa4f831
...
...
@@ -118,14 +118,14 @@ bool UplinkNASTransportMsg::getNasPdu(uint8_t*& nas, size_t& sizeofnas) {
//------------------------------------------------------------------------------
void
UplinkNASTransportMsg
::
setUserLocationInfoNR
(
const
NrCgi_t
&
cig
,
const
Tai_t
&
tai
)
{
UserLocationInformationNR
*
informationNR
=
new
UserLocationInformationNR
()
;
NR_CGI
nR_CGI
=
{};
TAI
tai_nr
=
{};
UserLocationInformationNR
information_nr
;
NR_CGI
nR_CGI
=
{};
TAI
tai_nr
=
{};
nR_CGI
.
setNR_CGI
(
cig
);
tai_nr
.
setTAI
(
tai
);
information
NR
->
setInformationNR
(
nR_CGI
,
tai_nr
);
userLocationInformation
.
setInformation
(
information
NR
);
information
_nr
.
set
(
nR_CGI
,
tai_nr
);
userLocationInformation
.
setInformation
(
information
_nr
);
Ngap_UplinkNASTransport_IEs_t
*
ie
=
(
Ngap_UplinkNASTransport_IEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_UplinkNASTransport_IEs_t
));
...
...
@@ -134,8 +134,8 @@ void UplinkNASTransportMsg::setUserLocationInfoNR(
ie
->
value
.
present
=
Ngap_UplinkNASTransport_IEs__value_PR_UserLocationInformation
;
int
ret
=
userLocationInformation
.
encodefromUserLocationInformation
(
&
ie
->
value
.
choice
.
UserLocationInformation
);
int
ret
=
userLocationInformation
.
encode
(
&
ie
->
value
.
choice
.
UserLocationInformation
);
if
(
!
ret
)
{
Logger
::
ngap
().
error
(
"Encode NGAP UserLocationInformation IE error"
);
free_wrapper
((
void
**
)
&
ie
);
...
...
@@ -149,14 +149,16 @@ void UplinkNASTransportMsg::setUserLocationInfoNR(
//------------------------------------------------------------------------------
bool
UplinkNASTransportMsg
::
getUserLocationInfoNR
(
NrCgi_t
&
cig
,
Tai_t
&
tai
)
{
UserLocationInformationNR
*
informationNR
;
userLocationInformation
.
getInformation
(
informationNR
);
UserLocationInformationNR
information_nr
=
{};
if
(
!
userLocationInformation
.
getInformation
(
information_nr
))
return
false
;
if
(
userLocationInformation
.
getChoiceOfUserLocationInformation
()
!=
Ngap_UserLocationInformation_PR_userLocationInformationNR
)
return
false
;
NR_CGI
nR_CGI
=
{};
TAI
nR_TAI
=
{};
information
NR
->
getInformationNR
(
nR_CGI
,
nR_TAI
);
information
_nr
.
get
(
nR_CGI
,
nR_TAI
);
nR_CGI
.
getNR_CGI
(
cig
);
nR_TAI
.
getTAI
(
tai
);
...
...
@@ -239,7 +241,7 @@ bool UplinkNASTransportMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
Ngap_Criticality_ignore
&&
uplinkNASTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_UplinkNASTransport_IEs__value_PR_UserLocationInformation
)
{
if
(
!
userLocationInformation
.
decode
fromUserLocationInformation
(
if
(
!
userLocationInformation
.
decode
(
&
uplinkNASTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
UserLocationInformation
))
{
Logger
::
ngap
().
error
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment