Documentation ¶
Overview ¶
Package wpasupplicant provides utilities to interact with wpa_supplicant via dbus.
Index ¶
- Constants
- func SignalName(s *dbus.Signal) string
- type BSS
- type BSSAddedSignal
- type Interface
- func (iface *Interface) BSSs(ctx context.Context) ([]*BSS, error)
- func (iface *Interface) DBusObject() *dbusutil.DBusObject
- func (iface *Interface) FlushBSS(ctx context.Context, age uint32) error
- func (iface *Interface) ParseBSSAddedSignal(ctx context.Context, sig *dbus.Signal) (*BSSAddedSignal, error)
- func (iface *Interface) ParseScanDoneSignal(ctx context.Context, sig *dbus.Signal) (bool, error)
- func (iface *Interface) Reattach(ctx context.Context) error
- type Supplicant
Constants ¶
const ( // DBusInterfacePropDisconnectReason the most recent IEEE802.11 reason code for disconnect. Negative value indicates locally generated disconnect. DBusInterfacePropDisconnectReason = "DisconnectReason" // DBusInterfaceSignalBSSAdded Interface became awaere of a new BSS. DBusInterfaceSignalBSSAdded = "BSSAdded" // DBusInterfaceSignalPropertiesChanged indicates that some properties have changed. Possible properties are: "ApScan", "Scanning", "State", "CurrentBSS", "CurrentNetwork". DBusInterfaceSignalPropertiesChanged = "PropertiesChanged" // DBusInterfaceSignalScanDone indicates that the scanning is finished. DBusInterfaceSignalScanDone = "ScanDone" // DBusInterfaceSignalEAP indicates the status of the EAP peer. DBusInterfaceSignalEAP = "EAP" // DBusInterfaceStateAssociated is the value of the State property when the interface is associated. DBusInterfaceStateAssociated = "associated" // DBusInterfaceStateCompleted is the value of the State property when all authentication is completed. DBusInterfaceStateCompleted = "completed" )
Variables ¶
This section is empty.
Functions ¶
func SignalName ¶
SignalName returns the name of the dbus.Signal, which may be one of DBusInterfaceSignal*.
Types ¶
type BSS ¶
type BSS struct {
// contains filtered or unexported fields
}
BSS is the object to interact with wpa_supplicant's fi.w1.wpa_supplicant1.BSS interface.
type BSSAddedSignal ¶
type BSSAddedSignal struct { BSS dbus.ObjectPath SSID []byte BSSID []byte }
BSSAddedSignal wraps D-Bus BSSAdded signal arguments.
type Interface ¶
type Interface struct {
// contains filtered or unexported fields
}
Interface is the object to interact with wpa_supplicant's fi.w1.wpa_supplicant1.Interface interface.
func NewInterface ¶
NewInterface creates an Interface object.
func (*Interface) DBusObject ¶
func (iface *Interface) DBusObject() *dbusutil.DBusObject
DBusObject returns the D-Bus object of the interface.
func (*Interface) FlushBSS ¶
FlushBSS calls the FlushBSS method of the interface to flush BSS entries from the cache.
func (*Interface) ParseBSSAddedSignal ¶
func (iface *Interface) ParseBSSAddedSignal(ctx context.Context, sig *dbus.Signal) (*BSSAddedSignal, error)
ParseBSSAddedSignal parses the D-Bus signal to a BSSAddedSignal.
func (*Interface) ParseScanDoneSignal ¶
ParseScanDoneSignal parses the ScanDone D-Bus signal and returns if it is a successful ScanDone.
type Supplicant ¶
type Supplicant struct {
// contains filtered or unexported fields
}
Supplicant is the object to interact with wpa_supplicant's fi.w1.wpa_supplicant1 interface.
func NewSupplicant ¶
func NewSupplicant(ctx context.Context) (*Supplicant, error)
NewSupplicant creates a Supplicant object.
func (*Supplicant) GetInterface ¶
GetInterface calls fi.w1.wpa_supplicant1.GetInterface to get the object path of the interface with name and return the Interface object with the object path.