From: John Default Date: Wed, 10 Oct 2007 23:17:36 +0000 Subject: Re: [LARTC] Packet capturing Message-Id: <470D5D90.6020500@advaita.sytes.net> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Hi and why do you need to destroy the other packet copy? The packet you receive with pcap is a/ for your host and can be used normally (for normal networking of the host) b/ not for your host - operating system drops packets not intended for it anyway If you didn't switch your network card into promiscuous mode, your NIC has already dropped that packet so neither you (pcap), nor your operating system will see it With libpcap you are actually capturing on Layer 2, ethernet header is included and can be injected. your operating system doesn't even have to have an IP address therefore. during testing i usually used "ifconfig ethX 0.0.0.0 up" just to be sure OS will not mess with IP packets :) . I am not sure the interface has to be even in "up" state for pcap to work. In our school we have to implement "bridge" and "router" using libpcap and i had no problems with that. Using raw socket is another option to pcap Jayesh Agrawal wrote: > Hello Everybody! > > I am an Engineering student and doing a project on WAN Emulator. Can > anyone please tell me the way to capture a packet on Network Layer. I > want to capture original packet and not the copy(i think libpcap > provides a copy of the original packet). Let suppose we get a copy on > Netwok layer then how we can destroy the original packet.... > > Plz suggest me....Thanks in advance > ------------------------------------------------------------------------ > > _______________________________________________ > LARTC mailing list > LARTC@mailman.ds9a.nl > http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc > -- ___________________________________ S pozdravom / Best regards John Default _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc