Swapping input and output octets
Hi All, One of the NAS in our network is reporting the accounting the wrong way (input and output octets are swapped). I'm trying to fix it by adding a logic similar to below at the start of the accounting section if( request:NAS-IP-Address == "192.168.1.7" && Acct-Status-Type != "Start"){ Temp-Attribute = &Acct-Input-Octets update request { Acct-Input-Octets := &Temp-Attribute Acct-Output-Octets := &Acct-Input-Octets } } I need to use a temporary variable to perform the data swapping. However I couldn't find a documentation of use of temporary variables or any such. Is there a better way to achieve this. How can a variable be used to store a value for a temporary reason without adding it to the request body. Thanks, -- *Anuruddha Premalala (MIEEE)Mobile : +94717213122E-mail : anuruddhapremalal@gmail.com <anuruddhapremalal@gmail.com>web : www.anuruddha.org <http://www.anuruddha.org>Sri Lanka.*
On 13 Jul 2016, at 00:43, Anuruddha Premalal <anuruddhapremalal@gmail.com> wrote:
Hi All,
One of the NAS in our network is reporting the accounting the wrong way (input and output octets are swapped).
I'm trying to fix it by adding a logic similar to below at the start of the accounting section
if( request:NAS-IP-Address == "192.168.1.7" && Acct-Status-Type != "Start"){ Temp-Attribute = &Acct-Input-Octets update request { Acct-Input-Octets := &Temp-Attribute Acct-Output-Octets := &Acct-Input-Octets } }
I need to use a temporary variable to perform the data swapping. However I couldn't find a documentation of use of temporary variables or any such. Is there a better way to achieve this. How can a variable be used to store a value for a temporary reason without adding it to the request body.
Tmp-Integer-0 they're in share/freeradius.dictionary.internal -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
Hi Arran, Thanks a lot. It worked! Following is the code snippet I used. if( request:NAS-IP-Address == "192.168.1.7" && Acct-Status-Type != "Start"){ update request { Tmp-Integer-0 = &Acct-Input-Octets Acct-Input-Octets := &Acct-Output-Octets Acct-Output-Octets := &Tmp-Integer-0 } } Regards, Anuruddha On Wed, Jul 13, 2016 at 10:37 AM, Arran Cudbard-Bell < a.cudbardb@freeradius.org> wrote:
On 13 Jul 2016, at 00:43, Anuruddha Premalal < anuruddhapremalal@gmail.com> wrote:
Hi All,
One of the NAS in our network is reporting the accounting the wrong way (input and output octets are swapped).
I'm trying to fix it by adding a logic similar to below at the start of the accounting section
if( request:NAS-IP-Address == "192.168.1.7" && Acct-Status-Type != "Start"){ Temp-Attribute = &Acct-Input-Octets update request { Acct-Input-Octets := &Temp-Attribute Acct-Output-Octets := &Acct-Input-Octets } }
I need to use a temporary variable to perform the data swapping. However I couldn't find a documentation of use of temporary variables or any such. Is there a better way to achieve this. How can a variable be used to store a value for a temporary reason without adding it to the request body.
Tmp-Integer-0
they're in share/freeradius.dictionary.internal
-Arran
Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- *Anuruddha Premalala (MIEEE)Mobile : +94717213122E-mail : anuruddhapremalal@gmail.com <anuruddhapremalal@gmail.com>web : www.anuruddha.org <http://www.anuruddha.org>Sri Lanka.*
participants (2)
-
Anuruddha Premalal -
Arran Cudbard-Bell