mirror of
https://github.com/espressif/openthread.git
synced 2026-08-04 01:47:47 +00:00
[routing-manager] new APIs to get state and new CLI commands (#8784)
This commit adds new public OT APIs in `border_routing.h` to get the current state of `RoutingManager` and to get the current favored on-link prefix. This commit also updates CLI `br` commands: - It moves the CLI `br` implementation into own `cli_br` module. - It adds `br state` to get the current state - It changes `br omrprefix`, `br onlinkprefix`, and `br nat64prefix` to output both local and favored prefixes when no additional arg is provided and allow the use of `local` or `favored` extra arg to specify the type. - It updates the documentation of `br` related commands in the source code and also adding `cli/README_BR.md`.
This commit is contained in:
@@ -2110,7 +2110,7 @@ class NodeImpl:
|
||||
self._expect_done()
|
||||
|
||||
def get_br_omr_prefix(self):
|
||||
cmd = 'br omrprefix'
|
||||
cmd = 'br omrprefix local'
|
||||
self.send_command(cmd)
|
||||
return self._expect_command_output()[0]
|
||||
|
||||
@@ -2124,7 +2124,7 @@ class NodeImpl:
|
||||
return omr_prefixes
|
||||
|
||||
def get_br_on_link_prefix(self):
|
||||
cmd = 'br onlinkprefix'
|
||||
cmd = 'br onlinkprefix local'
|
||||
self.send_command(cmd)
|
||||
return self._expect_command_output()[0]
|
||||
|
||||
@@ -2137,12 +2137,12 @@ class NodeImpl:
|
||||
return prefixes
|
||||
|
||||
def get_br_nat64_prefix(self):
|
||||
cmd = 'br nat64prefix'
|
||||
cmd = 'br nat64prefix local'
|
||||
self.send_command(cmd)
|
||||
return self._expect_command_output()[0]
|
||||
|
||||
def get_br_favored_nat64_prefix(self):
|
||||
cmd = 'br favorednat64prefix'
|
||||
cmd = 'br nat64prefix favored'
|
||||
self.send_command(cmd)
|
||||
return self._expect_command_output()[0].split(' ')[0]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user