usi++.h Source File

Main Page Class Hierarchy Compound List File List Compound Members Examples

# usi++.h

    00001 /*** This Programs/Libraries are (C)opyright by Sebastian Krahmer.
    00002  *** You may use it under the terms of the GPL. You should have
    00003  *** already received the file COPYING that shows you your rights.
    00004  *** Please look at COPYING for further license-details.
    00005  ***
    00006  *** THERE IS ABSOLUTELY NO WARRANTY. SO YOU USE IT AT YOUR OWN RISK.
    00007  *** IT WAS WRITTEN IN THE HOPE THAT IT WILL BE USEFULL. I AM NOT RESPONSIBLE
    00008  *** FOR ANY DAMAGE YOU MAYBE GET DUE TO USING MY PROGRAMS.
    00009  ***/
    00010
    00011
    00012 #ifndef _USIPP_H_
    00013 #define _USIPP_H_
    00014
    00015 #ifndef USI_VERSION
    00016 #define USI_VERSION 192
    00017 #endif
    00018
    00019 #include "config.h"
    00020 #include "datalink.h"
    00021 //#include "arp.h"
    00022 #include "Layer2.h"
    00023 #include "ip.h"
    00024 #include "icmp.h"
    00025 #include "udp.h"
    00026 #include "tcp.h"
    00027 #include "TX.h"
    00028 #include "TX_IP.h"
    00029 #include "RX.h"
    00030 #include <string>
    00031
    00032 namespace usipp {
    00033
    00034 class usifault {
    00035         string fault;
    00036 public:
    00037         usifault(const char *s = "undef") : fault(s) {}
    00038         ~usifault() {}
    00039         const char *why() { return fault.c_str(); }
    00040 };
    00041
    00042 /* For error-handling.
    00043  */
    00044 typedef enum {
    00045         PERROR = 0,
    00046         HERROR,
    00047         PCAP,
    00048         STDERR
    00049 } errorFuncs;
    00050
    00051 extern unsigned short in_cksum(unsigned short *ptr, int len);
    00052 extern bool exceptions;
    00053 extern int useException(bool);
    00054 extern void die(const char *, errorFuncs, int);
    00055 extern char *getMAC(const char *, char *, int);
    00056 extern char *setMAC(const char *, char *);
    00057
    00058 } // namespace usipp
    00059
    00060 using namespace usipp;
    00061
    00062 #endif // _USIPP_H_