framesender

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: 13 Imported by: 0

Documentation

Overview

Package framesender provides utilities to send management frames.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*config)

Option is the type of options of Sender.Send call.

func Count

func Count(count int) Option

Count returns an Option which sets the count to send in Send config. 0 is a special value meaning endless send. When count=0 specified, the process will only stop on context done.

func Delay

func Delay(d int) Option

Delay returns an Option which sets the delay (in milliseconds) between frames.

func DestMAC

func DestMAC(mac string) Option

DestMAC returns an Option which sets the destination MAC.

func NumBSS

func NumBSS(n int) Option

NumBSS returns an Option which sets the number of BSS.

func ProbeRespFooter

func ProbeRespFooter(b []byte) Option

ProbeRespFooter returns an Option which sets the footer in probe response.

func SSIDPrefix

func SSIDPrefix(p string) Option

SSIDPrefix returns an Option which sets the SSID prefix.

type Sender

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

Sender sends management frame with send_management_frame tool provided by wifi-testbed package on test router.

func New

func New(host *ssh.Conn, iface, workDir string) *Sender

New creates a Sender object on host.

func (*Sender) Interface

func (s *Sender) Interface() string

Interface returns the interface that this sender works on.

func (Sender) ReserveForStop

func (s Sender) ReserveForStop(ctx context.Context) (context.Context, context.CancelFunc)

ReserveForStop reserves time in context for cleaning up in Stop.

func (*Sender) Send

func (s *Sender) Send(ctx context.Context, t Type, ch int, ops ...Option) error

Send executes send_management_frame tool to send management frames with type t on iface and ch channel with given options.

func (*Sender) Start

func (s *Sender) Start(ctx context.Context, t Type, ch int, ops ...Option) error

Start runs send_management_frame tool in background to send management frames with type t on iface and ch channel with given options.

func (*Sender) Stop

func (s *Sender) Stop(ctx context.Context) error

Stop aborts current running command spawned by previous Start call.

type Type

type Type string

Type is the enum type of frame type.

const (
	TypeBeacon        Type = "beacon"
	TypeChannelSwitch Type = "channel_switch"
	TypeProbeResponse Type = "probe_response"
)

Type enum values.

Jump to

Keyboard shortcuts

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