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
e83ac3f6
Commit
e83ac3f6
authored
Jan 31, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
25617b9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
src/ngap/ngap_app/ngap_app.hpp
src/ngap/ngap_app/ngap_app.hpp
+0
-1
src/sctp/sctp_server.cpp
src/sctp/sctp_server.cpp
+8
-9
No files found.
src/ngap/ngap_app/ngap_app.hpp
View file @
e83ac3f6
...
...
@@ -23,7 +23,6 @@
#define _NGAP_APPLICATION_H_
#include <map>
#include <memory>
#include <shared_mutex>
#include "gNB_context.hpp"
...
...
src/sctp/sctp_server.cpp
View file @
e83ac3f6
...
...
@@ -46,10 +46,9 @@ namespace sctp {
//------------------------------------------------------------------------------
sctp_server
::
sctp_server
(
const
char
*
address
,
const
uint16_t
port_num
)
{
Logger
::
sctp
().
debug
(
"
c
reating socket!!"
);
Logger
::
sctp
().
debug
(
"
C
reating socket!!"
);
create_socket
(
address
,
port_num
);
app_
=
nullptr
;
// pthread_t thread_;
app_
=
nullptr
;
sctp_desc
=
{};
serverAddr_
=
{};
events_
=
{};
...
...
@@ -70,7 +69,7 @@ int sctp_server::create_socket(const char* address, const uint16_t port_num) {
Logger
::
sctp
().
debug
(
"getaddrinfo on %s was OK"
,
address
);
}
if
((
socket_
=
socket
(
res
->
ai_family
,
SOCK_STREAM
,
IPPROTO_SCTP
))
<
0
)
{
Logger
::
sctp
().
error
(
"
s
ocket: %s:%d"
,
strerror
(
errno
),
errno
);
Logger
::
sctp
().
error
(
"
S
ocket: %s:%d"
,
strerror
(
errno
),
errno
);
return
RETURNerror
;
}
Logger
::
sctp
().
info
(
"Created socket (%d)"
,
socket_
);
...
...
@@ -102,7 +101,7 @@ void sctp_server::start_receive(sctp_application* app) {
//------------------------------------------------------------------------------
void
*
sctp_server
::
sctp_receiver_thread
(
void
*
arg
)
{
sctp_server
*
ptr
=
(
sctp_server
*
)
arg
;
Logger
::
sctp
().
info
(
"Create pthread to receive
sctp
message"
);
Logger
::
sctp
().
info
(
"Create pthread to receive
SCTP
message"
);
int
fdmax
;
int
clientsock
;
fd_set
master
;
...
...
@@ -125,7 +124,7 @@ void* sctp_server::sctp_receiver_thread(void* arg) {
if
(
i
==
ptr
->
getSocket
())
{
if
((
clientsock
=
accept
(
ptr
->
getSocket
(),
NULL
,
NULL
))
<
0
)
{
Logger
::
sctp
().
error
(
"[socket(%d)]
a
ccept() error: %s:%d"
,
ptr
->
getSocket
(),
"[socket(%d)]
A
ccept() error: %s:%d"
,
ptr
->
getSocket
(),
strerror
(
errno
),
errno
);
pthread_exit
(
NULL
);
}
else
{
...
...
@@ -184,7 +183,7 @@ int sctp_server::sctp_read_from_socket(int sd, uint32_t ppid) {
}
default:
{
Logger
::
sctp
().
error
(
"Unhandled notification type (%d)"
,
snp
->
sn_header
.
sn_type
);
"Un
-
handled notification type (%d)"
,
snp
->
sn_header
.
sn_type
);
break
;
}
}
...
...
@@ -202,8 +201,8 @@ int sctp_server::sctp_read_from_socket(int sd, uint32_t ppid) {
return
SCTP_RC_ERROR
;
}
Logger
::
sctp
().
info
(
"
****
[Assoc_id %d, Socket %d] Received a msg (length %d) from port %d, "
"on stream %d, PPID %d
****
"
,
"[Assoc_id %d, Socket %d] Received a msg (length %d) from port %d, "
"on stream %d, PPID %d"
,
sinfo
.
sinfo_assoc_id
,
sd
,
n
,
ntohs
(
addr
.
sin6_port
),
sinfo
.
sinfo_stream
,
ntohl
(
sinfo
.
sinfo_ppid
));
bstring
payload
=
blk2bstr
(
buffer
,
n
);
...
...
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