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
84fa851d
Commit
84fa851d
authored
Jul 12, 2016
by
Frédéric Leroy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UE/ESM: use static buffer per UE to allow reentrancy in esm_sap.c
parent
7ff4939d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
19 deletions
+8
-19
openair3/NAS/UE/ESM/SAP/esm_sap.c
openair3/NAS/UE/ESM/SAP/esm_sap.c
+6
-19
openair3/NAS/UE/ESM/esmData.h
openair3/NAS/UE/ESM/esmData.h
+2
-0
No files found.
openair3/NAS/UE/ESM/SAP/esm_sap.c
View file @
84fa851d
...
...
@@ -95,12 +95,6 @@ static const char *_esm_sap_primitive_str[] = {
"ESM_UNITDATA_IND"
,
};
/*
* Buffer used to encode ESM messages before being returned to the EPS
* Mobility Management sublayer in order to be sent onto the network
*/
#define ESM_SAP_BUFFER_SIZE 4096
static
char
_esm_sap_buffer
[
ESM_SAP_BUFFER_SIZE
];
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
...
...
@@ -148,6 +142,7 @@ int esm_sap_send(nas_user_t *user, esm_sap_t *msg)
{
LOG_FUNC_IN
;
esm_data_t
*
esm_data
=
user
->
esm_data
;
msg
->
send
.
value
=
esm_data
->
send_buffer
;
int
rc
=
RETURNerror
;
int
pid
;
...
...
@@ -359,7 +354,6 @@ int esm_sap_send(nas_user_t *user, esm_sap_t *msg)
** turned upon ESM procedure completion **
** err: Error code of the ESM procedure **
** Return: RETURNok, RETURNerror **
** Others: _esm_sap_buffer **
** **
***************************************************************************/
static
int
_esm_sap_recv
(
nas_user_t
*
user
,
int
msg_type
,
int
is_standalone
,
...
...
@@ -642,13 +636,10 @@ static int _esm_sap_recv(nas_user_t *user, int msg_type, int is_standalone,
if
(
(
rc
!=
RETURNerror
)
&&
(
esm_procedure
!=
NULL
)
)
{
/* Encode the returned ESM response message */
int
size
=
esm_msg_encode
(
&
esm_msg
,
(
uint8_t
*
)
_esm_sap_buffer
,
int
size
=
esm_msg_encode
(
&
esm_msg
,
rsp
->
value
,
ESM_SAP_BUFFER_SIZE
);
if
(
size
>
0
)
{
rsp
->
length
=
size
;
rsp
->
value
=
(
uint8_t
*
)(
_esm_sap_buffer
);
}
rsp
->
length
=
size
;
/* Complete the relevant ESM procedure */
rc
=
(
*
esm_procedure
)(
user
,
is_standalone
,
ebi
,
rsp
,
triggered_by_ue
);
...
...
@@ -691,7 +682,6 @@ static int _esm_sap_recv(nas_user_t *user, int msg_type, int is_standalone,
** Outputs: rsp: The encoded ESM response message to be re- **
** turned upon ESM procedure completion **
** Return: RETURNok, RETURNerror **
** Others: _esm_sap_buffer **
** **
***************************************************************************/
static
int
_esm_sap_send
(
nas_user_t
*
user
,
int
msg_type
,
int
is_standalone
,
...
...
@@ -772,18 +762,15 @@ static int _esm_sap_send(nas_user_t *user, int msg_type, int is_standalone,
if
(
rc
!=
RETURNerror
)
{
/* Encode the returned ESM response message */
int
size
=
esm_msg_encode
(
&
esm_msg
,
(
uint8_t
*
)
_esm_sap_buffer
,
int
size
=
esm_msg_encode
(
&
esm_msg
,
rsp
->
value
,
ESM_SAP_BUFFER_SIZE
);
if
(
size
>
0
)
{
rsp
->
length
=
size
;
rsp
->
value
=
(
uint8_t
*
)(
_esm_sap_buffer
);
}
rsp
->
length
=
size
;
/* Execute the relevant ESM procedure */
if
(
esm_procedure
)
{
rc
=
(
*
esm_procedure
)(
user
,
is_standalone
,
pti
,
rsp
,
sent_by_ue
);
}
}
LOG_FUNC_RETURN
(
rc
);
...
...
openair3/NAS/UE/ESM/esmData.h
View file @
84fa851d
...
...
@@ -52,6 +52,7 @@ Description Defines internal private data handled by EPS Session
/* Total number of active EPS bearers */
#define ESM_DATA_EPS_BEARER_TOTAL 11
#define ESM_SAP_BUFFER_SIZE 4096
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
...
...
@@ -172,6 +173,7 @@ typedef struct esm_data_context_s {
}
pdn
[
ESM_DATA_PDN_MAX
+
1
];
esm_ebr_data_t
ebr
;
uint8_t
send_buffer
[
ESM_SAP_BUFFER_SIZE
];
}
esm_data_context_t
;
/*
...
...
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