l2api

package
v0.0.0-...-19fda0b Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type L2NetStatus

type L2NetStatus struct {
	// Visible devices at this moment, according to last scan results.
	// This only includes discovered P2P devices.
	Scan []*MeshDevice `json:"scan,omitempty"`

	Stats string `json:"stat,omitempty"`

	// Visible wifi networks (all kinds), on last scan result - including non-dmesh
	Visible int `json:"visible,omitempty"`

	// My SSID and PSK, when acting as a P2P or AP server
	SSID string `json:"s,omitempty"`
	PSK  string `json:"p,omitempty"`

	// AP we are connected to, if operating as STA or P2P client.
	ConnectedWifi string `json:"w,omitempty"`

	// Frequency on the STA connection, from wpa_cli if available
	Freq int `json:"f,omitempty"`
	// Last level of AP signal, from wpa_cli
	Level int `json:"l,omitempty"`
}

L2NetStatus device status and discovery info, sent as body of "/net/status" messages. Sync with android Wifi.sendWifiDiscoveryStatus()

type MeshDevice

type MeshDevice struct {

	// If the device has a P2P or AP interface, the SSID and PSK of the device,
	// They may be obtained via P2P discovery or other means (nan, etc)
	SSID string `json:"s,omitempty"`
	// PSK - not included if it is the default or open network. To distinguish, use info from the beacon.
	PSK string `json:"p,omitempty"`

	// MAC is used with explicit P2P connect ( i.e. no hacks )
	// User input required on the receiving end ( PBC ).
	// This is the MAC of the P2P interface, as reported.
	// For BLE/NAN, it is the current MAC of the device.
	MAC string `json:"d,omitempty"`

	// Name, from the discovery.
	// Deprecated - should be at L6
	Name string `json:"N,omitempty"`

	// Set only if the device is currently visible in a recent scan.
	// Equivalent RSSI for BLE, Nan, etc - based on last packet
	Level int `json:"l,omitempty"`

	// Freq the device is listening on
	Freq int `json:"f,omitempty"`

	// Metadata extracted from DIRECT DNSSD
	// Deprecated: L6/control
	UserAgent string `json:"ua,omitempty"`

	//
	Net string `json:"n,omitempty"`

	// Capabilities and BSSID
	Cap   string `json:"c,omitempty"`
	BSSID string `json:"b,omitempty"`

	LastSeen time.Time `json:"lastSeen,omitempty"`

	// Only on supplicant, not on android. Will change when the DNS-SD data changes.
	ServiceUpdateInd int `json:"sui,omitempty"`
}

Info about a L2NetStatus-connected device. Originally used for Android P2P L2NetStatus connections. Must be in sync with com.github.costinm.dmesh.lm3.Device

func (*MeshDevice) String

func (md *MeshDevice) String() string

type Node

type Node struct {
	SSID                 string   `protobuf:"bytes,1,opt,name=SSID,proto3" json:"SSID,omitempty"`
	PSK                  string   `protobuf:"bytes,2,opt,name=PSK,proto3" json:"PSK,omitempty"`
	MAC                  string   `protobuf:"bytes,3,opt,name=MAC,proto3" json:"MAC,omitempty"`
	Name                 string   `protobuf:"bytes,4,opt,name=Name,proto3" json:"Name,omitempty"`
	Level                int32    `protobuf:"varint,5,opt,name=Level,proto3" json:"Level,omitempty"`
	Freq                 int32    `protobuf:"varint,6,opt,name=Freq,proto3" json:"Freq,omitempty"`
	UserAgent            string   `protobuf:"bytes,7,opt,name=UserAgent,proto3" json:"UserAgent,omitempty"`
	Net                  string   `protobuf:"bytes,8,opt,name=Net,proto3" json:"Net,omitempty"`
	Cap                  string   `protobuf:"bytes,9,opt,name=cap,proto3" json:"cap,omitempty"`
	BSSID                string   `protobuf:"bytes,10,opt,name=BSSID,proto3" json:"BSSID,omitempty"`
	LastSeen             uint64   `protobuf:"varint,11,opt,name=LastSeen,proto3" json:"LastSeen,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Node) Descriptor

func (*Node) Descriptor() ([]byte, []int)

func (*Node) GetBSSID

func (m *Node) GetBSSID() string

func (*Node) GetCap

func (m *Node) GetCap() string

func (*Node) GetFreq

func (m *Node) GetFreq() int32

func (*Node) GetLastSeen

func (m *Node) GetLastSeen() uint64

func (*Node) GetLevel

func (m *Node) GetLevel() int32

func (*Node) GetMAC

func (m *Node) GetMAC() string

func (*Node) GetName

func (m *Node) GetName() string

func (*Node) GetNet

func (m *Node) GetNet() string

func (*Node) GetPSK

func (m *Node) GetPSK() string

func (*Node) GetSSID

func (m *Node) GetSSID() string

func (*Node) GetUserAgent

func (m *Node) GetUserAgent() string

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) Reset

func (m *Node) Reset()

func (*Node) String

func (m *Node) String() string

func (*Node) XXX_DiscardUnknown

func (m *Node) XXX_DiscardUnknown()

func (*Node) XXX_Marshal

func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Node) XXX_Merge

func (m *Node) XXX_Merge(src proto.Message)

func (*Node) XXX_Size

func (m *Node) XXX_Size() int

func (*Node) XXX_Unmarshal

func (m *Node) XXX_Unmarshal(b []byte) error

type Status

type Status struct {
	// Number of L2-visible nodes - wifi, BT, BLE, of any type
	// TODO: should it be a map or indicate the type ?
	Visible int32 `protobuf:"varint,1,opt,name=visible,proto3" json:"visible,omitempty"`
	// Device local SSID. Empty if device doesn't support P2P or never started.
	SSID string `protobuf:"bytes,2,opt,name=SSID,proto3" json:"SSID,omitempty"`
	// PSK, if different from the default.
	PSK string `protobuf:"bytes,3,opt,name=PSK,proto3" json:"PSK,omitempty"`
	// AP this node is connected to, or empty if no STA connection.
	ConnectedWifi string `protobuf:"bytes,4,opt,name=ConnectedWifi,proto3" json:"ConnectedWifi,omitempty"`
	// Wifi Frequency and Level, if device is connected as STA.
	Freq                 int32    `protobuf:"varint,5,opt,name=freq,proto3" json:"freq,omitempty"`
	Level                int32    `protobuf:"varint,6,opt,name=level,proto3" json:"level,omitempty"`
	Scan                 []*Node  `protobuf:"bytes,7,rep,name=Scan,proto3" json:"Scan,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Status) Descriptor

func (*Status) Descriptor() ([]byte, []int)

func (*Status) GetConnectedWifi

func (m *Status) GetConnectedWifi() string

func (*Status) GetFreq

func (m *Status) GetFreq() int32

func (*Status) GetLevel

func (m *Status) GetLevel() int32

func (*Status) GetPSK

func (m *Status) GetPSK() string

func (*Status) GetSSID

func (m *Status) GetSSID() string

func (*Status) GetScan

func (m *Status) GetScan() []*Node

func (*Status) GetVisible

func (m *Status) GetVisible() int32

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) Reset

func (m *Status) Reset()

func (*Status) String

func (m *Status) String() string

func (*Status) XXX_DiscardUnknown

func (m *Status) XXX_DiscardUnknown()

func (*Status) XXX_Marshal

func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Status) XXX_Merge

func (m *Status) XXX_Merge(src proto.Message)

func (*Status) XXX_Size

func (m *Status) XXX_Size() int

func (*Status) XXX_Unmarshal

func (m *Status) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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