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
canghaiwuhen
OpenXG-RAN
Commits
dec1c93c
Commit
dec1c93c
authored
Jan 22, 2016
by
Xenofon Foukas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed channel struct for async_channel implementation
parent
a054eb81
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
15 deletions
+23
-15
openair2/ENB_APP/enb_agent_async.c
openair2/ENB_APP/enb_agent_async.c
+11
-11
openair2/ENB_APP/enb_agent_async.h
openair2/ENB_APP/enb_agent_async.h
+9
-1
openair2/ENB_APP/enb_agent_net_comm.c
openair2/ENB_APP/enb_agent_net_comm.c
+3
-3
No files found.
openair2/ENB_APP/enb_agent_async.c
View file @
dec1c93c
...
...
@@ -39,21 +39,21 @@
#include "log.h"
enb_agent_
instance
_t
*
enb_agent_async_channel_info
(
mid_t
mod_id
,
char
*
dst_ip
,
uint16_t
dst_port
)
{
enb_agent_
async_channel
_t
*
enb_agent_async_channel_info
(
mid_t
mod_id
,
char
*
dst_ip
,
uint16_t
dst_port
)
{
enb_agent_
instance
_t
*
channel
;
channel
=
(
enb_agent_
instance_t
*
)
malloc
(
sizeof
(
enb_agent_instance
_t
));
enb_agent_
async_channel
_t
*
channel
;
channel
=
(
enb_agent_
async_channel_t
*
)
malloc
(
sizeof
(
enb_agent_channel
_t
));
if
(
channel
==
NULL
)
goto
error
;
channel
->
mod
_id
=
mod_id
;
channel
->
enb
_id
=
mod_id
;
/*Create a socket*/
channel
->
link
=
new_link_client
(
dst_ip
,
dst_port
);
if
(
channel
->
link
==
NULL
)
goto
error
;
LOG_I
(
ENB_AGENT
,
"starting enb agent client for module id %d on ipv4 %s, port %d
\n
"
,
channel
->
mod
_id
,
channel
->
enb
_id
,
dst_ip
,
dst_port
);
...
...
@@ -80,22 +80,22 @@ enb_agent_instance_t * enb_agent_async_channel_info(mid_t mod_id, char *dst_ip,
}
int
enb_agent_async_msg_send
(
void
*
data
,
int
size
,
int
priority
,
void
*
channel_info
)
{
enb_agent_
instance
_t
*
channel
;
channel
=
(
enb_agent_
instance
_t
*
)
channel_info
;
enb_agent_
async_channel
_t
*
channel
;
channel
=
(
enb_agent_
channel
_t
*
)
channel_info
;
return
message_put
(
channel
->
send_queue
,
data
,
size
,
priority
);
}
int
enb_agent_async_msg_recv
(
void
**
data
,
int
*
size
,
int
*
priority
,
void
*
channel_info
)
{
enb_agent_
instance
_t
*
channel
;
channel
=
(
enb_agent_
instance
_t
*
)
channel_info
;
enb_agent_
async_channel
_t
*
channel
;
channel
=
(
enb_agent_
async_channel
_t
*
)
channel_info
;
return
message_get
(
channel
->
receive_queue
,
data
,
size
,
priority
);
}
void
enb_agent_async_release
(
enb_agent_channel_t
*
channel
)
{
enb_agent_
instance
_t
*
channel_info
;
channel_info
=
(
enb_agent_
instance
_t
*
)
channel
->
channel_info
;
enb_agent_
async_channel
_t
*
channel_info
;
channel_info
=
(
enb_agent_
async_channel
_t
*
)
channel
->
channel_info
;
destroy_link_manager
(
channel_info
->
manager
);
...
...
openair2/ENB_APP/enb_agent_async.h
View file @
dec1c93c
...
...
@@ -39,7 +39,15 @@
#include "enb_agent_net_comm.h"
enb_agent_instance_t
*
enb_agent_async_channel_info
(
mid_t
mod_id
,
char
*
dst_ip
,
uint16_t
dst_port
);
typedef
struct
{
mid_t
enb_id
;
socket_link_t
*
link
;
message_queue_t
*
send_queue
;
message_queue_t
*
receive_queue
;
link_manager_t
*
manager
;
}
enb_agent_async_channel_t
;
enb_agent_async_channel_t
*
enb_agent_async_channel_info
(
mid_t
mod_id
,
char
*
dst_ip
,
uint16_t
dst_port
);
int
enb_agent_async_msg_send
(
void
*
data
,
int
size
,
int
priority
,
void
*
channel_info
);
...
...
openair2/ENB_APP/enb_agent_net_comm.c
View file @
dec1c93c
...
...
@@ -37,7 +37,7 @@
#include "enb_agent_net_comm.h"
#include "log.h"
enb_agent_channel_t
*
agent_channel
[
NUM_MAX_ENB
_AGENT
][
ENB_AGENT_MAX
];
enb_agent_channel_t
*
agent_channel
[
NUM_MAX_ENB
][
ENB_AGENT_MAX
];
enb_agent_channel_instance_t
channel_instance
;
int
enb_agent_channel_id
=
0
;
...
...
@@ -146,7 +146,7 @@ int enb_agent_destroy_channel(int channel_id) {
}
/*Unregister the channel from all agents*/
for
(
i
=
0
;
i
<
NUM_MAX_ENB
_AGENT
;
i
++
)
{
for
(
i
=
0
;
i
<
NUM_MAX_ENB
;
i
++
)
{
for
(
j
=
0
;
j
<
ENB_AGENT_MAX
;
j
++
)
{
if
(
agent_channel
[
i
][
j
]
!=
NULL
)
{
if
(
agent_channel
[
i
][
j
]
->
channel_id
==
e
->
channel_id
)
{
...
...
@@ -170,7 +170,7 @@ err_code_t enb_agent_init_channel_container(void) {
RB_INIT
(
&
channel_instance
.
enb_agent_head
);
for
(
i
=
0
;
i
<
NUM_MAX_ENB
_AGENT
;
i
++
)
{
for
(
i
=
0
;
i
<
NUM_MAX_ENB
;
i
++
)
{
for
(
j
=
0
;
j
<
ENB_AGENT_MAX
;
j
++
)
{
agent_channel
[
i
][
j
]
==
NULL
;
}
...
...
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