GNU bug report logs - #28964
[PATCH] gnu: Add hping.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Marius Bakke <mbakke@HIDDEN>; Keywords: patch moreinfo; dated Tue, 24 Oct 2017 06:08:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.
Added tag(s) moreinfo. Request was from Leo Famulari <leo@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 28964 <at> debbugs.gnu.org:


Received: (at 28964) by debbugs.gnu.org; 13 Feb 2019 00:09:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 12 19:09:07 2019
Received: from localhost ([127.0.0.1]:45531 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gti6t-0004mS-Ep
	for submit <at> debbugs.gnu.org; Tue, 12 Feb 2019 19:09:07 -0500
Received: from out2-smtp.messagingengine.com ([66.111.4.26]:47737)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leo@HIDDEN>) id 1gti6s-0004lz-75
 for 28964 <at> debbugs.gnu.org; Tue, 12 Feb 2019 19:09:06 -0500
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.nyi.internal (Postfix) with ESMTP id E40A821AEC;
 Tue, 12 Feb 2019 19:09:00 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute4.internal (MEProxy); Tue, 12 Feb 2019 19:09:00 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:in-reply-to; s=mesmtp; bh=++tVm+6zVPJABuVD3Hb4pduI
 H0s9dpTrpkTRbbGWNys=; b=V645TQHedp0dmxNIQed3EvEUmDxNIO8+AjevzLCs
 syiDaxTrsHuhSDzQaqWGKPamExJDj8FdbjnD9MgevarB/V0pDkFei+D9Abf2tWlM
 FOCgZZSNWgK4DSh+L7lcaXRzskC+bs5XKl2CgxWCET6sZua/I4Ao3p537dRdAhwf
 O4o=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=++tVm+
 6zVPJABuVD3Hb4pduIH0s9dpTrpkTRbbGWNys=; b=HiJ31OVb7eOMaIc018hgNZ
 sQA6SnQp5oj4camUEh1PLCia2q+lPVULrEeTJnJxgTZLBnVc+I+7PbRSQwgFzGWg
 +Owh8XFv1YtAywUHKrrpHmZga2JkwjitqOG+pL0ynHCA0OcPC29iHZHoyp+OlBAy
 34CQttIi20Itz/+6I26r0c2BmoOyyGMqR5eMEQkCgKfVZnLlUbkOnDVFPtp6sh/X
 VH4Hvj+G/3pkOsM+hR6jrcYEjrSAfSz3cKKCWTci82VmSGJ993mhEmso3jZ2DjKk
 SHGrTkwp0tyomQdoRNsNCO0ufTS1RZ0zeasxIYshaX2a+Edhk6PtIXRjknpbLLuw
 ==
X-ME-Sender: <xms:HGBjXLz0d5CCz5vqPJKFT39BpDL8xmF7r5vjDZuR_mnLqWgcFb6tug>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtvddgudekucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef
 tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvuffkfh
 ggtggujggfsehgtderredtredvnecuhfhrohhmpefnvghoucfhrghmuhhlrghrihcuoehl
 vghosehfrghmuhhlrghrihdrnhgrmhgvqeenucfkphepjeeirdduvdegrddvtddvrddufe
 ejnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlvghosehfrghmuhhlrghrihdrnhgrmhgv
 necuvehluhhsthgvrhfuihiivgeptd
X-ME-Proxy: <xmx:HGBjXEl1jIpMu5e5aIeblxfJIpgoRzo43l-KMzvrQ6BAgBsKtsUFGQ>
 <xmx:HGBjXHzNo2pzmvo9AFm2sLPPQct7O6JqSk-u1yTc6SvQ9clPz8y5EA>
 <xmx:HGBjXLIladG4c4Hd0sVSQ9sGVN2y4kwRJJ0iyCWfGYBu09OCausd6Q>
 <xmx:HGBjXOeiJAV9Gy2aX9L5OOxVxVPrN9z89SklzbFOVp-yWyyhGx0-3A>
Received: from localhost (c-76-124-202-137.hsd1.pa.comcast.net
 [76.124.202.137])
 by mail.messagingengine.com (Postfix) with ESMTPA id 1E875E462B;
 Tue, 12 Feb 2019 19:09:00 -0500 (EST)
Date: Tue, 12 Feb 2019 19:08:59 -0500
From: Leo Famulari <leo@HIDDEN>
To: Marius Bakke <mbakke@HIDDEN>
Subject: Re: [bug#28964] [PATCH] gnu: Add hping.
Message-ID: <20190213000859.GA2464@HIDDEN>
References: <20171024060636.30232-1-mbakke@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature"; boundary="sm4nu43k4a2Rpi4c"
Content-Disposition: inline
In-Reply-To: <20171024060636.30232-1-mbakke@HIDDEN>
User-Agent: Mutt/1.11.2 (2019-01-07)
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 28964
Cc: 28964 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

What is the status of this patch?

Can we push it? Or close the bug? It's been a little while...

--sm4nu43k4a2Rpi4c
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlxjYBsACgkQJkb6MLrK
fwgHgg/+Lm490Mm9YHrtkwCS0AHDphRaUgFUrajvRJbvmglrx1A8iFPrqGWPS2g7
l1keVAC4tLUjmB7BEDAnZgPw85kob3PAY05IDSXQk/NpT5rVGS8TkG/DtiItfjDc
//lzZJ8PN+nRVWrGQzg5Fn/AMVJKOu2erMVWk8O0aO9mYn83r/u+oFdUMHFYihqZ
E3SC6FnC/c6u1uoXodAmaKkMMN4hfKdVXKoM+3TlasPBK+mkzAU7ZlzaxDPCWF5p
WEtf/B9TdiOrRGrRBbgBrzlZT1xHLNSX/2hGNgTaY47ixpo9AMrLItXL894i0h4s
7gz/NiQv175koQ2hei8YA5wcstkgi6BO0kn/zYqU0EiL7/He7FnqzZM4O+NA1Wxt
U7lukxxFwVgxDeaLS6gWZ/tHKu2YPb8GRofkUuHcrWL0F16AogQ1xRyDDeXEj4Oa
zt4Ujy9fNrXMV9TKMrpwc80+UWad4uC5pvmtPIt2FsbICl4usyZ7ET4nr5d5BIok
Zpq8jVEUpoDfJYOX6STt6ybRRiJGGOvcY4VGCKTrfIYb+xmxUkWGpwj3IAnFOyLt
5yUWsTBjHEOvSrZ3m06X4WH5fy3RyDOYvdEQ3TqHZfI6Qo2FAAB4O+FNsM5C34FT
Y8h0lc3i+6GA7Xd58Y6RfEW89JFU1HqkgdjLhMdoh3Tac0fkhTo=
=UKg3
-----END PGP SIGNATURE-----

--sm4nu43k4a2Rpi4c--




Information forwarded to guix-patches@HIDDEN:
bug#28964; Package guix-patches. Full text available.

Message received at 28964 <at> debbugs.gnu.org:


Received: (at 28964) by debbugs.gnu.org; 24 Oct 2017 14:36:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 24 10:36:46 2017
Received: from localhost ([127.0.0.1]:60001 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1e70Jx-0007xb-R6
	for submit <at> debbugs.gnu.org; Tue, 24 Oct 2017 10:36:46 -0400
Received: from tobias.gr ([51.15.135.5]:53508)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1e70Jv-0007xS-KN
 for 28964 <at> debbugs.gnu.org; Tue, 24 Oct 2017 10:36:44 -0400
Received: by tobias.gr (OpenSMTPD) with ESMTP id 31e9d86a;
 Tue, 24 Oct 2017 14:36:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=tobias.gr; h=subject:to
 :references:from:message-id:date:mime-version:in-reply-to
 :content-type:content-transfer-encoding; s=201706; bh=Fv7KH17QZo
 DzLxhlEdXtat5i8RVRxbxV3Y07N0bwSHQ=; b=0IMqyyk7B0okvyYYANTg8msT/Z
 5TykvILWolLiQdRFYwIdD6H9bX5wRUmfUwnlWrdgx6nfoN5UTvBHcuNmpvIuFeST
 KrpmaoPv5D1Wt0q9kVBaMFsGwg2jJk9mDNH6ywaHtFmBkkd15ZklwAJX/wGqPsfa
 jtI0ofz64oY5FCW/Fbt0X8lVhteCvBe8P/Y2g+WshuTB1CJNzgdqvHex/7BKtOwz
 fBWJkLbysNtUWoqgWGUIHxjRoCex+KfgU/PPJNidhldzOSOBVv6NCmgIMOB8DsWD
 bj/oR5nTWkK+NvDecB/o0sGIrABsPlwdkPlNrHRV3ofaLw/c3Y9wZMTwN9tA==
Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 490eab1e
 (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128:NO); 
 Tue, 24 Oct 2017 14:36:39 +0000 (UTC)
Subject: Re: [bug#28964] [PATCH] gnu: Add hping.
To: mbakke@HIDDEN, 28964 <at> debbugs.gnu.org
References: <20171024060636.30232-1-mbakke@HIDDEN>
From: Tobias Geerinckx-Rice <me@HIDDEN>
Message-ID: <a53350b1-1742-dfcc-3c1c-827e53246dff@HIDDEN>
Date: Tue, 24 Oct 2017 16:39:00 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.4.0
MIME-Version: 1.0
In-Reply-To: <20171024060636.30232-1-mbakke@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Language: en-GB
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 28964
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Marius,

Marius Bakke wrote on 24/10/17 at 08:06:
> * gnu/packages/networking.scm (hping): New public variable.

Nice. I like stuff that sends random packets and breaks things.

> diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
> index a6c104297..4c1771459 100644
> --- a/gnu/packages/networking.scm
> +++ b/gnu/packages/networking.scm
> @@ -563,6 +566,70 @@ send out a ping packet and move on to the next target in a round-robin
>  fashion.")
>      (license license:expat)))
>  
> +(define-public hping
> +  (let ((commit "3547c7691742c6eaa31f8402e0ccbb81387c1b99")
> +        (revision "0"))
> +    (package
> +      (name "hping")
> +      (version (string-append "3.0.0-" revision "-" (string-take commit 7)))
> +      (source (origin
> +                (method git-fetch)
> +                (uri (git-reference
> +                      (url "https://github.com/antirez/hping")
> +                      (commit commit)))
> +                (file-name (string-append name "-" version "-checkout"))
> +                (sha256
> +                 (base32
> +                  "0y0n1ybij3yg9lfgzcwfmjz1sjg913zcqrv391xx83dm0j80sdpb"))))
> +      (build-system gnu-build-system)
> +      (arguments
> +       `(#:phases
> +         (modify-phases %standard-phases
> +           (add-before 'configure 'prepare-build
> +             (lambda* (#:key inputs #:allow-other-keys)
> +               (let ((tcl (assoc-ref inputs "tcl")))
> +                 ;; Search for bpf.h in the right place.
> +                 (substitute* '("libpcap_stuff.c" "script.c")
> +                   (("<net/bpf\\.h>") "<pcap/bpf.h>"))
> +                 ;; Likewise for TCL.
> +                 (substitute* "configure"
> +                   (("/usr/include/tcl.h")
> +                    (string-append tcl "/include/tcl.h"))
> +                   (("ls -1 /usr/local/lib")
> +                    (string-append "ls -1 " tcl "/lib")))
> +                 ;; Required environment variables.
> +                 (setenv "CC" "gcc")
> +                 (setenv "TCLSH" (which "tclsh"))
> +                 #t)))
> +           (add-before 'install 'pre-install
> +             (lambda* (#:key outputs #:allow-other-keys)
> +               (let* ((out (assoc-ref outputs "out"))
> +                      (sbin (string-append out "/sbin"))
> +                      (man (string-append out "/share/man")))
> +                 (mkdir-p sbin)
> +                 (mkdir-p (string-append man "/man8"))
> +                 (substitute* "Makefile"
> +                   (("/usr/sbin") sbin)
> +                   (("\\$\\{INSTALL_MANPATH\\}") man))

Adding (setenv "MANPATH" man) to 'prepare-build also works, and is
cleaner. There's no $SBINPATH, unfortunately.

> +                 ;; Fix references to wrong executable name.
> +                 (substitute* "docs/hping3.8"
> +                   (("hping2") "hping3")
> +                   (("HPING2") "HPING3"))

Erk. I'm sending a quick PR upstream just for that. Simple substitution
isn't ideal: there are references to things like ‘HPING2-HOWTO’ and
‘editing hping2.h’ which — though dubious — shouldn't be changed.

- A question: that HPING2-HOWTO (sic: ‘this HOWTO is not completed and
in some points very silly’) is mentioned several times in the man page
but not installed. Any strong opinions?

- A side note: this package installs ‘hping3’ (the tool), with both
‘hping’ and ‘hping2’ as symlinks. There are no such symlinks to the man
page: users must type ‘man hping3’. I've added it to that PR[0].

> +                 #t))))
> +         #:tests? #f))                  ;no tests
> +      (inputs
> +       `(("libpcap" ,libpcap)
> +         ("tcl" ,tcl)))
> +      (home-page "http://www.hping.org/")
> +      (synopsis "Network testing tool")

is a tad (too) short. We should at least mention its purpose "to send
(almost) arbitrary packets".

> +      (description
> +       "hping is a command-line oriented TCP/IP packet assembler/analyzer.

I don't see the nuance of ‘oriented’, and suggest dropping it. And hping
sends more than TCP/IP.

> +The interface is inspired by the @command{ping(8)} command, but hping isn't
> +only able to send ICMP echo requests.  It supports TCP, UDP, ICMP and RAW-IP

‘raw IP’.

> +protocols, has a traceroute mode, the ability to send files between a covered
> +channel, and many other features.")

A misspelling of ‘covert channel’?

WDYTO:

  "hping is a command-line IP packet assembler and analyzer.
  While its interface is inspired by the @command{ping(8)} command,
hping does
  more than just send ICMP echo requests.  It supports the TCP, UDP,
ICMP, and
  raw IP protocols, has a traceroute mode, the ability to send files
over a covert
  channel, and many other features."

> +      (license license:gpl2))))         ;strlcpy.c is BSD-3

There's also display_ipopt.c, which looks like BSD-4.

Kind regards,

T G-R

[0]: https://github.com/antirez/hping/pull/32




Information forwarded to guix-patches@HIDDEN:
bug#28964; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 24 Oct 2017 06:07:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 24 02:07:05 2017
Received: from localhost ([127.0.0.1]:58328 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1e6sMc-0006jq-UB
	for submit <at> debbugs.gnu.org; Tue, 24 Oct 2017 02:07:05 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52060)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mbakke@HIDDEN>) id 1e6sMa-0006jd-FJ
 for submit <at> debbugs.gnu.org; Tue, 24 Oct 2017 02:06:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <mbakke@HIDDEN>) id 1e6sMT-0003QP-TG
 for submit <at> debbugs.gnu.org; Tue, 24 Oct 2017 02:06:51 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:56985)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <mbakke@HIDDEN>) id 1e6sMT-0003QH-Pu
 for submit <at> debbugs.gnu.org; Tue, 24 Oct 2017 02:06:49 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43012)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <mbakke@HIDDEN>) id 1e6sMS-0001cR-2O
 for guix-patches@HIDDEN; Tue, 24 Oct 2017 02:06:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <mbakke@HIDDEN>) id 1e6sMO-0003O8-S0
 for guix-patches@HIDDEN; Tue, 24 Oct 2017 02:06:48 -0400
Received: from out4-smtp.messagingengine.com ([66.111.4.28]:34591)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <mbakke@HIDDEN>) id 1e6sMO-0003O2-Ng
 for guix-patches@HIDDEN; Tue, 24 Oct 2017 02:06:44 -0400
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.nyi.internal (Postfix) with ESMTP id D2ABE20DF6;
 Tue, 24 Oct 2017 02:06:43 -0400 (EDT)
Received: from frontend2 ([10.202.2.161])
 by compute5.internal (MEProxy); Tue, 24 Oct 2017 02:06:43 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h=
 cc:content-transfer-encoding:content-type:date:from:message-id
 :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=
 fm1; bh=bdXC6rTq95E8BHO1xVxdo6y+s8Pj3ZMhkulmsS5M8mQ=; b=ZZyU+CVq
 10fsmpgNk9u49NRrdsWEYiyQ6jBLhMJPcvTcqr6LR8sR0tb3Ud9pIZ9lZRjI0M9q
 mC/SMWuQhpGcrLouvjKb3KtwZUYQy34Ox4jYmuMy6ST7qPsVcy+bJGZo4L6WqOpD
 xh09LV7DqUnOwP8RP6YgrJSfK2HcBepbqWRjOLboPsutQW8YGzs681j3jny4HcBI
 s2ikwMh+k+etT3zFtkYpEyyBj+HfH82mToX2oHkN16SYque4naG3ZJtjT970h8i9
 6i8cfK+fnlNSP8yh0TEYAdndOq1Hpzw5BE8e1bjSgd4ioWu+cZHrOfUfCjM+oShS
 cDhbtDBYdqv7rg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:message-id:mime-version:subject:to:x-me-sender
 :x-me-sender:x-sasl-enc; s=fm1; bh=bdXC6rTq95E8BHO1xVxdo6y+s8Pj3
 ZMhkulmsS5M8mQ=; b=oNASRFXJGkLnNI++AjLDjxNqbSnPIXgX2C51XwAfB9TUO
 fXn4ljtjfIGkq4qYF8dh0aW9WYUK8Na8+3zyRwTxPcEchVewc26+CQ7po7BPqinY
 Yhc5w1A+BqezhrQVbHhEHz1yibK75ACDUVwF5JPMAoUhHYhS0mA//yHVU6sBNVvy
 sjdXpxg7rYx8U0FbejKb7h4I7XlAwkrvW+gK8hqvs5Ysp6G1jMxdaT6xGmtKIqcD
 vfitvUd2FnHsBZ9iRe8QiGm5lKLtYpYko76I7APUyqkEBuJ6ydYX6mHBH130EOfC
 +s0jlZ+1INIcN8OhOKON4V+DSwqjVNd9rztIsbiXw==
X-ME-Sender: <xms:c9juWehVxmdg2KIrccBdv_N3cVRGoIQvJ5OLAFQnaWZzq19MG-ZI5w>
Received: from localhost (cm-84.214.173.174.getinternet.no [84.214.173.174])
 by mail.messagingengine.com (Postfix) with ESMTPA id 5A05924407;
 Tue, 24 Oct 2017 02:06:43 -0400 (EDT)
From: Marius Bakke <mbakke@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] gnu: Add hping.
Date: Tue, 24 Oct 2017 08:06:36 +0200
Message-Id: <20171024060636.30232-1-mbakke@HIDDEN>
X-Mailer: git-send-email 2.14.3
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.4 (----)
X-Debbugs-Envelope-To: submit
Cc: Marius Bakke <mbakke@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.7 (/)

* gnu/packages/networking.scm (hping): New public variable.
---
 gnu/packages/networking.scm | 67 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)

diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index a6c104297..4c1771459 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2017 Rutger Helling <rhelling@HIDDEN>
 ;;; Copyright © 2017 Gábor Boskovits <boskovits@HIDDEN>
 ;;; Copyright © 2017 Thomas Danckaert <post@HIDDEN>
+;;; Copyright © 2017 Marius Bakke <mbakke@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,6 +39,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
@@ -75,6 +77,7 @@
   #:use-module (gnu packages qt)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages ssh)
+  #:use-module (gnu packages tcl)
   #:use-module (gnu packages textutils)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages valgrind)
@@ -563,6 +566,70 @@ send out a ping packet and move on to the next target in a round-robin
 fashion.")
     (license license:expat)))
 
+(define-public hping
+  (let ((commit "3547c7691742c6eaa31f8402e0ccbb81387c1b99")
+        (revision "0"))
+    (package
+      (name "hping")
+      (version (string-append "3.0.0-" revision "-" (string-take commit 7)))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/antirez/hping")
+                      (commit commit)))
+                (file-name (string-append name "-" version "-checkout"))
+                (sha256
+                 (base32
+                  "0y0n1ybij3yg9lfgzcwfmjz1sjg913zcqrv391xx83dm0j80sdpb"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           (add-before 'configure 'prepare-build
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let ((tcl (assoc-ref inputs "tcl")))
+                 ;; Search for bpf.h in the right place.
+                 (substitute* '("libpcap_stuff.c" "script.c")
+                   (("<net/bpf\\.h>") "<pcap/bpf.h>"))
+                 ;; Likewise for TCL.
+                 (substitute* "configure"
+                   (("/usr/include/tcl.h")
+                    (string-append tcl "/include/tcl.h"))
+                   (("ls -1 /usr/local/lib")
+                    (string-append "ls -1 " tcl "/lib")))
+                 ;; Required environment variables.
+                 (setenv "CC" "gcc")
+                 (setenv "TCLSH" (which "tclsh"))
+                 #t)))
+           (add-before 'install 'pre-install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (sbin (string-append out "/sbin"))
+                      (man (string-append out "/share/man")))
+                 (mkdir-p sbin)
+                 (mkdir-p (string-append man "/man8"))
+                 (substitute* "Makefile"
+                   (("/usr/sbin") sbin)
+                   (("\\$\\{INSTALL_MANPATH\\}") man))
+                 ;; Fix references to wrong executable name.
+                 (substitute* "docs/hping3.8"
+                   (("hping2") "hping3")
+                   (("HPING2") "HPING3"))
+                 #t))))
+         #:tests? #f))                  ;no tests
+      (inputs
+       `(("libpcap" ,libpcap)
+         ("tcl" ,tcl)))
+      (home-page "http://www.hping.org/")
+      (synopsis "Network testing tool")
+      (description
+       "hping is a command-line oriented TCP/IP packet assembler/analyzer.
+The interface is inspired by the @command{ping(8)} 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.")
+      (license license:gpl2))))         ;strlcpy.c is BSD-3
+
 (define-public httping
   (package
     (name "httping")
-- 
2.14.3





Acknowledgement sent to Marius Bakke <mbakke@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#28964; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 13 Feb 2019 00:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.