Version: v0.0.0-...-479b8de Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2021 License: GPL-3.0 Imports: 24 Imported by: 0




This section is empty.


This section is empty.


func NewReply

func NewReply(rID uint64, replyCode protocol.NotificationReplyCode, data string) *protocol.NotificationReply

NewReply constructs a new protocol notification reply


type Client

type Client struct {
	// contains filtered or unexported fields

Client holds the connection information of a client.

func NewClient

func NewClient(socketPath string, stats *statistics.Statistics, rules *rule.Loader) *Client

NewClient creates and configures a new client.

func (*Client) Ask

func (c *Client) Ask(con *conman.Connection) *rule.Rule

Ask sends a request to the server, with the values of a connection to be allowed or denied.

func (*Client) Close

func (c *Client) Close()

Close cancels the running tasks: pinging the server and (re)connection poller.

func (*Client) Connected

func (c *Client) Connected() bool

Connected checks if the client has established a connection with the server.

func (*Client) DefaultAction

func (c *Client) DefaultAction() rule.Action

DefaultAction returns the default configured action for

func (*Client) DefaultDuration

func (c *Client) DefaultDuration() rule.Duration

DefaultDuration returns the default duration configured for a rule. For example it can be: once, always, "until restart".

func (*Client) GetFirewallType

func (c *Client) GetFirewallType() string

GetFirewallType returns the firewall to use

func (*Client) GetIsAsking

func (c *Client) GetIsAsking() bool

GetIsAsking returns the isAsking flag

func (*Client) GetStatsConfig

func (c *Client) GetStatsConfig() statistics.StatsConfig

GetStatsConfig returns the stats config from disk

func (*Client) InterceptUnknown

func (c *Client) InterceptUnknown() bool

InterceptUnknown returns

func (*Client) ProcMonitorMethod

func (c *Client) ProcMonitorMethod() string

ProcMonitorMethod returns the monitor method configured. If it's not present in the config file, it'll return an empty string.

func (*Client) SetIsAsking

func (c *Client) SetIsAsking(flag bool)

SetIsAsking sets the isAsking flag

func (*Client) Subscribe

func (c *Client) Subscribe()

Subscribe opens a connection with the server (UI), to start receiving notifications. It firstly sends the daemon status and configuration.

type Config

type Config struct {
	Server            serverConfig           `json:"Server"`
	DefaultAction     string                 `json:"DefaultAction"`
	DefaultDuration   string                 `json:"DefaultDuration"`
	InterceptUnknown  bool                   `json:"InterceptUnknown"`
	ProcMonitorMethod string                 `json:"ProcMonitorMethod"`
	LogLevel          *uint32                `json:"LogLevel"`
	Firewall          string                 `json:"Firewall"`
	Stats             statistics.StatsConfig `json:"Stats"`

Config holds the values loaded from configFile

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL