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
6d092100
Commit
6d092100
authored
Sep 18, 2018
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PROTO_AGENT: Restructure/simplify code, UDP only, no own configuration
parent
b9c1782c
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
178 additions
and
644 deletions
+178
-644
common/ran_context.h
common/ran_context.h
+0
-2
openair2/ENB_APP/enb_config.c
openair2/ENB_APP/enb_config.c
+0
-128
openair2/ENB_APP/enb_config.h
openair2/ENB_APP/enb_config.h
+10
-35
openair2/LAYER2/PROTO_AGENT/proto_agent.c
openair2/LAYER2/PROTO_AGENT/proto_agent.c
+109
-364
openair2/LAYER2/PROTO_AGENT/proto_agent.h
openair2/LAYER2/PROTO_AGENT/proto_agent.h
+2
-9
openair2/LAYER2/PROTO_AGENT/proto_agent_async.c
openair2/LAYER2/PROTO_AGENT/proto_agent_async.c
+32
-86
openair2/LAYER2/PROTO_AGENT/proto_agent_async.h
openair2/LAYER2/PROTO_AGENT/proto_agent_async.h
+5
-6
openair2/LAYER2/PROTO_AGENT/proto_agent_defs.h
openair2/LAYER2/PROTO_AGENT/proto_agent_defs.h
+11
-7
openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.h
openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.h
+9
-7
No files found.
common/ran_context.h
View file @
6d092100
...
@@ -103,8 +103,6 @@ typedef struct {
...
@@ -103,8 +103,6 @@ typedef struct {
pthread_mutex_t
ru_mutex
;
pthread_mutex_t
ru_mutex
;
/// condition variable for signaling setup completion of an RU
/// condition variable for signaling setup completion of an RU
pthread_cond_t
ru_cond
;
pthread_cond_t
ru_cond
;
struct
cudu_params_s
cudu
;
}
RAN_CONTEXT_t
;
}
RAN_CONTEXT_t
;
...
...
openair2/ENB_APP/enb_config.c
View file @
6d092100
...
@@ -416,132 +416,6 @@ void RCconfig_macrlc(int macrlc_has_f1[MAX_MAC_INST]) {
...
@@ -416,132 +416,6 @@ void RCconfig_macrlc(int macrlc_has_f1[MAX_MAC_INST]) {
}
}
void
RCconfig_cudu
()
{
int
j
;
char
*
transport_type
;
char
*
du_type
;
char
*
balancing
;
pthread_t
myid
=
pthread_self
();
printf
(
"CONFIG my id is %u
\n
"
,
myid
);
paramdef_t
DU_Params
[]
=
DUPARAMS_DESC
;
paramdef_t
CU_Params
[]
=
CUPARAMS_DESC
;
paramlist_def_t
DU_ParamList
=
{
CONFIG_STRING_DU_LIST
,
NULL
,
0
};
paramlist_def_t
CU_ParamList
=
{
CONFIG_STRING_CU_LIST
,
NULL
,
0
};
config_getlist
(
&
DU_ParamList
,
DU_Params
,
sizeof
(
DU_Params
)
/
sizeof
(
paramdef_t
),
NULL
);
config_getlist
(
&
CU_ParamList
,
CU_Params
,
sizeof
(
CU_Params
)
/
sizeof
(
paramdef_t
),
NULL
);
paramdef_t
CU_Bal
[]
=
CU_BAL_DESC
;
paramlist_def_t
CU_BalList
=
{
CONFIG_STRING_CU_BALANCING
,
NULL
,
0
};
config_get
(
&
CU_Bal
,
sizeof
(
CU_Bal
)
/
sizeof
(
paramdef_t
),
NULL
);
//printf("%s\n", strdup(*(CU_Bal[0].strptr)));
balancing
=
strdup
(
*
(
CU_Bal
[
0
].
strptr
));
if
(
strcmp
(
balancing
,
"ALL"
)
==
0
)
{
RC
.
cudu
.
cu_balancing
=
CU_BALANCING_ALL
;
}
else
if
(
strcmp
(
balancing
,
"ROUND_ROBIN"
)
==
0
)
{
RC
.
cudu
.
cu_balancing
=
CU_BALANCING_ROUND_ROBIN
;
}
else
{
RC
.
cudu
.
cu_balancing
=
atoi
(
balancing
)
-
1
;
}
// DU Parameters
RC
.
cudu
.
local_du
.
du_interface
=
strdup
(
*
(
DU_ParamList
.
paramarray
[
0
][
DU_INTERFACE_F1U
].
strptr
));
RC
.
cudu
.
local_du
.
du_ipv4_address
=
strdup
(
*
(
DU_ParamList
.
paramarray
[
0
][
DU_ADDRESS_F1U
].
strptr
));
RC
.
cudu
.
local_du
.
du_port
=
*
(
DU_ParamList
.
paramarray
[
0
][
DU_PORT_F1U
].
iptr
);
transport_type
=
strdup
(
*
(
DU_ParamList
.
paramarray
[
0
][
DU_TYPE_F1U
].
strptr
));
if
(
strcmp
(
transport_type
,
"TCP"
)
==
0
)
{
RC
.
cudu
.
local_du
.
tcp
=
1
;
RC
.
cudu
.
local_du
.
udp
=
0
;
RC
.
cudu
.
local_du
.
sctp
=
0
;
}
else
if
(
strcmp
(
transport_type
,
"UDP"
)
==
0
)
{
RC
.
cudu
.
local_du
.
tcp
=
0
;
RC
.
cudu
.
local_du
.
udp
=
1
;
RC
.
cudu
.
local_du
.
sctp
=
0
;
}
else
if
(
strcmp
(
transport_type
,
"SCTP"
)
==
0
)
{
RC
.
cudu
.
local_du
.
tcp
=
0
;
RC
.
cudu
.
local_du
.
udp
=
0
;
RC
.
cudu
.
local_du
.
sctp
=
1
;
}
else
{
RC
.
cudu
.
local_du
.
tcp
=
1
;
RC
.
cudu
.
local_du
.
udp
=
0
;
RC
.
cudu
.
local_du
.
sctp
=
0
;
}
//CU Parameters
j
=
CU_ParamList
.
numelt
;
RC
.
cudu
.
serving_dus
=
j
;
for
(
int
k
=
0
;
k
<
j
;
k
++
)
{
RC
.
cudu
.
cu
[
k
].
cu_interface
=
strdup
(
*
(
CU_ParamList
.
paramarray
[
k
][
CU_INTERFACE_F1U
].
strptr
));
RC
.
cudu
.
cu
[
k
].
cu_ipv4_address
=
strdup
(
*
(
CU_ParamList
.
paramarray
[
k
][
CU_ADDRESS_F1U
].
strptr
));
RC
.
cudu
.
cu
[
k
].
cu_port
=
*
(
CU_ParamList
.
paramarray
[
k
][
CU_PORT_F1U
].
iptr
);
RC
.
cudu
.
cu
[
k
].
cu_id
=
k
;
du_type
=
strdup
(
*
(
CU_ParamList
.
paramarray
[
k
][
DU_TECH
].
strptr
));
transport_type
=
strdup
(
*
(
CU_ParamList
.
paramarray
[
k
][
CU_TYPE_F1U
].
strptr
));
if
(
strcmp
(
transport_type
,
"TCP"
)
==
0
)
{
RC
.
cudu
.
cu
[
k
].
tcp
=
1
;
RC
.
cudu
.
cu
[
k
].
udp
=
0
;
RC
.
cudu
.
cu
[
k
].
sctp
=
0
;
}
else
if
(
strcmp
(
transport_type
,
"UDP"
)
==
0
)
{
RC
.
cudu
.
cu
[
k
].
tcp
=
0
;
RC
.
cudu
.
cu
[
k
].
udp
=
1
;
RC
.
cudu
.
cu
[
k
].
sctp
=
0
;
}
else
if
(
strcmp
(
transport_type
,
"SCTP"
)
==
0
)
{
RC
.
cudu
.
cu
[
k
].
tcp
=
0
;
RC
.
cudu
.
cu
[
k
].
udp
=
0
;
RC
.
cudu
.
cu
[
k
].
sctp
=
1
;
}
else
{
RC
.
cudu
.
cu
[
k
].
tcp
=
1
;
RC
.
cudu
.
cu
[
k
].
udp
=
0
;
RC
.
cudu
.
cu
[
k
].
sctp
=
0
;
}
if
(
strcmp
(
du_type
,
"LTE"
)
==
0
)
{
RC
.
cudu
.
cu
[
k
].
du_type
=
DU_TYPE_LTE
;
}
else
if
(
strcmp
(
du_type
,
"WiFi"
)
==
0
)
{
RC
.
cudu
.
cu
[
k
].
du_type
=
DU_TYPE_WIFI
;
}
else
{
RC
.
cudu
.
cu
[
k
].
du_type
=
DU_TYPE_LTE
;
}
}
}
cudu_params_t
*
get_cudu_config
()
{
return
&
(
RC
.
cudu
);
}
int
RCconfig_RRC
(
uint32_t
i
,
eNB_RRC_INST
*
rrc
)
{
int
RCconfig_RRC
(
uint32_t
i
,
eNB_RRC_INST
*
rrc
)
{
int
num_enbs
=
0
;
int
num_enbs
=
0
;
...
@@ -2828,8 +2702,6 @@ void RCConfig(void) {
...
@@ -2828,8 +2702,6 @@ void RCConfig(void) {
char
aprefix
[
MAX_OPTNAME_SIZE
*
2
+
8
];
char
aprefix
[
MAX_OPTNAME_SIZE
*
2
+
8
];
// RCconfig_cudu();
/* get global parameters, defined outside any section in the config file */
/* get global parameters, defined outside any section in the config file */
printf
(
"Getting ENBSParams
\n
"
);
printf
(
"Getting ENBSParams
\n
"
);
...
...
openair2/ENB_APP/enb_config.h
View file @
6d092100
...
@@ -82,37 +82,16 @@ typedef struct mme_ip_address_s {
...
@@ -82,37 +82,16 @@ typedef struct mme_ip_address_s {
typedef
struct
du_
interface
s
{
typedef
struct
du_
param
s
{
c
har
*
du_interface
;
c
onst
char
*
remote_ipv4_address
;
c
har
*
du_ipv4_address
;
c
onst
int16_t
remote_port
;
uint16_t
du_por
t
;
}
du_params_
t
;
typedef
struct
cu_params
{
unsigned
tcp
:
1
;
const
char
*
local_interface
;
unsigned
udp
:
1
;
const
char
*
local_ipv4_address
;
unsigned
sctp
:
1
;
const
uint16_t
local_port
;
}
cu_params_t
;
}
du_interfaces_t
;
typedef
struct
cu_interfaces
{
char
*
cu_interface
;
char
*
cu_ipv4_address
;
uint16_t
cu_port
;
uint8_t
du_type
;
uint8_t
cu_id
;
unsigned
tcp
:
1
;
unsigned
udp
:
1
;
unsigned
sctp
:
1
;
}
cu_interfaces_t
;
typedef
struct
cudu_params_s
{
du_interfaces_t
local_du
;
cu_interfaces_t
cu
[
MAX_DU
];
uint8_t
serving_dus
;
uint8_t
cu_balancing
;
}
cudu_params_t
;
typedef
struct
ru_config_s
{
typedef
struct
ru_config_s
{
// indicates if local or remote rf is used (1 == LOCAL)
// indicates if local or remote rf is used (1 == LOCAL)
...
@@ -145,11 +124,7 @@ void ru_config_display(void);
...
@@ -145,11 +124,7 @@ void ru_config_display(void);
int
RCconfig_RRC
(
uint32_t
i
,
eNB_RRC_INST
*
rrc
);
int
RCconfig_RRC
(
uint32_t
i
,
eNB_RRC_INST
*
rrc
);
int
RCconfig_S1
(
MessageDef
*
msg_p
,
uint32_t
i
);
int
RCconfig_S1
(
MessageDef
*
msg_p
,
uint32_t
i
);
int
RCconfig_DU_F1
(
MessageDef
*
msg_p
,
uint32_t
i
);
int
RCconfig_CU_F1
(
uint32_t
i
);
void
RCconfig_cudu
(
void
);
cudu_params_t
*
get_cudu_config
(
void
);
void
read_config_and_init
(
void
);
void
read_config_and_init
(
void
);
int
RCconfig_X2
(
MessageDef
*
msg_p
,
uint32_t
i
);
int
RCconfig_X2
(
MessageDef
*
msg_p
,
uint32_t
i
);
...
...
openair2/LAYER2/PROTO_AGENT/proto_agent.c
View file @
6d092100
This diff is collapsed.
Click to expand it.
openair2/LAYER2/PROTO_AGENT/proto_agent.h
View file @
6d092100
...
@@ -45,20 +45,13 @@ void * proto_server_init(void *args);
...
@@ -45,20 +45,13 @@ void * proto_server_init(void *args);
void
*
proto_server_receive
(
void
*
args
);
void
*
proto_server_receive
(
void
*
args
);
void
*
proto_client_receive
(
void
*
args
);
void
*
proto_client_receive
(
void
*
args
);
int
proto_agent_start
(
uint8_t
enb_id
,
mod_id_t
mod_id
,
uint8_t
type_id
,
cudu_params_t
*
cu
du
);
int
proto_agent_start
(
mod_id_t
mod_id
,
const
du_params_t
*
du
);
int
proto_server_start
(
mod_id_t
mod_id
,
const
cu
du_params_t
*
cud
u
);
int
proto_server_start
(
mod_id_t
mod_id
,
const
cu
_params_t
*
c
u
);
int
proto_agent_stop
(
mod_id_t
mod_id
);
int
proto_agent_stop
(
mod_id_t
mod_id
);
void
*
proto_agent_task
(
void
*
args
);
void
*
proto_agent_task
(
void
*
args
);
uint8_t
select_du
(
uint8_t
max_dus
);
typedef
struct
{
mod_id_t
mod_id
;
uint8_t
type_id
;
}
proto_recv_t
;
void
proto_agent_send_rlc_data_req
(
uint8_t
mod_id
,
uint8_t
type_id
,
void
proto_agent_send_rlc_data_req
(
uint8_t
mod_id
,
uint8_t
type_id
,
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
srb_flag_t
srb_flagP
,
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
srb_flag_t
srb_flagP
,
const
MBMS_flag_t
MBMS_flagP
,
const
rb_id_t
rb_idP
,
const
mui_t
muiP
,
const
MBMS_flag_t
MBMS_flagP
,
const
rb_id_t
rb_idP
,
const
mui_t
muiP
,
...
...
openair2/LAYER2/PROTO_AGENT/proto_agent_async.c
View file @
6d092100
...
@@ -34,61 +34,35 @@
...
@@ -34,61 +34,35 @@
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/log.h"
uint16_t
proto_udp
=
0
;
proto_agent_async_channel_t
*
uint16_t
proto_tcp
=
0
;
proto_server_async_channel_info
(
mod_id_t
mod_id
,
const
char
*
ip
,
uint16_t
port
)
uint16_t
proto_sctp
=
0
;
{
LOG_E
(
PROTO_AGENT
,
"does not bind to specific address at the moment, ignoring %s
\n
"
,
ip
);
proto_agent_async_channel_t
*
proto_server_async_channel_info
(
mod_id_t
mod_id
,
char
*
dst_ip
,
uint16_t
dst_port
,
const
char
*
type
,
const
char
*
peer_addr
)
{
proto_agent_async_channel_t
*
channel
;
proto_agent_async_channel_t
*
channel
;
channel
=
(
proto_agent_async_channel_t
*
)
malloc
(
sizeof
(
proto_agent_channel_t
));
channel
=
malloc
(
sizeof
(
proto_agent_channel_t
));
channel
->
port
=
dst_port
;
channel
->
peer_addr
=
NULL
;
if
(
channel
==
NULL
)
if
(
channel
==
NULL
)
goto
error
;
goto
error
;
channel
->
port
=
port
;
channel
->
peer_addr
=
NULL
;
channel
->
enb_id
=
mod_id
;
channel
->
enb_id
=
mod_id
;
/*Create a socket*/
channel
->
link
=
new_link_udp_server
(
port
);
if
(
strcmp
(
type
,
"TCP"
)
==
0
)
{
proto_tcp
=
1
;
printf
(
"PROTO_AGENT: sTARTING TCP SERVER
\n
"
);
channel
->
link
=
new_link_server
(
dst_port
);
channel
->
type
=
0
;
}
else
if
(
strcmp
(
type
,
"UDP"
)
==
0
)
{
proto_udp
=
1
;
//channel->link = new_udp_link_server(dst_port);
channel
->
link
=
new_link_udp_server
(
dst_port
);
channel
->
type
=
1
;
channel
->
peer_addr
=
peer_addr
;
}
else
if
(
strcmp
(
type
,
"SCTP"
)
==
0
)
{
proto_sctp
=
1
;
//channel->link = new_sctp_link_server(dst_port);
channel
->
link
=
new_link_sctp_server
(
dst_port
);
channel
->
type
=
2
;
}
if
(
channel
->
link
==
NULL
)
goto
error
;
if
(
channel
->
link
==
NULL
)
goto
error
;
/*
* create a message queue
*/
channel
->
send_queue
=
new_message_queue
();
channel
->
send_queue
=
new_message_queue
();
if
(
channel
->
send_queue
==
NULL
)
goto
error
;
if
(
channel
->
send_queue
==
NULL
)
goto
error
;
channel
->
receive_queue
=
new_message_queue
();
channel
->
receive_queue
=
new_message_queue
();
if
(
channel
->
receive_queue
==
NULL
)
goto
error
;
if
(
channel
->
receive_queue
==
NULL
)
goto
error
;
/*
channel
->
manager
=
create_link_manager
(
channel
->
send_queue
,
* create a link manager
channel
->
receive_queue
,
*/
channel
->
link
,
channel
->
manager
=
create_link_manager
(
channel
->
send_queue
,
channel
->
receive_queue
,
channel
->
link
,
channel
->
type
,
channel
->
peer_addr
,
channel
->
port
);
CHANNEL_UDP
,
channel
->
peer_addr
,
channel
->
port
);
if
(
channel
->
manager
==
NULL
)
goto
error
;
if
(
channel
->
manager
==
NULL
)
goto
error
;
return
channel
;
return
channel
;
...
@@ -99,55 +73,34 @@ proto_agent_async_channel_t * proto_server_async_channel_info(mod_id_t mod_id, c
...
@@ -99,55 +73,34 @@ proto_agent_async_channel_t * proto_server_async_channel_info(mod_id_t mod_id, c
}
}
proto_agent_async_channel_t
*
proto_agent_async_channel_info
(
mod_id_t
mod_id
,
char
*
dst_ip
,
uint16_t
dst_port
,
const
char
*
type
,
const
char
*
peer_addr
)
{
proto_agent_async_channel_t
*
proto_agent_async_channel_info
(
mod_id_t
mod_id
,
const
char
*
dst_ip
,
uint16_t
dst_port
)
{
proto_agent_async_channel_t
*
channel
;
proto_agent_async_channel_t
*
channel
;
channel
=
(
proto_agent_async_channel_t
*
)
malloc
(
sizeof
(
proto_agent_channel_t
));
channel
=
(
proto_agent_async_channel_t
*
)
malloc
(
sizeof
(
proto_agent_channel_t
));
channel
->
port
=
dst_port
;
channel
->
peer_addr
=
NULL
;
if
(
channel
==
NULL
)
if
(
channel
==
NULL
)
goto
error
;
goto
error
;
channel
->
enb_id
=
mod_id
;
channel
->
port
=
dst_port
;
/*Create a socket*/
channel
->
peer_addr
=
dst_ip
;
if
(
strcmp
(
type
,
"TCP"
)
==
0
)
{
proto_tcp
=
1
;
channel
->
link
=
new_link_client
(
dst_ip
,
dst_port
);
channel
->
type
=
0
;
}
else
if
(
strcmp
(
type
,
"UDP"
)
==
0
)
{
proto_udp
=
1
;
channel
->
link
=
new_link_udp_client
(
dst_ip
,
dst_port
);
channel
->
type
=
1
;
channel
->
peer_addr
=
peer_addr
;
}
else
if
(
strcmp
(
type
,
"SCTP"
)
==
0
)
{
proto_sctp
=
1
;
channel
->
link
=
new_link_sctp_client
(
dst_ip
,
dst_port
);;
channel
->
type
=
2
;
}
channel
->
enb_id
=
mod_id
;
channel
->
link
=
new_link_udp_client
(
channel
->
peer_addr
,
channel
->
port
);
if
(
channel
->
link
==
NULL
)
goto
error
;
if
(
channel
->
link
==
NULL
)
goto
error
;
/*
* create a message queue
*/
channel
->
send_queue
=
new_message_queue
();
channel
->
send_queue
=
new_message_queue
();
if
(
channel
->
send_queue
==
NULL
)
goto
error
;
if
(
channel
->
send_queue
==
NULL
)
goto
error
;
channel
->
receive_queue
=
new_message_queue
();
channel
->
receive_queue
=
new_message_queue
();
if
(
channel
->
receive_queue
==
NULL
)
goto
error
;
if
(
channel
->
receive_queue
==
NULL
)
goto
error
;
/*
channel
->
manager
=
create_link_manager
(
channel
->
send_queue
,
* create a link manager
channel
->
receive_queue
,
*/
channel
->
link
,
channel
->
manager
=
create_link_manager
(
channel
->
send_queue
,
channel
->
receive_queue
,
channel
->
link
,
channel
->
type
,
channel
->
peer_addr
,
channel
->
port
);
CHANNEL_UDP
,
channel
->
peer_addr
,
channel
->
port
);
if
(
channel
->
manager
==
NULL
)
goto
error
;
if
(
channel
->
manager
==
NULL
)
goto
error
;
return
channel
;
return
channel
;
...
@@ -163,19 +116,12 @@ int proto_agent_async_msg_send(void *data, int size, int priority, void *channel
...
@@ -163,19 +116,12 @@ int proto_agent_async_msg_send(void *data, int size, int priority, void *channel
return
message_put
(
channel
->
send_queue
,
data
,
size
,
priority
);
return
message_put
(
channel
->
send_queue
,
data
,
size
,
priority
);
}
}
int
proto_agent_async_msg_recv
(
void
**
data
,
int
*
size
,
int
*
priority
,
void
*
channel_info
)
{
int
proto_agent_async_msg_recv
(
void
**
data
,
int
*
size
,
int
*
priority
,
void
*
channel_info
)
{
proto_agent_async_channel_t
*
channel
;
proto_agent_async_channel_t
*
channel
;
channel
=
(
proto_agent_async_channel_t
*
)
channel_info
;
channel
=
(
proto_agent_async_channel_t
*
)
channel_info
;
if
(
channel
==
NULL
)
return
0
;
else
if
(
channel
->
type
<
0
)
return
0
;
else
if
(
channel
->
receive_queue
==
NULL
)
return
0
;
else
return
message_get
(
channel
->
receive_queue
,
data
,
size
,
priority
);
return
message_get
(
channel
->
receive_queue
,
data
,
size
,
priority
);
}
}
void
proto_agent_async_release
(
proto_agent_channel_t
*
channel
)
{
void
proto_agent_async_release
(
proto_agent_channel_t
*
channel
)
{
...
...
openair2/LAYER2/PROTO_AGENT/proto_agent_async.h
View file @
6d092100
...
@@ -39,10 +39,9 @@
...
@@ -39,10 +39,9 @@
#include "proto_agent_net_comm.h"
#include "proto_agent_net_comm.h"
typedef
struct
{
typedef
struct
proto_agent_async_channel_s
{
mod_id_t
enb_id
;
mod_id_t
enb_id
;
uint16_t
type
;
// 0-> TCP, 1-> UDP, 2->SCTP
const
char
*
peer_addr
;
char
*
peer_addr
;
int
port
;
int
port
;
socket_link_t
*
link
;
socket_link_t
*
link
;
message_queue_t
*
send_queue
;
message_queue_t
*
send_queue
;
...
@@ -50,8 +49,8 @@ typedef struct {
...
@@ -50,8 +49,8 @@ typedef struct {
link_manager_t
*
manager
;
link_manager_t
*
manager
;
}
proto_agent_async_channel_t
;
}
proto_agent_async_channel_t
;
proto_agent_async_channel_t
*
proto_agent_async_channel_info
(
mod_id_t
mod_id
,
c
har
*
dst_ip
,
uint16_t
dst_port
,
const
char
*
type
,
const
char
*
peer_addr
);
proto_agent_async_channel_t
*
proto_agent_async_channel_info
(
mod_id_t
mod_id
,
c
onst
char
*
dst_ip
,
uint16_t
dst_port
);
proto_agent_async_channel_t
*
proto_server_async_channel_info
(
mod_id_t
mod_id
,
c
har
*
dst_ip
,
uint16_t
dst_port
,
const
char
*
type
,
const
char
*
peer_addr
);
proto_agent_async_channel_t
*
proto_server_async_channel_info
(
mod_id_t
mod_id
,
c
onst
char
*
ip
,
uint16_t
_port
);
int
proto_agent_async_msg_send
(
void
*
data
,
int
size
,
int
priority
,
void
*
channel_info
);
int
proto_agent_async_msg_send
(
void
*
data
,
int
size
,
int
priority
,
void
*
channel_info
);
...
...
openair2/LAYER2/PROTO_AGENT/proto_agent_defs.h
View file @
6d092100
...
@@ -100,7 +100,7 @@ typedef uint8_t mod_id_t; // module or enb id
...
@@ -100,7 +100,7 @@ typedef uint8_t mod_id_t; // module or enb id
typedef
uint8_t
lcid_t
;
typedef
uint8_t
lcid_t
;
typedef
int32_t
err_code_t
;
typedef
int32_t
err_code_t
;
#define CHANNEL_UDP 1
typedef
struct
{
typedef
struct
{
/* general info */
/* general info */
...
@@ -113,12 +113,16 @@ typedef struct {
...
@@ -113,12 +113,16 @@ typedef struct {
uint32_t
rx_msg
[
NUM_MAX_ENB
];
uint32_t
rx_msg
[
NUM_MAX_ENB
];
uint32_t
tx_msg
[
NUM_MAX_ENB
];
uint32_t
tx_msg
[
NUM_MAX_ENB
];
}
proto_agent_info_t
;
}
proto_agent_info_t
;
typedef
struct
{
/* forward declaration */
mod_id_t
enb_id
;
struct
proto_agent_channel_s
;
proto_agent_info_t
agent_info
;
}
proto_agent_instance_t
;
typedef
struct
proto_agent_instance_s
{
mod_id_t
mod_id
;
proto_agent_info_t
agent_info
;
struct
proto_agent_channel_s
*
channel
;
pthread_t
recv_thread
;
}
proto_agent_instance_t
;
#endif
#endif
openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.h
View file @
6d092100
...
@@ -41,16 +41,18 @@
...
@@ -41,16 +41,18 @@
#include "tree.h"
#include "tree.h"
#define ENB_AGENT_MAX 9
#define ENB_AGENT_MAX 9
/* forward declaration */
struct
proto_agent_async_channel_s
;
/*Channel related information used for Tx/Rx of protocol messages*/
/*Channel related information used for Tx/Rx of protocol messages*/
typedef
struct
proto_agent_channel_s
{
typedef
struct
proto_agent_channel_s
{
RB_ENTRY
(
proto_agent_channel_s
)
entry
;
RB_ENTRY
(
proto_agent_channel_s
)
entry
;
int
channel_id
;
int
channel_id
;
void
*
channel_info
;
struct
proto_agent_async_channel_s
*
channel_info
;
uint16_t
type
;
// 0-> TCP, 1-> UDP, 2->SCTP
/*Callbacks for channel message Tx and Rx*/
/*Callbacks for channel message Tx and Rx*/
int
(
*
msg_send
)(
void
*
data
,
int
size
,
int
priority
,
void
*
channel_info
);
int
(
*
msg_send
)(
void
*
data
,
int
size
,
int
priority
,
void
*
channel_info
);
int
(
*
msg_recv
)(
void
**
data
,
int
*
size
,
int
*
priority
,
void
*
channel_info
);
int
(
*
msg_recv
)(
void
**
data
,
int
*
size
,
int
*
priority
,
void
*
channel_info
);
void
(
*
release
)(
struct
proto_agent_channel_s
*
channel
);
void
(
*
release
)(
struct
proto_agent_channel_s
*
channel
);
}
proto_agent_channel_t
;
}
proto_agent_channel_t
;
typedef
struct
proto_agent_channel_instance_s
{
typedef
struct
proto_agent_channel_instance_s
{
...
...
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