Definition of Supported Firewall Services and Port Aliases.
List of Global Functions
GetFilenameFromServiceDefinedByPackage - Creates a file name from service name defined by package. Service MUST be defined by package, otherwise it returns 'nil'.
GetListOfServicesAddedByPackage - Returns list of service-ids defined by packages.
GetModified - Returns whether configuration was modified
GetNeededBroadcastPorts - Function returns needed ports allowing broadcast
GetNeededIPProtocols - Function returns needed IP protocols for service
GetNeededPortsAndProtocols - Function returns needed ports and protocols for service. Function cares about if the service is defined or not.
GetNeededRPCPorts - Function returns needed RPC ports for service
GetNeededTCPPorts - Function returns needed TCP ports for service
GetNeededUDPPorts - Function returns needed UDP ports for service
GetPossiblyConflictServices - Function returns list of possibly conflicting services. Conflicting services are for instance nis-client and nis-server. DEPRECATED - we currently don't have such services - services are defined by packages.
GetSupportedServices - Function returns the map of supported (known) services.
IsKnownService - Function returns if the service_id is a known (defined) service
ReadServicesDefinedByRPMPackages - Reads definition of services that can be used in FW_CONFIGURATIONS_[EXT|INT|DMZ] in SuSEfirewall2.
ResetModified - Sets that configuration was not modified
ServiceDefinedByPackage - Returns whether the service ID is defined by package. Returns 'false' if it isn't.
SetModified - Sets that configuration was modified
SetNeededPortsAndProtocols - Immediately writes the configuration of service defined by package to the service definition file. Service must be defined by package, this function doesn't work for hard-coded services (SuSEFirewallServices).
List of Global Variables
Creates a file name from service name defined by package. Service MUST be defined by package, otherwise it returns 'nil'.
Function parameters
string service
Return value
string - file name (e.g., 'abc')
Example 133.
GetFilenameFromServiceDefinedByPackage ("service:abc") -> "abc" GetFilenameFromServiceDefinedByPackage ("abc") -> nil
Returns list of service-ids defined by packages.
Return value
list <string> - service ids
Function returns needed ports allowing broadcast
Function parameters
string service
Return value
list <string> - of needed broadcast ports
Function returns needed IP protocols for service
Function parameters
string service
Return value
list <string> - of needed IP protocols
Function returns needed ports and protocols for service. Function cares about if the service is defined or not.
Function parameters
string service
Return value
map <string, list <string> > - of needed ports and protocols
Example 134.
GetNeededPortsAndProtocols ("service:aaa") -> $[ "tcp_ports" : [ "122", "ftp-data" ], "udp_ports" : [ "427" ], "rpc_ports" : [ "portmap", "ypbind" ], "ip_protocols" : [], "broadcast_ports" : [ "427" ], ];
Function returns needed RPC ports for service
Function parameters
string service
Return value
list <string> - of needed RPC ports
Function returns needed TCP ports for service
Function parameters
string service
Return value
list <string> - of needed TCP ports
Function returns needed UDP ports for service
Function parameters
string service
Return value
list <string> - of needed UDP ports
Function returns list of possibly conflicting services. Conflicting services are for instance nis-client and nis-server. DEPRECATED - we currently don't have such services - services are defined by packages.
Return value
list <string> - of conflicting services
Function returns the map of supported (known) services.
Return value
map <string, string> - supported services
$[ service_id : localized_service_name ] $[ "dns-server" : "DNS Server", "vnc" : "Remote Administration", ]
Function returns if the service_id is a known (defined) service
Function parameters
string service_id
Return value
boolean - if is known (defined)
Reads definition of services that can be used in FW_CONFIGURATIONS_[EXT|INT|DMZ] in SuSEfirewall2.
Return value
boolean - if successful
Returns whether the service ID is defined by package. Returns 'false' if it isn't.
Function parameters
string service
Return value
boolean - whether service is defined by package
Example 135.
ServiceDefinedByPackage ("http-server") -> false ServiceDefinedByPackage ("service:http-server") -> true
Immediately writes the configuration of service defined by package to the service definition file. Service must be defined by package, this function doesn't work for hard-coded services (SuSEFirewallServices).
Function parameters
string service
map <string, list <string> > store_definition
Return value
boolean - if successful (nil in case of developer's mistake)
Example 136.
SetNeededPortsAndProtocols ( "service:something", $[ "tcp_ports" : [ "22", "ftp-data", "400:420" ], "udp_ports" : [ ], "rpc_ports" : [ "portmap", "ypbind" ], "ip_protocols" : [ "esp" ], "broadcast_ports" : [ ], ] );
See also:
IsKnownService()
ServiceDefinedByPackage()