YaST2 Developers Documentation: Configuration YaST2 Firewall

Configuration YaST2 Firewall

firewall/uifunctions.ycp
Configuration dialogs handling functions
  • Lukas Ocilka

This module has an unstable interface.

Configuration dialogs handling. Both Expert and Simple.

Imports

  • Address
  • Confirm
  • IP
  • Label
  • Mode
  • Netmask
  • Popup
  • PortAliases
  • PortRanges
  • Report
  • SuSEFirewall
  • SuSEFirewallExpertRules
  • SuSEFirewallServices
  • Wizard

Includes

  • firewall/generalfunctions.ycp
  • firewall/helps.ycp
  • firewall/subdialogs.ycp

Local Functions

local CheckNetwork (string network) -> boolean

Checks the network entry which can be defined in several formats.

Parameters:
network
Example

	CheckNetwork ("192.168.0.1") -> true
	CheckNetwork ("192.168.0.0/20") -> true
	CheckNetwork ("192.168.0.0/255.255.255.0") -> true
	CheckNetwork ("0/0") -> true
local SetFirewallIcon () -> void

Sets the dialog icon.

local DisableBackButton (string key) -> void

Function disables the back button. Fake function for CWM Tree Widget.

Parameters:
key
local SaveAndRestart () -> boolean

Function saves configuration and restarts firewall

local StartNow () -> boolean

Function starts Firewall services and sets firewall to be started after exiting YaST

local StopNow () -> boolean

Function stops Firewall services and sets firewall to be stopped after exiting YaST

local SetFirewallInterfacesCustomAndChangeButtons (string current_item) -> void

Function sets appropriate states for [Change] and [Custom] buttons

Parameters:
current_item
local RedrawFirewallInterfaces () -> void

Function redraws Interfaces Table

local InitFirewallInterfaces (string key) -> void

Function initializes Interfaces table and known_device_names

Parameters:
key
local HandlePopupSetFirewallInterfaceIntoZone (string interface) -> void

Function handles popup dialog witch setting Interface into Zone

Parameters:
interface
local HandlePopupAdditionalSettingsForZones () -> void

Function handles popup with additional settings in zones

local HandleFirewallInterfaces (string key, map event) -> symbol

Function handles whole firewall-interfaces dialg

Parameters:
key
event
local ReportWrongPortDefinition (string port_nr, string port_definition) -> boolean

Reports that the port definition is wrong. Either a single port or a port range. Returns whether user accepts the wrong port definition despite this warning.

Parameters:
port_nr
port_definition
Return value:
whether user accepts the port definition despite the warning.
Example

	// maximum port number is 65535, port range
	boolean accepted = ReportWrongPortDefinition(99999, "5:99999");
	// dtto., single port
	boolean whattodo = ReportWrongPortDefinition(78910, "78910");
local CheckIfTheyAreAllKnownPorts (string ui_id, list <string> ports) -> boolean

Function checks list of ports if they exist (are known).

Parameters:
ui_id
ports
local CheckAdditionalServicesDefinition (string services_definition) -> boolean

Checks the string (services definition) for syntax errors

Parameters:
services_definition
Return value:
whether everything was ok or whether user wants is despite the error
local SetMasqueradeTableUsable (boolean usable) -> void

Function sets UI for Masquerade Table (and buttons) enabled or disabled

Parameters:
usable
local IsMasqueradingPossible () -> boolean

Function returns if masquerading is possible. Masquerading needs at least two interfaces in two different firewall zones. One of them has to be External.

Return value:
if possible.
local CheckPortNumber (string port_to_be_checked, string widget_id) -> string

Function checks port number got as parameter. If check fails SetFocus is called and an empty string is returned.

Parameters:
port_to_be_checked
widget_id