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
promise
OpenXG-RAN
Commits
e996f5d0
Commit
e996f5d0
authored
Nov 17, 2017
by
Navid Nikaein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new RAN APIs form SMA app based on the initial eNb config file
parent
c8c4b423
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
303 additions
and
32 deletions
+303
-32
openair2/ENB_APP/flexran_agent_common_internal.c
openair2/ENB_APP/flexran_agent_common_internal.c
+158
-5
openair2/ENB_APP/flexran_agent_common_internal.h
openair2/ENB_APP/flexran_agent_common_internal.h
+6
-2
openair2/ENB_APP/flexran_agent_ran_api.c
openair2/ENB_APP/flexran_agent_ran_api.c
+118
-21
openair2/ENB_APP/flexran_agent_ran_api.h
openair2/ENB_APP/flexran_agent_ran_api.h
+21
-4
No files found.
openair2/ENB_APP/flexran_agent_common_internal.c
View file @
e996f5d0
...
...
@@ -21,8 +21,8 @@
/*! \file flexran_agent_common_internal.c
* \brief internal functions for common message primitves and utilities
* \author Xenofon Foukas
* \date 201
6
* \author Xenofon Foukas
and N. Nikaein
* \date 201
7
* \version 0.1
*/
...
...
@@ -31,6 +31,7 @@
#include "flexran_agent_common_internal.h"
#include "flexran_agent_mac_internal.h"
extern
volatile
int
reconfigure_enb
;
int
apply_reconfiguration_policy
(
mid_t
mod_id
,
const
char
*
policy
,
size_t
policy_length
)
{
...
...
@@ -64,7 +65,17 @@ int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy
break
;
case
YAML_SCALAR_EVENT
:
// Check the system name and call the proper handler
if
(
strcmp
((
char
*
)
event
.
data
.
scalar
.
value
,
"mac"
)
==
0
)
{
// Check the system name and call the proper handler
if
(
strcmp
((
char
*
)
event
.
data
.
scalar
.
value
,
"enb"
)
==
0
)
{
LOG_I
(
ENB_APP
,
"This is intended for the enb system
\n
"
);
// Call the enb handler
if
(
parse_enb_id
(
mod_id
,
&
parser
)
==
-
1
)
{
goto
error
;
}
else
{
// succeful parse and setting
LOG_I
(
ENB_APP
,
"Successful parsed config for enb system
\n
"
);
//reconfigure_enb=RECONF_FREQ;
}
}
else
if
(
strcmp
((
char
*
)
event
.
data
.
scalar
.
value
,
"mac"
)
==
0
)
{
LOG_D
(
ENB_APP
,
"This is intended for the mac system
\n
"
);
// Call the mac handler
if
(
parse_mac_config
(
mod_id
,
&
parser
)
==
-
1
)
{
...
...
@@ -90,8 +101,8 @@ int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy
// TODO : Just skip it for now
if
(
skip_system_section
(
&
parser
)
==
-
1
)
{
goto
error
;
}
}
else
{
}
}
else
{
goto
error
;
}
break
;
...
...
@@ -115,6 +126,148 @@ int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy
}
int
parse_enb_id
(
mid_t
mod_id
,
yaml_parser_t
*
parser
)
{
yaml_event_t
event
;
void
*
param
;
char
*
endptr
;
int
is_array
=
0
;
int
i
=
0
;
int
done
=
0
;
int
mapping_started
=
0
;
while
(
!
done
)
{
if
(
!
yaml_parser_parse
(
parser
,
&
event
))
goto
error
;
switch
(
event
.
type
)
{
// We are expecting a mapping of parameters
case
YAML_SEQUENCE_START_EVENT
:
is_array
=
1
;
break
;
case
YAML_MAPPING_START_EVENT
:
LOG_D
(
ENB_APP
,
"The mapping of the parameters started
\n
"
);
mapping_started
=
1
;
break
;
case
YAML_MAPPING_END_EVENT
:
LOG_D
(
ENB_APP
,
"The mapping of the parameters ended
\n
"
);
mapping_started
=
0
;
break
;
case
YAML_SCALAR_EVENT
:
if
(
!
mapping_started
)
{
goto
error
;
}
// Check what key needs to be set
// use eNB egistered
if
(
mac_agent_registered
[
mod_id
])
{
LOG_I
(
ENB_APP
,
"Setting parameter for eNB %s
\n
"
,
event
.
data
.
scalar
.
value
);
if
(
strcmp
((
char
*
)
event
.
data
.
scalar
.
tag
,
YAML_INT_TAG
)
==
0
)
{
// if int
if
((
strtol
((
char
*
)
event
.
data
.
scalar
.
value
,
&
endptr
,
10
))
==
mod_id
)
{
// enb_id == mod_id: right enb instance to be configured
if
(
parse_enb_config_parameters
(
mod_id
,
parser
)
==
-
1
)
{
goto
error
;
}
}
else
{
goto
error
;
// not the expected type
}
}
}
break
;
default:
goto
error
;
}
done
=
(
event
.
type
==
YAML_MAPPING_END_EVENT
);
yaml_event_delete
(
&
event
);
}
return
0
;
error:
yaml_event_delete
(
&
event
);
return
-
1
;
}
int
parse_enb_config_parameters
(
mid_t
mod_id
,
yaml_parser_t
*
parser
)
{
yaml_event_t
event
;
void
*
param
;
char
*
endptr
;
int
done
=
0
;
int
mapping_started
=
0
;
while
(
!
done
)
{
if
(
!
yaml_parser_parse
(
parser
,
&
event
))
goto
error
;
switch
(
event
.
type
)
{
// We are expecting a mapping of parameters
case
YAML_MAPPING_START_EVENT
:
LOG_D
(
ENB_APP
,
"The mapping of the parameters started
\n
"
);
mapping_started
=
1
;
break
;
case
YAML_MAPPING_END_EVENT
:
LOG_D
(
ENB_APP
,
"The mapping of the parameters ended
\n
"
);
mapping_started
=
0
;
break
;
case
YAML_SCALAR_EVENT
:
if
(
!
mapping_started
)
{
goto
error
;
}
// Check what key needs to be set
LOG_I
(
ENB_APP
,
"Setting parameter %s
\n
"
,
event
.
data
.
scalar
.
value
);
if
(
strcmp
((
char
*
)
event
.
data
.
scalar
.
value
,
"dl_freq"
)
==
0
)
{
if
(
!
yaml_parser_parse
(
parser
,
&
event
))
goto
error
;
flexran_agent_set_operating_dl_freq
(
mod_id
,
0
,
strtol
((
char
*
)
event
.
data
.
scalar
.
value
,
&
endptr
,
10
));
LOG_I
(
ENB_APP
,
"Setting parameter value %s
\n
"
,
event
.
data
.
scalar
.
value
);
}
else
if
(
strcmp
((
char
*
)
event
.
data
.
scalar
.
value
,
"ul_freq_offset"
)
==
0
)
{
if
(
!
yaml_parser_parse
(
parser
,
&
event
))
goto
error
;
flexran_agent_set_operating_ul_freq
(
mod_id
,
0
,
strtol
((
char
*
)
event
.
data
.
scalar
.
value
,
&
endptr
,
10
));
LOG_I
(
ENB_APP
,
"Setting parameter value %s
\n
"
,
event
.
data
.
scalar
.
value
);
}
else
if
(
strcmp
((
char
*
)
event
.
data
.
scalar
.
value
,
"bandwidth"
)
==
0
)
{
if
(
!
yaml_parser_parse
(
parser
,
&
event
))
goto
error
;
flexran_agent_set_operating_bandwidth
(
mod_id
,
0
,
strtol
((
char
*
)
event
.
data
.
scalar
.
value
,
&
endptr
,
10
));
LOG_I
(
ENB_APP
,
"Setting parameter value %s
\n
"
,
event
.
data
.
scalar
.
value
);
}
else
if
(
strcmp
((
char
*
)
event
.
data
.
scalar
.
value
,
"frame_type"
)
==
0
)
{
if
(
!
yaml_parser_parse
(
parser
,
&
event
))
goto
error
;
flexran_agent_set_operating_frame_type
(
mod_id
,
0
,
strtol
((
char
*
)
event
.
data
.
scalar
.
value
,
&
endptr
,
10
));
LOG_I
(
ENB_APP
,
"Setting parameter value %s
\n
"
,
event
.
data
.
scalar
.
value
);
}
else
{
// not supported tag
goto
error
;
}
break
;
default:
goto
error
;
}
done
=
(
event
.
type
==
YAML_MAPPING_END_EVENT
);
yaml_event_delete
(
&
event
);
}
return
0
;
error:
yaml_event_delete
(
&
event
);
return
-
1
;
}
int
skip_system_section
(
yaml_parser_t
*
parser
)
{
yaml_event_t
event
;
...
...
openair2/ENB_APP/flexran_agent_common_internal.h
View file @
e996f5d0
...
...
@@ -21,8 +21,8 @@
/*! \file flexran_agent_common_internal.h
* \brief internal agent functions for common message primitves and utilities
* \author Xenofon Foukas
* \date 201
6
* \author Xenofon Foukas
and N. Nikaein
* \date 201
7
* \version 0.1
*/
...
...
@@ -37,6 +37,10 @@ int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy
int
apply_parameter_modification
(
void
*
parameter
,
yaml_parser_t
*
parser
);
int
parse_enb_id
(
mid_t
mod_id
,
yaml_parser_t
*
parser
);
int
parse_enb_config_parameters
(
mid_t
mod_id
,
yaml_parser_t
*
parser
)
;
// This can be used when parsing for a specific system that is not yet implmeneted
// in order to skip its configuration, without affecting the rest
int
skip_system_section
(
yaml_parser_t
*
parser
);
...
...
openair2/ENB_APP/flexran_agent_ran_api.c
View file @
e996f5d0
This diff is collapsed.
Click to expand it.
openair2/ENB_APP/flexran_agent_ran_api.h
View file @
e996f5d0
...
...
@@ -21,7 +21,7 @@
/*! \file flexran_agent_ran_api.h
* \brief FlexRAN RAN API abstraction header
* \author
shahab
SHARIAT BAGHERI
* \author
N. Nikaein, X. Foukas and S.
SHARIAT BAGHERI
* \date 2017
* \version 0.1
*/
...
...
@@ -198,6 +198,8 @@ int flexran_get_p0_pucch_status(mid_t mod_id, mid_t ue_id, int CC_id);
int
flexran_update_p0_pucch
(
mid_t
mod_id
,
mid_t
ue_id
,
int
CC_id
);
int
flexran_get_threequarter_fs
(
mid_t
mod_id
,
int
CC_id
);
int
flexran_get_hopping_mode
(
mid_t
mod_id
,
int
CC_id
);
int
flexran_get_hopping_offset
(
mid_t
mod_id
,
int
CC_id
);
...
...
@@ -301,10 +303,10 @@ int flexran_get_lcg(mid_t ue_id, mid_t lc_id);
int
flexran_get_direction
(
mid_t
ue_id
,
mid_t
lc_id
);
/*Get downlink frequency*/
floa
t
flexran_agent_get_operating_dl_freq
(
mid_t
mod_id
,
int
cc_id
);
uint32_
t
flexran_agent_get_operating_dl_freq
(
mid_t
mod_id
,
int
cc_id
);
/*Get uplink frequency*/
floa
t
flexran_agent_get_operating_ul_freq
(
mid_t
mod_id
,
int
cc_id
);
uint32_
t
flexran_agent_get_operating_ul_freq
(
mid_t
mod_id
,
int
cc_id
);
/*Get eutra band*/
int
flexran_agent_get_operating_eutra_band
(
mid_t
mod_id
,
int
cc_id
);
...
...
@@ -315,5 +317,20 @@ int flexran_agent_get_operating_pdsch_refpower (mid_t mod_id, int cc_id);
/*Get uplink power*/
int
flexran_agent_get_operating_pusch_p0
(
mid_t
mod_id
,
int
cc_id
);
/*set the dl freq */
void
flexran_agent_set_operating_dl_freq
(
mid_t
mod_id
,
int
cc_id
,
uint32_t
dl_freq_mhz
);
/* set the ul freq */
void
flexran_agent_set_operating_ul_freq
(
mid_t
mod_id
,
int
cc_id
,
int32_t
ul_freq_offset_mhz
);
/*set the the band */
void
flexran_agent_set_operating_eutra_band
(
mid_t
mod_id
,
int
cc_id
);
/* set the bandwidth */
void
flexran_agent_set_operating_bandwidth
(
mid_t
mod_id
,
int
cc_id
,
int
bandwidth
);
/*set frame type*/
void
flexran_agent_set_operating_frame_type
(
mid_t
mod_id
,
int
cc_id
,
int
frame_type
);
/*RRC status flexRAN*/
int
flexran_get_rrc_status
(
const
mid_t
mod_id
,
const
rnti_t
rntiP
);
\ No newline at end of file
int
flexran_get_rrc_status
(
const
mid_t
mod_id
,
const
rnti_t
rntiP
);
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