ruckusweb

package
v0.0.0-...-b1b4d54 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AAA

type AAA struct {
	// contains filtered or unexported fields
}

func (AAA) List

func (a AAA) List(ctx context.Context) ([]AaaServer, error)

type AP

type AP struct {
	ID               int        `xml:"id,attr"`
	Mac              MacAddress `xml:"mac,attr"`
	Name             string     `xml:"name,attr"`
	Devname          string     `xml:"devname,attr"`
	Description      string     `xml:"description,attr"`
	Model            string     `xml:"model,attr"`
	UsbInstalled     bool       `xml:"usb-installed,attr"`
	PoeMode          int        `xml:"poe-mode,attr"`
	Serial           string     `xml:"serial,attr"`
	Version          string     `xml:"version,attr"`
	BuildVersion     string     `xml:"build-version,attr"`
	Approved         string     `xml:"approved,attr"`
	TunnelMode       int        `xml:"tunnel-mode,attr"`
	Ip               net.IP     `xml:"ip,attr"`
	Ipv6Addr         net.IP     `xml:"ipv6-addr,attr"`
	UdpPort          int        `xml:"udp-port,attr"`
	ConfigState      int        `xml:"config-state,attr"`
	ExtIp            net.IP     `xml:"ext-ip,attr"`
	ExtIpv6          net.IP     `xml:"ext-ipv6,attr"`
	ExtPort          int        `xml:"ext-port,attr"`
	ExtFamily        int        `xml:"ext-family,attr"`
	CbandChann       string     `xml:"cband-chann,attr"`
	MeshMode         string     `xml:"mesh-mode,attr"`
	MaxHops          string     `xml:"max-hops,attr"`
	MeshEnabled      bool       `xml:"mesh-enabled,attr"`
	Support11ac      bool       `xml:"support-11ac,attr"`
	Support11ax      bool       `xml:"support-11ax,attr"`
	AuthMode         string     `xml:"auth-mode,attr"`
	LastSeen         Timestamp  `xml:"last-seen,attr"`
	Netmask          net.IP     `xml:"netmask,attr"`
	Gateway          net.IP     `xml:"gateway,attr"`
	Dns1             net.IP     `xml:"dns1,attr"`
	Dns2             net.IP     `xml:"dns2,attr"`
	Ipv6Plen         string     `xml:"ipv6-plen,attr"`
	Ipv6Gateway      net.IP     `xml:"ipv6-gateway,attr"`
	Ipv6Dns1         net.IP     `xml:"ipv6-dns1,attr"`
	Ipv6Dns2         net.IP     `xml:"ipv6-dns2,attr"`
	StrongCert       string     `xml:"strong-cert,attr"`
	Location         string     `xml:"location,attr"`
	Gps              string     `xml:"gps,attr"`
	GroupID          int        `xml:"group-id,attr"`
	CoordinateSource string     `xml:"coordinate_source,attr"`
	ByDhcp           bool       `xml:"by-dhcp,attr"`
	AsIs             bool       `xml:"as-is,attr"`
	WorkingRadio     string     `xml:"working-radio,attr"`
	BonjourCheck     string     `xml:"bonjour-check,attr"`
	Ipmode           string     `xml:"ipmode,attr"`
	AsIsIpv6         string     `xml:"as-is-ipv6,attr"`
	LedOff           string     `xml:"led-off,attr"`
	PoeModeSetting   string     `xml:"poe-mode-setting,attr"`
	Radio            []APRadio  `xml:"radio"`
}

type APGroup

type APGroup struct {
	ID          int    `xml:"id,attr"`
	Name        string `xml:"name,attr"`
	Description string `xml:"description,attr"`
	ApProperty  struct {
		Radio   []APGroupRadio `xml:"radio"`
		Network struct {
			Ipmode int `xml:"ipmode,attr"`
		} `xml:"network"`
		Mesh struct {
			MeshMode string `xml:"mesh-mode,attr"`
			MaxHops  int    `xml:"max-hops,attr"`
		} `xml:"mesh"`
		Chanfly struct {
			TurnOff     bool `xml:"turnOff,attr"`
			TurnOffTime int  `xml:"turnOff-time,attr"`
		} `xml:"chanfly"`
		Bonjourfencing struct {
			Enable IntBool `xml:"enable,attr"`
			Policy int     `xml:"policy,attr"`
		} `xml:"bonjourfencing"`
	} `xml:"ap-property"`
	Lldp struct {
		LldpInterval int         `xml:"lldp-interval,attr"`
		LldpHoldtime int         `xml:"lldp-holdtime,attr"`
		Enabled      bool        `xml:"enabled,attr"`
		LldpMgmt     EnabledBool `xml:"lldp-mgmt,attr"`
		Port         []struct {
			ID     string      `xml:"id,attr"`
			LldpOn EnabledBool `xml:"lldp-on,attr"`
		} `xml:"port"`
	} `xml:"lldp"`
	//Models    string `xml:"models"`
	Wlangroup struct {
		Wlansvc []struct {
			ID int `xml:"id,attr"`
		} `xml:"wlansvc"`
	} `xml:"wlangroup"`
}

type APGroupRadio

type APGroupRadio struct {
	RadioType            string  `xml:"radio-type,attr"`
	Channel              string  `xml:"channel,attr"`
	Channelization       string  `xml:"channelization,attr"`
	AutoChannelSet       bool    `xml:"auto-channel-set,attr"`
	ChannelSet           string  `xml:"channel-set,attr"`
	TxPower              int     `xml:"tx-power,attr"`
	MixMode              int     `xml:"mix-mode,attr"`
	WlangroupID          int     `xml:"wlangroup-id,attr"`
	ChannelOutdoor       string  `xml:"channel-outdoor,attr"`
	ChannelSelect        string  `xml:"channel-select,attr"`
	ChannelOutdoorSelect string  `xml:"channel-outdoor-select,attr"`
	ChannelIndoorSelect  string  `xml:"channel-indoor-select,attr"`
	WmmAc                IntBool `xml:"wmm-ac,attr"`
	SpectralinkComp      string  `xml:"spectralink-comp,attr"`
	VapEnabled           IntBool `xml:"vap-enabled,attr"`
}

type APGroups

type APGroups struct {
	// contains filtered or unexported fields
}

func (APGroups) List

func (a APGroups) List(ctx context.Context) ([]APGroup, error)

type APRadio

type APRadio struct {
	RadioType          string  `xml:"radio-type,attr"`
	Ieee80211RadioType string  `xml:"ieee80211-radio-type,attr"`
	RadioID            int     `xml:"radio-id,attr"`
	Channel            string  `xml:"channel,attr"`
	ChannelSeg2        string  `xml:"channel_seg2,attr"`
	TxPower            string  `xml:"tx-power,attr"`
	WmmAc              string  `xml:"wmm-ac,attr"`
	ProtMode           string  `xml:"prot-mode,attr"`
	VapEnabled         string  `xml:"vap-enabled,attr"`
	WlangroupID        string  `xml:"wlangroup-id,attr"`
	ChannelSelect      string  `xml:"channel-select,attr"`
	Enabled            IntBool `xml:"enabled,attr"`
	Channelization     string  `xml:"channelization,attr"`
}

type APStatus

type APStatus struct {
	Mac                MacAddress `xml:"mac,attr"`
	ID                 int        `xml:"id,attr"`
	Devname            string     `xml:"devname,attr"`
	Model              string     `xml:"model,attr"`
	State              string     `xml:"state,attr"`
	MeshState          string     `xml:"mesh-state,attr"`
	FirmwareVersion    string     `xml:"firmware-version,attr"`
	GroupID            int        `xml:"group-id,attr"`
	Ip                 net.IP     `xml:"ip,attr"`
	LastSeen           Timestamp  `xml:"last-seen,attr"`
	UptimeUpdate       string     `xml:"uptime-update,attr"`
	MeshActivated      string     `xml:"mesh-activated,attr"`
	MeshUplinkType     string     `xml:"mesh-uplink-type,attr"`
	MeshDepth          int        `xml:"mesh-depth,attr"`
	MeshMode           string     `xml:"mesh-mode,attr"`
	MeshEnabled        bool       `xml:"mesh-enabled,attr"`
	Support11ac        bool       `xml:"support-11ac,attr"`
	SerialNumber       string     `xml:"serial-number,attr"`
	ApCrashfileFlag    int        `xml:"ap-crashfile-flag,attr"`
	Role               string     `xml:"role,attr"`
	Fixed              string     `xml:"fixed,attr"`
	Priority           string     `xml:"priority,attr"`
	Channel11ng        int        `xml:"channel-11ng,attr"`
	TxPower11ng        int        `xml:"tx-power-11ng,attr"`
	Channelization11ng int        `xml:"channelization-11ng,attr"`
	Channel11na        int        `xml:"channel-11na,attr"`
	TxPower11na        int        `xml:"tx-power-11na,attr"`
	Channelization11na int        `xml:"channelization-11na,attr"`
	PoeModeWarningCode string     `xml:"poe-mode-warning-code,attr"`
	Radio              []struct {
		RadioType      string `xml:"radio-type,attr"`
		RadioBand      string `xml:"radio-band,attr"`
		Channel        int    `xml:"channel,attr"`
		Channelization int    `xml:"channelization,attr"`
		DfsChannel11na string `xml:"dfs-channel-11na,attr"`
	} `xml:"radio"`
	History struct {
		RxBytes24g ByteTimeSeries `xml:"rx-bytes-2.4g,attr"`
		TxBytes24g ByteTimeSeries `xml:"tx-bytes-2.4g,attr"`
		RxBytes5g  ByteTimeSeries `xml:"rx-bytes-5g,attr"`
		TxBytes5g  ByteTimeSeries `xml:"tx-bytes-5g,attr"`
		Rssi       RssiTimeSeries `xml:"rssi,attr"`
	} `xml:"history"`
}

type APs

type APs struct {
	// contains filtered or unexported fields
}

func (APs) List

func (a APs) List(ctx context.Context) ([]AP, error)

func (APs) ListStatuses

func (a APs) ListStatuses(ctx context.Context) ([]APStatus, error)

type AaaActiveDirectory

type AaaActiveDirectory struct {
	AaaEntry

	Encryption  EnabledBool `xml:"encryption,attr"`
	Timeout     int         `xml:"timeout,attr"`
	GroupString string      `xml:"group-string,attr"` // "memberOf"

	GlobalCatalog EnabledBool `xml:"global-catalog,attr"`
	Server1       string      `xml:"server1,attr"`
	Port          uint16      `xml:"port,attr"`
	SearchBase    string      `xml:"search-base,attr"`
	AdminDn       string      `xml:"admin-dn,attr"`
	AdminPwd      string      `xml:"admin-pwd,attr"`
	XAdminPwd     string      `xml:"x-admin-pwd,attr"`
}

func (AaaActiveDirectory) Editable

func (A AaaActiveDirectory) Editable() bool

func (AaaActiveDirectory) ID

func (A AaaActiveDirectory) ID() int

func (AaaActiveDirectory) Name

func (A AaaActiveDirectory) Name() string

type AaaEntry

type AaaEntry struct {
	ID       int    `xml:"id,attr"`
	Name     string `xml:"name,attr"`
	Editable bool   `xml:"EDITABLE,attr"`
	Type     string `xml:"type,attr"`
}

type AaaRadius

type AaaRadius struct {
	AaaEntry

	Encryption  EnabledBool `xml:"encryption,attr"`
	Timeout     int         `xml:"timeout,attr"`
	GroupString string      `xml:"group-string,attr"` // "memberOf"

	PrimaryRadius          *AaaRadiusEndpoint `xml:"primary-radius"`
	SecondaryRadius        *AaaRadiusEndpoint `xml:"secondary-radius"`
	Backup                 EnabledBool        `xml:"backup,attr"`
	Algorithm              string             `xml:"algorithm,attr"` // "pap", "chap"?
	FailoverRetry          int                `xml:"failover-retry,attr"`
	RetryConsecutivePacket int                `xml:"retry-consecutive-packet,attr"`
	RetryPrimaryInterval   int                `xml:"retry-primary-interval,attr"`
}

func (AaaRadius) Editable

func (A AaaRadius) Editable() bool

func (AaaRadius) ID

func (A AaaRadius) ID() int

func (AaaRadius) Name

func (A AaaRadius) Name() string

type AaaRadiusEndpoint

type AaaRadiusEndpoint struct {
	Ip   string `xml:"ip,attr"`
	Port uint16 `xml:"port,attr"`

	Secret  string `xml:"secret,attr"`
	XSecret string `xml:"x-secret,attr"`

	Timeout int `xml:"timeout,attr"`
	Retry   int `xml:"retry,attr"`
}

type AaaServer

type AaaServer interface {
	ID() int
	Name() string
	Editable() bool
	// contains filtered or unexported methods
}

type ByteTimeSeries

type ByteTimeSeries []ByteTimeSeriesRecord

func (ByteTimeSeries) MarshalText

func (ts ByteTimeSeries) MarshalText() ([]byte, error)

func (*ByteTimeSeries) UnmarshalText

func (ts *ByteTimeSeries) UnmarshalText(text []byte) error

type ByteTimeSeriesRecord

type ByteTimeSeriesRecord struct {
	At    time.Time
	Bytes uint64
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(Transport http.RoundTripper, host string, credentials Credentials) *Client

func (*Client) AAA

func (c *Client) AAA() AAA

func (*Client) APGroups

func (c *Client) APGroups() APGroups

func (*Client) APs

func (c *Client) APs() APs

func (*Client) ListStatuses

func (c *Client) ListStatuses(ctx context.Context) ([]WlanStatus, error)

func (*Client) SNMP

func (c *Client) SNMP() SNMP

func (*Client) Stations

func (c *Client) Stations() Stations

func (*Client) Sysinfo

func (c *Client) Sysinfo(ctx context.Context) (*Sysinfo, error)

func (*Client) TLS

func (c *Client) TLS() TLS

func (*Client) Wlans

func (c *Client) Wlans() Wlans

type Credentials

type Credentials struct {
	Username string
	Password string
}

type CsrInput

type CsrInput struct {
	CN string
	OU string
	O  string
	L  string
	S  string
	C  string

	// SanDNS is optional and overrides SanIP if present.
	SanDNS string
	// SanIP is optional and is overridden by SanDNS if present.
	SanIP net.IP
}

type EnabledBool

type EnabledBool bool

func (EnabledBool) MarshalText

func (b EnabledBool) MarshalText() ([]byte, error)

func (*EnabledBool) UnmarshalText

func (b *EnabledBool) UnmarshalText(text []byte) error

type IntBool

type IntBool bool

func (IntBool) MarshalText

func (b IntBool) MarshalText() ([]byte, error)

func (*IntBool) UnmarshalText

func (b *IntBool) UnmarshalText(text []byte) error

type MacAddress

type MacAddress net.HardwareAddr

func (MacAddress) MarshalText

func (m MacAddress) MarshalText() ([]byte, error)

func (*MacAddress) UnmarshalText

func (m *MacAddress) UnmarshalText(text []byte) error

type RssiTimeSeries

type RssiTimeSeries []RssiTimeSeriesRecord

func (RssiTimeSeries) MarshalText

func (ts RssiTimeSeries) MarshalText() ([]byte, error)

func (*RssiTimeSeries) UnmarshalText

func (ts *RssiTimeSeries) UnmarshalText(text []byte) error

type RssiTimeSeriesRecord

type RssiTimeSeriesRecord struct {
	At        time.Time
	Excellent uint32
	Moderate  uint32
	Poor      uint32
}

type SNMP

type SNMP struct {
	// contains filtered or unexported fields
}

func (SNMP) GetTrap

func (s SNMP) GetTrap(ctx context.Context) (*SNMPTrap, error)

func (SNMP) GetV2

func (s SNMP) GetV2(ctx context.Context) (*SNMPv2, error)

func (SNMP) GetV3

func (s SNMP) GetV3(ctx context.Context) (*SNMPv3, error)

func (SNMP) SetTrap

func (s SNMP) SetTrap(ctx context.Context, settings SNMPTrap) error

func (SNMP) SetV2

func (s SNMP) SetV2(ctx context.Context, settings SNMPv2) error

func (SNMP) SetV3

func (s SNMP) SetV3(ctx context.Context, settings SNMPv3) error

type SNMPTrap

type SNMPTrap struct {
	Enabled   bool   `xml:"enabled,attr"`
	Community string `xml:"community,attr"`
	Ver       int    `xml:"ver,attr"`
	Password  string `xml:"password,attr"`

	// For Ver=2:
	Ip1 net.IP `xml:"ip1,attr"`
	Ip2 net.IP `xml:"ip2,attr"`
	Ip3 net.IP `xml:"ip3,attr"`
	Ip4 net.IP `xml:"ip4,attr"`

	// For Ver=3:
	TrapV3s []SnmpTrapV3 `xml:"trapusr"`
}

type SNMPv2

type SNMPv2 struct {
	Snmpv2Ap    bool   `xml:"snmpv2-ap,attr"`
	Ver         int    `xml:"ver,attr"`
	Enabled     bool   `xml:"enabled,attr"`
	SysContact  string `xml:"sys-contact,attr"`
	SysLocation string `xml:"sys-location,attr"`
	RoCommunity string `xml:"ro-community,attr"`
	RwCommunity string `xml:"rw-community,attr"`
}

type SNMPv3

type SNMPv3 struct {
	Enabled bool `xml:"enabled,attr"`
	Ver     int  `xml:"ver,attr"`
	Snmpusr []struct {
		Role   string `xml:"role,attr"`
		Name   string `xml:"name,attr"`
		Auth   string `xml:"auth,attr"`
		AuthPP string `xml:"authPP,attr"`
		Priv   string `xml:"priv,attr"`
		PrivPP string `xml:"privPP,attr"`
	} `xml:"snmpusr"`
}

type SnmpTrapV3

type SnmpTrapV3 struct {
	Auth    string `xml:"auth,attr"`
	AuthPP  string `xml:"authPP,attr"`
	Enabled bool   `xml:"enabled,attr"`
	ID      int    `xml:"id,attr"`
	Ip      net.IP `xml:"ip,attr"`
	Name    string `xml:"name,attr"`
	Priv    string `xml:"priv,attr"`
	PrivPP  string `xml:"privPP,attr"`
}

type Station

type Station struct {
	// Far side
	Mac        MacAddress `xml:"mac,attr"`
	Status     int        `xml:"status,attr"`
	ExtStatus  int        `xml:"ext-status,attr"`
	FirstAssoc Timestamp  `xml:"first-assoc,attr"`

	// Near side
	Ap     MacAddress `xml:"ap,attr"`
	ApName string     `xml:"ap-name,attr"`

	// AA
	User                string `xml:"user,attr"`
	VapNasid            string `xml:"vap-nasid,attr"`
	NumIntervalStats    int    `xml:"num-interval-stats,attr"`
	CalledStationIDType int    `xml:"called-station-id-type,attr"`
	AcctMultiSessionID  string `xml:"acct-multi-session-id,attr"`
	AcctSessionID       string `xml:"acct-session-id,attr"`

	Location string `xml:"location,attr"`

	// Which network?
	WlanID     int        `xml:"wlan-id,attr"`
	Wlan       string     `xml:"wlan,attr"`
	Ssid       string     `xml:"ssid,attr"`
	VapMac     MacAddress `xml:"vap-mac,attr"` // BSSID
	Encryption string     `xml:"encryption,attr"`

	GroupID          int    `xml:"group-id,attr"`
	DpskID           int    `xml:"dpsk-id,attr"`
	WpaPassphrase    string `xml:"wpa-passphrase,attr"`
	WpaPassphraseLen int    `xml:"wpa-passphrase-len,attr"`

	// How is it connected?
	Ip   net.IP `xml:"ip,attr"`
	Ipv6 net.IP `xml:"ipv6,attr"`
	Vlan int    `xml:"vlan,attr"`

	Description string `xml:"description,attr"`
	Hostname    string `xml:"hostname,attr"`

	RoleID int `xml:"role-id,attr"`

	// Fingerprinted metadata
	DeviceInfo      string `xml:"dvcinfo,attr"`
	DeviceType      string `xml:"dvctype,attr"`
	DeviceInfoGroup string `xml:"dvcinfo-group,attr"`
	Model           string `xml:"model,attr"`

	Favourite IntBool `xml:"favourite,attr"`
	Legacy    IntBool `xml:"iot,attr"`
	Blocked   IntBool `xml:"blocked,attr"`

	// The original name of the station, before any renaming.
	OriginalName string `xml:"oldname,attr"`

	// Radio properties
	Channelization         string `xml:"channelization,attr"`
	Ieee80211RadioType     string `xml:"ieee80211-radio-type,attr"`
	RadioTypeText          string `xml:"radio-type-text,attr"`
	Rssi                   int    `xml:"rssi,attr"`
	ReceivedSignalStrength int    `xml:"received-signal-strength,attr"`
	NoiseFloor             int    `xml:"noise-floor,attr"`
	RssiLevel              string `xml:"rssi-level,attr"` // excellent, healthy, ???
	AuthMethod             string `xml:"auth-method,attr"`
	AvgRssi                int    `xml:"avg-rssi,attr"`
	Channel                int    `xml:"channel,attr"`
	RadioType              string `xml:"radio-type,attr"`
	RadioBand              string `xml:"radio-band,attr"`

	// Counters
	TotalRxPkts       uint64 `xml:"total-rx-pkts,attr"`
	TotalTxPkts       uint64 `xml:"total-tx-pkts,attr"`
	TotalRetryBytes   uint64 `xml:"total-retry-bytes,attr"`
	TotalRxDup        uint64 `xml:"total-rx-dup,attr"`
	TotalTxReassoc    uint64 `xml:"total-tx-reassoc,attr"`
	TotalRxCrcErrs    uint64 `xml:"total-rx-crc-errs,attr"`
	TotalUsageBytes   uint64 `xml:"total-usage-bytes,attr"`
	TotalRxBytes      uint64 `xml:"total-rx-bytes,attr"`
	TotalTxBytes      uint64 `xml:"total-tx-bytes,attr"`
	TotalRetries      uint64 `xml:"total-retries,attr"`
	TotalRxManagement uint64 `xml:"total-rx-management,attr"`
	TotalTxManagement uint64 `xml:"total-tx-management,attr"`
	TxDropData        uint64 `xml:"tx-drop-data,attr"`
	TxDropMgmt        uint64 `xml:"tx-drop-mgmt,attr"`
}

type Stations

type Stations struct {
	// contains filtered or unexported fields
}

func (Stations) List

func (s Stations) List(ctx context.Context) ([]Station, error)

func (Stations) ListByWlanName

func (s Stations) ListByWlanName(ctx context.Context, wlanName string) ([]Station, error)

func (Stations) SetFavorite

func (s Stations) SetFavorite(ctx context.Context, client MacAddress, favorite bool) error

func (Stations) SetLegacy

func (s Stations) SetLegacy(ctx context.Context, client MacAddress, legacy bool) error

func (Stations) SetName

func (s Stations) SetName(ctx context.Context, client MacAddress, name string) error

SetName sets the name of a client. If the name is non-empty, the given name will override the automatic name, and the device will remember the client even if it disconnects. There is a limit of 500ish renamed clients.

A client can be forgotten by setting it to an empty name.

type Sysinfo

type Sysinfo struct {
	Uptime        int    `xml:"uptime,attr"`
	Version       string `xml:"version,attr"`
	VersionNum    string `xml:"version-num,attr"`
	BuildNum      string `xml:"build-num,attr"`
	Model         string `xml:"model,attr"`
	Uuid          string `xml:"uuid,attr"`
	Serial        string `xml:"serial,attr"`
	Maxap         int    `xml:"maxap,attr"`
	FixedCtryCode string `xml:"fixed-ctry-code,attr"`
	EthNum        int    `xml:"eth-num,attr"`
	PoePort       string `xml:"poe-port,attr"`
	MaxConnectAp  int    `xml:"max_connect_ap,attr"`
}

type TLS

type TLS struct {
	// contains filtered or unexported fields
}

func (TLS) GetCertificateRequest

func (t TLS) GetCertificateRequest(ctx context.Context, input CsrInput) (*x509.CertificateRequest, error)

GetCertificateRequest asks the device to generate and sign a certificate signing request for a given CsrInput.

func (TLS) GetCertificates

func (t TLS) GetCertificates(ctx context.Context) ([]*x509.Certificate, error)

GetCertificates retrieves the current certificate chain from the device.

func (TLS) GetPrivateKey

func (t TLS) GetPrivateKey(ctx context.Context) (*rsa.PrivateKey, error)

GetPrivateKey retrieves the RSA private key from the device.

func (TLS) SetCertificates

func (t TLS) SetCertificates(ctx context.Context, certs []*x509.Certificate) error

SetCertificates sets the device's certificate chain to the provided certs.

The first certificate in the chain must have a public key corresponding to the device's private key.

func (TLS) SetPrivateKey

func (t TLS) SetPrivateKey(ctx context.Context, use2048bits bool) error

SetPrivateKey asks the device to generate a new private key.

This will force a reboot.

type Timestamp

type Timestamp struct {
	time.Time
}

func (Timestamp) MarshalText

func (t Timestamp) MarshalText() ([]byte, error)

func (*Timestamp) UnmarshalText

func (t *Timestamp) UnmarshalText(text []byte) error

type Wlan

type Wlan struct {
	ID          int    `xml:"id,attr,omitempty"`
	Name        string `xml:"name,attr"`
	Ssid        string `xml:"ssid,attr"`
	Description string `xml:"description,attr"`
	Usage       string `xml:"usage,attr"`
	IsGuest     bool   `xml:"is-guest,attr"`

	Authentication WlanAuthentication `xml:"authentication,attr"`
	EapType        WlanEapType        `xml:"eap-type,attr,omitempty"`

	Encryption WlanEncryption `xml:"encryption,attr"`
	// Wpa must be present for WPA2- or WPA3-related Encryption, but must be absent for WlanEncryptionNone or
	// WlanEncryptionOwe.
	Wpa *WlanWpa `xml:"wpa"`

	EnableType WlanEnablement `xml:"enable-type,attr"`

	AllowIotConnect     EnabledBool       `xml:"allow-iot-connect,attr"`
	AcctsvrID           int               `xml:"acctsvr-id,attr"`
	AcctUpdInterval     int               `xml:"acct-upd-interval,attr"`
	AutoProvisioning    EnabledBool       `xml:"auto-provisioning,attr"`
	CloseSystem         bool              `xml:"close-system,attr"`
	VlanID              int               `xml:"vlan-id,attr"`
	Dvlan               EnabledBool       `xml:"dvlan,attr"`
	MaxClientsPerRadio  int               `xml:"max-clients-per-radio,attr"`
	DoWmmAc             EnabledBool       `xml:"do-wmm-ac,attr"`
	AclID               int               `xml:"acl-id,attr"`
	PolicyID            string            `xml:"policy-id,attr"`
	DevicepolicyID      string            `xml:"devicepolicy-id,attr"`
	FastBss             EnabledBool       `xml:"fast-bss,attr"`
	Bgscan              IntBool           `xml:"bgscan,attr"`
	Balance             IntBool           `xml:"balance,attr"`
	BandBalance         IntBool           `xml:"band-balance,attr"`
	Do80211d            EnabledBool       `xml:"do-802-11d,attr"`
	WlanBind            IntBool           `xml:"wlan_bind,attr"`
	ForceDhcp           IntBool           `xml:"force-dhcp,attr"`
	ForceDhcpTimeout    int               `xml:"force-dhcp-timeout,attr"`
	MaxIdleTimeout      int               `xml:"max-idle-timeout,attr"`
	IdleTimeout         bool              `xml:"idle-timeout,attr"`
	ClientIsolation     EnabledBool       `xml:"client-isolation,attr"`
	CiWhitelistID       int               `xml:"ci-whitelist-id,attr"`
	DtimPeriod          int               `xml:"dtim-period,attr"`
	DirectedMbc         int               `xml:"directed-mbc,attr"`
	ClientFlowLog       EnabledBool       `xml:"client-flow-log,attr"`
	ExportClientLog     bool              `xml:"export-client-log,attr"`
	Wifi6               bool              `xml:"wifi6,attr"`
	Do80211w            IntBool           `xml:"do-802-11w,attr"`
	WebAuth             EnabledBool       `xml:"web-auth,attr"`
	HttpsRedirection    EnabledBool       `xml:"https-redirection,attr"`
	OfdmRateOnly        bool              `xml:"ofdm-rate-only,attr"`
	BssMinrate          int               `xml:"bss-minrate,attr"`
	TxRateConfig        int               `xml:"tx-rate-config,attr"`
	CalledStationIDType int               `xml:"called-station-id-type,attr"`
	Option82            int               `xml:"option82,attr"`
	Option82Opt1        int               `xml:"option82-opt1,attr"`
	Option82Opt2        int               `xml:"option82-opt2,attr"`
	Option82Opt150      int               `xml:"option82-opt150,attr"`
	Option82Opt151      int               `xml:"option82-opt151,attr"`
	DisDgaf             int               `xml:"dis-dgaf,attr"`
	Parp                int               `xml:"parp,attr"`
	Authstats           int               `xml:"authstats,attr"`
	StaInfoExtraction   IntBool           `xml:"sta-info-extraction,attr"`
	PoolID              string            `xml:"pool-id,attr"`
	LocalBridge         IntBool           `xml:"local-bridge,attr"`
	DhcpsvrID           int               `xml:"dhcpsvr-id,attr"`
	PrecedenceID        int               `xml:"precedence-id,attr"`
	RoleBasedAccessCtrl bool              `xml:"role-based-access-ctrl,attr"`
	Option82AreaName    string            `xml:"option82-areaName,attr"`
	GuestserviceID      int               `xml:"guestservice-id,attr"`
	AuthsvrID           string            `xml:"authsvr-id,attr"`
	WlanSurvivability   string            `xml:"wlan-survivability,attr"`
	MacAddrFormat       string            `xml:"mac-addr-format,attr"`
	QueuePriority       WlanQueuePriority `xml:"queue-priority"`
	Qos                 WlanQos           `xml:"qos"`
	Rrm                 struct {
		NeighborReport EnabledBool `xml:"neighbor-report,attr"`
	} `xml:"rrm"`
	Smartcast struct {
		McastFilter EnabledBool `xml:"mcast-filter,attr"`
	} `xml:"smartcast"`
	WlanSchedule WlanSchedule `xml:"wlan-schedule"`
	AvpPolicy    struct {
		AvpEnabled EnabledBool `xml:"avp-enabled,attr"`
		AvpdenyID  int         `xml:"avpdeny-id,attr"`
	} `xml:"avp-policy"`
	UrlfilteringPolicy struct {
		UrlfilteringEnabled EnabledBool `xml:"urlfiltering-enabled,attr"`
		UrlfilteringID      int         `xml:"urlfiltering-id,attr"`
	} `xml:"urlfiltering-policy"`
	WificallingPolicy struct {
		WificallingEnabled EnabledBool `xml:"wificalling-enabled,attr"`
		ProfileID          int         `xml:"profile-id,attr"`
	} `xml:"wificalling-policy"`
}

func NewWlan

func NewWlan(name string) Wlan

type WlanAuthentication

type WlanAuthentication int
const (
	// "open"
	WlanAuthenticationOpen WlanAuthentication = iota
	// "802.1x-eap"
	WlanAuthentication8021xEAP
	// "mac-auth"
	WlanAuthenticationMAC
)

type WlanEapType

type WlanEapType int
const (
	WlanEapTypeNone WlanEapType = iota
	// "PEAP"
	WlanEapTypePEAP
)

type WlanEnablement

type WlanEnablement int
const (
	WlanEnablementAlwaysOn WlanEnablement = iota
	WlanEnablementAlwaysOff
	WlanEnablementScheduled
)

type WlanEncryption

type WlanEncryption int
const (
	WlanEncryptionNone WlanEncryption = iota
	WlanEncryptionWpa2
	WlanEncryptionWpa2Wpa3Mixed
	WlanEncryptionWpa3
	WlanEncryptionOwe
)

func (WlanEncryption) MarshalText

func (e WlanEncryption) MarshalText() ([]byte, error)

func (*WlanEncryption) UnmarshalText

func (e *WlanEncryption) UnmarshalText(text []byte) error

type WlanQos

type WlanQos struct {
	UplinkPreset          string `xml:"uplink-preset,attr"`
	DownlinkPreset        string `xml:"downlink-preset,attr"`
	PerssidUplinkPreset   int    `xml:"perssid-uplink-preset,attr"`
	PerssidDownlinkPreset int    `xml:"perssid-downlink-preset,attr"`
}

uplinkPreset: e.qos && e.qos.uplinkPreset ? r(e.qos.uplinkPreset) : "DISABLE", downlinkPreset: e.qos && e.qos.downlinkPreset ? r(e.qos.downlinkPreset) : "DISABLE", enablePerSSIDUplink: !(!e.qos || !e.qos.perssidUplinkPreset || "0" === e.qos.perssidUplinkPreset), perssidUplinkPreset: e.qos && e.qos.perssidUplinkPreset || "0", enablePerSSIDDownlink: !(!e.qos || !e.qos.perssidDownlinkPreset || "0" === e.qos.perssidDownlinkPreset), perssidDownlinkPreset: e.qos && e.qos.perssidDownlinkPreset || "0"

type WlanQueuePriority

type WlanQueuePriority bool

WlanQueuePriority is either true indicating "HIGH" priority or false indicating "LOW" priority.

func (WlanQueuePriority) MarshalXML

func (p WlanQueuePriority) MarshalXML(e *xml.Encoder, se xml.StartElement) error

func (*WlanQueuePriority) UnmarshalXML

func (p *WlanQueuePriority) UnmarshalXML(d *xml.Decoder, se xml.StartElement) error

type WlanSchedule

type WlanSchedule [7]WlanScheduleDay

WlanSchedule describes when a Wlan should be enabled in terms of a 7-day week. Day 0 is Sunday.

func (WlanSchedule) MarshalXML

func (s WlanSchedule) MarshalXML(e *xml.Encoder, se xml.StartElement) error

func (WlanSchedule) String

func (s WlanSchedule) String() string

func (*WlanSchedule) UnmarshalXML

func (s *WlanSchedule) UnmarshalXML(d *xml.Decoder, se xml.StartElement) error

type WlanScheduleDay

type WlanScheduleDay [96]bool

WlanScheduleDay describes when a Wlan should be enabled in terms of 15-minute increments over a 24-hour day. Index 0 is 00:00-00:15 UTC, index 1 is 00:15-00:30 UTC, and so on.

type WlanStatus

type WlanStatus struct {
	ID        int    `xml:"id,attr"`
	Ssid      string `xml:"ssid,attr"`
	AssocStas int    `xml:"assoc-stas,attr"`
	State     string `xml:"state,attr"`
	History   struct {
		RxBytes ByteTimeSeries `xml:"rx-bytes,attr"`
		TxBytes ByteTimeSeries `xml:"tx-bytes,attr"`
		Rssi    RssiTimeSeries `xml:"rssi,attr"`
	} `xml:"history"`
}

type WlanWpa

type WlanWpa struct {
	// XPassphrase can only contain between 8 and 63 characters or 64 HEX characters, and cannot start or end with
	// space.
	XPassphrase string `xml:"x-passphrase,attr"`
	Passphrase  string `xml:"passphrase,attr"` //?
	// FIXME: Cipher should be "aes".
	Cipher string `xml:"cipher,attr"`
	/// XSaePassphrase can only contain between 8 and 63 characters, and cannot start or end with a space.
	XSaePassphrase string `xml:"x-sae-passphrase,attr"`
	/// SAEPassphrase can only contain between 8 and 63 characters, and cannot start or end with a space.
	SaePassphrase string `xml:"sae-passphrase,attr"`

	//?
	DynamicPsk    EnabledBool `xml:"dynamic-psk,attr"`
	DynamicPskLen string      `xml:"dynamic-psk-len,attr"`
	DpskType      string      `xml:"dpsk-type,attr"`
}

type Wlans

type Wlans struct {
	// contains filtered or unexported fields
}

func (Wlans) Create

func (w Wlans) Create(ctx context.Context, wlan Wlan) (*Wlan, error)

Create creates a Wlan.

Careful: Unleashed does no validation on create and can enter crash loops when presented with invalid data. Recovery requires deleting the offending Wlan from the CLI.

func (Wlans) Delete

func (w Wlans) Delete(ctx context.Context, id int) error

Delete a Wlan by ID.

func (Wlans) List

func (w Wlans) List(ctx context.Context) ([]Wlan, error)

func (Wlans) Update

func (w Wlans) Update(ctx context.Context, wlan Wlan) error

Update updates a Wlan, replacing the record.

Careful: Unleashed does no validation on update and can enter crash loops when presented with invalid data. Recovery requires deleting the offending Wlan from the CLI.

Jump to

Keyboard shortcuts

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