message

package
v0.0.0-...-1959fcc Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PacketType_name = map[int32]string{
		0: "Heartbeat",
		1: "Keepalive",
		2: "Acknowledge",
		3: "Relay",
		4: "Fragment",
		5: "OpenTunnel",
		6: "PeerOffline",
	}
	PacketType_value = map[string]int32{
		"Heartbeat":   0,
		"Keepalive":   1,
		"Acknowledge": 2,
		"Relay":       3,
		"Fragment":    4,
		"OpenTunnel":  5,
		"PeerOffline": 6,
	}
)

Enum value maps for PacketType.

View Source
var (
	StatusCode_name = map[int32]string{
		0: "Success",
		1: "ServerInternal",
		2: "InvalidVersion",
		3: "AddConflicted",
		4: "VersionTooOld",
		5: "InvalidToken",
		6: "InvalidSecretKey",
		7: "InvalidIdentifier",
		8: "AddressUnavailable",
	}
	StatusCode_value = map[string]int32{
		"Success":            0,
		"ServerInternal":     1,
		"InvalidVersion":     2,
		"AddConflicted":      3,
		"VersionTooOld":      4,
		"InvalidToken":       5,
		"InvalidSecretKey":   6,
		"InvalidIdentifier":  7,
		"AddressUnavailable": 8,
	}
)

Enum value maps for StatusCode.

View Source
var File_packet_proto protoreflect.FileDescriptor
View Source
var File_restful_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type EmptyResponse

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

func (*EmptyResponse) Descriptor deprecated

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

Deprecated: Use EmptyResponse.ProtoReflect.Descriptor instead.

func (*EmptyResponse) ProtoMessage

func (*EmptyResponse) ProtoMessage()

func (*EmptyResponse) ProtoReflect

func (x *EmptyResponse) ProtoReflect() protoreflect.Message

func (*EmptyResponse) Reset

func (x *EmptyResponse) Reset()

func (*EmptyResponse) String

func (x *EmptyResponse) String() string

type OpenDeviceRequest

type OpenDeviceRequest struct {
	SecurityHeader *SecurityHeader `protobuf:"bytes,1,opt,name=securityHeader,proto3" json:"securityHeader,omitempty"`
	// Use DHCP if address not present
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// contains filtered or unexported fields
}

OpenDeviceRequest represents the request to open a device

func (*OpenDeviceRequest) Descriptor deprecated

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

Deprecated: Use OpenDeviceRequest.ProtoReflect.Descriptor instead.

func (*OpenDeviceRequest) GetAddress

func (x *OpenDeviceRequest) GetAddress() string

func (*OpenDeviceRequest) GetSecurityHeader

func (x *OpenDeviceRequest) GetSecurityHeader() *SecurityHeader

func (*OpenDeviceRequest) ProtoMessage

func (*OpenDeviceRequest) ProtoMessage()

func (*OpenDeviceRequest) ProtoReflect

func (x *OpenDeviceRequest) ProtoReflect() protoreflect.Message

func (*OpenDeviceRequest) Reset

func (x *OpenDeviceRequest) Reset()

func (*OpenDeviceRequest) String

func (x *OpenDeviceRequest) String() string

type OpenDeviceResponse

type OpenDeviceResponse struct {

	// Encoded by BASE64 and encrypted by the secret key, the cipher is used to
	// encrypt/decrypt the traffic between peers communication over UDP.
	Cipher string `protobuf:"bytes,1,opt,name=cipher,proto3" json:"cipher,omitempty"`
	// The static address contained in the request. An address will be allocated
	// by DHCP dynamically if the request don't contain a static address.
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// The broadcast address of the address
	Broadcast string `protobuf:"bytes,3,opt,name=broadcast,proto3" json:"broadcast,omitempty"`
	// The CIDR of the subnet
	Subnet string `protobuf:"bytes,4,opt,name=subnet,proto3" json:"subnet,omitempty"`
	// The credential to prove the device hold the address. All HTTP API/UDP
	// packet request which contain IP address should include the credential.
	// The credential is generated by gateway via private key and no way to
	// counterfeit by the other one.
	Credential string `protobuf:"bytes,5,opt,name=credential,proto3" json:"credential,omitempty"`
	// The lease of the credential and client should renew before the credential
	// expiration. The unit of the lease is second.
	Lease int64 `protobuf:"varint,6,opt,name=lease,proto3" json:"lease,omitempty"`
	// contains filtered or unexported fields
}

OpenDeviceRequest represents the response to open a device

func (*OpenDeviceResponse) Descriptor deprecated

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

Deprecated: Use OpenDeviceResponse.ProtoReflect.Descriptor instead.

func (*OpenDeviceResponse) GetAddress

func (x *OpenDeviceResponse) GetAddress() string

func (*OpenDeviceResponse) GetBroadcast

func (x *OpenDeviceResponse) GetBroadcast() string

func (*OpenDeviceResponse) GetCipher

func (x *OpenDeviceResponse) GetCipher() string

func (*OpenDeviceResponse) GetCredential

func (x *OpenDeviceResponse) GetCredential() string

func (*OpenDeviceResponse) GetLease

func (x *OpenDeviceResponse) GetLease() int64

func (*OpenDeviceResponse) GetSubnet

func (x *OpenDeviceResponse) GetSubnet() string

func (*OpenDeviceResponse) ProtoMessage

func (*OpenDeviceResponse) ProtoMessage()

func (*OpenDeviceResponse) ProtoReflect

func (x *OpenDeviceResponse) ProtoReflect() protoreflect.Message

func (*OpenDeviceResponse) Reset

func (x *OpenDeviceResponse) Reset()

func (*OpenDeviceResponse) String

func (x *OpenDeviceResponse) String() string

type OpenTunnelRequest

type OpenTunnelRequest struct {
	SecurityHeader *SecurityHeader `protobuf:"bytes,1,opt,name=securityHeader,proto3" json:"securityHeader,omitempty"`
	// credential represents the identity to prove current client hold the `self` address
	Credential string `protobuf:"bytes,2,opt,name=credential,proto3" json:"credential,omitempty"`
	// self represents the virtual IP address of requester
	Self string `protobuf:"bytes,3,opt,name=self,proto3" json:"self,omitempty"`
	// destination represents the virtual IP address of the tunnel target
	Destination string `protobuf:"bytes,4,opt,name=destination,proto3" json:"destination,omitempty"`
	// contains filtered or unexported fields
}

OpenTunnelRequest represents the request when trying to open a tunnel

func (*OpenTunnelRequest) Descriptor deprecated

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

Deprecated: Use OpenTunnelRequest.ProtoReflect.Descriptor instead.

func (*OpenTunnelRequest) GetCredential

func (x *OpenTunnelRequest) GetCredential() string

func (*OpenTunnelRequest) GetDestination

func (x *OpenTunnelRequest) GetDestination() string

func (*OpenTunnelRequest) GetSecurityHeader

func (x *OpenTunnelRequest) GetSecurityHeader() *SecurityHeader

func (*OpenTunnelRequest) GetSelf

func (x *OpenTunnelRequest) GetSelf() string

func (*OpenTunnelRequest) ProtoMessage

func (*OpenTunnelRequest) ProtoMessage()

func (*OpenTunnelRequest) ProtoReflect

func (x *OpenTunnelRequest) ProtoReflect() protoreflect.Message

func (*OpenTunnelRequest) Reset

func (x *OpenTunnelRequest) Reset()

func (*OpenTunnelRequest) String

func (x *OpenTunnelRequest) String() string

type PacketAcknowledge

type PacketAcknowledge struct {
	AckId int64 `protobuf:"varint,1,opt,name=ackId,proto3" json:"ackId,omitempty"`
	// contains filtered or unexported fields
}

func (*PacketAcknowledge) Descriptor deprecated

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

Deprecated: Use PacketAcknowledge.ProtoReflect.Descriptor instead.

func (*PacketAcknowledge) GetAckId

func (x *PacketAcknowledge) GetAckId() int64

func (*PacketAcknowledge) ProtoMessage

func (*PacketAcknowledge) ProtoMessage()

func (*PacketAcknowledge) ProtoReflect

func (x *PacketAcknowledge) ProtoReflect() protoreflect.Message

func (*PacketAcknowledge) Reset

func (x *PacketAcknowledge) Reset()

func (*PacketAcknowledge) String

func (x *PacketAcknowledge) String() string

type PacketHeartbeat

type PacketHeartbeat struct {
	Credential []byte `protobuf:"bytes,1,opt,name=credential,proto3" json:"credential,omitempty"`
	// contains filtered or unexported fields
}

func (*PacketHeartbeat) Descriptor deprecated

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

Deprecated: Use PacketHeartbeat.ProtoReflect.Descriptor instead.

func (*PacketHeartbeat) GetCredential

func (x *PacketHeartbeat) GetCredential() []byte

func (*PacketHeartbeat) ProtoMessage

func (*PacketHeartbeat) ProtoMessage()

func (*PacketHeartbeat) ProtoReflect

func (x *PacketHeartbeat) ProtoReflect() protoreflect.Message

func (*PacketHeartbeat) Reset

func (x *PacketHeartbeat) Reset()

func (*PacketHeartbeat) String

func (x *PacketHeartbeat) String() string

type PacketKeepalive

type PacketKeepalive struct {
	VirtAddress string `protobuf:"bytes,1,opt,name=virtAddress,proto3" json:"virtAddress,omitempty"`
	Nonce       string `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// contains filtered or unexported fields
}

func (*PacketKeepalive) Descriptor deprecated

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

Deprecated: Use PacketKeepalive.ProtoReflect.Descriptor instead.

func (*PacketKeepalive) GetNonce

func (x *PacketKeepalive) GetNonce() string

func (*PacketKeepalive) GetVirtAddress

func (x *PacketKeepalive) GetVirtAddress() string

func (*PacketKeepalive) ProtoMessage

func (*PacketKeepalive) ProtoMessage()

func (*PacketKeepalive) ProtoReflect

func (x *PacketKeepalive) ProtoReflect() protoreflect.Message

func (*PacketKeepalive) Reset

func (x *PacketKeepalive) Reset()

func (*PacketKeepalive) String

func (x *PacketKeepalive) String() string

type PacketOpenTunnel

type PacketOpenTunnel struct {
	AckId       int64  `protobuf:"varint,1,opt,name=ackId,proto3" json:"ackId,omitempty"`
	VirtAddress string `protobuf:"bytes,2,opt,name=virtAddress,proto3" json:"virtAddress,omitempty"`
	UdpAddress  string `protobuf:"bytes,3,opt,name=udpAddress,proto3" json:"udpAddress,omitempty"`
	// contains filtered or unexported fields
}

func (*PacketOpenTunnel) Descriptor deprecated

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

Deprecated: Use PacketOpenTunnel.ProtoReflect.Descriptor instead.

func (*PacketOpenTunnel) GetAckId

func (x *PacketOpenTunnel) GetAckId() int64

func (*PacketOpenTunnel) GetUdpAddress

func (x *PacketOpenTunnel) GetUdpAddress() string

func (*PacketOpenTunnel) GetVirtAddress

func (x *PacketOpenTunnel) GetVirtAddress() string

func (*PacketOpenTunnel) ProtoMessage

func (*PacketOpenTunnel) ProtoMessage()

func (*PacketOpenTunnel) ProtoReflect

func (x *PacketOpenTunnel) ProtoReflect() protoreflect.Message

func (*PacketOpenTunnel) Reset

func (x *PacketOpenTunnel) Reset()

func (*PacketOpenTunnel) String

func (x *PacketOpenTunnel) String() string

type PacketPeerOffline

type PacketPeerOffline struct {
	AckId       int64  `protobuf:"varint,1,opt,name=ackId,proto3" json:"ackId,omitempty"`
	VirtAddress string `protobuf:"bytes,2,opt,name=virtAddress,proto3" json:"virtAddress,omitempty"`
	// contains filtered or unexported fields
}

func (*PacketPeerOffline) Descriptor deprecated

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

Deprecated: Use PacketPeerOffline.ProtoReflect.Descriptor instead.

func (*PacketPeerOffline) GetAckId

func (x *PacketPeerOffline) GetAckId() int64

func (*PacketPeerOffline) GetVirtAddress

func (x *PacketPeerOffline) GetVirtAddress() string

func (*PacketPeerOffline) ProtoMessage

func (*PacketPeerOffline) ProtoMessage()

func (*PacketPeerOffline) ProtoReflect

func (x *PacketPeerOffline) ProtoReflect() protoreflect.Message

func (*PacketPeerOffline) Reset

func (x *PacketPeerOffline) Reset()

func (*PacketPeerOffline) String

func (x *PacketPeerOffline) String() string

type PacketRelay

type PacketRelay struct {
	Credential  []byte `protobuf:"bytes,1,opt,name=credential,proto3" json:"credential,omitempty"`
	VirtAddress string `protobuf:"bytes,2,opt,name=virtAddress,proto3" json:"virtAddress,omitempty"`
	Fragment    []byte `protobuf:"bytes,3,opt,name=fragment,proto3" json:"fragment,omitempty"`
	// contains filtered or unexported fields
}

func (*PacketRelay) Descriptor deprecated

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

Deprecated: Use PacketRelay.ProtoReflect.Descriptor instead.

func (*PacketRelay) GetCredential

func (x *PacketRelay) GetCredential() []byte

func (*PacketRelay) GetFragment

func (x *PacketRelay) GetFragment() []byte

func (*PacketRelay) GetVirtAddress

func (x *PacketRelay) GetVirtAddress() string

func (*PacketRelay) ProtoMessage

func (*PacketRelay) ProtoMessage()

func (*PacketRelay) ProtoReflect

func (x *PacketRelay) ProtoReflect() protoreflect.Message

func (*PacketRelay) Reset

func (x *PacketRelay) Reset()

func (*PacketRelay) String

func (x *PacketRelay) String() string

type PacketType

type PacketType int32
const (
	PacketType_Heartbeat   PacketType = 0 // UDP packet from peer to gateway
	PacketType_Keepalive   PacketType = 1 // UDP packet between peers
	PacketType_Acknowledge PacketType = 2 // ACK message to notify the gateway specified message has received
	PacketType_Relay       PacketType = 3 // UDP packet which will be relayed by the gateway
	PacketType_Fragment    PacketType = 4 // UDP packet the raw IP fragment read from virtual network device
	PacketType_OpenTunnel  PacketType = 5
	PacketType_PeerOffline PacketType = 6
)

func (PacketType) Descriptor

func (PacketType) Descriptor() protoreflect.EnumDescriptor

func (PacketType) Enum

func (x PacketType) Enum() *PacketType

func (PacketType) EnumDescriptor deprecated

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

Deprecated: Use PacketType.Descriptor instead.

func (PacketType) Number

func (x PacketType) Number() protoreflect.EnumNumber

func (PacketType) String

func (x PacketType) String() string

func (PacketType) Type

type PeerOfflineRequest

type PeerOfflineRequest struct {
	SecurityHeader *SecurityHeader `protobuf:"bytes,1,opt,name=securityHeader,proto3" json:"securityHeader,omitempty"`
	// the renewed credential in BASE64 representation
	Credential string `protobuf:"bytes,2,opt,name=credential,proto3" json:"credential,omitempty"`
	// contains filtered or unexported fields
}

PeerOfflineRequest is used to notify the gateway the current peer is offline

func (*PeerOfflineRequest) Descriptor deprecated

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

Deprecated: Use PeerOfflineRequest.ProtoReflect.Descriptor instead.

func (*PeerOfflineRequest) GetCredential

func (x *PeerOfflineRequest) GetCredential() string

func (*PeerOfflineRequest) GetSecurityHeader

func (x *PeerOfflineRequest) GetSecurityHeader() *SecurityHeader

func (*PeerOfflineRequest) ProtoMessage

func (*PeerOfflineRequest) ProtoMessage()

func (*PeerOfflineRequest) ProtoReflect

func (x *PeerOfflineRequest) ProtoReflect() protoreflect.Message

func (*PeerOfflineRequest) Reset

func (x *PeerOfflineRequest) Reset()

func (*PeerOfflineRequest) String

func (x *PeerOfflineRequest) String() string

type RenewCredentialRequest

type RenewCredentialRequest struct {
	SecurityHeader *SecurityHeader `protobuf:"bytes,1,opt,name=securityHeader,proto3" json:"securityHeader,omitempty"`
	// current credential in BASE64 representation
	Credential string `protobuf:"bytes,2,opt,name=credential,proto3" json:"credential,omitempty"`
	// contains filtered or unexported fields
}

RenewCredentialRequest is used to request renew the credential

func (*RenewCredentialRequest) Descriptor deprecated

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

Deprecated: Use RenewCredentialRequest.ProtoReflect.Descriptor instead.

func (*RenewCredentialRequest) GetCredential

func (x *RenewCredentialRequest) GetCredential() string

func (*RenewCredentialRequest) GetSecurityHeader

func (x *RenewCredentialRequest) GetSecurityHeader() *SecurityHeader

func (*RenewCredentialRequest) ProtoMessage

func (*RenewCredentialRequest) ProtoMessage()

func (*RenewCredentialRequest) ProtoReflect

func (x *RenewCredentialRequest) ProtoReflect() protoreflect.Message

func (*RenewCredentialRequest) Reset

func (x *RenewCredentialRequest) Reset()

func (*RenewCredentialRequest) String

func (x *RenewCredentialRequest) String() string

type RenewCredentialResponse

type RenewCredentialResponse struct {

	// the renewed credential in BASE64 representation
	Credential string `protobuf:"bytes,1,opt,name=credential,proto3" json:"credential,omitempty"`
	// The lease of the credential and client should renew before the credential
	// expiration. The unit of the lease is second.
	Lease int64 `protobuf:"varint,2,opt,name=lease,proto3" json:"lease,omitempty"`
	// contains filtered or unexported fields
}

func (*RenewCredentialResponse) Descriptor deprecated

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

Deprecated: Use RenewCredentialResponse.ProtoReflect.Descriptor instead.

func (*RenewCredentialResponse) GetCredential

func (x *RenewCredentialResponse) GetCredential() string

func (*RenewCredentialResponse) GetLease

func (x *RenewCredentialResponse) GetLease() int64

func (*RenewCredentialResponse) ProtoMessage

func (*RenewCredentialResponse) ProtoMessage()

func (*RenewCredentialResponse) ProtoReflect

func (x *RenewCredentialResponse) ProtoReflect() protoreflect.Message

func (*RenewCredentialResponse) Reset

func (x *RenewCredentialResponse) Reset()

func (*RenewCredentialResponse) String

func (x *RenewCredentialResponse) String() string

type SecurityHeader

type SecurityHeader struct {
	Version   string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	NetworkID string `protobuf:"bytes,2,opt,name=networkID,proto3" json:"networkID,omitempty"`
	// token represent the authentication information, and the schema of the token
	// is composed by: ${timestamp}.${encrypted}
	// - timestamp: a unit nano timestamp encoded by BASE64
	// - encrypted: the encrypted data encoded by BASE64
	Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*SecurityHeader) Descriptor deprecated

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

Deprecated: Use SecurityHeader.ProtoReflect.Descriptor instead.

func (*SecurityHeader) GetNetworkID

func (x *SecurityHeader) GetNetworkID() string

func (*SecurityHeader) GetToken

func (x *SecurityHeader) GetToken() string

func (*SecurityHeader) GetVersion

func (x *SecurityHeader) GetVersion() string

func (*SecurityHeader) ProtoMessage

func (*SecurityHeader) ProtoMessage()

func (*SecurityHeader) ProtoReflect

func (x *SecurityHeader) ProtoReflect() protoreflect.Message

func (*SecurityHeader) Reset

func (x *SecurityHeader) Reset()

func (*SecurityHeader) String

func (x *SecurityHeader) String() string

type StatusCode

type StatusCode int32
const (
	StatusCode_Success            StatusCode = 0
	StatusCode_ServerInternal     StatusCode = 1
	StatusCode_InvalidVersion     StatusCode = 2
	StatusCode_AddConflicted      StatusCode = 3
	StatusCode_VersionTooOld      StatusCode = 4
	StatusCode_InvalidToken       StatusCode = 5
	StatusCode_InvalidSecretKey   StatusCode = 6
	StatusCode_InvalidIdentifier  StatusCode = 7
	StatusCode_AddressUnavailable StatusCode = 8
)

func (StatusCode) Descriptor

func (StatusCode) Descriptor() protoreflect.EnumDescriptor

func (StatusCode) Enum

func (x StatusCode) Enum() *StatusCode

func (StatusCode) EnumDescriptor deprecated

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

Deprecated: Use StatusCode.Descriptor instead.

func (StatusCode) Number

func (x StatusCode) Number() protoreflect.EnumNumber

func (StatusCode) String

func (x StatusCode) String() string

func (StatusCode) Type

Jump to

Keyboard shortcuts

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