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
b2ac87a8
Commit
b2ac87a8
authored
Feb 03, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup/address review comments
parent
7fc6c548
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
25 deletions
+31
-25
src/amf-app/amf_config.hpp
src/amf-app/amf_config.hpp
+2
-3
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+0
-1
src/amf-app/amf_n1.hpp
src/amf-app/amf_n1.hpp
+12
-10
src/amf-app/amf_n2.hpp
src/amf-app/amf_n2.hpp
+11
-8
src/sctp/sctp_server.cpp
src/sctp/sctp_server.cpp
+5
-2
src/sctp/sctp_server.hpp
src/sctp/sctp_server.hpp
+1
-1
No files found.
src/amf-app/amf_config.hpp
View file @
b2ac87a8
...
...
@@ -244,10 +244,9 @@ typedef struct slice_s {
bool
operator
>
(
const
struct
slice_s
&
s
)
const
{
if
(
this
->
sst
>
s
.
sst
)
return
true
;
if
(
this
->
sst
==
s
.
sst
)
{
if
(
this
->
sd
>
s
.
sd
)
return
true
;
if
(
this
->
sd
<=
s
.
sd
)
return
false
;
return
(
this
->
sd
>
s
.
sd
);
}
return
tru
e
;
return
fals
e
;
}
nlohmann
::
json
to_json
()
const
{
...
...
src/amf-app/amf_n1.cpp
View file @
b2ac87a8
...
...
@@ -1247,7 +1247,6 @@ void amf_n1::registration_request_handle(
if
(
nc
==
nullptr
)
{
// try to get the GUTI -> nas_context
if
(
guti_2_nas_context
(
guti
,
nc
))
{
// nc = guti_2_nas_context(guti);
set_amf_ue_ngap_id_2_nas_context
(
amf_ue_ngap_id
,
nc
);
nc
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
nc
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
...
...
src/amf-app/amf_n1.hpp
View file @
b2ac87a8
...
...
@@ -108,17 +108,18 @@ class amf_n1 {
SecurityHeaderType_t
&
type
,
const
uint8_t
*
buffer
,
const
uint32_t
length
);
/*
* Verify if a UE NAS context associated with a GUTI exist
* Verify if a UE NAS context associated with a GUTI exist
s
* @param [const std::string&] guti: UE GUTI
* @return true if
UE NAS context exist
, otherwise false
* @return true if
the UE NAS context exists
, otherwise false
*/
bool
is_guti_2_nas_context
(
const
std
::
string
&
guti
)
const
;
/*
* Get UE NAS context associated with a GUTI if exist and not null
* Get UE NAS context associated with a GUTI if the context exists and is not
* null
* @param [const std::string&] guti: UE GUTI
* @param [std::shared_ptr<nas_context>&] nc: UE NAS Context
* @return true if
context exists and
not null, otherwise return false
* @return true if
the context exists and is
not null, otherwise return false
*/
bool
guti_2_nas_context
(
const
std
::
string
&
guti
,
std
::
shared_ptr
<
nas_context
>&
nc
)
const
;
...
...
@@ -140,18 +141,18 @@ class amf_n1 {
bool
remove_guti_2_nas_context
(
const
std
::
string
&
guti
);
/*
* Verify if a UE NAS context associated with an AMF UE NGAP ID exist
* Verify if a UE NAS context associated with an AMF UE NGAP ID exist
s
* @param [const long& ] amf_ue_ngap_id: AMF UE NGAP ID
* @return true if UE NAS context exist, otherwise false
* @return true if UE NAS context exist
s
, otherwise false
*/
bool
is_amf_ue_id_2_nas_context
(
const
long
&
amf_ue_ngap_id
)
const
;
/*
* Verify if a UE NAS context associated with an AMF UE NGAP ID exist
and not
* null
* Verify if a UE NAS context associated with an AMF UE NGAP ID exist
s and is
* n
ot n
ull
* @param [const long& ] amf_ue_ngap_id: AMF UE NGAP ID
* @param [std::shared_ptr<nas_context>&] nc: pointer to UE NAS context
* @return true if
UE NAS context exist
, otherwise false
* @return true if
the UE NAS context exists (and not null)
, otherwise false
*/
bool
amf_ue_id_2_nas_context
(
const
long
&
amf_ue_ngap_id
,
std
::
shared_ptr
<
nas_context
>&
nc
)
const
;
...
...
@@ -223,7 +224,8 @@ class amf_n1 {
* Get UE NAS context associated with an IMSI
* @param [const std::string&] imsi: UE IMSI
* @param [const std::shared_ptr<nas_context>&] nc: pointer to UE NAS context
* @return true if the NAS context exist and not null, otherwise return false
* @return true if the NAS context exists and is not null, otherwise return
* false
*/
bool
imsi_2_nas_context
(
const
std
::
string
&
imsi
,
std
::
shared_ptr
<
nas_context
>&
)
const
;
...
...
src/amf-app/amf_n2.hpp
View file @
b2ac87a8
...
...
@@ -225,20 +225,21 @@ class amf_n2 : public ngap::ngap_app {
const
uint32_t
&
ran_ue_ngap_id
,
std
::
vector
<
nas
::
SNSSAI_t
>&
common_nssai
);
/*
* Verify whether a UE NGAP context associated with a RAN UE NGAP ID exist
* Get the UE NGAP context associated with a RAN UE NGAP ID if it exists and
* not null
* @param [const uint32_t&] ran_ue_ngap_id: RAN UE NGAP ID
* @param [std::shared_ptr<ue_ngap_context>&] unc: shared pointer to the
* existing UE NGAP context
* @return true if
exist
, otherwise return false
* @return true if
the context exists and is not null
, otherwise return false
*/
bool
ran_ue_id_2_ue_ngap_context
(
const
uint32_t
&
ran_ue_ngap_id
,
std
::
shared_ptr
<
ue_ngap_context
>&
unc
)
const
;
/*
* Verify whether a UE NGAP context associated with a RAN UE NGAP ID exist
* Verify whether a UE NGAP context associated with a RAN UE NGAP ID exist
s
* @param [const uint32_t&] ran_ue_ngap_id: RAN UE NGAP ID
* @return true if
exist
, otherwise return false
* @return true if
the context exists and is not null
, otherwise return false
*/
bool
is_ran_ue_id_2_ue_ngap_context
(
const
uint32_t
&
ran_ue_ngap_id
)
const
;
...
...
@@ -268,19 +269,21 @@ class amf_n2 : public ngap::ngap_app {
void
remove_ue_context_with_ran_ue_ngap_id
(
const
uint32_t
&
ran_ue_ngap_id
);
/*
* Verify whether a UE NGAP context associated with a AMF UE NGAP ID exist
* Verify whether a UE NGAP context associated with a AMF UE NGAP ID exists
* and is not null
* @param [const unsigned long&] amf_ue_ngap_id: AMF UE NGAP ID
* @return true if
exist
, otherwise return false
* @return true if
the context exists and is not null
, otherwise return false
*/
bool
is_amf_ue_id_2_ue_ngap_context
(
const
unsigned
long
&
amf_ue_ngap_id
)
const
;
/*
* Get UE NGAP context associated with a AMF UE NGAP ID
* Get UE NGAP context associated with a AMF UE NGAP ID if the context exists
* and is not null
* @param [const unsigned long&] amf_ue_ngap_id: AMF UE NGAP ID
* @param [std::shared_ptr<ue_ngap_context>&] unc: store the pointer to UE
* NGAP context
* @return true if
context exist and
not null, otherwise return false
* @return true if
the context exists and is
not null, otherwise return false
*/
bool
amf_ue_id_2_ue_ngap_context
(
const
unsigned
long
&
amf_ue_ngap_id
,
...
...
src/sctp/sctp_server.cpp
View file @
b2ac87a8
...
...
@@ -42,9 +42,12 @@ extern "C" {
namespace
sctp
{
//------------------------------------------------------------------------------
sctp_application
::~
sctp_application
()
{}
//------------------------------------------------------------------------------
sctp_server
::
sctp_server
(
const
char
*
address
,
const
uint16_t
port_num
)
{
Logger
::
sctp
().
debug
(
"Creating socket!
!
"
);
Logger
::
sctp
().
debug
(
"Creating socket!"
);
create_socket
(
address
,
port_num
);
app_
=
nullptr
;
sctp_desc
=
{};
...
...
@@ -118,7 +121,7 @@ void* sctp_server::sctp_receiver_thread(void* arg) {
FD_SET
(
ptr
->
getSocket
(),
&
master
);
fdmax
=
ptr
->
getSocket
();
while
(
1
)
{
while
(
true
)
{
memcpy
(
&
read_fds
,
&
master
,
sizeof
(
master
));
if
(
select
(
fdmax
+
1
,
&
read_fds
,
NULL
,
NULL
,
NULL
)
==
-
1
)
{
Logger
::
sctp
().
error
(
...
...
src/sctp/sctp_server.hpp
View file @
b2ac87a8
...
...
@@ -73,7 +73,7 @@ typedef struct sctp_descriptor_s {
class
sctp_application
{
public:
virtual
~
sctp_application
()
{}
;
virtual
~
sctp_application
();
virtual
void
handle_receive
(
bstring
payload
,
sctp_assoc_id_t
assoc_id
,
sctp_stream_id_t
stream
,
sctp_stream_id_t
instreams
,
sctp_stream_id_t
outstreams
)
=
0
;
...
...
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