diff options
Diffstat (limited to 'src/etc/inc/openvpn.auth-user.php')
-rw-r--r-- | src/etc/inc/openvpn.auth-user.php | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/src/etc/inc/openvpn.auth-user.php b/src/etc/inc/openvpn.auth-user.php index 9c6c5ac..54a0fe5 100644 --- a/src/etc/inc/openvpn.auth-user.php +++ b/src/etc/inc/openvpn.auth-user.php @@ -67,17 +67,11 @@ require_once("interfaces.inc"); /** * Get the NAS-Identifier * - * We will use our local hostname to make up the nas_id + * We will return "openVPN" so that connections can be distinguished by the Radius */ if (!function_exists("getNasID")) { function getNasID() { - global $g; - - $nasId = gethostname(); - if (empty($nasId)) { - $nasId = $g['product_name']; - } - return $nasId; + return "openVPN"; } } @@ -96,6 +90,40 @@ function getNasIP() { return $nasIp; } } + +/** + * Set the NAS-Port-Type + * + * Should be "Virtual" since that denotes VPN connections + */ +if (!function_exists("getNasPortType")) { +function getNasPortType() { + return RADIUS_VIRTUAL; +} +} + +/** + * Set the NAS-Port + * + * We will return the port the client connected to + */ +if (!function_exists("getNasPort")) { +function getNasPort() { + return $_GET['nas_port']; +} +} + +/** + * Set the Called-Station-ID + * + * We will return the IP and port the client connected to + */ +if (!function_exists("getCalledStationId")) { +function getCalledStationId() { + return get_interface_ip() . ":" . getNasPort(); +} +} + /* setup syslog logging */ openlog("openvpn", LOG_ODELAY, LOG_AUTH); |