[srp-server] implement TTL processing (#7738)

This commit is contained in:
Jonathan Hui
2022-05-31 22:01:27 -07:00
committed by GitHub
parent 11eb753484
commit 33cc75ed3b
12 changed files with 399 additions and 14 deletions
+7 -2
View File
@@ -929,6 +929,10 @@ class NodeImpl:
self.send_command(f'srp server lease {min_lease} {max_lease} {min_key_lease} {max_key_lease}')
self._expect_done()
def srp_server_set_ttl_range(self, min_ttl, max_ttl):
self.send_command(f'srp server ttl {min_ttl} {max_ttl}')
self._expect_done()
def srp_server_get_hosts(self):
"""Returns the host list on the SRP server as a list of property
dictionary.
@@ -989,6 +993,7 @@ class NodeImpl:
'port': '12345',
'priority': '0',
'weight': '0',
'ttl': '7200',
'TXT': ['abc=010203'],
'host_fullname': 'my-host.default.service.arpa.',
'host': 'my-host',
@@ -1015,8 +1020,8 @@ class NodeImpl:
service_list.append(service)
continue
# 'subtypes', port', 'priority', 'weight'
for i in range(0, 4):
# 'subtypes', port', 'priority', 'weight', 'ttl'
for i in range(0, 5):
key_value = lines.pop(0).strip().split(':')
service[key_value[0].strip()] = key_value[1].strip()