clientlog: count authenticated NTP requests
This commit is contained in:
parent
6366ebc17e
commit
f8df4789b1
3 changed files with 12 additions and 0 deletions
|
@ -127,6 +127,7 @@ static int active;
|
|||
/* Global statistics */
|
||||
static uint32_t total_hits[MAX_SERVICES];
|
||||
static uint32_t total_drops[MAX_SERVICES];
|
||||
static uint32_t total_ntp_auth_hits;
|
||||
static uint32_t total_record_drops;
|
||||
|
||||
#define NSEC_PER_SEC 1000000000U
|
||||
|
@ -585,6 +586,14 @@ CLG_LimitServiceRate(CLG_Service service, int index)
|
|||
|
||||
/* ================================================== */
|
||||
|
||||
void
|
||||
CLG_LogAuthNtpRequest(void)
|
||||
{
|
||||
total_ntp_auth_hits++;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
void CLG_GetNtpTimestamps(int index, NTP_int64 **rx_ts, NTP_int64 **tx_ts)
|
||||
{
|
||||
Record *record;
|
||||
|
|
|
@ -42,6 +42,7 @@ extern void CLG_Finalise(void);
|
|||
extern int CLG_GetClientIndex(IPAddr *client);
|
||||
extern int CLG_LogServiceAccess(CLG_Service service, IPAddr *client, struct timespec *now);
|
||||
extern int CLG_LimitServiceRate(CLG_Service service, int index);
|
||||
extern void CLG_LogAuthNtpRequest(void);
|
||||
extern void CLG_GetNtpTimestamps(int index, NTP_int64 **rx_ts, NTP_int64 **tx_ts);
|
||||
extern int CLG_GetNtpMinPoll(void);
|
||||
|
||||
|
|
|
@ -2096,6 +2096,8 @@ NCR_ProcessRxUnknown(NTP_Remote_Address *remote_addr, NTP_Local_Address *local_a
|
|||
/* Don't respond unless a non-zero KoD was returned */
|
||||
if (kod == 0)
|
||||
return;
|
||||
} else if (info.auth.mode != NTP_AUTH_NONE && info.auth.mode != NTP_AUTH_MSSNTP) {
|
||||
CLG_LogAuthNtpRequest();
|
||||
}
|
||||
|
||||
/* If it is an NTPv4 packet with a long MAC and no extension fields,
|
||||
|
|
Loading…
Reference in a new issue