1/*===========================================================================*
2 * @(#) $Name: arts++-1-1-a13 $ $Id: caida_t.h.in,v 1.1.1.1 2002/11/16 00:46:41 rkoga Exp $
3 *===========================================================================*
4 *  This header file is basically the equivalent of the fixed-width types in
5 *  <inttypes.h> in the new ISO C working draft (Working Draft 1997-11-21,
6 *  WG14/N794 J11/97-158), but for today's compilers (February 1998) and
7 *  generated by autoconf so I can ship it around to various platforms.
8 *  I've also added ipv4addr_t here, since CAIDA frequently needs to deal
9 *  with IPv4 addresses.  It's worth noting that an ipv4addr_t value should
10 *  always be in network byte order, regardless of a platform's endianness,
11 *  which makes it distinct from an uint32_t.
12 *
13 *  Daniel McRobb <dwm@caida.org>
14 *===========================================================================*/
15
16/*===========================================================================*
17 *  Copyright Notice
18 *
19 *  By accessing this software, arts++, you are duly informed
20 *  of and agree to be bound by the conditions described below in this
21 *  notice:
22 *
23 *  This software product, arts++, is developed by Daniel W. McRobb, and
24 *  copyrighted(C) 1998 by the University of California, San Diego
25 *  (UCSD), with all rights reserved.  UCSD administers the CAIDA grant,
26 *  NCR-9711092, under which part of this code was developed.
27 *
28 *  There is no charge for arts++ software.  You can redistribute it
29 *  and/or modify it under the terms of the GNU Lesser General Public
30 *  License, Version 2.1, February 1999, which is incorporated by
31 *  reference herein.
32 *
33 *  arts++ is distributed WITHOUT ANY WARRANTY, IMPLIED OR EXPRESS, OF
34 *  MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE or that the use
35 *  of it will not infringe on any third party's intellectual
36 *  property rights.
37 *
38 *  You should have received a copy of the GNU Lesser General Public
39 *  License along with arts++.  Copies can also be obtained from:
40 *
41 *    http://www.gnu.org/copyleft/lesser.html
42 *
43 *  or by writing to:
44 *
45 *  Free Software Foundation, Inc.
46 *  59 Temple Place, Suite 330
47 *  Boston, MA 02111-1307
48 *  USA
49 *
50 *  Or contact:
51 *
52 *    info@caida.org
53 *===========================================================================*/
54
55#ifndef _CAIDA_T_H_
56#define _CAIDA_T_H_
57
58#include <sys/types.h>
59
60#undef HAVE_SYS_FILIO_H
61
62#define HAVE_MACHINE_TYPES_H  0
63#define HAVE_INTTYPES_H       0
64
65#define HAVE_INT8_T    0
66#define HAVE_INT16_T   0
67#define HAVE_INT32_T   0
68#define HAVE_INT64_T   0
69#define HAVE_UINT8_T   0
70#define HAVE_UINT16_T  0
71#define HAVE_UINT32_T  0
72#define HAVE_UINT64_T  0
73
74#if (HAVE_INTTYPES_H == 1)
75  #include <inttypes.h>
76#endif
77
78#if (HAVE_MACHINE_TYPES_H == 1)
79  #include <machine/types.h>
80#endif
81
82#define SIZEOF_UNSIGNED_SHORT       0
83#define SIZEOF_UNSIGNED_INT         0
84#define SIZEOF_UNSIGNED_LONG        0
85#define SIZEOF_UNSIGNED_LONG_LONG   0
86
87#define SIZEOF_SHORT           0
88#define SIZEOF_INT             0
89#define SIZEOF_LONG            0
90#define SIZEOF_LONG_LONG       0
91
92#if (HAVE_UINT8_T == 0)
93  typedef unsigned char   uint8_t;
94#endif
95
96#if (HAVE_INT8_T == 0)
97  typedef char            int8_t;
98#endif
99
100#if (HAVE_UINT16_T == 0)
101  #if (SIZEOF_UNSIGNED_SHORT == 2)
102    typedef unsigned short  uint16_t;
103  #endif
104#endif
105
106#if (HAVE_INT16_T == 0)
107  #if (SIZEOF_SHORT == 2)
108    typedef short           int16_t;
109  #endif
110#endif
111
112#if (HAVE_UINT32_T == 0)
113  #if (SIZEOF_UNSIGNED_INT == 4)
114    typedef unsigned int    uint32_t;
115  #elif (SIZEOF_UNSIGNED_LONG == 4)
116    typedef unsigned long   uint32_t;
117  #endif
118#endif
119
120typedef uint32_t  ipv4addr_t;
121
122#if (HAVE_INT32_T == 0)
123  #if (SIZEOF_INT == 4)
124    typedef int             int32_t;
125  #elif (SIZEOF_LONG == 4)
126    typedef long            int32_t;
127  #endif
128#endif
129
130#if (HAVE_UINT64_T == 0)
131  #if (SIZEOF_UNSIGNED_LONG_LONG == 8)
132    typedef unsigned long long  uint64_t;
133  #endif
134#endif
135
136#if (HAVE_INT64_T == 0)
137  #if (SIZEOF_LONG_LONG == 8)
138    typedef long long       int64_t;
139  #endif
140#endif
141
142#endif  /* _CAIDA_T_H_  */
143