Yep, there are the Net::Radius modules which incorporate methods for building packets for authentication and accounting against a Radius server - I have used these modules fairly extensively under their older namesake, RADIUS::Dictionary and RADIUS::Packet.

An example of usage of these Perl modules can be found in the System RADIUS Client Daemon project on Freshmeat here - From the code base for the next (and long overdue) release for this project ...

#!/usr/bin/perl use Net::Radius::Dictionary; use Net::Radius::Packet (); use Socket; . . . sub build_radius_packet { my (%attribute) = @_; my $packet = Net::Radius::Packet->new($CONFIG->{'dictionary'}); if (defined $packet) { $packet->set_code('Accounting-Request'); $packet->set_identifier(inet_ntoa(inet_aton($CONFIG->{'hostnam +e'}))); $packet->set_authenticator(undef); $packet->set_attr($_, $attribute{$_}) foreach sort keys %attri +bute; $packet->dump if $CONFIG->{'debug'}; } return $packet; } sub send_radius_packet { my ($packet) = @_; my $response; return undef unless socket(SOCK_UDP, PF_INET, SOCK_DGRAM, getproto +byname('udp')); my $data = Net::Radius::Packet::auth_resp($packet->pack, $CONFIG-> +{'secret'}); for (1..$CONFIG->{'retry'}) { send(SOCK_UDP, $data, 0, $remote_addr); sleep 1; vec(my $rbit, fileno(SOCK_UDP), 1) = 1; vec(my $wbit, fileno(SOCK_UDP), 1) = 1; $response = select($rbit, $wbit, ($rbit | $wbit), $CONFIG->{'t +imeout'}); last if $response > 1; } close(SOCK_UDP); return $response; }

 


In reply to Re: Radius Client Module by rob_au
in thread Radius Client Module by amphiplex

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.