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
c509d831
Commit
c509d831
authored
Jan 20, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use ITTI to send N1 Message Notification message to AMF App to process
parent
f5e31641
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
235 additions
and
145 deletions
+235
-145
src/amf-app/amf_app.cpp
src/amf-app/amf_app.cpp
+205
-118
src/amf-app/amf_app.hpp
src/amf-app/amf_app.hpp
+1
-11
src/ngap/ngapIEs/GNB-ID.cpp
src/ngap/ngapIEs/GNB-ID.cpp
+12
-6
src/ngap/ngapIEs/GNB-ID.hpp
src/ngap/ngapIEs/GNB-ID.hpp
+3
-1
src/sbi/amf_server/impl/N1MessageNotifyApiImpl.cpp
src/sbi/amf_server/impl/N1MessageNotifyApiImpl.cpp
+14
-9
No files found.
src/amf-app/amf_app.cpp
View file @
c509d831
This diff is collapsed.
Click to expand it.
src/amf-app/amf_app.hpp
View file @
c509d831
...
...
@@ -83,6 +83,7 @@ class amf_app {
// itti handlers
void
handle_itti_message
(
itti_nas_signalling_establishment_request
&
itti_msg
);
void
handle_itti_message
(
itti_n1n2_message_transfer_request
&
itti_msg
);
void
handle_itti_message
(
itti_sbi_n1_message_notification
&
itti_msg
);
bool
is_amf_ue_id_2_ue_context
(
const
long
&
amf_ue_ngap_id
)
const
;
std
::
shared_ptr
<
ue_context
>
amf_ue_id_2_ue_context
(
...
...
@@ -161,17 +162,6 @@ class amf_app {
std
::
shared_ptr
<
itti_sbi_notification_data
>&
msg
,
oai
::
amf
::
model
::
ProblemDetails
&
problem_details
,
uint32_t
&
http_code
);
/*
* Handle N1 Message Notification
* @param [std::shared_ptr<itti_sbi_n1_message_notification>& ] msg: message
* @param [oai::amf::model::ProblemDetails& ] problem_details
* @param [uint8_t&] http_code
* @return true if handle sucessfully, otherwise return false
*/
bool
handle_n1_message_notification
(
std
::
shared_ptr
<
itti_sbi_n1_message_notification
>&
msg
,
oai
::
amf
::
model
::
ProblemDetails
&
problem_details
,
uint32_t
&
http_code
);
/*
* Generate a random UUID for SMF instance
* @param [void]
...
...
src/ngap/ngapIEs/GNB-ID.cpp
View file @
c509d831
...
...
@@ -47,26 +47,32 @@ void GNB_ID::setValue(uint32_t gnbId) {
uint8_t
len
=
0
;
for
(
uint32_t
i
=
0x00000001
;
i
<=
0x00000400
;
i
=
i
<<
1
,
len
++
)
{
if
((
i
&
gnbId
))
{
gNBId
.
bit
eslen
=
32
-
len
;
gNBId
.
bit
_length
=
32
-
len
;
break
;
}
}
if
(
!
((
gNBId
.
bit
eslen
>=
22
)
&&
(
gNBId
.
biteslen
<=
32
)))
{
if
(
!
((
gNBId
.
bit
_length
>=
22
)
&&
(
gNBId
.
bit_length
<=
32
)))
{
cout
<<
"[warning][gNBID length out of range]"
<<
endl
;
}
}
//------------------------------------------------------------------------------
void
GNB_ID
::
setValue
(
uint32_t
id
,
uint8_t
bit_length
)
{
gNBId
.
id
=
id
;
gNBId
.
bit_length
=
bit_length
;
}
//------------------------------------------------------------------------------
bool
GNB_ID
::
encode2bitstring
(
Ngap_GNB_ID_t
&
gnbid
)
{
gnbid
.
present
=
Ngap_GNB_ID_PR_gNB_ID
;
if
(
!
(
gNBId
.
bit
eslen
%
8
))
gnbid
.
choice
.
gNB_ID
.
size
=
gNBId
.
bit
eslen
/
8
;
if
(
!
(
gNBId
.
bit
_length
%
8
))
gnbid
.
choice
.
gNB_ID
.
size
=
gNBId
.
bit
_length
/
8
;
else
gnbid
.
choice
.
gNB_ID
.
size
=
gNBId
.
bit
eslen
/
8
+
1
;
gnbid
.
choice
.
gNB_ID
.
size
=
gNBId
.
bit
_length
/
8
+
1
;
// printf("m_gNBId.size(%d)\n",m_gNBId.size);
gnbid
.
choice
.
gNB_ID
.
bits_unused
=
32
-
gNBId
.
bit
eslen
;
gnbid
.
choice
.
gNB_ID
.
bits_unused
=
32
-
gNBId
.
bit
_length
;
gnbid
.
choice
.
gNB_ID
.
buf
=
(
uint8_t
*
)
calloc
(
1
,
4
*
sizeof
(
uint8_t
));
if
(
!
gnbid
.
choice
.
gNB_ID
.
buf
)
return
false
;
gnbid
.
choice
.
gNB_ID
.
buf
[
3
]
=
gNBId
.
id
&
0x000000ff
;
...
...
src/ngap/ngapIEs/GNB-ID.hpp
View file @
c509d831
...
...
@@ -45,10 +45,12 @@ class GNB_ID {
void
setValue
(
uint32_t
gnbId
);
long
getValue
();
void
setValue
(
uint32_t
id
,
uint8_t
bit_length
);
private:
struct
gNBId_s
{
uint32_t
id
;
uint8_t
bit
eslen
;
uint8_t
bit
_length
;
}
gNBId
;
// 22bits to 32bits
};
...
...
src/sbi/amf_server/impl/N1MessageNotifyApiImpl.cpp
View file @
c509d831
...
...
@@ -14,8 +14,11 @@
#include "N1MessageNotifyApiImpl.h"
#include "itti_msg_sbi.hpp"
#include "conversions.hpp"
#include "itti.hpp"
using
namespace
amf_application
;
extern
itti_mw
*
itti_inst
;
namespace
oai
{
namespace
amf
{
namespace
api
{
...
...
@@ -47,15 +50,17 @@ void N1MessageNotifyApiImpl::receive_n1_message_notification(
oai
::
amf
::
model
::
ProblemDetails
problem_details
=
{};
uint32_t
http_code
=
{
0
};
if
(
m_amf_app
->
handle_n1_message_notification
(
itti_msg
,
problem_details
,
http_code
))
{
response
.
send
(
Pistache
::
Http
::
Code
(
http_code
));
}
else
{
response
.
headers
().
add
<
Pistache
::
Http
::
Header
::
ContentType
>
(
Pistache
::
Http
::
Mime
::
MediaType
(
"application/problem+json"
));
nlohmann
::
json
json_data
=
{};
to_json
(
json_data
,
problem_details
);
response
.
send
(
Pistache
::
Http
::
Code
(
http_code
),
json_data
.
dump
().
c_str
());
// Send response
response
.
send
(
Pistache
::
Http
::
Code
::
No_Content
);
// TODO: problem
// Process N1 Notification Message at AMF APP
int
ret
=
itti_inst
->
send_msg
(
itti_msg
);
if
(
0
!=
ret
)
{
Logger
::
amf_server
().
error
(
"Could not send ITTI message %s to task TASK_AMF_N2"
,
itti_msg
->
get_msg_name
());
}
}
...
...
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