(self, line)
| 484 | pf.disable(pf_get_anchor(family, port)) |
| 485 | |
| 486 | def firewall_command(self, line): |
| 487 | if line.startswith('QUERY_PF_NAT '): |
| 488 | try: |
| 489 | dst = pf.query_nat(*(line[13:].split(','))) |
| 490 | sys.stdout.write('QUERY_PF_NAT_SUCCESS %s,%r\n' % dst) |
| 491 | except IOError as e: |
| 492 | sys.stdout.write('QUERY_PF_NAT_FAILURE %s\n' % e) |
| 493 | |
| 494 | sys.stdout.flush() |
| 495 | return True |
| 496 | else: |
| 497 | return False |
| 498 | |
| 499 | def is_supported(self): |
| 500 | if which("pfctl"): |