SHA256
1
0
forked from pool/libpcap
OBS User unknown 2007-01-04 16:25:26 +00:00 committed by Git OBS Bridge
commit 3bfaf02efa
10 changed files with 513 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

11
libpcap-0.9.5-config.diff Normal file
View File

@ -0,0 +1,11 @@
--- configure.in
+++ configure.in
@@ -55,7 +55,7 @@
AC_CHECK_FUNCS(vsnprintf snprintf,,
[needsnprintf=yes])
if test $needsnprintf = yes; then
- AC_LIBOBJ(snprintf)
+ AC_LIBOBJ([snprintf])
fi
#

View File

@ -0,0 +1,52 @@
--- pcap-bpf.c
+++ pcap-bpf.c
@@ -558,7 +558,7 @@
fd = open(device, O_RDWR);
if (fd == -1 && errno == EACCES)
fd = open(device, O_RDONLY);
- } while (fd < 0 && errno == EBUSY);
+ } while (fd < 0 && errno == EBUSY && n < 1000);
/*
* XXX better message for all minors used
--- pcap-linux.c
+++ pcap-linux.c
@@ -100,6 +100,7 @@
#include <netinet/in.h>
#include <linux/if_ether.h>
#include <net/if_arp.h>
+#include <sys/poll.h>
/*
* If PF_PACKET is defined, we can use {SOCK_RAW,SOCK_DGRAM}/PF_PACKET
@@ -1011,8 +1012,30 @@
if (can_filter_in_kernel) {
if ((err = set_kernel_filter(handle, &fcode)) == 0)
{
+ char buf[1024];
+ int oldflags;
+ int ret;
+ unsigned int received = 0, rec_len = 0;
+ socklen_t optlen = sizeof(rec_len);
/* Installation succeded - using kernel filter. */
handle->md.use_bpf = 1;
+
+ oldflags = fcntl(handle->fd, F_GETFL, 0);
+ oldflags |= O_NONBLOCK;
+ fcntl(handle->fd, F_SETFL, oldflags);
+ getsockopt(handle->fd, SOL_SOCKET, SO_RCVBUF,
+ (char *)&rec_len, &optlen);
+
+ /* now read all packets received until now */
+ while((ret = read(handle->fd, buf, 1024)) > 0
+ && received < rec_len) {
+ received += ret;
+ }
+
+ if(oldflags > 0) {
+ oldflags &= ~O_NONBLOCK;
+ fcntl(handle->fd, F_SETFL, oldflags);
+ }
}
else if (err == -1) /* Non-fatal error */
{

View File

@ -0,0 +1,34 @@
--- gencode.c
+++ gencode.c
@@ -5244,6 +5244,7 @@
bpf_error("invalid qualifier against IPv6 address");
/* NOTREACHED */
}
+ return NULL;
}
#endif /*INET6*/
@@ -5296,6 +5297,7 @@
}
bpf_error("ethernet address used in non-ether expression");
/* NOTREACHED */
+ return NULL;
}
void
@@ -5725,6 +5727,7 @@
}
bpf_error("too many registers needed to evaluate expression");
/* NOTREACHED */
+ return 0;
}
/*
@@ -6315,6 +6318,7 @@
}
bpf_error("ARCnet address used in non-arc expression");
/* NOTREACHED */
+ return NULL;
}
static struct block *

76
libpcap-0.9.5-shared.diff Normal file
View File

@ -0,0 +1,76 @@
--- Makefile.in
+++ Makefile.in
@@ -37,6 +37,13 @@
srcdir = @srcdir@
VPATH = @srcdir@
+###
+# pcaplib version
+MAJOR = 0
+MINOR = 9.3
+VERSION = $(MAJOR).$(MINOR)
+export MAJOR MINOR VERSION
+
#
# You shouldn't need to edit anything below.
#
@@ -95,31 +102,22 @@
TAGFILES = \
$(SRC) $(HDR) $(TAGHDR)
-CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
+LIBNAME = libpcap.so
+CLEANFILES = $(OBJ) libpcap.a $(LIBNAME)* $(GENSRC) $(GENHDR) lex.yy.c
-all: libpcap.a
+all: libpcap.a libpcap.so
libpcap.a: $(OBJ)
@rm -f $@
ar rc $@ $(OBJ) $(LIBS)
$(RANLIB) $@
-shared: libpcap.$(DYEXT)
-
-#
-# XXX - this works with GNU ld, but won't necessarily work with native
-# ld on, for example, various SVR4-flavored platforms, or Digital UNIX.
-#
libpcap.so: $(OBJ)
@rm -f $@
- ld -shared -o $@.`cat VERSION` $(OBJ)
-
-# the following rule succeeds, but the result is untested.
-libpcap.dylib: $(OBJ)
- rm -f libpcap*.dylib
- $(CC) -dynamiclib -undefined error -o libpcap.`cat VERSION`.dylib $(OBJ) \
- -install_name $(libdir)/libpcap.0.dylib -compatibility_version `cat VERSION` \
- -current_version `cat VERSION`
+ $(CC) -shared -Wl,-soname -Wl,$@.$(MAJOR) -o $@.$(VERSION) $(OBJ)
+ @rm -f $@.$(MAJOR) $@
+ @ln -s $@.$(VERSION) $@.$(MAJOR)
+ @ln -s $@.$(VERSION) $@
scanner.c: $(srcdir)/scanner.l
@@ -173,8 +171,11 @@
install: libpcap.a
[ -d $(DESTDIR)$(libdir) ] || \
(mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
- $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
+ $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/
$(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
+ $(INSTALL_PROGRAM) $(LIBNAME).$(VERSION) $(DESTDIR)$(libdir)/
+ @ln -sf $(LIBNAME).$(VERSION) $(DESTDIR)$(libdir)/$(LIBNAME).$(MAJOR)
+ @ln -sf $(LIBNAME).$(VERSION) $(DESTDIR)$(libdir)/$(LIBNAME)
[ -d $(DESTDIR)$(includedir) ] || \
(mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
$(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h
@@ -196,6 +197,7 @@
uninstall:
rm -f $(DESTDIR)$(libdir)/libpcap.a
+ rm -f $(DESTDIR)$(libdir)/$(LIBNAME)*
rm -f $(DESTDIR)$(includedir)/pcap.h
rm -f $(DESTDIR)$(includedir)/pcap-bpf.h
rm -f $(DESTDIR)$(includedir)/pcap-namedb.h

3
libpcap-0.9.5.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b47593e47816c0195b325a122023b85a4f51af7e42b5481cc4537d260545e2ca
size 349575

153
libpcap.changes Normal file
View File

@ -0,0 +1,153 @@
-------------------------------------------------------------------
Wed Jan 3 15:25:29 CET 2007 - prusnak@suse.cz
- update to 0.9.5
* Support for LAPD frames with vISDN
* Support for ERF on channelized T1/E1 cards via DAG API
* Better failure detection on PacketGetAdapterNames()
* Fixes for MPLS packet generation (link layer)
* OP_PACKET now matches the beginning of the packet, instead of beginning+link-layer
* Fix allocation of buffer for list of link-layer types
* Add support for DLT_JUNIPER_VP
* Don't double-count received packets on Linux systems
-------------------------------------------------------------------
Wed Jan 25 21:37:40 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Mon Jan 9 17:34:05 CET 2006 - mjancar@suse.cz
- update to 0.9.4
-------------------------------------------------------------------
Wed Aug 10 00:31:47 CEST 2005 - kkeil@suse.de
- Reverse the -fno-strict-aliasing work around
-------------------------------------------------------------------
Sun Aug 7 10:47:54 CEST 2005 - aj@suse.de
- Compile with -fno-strict-aliasing to work around compiler bug for now.
-------------------------------------------------------------------
Fri Aug 5 01:02:50 CEST 2005 - ro@suse.de
- do not package all of libdir (debuginfo)
-------------------------------------------------------------------
Tue Aug 2 18:35:42 CEST 2005 - mjancar@suse.cz
- update to 0.9.3
-------------------------------------------------------------------
Tue Apr 12 23:18:22 CEST 2005 - ro@suse.de
- added return value to non-void functions
-------------------------------------------------------------------
Thu Nov 18 01:57:38 CET 2004 - ro@suse.de
- fixed file list
-------------------------------------------------------------------
Tue Aug 24 17:30:55 CEST 2004 - kkeil@suse.de
- add DLT_PPP_WITHDIRECTION from libpcap cvs to handle PPP filters
in a compatible way
Thanks to Hannes Gredler <hannes@juniper.net> for implementing it
-------------------------------------------------------------------
Wed Aug 04 16:45:40 CEST 2004 - postadal@suse.cz
- updated to version 0.8.3
-------------------------------------------------------------------
Mon Feb 09 18:02:42 CET 2004 - postadal@suse.cz
- updated to version 0.8.1
* the include file include/net/bpf.h renamed to include/pcap-bpf
- fixed config (LIBOBJS issue)
-------------------------------------------------------------------
Sat Jan 10 01:27:25 CET 2004 - schwab@suse.de
- Use autoreconf.
-------------------------------------------------------------------
Thu Jul 24 12:55:09 CEST 2003 - postadal@suse.cz
- update to version 0.7.2
* support frame relay
* support for ARPHRD_RAWHDLC
* support eg (Octane/O2xxx/O3xxx Gigabit) devices
* add new reserved DLT types
-------------------------------------------------------------------
Mon May 20 14:39:56 CEST 2002 - postadal@suse.de
- security fix (get spurious packets before kernel filter kicks in)
- update to 0.7.1
* pcap_stats() has been documented as to what its counters mean on
each platform
* Added pcap_findalldevs() call to get list of interfaces in
a MI way
-------------------------------------------------------------------
Wed Mar 13 21:04:35 CET 2002 - postadal@suse.cz
- fixed Makefile.in to created shared library
-------------------------------------------------------------------
Thu Jan 10 10:04:40 CET 2002 - cihlar@suse.cz
- use %{_lib}
-------------------------------------------------------------------
Fri Feb 23 14:15:48 CET 2001 - cihlar@suse.cz
- update to 0.6.2 - it should handle isdn without patch
-------------------------------------------------------------------
Thu Dec 7 13:44:02 CET 2000 - schwab@suse.de
- Compile with -fpic so that it can be included in a shared library.
-------------------------------------------------------------------
Wed Oct 11 09:58:55 CEST 2000 - smid@suse.cz
- new version 0.5.2
-------------------------------------------------------------------
Thu Jun 8 08:26:58 MEST 2000 - cihlar@suse.cz
- Group sorted
-------------------------------------------------------------------
Fri Apr 21 15:41:02 CEST 2000 - smid@suse.cz
- buildroot added
-------------------------------------------------------------------
Thu Mar 2 15:32:37 CET 2000 - uli@suse.de
- moved man page to %{_mandir}
-------------------------------------------------------------------
Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
-------------------------------------------------------------------
Thu Sep 9 12:15:28 CEST 1999 - bs@suse.de
- fixed call of Check at the end of %install section
-------------------------------------------------------------------
Sun Jul 11 14:04:46 MEST 1999 - @suse.de
- new package: libpcap
now an extra package, because many network tools use it (so far
it was included in .srpm packages that needed it, like tcpdump)

160
libpcap.spec Normal file
View File

@ -0,0 +1,160 @@
#
# spec file for package libpcap (Version 0.9.5)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: libpcap
Version: 0.9.5
Release: 1
Autoreqprov: on
Group: System/Libraries
License: BSD License and BSD-like
URL: http://www.tcpdump.org/
Summary: A Library for Network Sniffers
Source: %{name}-%{version}.tar.bz2
Patch: %{name}-%{version}-shared.diff
Patch1: %{name}-%{version}-filter-fix.diff
Patch2: %{name}-%{version}-config.diff
Patch4: %{name}-%{version}-nonvoid.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
libpcap is a library used by packet sniffer programs. It provides an
interface for them to capture and analyze packets from network devices.
This package is only needed if you plan to compile or write such a
program yourself.
Authors:
--------
Bill Fenner <fenner@research.att.com>
Assar Westerlund <assar@sics.se>
Alexei <kuznet@ms2.inr.ac.ru>
Jun-ichiro itojun Hagino <itojun@iijlab.net>
Guy Harris <gharris@flashcom.net>
Torsten Landschoff <t.landschoff@gmx.net>
Michael Richardson <mcr@sandelman.ottawa.on.ca>
Steve McCanne
Craig Leres
Van Jacobson
%prep
%setup -q
%patch
%patch1
%patch2
%patch4
%build
%{suse_update_config -f}
aclocal --force
libtoolize --force
autoconf --force
autoheader --force
CFLAGS="$RPM_OPT_FLAGS -fpic" CXXFLAGS="$RPM_OPT_FLAGS -fpic" \
./configure \
--prefix=%{_prefix} \
--sysconfdir=%{_sysconfdir} \
--libdir=%{_libdir} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
--enable-ipv6
make
%install
make DESTDIR=$RPM_BUILD_ROOT install
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
%doc README* INSTALL.txt CHANGES CREDITS LICENSE TODO doc/*
%doc %{_mandir}/man?/*
%{_libdir}/lib*
%{_includedir}/*
%changelog -n libpcap
* Wed Jan 03 2007 - prusnak@suse.cz
- update to 0.9.5
* Support for LAPD frames with vISDN
* Support for ERF on channelized T1/E1 cards via DAG API
* Better failure detection on PacketGetAdapterNames()
* Fixes for MPLS packet generation (link layer)
* OP_PACKET now matches the beginning of the packet, instead of beginning+link-layer
* Fix allocation of buffer for list of link-layer types
* Add support for DLT_JUNIPER_VP
* Don't double-count received packets on Linux systems
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Mon Jan 09 2006 - mjancar@suse.cz
- update to 0.9.4
* Wed Aug 10 2005 - kkeil@suse.de
- Reverse the -fno-strict-aliasing work around
* Sun Aug 07 2005 - aj@suse.de
- Compile with -fno-strict-aliasing to work around compiler bug for now.
* Fri Aug 05 2005 - ro@suse.de
- do not package all of libdir (debuginfo)
* Tue Aug 02 2005 - mjancar@suse.cz
- update to 0.9.3
* Tue Apr 12 2005 - ro@suse.de
- added return value to non-void functions
* Thu Nov 18 2004 - ro@suse.de
- fixed file list
* Tue Aug 24 2004 - kkeil@suse.de
- add DLT_PPP_WITHDIRECTION from libpcap cvs to handle PPP filters
in a compatible way
Thanks to Hannes Gredler <hannes@juniper.net> for implementing it
* Wed Aug 04 2004 - postadal@suse.cz
- updated to version 0.8.3
* Mon Feb 09 2004 - postadal@suse.cz
- updated to version 0.8.1
* the include file include/net/bpf.h renamed to include/pcap-bpf
- fixed config (LIBOBJS issue)
* Sat Jan 10 2004 - schwab@suse.de
- Use autoreconf.
* Thu Jul 24 2003 - postadal@suse.cz
- update to version 0.7.2
* support frame relay
* support for ARPHRD_RAWHDLC
* support eg (Octane/O2xxx/O3xxx Gigabit) devices
* add new reserved DLT types
* Mon May 20 2002 - postadal@suse.de
- security fix (get spurious packets before kernel filter kicks in)
- update to 0.7.1
* pcap_stats() has been documented as to what its counters mean on
each platform
* Added pcap_findalldevs() call to get list of interfaces in
a MI way
* Wed Mar 13 2002 - postadal@suse.cz
- fixed Makefile.in to created shared library
* Thu Jan 10 2002 - cihlar@suse.cz
- use %%{_lib}
* Fri Feb 23 2001 - cihlar@suse.cz
- update to 0.6.2 - it should handle isdn without patch
* Thu Dec 07 2000 - schwab@suse.de
- Compile with -fpic so that it can be included in a shared library.
* Wed Oct 11 2000 - smid@suse.cz
- new version 0.5.2
* Thu Jun 08 2000 - cihlar@suse.cz
- Group sorted
* Fri Apr 21 2000 - smid@suse.cz
- buildroot added
* Thu Mar 02 2000 - uli@suse.de
- moved man page to %%{_mandir}
* Mon Sep 13 1999 - bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Thu Sep 09 1999 - bs@suse.de
- fixed call of Check at the end of %%install section
* Sun Jul 11 1999 - @suse.de
- new package: libpcap
now an extra package, because many network tools use it (so far
it was included in .srpm packages that needed it, like tcpdump)

0
ready Normal file
View File