hi to everybody. I've just registered to post here. I hope you to understand me.
I need to do the next.
I'm doing for my final degree project some sniffer in C running in openwrt firmware. I've already done every but I have one thing left I don't know how to start with.
I've the next private net: http://img443.imageshack.us/img443/999/sinttulo2de.png
What my sniffer does is to sniff all packets running through my router, and when one of these packets goes to any of my connected PCs, if that PC is asleep, it wakes it up. As if it were an automatic wake on lan.
So, I've a problem. Supposing PC3 sends a packet to PC4, the arp table from the switch knows where is PC4, and will guide that packet to the PC4 gateway. If this happens, my sniffer will never see that packet, because the sniffer is running in the proccessor in the router, and can only see the packets which go through it.
I need to do the next. When PC4 fells asleep and my sniffer detects it (already done that), the sniffers has to send a fake broadcast with the IP address source fro PC4, to cheat the switch and make it think PC4 is now connect in the gateway which goes to the router. So, the next packet which will be sent from PC3 to PC4 will go to the router instead to PC4, and my sniffer will see it.
To sum up, I need to send a broadcast packet with the IP source addres field modified, and I don't know how to do it.
Sorry for my english!!