diff options
author | Ermal Luçi <eri@pfsense.org> | 2013-01-29 12:39:29 -0800 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2013-01-29 12:39:29 -0800 |
commit | fe5f2a3b6687ef715617253459cffb8747e7e6c3 (patch) | |
tree | 256d1dd360b3a5d235241a9f37c1f6ea2c21f3f5 /etc/inc | |
parent | 97e0cb612624cf460e984afeca79cac47e433685 (diff) | |
parent | fa2cd558c25c99ac6ca2214c9cc736837defd2e6 (diff) | |
download | pfsense-fe5f2a3b6687ef715617253459cffb8747e7e6c3.zip pfsense-fe5f2a3b6687ef715617253459cffb8747e7e6c3.tar.gz |
Merge pull request #358 from miken32/hp_bandwidth
support HP RADIUS attributes for bandwidth limits and redirection URLs
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; } } |