Beispiel #1
0
 private void destroyPIFs()
 {
     foreach (PIF pif in PIFs)
     {
         if (pif.IsTunnelAccessPIF)
         {
             // A tunnel access PIF is destroyed by destroying its tunnel.
             // (Actually each network will have either all tunnel access PIFs (if
             // it is a CHIN) or all regular PIFs (if it isn't), but we don't use
             // that: we do it PIF-by-PIF).
             foreach (Tunnel tunnel in Connection.ResolveAll(pif.tunnel_access_PIF_of))  // actually there will only ever be one
             {
                 Tunnel.destroy(Session, tunnel.opaque_ref);
             }
         }
         else
         {
             if (!pif.physical)
             {
                 VLAN.destroy(Session, pif.VLAN_master_of);
             }
             else
             {
                 // do we ever destroy physical pifs anyway? not sure this is something we need but here for completeness
                 PIF.forget(Session, pif.opaque_ref);
             }
         }
     }
     PIFs = null;
 }