1258945Sroberto/*****************************************************************************
2258945Sroberto *
3258945Sroberto *  libntpq_subs.c
4258945Sroberto *
5258945Sroberto *  This is the second part of the wrapper library for ntpq, the NTP query utility.
6258945Sroberto *  This library reuses the sourcecode from ntpq and exports a number
7258945Sroberto *  of useful functions in a library that can be linked against applications
8258945Sroberto *  that need to query the status of a running ntpd. The whole
9258945Sroberto *  communcation is based on mode 6 packets.
10258945Sroberto *
11258945Sroberto *  This source file exports the (private) functions from ntpq-subs.c
12258945Sroberto *
13258945Sroberto ****************************************************************************/
14258945Sroberto
15258945Sroberto
16258945Sroberto#include "ntpq-subs.c"
17258945Sroberto#include "libntpq.h"
18258945Sroberto
19258945Sroberto
20258945Srobertoint ntpq_dogetassoc(void)
21258945Sroberto{
22258945Sroberto
23280849Scy	if (dogetassoc(NULL))
24258945Sroberto		return numassoc;
25280849Scy	else
26280849Scy		return 0;
27258945Sroberto}
28258945Sroberto
29280849Scy/* the following functions are required internally by a number of libntpq functions
30280849Scy * and since they are defined as static in ntpq-subs.c, they need to be exported here
31280849Scy */
32280849Scy
33258945Srobertochar ntpq_decodeaddrtype(sockaddr_u *sock)
34258945Sroberto{
35258945Sroberto	return decodeaddrtype(sock);
36258945Sroberto}
37258945Sroberto
38258945Srobertoint
39258945Srobertontpq_doquerylist(
40258945Sroberto	struct ntpq_varlist *vlist,
41258945Sroberto	int op,
42258945Sroberto	associd_t associd,
43258945Sroberto	int auth,
44258945Sroberto	u_short *rstatus,
45293893Sglebius	size_t *dsize,
46258945Sroberto	const char **datap
47258945Sroberto	)
48258945Sroberto{
49258945Sroberto	return doquerylist((struct varlist *)vlist, op, associd, auth,
50258945Sroberto			   rstatus, dsize, datap);
51258945Sroberto}
52258945Sroberto
53