daemon

package
v0.0.0-...-61e9e54 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2017 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STARTING = 0 + iota
	MANAGING
	OPERATING
	MANUAL
)

enum to track current system state

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
}

Client is the base type for both testing and runtime

func GetClient

func GetClient() *Client

GetClient returns a client for runtime or testing

func (*Client) CheckWaitApConnect

func (c *Client) CheckWaitApConnect() bool

CheckWaitApConnect returns true if the flag wait file exists and false if it does not

func (*Client) GetManualFlagPath

func (c *Client) GetManualFlagPath() string

GetManualFlagPath returns the current path

func (*Client) GetPreviousState

func (c *Client) GetPreviousState() int

GetPreviousState returns the daemon previous state

func (*Client) GetState

func (c *Client) GetState() int

GetState returns the daemon state

func (*Client) GetWaitFlagPath

func (c *Client) GetWaitFlagPath() string

GetWaitFlagPath returns the current path

func (*Client) IsApUpWithoutSSIDs

func (c *Client) IsApUpWithoutSSIDs(cw *wifiap.Client) bool

IsApUpWithoutSSIDs corrects an possible but unlikely case. if wifiap is UP and there are no known SSIDs, bring it down so on next loop iter we start again and can get SSIDs. returns true when ip is UP and has no ssids

func (*Client) Manage

func (c *Client) Manage(nc *netman.Client)

Manage sets wlan0 to not managed by network manager

func (*Client) ManagementServerDown

func (c *Client) ManagementServerDown()

ManagementServerDown stops the management server if it is running also remove the wait flag file, thus resetting proper State

func (*Client) ManagementServerUp

func (c *Client) ManagementServerUp()

ManagementServerUp starts the management server if it is not running

func (*Client) ManualMode

func (c *Client) ManualMode() bool

ManualMode enables the daemon to loop without action if in manual mode It returns true if the manual mode flag wait file exists and false if it does not. If it does not exist and the mode is MANUAL, the state is set to STARTING. If it does exist and the mode is not MANUAL, state is set to MANUAL

func (*Client) OperationalServerDown

func (c *Client) OperationalServerDown()

OperationalServerDown stops the operational server if it is running

func (*Client) OperationalServerUp

func (c *Client) OperationalServerUp()

OperationalServerUp starts the operational server if it is not running

func (*Client) ScanSsids

func (c *Client) ScanSsids(path string, nc *netman.Client) bool

ScanSsids sets wlan0 to be managed and then scans for ssids. If found, write the ssids (comma separated) to path and return true, else return false.

func (*Client) SetDefaults

func (c *Client) SetDefaults()

SetDefaults sets defaults if not yet set. Currently the hash for the portals password is set. TODO: set default password based on MAC addr or Serial number

func (*Client) SetManualFlagPath

func (c *Client) SetManualFlagPath(s string)

SetManualFlagPath sets the current path

func (*Client) SetPreviousState

func (c *Client) SetPreviousState(i int)

SetPreviousState sets daemon previous state

func (*Client) SetState

func (c *Client) SetState(i int)

SetState sets the daemon state and updates the previous state

func (*Client) SetWaitFlagPath

func (c *Client) SetWaitFlagPath(s string)

SetWaitFlagPath sets the current path

func (*Client) Unmanage

func (c *Client) Unmanage(nc *netman.Client)

Unmanage sets wlan0 to be Unmanaged by network manager if it is managed

Jump to

Keyboard shortcuts

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