Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __CSOCKETRTSCHEDULER_H__
00020 #define __CSOCKETRTSCHEDULER_H__
00021
00022 #define WANT_WINSOCK2
00023
00024 #include <platdep/sockets.h>
00025 #include <platdep/timeutil.h>
00026 #include "INETDefs.h"
00027 #include <omnetpp.h>
00028
00029
00030 #include "bsdint.h"
00031 #define HAVE_U_INT8_T
00032 #define HAVE_U_INT16_T
00033 #define HAVE_U_INT32_T
00034 #define HAVE_U_INT64_T
00035 #ifdef HAVE_PCAP
00036 #include <pcap.h>
00037 #endif
00038 #include "ExtFrame_m.h"
00039
00040 class cSocketRTScheduler : public cScheduler
00041 {
00042 protected:
00043 int fd;
00044
00045 virtual bool receiveWithTimeout();
00046 virtual int receiveUntil(const timeval& targetTime);
00047 public:
00051 cSocketRTScheduler();
00052
00056 virtual ~cSocketRTScheduler();
00057 #ifdef HAVE_PCAP
00058 static std::vector<cModule *> modules;
00059 static std::vector<pcap_t *> pds;
00060 static std::vector<int> datalinks;
00061 static std::vector<int> headerLengths;
00062 #endif
00063 static timeval baseTime;
00064
00068 virtual void startRun();
00069
00073 virtual void endRun();
00074
00078 virtual void executionResumed();
00079
00085 void setInterfaceModule(cModule *mod, const char *dev, const char *filter);
00086
00090 virtual cMessage *getNextEvent();
00091
00095 void sendBytes(unsigned char *buf, size_t numBytes, struct sockaddr *from, socklen_t addrlen);
00096 };
00097
00098 #endif
00099