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
1f74fd47
Commit
1f74fd47
authored
Dec 02, 2023
by
liuyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add udp-> ngap handle
parent
d8cba37f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
src/ngap/ngap_app/ngap_app.cpp
src/ngap/ngap_app/ngap_app.cpp
+3
-2
src/ngap/ngap_app/udp.cpp
src/ngap/ngap_app/udp.cpp
+16
-8
No files found.
src/ngap/ngap_app/ngap_app.cpp
View file @
1f74fd47
...
...
@@ -51,6 +51,7 @@ using namespace sctp;
using
namespace
config
;
using
namespace
ngap
;
extern
bool
priority
;
//------------------------------------------------------------------------------
ngap_app
::
ngap_app
(
const
std
::
string
&
address
,
const
uint16_t
port_num
)
:
ppid_
(
60
),
sctp_s_38412
(
address
.
c_str
(),
port_num
)
{
...
...
@@ -109,7 +110,7 @@ void ngap_app::handle_receive(
"Handling SCTP payload from SCTP Server on assoc_id (%d), stream_id "
"(%d), instreams (%d), outstreams (%d)"
,
assoc_id
,
stream
,
instreams
,
outstreams
);
bool
priority
=
true
;
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
=
(
Ngap_NGAP_PDU_t
*
)
calloc
(
1
,
sizeof
(
Ngap_NGAP_PDU_t
));
asn_dec_rval_t
rc
=
asn_decode
(
...
...
@@ -159,7 +160,7 @@ void ngap_app::handle_receive(
// // octet_stream_2_hex_stream2((uint8_t*) bdata(payload), blength(payload), ngapmsg);
// //curl_http_another_amf(assoc_id,stream,ngapmsg);
UdpSend
(
buffer
,
n
,
"10.103.23
8
.31"
,
20001
);
UdpSend
(
buffer
,
n
,
"10.103.23
9
.31"
,
20001
);
}
else
{
//Handle the message
...
...
src/ngap/ngap_app/udp.cpp
View file @
1f74fd47
...
...
@@ -7,7 +7,7 @@
#include <stdlib.h>
#include <sys/time.h>
#include <unistd.h>
//
#include "amf_sbi.hpp"
#include "amf_sbi.hpp"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
...
...
@@ -22,13 +22,16 @@
#include <thread>
#include "bstrlib.h"
#include "sstream"
// #include "ngap_message_callback.hpp"
extern
"C"
{
#include "Ngap_InitiatingMessage.h"
#include "Ngap_NGAP-PDU.h"
}
using
namespace
std
;
bool
priority
=
true
;
udp_server
::
udp_server
(
const
char
*
udp_address
,
uint16_t
udp_port_num
){
cout
<<
"start create socket"
<<
endl
;
create_socket
(
udp_address
,
udp_port_num
);
...
...
@@ -182,6 +185,11 @@ vector<string> SplitString(string s, string c){
}
void
udp_server
::
handle_receive_udp
(
int
r
,
uint8_t
udp_recv
[]){
if
(
priority
==
true
)
{
Logger
::
ngap
().
info
(
"synchronize context"
);
}
else
{
stringstream
ngap_msg_stream
;
sctp_stream_id_t
stream
;
...
...
@@ -214,21 +222,21 @@ void udp_server::handle_receive_udp(int r,uint8_t udp_recv[]){
assoc_id
=
_assoc_id
;
bstring
payload
=
blk2bstr
(
buffer
,
r
-
2
);
//
//
bstring udp_recv_bstr=bfromcstr(content.c_str());
// bstring udp_recv_bstr=bfromcstr(content.c_str());
// cout<<"data:"<<payload->data<<endl;
// cout<<"slen"<<payload->slen<<endl;
// cout<<"mlen"<<payload->mlen<<endl;
cout
<<
"start handle"
<<
endl
;
// ngap_app("0",0).handle_receive(payload,assoc_id,stream,0,0
);
ngap_app
(
"0"
,
0
).
handle_receive
(
payload
,
assoc_id
,
stream
,
0
,
0
,
buffer
,
r
-
2
);
// Ngap_NGAP_PDU_t* ngap_msg_pdu =
// (Ngap_NGAP_PDU_t*) calloc(1, sizeof(Ngap_NGAP_PDU_t));
// Logger::
ud
p().info("start decode");
// Logger::
nga
p().info("start decode");
// asn_dec_rval_t rc = asn_decode(
// NULL, ATS_ALIGNED_CANONICAL_PER, &asn_DEF_Ngap_NGAP_PDU,
// (void**) &ngap_msg_pdu, bdata(
udp_recv_bstr), blength(udp_recv_bstr
));
// Logger::
ud
p().debug(
// (void**) &ngap_msg_pdu, bdata(
payload), blength(payload
));
// Logger::
nga
p().debug(
// "Decoded UDP message, procedure code %d, present %d",
// ngap_msg_pdu->choice.initiatingMessage->procedureCode,
// ngap_msg_pdu->present);
...
...
@@ -237,6 +245,6 @@ void udp_server::handle_receive_udp(int r,uint8_t udp_recv[]){
// [ngap_msg_pdu->present - 1])(
// assoc_id, stream, ngap_msg_pdu);
}
}
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