diff options
author | roberto <roberto@FreeBSD.org> | 1999-12-09 13:01:21 +0000 |
---|---|---|
committer | roberto <roberto@FreeBSD.org> | 1999-12-09 13:01:21 +0000 |
commit | 8eeba8afa3fed0281eff3ee16799b5be7506342e (patch) | |
tree | 7d75f32625357fba7e364033d35a8e1280477e7a /contrib/ntp/ntpdc/ntpdc.h | |
parent | 7fe95b26a2caf5b1c59fa606ad633557bdcf1f01 (diff) | |
parent | ef64b99e8412f2273dd2e8b3291c2f78ffc4667f (diff) | |
download | FreeBSD-src-8eeba8afa3fed0281eff3ee16799b5be7506342e.zip FreeBSD-src-8eeba8afa3fed0281eff3ee16799b5be7506342e.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r54359,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/ntp/ntpdc/ntpdc.h')
-rw-r--r-- | contrib/ntp/ntpdc/ntpdc.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/contrib/ntp/ntpdc/ntpdc.h b/contrib/ntp/ntpdc/ntpdc.h new file mode 100644 index 0000000..8b35d4f --- /dev/null +++ b/contrib/ntp/ntpdc/ntpdc.h @@ -0,0 +1,59 @@ +/* + * ntpdc.h - definitions of interest to ntpdc + */ +#include "ntp_fp.h" +#include "ntp.h" +#include "ntp_request.h" +#include "ntp_string.h" +#include "ntp_malloc.h" + +/* + * Maximum number of arguments + */ +#define MAXARGS 4 + +/* + * Flags for forming descriptors. + */ +#define OPT 0x80 /* this argument is optional, or'd with type */ + +#define NO 0x0 +#define NTP_STR 0x1 /* string argument */ +#define UINT 0x2 /* unsigned integer */ +#define INT 0x3 /* signed integer */ +#define ADD 0x4 /* IP network address */ + +/* + * Arguments are returned in a union + */ +typedef union { + char *string; + long ival; + u_long uval; + u_int32 netnum; +} arg_v; + +/* + * Structure for passing parsed command line + */ +struct parse { + char *keyword; + arg_v argval[MAXARGS]; + int nargs; +}; + +/* + * ntpdc includes a command parser which could charitably be called + * crude. The following structure is used to define the command + * syntax. + */ +struct xcmd { + const char *keyword; /* command key word */ + void (*handler) P((struct parse *, FILE *)); /* command handler */ + u_char arg[MAXARGS]; /* descriptors for arguments */ + const char *desc[MAXARGS]; /* descriptions for arguments */ + const char *comment; +}; + +extern int doquery P((int, int, int, int, int, char *, int *, int *, char **, int)); +extern char * nntohost P((u_int32)); |