summaryrefslogtreecommitdiffstats
path: root/isys/isys.py
diff options
context:
space:
mode:
Diffstat (limited to 'isys/isys.py')
-rw-r--r--isys/isys.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/isys/isys.py b/isys/isys.py
index e62713ad0..f62148e85 100644
--- a/isys/isys.py
+++ b/isys/isys.py
@@ -449,13 +449,6 @@ def inet_convertNetmaskToPrefix (netmask):
return prefix
-# Converts IPv4 CIDR prefix to a dotted-quad netmask
-def inet_convertPrefixToNetmask (prefix):
- (m,) = struct.unpack('I',socket.inet_pton(socket.AF_INET,'255.255.255.255'))
- tmp = m >> (32 - int(prefix))
- ret = socket.inet_ntop(socket.AF_INET, struct.pack('i', tmp))
- return ret
-
def getopt(*args):
warnings.warn("isys.getopt is deprecated. Use optparse instead.",
DeprecationWarning, stacklevel=2)
@@ -886,6 +879,9 @@ def getIPAddress(dev):
def resetFileContext(fn, instroot = '/'):
return _isys.resetFileContext(fn, instroot)
+def prefix2netmask(prefix):
+ return _isys.prefix2netmask(prefix)
+
auditDaemon = _isys.auditdaemon
handleSegv = _isys.handleSegv