# gunzip libpcap-1.2.0rc1.tar.gz
# tar xf libpcap-1.2.0rc1.tar
# cd libpcap-1.2.0
Configure it for your OS, few files will be generated
# ./configure
#make
#make uninstall
#make distclean
New Installation
#make install
# make tests
# ./findalldevstest
NonBlocktest will start listening to the first network interface device.
# ./nonblocktest
# find /usr -name libpcap.so
/usr/local/lib/libpcap.so
Set LD_LIBRARY_PATH (Jpcap will link this shared object)
# echo LD_LIBRARY_PATH
# LD_LIBRARY_PATH=/usr/local/lib/
# export LD_LIBRARY_PATH
# unzip jpcap-0.6.zip
#cd src/c
#make
# vi Makefile
1. JAVA_DIR = $(JAVA_HOME)
2. JNI_INCLUDE2 = $(JAVA_DIR)/include/solaris
3. PCAP_INCLUDE = /usr/local/include/pcap
4. COMPILE_OPTION = -G
#make
#vi Jpcap.c
3. #define SIOCGIFHWADDR SIOCGIFADDR
# make
Move the shared library to /usr/local/lib
#cp libjpcap.so /usr/local/lib/
#echo $LD_LIBRARY_PATH
#find /usr -name gcc
If it is not installed
#pkg install gcc-3
#PATH=$PATH:/usr/sfw/bin
# find /usr -name make
# PATH=$PATH:/usr/ccs/bin
#echo $PATH and verify if gcc and make path are visible.
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (1)
Author
Commented:In this article which is Part 1 is an installation guide with few exercise. In Part 2 of this article i will discuss Ethernet frame, packet capture/send over Ethernet with examples
Please feel free to ask any questions based on this article or in general issues regarding libpcap/jpcap. I would also appreciate comments by subject area experts in these software.