[Plugins-writers] using libpcap in C plugin

From: Jingyu Dong (jdong@private)
Date: Tue Aug 09 2005 - 08:56:46 PDT


Hello,

 

I wrote a C plugin which used libpcap APIs. To compile it, I copy a
makefile from an existing C plugin and change a little on it. 

 

My problems are:

 

1.	When executing 'make', it complained that 'struct pcap_if' not
found. It should be defined in 'pcap.h'. I looked around and found that
the head file included in library-nessus is really missing this
structure from original head file. So I copied this file from system
include directory, and the compile passed. So, is the libpcap included
with nessus an old version?
2.	When launched this .nes file, nessus daemon prompted in the log
file that it can' find ref for function pcap_next_ex. So I changed the
makefile - nessus.tmpl from "-lpcap-nessus" to "-lpcap". Then the plugin
can be launched as normal. But when I run the plugin, it caused
segmentation fault in the function call "pcap_next_ex". Finally, I
changed this function to "pcap_next" and everything works fine now. So
where's the problem?

 

Any suggestion would be appreciated! Thanks!!

 

Jingyu




_______________________________________________
Plugins-writers mailing list
Plugins-writers@private
http://mail.nessus.org/mailman/listinfo/plugins-writers



This archive was generated by hypermail 2.1.3 : Tue Aug 09 2005 - 09:10:00 PDT