Skip to content

Commit

Permalink
Add support for redirect action in ADF
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Vyshakh Krishnan authored and GIC-de committed Jun 13, 2023
1 parent d6e9ffc commit dd34c5a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyrad/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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':
Expand Down

0 comments on commit dd34c5a

Please sign in to comment.