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