/* ================================================== */
+void
+NCR_ModifyOffset(NCR_Instance inst, double new_offset)
+{
+ inst->offset_correction = new_offset;
+ LOG(LOGS_INFO, "Source %s new offset %f",
+ UTI_IPToString(&inst->remote_addr.ip_addr), new_offset);
+}
+
+/* ================================================== */
+
void
NCR_ModifyPolltarget(NCR_Instance inst, int new_poll_target)
{
extern void NCR_ModifyMinstratum(NCR_Instance inst, int new_min_stratum);
+extern void NCR_ModifyOffset(NCR_Instance inst, double new_offset);
+
extern void NCR_ModifyPolltarget(NCR_Instance inst, int new_poll_target);
extern void NCR_InitiateSampleBurst(NCR_Instance inst, int n_good_samples, int n_total_samples);
/* ================================================== */
+int
+NSR_ModifyOffset(IPAddr *address, double new_offset)
+{
+ int slot;
+
+ if (!find_slot(address, &slot))
+ return 0;
+
+ NCR_ModifyOffset(get_record(slot)->data, new_offset);
+ return 1;
+}
+
+/* ================================================== */
+
int
NSR_ModifyPolltarget(IPAddr *address, int new_poll_target)
{
extern int NSR_ModifyMinstratum(IPAddr *address, int new_min_stratum);
+extern int NSR_ModifyOffset(IPAddr *address, double new_offset);
+
extern int NSR_ModifyPolltarget(IPAddr *address, int new_poll_target);
extern int NSR_InitiateSampleBurst(int n_good_samples, int n_total_samples, IPAddr *mask, IPAddr *address);
}
}
+int
+RCL_ModifyOffset(uint32_t ref_id, double offset)
+{
+ unsigned int i;
+
+ for (i = 0; i < ARR_GetSize(refclocks); i++) {
+ RCL_Instance inst = get_refclock(i);
+ if (inst->ref_id == ref_id) {
+ inst->offset = offset;
+ LOG(LOGS_INFO, "Source %s new offset %f", UTI_RefidToString(ref_id), offset);
+ return 1;
+ }
+ }
+ return 0;
+}
+
void
RCL_SetDriverData(RCL_Instance instance, void *data)
{
extern int RCL_AddRefclock(RefclockParameters *params);
extern void RCL_StartRefclocks(void);
extern void RCL_ReportSource(RPT_SourceReport *report, struct timespec *now);
+extern int RCL_ModifyOffset(uint32_t ref_id, double offset);
/* functions used by drivers */
extern void RCL_SetDriverData(RCL_Instance instance, void *data);
return 0;
}
+int
+NSR_ModifyOffset(IPAddr *address, double new_offset)
+{
+ return 0;
+}
+
int
NSR_ModifyPolltarget(IPAddr *address, int new_poll_target)
{
memset(report, 0, sizeof (*report));
}
+int
+RCL_ModifyOffset(uint32_t ref_id, double offset)
+{
+ return 0;
+}
+
#endif /* !FEAT_REFCLOCK */
#ifndef FEAT_SIGND