WGmeta::Wrapper::Show - Class for interfacing `wg show dump` output
use Wireguard::WGmeta::Wrapper::Show; my $wg_show = Wireguard::WGmeta::Wrapper::Show->new(<wg show dump output as string>);
This class provides wrapper-functions around the output of Wireguard::WGmeta::Parser::Show.
use Wireguard::WGmeta::Wrapper::Show; use Wireguard::WGmeta::Wrapper::Bridge; my ($out, $err) = get_wg_show(); my $wg_show = Wireguard::WGmeta::Wrapper::Show->new($out); # get a specific interface section wg_show->get_interface_section('wg0', '<interface_public_key>');
Creates a new instance of the show parser
Parameters
$wg_show_dump Output of the (external) command wg show dump.
$wg_show_dump
wg show dump
Returns
Instance
Returns a list with all available interface names
A list with valid interface names.
Simply checks if data is available for a specific interface. Useful to check if an interface is up.
$interface An interface name
$interface
If yes, returns True else False
Returns a specific section of an interface
$interface A valid interface name, ideally retrieved through "get_interface_list()".
$identifier A valid identifier, if the requested section is a peer this is its public-key, otherwise the interface name again.
$identifier
A hash of the requested section. If non-existent, empty hash.
Returns a sorted list of all peers belonging to given interface
A list of peer public-keys (identifiers), if the interface does not exist -> empty list.
To install Wireguard::WGmeta, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Wireguard::WGmeta
CPAN shell
perl -MCPAN -e shell install Wireguard::WGmeta
For more information on module installation, please visit the detailed CPAN module installation guide.