NAME

TunTap - Perl extension for Tun/Tap interface

SYNOPSIS

  use TunTap qw/:all/;
  use AnyEvent;
  use AnyEvent::Handle;

  my $fd = tun_alloc("tap0", IFF_NO_PI | IFF_TAP);
  open my $fh, "+<&=", $fd or die $!;

  my $tap_hdl; 
  $tap_hdl = AnyEvent::Handle->new(fh => $fh, 
	  on_error => sub { 
	  	  print "TAP error: $!"; 
		  $_[0]->destroy;
	  },
  );

  AE::cv->wait;

DESCRIPTION

Perl module to open Tun/Tap interface.

EXPORT

None by default.

SEE ALSO

Tun/Tap interface tutorial: http://backreference.org/2010/03/26/tuntap-interface-tutorial/

AUTHOR

Jeff Zhang, <zhang491226@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2016 by Jeff Zhang

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.22.1 or, at your option, any later version of Perl 5 you may have available.