(family, table, *args)
| 28 | |
| 29 | |
| 30 | def ipt(family, table, *args): |
| 31 | if family == socket.AF_INET6: |
| 32 | argv = ['ip6tables', '-w', '-t', table] + list(args) |
| 33 | elif family == socket.AF_INET: |
| 34 | argv = ['iptables', '-w', '-t', table] + list(args) |
| 35 | else: |
| 36 | raise Exception('Unsupported family "%s"' % family_to_string(family)) |
| 37 | debug1('%s' % ' '.join(argv)) |
| 38 | rv = ssubprocess.call(argv, env=get_env()) |
| 39 | if rv: |
| 40 | raise Fatal('%r returned %d' % (argv, rv)) |
| 41 | |
| 42 | |
| 43 | def nft(family, table, action, *args): |