LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   wanna write c code for packet capture??wotz the approach (https://www.linuxquestions.org/questions/linux-networking-3/wanna-write-c-code-for-packet-capture-wotz-the-approach-560792/)

raklo 06-11-2007 02:22 AM

wanna write c code for packet capture??wotz the approach
 
hello all,
i wanna write a small c code,which captures the incoming packet and prints the protocol,i.e TCP/UDP.

i dont want to use pcap and libpcap libraries,
is there any alternate approach to it???

regards
rakesh

acid_kewpie 06-11-2007 03:11 AM

why would you not want to use libpcap? that's exactly what they're for, and if you don't use them, you're just going to have to replicate what they already do.

raklo 06-11-2007 04:21 AM

actually this is an exercise that im supposed to do,and the main restriction
is that i have to retrieve the protocol info of each incoming pcket dynamically
without using libpcap.

so i just wanna know if there is an approach??
i jst saw somwhere that this can be done using recvfrom()
is that approach proper??will it lead to somewhhere?
regards and thanx
rakesh


All times are GMT -5. The time now is 03:03 AM.