Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / ntp / include / ntp_types.h
blob714746e245321c221a24db09104793e3c3695b8e
1 /* $NetBSD: ntp_types.h,v 1.2 2003/12/04 16:23:36 drochner Exp $ */
3 /*
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
6 * as int and u_int.
7 * For 32 bit systems, define them as long and u_long
8 */
9 #include <sys/types.h>
10 #include "ntp_machine.h"
12 #ifndef _NTP_TYPES_
13 #define _NTP_TYPES_
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
21 * just undefine that.
23 #ifdef mac
24 #undef mac
25 #endif
28 * Set up for prototyping
30 #ifndef P
31 #if defined(__STDC__) || defined(HAVE_PROTOTYPES)
32 #define P(x) x
33 #else /* not __STDC__ and not HAVE_PROTOTYPES */
34 #define P(x) ()
35 #endif /* not __STDC__ and HAVE_PROTOTYPES */
36 #endif /* P */
39 * VMS DECC (v4.1), {u_char,u_short,u_long} are only in SOCKET.H,
40 * and u_int isn't defined anywhere
42 #if defined(VMS)
43 #include <socket.h>
44 typedef unsigned int u_int;
46 * Note: VMS DECC has long == int (even on __alpha),
47 * so the distinction below doesn't matter
49 #endif /* VMS */
51 #if (SIZEOF_INT == 4)
52 # ifndef int32
53 # define int32 int
54 # endif
55 # ifndef u_int32
56 # define u_int32 unsigned int
57 # endif
58 #else /* not sizeof(int) == 4 */
59 # if (SIZEOF_LONG == 4)
60 # else /* not sizeof(long) == 4 */
61 # ifndef int32
62 # define int32 long
63 # endif
64 # ifndef u_int32
65 # define u_int32 unsigned long
66 # endif
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_ */