Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
map-controller
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Multi-AP
map-controller
Commits
05705294
Commit
05705294
authored
Mar 29, 2022
by
Saurabh Verma
Browse files
Options
Downloads
Patches
Plain Diff
add failed connection message CMDU
parent
de6cf726
No related branches found
No related tags found
1 merge request
!106
add failed connection message CMDU
Pipeline
#46905
passed
Mar 29, 2022
Stage: static_code_analysis
Stage: compile_test
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/cmdu_validate.c
+38
-0
38 additions, 0 deletions
src/cmdu_validate.c
src/cmdu_validate.h
+1
-0
1 addition, 0 deletions
src/cmdu_validate.h
src/cntlr.c
+1
-0
1 addition, 0 deletions
src/cntlr.c
src/cntlr_map_debug.c
+28
-0
28 additions, 0 deletions
src/cntlr_map_debug.c
with
68 additions
and
0 deletions
src/cmdu_validate.c
+
38
−
0
View file @
05705294
...
...
@@ -817,3 +817,41 @@ bool validate_ap_autoconfig_response(struct cmdu_buff *cmdu, struct tlv *tv[][16
return
true
;
}
bool
validate_failed_connection_msg
(
struct
cmdu_buff
*
cmdu
,
struct
tlv
*
tv
[][
16
])
{
int
ret
;
struct
tlv_policy
c_policy
[]
=
{
[
0
]
=
{
.
type
=
MAP_TLV_STA_MAC_ADDRESS
,
.
present
=
TLV_PRESENT_ONE
,
.
minlen
=
6
,
.
maxlen
=
6
},
[
1
]
=
{
.
type
=
MAP_TLV_STATUS_CODE
,
.
present
=
TLV_PRESENT_ONE
,
.
minlen
=
2
,
.
maxlen
=
2
},
[
2
]
=
{
.
type
=
MAP_TLV_REASON_CODE
,
.
present
=
TLV_PRESENT_MORE
,
.
minlen
=
2
,
.
maxlen
=
2
}
};
ret
=
cmdu_parse_tlvs
(
cmdu
,
tv
,
c_policy
,
3
);
if
(
ret
)
{
dbg
(
"%s: parse_tlv failed
\n
"
,
__func__
);
return
false
;
}
if
(
!
tv
[
0
][
0
]
||
!
tv
[
1
][
0
])
{
dbg
(
"%s: mandatory tlv missing
\n
"
,
__func__
);
return
false
;
}
return
true
;
}
This diff is collapsed.
Click to expand it.
src/cmdu_validate.h
+
1
−
0
View file @
05705294
...
...
@@ -9,5 +9,6 @@ bool validate_topology_response(struct cmdu_buff *cmdu, struct tlv *tv_tsp[][16]
bool
validate_ap_autoconfig_wsc
(
struct
cmdu_buff
*
cmdu
,
struct
tlv
*
tv
[][
16
]);
bool
validate_ap_autoconfig_search
(
struct
cmdu_buff
*
cmdu
,
struct
tlv
*
tv
[][
16
]);
bool
validate_ap_autoconfig_response
(
struct
cmdu_buff
*
cmdu
,
struct
tlv
*
tv
[][
16
]);
bool
validate_failed_connection_msg
(
struct
cmdu_buff
*
cmdu
,
struct
tlv
*
tv
[][
16
]);
#endif // CMDU_VALIDATE
This diff is collapsed.
Click to expand it.
src/cntlr.c
+
1
−
0
View file @
05705294
...
...
@@ -2249,6 +2249,7 @@ static int controller_subscribe_for_cmdus(struct controller *c)
CMDU_AP_CAPABILITY_REPORT
,
CMDU_CLIENT_CAPABILITY_REPORT
,
CMDU_HIGHER_LAYER_DATA
,
CMDU_FAILED_CONNECTION
,
-
1
);
memcpy
(
c
->
cmdu_mask
,
cmdu_mask
,
sizeof
(
c
->
cmdu_mask
));
...
...
This diff is collapsed.
Click to expand it.
src/cntlr_map_debug.c
+
28
−
0
View file @
05705294
...
...
@@ -1350,6 +1350,34 @@ int debug_backhaul_sta_caps_report(void *cntlr, struct cmdu_buff *cmdu)
int
debug_failed_connection_msg
(
void
*
cntlr
,
struct
cmdu_buff
*
cmdu
)
{
struct
tlv
*
tv
[
3
][
16
];
if
(
!
validate_failed_connection_msg
(
cmdu
,
tv
))
{
trace
(
"%s: cmdu validation "
\
"[FAILED_CONNECTION] failed
\n
"
,
__func__
);
return
-
1
;
}
trace
(
"%s: --->
\n
"
,
__func__
);
trace
(
"parsing failed connection message
\n
"
);
if
(
tv
[
0
][
0
])
{
struct
tlv_sta_mac
*
t
=
(
struct
tlv_sta_mac
*
)
tv
[
0
][
0
]
->
data
;
trace
(
"
\t
macaddr: "
MACFMT
"
\n
"
,
MAC2STR
(
t
->
macaddr
));
}
if
(
tv
[
1
][
0
])
{
struct
tlv_status_code
*
t
=
(
struct
tlv_status_code
*
)
tv
[
1
][
0
]
->
data
;
trace
(
"
\t
status code: %d
\n
"
,
BUF_GET_BE16
(
t
->
code
));
}
if
(
tv
[
2
][
0
])
{
struct
tlv_reason_code
*
t
=
(
struct
tlv_reason_code
*
)
tv
[
2
][
0
]
->
data
;
trace
(
"
\t
reason code: %d
\n
"
,
BUF_GET_BE16
(
t
->
code
));
}
return
0
;
}
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
sign in
to comment