00001 /* 00002 * Copyright (c) 2002 - 2003 00003 * NetGroup, Politecnico di Torino (Italy) 00004 * All rights reserved. 00005 * 00006 * Redistribution and use in source and binary forms, with or without 00007 * modification, are permitted provided that the following conditions 00008 * are met: 00009 * 00010 * 1. Redistributions of source code must retain the above copyright 00011 * notice, this list of conditions and the following disclaimer. 00012 * 2. Redistributions in binary form must reproduce the above copyright 00013 * notice, this list of conditions and the following disclaimer in the 00014 * documentation and/or other materials provided with the distribution. 00015 * 3. Neither the name of the Politecnico di Torino nor the names of its 00016 * contributors may be used to endorse or promote products derived from 00017 * this software without specific prior written permission. 00018 * 00019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00020 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00021 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00022 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00023 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00024 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00025 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00026 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00027 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00028 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00029 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00030 * 00031 */ 00032 00033 #define SIZEOF_CHAR 1 00034 #define SIZEOF_SHORT 2 00035 #define SIZEOF_INT 4 00036 #ifndef _MSC_EXTENSIONS 00037 #define SIZEOF_LONG_LONG 8 00038 #endif 00039 00040 00041 /* 00042 * Avoids a compiler warning in case this was already defined 00043 * (someone defined _WINSOCKAPI_ when including 'windows.h', in order 00044 * to prevent it from including 'winsock.h') 00045 */ 00046 #ifdef _WINSOCKAPI_ 00047 #undef _WINSOCKAPI_ 00048 #endif 00049 #include <winsock2.h> 00050 00051 #include <fcntl.h> 00052 00053 #include "bittypes.h" 00054 #include <time.h> 00055 #include <io.h> 00056 00057 #ifndef __MINGW32__ 00058 #include "IP6_misc.h" 00059 #endif 00060 00061 #define caddr_t char* 00062 00063 #define snprintf _snprintf 00064 #define vsnprintf _vsnprintf 00065 #define inline __inline