home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xntp3.zip / ntpq / ntpq.h < prev    next >
C/C++ Source or Header  |  1992-07-07  |  1KB  |  83 lines

  1. /*
  2.  * ntpq.h - definitions of interest to ntpq
  3.  */
  4.  
  5. /*
  6.  * Maximum number of arguments
  7.  */
  8. #define    MAXARGS    4
  9.  
  10. /*
  11.  * xntpdc includes a command parser which could charitably be called
  12.  * crude.  The following structure is used to define the command
  13.  * syntax.
  14.  */
  15. struct xcmd {
  16.     char *keyword;        /* command key word */
  17.     void (*handler)();    /* command handler */
  18.     u_char arg[MAXARGS];    /* descriptors for arguments */
  19.     char *desc[MAXARGS];    /* descriptions for arguments */
  20.     char *comment;
  21. };
  22.  
  23.  
  24. /*
  25.  * Flags for forming descriptors.
  26.  */
  27. #define    OPT    0x80        /* this argument is optional, or'd with type */
  28.  
  29. #define    NO    0x0
  30. #define    STR    0x1        /* string argument */
  31. #define    UINT    0x2        /* unsigned integer */
  32. #define    INT    0x3        /* signed integer */
  33. #define    ADD    0x4        /* IP network address */
  34.  
  35. /*
  36.  * Arguments are returned in a union
  37.  */
  38. typedef union {
  39.     char *string;
  40.     long ival;
  41.     u_long uval;
  42.     u_long netnum;
  43. } arg_v;
  44.  
  45.  
  46. /*
  47.  * Structure for passing parsed command line
  48.  */
  49. struct parse {
  50.     char *keyword;
  51.     arg_v argval[MAXARGS];
  52.     int nargs;
  53. };
  54.  
  55.  
  56. /*
  57.  * Types of things we may deal with
  58.  */
  59. #define    TYPE_SYS    1
  60. #define    TYPE_PEER    2
  61. #define    TYPE_CLOCK    3
  62.  
  63.  
  64. /*
  65.  * Structure to hold association data
  66.  */
  67. struct association {
  68.     u_short assid;
  69.     u_short status;
  70. };
  71.  
  72. #define    MAXASSOC    1024
  73.  
  74. /*
  75.  * Structure for translation tables between text format
  76.  * variable indices and text format.
  77.  */
  78. struct ctl_var {
  79.     u_short code;
  80.     u_short fmt;
  81.     char *text;
  82. };
  83.