Permalink
Browse files

initial commit

  • Loading branch information...
1 parent 90cc0ba commit b2f17b276dc42d9907dae21240a1e33781836fb8 @shadowbq shadowbq committed Feb 4, 2010
Showing with 881 additions and 40 deletions.
  1. +459 −20 LICENSE
  2. +128 −0 Makefile
  3. +9 −15 README.rdoc
  4. +3 −3 Rakefile
  5. +1 −0 VERSION
  6. +4 −0 lib/extconf.rb
  7. +246 −0 lib/pcaprub.c
  8. +5 −0 lib/pcaprub.rb
  9. +24 −0 mkmf.log
  10. +2 −2 test/test_pcaprub.rb
View
479 LICENSE

Large diffs are not rendered by default.

Oops, something went wrong.
View
128 Makefile
@@ -0,0 +1,128 @@
+
+SHELL = /bin/sh
+
+#### Start of system configuration section. ####
+
+srcdir = /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake
+topdir = /usr/local/lib/ruby/1.8/i386-freebsd8
+hdrdir = $(topdir)
+VPATH = $(srcdir):$(topdir):$(hdrdir)
+exec_prefix = $(prefix)
+prefix = $(DESTDIR)/usr/local
+sharedstatedir = $(prefix)/com
+mandir = $(DESTDIR)/usr/local/man
+psdir = $(docdir)
+oldincludedir = $(DESTDIR)/usr/include
+localedir = $(datarootdir)/locale
+bindir = $(exec_prefix)/bin
+libexecdir = $(exec_prefix)/libexec
+sitedir = $(libdir)/ruby/site_ruby
+htmldir = $(docdir)
+vendorarchdir = $(vendorlibdir)/$(sitearch)
+includedir = $(prefix)/include
+infodir = $(DESTDIR)/usr/local/info
+vendorlibdir = $(vendordir)/$(ruby_version)
+sysconfdir = $(prefix)/etc
+libdir = $(exec_prefix)/lib
+sbindir = $(exec_prefix)/sbin
+rubylibdir = $(libdir)/ruby/$(ruby_version)
+docdir = $(datarootdir)/doc/$(PACKAGE)
+dvidir = $(docdir)
+vendordir = $(libdir)/ruby/vendor_ruby
+datarootdir = $(prefix)/share
+pdfdir = $(docdir)
+archdir = $(rubylibdir)/$(arch)
+sitearchdir = $(sitelibdir)/$(sitearch)
+datadir = $(datarootdir)
+localstatedir = $(prefix)/var
+sitelibdir = $(sitedir)/$(ruby_version)
+
+CC = cc
+LIBRUBY = $(LIBRUBY_SO)
+LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
+LIBRUBYARG_SHARED = -Wl,-R -Wl,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)
+LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
+
+RUBY_EXTCONF_H =
+CFLAGS = -fPIC -O2 -pipe -fno-strict-aliasing -fPIC $(cflags)
+INCFLAGS = -I. -I. -I/usr/local/lib/ruby/1.8/i386-freebsd8 -I/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake
+DEFS =
+CPPFLAGS =
+CXXFLAGS = $(CFLAGS)
+ldflags = -L. -rdynamic
+dldflags = -Wl,-soname,$(.TARGET)
+archflag =
+DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
+LDSHARED = cc -shared
+AR = ar
+EXEEXT =
+
+RUBY_INSTALL_NAME = ruby18
+RUBY_SO_NAME = ruby18
+arch = i386-freebsd8
+sitearch = i386-freebsd8
+ruby_version = 1.8
+ruby = /usr/local/bin/ruby18
+RUBY = $(ruby)
+RM = rm -f
+MAKEDIRS = mkdir -p
+INSTALL = /usr/bin/install -c -o root -g wheel
+INSTALL_PROG = $(INSTALL) -m 0755
+INSTALL_DATA = install -o root -g wheel -m 444
+COPY = cp
+
+#### End of system configuration section. ####
+
+preload =
+
+libpath = . $(libdir)
+LIBPATH = -L. -L$(libdir) -Wl,-R$(libdir)
+DEFFILE =
+
+CLEANFILES = mkmf.log
+DISTCLEANFILES =
+
+extout =
+extout_prefix =
+target_prefix =
+LOCAL_LIBS =
+LIBS = $(LIBRUBYARG_SHARED) -lpcap -lrt -lcrypt -lm -rpath=/usr/lib:/usr/local/lib -pthread
+SRCS =
+OBJS =
+TARGET =
+DLLIB =
+EXTSTATIC =
+STATIC_LIB =
+
+BINDIR = $(bindir)
+RUBYCOMMONDIR = $(sitedir)$(target_prefix)
+RUBYLIBDIR = $(sitelibdir)$(target_prefix)
+RUBYARCHDIR = $(sitearchdir)$(target_prefix)
+
+TARGET_SO = $(DLLIB)
+CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map
+CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
+
+all: Makefile
+static: $(STATIC_LIB)
+
+clean:
+ @-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
+
+distclean: clean
+ @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
+ @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
+
+realclean: distclean
+install: install-so install-rb
+
+install-so: Makefile
+install-rb: pre-install-rb install-rb-default
+install-rb-default: pre-install-rb-default
+pre-install-rb: Makefile
+pre-install-rb-default: Makefile
+
+site-install: site-install-so site-install-rb install
+site-install-so: install-so
+site-install-rb: install-rb
+
View
@@ -1,17 +1,11 @@
= pcaprub
-Description goes here.
-
-== Note on Patches/Pull Requests
-
-* Fork the project.
-* Make your feature addition or bug fix.
-* Add tests for it. This is important so I don't break it in a
- future version unintentionally.
-* Commit, do not mess with rakefile, version, or history.
- (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
-* Send me a pull request. Bonus points for topic branches.
-
-== Copyright
-
-Copyright (c) 2010 shadowbq. See LICENSE for details.
+This goal of this project is to provide a consistent interface to LBL's libpcap
+packet capture library. This project was created because the currently
+available ruby-pcap library is poorly designed and has been unmaintained since
+2000. This does not provide packet processing functionality, it simply provides
+the interface for capturing packets. For packet processing capability, see the
+PacketRub project (http://packetrub.rubyforge.org).
+
+Requirements:
+ libpcap - http://www.tcpdump.org
View
@@ -5,12 +5,12 @@ begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "pcaprub"
- gem.summary = %Q{libpcap bindings for ruby}
- gem.description = %Q{TODO: longer description of your gem}
+ gem.summary = "libpcap bindings for ruby"
+ gem.description = "libpcap bindings for ruby"
gem.email = "shadowbq@gmail.com"
gem.homepage = "http://github.com/shadowbq/pcaprub"
gem.authors = ["shadowbq"]
- gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
+ gem.extensions = ["lib/extconf.rb"]
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
Jeweler::GemcutterTasks.new
View
@@ -0,0 +1 @@
+0.6.0
View
@@ -0,0 +1,4 @@
+require 'mkmf'
+
+have_library("pcap", "pcap_open_live")
+create_makefile("pcaprub")
Oops, something went wrong.

0 comments on commit b2f17b2

Please sign in to comment.