Documentation ¶
Index ¶
- Constants
- Variables
- func ActivateInterface(name string) error
- func ChannelHopping(iface string, chanList string, allChannels []int, hopPeriod int)
- func SetChannel(iface string, channel int) (error, string)
- func SupportedChannels(iface string) ([]int, error)
- type Memory
- type PacketCallback
- type PacketMuxer
- type Peer
- func (peer *Peer) Advertise(enabled bool)
- func (peer *Peer) Data() map[string]interface{}
- func (peer *Peer) ID() string
- func (peer *Peer) InactiveFor() float64
- func (peer *Peer) MarshalJSON() ([]byte, error)
- func (peer *Peer) SetData(adv map[string]interface{})
- func (peer *Peer) StartAdvertising(iface string) (err error)
- func (peer *Peer) StopAdvertising()
- func (peer *Peer) Update(radio *layers.RadioTap, dot11 *layers.Dot11, adv map[string]interface{}) (err error)
- type PeerActivityCallback
- type Router
- type SessionID
Constants ¶
View Source
const ( // ErrIfaceNotUp Ugly, but gopacket folks are not exporting pcap errors, so ... // ref. https://github.com/gopacket/gopacket/blob/96986c90e3e5c7e01deed713ff8058e357c0c047/pcap/pcap.go#L281 ErrIfaceNotUp = "Interface Not Up" )
Variables ¶
View Source
var ( SnapLength = 65536 ReadTimeout = 100 )
View Source
var ( Workers = 0 PeerTTL = 1800 Peers = sync.Map{} )
View Source
var (
SignalingPeriod = 300
)
Functions ¶
func ActivateInterface ¶
func ChannelHopping ¶
func SupportedChannels ¶
Types ¶
type Memory ¶
func MemoryFromPath ¶
type PacketCallback ¶
type PacketMuxer ¶
type PacketMuxer struct {
// contains filtered or unexported fields
}
func NewPacketMuxer ¶
func NewPacketMuxer(iface, filter string, workers int) (mux *PacketMuxer, err error)
func (*PacketMuxer) OnPacket ¶
func (mux *PacketMuxer) OnPacket(cb PacketCallback)
func (*PacketMuxer) Start ¶
func (mux *PacketMuxer) Start()
func (*PacketMuxer) Stop ¶
func (mux *PacketMuxer) Stop()
func (*PacketMuxer) Write ¶
func (mux *PacketMuxer) Write(data []byte) error
type Peer ¶
type Peer struct { sync.Mutex MetAt time.Time // first time met DetectedAt time.Time // first time detected on this session SeenAt time.Time // last time detected on this session PrevSeenAt time.Time // if we met this unit before, this is the last time it's been seen Encounters uint64 Channel int RSSI int SessionID SessionID SessionIDStr string Keys *crypto.KeyPair AdvData sync.Map AdvPeriod int ForceDisabled bool // contains filtered or unexported fields }
func (*Peer) InactiveFor ¶
func (*Peer) MarshalJSON ¶
func (*Peer) StartAdvertising ¶
func (*Peer) StopAdvertising ¶
func (peer *Peer) StopAdvertising()
type PeerActivityCallback ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) OnNewPeer ¶
func (router *Router) OnNewPeer(cb PeerActivityCallback)
func (*Router) OnPeerLost ¶
func (router *Router) OnPeerLost(cb PeerActivityCallback)
Click to show internal directories.
Click to hide internal directories.