1 { lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, libpcap, pcre }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
10 rev = "V${lib.replaceStrings ["."] ["_"] version}";
11 sha256 = "1x2fyd7wdqlj1r76ilal06cl2wmbz0ws6i3ys204sbjh1cj6dcl7";
16 url = "https://patch-diff.githubusercontent.com/raw/jpr5/ngrep/pull/11.patch";
17 sha256 = "0k5qzvj8j3r1409qwwvzp7m3clgs2g7hs4q68bhrqbrsvvb2h5dh";
21 nativeBuildInputs = [ autoreconfHook ];
22 buildInputs = [ libpcap pcre ];
27 "--disable-pcap-restart"
28 "--with-pcap-includes=${libpcap}/include"
32 sed -i "s|BPF=.*|BPF=${libpcap}/include/pcap/bpf.h|" configure
36 description = "Network packet analyzer";
38 ngrep strives to provide most of GNU grep's common features, applying
39 them to the network layer. ngrep is a pcap-aware tool that will allow you
40 to specify extended regular or hexadecimal expressions to match against
41 data payloads of packets. It currently recognizes IPv4/6, TCP, UDP,
42 ICMPv4/6, IGMP and Raw across Ethernet, PPP, SLIP, FDDI, Token Ring and
43 null interfaces, and understands BPF filter logic in the same fashion as
44 more common packet sniffing tools, such as tcpdump and snoop.
46 homepage = "https://github.com/jpr5/ngrep/";
48 shortName = "ngrep"; # BSD-style, see README.md and LICENSE
49 url = "https://github.com/jpr5/ngrep/blob/master/LICENSE";
51 redistributable = true;
53 platforms = with platforms; linux ++ darwin;
54 maintainers = [ maintainers.bjornfor ];
55 mainProgram = "ngrep";