diff --git a/.github/workflows/nightly-release.yaml b/.github/workflows/nightly-release.yaml index 573f292..086ab2f 100644 --- a/.github/workflows/nightly-release.yaml +++ b/.github/workflows/nightly-release.yaml @@ -21,11 +21,16 @@ jobs: - name: "Setup nix env" uses: JRMurr/direnv-nix-action@v4.1.0 - - name: Use Latest userwireguard and protocol + - name: Check if the current protobuf go files are up to date + working-directory: protocol + run: | + make + git diff --exit-code + + - name: Use Latest userwireguard run: | go mod edit -dropreplace github.com/urnetwork/userwireguard@v0.0.0 - go mod edit -dropreplace github.com/urnetwork/protocol@v0.0.0 - go mod edit -require github.com/urnetwork/userwireguard@latest -require github.com/urnetwork/protocol@latest + go mod edit -require github.com/urnetwork/userwireguard@latest go mod tidy - name: Install semver-release diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5489291..c7e820d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -24,11 +24,16 @@ jobs: - name: "Setup env" uses: JRMurr/direnv-nix-action@v4.1.0 - - name: Use Latest userwireguard and protocol + - name: Check if the current protobuf go files are up to date + working-directory: protocol + run: | + make + git diff --exit-code + + - name: Use Latest userwireguard run: | go mod edit -dropreplace github.com/urnetwork/userwireguard@v0.0.0 - go mod edit -dropreplace github.com/urnetwork/protocol@v0.0.0 - go mod edit -require github.com/urnetwork/userwireguard@latest -require github.com/urnetwork/protocol@latest + go mod edit -require github.com/urnetwork/userwireguard@latest go mod tidy - name: Run Tests diff --git a/connect.go b/connect.go index ea4f0b1..918555b 100644 --- a/connect.go +++ b/connect.go @@ -10,7 +10,7 @@ import ( "github.com/oklog/ulid/v2" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) const MaxMultihopLength = 8 diff --git a/connectctl/main.go b/connectctl/main.go index 633071e..d0b23cd 100644 --- a/connectctl/main.go +++ b/connectctl/main.go @@ -32,7 +32,7 @@ import ( "github.com/docopt/docopt-go" "github.com/urnetwork/connect" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) const ConnectCtlVersion = "0.0.1" diff --git a/extenderctl/main.gox b/extenderctl/main.gox index a6806d8..ab2e2cf 100644 --- a/extenderctl/main.gox +++ b/extenderctl/main.gox @@ -38,7 +38,7 @@ import ( "github.com/urnetwork/connect" // "github.com/urnetwork/connect" - // "github.com/urnetwork/protocol" + // "github.com/urnetwork/connect/protocol" ) // run [secret] [allowed host] [port] diff --git a/frame.go b/frame.go index 6eef31b..b28d71f 100644 --- a/frame.go +++ b/frame.go @@ -5,7 +5,7 @@ import ( "google.golang.org/protobuf/proto" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) func ToFrame(message proto.Message) (*protocol.Frame, error) { diff --git a/go.mod b/go.mod index 9ddbdc5..e48bcb3 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,6 @@ require ( github.com/mattn/go-shellwords v1.0.12 github.com/oklog/ulid/v2 v2.1.0 github.com/quic-go/quic-go v0.46.0 - github.com/urnetwork/protocol v0.0.0 github.com/urnetwork/userwireguard v0.0.0 golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 golang.org/x/term v0.20.0 @@ -62,6 +61,4 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/urnetwork/protocol v0.0.0 => ../protocol - replace github.com/urnetwork/userwireguard v0.0.0 => ../userwireguard diff --git a/go.sum b/go.sum index bc6cda3..7e9647d 100644 --- a/go.sum +++ b/go.sum @@ -97,8 +97,8 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/urnetwork/protocol v0.1.0 h1:XgBEVJ+8K24jVJH37CwkBi/szzh54PWBQaODElto5KQ= -github.com/urnetwork/protocol v0.1.0/go.mod h1:+JJm4mqeK95mTRMAGMeddzdUpPEnZmp2U8RYPjXb/JQ= +github.com/urnetwork/connect/protocol v0.1.0 h1:XgBEVJ+8K24jVJH37CwkBi/szzh54PWBQaODElto5KQ= +github.com/urnetwork/connect/protocol v0.1.0/go.mod h1:+JJm4mqeK95mTRMAGMeddzdUpPEnZmp2U8RYPjXb/JQ= github.com/urnetwork/userwireguard v0.0.1 h1:6tG7Oas3Ca1UPjenVmcuYmX87uRIyzc/3hz640wFwsM= github.com/urnetwork/userwireguard v0.0.1/go.mod h1:4o4/Mpn+ipHHx998wXkRt4yRXZh1bMMl2Ybivh71gLo= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= diff --git a/ip.go b/ip.go index ee07f1f..551e23e 100644 --- a/ip.go +++ b/ip.go @@ -24,7 +24,7 @@ import ( "github.com/golang/glog" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) // implements user-space NAT (UNAT) and packet inspection diff --git a/ip_remote_multi_client.go b/ip_remote_multi_client.go index 4f13411..513de3f 100644 --- a/ip_remote_multi_client.go +++ b/ip_remote_multi_client.go @@ -19,7 +19,7 @@ import ( "github.com/golang/glog" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) // multi client is a sender approach to mitigate bad destinations diff --git a/ip_remote_multi_client_test.go b/ip_remote_multi_client_test.go index a1f1f03..853dc0e 100644 --- a/ip_remote_multi_client_test.go +++ b/ip_remote_multi_client_test.go @@ -11,7 +11,7 @@ import ( "github.com/go-playground/assert/v2" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) func TestMultiClientUdp4(t *testing.T) { diff --git a/ip_test.go b/ip_test.go index 28beb94..e9514a3 100644 --- a/ip_test.go +++ b/ip_test.go @@ -16,7 +16,7 @@ import ( "github.com/go-playground/assert/v2" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) func TestClientUdp4(t *testing.T) { diff --git a/net_extender.go b/net_extender.go index 97c23d6..06cba7e 100644 --- a/net_extender.go +++ b/net_extender.go @@ -46,7 +46,7 @@ import ( // "src.agwa.name/tlshacks" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) // an extender uses an independent url that is hard-coded to forward to the platform diff --git a/net_extender_server.go b/net_extender_server.go index 3577b40..f924c08 100644 --- a/net_extender_server.go +++ b/net_extender_server.go @@ -47,7 +47,7 @@ import ( // "src.agwa.name/tlshacks" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) // server listens for a tls connect and replies with a self-signed cert diff --git a/protocol/MOVED.md b/protocol/MOVED.md deleted file mode 100644 index 7507c87..0000000 --- a/protocol/MOVED.md +++ /dev/null @@ -1 +0,0 @@ -moved to https://github.com/urnetwork/protocol diff --git a/protocol/Makefile b/protocol/Makefile new file mode 100644 index 0000000..bcd7e33 --- /dev/null +++ b/protocol/Makefile @@ -0,0 +1,6 @@ + +all: + protoc -I=. --go_out=. --go_opt=paths=source_relative *.proto + + + diff --git a/protocol/audit.pb.go b/protocol/audit.pb.go new file mode 100644 index 0000000..95ecd19 --- /dev/null +++ b/protocol/audit.pb.go @@ -0,0 +1,847 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v4.24.4 +// source: audit.proto + +package protocol + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type EgressProtocol int32 + +const ( + EgressProtocol_IP_TCP EgressProtocol = 0 + EgressProtocol_IP_UDP EgressProtocol = 1 +) + +// Enum value maps for EgressProtocol. +var ( + EgressProtocol_name = map[int32]string{ + 0: "IP_TCP", + 1: "IP_UDP", + } + EgressProtocol_value = map[string]int32{ + "IP_TCP": 0, + "IP_UDP": 1, + } +) + +func (x EgressProtocol) Enum() *EgressProtocol { + p := new(EgressProtocol) + *p = x + return p +} + +func (x EgressProtocol) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EgressProtocol) Descriptor() protoreflect.EnumDescriptor { + return file_audit_proto_enumTypes[0].Descriptor() +} + +func (EgressProtocol) Type() protoreflect.EnumType { + return &file_audit_proto_enumTypes[0] +} + +func (x EgressProtocol) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EgressProtocol.Descriptor instead. +func (EgressProtocol) EnumDescriptor() ([]byte, []int) { + return file_audit_proto_rawDescGZIP(), []int{0} +} + +// this is sent to the platform +// note the platform does not have prior knowledge and would have to brute force decrypt the audit record +// the provider creates and encrypts the final `AccountRecord` from the partial and discards the partial +type ProviderAudit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Egress *EncryptedEgressRecord `protobuf:"bytes,1,opt,name=Egress,proto3" json:"Egress,omitempty"` + // this data is used to encode the associated `AccountRecord` + // this data is not stored and should be thrown out by the platform + AccountPartial *AccountRecordPartial `protobuf:"bytes,2,opt,name=AccountPartial,proto3" json:"AccountPartial,omitempty"` +} + +func (x *ProviderAudit) Reset() { + *x = ProviderAudit{} + if protoimpl.UnsafeEnabled { + mi := &file_audit_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProviderAudit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProviderAudit) ProtoMessage() {} + +func (x *ProviderAudit) ProtoReflect() protoreflect.Message { + mi := &file_audit_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProviderAudit.ProtoReflect.Descriptor instead. +func (*ProviderAudit) Descriptor() ([]byte, []int) { + return file_audit_proto_rawDescGZIP(), []int{0} +} + +func (x *ProviderAudit) GetEgress() *EncryptedEgressRecord { + if x != nil { + return x.Egress + } + return nil +} + +func (x *ProviderAudit) GetAccountPartial() *AccountRecordPartial { + if x != nil { + return x.AccountPartial + } + return nil +} + +// kept local on provider +// time block is UTC in 50ms blocks +// a typical abuse report will have to account for +-60s, or look up about 1200 blocks per record +type EgressKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TimeBlock uint64 `protobuf:"varint,1,opt,name=TimeBlock,proto3" json:"TimeBlock,omitempty"` + Protocol EgressProtocol `protobuf:"varint,2,opt,name=Protocol,proto3,enum=bringyour.EgressProtocol" json:"Protocol,omitempty"` + SourceIp []byte `protobuf:"bytes,3,opt,name=SourceIp,proto3" json:"SourceIp,omitempty"` + SourcePort uint32 `protobuf:"varint,4,opt,name=SourcePort,proto3" json:"SourcePort,omitempty"` + DestinationIp []byte `protobuf:"bytes,5,opt,name=DestinationIp,proto3" json:"DestinationIp,omitempty"` + DestinationPort uint32 `protobuf:"varint,6,opt,name=DestinationPort,proto3" json:"DestinationPort,omitempty"` +} + +func (x *EgressKey) Reset() { + *x = EgressKey{} + if protoimpl.UnsafeEnabled { + mi := &file_audit_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EgressKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EgressKey) ProtoMessage() {} + +func (x *EgressKey) ProtoReflect() protoreflect.Message { + mi := &file_audit_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EgressKey.ProtoReflect.Descriptor instead. +func (*EgressKey) Descriptor() ([]byte, []int) { + return file_audit_proto_rawDescGZIP(), []int{1} +} + +func (x *EgressKey) GetTimeBlock() uint64 { + if x != nil { + return x.TimeBlock + } + return 0 +} + +func (x *EgressKey) GetProtocol() EgressProtocol { + if x != nil { + return x.Protocol + } + return EgressProtocol_IP_TCP +} + +func (x *EgressKey) GetSourceIp() []byte { + if x != nil { + return x.SourceIp + } + return nil +} + +func (x *EgressKey) GetSourcePort() uint32 { + if x != nil { + return x.SourcePort + } + return 0 +} + +func (x *EgressKey) GetDestinationIp() []byte { + if x != nil { + return x.DestinationIp + } + return nil +} + +func (x *EgressKey) GetDestinationPort() uint32 { + if x != nil { + return x.DestinationPort + } + return 0 +} + +// kept local on provider +type EgressKeyWithSalt struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key *EgressKey `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` + // 128-bit + Salt []byte `protobuf:"bytes,2,opt,name=Salt,proto3" json:"Salt,omitempty"` +} + +func (x *EgressKeyWithSalt) Reset() { + *x = EgressKeyWithSalt{} + if protoimpl.UnsafeEnabled { + mi := &file_audit_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EgressKeyWithSalt) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EgressKeyWithSalt) ProtoMessage() {} + +func (x *EgressKeyWithSalt) ProtoReflect() protoreflect.Message { + mi := &file_audit_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EgressKeyWithSalt.ProtoReflect.Descriptor instead. +func (*EgressKeyWithSalt) Descriptor() ([]byte, []int) { + return file_audit_proto_rawDescGZIP(), []int{2} +} + +func (x *EgressKeyWithSalt) GetKey() *EgressKey { + if x != nil { + return x.Key + } + return nil +} + +func (x *EgressKeyWithSalt) GetSalt() []byte { + if x != nil { + return x.Salt + } + return nil +} + +// this created on the provider so that the platform cannot see the raw data +// a complete audit record is an `EgressRecord` and an `AccountRecord` +type EncryptedEgressRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 128-bit + Salt []byte `protobuf:"bytes,1,opt,name=Salt,proto3" json:"Salt,omitempty"` + // Argon2id of `EgressKeyWithSalt` + KeyWithSaltHash []byte `protobuf:"bytes,2,opt,name=KeyWithSaltHash,proto3" json:"KeyWithSaltHash,omitempty"` + // AES256 using `EgressRecordSecret` + EncryptedEgress []byte `protobuf:"bytes,3,opt,name=EncryptedEgress,proto3" json:"EncryptedEgress,omitempty"` +} + +func (x *EncryptedEgressRecord) Reset() { + *x = EncryptedEgressRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_audit_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EncryptedEgressRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EncryptedEgressRecord) ProtoMessage() {} + +func (x *EncryptedEgressRecord) ProtoReflect() protoreflect.Message { + mi := &file_audit_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EncryptedEgressRecord.ProtoReflect.Descriptor instead. +func (*EncryptedEgressRecord) Descriptor() ([]byte, []int) { + return file_audit_proto_rawDescGZIP(), []int{3} +} + +func (x *EncryptedEgressRecord) GetSalt() []byte { + if x != nil { + return x.Salt + } + return nil +} + +func (x *EncryptedEgressRecord) GetKeyWithSaltHash() []byte { + if x != nil { + return x.KeyWithSaltHash + } + return nil +} + +func (x *EncryptedEgressRecord) GetEncryptedEgress() []byte { + if x != nil { + return x.EncryptedEgress + } + return nil +} + +type AccountRecordPartial struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ulid + ContractId []byte `protobuf:"bytes,4,opt,name=ContractId,proto3" json:"ContractId,omitempty"` + AccountRecordSecret []byte `protobuf:"bytes,5,opt,name=AccountRecordSecret,proto3" json:"AccountRecordSecret,omitempty"` +} + +func (x *AccountRecordPartial) Reset() { + *x = AccountRecordPartial{} + if protoimpl.UnsafeEnabled { + mi := &file_audit_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountRecordPartial) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountRecordPartial) ProtoMessage() {} + +func (x *AccountRecordPartial) ProtoReflect() protoreflect.Message { + mi := &file_audit_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccountRecordPartial.ProtoReflect.Descriptor instead. +func (*AccountRecordPartial) Descriptor() ([]byte, []int) { + return file_audit_proto_rawDescGZIP(), []int{4} +} + +func (x *AccountRecordPartial) GetContractId() []byte { + if x != nil { + return x.ContractId + } + return nil +} + +func (x *AccountRecordPartial) GetAccountRecordSecret() []byte { + if x != nil { + return x.AccountRecordSecret + } + return nil +} + +type EgressRecordSecret struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key *EgressKey `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` + // 128-bit + Salt []byte `protobuf:"bytes,2,opt,name=Salt,proto3" json:"Salt,omitempty"` + // 24-bit + Nonce []byte `protobuf:"bytes,3,opt,name=Nonce,proto3" json:"Nonce,omitempty"` +} + +func (x *EgressRecordSecret) Reset() { + *x = EgressRecordSecret{} + if protoimpl.UnsafeEnabled { + mi := &file_audit_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EgressRecordSecret) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EgressRecordSecret) ProtoMessage() {} + +func (x *EgressRecordSecret) ProtoReflect() protoreflect.Message { + mi := &file_audit_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EgressRecordSecret.ProtoReflect.Descriptor instead. +func (*EgressRecordSecret) Descriptor() ([]byte, []int) { + return file_audit_proto_rawDescGZIP(), []int{5} +} + +func (x *EgressRecordSecret) GetKey() *EgressKey { + if x != nil { + return x.Key + } + return nil +} + +func (x *EgressRecordSecret) GetSalt() []byte { + if x != nil { + return x.Salt + } + return nil +} + +func (x *EgressRecordSecret) GetNonce() []byte { + if x != nil { + return x.Nonce + } + return nil +} + +type EgressRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key *EgressKey `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` + StartTime uint64 `protobuf:"varint,2,opt,name=StartTime,proto3" json:"StartTime,omitempty"` + EndTime *uint64 `protobuf:"varint,3,opt,name=EndTime,proto3,oneof" json:"EndTime,omitempty"` + AccountRecordSecret []byte `protobuf:"bytes,4,opt,name=AccountRecordSecret,proto3" json:"AccountRecordSecret,omitempty"` +} + +func (x *EgressRecord) Reset() { + *x = EgressRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_audit_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EgressRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EgressRecord) ProtoMessage() {} + +func (x *EgressRecord) ProtoReflect() protoreflect.Message { + mi := &file_audit_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EgressRecord.ProtoReflect.Descriptor instead. +func (*EgressRecord) Descriptor() ([]byte, []int) { + return file_audit_proto_rawDescGZIP(), []int{6} +} + +func (x *EgressRecord) GetKey() *EgressKey { + if x != nil { + return x.Key + } + return nil +} + +func (x *EgressRecord) GetStartTime() uint64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *EgressRecord) GetEndTime() uint64 { + if x != nil && x.EndTime != nil { + return *x.EndTime + } + return 0 +} + +func (x *EgressRecord) GetAccountRecordSecret() []byte { + if x != nil { + return x.AccountRecordSecret + } + return nil +} + +type AccountRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ulid + ContractId []byte `protobuf:"bytes,1,opt,name=ContractId,proto3" json:"ContractId,omitempty"` + // ulid + ClientAccountId []byte `protobuf:"bytes,2,opt,name=ClientAccountId,proto3" json:"ClientAccountId,omitempty"` + // ulid + ProviderAccountId []byte `protobuf:"bytes,3,opt,name=ProviderAccountId,proto3" json:"ProviderAccountId,omitempty"` +} + +func (x *AccountRecord) Reset() { + *x = AccountRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_audit_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountRecord) ProtoMessage() {} + +func (x *AccountRecord) ProtoReflect() protoreflect.Message { + mi := &file_audit_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccountRecord.ProtoReflect.Descriptor instead. +func (*AccountRecord) Descriptor() ([]byte, []int) { + return file_audit_proto_rawDescGZIP(), []int{7} +} + +func (x *AccountRecord) GetContractId() []byte { + if x != nil { + return x.ContractId + } + return nil +} + +func (x *AccountRecord) GetClientAccountId() []byte { + if x != nil { + return x.ClientAccountId + } + return nil +} + +func (x *AccountRecord) GetProviderAccountId() []byte { + if x != nil { + return x.ProviderAccountId + } + return nil +} + +var File_audit_proto protoreflect.FileDescriptor + +var file_audit_proto_rawDesc = []byte{ + 0x0a, 0x0b, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x62, + 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x22, 0x92, 0x01, 0x0a, 0x0d, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x41, 0x75, 0x64, 0x69, 0x74, 0x12, 0x38, 0x0a, 0x06, 0x45, 0x67, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x62, 0x72, 0x69, + 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, + 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x45, 0x67, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x47, 0x0a, 0x0e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, + 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x62, + 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x0e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x22, 0xec, 0x01, + 0x0a, 0x09, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x54, + 0x69, 0x6d, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, + 0x54, 0x69, 0x6d, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x35, 0x0a, 0x08, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x62, 0x72, + 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x70, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x08, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x70, 0x12, 0x1e, 0x0a, 0x0a, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x24, 0x0a, 0x0d, + 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x70, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x70, 0x12, 0x28, 0x0a, 0x0f, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x44, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x72, 0x74, 0x22, 0x4f, 0x0a, 0x11, + 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x57, 0x69, 0x74, 0x68, 0x53, 0x61, 0x6c, + 0x74, 0x12, 0x26, 0x0a, 0x03, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x45, 0x67, 0x72, 0x65, 0x73, + 0x73, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x61, 0x6c, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x53, 0x61, 0x6c, 0x74, 0x22, 0x7f, 0x0a, + 0x15, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x61, 0x6c, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x53, 0x61, 0x6c, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x4b, 0x65, + 0x79, 0x57, 0x69, 0x74, 0x68, 0x53, 0x61, 0x6c, 0x74, 0x48, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x4b, 0x65, 0x79, 0x57, 0x69, 0x74, 0x68, 0x53, 0x61, 0x6c, 0x74, + 0x48, 0x61, 0x73, 0x68, 0x12, 0x28, 0x0a, 0x0f, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, + 0x64, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x45, + 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x68, + 0x0a, 0x14, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x50, + 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x13, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x13, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x66, 0x0a, 0x12, 0x45, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x26, + 0x0a, 0x03, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x62, 0x72, + 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x4b, 0x65, + 0x79, 0x52, 0x03, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x61, 0x6c, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x53, 0x61, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x4e, 0x6f, + 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x4e, 0x6f, 0x6e, 0x63, 0x65, + 0x22, 0xb1, 0x01, 0x0a, 0x0c, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x12, 0x26, 0x0a, 0x03, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x45, 0x67, 0x72, 0x65, 0x73, + 0x73, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x53, 0x74, + 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, + 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x07, 0x45, 0x6e, 0x64, 0x54, + 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, 0x13, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x13, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x45, 0x6e, 0x64, + 0x54, 0x69, 0x6d, 0x65, 0x22, 0x87, 0x01, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, + 0x12, 0x2c, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x2a, 0x28, + 0x0a, 0x0e, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x12, 0x0a, 0x0a, 0x06, 0x49, 0x50, 0x5f, 0x54, 0x43, 0x50, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, + 0x49, 0x50, 0x5f, 0x55, 0x44, 0x50, 0x10, 0x01, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x72, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_audit_proto_rawDescOnce sync.Once + file_audit_proto_rawDescData = file_audit_proto_rawDesc +) + +func file_audit_proto_rawDescGZIP() []byte { + file_audit_proto_rawDescOnce.Do(func() { + file_audit_proto_rawDescData = protoimpl.X.CompressGZIP(file_audit_proto_rawDescData) + }) + return file_audit_proto_rawDescData +} + +var file_audit_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_audit_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_audit_proto_goTypes = []interface{}{ + (EgressProtocol)(0), // 0: bringyour.EgressProtocol + (*ProviderAudit)(nil), // 1: bringyour.ProviderAudit + (*EgressKey)(nil), // 2: bringyour.EgressKey + (*EgressKeyWithSalt)(nil), // 3: bringyour.EgressKeyWithSalt + (*EncryptedEgressRecord)(nil), // 4: bringyour.EncryptedEgressRecord + (*AccountRecordPartial)(nil), // 5: bringyour.AccountRecordPartial + (*EgressRecordSecret)(nil), // 6: bringyour.EgressRecordSecret + (*EgressRecord)(nil), // 7: bringyour.EgressRecord + (*AccountRecord)(nil), // 8: bringyour.AccountRecord +} +var file_audit_proto_depIdxs = []int32{ + 4, // 0: bringyour.ProviderAudit.Egress:type_name -> bringyour.EncryptedEgressRecord + 5, // 1: bringyour.ProviderAudit.AccountPartial:type_name -> bringyour.AccountRecordPartial + 0, // 2: bringyour.EgressKey.Protocol:type_name -> bringyour.EgressProtocol + 2, // 3: bringyour.EgressKeyWithSalt.Key:type_name -> bringyour.EgressKey + 2, // 4: bringyour.EgressRecordSecret.Key:type_name -> bringyour.EgressKey + 2, // 5: bringyour.EgressRecord.Key:type_name -> bringyour.EgressKey + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_audit_proto_init() } +func file_audit_proto_init() { + if File_audit_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_audit_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProviderAudit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_audit_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EgressKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_audit_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EgressKeyWithSalt); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_audit_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EncryptedEgressRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_audit_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountRecordPartial); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_audit_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EgressRecordSecret); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_audit_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EgressRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_audit_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_audit_proto_msgTypes[6].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_audit_proto_rawDesc, + NumEnums: 1, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_audit_proto_goTypes, + DependencyIndexes: file_audit_proto_depIdxs, + EnumInfos: file_audit_proto_enumTypes, + MessageInfos: file_audit_proto_msgTypes, + }.Build() + File_audit_proto = out.File + file_audit_proto_rawDesc = nil + file_audit_proto_goTypes = nil + file_audit_proto_depIdxs = nil +} diff --git a/protocol/audit.proto b/protocol/audit.proto new file mode 100644 index 0000000..0e7791c --- /dev/null +++ b/protocol/audit.proto @@ -0,0 +1,125 @@ +syntax = "proto3"; +package bringyour; + +option go_package = "github.com/urnetwork/connect/protocol"; + + +// the audit protocol protects providers by creating a cryptographic record +// of egress traffic that can be used for the specific purpose of abuse reports. +// It's in the interest of providers to enable the audit protocol, +// because it lets the network operator enforce abuse reports +// as the back line of abuse prevention as detailed at https://bringyour.com/trustandsafety + +// The goal of the audit database is to be computationally intractable to +// extract data without some prior knowledge of the record to extract. +// Typically the prior knowledge would come in the form of an abuse report, +// which is created from a destination server log. + +// the provider creates an `EgressRecord` which contains a key +// that the platform uses to further encrypt an `AccountRecord`. +// each `EgressRecord` is keyed by an `EgressKeyWithSalt`, which is password hashed +// using a specific salt per record to prevent pre-computed tables. +// The `EgressRecord` is symetrically encrypted using a `EgressRecordSecret`, +// which is the `EgressKey` plus an N-bit nonce. The nonce is thrown away, +// so that decryption requires enumating all the N-bit possiblities. + +// hence, to lookup a record, one provides the EgressKey and the system +// must do a table scan of all records using the specific salt per record. +// If the salted key matches, the system must brute-force the N-bit nonce +// to decrypt the `EgressRecord`. The system must then use the account secret +// from the record to decrypt the `AccountRecord`. N is chosen sufficiently large +// to take minutes to decrypt a single record on a modern multi core server. + +// without a prior `EgressKey`, the system must enumerate K bits of possible +// `EgressKeys` to find a match for a single record. +// For an IPv4 where nothing is known, K is ~130 bits. +// For specific probing for a single server where an IPv4 source IP, destination IP, +// and destination port are known, and approximate day is known, K is ~40 bits. +// K bits must be brute forced per record, +// where each attempt requires creating the salted password hash. +// In addition, decrypting a single record has the nonce brute force cost. + +// The specific bit sizes and encryption algorithms used are: +// salt: 128 bits +// nonce: 24 bits +// password hash: Argon2id +// symmetric encryption: AES-256 + + +// this is sent to the platform +// note the platform does not have prior knowledge and would have to brute force decrypt the audit record +// the provider creates and encrypts the final `AccountRecord` from the partial and discards the partial +message ProviderAudit { + EncryptedEgressRecord Egress = 1; + // this data is used to encode the associated `AccountRecord` + // this data is not stored and should be thrown out by the platform + AccountRecordPartial AccountPartial = 2; +} + + +enum EgressProtocol { + IP_TCP = 0; + IP_UDP = 1; +} + +// kept local on provider +// time block is UTC in 50ms blocks +// a typical abuse report will have to account for +-60s, or look up about 1200 blocks per record +message EgressKey { + uint64 TimeBlock = 1; + EgressProtocol Protocol = 2; + bytes SourceIp = 3; + uint32 SourcePort = 4; + bytes DestinationIp = 5; + uint32 DestinationPort = 6; +} + +// kept local on provider +message EgressKeyWithSalt { + EgressKey Key = 1; + // 128-bit + bytes Salt = 2; +} + + +// this created on the provider so that the platform cannot see the raw data +// a complete audit record is an `EgressRecord` and an `AccountRecord` +message EncryptedEgressRecord { + // 128-bit + bytes Salt = 1; + // Argon2id of `EgressKeyWithSalt` + bytes KeyWithSaltHash = 2; + // AES256 using `EgressRecordSecret` + bytes EncryptedEgress = 3; +} + +message AccountRecordPartial { + // ulid + bytes ContractId = 4; + bytes AccountRecordSecret = 5; +} + +message EgressRecordSecret { + EgressKey Key = 1; + // 128-bit + bytes Salt = 2; + // 24-bit + bytes Nonce = 3; +} + +message EgressRecord { + EgressKey Key = 1; + uint64 StartTime = 2; + optional uint64 EndTime = 3; + bytes AccountRecordSecret = 4; +} + +message AccountRecord { + // ulid + bytes ContractId = 1; + // ulid + bytes ClientAccountId = 2; + // ulid + bytes ProviderAccountId = 3; +} + diff --git a/protocol/extender.pb.go b/protocol/extender.pb.go new file mode 100644 index 0000000..ac2b5a9 --- /dev/null +++ b/protocol/extender.pb.go @@ -0,0 +1,185 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v4.24.4 +// source: extender.proto + +package protocol + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ExtenderHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DestinationHost string `protobuf:"bytes,1,opt,name=DestinationHost,proto3" json:"DestinationHost,omitempty"` + DestinationPort uint32 `protobuf:"varint,2,opt,name=DestinationPort,proto3" json:"DestinationPort,omitempty"` + Timestamp uint64 `protobuf:"varint,3,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"` + Nonce []byte `protobuf:"bytes,4,opt,name=Nonce,proto3" json:"Nonce,omitempty"` + Signature []byte `protobuf:"bytes,5,opt,name=Signature,proto3" json:"Signature,omitempty"` +} + +func (x *ExtenderHeader) Reset() { + *x = ExtenderHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_extender_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExtenderHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExtenderHeader) ProtoMessage() {} + +func (x *ExtenderHeader) ProtoReflect() protoreflect.Message { + mi := &file_extender_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExtenderHeader.ProtoReflect.Descriptor instead. +func (*ExtenderHeader) Descriptor() ([]byte, []int) { + return file_extender_proto_rawDescGZIP(), []int{0} +} + +func (x *ExtenderHeader) GetDestinationHost() string { + if x != nil { + return x.DestinationHost + } + return "" +} + +func (x *ExtenderHeader) GetDestinationPort() uint32 { + if x != nil { + return x.DestinationPort + } + return 0 +} + +func (x *ExtenderHeader) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *ExtenderHeader) GetNonce() []byte { + if x != nil { + return x.Nonce + } + return nil +} + +func (x *ExtenderHeader) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +var File_extender_proto protoreflect.FileDescriptor + +var file_extender_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x09, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x22, 0xb6, 0x01, 0x0a, 0x0e, + 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x28, + 0x0a, 0x0f, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x6f, 0x73, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x44, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0f, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, + 0x72, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x12, 0x14, 0x0a, 0x05, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x05, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x75, 0x72, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x63, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_extender_proto_rawDescOnce sync.Once + file_extender_proto_rawDescData = file_extender_proto_rawDesc +) + +func file_extender_proto_rawDescGZIP() []byte { + file_extender_proto_rawDescOnce.Do(func() { + file_extender_proto_rawDescData = protoimpl.X.CompressGZIP(file_extender_proto_rawDescData) + }) + return file_extender_proto_rawDescData +} + +var file_extender_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_extender_proto_goTypes = []interface{}{ + (*ExtenderHeader)(nil), // 0: bringyour.ExtenderHeader +} +var file_extender_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_extender_proto_init() } +func file_extender_proto_init() { + if File_extender_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_extender_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExtenderHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_extender_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_extender_proto_goTypes, + DependencyIndexes: file_extender_proto_depIdxs, + MessageInfos: file_extender_proto_msgTypes, + }.Build() + File_extender_proto = out.File + file_extender_proto_rawDesc = nil + file_extender_proto_goTypes = nil + file_extender_proto_depIdxs = nil +} diff --git a/protocol/extender.proto b/protocol/extender.proto new file mode 100644 index 0000000..6ef64bf --- /dev/null +++ b/protocol/extender.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package bringyour; + +option go_package = "github.com/urnetwork/connect/protocol"; + + +message ExtenderHeader { + string DestinationHost = 1; + uint32 DestinationPort = 2; + uint64 Timestamp = 3; + bytes Nonce = 4; + bytes Signature = 5; +} diff --git a/protocol/frame.pb.go b/protocol/frame.pb.go new file mode 100644 index 0000000..fd648ee --- /dev/null +++ b/protocol/frame.pb.go @@ -0,0 +1,359 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v4.24.4 +// source: frame.proto + +package protocol + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// frames are used at all levels +// flatten all message types into this enum +type MessageType int32 + +const ( + MessageType_TransferPack MessageType = 0 + MessageType_TransferAck MessageType = 1 + MessageType_TransferContract MessageType = 2 + MessageType_TransferProvide MessageType = 3 + MessageType_TransferAuth MessageType = 4 + MessageType_TransferCreateStream MessageType = 5 + MessageType_TransferCreateStreamResult MessageType = 6 + // REMOVED + MessageType_TransferCloseStream MessageType = 7 + MessageType_TransferStreamOpen MessageType = 8 + MessageType_TransferStreamClose MessageType = 9 + MessageType_TransferCreateContract MessageType = 10 + MessageType_TransferCreateContractResult MessageType = 11 + MessageType_TransferCloseContract MessageType = 12 + MessageType_TransferPeerAudit MessageType = 13 + MessageType_TestSimpleMessage MessageType = 14 + MessageType_IpIpPacketToProvider MessageType = 15 + MessageType_IpIpPacketFromProvider MessageType = 16 + MessageType_IpIpPing MessageType = 17 + MessageType_TransferControlPing MessageType = 18 + MessageType_TransferProvidePing MessageType = 19 +) + +// Enum value maps for MessageType. +var ( + MessageType_name = map[int32]string{ + 0: "TransferPack", + 1: "TransferAck", + 2: "TransferContract", + 3: "TransferProvide", + 4: "TransferAuth", + 5: "TransferCreateStream", + 6: "TransferCreateStreamResult", + 7: "TransferCloseStream", + 8: "TransferStreamOpen", + 9: "TransferStreamClose", + 10: "TransferCreateContract", + 11: "TransferCreateContractResult", + 12: "TransferCloseContract", + 13: "TransferPeerAudit", + 14: "TestSimpleMessage", + 15: "IpIpPacketToProvider", + 16: "IpIpPacketFromProvider", + 17: "IpIpPing", + 18: "TransferControlPing", + 19: "TransferProvidePing", + } + MessageType_value = map[string]int32{ + "TransferPack": 0, + "TransferAck": 1, + "TransferContract": 2, + "TransferProvide": 3, + "TransferAuth": 4, + "TransferCreateStream": 5, + "TransferCreateStreamResult": 6, + "TransferCloseStream": 7, + "TransferStreamOpen": 8, + "TransferStreamClose": 9, + "TransferCreateContract": 10, + "TransferCreateContractResult": 11, + "TransferCloseContract": 12, + "TransferPeerAudit": 13, + "TestSimpleMessage": 14, + "IpIpPacketToProvider": 15, + "IpIpPacketFromProvider": 16, + "IpIpPing": 17, + "TransferControlPing": 18, + "TransferProvidePing": 19, + } +) + +func (x MessageType) Enum() *MessageType { + p := new(MessageType) + *p = x + return p +} + +func (x MessageType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MessageType) Descriptor() protoreflect.EnumDescriptor { + return file_frame_proto_enumTypes[0].Descriptor() +} + +func (MessageType) Type() protoreflect.EnumType { + return &file_frame_proto_enumTypes[0] +} + +func (x MessageType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MessageType.Descriptor instead. +func (MessageType) EnumDescriptor() ([]byte, []int) { + return file_frame_proto_rawDescGZIP(), []int{0} +} + +type Frame struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MessageType MessageType `protobuf:"varint,1,opt,name=message_type,json=messageType,proto3,enum=bringyour.MessageType" json:"message_type,omitempty"` + MessageBytes []byte `protobuf:"bytes,2,opt,name=message_bytes,json=messageBytes,proto3" json:"message_bytes,omitempty"` +} + +func (x *Frame) Reset() { + *x = Frame{} + if protoimpl.UnsafeEnabled { + mi := &file_frame_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Frame) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Frame) ProtoMessage() {} + +func (x *Frame) ProtoReflect() protoreflect.Message { + mi := &file_frame_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Frame.ProtoReflect.Descriptor instead. +func (*Frame) Descriptor() ([]byte, []int) { + return file_frame_proto_rawDescGZIP(), []int{0} +} + +func (x *Frame) GetMessageType() MessageType { + if x != nil { + return x.MessageType + } + return MessageType_TransferPack +} + +func (x *Frame) GetMessageBytes() []byte { + if x != nil { + return x.MessageBytes + } + return nil +} + +type FilteredFrame struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MessageType MessageType `protobuf:"varint,1,opt,name=message_type,json=messageType,proto3,enum=bringyour.MessageType" json:"message_type,omitempty"` +} + +func (x *FilteredFrame) Reset() { + *x = FilteredFrame{} + if protoimpl.UnsafeEnabled { + mi := &file_frame_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FilteredFrame) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FilteredFrame) ProtoMessage() {} + +func (x *FilteredFrame) ProtoReflect() protoreflect.Message { + mi := &file_frame_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FilteredFrame.ProtoReflect.Descriptor instead. +func (*FilteredFrame) Descriptor() ([]byte, []int) { + return file_frame_proto_rawDescGZIP(), []int{1} +} + +func (x *FilteredFrame) GetMessageType() MessageType { + if x != nil { + return x.MessageType + } + return MessageType_TransferPack +} + +var File_frame_proto protoreflect.FileDescriptor + +var file_frame_proto_rawDesc = []byte{ + 0x0a, 0x0b, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x62, + 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x22, 0x67, 0x0a, 0x05, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, + 0x6f, 0x75, 0x72, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x22, 0x4a, 0x0a, 0x0d, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x46, 0x72, 0x61, + 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, + 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x2a, 0xee, 0x03, + 0x0a, 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, + 0x0c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x50, 0x61, 0x63, 0x6b, 0x10, 0x00, 0x12, + 0x0f, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x63, 0x6b, 0x10, 0x01, + 0x12, 0x14, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x10, 0x04, 0x12, 0x18, 0x0a, + 0x14, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x10, 0x05, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x10, 0x06, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x10, 0x07, + 0x12, 0x16, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x4f, 0x70, 0x65, 0x6e, 0x10, 0x08, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x66, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x10, + 0x09, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x10, 0x0a, 0x12, 0x20, 0x0a, + 0x1c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x10, 0x0b, 0x12, + 0x19, 0x0a, 0x15, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x73, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x10, 0x0c, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x50, 0x65, 0x65, 0x72, 0x41, 0x75, 0x64, 0x69, 0x74, 0x10, + 0x0d, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x65, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x10, 0x0e, 0x12, 0x18, 0x0a, 0x14, 0x49, 0x70, 0x49, 0x70, + 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x10, 0x0f, 0x12, 0x1a, 0x0a, 0x16, 0x49, 0x70, 0x49, 0x70, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, + 0x46, 0x72, 0x6f, 0x6d, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x10, 0x10, 0x12, 0x0c, + 0x0a, 0x08, 0x49, 0x70, 0x49, 0x70, 0x50, 0x69, 0x6e, 0x67, 0x10, 0x11, 0x12, 0x17, 0x0a, 0x13, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x50, + 0x69, 0x6e, 0x67, 0x10, 0x12, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, + 0x72, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x50, 0x69, 0x6e, 0x67, 0x10, 0x13, 0x42, 0x27, + 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x72, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_frame_proto_rawDescOnce sync.Once + file_frame_proto_rawDescData = file_frame_proto_rawDesc +) + +func file_frame_proto_rawDescGZIP() []byte { + file_frame_proto_rawDescOnce.Do(func() { + file_frame_proto_rawDescData = protoimpl.X.CompressGZIP(file_frame_proto_rawDescData) + }) + return file_frame_proto_rawDescData +} + +var file_frame_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_frame_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_frame_proto_goTypes = []interface{}{ + (MessageType)(0), // 0: bringyour.MessageType + (*Frame)(nil), // 1: bringyour.Frame + (*FilteredFrame)(nil), // 2: bringyour.FilteredFrame +} +var file_frame_proto_depIdxs = []int32{ + 0, // 0: bringyour.Frame.message_type:type_name -> bringyour.MessageType + 0, // 1: bringyour.FilteredFrame.message_type:type_name -> bringyour.MessageType + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_frame_proto_init() } +func file_frame_proto_init() { + if File_frame_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_frame_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Frame); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_frame_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FilteredFrame); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_frame_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_frame_proto_goTypes, + DependencyIndexes: file_frame_proto_depIdxs, + EnumInfos: file_frame_proto_enumTypes, + MessageInfos: file_frame_proto_msgTypes, + }.Build() + File_frame_proto = out.File + file_frame_proto_rawDesc = nil + file_frame_proto_goTypes = nil + file_frame_proto_depIdxs = nil +} diff --git a/protocol/frame.proto b/protocol/frame.proto new file mode 100644 index 0000000..3dd7194 --- /dev/null +++ b/protocol/frame.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package bringyour; + +option go_package = "github.com/urnetwork/connect/protocol"; + + +// frames are used at all levels +// flatten all message types into this enum +enum MessageType { + TransferPack = 0; + TransferAck = 1; + TransferContract = 2; + TransferProvide = 3; + TransferAuth = 4; + TransferCreateStream = 5; + TransferCreateStreamResult = 6; + /* REMOVED */ TransferCloseStream = 7; + TransferStreamOpen = 8; + TransferStreamClose = 9; + TransferCreateContract = 10; + TransferCreateContractResult = 11; + TransferCloseContract = 12; + TransferPeerAudit = 13; + TestSimpleMessage = 14; + IpIpPacketToProvider = 15; + IpIpPacketFromProvider = 16; + IpIpPing = 17; + TransferControlPing = 18; + TransferProvidePing = 19; +} + + +message Frame { + MessageType message_type = 1; + bytes message_bytes = 2; +} + + +message FilteredFrame { + MessageType message_type = 1; +} + diff --git a/protocol/ip.pb.go b/protocol/ip.pb.go new file mode 100644 index 0000000..41fff3d --- /dev/null +++ b/protocol/ip.pb.go @@ -0,0 +1,329 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v4.24.4 +// source: ip.proto + +package protocol + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// a raw packet +// the provider is expected to do its own parsing to confirm the data verbatim +type IpPacket struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PacketBytes []byte `protobuf:"bytes,1,opt,name=packet_bytes,json=packetBytes,proto3" json:"packet_bytes,omitempty"` +} + +func (x *IpPacket) Reset() { + *x = IpPacket{} + if protoimpl.UnsafeEnabled { + mi := &file_ip_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IpPacket) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IpPacket) ProtoMessage() {} + +func (x *IpPacket) ProtoReflect() protoreflect.Message { + mi := &file_ip_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IpPacket.ProtoReflect.Descriptor instead. +func (*IpPacket) Descriptor() ([]byte, []int) { + return file_ip_proto_rawDescGZIP(), []int{0} +} + +func (x *IpPacket) GetPacketBytes() []byte { + if x != nil { + return x.PacketBytes + } + return nil +} + +type IpPacketToProvider struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpPacket *IpPacket `protobuf:"bytes,1,opt,name=ip_packet,json=ipPacket,proto3" json:"ip_packet,omitempty"` +} + +func (x *IpPacketToProvider) Reset() { + *x = IpPacketToProvider{} + if protoimpl.UnsafeEnabled { + mi := &file_ip_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IpPacketToProvider) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IpPacketToProvider) ProtoMessage() {} + +func (x *IpPacketToProvider) ProtoReflect() protoreflect.Message { + mi := &file_ip_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IpPacketToProvider.ProtoReflect.Descriptor instead. +func (*IpPacketToProvider) Descriptor() ([]byte, []int) { + return file_ip_proto_rawDescGZIP(), []int{1} +} + +func (x *IpPacketToProvider) GetIpPacket() *IpPacket { + if x != nil { + return x.IpPacket + } + return nil +} + +type IpPacketFromProvider struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpPacket *IpPacket `protobuf:"bytes,1,opt,name=ip_packet,json=ipPacket,proto3" json:"ip_packet,omitempty"` +} + +func (x *IpPacketFromProvider) Reset() { + *x = IpPacketFromProvider{} + if protoimpl.UnsafeEnabled { + mi := &file_ip_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IpPacketFromProvider) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IpPacketFromProvider) ProtoMessage() {} + +func (x *IpPacketFromProvider) ProtoReflect() protoreflect.Message { + mi := &file_ip_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IpPacketFromProvider.ProtoReflect.Descriptor instead. +func (*IpPacketFromProvider) Descriptor() ([]byte, []int) { + return file_ip_proto_rawDescGZIP(), []int{2} +} + +func (x *IpPacketFromProvider) GetIpPacket() *IpPacket { + if x != nil { + return x.IpPacket + } + return nil +} + +type IpPing struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *IpPing) Reset() { + *x = IpPing{} + if protoimpl.UnsafeEnabled { + mi := &file_ip_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IpPing) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IpPing) ProtoMessage() {} + +func (x *IpPing) ProtoReflect() protoreflect.Message { + mi := &file_ip_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IpPing.ProtoReflect.Descriptor instead. +func (*IpPing) Descriptor() ([]byte, []int) { + return file_ip_proto_rawDescGZIP(), []int{3} +} + +var File_ip_proto protoreflect.FileDescriptor + +var file_ip_proto_rawDesc = []byte{ + 0x0a, 0x08, 0x69, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x62, 0x72, 0x69, 0x6e, + 0x67, 0x79, 0x6f, 0x75, 0x72, 0x22, 0x2d, 0x0a, 0x08, 0x49, 0x70, 0x50, 0x61, 0x63, 0x6b, 0x65, + 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x22, 0x46, 0x0a, 0x12, 0x49, 0x70, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, + 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x09, 0x69, 0x70, + 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x49, 0x70, 0x50, 0x61, 0x63, 0x6b, + 0x65, 0x74, 0x52, 0x08, 0x69, 0x70, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x22, 0x48, 0x0a, 0x14, + 0x49, 0x70, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x09, 0x69, 0x70, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, + 0x6f, 0x75, 0x72, 0x2e, 0x49, 0x70, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x69, 0x70, + 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x22, 0x08, 0x0a, 0x06, 0x49, 0x70, 0x50, 0x69, 0x6e, 0x67, + 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, + 0x72, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_ip_proto_rawDescOnce sync.Once + file_ip_proto_rawDescData = file_ip_proto_rawDesc +) + +func file_ip_proto_rawDescGZIP() []byte { + file_ip_proto_rawDescOnce.Do(func() { + file_ip_proto_rawDescData = protoimpl.X.CompressGZIP(file_ip_proto_rawDescData) + }) + return file_ip_proto_rawDescData +} + +var file_ip_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_ip_proto_goTypes = []interface{}{ + (*IpPacket)(nil), // 0: bringyour.IpPacket + (*IpPacketToProvider)(nil), // 1: bringyour.IpPacketToProvider + (*IpPacketFromProvider)(nil), // 2: bringyour.IpPacketFromProvider + (*IpPing)(nil), // 3: bringyour.IpPing +} +var file_ip_proto_depIdxs = []int32{ + 0, // 0: bringyour.IpPacketToProvider.ip_packet:type_name -> bringyour.IpPacket + 0, // 1: bringyour.IpPacketFromProvider.ip_packet:type_name -> bringyour.IpPacket + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_ip_proto_init() } +func file_ip_proto_init() { + if File_ip_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ip_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IpPacket); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ip_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IpPacketToProvider); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ip_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IpPacketFromProvider); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ip_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IpPing); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ip_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ip_proto_goTypes, + DependencyIndexes: file_ip_proto_depIdxs, + MessageInfos: file_ip_proto_msgTypes, + }.Build() + File_ip_proto = out.File + file_ip_proto_rawDesc = nil + file_ip_proto_goTypes = nil + file_ip_proto_depIdxs = nil +} diff --git a/protocol/ip.proto b/protocol/ip.proto new file mode 100644 index 0000000..a58e088 --- /dev/null +++ b/protocol/ip.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package bringyour; + +option go_package = "github.com/urnetwork/connect/protocol"; + + +// a raw packet +// the provider is expected to do its own parsing to confirm the data verbatim +message IpPacket { + bytes packet_bytes = 1; +} + + +message IpPacketToProvider { + IpPacket ip_packet = 1; +} + + +message IpPacketFromProvider { + IpPacket ip_packet = 1; +} + + +message IpPing { +} + diff --git a/protocol/test.pb.go b/protocol/test.pb.go new file mode 100644 index 0000000..f8b4c87 --- /dev/null +++ b/protocol/test.pb.go @@ -0,0 +1,164 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v4.24.4 +// source: test.proto + +package protocol + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type SimpleMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MessageIndex uint32 `protobuf:"varint,1,opt,name=message_index,json=messageIndex,proto3" json:"message_index,omitempty"` + MessageCount uint32 `protobuf:"varint,2,opt,name=message_count,json=messageCount,proto3" json:"message_count,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` +} + +func (x *SimpleMessage) Reset() { + *x = SimpleMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_test_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SimpleMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SimpleMessage) ProtoMessage() {} + +func (x *SimpleMessage) ProtoReflect() protoreflect.Message { + mi := &file_test_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SimpleMessage.ProtoReflect.Descriptor instead. +func (*SimpleMessage) Descriptor() ([]byte, []int) { + return file_test_proto_rawDescGZIP(), []int{0} +} + +func (x *SimpleMessage) GetMessageIndex() uint32 { + if x != nil { + return x.MessageIndex + } + return 0 +} + +func (x *SimpleMessage) GetMessageCount() uint32 { + if x != nil { + return x.MessageCount + } + return 0 +} + +func (x *SimpleMessage) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +var File_test_proto protoreflect.FileDescriptor + +var file_test_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x62, 0x72, + 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x22, 0x73, 0x0a, 0x0d, 0x53, 0x69, 0x6d, 0x70, 0x6c, + 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x23, 0x0a, + 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x27, 0x5a, 0x25, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x72, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_test_proto_rawDescOnce sync.Once + file_test_proto_rawDescData = file_test_proto_rawDesc +) + +func file_test_proto_rawDescGZIP() []byte { + file_test_proto_rawDescOnce.Do(func() { + file_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_test_proto_rawDescData) + }) + return file_test_proto_rawDescData +} + +var file_test_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_test_proto_goTypes = []interface{}{ + (*SimpleMessage)(nil), // 0: bringyour.SimpleMessage +} +var file_test_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_test_proto_init() } +func file_test_proto_init() { + if File_test_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SimpleMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_test_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_test_proto_goTypes, + DependencyIndexes: file_test_proto_depIdxs, + MessageInfos: file_test_proto_msgTypes, + }.Build() + File_test_proto = out.File + file_test_proto_rawDesc = nil + file_test_proto_goTypes = nil + file_test_proto_depIdxs = nil +} diff --git a/protocol/test.proto b/protocol/test.proto new file mode 100644 index 0000000..a243bf5 --- /dev/null +++ b/protocol/test.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package bringyour; + +option go_package = "github.com/urnetwork/connect/protocol"; + + +message SimpleMessage { + uint32 message_index = 1; + uint32 message_count = 2; + string content = 3; +} diff --git a/protocol/transfer.pb.go b/protocol/transfer.pb.go new file mode 100644 index 0000000..652b917 --- /dev/null +++ b/protocol/transfer.pb.go @@ -0,0 +1,2162 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v4.24.4 +// source: transfer.proto + +package protocol + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// CHANGE FROM PRIOR VERSION, modes should be considered individually as a mask and do not imply other modes +type ProvideMode int32 + +const ( + ProvideMode_None ProvideMode = 0 // this is interpreted the same as a `null` provide mode + ProvideMode_Network ProvideMode = 1 + ProvideMode_FriendsAndFamily ProvideMode = 2 + ProvideMode_Public ProvideMode = 3 + ProvideMode_Stream ProvideMode = 4 + ProvideMode_PublicStream ProvideMode = 5 +) + +// Enum value maps for ProvideMode. +var ( + ProvideMode_name = map[int32]string{ + 0: "None", + 1: "Network", + 2: "FriendsAndFamily", + 3: "Public", + 4: "Stream", + 5: "PublicStream", + } + ProvideMode_value = map[string]int32{ + "None": 0, + "Network": 1, + "FriendsAndFamily": 2, + "Public": 3, + "Stream": 4, + "PublicStream": 5, + } +) + +func (x ProvideMode) Enum() *ProvideMode { + p := new(ProvideMode) + *p = x + return p +} + +func (x ProvideMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProvideMode) Descriptor() protoreflect.EnumDescriptor { + return file_transfer_proto_enumTypes[0].Descriptor() +} + +func (ProvideMode) Type() protoreflect.EnumType { + return &file_transfer_proto_enumTypes[0] +} + +func (x ProvideMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ProvideMode.Descriptor instead. +func (ProvideMode) EnumDescriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{0} +} + +type ContractError int32 + +const ( + ContractError_NoPermission ContractError = 0 + ContractError_InsufficientBalance ContractError = 1 + ContractError_Setup ContractError = 2 +) + +// Enum value maps for ContractError. +var ( + ContractError_name = map[int32]string{ + 0: "NoPermission", + 1: "InsufficientBalance", + 2: "Setup", + } + ContractError_value = map[string]int32{ + "NoPermission": 0, + "InsufficientBalance": 1, + "Setup": 2, + } +) + +func (x ContractError) Enum() *ContractError { + p := new(ContractError) + *p = x + return p +} + +func (x ContractError) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ContractError) Descriptor() protoreflect.EnumDescriptor { + return file_transfer_proto_enumTypes[1].Descriptor() +} + +func (ContractError) Type() protoreflect.EnumType { + return &file_transfer_proto_enumTypes[1] +} + +func (x ContractError) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ContractError.Descriptor instead. +func (ContractError) EnumDescriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{1} +} + +// stream_id replaces the source_id and destination_id +type TransferPath struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ulid + SourceId []byte `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3,oneof" json:"source_id,omitempty"` + // ulid + DestinationId []byte `protobuf:"bytes,1,opt,name=destination_id,json=destinationId,proto3,oneof" json:"destination_id,omitempty"` + // ulid + StreamId []byte `protobuf:"bytes,3,opt,name=stream_id,json=streamId,proto3,oneof" json:"stream_id,omitempty"` +} + +func (x *TransferPath) Reset() { + *x = TransferPath{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransferPath) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransferPath) ProtoMessage() {} + +func (x *TransferPath) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransferPath.ProtoReflect.Descriptor instead. +func (*TransferPath) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{0} +} + +func (x *TransferPath) GetSourceId() []byte { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *TransferPath) GetDestinationId() []byte { + if x != nil { + return x.DestinationId + } + return nil +} + +func (x *TransferPath) GetStreamId() []byte { + if x != nil { + return x.StreamId + } + return nil +} + +type TransferFrame struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TransferPath *TransferPath `protobuf:"bytes,1,opt,name=transfer_path,json=transferPath,proto3" json:"transfer_path,omitempty"` + Frame *Frame `protobuf:"bytes,2,opt,name=frame,proto3" json:"frame,omitempty"` +} + +func (x *TransferFrame) Reset() { + *x = TransferFrame{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransferFrame) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransferFrame) ProtoMessage() {} + +func (x *TransferFrame) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransferFrame.ProtoReflect.Descriptor instead. +func (*TransferFrame) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{1} +} + +func (x *TransferFrame) GetTransferPath() *TransferPath { + if x != nil { + return x.TransferPath + } + return nil +} + +func (x *TransferFrame) GetFrame() *Frame { + if x != nil { + return x.Frame + } + return nil +} + +// this is the minimal subset of `TransferFrame` used when making a routing decision +type FilteredTransferFrame struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TransferPath *TransferPath `protobuf:"bytes,1,opt,name=transfer_path,json=transferPath,proto3" json:"transfer_path,omitempty"` +} + +func (x *FilteredTransferFrame) Reset() { + *x = FilteredTransferFrame{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FilteredTransferFrame) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FilteredTransferFrame) ProtoMessage() {} + +func (x *FilteredTransferFrame) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FilteredTransferFrame.ProtoReflect.Descriptor instead. +func (*FilteredTransferFrame) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{2} +} + +func (x *FilteredTransferFrame) GetTransferPath() *TransferPath { + if x != nil { + return x.TransferPath + } + return nil +} + +type FilteredTransferFrameWithFrame struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TransferPath *TransferPath `protobuf:"bytes,1,opt,name=transfer_path,json=transferPath,proto3" json:"transfer_path,omitempty"` + Frame *FilteredFrame `protobuf:"bytes,2,opt,name=frame,proto3" json:"frame,omitempty"` +} + +func (x *FilteredTransferFrameWithFrame) Reset() { + *x = FilteredTransferFrameWithFrame{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FilteredTransferFrameWithFrame) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FilteredTransferFrameWithFrame) ProtoMessage() {} + +func (x *FilteredTransferFrameWithFrame) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FilteredTransferFrameWithFrame.ProtoReflect.Descriptor instead. +func (*FilteredTransferFrameWithFrame) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{3} +} + +func (x *FilteredTransferFrameWithFrame) GetTransferPath() *TransferPath { + if x != nil { + return x.TransferPath + } + return nil +} + +func (x *FilteredTransferFrameWithFrame) GetFrame() *FilteredFrame { + if x != nil { + return x.Frame + } + return nil +} + +type Pack struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ulid + MessageId []byte `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` + // ulid + SequenceId []byte `protobuf:"bytes,2,opt,name=sequence_id,json=sequenceId,proto3" json:"sequence_id,omitempty"` + SequenceNumber uint64 `protobuf:"varint,3,opt,name=sequence_number,json=sequenceNumber,proto3" json:"sequence_number,omitempty"` + // this marks the head message in the sender's sequence + // it means that any message with an earlier sequence_id won't arrive + // and is used when a receiver is recreated with zero state + Head bool `protobuf:"varint,4,opt,name=head,proto3" json:"head,omitempty"` + Frames []*Frame `protobuf:"bytes,5,rep,name=frames,proto3" json:"frames,omitempty"` + // when true, deliver out of sequence with no acks and no retry + // use true when there is an external transfer control + // default to false for backward compatibility + Nack bool `protobuf:"varint,6,opt,name=nack,proto3" json:"nack,omitempty"` + ContractFrame *Frame `protobuf:"bytes,7,opt,name=contract_frame,json=contractFrame,proto3,oneof" json:"contract_frame,omitempty"` + // this is threaded back by the `Ack` + // so that the client can compute a single message rtt + Tag *Tag `protobuf:"bytes,8,opt,name=tag,proto3,oneof" json:"tag,omitempty"` + // contract_id lock + // this is required for nack messages. There is no need to set this for ack messages. + // ulid + ContractId []byte `protobuf:"bytes,9,opt,name=contract_id,json=contractId,proto3,oneof" json:"contract_id,omitempty"` +} + +func (x *Pack) Reset() { + *x = Pack{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Pack) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Pack) ProtoMessage() {} + +func (x *Pack) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Pack.ProtoReflect.Descriptor instead. +func (*Pack) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{4} +} + +func (x *Pack) GetMessageId() []byte { + if x != nil { + return x.MessageId + } + return nil +} + +func (x *Pack) GetSequenceId() []byte { + if x != nil { + return x.SequenceId + } + return nil +} + +func (x *Pack) GetSequenceNumber() uint64 { + if x != nil { + return x.SequenceNumber + } + return 0 +} + +func (x *Pack) GetHead() bool { + if x != nil { + return x.Head + } + return false +} + +func (x *Pack) GetFrames() []*Frame { + if x != nil { + return x.Frames + } + return nil +} + +func (x *Pack) GetNack() bool { + if x != nil { + return x.Nack + } + return false +} + +func (x *Pack) GetContractFrame() *Frame { + if x != nil { + return x.ContractFrame + } + return nil +} + +func (x *Pack) GetTag() *Tag { + if x != nil { + return x.Tag + } + return nil +} + +func (x *Pack) GetContractId() []byte { + if x != nil { + return x.ContractId + } + return nil +} + +// used for deep message inspection +type FilteredPack struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContractFrame *Frame `protobuf:"bytes,7,opt,name=contract_frame,json=contractFrame,proto3,oneof" json:"contract_frame,omitempty"` +} + +func (x *FilteredPack) Reset() { + *x = FilteredPack{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FilteredPack) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FilteredPack) ProtoMessage() {} + +func (x *FilteredPack) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FilteredPack.ProtoReflect.Descriptor instead. +func (*FilteredPack) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{5} +} + +func (x *FilteredPack) GetContractFrame() *Frame { + if x != nil { + return x.ContractFrame + } + return nil +} + +// ack of a later message means all prior messages have been ackd +type Ack struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ulid + MessageId []byte `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` + // ulid + SequenceId []byte `protobuf:"bytes,2,opt,name=sequence_id,json=sequenceId,proto3" json:"sequence_id,omitempty"` + // all data buffered in the receiver is acked with `selective=true`. When released it is acked with `selective=false` + Selective bool `protobuf:"varint,3,opt,name=selective,proto3" json:"selective,omitempty"` + // from the `Pack` this responds to + Tag *Tag `protobuf:"bytes,4,opt,name=tag,proto3,oneof" json:"tag,omitempty"` +} + +func (x *Ack) Reset() { + *x = Ack{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ack) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ack) ProtoMessage() {} + +func (x *Ack) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ack.ProtoReflect.Descriptor instead. +func (*Ack) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{6} +} + +func (x *Ack) GetMessageId() []byte { + if x != nil { + return x.MessageId + } + return nil +} + +func (x *Ack) GetSequenceId() []byte { + if x != nil { + return x.SequenceId + } + return nil +} + +func (x *Ack) GetSelective() bool { + if x != nil { + return x.Selective + } + return false +} + +func (x *Ack) GetTag() *Tag { + if x != nil { + return x.Tag + } + return nil +} + +type Tag struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SendTime uint64 `protobuf:"varint,1,opt,name=send_time,json=sendTime,proto3" json:"send_time,omitempty"` +} + +func (x *Tag) Reset() { + *x = Tag{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Tag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Tag) ProtoMessage() {} + +func (x *Tag) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Tag.ProtoReflect.Descriptor instead. +func (*Tag) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{7} +} + +func (x *Tag) GetSendTime() uint64 { + if x != nil { + return x.SendTime + } + return 0 +} + +// this is a connection local message that is sent at the start of each connection to the control platform +// there is no response. the other side will close the connection if no auth +// no auth can happen if the jwt is not valid, or the client_id is not associated with the jwt +// note that association of the client_id to the jwt uses the api (see openapi spec in the api dir) +type Auth struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // the jwt will have the client_id in it + ByJwt string `protobuf:"bytes,1,opt,name=by_jwt,json=byJwt,proto3" json:"by_jwt,omitempty"` + // the version of the app, a semver managed by warp + AppVersion string `protobuf:"bytes,2,opt,name=app_version,json=appVersion,proto3" json:"app_version,omitempty"` + // the pair (client_id, instance_id) represents a single in memory instance + // this helps the platform distinguish multiple instances from multiple transports of the same instance + InstanceId []byte `protobuf:"bytes,3,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` +} + +func (x *Auth) Reset() { + *x = Auth{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Auth) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Auth) ProtoMessage() {} + +func (x *Auth) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Auth.ProtoReflect.Descriptor instead. +func (*Auth) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{8} +} + +func (x *Auth) GetByJwt() string { + if x != nil { + return x.ByJwt + } + return "" +} + +func (x *Auth) GetAppVersion() string { + if x != nil { + return x.AppVersion + } + return "" +} + +func (x *Auth) GetInstanceId() []byte { + if x != nil { + return x.InstanceId + } + return nil +} + +type Provide struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Keys []*ProvideKey `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` +} + +func (x *Provide) Reset() { + *x = Provide{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Provide) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Provide) ProtoMessage() {} + +func (x *Provide) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Provide.ProtoReflect.Descriptor instead. +func (*Provide) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{9} +} + +func (x *Provide) GetKeys() []*ProvideKey { + if x != nil { + return x.Keys + } + return nil +} + +type ProvideKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mode ProvideMode `protobuf:"varint,1,opt,name=mode,proto3,enum=bringyour.ProvideMode" json:"mode,omitempty"` + // used to sign the `StoredContract` bytes + ProvideSecretKey []byte `protobuf:"bytes,2,opt,name=provide_secret_key,json=provideSecretKey,proto3" json:"provide_secret_key,omitempty"` +} + +func (x *ProvideKey) Reset() { + *x = ProvideKey{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProvideKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProvideKey) ProtoMessage() {} + +func (x *ProvideKey) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProvideKey.ProtoReflect.Descriptor instead. +func (*ProvideKey) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{10} +} + +func (x *ProvideKey) GetMode() ProvideMode { + if x != nil { + return x.Mode + } + return ProvideMode_None +} + +func (x *ProvideKey) GetProvideSecretKey() []byte { + if x != nil { + return x.ProvideSecretKey + } + return nil +} + +// each hop on the stream receives this to configure its state, +// including the first and last hops +// this is sent each time a stream contract is created +type StreamOpen struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ulid + SourceId []byte `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3,oneof" json:"source_id,omitempty"` + // ulid + DestinationId []byte `protobuf:"bytes,1,opt,name=destination_id,json=destinationId,proto3,oneof" json:"destination_id,omitempty"` + // ulid + StreamId []byte `protobuf:"bytes,3,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` +} + +func (x *StreamOpen) Reset() { + *x = StreamOpen{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StreamOpen) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamOpen) ProtoMessage() {} + +func (x *StreamOpen) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StreamOpen.ProtoReflect.Descriptor instead. +func (*StreamOpen) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{11} +} + +func (x *StreamOpen) GetSourceId() []byte { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *StreamOpen) GetDestinationId() []byte { + if x != nil { + return x.DestinationId + } + return nil +} + +func (x *StreamOpen) GetStreamId() []byte { + if x != nil { + return x.StreamId + } + return nil +} + +// each hop on the stream receives this to configure its state +// this is sent when all open contracts for the stream are closed +type StreamClose struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ulid + StreamId []byte `protobuf:"bytes,3,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` +} + +func (x *StreamClose) Reset() { + *x = StreamClose{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StreamClose) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamClose) ProtoMessage() {} + +func (x *StreamClose) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StreamClose.ProtoReflect.Descriptor instead. +func (*StreamClose) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{12} +} + +func (x *StreamClose) GetStreamId() []byte { + if x != nil { + return x.StreamId + } + return nil +} + +// control message to create a contract +// platform sends a CreateContractResult +type CreateContract struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ulid + DestinationId []byte `protobuf:"bytes,1,opt,name=destination_id,json=destinationId,proto3,oneof" json:"destination_id,omitempty"` + TransferByteCount uint64 `protobuf:"varint,2,opt,name=transfer_byte_count,json=transferByteCount,proto3" json:"transfer_byte_count,omitempty"` + // restrict the contract to a companion of an existing open contract + Companion bool `protobuf:"varint,3,opt,name=companion,proto3" json:"companion,omitempty"` + // ulids + UsedContractIds [][]byte `protobuf:"bytes,4,rep,name=used_contract_ids,json=usedContractIds,proto3" json:"used_contract_ids,omitempty"` + // ulids + IntermediaryIds [][]byte `protobuf:"bytes,5,rep,name=intermediary_ids,json=intermediaryIds,proto3" json:"intermediary_ids,omitempty"` + // ulid + StreamId []byte `protobuf:"bytes,6,opt,name=stream_id,json=streamId,proto3,oneof" json:"stream_id,omitempty"` + // stream will be used when intermediary_ids or stream_id is set + // in the case of wanting to use streams with no intermediaries, set `force_stream=true` + ForceStream *bool `protobuf:"varint,7,opt,name=force_stream,json=forceStream,proto3,oneof" json:"force_stream,omitempty"` +} + +func (x *CreateContract) Reset() { + *x = CreateContract{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateContract) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateContract) ProtoMessage() {} + +func (x *CreateContract) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateContract.ProtoReflect.Descriptor instead. +func (*CreateContract) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{13} +} + +func (x *CreateContract) GetDestinationId() []byte { + if x != nil { + return x.DestinationId + } + return nil +} + +func (x *CreateContract) GetTransferByteCount() uint64 { + if x != nil { + return x.TransferByteCount + } + return 0 +} + +func (x *CreateContract) GetCompanion() bool { + if x != nil { + return x.Companion + } + return false +} + +func (x *CreateContract) GetUsedContractIds() [][]byte { + if x != nil { + return x.UsedContractIds + } + return nil +} + +func (x *CreateContract) GetIntermediaryIds() [][]byte { + if x != nil { + return x.IntermediaryIds + } + return nil +} + +func (x *CreateContract) GetStreamId() []byte { + if x != nil { + return x.StreamId + } + return nil +} + +func (x *CreateContract) GetForceStream() bool { + if x != nil && x.ForceStream != nil { + return *x.ForceStream + } + return false +} + +type CreateContractResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Error *ContractError `protobuf:"varint,1,opt,name=error,proto3,enum=bringyour.ContractError,oneof" json:"error,omitempty"` + // the public contract to share with the transfer destination + // note this may contain a `stream_id` which directs the client to switch to a stream + Contract *Contract `protobuf:"bytes,2,opt,name=contract,proto3,oneof" json:"contract,omitempty"` + // echo the `CreateContract` to allow associating the result with the request + CreateContract *CreateContract `protobuf:"bytes,3,opt,name=create_contract,json=createContract,proto3,oneof" json:"create_contract,omitempty"` +} + +func (x *CreateContractResult) Reset() { + *x = CreateContractResult{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateContractResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateContractResult) ProtoMessage() {} + +func (x *CreateContractResult) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateContractResult.ProtoReflect.Descriptor instead. +func (*CreateContractResult) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{14} +} + +func (x *CreateContractResult) GetError() ContractError { + if x != nil && x.Error != nil { + return *x.Error + } + return ContractError_NoPermission +} + +func (x *CreateContractResult) GetContract() *Contract { + if x != nil { + return x.Contract + } + return nil +} + +func (x *CreateContractResult) GetCreateContract() *CreateContract { + if x != nil { + return x.CreateContract + } + return nil +} + +// append this message inline a pack to enable the connection +type Contract struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ulid + StoredContractBytes []byte `protobuf:"bytes,1,opt,name=stored_contract_bytes,json=storedContractBytes,proto3" json:"stored_contract_bytes,omitempty"` + // `stored_contract_bytes` signed with the `provider_secret_key` + StoredContractHmac []byte `protobuf:"bytes,2,opt,name=stored_contract_hmac,json=storedContractHmac,proto3" json:"stored_contract_hmac,omitempty"` + // the client must always verify the provide mode by matching the `provider_secret_key` for that mode to the hmac + ProvideMode ProvideMode `protobuf:"varint,3,opt,name=provide_mode,json=provideMode,proto3,enum=bringyour.ProvideMode" json:"provide_mode,omitempty"` +} + +func (x *Contract) Reset() { + *x = Contract{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Contract) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Contract) ProtoMessage() {} + +func (x *Contract) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Contract.ProtoReflect.Descriptor instead. +func (*Contract) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{15} +} + +func (x *Contract) GetStoredContractBytes() []byte { + if x != nil { + return x.StoredContractBytes + } + return nil +} + +func (x *Contract) GetStoredContractHmac() []byte { + if x != nil { + return x.StoredContractHmac + } + return nil +} + +func (x *Contract) GetProvideMode() ProvideMode { + if x != nil { + return x.ProvideMode + } + return ProvideMode_None +} + +// stream_id replaces the source_id and destination_id +type StoredContract struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContractId []byte `protobuf:"bytes,1,opt,name=contract_id,json=contractId,proto3" json:"contract_id,omitempty"` + TransferByteCount uint64 `protobuf:"varint,2,opt,name=transfer_byte_count,json=transferByteCount,proto3" json:"transfer_byte_count,omitempty"` + // ulid + SourceId []byte `protobuf:"bytes,3,opt,name=source_id,json=sourceId,proto3,oneof" json:"source_id,omitempty"` + // ulid + DestinationId []byte `protobuf:"bytes,4,opt,name=destination_id,json=destinationId,proto3,oneof" json:"destination_id,omitempty"` + // ulid + StreamId []byte `protobuf:"bytes,5,opt,name=stream_id,json=streamId,proto3,oneof" json:"stream_id,omitempty"` + // relative priority + // 0 (missing) is least priority + // any positive priority value is 100% more than 0 + // generally only positive priority data will matter for the community payouts, + // and priority will scale the payout amount, + // so it is in a provider's interest to prioritize data with positive priority + Priority *uint32 `protobuf:"varint,6,opt,name=priority,proto3,oneof" json:"priority,omitempty"` +} + +func (x *StoredContract) Reset() { + *x = StoredContract{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoredContract) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoredContract) ProtoMessage() {} + +func (x *StoredContract) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StoredContract.ProtoReflect.Descriptor instead. +func (*StoredContract) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{16} +} + +func (x *StoredContract) GetContractId() []byte { + if x != nil { + return x.ContractId + } + return nil +} + +func (x *StoredContract) GetTransferByteCount() uint64 { + if x != nil { + return x.TransferByteCount + } + return 0 +} + +func (x *StoredContract) GetSourceId() []byte { + if x != nil { + return x.SourceId + } + return nil +} + +func (x *StoredContract) GetDestinationId() []byte { + if x != nil { + return x.DestinationId + } + return nil +} + +func (x *StoredContract) GetStreamId() []byte { + if x != nil { + return x.StreamId + } + return nil +} + +func (x *StoredContract) GetPriority() uint32 { + if x != nil && x.Priority != nil { + return *x.Priority + } + return 0 +} + +// control message +type CloseContract struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContractId []byte `protobuf:"bytes,1,opt,name=contract_id,json=contractId,proto3" json:"contract_id,omitempty"` + AckedByteCount uint64 `protobuf:"varint,2,opt,name=acked_byte_count,json=ackedByteCount,proto3" json:"acked_byte_count,omitempty"` + UnackedByteCount uint64 `protobuf:"varint,3,opt,name=unacked_byte_count,json=unackedByteCount,proto3" json:"unacked_byte_count,omitempty"` + Checkpoint bool `protobuf:"varint,4,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"` +} + +func (x *CloseContract) Reset() { + *x = CloseContract{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloseContract) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloseContract) ProtoMessage() {} + +func (x *CloseContract) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloseContract.ProtoReflect.Descriptor instead. +func (*CloseContract) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{17} +} + +func (x *CloseContract) GetContractId() []byte { + if x != nil { + return x.ContractId + } + return nil +} + +func (x *CloseContract) GetAckedByteCount() uint64 { + if x != nil { + return x.AckedByteCount + } + return 0 +} + +func (x *CloseContract) GetUnackedByteCount() uint64 { + if x != nil { + return x.UnackedByteCount + } + return 0 +} + +func (x *CloseContract) GetCheckpoint() bool { + if x != nil { + return x.Checkpoint + } + return false +} + +// peer auditing +// the acl will block contracts between between two parties with bad audits of each other +type PeerAudit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ulid + PeerId []byte `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` + // number of seconds in the audit + Duration uint64 `protobuf:"varint,2,opt,name=duration,proto3" json:"duration,omitempty"` + Abuse bool `protobuf:"varint,3,opt,name=abuse,proto3" json:"abuse,omitempty"` + BadContractCount uint64 `protobuf:"varint,4,opt,name=bad_contract_count,json=badContractCount,proto3" json:"bad_contract_count,omitempty"` + DiscardedByteCount uint64 `protobuf:"varint,5,opt,name=discarded_byte_count,json=discardedByteCount,proto3" json:"discarded_byte_count,omitempty"` + DiscardedCount uint64 `protobuf:"varint,6,opt,name=discarded_count,json=discardedCount,proto3" json:"discarded_count,omitempty"` + BadMessageByteCount uint64 `protobuf:"varint,7,opt,name=bad_message_byte_count,json=badMessageByteCount,proto3" json:"bad_message_byte_count,omitempty"` + BadMessageCount uint64 `protobuf:"varint,8,opt,name=bad_message_count,json=badMessageCount,proto3" json:"bad_message_count,omitempty"` + SendByteCount uint64 `protobuf:"varint,9,opt,name=send_byte_count,json=sendByteCount,proto3" json:"send_byte_count,omitempty"` + SendCount uint64 `protobuf:"varint,10,opt,name=send_count,json=sendCount,proto3" json:"send_count,omitempty"` + ResendByteCount uint64 `protobuf:"varint,11,opt,name=resend_byte_count,json=resendByteCount,proto3" json:"resend_byte_count,omitempty"` + ResendCount uint64 `protobuf:"varint,12,opt,name=resend_count,json=resendCount,proto3" json:"resend_count,omitempty"` + // ulid + StreamId []byte `protobuf:"bytes,13,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` +} + +func (x *PeerAudit) Reset() { + *x = PeerAudit{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PeerAudit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PeerAudit) ProtoMessage() {} + +func (x *PeerAudit) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PeerAudit.ProtoReflect.Descriptor instead. +func (*PeerAudit) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{18} +} + +func (x *PeerAudit) GetPeerId() []byte { + if x != nil { + return x.PeerId + } + return nil +} + +func (x *PeerAudit) GetDuration() uint64 { + if x != nil { + return x.Duration + } + return 0 +} + +func (x *PeerAudit) GetAbuse() bool { + if x != nil { + return x.Abuse + } + return false +} + +func (x *PeerAudit) GetBadContractCount() uint64 { + if x != nil { + return x.BadContractCount + } + return 0 +} + +func (x *PeerAudit) GetDiscardedByteCount() uint64 { + if x != nil { + return x.DiscardedByteCount + } + return 0 +} + +func (x *PeerAudit) GetDiscardedCount() uint64 { + if x != nil { + return x.DiscardedCount + } + return 0 +} + +func (x *PeerAudit) GetBadMessageByteCount() uint64 { + if x != nil { + return x.BadMessageByteCount + } + return 0 +} + +func (x *PeerAudit) GetBadMessageCount() uint64 { + if x != nil { + return x.BadMessageCount + } + return 0 +} + +func (x *PeerAudit) GetSendByteCount() uint64 { + if x != nil { + return x.SendByteCount + } + return 0 +} + +func (x *PeerAudit) GetSendCount() uint64 { + if x != nil { + return x.SendCount + } + return 0 +} + +func (x *PeerAudit) GetResendByteCount() uint64 { + if x != nil { + return x.ResendByteCount + } + return 0 +} + +func (x *PeerAudit) GetResendCount() uint64 { + if x != nil { + return x.ResendCount + } + return 0 +} + +func (x *PeerAudit) GetStreamId() []byte { + if x != nil { + return x.StreamId + } + return nil +} + +type ControlPing struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ControlPing) Reset() { + *x = ControlPing{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ControlPing) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ControlPing) ProtoMessage() {} + +func (x *ControlPing) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ControlPing.ProtoReflect.Descriptor instead. +func (*ControlPing) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{19} +} + +type ProvidePing struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ProvidePing) Reset() { + *x = ProvidePing{} + if protoimpl.UnsafeEnabled { + mi := &file_transfer_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProvidePing) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProvidePing) ProtoMessage() {} + +func (x *ProvidePing) ProtoReflect() protoreflect.Message { + mi := &file_transfer_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProvidePing.ProtoReflect.Descriptor instead. +func (*ProvidePing) Descriptor() ([]byte, []int) { + return file_transfer_proto_rawDescGZIP(), []int{20} +} + +var File_transfer_proto protoreflect.FileDescriptor + +var file_transfer_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x09, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x1a, 0x0b, 0x66, 0x72, 0x61, + 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x01, 0x0a, 0x0c, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x66, 0x65, 0x72, 0x50, 0x61, 0x74, 0x68, 0x12, 0x20, 0x0a, 0x09, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x08, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x64, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x0d, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x02, 0x52, 0x08, 0x73, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x64, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x73, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x22, 0x75, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x66, 0x65, 0x72, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x66, 0x65, 0x72, 0x50, 0x61, 0x74, 0x68, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x50, 0x61, 0x74, 0x68, 0x12, 0x26, 0x0a, 0x05, 0x66, 0x72, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, + 0x75, 0x72, 0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x05, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x22, + 0x55, 0x0a, 0x15, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x66, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x66, 0x65, 0x72, 0x50, 0x61, 0x74, 0x68, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x50, 0x61, 0x74, 0x68, 0x22, 0x8e, 0x01, 0x0a, 0x1e, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x46, 0x72, 0x61, 0x6d, 0x65, + 0x57, 0x69, 0x74, 0x68, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x66, 0x65, 0x72, 0x50, 0x61, 0x74, 0x68, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x50, 0x61, 0x74, 0x68, 0x12, 0x2e, 0x0a, 0x05, 0x66, 0x72, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, + 0x75, 0x72, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x46, 0x72, 0x61, 0x6d, 0x65, + 0x52, 0x05, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x22, 0xf7, 0x02, 0x0a, 0x04, 0x50, 0x61, 0x63, 0x6b, + 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, + 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x49, 0x64, + 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x73, 0x65, 0x71, 0x75, 0x65, + 0x6e, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x61, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x28, 0x0a, + 0x06, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, + 0x06, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x63, 0x6b, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6e, 0x61, 0x63, 0x6b, 0x12, 0x3c, 0x0a, 0x0e, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, + 0x46, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, 0x03, 0x74, 0x61, 0x67, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, + 0x75, 0x72, 0x2e, 0x54, 0x61, 0x67, 0x48, 0x01, 0x52, 0x03, 0x74, 0x61, 0x67, 0x88, 0x01, 0x01, + 0x12, 0x24, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x02, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x74, 0x61, + 0x67, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x69, + 0x64, 0x22, 0x5f, 0x0a, 0x0c, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x50, 0x61, 0x63, + 0x6b, 0x12, 0x3c, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x66, 0x72, + 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x62, 0x72, 0x69, 0x6e, + 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, + 0x11, 0x0a, 0x0f, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x66, 0x72, 0x61, + 0x6d, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x03, 0x41, 0x63, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x71, + 0x75, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, + 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x25, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, + 0x72, 0x2e, 0x54, 0x61, 0x67, 0x48, 0x00, 0x52, 0x03, 0x74, 0x61, 0x67, 0x88, 0x01, 0x01, 0x42, + 0x06, 0x0a, 0x04, 0x5f, 0x74, 0x61, 0x67, 0x22, 0x22, 0x0a, 0x03, 0x54, 0x61, 0x67, 0x12, 0x1b, + 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x5f, 0x0a, 0x04, 0x41, + 0x75, 0x74, 0x68, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x79, 0x5f, 0x6a, 0x77, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x79, 0x4a, 0x77, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x70, + 0x70, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x61, 0x70, 0x70, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x22, 0x34, 0x0a, 0x07, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x12, 0x29, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, + 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x04, 0x6b, 0x65, + 0x79, 0x73, 0x22, 0x66, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x4b, 0x65, 0x79, + 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, + 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x2c, 0x0a, 0x12, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x98, 0x01, 0x0a, 0x0a, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x20, 0x0a, 0x09, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x08, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x64, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x0d, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x73, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x49, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x69, 0x64, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x22, 0x2a, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, + 0x6c, 0x6f, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, + 0x64, 0x22, 0xdd, 0x02, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x12, 0x2a, 0x0a, 0x0e, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0d, + 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, + 0x12, 0x2e, 0x0a, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x74, + 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x42, 0x79, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x69, 0x6f, 0x6e, 0x12, 0x2a, + 0x0a, 0x11, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, + 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0f, 0x75, 0x73, 0x65, 0x64, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, + 0x72, 0x79, 0x49, 0x64, 0x73, 0x12, 0x20, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, + 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x08, 0x73, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, + 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x48, 0x02, 0x52, + 0x0b, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x88, 0x01, 0x01, 0x42, + 0x11, 0x0a, 0x0f, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, + 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x22, 0xf5, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x33, 0x0a, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x62, 0x72, 0x69, 0x6e, + 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, + 0x34, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x48, 0x01, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x88, 0x01, 0x01, 0x12, 0x47, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x48, 0x02, 0x52, 0x0e, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x88, 0x01, 0x01, 0x42, 0x08, + 0x0a, 0x06, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x22, 0xab, 0x01, 0x0a, 0x08, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x68, 0x6d, + 0x61, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x48, 0x6d, 0x61, 0x63, 0x12, 0x39, 0x0a, 0x0c, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x6f, 0x75, 0x72, 0x2e, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x22, 0xae, 0x02, 0x0a, 0x0e, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x42, 0x79, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, + 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, + 0x0e, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x0d, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x09, 0x73, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x02, 0x52, 0x08, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x70, + 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x03, 0x52, + 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, + 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x64, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x42, 0x0c, 0x0a, + 0x0a, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x42, 0x0b, 0x0a, 0x09, 0x5f, + 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0xa8, 0x01, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, + 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x61, + 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x75, 0x6e, 0x61, 0x63, 0x6b, 0x65, 0x64, + 0x5f, 0x62, 0x79, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x10, 0x75, 0x6e, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x22, 0xf3, 0x03, 0x0a, 0x09, 0x50, 0x65, 0x65, 0x72, 0x41, 0x75, 0x64, 0x69, + 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x62, 0x75, 0x73, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x61, 0x62, 0x75, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x12, + 0x62, 0x61, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x62, 0x61, 0x64, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x69, + 0x73, 0x63, 0x61, 0x72, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, + 0x64, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x27, 0x0a, 0x0f, + 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x65, 0x64, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x33, 0x0a, 0x16, 0x62, 0x61, 0x64, 0x5f, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x62, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x42, 0x79, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x62, 0x61, + 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x62, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x62, + 0x79, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, + 0x0a, 0x0a, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x09, 0x73, 0x65, 0x6e, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, + 0x11, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x64, + 0x42, 0x79, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x73, + 0x65, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0b, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x08, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x22, 0x0d, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x69, 0x6e, 0x67, 0x22, 0x0d, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x50, 0x69, 0x6e, 0x67, 0x2a, 0x64, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, + 0x12, 0x0b, 0x0a, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x10, 0x01, 0x12, 0x14, 0x0a, + 0x10, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x41, 0x6e, 0x64, 0x46, 0x61, 0x6d, 0x69, 0x6c, + 0x79, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x10, 0x03, 0x12, + 0x0a, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x10, 0x05, 0x2a, 0x45, 0x0a, + 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x10, + 0x0a, 0x0c, 0x4e, 0x6f, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x10, 0x00, + 0x12, 0x17, 0x0a, 0x13, 0x49, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x65, 0x74, + 0x75, 0x70, 0x10, 0x02, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x75, 0x72, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x63, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_transfer_proto_rawDescOnce sync.Once + file_transfer_proto_rawDescData = file_transfer_proto_rawDesc +) + +func file_transfer_proto_rawDescGZIP() []byte { + file_transfer_proto_rawDescOnce.Do(func() { + file_transfer_proto_rawDescData = protoimpl.X.CompressGZIP(file_transfer_proto_rawDescData) + }) + return file_transfer_proto_rawDescData +} + +var file_transfer_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_transfer_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_transfer_proto_goTypes = []interface{}{ + (ProvideMode)(0), // 0: bringyour.ProvideMode + (ContractError)(0), // 1: bringyour.ContractError + (*TransferPath)(nil), // 2: bringyour.TransferPath + (*TransferFrame)(nil), // 3: bringyour.TransferFrame + (*FilteredTransferFrame)(nil), // 4: bringyour.FilteredTransferFrame + (*FilteredTransferFrameWithFrame)(nil), // 5: bringyour.FilteredTransferFrameWithFrame + (*Pack)(nil), // 6: bringyour.Pack + (*FilteredPack)(nil), // 7: bringyour.FilteredPack + (*Ack)(nil), // 8: bringyour.Ack + (*Tag)(nil), // 9: bringyour.Tag + (*Auth)(nil), // 10: bringyour.Auth + (*Provide)(nil), // 11: bringyour.Provide + (*ProvideKey)(nil), // 12: bringyour.ProvideKey + (*StreamOpen)(nil), // 13: bringyour.StreamOpen + (*StreamClose)(nil), // 14: bringyour.StreamClose + (*CreateContract)(nil), // 15: bringyour.CreateContract + (*CreateContractResult)(nil), // 16: bringyour.CreateContractResult + (*Contract)(nil), // 17: bringyour.Contract + (*StoredContract)(nil), // 18: bringyour.StoredContract + (*CloseContract)(nil), // 19: bringyour.CloseContract + (*PeerAudit)(nil), // 20: bringyour.PeerAudit + (*ControlPing)(nil), // 21: bringyour.ControlPing + (*ProvidePing)(nil), // 22: bringyour.ProvidePing + (*Frame)(nil), // 23: bringyour.Frame + (*FilteredFrame)(nil), // 24: bringyour.FilteredFrame +} +var file_transfer_proto_depIdxs = []int32{ + 2, // 0: bringyour.TransferFrame.transfer_path:type_name -> bringyour.TransferPath + 23, // 1: bringyour.TransferFrame.frame:type_name -> bringyour.Frame + 2, // 2: bringyour.FilteredTransferFrame.transfer_path:type_name -> bringyour.TransferPath + 2, // 3: bringyour.FilteredTransferFrameWithFrame.transfer_path:type_name -> bringyour.TransferPath + 24, // 4: bringyour.FilteredTransferFrameWithFrame.frame:type_name -> bringyour.FilteredFrame + 23, // 5: bringyour.Pack.frames:type_name -> bringyour.Frame + 23, // 6: bringyour.Pack.contract_frame:type_name -> bringyour.Frame + 9, // 7: bringyour.Pack.tag:type_name -> bringyour.Tag + 23, // 8: bringyour.FilteredPack.contract_frame:type_name -> bringyour.Frame + 9, // 9: bringyour.Ack.tag:type_name -> bringyour.Tag + 12, // 10: bringyour.Provide.keys:type_name -> bringyour.ProvideKey + 0, // 11: bringyour.ProvideKey.mode:type_name -> bringyour.ProvideMode + 1, // 12: bringyour.CreateContractResult.error:type_name -> bringyour.ContractError + 17, // 13: bringyour.CreateContractResult.contract:type_name -> bringyour.Contract + 15, // 14: bringyour.CreateContractResult.create_contract:type_name -> bringyour.CreateContract + 0, // 15: bringyour.Contract.provide_mode:type_name -> bringyour.ProvideMode + 16, // [16:16] is the sub-list for method output_type + 16, // [16:16] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name +} + +func init() { file_transfer_proto_init() } +func file_transfer_proto_init() { + if File_transfer_proto != nil { + return + } + file_frame_proto_init() + if !protoimpl.UnsafeEnabled { + file_transfer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransferPath); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransferFrame); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FilteredTransferFrame); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FilteredTransferFrameWithFrame); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Pack); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FilteredPack); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ack); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Tag); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Auth); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Provide); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProvideKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StreamOpen); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StreamClose); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateContract); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateContractResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Contract); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoredContract); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CloseContract); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerAudit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ControlPing); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_transfer_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProvidePing); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_transfer_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_transfer_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_transfer_proto_msgTypes[5].OneofWrappers = []interface{}{} + file_transfer_proto_msgTypes[6].OneofWrappers = []interface{}{} + file_transfer_proto_msgTypes[11].OneofWrappers = []interface{}{} + file_transfer_proto_msgTypes[13].OneofWrappers = []interface{}{} + file_transfer_proto_msgTypes[14].OneofWrappers = []interface{}{} + file_transfer_proto_msgTypes[16].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_transfer_proto_rawDesc, + NumEnums: 2, + NumMessages: 21, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_transfer_proto_goTypes, + DependencyIndexes: file_transfer_proto_depIdxs, + EnumInfos: file_transfer_proto_enumTypes, + MessageInfos: file_transfer_proto_msgTypes, + }.Build() + File_transfer_proto = out.File + file_transfer_proto_rawDesc = nil + file_transfer_proto_goTypes = nil + file_transfer_proto_depIdxs = nil +} diff --git a/protocol/transfer.proto b/protocol/transfer.proto new file mode 100644 index 0000000..bc67ae8 --- /dev/null +++ b/protocol/transfer.proto @@ -0,0 +1,274 @@ +syntax = "proto3"; +package bringyour; + +import "frame.proto"; + +option go_package = "github.com/urnetwork/connect/protocol"; + + +// changes 2024-08: +// 1. transfer can now be addressed to/from a stream_id +// Anywhere transfer would be addressed to a destination_id or from a source_id, +// it can now be to/from a stream_id. +// 2. stream_ids are created by adding intermediary_destination_ids to CreateContract +// 3. multi-hop state is created with StreamOpen +// This is sent each time a stream contract is created, +// so that the hop state can time out the same as the sender state. + + +// stream_id replaces the source_id and destination_id +message TransferPath { + // ulid + optional bytes source_id = 2; + // ulid + optional bytes destination_id = 1; + // ulid + optional bytes stream_id = 3; +} + + +message TransferFrame { + TransferPath transfer_path = 1; + Frame frame = 2; +} + + +// this is the minimal subset of `TransferFrame` used when making a routing decision +message FilteredTransferFrame { + TransferPath transfer_path = 1; +} + + +message FilteredTransferFrameWithFrame { + TransferPath transfer_path = 1; + FilteredFrame frame = 2; +} + + +message Pack { + // ulid + bytes message_id = 1; + // ulid + bytes sequence_id = 2; + uint64 sequence_number = 3; + // this marks the head message in the sender's sequence + // it means that any message with an earlier sequence_id won't arrive + // and is used when a receiver is recreated with zero state + bool head = 4; + + repeated Frame frames = 5; + + // when true, deliver out of sequence with no acks and no retry + // use true when there is an external transfer control + // default to false for backward compatibility + bool nack = 6; + + optional Frame contract_frame = 7; + + // this is threaded back by the `Ack` + // so that the client can compute a single message rtt + optional Tag tag = 8; + + // contract_id lock + // this is required for nack messages. There is no need to set this for ack messages. + // ulid + optional bytes contract_id = 9; +} + + +// used for deep message inspection +message FilteredPack { + optional Frame contract_frame = 7; +} + + +// ack of a later message means all prior messages have been ackd +message Ack { + // ulid + bytes message_id = 1; + // ulid + bytes sequence_id = 2; + // all data buffered in the receiver is acked with `selective=true`. When released it is acked with `selective=false` + bool selective = 3; + + // from the `Pack` this responds to + optional Tag tag = 4; +} + + +message Tag { + uint64 send_time = 1; +} + + +// this is a connection local message that is sent at the start of each connection to the control platform +// there is no response. the other side will close the connection if no auth +// no auth can happen if the jwt is not valid, or the client_id is not associated with the jwt +// note that association of the client_id to the jwt uses the api (see openapi spec in the api dir) +message Auth { + // the jwt will have the client_id in it + string by_jwt = 1; + // the version of the app, a semver managed by warp + string app_version = 2; + + // the pair (client_id, instance_id) represents a single in memory instance + // this helps the platform distinguish multiple instances from multiple transports of the same instance + bytes instance_id = 3; +} + + +// CHANGE FROM PRIOR VERSION, modes should be considered individually as a mask and do not imply other modes +enum ProvideMode { + None = 0; // this is interpreted the same as a `null` provide mode + Network = 1; + FriendsAndFamily = 2; + Public = 3; + Stream = 4; + PublicStream = 5; +} + + +message Provide { + repeated ProvideKey keys = 1; +} + + +message ProvideKey { + ProvideMode mode = 1; + // used to sign the `StoredContract` bytes + bytes provide_secret_key = 2; +} + + +// each hop on the stream receives this to configure its state, +// including the first and last hops +// this is sent each time a stream contract is created +message StreamOpen { + // ulid + optional bytes source_id = 2; + // ulid + optional bytes destination_id = 1; + // ulid + bytes stream_id = 3; +} + +// each hop on the stream receives this to configure its state +// this is sent when all open contracts for the stream are closed +message StreamClose { + // ulid + bytes stream_id = 3; +} + + +// control message to create a contract +// platform sends a CreateContractResult +message CreateContract { + // ulid + optional bytes destination_id = 1; + uint64 transfer_byte_count = 2; + // restrict the contract to a companion of an existing open contract + bool companion = 3; + // ulids + repeated bytes used_contract_ids = 4; + + // ulids + repeated bytes intermediary_ids = 5; + // ulid + optional bytes stream_id = 6; + // stream will be used when intermediary_ids or stream_id is set + // in the case of wanting to use streams with no intermediaries, set `force_stream=true` + optional bool force_stream = 7; +} +// the creator knows all the hops on the stream from the enumerated linpaths +// when evaluating the completed contracts, the send and receive count involving the source_id +// is the baseline to evaluate the other contracts for disputes + + +enum ContractError { + NoPermission = 0; + InsufficientBalance = 1; + Setup = 2; +} + + +message CreateContractResult { + optional ContractError error = 1; + // the public contract to share with the transfer destination + // note this may contain a `stream_id` which directs the client to switch to a stream + optional Contract contract = 2; + + // echo the `CreateContract` to allow associating the result with the request + optional CreateContract create_contract = 3; +} + + +// append this message inline a pack to enable the connection +message Contract { + // ulid + bytes stored_contract_bytes = 1; + // `stored_contract_bytes` signed with the `provider_secret_key` + bytes stored_contract_hmac = 2; + // the client must always verify the provide mode by matching the `provider_secret_key` for that mode to the hmac + ProvideMode provide_mode = 3; +} + + +// stream_id replaces the source_id and destination_id +message StoredContract { + bytes contract_id = 1; + uint64 transfer_byte_count = 2; + // ulid + optional bytes source_id = 3; + // ulid + optional bytes destination_id = 4; + // ulid + optional bytes stream_id = 5; + + // relative priority + // 0 (missing) is least priority + // any positive priority value is 100% more than 0 + // generally only positive priority data will matter for the community payouts, + // and priority will scale the payout amount, + // so it is in a provider's interest to prioritize data with positive priority + optional uint32 priority = 6; +} + + +// control message +message CloseContract { + bytes contract_id = 1; + uint64 acked_byte_count = 2; + uint64 unacked_byte_count = 3; + bool checkpoint = 4; +} + + +// peer auditing +// the acl will block contracts between between two parties with bad audits of each other +message PeerAudit { + // ulid + bytes peer_id = 1; + // number of seconds in the audit + uint64 duration = 2; + bool abuse = 3; + uint64 bad_contract_count = 4; + uint64 discarded_byte_count = 5; + uint64 discarded_count = 6; + uint64 bad_message_byte_count = 7; + uint64 bad_message_count = 8; + uint64 send_byte_count = 9; + uint64 send_count = 10; + uint64 resend_byte_count = 11; + uint64 resend_count = 12; + // ulid + bytes stream_id = 13; +} + + +message ControlPing { +} + + +message ProvidePing { +} + diff --git a/provider/main.go b/provider/main.go index 9e83405..e932159 100644 --- a/provider/main.go +++ b/provider/main.go @@ -19,7 +19,7 @@ import ( gojwt "github.com/golang-jwt/jwt/v5" "github.com/urnetwork/connect" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) const DefaultApiUrl = "https://api.bringyour.com" diff --git a/transfer.go b/transfer.go index e603d95..29e4032 100644 --- a/transfer.go +++ b/transfer.go @@ -21,7 +21,7 @@ import ( "github.com/golang/glog" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) /* diff --git a/transfer_contract_manager.go b/transfer_contract_manager.go index d4ef2ddd..015a4c9 100644 --- a/transfer_contract_manager.go +++ b/transfer_contract_manager.go @@ -21,7 +21,7 @@ import ( "github.com/golang/glog" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) // manage contracts which are embedded into each transfer sequence diff --git a/transfer_contract_manager_test.go b/transfer_contract_manager_test.go index 31ee071..130a0ca 100644 --- a/transfer_contract_manager_test.go +++ b/transfer_contract_manager_test.go @@ -13,7 +13,7 @@ import ( "google.golang.org/protobuf/proto" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) func TestTakeContract(t *testing.T) { diff --git a/transfer_control.go b/transfer_control.go index 8666198..6a9eceb 100644 --- a/transfer_control.go +++ b/transfer_control.go @@ -6,7 +6,7 @@ import ( "github.com/golang/glog" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) // control sync is a pattern to sync control messages between the server and client diff --git a/transfer_control_test.go b/transfer_control_test.go index 88c386f..e9b6460 100644 --- a/transfer_control_test.go +++ b/transfer_control_test.go @@ -9,7 +9,7 @@ import ( "github.com/go-playground/assert/v2" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) func TestControlSync(t *testing.T) { diff --git a/transfer_oob_control.go b/transfer_oob_control.go index 827d114..889976e 100644 --- a/transfer_oob_control.go +++ b/transfer_oob_control.go @@ -8,7 +8,7 @@ import ( "google.golang.org/protobuf/proto" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) // control messages for a client out of band with the client sequence diff --git a/transfer_rtt.go b/transfer_rtt.go index 7fcef93..7a5e994 100644 --- a/transfer_rtt.go +++ b/transfer_rtt.go @@ -9,7 +9,7 @@ import ( "github.com/golang/glog" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) type rttWindowItem struct { diff --git a/transfer_stream_manager.go b/transfer_stream_manager.go index f03e145..ad84f1e 100644 --- a/transfer_stream_manager.go +++ b/transfer_stream_manager.go @@ -9,7 +9,7 @@ import ( "github.com/golang/glog" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) func DefaultStreamManagerSettings() *StreamManagerSettings { diff --git a/transfer_test.go b/transfer_test.go index 8014105..00e43b1 100644 --- a/transfer_test.go +++ b/transfer_test.go @@ -14,7 +14,7 @@ import ( "github.com/go-playground/assert/v2" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) func TestSendReceiveSenderReset(t *testing.T) { diff --git a/transport.go b/transport.go index 28a6b28..0dd5d50 100644 --- a/transport.go +++ b/transport.go @@ -11,7 +11,7 @@ import ( "github.com/golang/glog" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" ) const TransportBufferSize = 1 diff --git a/wireguard/tun/tun_userspace.go b/wireguard/tun/tun_userspace.go index 032a6e7..02970a2 100644 --- a/wireguard/tun/tun_userspace.go +++ b/wireguard/tun/tun_userspace.go @@ -20,7 +20,7 @@ import ( "github.com/google/gopacket" "github.com/google/gopacket/layers" "github.com/urnetwork/connect" - "github.com/urnetwork/protocol" + "github.com/urnetwork/connect/protocol" "github.com/urnetwork/userwireguard/conn" "github.com/urnetwork/userwireguard/logger" "github.com/urnetwork/userwireguard/tun"