version 1.1.1.2, 2013/07/22 11:54:42
|
version 1.1.1.4, 2023/09/27 11:11:38
|
Line 1
|
Line 1
|
/* |
/* |
* $Id$ | * libnet |
* | |
* libnet.h - Network routine library header file |
* libnet.h - Network routine library header file |
|
* @configure_input@ |
* |
* |
* Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com> |
* Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com> |
* All rights reserved. |
* All rights reserved. |
Line 31
|
Line 31
|
|
|
#ifndef __LIBNET_H |
#ifndef __LIBNET_H |
#define __LIBNET_H |
#define __LIBNET_H |
|
|
/** |
/** |
* @file libnet.h |
* @file libnet.h |
* @brief toplevel libnet header file | * @brief Top-level libnet header file |
| * |
| * @details This section doesn't contain any details about libnet.h. |
| * |
| * For details, see libnet-functions.h and libnet-macros.h |
*/ |
*/ |
|
|
/** |
|
* @mainpage Libnet Packet Assembly Library |
|
* |
|
* @section intro Overview |
|
* |
|
* Libnet is a high-level API (toolkit) allowing the application programmer to |
|
* construct and inject network packets. It provides a portable and simplified |
|
* interface for low-level network packet shaping, handling and injection. |
|
* Libnet hides much of the tedium of packet creation from the application |
|
* programmer such as multiplexing, buffer management, arcane packet header |
|
* information, byte-ordering, OS-dependent issues, and much more. Libnet |
|
* features portable packet creation interfaces at the IP layer and link layer, |
|
* as well as a host of supplementary and complementary functionality. Using |
|
* libnet, quick and simple packet assembly applications can be whipped up with |
|
* little effort. With a bit more time, more complex programs can be written |
|
* (Traceroute and ping were easily rewritten using libnet and |
|
* <a href="www.tcpdump.org">libpcap</a>). |
|
*/ |
|
|
|
#ifdef __cplusplus |
#ifdef __cplusplus |
extern "C" { |
extern "C" { |
#endif |
#endif |
|
|
|
/* |
|
* TODO move the stuff we ALWAYS need out of the DOXYGEN ifndef block |
|
* and minimize their redundancies (see doc/TODO) |
|
*/ |
|
#ifndef DOXYGEN_SHOULD_SKIP_THIS // mess |
#include <stdio.h> |
#include <stdio.h> |
#include <string.h> |
#include <string.h> |
#include <unistd.h> |
|
#include <fcntl.h> |
#include <fcntl.h> |
#include <signal.h> |
#include <signal.h> |
#include <stdlib.h> |
#include <stdlib.h> |
|
|
#if !defined(__WIN32__) |
|
# include <sys/ioctl.h> |
|
#endif /* __WIN32__ */ |
|
|
|
#if defined(HAVE_SYS_SOCKIO_H) && !defined(SIOCGIFADDR) |
|
# include <sys/sockio.h> |
|
#endif |
|
|
|
#include <sys/stat.h> |
#include <sys/stat.h> |
#include <sys/types.h> |
#include <sys/types.h> |
#include <ctype.h> |
#include <ctype.h> |
|
|
#if !defined(__WIN32__) | #include <errno.h> |
# include <sys/socket.h> | #include <stdarg.h> |
# include <net/if.h> | |
#else /* __WIN32__ */ | |
# if (__CYGWIN__) | |
# include <sys/socket.h> | |
# endif | |
# include <ws2tcpip.h> | |
# include <windows.h> | |
# include <winsock2.h> | |
# include <win32/in_systm.h> | |
#endif /* __WIN32__ */ | |
|
|
#if !(__linux__) && !(__WIN32__) && !(__APPLE__) && !(__CYGWIN__) && !(__GNU__) | #if !defined(_MSC_VER) |
#else /* __linux__ */ | #include <unistd.h> |
# if (HAVE_NET_ETHERNET_H) | #endif |
# include <net/ethernet.h> | |
# endif /* HAVE_NET_ETHERNET_H */ | |
#endif /* __linux__ */ | |
|
|
|
#if defined(HAVE_SYS_SOCKIO_H) && !defined(SIOCGIFADDR) |
|
#include <sys/sockio.h> |
|
#endif |
|
|
#if !defined(__WIN32__) |
#if !defined(__WIN32__) |
# include <arpa/inet.h> | #include <sys/ioctl.h> |
# include <sys/time.h> | #include <sys/socket.h> |
# include <netdb.h> | #include <net/if.h> |
| #if defined (__FreeBSD__) || defined (__DragonFly__) |
| #include <netinet/in.h> |
| #endif |
| #include <arpa/inet.h> |
| #include <sys/time.h> |
| #include <netdb.h> |
| #else /* __WIN32__ */ |
| #if (__CYGWIN__) |
| #include <sys/socket.h> |
| #endif |
| #include <stdint.h> |
| #include <ws2tcpip.h> |
| #include <windows.h> |
| #include <winsock2.h> |
#endif /* __WIN32__ */ |
#endif /* __WIN32__ */ |
|
|
#include <errno.h> | #if (HAVE_NET_ETHERNET_H) |
#include <stdarg.h> | #include <net/ethernet.h> |
| #endif /* HAVE_NET_ETHERNET_H */ |
|
|
#define LIBNET_VERSION "@PACKAGE_VERSION@" |
#define LIBNET_VERSION "@PACKAGE_VERSION@" |
|
|
#define @ENDIANESS@ 1 |
#define @ENDIANESS@ 1 |
|
|
|
#ifndef LIBNET_API |
|
#define LIBNET_API |
|
#endif |
|
#endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
|
|
#include "./libnet/libnet-types.h" |
#include "./libnet/libnet-types.h" |
#include "./libnet/libnet-macros.h" |
#include "./libnet/libnet-macros.h" |
#include "./libnet/libnet-headers.h" |
#include "./libnet/libnet-headers.h" |
Line 124 extern "C" {
|
Line 117 extern "C" {
|
|
|
#endif /* __LIBNET_H */ |
#endif /* __LIBNET_H */ |
|
|
/* EOF */ |
|