def netParse(ipstr):
 prefixLen = 0
 if ('/' in ipstr):
  (ip, pf) = ipstr.split('/')
  prefixLen = int(pf)
 else:
  ip = ipstr
  prefixLen = 24
 return (ipParse(ip), prefixLen)

def netParse ( ipstr ) : prefixLen = 0 if ( '/' in ipstr ) : ( ip , pf ) = ipstr . split ( '/' ) prefixLen = int ( pf ) else : ip = ipstr prefixLen = 24 return ( ipParse ( ip ) , prefixLen )
parse an ip network specification .