| 1 | package Data::Radius; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | our $VERSION = '1.2.9'; | ||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | Data::Radius - module to encode/decode RADIUS messages | ||
| 11 | |||
| 12 | =head1 SYNOPSYS | ||
| 13 | |||
| 14 | use Data::Radius::Constants qw(:all); | ||
| 15 | use Data::Radius::Packet; | ||
| 16 | |||
| 17 | my $dictionary = Data::Radius::Dictionary->load_file('./radius/dictionary'); | ||
| 18 | my $packet = Data::Radius::Packet->new(secret => 'top-secret', dict => $dictionary); | ||
| 19 | |||
| 20 | # build request packet: | ||
| 21 | my ($request, $req_id, $authenticator) = $packet->build( | ||
| 22 | type => ACCESS_REQUEST, | ||
| 23 | av_list => [ | ||
| 24 | { Name => 'User-Name', Value => 'JonSnow'}, | ||
| 25 | { Name => 'User-Password', Value => 'Castle Black' }, | ||
| 26 | { Name => 'Message-Authenticator', Value => '' }, | ||
| 27 | ], | ||
| 28 | ); | ||
| 29 | |||
| 30 | # ... send $request and read $reply binary packets from RADIUS server | ||
| 31 | |||
| 32 | # parse reply packet: | ||
| 33 | my ($reply_type, $reply_id, $reply_authenticator, $av_list) = $packet->parse($reply, $authenticator); | ||
| 34 | |||
| 35 | =head1 SEE ALSO | ||
| 36 | |||
| 37 | L<Data::Radius::Packet> | ||
| 38 | |||
| 39 | =head1 AUTHOR | ||
| 40 | |||
| 41 | Sergey Leschenko <sergle.ua at gmail.com> | ||
| 42 | |||
| 43 | PortaOne Development Team <perl-radius at portaone.com> is the current module's maintainer at CPAN. | ||
| 44 | |||
| 45 | =head1 COPYRIGHT & LICENSE | ||
| 46 | |||
| 47 | Copyright 2016 PortaOne Inc., all rights reserved. | ||
| 48 | |||
| 49 | This program is free software; you can redistribute it and/or modify it | ||
| 50 | under the same terms as Perl itself. | ||
| 51 | |||
| 52 | =cut | ||
| 53 | |||
| 54 | 1; |