00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __MSGHANDLER_H__
00019 #define __MSGHANDLER_H__
00020
00021 #include <omnetpp.h>
00022 #include <platdep/sockets.h>
00023 #include <arpa/inet.h>
00024 #include <netdb.h>
00025 #include <PhyControlInfo_m.h>
00026 #include "cUDPSocketRTScheduler.h"
00027 #include "RAWEtherFrame.h"
00028 #include "PMTypes.h"
00029
00030
00031 class MsgHandler : public cSimpleModule
00032 {
00033 private:
00034 cModule *host;
00035 cModule *vif[MAX_NUM_VIF];
00036 struct addrinfo addrInfo;
00037 struct sockaddr_storage hostAddr;
00038 int numVif;
00039
00040 void sendToHost(char *msg, int length);
00041
00042 protected:
00043 virtual void initialize();
00044 virtual void handleMessage(cMessage *msg);
00045 void setRTS(int8_t index, int16_t rts);
00046 void setRetry(int8_t index, int16_t retry);
00047 void setTxPower(int8_t index, int16_t txpower);
00048 void setSensitivity(int8_t index, int16_t sensitivity);
00049 void setChannel(int8_t index, int16_t channel);
00050
00051 public:
00052 MsgHandler();
00053 virtual ~MsgHandler();
00054 void sendAck(unsigned int msgId);
00055 void sendToModel(char *wlanPkt, int length);
00056 void updateVifParameter(configNotification *info);
00057 void initializeVifParameters(vifRegistrationData vifReg[]);
00058 };
00059
00060 #endif // __MSGHANDLER_H__