xref: /netbsd-src/external/bsd/ntp/dist/sntp/tests/sntptest.c (revision afab4e300d3a9fb07dd8c80daf53d0feb3345706)
1 /*	$NetBSD: sntptest.c,v 1.2 2020/05/25 20:47:35 christos Exp $	*/
2 
3 
4 #include "config.h"
5 #include "ntp_stdlib.h"
6 #include "sntp-opts.h"
7 #include "sntptest.h"
8 
9 void
10 sntptest(void) {
11 	optionSaveState(&sntpOptions);
12 }
13 
14 
15 void
16 sntptest_destroy(void) {
17 	optionRestore(&sntpOptions);
18 }
19 
20 
21 void
22 ActivateOption(const char* option, const char* argument) {
23 
24 	const int ARGV_SIZE = 4;
25 
26 	char* opts[ARGV_SIZE];
27 
28 	opts[0] = estrdup("sntpopts");
29 	opts[1] = estrdup(option);
30 	opts[2] = estrdup(argument);
31 	opts[3] = estrdup("127.0.0.1");
32 
33 	optionProcess(&sntpOptions, ARGV_SIZE, opts);
34 }
35 
36