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
Show 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 @@
...
@@ -21,130 +21,114 @@
#include "UserLocationInformation.hpp"
#include "UserLocationInformation.hpp"
#include "logger.hpp"
namespace
ngap
{
namespace
ngap
{
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
UserLocationInformation
::
UserLocationInformation
()
{
UserLocationInformation
::
UserLocationInformation
()
{
userLocationInformationEUTRA
=
nullptr
;
present_
=
Ngap_UserLocationInformation_PR_NOTHING
;
userLocationInformationNR
=
nullptr
;
user_location_information_eutra_
=
std
::
nullopt
;
// userLocationInformationN3IWF = nullptr;
user_location_information_nr_
=
std
::
nullopt
;
// userLocationInformationN3IWF = std::nullopt;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
UserLocationInformation
::~
UserLocationInformation
()
{}
UserLocationInformation
::~
UserLocationInformation
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
UserLocationInformation
::
setInformation
(
Ngap_UserLocationInformation_PR
UserLocationInformationEUTRA
*
informationEUTRA
)
{
UserLocationInformation
::
getChoiceOfUserLocationInformation
()
{
informationPresent
=
return
present_
;
Ngap_UserLocationInformation_PR_userLocationInformationEUTRA
;
}
userLocationInformationEUTRA
=
informationEUTRA
;
//------------------------------------------------------------------------------
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
(
void
UserLocationInformation
::
setInformation
(
UserLocationInformationNR
*
informationNR
)
{
const
UserLocationInformationEUTRA
&
information_eutra
)
{
informationPresent
=
present_
=
Ngap_UserLocationInformation_PR_userLocationInformationEUTRA
;
Ngap_UserLocationInformation_PR_userLocationInformationNR
;
user_location_information_eutra_
=
userLocationInformationNR
=
informationNR
;
std
::
optional
<
UserLocationInformationEUTRA
>
(
information_eutra
)
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#if 0
bool
UserLocationInformation
::
getInformation
(
void UserLocationInformation::setInformation(UserLocationInformationN3IWF* informationN3IWF)
UserLocationInformationNR
&
information_nr
)
{
{
if
(
!
user_location_information_nr_
.
has_value
())
return
false
;
informationPresent = Ngap_UserLocationInformation_PR_userLocationInformationN3IWF;
information_nr
=
user_location_information_nr_
.
value
();
userLocationInformationN3IWF = informationN3IWF;
return
true
;
}
}
#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
(
bool
UserLocationInformation
::
encode
(
Ngap_UserLocationInformation_t
*
user
LocationI
nformation
)
{
Ngap_UserLocationInformation_t
*
user
_location_i
nformation
)
{
user
LocationInformation
->
present
=
informationPresent
;
user
_location_information
->
present
=
present_
;
switch
(
informationPresent
)
{
switch
(
present_
)
{
case
Ngap_UserLocationInformation_PR_userLocationInformationEUTRA
:
{
case
Ngap_UserLocationInformation_PR_userLocationInformationEUTRA
:
{
Ngap_UserLocationInformationEUTRA
*
ie
EUTRA
=
Ngap_UserLocationInformationEUTRA
*
ie
_eutra
=
(
Ngap_UserLocationInformationEUTRA
*
)
calloc
(
(
Ngap_UserLocationInformationEUTRA
*
)
calloc
(
1
,
sizeof
(
Ngap_UserLocationInformationEUTRA
));
1
,
sizeof
(
Ngap_UserLocationInformationEUTRA
));
userLocationInformationEUTRA
->
encode2UserLocationInformationEUTRA
(
user_location_information_eutra_
.
value
().
encode
(
ie_eutra
);
ieEUTRA
);
user_location_information
->
choice
.
userLocationInformationEUTRA
=
ie_eutra
;
userLocationInformation
->
choice
.
userLocationInformationEUTRA
=
ieEUTRA
;
break
;
break
;
}
}
case
Ngap_UserLocationInformation_PR_userLocationInformationNR
:
{
case
Ngap_UserLocationInformation_PR_userLocationInformationNR
:
{
Ngap_UserLocationInformationNR
*
ie
NR
=
Ngap_UserLocationInformationNR
*
ie
_nr
=
(
Ngap_UserLocationInformationNR
*
)
calloc
(
(
Ngap_UserLocationInformationNR
*
)
calloc
(
1
,
sizeof
(
Ngap_UserLocationInformationNR
));
1
,
sizeof
(
Ngap_UserLocationInformationNR
));
user
LocationInformationNR
->
encode2UserLocationInformationNR
(
ieNR
);
user
_location_information_nr_
.
value
().
encode
(
ie_nr
);
user
LocationInformation
->
choice
.
userLocationInformationNR
=
ieNR
;
user
_location_information
->
choice
.
userLocationInformationNR
=
ie_nr
;
break
;
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:
default:
// cout << "[Warning] UserLocationInformation encode error!" << endl
;
Logger
::
ngap
().
warn
(
"UserLocationInformation encode error!"
)
;
return
false
;
return
false
;
}
}
return
true
;
return
true
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
UserLocationInformation
::
decode
fromUserLocationInformation
(
bool
UserLocationInformation
::
decode
(
Ngap_UserLocationInformation_t
*
user
LocationI
nformation
)
{
Ngap_UserLocationInformation_t
*
user
_location_i
nformation
)
{
informationPresent
=
userLocationI
nformation
->
present
;
present_
=
user_location_i
nformation
->
present
;
switch
(
informationPresent
)
{
switch
(
present_
)
{
case
Ngap_UserLocationInformation_PR_userLocationInformationEUTRA
:
{
case
Ngap_UserLocationInformation_PR_userLocationInformationEUTRA
:
{
userLocationInformationEUTRA
=
new
UserLocationInformationEUTRA
();
UserLocationInformationEUTRA
user_location_information_eutra
=
{};
userLocationInformationEUTRA
->
decodefromUserLocationInformationEUTRA
(
user_location_information_eutra
.
decode
(
userLocationInformation
->
choice
.
userLocationInformationEUTRA
);
user_location_information
->
choice
.
userLocationInformationEUTRA
);
user_location_information_eutra_
=
std
::
optional
<
UserLocationInformationEUTRA
>
(
user_location_information_eutra
);
break
;
break
;
}
}
case
Ngap_UserLocationInformation_PR_userLocationInformationNR
:
{
case
Ngap_UserLocationInformation_PR_userLocationInformationNR
:
{
userLocationInformationNR
=
new
UserLocationInformationNR
();
UserLocationInformationNR
user_location_information_nr
=
{};
userLocationInformationNR
->
decodefromUserLocationInformationNR
(
user_location_information_nr
.
decode
(
userLocationInformation
->
choice
.
userLocationInformationNR
);
user_location_information
->
choice
.
userLocationInformationNR
);
user_location_information_nr_
=
std
::
optional
<
UserLocationInformationNR
>
(
user_location_information_nr
);
break
;
break
;
}
}
#if 0
case Ngap_UserLocationInformation_PR_userLocationInformationN3IWF:{
userLocationInformationN3IWF = new UserLocationInformationN3IWF();
userLocationInformationN3IWF->decodefromUserLocationInformationN3IWF(userLocationInformation->choice.userLocationInformationN3IWF);
break;}
#endif
default:
default:
// cout << "[Warning] UserLocationInformation decode error!" << endl
;
Logger
::
ngap
().
warn
(
"UserLocationInformation decode error!"
)
;
return
false
;
return
false
;
}
}
return
true
;
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
}
// namespace ngap
src/ngap/ngapIEs/UserLocationInformation.hpp
View file @
4fa4f831
...
@@ -26,6 +26,8 @@
...
@@ -26,6 +26,8 @@
#include "UserLocationInformationN3IWF.hpp"
#include "UserLocationInformationN3IWF.hpp"
#include "UserLocationInformationNR.hpp"
#include "UserLocationInformationNR.hpp"
#include <optional>
extern
"C"
{
extern
"C"
{
#include "Ngap_UserLocationInformation.h"
#include "Ngap_UserLocationInformation.h"
}
}
...
@@ -36,25 +38,23 @@ class UserLocationInformation {
...
@@ -36,25 +38,23 @@ class UserLocationInformation {
UserLocationInformation
();
UserLocationInformation
();
virtual
~
UserLocationInformation
();
virtual
~
UserLocationInformation
();
void
setInformation
(
UserLocationInformationEUTRA
*
);
void
setInformation
(
const
UserLocationInformationEUTRA
&
);
void
getInformation
(
UserLocationInformationEUTRA
*
&
);
bool
getInformation
(
UserLocationInformationEUTRA
&
);
void
setInformation
(
UserLocationInformationNR
*
);
void
setInformation
(
const
UserLocationInformationNR
&
);
void
getInformation
(
UserLocationInformationNR
*
&
);
bool
getInformation
(
UserLocationInformationNR
&
);
// void setInformation(
UserLocationInformationN3IWF*
);
// void setInformation(
const UserLocationInformationN3IWF&
);
// void getInformation(UserLocationInformationN3IWF
*
&);
// void getInformation(UserLocationInformationN3IWF&);
bool
encodefromUserLocationInformation
(
bool
encode
(
Ngap_UserLocationInformation_t
*
user_location_information
);
Ngap_UserLocationInformation_t
*
userLocationInformation
);
bool
decode
(
Ngap_UserLocationInformation_t
*
user_location_information
);
bool
decodefromUserLocationInformation
(
Ngap_UserLocationInformation_t
*
userLocationInformation
);
Ngap_UserLocationInformation_PR
getChoiceOfUserLocationInformation
();
Ngap_UserLocationInformation_PR
getChoiceOfUserLocationInformation
();
private:
private:
Ngap_UserLocationInformation_PR
informationPresent
;
Ngap_UserLocationInformation_PR
present_
;
UserLocationInformationEUTRA
*
userLocationInformationEUTRA
;
std
::
optional
<
UserLocationInformationEUTRA
>
user_location_information_eutra_
;
UserLocationInformationNR
*
userLocationInformationNR
;
std
::
optional
<
UserLocationInformationNR
>
user_location_information_nr_
;
// TODO: UserLocationInformationN3IWF *userLocationInformationN3IWF;
// TODO: UserLocationInformationN3IWF *userLocationInformationN3IWF;
};
};
...
...
src/ngap/ngapIEs/UserLocationInformationEUTRA.cpp
View file @
4fa4f831
...
@@ -31,70 +31,44 @@ UserLocationInformationEUTRA::UserLocationInformationEUTRA() {}
...
@@ -31,70 +31,44 @@ UserLocationInformationEUTRA::UserLocationInformationEUTRA() {}
UserLocationInformationEUTRA
::~
UserLocationInformationEUTRA
()
{}
UserLocationInformationEUTRA
::~
UserLocationInformationEUTRA
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
UserLocationInformationEUTRA
::
set
InformationEUTRA
(
void
UserLocationInformationEUTRA
::
set
(
const
EUTRA_CGI
&
m_eUTRA_CGI
,
const
TAI
&
m_tAI
)
{
const
EUTRA_CGI
&
m_eUTRA_CGI
,
const
TAI
&
m_tAI
)
{
eUTRA_CGI
=
m_eUTRA_CGI
;
eUTRA_CGI
=
m_eUTRA_CGI
;
tAI
=
m_tAI
;
tAI
=
m_tAI
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
UserLocationInformationEUTRA
::
encode2UserLocationInformationEUTRA
(
void
UserLocationInformationEUTRA
::
get
(
EUTRA_CGI
&
m_eUTRA_CGI
,
TAI
&
m_tAI
)
{
Ngap_UserLocationInformationEUTRA_t
*
userLocationInformationEUTRA
)
{
m_eUTRA_CGI
=
eUTRA_CGI
;
if
(
!
eUTRA_CGI
.
encode
(
userLocationInformationEUTRA
->
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"
);
Logger
::
ngap
().
warn
(
"Encode eUTRA_CGI IE error"
);
return
false
;
return
false
;
}
}
if
(
!
tAI
.
encode
(
&
user
LocationInformationEUTRA
->
tAI
))
{
if
(
!
tAI
.
encode
(
&
user
_location_info_eutra
->
tAI
))
{
Logger
::
ngap
().
warn
(
"Encode TAI IE error"
);
Logger
::
ngap
().
warn
(
"Encode TAI IE error"
);
return
false
;
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
;
return
true
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
UserLocationInformationEUTRA
::
decode
fromUserLocationInformationEUTRA
(
bool
UserLocationInformationEUTRA
::
decode
(
Ngap_UserLocationInformationEUTRA_t
*
user
LocationInformationEUTRA
)
{
Ngap_UserLocationInformationEUTRA_t
*
user
_location_info_eutra
)
{
if
(
!
eUTRA_CGI
.
decode
(
user
LocationInformationEUTRA
->
eUTRA_CGI
))
{
if
(
!
eUTRA_CGI
.
decode
(
user
_location_info_eutra
->
eUTRA_CGI
))
{
Logger
::
ngap
().
warn
(
"Decode eUTRA_CGI IE error"
);
Logger
::
ngap
().
warn
(
"Decode eUTRA_CGI IE error"
);
return
false
;
return
false
;
}
}
if
(
!
tAI
.
decode
(
&
user
LocationInformationEUTRA
->
tAI
))
{
if
(
!
tAI
.
decode
(
&
user
_location_info_eutra
->
tAI
))
{
Logger
::
ngap
().
warn
(
"Decode TAI IE error"
);
Logger
::
ngap
().
warn
(
"Decode TAI IE error"
);
return
false
;
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
;
return
true
;
}
}
//------------------------------------------------------------------------------
void
UserLocationInformationEUTRA
::
getInformationEUTRA
(
EUTRA_CGI
&
m_eUTRA_CGI
,
TAI
&
m_tAI
)
{
m_eUTRA_CGI
=
eUTRA_CGI
;
m_tAI
=
tAI
;
}
}
// namespace ngap
}
// namespace ngap
src/ngap/ngapIEs/UserLocationInformationEUTRA.hpp
View file @
4fa4f831
...
@@ -36,15 +36,13 @@ class UserLocationInformationEUTRA {
...
@@ -36,15 +36,13 @@ class UserLocationInformationEUTRA {
UserLocationInformationEUTRA
();
UserLocationInformationEUTRA
();
virtual
~
UserLocationInformationEUTRA
();
virtual
~
UserLocationInformationEUTRA
();
void
set
InformationEUTRA
(
const
EUTRA_CGI
&
m_eUTRA_CGI
,
const
TAI
&
m_tAI
);
void
set
(
const
EUTRA_CGI
&
m_eUTRA_CGI
,
const
TAI
&
m_tAI
);
void
get
InformationEUTRA
(
EUTRA_CGI
&
m_eUTRA_CGI
,
TAI
&
m_tAI
);
void
get
(
EUTRA_CGI
&
m_eUTRA_CGI
,
TAI
&
m_tAI
);
// bool getTimeStampPresence();
// bool getTimeStampPresence();
bool
encode2UserLocationInformationEUTRA
(
bool
encode
(
Ngap_UserLocationInformationEUTRA_t
*
userLocationInformation
);
Ngap_UserLocationInformationEUTRA_t
*
userLocationInformation
);
bool
decode
(
Ngap_UserLocationInformationEUTRA_t
*
userLocationInformation
);
bool
decodefromUserLocationInformationEUTRA
(
Ngap_UserLocationInformationEUTRA_t
*
userLocationInformation
);
private:
private:
EUTRA_CGI
eUTRA_CGI
;
// Mandatory
EUTRA_CGI
eUTRA_CGI
;
// Mandatory
...
...
src/ngap/ngapIEs/UserLocationInformationNR.cpp
View file @
4fa4f831
...
@@ -30,62 +30,38 @@ UserLocationInformationNR::UserLocationInformationNR() {}
...
@@ -30,62 +30,38 @@ UserLocationInformationNR::UserLocationInformationNR() {}
UserLocationInformationNR
::~
UserLocationInformationNR
()
{}
UserLocationInformationNR
::~
UserLocationInformationNR
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
UserLocationInformationNR
::
setInformationNR
(
void
UserLocationInformationNR
::
set
(
const
NR_CGI
&
m_nR_CGI
,
const
TAI
&
m_tAI
)
{
const
NR_CGI
&
m_nR_CGI
,
const
TAI
&
m_tAI
)
{
nR_CGI
=
m_nR_CGI
;
nR_CGI
=
m_nR_CGI
;
tAI
=
m_tAI
;
tAI
=
m_tAI
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
UserLocationInformationNR
::
encode
2UserLocationInformationNR
(
bool
UserLocationInformationNR
::
encode
(
Ngap_UserLocationInformationNR_t
*
user
LocationInformationNR
)
{
Ngap_UserLocationInformationNR_t
*
user
_location_info_nr
)
{
if
(
!
nR_CGI
.
encode2NR_CGI
(
&
user
LocationInformationNR
->
nR_CGI
))
{
if
(
!
nR_CGI
.
encode2NR_CGI
(
&
user
_location_info_nr
->
nR_CGI
))
{
return
false
;
return
false
;
}
}
if
(
!
tAI
.
encode
(
&
user
LocationInformationNR
->
tAI
))
{
if
(
!
tAI
.
encode
(
&
user
_location_info_nr
->
tAI
))
{
return
false
;
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
;
return
true
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
UserLocationInformationNR
::
decode
fromUserLocationInformationNR
(
bool
UserLocationInformationNR
::
decode
(
Ngap_UserLocationInformationNR_t
*
user
LocationInformationNR
)
{
Ngap_UserLocationInformationNR_t
*
user
_location_info_nr
)
{
if
(
!
nR_CGI
.
decodefromNR_CGI
(
&
user
LocationInformationNR
->
nR_CGI
))
{
if
(
!
nR_CGI
.
decodefromNR_CGI
(
&
user
_location_info_nr
->
nR_CGI
))
{
return
false
;
return
false
;
}
}
if
(
!
tAI
.
decode
(
&
user
LocationInformationNR
->
tAI
))
{
if
(
!
tAI
.
decode
(
&
user
_location_info_nr
->
tAI
))
{
return
false
;
return
false
;
}
}
#if 0
if(userLocationInformationEUTRA->timeStamp)
{
istimeStampSet = true;
timeStamp = new TimeStamp();
if(!timeStamp->decodefromTimeStamp(userLocationInformationEUTRA->timeStamp))
{
return false;
}
}
#endif
return
true
;
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_nR_CGI
=
nR_CGI
;
m_tAI
=
tAI
;
m_tAI
=
tAI
;
}
}
...
...
src/ngap/ngapIEs/UserLocationInformationNR.hpp
View file @
4fa4f831
...
@@ -35,11 +35,11 @@ class UserLocationInformationNR {
...
@@ -35,11 +35,11 @@ class UserLocationInformationNR {
UserLocationInformationNR
();
UserLocationInformationNR
();
virtual
~
UserLocationInformationNR
();
virtual
~
UserLocationInformationNR
();
void
set
InformationNR
(
const
NR_CGI
&
,
const
TAI
&
);
void
set
(
const
NR_CGI
&
,
const
TAI
&
);
void
get
InformationNR
(
NR_CGI
&
,
TAI
&
);
void
get
(
NR_CGI
&
,
TAI
&
);
bool
encode
2UserLocationInformationNR
(
Ngap_UserLocationInformationNR_t
*
);
bool
encode
(
Ngap_UserLocationInformationNR_t
*
);
bool
decode
fromUserLocationInformationNR
(
Ngap_UserLocationInformationNR_t
*
);
bool
decode
(
Ngap_UserLocationInformationNR_t
*
);
private:
private:
NR_CGI
nR_CGI
;
// Mandatory
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) {
...
@@ -88,13 +88,13 @@ void HandoverNotifyMsg::setRanUeNgapId(const uint32_t& ran_ue_ngap_id) {
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
HandoverNotifyMsg
::
setUserLocationInfoNR
(
void
HandoverNotifyMsg
::
setUserLocationInfoNR
(
const
NrCgi_t
&
cig
,
const
Tai_t
&
tai
)
{
const
NrCgi_t
&
cig
,
const
Tai_t
&
tai
)
{
UserLocationInformationNR
*
informationNR
=
new
UserLocationInformationNR
()
;
UserLocationInformationNR
information_nr
=
{}
;
NR_CGI
nR_CGI
=
{};
NR_CGI
nR_CGI
=
{};
nR_CGI
.
setNR_CGI
(
cig
.
mcc
,
cig
.
mnc
,
cig
.
nrCellID
);
nR_CGI
.
setNR_CGI
(
cig
.
mcc
,
cig
.
mnc
,
cig
.
nrCellID
);
TAI
tai_nr
=
{};
TAI
tai_nr
=
{};
tai_nr
.
setTAI
(
tai
);
tai_nr
.
setTAI
(
tai
);
information
NR
->
setInformationNR
(
nR_CGI
,
tai_nr
);
information
_nr
.
set
(
nR_CGI
,
tai_nr
);
userLocationInformation
.
setInformation
(
information
NR
);
userLocationInformation
.
setInformation
(
information
_nr
);
Ngap_HandoverNotifyIEs_t
*
ie
=
Ngap_HandoverNotifyIEs_t
*
ie
=
(
Ngap_HandoverNotifyIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverNotifyIEs_t
));
(
Ngap_HandoverNotifyIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverNotifyIEs_t
));
...
@@ -102,8 +102,8 @@ void HandoverNotifyMsg::setUserLocationInfoNR(
...
@@ -102,8 +102,8 @@ void HandoverNotifyMsg::setUserLocationInfoNR(
ie
->
criticality
=
Ngap_Criticality_ignore
;
ie
->
criticality
=
Ngap_Criticality_ignore
;
ie
->
value
.
present
=
Ngap_HandoverNotifyIEs__value_PR_UserLocationInformation
;
ie
->
value
.
present
=
Ngap_HandoverNotifyIEs__value_PR_UserLocationInformation
;
int
ret
=
userLocationInformation
.
encodefromUserLocationInformation
(
int
ret
=
&
ie
->
value
.
choice
.
UserLocationInformation
);
userLocationInformation
.
encode
(
&
ie
->
value
.
choice
.
UserLocationInformation
);
if
(
!
ret
)
{
if
(
!
ret
)
{
Logger
::
ngap
().
error
(
"Encode UserLocationInformation IE error"
);
Logger
::
ngap
().
error
(
"Encode UserLocationInformation IE error"
);
free_wrapper
((
void
**
)
&
ie
);
free_wrapper
((
void
**
)
&
ie
);
...
@@ -116,9 +116,8 @@ void HandoverNotifyMsg::setUserLocationInfoNR(
...
@@ -116,9 +116,8 @@ void HandoverNotifyMsg::setUserLocationInfoNR(
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
HandoverNotifyMsg
::
getUserLocationInfoNR
(
NrCgi_t
&
cig
,
Tai_t
&
tai
)
{
bool
HandoverNotifyMsg
::
getUserLocationInfoNR
(
NrCgi_t
&
cig
,
Tai_t
&
tai
)
{
UserLocationInformationNR
*
informationNR
=
nullptr
;
UserLocationInformationNR
information_nr
=
{};
userLocationInformation
.
getInformation
(
informationNR
);
if
(
!
userLocationInformation
.
getInformation
(
information_nr
))
return
false
;
if
(
!
informationNR
)
return
false
;
if
(
userLocationInformation
.
getChoiceOfUserLocationInformation
()
!=
if
(
userLocationInformation
.
getChoiceOfUserLocationInformation
()
!=
Ngap_UserLocationInformation_PR_userLocationInformationNR
)
Ngap_UserLocationInformation_PR_userLocationInformationNR
)
...
@@ -126,7 +125,7 @@ bool HandoverNotifyMsg::getUserLocationInfoNR(NrCgi_t& cig, Tai_t& tai) {
...
@@ -126,7 +125,7 @@ bool HandoverNotifyMsg::getUserLocationInfoNR(NrCgi_t& cig, Tai_t& tai) {
NR_CGI
nR_CGI
=
{};
NR_CGI
nR_CGI
=
{};
TAI
nR_TAI
=
{};
TAI
nR_TAI
=
{};
information
NR
->
getInformationNR
(
nR_CGI
,
nR_TAI
);
information
_nr
.
get
(
nR_CGI
,
nR_TAI
);
nR_CGI
.
getNR_CGI
(
cig
);
nR_CGI
.
getNR_CGI
(
cig
);
nR_TAI
.
getTAI
(
tai
);
nR_TAI
.
getTAI
(
tai
);
...
@@ -198,7 +197,7 @@ bool HandoverNotifyMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
...
@@ -198,7 +197,7 @@ bool HandoverNotifyMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
*/
*/
if
(
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
if
(
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverNotifyIEs__value_PR_UserLocationInformation
)
{
Ngap_HandoverNotifyIEs__value_PR_UserLocationInformation
)
{
if
(
!
userLocationInformation
.
decode
fromUserLocationInformation
(
if
(
!
userLocationInformation
.
decode
(
&
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
&
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
UserLocationInformation
))
{
->
value
.
choice
.
UserLocationInformation
))
{
Logger
::
ngap
().
error
(
Logger
::
ngap
().
error
(
...
...
src/ngap/ngapMsgs/InitialUEMessage.cpp
View file @
4fa4f831
...
@@ -95,14 +95,14 @@ void InitialUEMessageMsg::setNasPdu(uint8_t* nas, size_t size) {
...
@@ -95,14 +95,14 @@ void InitialUEMessageMsg::setNasPdu(uint8_t* nas, size_t size) {
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
InitialUEMessageMsg
::
setUserLocationInfoNR
(
void
InitialUEMessageMsg
::
setUserLocationInfoNR
(
const
struct
NrCgi_s
&
cig
,
const
struct
Tai_s
&
tai
)
{
const
struct
NrCgi_s
&
cig
,
const
struct
Tai_s
&
tai
)
{
UserLocationInformationNR
*
informationNR
=
new
UserLocationInformationNR
()
;
UserLocationInformationNR
information_nr
;
NR_CGI
nR_CGI
=
{};
NR_CGI
nR_CGI
=
{};
nR_CGI
.
setNR_CGI
(
cig
.
mcc
,
cig
.
mnc
,
cig
.
nrCellID
);
nR_CGI
.
setNR_CGI
(
cig
.
mcc
,
cig
.
mnc
,
cig
.
nrCellID
);
TAI
tai_nr
=
{};
TAI
tai_nr
=
{};
tai_nr
.
setTAI
(
tai
);
tai_nr
.
setTAI
(
tai
);
information
NR
->
setInformationNR
(
nR_CGI
,
tai_nr
);
information
_nr
.
set
(
nR_CGI
,
tai_nr
);
userLocationInformation
.
setInformation
(
information
NR
);
userLocationInformation
.
setInformation
(
information
_nr
);
Ngap_InitialUEMessage_IEs_t
*
ie
=
(
Ngap_InitialUEMessage_IEs_t
*
)
calloc
(
Ngap_InitialUEMessage_IEs_t
*
ie
=
(
Ngap_InitialUEMessage_IEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_InitialUEMessage_IEs_t
));
1
,
sizeof
(
Ngap_InitialUEMessage_IEs_t
));
...
@@ -111,8 +111,8 @@ void InitialUEMessageMsg::setUserLocationInfoNR(
...
@@ -111,8 +111,8 @@ void InitialUEMessageMsg::setUserLocationInfoNR(
ie
->
value
.
present
=
ie
->
value
.
present
=
Ngap_InitialUEMessage_IEs__value_PR_UserLocationInformation
;
Ngap_InitialUEMessage_IEs__value_PR_UserLocationInformation
;
int
ret
=
userLocationInformation
.
encodefromUserLocationInformation
(
int
ret
=
&
ie
->
value
.
choice
.
UserLocationInformation
);
userLocationInformation
.
encode
(
&
ie
->
value
.
choice
.
UserLocationInformation
);
if
(
!
ret
)
{
if
(
!
ret
)
{
Logger
::
ngap
().
error
(
"Encode UserLocationInformation IE error"
);
Logger
::
ngap
().
error
(
"Encode UserLocationInformation IE error"
);
free_wrapper
((
void
**
)
&
ie
);
free_wrapper
((
void
**
)
&
ie
);
...
@@ -234,7 +234,7 @@ bool InitialUEMessageMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
...
@@ -234,7 +234,7 @@ bool InitialUEMessageMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
Ngap_Criticality_reject
&&
Ngap_Criticality_reject
&&
initialUEMessageIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
initialUEMessageIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_InitialUEMessage_IEs__value_PR_UserLocationInformation
)
{
Ngap_InitialUEMessage_IEs__value_PR_UserLocationInformation
)
{
if
(
!
userLocationInformation
.
decode
fromUserLocationInformation
(
if
(
!
userLocationInformation
.
decode
(
&
initialUEMessageIEs
->
protocolIEs
.
list
.
array
[
i
]
&
initialUEMessageIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
UserLocationInformation
))
{
->
value
.
choice
.
UserLocationInformation
))
{
Logger
::
ngap
().
error
(
Logger
::
ngap
().
error
(
...
@@ -322,14 +322,14 @@ bool InitialUEMessageMsg::getNasPdu(uint8_t*& nas, size_t& size) {
...
@@ -322,14 +322,14 @@ bool InitialUEMessageMsg::getNasPdu(uint8_t*& nas, size_t& size) {
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
InitialUEMessageMsg
::
getUserLocationInfoNR
(
bool
InitialUEMessageMsg
::
getUserLocationInfoNR
(
struct
NrCgi_s
&
cig
,
struct
Tai_s
&
tai
)
{
struct
NrCgi_s
&
cig
,
struct
Tai_s
&
tai
)
{
UserLocationInformationNR
*
informationNR
;
UserLocationInformationNR
information_nr
=
{}
;
userLocationInformation
.
getInformation
(
information
NR
);
userLocationInformation
.
getInformation
(
information
_nr
);
if
(
userLocationInformation
.
getChoiceOfUserLocationInformation
()
!=
if
(
userLocationInformation
.
getChoiceOfUserLocationInformation
()
!=
Ngap_UserLocationInformation_PR_userLocationInformationNR
)
Ngap_UserLocationInformation_PR_userLocationInformationNR
)
return
false
;
return
false
;
NR_CGI
nR_CGI
=
{};
NR_CGI
nR_CGI
=
{};
TAI
nR_TAI
=
{};
TAI
nR_TAI
=
{};
information
NR
->
getInformationNR
(
nR_CGI
,
nR_TAI
);
information
_nr
.
get
(
nR_CGI
,
nR_TAI
);
nR_CGI
.
getNR_CGI
(
cig
);
nR_CGI
.
getNR_CGI
(
cig
);
nR_TAI
.
getTAI
(
tai
);
nR_TAI
.
getTAI
(
tai
);
...
...
src/ngap/ngapMsgs/PduSessionResourceReleaseResponse.cpp
View file @
4fa4f831
...
@@ -172,13 +172,13 @@ void PduSessionResourceReleaseResponseMsg::setUserLocationInfoNR(
...
@@ -172,13 +172,13 @@ void PduSessionResourceReleaseResponseMsg::setUserLocationInfoNR(
if
(
!
userLocationInformation
)
if
(
!
userLocationInformation
)
userLocationInformation
=
new
UserLocationInformation
();
userLocationInformation
=
new
UserLocationInformation
();
UserLocationInformationNR
*
informationNR
=
new
UserLocationInformationNR
()
;
UserLocationInformationNR
information_nr
=
{}
;
NR_CGI
nR_CGI
=
{};
NR_CGI
nR_CGI
=
{};
TAI
tai_nr
=
{};
TAI
tai_nr
=
{};
nR_CGI
.
setNR_CGI
(
cig
.
mcc
,
cig
.
mnc
,
cig
.
nrCellID
);
nR_CGI
.
setNR_CGI
(
cig
.
mcc
,
cig
.
mnc
,
cig
.
nrCellID
);
tai_nr
.
setTAI
(
tai
);
tai_nr
.
setTAI
(
tai
);
information
NR
->
setInformationNR
(
nR_CGI
,
tai_nr
);
information
_nr
.
set
(
nR_CGI
,
tai_nr
);
userLocationInformation
->
setInformation
(
information
NR
);
userLocationInformation
->
setInformation
(
information
_nr
);
Ngap_PDUSessionResourceReleaseResponseIEs_t
*
ie
=
Ngap_PDUSessionResourceReleaseResponseIEs_t
*
ie
=
(
Ngap_PDUSessionResourceReleaseResponseIEs_t
*
)
calloc
(
(
Ngap_PDUSessionResourceReleaseResponseIEs_t
*
)
calloc
(
...
@@ -188,7 +188,7 @@ void PduSessionResourceReleaseResponseMsg::setUserLocationInfoNR(
...
@@ -188,7 +188,7 @@ void PduSessionResourceReleaseResponseMsg::setUserLocationInfoNR(
ie
->
value
.
present
=
ie
->
value
.
present
=
Ngap_PDUSessionResourceReleaseResponseIEs__value_PR_UserLocationInformation
;
Ngap_PDUSessionResourceReleaseResponseIEs__value_PR_UserLocationInformation
;
int
ret
=
userLocationInformation
->
encode
fromUserLocationInformation
(
int
ret
=
userLocationInformation
->
encode
(
&
ie
->
value
.
choice
.
UserLocationInformation
);
&
ie
->
value
.
choice
.
UserLocationInformation
);
if
(
!
ret
)
{
if
(
!
ret
)
{
Logger
::
nas_mm
().
warn
(
"Encode UserLocationInformation IE error"
);
Logger
::
nas_mm
().
warn
(
"Encode UserLocationInformation IE error"
);
...
@@ -206,14 +206,15 @@ void PduSessionResourceReleaseResponseMsg::setUserLocationInfoNR(
...
@@ -206,14 +206,15 @@ void PduSessionResourceReleaseResponseMsg::setUserLocationInfoNR(
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
PduSessionResourceReleaseResponseMsg
::
getUserLocationInfoNR
(
bool
PduSessionResourceReleaseResponseMsg
::
getUserLocationInfoNR
(
NrCgi_t
&
cig
,
Tai_t
&
tai
)
{
NrCgi_t
&
cig
,
Tai_t
&
tai
)
{
UserLocationInformationNR
*
informationNR
;
UserLocationInformationNR
information_nr
=
{};
userLocationInformation
->
getInformation
(
informationNR
);
if
(
!
userLocationInformation
->
getInformation
(
information_nr
))
return
false
;
if
(
userLocationInformation
->
getChoiceOfUserLocationInformation
()
!=
if
(
userLocationInformation
->
getChoiceOfUserLocationInformation
()
!=
Ngap_UserLocationInformation_PR_userLocationInformationNR
)
Ngap_UserLocationInformation_PR_userLocationInformationNR
)
return
false
;
return
false
;
NR_CGI
nR_CGI
=
{};
NR_CGI
nR_CGI
=
{};
TAI
nR_TAI
=
{};
TAI
nR_TAI
=
{};
information
NR
->
getInformationNR
(
nR_CGI
,
nR_TAI
);
information
_nr
.
get
(
nR_CGI
,
nR_TAI
);
PlmnId
cgi_plmnId
=
{};
PlmnId
cgi_plmnId
=
{};
NRCellIdentity
nRCellIdentity
=
{};
NRCellIdentity
nRCellIdentity
=
{};
nR_CGI
.
getNR_CGI
(
cig
);
nR_CGI
.
getNR_CGI
(
cig
);
...
...
src/ngap/ngapMsgs/UEContextReleaseComplete.cpp
View file @
4fa4f831
...
@@ -93,14 +93,14 @@ void UEContextReleaseCompleteMsg::setUserLocationInfoNR(
...
@@ -93,14 +93,14 @@ void UEContextReleaseCompleteMsg::setUserLocationInfoNR(
if
(
!
userLocationInformation
)
if
(
!
userLocationInformation
)
userLocationInformation
=
new
UserLocationInformation
();
userLocationInformation
=
new
UserLocationInformation
();
UserLocationInformationNR
*
informationNR
=
new
UserLocationInformationNR
()
;
UserLocationInformationNR
information_nr
=
{}
;
NR_CGI
nR_CGI
=
{};
NR_CGI
nR_CGI
=
{};
nR_CGI
.
setNR_CGI
(
cig
.
mcc
,
cig
.
mnc
,
cig
.
nrCellID
);
nR_CGI
.
setNR_CGI
(
cig
.
mcc
,
cig
.
mnc
,
cig
.
nrCellID
);
TAI
tai_nr
=
{};
TAI
tai_nr
=
{};
tai_nr
.
setTAI
(
tai
);
tai_nr
.
setTAI
(
tai
);
information
NR
->
setInformationNR
(
nR_CGI
,
tai_nr
);
information
_nr
.
set
(
nR_CGI
,
tai_nr
);
userLocationInformation
->
setInformation
(
information
NR
);
userLocationInformation
->
setInformation
(
information
_nr
);
Ngap_UEContextReleaseComplete_IEs
*
ie
=
Ngap_UEContextReleaseComplete_IEs
*
ie
=
(
Ngap_UEContextReleaseComplete_IEs
*
)
calloc
(
(
Ngap_UEContextReleaseComplete_IEs
*
)
calloc
(
...
@@ -110,7 +110,7 @@ void UEContextReleaseCompleteMsg::setUserLocationInfoNR(
...
@@ -110,7 +110,7 @@ void UEContextReleaseCompleteMsg::setUserLocationInfoNR(
ie
->
value
.
present
=
ie
->
value
.
present
=
Ngap_UEContextReleaseComplete_IEs__value_PR_UserLocationInformation
;
Ngap_UEContextReleaseComplete_IEs__value_PR_UserLocationInformation
;
int
ret
=
userLocationInformation
->
encode
fromUserLocationInformation
(
int
ret
=
userLocationInformation
->
encode
(
&
ie
->
value
.
choice
.
UserLocationInformation
);
&
ie
->
value
.
choice
.
UserLocationInformation
);
if
(
!
ret
)
{
if
(
!
ret
)
{
Logger
::
ngap
().
error
(
"Encode NGAP UserLocationInformation IE error"
);
Logger
::
ngap
().
error
(
"Encode NGAP UserLocationInformation IE error"
);
...
@@ -126,12 +126,12 @@ void UEContextReleaseCompleteMsg::setUserLocationInfoNR(
...
@@ -126,12 +126,12 @@ void UEContextReleaseCompleteMsg::setUserLocationInfoNR(
void
UEContextReleaseCompleteMsg
::
getUserLocationInfoNR
(
void
UEContextReleaseCompleteMsg
::
getUserLocationInfoNR
(
NrCgi_t
&
cig
,
Tai_t
&
tai
)
{
NrCgi_t
&
cig
,
Tai_t
&
tai
)
{
if
(
userLocationInformation
)
{
if
(
userLocationInformation
)
{
UserLocationInformationNR
*
informationNR
=
new
UserLocationInformationNR
()
;
UserLocationInformationNR
information_nr
=
{}
;
userLocationInformation
->
getInformation
(
informationNR
)
;
if
(
!
userLocationInformation
->
getInformation
(
information_nr
))
return
;
NR_CGI
nR_CGI
=
{};
NR_CGI
nR_CGI
=
{};
TAI
tai_nr
=
{};
TAI
tai_nr
=
{};
information
NR
->
getInformationNR
(
nR_CGI
,
tai_nr
);
information
_nr
.
get
(
nR_CGI
,
tai_nr
);
PlmnId
plmnId_cgi
=
{};
PlmnId
plmnId_cgi
=
{};
NRCellIdentity
nRCellIdentity
=
{};
NRCellIdentity
nRCellIdentity
=
{};
...
...
src/ngap/ngapMsgs/UplinkNASTransport.cpp
View file @
4fa4f831
...
@@ -118,14 +118,14 @@ bool UplinkNASTransportMsg::getNasPdu(uint8_t*& nas, size_t& sizeofnas) {
...
@@ -118,14 +118,14 @@ bool UplinkNASTransportMsg::getNasPdu(uint8_t*& nas, size_t& sizeofnas) {
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
UplinkNASTransportMsg
::
setUserLocationInfoNR
(
void
UplinkNASTransportMsg
::
setUserLocationInfoNR
(
const
NrCgi_t
&
cig
,
const
Tai_t
&
tai
)
{
const
NrCgi_t
&
cig
,
const
Tai_t
&
tai
)
{
UserLocationInformationNR
*
informationNR
=
new
UserLocationInformationNR
()
;
UserLocationInformationNR
information_nr
;
NR_CGI
nR_CGI
=
{};
NR_CGI
nR_CGI
=
{};
TAI
tai_nr
=
{};
TAI
tai_nr
=
{};
nR_CGI
.
setNR_CGI
(
cig
);
nR_CGI
.
setNR_CGI
(
cig
);
tai_nr
.
setTAI
(
tai
);
tai_nr
.
setTAI
(
tai
);
information
NR
->
setInformationNR
(
nR_CGI
,
tai_nr
);
information
_nr
.
set
(
nR_CGI
,
tai_nr
);
userLocationInformation
.
setInformation
(
information
NR
);
userLocationInformation
.
setInformation
(
information
_nr
);
Ngap_UplinkNASTransport_IEs_t
*
ie
=
(
Ngap_UplinkNASTransport_IEs_t
*
)
calloc
(
Ngap_UplinkNASTransport_IEs_t
*
ie
=
(
Ngap_UplinkNASTransport_IEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_UplinkNASTransport_IEs_t
));
1
,
sizeof
(
Ngap_UplinkNASTransport_IEs_t
));
...
@@ -134,8 +134,8 @@ void UplinkNASTransportMsg::setUserLocationInfoNR(
...
@@ -134,8 +134,8 @@ void UplinkNASTransportMsg::setUserLocationInfoNR(
ie
->
value
.
present
=
ie
->
value
.
present
=
Ngap_UplinkNASTransport_IEs__value_PR_UserLocationInformation
;
Ngap_UplinkNASTransport_IEs__value_PR_UserLocationInformation
;
int
ret
=
userLocationInformation
.
encodefromUserLocationInformation
(
int
ret
=
&
ie
->
value
.
choice
.
UserLocationInformation
);
userLocationInformation
.
encode
(
&
ie
->
value
.
choice
.
UserLocationInformation
);
if
(
!
ret
)
{
if
(
!
ret
)
{
Logger
::
ngap
().
error
(
"Encode NGAP UserLocationInformation IE error"
);
Logger
::
ngap
().
error
(
"Encode NGAP UserLocationInformation IE error"
);
free_wrapper
((
void
**
)
&
ie
);
free_wrapper
((
void
**
)
&
ie
);
...
@@ -149,14 +149,16 @@ void UplinkNASTransportMsg::setUserLocationInfoNR(
...
@@ -149,14 +149,16 @@ void UplinkNASTransportMsg::setUserLocationInfoNR(
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
UplinkNASTransportMsg
::
getUserLocationInfoNR
(
NrCgi_t
&
cig
,
Tai_t
&
tai
)
{
bool
UplinkNASTransportMsg
::
getUserLocationInfoNR
(
NrCgi_t
&
cig
,
Tai_t
&
tai
)
{
UserLocationInformationNR
*
informationNR
;
UserLocationInformationNR
information_nr
=
{};
userLocationInformation
.
getInformation
(
informationNR
);
if
(
!
userLocationInformation
.
getInformation
(
information_nr
))
return
false
;
if
(
userLocationInformation
.
getChoiceOfUserLocationInformation
()
!=
if
(
userLocationInformation
.
getChoiceOfUserLocationInformation
()
!=
Ngap_UserLocationInformation_PR_userLocationInformationNR
)
Ngap_UserLocationInformation_PR_userLocationInformationNR
)
return
false
;
return
false
;
NR_CGI
nR_CGI
=
{};
NR_CGI
nR_CGI
=
{};
TAI
nR_TAI
=
{};
TAI
nR_TAI
=
{};
information
NR
->
getInformationNR
(
nR_CGI
,
nR_TAI
);
information
_nr
.
get
(
nR_CGI
,
nR_TAI
);
nR_CGI
.
getNR_CGI
(
cig
);
nR_CGI
.
getNR_CGI
(
cig
);
nR_TAI
.
getTAI
(
tai
);
nR_TAI
.
getTAI
(
tai
);
...
@@ -239,7 +241,7 @@ bool UplinkNASTransportMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
...
@@ -239,7 +241,7 @@ bool UplinkNASTransportMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
Ngap_Criticality_ignore
&&
Ngap_Criticality_ignore
&&
uplinkNASTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
uplinkNASTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_UplinkNASTransport_IEs__value_PR_UserLocationInformation
)
{
Ngap_UplinkNASTransport_IEs__value_PR_UserLocationInformation
)
{
if
(
!
userLocationInformation
.
decode
fromUserLocationInformation
(
if
(
!
userLocationInformation
.
decode
(
&
uplinkNASTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
&
uplinkNASTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
UserLocationInformation
))
{
->
value
.
choice
.
UserLocationInformation
))
{
Logger
::
ngap
().
error
(
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