mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
firewall: Get service ports details
Add interface to get port types and numbers for a service. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
1 parent
51fc87f1bc
commit
e5081018a3
2 files changed
+23
-2
No files matched your search
@@ -95,6 +95,13 @@ def get_enabled_services(zone):
|
||||
return output.split()
|
||||
|
||||
|
||||
def get_port_details(service_port):
|
||||
"""Return the port types and numbers for a service port"""
|
||||
output = _run(
|
||||
['get-service-ports', '--service', service_port], superuser=True)
|
||||
return output.split()
|
||||
|
||||
|
||||
def get_interfaces(zone):
|
||||
"""Return the list of interfaces in a zone."""
|
||||
output = _run(['get-interfaces', '--zone', zone], superuser=True)
|
||||
|
||||
Reference in new issue
Block a user