]> git.ipfire.org Git - thirdparty/chrony.git/blame - nts_ke_client.h
clientlog: add support for KoD rate limiting
[thirdparty/chrony.git] / nts_ke_client.h
CommitLineData
a420ed57
ML
1/*
2 chronyd/chronyc - Programs for keeping computer clocks accurate.
3
4 **********************************************************************
5 * Copyright (C) Miroslav Lichvar 2020
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of version 2 of the GNU General Public License as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 *
20 **********************************************************************
21
22 =======================================================================
23
24 Header file for the NTS-KE client
25 */
26
27#ifndef GOT_NTS_KE_CLIENT_H
28#define GOT_NTS_KE_CLIENT_H
29
30#include "addressing.h"
31#include "nts_ke.h"
32
33typedef struct NKC_Instance_Record *NKC_Instance;
34
a420ed57 35/* Create a client NTS-KE instance */
6615bb1b 36extern NKC_Instance NKC_CreateInstance(IPSockAddr *address, const char *name, uint32_t cert_set);
a420ed57
ML
37
38/* Destroy an instance */
39extern void NKC_DestroyInstance(NKC_Instance inst);
40
41/* Connect to the server, start an NTS-KE session, send an NTS-KE request, and
42 process the response (asynchronously) */
43extern int NKC_Start(NKC_Instance inst);
44
45/* Check if the client is still running */
46extern int NKC_IsActive(NKC_Instance inst);
47
48/* Get the NTS data if the session was successful */
adcf0734 49extern int NKC_GetNtsData(NKC_Instance inst, NKE_Context *context,
a420ed57
ML
50 NKE_Cookie *cookies, int *num_cookies, int max_cookies,
51 IPSockAddr *ntp_address);
52
66dc2b6d
ML
53/* Get a factor to calculate retry interval (in log2 seconds) */
54extern int NKC_GetRetryFactor(NKC_Instance inst);
55
a420ed57 56#endif