Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
Michael Black
OpenXG UE
Commits
5c68790b
Commit
5c68790b
authored
May 29, 2020
by
Andrew Burger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trying to read a single packet inside oai ue
parent
0ad24d8e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
17 deletions
+57
-17
nfapi/oai_integration/nfapi.c
nfapi/oai_integration/nfapi.c
+1
-1
nfapi/oai_integration/vendor_ext.h
nfapi/oai_integration/vendor_ext.h
+2
-2
openair2/PHY_INTERFACE/phy_stub_UE.c
openair2/PHY_INTERFACE/phy_stub_UE.c
+28
-5
openair2/PHY_INTERFACE/phy_stub_UE.h
openair2/PHY_INTERFACE/phy_stub_UE.h
+3
-0
targets/RT/USER/lte-uesoftmodem.c
targets/RT/USER/lte-uesoftmodem.c
+23
-9
No files found.
nfapi/oai_integration/nfapi.c
View file @
5c68790b
...
...
@@ -23,7 +23,7 @@
#include <pthread.h>
#include "nfapi/oai_integration/vendor_ext.h"
#include "common/utils/LOG/log.h"
static
char
nfapi_str_mode
[
6
][
24
]
=
{
"MONOLITHIC"
,
"PNF"
,
"VNF"
,
"UE_STUB_PNF"
,
"UE_STUB_OFFNET"
,
"<UNKNOWN NFAPI MODE>"
};
static
char
nfapi_str_mode
[
6
][
24
]
=
{
"MONOLITHIC"
,
"PNF"
,
"VNF"
,
"UE_STUB_PNF"
,
"UE_STUB_OFFNET"
,
"
STANDALONE_PNF"
,
"
<UNKNOWN NFAPI MODE>"
};
typedef
struct
{
nfapi_mode_t
nfapi_mode
;
...
...
nfapi/oai_integration/vendor_ext.h
View file @
5c68790b
...
...
@@ -70,8 +70,8 @@ typedef enum {
NFAPI_MODE_VNF
,
NFAPI_UE_STUB_PNF
,
NFAPI_UE_STUB_OFFNET
,
NFAPI_MODE_
UNKNOWN
,
NFAPI_MODE_
STANDALONE_PNF
NFAPI_MODE_
STANDALONE_PNF
,
NFAPI_MODE_
UNKNOWN
}
nfapi_mode_t
;
char
*
nfapi_get_strmode
(
void
);
...
...
openair2/PHY_INTERFACE/phy_stub_UE.c
View file @
5c68790b
...
...
@@ -882,7 +882,7 @@ void hi_dci0_req_UE_MAC(int sfn,
// The following set of memcpy functions should be getting called as callback
// functions from pnf_p7_subframe_ind.
int
memcpy_dl_config_req
(
L1_rxtx_proc_t
*
proc
,
int
memcpy_dl_config_req
(
L1_rxtx_proc_t
*
proc
,
nfapi_pnf_p7_config_t
*
pnf_p7
,
nfapi_dl_config_request_t
*
req
)
{
dl_config_req
=
(
nfapi_dl_config_request_t
*
)
malloc
(
sizeof
(
nfapi_dl_config_request_t
));
...
...
@@ -959,8 +959,8 @@ int memcpy_tx_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_tx_request_t *req) {
return
0
;
}
int
memcpy_hi_dci0_req
(
L1_rxtx_proc_t
*
proc
,
nfapi_pnf_p7_config_t
*
pnf_p7
,
int
memcpy_hi_dci0_req
(
L1_rxtx_proc_t
*
proc
,
nfapi_pnf_p7_config_t
*
pnf_p7
,
nfapi_hi_dci0_request_t
*
req
)
{
hi_dci0_req
=
(
nfapi_hi_dci0_request_t
*
)
malloc
(
sizeof
(
nfapi_hi_dci0_request_t
));
//if(req!=0){
...
...
@@ -1044,9 +1044,32 @@ void UE_config_stub_pnf(void) {
}
}
void
UE_init_socket
(
void
)
{
int
ue_init_standalone_socket
(
const
char
*
addr
,
int
port
)
{
struct
sockaddr_in
server_address
;
int
addr_len
=
sizeof
(
server_address
);
memset
(
&
server_address
,
0
,
addr_len
);
server_address
.
sin_family
=
AF_INET
;
server_address
.
sin_port
=
htons
(
port
);
int
sd
=
socket
(
address
.
sin_family
,
SOCK_STREAM
,
IPPROTO_SCTP
);
if
(
sd
<
0
)
{
LOG_E
(
MAC
,
"Socket creation error standalone PNF"
);
return
-
1
;
}
if
(
inet_pton
(
server_address
.
sin_family
,
addr
,
&
server_address
.
sin_addr
)
<=
0
)
{
LOG_E
(
MAC
,
"Invalid standalone PNF Address"
);
return
-
1
;
}
if
(
connect
(
socket
,
(
struct
sockaddr
*
)
&
server_address
,
addr_len
)
<
0
)
{
LOG_E
(
MAC
,
"Connection to standalone PNF failed"
);
return
-
1
;
}
// scpt socket creation and memcpy function calls here
return
sd
;
}
/* Dummy functions*/
...
...
openair2/PHY_INTERFACE/phy_stub_UE.h
View file @
5c68790b
...
...
@@ -131,6 +131,9 @@ int memcpy_hi_dci0_req (L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t* pnf_p7, nfa
void
UE_config_stub_pnf
(
void
);
// This function is used to open an SCTP socket with a standalone PNF module
int
ue_init_standalone_socket
(
const
char
*
addr
,
int
port
);
#endif
/* PHY_STUB_UE_H_ */
targets/RT/USER/lte-uesoftmodem.c
View file @
5c68790b
...
...
@@ -631,7 +631,7 @@ int main( int argc, char **argv ) {
NB_INST
=
1
;
if
(
NFAPI_MODE
==
NFAPI_UE_STUB_PNF
)
{
// || NFAPI_MODE_STANDALONE_PNF
if
(
NFAPI_MODE
==
NFAPI_UE_STUB_PNF
||
NFAPI_MODE_STANDALONE_PNF
)
{
// || NFAPI_MODE_STANDALONE_PNF
PHY_vars_UE_g
=
malloc
(
sizeof
(
PHY_VARS_UE
**
)
*
NB_UE_INST
);
for
(
int
i
=
0
;
i
<
NB_UE_INST
;
i
++
)
{
...
...
@@ -704,11 +704,31 @@ int main( int argc, char **argv ) {
exit
(
-
1
);
// need a softer mode
}
nfapi_setmode
(
NFAPI_MODE_STANDALONE_PNF
);
// make sure to hammer out this nfapi mode crap
if
(
NFAPI_MODE
==
NFAPI_UE_STUB_PNF
)
{
// UE-STUB-PNF
UE_config_stub_pnf
();
}
// add socket here and call corresponding memcpys - Andrew
// hard-coding address and port for now fix later
int
sd
=
-
1
;
if
(
NFAPI_MODE
==
NFAPI_MODE_STANDALONE_PNF
)
{
const
char
*
standalone_addr
=
"127.0.0.1"
;
int
standalone_port
=
3289
;
char
buffy
[
1024
];
sd
=
ue_init_standalone_socket
(
standalone_addr
,
standalone_port
);
ssize_t
len
=
read
(
sd
,
buffy
,
sizeof
(
buffy
));
if
(
len
==
-
1
)
{
printf
(
"reading from standalone pnf sctp socket failed
\n
"
);
return
EXIT_FAILURE
;
}
nfapi_p7_message_header_t
header_t
;
if
(
nfapi_p7_message_header_unpack
((
void
*
)
buffy
,
len
,
&
header_t
,
sizeof
(
header_t
),
NULL
)
!=
0
)
{
printf
(
"unpacking p7 message failed from standalone pnf
\n
"
);
printf
(
"Bruins header_t.message_id: %u"
,
header_t
.
message_id
);
}
}
printf
(
"ITTI tasks created
\n
"
);
mlockall
(
MCL_CURRENT
|
MCL_FUTURE
);
...
...
@@ -723,13 +743,7 @@ int main( int argc, char **argv ) {
init_UE_stub_single_thread
(
NB_UE_INST
,
eMBMS_active
,
uecap_xer_in
,
emul_iface
);
}
else
if
(
NFAPI_MODE
==
NFAPI_MODE_STANDALONE_PNF
)
{
// init thread and open socket
/*
need to do this in thread
l2_init_ue(eMBMS_active,(uecap_xer_in==1)?uecap_xer:NULL,
0,// cba_group_active
0); // HO flag
*/
init_UE_stub_single_thread
(
NB_UE_INST
,
eMBMS_active
,
uecap_xer_in
,
emul_iface
);
}
else
{
...
...
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