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
e6762ffe
Commit
e6762ffe
authored
Jan 14, 2016
by
Xenofon Foukas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for multiple eNBs in an emulation environment
parent
dbcf482f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
24 deletions
+28
-24
openair2/ENB_APP/enb_agent_net_comm.c
openair2/ENB_APP/enb_agent_net_comm.c
+24
-20
openair2/ENB_APP/enb_agent_net_comm.h
openair2/ENB_APP/enb_agent_net_comm.h
+4
-4
No files found.
openair2/ENB_APP/enb_agent_net_comm.c
View file @
e6762ffe
...
...
@@ -37,17 +37,17 @@
#include "enb_agent_net_comm.h"
#include "log.h"
enb_agent_channel_t
*
agent_channel
[
ENB_AGENT_MAX
];
enb_agent_channel_t
*
agent_channel
[
NUM_MAX_ENB_AGENT
][
ENB_AGENT_MAX
];
enb_agent_channel_instance_t
channel_instance
;
int
enb_agent_channel_id
=
0
;
int
enb_agent_msg_send
(
void
*
data
,
int
size
,
int
priority
,
agent_id_t
agent_id
)
{
int
enb_agent_msg_send
(
mid_t
mod_id
,
agent_id_t
agent_id
,
void
*
data
,
int
size
,
int
priority
)
{
/*Check if agent id is valid*/
if
(
agent_id
>=
ENB_AGENT_MAX
||
agent_id
<
0
)
{
goto
error
;
}
enb_agent_channel_t
*
channel
;
channel
=
agent_channel
[
agent_id
];
channel
=
agent_channel
[
mod_id
][
agent_id
];
/*Check if agent has a channel registered*/
if
(
channel
==
NULL
)
{
...
...
@@ -61,13 +61,13 @@ int enb_agent_msg_send(void *data, int size, int priority, agent_id_t agent_id)
return
-
1
;
}
int
enb_agent_msg_recv
(
void
**
data
,
int
*
size
,
int
*
priority
,
agent_id_t
agent_id
)
{
int
enb_agent_msg_recv
(
mid_t
mod_id
,
agent_id_t
agent_id
,
void
**
data
,
int
*
size
,
int
*
priority
)
{
/*Check if agent id is valid*/
if
(
agent_id
>=
ENB_AGENT_MAX
||
agent_id
<
0
)
{
goto
error
;
}
enb_agent_channel_t
*
channel
;
channel
=
agent_channel
[
agent_id
];
channel
=
agent_channel
[
mod_id
][
agent_id
];
/*Check if agent has a channel registered*/
if
(
channel
==
NULL
)
{
...
...
@@ -81,7 +81,7 @@ int enb_agent_msg_recv(void **data, int *size, int *priority, agent_id_t agent_i
return
-
1
;
}
int
enb_agent_register_channel
(
enb_agent_channel_t
*
channel
,
agent_id_t
agent_id
)
{
int
enb_agent_register_channel
(
mid_t
mod_id
,
enb_agent_channel_t
*
channel
,
agent_id_t
agent_id
)
{
int
i
;
if
(
channel
==
NULL
)
{
...
...
@@ -90,23 +90,23 @@ int enb_agent_register_channel(enb_agent_channel_t *channel, agent_id_t agent_id
if
(
agent_id
==
ENB_AGENT_MAX
)
{
for
(
i
=
0
;
i
<
ENB_AGENT_MAX
;
i
++
)
{
agent_channel
[
i
]
=
channel
;
agent_channel
[
mod_id
][
i
]
=
channel
;
}
}
else
{
agent_channel
[
agent_id
]
=
channel
;
agent_channel
[
mod_id
][
agent_id
]
=
channel
;
}
return
0
;
}
void
enb_agent_unregister_channel
(
agent_id_t
agent_id
)
{
void
enb_agent_unregister_channel
(
mid_t
mod_id
,
agent_id_t
agent_id
)
{
int
i
;
if
(
agent_id
==
ENB_AGENT_MAX
)
{
for
(
i
=
0
;
i
<
ENB_AGENT_MAX
;
i
++
)
{
agent_channel
[
i
]
=
NULL
;
agent_channel
[
mod_id
][
i
]
=
NULL
;
}
}
else
{
agent_channel
[
agent_id
]
=
NULL
;
agent_channel
[
mod_id
][
agent_id
]
=
NULL
;
}
}
...
...
@@ -132,7 +132,7 @@ int enb_agent_create_channel(void *channel_info,
}
int
enb_agent_destroy_channel
(
int
channel_id
)
{
int
i
;
int
i
,
j
;
/*Check to see if channel exists*/
struct
enb_agent_channel_s
*
e
=
NULL
;
...
...
@@ -146,10 +146,12 @@ int enb_agent_destroy_channel(int channel_id) {
}
/*Unregister the channel from all agents*/
for
(
i
=
0
;
i
<
ENB_AGENT_MAX
;
i
++
)
{
if
(
agent_channel
[
i
]
!=
NULL
)
{
if
(
agent_channel
[
i
]
->
channel_id
==
e
->
channel_id
)
{
agent_channel
[
i
]
==
NULL
;
for
(
i
=
0
;
i
<
NUM_MAX_ENB_AGENT
;
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
)
{
agent_channel
[
i
][
j
]
==
NULL
;
}
}
}
}
...
...
@@ -163,13 +165,15 @@ int enb_agent_destroy_channel(int channel_id) {
}
err_code_t
enb_agent_init_channel_container
(
void
)
{
int
i
;
int
i
,
j
;
LOG_I
(
ENB_AGENT
,
"init RB tree for channel container
\n
"
);
RB_INIT
(
&
channel_instance
.
enb_agent_head
);
for
(
i
=
0
;
i
<
ENB_AGENT_MAX
;
i
++
)
{
agent_channel
[
i
]
==
NULL
;
for
(
i
=
0
;
i
<
NUM_MAX_ENB_AGENT
;
i
++
)
{
for
(
j
=
0
;
j
<
ENB_AGENT_MAX
;
j
++
)
{
agent_channel
[
i
][
j
]
==
NULL
;
}
}
return
0
;
...
...
openair2/ENB_APP/enb_agent_net_comm.h
View file @
e6762ffe
...
...
@@ -56,16 +56,16 @@ typedef struct enb_agent_channel_instance_s{
}
enb_agent_channel_instance_t
;
/*Send and receive messages using the channel registered for a specific agent*/
int
enb_agent_msg_send
(
void
*
data
,
int
size
,
int
priority
,
agent_id_t
agent_id
);
int
enb_agent_msg_send
(
mid_t
mod_id
,
agent_id_t
agent_id
,
void
*
data
,
int
size
,
int
priority
);
int
enb_agent_msg_recv
(
void
**
data
,
int
*
size
,
int
*
priority
,
agent_id_t
agent_id
);
int
enb_agent_msg_recv
(
mid_t
mod_id
,
agent_id_t
agent_id
,
void
**
data
,
int
*
size
,
int
*
priority
);
/*Register a channel to an agent. Use ENB_AGENT_MAX to register the
*same channel to all agents*/
int
enb_agent_register_channel
(
enb_agent_channel_t
*
channel
,
agent_id_t
agent_id
);
int
enb_agent_register_channel
(
mid_t
mod_id
,
enb_agent_channel_t
*
channel
,
agent_id_t
agent_id
);
/*Unregister the current channel of an agent. Use ENB_AGENT_MAX to unregister all channels*/
void
enb_agent_unregister_channel
(
agent_id_t
agent_id
);
void
enb_agent_unregister_channel
(
mid_t
mod_id
,
agent_id_t
agent_id
);
/*Create a new channel. Returns the id of the new channel or negative number otherwise*/
int
enb_agent_create_channel
(
void
*
channel_info
,
...
...
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