"\0\0"
"Other daemon commands:\0\0"
"cyclelogs\0Close and re-open log files\0"
- "dump\0Dump all measurements to save files\0"
+ "dump\0Dump measurements and NTS keys/cookies\0"
"rekey\0Re-read keys from key file\0"
"reset\0Drop all measurements\0"
"shutdown\0Stop daemon\0"
#include "reference.h"
#include "manual.h"
#include "memory.h"
+#include "nts_ke_server.h"
#include "local.h"
#include "addrfilt.h"
#include "conf.h"
handle_dump(CMD_Request *rx_message, CMD_Reply *tx_message)
{
SRC_DumpSources();
+ NSR_DumpAuthData();
+ NKS_DumpKeys();
}
/* ================================================== */
assert(0);
}
}
+
+/* ================================================== */
+
+void
+NAU_DumpData(NAU_Instance instance)
+{
+ switch (instance->mode) {
+ case NTP_AUTH_NTS:
+ NNC_DumpData(instance->nts);
+ break;
+ default:
+ break;
+ }
+}
/* Change an authentication-specific address (e.g. after replacing a source) */
extern void NAU_ChangeAddress(NAU_Instance instance, IPAddr *address);
+/* Save authentication-specific data to speed up the next start */
+extern void NAU_DumpData(NAU_Instance instance);
+
#endif
/* ================================================== */
+void
+NCR_DumpAuthData(NCR_Instance inst)
+{
+ NAU_DumpData(inst->auth);
+}
+
+/* ================================================== */
+
static void
broadcast_timeout(void *arg)
{
extern int NCR_IsSyncPeer(NCR_Instance instance);
+extern void NCR_DumpAuthData(NCR_Instance inst);
+
extern void NCR_AddBroadcastDestination(IPAddr *addr, unsigned short port, int interval);
#endif /* GOT_NTP_CORE_H */
}
}
-
/* ================================================== */
+void
+NSR_DumpAuthData(void)
+{
+ SourceRecord *record;
+ int i;
+
+ for (i = 0; i < ARR_GetSize(records); i++) {
+ record = get_record(i);
+ if (!record->remote_addr)
+ continue;
+ NCR_DumpAuthData(record->data);
+ }
+}
extern void NSR_GetActivityReport(RPT_ActivityReport *report);
+extern void NSR_DumpAuthData(void);
+
#endif /* GOT_NTP_SOURCES_H */
/* ================================================== */
+void
+NKS_DumpKeys(void)
+{
+ save_keys();
+}
+
+/* ================================================== */
+
/* A server cookie consists of key ID, nonce, and encrypted C2S+S2C keys */
int
extern void NKS_Initialise(int scfilter_level);
extern void NKS_Finalise(void);
+/* Save the current server keys */
+extern void NKS_DumpKeys(void);
+
/* Generate an NTS cookie with a given context */
extern int NKS_GenerateCookie(NKE_Context *context, NKE_Cookie *cookie);
memset(&inst->context, 0, sizeof (inst->context));
inst->num_cookies = 0;
}
+
+/* ================================================== */
+
+void
+NNC_DumpData(NNC_Instance inst)
+{
+ save_cookies(inst);
+}
extern void NNC_ChangeAddress(NNC_Instance inst, IPAddr *address);
+extern void NNC_DumpData(NNC_Instance inst);
+
#endif
dumpdir = CNF_GetDumpDir();
if (dumpdir[0] == '\0') {
- LOG(LOGS_WARN, "dumpdir not specified");
return NULL;
}
memset(report, 0, sizeof (*report));
}
+void
+NSR_DumpAuthData(void)
+{
+}
+
#ifndef FEAT_CMDMON
void
{
}
+void
+NNC_DumpData(NNC_Instance inst)
+{
+}
+
void
NKC_Initialise(void)
{
{
}
+void
+NKS_DumpKeys(void)
+{
+}
+
#endif /* !FEAT_NTS */