NAME

Linux::Wireguard - Wireguard in Perl

SYNOPSIS

my @names = Linux::Wireguard::list_device_names();

my %device = map { $_ => Linux::Wireguard::get_device($_) } @names;

DESCRIPTION

Linux::Wireguard provides an interface to Wireguard via the embedded wireguard C library.

FUNCTIONS

@names = list_device_names()

Returns a list of strings.

$dev_hr = get_device( $NAME )

Returns a reference to a hash that describes the $NAME’d device:

$bin = generate_private_key()

Returns a newly-generated private key (raw string).

$bin = generate_public_key( $PRIVATE_KEY )

Takes a private key and returns its public key. (Both raw strings.)

$bin = generate_preshared_key()

Returns a newly-generated preshared key (raw string).

TODO

The interface is incomplete. It would be nice for it to be complete.

LICENSE & COPYRIGHT

Copyright 2022 Gasper Software Consulting. All rights reserved.

Linux::Wireguard is licensed under the same terms as Perl itself (cf. perlartistic); HOWEVER, the embedded C wireguard library has its own copyright terms. Use of Linux::Wireguard may imply acceptance of that embedded C library’s own copyright terms. See wireguard-tools/contrib/embeddable-wg-library/README in this distribution for details.