summaryrefslogtreecommitdiffstats
path: root/sshuttle/methods/pf.py
diff options
context:
space:
mode:
authorvieira <vieira@yubo.be>2017-01-14 19:23:02 +0000
committerBrian May <brian@linuxpenguins.xyz>2017-01-15 19:08:53 +1100
commite8ceccc3d5462ec35d134a5ada544e972a2f8fa9 (patch)
tree11905b5d9c397ebf7fa94f9ced236453d296cbc6 /sshuttle/methods/pf.py
parente39c4afce0cddb07bfa538f5ee972d6283bab96d (diff)
Add support for PfSense
PfSense is based on FreeBSD and its pf is pretty close to the one FreeBSD ships, however some structures have different fields and two offsets had to be fixed.
Diffstat (limited to 'sshuttle/methods/pf.py')
-rw-r--r--sshuttle/methods/pf.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/sshuttle/methods/pf.py b/sshuttle/methods/pf.py
index c77ea5d..5888b47 100644
--- a/sshuttle/methods/pf.py
+++ b/sshuttle/methods/pf.py
@@ -1,5 +1,6 @@
import os
import sys
+import platform
import re
import socket
import struct
@@ -335,10 +336,20 @@ class Darwin(FreeBsd):
return xport.port
+class PfSense(FreeBsd):
+ RULE_ACTION_OFFSET = 3040
+
+ def __init__(self):
+ self.pfioc_rule = c_char * 3112
+ super(PfSense, self).__init__()
+
+
if sys.platform == 'darwin':
pf = Darwin()
elif sys.platform.startswith('openbsd'):
pf = OpenBsd()
+elif platform.version().endswith('pfSense'):
+ pf = PfSense()
else:
pf = FreeBsd()