|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/22697/root/usr/share/system-config-network/netconfpkg/ |
Upload File : |
mò
\Tc @ s\ d k Z d k Z d f d „ ƒ YZ d „ Z e d j o e ƒ n d Z d Z d Z d S( Nt IPCalcc B sA t Z d Z e e d „ Z d „ Z d „ Z d „ Z d „ Z RS( s« A wrapper class that encapsulates the command line
functionality of the ipcalc command, providing access to computing
network prefixes, netmasks, etc. from python.c C s | | _ | | _ | | _ d S( s· Initialize an IPCalc object. Address must be provided, and
in order for most of the other calculations to be possible,
one of prefix or netmask must also be provided.N( t addresst selft _addresst prefixt _prefixt netmaskt _netmask( R R R R ( ( t5 /usr/share/system-config-network/netconfpkg/ipcalc.pyt __init__ s c C s | i o | i Sn• | i p? t i d | i ƒ i ƒ } t i d | ƒ i
ƒ d | _ n t i d | i | i f ƒ i ƒ } t i d | ƒ i
ƒ d | _ | i Sd S( Ns ipcalc -m %ss
NETMASK=(\S+)i s ipcalc -p %s %ss PREFIX=(\d+)( R R R t ost popenR t readt textt ret matcht groups( R R
( ( R R s
#%c C sˆ | i o | i Snp | i p t i d | i ƒ i ƒ } n t i d | i | i f ƒ } t i d | ƒ i
ƒ d | _ | i Sd S( Ns ipcalc -m %ss ipcalc -m %s/%ss
NETMASK=(\S+)i ( R R R R
R R R R
R R R ( R R
( ( R R , s
c C sW | i p | i ƒ n t i d | i | i f ƒ i ƒ } t i d | ƒ i
ƒ d S( Ns ipcalc -n %s/%ss
NETWORK=(\S+)i ( R R R R
R R R R
R R R ( R R
( ( R t network8 s
%c C sW | i p | i ƒ n t i d | i | i f ƒ i ƒ } t i d | ƒ i
ƒ d S( Ns ipcalc -b %s/%ss BROADCAST=(\S+)i ( R R R R
R R R R
R R R ( R R
( ( R t broadcast>