Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / ntp / ntpq / ntpq.h
blob909a1fb1c4b1577e7456e6c1a7724faa7f0b0f02
1 /* $NetBSD: ntpq.h,v 1.2 2003/12/04 16:23:38 drochner Exp $ */
3 /*
4 * ntpq.h - definitions of interest to ntpq
5 */
6 #include "ntp_fp.h"
7 #include "ntp.h"
8 #include "ntp_control.h"
9 #include "ntp_string.h"
10 #include "ntp_malloc.h"
13 * Maximum number of arguments
15 #define MAXARGS 4
18 * Flags for forming descriptors.
21 * Flags for forming descriptors.
23 #define OPT 0x80 /* this argument is optional, or'd with type */
25 #define NO 0x0
26 #define NTP_STR 0x1 /* string argument */
27 #define NTP_UINT 0x2 /* unsigned integer */
28 #define NTP_INT 0x3 /* signed integer */
29 #define NTP_ADD 0x4 /* IP network address */
30 #define IP_VERSION 0x5 /* IP version */
33 * Arguments are returned in a union
35 typedef union {
36 char *string;
37 long ival;
38 u_long uval;
39 struct sockaddr_storage netnum;
40 } arg_v;
43 * Structure for passing parsed command line
45 struct parse {
46 const char *keyword;
47 arg_v argval[MAXARGS];
48 int nargs;
52 * ntpdc includes a command parser which could charitably be called
53 * crude. The following structure is used to define the command
54 * syntax.
56 struct xcmd {
57 const char *keyword; /* command key word */
58 void (*handler) P((struct parse *, FILE *)); /* command handler */
59 u_char arg[MAXARGS]; /* descriptors for arguments */
60 const char *desc[MAXARGS]; /* descriptions for arguments */
61 const char *comment;
65 * Structure to hold association data
67 struct association {
68 u_short assid;
69 u_short status;
72 #define MAXASSOC 1024
75 * Structure for translation tables between text format
76 * variable indices and text format.
78 struct ctl_var {
79 u_short code;
80 u_short fmt;
81 const char *text;
84 extern void asciize P((int, char *, FILE *));
85 extern int getnetnum P((const char *, struct sockaddr_storage *, char *, int));
86 extern void sortassoc P((void));
87 extern int doquery P((int, int, int, int, char *, u_short *, int *, char **));
88 extern char * nntohost P((struct sockaddr_storage *));
89 extern int decodets P((char *, l_fp *));
90 extern int decodeuint P((char *, u_long *));
91 extern int nextvar P((int *, char **, char **, char **));
92 extern int decodetime P((char *, l_fp *));
93 extern void printvars P((int, char *, int, int, FILE *));
94 extern int decodeint P((char *, long *));
95 extern int findvar P((char *, struct ctl_var *, int code));