00001
00002
00003
00004
00005
00006
00007
00008
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
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
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 }
00059
00060 using namespace usipp;
00061
00062 #endif // _USIPP_H_