ntp: don't replace source instance when changing address

Add new functions to change source's reference ID/address and reset the
instance. Use that instead of destroying and creating a new instance
when the NTP address is changed.
This commit is contained in:
Miroslav Lichvar
2014-12-01 18:01:11 +01:00
parent 308bcae257
commit 42dd5caa1b
5 changed files with 53 additions and 28 deletions

View File

@@ -74,6 +74,11 @@ extern SRC_Instance SRC_CreateNewInstance(uint32_t ref_id, SRC_Type type, SRC_Se
extern void SRC_DestroyInstance(SRC_Instance instance);
/* Function to reset a source */
extern void SRC_ResetInstance(SRC_Instance instance);
/* Function to change the sources's reference ID and IP address */
extern void SRC_SetRefid(SRC_Instance instance, uint32_t ref_id, IPAddr *addr);
/* Function to get the range of frequencies, relative to the given
source, that we believe the local clock lies within. The return
@@ -174,7 +179,5 @@ extern SRC_Type SRC_GetType(int index);
extern int SRC_Samples(SRC_Instance inst);
extern SRC_SelectOption SRC_GetSelectOption(SRC_Instance inst);
#endif /* GOT_SOURCES_H */