libnet: libnet.h Source File

Main Page | Data Structures | File List | Data Fields | Globals

# libnet.h

Go to the documentation of this file.

    00001 /*
    00002  *  $Id: libnet.h,v 1.7 2004/01/03 20:31:00 mike Exp $
    00003  *
    00004  *  libnet.h - Network routine library header file for Win32 VC++
    00005  *
    00006  *  Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
    00007  *  All rights reserved.
    00008  *
    00009  * Redistribution and use in source and binary forms, with or without
    00010  * modification, are permitted provided that the following conditions
    00011  * are met:
    00012  * 1. Redistributions of source code must retain the above copyright
    00013  *    notice, this list of conditions and the following disclaimer.
    00014  * 2. Redistributions in binary form must reproduce the above copyright
    00015  *    notice, this list of conditions and the following disclaimer in the
    00016  *    documentation and/or other materials provided with the distribution.
    00017  *
    00018  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
    00019  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    00020  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    00021  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
    00022  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    00023  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    00024  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    00025  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    00026  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    00027  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    00028  * SUCH DAMAGE.
    00029  *
    00030  */
    00031
    00032 #ifdef _WIN32
    00033
    00034 #ifndef __LIBNET_H
    00035 #define __LIBNET_H
    00036
    00037 #include <winsock2.h>
    00038 #include <windows.h>
    00039 #include <time.h>
    00040 #include "in_systm.h"
    00041 #include "pcap.h"
    00042
    00043
    00044 #ifdef __cplusplus
    00045 extern "C" {
    00046 #endif
    00047
    00048 /* __WIN32__ is NOT a predefined MACRO, use _WIN32
    00049  * __CYGWIN__ is defined within the cygwin environment.
    00050  */
    00051 #ifndef __WIN32__
    00052 #define __WIN32__ _WIN32
    00053 #endif
    00054
    00055 #define LIBNET_LIL_ENDIAN 1
    00056 #define HAVE_CONFIG_H 1
    00057
    00058 /* Some UNIX to Win32 conversions */
    00059 #define STDOUT_FILENO stdout
    00060 #define snprintf _snprintf
    00061 #define write _write
    00062 #define open _open
    00063 #define random rand
    00064 #define close closesocket
    00065 #define __func__ __FUNCTION__
    00066
    00067 /* __FUNCTION__ available in VC ++ 7.0 (.NET) and greater */
    00068 #if _MSC_VER < 1300
    00069 #define __FUNCTION__ __FILE__
    00070 #endif
    00071
    00072 #pragma comment (lib,"ws2_32")    /* Winsock 2 */
    00073 #pragma comment (lib,"iphlpapi")  /* IP Helper */
    00074 #pragma comment (lib,"wpcap")     /* Winpcap   */
    00075 #pragma comment (lib,"packet")
    00076
    00077 /* "@LIBNET_VERSION@" will not work in VC++, so version.h doesn't get populated */
    00078 #define VERSION  "1.1.1"
    00079
    00080 /* To use Win32 native versions */
    00081 #define WPCAP 1
    00082 #define _GNU_SOURCE
    00083 #include <stdio.h>
    00084 #include <string.h>
    00085 #include <fcntl.h>
    00086 #include <signal.h>
    00087 #include <stdlib.h>
    00088 #include <sys/stat.h>
    00089 #include <sys/types.h>
    00090 #include <ctype.h>
    00091 #include <errno.h>
    00092 #include <stdarg.h>
    00093 #include "../libnet/libnet-macros.h"
    00094 #include "../libnet/libnet-headers.h"
    00095 #include "../libnet/libnet-structures.h"
    00096 #include "../libnet/libnet-asn1.h"
    00097 #include "../libnet/libnet-functions.h"
    00098
    00099 #ifdef __cplusplus
    00100 }
    00101 #endif
    00102
    00103 #endif  /* __LIBNET_H */
    00104
    00105 #endif
    00106 /* EOF */