inform

package module
v0.0.0-...-18955cf Latest Latest
Warning

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

Go to latest
Published: May 12, 2017 License: MIT Imports: 15 Imported by: 0

README

unifi-inform

Unifi's inform protocol in Golang

Documentation

Index

Constants

View Source
const (
	MAGIC_NUMBER   uint32 = 1414414933
	INFORM_VERSION uint32 = 0
	DATA_VERSION   uint32 = 1

	ENCRYPT_FLAG uint16 = 1
	ZLIB_FLAG    uint16 = 2
	SNAPPY_FLAG  uint16 = 4
)

Variables

This section is empty.

Functions

func CompressSnappy

func CompressSnappy(data []byte) ([]byte, error)

func CompressZLib

func CompressZLib(data []byte) (result []byte, err error)

func DecompressSnappy

func DecompressSnappy(data []byte) ([]byte, error)

func DecompressZLib

func DecompressZLib(data []byte) (result []byte, err error)

func Decrypt

func Decrypt(iv IV, key data.Key, data []byte) (result []byte, err error)

func Encrypt

func Encrypt(iv IV, key data.Key, data []byte) (result []byte, err error)

Types

type Client

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

func NewClient

func NewClient(m messages.MacAddr, address string) *Client

func (*Client) SendInform

func (c *Client) SendInform() (messages.InformResponse, error)

func (*Client) StartDiscovery

func (c *Client) StartDiscovery()

type IV

type IV data.Key
var (
	NIL_IV IV = []byte{
		0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00,
	}
)

func GenerateIV

func GenerateIV() (IV, error)

type Packet

type Packet struct {
	Msg messages.Message
	// contains filtered or unexported fields
}

func NewPacket

func NewPacket(ap messages.MacAddr, msg messages.Message, k messages.Key) *Packet

func (Packet) IsEncrypted

func (p Packet) IsEncrypted() bool

func (Packet) IsSnappy

func (p Packet) IsSnappy() bool

func (Packet) IsZLib

func (p Packet) IsZLib() bool

func (Packet) Marshal

func (p Packet) Marshal() (result []byte, err error)

func (*Packet) Unmarshal

func (p *Packet) Unmarshal(data []byte, keyFetcher func(messages.MacAddr) (messages.Key, error)) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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