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
dyyu
openairinterface5G
Commits
84fa851d
Commit
84fa851d
authored
8 years ago
by
FredericLeroy
Browse files
Options
Downloads
Patches
Plain Diff
UE/ESM: use static buffer per UE to allow reentrancy in esm_sap.c
parent
7ff4939d
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
openair3/NAS/UE/ESM/SAP/esm_sap.c
+6
-19
6 additions, 19 deletions
openair3/NAS/UE/ESM/SAP/esm_sap.c
openair3/NAS/UE/ESM/esmData.h
+2
-0
2 additions, 0 deletions
openair3/NAS/UE/ESM/esmData.h
with
8 additions
and
19 deletions
openair3/NAS/UE/ESM/SAP/esm_sap.c
+
6
−
19
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
);
...
...
This diff is collapsed.
Click to expand it.
openair3/NAS/UE/ESM/esmData.h
+
2
−
0
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
;
/*
...
...
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