[netdata] new API to get lowpan context IDs (#8870)

This commit adds `otNetDataGetNextLowpanContextInfo()` to iterate
through the list of LoWPAN Context entries in Thread Network Data
providing info about the prefix, its LoWPAN Context ID and Compress
flag (relating to `ContextTlv` sub-TLVs of `PrefixTlv`s in Network
Data).

This commit also updates CLI command `netdata show` to list the
context IDs in addition to prefixes, routes, and services.
This commit is contained in:
Abtin Keshavarzian
2023-03-17 21:39:59 -07:00
committed by GitHub
parent 89d5799d76
commit af031f3b50
14 changed files with 263 additions and 11 deletions
+4 -2
View File
@@ -2300,6 +2300,8 @@ class NodeImpl:
for line in netdata:
if line.startswith('Services:'):
services_section = True
elif line.startswith('Contexts'):
services_section = False
elif services_section:
services.append(line.strip().split(' '))
return services
@@ -2310,8 +2312,8 @@ class NodeImpl:
def get_netdata(self):
raw_netdata = self.netdata_show()
netdata = {'Prefixes': [], 'Routes': [], 'Services': []}
key_list = ['Prefixes', 'Routes', 'Services']
netdata = {'Prefixes': [], 'Routes': [], 'Services': [], 'Contexts': []}
key_list = ['Prefixes', 'Routes', 'Services', 'Contexts']
key = None
for i in range(0, len(raw_netdata)):