diff options
author | Michael Newton <miken32@gmail.com> | 2013-01-29 12:11:55 -0800 |
---|---|---|
committer | Michael Newton <miken32@gmail.com> | 2013-01-29 12:11:55 -0800 |
commit | fa2cd558c25c99ac6ca2214c9cc736837defd2e6 (patch) | |
tree | 0a3025be904ee0ccdff3c7d5080b3c8b9188d6df /etc/inc | |
parent | cc6052f00d7042a47fcc69f97f2bc8175ce33468 (diff) | |
download | pfsense-fa2cd558c25c99ac6ca2214c9cc736837defd2e6.zip pfsense-fa2cd558c25c99ac6ca2214c9cc736837defd2e6.tar.gz |
support HP RADIUS attributes for bandwidth, url, data quotas
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/radius.inc | 137 |
1 files changed, 83 insertions, 54 deletions
diff --git a/etc/inc/radius.inc b/etc/inc/radius.inc index 6059b73..6aa6cfe 100644 --- a/etc/inc/radius.inc +++ b/etc/inc/radius.inc @@ -553,7 +553,7 @@ class Auth_RADIUS extends PEAR { } } - if ($vendor == 1584) { + elseif ($vendor == 1584) { switch ($attrv) { case 102: @@ -562,7 +562,7 @@ class Auth_RADIUS extends PEAR { } } - if ($vendor == 3309) { /* RADIUS_VENDOR_NOMADIX */ + elseif ($vendor == 3309) { /* RADIUS_VENDOR_NOMADIX */ switch ($attrv) { case 1: /* RADIUS_NOMADIX_BW_UP */ @@ -589,61 +589,90 @@ class Auth_RADIUS extends PEAR { } } - if ($vendor == 14122) { /* RADIUS_VENDOR_WISPr Wi-Fi Alliance */ - - switch ($attrv) { - case 1: /* WISPr-Location-ID */ - $this->attributes['location_id'] = radius_cvt_string($datav); - break; - case 2: /* WISPr-Location-Name */ - $this->attributes['location_name'] = radius_cvt_string($datav); - break; - case 3: /* WISPr-Logoff-URL */ - $this->attributes['url_logoff'] = radius_cvt_string($datav); - break; - case 4: /* WISPr-Redirection-URL */ - $this->attributes['url_redirection'] = radius_cvt_string($datav); - break; - case 5: /* WISPr-Bandwidth-Min-Up */ - $this->attributes['bw_up_min'] = radius_cvt_int($datav); - break; - case 6: /* WISPr-Bandwidth-Min-Down */ - $this->attributes['bw_down_min'] = radius_cvt_int($datav); - break; - case 7: /* WISPr-Bandwidth-Max-Up */ - $this->attributes['bw_up'] = radius_cvt_int($datav); - break; - case 8: /* WISPr-Bandwidth-Max-Down */ - $this->attributes['bw_down'] = radius_cvt_int($datav); - break; - case 9: /* WISPr-Session-Terminate-Time */ - $this->attributes['session_terminate_time'] = radius_cvt_string($datav); - break; - case 10: /* WISPr-Session-Terminate-End-Of-Day */ - $this->attributes['session_terminate_endofday'] = radius_cvt_int($datav); - break; - case 11: /* WISPr-Billing-Class-Of-Service */ - $this->attributes['billing_class_of_service'] = radius_cvt_string($datav); - break; - } - } - - if ($vendor == 14559) { /* RADIUS_VENDOR_ChilliSpot */ - switch ($attrv) { - case 4: /* ChilliSpot-Bandwidth-Max-Up */ - $this->attributes['bw_up'] = radius_cvt_int($datav); - break; - case 5: /* ChilliSpot-Bandwidth-Max-Down */ - $this->attributes['bw_down'] = radius_cvt_int($datav); - break; - } - } + elseif ($vendor == 14122) { /* RADIUS_VENDOR_WISPr Wi-Fi Alliance */ + + switch ($attrv) { + case 1: /* WISPr-Location-ID */ + $this->attributes['location_id'] = radius_cvt_string($datav); + break; + case 2: /* WISPr-Location-Name */ + $this->attributes['location_name'] = radius_cvt_string($datav); + break; + case 3: /* WISPr-Logoff-URL */ + $this->attributes['url_logoff'] = radius_cvt_string($datav); + break; + case 4: /* WISPr-Redirection-URL */ + $this->attributes['url_redirection'] = radius_cvt_string($datav); + break; + case 5: /* WISPr-Bandwidth-Min-Up */ + $this->attributes['bw_up_min'] = radius_cvt_int($datav); + break; + case 6: /* WISPr-Bandwidth-Min-Down */ + $this->attributes['bw_down_min'] = radius_cvt_int($datav); + break; + case 7: /* WISPr-Bandwidth-Max-Up */ + $this->attributes['bw_up'] = radius_cvt_int($datav); + break; + case 8: /* WISPr-Bandwidth-Max-Down */ + $this->attributes['bw_down'] = radius_cvt_int($datav); + break; + case 9: /* WISPr-Session-Terminate-Time */ + $this->attributes['session_terminate_time'] = radius_cvt_string($datav); + break; + case 10: /* WISPr-Session-Terminate-End-Of-Day */ + $this->attributes['session_terminate_endofday'] = radius_cvt_int($datav); + break; + case 11: /* WISPr-Billing-Class-Of-Service */ + $this->attributes['billing_class_of_service'] = radius_cvt_string($datav); + break; + } + } + + elseif ($vendor == 14559) { /* RADIUS_VENDOR_ChilliSpot */ + switch ($attrv) { + case 4: /* ChilliSpot-Bandwidth-Max-Up */ + $this->attributes['bw_up'] = radius_cvt_int($datav); + break; + case 5: /* ChilliSpot-Bandwidth-Max-Down */ + $this->attributes['bw_down'] = radius_cvt_int($datav); + break; + } + } + + elseif ($vendor == 8744) { /* Colubris / HP MSM wireless */ + //documented at http://bizsupport1.austin.hp.com/bc/docs/support/SupportManual/c02704528/c02704528.pdf pg 15-67 + if ($attrv == 0) { /* Colubris AV-Pair */ + $datav = explode('=', $datav); + switch ($datav[0]) { + case 'max-input-rate': + // "Controls the data rate [kbps] at which traffic can be transferred from the user to the [router]." + $this->attributes['bw_up'] = radius_cvt_int($datav[1]); + break; + case 'max-output-rate': + //"Controls the data rate [kbps] at which traffic can be transferred from the [router] to the user." + $this->attributes['bw_down'] = radius_cvt_int($datav[1]); + break; + case 'max-input-octets': + $this->attributes['maxbytesup'] = radius_cvt_int($datav[1]); + break; + case 'max-output-octets': + $this->attributes['maxbytesdown'] = radius_cvt_int($datav[1]); + break; + case 'welcome-url': + $this->attributes['url_redirection'] = radius_cvt_string($datav[1]); + break; + case 'goodbye-url': + $this->attributes['url_logoff'] = radius_cvt_string($datav[1]); + break; + } + } + } break; - case 85: /* Acct-Interim-Interval: RFC 2869 */ - $this->attributes['interim_interval'] = radius_cvt_int($datav); - break; + case 85: /* Acct-Interim-Interval: RFC 2869 */ + $this->attributes['interim_interval'] = radius_cvt_int($datav); + break; } } |