1 /* $NetBSD: ntp_types.h,v 1.2 2003/12/04 16:23:36 drochner Exp $ */
4 * ntp_types.h - defines how int32 and u_int32 are treated.
5 * For 64 bit systems like the DEC Alpha, they have to be defined
7 * For 32 bit systems, define them as long and u_long
10 #include "ntp_machine.h"
16 * This is another naming conflict.
17 * On NetBSD for MAC the macro "mac" is defined as 1
18 * this is fun for us as a packet structure contains an
19 * optional "mac" member - severe confusion results 8-)
20 * As we hopefully do not have to rely on that macro we
28 * Set up for prototyping
31 #if defined(__STDC__) || defined(HAVE_PROTOTYPES)
33 #else /* not __STDC__ and not HAVE_PROTOTYPES */
35 #endif /* not __STDC__ and HAVE_PROTOTYPES */
39 * VMS DECC (v4.1), {u_char,u_short,u_long} are only in SOCKET.H,
40 * and u_int isn't defined anywhere
44 typedef unsigned int u_int
;
46 * Note: VMS DECC has long == int (even on __alpha),
47 * so the distinction below doesn't matter
56 # define u_int32 unsigned int
58 #else /* not sizeof(int) == 4 */
59 # if (SIZEOF_LONG == 4)
60 # else /* not sizeof(long) == 4 */
65 # define u_int32 unsigned long
67 # endif /* not sizeof(long) == 4 */
68 # include "Bletch: what's 32 bits on this machine?"
69 #endif /* not sizeof(int) == 4 */
71 typedef u_char ntp_u_int8_t
;
72 typedef u_short ntp_u_int16_t
;
73 typedef u_int32 ntp_u_int32_t
;
75 typedef struct ntp_uint64_t
{ u_int32 val
[2]; } ntp_uint64_t
;
77 typedef unsigned short associd_t
; /* association ID */
78 typedef u_int32 keyid_t
; /* cryptographic key ID */
79 typedef u_int32 tstamp_t
; /* NTP seconds timestamp */
81 #endif /* _NTP_TYPES_ */