Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
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
lizhongxiao
OpenXG-RAN
Commits
4e5f239b
Commit
4e5f239b
authored
Jun 28, 2023
by
jperaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug #127974 [L3 SIMU] unix socket for com between UE<->proxy: backport of work from Daniil
parent
fc77df61
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
openair3/SS/ss_gNB_vtp_task.c
openair3/SS/ss_gNB_vtp_task.c
+12
-15
No files found.
openair3/SS/ss_gNB_vtp_task.c
View file @
4e5f239b
...
@@ -105,7 +105,7 @@ static int vtp_send_init_udp(const vtp_udpSockReq_t *req)
...
@@ -105,7 +105,7 @@ static int vtp_send_init_udp(const vtp_udpSockReq_t *req)
{
{
// Create and alloc new message
// Create and alloc new message
MessageDef
*
message_p
;
MessageDef
*
message_p
;
message_p
=
itti_alloc_new_message
(
TASK_
VT
P
,
0
,
UDP_INIT
);
message_p
=
itti_alloc_new_message
(
TASK_
UD
P
,
0
,
UDP_INIT
);
if
(
message_p
==
NULL
)
if
(
message_p
==
NULL
)
{
{
return
-
1
;
return
-
1
;
...
@@ -168,7 +168,10 @@ void ss_vtp_send_tinfo(
...
@@ -168,7 +168,10 @@ void ss_vtp_send_tinfo(
virtualTime
.
TimingInfo
.
HSFN
.
d
=
false
;
virtualTime
.
TimingInfo
.
HSFN
.
d
=
false
;
virtualTime
.
TimingInfo
.
HSFN
.
v
.
Number
=
0
;
virtualTime
.
TimingInfo
.
HSFN
.
v
.
Number
=
0
;
_ss_log_vt
(
&
virtualTime
,
" <= "
);
if
(((
tinfo
->
sfn
%
32
)
==
0
)
&&
(
tinfo
->
sf
==
0
)
&&
(
tinfo
->
slot
==
0
))
{
_ss_log_vt
(
&
virtualTime
,
" <= "
);
}
/* Encode message
/* Encode message
*/
*/
...
@@ -210,11 +213,10 @@ static int vtp_send_udp_msg(
...
@@ -210,11 +213,10 @@ static int vtp_send_udp_msg(
// Create and alloc new message
// Create and alloc new message
MessageDef
*
message_p
=
NULL
;
MessageDef
*
message_p
=
NULL
;
udp_data_req_t
*
udp_data_req_p
=
NULL
;
udp_data_req_t
*
udp_data_req_p
=
NULL
;
message_p
=
itti_alloc_new_message
(
TASK_
VT
P
,
0
,
UDP_DATA_REQ
);
message_p
=
itti_alloc_new_message
(
TASK_
UD
P
,
0
,
UDP_DATA_REQ
);
if
(
message_p
)
if
(
message_p
)
{
{
LOG_A
(
GNB_APP
,
"Sending UDP_DATA_REQ length %u offset %u buffer %x %x %x
\n
"
,
buffer_len
,
buffer_offset
,
buffer
[
0
],
buffer
[
1
],
buffer
[
2
]);
udp_data_req_p
=
&
message_p
->
ittiMsg
.
udp_data_req
;
udp_data_req_p
=
&
message_p
->
ittiMsg
.
udp_data_req
;
udp_data_req_p
->
peer_address
=
peerIpAddr
;
udp_data_req_p
->
peer_address
=
peerIpAddr
;
udp_data_req_p
->
peer_port
=
peerPort
;
udp_data_req_p
->
peer_port
=
peerPort
;
...
@@ -236,14 +238,11 @@ static int vtp_send_udp_msg(
...
@@ -236,14 +238,11 @@ static int vtp_send_udp_msg(
*/
*/
static
void
vtp_send_proxy
(
void
*
msg
,
int
msgLen
)
static
void
vtp_send_proxy
(
void
*
msg
,
int
msgLen
)
{
{
LOG_A
(
GNB_APP
,
"In sys_send_proxy
\n
"
);
uint32_t
peerIpAddr
;
uint32_t
peerIpAddr
;
uint16_t
peerPort
=
vtp_proxy_send_port
;
uint16_t
peerPort
=
vtp_proxy_send_port
;
IPV4_STR_ADDR_TO_INT_NWBO
(
vtp_local_address
,
peerIpAddr
,
" BAD IP Address"
);
IPV4_STR_ADDR_TO_INT_NWBO
(
vtp_local_address
,
peerIpAddr
,
" BAD IP Address"
);
LOG_A
(
GNB_APP
,
"
\n
Cell Config End of Buffer
\n
"
);
/** Send to proxy */
/** Send to proxy */
vtp_send_udp_msg
((
uint8_t
*
)
msg
,
msgLen
,
0
,
peerIpAddr
,
peerPort
);
vtp_send_udp_msg
((
uint8_t
*
)
msg
,
msgLen
,
0
,
peerIpAddr
,
peerPort
);
return
;
return
;
...
@@ -252,7 +251,6 @@ static void vtp_send_proxy(void *msg, int msgLen)
...
@@ -252,7 +251,6 @@ static void vtp_send_proxy(void *msg, int msgLen)
static
void
ss_send_vtp_resp
(
struct
VirtualTimeInfo_Type
*
virtualTime
)
static
void
ss_send_vtp_resp
(
struct
VirtualTimeInfo_Type
*
virtualTime
)
{
{
VtpCmdReq_t
*
req
=
(
VtpCmdReq_t
*
)
malloc
(
sizeof
(
VtpCmdReq_t
));
VtpCmdReq_t
*
req
=
(
VtpCmdReq_t
*
)
malloc
(
sizeof
(
VtpCmdReq_t
));
LOG_A
(
GNB_APP
,
"itti_alloc %p
\n
"
,
req
);
req
->
header
.
preamble
=
0xFEEDC0DE
;
req
->
header
.
preamble
=
0xFEEDC0DE
;
req
->
header
.
msg_id
=
SS_VTP_RESP
;
req
->
header
.
msg_id
=
SS_VTP_RESP
;
req
->
header
.
length
=
sizeof
(
proxy_ss_header_t
);
req
->
header
.
length
=
sizeof
(
proxy_ss_header_t
);
...
@@ -286,9 +284,6 @@ static void ss_send_vtp_resp(struct VirtualTimeInfo_Type *virtualTime)
...
@@ -286,9 +284,6 @@ static void ss_send_vtp_resp(struct VirtualTimeInfo_Type *virtualTime)
req
->
tinfo
.
sfn
=
virtualTime
->
TimingInfo
.
SFN
.
v
.
Number
;
req
->
tinfo
.
sfn
=
virtualTime
->
TimingInfo
.
SFN
.
v
.
Number
;
req
->
tinfo
.
sf
=
virtualTime
->
TimingInfo
.
Subframe
.
v
.
Number
;
req
->
tinfo
.
sf
=
virtualTime
->
TimingInfo
.
Subframe
.
v
.
Number
;
LOG_A
(
GNB_APP
,
"VTP_ACK Command to proxy sent for cell_id: %d SFN: %d SF: %d mu: %d slot: %d
\n
"
,
req
->
header
.
cell_id
,
req
->
tinfo
.
sfn
,
req
->
tinfo
.
sf
,
req
->
tinfo
.
mu
,
req
->
tinfo
.
slot
);
vtp_send_proxy
((
void
*
)
req
,
sizeof
(
VtpCmdReq_t
));
vtp_send_proxy
((
void
*
)
req
,
sizeof
(
VtpCmdReq_t
));
}
}
...
@@ -296,7 +291,6 @@ static void ss_send_vtp_resp(struct VirtualTimeInfo_Type *virtualTime)
...
@@ -296,7 +291,6 @@ static void ss_send_vtp_resp(struct VirtualTimeInfo_Type *virtualTime)
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
static
inline
uint8_t
ss_gNB_read_from_vtp_socket
(
acpCtx_t
ctx
)
static
inline
uint8_t
ss_gNB_read_from_vtp_socket
(
acpCtx_t
ctx
)
{
{
struct
VirtualTimeInfo_Type
*
virtualTime
=
NULL
;
const
size_t
size
=
16
*
1024
;
const
size_t
size
=
16
*
1024
;
unsigned
char
*
buffer
=
(
unsigned
char
*
)
acpMalloc
(
size
);
unsigned
char
*
buffer
=
(
unsigned
char
*
)
acpMalloc
(
size
);
assert
(
buffer
);
assert
(
buffer
);
...
@@ -307,7 +301,6 @@ static inline uint8_t ss_gNB_read_from_vtp_socket(acpCtx_t ctx)
...
@@ -307,7 +301,6 @@ static inline uint8_t ss_gNB_read_from_vtp_socket(acpCtx_t ctx)
while
(
1
)
while
(
1
)
{
{
int
userId
=
acpRecvMsg
(
ctx
,
&
msgSize
,
buffer
);
int
userId
=
acpRecvMsg
(
ctx
,
&
msgSize
,
buffer
);
LOG_A
(
GNB_APP
,
"[SS-VTP] Received msgSize=%d, userId=%d
\n
"
,
(
int
)
msgSize
,
userId
);
// Error handling
// Error handling
if
(
userId
<
0
)
if
(
userId
<
0
)
...
@@ -340,15 +333,19 @@ static inline uint8_t ss_gNB_read_from_vtp_socket(acpCtx_t ctx)
...
@@ -340,15 +333,19 @@ static inline uint8_t ss_gNB_read_from_vtp_socket(acpCtx_t ctx)
}
}
else
if
(
userId
==
MSG_SysVTEnquireTimingAck_userId
)
else
if
(
userId
==
MSG_SysVTEnquireTimingAck_userId
)
{
{
struct
VirtualTimeInfo_Type
*
virtualTime
=
NULL
;
if
(
acpSysVTEnquireTimingAckDecSrv
(
ctx
,
buffer
,
msgSize
,
&
virtualTime
)
!=
0
)
if
(
acpSysVTEnquireTimingAckDecSrv
(
ctx
,
buffer
,
msgSize
,
&
virtualTime
)
!=
0
)
{
{
LOG_E
(
GNB_APP
,
"[SS-VTP] acpVngProcessDecSrv failed
\n
"
);
LOG_E
(
GNB_APP
,
"[SS-VTP] acpVngProcessDecSrv failed
\n
"
);
break
;
break
;
}
}
AssertFatal
(
virtualTime
!=
NULL
,
"VT struct is null (%p)"
,
virtualTime
);
ss_send_vtp_resp
(
virtualTime
);
ss_send_vtp_resp
(
virtualTime
);
_ss_log_vt
(
virtualTime
,
" => "
);
if
((
virtualTime
->
TimingInfo
.
SFN
.
v
.
Number
%
32
)
==
0
&&
(
virtualTime
->
TimingInfo
.
Subframe
.
v
.
Number
==
0
)
&&
(
virtualTime
->
TimingInfo
.
Slot
.
v
.
SlotOffset
.
v
.
Numerology1
==
0
))
{
_ss_log_vt
(
virtualTime
,
" => "
);
}
acpSysVTEnquireTimingAckFreeSrv
(
virtualTime
);
acpSysVTEnquireTimingAckFreeSrv
(
virtualTime
);
// TODo forward the message to sys_task ACK
// TODo forward the message to sys_task ACK
...
...
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