Documentation
¶
Index ¶
- Variables
- func Version() string
- type ActivateZone
- type Client
- func (c *Client) AddForwardPort(zone, port, protocol, toPort, toAddress string, timeout int) error
- func (c *Client) AddInterface(zone, interFace string) error
- func (c *Client) AddPort(zone, port, protocol string, timeout int) error
- func (c *Client) AddProtocol(zone, protocol string, timeout int) error
- func (c *Client) AddRichRule(zone, rule string, timeout int) error
- func (c *Client) AddService(zone, service string, timeout int) error
- func (c *Client) AddSource(zone, source string, timeout int) error
- func (c *Client) AddSourcePort(zone, port, protocol string, timeout int) error
- func (c *Client) AddZone(zoneSet ZoneSetting) (err error)
- func (c *Client) CallMethod(method string, args ...interface{}) (*dbus.Call, error)
- func (c *Client) CallPermanentServiceMethod(svcId int, method string, args ...interface{}) (*dbus.Call, error)
- func (c *Client) CallPermanentServiceMethod2(svc string, method string, args ...interface{}) (*dbus.Call, error)
- func (c *Client) CallPermanentZoneMethod(zoneId int, method string, args ...interface{}) (*dbus.Call, error)
- func (c *Client) CallPermanentZoneMethod2(zone string, method string, args ...interface{}) (*dbus.Call, error)
- func (c *Client) CallRuntimeZoneMethod(method string, args ...interface{}) (*dbus.Call, error)
- func (c *Client) CheckPermanentConfig() (err error)
- func (c *Client) Close() error
- func (c *Client) GetActiveZones() (azs map[string]ActivateZone, err error)
- func (c *Client) GetDefaultZone() (defaultZone string, err error)
- func (c *Client) GetForwardPorts(zone string) (fps ForwardPorts, err error)
- func (c *Client) GetInterfaces(zone string) (Interfaces []string, err error)
- func (c *Client) GetPorts(zone string) (ports Ports, err error)
- func (c *Client) GetProtocols(zone string) (protocols []string, err error)
- func (c *Client) GetRichRules(zone string) (richRules []string, err error)
- func (c *Client) GetServiceByName(service string) (path string, err error)
- func (c *Client) GetServiceNames() (names []string, err error)
- func (c *Client) GetServiceSettings(svc string) (svcSet ServiceSetting, err error)
- func (c *Client) GetServices(zone string) (services []string, err error)
- func (c *Client) GetSourcePorts(zone string) (ports Ports, err error)
- func (c *Client) GetSources(zone string) (sources []string, err error)
- func (c *Client) GetZoneByName(zone string) (path string, err error)
- func (c *Client) GetZoneNames() (names []string, err error)
- func (c *Client) GetZoneOfSource(source string) (zoneName string, err error)
- func (c *Client) GetZoneSettings(zone string) (zs ZoneSetting, err error)
- func (c *Client) GetZones() (zones []string, err error)
- func (c *Client) ListServices() (services []string, err error)
- func (c *Client) ListServicesPath() (servicesPath []string, err error)
- func (c *Client) ListZones() (zonesPath []string, err error)
- func (c *Client) Reload() (err error)
- func (c *Client) RemoveForwardPort(zone, port, protocol, toPort, toAddress string) error
- func (c *Client) RemovePort(zone, port, protocol string) error
- func (c *Client) RemoveProtocol(zone, protocol string) error
- func (c *Client) RemoveRichRule(zone, rule string) error
- func (c *Client) RemoveService(zone, service string) error
- func (c *Client) RemoveSource(zone, source string) error
- func (c *Client) RemoveSourcePort(zone, port, protocol string) error
- func (c *Client) RuntimeToPermanent() (err error)
- func (c *Client) SetDefaultZone(zone string) (err error)
- func (c *Client) SetForwardPorts(zone string, fps ForwardPorts) error
- func (c *Client) SetPorts(zone string, ports Ports) error
- func (c *Client) SetProtocols(zone string, protocols []string) error
- func (c *Client) SetRichRules(zone string, rules []string) error
- func (c *Client) SetServices(zone string, services []string) error
- func (c *Client) SetSourcePorts(zone string, ports Ports) error
- func (c *Client) SetSources(zone string, sources []string) error
- type ForwardPort
- type ForwardPorts
- type Options
- type Port
- type Ports
- type ServiceSetting
- type ServiceSettingMap
- type ZoneSetting
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type ActivateZone ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddForwardPort ¶
AddForwardPort Add the IPv4 forward port into zone. If zone is empty, use default zone. The port can either be a single port number portid or a port range portid-portid. The protocol can either be tcp or udp. The destination address is a simple IP address. If timeout(The timeout configuration does not take effect for permanent configuration) is non-zero, the operation will be active only for the amount of seconds.
func (*Client) AddInterface ¶
AddInterface Bind interface with zone.
func (*Client) AddPort ¶
AddPort when the timeout((The timeout configuration does not take effect for permanent configuration) is set to 0, the timeout is ignored.
func (*Client) AddProtocol ¶
AddProtocol add protocol into zone. The protocol can be any protocol supported by the system. Please have a look at /etc/protocols for supported protocols.
func (*Client) AddRichRule ¶
AddRichRule add rule to list of rich-language rules in zone.
func (*Client) AddService ¶
AddService Add service into zone. If timeout is non-zero, the operation will be active only for the amount of seconds.
func (*Client) AddSourcePort ¶
AddSourcePort add (port, protocol) to list of source ports of zone.
func (*Client) AddZone ¶
func (c *Client) AddZone(zoneSet ZoneSetting) (err error)
AddZone Add zone with given settings into permanent configuration.
func (*Client) CallMethod ¶
func (*Client) CallPermanentServiceMethod ¶
func (*Client) CallPermanentServiceMethod2 ¶
func (*Client) CallPermanentZoneMethod ¶
func (*Client) CallPermanentZoneMethod2 ¶
func (*Client) CallRuntimeZoneMethod ¶
func (*Client) CheckPermanentConfig ¶
CheckPermanentConfig Run checks on the permanent configuration. This is most useful if changes were made manually to configuration files.
func (*Client) GetActiveZones ¶
func (c *Client) GetActiveZones() (azs map[string]ActivateZone, err error)
GetActiveZones Return dictionary of currently active zones altogether with interfaces and sources used in these zones. Active zones are zones, that have a binding to an interface or source.
func (*Client) GetDefaultZone ¶
GetDefaultZone Return default zone.
func (*Client) GetForwardPorts ¶
func (c *Client) GetForwardPorts(zone string) (fps ForwardPorts, err error)
GetForwardPorts Get list of (port, protocol, toport, toaddr) defined in zone.
func (*Client) GetInterfaces ¶
GetInterfaces Return array of interfaces (s) previously bound with zone.
func (*Client) GetPorts ¶
GetPorts Return array of ports (2-tuple of port and protocol) previously enabled in zone
func (*Client) GetProtocols ¶
GetProtocols Return array of protocols (s) previously enabled in zone.
func (*Client) GetRichRules ¶
GetRichRules Get list of rich-language rules in zone.
func (*Client) GetServiceByName ¶
GetServiceByName Return object path (permanent configuration) of service with given name.
func (*Client) GetServiceNames ¶
GetServiceNames Return list of service names (permanent configuration).
func (*Client) GetServiceSettings ¶
func (c *Client) GetServiceSettings(svc string) (svcSet ServiceSetting, err error)
GetServiceSettings Return permanent settings of a service.
func (*Client) GetServices ¶
GetServices Get list of service names used in zone.
func (*Client) GetSourcePorts ¶
GetSourcePorts Get list of (port, protocol) defined in zone.
func (*Client) GetSources ¶
GetSources Get list of source addresses bound to zone.
func (*Client) GetZoneByName ¶
GetZoneByName Return object path (permanent configuration) of zone with given name.
func (*Client) GetZoneNames ¶
GetZoneNames Return list of zone names (permanent configuration).
func (*Client) GetZoneOfSource ¶
GetZoneOfSource Return name of zone the source is bound to or empty string.
func (*Client) GetZoneSettings ¶
func (c *Client) GetZoneSettings(zone string) (zs ZoneSetting, err error)
func (*Client) GetZones ¶
GetZones Return array of names (s) of predefined zones known to current runtime environment.
func (*Client) ListServices ¶
ListServices Return array of service names (s)
func (*Client) ListServicesPath ¶
ListServicesPath Return array of objects paths (o) of services in permanent configuration.
func (*Client) Reload ¶
Reload firewall rules and keep state information. Current permanent configuration will become new runtime configuration, i.e. all runtime only changes done until reload are lost with reload if they have not been also in permanent configuration.
func (*Client) RemoveForwardPort ¶
RemoveForwardPort remove (port, protocol, toport, toaddr) from list of forward ports of zone.
func (*Client) RemovePort ¶
RemovePort If zone is empty, use default zone.
func (*Client) RemoveProtocol ¶
RemoveProtocol remove protocol from zone.
func (*Client) RemoveRichRule ¶
RemoveRichRule remove rule from list of rich-language rules in zone.
func (*Client) RemoveService ¶
RemoveService remove service from list of services used in zone.
func (*Client) RemoveSource ¶
RemoveSource remove source from list of source addresses bound to zone.
func (*Client) RemoveSourcePort ¶
RemoveSourcePort remove (port, protocol) from list of source ports of zone.
func (*Client) RuntimeToPermanent ¶
RuntimeToPermanent Make runtime settings permanent. Replaces permanent settings with runtime settings for zones, services, icmptypes, direct (deprecated) and policies (lockdown whitelist).
func (*Client) SetDefaultZone ¶
SetDefaultZone Set default zone for connections and interfaces where no zone has been selected to zone. Setting the default zone changes the zone for the connections or interfaces, that are using the default zone. This is a runtime and permanent change.
func (*Client) SetForwardPorts ¶
func (c *Client) SetForwardPorts(zone string, fps ForwardPorts) error
SetForwardPorts Permanently set forward ports of zone
func (*Client) SetProtocols ¶
SetProtocols Permanently set list of protocols used in zone to protocols.
func (*Client) SetRichRules ¶
SetRichRules Permanently set list of rich-language rules to rules.
func (*Client) SetServices ¶
SetServices Permanently set list of services used in zone to services.
func (*Client) SetSourcePorts ¶
SetSourcePorts Permanently set source-ports of zone to list
type ForwardPort ¶
type ForwardPorts ¶
type ForwardPorts []ForwardPort
type Options ¶
type Options struct {
//dbusRuntimePath dbus.ObjectPath
//dbusRuntimeInterface string
//dbusRuntimeZoneInterface string
//dbusPermanentPath dbus.ObjectPath
//dbusPermanentInterface string
Zone string
Permanent bool
}
Options keeps the settings to set up firewalld connection.
type ServiceSetting ¶
type ServiceSettingMap ¶
type ServiceSettingMap map[string]interface{}
func (ServiceSettingMap) ToStruct ¶
func (ssm ServiceSettingMap) ToStruct() (ss ServiceSetting, err error)
type ZoneSetting ¶
type ZoneSetting struct {
Version string
Name string
Description string
Unused bool
Target string
Services []string
Ports Ports
IcmpBlocks []string
Masquerade bool
ForwardPorts ForwardPorts
Interfaces []string
SourceAddresses []string
RichRules []string
Protocols []string
SourcePorts Ports
IcmpBlockInversion bool
}
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
001defaultzone
command
|
|
|
002servicesetings
command
|
|
|
003listservices
command
|
|
|
005GetZoneSettings
command
|
|
|
006AddPort
command
|
|
|
007GetPort
command
|
|
|
008AddZone
command
|
|
|
009GetServicesSettings
command
|