The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Pcap.h Sniffing papabearcares Shell Programming and Scripting 0 04-16-2008 09:22 PM
Pcap.h Sniffing papabearcares High Level Programming 0 04-16-2008 09:21 PM
Filtering paquets with pcap.h danathane High Level Programming 3 03-03-2008 09:17 AM
Compiling Pcap.c TioTony High Level Programming 6 01-22-2002 07:15 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-23-2006
Registered User
 

Join Date: Jun 2006
Posts: 3
Stumble this Post!
Question pcap.h

I cant use pcap.h include file. How can I do so?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-24-2006
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 923
Stumble this Post!
Errrr...
Code:
#include <pcap.h>
perhaps? If not, explain what the problem actually is before asking for help.
Reply With Quote
  #3 (permalink)  
Old 06-24-2006
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,572
Stumble this Post!
first check whether you have the packet capture library

and pcap.h available under /usr/include

else you cannot use it
Reply With Quote
  #4 (permalink)  
Old 06-28-2006
Registered User
 

Join Date: Jun 2006
Location: Italy
Posts: 7
Stumble this Post!
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
Reply With Quote
  #5 (permalink)  
Old 07-03-2006
linuxpenguin's Avatar
Registered User
 

Join Date: May 2002
Location: India
Posts: 295
Stumble this Post!
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
__________________
War doesnt determine who is right, it determines who is left
Reply With Quote
  #6 (permalink)  
Old 07-03-2006
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,572
Stumble this Post!
as i had mentioned earlier

its the important header file for packet capturing library routines
Reply With Quote
  #7 (permalink)  
Old 07-03-2006
Registered User
 

Join Date: Jun 2006
Location: Italy
Posts: 7
Stumble this Post!
Thumbs up

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


Great!



Freddie
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:14 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0