1*cfb92d14SAndroid Build Coastguard Worker# OpenThread CLI - SRP Server 2*cfb92d14SAndroid Build Coastguard Worker 3*cfb92d14SAndroid Build Coastguard Worker## Quick Start 4*cfb92d14SAndroid Build Coastguard Worker 5*cfb92d14SAndroid Build Coastguard WorkerSee [README_SRP.md](README_SRP.md). 6*cfb92d14SAndroid Build Coastguard Worker 7*cfb92d14SAndroid Build Coastguard Worker## Command List 8*cfb92d14SAndroid Build Coastguard Worker 9*cfb92d14SAndroid Build Coastguard Worker- [help](#help) 10*cfb92d14SAndroid Build Coastguard Worker- [addrmode](#addrmode) 11*cfb92d14SAndroid Build Coastguard Worker- [auto](#auto) 12*cfb92d14SAndroid Build Coastguard Worker- [disable](#disable) 13*cfb92d14SAndroid Build Coastguard Worker- [domain](#domain) 14*cfb92d14SAndroid Build Coastguard Worker- [enable](#enable) 15*cfb92d14SAndroid Build Coastguard Worker- [host](#host) 16*cfb92d14SAndroid Build Coastguard Worker- [lease](#lease) 17*cfb92d14SAndroid Build Coastguard Worker- [seqnum](#seqnum) 18*cfb92d14SAndroid Build Coastguard Worker- [service](#service) 19*cfb92d14SAndroid Build Coastguard Worker- [state](#state) 20*cfb92d14SAndroid Build Coastguard Worker 21*cfb92d14SAndroid Build Coastguard Worker## Command Details 22*cfb92d14SAndroid Build Coastguard Worker 23*cfb92d14SAndroid Build Coastguard Worker### help 24*cfb92d14SAndroid Build Coastguard Worker 25*cfb92d14SAndroid Build Coastguard WorkerUsage: `srp server help` 26*cfb92d14SAndroid Build Coastguard Worker 27*cfb92d14SAndroid Build Coastguard WorkerPrint SRP server help menu. 28*cfb92d14SAndroid Build Coastguard Worker 29*cfb92d14SAndroid Build Coastguard Worker```bash 30*cfb92d14SAndroid Build Coastguard Worker> srp server help 31*cfb92d14SAndroid Build Coastguard Workeraddrmode 32*cfb92d14SAndroid Build Coastguard Workerauto 33*cfb92d14SAndroid Build Coastguard Workerdisable 34*cfb92d14SAndroid Build Coastguard Workerdomain 35*cfb92d14SAndroid Build Coastguard Workerenable 36*cfb92d14SAndroid Build Coastguard Workerhelp 37*cfb92d14SAndroid Build Coastguard Workerhost 38*cfb92d14SAndroid Build Coastguard Workerlease 39*cfb92d14SAndroid Build Coastguard Workerseqnum 40*cfb92d14SAndroid Build Coastguard Workerservice 41*cfb92d14SAndroid Build Coastguard Workerstate 42*cfb92d14SAndroid Build Coastguard WorkerDone 43*cfb92d14SAndroid Build Coastguard Worker``` 44*cfb92d14SAndroid Build Coastguard Worker 45*cfb92d14SAndroid Build Coastguard Worker### addrmode 46*cfb92d14SAndroid Build Coastguard Worker 47*cfb92d14SAndroid Build Coastguard WorkerUsage: `srp server addrmode [unicast|anycast]` 48*cfb92d14SAndroid Build Coastguard Worker 49*cfb92d14SAndroid Build Coastguard WorkerGet or set the address mode used by the SRP server. 50*cfb92d14SAndroid Build Coastguard Worker 51*cfb92d14SAndroid Build Coastguard WorkerAddress mode specifies how the address and port number are determined by the SRP server and this is published in the Thread Network Data. 52*cfb92d14SAndroid Build Coastguard Worker 53*cfb92d14SAndroid Build Coastguard WorkerGet the address mode. 54*cfb92d14SAndroid Build Coastguard Worker 55*cfb92d14SAndroid Build Coastguard Worker```bash 56*cfb92d14SAndroid Build Coastguard Worker> srp server addrmode 57*cfb92d14SAndroid Build Coastguard Workerunicast 58*cfb92d14SAndroid Build Coastguard WorkerDone 59*cfb92d14SAndroid Build Coastguard Worker``` 60*cfb92d14SAndroid Build Coastguard Worker 61*cfb92d14SAndroid Build Coastguard WorkerSet the address mode. 62*cfb92d14SAndroid Build Coastguard Worker 63*cfb92d14SAndroid Build Coastguard Worker```bash 64*cfb92d14SAndroid Build Coastguard Worker> srp server addrmode anycast 65*cfb92d14SAndroid Build Coastguard WorkerDone 66*cfb92d14SAndroid Build Coastguard Worker 67*cfb92d14SAndroid Build Coastguard Worker> srp server addrmode 68*cfb92d14SAndroid Build Coastguard Workeranycast 69*cfb92d14SAndroid Build Coastguard WorkerDone 70*cfb92d14SAndroid Build Coastguard Worker``` 71*cfb92d14SAndroid Build Coastguard Worker 72*cfb92d14SAndroid Build Coastguard Worker### auto 73*cfb92d14SAndroid Build Coastguard Worker 74*cfb92d14SAndroid Build Coastguard WorkerUsage: `srp server auto [enable|disable]` 75*cfb92d14SAndroid Build Coastguard Worker 76*cfb92d14SAndroid Build Coastguard WorkerEnables or disables the auto-enable mode on the SRP server. 77*cfb92d14SAndroid Build Coastguard Worker 78*cfb92d14SAndroid Build Coastguard WorkerWhen this mode is enabled, the Border Routing Manager controls if and when to enable or disable the SRP server. 79*cfb92d14SAndroid Build Coastguard Worker 80*cfb92d14SAndroid Build Coastguard WorkerThis command requires that `OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE` be enabled. 81*cfb92d14SAndroid Build Coastguard Worker 82*cfb92d14SAndroid Build Coastguard Worker```bash 83*cfb92d14SAndroid Build Coastguard Worker> srp server auto enable 84*cfb92d14SAndroid Build Coastguard WorkerDone 85*cfb92d14SAndroid Build Coastguard Worker 86*cfb92d14SAndroid Build Coastguard Worker> srp server auto 87*cfb92d14SAndroid Build Coastguard WorkerEnabled 88*cfb92d14SAndroid Build Coastguard WorkerDone 89*cfb92d14SAndroid Build Coastguard Worker``` 90*cfb92d14SAndroid Build Coastguard Worker 91*cfb92d14SAndroid Build Coastguard Worker### disable 92*cfb92d14SAndroid Build Coastguard Worker 93*cfb92d14SAndroid Build Coastguard WorkerUsage: `srp server disable` 94*cfb92d14SAndroid Build Coastguard Worker 95*cfb92d14SAndroid Build Coastguard WorkerDisable the SRP server. 96*cfb92d14SAndroid Build Coastguard Worker 97*cfb92d14SAndroid Build Coastguard Worker```bash 98*cfb92d14SAndroid Build Coastguard Worker> srp server disable 99*cfb92d14SAndroid Build Coastguard WorkerDone 100*cfb92d14SAndroid Build Coastguard Worker``` 101*cfb92d14SAndroid Build Coastguard Worker 102*cfb92d14SAndroid Build Coastguard Worker### domain 103*cfb92d14SAndroid Build Coastguard Worker 104*cfb92d14SAndroid Build Coastguard WorkerUsage: `srp server domain [domain-name]` 105*cfb92d14SAndroid Build Coastguard Worker 106*cfb92d14SAndroid Build Coastguard WorkerGet the domain. 107*cfb92d14SAndroid Build Coastguard Worker 108*cfb92d14SAndroid Build Coastguard Worker```bash 109*cfb92d14SAndroid Build Coastguard Worker> srp server domain 110*cfb92d14SAndroid Build Coastguard Workerdefault.service.arpa. 111*cfb92d14SAndroid Build Coastguard WorkerDone 112*cfb92d14SAndroid Build Coastguard Worker``` 113*cfb92d14SAndroid Build Coastguard Worker 114*cfb92d14SAndroid Build Coastguard WorkerSet the domain. 115*cfb92d14SAndroid Build Coastguard Worker 116*cfb92d14SAndroid Build Coastguard Worker```bash 117*cfb92d14SAndroid Build Coastguard Worker> srp server domain thread.service.arpa. 118*cfb92d14SAndroid Build Coastguard WorkerDone 119*cfb92d14SAndroid Build Coastguard Worker``` 120*cfb92d14SAndroid Build Coastguard Worker 121*cfb92d14SAndroid Build Coastguard Worker### enable 122*cfb92d14SAndroid Build Coastguard Worker 123*cfb92d14SAndroid Build Coastguard WorkerUsage: `srp server enable` 124*cfb92d14SAndroid Build Coastguard Worker 125*cfb92d14SAndroid Build Coastguard WorkerEnable the SRP server. 126*cfb92d14SAndroid Build Coastguard Worker 127*cfb92d14SAndroid Build Coastguard Worker```bash 128*cfb92d14SAndroid Build Coastguard Worker> srp server enable 129*cfb92d14SAndroid Build Coastguard WorkerDone 130*cfb92d14SAndroid Build Coastguard Worker``` 131*cfb92d14SAndroid Build Coastguard Worker 132*cfb92d14SAndroid Build Coastguard Worker### host 133*cfb92d14SAndroid Build Coastguard Worker 134*cfb92d14SAndroid Build Coastguard WorkerUsage: `srp server host` 135*cfb92d14SAndroid Build Coastguard Worker 136*cfb92d14SAndroid Build Coastguard WorkerPrint information of all registered hosts. 137*cfb92d14SAndroid Build Coastguard Worker 138*cfb92d14SAndroid Build Coastguard Worker```bash 139*cfb92d14SAndroid Build Coastguard Worker> srp server host 140*cfb92d14SAndroid Build Coastguard Workersrp-api-test-1.default.service.arpa. 141*cfb92d14SAndroid Build Coastguard Worker deleted: false 142*cfb92d14SAndroid Build Coastguard Worker addresses: [fdde:ad00:beef:0:0:ff:fe00:fc10] 143*cfb92d14SAndroid Build Coastguard Workersrp-api-test-0.default.service.arpa. 144*cfb92d14SAndroid Build Coastguard Worker deleted: false 145*cfb92d14SAndroid Build Coastguard Worker addresses: [fdde:ad00:beef:0:0:ff:fe00:fc10] 146*cfb92d14SAndroid Build Coastguard WorkerDone 147*cfb92d14SAndroid Build Coastguard Worker``` 148*cfb92d14SAndroid Build Coastguard Worker 149*cfb92d14SAndroid Build Coastguard Worker### lease 150*cfb92d14SAndroid Build Coastguard Worker 151*cfb92d14SAndroid Build Coastguard WorkerUsage: `srp server lease [<min-lease>] [<max-lease>] [<min-key-lease>] [<max-key-lease>]` 152*cfb92d14SAndroid Build Coastguard Worker 153*cfb92d14SAndroid Build Coastguard WorkerGet LEASE and KEY-LEASE values. 154*cfb92d14SAndroid Build Coastguard Worker 155*cfb92d14SAndroid Build Coastguard Worker```bash 156*cfb92d14SAndroid Build Coastguard Worker> srp server lease 157*cfb92d14SAndroid Build Coastguard Workermin lease: 1800 158*cfb92d14SAndroid Build Coastguard Workermax lease: 7200 159*cfb92d14SAndroid Build Coastguard Workermin key-lease: 86400 160*cfb92d14SAndroid Build Coastguard Workermax key-lease: 1209600 161*cfb92d14SAndroid Build Coastguard WorkerDone 162*cfb92d14SAndroid Build Coastguard Worker``` 163*cfb92d14SAndroid Build Coastguard Worker 164*cfb92d14SAndroid Build Coastguard WorkerSet LEASE and KEY-LEASE values. 165*cfb92d14SAndroid Build Coastguard Worker 166*cfb92d14SAndroid Build Coastguard Worker```bash 167*cfb92d14SAndroid Build Coastguard Worker> srp server lease 1800 7200 86400 1209600 168*cfb92d14SAndroid Build Coastguard WorkerDone 169*cfb92d14SAndroid Build Coastguard Worker``` 170*cfb92d14SAndroid Build Coastguard Worker 171*cfb92d14SAndroid Build Coastguard Worker### seqnum 172*cfb92d14SAndroid Build Coastguard Worker 173*cfb92d14SAndroid Build Coastguard WorkerUsage: `srp server seqnum [<seqnum>]` 174*cfb92d14SAndroid Build Coastguard Worker 175*cfb92d14SAndroid Build Coastguard WorkerGet or set the sequence number used with anycast address mode. 176*cfb92d14SAndroid Build Coastguard Worker 177*cfb92d14SAndroid Build Coastguard WorkerThe sequence number is included in "DNS/SRP Service Anycast Address" entry published in the Network Data. 178*cfb92d14SAndroid Build Coastguard Worker 179*cfb92d14SAndroid Build Coastguard Worker```bash 180*cfb92d14SAndroid Build Coastguard Worker> srp server seqnum 20 181*cfb92d14SAndroid Build Coastguard WorkerDone 182*cfb92d14SAndroid Build Coastguard Worker 183*cfb92d14SAndroid Build Coastguard Worker> srp server seqnum 184*cfb92d14SAndroid Build Coastguard Worker20 185*cfb92d14SAndroid Build Coastguard WorkerDone 186*cfb92d14SAndroid Build Coastguard Worker``` 187*cfb92d14SAndroid Build Coastguard Worker 188*cfb92d14SAndroid Build Coastguard Worker### service 189*cfb92d14SAndroid Build Coastguard Worker 190*cfb92d14SAndroid Build Coastguard WorkerUsage: `srp server service` 191*cfb92d14SAndroid Build Coastguard Worker 192*cfb92d14SAndroid Build Coastguard WorkerPrint information of all registered services. 193*cfb92d14SAndroid Build Coastguard Worker 194*cfb92d14SAndroid Build Coastguard WorkerThe TXT record is displayed as an array of entries. If an entry has a key, the key will be printed in ASCII format. The value portion will always be printed as hex bytes. 195*cfb92d14SAndroid Build Coastguard Worker 196*cfb92d14SAndroid Build Coastguard Worker```bash 197*cfb92d14SAndroid Build Coastguard Worker> srp server service 198*cfb92d14SAndroid Build Coastguard Workersrp-api-test-1._ipps._tcp.default.service.arpa. 199*cfb92d14SAndroid Build Coastguard Worker deleted: false 200*cfb92d14SAndroid Build Coastguard Worker subtypes: (null) 201*cfb92d14SAndroid Build Coastguard Worker port: 49152 202*cfb92d14SAndroid Build Coastguard Worker priority: 0 203*cfb92d14SAndroid Build Coastguard Worker weight: 0 204*cfb92d14SAndroid Build Coastguard Worker ttl: 7200 205*cfb92d14SAndroid Build Coastguard Worker lease: 7200 206*cfb92d14SAndroid Build Coastguard Worker key-lease: 1209600 207*cfb92d14SAndroid Build Coastguard Worker TXT: [616263, xyz=585960] 208*cfb92d14SAndroid Build Coastguard Worker host: srp-api-test-1.default.service.arpa. 209*cfb92d14SAndroid Build Coastguard Worker addresses: [fdde:ad00:beef:0:0:ff:fe00:fc10] 210*cfb92d14SAndroid Build Coastguard Workersrp-api-test-0._ipps._tcp.default.service.arpa. 211*cfb92d14SAndroid Build Coastguard Worker deleted: false 212*cfb92d14SAndroid Build Coastguard Worker subtypes: _sub1,_sub2 213*cfb92d14SAndroid Build Coastguard Worker port: 49152 214*cfb92d14SAndroid Build Coastguard Worker priority: 0 215*cfb92d14SAndroid Build Coastguard Worker weight: 0 216*cfb92d14SAndroid Build Coastguard Worker ttl: 3600 217*cfb92d14SAndroid Build Coastguard Worker lease: 3600 218*cfb92d14SAndroid Build Coastguard Worker key-lease: 1209600 219*cfb92d14SAndroid Build Coastguard Worker TXT: [616263, xyz=585960] 220*cfb92d14SAndroid Build Coastguard Worker host: srp-api-test-0.default.service.arpa. 221*cfb92d14SAndroid Build Coastguard Worker addresses: [fdde:ad00:beef:0:0:ff:fe00:fc10] 222*cfb92d14SAndroid Build Coastguard WorkerDone 223*cfb92d14SAndroid Build Coastguard Worker``` 224*cfb92d14SAndroid Build Coastguard Worker 225*cfb92d14SAndroid Build Coastguard Worker### state 226*cfb92d14SAndroid Build Coastguard Worker 227*cfb92d14SAndroid Build Coastguard WorkerUsage: `srp server state` 228*cfb92d14SAndroid Build Coastguard Worker 229*cfb92d14SAndroid Build Coastguard WorkerPrint the state of the SRP server. It could be `disabled`, `stopped` or `running`. 230*cfb92d14SAndroid Build Coastguard Worker 231*cfb92d14SAndroid Build Coastguard Worker- disabled: The SRP server is not enabled. 232*cfb92d14SAndroid Build Coastguard Worker- stopped: The SRP server is enabled but not active due to existing SRP servers already active in the Thread network. The SRP server may become active when existing SRP servers are no longer active within the Thread network. 233*cfb92d14SAndroid Build Coastguard Worker- running: The SRP server is active and will handle service registrations. 234*cfb92d14SAndroid Build Coastguard Worker 235*cfb92d14SAndroid Build Coastguard Worker```bash 236*cfb92d14SAndroid Build Coastguard Worker> srp server state 237*cfb92d14SAndroid Build Coastguard Workerrunning 238*cfb92d14SAndroid Build Coastguard WorkerDone 239*cfb92d14SAndroid Build Coastguard Worker``` 240