Deployment Guide

Amigopod 3.7 | Deployment Guide Reference | 405
Limit by MAC address, 50 MB download in past 24 hours:
return GetCallingStationTraffic(86400, 'out') > 50000000 && AccessReject()
GetUserTraffic()
GetUserTraffic($from_time, $to_time = null, $in_out = null)
Calculate sum of traffic counters in a time interval. Sessions are summed if they have the same User-Name
attribute as that specified in the RADIUS Access-Request.
See “GetCallingStationTraffic()” for details on how to specify the time interval.
GetIpAddressTraffic()
GetIpAddressTraffic($from_time = null, $to_time = null, $in_out = null)
Calculate sum of traffic counters in a time interval. The IP address used is determined based on the context.
If processing a RADIUS Access-Request, the IP address is determined using the Framed-IP-Address
attribute. If processing a HTTP request, the current client IP address is assumed
(from $_SERVER['REMOTE_ADDR']).
Specifying an empty value for the IP address (such as null, false, or empty string) also causes the current
client IP address to be used.
See “GetTraffic()” for details on how to specify the time interval.
GetCallingStationTime()
GetCallingStationTime($from_time, $to_time = null, $mac_format = null)
Calculate sum of session times in a specified time interval.
Because different NAS equipment can send differently-formatted MAC addresses in the Calling-Station-Id
attribute, the
$mac_format argument may be specified. This should be a sprintf-style format string that
accepts 6 arguments (the octets of the MAC address). The default if not specified is the IEEE 802 standard
format, %02X-%02X-%02X-%02X-%02X-%02X – that is, uppercase hexadecimal with each octet
separated with a hyphen.
The calling station ID is looked up automatically from the RADIUS Access-Request (Calling-Station-ID
attribute).
See “GetTraffic()” for details on how to specify the time interval.
GetUserTime()
GetUserTime($from_time, $to_time = null)
Calculate sum of session times in a specified time interval.
See “GetTraffic()” for details on how to specify the time interval.
GetIpAddressTime()
GetIpAddressTime($from_time = null, $to_time = null)
Calculate sum of session times in a specified time interval. The IP address is looked up automatically from
the RADIUS Access-Request (Framed-IP-Address attribute).
See “GetTraffic()” for details on how to specify the time interval.
See “GetIpAddressTraffic()” for additional details on the
$ip_addr argument.