WatchGuardXMLFile
in package
Class WatchGuardXMLFile
Table of Contents
Properties
- $allAliases : array<string|int, mixed>
- array for all aliases from this xmlfile
- $allNats : array<string|int, mixed>
- array for all nats from this xmlfile
- $allPolicies : array<string|int, mixed>
- array for all policies from this xmlfile
- $allServices : array<string|int, mixed>
- array for all services from this xmlfile
- $allTags : array<string|int, mixed>
- array for all tags from this xmlfile
- $allTunnels : array<string|int, mixed>
- array for all tunnels from this xmlfile
- $jsonoutput : array<string|int, mixed>
- array for outputbuffering, used to create json object
- $output : array<string|int, mixed>
- array for outputbuffering
- $policyActionFilter : string
- string for filter-action (deny/allow)
- $policyExcludeNameFilter : array<string|int, mixed>
- array for filter-exclude-name
- $policyExcludeTypeFilter : array<string|int, mixed>
- array for filter-exclude-type
- $policyFromFilter : array<string|int, mixed>
- array for filter-from
- $policyNameFilter : array<string|int, mixed>
- array for filter-name
- $policyTagFilter : array<string|int, mixed>
- array for filter-tag
- $policyToFilter : array<string|int, mixed>
- array for filter-to
- $policyTypeFilter : array<string|int, mixed>
- array for filter-type
- $typePortFilter : array<string|int, mixed>
- array for filter-port
- $xmlfile : SimpleXMLElement
- base object containing the loaded xml structure and all methods
Methods
- __construct() : mixed
- WatchGuardXMLFile constructor.
- findAliasRefByPolicy() : mixed
- stores policy references to alias objects
- findAliasReferences() : mixed
- finds alias references and stores the reference at the object.
- findPolicyAction() : mixed
- finds policy action
- findServiceRefByPolicy() : mixed
- stores policy references to services
- findTagRefByPolicy() : mixed
- stores policy references to tags
- getAliasCount() : mixed
- getJsonOutput() : array<string|int, mixed>
- getOutput() : array<string|int, mixed>
- getPolicyExcludeNameFilter() : array<string|int, mixed>
- getPolicyExcludeTypeFilter() : array<string|int, mixed>
- getPolicyFromFilter() : array<string|int, mixed>
- getPolicyNameFilter() : array<string|int, mixed>
- getPolicyTagFilter() : array<string|int, mixed>
- getPolicyToFilter() : array<string|int, mixed>
- getPolicyTypeFilter() : array<string|int, mixed>
- getTypePortFilter() : array<string|int, mixed>
- listAllAliases() : mixed
- lists (all) aliases in this xmlfile
- listAllNats() : mixed
- lists (all) nats in this xmlfile
- listAllPolicies() : mixed
- lists (all) policies in this xmlfile
- listAllServices() : mixed
- lists (all) services in this xmlfile
- listAllTags() : mixed
- lists (all) tags in this xmlfile
- listAllTunnels() : mixed
- lists (all) tunnels in this xmlfile
- prepareAllAliases() : mixed
- prepare (all) aliases in this xmlfile
- prepareAllPolicies() : mixed
- lists (all) policies in this xmlfile
- printAlias() : mixed
- prints one single alias
- printInfo() : mixed
- printJsonOutput() : void
- printWarnings() : mixed
- resolveAliasAddress() : string
- resolves aliases for printing out the details
- setPolicyActionFilter() : mixed
- setPolicyExcludeNameFilter() : mixed
- setPolicyExcludeTypeFilter() : mixed
- setPolicyFromFilter() : mixed
- setPolicyNameFilter() : mixed
- setPolicyTagFilter() : mixed
- setPolicyToFilter() : mixed
- setPolicyTypeFilter() : mixed
- setTypePortFilter() : mixed
- getAliasByName() : mixed
- returns ONE alias
- getAllAliases() : mixed
- reads all aliases from xml and sets the pointer into allAliases array
- getAllNats() : mixed
- reads all nats from xml and sets the pointer into nats array
- getAllPolicies() : mixed
- reads all policies from xml and sets the pointer into allPolicies array
- getAllServices() : mixed
- reads all services from xml and sets the pointer into allServices array
- getAllTags() : mixed
- reads all tags from xml and sets the pointer into allTags array
- getAllTunnels() : mixed
- reads all tunnels from xml and sets the pointer into allTunels array
- getXMLObject() : SimpleXMLElement|null
- searchs an xml object by name and returns the found simpleXMLElement
Properties
$allAliases
array for all aliases from this xmlfile
private
array<string|int, mixed>
$allAliases
$allNats
array for all nats from this xmlfile
private
array<string|int, mixed>
$allNats
$allPolicies
array for all policies from this xmlfile
private
array<string|int, mixed>
$allPolicies
$allServices
array for all services from this xmlfile
private
array<string|int, mixed>
$allServices
$allTags
array for all tags from this xmlfile
private
array<string|int, mixed>
$allTags
$allTunnels
array for all tunnels from this xmlfile
private
array<string|int, mixed>
$allTunnels
$jsonoutput
array for outputbuffering, used to create json object
private
array<string|int, mixed>
$jsonoutput
= []
$output
array for outputbuffering
private
array<string|int, mixed>
$output
= []
$policyActionFilter
string for filter-action (deny/allow)
private
string
$policyActionFilter
$policyExcludeNameFilter
array for filter-exclude-name
private
array<string|int, mixed>
$policyExcludeNameFilter
$policyExcludeTypeFilter
array for filter-exclude-type
private
array<string|int, mixed>
$policyExcludeTypeFilter
$policyFromFilter
array for filter-from
private
array<string|int, mixed>
$policyFromFilter
$policyNameFilter
array for filter-name
private
array<string|int, mixed>
$policyNameFilter
$policyTagFilter
array for filter-tag
private
array<string|int, mixed>
$policyTagFilter
$policyToFilter
array for filter-to
private
array<string|int, mixed>
$policyToFilter
$policyTypeFilter
array for filter-type
private
array<string|int, mixed>
$policyTypeFilter
$typePortFilter
array for filter-port
private
array<string|int, mixed>
$typePortFilter
$xmlfile
base object containing the loaded xml structure and all methods
private
SimpleXMLElement
$xmlfile
Methods
__construct()
WatchGuardXMLFile constructor.
public
__construct(mixed $xmlfilename) : mixed
loads the xmlfile, initializes all aliases, policies and services.
Parameters
- $xmlfilename : mixed
findAliasRefByPolicy()
stores policy references to alias objects
public
findAliasRefByPolicy() : mixed
findAliasReferences()
finds alias references and stores the reference at the object.
public
findAliasReferences() : mixed
or at least tries to. could be more sophisticated, but this is a quick start with hitting feels like about 98%
findPolicyAction()
finds policy action
public
findPolicyAction(mixed $policyName) : mixed
actions are stored in
Parameters
- $policyName : mixed
findServiceRefByPolicy()
stores policy references to services
public
findServiceRefByPolicy() : mixed
findTagRefByPolicy()
stores policy references to tags
public
findTagRefByPolicy() : mixed
tags are not stored in
getAliasCount()
public
getAliasCount() : mixed
getJsonOutput()
public
getJsonOutput() : array<string|int, mixed>
Return values
array<string|int, mixed>getOutput()
public
getOutput() : array<string|int, mixed>
Return values
array<string|int, mixed>getPolicyExcludeNameFilter()
public
getPolicyExcludeNameFilter() : array<string|int, mixed>
Return values
array<string|int, mixed>getPolicyExcludeTypeFilter()
public
getPolicyExcludeTypeFilter() : array<string|int, mixed>
Return values
array<string|int, mixed>getPolicyFromFilter()
public
getPolicyFromFilter() : array<string|int, mixed>
Return values
array<string|int, mixed>getPolicyNameFilter()
public
getPolicyNameFilter() : array<string|int, mixed>
Return values
array<string|int, mixed>getPolicyTagFilter()
public
getPolicyTagFilter() : array<string|int, mixed>
Return values
array<string|int, mixed>getPolicyToFilter()
public
getPolicyToFilter() : array<string|int, mixed>
Return values
array<string|int, mixed>getPolicyTypeFilter()
public
getPolicyTypeFilter() : array<string|int, mixed>
Return values
array<string|int, mixed>getTypePortFilter()
public
getTypePortFilter() : array<string|int, mixed>
Return values
array<string|int, mixed>listAllAliases()
lists (all) aliases in this xmlfile
public
listAllAliases() : mixed
listAllNats()
lists (all) nats in this xmlfile
public
listAllNats() : mixed
listAllPolicies()
lists (all) policies in this xmlfile
public
listAllPolicies([mixed $index = 'policies' ]) : mixed
Parameters
- $index : mixed = 'policies'
listAllServices()
lists (all) services in this xmlfile
public
listAllServices() : mixed
listAllTags()
lists (all) tags in this xmlfile
public
listAllTags() : mixed
listAllTunnels()
lists (all) tunnels in this xmlfile
public
listAllTunnels() : mixed
prepareAllAliases()
prepare (all) aliases in this xmlfile
public
prepareAllAliases(mixed $index[, mixed $name = "" ]) : mixed
Parameters
- $index : mixed
- $name : mixed = ""
prepareAllPolicies()
lists (all) policies in this xmlfile
public
prepareAllPolicies(mixed $index[, mixed $name = '' ]) : mixed
Parameters
- $index : mixed
- $name : mixed = ''
printAlias()
prints one single alias
public
printAlias(mixed $aliasname) : mixed
Parameters
- $aliasname : mixed
printInfo()
public
printInfo([mixed $format = "text" ]) : mixed
Parameters
- $format : mixed = "text"
printJsonOutput()
public
printJsonOutput(mixed $options) : void
Parameters
- $options : mixed
printWarnings()
public
printWarnings() : mixed
resolveAliasAddress()
resolves aliases for printing out the details
public
resolveAliasAddress(mixed $searchstring) : string
currently supports addresses and networks (addr/mask). and partly things like interfaces.
Parameters
- $searchstring : mixed
Return values
stringsetPolicyActionFilter()
public
setPolicyActionFilter(string $policyActionFilter) : mixed
Parameters
- $policyActionFilter : string
setPolicyExcludeNameFilter()
public
setPolicyExcludeNameFilter(array<string|int, mixed> $policyExcludeNameFilter) : mixed
Parameters
- $policyExcludeNameFilter : array<string|int, mixed>
setPolicyExcludeTypeFilter()
public
setPolicyExcludeTypeFilter(array<string|int, mixed> $policyExcludeTypeFilter) : mixed
Parameters
- $policyExcludeTypeFilter : array<string|int, mixed>
setPolicyFromFilter()
public
setPolicyFromFilter(array<string|int, mixed> $policyFromFilter) : mixed
Parameters
- $policyFromFilter : array<string|int, mixed>
setPolicyNameFilter()
public
setPolicyNameFilter(array<string|int, mixed> $policyNameFilter) : mixed
Parameters
- $policyNameFilter : array<string|int, mixed>
setPolicyTagFilter()
public
setPolicyTagFilter(array<string|int, mixed> $policyTagFilter) : mixed
Parameters
- $policyTagFilter : array<string|int, mixed>
setPolicyToFilter()
public
setPolicyToFilter(array<string|int, mixed> $policyToFilter) : mixed
Parameters
- $policyToFilter : array<string|int, mixed>
setPolicyTypeFilter()
public
setPolicyTypeFilter(array<string|int, mixed> $policyTypeFilter) : mixed
Parameters
- $policyTypeFilter : array<string|int, mixed>
setTypePortFilter()
public
setTypePortFilter(array<string|int, mixed> $typePortFilter) : mixed
Parameters
- $typePortFilter : array<string|int, mixed>
getAliasByName()
returns ONE alias
private
getAliasByName(mixed $name) : mixed
Parameters
- $name : mixed
getAllAliases()
reads all aliases from xml and sets the pointer into allAliases array
private
getAllAliases() : mixed
getAllNats()
reads all nats from xml and sets the pointer into nats array
private
getAllNats() : mixed
getAllPolicies()
reads all policies from xml and sets the pointer into allPolicies array
private
getAllPolicies() : mixed
also initializes the alias references; if an alias is referenced by this policy, it is stored at the alias object.
getAllServices()
reads all services from xml and sets the pointer into allServices array
private
getAllServices() : mixed
getAllTags()
reads all tags from xml and sets the pointer into allTags array
private
getAllTags() : mixed
getAllTunnels()
reads all tunnels from xml and sets the pointer into allTunels array
private
getAllTunnels() : mixed
getXMLObject()
searchs an xml object by name and returns the found simpleXMLElement
private
getXMLObject(SimpleXMLElement $obj, mixed $searchname) : SimpleXMLElement|null
Parameters
- $obj : SimpleXMLElement
- $searchname : mixed