MCPcopy
hub / github.com/sshuttle/sshuttle / firewall_command

Method firewall_command

sshuttle/methods/pf.py:486–497  ·  view source on GitHub ↗
(self, line)

Source from the content-addressed store, hash-verified

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"):

Callers 6

test_firewall_commandFunction · 0.45
test_firewall_commandFunction · 0.45
mainFunction · 0.45

Calls 3

query_natMethod · 0.80
writeMethod · 0.80
flushMethod · 0.80

Tested by 5

test_firewall_commandFunction · 0.36
test_firewall_commandFunction · 0.36