Ejemplo n.º 1
0
 /**
  * Returns list of active interfaces.
  *
  * @return array list of active PPTP connections
  * @throws Engine_Exception
  */
 public function get_active_list()
 {
     clearos_profile(__METHOD__, __LINE__);
     $ethlist = array();
     $ethinfolist = array();
     $ifs = new Iface_Manager();
     $ethlist = $ifs->get_interfaces();
     foreach ($ethlist as $eth) {
         if (!preg_match('/^pptp[0-9]/', $eth)) {
             continue;
         }
         $ifdetails = array();
         $if = new Iface($eth);
         // TODO: YAPH - yet another PPPoE hack
         if ($if->is_configured()) {
             continue;
         }
         $address = $if->get_live_ip();
         $remote = $if->get_live_ip();
         $ifinfo = array();
         $ifinfo['name'] = $eth;
         $ifinfo['address'] = $address;
         $ethinfolist[] = $ifinfo;
     }
     return $ethinfolist;
 }