From 29a5799fb67388dd39e131b48e02462d604d9bfb Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 15 Feb 2005 19:54:55 +0000 Subject: m0n0wall -> pfSense --- usr/local/captiveportal/radius_accounting.inc | 32 +++++++++++------------ usr/local/captiveportal/radius_authentication.inc | 10 +++---- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'usr/local/captiveportal') diff --git a/usr/local/captiveportal/radius_accounting.inc b/usr/local/captiveportal/radius_accounting.inc index 398af92..5722f86 100644 --- a/usr/local/captiveportal/radius_accounting.inc +++ b/usr/local/captiveportal/radius_accounting.inc @@ -2,20 +2,20 @@ /* radius_accounting.inc part of m0n0wall (http://m0n0.ch/wall) - + Copyright (C) 2004 Dinesh Nair All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE @@ -35,12 +35,12 @@ function RADIUS_ACCOUNTING_START($username,$sessionid,$port_type,$stationid,$ipa exec("/bin/hostname", $nasHostname) ; if(!$nasHostname[0]) - $nasHostname[0] = "m0n0wall" ; + $nasHostname[0] = "pfSense" ; $fd = @fsockopen("udp://$radiusip",$radiusport,$errno,$errstr,3) ; - if(!$fd) + if(!$fd) return 1 ; /* error return */ - + /* set 5 second timeout on socket i/o */ stream_set_timeout($fd, 5) ; @@ -76,7 +76,7 @@ function RADIUS_ACCOUNTING_START($username,$sessionid,$port_type,$stationid,$ipa 40,6,0,0,0,1, // Acct Status Type = Start 45,6,0,0,0,1, // Acct RADIUS Authenticated 44,2+strlen($sessionid),$sessionid, // Acct Session ID - 31,2+strlen($stationid),$stationid, // Calling Station + 31,2+strlen($stationid),$stationid, // Calling Station 30,2+strlen($portalmac),$portalmac, // Called Station 8,6,ip2long($ipaddr) // Framed-IP-Address ); @@ -108,7 +108,7 @@ function RADIUS_ACCOUNTING_START($username,$sessionid,$port_type,$stationid,$ipa } $ret = fwrite($fd,$data) ; - if( !$ret || ($ret != $length) ) + if( !$ret || ($ret != $length) ) return 1; /* error return */ if ($debug) @@ -134,11 +134,11 @@ function RADIUS_ACCOUNTING_STOP($ruleno,$username,$sessionid,$start_time,$port_t exec("/bin/hostname", $nasHostname) ; if(!$nasHostname[0]) - $nasHostname[0] = "m0n0wall" ; + $nasHostname[0] = "pfSense" ; $input_pkts = $input_bytes = $output_pkts = $output_bytes = 0 ; - exec("/sbin/ipfw show {$ruleno}", $ipfw) ; + exec("/sbin/ipfw show {$ruleno}", $ipfw) ; preg_match("/(\d+)\s+(\d+)\s+(\d+)\s+skipto/", $ipfw[0], $matches) ; $output_pkts = $matches[2] ; $output_bytes = $matches[3] ; @@ -149,9 +149,9 @@ function RADIUS_ACCOUNTING_STOP($ruleno,$username,$sessionid,$start_time,$port_t $input_bytes = $matches[3] ; $fd = @fsockopen("udp://$radiusip",$radiusport,$errno,$errstr,3) ; - if(!$fd) + if(!$fd) return 1 ; /* error return */ - + /* set 5 second timeout on socket i/o */ stream_set_timeout($fd, 5) ; @@ -225,10 +225,10 @@ function RADIUS_ACCOUNTING_STOP($ruleno,$username,$sessionid,$start_time,$port_t if($debug) { echo "username is $username with len " . strlen($username) ."\n" ; echo "nasHostname is {$nasHostname[0]} with len " . strlen($nasHostname[0]) ."\n" ; - } + } $ret = fwrite($fd,$data) ; - if( !$ret || ($ret != $length) ) + if( !$ret || ($ret != $length) ) return 1; /* error return */ if ($debug) diff --git a/usr/local/captiveportal/radius_authentication.inc b/usr/local/captiveportal/radius_authentication.inc index 10a2009..5aaa5c7 100644 --- a/usr/local/captiveportal/radius_authentication.inc +++ b/usr/local/captiveportal/radius_authentication.inc @@ -34,12 +34,12 @@ function RADIUS_AUTHENTICATION($username,$password,$port_type,$radiusip,$radiusp exec("/bin/hostname", $nasHostname) ; if(!$nasHostname[0]) - $nasHostname[0] = "m0n0wall" ; + $nasHostname[0] = "pfSense" ; $fd = @fsockopen("udp://$radiusip",$radiusport,$errno,$errstr,3) ; - if(!$fd) + if(!$fd) return 1 ; /* error return */ - + /* set 5 second timeout on socket i/o */ stream_set_timeout($fd, 5) ; @@ -81,10 +81,10 @@ function RADIUS_AUTHENTICATION($username,$password,$port_type,$radiusip,$radiusp echo "username is $username with len " . strlen($username) ."\n" ; echo "encryptedpassword is $encryptedpassword with len " . strlen($encryptedpassword) ."\n" ; echo "nasHostname is {$nasHostname[0]} with len " . strlen($nasHostname[0]) ."\n" ; - } + } $ret = fwrite($fd,$data) ; - if( !$ret || ($ret != $length) ) + if( !$ret || ($ret != $length) ) return 1; /* error return */ if ($debug) -- cgit v1.1