summaryrefslogtreecommitdiff
path: root/ntpq/libntpq_subs.c
blob: e53b4193c9e4993f24d25cb8e8f8445ad710d03d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*****************************************************************************
 *
 *  libntpq_subs.c
 *
 *  This is the second part of the wrapper library for ntpq, the NTP query utility. 
 *  This library reuses the sourcecode from ntpq and exports a number
 *  of useful functions in a library that can be linked against applications
 *  that need to query the status of a running ntpd. The whole 
 *  communcation is based on mode 6 packets.
 *
 *  This source file exports the (private) functions from ntpq-subs.c 
 *
 ****************************************************************************/


#include "ntpq-subs.c"
#include "libntpq.h"


int ntpq_dogetassoc(void)
{
	
	if (dogetassoc(NULL))
		return numassoc;
	else
		return 0;	
}

/* the following functions are required internally by a number of libntpq functions 
 * and since they are defined as static in ntpq-subs.c, they need to be exported here
 */
 
char ntpq_decodeaddrtype(sockaddr_u *sock)
{
	return decodeaddrtype(sock);
}

int
ntpq_doquerylist(
	struct ntpq_varlist *vlist,
	int op,
	associd_t associd,
	int auth,
	u_short *rstatus,
	int *dsize,
	const char **datap
	)
{
	return doquerylist((struct varlist *)vlist, op, associd, auth,
			   rstatus, dsize, datap);
}