Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
usage [2013-05-14 23:17]
wikiadmin created
usage [2016-09-19 19:50] (current)
wikiadmin [Auto-Topups]
Line 1: Line 1:
 +====== Attribute Usage ======
 +
 Attributes are used in order to process and set configuration items for incoming connections. Each attribute has a Name, Operator and Value. Attributes are used in order to process and set configuration items for incoming connections. Each attribute has a Name, Operator and Value.
  
-====Name====+===== Name ====
 Specify the type of attribute to be used. If you need to specify a vendor attribute, use the following format: Specify the type of attribute to be used. If you need to specify a vendor attribute, use the following format:
-<​code>​[vendor_code:​vendor_attribute_name]</​code>​ 
  
-====Operator====+<​code>​ 
 +[vendor_code:​vendor_attribute_name] 
 +</​code>​ 
 + 
 +===== Operator ====
 How to use the value of this attribute. See the OPERATORS file for details on each supported operator. How to use the value of this attribute. See the OPERATORS file for details on each supported operator.
  
-====Value====+===== Value ====
 Value of the attribute (string). Value of the attribute (string).
  
 Example: Example:
-<​code>//​ Sets the users traffic limit to 5GB 
-Name: SMRadius-Capping-Traffic-Limit Operator: := Value: 5000</​code>​ 
  
-====Non-standard ​core attributes====+<​code>​ 
 +// Sets the users traffic limit to 5GB 
 +Name: SMRadius-Capping-Traffic-Limit Operator: := Value: 5000 
 +</​code>​ 
 + 
 +====== Non-standard ​Core Attributes ====== 
 A listing of non standard attributes and their functions in SMRadius. These attributes are listed under the areas in SMRadius that make use of them. A listing of non standard attributes and their functions in SMRadius. These attributes are listed under the areas in SMRadius that make use of them.
  
-===Capping=== +===== Capping ===== 
-  * __[[mod_feature_capping.pm|SMRadius-Capping-Traffic-Limit]]__ + 
-  * __[[mod_feature_capping.pm|SMRadius-Capping-Uptime-Limit]]__ +  * [[mod_feature_capping.pm|SMRadius-Capping-Traffic-Limit]] 
-  * __[[mod_feature_capping.pm|SMRadius-Config-Capping-Traffic-Multiplier]]__ +  * [[mod_feature_capping.pm|SMRadius-Capping-Uptime-Limit]] 
-  * __[[mod_feature_capping.pm|SMRadius-Config-Capping-Uptime-Multiplier]]__+  * [[mod_feature_capping.pm|SMRadius-Config-Capping-Traffic-Multiplier]] 
 +  * [[mod_feature_capping.pm|SMRadius-Config-Capping-Uptime-Multiplier]] 
 + 
 +===== Auto-Topups ===== 
 + 
 +  * [[mod_feature_capping.pm|SMRadius-AutoTopup-Traffic-Enabled]] 
 +  * [[mod_feature_capping.pm|SMRadius-AutoTopup-Traffic-Amount]] 
 +  * [[mod_feature_capping.pm|SMRadius-AutoTopup-Traffic-Limit]] 
 +  * [[mod_feature_capping.pm|SMRadius-AutoTopup-Traffic-Notify]] 
 +  * [[mod_feature_capping.pm|SMRadius-AutoTopup-Traffic-NotifyTemplate]] 
 +  * [[mod_feature_capping.pm|SMRadius-AutoTopup-Traffic-Threshold]] 
 + 
 +  * [[mod_feature_capping.pm|SMRadius-AutoTopup-Uptime-Enabled]] 
 +  * [[mod_feature_capping.pm|SMRadius-AutoTopup-Uptime-Amount]] 
 +  * [[mod_feature_capping.pm|SMRadius-AutoTopup-Uptime-Limit]] 
 +  * [[mod_feature_capping.pm|SMRadius-AutoTopup-Uptime-Notify]] 
 +  * [[mod_feature_capping.pm|SMRadius-AutoTopup-Uptime-NotifyTemplate]] 
 +  * [[mod_feature_capping.pm|SMRadius-AutoTopup-Uptime-Threshold]] 
 + 
 +===== Validity ==== 
 + 
 +  * [[mod_feature_validity.pm|SMRadius-Validity-ValidFrom]] 
 +  * [[mod_feature_validity.pm|SMRadius-Validity-ValidTo]] 
 +  * [[mod_feature_validity.pm|SMRadius-Validity-ValidWindow]] 
 + 
 + 
 +===== Config ===== 
 + 
 +  * [[mod_config_sql.pm|SMRadius-Config-Secret]] 
 +  * [[mod_config_sql.pm|SMRadius-Config-PODServer]] 
 +  * [[mod_config_sql.pm|SMRadius-Config-Filter-Reply-Attribute]] 
 +  * [[mod_config_sql.pm|SMRadius-Config-Filter-Reply-VAttribute]] 
 + 
 +====== Core ====== 
 + 
 +===== SMRadius-Evaluate ===== 
 +Evaluate and set an attribute / attributes based on the results of the evaluation. Syntax: TEST CASE ? TRUE_ATTRIBUTE : FALSE. 
 + 
 +Lets take a real life example: 
 + 
 +1. For traffic under 80000Mbyte, we set an attribute 
 +<​code>​ 
 +SMRadius-Evaluate ||+= SMRadius_Capping_TotalDataUsage < 80000 ? [14988:​Mikrotik-Rate-Limit] = 1m/4m 1m/6m 1m/5m 10/10 1 
 +</​code>​ 
 + 
 +2. For traffic above 80000Mbyte, but below 130000Mbyte,​ we set the same attribute to something else... 
 +<​code>​ 
 +SMRadius-Evaluate ||+= SMRadius_Capping_TotalDataUsage > 80000 && SMRadius_Capping_TotalDataUsage < 130000 ? [14988:​Mikrotik-Rate-Limit] = 512k/1m 640k/2m 640k/2m 10/10 4 
 +</​code>​ 
 + 
 +3. For traffic above 130000Mbyte,​ we set the traffic to a third different value... 
 +<​code>​ 
 +SMRadius-Evaluate ||+= SMRadius_Capping_TotalDataUsage > 130000 ? [14988:​Mikrotik-Rate-Limit] = 128k/384k 512k/1024k 256k/512k 10/10 8 
 +</​code>​ 
 + 
 +===== SMRadius-Peer-Address ===== 
 + 
 +Allows the admin to specify an address that the peer address must match in order to be authorized. The user / group attribute SMRadius-Peer-Address will be checked against the peer address of the client device. 
 + 
 +<​code>​ 
 +SMRadius-Peer-Address ​ ==  <peer address>​ 
 +</​code>​ 
 + 
 +===== SMRadius-Disable-WebUITopup ===== 
 + 
 +Allows one to build web ui's that ignore topups, this attribute is not used internally. 
 + 
 +===== SMRadius-Username-Transform ===== 
 + 
 +<btn type="​warning"​ size="​xs">​Work in Progress</​btn>​
  
-===Validity=== +Transforms a username from the supplied username to the configured username.
-  * __[[mod_feature_validity.pm|SMRadius-Validity-ValidFrom]]__ +
-  * __[[mod_feature_validity.pm|SMRadius-Validity-ValidTo]]__ +
-  * __[[mod_feature_validity.pm|SMRadius-Validity-ValidWindow]]__+
  
 +<​code>​
 +# Transfrom user@example.net to user@this.example.net
 +SMRadius-Username-Transform ​ :=  example.net=this.example.net
 +</​code>​
  
-===Config=== 
-  * __[[mod_config_sql.pm|SMRadius-Config-Secret]]__ 
-  * __[[mod_config_sql.pm|SMRadius-Config-PODServer]]__ 
-  * __[[mod_config_sql.pm|SMRadius-Config-Filter-Reply-Attribute]]__ 
-  * __[[mod_config_sql.pm|SMRadius-Config-Filter-Reply-VAttribute]]__ 
  
-===Core=== 
-  * __SMRadius-Username-Transform__ 
-    * Transforms a username from the supplied username to the configured username (Currently disabled) 
-    * <​code>#​ Transfrom user@example.net to user@this.example.net 
-SMRadius-Username-Transform ​ :=  example.net=this.example.net</​code>​ 
-  * __SMRadius-Evaluate__ 
-    * Evaluate and set an attribute / attributes based on the results of the evaluation. Syntax: TEST CASE ? TRUE_ATTRIBUTE : FALSE 
-  * __SMRadius-Peer-Address__ 
-    * Allows the admin to specify an address that the peer address must match in order to be authorized. The user / group attribute SMRadius-Peer-Address will be checked against the peer address of the client device. 
-    * <​code>​SMRadius-Peer-Address ​ ==  < peer-address ></​code>​