1/***************************************************************************** 2 * 3 * libntpq_subs.c 4 * 5 * This is the second part of the wrapper library for ntpq, the NTP query utility. 6 * This library reuses the sourcecode from ntpq and exports a number 7 * of useful functions in a library that can be linked against applications 8 * that need to query the status of a running ntpd. The whole 9 * communcation is based on mode 6 packets. 10 * 11 * This source file exports the (private) functions from ntpq-subs.c 12 * 13 ****************************************************************************/ 14 15 16#define _LIBNTPQSUBSC 17#include "ntpq-subs.c" 18#include "libntpq.h" 19 20/* Function Prototypes */ 21int ntpq_dogetassoc(void); 22char ntpq_decodeaddrtype(sockaddr_u *sock); 23int ntpq_doquerylist(struct varlist *, int , int , int , u_short *, int *, char **datap ); 24 25 26/* the following functions are required internally by a number of libntpq functions 27 * and since they are defined as static in ntpq-subs.c, they need to be exported here 28 */ 29 30int ntpq_dogetassoc(void) 31{ 32 33 if ( dogetassoc(NULL)) 34 { 35 return numassoc; 36 } else { 37 return 0; 38 } 39} 40 41char ntpq_decodeaddrtype(sockaddr_u *sock) 42{ 43 return decodeaddrtype(sock); 44} 45 46int ntpq_doquerylist(struct varlist *vlist, int op, int associd, int auth, u_short *rstatus, int *dsize, char **datap ) 47{ 48 return doquerylist(vlist, op, associd, auth, rstatus, dsize, &*datap ); 49} 50 51