(Note that the people at LBL are no longer developing libpcap or
tcpdump; it's now being done by the Tcpdump Group, so mail to
"[EMAIL PROTECTED]" and "[EMAIL PROTECTED]" is forwarded to
"[EMAIL PROTECTED]".)

> I am a user of libpcap library and have two questions.
> 
> I find that the default directory to install the library is
> /usr/include/pcap,

No, the default directory for the header files is either "/usr/include"
or "/usr/local/include"; there may be some versions of libpcap that, for
some reason, install it in "/usr/include/pcap", but that's *not* where
it's supposed to be installed.

> but the manual show that

        ...

>        #include <pcap.h>

Yes, that's because it's supposed to be installed in "/usr/include" or
"/usr/local/include".

If your system installed it in "/usr/include/pcap", you should have your
Makefile add a "-I/usr/include/pcap" compiler flag.

> A second question is that
> I see only one line about 'pcap_dumper' in the library.
> 
> [yanya@cpt libpcap-0.4]$ find . -type f | xargs grep 'pcap_dumper '
> ./pcap.h:typedef struct pcap_dumper pcap_dumper_t;
> 
> And no declaration or definition for struct pcap_dumper.

Correct.  The libpcap library uses only *pointers* to "pcap_t" and
"pcap_dumper_t", and doesn't declare the "struct pcap" and "struct
pcap_dumper" structures, so that those structures are opaque to
applications using libpcap.

> The following is what I confront to compile file ttt_pcap.c
> 
> [yanya@cpt libpcap-0.4]$ more VERSION
> 0.4
> [yanya@cpt libpcap-0.4]$ more ttt_pcap.c
> #include <pcap/pcap.h>
> 
> int main(void){
>     pcap_t  *p, p1;
>     pcap_dumper_t *pdt, pdt1;
> 
>     exit (0);
> }
> 
> [yanya@cpt libpcap-0.4]$ gcc ttt_pcap.c -lpcap
> ttt_pcap.c: In function `main':
> ttt_pcap.c:4: storage size of `p1' isn't known
> ttt_pcap.c:5: storage size of `pdt1' isn't known
> [yanya@cpt libpcap-0.4]$
> 
> Are them bugs or my own faults to use the library?

You're using the library incorrectly - don't declare objects of type
"pcap_t" or "pcap_dumper_t", just declare pointers to those types.
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to