freebsd-skq/ntpq/libntpq_subs.c
cy 047f369a62 Vendor import ntp 4.2.8.
Reviewed by:	roberto
Security:	VUXML: 4033d826-87dd-11e4-9079-3c970e169bc2
Security:	http://www.kb.cert.org/vuls/id/852879
Security:	CVE-2014-9293
Security	CVE-2014-9294
Security	CVE-2014-9295
Security	CVE-2014-9296
2014-12-20 22:52:39 +00:00

53 lines
1.2 KiB
C

/*****************************************************************************
*
* 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);
}