summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Beisert <j.beisert@pengutronix.de>2009-03-30 13:45:52 +0000
committerJuergen Beisert <j.beisert@pengutronix.de>2009-03-30 13:45:52 +0000
commit9358c70fe9026a93f1b597383ad21b5f7de53864 (patch)
tree87e540fd937a7f452552a865a1bb07dbf1c14c7b
parent1379dac6f9ab31f3e067f0e99a2480d1b543d14b (diff)
downloadptxdist-9358c70fe9026a93f1b597383ad21b5f7de53864.tar.gz
ptxdist-9358c70fe9026a93f1b597383ad21b5f7de53864.tar.xz
* hping: Added for network measurement
- note: experimental yet git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-trunk@10182 33e552b5-05e3-0310-8538-816dae2090ed
-rw-r--r--patches/hping3-20051105/generic/clean_makefile.diff71
-rw-r--r--patches/hping3-20051105/generic/remove_pcap_header.diff23
-rw-r--r--patches/hping3-20051105/generic/series2
-rw-r--r--rules/hping.in24
-rw-r--r--rules/hping.make104
5 files changed, 224 insertions, 0 deletions
diff --git a/patches/hping3-20051105/generic/clean_makefile.diff b/patches/hping3-20051105/generic/clean_makefile.diff
new file mode 100644
index 000000000..050b756bc
--- /dev/null
+++ b/patches/hping3-20051105/generic/clean_makefile.diff
@@ -0,0 +1,71 @@
+Subject: Don't be smarter than make
+From: Juergen Beisert <jbe@pengutronix.de>
+
+Simplify the makefile and use embedded rules.
+
+Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
+
+---
+ Makefile.in | 27 ++++++++++++---------------
+ 1 file changed, 12 insertions(+), 15 deletions(-)
+
+Index: Makefile.in
+===================================================================
+--- Makefile.in.orig
++++ Makefile.in
+@@ -9,7 +9,7 @@
+ CC= gcc
+ AR=/usr/bin/ar
+ RANLIB=/usr/bin/ranlib
+-CCOPT= -O2 -Wall @PCAP_INCLUDE@ @TCL_INC@ @USE_TCL@
++CFLAGS= -O2 -Wall @PCAP_INCLUDE@ @TCL_INC@ @USE_TCL@
+ DEBUG= -g
+ #uncomment the following if you need libpcap based build under linux
+ #(not raccomanded)
+@@ -50,21 +50,18 @@ libars.a: $(ARSOBJ)
+ $(RANLIB) $@
+
+ hping3: byteorder.h $(OBJ)
+- $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@
++ $(CC) -o hping3 $(LDFLAGS) $(DEBUG) $(OBJ) $(PCAP) $(LDLIBS) @SOLARISLIB@ @TCL_LIB@
+ @echo
+- ./hping3 -v
+- @echo "use \`make strip' to strip hping3 binary"
+- @echo "use \`make install' to install hping3"
++# ./hping3 -v
++# @echo "use \`make strip' to strip hping3 binary"
++# @echo "use \`make install' to install hping3"
+
+ hping3-static: byteorder.h $(OBJ)
+- $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl
++ $(CC) -static -o hping3-static $(LDFLAGS) $(CCOPT) $(DEBUG) $(OBJ) $(PCAP) $(LDLIBS) @SOLARISLIB@ @TCL_LIB@ -ldl
+
+ byteorder.h:
+ ./configure
+
+-.c.o:
+- $(CC) -c $(CCOPT) $(DEBUG) $(COMPILE_TIME) $<
+-
+ clean:
+ rm -rf hping3 *.o libars.a
+
+@@ -72,13 +69,13 @@ distclean:
+ rm -rf hping3 *.o byteorder byteorder.h systype.h Makefile libars.a .depend
+
+ install: hping3
+- cp -f hping3 /usr/sbin/
+- chmod 755 /usr/sbin/hping3
+- ln -s /usr/sbin/hping3 /usr/sbin/hping
+- ln -s /usr/sbin/hping3 /usr/sbin/hping2
++ cp -f hping3 $(DESTDIR)/usr/sbin/
++ chmod 755 $(DESTDIR)/usr/sbin/hping3
++ ln -sf $(DESTDIR)/usr/sbin/hping3 $(DESTDIR)/usr/sbin/hping
++ ln -sf $(DESTDIR)/usr/sbin/hping3 $(DESTDIR)/usr/sbin/hping2
+ @if [ -d ${INSTALL_MANPATH}/man8 ]; then \
+- cp ./docs/hping3.8 ${INSTALL_MANPATH}/man8; \
+- chmod 644 ${INSTALL_MANPATH}/man8/hping3.8; \
++ cp ./docs/hping3.8 $(DESTDIR)/${INSTALL_MANPATH}/man8; \
++ chmod 644 $(DESTDIR)/${INSTALL_MANPATH}/man8/hping3.8; \
+ else \
+ echo "@@@@@@ WARNING @@@@@@"; \
+ echo "Can't install the man page: ${INSTALL_MANPATH}/man8 does not exist"; \
diff --git a/patches/hping3-20051105/generic/remove_pcap_header.diff b/patches/hping3-20051105/generic/remove_pcap_header.diff
new file mode 100644
index 000000000..2a9e75735
--- /dev/null
+++ b/patches/hping3-20051105/generic/remove_pcap_header.diff
@@ -0,0 +1,23 @@
+Subject: The <net/bpf.h> include file does not exist an more
+From: Juergen Beisert <jbe@pengutronix.de>
+
+The <net/bpf.h> include file does not exist an more. Simply removed.
+
+Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
+
+---
+ libpcap_stuff.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+Index: libpcap_stuff.c
+===================================================================
+--- libpcap_stuff.c.orig
++++ libpcap_stuff.c
+@@ -17,7 +17,6 @@
+ #include <stdlib.h>
+ #include <sys/ioctl.h>
+ #include <pcap.h>
+-#include <net/bpf.h>
+
+ #include "globals.h"
+
diff --git a/patches/hping3-20051105/generic/series b/patches/hping3-20051105/generic/series
new file mode 100644
index 000000000..1a6453311
--- /dev/null
+++ b/patches/hping3-20051105/generic/series
@@ -0,0 +1,2 @@
+clean_makefile.diff -p0
+remove_pcap_header.diff -p0
diff --git a/rules/hping.in b/rules/hping.in
new file mode 100644
index 000000000..4745e9f87
--- /dev/null
+++ b/rules/hping.in
@@ -0,0 +1,24 @@
+## SECTION=networking
+config HPING
+ tristate
+ select TCL if HPING_TCL
+ select LIBC_M if HPING_TCL
+ select LIBC_PTHREAD if HPING_TCL
+ select LIBPCAP
+ prompt "hping"
+ help
+ hping is a command-line oriented TCP/IP packet assembler/analyzer.
+ The interface is inspired to the ping(8) unix command, but hping
+ isn't only able to send ICMP echo requests. It supports TCP, UDP,
+ ICMP and RAW-IP protocols, has a traceroute mode, the ability to
+ send files between a covered channel, and many other features.
+
+if HPING
+config HPING_TCL
+ prompt "Add TCL support"
+ depends on BROKEN
+ bool
+ help
+ Add the Tcl scripting engine feature
+
+endif
diff --git a/rules/hping.make b/rules/hping.make
new file mode 100644
index 000000000..48fd201a8
--- /dev/null
+++ b/rules/hping.make
@@ -0,0 +1,104 @@
+# -*-makefile-*-
+# $Id: template-make 9053 2008-11-03 10:58:48Z wsa $
+#
+# Copyright (C) 2009 by Juergen Beisert
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_HPING) += hping
+
+#
+# Paths and names
+#
+HPING_VERSION := 3-20051105
+HPING := hping$(HPING_VERSION)
+HPING_SUFFIX := tar.gz
+HPING_URL := http://www.hping.org/$(HPING).$(HPING_SUFFIX)
+HPING_SOURCE := $(SRCDIR)/$(HPING).$(HPING_SUFFIX)
+HPING_DIR := $(BUILDDIR)/$(HPING)
+
+# ----------------------------------------------------------------------------
+# Get
+# ----------------------------------------------------------------------------
+
+$(HPING_SOURCE):
+ @$(call targetinfo)
+ @$(call get, HPING)
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+HPING_PATH := PATH=$(CROSS_PATH)
+HPING_ENV := $(CROSS_ENV)
+
+#
+# autoconf
+#
+HPING_AUTOCONF := --no-tcl
+
+$(STATEDIR)/hping.prepare:
+ @$(call targetinfo)
+ @$(call clean, $(HPING_DIR)/config.cache)
+ cd $(HPING_DIR) && \
+ $(HPING_PATH) $(HPING_ENV) MANPATH=/usr/man \
+ ./configure $(HPING_AUTOCONF)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/hping.compile:
+ @$(call targetinfo)
+ cd $(HPING_DIR) && $(HPING_PATH) $(MAKE) $(HPING_ENV) $(PARALLELMFLAGS)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/hping.install:
+ @$(call targetinfo)
+ @$(call install, HPING)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/hping.targetinstall:
+ @$(call targetinfo)
+
+ @$(call install_init, hping)
+ @$(call install_fixup, hping,PACKAGE,hping)
+ @$(call install_fixup, hping,PRIORITY,optional)
+ @$(call install_fixup, hping,VERSION,$(HPING_VERSION))
+ @$(call install_fixup, hping,SECTION,base)
+ @$(call install_fixup, hping,AUTHOR,"Juergen Beisert <jbe@pengutronix.de>")
+ @$(call install_fixup, hping,DEPENDS,)
+ @$(call install_fixup, hping,DESCRIPTION,missing)
+
+ @$(call install_copy, hping, 0, 0, 0755, -, /usr/sbin/hping3)
+
+ @$(call install_finish, hping)
+
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+hping_clean:
+ rm -rf $(STATEDIR)/hping.*
+ rm -rf $(PKGDIR)/hping_*
+ rm -rf $(HPING_DIR)
+
+# vim: syntax=make