...
Code Block | ||||
---|---|---|---|---|
| ||||
plugins:
filters:
case_before:
decode_option_82:
tags: post_auth
case:
- when: $request.RAD_REQUEST.DHCP-Relay-Circuit-Id.like?("^0x0006[0-9a-f]{12}$")
then:
'$var.PE-Switch-MAC-Address': $request.RAD_REQUEST.DHCP-Relay-Remote-Id.substring(2).format_mac()
'$var.PE-Switch-Port-Number': $request.RAD_REQUEST.DHCP-Relay-Circuit-Id.substring(-2).to_i(16).to_s()
- when: $request.RAD_REQUEST.DHCP-Relay-Circuit-Id.like?("^0x[0-9a-f]{20}$")
then:
'$var.PE-Switch-MAC-Address': $request.RAD_REQUEST.DHCP-Relay-Remote-Id.substring(2).format_mac()
'$var.PE-Switch-Port-Number': $request.RAD_REQUEST.DHCP-Relay-Circuit-Id.substring(-10, -8).to_i(16).to_s()
- else:
'$var.PE-Switch-IP-Address': $request.RAD_REQUEST.DHCP-Relay-Remote-Id.unhex()
'$var.PE-Switch-Port-Number': $request.RAD_REQUEST.DHCP-Relay-Circuit-Id.unhex().regexp_replace("^.+/(\d+):\d+$", "\\1") |
...
Code Block | ||||
---|---|---|---|---|
| ||||
plugins:
filters:
divide_after:
tags:
- authorize
- service_status_ok
- residential_customer
divide_speed_limits:
factors:
'$response.RAD_REPLY.HARD-Day-In-Speed': 8
'$response.RAD_REPLY.HARD-Day-Out-Speed': 2
'$response.RAD_REPLY.HARD-Night-In-Speed': 4
'$response.RAD_REPLY.HARD-Night-Out-Speed': 2 |
...
Code Block | ||||
---|---|---|---|---|
| ||||
plugins:
filters:
format_after:
combine_rate_and_burst_values:
tags: [authorize, individual_customer]
values:
InRate: '$response.RAD_REPLY.InRate'
OutRate: '$response.RAD_REPLY.OutRate'
destination: '$response.Speed-Limits'
template: 'InRate=#{$InRate};InBurst=#{($InRate.to_i() / 8 * 900).to_i()};OutRate=#{$OutRate};OutBurst=#{($OutRate.to_i() / 8 * 900).to_i()}'
delete_values: true |
...