[ip6] add public API to convert otSockAddr to string (#6693)

This commit adds public API `otIp6SockAddrToString()` which converts
an IPv6 socket address (`otSockAddr`) to human-readable string. The
CLI modules (e.g. `ProcessNetStat()`) are then updated to use the new
API.
This commit is contained in:
Abtin Keshavarzian
2021-06-01 13:08:13 -07:00
committed by GitHub
parent 260f2dde57
commit 60ff174c44
10 changed files with 83 additions and 72 deletions
+9 -9
View File
@@ -35,24 +35,24 @@ setup_leader
send "udp open\n"
expect_line "Done"
send "netstat\n"
expect "| Local Address | Peer Address |"
expect "+-----------------------------------------------+-----------------------------------------------+"
expect "| 0:0:0:0:0:0:0:0:* | 0:0:0:0:0:0:0:0:* |"
expect "| Local Address | Peer Address |"
expect "+-------------------------------------------------+-------------------------------------------------+"
expect "| [0:0:0:0:0:0:0:0]:0 | [0:0:0:0:0:0:0:0]:0 |"
expect_line "Done"
send "udp bind :: 10001\n"
expect_line "Done"
send "netstat\n"
expect "| Local Address | Peer Address |"
expect "+-----------------------------------------------+-----------------------------------------------+"
expect "| 0:0:0:0:0:0:0:0:10001 | 0:0:0:0:0:0:0:0:* |"
expect "| Local Address | Peer Address |"
expect "+-------------------------------------------------+-------------------------------------------------+"
expect "| [0:0:0:0:0:0:0:0]:1001 | [0:0:0:0:0:0:0:0]:0 |"
expect_line "Done"
set addr [get_ipaddr mleid]
send "udp connect $addr 10001\n"
expect_line "Done"
send "netstat\n"
expect "| Local Address | Peer Address |"
expect "+-----------------------------------------------+-----------------------------------------------+"
expect -re "\\| 0:0:0:0:0:0:0:0:10001 +\\| $addr:10001 +\\|"
expect "| Local Address | Peer Address |"
expect "+-------------------------------------------------+-------------------------------------------------+"
expect -re "\\| \\[0:0:0:0:0:0:0:0\\]:10001 +\\| \\[$addr\\]:10001 +\\|"
expect_line "Done"
dispose_all