please help me in rectifying the .cc code...
#include "omnetpp.h"
class AccessPoint : public cSimpleModule
{
Module_Class_Members(AccessPoint,cSimpleModule,16384);
virtual void activity();
};
Define_Module( AccessPoint );
void AccessPoint::activity()
{
//recording variables
cOutVector resp_v("DataStn");
float process_time = 0;
float time_stamp = 0;
float elasped_time = 0;
float delay = 0;
int random_wait; // variance time randomised
//Address Information
int sta_add = parentModule()->par("num_station"); //error: function parentModule could not be resolved
int AP_addr = sta_add + 1;
const int data_addr = 99; //permanent addr for data sta
//msg parameters
int source; // msg source
int destination; // msg destination
int msg_kind; //msg kind
long msg_nav; // nav of the msg
float msg_timestamp; // time stamp of msg
//IEEE802 vectors
//--------------------------
//State definitions
int State = 1;
//1 - Unauthenticated, Unassociated
//2 - Authenticated, Unassociated
//3 - Authenticated, Associated
//Network Allocation Vector (NAV) - max value 32767 (appox 32 msec)
long NAV = 0;
long temp_NAV = 0; // updated NAV value of the incoming packet
//Flags
bool flag_AUT = false; // is there an outstanding AUT request
bool flag_ASS = false; // is there an outstanding ASS request
bool flag_CTS = false; // This station has CTS
bool flag_RTS = false; // This station has RTS outstanding
bool flag_ORTS = false;// Another Station has RTS outstanding
bool flag_OCTS = false;// Another Station has CTS outstanding
bool flag_CLK = false; // not waiting for CLK signal
//Timing Constants - dependant on the PHY
//Device Interval - delays due to busy device
const int Device_Itvl = 3; // 3 cycles of clock
//DIFS
const int DIFS = 128; // microsecond
const int error_DIFS = 12; // microsecond
//SIFS
const int SIFS = 28; // microsecond
const int error_SIFS = 4; // microsecond
//Clock Cycle Time
const int CLOCK = 4; // microsecond
//microsecond denominator
const double Million = 0.000001;
// Message Kind Definition
const int RTS = 1;
const int CTS = 2;
const int AUT = 3;
const int ASS = 4;
const int rply_AUT = 5;
const int rply_ASS = 6;
const int de_AUT = 7;
const int de_ASS = 8;
const int DATA = 9;
const int ACK = 10;
const int CLK = 11;
const int LASTPKT = 12;
//-------------------------------------------------------------------------
for(;;)
{//for
//receiving from FS
cMessage *done = receive();
source = done->scr_add();//error : method src_add could not be resolved
destination = done->des_add();
msg_kind = done->kind();
msg_nav = done->nvec();
msg_timestamp = done->msgtimer();
delete done;
if (destination == AP_addr)
{//if destination
if (msg_kind == AUT)
{//if AUT
//reply with a rply_AUT
cMessage *work = new cMessage( "rply_AUT" );
work->setSCR(AP_addr);
work->setDES(source);
//work->setROUTESCR(AP_addr);
//work->setROUTDES(source);
work->setKind(rply_AUT);
work->setMsgTime(simTime());
work->setNAV(0);
random_wait = intrand(6);
wait ((SIFS+random_wait)*Million);
send( work, "out" );
}//if AUT
if(msg_kind == ASS)
{//if ASS
//reply with a rply_ASS
cMessage *work = new cMessage( "rply_ASS" );
work->setSCR(AP_addr);
work->setDES(source);
//work->setROUTESCR(AP_addr);
//work->setROUTDES(source);
work->setKind(rply_ASS);
work->setNAV(0);
work->setMsgTime(simTime());
random_wait = intrand(6);
wait ((SIFS+random_wait)*Million);
send( work, "out" );
}//if ASS
if((msg_kind == RTS))
{//if RTS reply with CTS
//reply with a CTS
cMessage *work = new cMessage( "CTS" );
work->setSCR(AP_addr);
work->setDES(source);
//work->setROUTESCR(AP_addr);
//work->setROUTDES(source);
work->setKind(CTS);
work->setMsgTime(simTime());
// The transmission delay from RTS to CTS needs to be subtracted
// from the RTS NAV
process_time = msg_nav - SIFS;
work->setNAV(process_time);
NAV = process_time; //setting own NAV vector
time_stamp = simTime(); //of the NAV vector
wait ((SIFS)*Million);
send( work, "out" );
}//if RTS
if(msg_kind == LASTPKT)
{//if DATA
//reply with a ACK for last packet
cMessage *work = new cMessage( "ACK" );
work->setSCR(AP_addr);
work->setDES(source);
//work->setROUTESCR(AP_addr);
//work->setROUTDES(source);
work->setKind(ACK);
work->setNAV(0);
wait ((SIFS)*Million);//delay SIFS
work->setTimestamp();
send( work, "out" );
//resp_v.record(source); //xxx
}//if DATA
}//if destination
} //for
}//void
please help me in removing these errors...