Thanks you before...
WirelessHost;
import inet.networklayer.IManetRouting;
import nesg.netattacks.attacks.controllers.NA_Attack;
import nesg.netattacks.attacks.controllers.delayAttack.NA_DelayAttack;
import nesg.netattacks.attacks.controllers.droppingAttack.NA_DroppingAttack;
import nesg.netattacks.attacks.controllers.sinkholeAttack.NA_SinkholeAttack;
//import inet.networklayer.IManetRouting;
import inet.util.ThruputMeter;
import inet.util.ThruputMeteringChannel;
//
// Wireless ad hoc host. Modificated from WirelessHost module.
// Redefined from INET framework and used as normal host.
//
// It is used as a simple AdhocHost like in INET framework. These hosts never
// behaves as attacker host. The only differente regards AdhocHost is that in
// this case they are using the MA framework arquitecture.
//
// @see AdhocHost, WirelessHost
//
// @author Gabriel Maciá Fernández,
gma...@ugr.es// @date 01/22/2013
module NA_AdhocHost extends NA_WirelessHost
{
parameters:
@display("i=device/cellphone,white;bgb=803,448;i2=status/green");
wlan[*].mgmtType = default("Ieee80211MgmtAdhoc"); // use adhoc management
string routingProtocol @enum("AODVUU","DYMOUM","DYMO","DSRUU","OLSR","OLSR_ETX","DSDV_2","Batman") = default("AODVUU");
IPForward = default(true);
submodules:
manetrouting: <routingProtocol> like IManetRouting if routingProtocol != "" {
@display("p=522,307");
}
connections:
//networkLayer.manetOut --> manetrouting.from_ip if routingProtocol != "";
//networkLayer.manetIn <-- manetrouting.to_ip if routingProtocol != "";
networkLayer.manetOut --> manetrouting.from_ip if routingProtocol != "";
networkLayer.manetIn <-- manetrouting.to_ip if routingProtocol != "";
udp.ipOut --> thruputMeter_tx.in;
udp.ipIn <-- thruputMeter_rx.out;
for i=0..numTcpApps-1 {
tcpApp[i].tcpOut --> tcp.appIn++;
tcpApp[i].tcpIn <-- tcp.appOut++;
}
thruputMeter_tx.out --> networkLayer.manetIn if hasTcp;
thruputMeter_rx.in <-- networkLayer.manetOut if hasTcp;
networkLayer.ifOut++ --> thruputMeter_rx.in;
networkLayer.ifIn++ <-- thruputMeter_tx.out;
networkLayer.igmpOut --> thruputMeter_rx.in;
networkLayer.igmpIn <-- thruputMeter_tx.out;
}