wpasupplicant

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package wpasupplicant provides utilities to interact with wpa_supplicant via dbus.

Index

Constants

View Source
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

func SignalName(s *dbus.Signal) string

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.

func NewBSS

func NewBSS(ctx context.Context, path dbus.ObjectPath) (*BSS, error)

NewBSS creates a BSS object.

func (*BSS) BSSID

func (b *BSS) BSSID(ctx context.Context) ([]byte, error)

BSSID returns the BSSID of this BSS.

func (*BSS) SSID

func (b *BSS) SSID(ctx context.Context) ([]byte, error)

SSID returns the SSID of this BSS.

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

func NewInterface(ctx context.Context, path dbus.ObjectPath) (*Interface, error)

NewInterface creates an Interface object.

func (*Interface) BSSs

func (iface *Interface) BSSs(ctx context.Context) ([]*BSS, error)

BSSs returns the BSSs property of the interface.

func (*Interface) DBusObject

func (iface *Interface) DBusObject() *dbusutil.DBusObject

DBusObject returns the D-Bus object of the interface.

func (*Interface) FlushBSS

func (iface *Interface) FlushBSS(ctx context.Context, age uint32) error

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

func (iface *Interface) ParseScanDoneSignal(ctx context.Context, sig *dbus.Signal) (bool, error)

ParseScanDoneSignal parses the ScanDone D-Bus signal and returns if it is a successful ScanDone.

func (*Interface) Reattach

func (iface *Interface) Reattach(ctx context.Context) error

Reattach calls the Reattach method of the interface.

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

func (s *Supplicant) GetInterface(ctx context.Context, name string) (*Interface, error)

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.

Jump to

Keyboard shortcuts

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