Documentation ¶
Overview ¶
Package hostapd is used to interact with hostapd's control interface. More information about the control interface: http://w1.fi/wpa_supplicant/devel/hostapd_ctrl_iface_page.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTerminating = errors.New("wpa_supplicant is exiting")
ErrTerminating is returned by attach when and if the control interface terminates the connection. This can be because WiFi interface configuration was changed and hostapd is restarting.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a hostapd control interface client.
func (*Client) Attach ¶
Attach subscribes to hostapd events. For each event, the provided callback function will be called. The callback should return quickly, since it blocks attach from processing. Attach blocks until an error occurs or the provided context is canceled. Any error returned from the provided callback will stop attach and be returned.
func (*Client) Close ¶
Close closes the connection to the control interface. The client is no longer usable after closing.
type Event ¶
type Event interface { // Raw returns the string used by the control interface // to represent this event. Raw() string }
Event is an unsolicited message received from the hostapd control interface.
type EventStationConnect ¶
type EventStationConnect struct { MAC string // contains filtered or unexported fields }
EventStationConnect is an event that happens when a station (WiFi client) connects to the AP.
func (EventStationConnect) Raw ¶
func (e EventStationConnect) Raw() string
Raw returns event as given by hostapd. Satisifes the Event interface.
type EventStationDisconnect ¶
type EventStationDisconnect struct { MAC string // contains filtered or unexported fields }
EventStationDisconnect is an event that happens when a station (WiFi client) disconnects from the AP.
func (EventStationDisconnect) Raw ¶
func (e EventStationDisconnect) Raw() string
Raw returns event as given by hostapd. Satisifes the Event interface.
type EventTerminating ¶
type EventTerminating string
EventTerminating is received when the wpa_supplicant is exiting. This can happen, for example, when the wireless settings are changed and hostapd is restarted.
func (EventTerminating) Raw ¶
func (e EventTerminating) Raw() string
Raw returns event as given by hostapd. Satisifes the Event interface.
type EventUnrecognized ¶
type EventUnrecognized string
EventUnrecognized is a catch-all event for unrecognized events. Its Raw method returns the contents of the message.
func (EventUnrecognized) Raw ¶
func (e EventUnrecognized) Raw() string
Raw returns event as given by hostapd. Satisifes the Event interface.