Skip to content

Commit

Permalink
Some changes to the API documentation.
Browse files Browse the repository at this point in the history
Added missing makefile definitions.
  • Loading branch information
teclator committed Sep 6, 2018
1 parent fdae5aa commit 38f0b7f
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 64 deletions.
3 changes: 2 additions & 1 deletion library/network/src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ yfwdlib_DATA = \
lib/y2firewall/firewalld/relations.rb \
lib/y2firewall/firewalld/service.rb \
lib/y2firewall/firewalld/zone.rb \
lib/y2firewall/firewalld/zone_parser.rb
lib/y2firewall/firewalld/zone_reader.rb \
lib/y2firewall/firewalld/service_reader.rb

yfwdapilibdir = @ylibdir@/y2firewall/firewalld/api/
yfwdapilib_DATA = \
Expand Down
9 changes: 5 additions & 4 deletions library/network/src/lib/y2firewall/firewalld/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ def running?
state == "running"
end

# Enables the firewalld service
def enable!
offline? ? run_command("--enable") : Yast::Service.Enable("firewalld")
end

# Disables the firewalld service
def disable!
offline? ? run_command("--disable") : Yast::Service.Disable("firewalld")
end
Expand Down Expand Up @@ -129,9 +131,9 @@ def default_zone
# Set the default zone
#
# @param zone [String] The firewall zone
# @return [String] default zone
# @return [Boolean] true if the default zone was modified correctly
def default_zone=(zone)
run_command("--set-default-zone=#{zone}") == "success"
string_command("--set-default-zone=#{zone}") == "success"
end

# Do a reload of the firewall if running. In offline mode just return
Expand Down Expand Up @@ -163,8 +165,7 @@ def log_denied_packets?(kind)

# @param kind [String] Denied packets to log. Possible values are:
# all, unicast, broadcast, multicast and off
# @return [Boolean] True if desired packet type was set to being logged
# when denied
# @return [Boolean] true if the type of packages to log was set correctly
def log_denied_packets=(kind)
string_command("--set-log-denied=#{kind}") == "success"
end
Expand Down
4 changes: 2 additions & 2 deletions library/network/src/lib/y2firewall/firewalld/api/services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def service_description(service, permanent: permanent?)
# @param service [String] The firewall service
# @param long_description [String] the new service description
def service_description=(service, long_description)
run_command("--service=#{service}", "--set-description=#{long_description}",
permanent: !offline?)
string_command("--service=#{service}", "--set-description=#{long_description}",
permanent: !offline?) == "success"
end

# Returns whether the service definition for the service name given is
Expand Down
Loading

0 comments on commit 38f0b7f

Please sign in to comment.