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-Simple
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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
CommunityXG
OpenXG-AMF-Simple
Commits
396896be
Commit
396896be
authored
Sep 14, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue for malformed PDUSessionResourceSetupRequest
parent
5227afe5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
4 deletions
+32
-4
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+18
-2
src/amf-app/amf_statistics.cpp
src/amf-app/amf_statistics.cpp
+1
-1
src/ngap/ngapMsgs/PduSessionResourceSetupRequest.cpp
src/ngap/ngapMsgs/PduSessionResourceSetupRequest.cpp
+11
-0
src/ngap/ngapMsgs/PduSessionResourceSetupRequest.hpp
src/ngap/ngapMsgs/PduSessionResourceSetupRequest.hpp
+1
-0
src/sbi/amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
.../amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
+1
-1
No files found.
src/amf-app/amf_n2.cpp
View file @
396896be
...
@@ -48,6 +48,10 @@
...
@@ -48,6 +48,10 @@
#include "Ngap_CauseRadioNetwork.h"
#include "Ngap_CauseRadioNetwork.h"
#include "Ngap_TimeToWait.h"
#include "Ngap_TimeToWait.h"
extern
"C"
{
#include "dynamic_memory_check.h"
}
using
namespace
amf_application
;
using
namespace
amf_application
;
using
namespace
config
;
using
namespace
config
;
extern
itti_mw
*
itti_inst
;
extern
itti_mw
*
itti_inst
;
...
@@ -573,10 +577,22 @@ void amf_n2::handle_itti_message(itti_pdu_session_resource_setup_request &itti_m
...
@@ -573,10 +577,22 @@ void amf_n2::handle_itti_message(itti_pdu_session_resource_setup_request &itti_m
list
.
push_back
(
item
);
list
.
push_back
(
item
);
psrsr
->
setPduSessionResourceSetupRequestList
(
list
);
psrsr
->
setPduSessionResourceSetupRequestList
(
list
);
uint8_t
buffer
[
5000
];
size_t
buffer_size
=
512
;
//TODO: remove hardcoded value
int
encoded_size
=
psrsr
->
encode2buffer
(
buffer
,
5000
);
char
*
buffer
=
(
char
*
)
calloc
(
1
,
buffer_size
);
int
encoded_size
=
0
;
psrsr
->
encode2buffer_new
(
buffer
,
encoded_size
);
#if DEBUG_IS_ON
Logger
::
amf_n2
().
debug
(
"N2 SM buffer data: "
);
for
(
int
i
=
0
;
i
<
encoded_size
;
i
++
)
printf
(
"%02x "
,
(
char
)
buffer
[
i
]);
#endif
Logger
::
amf_n2
().
debug
(
" (%d bytes)
\n
"
,
encoded_size
);
bstring
b
=
blk2bstr
(
buffer
,
encoded_size
);
bstring
b
=
blk2bstr
(
buffer
,
encoded_size
);
sctp_s_38412
.
sctp_send_msg
(
gc
.
get
()
->
sctp_assoc_id
,
unc
.
get
()
->
sctp_stream_send
,
&
b
);
sctp_s_38412
.
sctp_send_msg
(
gc
.
get
()
->
sctp_assoc_id
,
unc
.
get
()
->
sctp_stream_send
,
&
b
);
//free memory
free_wrapper
((
void
**
)
&
buffer
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
...
src/amf-app/amf_statistics.cpp
View file @
396896be
...
@@ -49,7 +49,7 @@ void statistics::display() {
...
@@ -49,7 +49,7 @@ void statistics::display() {
//TODO: Show the list of common PLMNs
//TODO: Show the list of common PLMNs
for
(
int
i
=
0
;
i
<
gnbs
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
gnbs
.
size
();
i
++
)
{
Logger
::
amf_app
().
info
(
"| %d | Connected | 0x%x | %s | %s, %d
| "
,
i
+
1
,
gnbs
[
i
].
gnb_id
,
gnbs
[
i
].
gnb_name
.
c_str
(),
(
gnbs
[
i
].
mcc
+
gnbs
[
i
].
mnc
).
c_str
(),
gnbs
[
i
].
tac
);
Logger
::
amf_app
().
info
(
"| %d | Connected | 0x%x | %s | %s, %d | "
,
i
+
1
,
gnbs
[
i
].
gnb_id
,
gnbs
[
i
].
gnb_name
.
c_str
(),
(
gnbs
[
i
].
mcc
+
gnbs
[
i
].
mnc
).
c_str
(),
gnbs
[
i
].
tac
);
}
}
Logger
::
amf_app
().
info
(
"|----------------------------------------------------------------------------------------------------------------|"
);
Logger
::
amf_app
().
info
(
"|----------------------------------------------------------------------------------------------------------------|"
);
Logger
::
amf_app
().
info
(
""
);
Logger
::
amf_app
().
info
(
""
);
...
...
src/ngap/ngapMsgs/PduSessionResourceSetupRequest.cpp
View file @
396896be
...
@@ -223,6 +223,17 @@ int PduSessionResourceSetupRequestMsg::encode2buffer(uint8_t *buf, int buf_size)
...
@@ -223,6 +223,17 @@ int PduSessionResourceSetupRequestMsg::encode2buffer(uint8_t *buf, int buf_size)
return
er
.
encoded
;
return
er
.
encoded
;
}
}
//------------------------------------------------------------------------------
void
PduSessionResourceSetupRequestMsg
::
encode2buffer_new
(
char
*
buf
,
int
&
encoded_size
)
{
char
*
buffer
=
(
char
*
)
calloc
(
1
,
512
);
//TODO: remove hardcoded value
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
pduSessionResourceSetupRequestPdu
);
encoded_size
=
aper_encode_to_new_buffer
(
&
asn_DEF_Ngap_NGAP_PDU
,
NULL
,
pduSessionResourceSetupRequestPdu
,
(
void
**
)
&
buffer
);
cout
<<
"er.encoded("
<<
encoded_size
<<
")"
<<
endl
;
memcpy
((
void
*
)
buf
,
(
void
*
)
buffer
,
encoded_size
);
free
(
buffer
);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//Decapsulation
//Decapsulation
bool
PduSessionResourceSetupRequestMsg
::
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
)
{
bool
PduSessionResourceSetupRequestMsg
::
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
)
{
...
...
src/ngap/ngapMsgs/PduSessionResourceSetupRequest.hpp
View file @
396896be
...
@@ -60,6 +60,7 @@ class PduSessionResourceSetupRequestMsg {
...
@@ -60,6 +60,7 @@ class PduSessionResourceSetupRequestMsg {
void
setPduSessionResourceSetupRequestList
(
std
::
vector
<
PDUSessionResourceSetupRequestItem_t
>
list
);
void
setPduSessionResourceSetupRequestList
(
std
::
vector
<
PDUSessionResourceSetupRequestItem_t
>
list
);
void
setPduSessionAggregateMaximumBitRate
(
long
bit_rate_downlink
,
long
bit_rate_uplink
);
void
setPduSessionAggregateMaximumBitRate
(
long
bit_rate_downlink
,
long
bit_rate_uplink
);
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
void
encode2buffer_new
(
char
*
buf
,
int
&
encoded_size
);
//Decapsulation
//Decapsulation
bool
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
);
bool
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
);
unsigned
long
getAmfUeNgapId
();
unsigned
long
getAmfUeNgapId
();
...
...
src/sbi/amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
View file @
396896be
...
@@ -62,7 +62,7 @@ void N1N2MessageCollectionDocumentApiImpl::n1_n2_message_transfer(const std::str
...
@@ -62,7 +62,7 @@ void N1N2MessageCollectionDocumentApiImpl::n1_n2_message_transfer(const std::str
}
}
bstring
n1sm
;
bstring
n1sm
;
msg_str_2_msg_hex
(
n1sm_str
.
substr
(
0
,
n1sm_str
.
length
()
-
2
),
n1sm
);
msg_str_2_msg_hex
(
n1sm_str
.
substr
(
0
,
n1sm_str
.
length
()),
n1sm
);
bstring
n2sm
;
bstring
n2sm
;
msg_str_2_msg_hex
(
n2sm_str
,
n2sm
);
msg_str_2_msg_hex
(
n2sm_str
,
n2sm
);
...
...
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