generated from nix-community/nur-packages-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wireshark-extcap: wrap wireshark with extcap programs
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This implements an ieee 802.15.4 sniffer in the 2.4ghz band using O-QPSK demod. The main entrypoint implements the wireshark extcap protocol, which will make it appear in the list of interfaces if it's located in its `lib/extpath` folder, or if it's referenced by `WIRESHARK_EXTCAP_DIR`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The default Wireshark only looks for extcap programs within a few specific locations, this creates a wrapper in order to expose specific extcap programs to Wireshark. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ lib | ||
, wireshark | ||
, symlinkJoin | ||
, makeWrapper | ||
, onlyBin | ||
, extCapPackages ? [] | ||
|
||
# Whether to include the extcap binaries provided by this repository | ||
, includeExtCaps ? true | ||
, ieee-802-15-4-sniffer ? null | ||
, ice9-bluetooth-sniffer ? null | ||
}: | ||
|
||
let | ||
extCapDir = symlinkJoin { | ||
name = "wireshark-extcap-dir"; | ||
paths = lib.optionals includeExtCaps [ ieee-802-15-4-sniffer ice9-bluetooth-sniffer ] ++ extCapPackages; | ||
postBuild = '' | ||
# Link the builtin extcap programs because wireshark doesn't look in its own lib directory | ||
# if the env var is set | ||
cp -vs ${wireshark}/lib/wireshark/extcap/* $out/bin | ||
# Some programs might've been wrapped and have a hidden `.orig.wrapped` file that we don't want | ||
# wireshark calling into | ||
rm -f $out/bin/.[!.]* | ||
''; | ||
}; | ||
in | ||
|
||
symlinkJoin { | ||
name = "wireshark-wrapped"; | ||
paths = [ wireshark ]; | ||
nativeBuildInputs = [ makeWrapper ]; | ||
postBuild = '' | ||
for file in $out/bin/*; do | ||
wrapProgram $file --prefix WIRESHARK_EXTCAP_DIR : ${onlyBin extCapDir}/bin | ||
done | ||
''; | ||
meta = wireshark.meta; | ||
} |