Annotation of embedaddon/libnet/include/win32/libnet.h, revision 1.1.1.1

1.1       misho       1: /*
                      2:  *  $Id: libnet.h,v 1.7 2004/01/03 20:31:00 mike Exp $
                      3:  *
                      4:  *  libnet.h - Network routine library header file for Win32 VC++
                      5:  *
                      6:  *  Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
                      7:  *  All rights reserved.
                      8:  *
                      9:  * Redistribution and use in source and binary forms, with or without
                     10:  * modification, are permitted provided that the following conditions
                     11:  * are met:
                     12:  * 1. Redistributions of source code must retain the above copyright
                     13:  *    notice, this list of conditions and the following disclaimer.
                     14:  * 2. Redistributions in binary form must reproduce the above copyright
                     15:  *    notice, this list of conditions and the following disclaimer in the
                     16:  *    documentation and/or other materials provided with the distribution.
                     17:  *
                     18:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
                     19:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     20:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     21:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
                     22:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     23:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     24:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     25:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     26:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     27:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     28:  * SUCH DAMAGE.
                     29:  *
                     30:  */
                     31: 
                     32: #ifdef _WIN32
                     33: 
                     34: #ifndef __LIBNET_H
                     35: #define __LIBNET_H
                     36: 
                     37: #include <winsock2.h>
                     38: #include <windows.h>
                     39: #include <time.h>
                     40: #include "in_systm.h"
                     41: #include "pcap.h"
                     42: 
                     43: 
                     44: #ifdef __cplusplus
                     45: extern "C" {
                     46: #endif
                     47: 
                     48: /* __WIN32__ is NOT a predefined MACRO, use _WIN32
                     49:  * __CYGWIN__ is defined within the cygwin environment.
                     50:  */ 
                     51: #ifndef __WIN32__
                     52: #define __WIN32__ _WIN32
                     53: #endif
                     54: 
                     55: #define LIBNET_LIL_ENDIAN 1
                     56: #define HAVE_CONFIG_H 1
                     57: 
                     58: /* Some UNIX to Win32 conversions */
                     59: #define STDOUT_FILENO stdout
                     60: #define snprintf _snprintf 
                     61: #define write _write
                     62: #define open _open
                     63: #define random rand
                     64: #define close closesocket
                     65: #define __func__ __FUNCTION__
                     66: 
                     67: /* __FUNCTION__ available in VC ++ 7.0 (.NET) and greater */
                     68: #if _MSC_VER < 1300
                     69: #define __FUNCTION__ __FILE__
                     70: #endif
                     71: 
                     72: #pragma comment (lib,"ws2_32")    /* Winsock 2 */
                     73: #pragma comment (lib,"iphlpapi")  /* IP Helper */
                     74: #pragma comment (lib,"wpcap")     /* Winpcap   */
                     75: #pragma comment (lib,"packet")   
                     76: 
                     77: /* "@LIBNET_VERSION@" will not work in VC++, so version.h doesn't get populated */
                     78: #define VERSION  "1.1.1"
                     79: 
                     80: /* To use Win32 native versions */
                     81: #define WPCAP 1
                     82: #define _GNU_SOURCE
                     83: #include <stdio.h>
                     84: #include <string.h>
                     85: #include <fcntl.h>
                     86: #include <signal.h>
                     87: #include <stdlib.h>
                     88: #include <sys/stat.h>
                     89: #include <sys/types.h>
                     90: #include <ctype.h>
                     91: #include <errno.h>
                     92: #include <stdarg.h>
                     93: #include "../libnet/libnet-macros.h"
                     94: #include "../libnet/libnet-headers.h"
                     95: #include "../libnet/libnet-structures.h"
                     96: #include "../libnet/libnet-asn1.h"
                     97: #include "../libnet/libnet-functions.h"
                     98: 
                     99: #ifdef __cplusplus
                    100: }
                    101: #endif
                    102: 
                    103: #endif  /* __LIBNET_H */
                    104: 
                    105: #endif
                    106: /* EOF */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>