|
Packit |
03b34a |
/*
|
|
Packit |
03b34a |
* $Id: libnet.h.in,v 1.5 2004/01/17 07:51:19 mike Exp $
|
|
Packit |
03b34a |
*
|
|
Packit |
03b34a |
* libnet.h - Network routine library header file
|
|
Packit |
03b34a |
*
|
|
Packit |
03b34a |
* Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
|
|
Packit |
03b34a |
* All rights reserved.
|
|
Packit |
03b34a |
*
|
|
Packit |
03b34a |
* Redistribution and use in source and binary forms, with or without
|
|
Packit |
03b34a |
* modification, are permitted provided that the following conditions
|
|
Packit |
03b34a |
* are met:
|
|
Packit |
03b34a |
* 1. Redistributions of source code must retain the above copyright
|
|
Packit |
03b34a |
* notice, this list of conditions and the following disclaimer.
|
|
Packit |
03b34a |
* 2. Redistributions in binary form must reproduce the above copyright
|
|
Packit |
03b34a |
* notice, this list of conditions and the following disclaimer in the
|
|
Packit |
03b34a |
* documentation and/or other materials provided with the distribution.
|
|
Packit |
03b34a |
*
|
|
Packit |
03b34a |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
Packit |
03b34a |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
Packit |
03b34a |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
Packit |
03b34a |
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
Packit |
03b34a |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
Packit |
03b34a |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
Packit |
03b34a |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
Packit |
03b34a |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
Packit |
03b34a |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
Packit |
03b34a |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
Packit |
03b34a |
* SUCH DAMAGE.
|
|
Packit |
03b34a |
*
|
|
Packit |
03b34a |
*/
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
#ifndef __LIBNET_H
|
|
Packit |
03b34a |
#define __LIBNET_H
|
|
Packit |
03b34a |
/**
|
|
Packit |
03b34a |
* @file libnet.h
|
|
Packit |
03b34a |
* @brief toplevel libnet header file
|
|
Packit |
03b34a |
*/
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
/**
|
|
Packit |
03b34a |
* @mainpage Libnet Packet Assembly Library
|
|
Packit |
03b34a |
*
|
|
Packit |
03b34a |
* @section intro Overview
|
|
Packit |
03b34a |
*
|
|
Packit |
03b34a |
* Libnet is a high-level API (toolkit) allowing the application programmer to
|
|
Packit |
03b34a |
* construct and inject network packets. It provides a portable and simplified
|
|
Packit |
03b34a |
* interface for low-level network packet shaping, handling and injection.
|
|
Packit |
03b34a |
* Libnet hides much of the tedium of packet creation from the application
|
|
Packit |
03b34a |
* programmer such as multiplexing, buffer management, arcane packet header
|
|
Packit |
03b34a |
* information, byte-ordering, OS-dependent issues, and much more. Libnet
|
|
Packit |
03b34a |
* features portable packet creation interfaces at the IP layer and link layer,
|
|
Packit |
03b34a |
* as well as a host of supplementary and complementary functionality. Using
|
|
Packit |
03b34a |
* libnet, quick and simple packet assembly applications can be whipped up with
|
|
Packit |
03b34a |
* little effort. With a bit more time, more complex programs can be written
|
|
Packit |
03b34a |
* (Traceroute and ping were easily rewritten using libnet and
|
|
Packit |
03b34a |
* libpcap).
|
|
Packit |
03b34a |
*/
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
#ifdef __cplusplus
|
|
Packit |
03b34a |
extern "C" {
|
|
Packit |
03b34a |
#endif
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
#include <stdio.h>
|
|
Packit |
03b34a |
#include <string.h>
|
|
Packit |
03b34a |
#include <unistd.h>
|
|
Packit |
03b34a |
#include <fcntl.h>
|
|
Packit |
03b34a |
#include <signal.h>
|
|
Packit |
03b34a |
#include <stdlib.h>
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
#if !defined(__WIN32__)
|
|
Packit |
03b34a |
# include <sys/ioctl.h>
|
|
Packit |
03b34a |
#endif /* __WIN32__ */
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
#if defined(HAVE_SYS_SOCKIO_H) && !defined(SIOCGIFADDR)
|
|
Packit |
03b34a |
# include <sys/sockio.h>
|
|
Packit |
03b34a |
#endif
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
#include <sys/stat.h>
|
|
Packit |
03b34a |
#include <sys/types.h>
|
|
Packit |
03b34a |
#include <ctype.h>
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
#if !defined(__WIN32__)
|
|
Packit |
03b34a |
# include <sys/socket.h>
|
|
Packit |
03b34a |
# include <net/if.h>
|
|
Packit |
03b34a |
#else /* __WIN32__ */
|
|
Packit |
03b34a |
# if (__CYGWIN__)
|
|
Packit |
03b34a |
# include <sys/socket.h>
|
|
Packit |
03b34a |
# endif
|
|
Packit |
03b34a |
# include <ws2tcpip.h>
|
|
Packit |
03b34a |
# include <windows.h>
|
|
Packit |
03b34a |
# include <winsock2.h>
|
|
Packit |
03b34a |
# include <win32/in_systm.h>
|
|
Packit |
03b34a |
#endif /* __WIN32__ */
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
#if !(__linux__) && !(__WIN32__) && !(__APPLE__) && !(__CYGWIN__) && !(__GNU__)
|
|
Packit |
03b34a |
#else /* __linux__ */
|
|
Packit |
03b34a |
# if (HAVE_NET_ETHERNET_H)
|
|
Packit |
03b34a |
# include <net/ethernet.h>
|
|
Packit |
03b34a |
# endif /* HAVE_NET_ETHERNET_H */
|
|
Packit |
03b34a |
#endif /* __linux__ */
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
#if !defined(__WIN32__)
|
|
Packit |
03b34a |
# include <arpa/inet.h>
|
|
Packit |
03b34a |
# include <sys/time.h>
|
|
Packit |
03b34a |
# include <netdb.h>
|
|
Packit |
03b34a |
#endif /* __WIN32__ */
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
#include <errno.h>
|
|
Packit |
03b34a |
#include <stdarg.h>
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
#define LIBNET_VERSION "@PACKAGE_VERSION@"
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
#define @ENDIANESS@ 1
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
#include "./libnet/libnet-types.h"
|
|
Packit |
03b34a |
#include "./libnet/libnet-macros.h"
|
|
Packit |
03b34a |
#include "./libnet/libnet-headers.h"
|
|
Packit |
03b34a |
#include "./libnet/libnet-structures.h"
|
|
Packit |
03b34a |
#include "./libnet/libnet-asn1.h"
|
|
Packit |
03b34a |
#include "./libnet/libnet-functions.h"
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
#ifdef __cplusplus
|
|
Packit |
03b34a |
}
|
|
Packit |
03b34a |
#endif
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
#endif /* __LIBNET_H */
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
/* EOF */
|