def netstat():
 if (__grains__['kernel'] == 'Linux'):
  return _netstat_linux()
 elif (__grains__['kernel'] in ('OpenBSD', 'FreeBSD', 'NetBSD')):
  return _netstat_bsd()
 elif (__grains__['kernel'] == 'SunOS'):
  return _netstat_sunos()
 raise CommandExecutionError('Not yet supported on this platform')

def netstat ( ) : if ( __grains__ [ 'kernel' ] == 'Linux' ) : return _netstat_linux ( ) elif ( __grains__ [ 'kernel' ] in ( 'OpenBSD' , 'FreeBSD' , 'NetBSD' ) ) : return _netstat_bsd ( ) elif ( __grains__ [ 'kernel' ] == 'SunOS' ) : return _netstat_sunos ( ) raise CommandExecutionError ( 'Not yet supported on this platform' )
return information on open ports and states .