version 1.1.1.1, 2012/02/21 22:14:23
|
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 |
|
|
#define _GNU_SOURCE | /* |
| * 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> |
|
|
|
#include <errno.h> |
|
#include <stdarg.h> |
|
|
|
#if !defined(_MSC_VER) |
|
#include <unistd.h> |
|
#endif |
|
|
|
#if defined(HAVE_SYS_SOCKIO_H) && !defined(SIOCGIFADDR) |
|
#include <sys/sockio.h> |
|
#endif |
|
|
#if !defined(__WIN32__) |
#if !defined(__WIN32__) |
|
#include <sys/ioctl.h> |
#include <sys/socket.h> |
#include <sys/socket.h> |
#include <netinet/in.h> |
|
#include <netinet/in_systm.h> |
|
#include <netinet/ip.h> |
|
#include <net/if.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__ */ |
#else /* __WIN32__ */ |
#if (__CYGWIN__) |
#if (__CYGWIN__) |
#include <sys/socket.h> |
#include <sys/socket.h> |
#endif |
#endif |
|
#include <stdint.h> |
#include <ws2tcpip.h> |
#include <ws2tcpip.h> |
#include <windows.h> |
#include <windows.h> |
#include <winsock2.h> |
#include <winsock2.h> |
#include <win32/in_systm.h> |
|
#endif /* __WIN32__ */ |
#endif /* __WIN32__ */ |
#if !(__linux__) && !(__WIN32__) && !(__APPLE__) && !(__CYGWIN__) | |
#include <netinet/ip_var.h> | |
#else /* __linux__ */ | |
#if (HAVE_NET_ETHERNET_H) |
#if (HAVE_NET_ETHERNET_H) |
#include <net/ethernet.h> |
#include <net/ethernet.h> |
#endif /* HAVE_NET_ETHERNET_H */ |
#endif /* HAVE_NET_ETHERNET_H */ |
#endif /* __linux__ */ |
|
#if !defined(__WIN32__) |
|
#include <netinet/tcp.h> |
|
#include <netinet/udp.h> |
|
#if (__linux__) && !(__GLIBC__) |
|
/* we get multiple definitions of IGMP_AGE_THRESHOLD if we include netinet */ |
|
#include <linux/igmp.h> |
|
#else |
|
#include <netinet/igmp.h> |
|
#endif |
|
#include <arpa/inet.h> |
|
#include <sys/time.h> |
|
#include <netdb.h> |
|
#endif /* __WIN32__ */ |
|
#include <errno.h> |
|
#include <stdarg.h> |
|
|
|
#define LIBNET_VERSION "@LIBNET_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 129 extern "C" {
|
Line 117 extern "C" {
|
|
|
#endif /* __LIBNET_H */ |
#endif /* __LIBNET_H */ |
|
|
/* EOF */ |
|