xref: /netbsd-src/external/bsd/ntp/dist/sntp/main.h (revision cdfa2a7ef92791ba9db70a584a1d904730e6fb46)
1 /*	$NetBSD: main.h,v 1.5 2020/05/25 20:47:32 christos Exp $	*/
2 
3 #ifndef MAIN_H
4 #define MAIN_H
5 
6 #include <stdio.h>
7 #include <isc/result.h>
8 #include <isc/net.h>
9 
10 #include <ntp.h>
11 #include <ntp_unixtime.h>
12 #include <ntp_stdlib.h>
13 #include <ntp_intres.h>
14 #include <ntp_debug.h>
15 #include <timevalops.h>
16 
17 #include <sntp-opts.h>
18 
19 #include "crypto.h"
20 
21 void	set_li_vn_mode(struct pkt *spkt, char leap, char version, char mode);
22 extern int sntp_main(int argc, char **argv, const char *);
23 int	generate_pkt(struct pkt *x_pkt, const struct timeval *tv_xmt,
24 				  int key_id, struct key *pkt_key);
25 int	handle_pkt(int rpktl, struct pkt *rpkt, sockaddr_u *host,
26 		   const char *hostname);
27 void	offset_calculation(struct pkt *rpkt, int rpktl,
28 			   struct timeval *tv_dst, double *offset,
29 			   double *precision, double *root_dispersion);
30 int	on_wire(struct addrinfo *host, struct addrinfo *bcastaddr);
31 int	set_time(double offset);
32 
33 #endif /* MAIN_H */
34