libntpq_subs.c revision 285612
1244971Sjkim/*****************************************************************************
2244971Sjkim *
3244971Sjkim *  libntpq_subs.c
4244971Sjkim *
5244971Sjkim *  This is the second part of the wrapper library for ntpq, the NTP query utility.
6244971Sjkim *  This library reuses the sourcecode from ntpq and exports a number
7244971Sjkim *  of useful functions in a library that can be linked against applications
8306536Sjkim *  that need to query the status of a running ntpd. The whole
9244971Sjkim *  communcation is based on mode 6 packets.
10244971Sjkim *
11244971Sjkim *  This source file exports the (private) functions from ntpq-subs.c
12244971Sjkim *
13244971Sjkim ****************************************************************************/
14244971Sjkim
15244971Sjkim
16244971Sjkim#include "ntpq-subs.c"
17244971Sjkim#include "libntpq.h"
18244971Sjkim
19244971Sjkim
20244971Sjkimint ntpq_dogetassoc(void)
21244971Sjkim{
22244971Sjkim
23244971Sjkim	if (dogetassoc(NULL))
24244971Sjkim		return numassoc;
25244971Sjkim	else
26244971Sjkim		return 0;
27244971Sjkim}
28244971Sjkim
29244971Sjkim/* the following functions are required internally by a number of libntpq functions
30244971Sjkim * and since they are defined as static in ntpq-subs.c, they need to be exported here
31244971Sjkim */
32244971Sjkim
33244971Sjkimchar ntpq_decodeaddrtype(sockaddr_u *sock)
34244971Sjkim{
35244971Sjkim	return decodeaddrtype(sock);
36244971Sjkim}
37244971Sjkim
38244971Sjkimint
39244971Sjkimntpq_doquerylist(
40244971Sjkim	struct ntpq_varlist *vlist,
41244971Sjkim	int op,
42244971Sjkim	associd_t associd,
43244971Sjkim	int auth,
44245582Sjkim	u_short *rstatus,
45245582Sjkim	int *dsize,
46245582Sjkim	const char **datap
47244971Sjkim	)
48244971Sjkim{
49244971Sjkim	return doquerylist((struct varlist *)vlist, op, associd, auth,
50244971Sjkim			   rstatus, dsize, datap);
51244971Sjkim}
52244971Sjkim
53244971Sjkim