Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
map-topology
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-topology
Commits
fb4247bf
Commit
fb4247bf
authored
4 years ago
by
Nevadita
Browse files
Options
Downloads
Patches
Plain Diff
map-topology:Fixed status timer start and refresh interval
parent
63cea91e
No related branches found
No related tags found
1 merge request
!5
map-topology:Adding status changes and making changelog array dynamic
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
src/topo_ieee1905.c
+5
-0
5 additions, 0 deletions
src/topo_ieee1905.c
src/topologyd.c
+2
-6
2 additions, 6 deletions
src/topologyd.c
src/topologyd.h
+1
-1
1 addition, 1 deletion
src/topologyd.h
with
9 additions
and
8 deletions
README.md
+
1
−
1
View file @
fb4247bf
...
@@ -47,7 +47,7 @@ map-topology provides the `topology` UBUS object with following methods :
...
@@ -47,7 +47,7 @@ map-topology provides the `topology` UBUS object with following methods :
'topology'
@fc2af0e9
'topology'
@fc2af0e9
"refresh"
:
{}
"refresh"
:
{}
"status"
:
{}
"status"
:
{}
"
refresh
"
:
{}
"
dump
"
:
{}
"changelog"
:
{}
"changelog"
:
{}
````
````
...
...
This diff is collapsed.
Click to expand it.
src/topo_ieee1905.c
+
5
−
0
View file @
fb4247bf
...
@@ -175,10 +175,12 @@ void topologyd_algo_run(struct topologyd_private *priv)
...
@@ -175,10 +175,12 @@ void topologyd_algo_run(struct topologyd_private *priv)
topologyd_send_ieee1905_topology_query
(
priv
,
NULL
);
topologyd_send_ieee1905_topology_query
(
priv
,
NULL
);
dbg
(
"Processing "
MACFMT
" AL
\n
"
,
MAC2STR
(
p
->
hwaddr
));
dbg
(
"Processing "
MACFMT
" AL
\n
"
,
MAC2STR
(
p
->
hwaddr
));
dbg
(
"The total nodes are %d"
,
p
->
nbr_num
);
for
(
j
=
0
;
j
<
p
->
nbr_num
;
j
++
)
{
for
(
j
=
0
;
j
<
p
->
nbr_num
;
j
++
)
{
dbg
(
"sending req to "
MACFMT
"
\n
"
,
MAC2STR
(
p
->
nbrlist
[
j
]));
dbg
(
"sending req to "
MACFMT
"
\n
"
,
MAC2STR
(
p
->
nbrlist
[
j
]));
topologyd_send_ieee1905_topology_query
(
priv
,
p
->
nbrlist
[
j
]);
topologyd_send_ieee1905_topology_query
(
priv
,
p
->
nbrlist
[
j
]);
dbg
(
"Processing "
MACFMT
" AL
\n
"
,
MAC2STR
(
p
->
nbrlist
[
j
]));
}
}
}
}
...
@@ -199,6 +201,9 @@ void topologyd_algo_run(struct topologyd_private *priv)
...
@@ -199,6 +201,9 @@ void topologyd_algo_run(struct topologyd_private *priv)
}
}
priv
->
algo_running
=
false
;
priv
->
algo_running
=
false
;
if
(
priv
->
status
==
0
)
uloop_timeout_set
(
&
priv
->
status_timer
,
TOPOLOGY_STATUS_INTERVAL
*
1000
);
dbg
(
"
\n
====== Done Building Topology======
\n
"
);
dbg
(
"
\n
====== Done Building Topology======
\n
"
);
}
}
This diff is collapsed.
Click to expand it.
src/topologyd.c
+
2
−
6
View file @
fb4247bf
...
@@ -23,7 +23,6 @@
...
@@ -23,7 +23,6 @@
#include
"json_utils.h"
#include
"json_utils.h"
static
int
signal_pending
;
static
int
signal_pending
;
extern
int
refresh_int
;
extern
const
char
*
ubus_socket
;
extern
const
char
*
ubus_socket
;
uint32_t
topology_log_max
;
uint32_t
topology_log_max
;
...
@@ -406,8 +405,8 @@ static void topologyd_periodic_refresh(struct uloop_timeout *t)
...
@@ -406,8 +405,8 @@ static void topologyd_periodic_refresh(struct uloop_timeout *t)
topologyd_algo_run
(
priv
);
topologyd_algo_run
(
priv
);
if
(
priv
->
refresh_int
)
if
(
priv
->
config
.
refresh_int
)
uloop_timeout_set
(
&
priv
->
refresh_timer
,
priv
->
refresh_int
*
1000
);
uloop_timeout_set
(
&
priv
->
refresh_timer
,
priv
->
config
.
refresh_int
*
1000
);
}
}
static
void
topologyd_change_status
(
struct
uloop_timeout
*
t
)
static
void
topologyd_change_status
(
struct
uloop_timeout
*
t
)
...
@@ -454,12 +453,9 @@ static int topologyd_run(struct topologyd_private *priv)
...
@@ -454,12 +453,9 @@ static int topologyd_run(struct topologyd_private *priv)
return
-
1
;
return
-
1
;
}
}
if
(
priv
->
refresh_int
==
0
)
priv
->
refresh_int
=
TOPOLOGY_REFRESH_INT
;
topologyd_start_heartbeat
(
&
priv
->
heartbeat
);
topologyd_start_heartbeat
(
&
priv
->
heartbeat
);
topologyd_periodic_refresh
(
&
priv
->
refresh_timer
);
topologyd_periodic_refresh
(
&
priv
->
refresh_timer
);
uloop_timeout_set
(
&
priv
->
status_timer
,
90
*
1000
);
//initalize the changelog values
//initalize the changelog values
priv
->
topo
.
changelog_front
=
priv
->
topo
.
changelog_rear
=
-
1
;
priv
->
topo
.
changelog_front
=
priv
->
topo
.
changelog_rear
=
-
1
;
...
...
This diff is collapsed.
Click to expand it.
src/topologyd.h
+
1
−
1
View file @
fb4247bf
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#define TOPOLOGY_NODE_MAX 32
#define TOPOLOGY_NODE_MAX 32
#define TOPOLOGY_NEIGHBOR_MAX 32
#define TOPOLOGY_NEIGHBOR_MAX 32
#define TOPOLOGY_VALIDITY 120 // 120 sec
#define TOPOLOGY_VALIDITY 120 // 120 sec
#define TOPOLOGY_STATUS_INTERVAL 5
typedef
uint32_t
ieee1905_object_t
;
typedef
uint32_t
ieee1905_object_t
;
...
@@ -77,7 +78,6 @@ struct topologyd_config {
...
@@ -77,7 +78,6 @@ struct topologyd_config {
struct
topologyd_private
{
struct
topologyd_private
{
int
debug
;
int
debug
;
uint32_t
refresh_int
;
bool
algo_running
;
bool
algo_running
;
enum
{
INCOMPLETE
,
AVAILABLE
}
status
;
enum
{
INCOMPLETE
,
AVAILABLE
}
status
;
struct
ubus_context
*
ctx
;
struct
ubus_context
*
ctx
;
...
...
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