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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Multi-AP
map-controller
Commits
c568a1b1
Commit
c568a1b1
authored
2 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
agent_map: send policy config to returning nodes
parent
e71a5f4f
No related branches found
No related tags found
1 merge request
!170
agent_map: send policy config to returning nodes
Pipeline
#75548
passed
2 years ago
Stage: static_code_analysis
Stage: compile_test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cmdu_validate.c
+46
-0
46 additions, 0 deletions
src/cmdu_validate.c
src/cmdu_validate.h
+1
-0
1 addition, 0 deletions
src/cmdu_validate.h
src/cntlr_map.c
+36
-0
36 additions, 0 deletions
src/cntlr_map.c
with
83 additions
and
0 deletions
src/cmdu_validate.c
+
46
−
0
View file @
c568a1b1
...
...
@@ -104,6 +104,14 @@ static int check_supported_band_tlv(struct tlv *t)
sizeof
(
struct
tlv_supported_band
));
}
/* Check 1905.1 AL MAC address type TLV */
static
int
check_client_assoc_event_tlv
(
struct
tlv
*
t
)
{
/* macaddr (6 bytes) + macaddr (6 bytes) + assoc event (1 byte) */
return
check_serialized_tlv
(
t
,
sizeof
(
struct
tlv_client_assoc_event
));
}
static
int
check_service_tlv
(
struct
tlv
*
t
)
{
int
offset
=
0
;
...
...
@@ -824,3 +832,41 @@ bool validate_ap_autoconfig_response(struct cmdu_buff *cmdu, struct tlv *tv[][16
return
true
;
}
bool
validate_topology_notification
(
struct
cmdu_buff
*
cmdu
,
struct
tlv
*
tv
[][
16
])
{
struct
tlv_policy
a_policy
[]
=
{
[
0
]
=
{
.
type
=
TLV_TYPE_AL_MAC_ADDRESS_TYPE
,
.
present
=
TLV_PRESENT_ONE
,
.
minlen
=
6
,
.
maxlen
=
6
,
},
[
1
]
=
{
.
type
=
MAP_TLV_CLIENT_ASSOCIATION_EVENT
,
.
present
=
TLV_PRESENT_OPTIONAL_MORE
,
.
minlen
=
13
,
.
maxlen
=
13
,
}
};
int
ret
;
int
num
=
0
;
trace
(
"%s |"
MACFMT
"|CMDU: ap autoconfig response
\n
"
,
__func__
,
MAC2STR
(
cmdu
->
origin
));
ret
=
cmdu_parse_tlvs
(
cmdu
,
tv
,
a_policy
,
2
);
if
(
ret
)
{
dbg
(
"%s: parse_tlv failed
\n
"
,
__func__
);
return
false
;
}
/* Parse SupportedRole TLV */
if
(
check_al_mac_addr_type_tlv
(
tv
[
0
][
0
]))
return
false
;
while
(
tv
[
1
][
num
])
{
if
(
check_client_assoc_event_tlv
(
tv
[
1
][
num
++
]))
return
false
;
}
return
true
;
}
This diff is collapsed.
Click to expand it.
src/cmdu_validate.h
+
1
−
0
View file @
c568a1b1
...
...
@@ -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_topology_notification
(
struct
cmdu_buff
*
cmdu
,
struct
tlv
*
tv
[][
16
]);
#endif // CMDU_VALIDATE
This diff is collapsed.
Click to expand it.
src/cntlr_map.c
+
36
−
0
View file @
c568a1b1
...
...
@@ -63,6 +63,42 @@ struct map_cmdu_calltable_t {
int
handle_topology_notification
(
void
*
cntlr
,
struct
cmdu_buff
*
cmdu
)
{
trace
(
"%s: --->
\n
"
,
__func__
);
struct
controller
*
c
=
(
struct
controller
*
)
cntlr
;
struct
tlv
*
tv
[
2
][
16
]
=
{
0
};
struct
tlv_aladdr
*
aladdr_tlv
;
uint8_t
*
aladdr
;
int
num
=
0
;
if
(
!
validate_topology_notification
(
cmdu
,
tv
))
{
dbg
(
"cmdu validation: [TOPOLOGY_NOTIFICATION] failed
\n
"
);
return
-
1
;
}
aladdr_tlv
=
(
struct
tlv_aladdr
*
)
tv
[
0
][
0
]
->
data
;
aladdr
=
aladdr_tlv
->
macaddr
;
if
(
tv
[
1
][
num
])
{
/* client connect event*/
}
else
{
/* neighbor addition event */
struct
node
*
n
;
uint8_t
wildcard
[
6
]
=
{
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
};
struct
node_policy
*
np
;
np
=
agent_find_policy
(
c
,
aladdr
);
if
(
!
np
)
return
-
1
;
n
=
find_node_by_mac
(
c
,
aladdr
);
if
(
!
n
)
return
-
1
;
cmdu
=
cntlr_gen_policy_config_req
(
cntlr
,
aladdr
,
np
,
0
,
wildcard
,
1
,
wildcard
);
if
(
!
cmdu
)
return
-
1
;
}
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
register
or
sign in
to comment