Annotation of embedaddon/libnet/sample/libnet_test.h, revision 1.1.1.2

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

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