Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Worker.N
openairinterface5G
Commits
e6762ffe
Commit
e6762ffe
authored
9 years ago
by
Xenofon Foukas
Browse files
Options
Downloads
Patches
Plain Diff
Added support for multiple eNBs in an emulation environment
parent
dbcf482f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openair2/ENB_APP/enb_agent_net_comm.c
+24
-20
24 additions, 20 deletions
openair2/ENB_APP/enb_agent_net_comm.c
openair2/ENB_APP/enb_agent_net_comm.h
+4
-4
4 additions, 4 deletions
openair2/ENB_APP/enb_agent_net_comm.h
with
28 additions
and
24 deletions
openair2/ENB_APP/enb_agent_net_comm.c
+
24
−
20
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
;
...
...
This diff is collapsed.
Click to expand it.
openair2/ENB_APP/enb_agent_net_comm.h
+
4
−
4
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
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment