@ -106,11 +106,15 @@ options:
description :
description :
- TCP flags specification .
- TCP flags specification .
- C ( tcp_flags ) expects a dict with the two keys C ( flags ) and C ( flags_set ) .
- C ( tcp_flags ) expects a dict with the two keys C ( flags ) and C ( flags_set ) .
- The C ( flags ) list is the mask , a list of flags you want to examine .
- The C ( flags_set ) list tells which one ( s ) should be set .
If one of the two values is missing , the - - tcp - flags option will be ignored .
default : { }
default : { }
version_added : " 2.4 "
version_added : " 2.4 "
suboptions :
flags :
description :
- List of flags you want to examine .
flags_set :
description :
- Flags to be set .
match :
match :
description :
description :
- Specifies a match to use , that is , an extension module that tests for
- Specifies a match to use , that is , an extension module that tests for
@ -340,6 +344,19 @@ EXAMPLES = '''
protocol : tcp
protocol : tcp
reject_with : tcp - reset
reject_with : tcp - reset
ip_version : ipv4
ip_version : ipv4
# Set tcp flags
- iptables :
chain : OUTPUT
jump : DROP
protocol : tcp
tcp_flags :
flags : ALL
flags_set :
- ACK
- RST
- SYN
- FIN
'''
'''
import re
import re
@ -518,7 +535,11 @@ def main():
destination = dict ( type = ' str ' ) ,
destination = dict ( type = ' str ' ) ,
to_destination = dict ( type = ' str ' ) ,
to_destination = dict ( type = ' str ' ) ,
match = dict ( type = ' list ' , default = [ ] ) ,
match = dict ( type = ' list ' , default = [ ] ) ,
tcp_flags = dict ( type = ' dict ' , default = { } ) ,
tcp_flags = dict ( type = ' dict ' ,
options = dict (
flags = dict ( type = ' list ' ) ,
flags_set = dict ( type = ' list ' ) )
) ,
jump = dict ( type = ' str ' ) ,
jump = dict ( type = ' str ' ) ,
log_prefix = dict ( type = ' str ' ) ,
log_prefix = dict ( type = ' str ' ) ,
goto = dict ( type = ' str ' ) ,
goto = dict ( type = ' str ' ) ,
@ -605,5 +626,6 @@ def main():
module . exit_json ( * * args )
module . exit_json ( * * args )
if __name__ == ' __main__ ' :
if __name__ == ' __main__ ' :
main ( )
main ( )