NETWORK ATTACKS FRAMEWORK
1.0.0
A NETwork Attacks framework. Making network attacks impact evaluation easier!
|
ADOVUU hacked module. More...
#include <NA_aodv_uu_omnet.h>
Public Member Functions | |
NA_AODVUU () | |
~NA_AODVUU () | |
void | packetFailed (IPv4Datagram *p) |
void | packetFailedMac (Ieee80211DataFrame *) |
virtual uint32_t | getRoute (const ManetAddress &, std::vector< ManetAddress > &) |
virtual bool | getNextHop (const ManetAddress &, ManetAddress &add, int &iface, double &) |
virtual bool | isProactive () |
virtual void | setRefreshRoute (const ManetAddress &destination, const ManetAddress &nextHop, bool isReverse) |
virtual bool | setRoute (const ManetAddress &destination, const ManetAddress &nextHop, const int &ifaceIndex, const int &hops, const ManetAddress &mask=ManetAddress::ZERO) |
virtual bool | setRoute (const ManetAddress &destination, const ManetAddress &nextHop, const char *ifaceName, const int &hops, const ManetAddress &mask=ManetAddress::ZERO) |
void | handleMessageFromAttackController (cMessage *msg) |
This method is in charge of to receive the control message from the attack controller. | |
Static Public Attributes | |
static int | log_file_fd = -1 |
static bool | log_file_fd_init = false |
Protected Types | |
typedef std::vector < rreq_record * > | RreqRecords |
typedef std::map< ManetAddress, struct blacklist * > | RreqBlacklist |
typedef std::map< ManetAddress, seek_list_t * > | SeekHead |
Protected Member Functions | |
void | drop (cPacket *p, int cause=0) |
int | startAODVUUAgent () |
void | scheduleNextEvent () |
const char * | if_indextoname (int, char *) |
IPv4Datagram * | pkt_encapsulate (IPv4Datagram *, IPv4Address) |
IPv4Datagram * | pkt_decapsulate (IPv4Datagram *) |
virtual void | handleMessage (cMessage *msg) |
virtual void | finish () |
int | numInitStages () const |
void | initialize (int stage) |
void | recvAODVUUPacket (cMessage *p) |
void | processPacket (IPv4Datagram *, unsigned int) |
struct dev_info | dev_ifindex (int) |
struct dev_info | dev_nr (int) |
int | ifindex2devindex (unsigned int ifindex) |
virtual void | processLinkBreak (const cObject *details) |
virtual bool | isOurType (cPacket *) |
virtual bool | getDestAddress (cPacket *, ManetAddress &) |
Protected Attributes | |
bool | is_init |
cMessage * | sendMessageEvent |
int | initialized |
int | node_id |
IPv4Address * | gateWayAddress |
int | NS_DEV_NR |
int | NS_IFINDEX |
int | log_to_file |
int | rt_log_interval |
int | unidir_hack |
int | rreq_gratuitous |
int | expanding_ring_search |
int | internet_gw_mode |
int | local_repair |
int | receive_n_hellos |
int | hello_jittering |
int | optimized_hellos |
int | ratelimit |
int | llfeedback |
char * | progname |
int | wait_on_reboot |
struct timer | worb_timer |
int | active_route_timeout |
int | ttl_start |
int | delete_period |
struct timer | hello_timer |
RreqRecords | rreq_records |
RreqBlacklist | rreq_blacklist |
SeekHead | seekhead |
int | log_rt_fd |
int | log_nmsgs |
int | debug |
struct timer | rt_log_timer |
struct host_info | this_host |
unsigned int | dev_indices [MAX_NR_INTERFACES] |
Static Protected Attributes | |
static bool | iswrite = false |
static int | totalSend = 0 |
static int | totalRreqSend = 0 |
static int | totalRreqRec = 0 |
static int | totalRrepSend = 0 |
static int | totalRrepRec = 0 |
static int | totalRrepAckSend = 0 |
static int | totalRrepAckRec = 0 |
static int | totalRerrSend = 0 |
static int | totalRerrRec = 0 |
Private Types | |
typedef std::multimap < simtime_t, struct timer * > | AodvTimerMap |
typedef std::map< ManetAddress, struct rt_table * > | AodvRtTableMap |
Private Member Functions | |
bool | isBroadcast (ManetAddress add) |
Private Attributes | |
NA_NesgLog | log |
Log reference. | |
bool | sinkholeAttackIsActive |
Flag to activate sinkhole attack. | |
double | sinkholeAttackProbability |
Probability for sinkhole packets when sinkhole attack is active. | |
bool | sinkOnlyWhenRouteInTable |
Sink only if the attacker DO know the route. | |
long | numSents |
Number of false RREP sent. | |
ParPtr | seqnoAdded |
Sequence number for the simulation. | |
int | numHops |
Sequence number for the simulation. | |
char | nodeName [50] |
ICMPAccess | icmpAccess |
bool | useIndex |
bool | isRoot |
uint32_t | costStatic |
uint32_t | costMobile |
bool | useHover |
bool | propagateProactive |
struct timer | proactive_rreq_timer |
long | proactive_rreq_timeout |
AodvTimerMap | aodvTimerMap |
AodvRtTableMap | aodvRtTableMap |
ADOVUU hacked module.
To implement an attack is usually needed to modify the AODVUU related files and its owner methods. Each piece of code modified is labeled with a specific tags. For example, for sinkhole attack these are the following:
\// BEGIN NA_SINKHOLE - <username> <code modified to implement sinkhole> \// END NA_SINKHOLE - <username>
Attacks implemented and the corresponding files modified:
Attack | Modified files |
---|---|
Sinkhole | NA_aodv_rreq, NA_aodv_uu_omnet |
Definition at line 158 of file NA_aodv_uu_omnet.h.
typedef std::map<ManetAddress, struct rt_table*> NA_AODVUU::AodvRtTableMap [private] |
Definition at line 222 of file NA_aodv_uu_omnet.h.
typedef std::multimap<simtime_t, struct timer*> NA_AODVUU::AodvTimerMap [private] |
Definition at line 220 of file NA_aodv_uu_omnet.h.
typedef std::map<ManetAddress, struct blacklist *> NA_AODVUU::RreqBlacklist [protected] |
Definition at line 368 of file NA_aodv_uu_omnet.h.
typedef std::vector<rreq_record *> NA_AODVUU::RreqRecords [protected] |
Definition at line 367 of file NA_aodv_uu_omnet.h.
typedef std::map<ManetAddress, seek_list_t*> NA_AODVUU::SeekHead [protected] |
Definition at line 369 of file NA_aodv_uu_omnet.h.
NA_AODVUU::NA_AODVUU | ( | ) | [inline] |
Definition at line 229 of file NA_aodv_uu_omnet.h.
{isRoot = false; is_init = false; log_file_fd_init = false; sendMessageEvent = new cMessage();/*&messageEvent;*/}
struct dev_info NA_AODVUU::dev_ifindex | ( | int | ) | [read, protected] |
struct dev_info NA_AODVUU::dev_nr | ( | int | ) | [read, protected] |
void NA_AODVUU::drop | ( | cPacket * | p, |
int | cause = 0 |
||
) | [inline, protected] |
Definition at line 249 of file NA_aodv_uu_omnet.h.
{ delete p; // icmpAccess.get()->sendErrorMessage(p, ICMP_DESTINATION_UNREACHABLE, cause);
virtual void NA_AODVUU::finish | ( | ) | [protected, virtual] |
virtual bool NA_AODVUU::getDestAddress | ( | cPacket * | , |
ManetAddress & | |||
) | [protected, virtual] |
virtual bool NA_AODVUU::getNextHop | ( | const ManetAddress & | , |
ManetAddress & | add, | ||
int & | iface, | ||
double & | |||
) | [virtual] |
virtual uint32_t NA_AODVUU::getRoute | ( | const ManetAddress & | , |
std::vector< ManetAddress > & | |||
) | [virtual] |
virtual void NA_AODVUU::handleMessage | ( | cMessage * | msg | ) | [protected, virtual] |
void NA_AODVUU::handleMessageFromAttackController | ( | cMessage * | msg | ) | [virtual] |
This method is in charge of to receive the control message from the attack controller.
Depending of the message information, this method sets the specific hacked module properties to allow the attack behavior or not.
This method must be overridden for all hacked modules.
msg | cMessage the received message from attack controller |
Reimplemented from NA_HackedModule.
const char* NA_AODVUU::if_indextoname | ( | int | , |
char * | |||
) | [protected] |
int NA_AODVUU::ifindex2devindex | ( | unsigned int | ifindex | ) | [protected] |
void NA_AODVUU::initialize | ( | int | stage | ) | [protected] |
bool NA_AODVUU::isBroadcast | ( | ManetAddress | add | ) | [inline, private] |
Definition at line 211 of file NA_aodv_uu_omnet.h.
{ if (this->isInMacLayer() && add==ManetAddress(MACAddress::BROADCAST_ADDRESS)) return true; if (!this->isInMacLayer() && add==ManetAddress(IPv4Address::ALLONES_ADDRESS)) return true; return false;
virtual bool NA_AODVUU::isOurType | ( | cPacket * | ) | [protected, virtual] |
virtual bool NA_AODVUU::isProactive | ( | ) | [virtual] |
int NA_AODVUU::numInitStages | ( | ) | const [inline, protected] |
Definition at line 262 of file NA_aodv_uu_omnet.h.
{return 5;}
void NA_AODVUU::packetFailed | ( | IPv4Datagram * | p | ) |
void NA_AODVUU::packetFailedMac | ( | Ieee80211DataFrame * | ) |
IPv4Datagram* NA_AODVUU::pkt_decapsulate | ( | IPv4Datagram * | ) | [protected] |
IPv4Datagram* NA_AODVUU::pkt_encapsulate | ( | IPv4Datagram * | , |
IPv4Address | |||
) | [protected] |
virtual void NA_AODVUU::processLinkBreak | ( | const cObject * | details | ) | [protected, virtual] |
void NA_AODVUU::processPacket | ( | IPv4Datagram * | , |
unsigned | int | ||
) | [protected] |
void NA_AODVUU::recvAODVUUPacket | ( | cMessage * | p | ) | [protected] |
void NA_AODVUU::scheduleNextEvent | ( | ) | [protected] |
virtual void NA_AODVUU::setRefreshRoute | ( | const ManetAddress & | destination, |
const ManetAddress & | nextHop, | ||
bool | isReverse | ||
) | [virtual] |
virtual bool NA_AODVUU::setRoute | ( | const ManetAddress & | destination, |
const ManetAddress & | nextHop, | ||
const int & | ifaceIndex, | ||
const int & | hops, | ||
const ManetAddress & | mask = ManetAddress::ZERO |
||
) | [virtual] |
virtual bool NA_AODVUU::setRoute | ( | const ManetAddress & | destination, |
const ManetAddress & | nextHop, | ||
const char * | ifaceName, | ||
const int & | hops, | ||
const ManetAddress & | mask = ManetAddress::ZERO |
||
) | [virtual] |
int NA_AODVUU::startAODVUUAgent | ( | ) | [protected] |
int NA_AODVUU::active_route_timeout [protected] |
Definition at line 346 of file NA_aodv_uu_omnet.h.
AodvRtTableMap NA_AODVUU::aodvRtTableMap [private] |
Definition at line 223 of file NA_aodv_uu_omnet.h.
AodvTimerMap NA_AODVUU::aodvTimerMap [private] |
Definition at line 221 of file NA_aodv_uu_omnet.h.
uint32_t NA_AODVUU::costMobile [private] |
Definition at line 206 of file NA_aodv_uu_omnet.h.
uint32_t NA_AODVUU::costStatic [private] |
Definition at line 205 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::debug [protected] |
Definition at line 379 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::delete_period [protected] |
Definition at line 348 of file NA_aodv_uu_omnet.h.
unsigned int NA_AODVUU::dev_indices[MAX_NR_INTERFACES] [protected] |
Definition at line 386 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::expanding_ring_search [protected] |
Definition at line 333 of file NA_aodv_uu_omnet.h.
IPv4Address* NA_AODVUU::gateWayAddress [protected] |
Definition at line 273 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::hello_jittering [protected] |
Definition at line 337 of file NA_aodv_uu_omnet.h.
struct timer NA_AODVUU::hello_timer [protected] |
Definition at line 351 of file NA_aodv_uu_omnet.h.
ICMPAccess NA_AODVUU::icmpAccess [private] |
Definition at line 202 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::initialized [protected] |
Definition at line 271 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::internet_gw_mode [protected] |
Definition at line 334 of file NA_aodv_uu_omnet.h.
bool NA_AODVUU::is_init [protected] |
Definition at line 248 of file NA_aodv_uu_omnet.h.
bool NA_AODVUU::isRoot [private] |
Definition at line 204 of file NA_aodv_uu_omnet.h.
bool NA_AODVUU::iswrite = false [static, protected] |
Definition at line 391 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::llfeedback [protected] |
Definition at line 340 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::local_repair [protected] |
Definition at line 335 of file NA_aodv_uu_omnet.h.
NA_NesgLog NA_AODVUU::log [private] |
Log reference.
Reimplemented from NA_HackedModule.
Definition at line 166 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::log_file_fd = -1 [static] |
Definition at line 227 of file NA_aodv_uu_omnet.h.
bool NA_AODVUU::log_file_fd_init = false [static] |
Definition at line 228 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::log_nmsgs [protected] |
Definition at line 378 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::log_rt_fd [protected] |
Definition at line 377 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::log_to_file [protected] |
Definition at line 329 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::node_id [protected] |
Definition at line 272 of file NA_aodv_uu_omnet.h.
char NA_AODVUU::nodeName[50] [private] |
Definition at line 201 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::NS_DEV_NR [protected] |
Definition at line 275 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::NS_IFINDEX [protected] |
Definition at line 276 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::numHops [private] |
Sequence number for the simulation.
Implemented as a pointer to allow random distributions values
Definition at line 197 of file NA_aodv_uu_omnet.h.
long NA_AODVUU::numSents [private] |
Number of false RREP sent.
Definition at line 187 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::optimized_hellos [protected] |
Definition at line 338 of file NA_aodv_uu_omnet.h.
long NA_AODVUU::proactive_rreq_timeout [private] |
Definition at line 210 of file NA_aodv_uu_omnet.h.
struct timer NA_AODVUU::proactive_rreq_timer [private] |
Definition at line 209 of file NA_aodv_uu_omnet.h.
char* NA_AODVUU::progname [protected] |
Definition at line 341 of file NA_aodv_uu_omnet.h.
bool NA_AODVUU::propagateProactive [private] |
Definition at line 208 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::ratelimit [protected] |
Definition at line 339 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::receive_n_hellos [protected] |
Definition at line 336 of file NA_aodv_uu_omnet.h.
RreqBlacklist NA_AODVUU::rreq_blacklist [protected] |
Definition at line 372 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::rreq_gratuitous [protected] |
Definition at line 332 of file NA_aodv_uu_omnet.h.
RreqRecords NA_AODVUU::rreq_records [protected] |
Definition at line 371 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::rt_log_interval [protected] |
Definition at line 330 of file NA_aodv_uu_omnet.h.
struct timer NA_AODVUU::rt_log_timer [protected] |
Definition at line 380 of file NA_aodv_uu_omnet.h.
SeekHead NA_AODVUU::seekhead [protected] |
Definition at line 373 of file NA_aodv_uu_omnet.h.
cMessage* NA_AODVUU::sendMessageEvent [protected] |
Definition at line 266 of file NA_aodv_uu_omnet.h.
ParPtr NA_AODVUU::seqnoAdded [private] |
Sequence number for the simulation.
Implemented as a pointer to allow random distributions values
Definition at line 192 of file NA_aodv_uu_omnet.h.
bool NA_AODVUU::sinkholeAttackIsActive [private] |
Flag to activate sinkhole attack.
Definition at line 172 of file NA_aodv_uu_omnet.h.
double NA_AODVUU::sinkholeAttackProbability [private] |
Probability for sinkhole packets when sinkhole attack is active.
Definition at line 177 of file NA_aodv_uu_omnet.h.
bool NA_AODVUU::sinkOnlyWhenRouteInTable [private] |
Sink only if the attacker DO know the route.
Definition at line 182 of file NA_aodv_uu_omnet.h.
struct host_info NA_AODVUU::this_host [protected] |
Definition at line 383 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::totalRerrRec = 0 [static, protected] |
Definition at line 400 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::totalRerrSend = 0 [static, protected] |
Definition at line 399 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::totalRrepAckRec = 0 [static, protected] |
Definition at line 398 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::totalRrepAckSend = 0 [static, protected] |
Definition at line 397 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::totalRrepRec = 0 [static, protected] |
Definition at line 396 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::totalRrepSend = 0 [static, protected] |
Definition at line 395 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::totalRreqRec = 0 [static, protected] |
Definition at line 394 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::totalRreqSend = 0 [static, protected] |
Definition at line 393 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::totalSend = 0 [static, protected] |
Definition at line 392 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::ttl_start [protected] |
Definition at line 347 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::unidir_hack [protected] |
Definition at line 331 of file NA_aodv_uu_omnet.h.
bool NA_AODVUU::useHover [private] |
Definition at line 207 of file NA_aodv_uu_omnet.h.
bool NA_AODVUU::useIndex [private] |
Definition at line 203 of file NA_aodv_uu_omnet.h.
int NA_AODVUU::wait_on_reboot [protected] |
Definition at line 342 of file NA_aodv_uu_omnet.h.
struct timer NA_AODVUU::worb_timer [protected] |
Definition at line 343 of file NA_aodv_uu_omnet.h.