pcap.h | Unix Linux Forums | Programming

  Go Back    


Programming Post questions about C, C++, Java, SQL, and other programming languages here.

pcap.h

Programming


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-24-2006
Pervez Sajjad Pervez Sajjad is offline
Registered User
 
Join Date: Jun 2006
Last Activity: 5 July 2006, 3:17 AM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Question pcap.h

I cant use pcap.h include file. How can I do so?
Sponsored Links
    #2  
Old 06-24-2006
Corona688 Corona688 is online now Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 21 October 2014, 3:53 PM EDT
Location: Saskatchewan
Posts: 19,634
Thanks: 815
Thanked 3,335 Times in 3,124 Posts
Errrr...
Code:
#include <pcap.h>

perhaps? If not, explain what the problem actually is before asking for help.
Sponsored Links
    #3  
Old 06-25-2006
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
 
Join Date: Mar 2005
Last Activity: 5 July 2014, 11:14 AM EDT
Location: classification algos
Posts: 3,203
Thanks: 19
Thanked 30 Times in 27 Posts
first check whether you have the packet capture library

and pcap.h available under /usr/include

else you cannot use it
    #4  
Old 06-28-2006
Freddie Freddie is offline
Registered User
 
Join Date: Jun 2006
Last Activity: 19 May 2009, 11:41 AM EDT
Location: Poland, Warsaw
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
If you have pcap.h in /usr/include type:
#include <pcap.h>

If you don't have pcap.h in /usr/include:
download it (but i can't help you to find it, I don't know where you can find it, ask it someone), save it in the directory of the source program that use pcap.h and in this source type:
#include pcap.h


Freddie
Sponsored Links
    #5  
Old 07-03-2006
linuxpenguin's Avatar
linuxpenguin linuxpenguin is offline Forum Advisor  
Registered User
 
Join Date: May 2002
Last Activity: 28 March 2014, 4:09 PM EDT
Location: India
Posts: 350
Thanks: 0
Thanked 5 Times in 5 Posts
you dont have to copy it to some directory. If it exists somewhere on your file system and you know where then simply use the -I compiler flag when you do the compile, so lets c it is in /tmp, then you compile as

cc -o outfile sourcefiles -I/tmp

The advantage of this is that pcap may be using other .h files and if pcap is some package library then logically the other .h files should reside in the same directory as pcap and this referencing them will be easy. else if you manage to include pcap.h and pcap uses say nocap.h the you ll get an error that you cant find nocap. so using the -I flag would help resolve such recursive errors.

btw what is the pcap.h file
Sponsored Links
    #6  
Old 07-03-2006
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
 
Join Date: Mar 2005
Last Activity: 5 July 2014, 11:14 AM EDT
Location: classification algos
Posts: 3,203
Thanks: 19
Thanked 30 Times in 27 Posts
as i had mentioned earlier

its the important header file for packet capturing library routines
Sponsored Links
    #7  
Old 07-03-2006
Freddie Freddie is offline
Registered User
 
Join Date: Jun 2006
Last Activity: 19 May 2009, 11:41 AM EDT
Location: Poland, Warsaw
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
MySQL

Quote:
Originally Posted by linuxpenguin
you dont have to copy it to some directory. If it....
[...]
(some text has been cut)


Great!



Freddie
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sampling pcap file sajal.bhatia Shell Programming and Scripting 8 11-14-2010 06:18 PM
how to check port already used in pcap pgm ram.sj UNIX for Advanced & Expert Users 1 08-13-2009 04:35 AM
Pcap.h Sniffing papabearcares Shell Programming and Scripting 0 04-17-2008 12:22 AM
Pcap.h Sniffing papabearcares Programming 0 04-17-2008 12:21 AM
Compiling Pcap.c TioTony Programming 6 01-22-2002 10:15 AM



All times are GMT -4. The time now is 03:56 PM.