From d1f207a2c3388bbbd8a6ff976603e679478533b2 Mon Sep 17 00:00:00 2001 From: Jamie Lenehan Date: Tue, 4 Jul 2006 03:38:21 +0000 Subject: hping2 2.0.0rc3: Added hping2, a network testing tool. Especially useful when testing devices for their handling of various protocols (GRE, IP-IP etc) without needing to resort to an actual working application. --- packages/hping/.mtn2git_empty | 0 packages/hping/files/.mtn2git_empty | 0 packages/hping/files/hping2_configure.patch | 75 +++++++++++++ packages/hping/files/hping2_debian.patch | 168 ++++++++++++++++++++++++++++ packages/hping/hping2_1.9.9+2.0.0rc3.bb | 48 ++++++++ 5 files changed, 291 insertions(+) create mode 100644 packages/hping/.mtn2git_empty create mode 100644 packages/hping/files/.mtn2git_empty create mode 100644 packages/hping/files/hping2_configure.patch create mode 100644 packages/hping/files/hping2_debian.patch create mode 100644 packages/hping/hping2_1.9.9+2.0.0rc3.bb (limited to 'packages/hping') diff --git a/packages/hping/.mtn2git_empty b/packages/hping/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/hping/files/.mtn2git_empty b/packages/hping/files/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/hping/files/hping2_configure.patch b/packages/hping/files/hping2_configure.patch new file mode 100644 index 0000000000..90795ab0e0 --- /dev/null +++ b/packages/hping/files/hping2_configure.patch @@ -0,0 +1,75 @@ +Allow the byteorder and target os type to be specified via +environment variables when running the configured shell script, don't +try and run the resultant binary after building it, don't set various +compiler related environment varibles - we'll let OE set those. + +diff -dur hping2-rc3-orig/configure hping2-rc3/configure +--- hping2-rc3-orig/configure 2005-12-03 19:04:44.000000000 +1100 ++++ hping2-rc3/configure 2005-12-03 19:05:58.000000000 +1100 +@@ -13,16 +13,19 @@ + exit 0 + fi + +-CC=${CC:=cc} ++if [ "x$BYTEORDER" = "x" ]; then ++ CC=${CC:=cc} + +-echo build byteorder.c... +-$CC byteorder.c -o byteorder || exit 1 ++ echo build byteorder.c... ++ $CC byteorder.c -o byteorder || exit 1 ++ ++ BYTEORDER=`./byteorder -m` ++fi + + INSTALL_MANPATH=`echo $MANPATH|cut -f1 -d:` + if [ "$INSTALL_MANPATH" = "" ]; then + INSTALL_MANPATH="/usr/local/man" + fi +-BYTEORDER=`./byteorder -m` + + echo create byteorder.h... + cat > byteorder.h < ++ ++#if __BYTE_ORDER == __LITTLE_ENDIAN + #define BYTE_ORDER_LITTLE_ENDIAN +-#elif defined(__mc68000__) \ +- || defined (__sparc__) \ +- || defined (__sparc) \ +- || defined (__PPC__) \ +- || defined (__BIG_ENDIAN__) \ +- || (defined(__mips__) && (defined(MIPSEB) || defined (__MIPSEB__))) ++#elif __BYTE_ORDER == __BIG_ENDIAN + #define BYTE_ORDER_BIG_ENDIAN + #else + # error can not find the byte order for this architecture, fix bytesex.h +--- hping2-2.rc3.orig/getlhs.c ++++ hping2-2.rc3/getlhs.c +@@ -55,6 +55,12 @@ + case DLT_IEEE802_11: + linkhdr_size = 14; + break; ++ case DLT_IEEE802_11: ++ linkhdr_size = 14; ++ break; ++ case DLT_TOKEN_RING: ++ linkhdr_size = 20; ++ break; + case DLT_ATM_RFC1483: + #ifdef DLT_CIP + case DLT_CIP: +@@ -105,6 +111,15 @@ + } else if ( strstr(ifname, "wlan") ) { + linkhdr_size = WLANHDR_SIZE; + return 0; ++ } else if (strstr(ifname, "atm")) { ++ linkhdr_size = 0; ++ return 0; ++ } else if ( strstr(ifname, "wlan") ) { ++ linkhdr_size = WLANHDR_SIZE; ++ return 0; ++ } else if ( strstr(ifname, "tr") ) { ++ linkhdr_size = TRHDR_SIZE; ++ return 0; + } + else + return -1; +--- hping2-2.rc3.orig/listen.c ++++ hping2-2.rc3/listen.c +@@ -10,6 +10,7 @@ + + #include + #include ++#include + #include + #include + #include +--- hping2-2.rc3.orig/main.c ++++ hping2-2.rc3/main.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + #include "hping2.h" + +--- hping2-2.rc3.orig/resolve.c ++++ hping2-2.rc3/resolve.c +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + #include + #include + #include +--- hping2-2.rc3.orig/sendicmp.c ++++ hping2-2.rc3/sendicmp.c +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + + #include "hping2.h" + #include "globals.h" +--- hping2-2.rc3.orig/sendtcp.c ++++ hping2-2.rc3/sendtcp.c +@@ -15,6 +15,8 @@ + #include + #include + #include ++#include ++#include + + #include "hping2.h" + #include "globals.h" +--- hping2-2.rc3.orig/sendudp.c ++++ hping2-2.rc3/sendudp.c +@@ -15,6 +15,8 @@ + #include + #include + #include ++#include ++#include + + #include "hping2.h" + #include "globals.h" +--- hping2-2.rc3.orig/statistics.c ++++ hping2-2.rc3/statistics.c +@@ -10,6 +10,7 @@ + + #include + #include ++#include + + #include "hping2.h" + #include "globals.h" +@@ -33,7 +34,7 @@ + lossrate = 100; + + fprintf(stderr, "\n--- %s hping statistic ---\n", targetname); +- fprintf(stderr, "%d packets tramitted, %d packets received, " ++ fprintf(stderr, "%d packets transmitted, %d packets received, " + "%d%% packet loss\n", sent_pkt, recv_pkt, lossrate); + if (out_of_sequence_pkt) + fprintf(stderr, "%d out of sequence packets received\n", +--- hping2-2.rc3.orig/usage.c ++++ hping2-2.rc3/usage.c +@@ -12,6 +12,7 @@ + + #include + #include ++#include + + void show_usage(void) + { +--- hping2-2.rc3.orig/version.c ++++ hping2-2.rc3/version.c +@@ -10,6 +10,7 @@ + + #include + #include ++#include + + #include "release.h" + #include "hping2.h" diff --git a/packages/hping/hping2_1.9.9+2.0.0rc3.bb b/packages/hping/hping2_1.9.9+2.0.0rc3.bb new file mode 100644 index 0000000000..912f7c420e --- /dev/null +++ b/packages/hping/hping2_1.9.9+2.0.0rc3.bb @@ -0,0 +1,48 @@ +DESCRIPTION = "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." +HOMEPAGE = "http://www.hping.org/" +SECTION = "console/network" +MAINTAINER = "Jamie Lenehan " +LICENSE = "GPL" +PR = "r0" + +SRC_URI = "http://www.hping.org/hping2.0.0-rc3.tar.gz \ + file://hping2_debian.patch;patch=1 \ + file://hping2_configure.patch;patch=1" +S="${WORKDIR}/hping2-rc3" + +# +# We've patched configure to accept byte order and ostype as env +# variables Pass those values in to stop it trying to figure it out +# by itself. +# NOTE: The configure script is not an autoconf script. +# +do_configure() { + # endianness fun.. inspired by openssl.inc + . ${CONFIG_SITE} + BYTEORDER="UNKNOWN" + if test "x$ac_cv_c_bigendian" = "xyes"; then + BYTEORDER="__BIG_ENDIAN_BITFIELD" + elif test "x$ac_cv_c_littleendian" = "xyes"; then + BYTEORDER="__LITTLE_ENDIAN_BITFIELD" + else + oefatal do_configure cannot determine endianess + fi + BYTEORDER="${BYTEORDER}" CONFIGOSTYPE="LINUX" ./configure +} + +# +# Instead of patching the install we do things manually here +# +do_install() { + install -m 0755 -d ${D}${sbindir} ${D}/${mandir} ${D}${docdir}/hping2 + install -m 0755 hping2 ${D}/${sbindir} + install -m 0644 docs/hping2.8 ${D}/${mandir} + install -m 0644 docs/HPING2-HOWTO.txt docs/HPING2-IS-OPEN \ + docs/MORE-FUN-WITH-IPID docs/SPOOFED_SCAN.txt \ + docs/AS-BACKDOOR docs/APD.txt ${D}${docdir}/hping2 +} -- cgit 1.2.3-korg