コード例 #1
0
 /**
  * @return AppStore|null
  */
 public static function getPredefinedStore()
 {
     if (self::$predefinedStore !== null) {
         return self::$predefinedStore;
     }
     self::$predefinedStore = new AppStore(null);
     self::$predefinedStore->setName('predefined Apps');
     self::$predefinedStore->load_from_predefinedfile();
     return self::$predefinedStore;
 }
コード例 #2
0
 public function display_statistics()
 {
     print "Statistics for VSYS '" . $this->name . "'\n";
     print "- " . $this->securityRules->count() . " security rules\n";
     print "- " . $this->natRules->count() . " nat rules\n";
     print "- " . $this->decryptionRules->count() . " decryption rules\n";
     print "- " . $this->addressStore->countAddresses() . " address objects\n";
     print "- " . $this->addressStore->countAddressGroups() . " address groups\n";
     print "- " . $this->serviceStore->countServices() . " service objects\n";
     print "- " . $this->serviceStore->countServiceGroups() . " service groups\n";
     print "- " . $this->addressStore->countTmpAddresses() . " temporary address objects\n";
     print "- " . $this->serviceStore->countTmpServices() . " temporary service objects\n";
     print "- " . $this->tagStore->count() . " tags. " . $this->tagStore->countUnused() . " unused\n";
     print "- " . $this->zoneStore->count() . " zones.\n";
     print "- " . $this->appStore->count() . " apps.\n";
 }
コード例 #3
0
 public function PanoramaConf()
 {
     $this->tagStore = new TagStore($this);
     $this->tagStore->setName('tagStore');
     $this->zoneStore = new ZoneStore($this);
     $this->zoneStore->setName('zoneStore');
     $this->appStore = AppStore::getPredefinedStore();
     $this->serviceStore = new ServiceStore($this);
     $this->serviceStore->name = 'services';
     $this->addressStore = new AddressStore($this);
     $this->addressStore->name = 'addresses';
     $this->securityRules = new RuleStore($this, 'SecurityRule', true);
     $this->natRules = new RuleStore($this, 'NatRule', true);
     $this->decryptionRules = new RuleStore($this, 'DecryptionRule', true);
     $this->appOverrideRules = new RuleStore($this, 'AppOverrideRule', true);
 }
コード例 #4
0
 /**
  * should only be called from a Rule constructor
  * @ignore
  */
 public function load_from_domxml($xml)
 {
     //print "started to extract '".$this->toString()."' from xml\n";
     $this->xmlroot = $xml;
     $i = 0;
     foreach ($xml->childNodes as $node) {
         if ($node->nodeType != 1) {
             continue;
         }
         if ($i == 0 && strtolower($node->textContent) == 'any') {
             return;
         }
         if (strlen($node->textContent) < 1) {
             derr('this container has members with empty name!', $node);
         }
         $f = $this->parentCentralStore->findOrCreate($node->textContent, $this);
         $this->o[] = $f;
         $i++;
     }
 }
コード例 #5
0
 /**
  * @param PanoramaConf|null $withPanorama
  * @param string|null $serial
  * @param Template|null $fromTemplate
  */
 public function PANConf($withPanorama = null, $serial = null, $fromTemplate = null)
 {
     if (!is_null($withPanorama)) {
         $this->panorama = $withPanorama;
     }
     if (!is_null($serial)) {
         $this->serial = $serial;
     }
     $this->owner = $fromTemplate;
     $this->tagStore = new TagStore($this);
     $this->tagStore->setName('tagStore');
     $this->appStore = AppStore::getPredefinedStore();
     $this->serviceStore = new ServiceStore($this);
     $this->serviceStore->name = 'services';
     if (!is_null($withPanorama)) {
         $this->serviceStore->panoramaShared = $this->panorama->serviceStore;
     }
     $this->addressStore = new AddressStore($this);
     $this->addressStore->name = 'addresses';
     if (!is_null($withPanorama)) {
         $this->addressStore->panoramaShared = $this->panorama->addressStore;
     }
     $this->network = new NetworkPropertiesContainer($this);
 }