Sha256: 3922fb1aa06174d9f6af606b0566cbd49c07ed4074962581bfb37df58a639511

Contents?: true

Size: 1.91 KB

Versions: 1

Compression:

Stored size: 1.91 KB

Contents

== RADIUSTAR

Pretend this is ascii art of the "the more you know" star thing
---=====*

by pjdavis
http://github.com/pjdavis/radiustar

== DESCRIPTION:

Ruby Radius Library

== FEATURES

* Import your own radius dictionaries
* Authentication
* Accounting

== SYNOPSIS:

  require 'rubygems'
  require 'radiustar'

  # Load dictionaries from freeradius directory
  # NOTICE: here the Dictionary.new() only accept a parameter of "folder name" but not the dictionary file
  dict = Radiustar::Dictionary.new('/usr/share/freeradius/')

  # Lets get authenticated
  auth_custom_attr = {
    'Framed-Address'  => '127.0.0.1',
    'NAS-Port'        => 0,
    'NAS-Port-Type'   => 'Ethernet'
  }

  req = Radiustar::Request.new('127.0.0.1', { :dict => dict })
  reply = req.authenticate('John Doe', 'hello', 'testing123', auth_custom_attr)

  if reply[:code] == 'Access-Accept'
    req = Radiustar::Request.new('127.0.0.1:1813', { :dict => dict })

    acct_custom_attr = {
      'Framed-Address'  => '127.0.0.1',
      'NAS-Port'        => 0,
      'NAS-Port-Type'   => 'Ethernet',
      'Acct-Session-Time' => 0
    }

    timings = Time.now
    reply = req.accounting_start('John Doe', 'testing123', '123456', acct_custom_attr)

    sleep(rand 5)
    acct_custom_attr['Acct-Session-Time'] = Time.now - timings
    reply = req.accounting_update('John Doe', 'testing123', '123456', acct_custom_attr)

    sleep(rand 5)
    acct_custom_attr['Acct-Session-Time'] = Time.now - timings
    reply = req.accounting_stop('John Doe', 'testing123', '123456', acct_custom_attr)

  end

== REQUIREMENTS:

* Ruby 1.8

== INSTALL:

	gem install radiustar

== Thanks:
Thanks to everyone who has contributed to this project. Without your help and support, this would not have been possible.

* charl
* Mark Bryars
* jamesotron
* dguerri
* gderosa
* mkocher
* bwlang
* cbascom
* Paulche

== LICENSE:

Copyright (c) 2010 [PJ Davis], released under the CC0 1.0 Universal license.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
radiustar-0.0.8 README.rdoc