From dd34c5a29b46d83b0bea841e85fd72b79f315b87 Mon Sep 17 00:00:00 2001 From: Vyshakh Krishnan Date: Tue, 13 Jun 2023 14:54:33 +0530 Subject: [PATCH] Add support for redirect action in ADF Ascend data filter supports accept and discard now. To support walled garden use case, there is a requirement to have redirect action which can redirect http traffic --- pyrad/tools.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyrad/tools.py b/pyrad/tools.py index 2e51175..2bb22c1 100644 --- a/pyrad/tools.py +++ b/pyrad/tools.py @@ -65,9 +65,11 @@ def EncodeAscendBinary(str): Example: 'family=ipv4 action=discard direction=in dst=10.10.255.254/32' + Note: redirect(0x20) action is added for http-redirect (walled garden) use case + Type: family ipv4(default) or ipv6 - action discard(default) or accept + action discard(default) or accept or redirect direction in(default) or out src source prefix (default ignore) dst destination prefix (default ignore) @@ -112,6 +114,8 @@ def EncodeAscendBinary(str): terms['dst'] = 16 * b'\x00' elif key == 'action' and value == 'accept': terms[key] = b'\x01' + elif key == 'action' and value == 'redirect': + terms[key] = b'\x20' elif key == 'direction' and value == 'out': terms[key] = b'\x00' elif key == 'src' or key == 'dst':