openiot

package
v0.0.0-...-11667e1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: GPL-3.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EncryptionType_name = map[int32]string{
	0: "PLAIN",
	1: "AES_ECB",
	2: "AES_CBC",
}
View Source
var EncryptionType_value = map[string]int32{
	"PLAIN":   0,
	"AES_ECB": 1,
	"AES_CBC": 2,
}

Functions

This section is empty.

Types

type EncryptionType

type EncryptionType int32
const (
	EncryptionType_PLAIN   EncryptionType = 0
	EncryptionType_AES_ECB EncryptionType = 1
	EncryptionType_AES_CBC EncryptionType = 2
)

func (EncryptionType) EnumDescriptor

func (EncryptionType) EnumDescriptor() ([]byte, []int)

func (EncryptionType) String

func (x EncryptionType) String() string
type Header struct {
	// Unique (at least within network) device ID.
	DeviceId uint64 `protobuf:"varint,100,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
	// CRC of message data before encryption (if desired).
	Crc uint32 `protobuf:"fixed32,101,opt,name=crc,proto3" json:"crc,omitempty"`
	// Indicates that next message is KeyExchangeRequest/KeyExchangeResponse
	KeyExchange bool `protobuf:"varint,102,opt,name=key_exchange,json=keyExchange,proto3" json:"key_exchange,omitempty"`
	// Indicates that next message is JoinRequest/JoinResponse
	JoinRequest bool `protobuf:"varint,103,opt,name=join_request,json=joinRequest,proto3" json:"join_request,omitempty"`
	// Optional: for AES_CBC encoding
	AesIv                []byte   `protobuf:"bytes,104,opt,name=aes_iv,json=aesIv,proto3" json:"aes_iv,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Always unencrypted message header to be able to find decryption key by device id.

func (*Header) Descriptor

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

func (*Header) GetAesIv

func (m *Header) GetAesIv() []byte

func (*Header) GetCrc

func (m *Header) GetCrc() uint32

func (*Header) GetDeviceId

func (m *Header) GetDeviceId() uint64

func (*Header) GetJoinRequest

func (m *Header) GetJoinRequest() bool

func (*Header) GetKeyExchange

func (m *Header) GetKeyExchange() bool

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) Reset

func (m *Header) Reset()

func (*Header) String

func (m *Header) String() string

func (*Header) XXX_DiscardUnknown

func (m *Header) XXX_DiscardUnknown()

func (*Header) XXX_Marshal

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

func (*Header) XXX_Merge

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

func (*Header) XXX_Size

func (m *Header) XXX_Size() int

func (*Header) XXX_Unmarshal

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

type JoinRequest

type JoinRequest struct {
	// Names
	Name         string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Manufacturer string `protobuf:"bytes,2,opt,name=manufacturer,proto3" json:"manufacturer,omitempty"`
	ProductUrl   string `protobuf:"bytes,3,opt,name=product_url,json=productUrl,proto3" json:"product_url,omitempty"`
	// Default DeviceHandler name
	DefaultHandler string `protobuf:"bytes,4,opt,name=default_handler,json=defaultHandler,proto3" json:"default_handler,omitempty"`
	// Name of device message (in package.name format), e.g.:
	// "sensor.MultiSensor"
	ProtobufName         string   `protobuf:"bytes,5,opt,name=protobuf_name,json=protobufName,proto3" json:"protobuf_name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Request to join IoT network from device. If device uses encryption it must complete key exchange before and encrypt JoinRequest as well.

func (*JoinRequest) Descriptor

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

func (*JoinRequest) GetDefaultHandler

func (m *JoinRequest) GetDefaultHandler() string

func (*JoinRequest) GetManufacturer

func (m *JoinRequest) GetManufacturer() string

func (*JoinRequest) GetName

func (m *JoinRequest) GetName() string

func (*JoinRequest) GetProductUrl

func (m *JoinRequest) GetProductUrl() string

func (*JoinRequest) GetProtobufName

func (m *JoinRequest) GetProtobufName() string

func (*JoinRequest) ProtoMessage

func (*JoinRequest) ProtoMessage()

func (*JoinRequest) Reset

func (m *JoinRequest) Reset()

func (*JoinRequest) String

func (m *JoinRequest) String() string

func (*JoinRequest) XXX_DiscardUnknown

func (m *JoinRequest) XXX_DiscardUnknown()

func (*JoinRequest) XXX_Marshal

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

func (*JoinRequest) XXX_Merge

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

func (*JoinRequest) XXX_Size

func (m *JoinRequest) XXX_Size() int

func (*JoinRequest) XXX_Unmarshal

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

type JoinResponse

type JoinResponse struct {
	// Server's name
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Server's timestamp
	Timestamp            int64    `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Request to join response from controller to device.

func (*JoinResponse) Descriptor

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

func (*JoinResponse) GetName

func (m *JoinResponse) GetName() string

func (*JoinResponse) GetTimestamp

func (m *JoinResponse) GetTimestamp() int64

func (*JoinResponse) ProtoMessage

func (*JoinResponse) ProtoMessage()

func (*JoinResponse) Reset

func (m *JoinResponse) Reset()

func (*JoinResponse) String

func (m *JoinResponse) String() string

func (*JoinResponse) XXX_DiscardUnknown

func (m *JoinResponse) XXX_DiscardUnknown()

func (*JoinResponse) XXX_Marshal

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

func (*JoinResponse) XXX_Merge

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

func (*JoinResponse) XXX_Size

func (m *JoinResponse) XXX_Size() int

func (*JoinResponse) XXX_Unmarshal

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

type KeyExchangeRequest

type KeyExchangeRequest struct {
	// Diffie-Hellman modulus
	DhP uint64 `protobuf:"varint,1,opt,name=dh_p,json=dhP,proto3" json:"dh_p,omitempty"`
	// Diffie-Hellman base
	DhG uint64 `protobuf:"varint,2,opt,name=dh_g,json=dhG,proto3" json:"dh_g,omitempty"`
	// "Public" key of device
	DhA []uint32 `protobuf:"varint,3,rep,packed,name=dh_a,json=dhA,proto3" json:"dh_a,omitempty"`
	// Desired encryption type
	EncryptionType       EncryptionType `` /* 132-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

Diffie-Hellman key exchange: device to controller.

func (*KeyExchangeRequest) Descriptor

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

func (*KeyExchangeRequest) GetDhA

func (m *KeyExchangeRequest) GetDhA() []uint32

func (*KeyExchangeRequest) GetDhG

func (m *KeyExchangeRequest) GetDhG() uint64

func (*KeyExchangeRequest) GetDhP

func (m *KeyExchangeRequest) GetDhP() uint64

func (*KeyExchangeRequest) GetEncryptionType

func (m *KeyExchangeRequest) GetEncryptionType() EncryptionType

func (*KeyExchangeRequest) ProtoMessage

func (*KeyExchangeRequest) ProtoMessage()

func (*KeyExchangeRequest) Reset

func (m *KeyExchangeRequest) Reset()

func (*KeyExchangeRequest) String

func (m *KeyExchangeRequest) String() string

func (*KeyExchangeRequest) XXX_DiscardUnknown

func (m *KeyExchangeRequest) XXX_DiscardUnknown()

func (*KeyExchangeRequest) XXX_Marshal

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

func (*KeyExchangeRequest) XXX_Merge

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

func (*KeyExchangeRequest) XXX_Size

func (m *KeyExchangeRequest) XXX_Size() int

func (*KeyExchangeRequest) XXX_Unmarshal

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

type KeyExchangeResponse

type KeyExchangeResponse struct {
	DhB                  []uint32 `protobuf:"varint,1,rep,packed,name=dh_b,json=dhB,proto3" json:"dh_b,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Diffie-Hellman key exchange: controller to device.

func (*KeyExchangeResponse) Descriptor

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

func (*KeyExchangeResponse) GetDhB

func (m *KeyExchangeResponse) GetDhB() []uint32

func (*KeyExchangeResponse) ProtoMessage

func (*KeyExchangeResponse) ProtoMessage()

func (*KeyExchangeResponse) Reset

func (m *KeyExchangeResponse) Reset()

func (*KeyExchangeResponse) String

func (m *KeyExchangeResponse) String() string

func (*KeyExchangeResponse) XXX_DiscardUnknown

func (m *KeyExchangeResponse) XXX_DiscardUnknown()

func (*KeyExchangeResponse) XXX_Marshal

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

func (*KeyExchangeResponse) XXX_Merge

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

func (*KeyExchangeResponse) XXX_Size

func (m *KeyExchangeResponse) XXX_Size() int

func (*KeyExchangeResponse) XXX_Unmarshal

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

type LeaveRequest

type LeaveRequest struct {
	Reason               string   `protobuf:"bytes,1,opt,name=reason,proto3" json:"reason,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Deveice request to leave IoT network

func (*LeaveRequest) Descriptor

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

func (*LeaveRequest) GetReason

func (m *LeaveRequest) GetReason() string

func (*LeaveRequest) ProtoMessage

func (*LeaveRequest) ProtoMessage()

func (*LeaveRequest) Reset

func (m *LeaveRequest) Reset()

func (*LeaveRequest) String

func (m *LeaveRequest) String() string

func (*LeaveRequest) XXX_DiscardUnknown

func (m *LeaveRequest) XXX_DiscardUnknown()

func (*LeaveRequest) XXX_Marshal

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

func (*LeaveRequest) XXX_Merge

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

func (*LeaveRequest) XXX_Size

func (m *LeaveRequest) XXX_Size() int

func (*LeaveRequest) XXX_Unmarshal

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

type LeaveResponse

type LeaveResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Controller response to leave network request

func (*LeaveResponse) Descriptor

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

func (*LeaveResponse) ProtoMessage

func (*LeaveResponse) ProtoMessage()

func (*LeaveResponse) Reset

func (m *LeaveResponse) Reset()

func (*LeaveResponse) String

func (m *LeaveResponse) String() string

func (*LeaveResponse) XXX_DiscardUnknown

func (m *LeaveResponse) XXX_DiscardUnknown()

func (*LeaveResponse) XXX_Marshal

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

func (*LeaveResponse) XXX_Merge

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

func (*LeaveResponse) XXX_Size

func (m *LeaveResponse) XXX_Size() int

func (*LeaveResponse) XXX_Unmarshal

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

type MessageInfo

type MessageInfo struct {
	// Auto-incremented sequence number to drop duplicates
	// uint32 should last about 136 years even if device / controller
	// will be sending messages every second
	Sequence uint32 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"`
	// Date & Time for RTC use case
	//
	// Server's time in BCD 24-hour format, e.g
	// HH:MM:SS
	// 0x102233 -> 10:22:33
	// 0x223344 -> 22:33:44
	Time uint32 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"`
	// Server's date in BCD format.
	// YY-MM-DD-WD
	// 0x20 10 11 01 -> Mon, Oct 11, 2020
	Date                 uint32   `protobuf:"varint,3,opt,name=date,proto3" json:"date,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

A message followed by Header and describes common parameters for all device / controller messages.

func (*MessageInfo) Descriptor

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

func (*MessageInfo) GetDate

func (m *MessageInfo) GetDate() uint32

func (*MessageInfo) GetSequence

func (m *MessageInfo) GetSequence() uint32

func (*MessageInfo) GetTime

func (m *MessageInfo) GetTime() uint32

func (*MessageInfo) ProtoMessage

func (*MessageInfo) ProtoMessage()

func (*MessageInfo) Reset

func (m *MessageInfo) Reset()

func (*MessageInfo) String

func (m *MessageInfo) String() string

func (*MessageInfo) XXX_DiscardUnknown

func (m *MessageInfo) XXX_DiscardUnknown()

func (*MessageInfo) XXX_Marshal

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

func (*MessageInfo) XXX_Merge

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

func (*MessageInfo) XXX_Size

func (m *MessageInfo) XXX_Size() int

func (*MessageInfo) XXX_Unmarshal

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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