Hello, I want to use wincap to built a packet forwarding application which could be run on a gateway machine so that hosts on the LAN can access the internet through the gateway. i dont want to use any already available proxy or the routing features of the OS. This is because later on I will enhance this application to work according to my custom design or a router with multiple interfaces.
What I tried doing is made 2 applications. One application was responsible for transfering packets from internal LAN to ISP. And the other application did tranfer of packets coming from ISP to host on LAN. To begin with I wanted avoiding ARP requests. So I made a LAN of only one host and hardcoded the MAC address while forwarding the packet to the host from the gateway. Similarly, I hardcoded the MAC address of ISP while forwarding the packet to the ISP. After running the 2 applications on the gateway, I tried pinging to some external host via gateway. But it failed. I also tried browsing through the internal host, but that too failed. But I could see some traffic going indicated by the lights of the switch. Probably, I am making some mistake while I am rebuilding the ethernet packet that is to be forwarded. So can anyone plz help me how to make the new packet which is to be forwarded when a new packet arrives to be transfered to the other side. Or probably how to use pcap_sendpacket from within the call back function of the arriving interface. What I did was I just made changes in the source and destination address of the arriving packet and forwarded the same packet to the other interface. Plz Help, Thanks Nitesh __________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com
