File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / libnet / sample / libnet_test.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 22:14:23 2012 UTC (12 years, 4 months ago) by misho
Branches: libnet, MAIN
CVS tags: v1_1_6p5, v1_1_6p4, v1_1_6p0, v1_1_6, v1_1_2_1, HEAD
libnet

    1: /*
    2:  *  $Id: libnet_test.h,v 1.1.1.1 2012/02/21 22:14:23 misho Exp $
    3:  *
    4:  *  libnet_test.h
    5:  *
    6:  *  Copyright (c) 1998 - 2001 Mike D. Schiffman <mike@infonexus.com>
    7:  */
    8: 
    9: #ifndef __LIBNET_TEST_H
   10: #define __LIBNET_TEST_H
   11: 
   12: #ifndef _WIN32
   13: #include "../include/libnet.h"
   14: #else
   15: #include "../include/win32/libnet.h"
   16: #include "../include/win32/getopt.h"
   17: #endif
   18: 
   19: #define libnet_timersub(tvp, uvp, vvp)                                  \
   20:         do {                                                            \
   21:                 (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec;          \
   22:                 (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec;       \
   23:                 if ((vvp)->tv_usec < 0) {                               \
   24:                         (vvp)->tv_sec--;                                \
   25:                         (vvp)->tv_usec += 1000000;                      \
   26:                 }                                                       \
   27:         } while (0)
   28: 
   29: u_char enet_src[6] = {0x0d, 0x0e, 0x0a, 0x0d, 0x00, 0x00};
   30: u_char enet_dst[6] = {0x00, 0x10, 0x67, 0x00, 0xb1, 0x86};
   31: u_char ip_src[4]   = {0x0a, 0x00, 0x00, 0x01};
   32: u_char ip_dst[4]   = {0x0a, 0x00, 0x00, 0x02};
   33: u_char fddi_src[6] = {0x00, 0x0d, 0x0e, 0x0a, 0x0d, 0x00};
   34: u_char fddi_dst[6] = {0x00, 0x10, 0x67, 0x00, 0xb1, 0x86};
   35: u_char tr_src[6]   = {0x00, 0x0d, 0x0e, 0x0a, 0x0d, 0x00};
   36: u_char tr_dst[6]   = {0x00, 0x10, 0x67, 0x00, 0xb1, 0x86};
   37: 
   38: u_char org_code[3] = {0x00, 0x00, 0x00};
   39: 
   40: void usage(char *);
   41: 
   42: #if defined(__WIN32__)
   43: #include <win32/getopt.h>
   44: #include <winsock2.h>
   45: #include <ws2tcpip.h>
   46: #ifndef _WIN32
   47: #include <sys/time.h>
   48: #endif
   49: #if defined(__GNUC__)         /* mingw compiler */
   50: extern __attribute__((dllimport)) char *optarg;
   51: #else   /* assume msvc */
   52: #ifndef _WIN32
   53: extern __dllspec(dllimport) char *optarg;
   54: #endif
   55: #endif
   56: #endif  /* __WIN32__ */
   57: 
   58: #endif  /* __LIBNET_TEST_H */
   59: 
   60: /* EOF */

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