/** * @param bool $yes * @return bool */ public function API_setDestinationIsNegated($yes) { $ret = $this->setDestinationIsNegated($yes); if ($ret) { $con = findConnectorOrDie($this); $con->sendSetRequest($this->getXPath(), '<negate-destination>' . boolYesNo($yes) . '</negate-destination>'); } return $ret; }
/** * @param bool $yes */ public function setBiDirectional($yes) { if (is_string($yes)) { if ($yes == 'yes' || $yes == 'no') { $this->bidir = $yes; } else { derr("This value is not supported: '{$yes}'"); } } else { if ($yes === true || $yes === false) { $this->bidir = boolYesNo($yes); } else { derr("This value is not supported: '{$yes}'"); } } if ($this->snattype != 'static-ip') { derr('You cannot do this on non static NATs'); } $this->rewriteSNAT_XML(); }
} } if (!isset(PH::$args['mergeadjacentonly'])) { print " - No 'mergeAdjacentOnly' argument provided, using default 'no'\n"; $mergeAdjacentOnly = false; } else { if (PH::$args['mergeadjacentonly'] === null || strlen(PH::$args['mergeadjacentonly']) == 0) { $mergeAdjacentOnly = true; } elseif (strtolower(PH::$args['mergeadjacentonly']) == 'yes' || strtolower(PH::$args['mergeadjacentonly']) == 'true' || strtolower(PH::$args['mergeadjacentonly']) == 1) { $mergeAdjacentOnly = true; } elseif (strtolower(PH::$args['mergeadjacentonly']) == 'no' || strtolower(PH::$args['mergeadjacentonly']) == 'false' || strtolower(PH::$args['mergeadjacentonly']) == 0) { $mergeAdjacentOnly = false; } else { display_error_usage_exit("(mergeAdjacentOnly' argument was given unsupported value '" . PH::$args['mergeadjacentonly'] . "'"); } print " - mergeAdjacentOnly = " . boolYesNo($mergeAdjacentOnly) . "\n"; } $hashTable = array(); /** * @param $rule SecurityRule * @param $method * @throws Exception */ function updateRuleHash($rule, $method) { global $hashTable; if (isset($rule->mergeHash)) { if (isset($hashTable[$rule->mergeHash])) { if (isset($hashTable[$rule->mergeHash][$rule->serial])) { unset($hashTable[$rule->mergeHash][$rule->serial]); }