proto

package
v0.27.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: BSD-3-Clause Imports: 9 Imported by: 5

Documentation

Index

Constants

View Source
const HeaderId = "x-wiretrustee-peer-id"

protocol constants, field names that can be used by both client and server

View Source
const HeaderRegistered = "x-wiretrustee-peer-registered"

Variables

View Source
var (
	Body_Type_name = map[int32]string{
		0: "OFFER",
		1: "ANSWER",
		2: "CANDIDATE",
		4: "MODE",
	}
	Body_Type_value = map[string]int32{
		"OFFER":     0,
		"ANSWER":    1,
		"CANDIDATE": 2,
		"MODE":      4,
	}
)

Enum value maps for Body_Type.

View Source
var File_signalexchange_proto protoreflect.FileDescriptor
View Source
var SignalExchange_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "signalexchange.SignalExchange",
	HandlerType: (*SignalExchangeServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Send",
			Handler:    _SignalExchange_Send_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ConnectStream",
			Handler:       _SignalExchange_ConnectStream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "signalexchange.proto",
}

SignalExchange_ServiceDesc is the grpc.ServiceDesc for SignalExchange service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterSignalExchangeServer

func RegisterSignalExchangeServer(s grpc.ServiceRegistrar, srv SignalExchangeServer)

Types

type Body

type Body struct {
	Type    Body_Type `protobuf:"varint,1,opt,name=type,proto3,enum=signalexchange.Body_Type" json:"type,omitempty"`
	Payload string    `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	// wgListenPort is an actual WireGuard listen port
	WgListenPort   uint32 `protobuf:"varint,3,opt,name=wgListenPort,proto3" json:"wgListenPort,omitempty"`
	NetBirdVersion string `protobuf:"bytes,4,opt,name=netBirdVersion,proto3" json:"netBirdVersion,omitempty"`
	Mode           *Mode  `protobuf:"bytes,5,opt,name=mode,proto3" json:"mode,omitempty"`
	// featuresSupported list of supported features by the client of this protocol
	FeaturesSupported []uint32 `protobuf:"varint,6,rep,packed,name=featuresSupported,proto3" json:"featuresSupported,omitempty"`
	// RosenpassConfig is a Rosenpass config of the remote peer our peer tries to connect to
	RosenpassConfig *RosenpassConfig `protobuf:"bytes,7,opt,name=rosenpassConfig,proto3" json:"rosenpassConfig,omitempty"`
	// contains filtered or unexported fields
}

Actual body of the message that can contain credentials (type OFFER/ANSWER) or connection Candidate This part will be encrypted

func (*Body) Descriptor deprecated

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

Deprecated: Use Body.ProtoReflect.Descriptor instead.

func (*Body) GetFeaturesSupported added in v0.14.5

func (x *Body) GetFeaturesSupported() []uint32

func (*Body) GetMode added in v0.14.5

func (x *Body) GetMode() *Mode

func (*Body) GetNetBirdVersion added in v0.8.12

func (x *Body) GetNetBirdVersion() string

func (*Body) GetPayload

func (x *Body) GetPayload() string

func (*Body) GetRosenpassConfig added in v0.25.4

func (x *Body) GetRosenpassConfig() *RosenpassConfig

func (*Body) GetType

func (x *Body) GetType() Body_Type

func (*Body) GetWgListenPort added in v0.8.12

func (x *Body) GetWgListenPort() uint32

func (*Body) ProtoMessage

func (*Body) ProtoMessage()

func (*Body) ProtoReflect

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

func (*Body) Reset

func (x *Body) Reset()

func (*Body) String

func (x *Body) String() string

type Body_Type

type Body_Type int32

Message type

const (
	Body_OFFER     Body_Type = 0
	Body_ANSWER    Body_Type = 1
	Body_CANDIDATE Body_Type = 2
	Body_MODE      Body_Type = 4
)

func (Body_Type) Descriptor

func (Body_Type) Descriptor() protoreflect.EnumDescriptor

func (Body_Type) Enum

func (x Body_Type) Enum() *Body_Type

func (Body_Type) EnumDescriptor deprecated

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

Deprecated: Use Body_Type.Descriptor instead.

func (Body_Type) Number

func (x Body_Type) Number() protoreflect.EnumNumber

func (Body_Type) String

func (x Body_Type) String() string

func (Body_Type) Type

type EncryptedMessage

type EncryptedMessage struct {

	// Wireguard public key
	Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// Wireguard public key of the remote peer to connect to
	RemoteKey string `protobuf:"bytes,3,opt,name=remoteKey,proto3" json:"remoteKey,omitempty"`
	// encrypted message Body
	Body []byte `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

Used for sending through signal. The body of this message is the Body message encrypted with the Wireguard private key and the remote Peer key

func (*EncryptedMessage) Descriptor deprecated

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

Deprecated: Use EncryptedMessage.ProtoReflect.Descriptor instead.

func (*EncryptedMessage) GetBody

func (x *EncryptedMessage) GetBody() []byte

func (*EncryptedMessage) GetKey

func (x *EncryptedMessage) GetKey() string

func (*EncryptedMessage) GetRemoteKey

func (x *EncryptedMessage) GetRemoteKey() string

func (*EncryptedMessage) ProtoMessage

func (*EncryptedMessage) ProtoMessage()

func (*EncryptedMessage) ProtoReflect

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

func (*EncryptedMessage) Reset

func (x *EncryptedMessage) Reset()

func (*EncryptedMessage) String

func (x *EncryptedMessage) String() string

type Message

type Message struct {

	// WireGuard public key
	Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// WireGuard public key of the remote peer to connect to
	RemoteKey string `protobuf:"bytes,3,opt,name=remoteKey,proto3" json:"remoteKey,omitempty"`
	Body      *Body  `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

A decrypted representation of the EncryptedMessage. Used locally before/after encryption

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetBody

func (x *Message) GetBody() *Body

func (*Message) GetKey

func (x *Message) GetKey() string

func (*Message) GetRemoteKey

func (x *Message) GetRemoteKey() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type Mode added in v0.14.5

type Mode struct {
	Direct *bool `protobuf:"varint,1,opt,name=direct,proto3,oneof" json:"direct,omitempty"`
	// contains filtered or unexported fields
}

Mode indicates a connection mode

func (*Mode) Descriptor deprecated added in v0.14.5

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

Deprecated: Use Mode.ProtoReflect.Descriptor instead.

func (*Mode) GetDirect added in v0.14.5

func (x *Mode) GetDirect() bool

func (*Mode) ProtoMessage added in v0.14.5

func (*Mode) ProtoMessage()

func (*Mode) ProtoReflect added in v0.14.5

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

func (*Mode) Reset added in v0.14.5

func (x *Mode) Reset()

func (*Mode) String added in v0.14.5

func (x *Mode) String() string

type RosenpassConfig added in v0.25.4

type RosenpassConfig struct {
	RosenpassPubKey []byte `protobuf:"bytes,1,opt,name=rosenpassPubKey,proto3" json:"rosenpassPubKey,omitempty"`
	// rosenpassServerAddr is an IP:port of the rosenpass service
	RosenpassServerAddr string `protobuf:"bytes,2,opt,name=rosenpassServerAddr,proto3" json:"rosenpassServerAddr,omitempty"`
	// contains filtered or unexported fields
}

func (*RosenpassConfig) Descriptor deprecated added in v0.25.4

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

Deprecated: Use RosenpassConfig.ProtoReflect.Descriptor instead.

func (*RosenpassConfig) GetRosenpassPubKey added in v0.25.4

func (x *RosenpassConfig) GetRosenpassPubKey() []byte

func (*RosenpassConfig) GetRosenpassServerAddr added in v0.25.4

func (x *RosenpassConfig) GetRosenpassServerAddr() string

func (*RosenpassConfig) ProtoMessage added in v0.25.4

func (*RosenpassConfig) ProtoMessage()

func (*RosenpassConfig) ProtoReflect added in v0.25.4

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

func (*RosenpassConfig) Reset added in v0.25.4

func (x *RosenpassConfig) Reset()

func (*RosenpassConfig) String added in v0.25.4

func (x *RosenpassConfig) String() string

type SignalExchangeClient

type SignalExchangeClient interface {
	// Synchronously connect to the Signal Exchange service offering connection candidates and waiting for connection candidates from the other party (remote peer)
	Send(ctx context.Context, in *EncryptedMessage, opts ...grpc.CallOption) (*EncryptedMessage, error)
	// Connect to the Signal Exchange service offering connection candidates and maintain a channel for receiving candidates from the other party (remote peer)
	ConnectStream(ctx context.Context, opts ...grpc.CallOption) (SignalExchange_ConnectStreamClient, error)
}

SignalExchangeClient is the client API for SignalExchange service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type SignalExchangeServer

type SignalExchangeServer interface {
	// Synchronously connect to the Signal Exchange service offering connection candidates and waiting for connection candidates from the other party (remote peer)
	Send(context.Context, *EncryptedMessage) (*EncryptedMessage, error)
	// Connect to the Signal Exchange service offering connection candidates and maintain a channel for receiving candidates from the other party (remote peer)
	ConnectStream(SignalExchange_ConnectStreamServer) error
	// contains filtered or unexported methods
}

SignalExchangeServer is the server API for SignalExchange service. All implementations must embed UnimplementedSignalExchangeServer for forward compatibility

type SignalExchange_ConnectStreamClient

type SignalExchange_ConnectStreamClient interface {
	Send(*EncryptedMessage) error
	Recv() (*EncryptedMessage, error)
	grpc.ClientStream
}

type SignalExchange_ConnectStreamServer

type SignalExchange_ConnectStreamServer interface {
	Send(*EncryptedMessage) error
	Recv() (*EncryptedMessage, error)
	grpc.ServerStream
}

type UnimplementedSignalExchangeServer

type UnimplementedSignalExchangeServer struct {
}

UnimplementedSignalExchangeServer must be embedded to have forward compatible implementations.

func (UnimplementedSignalExchangeServer) ConnectStream

func (UnimplementedSignalExchangeServer) Send

type UnsafeSignalExchangeServer

type UnsafeSignalExchangeServer interface {
	// contains filtered or unexported methods
}

UnsafeSignalExchangeServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SignalExchangeServer will result in compilation errors.

Jump to

Keyboard shortcuts

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