cmdmon: specify name instead of address in add request

Modify the request for adding a source to provide the name of the source
instead of its address (resolved in chronyc) in order to enable chronyd
to replace the source, support an "add pool" command, and enable an NTS
client to verify the server's certificate.

The name resolving does not block the response. Success is indicated
even if the name cannot be resolved, or a source with the same address
is already present.

To prevent unresolvable names from getting to chronyd, chronyc does not
send the request if it could not resolve the name itself (assuming they
are both running on the same host using the same resolver).
This commit is contained in:
Miroslav Lichvar
2019-12-04 12:04:19 +01:00
parent 00fff161cf
commit 02914ac637
4 changed files with 37 additions and 16 deletions

View File

@@ -263,7 +263,7 @@ typedef struct {
typedef struct {
uint32_t type;
IPAddr ip_addr;
int8_t name[256];
uint32_t port;
int32_t minpoll;
int32_t maxpoll;
@@ -503,6 +503,7 @@ typedef struct {
#define STT_INVALIDAF 17
#define STT_BADPKTVERSION 18
#define STT_BADPKTLENGTH 19
#define STT_INVALIDNAME 21
typedef struct {
int32_t EOR;