xref: /freebsd/contrib/ntp/libntp/lib_strbuf.c (revision 6be3386466ab79a84b48429ae66244f21526d3df)
1 /*
2  * lib_strbuf - library string storage
3  */
4 #ifdef HAVE_CONFIG_H
5 #include <config.h>
6 #endif
7 
8 #include <isc/net.h>
9 #include <isc/result.h>
10 
11 #include "ntp_fp.h"
12 #include "ntp_stdlib.h"
13 #include "lib_strbuf.h"
14 
15 
16 /*
17  * Storage declarations
18  */
19 int		debug;
20 libbufstr	lib_stringbuf[LIB_NUMBUF];
21 int		lib_nextbuf;
22 int		ipv4_works;
23 int		ipv6_works;
24 int		lib_inited;
25 
26 
27 /*
28  * initialization routine.  Might be needed if the code is ROMized.
29  */
30 void
31 init_lib(void)
32 {
33 	if (lib_inited)
34 		return;
35 	ipv4_works = (ISC_R_SUCCESS == isc_net_probeipv4());
36 	ipv6_works = (ISC_R_SUCCESS == isc_net_probeipv6());
37 	init_systime();
38 	lib_inited = TRUE;
39 }
40