Skip to main content
Homepage
Explore
Search or go to…
/
Sign in
Explore
Primary navigation
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
?
Collapse sidebar
Snippets
Groups
Projects
Show more breadcrumbs
Multi-AP
map-controller
Commits
929bcfa4
Commit
929bcfa4
authored
Dec 6, 2021
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
mapcontroller: trigger autoconfig renew regardless if detected by SIGHUP
parent
381b1363
No related branches found
No related tags found
No related merge requests found
Pipeline
#36627
failed
Dec 6, 2021
Status:
Stage: static_code_analysis
Status:
Stage: checkpatch
Status:
Stage: functional_test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cntlr.c
+78
-68
78 additions, 68 deletions
src/cntlr.c
src/cntlr.h
+1
-1
1 addition, 1 deletion
src/cntlr.h
src/cntlr_map.c
+1
-1
1 addition, 1 deletion
src/cntlr_map.c
with
80 additions
and
70 deletions
src/cntlr.c
+
78
−
68
View file @
929bcfa4
...
@@ -1429,52 +1429,11 @@ static void cntlr_query_nodes(struct uloop_timeout *t)
...
@@ -1429,52 +1429,11 @@ static void cntlr_query_nodes(struct uloop_timeout *t)
uloop_timeout_set
(
&
c
->
query_nodes
,
60
*
1000
);
uloop_timeout_set
(
&
c
->
query_nodes
,
60
*
1000
);
}
}
uint8_t
cntlr_resync_config
(
struct
controller
*
c
)
{
uint8_t
diff
;
struct
node_policy
*
np
;
diff
=
cntlr_config_reload
(
&
c
->
cfg
);
list_for_each_entry
(
np
,
&
c
->
cfg
.
nodelist
,
list
)
{
struct
node
*
n
;
n
=
find_node_by_mac
(
c
,
np
->
agent_id
);
if
(
n
)
n
->
np
=
np
;
}
return
diff
;
}
#define RADIO_MAX 8
#define RADIO_MAX 8
static
void
cntlr_signal_periodic_run
(
struct
uloop_timeout
*
t
)
bool
cntlr_check_config_diff
(
struct
controller
*
c
,
uint8_t
diff
)
{
{
struct
controller
*
c
=
container_of
(
t
,
struct
controller
,
signal_handler
);
bool
reloaded
=
false
;
sigset_t
waiting_mask
;
sigpending
(
&
waiting_mask
);
if
(
sigismember
(
&
waiting_mask
,
SIGINT
))
{
dbg
(
"|%s:%d| Received SIGINT, terminating
\n
"
,
__func__
,
__LINE__
);
signal
(
SIGINT
,
SIG_IGN
);
cntlr_terminate
(
c
);
}
if
(
sigismember
(
&
waiting_mask
,
SIGTERM
))
{
dbg
(
"|%s:%d| Received SIGSTP, terminating
\n
"
,
__func__
,
__LINE__
);
signal
(
SIGTERM
,
SIG_IGN
);
cntlr_terminate
(
c
);
}
if
(
sigismember
(
&
waiting_mask
,
SIGHUP
))
{
uint8_t
diff
;
dbg
(
"|%s:%d| Received SIGHUP, reload config
\n
"
,
__func__
,
__LINE__
);
signal
(
SIGHUP
,
SIG_IGN
);
diff
=
cntlr_resync_config
(
c
);
if
(
diff
&
CONFIG_DIFF_CREDENTIALS
||
diff
&
CONFIG_DIFF_VLAN
)
{
if
(
diff
&
CONFIG_DIFF_CREDENTIALS
||
diff
&
CONFIG_DIFF_VLAN
)
{
struct
cmdu_buff
*
cmdu
;
struct
cmdu_buff
*
cmdu
;
uint8_t
origin
[
6
]
=
{
0x01
,
0x80
,
0xc2
,
0x00
,
0x00
,
0x13
};
uint8_t
origin
[
6
]
=
{
0x01
,
0x80
,
0xc2
,
0x00
,
0x00
,
0x13
};
...
@@ -1484,6 +1443,7 @@ static void cntlr_signal_periodic_run(struct uloop_timeout *t)
...
@@ -1484,6 +1443,7 @@ static void cntlr_signal_periodic_run(struct uloop_timeout *t)
if
(
cmdu
)
{
if
(
cmdu
)
{
send_cmdu
(
c
,
cmdu
);
send_cmdu
(
c
,
cmdu
);
cmdu_free
(
cmdu
);
cmdu_free
(
cmdu
);
reloaded
=
true
;
}
}
}
else
if
(
diff
&
(
CONFIG_DIFF_AGENT_POLICY
|
CONFIG_DIFF_AGENT_POLICY_CNT
))
{
}
else
if
(
diff
&
(
CONFIG_DIFF_AGENT_POLICY
|
CONFIG_DIFF_AGENT_POLICY_CNT
))
{
struct
node_policy
*
p
;
struct
node_policy
*
p
;
...
@@ -1496,7 +1456,8 @@ static void cntlr_signal_periodic_run(struct uloop_timeout *t)
...
@@ -1496,7 +1456,8 @@ static void cntlr_signal_periodic_run(struct uloop_timeout *t)
* Also few information i.e. exclude stalist,
* Also few information i.e. exclude stalist,
* rcpi/util threshold is sent along with
* rcpi/util threshold is sent along with
* 17.2.11 & 17.2.12 tlv.
* 17.2.11 & 17.2.12 tlv.
* So for now, dummy radio id & bss id is being used for this purpose.
* So for now, dummy radio id & bss id is being used for this
* purpose.
* ((later on radio id & bss id info for specific agent
* ((later on radio id & bss id info for specific agent
* will be stored using in Topology Response CMDU.))
* will be stored using in Topology Response CMDU.))
*/
*/
...
@@ -1528,6 +1489,7 @@ static void cntlr_signal_periodic_run(struct uloop_timeout *t)
...
@@ -1528,6 +1489,7 @@ static void cntlr_signal_periodic_run(struct uloop_timeout *t)
if
(
cmdu
)
{
if
(
cmdu
)
{
send_cmdu
(
c
,
cmdu
);
send_cmdu
(
c
,
cmdu
);
cmdu_free
(
cmdu
);
cmdu_free
(
cmdu
);
reloaded
=
true
;
}
}
}
}
...
@@ -1535,6 +1497,54 @@ static void cntlr_signal_periodic_run(struct uloop_timeout *t)
...
@@ -1535,6 +1497,54 @@ static void cntlr_signal_periodic_run(struct uloop_timeout *t)
list_for_each_entry
(
p
,
&
c
->
cfg
.
nodelist
,
list
)
list_for_each_entry
(
p
,
&
c
->
cfg
.
nodelist
,
list
)
p
->
is_policy_diff
=
false
;
p
->
is_policy_diff
=
false
;
}
}
return
reloaded
;
}
bool
cntlr_resync_config
(
struct
controller
*
c
,
bool
reload
)
{
uint8_t
diff
;
struct
node_policy
*
np
;
diff
=
cntlr_config_reload
(
&
c
->
cfg
);
if
(
reload
)
cntlr_check_config_diff
(
c
,
diff
);
list_for_each_entry
(
np
,
&
c
->
cfg
.
nodelist
,
list
)
{
struct
node
*
n
;
n
=
find_node_by_mac
(
c
,
np
->
agent_id
);
if
(
n
)
n
->
np
=
np
;
}
return
!!
diff
;
}
static
void
cntlr_signal_periodic_run
(
struct
uloop_timeout
*
t
)
{
struct
controller
*
c
=
container_of
(
t
,
struct
controller
,
signal_handler
);
sigset_t
waiting_mask
;
sigpending
(
&
waiting_mask
);
if
(
sigismember
(
&
waiting_mask
,
SIGINT
))
{
dbg
(
"|%s:%d| Received SIGINT, terminating
\n
"
,
__func__
,
__LINE__
);
signal
(
SIGINT
,
SIG_IGN
);
cntlr_terminate
(
c
);
}
if
(
sigismember
(
&
waiting_mask
,
SIGTERM
))
{
dbg
(
"|%s:%d| Received SIGSTP, terminating
\n
"
,
__func__
,
__LINE__
);
signal
(
SIGTERM
,
SIG_IGN
);
cntlr_terminate
(
c
);
}
if
(
sigismember
(
&
waiting_mask
,
SIGHUP
))
{
dbg
(
"|%s:%d| Received SIGHUP, reload config
\n
"
,
__func__
,
__LINE__
);
signal
(
SIGHUP
,
SIG_IGN
);
cntlr_resync_config
(
c
,
true
);
}
}
uloop_timeout_set
(
&
c
->
signal_handler
,
1
*
1000
);
uloop_timeout_set
(
&
c
->
signal_handler
,
1
*
1000
);
...
@@ -2123,7 +2133,7 @@ int start_controller(void)
...
@@ -2123,7 +2133,7 @@ int start_controller(void)
alloc_node_init
(
c
,
np
->
agent_id
);
alloc_node_init
(
c
,
np
->
agent_id
);
}
}
}
}
cntlr_resync_config
(
c
);
cntlr_resync_config
(
c
,
false
);
if
(
!
c
->
cfg
.
enabled
)
if
(
!
c
->
cfg
.
enabled
)
goto
out_exit
;
goto
out_exit
;
...
...
...
...
This diff is collapsed.
Click to expand it.
src/cntlr.h
+
1
−
1
View file @
929bcfa4
...
@@ -406,7 +406,7 @@ struct sta *cntlr_find_sta(struct controller *c, uint8_t *mac);
...
@@ -406,7 +406,7 @@ struct sta *cntlr_find_sta(struct controller *c, uint8_t *mac);
struct
bcnreq
*
cntlr_find_bcnreq
(
struct
controller
*
c
,
uint8_t
*
sta
,
uint8_t
*
alid
);
struct
bcnreq
*
cntlr_find_bcnreq
(
struct
controller
*
c
,
uint8_t
*
sta
,
uint8_t
*
alid
);
struct
netif_iface
*
cntlr_get_fbss_by_mac
(
struct
controller
*
c
,
struct
node
*
n
,
struct
netif_iface
*
cntlr_get_fbss_by_mac
(
struct
controller
*
c
,
struct
node
*
n
,
uint8_t
*
mac
);
uint8_t
*
mac
);
uint8_t
cntlr_resync_config
(
struct
controller
*
c
);
bool
cntlr_resync_config
(
struct
controller
*
c
,
bool
reload
);
void
free_bcn_metrics
(
struct
controller
*
c
,
struct
sta
*
s
);
void
free_bcn_metrics
(
struct
controller
*
c
,
struct
sta
*
s
);
void
free_usta_metrics
(
struct
controller
*
c
,
struct
sta
*
s
);
void
free_usta_metrics
(
struct
controller
*
c
,
struct
sta
*
s
);
#endif
/* CNTLR_H */
#endif
/* CNTLR_H */
This diff is collapsed.
Click to expand it.
src/cntlr_map.c
+
1
−
1
View file @
929bcfa4
...
@@ -465,7 +465,7 @@ struct node *cntlr_add_agent(struct controller *c, uint8_t *hwaddr)
...
@@ -465,7 +465,7 @@ struct node *cntlr_add_agent(struct controller *c, uint8_t *hwaddr)
cntlr_config_add_agent
(
&
c
->
cfg
,
mac_str
);
cntlr_config_add_agent
(
&
c
->
cfg
,
mac_str
);
cntlr_resync_config
(
c
);
cntlr_resync_config
(
c
,
true
);
return
n
;
return
n
;
}
}
...
...
...
...
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