Skip to content
GitLab
Explore
Sign in
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
eb3c174d
Commit
eb3c174d
authored
4 years ago
by
Nevadita
Browse files
Options
Downloads
Patches
Plain Diff
map-topology: Changed the ouput display for method nodes
parent
fe957af3
No related branches found
No related tags found
1 merge request
!11
Added Ubus method nodes
Pipeline
#3205
passed
4 years ago
Stage: static_code_analysis
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+10
-0
10 additions, 0 deletions
README.md
src/topologyd.c
+6
-7
6 additions, 7 deletions
src/topologyd.c
with
16 additions
and
7 deletions
README.md
+
10
−
0
View file @
eb3c174d
...
...
@@ -49,6 +49,7 @@ map-topology provides the `topology` UBUS object with following methods :
"status"
:
{}
"dump"
:
{}
"changelog"
:
{}
"nodes"
:
{}
````
### Usage
...
...
@@ -206,6 +207,15 @@ root@iopsys:# ubus call topology changelog
]
}
#To show the topology nodes macaddress -
root@iopsys:# ubus call topology nodes
{
"ieee1905_macaddr"
:
"00:22:07:70:f5:6c"
,
"neighbors"
:
[
"00:22:07:6e:d8:08"
,
"00:22:07:6d:3d:8e"
]
}
````
### Testing
...
...
This diff is collapsed.
Click to expand it.
src/topologyd.c
+
6
−
7
View file @
eb3c174d
...
...
@@ -887,6 +887,7 @@ void topologyd_dump_node(struct blob_buf *bb, struct node *p, int is_self)
void
topologyd_dump_node_nbr
(
struct
topologyd_private
*
priv
,
struct
blob_buf
*
b
)
{
char
mac_str
[
18
]
=
{
0x0
};
void
*
nodes_array
,
*
table
;
struct
node
*
p
;
int
i
;
...
...
@@ -894,11 +895,10 @@ void topologyd_dump_node_nbr(struct topologyd_private *priv, struct blob_buf *b)
/* Add details of own node first */
p
=
&
priv
->
selfnode
;
table
=
blobmsg_open_table
(
b
,
"self"
);
topologyd_dump_node
(
b
,
p
,
1
);
blobmsg_close_table
(
b
,
table
);
hwaddr_ntoa
(
p
->
hwaddr
,
mac_str
);
blobmsg_add_string
(
b
,
"ieee1905_macaddr"
,
mac_str
);
nodes_array
=
blobmsg_open_array
(
b
,
"n
ode
s"
);
nodes_array
=
blobmsg_open_array
(
b
,
"n
eighbor
s"
);
for
(
i
=
0
;
i
<
NODE_HTABLE_SIZE
;
i
++
)
{
if
(
hlist_empty
(
&
priv
->
topo
.
node_htable
[
i
]))
continue
;
...
...
@@ -908,9 +908,8 @@ void topologyd_dump_node_nbr(struct topologyd_private *priv, struct blob_buf *b)
if
(
hwaddr_is_zero
(
p
->
hwaddr
))
// TODO: unlikely..
continue
;
table
=
blobmsg_open_table
(
b
,
NULL
);
topologyd_dump_node
(
b
,
p
,
1
);
blobmsg_close_table
(
b
,
table
);
hwaddr_ntoa
(
p
->
hwaddr
,
mac_str
);
blobmsg_add_string
(
b
,
NULL
,
mac_str
);
}
}
blobmsg_close_array
(
b
,
nodes_array
);
...
...
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