ntp: add configuration ID to sources

Provide an ID for each configured NTP source to enable tracking and
removing of its corresponding sources, even after they change their
address.
This commit is contained in:
Miroslav Lichvar
2020-06-09 11:59:25 +02:00
parent 428f9e4228
commit 951f14ae06
6 changed files with 66 additions and 14 deletions

11
stubs.c
View File

@@ -194,13 +194,15 @@ NSR_Finalise(void)
}
NSR_Status
NSR_AddSource(NTP_Remote_Address *remote_addr, NTP_Source_Type type, SourceParameters *params)
NSR_AddSource(NTP_Remote_Address *remote_addr, NTP_Source_Type type,
SourceParameters *params, uint32_t *conf_id)
{
return NSR_TooManySources;
}
NSR_Status
NSR_AddSourceByName(char *name, int port, int pool, NTP_Source_Type type, SourceParameters *params)
NSR_AddSourceByName(char *name, int port, int pool, NTP_Source_Type type,
SourceParameters *params, uint32_t *conf_id)
{
return NSR_TooManySources;
}
@@ -211,6 +213,11 @@ NSR_RemoveSource(IPAddr *address)
return NSR_NoSuchSource;
}
void
NSR_RemoveSourcesById(uint32_t conf_id)
{
}
void
NSR_RemoveAllSources(void)
{