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
c12dcdd2
Commit
c12dcdd2
authored
4 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
map-controller: controller discovery porting
parent
d543e72a
No related branches found
No related tags found
No related merge requests found
Pipeline
#20342
failed
4 years ago
Stage: static_code_analysis
Stage: checkpatch
Stage: functional_test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/cntlr_map.c
+57
-5
57 additions, 5 deletions
src/core/cntlr_map.c
with
57 additions
and
5 deletions
src/core/cntlr_map.c
+
57
−
5
View file @
c12dcdd2
...
@@ -178,7 +178,7 @@ out:
...
@@ -178,7 +178,7 @@ out:
return
ret
;
return
ret
;
}
}
int
handle_ap_autoconfig_search
(
void
*
cntlr
,
struct
cmdu_buff
*
r
ec
_cmdu
)
int
handle_ap_autoconfig_search
(
void
*
cntlr
,
struct
cmdu_buff
*
r
x
_cmdu
)
{
{
trace
(
"%s: --->
\n
"
,
__func__
);
trace
(
"%s: --->
\n
"
,
__func__
);
struct
controller
*
c
=
(
struct
controller
*
)
cntlr
;
struct
controller
*
c
=
(
struct
controller
*
)
cntlr
;
...
@@ -196,7 +196,7 @@ int handle_ap_autoconfig_search(void *cntlr, struct cmdu_buff *rec_cmdu)
...
@@ -196,7 +196,7 @@ int handle_ap_autoconfig_search(void *cntlr, struct cmdu_buff *rec_cmdu)
struct
tlv
*
tv
[
6
][
16
]
=
{
0
};
struct
tlv
*
tv
[
6
][
16
]
=
{
0
};
int
ret
=
0
;
int
ret
=
0
;
ret
=
cmdu_parse_tlvs
(
r
ec
_cmdu
,
tv
,
a_policy
,
6
);
ret
=
cmdu_parse_tlvs
(
r
x
_cmdu
,
tv
,
a_policy
,
6
);
if
(
!
tv
[
0
][
0
]
||
!
tv
[
1
][
0
]
||
!
tv
[
2
][
0
]
||
!
tv
[
3
][
0
]
||
!
tv
[
4
][
0
]
if
(
!
tv
[
0
][
0
]
||
!
tv
[
1
][
0
]
||
!
tv
[
2
][
0
]
||
!
tv
[
3
][
0
]
||
!
tv
[
4
][
0
]
||
!
tv
[
5
][
0
])
||
!
tv
[
5
][
0
])
...
@@ -260,7 +260,7 @@ int handle_ap_autoconfig_search(void *cntlr, struct cmdu_buff *rec_cmdu)
...
@@ -260,7 +260,7 @@ int handle_ap_autoconfig_search(void *cntlr, struct cmdu_buff *rec_cmdu)
}
else
{
}
else
{
char
data
[
128
]
=
{
0
};
char
data
[
128
]
=
{
0
};
snprintf
(
data
,
sizeof
(
data
),
"{
\"
type
\"
:
\"
error
\"
,
\"
reason
\"
:
\"
multiple controllers
\"
,
\"
almac
\"
:
\"
"
MACFMT
"
\"
}"
,
MAC2STR
(
r
ec
_cmdu
->
origin
));
snprintf
(
data
,
sizeof
(
data
),
"{
\"
type
\"
:
\"
error
\"
,
\"
reason
\"
:
\"
multiple controllers
\"
,
\"
almac
\"
:
\"
"
MACFMT
"
\"
}"
,
MAC2STR
(
r
x
_cmdu
->
origin
));
cntlr_notify_event
(
c
,
"map.controller"
,
data
);
cntlr_notify_event
(
c
,
"map.controller"
,
data
);
}
}
...
@@ -270,7 +270,7 @@ int handle_ap_autoconfig_search(void *cntlr, struct cmdu_buff *rec_cmdu)
...
@@ -270,7 +270,7 @@ int handle_ap_autoconfig_search(void *cntlr, struct cmdu_buff *rec_cmdu)
__func__
,
freq
->
band
);
__func__
,
freq
->
band
);
cmdu
=
cntlr_gen_ap_autoconfig_response
(
cntlr
,
aladdr_origin
,
cmdu
=
cntlr_gen_ap_autoconfig_response
(
cntlr
,
aladdr_origin
,
freq
->
band
,
freq
->
band
,
cmdu_get_mid
(
r
ec
_cmdu
));
cmdu_get_mid
(
r
x
_cmdu
));
if
(
!
cmdu
)
if
(
!
cmdu
)
return
-
1
;
return
-
1
;
...
@@ -281,9 +281,61 @@ int handle_ap_autoconfig_search(void *cntlr, struct cmdu_buff *rec_cmdu)
...
@@ -281,9 +281,61 @@ int handle_ap_autoconfig_search(void *cntlr, struct cmdu_buff *rec_cmdu)
}
}
/* disable and quit on controller response */
/* disable and quit on controller response */
int
handle_ap_autoconfig_response
(
void
*
cntlr
,
struct
cmdu_buff
*
cmdu
)
int
handle_ap_autoconfig_response
(
void
*
cntlr
,
struct
cmdu_buff
*
rx_
cmdu
)
{
{
trace
(
"%s: --->
\n
"
,
__func__
);
trace
(
"%s: --->
\n
"
,
__func__
);
struct
controller
*
c
=
(
struct
controller
*
)
cntlr
;
bool
has_cntlr
=
false
;
struct
tlv_policy
a_policy
[]
=
{
[
0
]
=
{
.
type
=
TLV_TYPE_SUPPORTED_ROLE
,
.
present
=
TLV_PRESENT_ONE
},
[
1
]
=
{
.
type
=
MAP_TLV_SUPPORTED_SERVICE
,
.
present
=
TLV_PRESENT_ONE
},
[
2
]
=
{
.
type
=
MAP_TLV_MULTIAP_PROFILE
,
.
present
=
TLV_PRESENT_ONE
},
[
3
]
=
{
.
type
=
TLV_TYPE_SUPPORTED_FREQ_BAND
,
.
present
=
TLV_PRESENT_ONE
}
};
struct
tlv
*
tv
[
4
][
16
]
=
{
0
};
int
i
;
cmdu_parse_tlvs
(
rx_cmdu
,
tv
,
a_policy
,
4
);
if
(
!
tv
[
0
][
0
]
||
!
tv
[
1
][
0
]
||
!
tv
[
2
][
0
]
||
!
tv
[
3
][
0
])
return
-
1
;
/* find if supported services containts controller */
if
(
tv
[
1
][
0
]
->
data
[
0
]
>
0
)
{
int
i
;
for
(
i
=
0
;
i
<
tv
[
1
][
0
]
->
data
[
0
];
i
++
)
{
if
(
tv
[
1
][
0
]
->
data
[(
i
+
1
)]
==
SUPPORTED_SERVICE_MULTIAP_CONTROLLER
)
{
has_cntlr
=
true
;
break
;
}
}
}
/* if does not support controller - return */
if
(
!
has_cntlr
)
{
dbg
(
"autoconfig response does not support controller!
\n
"
);
return
-
1
;
}
/* discard self response */
if
(
!
memcmp
(
rx_cmdu
->
origin
,
c
->
almac
,
6
))
return
0
;
trace
(
"Received AP-Autoconfig Response which was not from self
\n
"
);
if
(
c
->
state
==
CNTLR_INIT
)
{
trace
(
"Disable and exit
\n
"
);
set_value_by_string
(
"mapcontroller"
,
"controller"
,
"enabled"
,
"0"
,
UCI_TYPE_STRING
);
exit
(
0
);
}
else
{
char
data
[
128
]
=
{
0
};
snprintf
(
data
,
sizeof
(
data
),
"{
\"
type
\"
:
\"
error
\"
,
\"
reason
\"
:
\"
multiple controllers
\"
,
\"
almac
\"
:
\"
"
MACFMT
"
\"
}"
,
MAC2STR
(
rx_cmdu
->
origin
));
cntlr_notify_event
(
c
,
"map.controller"
,
data
);
}
return
0
;
return
0
;
// struct controller *c = (struct controller *) cntlr;
// struct controller *c = (struct controller *) cntlr;
// struct tlv_supp_service *tlv;
// struct tlv_supp_service *tlv;
...
...
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