Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-AMF
Commits
887cdf9e
Commit
887cdf9e
authored
Feb 09, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue for LADN Indication
parent
0be97cec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
20 deletions
+14
-20
src/nas/ies/LADN_Indication.cpp
src/nas/ies/LADN_Indication.cpp
+14
-20
No files found.
src/nas/ies/LADN_Indication.cpp
View file @
887cdf9e
...
...
@@ -57,7 +57,6 @@ LADN_Indication::~LADN_Indication() {}
//------------------------------------------------------------------------------
void
LADN_Indication
::
setValue
(
uint8_t
iei
,
uint8_t
value
)
{
_iei
=
iei
;
//_value = value;
}
//------------------------------------------------------------------------------
...
...
@@ -68,19 +67,15 @@ bool LADN_Indication::getValue(std::vector<bstring>& ladn) {
//------------------------------------------------------------------------------
int
LADN_Indication
::
encode2buffer
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding LADN_Indication
iei
(0x%x)"
,
_iei
);
Logger
::
nas_mm
().
debug
(
"Encoding LADN_Indication
IEI
(0x%x)"
,
_iei
);
if
(
len
<
length
)
{
Logger
::
nas_mm
().
error
(
"Len is less than %d"
,
length
);
return
0
;
}
int
encoded_size
=
0
;
if
(
_iei
)
{
*
(
buf
+
encoded_size
)
=
_iei
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
(
length
-
3
)
&
0x00ff
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
((
length
-
3
)
&
0xff00
)
>>
8
;
encoded_size
++
;
ENCODE_U8
(
buf
,
_iei
,
encoded_size
);
ENCODE_U16
(
buf
,
length
-
3
,
encoded_size
);
for
(
int
i
=
0
;
i
<
LADN
.
size
();
i
++
)
{
*
(
buf
+
encoded_size
)
=
blength
(
LADN
.
at
(
i
));
encoded_size
++
;
...
...
@@ -88,6 +83,7 @@ int LADN_Indication::encode2buffer(uint8_t* buf, int len) {
encode_bstring
(
LADN
.
at
(
i
),
(
buf
+
encoded_size
),
len
-
encoded_size
);
}
}
else
{
// TODO:
// *(buf + encoded_size) = length - 1; encoded_size++;
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
}
...
...
@@ -97,29 +93,26 @@ int LADN_Indication::encode2buffer(uint8_t* buf, int len) {
//------------------------------------------------------------------------------
int
LADN_Indication
::
decodefrombuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
Logger
::
nas_mm
().
debug
(
"Decoding LADN_Indication
iei
(0x%x)"
,
*
buf
);
Logger
::
nas_mm
().
debug
(
"Decoding LADN_Indication
IEI
(0x%x)"
,
*
buf
);
int
decoded_size
=
0
;
if
(
is_option
)
{
decoded_size
++
;
}
length
=
0
;
length
|=
*
(
buf
+
decoded_size
);
decoded_size
++
;
length
|=
(
*
(
buf
+
decoded_size
))
<<
8
;
decoded_size
++
;
DECODE_U16
(
buf
,
length
,
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Decoded LADN_Indication len (%d)"
,
length
);
int
LEAGTH
=
length
;
uint8_t
len_dnn
;
int
len_ie
=
length
;
uint8_t
len_dnn
=
0
;
bstring
dnn
;
while
(
LEAGTH
)
{
len_dnn
=
*
(
buf
+
decoded_size
);
decoded_size
++
;
LEAGTH
--
;
while
(
len_ie
)
{
DECODE_U8
(
buf
,
len_dnn
,
decoded_size
);
len_ie
--
;
decode_bstring
(
&
dnn
,
len_dnn
,
(
buf
+
decoded_size
),
len
-
decoded_size
);
decoded_size
+=
len_dnn
;
LEAGTH
-=
len_dnn
;
len_ie
-=
len_dnn
;
LADN
.
insert
(
LADN
.
end
(),
dnn
);
}
for
(
int
i
=
0
;
i
<
LADN
.
size
();
i
++
)
{
for
(
int
j
=
0
;
j
<
blength
(
LADN
.
at
(
i
));
j
++
)
{
Logger
::
nas_mm
().
debug
(
...
...
@@ -127,6 +120,7 @@ int LADN_Indication::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
(
uint8_t
)
LADN
.
at
(
i
)
->
data
[
j
]);
}
}
Logger
::
nas_mm
().
debug
(
"Decoded LADN_Indication len (%d)"
,
decoded_size
);
return
decoded_size
;
}
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