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
wangwenhui
OpenXG-RAN
Commits
61344db9
Commit
61344db9
authored
Aug 29, 2019
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FlexRAN delegation: mapper function to return path name
parent
f63cf659
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
openair2/ENB_APP/flexran_agent_common.c
openair2/ENB_APP/flexran_agent_common.c
+13
-11
openair2/ENB_APP/flexran_agent_common.h
openair2/ENB_APP/flexran_agent_common.h
+6
-1
No files found.
openair2/ENB_APP/flexran_agent_common.c
View file @
61344db9
...
...
@@ -478,20 +478,22 @@ int flexran_agent_destroy_control_delegation(Protocol__FlexranMessage *msg) {
return
0
;
}
void
*
flexran_agent_load_delegated_code
(
mid_t
mod_id
,
const
char
*
name
)
{
char
target
[
512
];
int
len
=
snprintf
(
target
,
sizeof
(
target
)
,
"%s/libflex.%s.so"
,
int
flexran_agent_map_name_to_delegated_object
(
mid_t
mod_id
,
const
char
*
name
,
char
*
path
,
int
maxlen
)
{
int
len
=
snprintf
(
path
,
maxlen
,
"%s/libflex.%s.so"
,
RC
.
flexran
[
mod_id
]
->
cache_name
,
name
);
if
(
len
>=
sizeof
(
target
)
)
{
LOG_E
(
FLEXRAN_AGENT
,
"
target
has been truncated, cannot read object
\n
"
);
return
0
;
if
(
len
>=
maxlen
)
{
LOG_E
(
FLEXRAN_AGENT
,
"
path
has been truncated, cannot read object
\n
"
);
return
-
1
;
}
LOG_I
(
FLEXRAN_AGENT
,
"Opening pushed code: %s
\n
"
,
target
);
void
*
lib
=
dlopen
(
target
,
RTLD_NOW
);
if
(
lib
==
NULL
)
LOG_E
(
FLEXRAN_AGENT
,
"Could not load library: %s
\n
"
,
dlerror
());
return
lib
;
struct
stat
buf
;
int
status
=
stat
(
path
,
&
buf
);
if
(
status
<
0
)
{
LOG_E
(
FLEXRAN_AGENT
,
"Could not stat object %s: %s
\n
"
,
path
,
strerror
(
errno
));
return
-
1
;
}
return
0
;
}
int
flexran_agent_reconfiguration
(
mid_t
mod_id
,
const
void
*
params
,
Protocol__FlexranMessage
**
msg
)
{
...
...
openair2/ENB_APP/flexran_agent_common.h
View file @
61344db9
...
...
@@ -131,7 +131,12 @@ int flexran_agent_destroy_lc_config_request(Protocol__FlexranMessage *msg);
/* Control delegation message constructor and destructor */
int
flexran_agent_control_delegation
(
mid_t
mod_id
,
const
void
*
params
,
Protocol__FlexranMessage
**
msg
);
int
flexran_agent_destroy_control_delegation
(
Protocol__FlexranMessage
*
msg
);
void
*
flexran_agent_load_delegated_code
(
mid_t
mod_id
,
const
char
*
name
);
/* Map a name from a control_delegation message to a file name. The function
* stat()s the file to check existence and returns the complete path name in
* path. The length in path needs to be maxlen, the maximum length the path may
* have. */
int
flexran_agent_map_name_to_delegated_object
(
mid_t
mod_id
,
const
char
*
name
,
char
*
path
,
int
maxlen
);
/* Policy reconfiguration message constructor and destructor */
int
flexran_agent_reconfiguration
(
mid_t
mod_id
,
const
void
*
params
,
Protocol__FlexranMessage
**
msg
);
...
...
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