Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ieee1905
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Multi-AP
ieee1905
Commits
30ba1e75
Commit
30ba1e75
authored
4 years ago
by
Anjan Chanda
Browse files
Options
Downloads
Patches
Plain Diff
reserve space for tlv with cmdu_reserve_tlv()
parent
7c40b0a2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cmdu.c
+17
-0
17 additions, 0 deletions
src/cmdu.c
src/cmdu.h
+1
-0
1 addition, 0 deletions
src/cmdu.h
with
18 additions
and
0 deletions
src/cmdu.c
+
17
−
0
View file @
30ba1e75
...
...
@@ -348,6 +348,23 @@ int cmdu_put_eom(struct cmdu_buff *c)
return
cmdu_put
(
c
,
eom
,
sizeof
(
eom
));
}
struct
tlv
*
cmdu_reserve_tlv
(
struct
cmdu_buff
*
c
,
uint16_t
tlv_datalen
)
{
uint16_t
len
=
tlv_datalen
+
TLV_HLEN
;
if
(
!
c
)
return
NULL
;
if
(
c
->
end
-
c
->
tail
<
len
)
{
fprintf
(
stderr
,
"%s: Failed to reserve %hu! Allocate new cmdu fragment
\n
"
,
__func__
,
tlv_datalen
);
return
NULL
;
}
return
(
struct
tlv
*
)
c
->
tail
;
}
int
cmdu_parse_tlvs
(
struct
cmdu_buff
*
c
,
struct
tlv
*
tv
[][
16
],
struct
tlv_policy
*
policy
,
int
policy_len
)
{
...
...
This diff is collapsed.
Click to expand it.
src/cmdu.h
+
1
−
0
View file @
30ba1e75
...
...
@@ -159,6 +159,7 @@ int cmdu_parse_tlvs(struct cmdu_buff *c, struct tlv *tv[][16],
int
cmdu_copy_tlvs_linear
(
struct
cmdu_buff
*
c
,
uint8_t
*
tlvs
,
uint32_t
tlvslen
);
int
cmdu_copy_tlvs
(
struct
cmdu_buff
*
c
,
struct
tlv
*
tv
[],
int
tv_arrsize
);
struct
tlv
*
cmdu_reserve_tlv
(
struct
cmdu_buff
*
c
,
uint16_t
tlv_datalen
);
int
cmdu_put_tlv
(
struct
cmdu_buff
*
c
,
struct
tlv
*
t
);
int
cmdu_put
(
struct
cmdu_buff
*
c
,
uint8_t
*
bytes
,
int
len
);
int
cmdu_put_eom
(
struct
cmdu_buff
*
c
);
...
...
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