home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / daytime.zip / daytime.h < prev    next >
C/C++ Source or Header  |  1999-02-27  |  1KB  |  72 lines

  1. /* daytime.h
  2.  *
  3.  * Author:   <rommel@ars.de>
  4.  * Created: Sun May 04 1997
  5.  *
  6.  * This code is in the public domain.
  7.  * Let the author know if you make improvements or fixes, though.
  8.  */
  9.  
  10. /* $Id: daytime.h,v 1.4 1999/02/27 14:16:23 rommel Exp rommel $ */
  11.  
  12. /*
  13.  * $Log: daytime.h,v $
  14.  * Revision 1.4  1999/02/27 14:16:23  rommel
  15.  * renamed type
  16.  *
  17.  * Revision 1.3  1998/10/01 10:04:37  rommel
  18.  * fixes from colinw@ami.com.au
  19.  *
  20.  * Revision 1.2  1998/07/30 06:46:09  rommel
  21.  * added Win32 port
  22.  * added SNTP support
  23.  * fixed many bugs
  24.  * prepared for modem support
  25.  *
  26.  * Revision 1.1  1997/05/04 19:59:52  rommel
  27.  * Initial revision
  28.  *
  29.  */
  30.  
  31. #ifndef _DAYTIME_H
  32. #define _DAYTIME_H
  33.  
  34. typedef enum {TIME = 0, DAYTIME = 1, SNTP = 2} service;
  35. typedef enum {UDP = 0, TCP = 1, MODEM = 3} protocol;
  36.  
  37. typedef struct
  38. {
  39.   int mode     : 3;
  40.   int version  : 3;
  41.   int leap_ind : 2;
  42. }
  43. flagbits;
  44.  
  45. typedef struct
  46. {
  47.   long integer;
  48.   long fraction;
  49. }
  50. tstamp;
  51.  
  52. typedef struct
  53. {
  54.   flagbits flags;
  55.   char stratum;
  56.   char poll;
  57.   char precision;
  58.   long root_delay;
  59.   long root_dispersion;
  60.   long reference_id;
  61.   tstamp reference_time;
  62.   tstamp originate_time;
  63.   tstamp receive_time;
  64.   tstamp transmit_time;
  65.   /* long authenticator[3]; */
  66. }
  67. sntp;
  68.  
  69. #endif /* _DAYTIME_H */
  70.  
  71. /* end of daytime.h */
  72.