models

package
v0.0.0-...-9cdc9d2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ELEMENT_IDS = map[byte]string{
	0:   "SSID",
	1:   "SUPPORTED_RATES",
	5:   "TRAFFIC_INDICATION_MAP",
	7:   "COUNTRY",
	11:  "QBSS",
	42:  "ERP_INFO",
	48:  "RSN",
	50:  "EXTENDED_SUPPORTED_RATES",
	61:  "HT_OPERATION",
	3:   "DS_PARAMETER_SET",
	45:  "HT_CAPABILITIES",
	127: "EXTENDED_CAPABILITIES",
	221: "VENDOR_SPECIFIC",
}

https://github.com/torvalds/linux/blob/master/include/linux/ieee80211.h#L1787

View Source
var Orm *gorm.DB

Functions

func APITLSCertificate

func APITLSCertificate() (pair tls.Certificate)

func APITLSConfig

func APITLSConfig() (config *tls.Config)

func APITLSData

func APITLSData() ([]byte, []byte)

func CollectorTLSConfig

func CollectorTLSConfig() *tls.Config

func Connect

func Connect()

func CreateUser

func CreateUser(username, password string, admin bool) (err error)

func DropUsers

func DropUsers()

Used for tests

func ParseFrameElements

func ParseFrameElements(stream []byte) (elements map[string][]byte)

func SetTLS

func SetTLS(request map[string]string) (err error)

func Setup

func Setup()

Types

type Alert

type Alert struct {
	gorm.Model
	Title    string
	Rule     string
	Severity string
}

func (*Alert) Delete

func (alert *Alert) Delete() error

func (*Alert) Save

func (alert *Alert) Save() error

type Association

type Association struct {
	Source             string
	Target             string
	DataToSource       int64
	DataToTarget       int64
	SourceTransmitting bool
	TargetTransmitting bool
	Direct             bool
}

An Assocation contains all the data about interactions between two MAC addresses

type Collector

type Collector struct {
	gorm.Model
	Name       string `sql:"not null;unique"`
	CaCert     string
	PrivateKey string
}

func CollectorByName

func CollectorByName(name string) (collector Collector, err error)

func Collectors

func Collectors() (collectors []Collector, err error)

func CreateCollector

func CreateCollector(name string) (collector Collector, err error)

func (*Collector) Delete

func (collector *Collector) Delete() error

type Device

type Device struct {
	MAC         string
	Vendor      string
	AccessPoint bool
	Probing     bool
	ProbedFor   []Network
	Online      bool
}

func (*Device) VisualData

func (device *Device) VisualData() map[string]string

type Network

type Network struct {
	SSID         string
	Clients      []Device
	AccessPoints []Device
}

func (*Network) VisualData

func (network *Network) VisualData() []map[string]string

type Session

type Session struct {
	gorm.Model
	UserID            uint
	Cookie            string
	OriginallyCreated time.Time
	LastUsed          time.Time
}

func SessionFromID

func SessionFromID(id string) (session Session, err error)

func (*Session) Delete

func (session *Session) Delete() error

func (Session) HTTPCookie

func (session Session) HTTPCookie() http.Cookie

func (*Session) Reload

func (session *Session) Reload() error

func (*Session) Save

func (session *Session) Save() error

func (Session) User

func (session Session) User() (user User, err error)

type TLS

type TLS struct {
	gorm.Model
	CaCert     string
	PrivateKey string
}

type User

type User struct {
	gorm.Model
	Name     string
	Password []byte
	Username string `sql:"not null;unique"`
	Admin    bool
	Sessions []Session
}

func CreateTestUser

func CreateTestUser(traits []string) (user User)

func UserByUsername

func UserByUsername(username string) (user User, err error)

func UserFromSessionCookie

func UserFromSessionCookie(session_cookie string) (user User, err error)

func Users

func Users() (users []User, err error)

func (*User) Delete

func (user *User) Delete() error

func (*User) DestroyAllOtherSessions

func (user *User) DestroyAllOtherSessions(session_cookie string)

func (*User) DestroyAllSessions

func (user *User) DestroyAllSessions()

func (*User) NewSession

func (user *User) NewSession() (wave_session string, err error)

func (User) OnlyAdmin

func (user User) OnlyAdmin() (only_admin bool, err error)

func (*User) Reload

func (user *User) Reload() error

func (*User) Save

func (user *User) Save() error

func (*User) SessionCount

func (user *User) SessionCount() int

func (*User) SetPassword

func (user *User) SetPassword(password string) (err error)

func (User) ValidAuthentication

func (user User) ValidAuthentication(password string) (valid bool)

type Wireless80211Frame

type Wireless80211Frame struct {
	Length           uint16
	TSFT             uint64
	FlagsRadio       layers.RadioTapFlags
	Rate             layers.RadioTapRate
	ChannelFrequency layers.RadioTapChannelFrequency
	ChannelFlags     layers.RadioTapChannelFlags
	FHSS             uint16
	DBMAntennaSignal int8
	DBMAntennaNoise  int8
	LockQuality      uint16
	TxAttenuation    uint16
	DBTxAttenuation  uint16
	DBMTxPower       int8
	Antenna          uint8
	DBAntennaSignal  uint8
	DBAntennaNoise   uint8
	RxFlags          layers.RadioTapRxFlags
	TxFlags          layers.RadioTapTxFlags
	RtsRetries       uint8
	DataRetries      uint8
	MCS              layers.RadioTapMCS
	AMPDUStatus      layers.RadioTapAMPDUStatus
	VHT              layers.RadioTapVHT
	Type             string
	Flags80211       layers.Dot11Flags
	Proto            uint8
	DurationID       uint16
	Address1         string
	Address2         string
	Address3         string
	Address4         string
	SequenceNumber   uint16
	FragmentNumber   uint16
	Checksum         uint32
	Elements         map[string][]byte
	Interface        string
}

func (*Wireless80211Frame) ParseElements

func (frame *Wireless80211Frame) ParseElements(packet gopacket.Packet, ether *layers.Dot11)

Jump to

Keyboard shortcuts

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