/**
  * Import CONNECTIONS
  *@param $p_connections CONNECTIONS code to import
  *@param $p_oPort Port object to connect
  *
  *@return errors string to be alimented if import ko / '' if ok
  **/
 function importConnections($p_connections, $p_oPort)
 {
     global $LANG;
     $this->addLog('Function importConnections().');
     $errors = '';
     if (isset($p_connections->CDP)) {
         $cdp = $p_connections->CDP;
         if ($cdp == 1) {
             $p_oPort->setCDP();
         } else {
             $errors .= $LANG['plugin_fusioninventory']["errors"][22] . ' CONNECTIONS : CDP=' . $cdp . "\n";
         }
     } else {
         $cdp = 0;
     }
     $count = 0;
     foreach ($p_connections->children() as $name => $child) {
         switch ($child->getName()) {
             case 'CDP':
                 // already managed
                 break;
             case 'CONNECTION':
                 $count++;
                 $errors .= $this->importConnection($child, $p_oPort, $cdp);
                 break;
             default:
                 $errors .= $LANG['plugin_fusioninventory']["errors"][22] . ' CONNECTIONS : ' . $child->getName() . "\n";
         }
     }
     if ($p_oPort->getValue('trunk') != 1) {
         if ($count > 1) {
             // MultipleMac
             $p_oPort->setNoTrunk();
             $pfiud = new PluginFusioninventoryUnknownDevice();
             $pfiud->hubNetwork($p_oPort);
         } else {
             if (!$p_oPort->getNoTrunk()) {
                 $p_oPort->setValue('trunk', 0);
             }
         }
         //      } else {
         //         if ($p_oPort->getValue('trunk') == '-1') {
         //            $p_oPort->setValue('trunk', '0');
         //         }
     }
     return $errors;
 }