Implemented ARP sniffing and spoofing functionality

This commit is contained in:
Martin Willi
2010-03-25 14:39:32 +01:00
parent dc70a5bb0b
commit f8e99e012a
4 changed files with 259 additions and 1 deletions
+13
View File
@@ -16,6 +16,7 @@
#include "farp_plugin.h"
#include "farp_listener.h"
#include "farp_spoofer.h"
#include <daemon.h>
@@ -35,11 +36,17 @@ struct private_farp_plugin_t {
* Listener registering active virtual IPs
*/
farp_listener_t *listener;
/**
* Spoofer listening and spoofing ARP messages
*/
farp_spoofer_t *spoofer;
};
METHOD(plugin_t, destroy, void,
private_farp_plugin_t *this)
{
DESTROY_IF(this->spoofer);
charon->bus->remove_listener(charon->bus, &this->listener->listener);
this->listener->destroy(this->listener);
free(this);
@@ -59,6 +66,12 @@ plugin_t *farp_plugin_create()
charon->bus->add_listener(charon->bus, &this->listener->listener);
this->spoofer = farp_spoofer_create(this->listener);
if (!this->spoofer)
{
destroy(this);
return NULL;
}
return &this->public.plugin;
}