2 * ntp_types.h - defines how int32 and u_int32 are treated.
3 * For 64 bit systems like the DEC Alpha, they have to be defined
5 * For 32 bit systems, define them as long and u_long
8 #include "ntp_machine.h"
14 * This is another naming conflict.
15 * On NetBSD for MAC the macro "mac" is defined as 1
16 * this is fun for us as a packet structure contains an
17 * optional "mac" member - severe confusion results 8-)
18 * As we hopefully do not have to rely on that macro we
26 * Set up for prototyping
29 #if defined(__STDC__) || defined(HAVE_PROTOTYPES)
31 #else /* not __STDC__ and not HAVE_PROTOTYPES */
33 #endif /* not __STDC__ and HAVE_PROTOTYPES */
37 * VMS DECC (v4.1), {u_char,u_short,u_long} are only in SOCKET.H,
38 * and u_int isn't defined anywhere
42 typedef unsigned int u_int;
44 * Note: VMS DECC has long == int (even on __alpha),
45 * so the distinction below doesn't matter
54 # define u_int32 unsigned int
56 #else /* not sizeof(int) == 4 */
57 # if (SIZEOF_LONG == 4)
58 # else /* not sizeof(long) == 4 */
63 # define u_int32 unsigned long
65 # endif /* not sizeof(long) == 4 */
66 # include "Bletch: what's 32 bits on this machine?"
67 #endif /* not sizeof(int) == 4 */
69 typedef u_char ntp_u_int8_t;
70 typedef u_short ntp_u_int16_t;
71 typedef u_int32 ntp_u_int32_t;
73 typedef struct ntp_uint64_t { u_int32 val[2]; } ntp_uint64_t;
75 typedef unsigned short associd_t; /* association ID */
76 typedef u_int32 keyid_t; /* cryptographic key ID */
77 typedef u_int32 tstamp_t; /* NTP seconds timestamp */
79 #endif /* _NTP_TYPES_ */