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
30527f14
Commit
30527f14
authored
Jan 14, 2016
by
Xenofon Foukas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Channel implementation for async interface
parent
5c54d2fb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
159 additions
and
0 deletions
+159
-0
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+1
-0
openair2/ENB_APP/enb_agent_async.c
openair2/ENB_APP/enb_agent_async.c
+107
-0
openair2/ENB_APP/enb_agent_async.h
openair2/ENB_APP/enb_agent_async.h
+51
-0
No files found.
cmake_targets/CMakeLists.txt
View file @
30527f14
...
@@ -748,6 +748,7 @@ if (ENB_AGENT_SB_IF)
...
@@ -748,6 +748,7 @@ if (ENB_AGENT_SB_IF)
${
OPENAIR2_DIR
}
/ENB_APP/enb_agent.c
${
OPENAIR2_DIR
}
/ENB_APP/enb_agent.c
${
OPENAIR2_DIR
}
/ENB_APP/enb_agent_task_manager.c
${
OPENAIR2_DIR
}
/ENB_APP/enb_agent_task_manager.c
${
OPENAIR2_DIR
}
/ENB_APP/enb_agent_net_comm.c
${
OPENAIR2_DIR
}
/ENB_APP/enb_agent_net_comm.c
${
OPENAIR2_DIR
}
/ENB_APP/enb_agent_async.c
)
)
set
(
ENB_AGENT_LIB ENB_AGENT
)
set
(
ENB_AGENT_LIB ENB_AGENT
)
#include_directories(${OPENAIR2_DIR}/ENB_APP)
#include_directories(${OPENAIR2_DIR}/ENB_APP)
...
...
openair2/ENB_APP/enb_agent_async.c
0 → 100644
View file @
30527f14
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*! \file enb_agent_async.c
* \brief channel implementation for async interface
* \author Xenofon Foukas
* \date 2016
* \version 0.1
*/
#include "enb_agent_async.h"
#include "enb_agent_defs.h"
#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_instance_t
*
channel
;
channel
=
(
enb_agent_instance_t
*
)
malloc
(
sizeof
(
enb_agent_instance_t
));
if
(
channel
==
NULL
)
goto
error
;
channel
->
mod_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
,
dst_ip
,
dst_port
);
/*
* create a message queue
*/
channel
->
send_queue
=
new_message_queue
();
if
(
channel
->
send_queue
==
NULL
)
goto
error
;
channel
->
receive_queue
=
new_message_queue
();
if
(
channel
->
receive_queue
==
NULL
)
goto
error
;
/*
* create a link manager
*/
channel
->
manager
=
create_link_manager
(
channel
->
send_queue
,
channel
->
receive_queue
,
channel
->
link
);
if
(
channel
->
manager
==
NULL
)
goto
error
;
return
channel
;
error:
LOG_I
(
ENB_AGENT
,
"there was an error
\n
"
);
return
1
;
}
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
;
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
;
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
;
destroy_link_manager
(
channel_info
->
manager
);
destroy_message_queue
(
channel_info
->
send_queue
);
destroy_message_queue
(
channel_info
->
receive_queue
);
close_link
(
channel_info
->
link
);
free
(
channel_info
);
}
openair2/ENB_APP/enb_agent_async.h
0 → 100644
View file @
30527f14
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*! \file enb_agent_async.h
* \brief channel implementation for async interface
* \author Xenofon Foukas
* \date 2016
* \version 0.1
*/
#ifndef ENB_AGENT_ASYNC_H_
#define ENB_AGENT_ASYNC_H_
#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
);
int
enb_agent_async_msg_send
(
void
*
data
,
int
size
,
int
priority
,
void
*
channel_info
);
int
enb_agent_async_msg_recv
(
void
**
data
,
int
*
size
,
int
*
priority
,
void
*
channel_info
);
void
enb_agent_async_release
(
enb_agent_channel_t
*
channel
);
#endif
/*ENB_AGENT_ASYNC_H_*/
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