Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 7 commits
  • 4 files changed
  • 0 comments
  • 4 contributors
2  lib/radiustar/dictionary/values.rb
@@ -40,4 +40,4 @@ def initialize(name, id)
40 40
41 41 end
42 42
43   -end
  43 +end
2  lib/radiustar/packet.rb
@@ -214,7 +214,7 @@ def decode(value, secret)
214 214 decoded_value = ""
215 215 lastround = @authenticator
216 216 0.step(value.length-1, 16) do |i|
217   - decoded_value = xor_str(value[i, 16], Digest::MD5.digest(secret + lastround))
  217 + decoded_value += xor_str(value[i, 16], Digest::MD5.digest(secret + lastround))
218 218 lastround = value[i, 16]
219 219 end
220 220
11 spec/value_spec.rb
... ... @@ -0,0 +1,11 @@
  1 +require File.join(File.dirname(__FILE__), %w[spec_helper])
  2 +
  3 +describe Radiustar::Value do
  4 + it "should get numeric value of NAS-Port-Type == Ethernet from dictionary.rfc2865" do
  5 + dict = Radiustar::Dictionary.new
  6 + dict.read(File.dirname(__FILE__) + '/../templates/dictionary.rfc2865')
  7 + attribute = dict.find_attribute_by_name 'NAS-Port-Type'
  8 + ethernet_value = attribute.find_values_by_name 'Ethernet'
  9 + ethernet_value.id.should == 15
  10 + end
  11 +end
137 templates/dictionary.rfc2865
... ... @@ -0,0 +1,137 @@
  1 +# -*- text -*-
  2 +#
  3 +# Attributes and values defined in RFC 2865.
  4 +# http://www.ietf.org/rfc/rfc2865.txt
  5 +#
  6 +# $Id$
  7 +#
  8 +ATTRIBUTE User-Name 1 string
  9 +ATTRIBUTE User-Password 2 string encrypt=1
  10 +ATTRIBUTE CHAP-Password 3 octets
  11 +ATTRIBUTE NAS-IP-Address 4 ipaddr
  12 +ATTRIBUTE NAS-Port 5 integer
  13 +ATTRIBUTE Service-Type 6 integer
  14 +ATTRIBUTE Framed-Protocol 7 integer
  15 +ATTRIBUTE Framed-IP-Address 8 ipaddr
  16 +ATTRIBUTE Framed-IP-Netmask 9 ipaddr
  17 +ATTRIBUTE Framed-Routing 10 integer
  18 +ATTRIBUTE Filter-Id 11 string
  19 +ATTRIBUTE Framed-MTU 12 integer
  20 +ATTRIBUTE Framed-Compression 13 integer
  21 +ATTRIBUTE Login-IP-Host 14 ipaddr
  22 +ATTRIBUTE Login-Service 15 integer
  23 +ATTRIBUTE Login-TCP-Port 16 integer
  24 +# Attribute 17 is undefined
  25 +ATTRIBUTE Reply-Message 18 string
  26 +ATTRIBUTE Callback-Number 19 string
  27 +ATTRIBUTE Callback-Id 20 string
  28 +# Attribute 21 is undefined
  29 +ATTRIBUTE Framed-Route 22 string
  30 +ATTRIBUTE Framed-IPX-Network 23 ipaddr
  31 +ATTRIBUTE State 24 octets
  32 +ATTRIBUTE Class 25 octets
  33 +ATTRIBUTE Vendor-Specific 26 octets
  34 +ATTRIBUTE Session-Timeout 27 integer
  35 +ATTRIBUTE Idle-Timeout 28 integer
  36 +ATTRIBUTE Termination-Action 29 integer
  37 +ATTRIBUTE Called-Station-Id 30 string
  38 +ATTRIBUTE Calling-Station-Id 31 string
  39 +ATTRIBUTE NAS-Identifier 32 string
  40 +ATTRIBUTE Proxy-State 33 octets
  41 +ATTRIBUTE Login-LAT-Service 34 string
  42 +ATTRIBUTE Login-LAT-Node 35 string
  43 +ATTRIBUTE Login-LAT-Group 36 octets
  44 +ATTRIBUTE Framed-AppleTalk-Link 37 integer
  45 +ATTRIBUTE Framed-AppleTalk-Network 38 integer
  46 +ATTRIBUTE Framed-AppleTalk-Zone 39 string
  47 +
  48 +ATTRIBUTE CHAP-Challenge 60 octets
  49 +ATTRIBUTE NAS-Port-Type 61 integer
  50 +ATTRIBUTE Port-Limit 62 integer
  51 +ATTRIBUTE Login-LAT-Port 63 string
  52 +
  53 +#
  54 +# Integer Translations
  55 +#
  56 +
  57 +# Service types
  58 +
  59 +VALUE Service-Type Login-User 1
  60 +VALUE Service-Type Framed-User 2
  61 +VALUE Service-Type Callback-Login-User 3
  62 +VALUE Service-Type Callback-Framed-User 4
  63 +VALUE Service-Type Outbound-User 5
  64 +VALUE Service-Type Administrative-User 6
  65 +VALUE Service-Type NAS-Prompt-User 7
  66 +VALUE Service-Type Authenticate-Only 8
  67 +VALUE Service-Type Callback-NAS-Prompt 9
  68 +VALUE Service-Type Call-Check 10
  69 +VALUE Service-Type Callback-Administrative 11
  70 +
  71 +# Framed Protocols
  72 +
  73 +VALUE Framed-Protocol PPP 1
  74 +VALUE Framed-Protocol SLIP 2
  75 +VALUE Framed-Protocol ARAP 3
  76 +VALUE Framed-Protocol Gandalf-SLML 4
  77 +VALUE Framed-Protocol Xylogics-IPX-SLIP 5
  78 +VALUE Framed-Protocol X.75-Synchronous 6
  79 +
  80 +# Framed Routing Values
  81 +
  82 +VALUE Framed-Routing None 0
  83 +VALUE Framed-Routing Broadcast 1
  84 +VALUE Framed-Routing Listen 2
  85 +VALUE Framed-Routing Broadcast-Listen 3
  86 +
  87 +# Framed Compression Types
  88 +
  89 +VALUE Framed-Compression None 0
  90 +VALUE Framed-Compression Van-Jacobson-TCP-IP 1
  91 +VALUE Framed-Compression IPX-Header-Compression 2
  92 +VALUE Framed-Compression Stac-LZS 3
  93 +
  94 +# Login Services
  95 +
  96 +VALUE Login-Service Telnet 0
  97 +VALUE Login-Service Rlogin 1
  98 +VALUE Login-Service TCP-Clear 2
  99 +VALUE Login-Service PortMaster 3
  100 +VALUE Login-Service LAT 4
  101 +VALUE Login-Service X25-PAD 5
  102 +VALUE Login-Service X25-T3POS 6
  103 +VALUE Login-Service TCP-Clear-Quiet 8
  104 +
  105 +# Login-TCP-Port (see /etc/services for more examples)
  106 +
  107 +VALUE Login-TCP-Port Telnet 23
  108 +VALUE Login-TCP-Port Rlogin 513
  109 +VALUE Login-TCP-Port Rsh 514
  110 +
  111 +# Termination Options
  112 +
  113 +VALUE Termination-Action Default 0
  114 +VALUE Termination-Action RADIUS-Request 1
  115 +
  116 +# NAS Port Types
  117 +
  118 +VALUE NAS-Port-Type Async 0
  119 +VALUE NAS-Port-Type Sync 1
  120 +VALUE NAS-Port-Type ISDN 2
  121 +VALUE NAS-Port-Type ISDN-V120 3
  122 +VALUE NAS-Port-Type ISDN-V110 4
  123 +VALUE NAS-Port-Type Virtual 5
  124 +VALUE NAS-Port-Type PIAFS 6
  125 +VALUE NAS-Port-Type HDLC-Clear-Channel 7
  126 +VALUE NAS-Port-Type X.25 8
  127 +VALUE NAS-Port-Type X.75 9
  128 +VALUE NAS-Port-Type G.3-Fax 10
  129 +VALUE NAS-Port-Type SDSL 11
  130 +VALUE NAS-Port-Type ADSL-CAP 12
  131 +VALUE NAS-Port-Type ADSL-DMT 13
  132 +VALUE NAS-Port-Type IDSL 14
  133 +VALUE NAS-Port-Type Ethernet 15
  134 +VALUE NAS-Port-Type xDSL 16
  135 +VALUE NAS-Port-Type Cable 17
  136 +VALUE NAS-Port-Type Wireless-Other 18
  137 +VALUE NAS-Port-Type Wireless-802.11 19

No commit comments for this range

Something went wrong with that request. Please try again.