From 8aaa3494f9318905e08f792acc07e33324507d20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 23:12:14 +0000 Subject: [PATCH 1/7] Bump google.golang.org/protobuf from 1.31.0 to 1.33.0 Bumps google.golang.org/protobuf from 1.31.0 to 1.33.0. --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9175200..b2d7d07 100644 --- a/go.mod +++ b/go.mod @@ -7,4 +7,4 @@ require ( golang.org/x/net v0.17.0 ) -require google.golang.org/protobuf v1.31.0 // indirect +require google.golang.org/protobuf v1.33.0 // indirect diff --git a/go.sum b/go.sum index 6da6784..f11b37b 100644 --- a/go.sum +++ b/go.sum @@ -9,5 +9,5 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IV golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= From bd6e705153b9f6a63782f2f990cccd4d6a42f89e Mon Sep 17 00:00:00 2001 From: Chris Mikkelson Date: Tue, 26 Aug 2025 10:37:39 -0500 Subject: [PATCH 2/7] Update protoc go:generate invocation --- sielink.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sielink.go b/sielink.go index 778793c..fdd58d0 100644 --- a/sielink.go +++ b/sielink.go @@ -22,7 +22,7 @@ var ProtocolVersion uint32 = 1 // the package can interoperate with. var SupportedVersions = []uint32{ProtocolVersion} -//go:generate protoc --go_out=. sielink.proto +//go:generate protoc --go_out=. --go_opt=paths=source_relative --go_opt=Msielink.proto=github.com/farsightsec/sielink ./sielink.proto // A Link is the basic interface to a collection of sielink connections. type Link interface { From 06b1a3125687d819131c78be677b754ace6df5dd Mon Sep 17 00:00:00 2001 From: Chris Mikkelson Date: Tue, 26 Aug 2025 10:40:24 -0500 Subject: [PATCH 3/7] Rebuild sielink.pb.go with new protobuf compiler --- sielink.pb.go | 988 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 687 insertions(+), 301 deletions(-) diff --git a/sielink.pb.go b/sielink.pb.go index 51a39a7..82d0dc8 100644 --- a/sielink.pb.go +++ b/sielink.pb.go @@ -1,38 +1,32 @@ -// Code generated by protoc-gen-go. +// +// Copyright (c) 2017 by Farsight Security, Inc. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.8 +// protoc v5.29.3 // source: sielink.proto -// DO NOT EDIT! - -/* -Package sielink is a generated protocol buffer package. - -It is generated from these files: - sielink.proto - -It has these top-level messages: - Message - Payload - LossCounter - Topology - Path - Subscription - Alert -*/ -package sielink -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +package sielink -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +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 MessageType int32 @@ -45,40 +39,62 @@ const ( MessageType_Finished MessageType = 5 ) -var MessageType_name = map[int32]string{ - 0: "DataMessage", - 1: "TopologyMessage", - 2: "AlertMessage", - 3: "Heartbeat", - 4: "Shutdown", - 5: "Finished", -} -var MessageType_value = map[string]int32{ - "DataMessage": 0, - "TopologyMessage": 1, - "AlertMessage": 2, - "Heartbeat": 3, - "Shutdown": 4, - "Finished": 5, -} +// Enum value maps for MessageType. +var ( + MessageType_name = map[int32]string{ + 0: "DataMessage", + 1: "TopologyMessage", + 2: "AlertMessage", + 3: "Heartbeat", + 4: "Shutdown", + 5: "Finished", + } + MessageType_value = map[string]int32{ + "DataMessage": 0, + "TopologyMessage": 1, + "AlertMessage": 2, + "Heartbeat": 3, + "Shutdown": 4, + "Finished": 5, + } +) func (x MessageType) Enum() *MessageType { p := new(MessageType) *p = x return p } + func (x MessageType) String() string { - return proto.EnumName(MessageType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MessageType) Descriptor() protoreflect.EnumDescriptor { + return file_sielink_proto_enumTypes[0].Descriptor() +} + +func (MessageType) Type() protoreflect.EnumType { + return &file_sielink_proto_enumTypes[0] } -func (x *MessageType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(MessageType_value, data, "MessageType") + +func (x MessageType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *MessageType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = MessageType(value) + *x = MessageType(num) return nil } -func (MessageType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// Deprecated: Use MessageType.Descriptor instead. +func (MessageType) EnumDescriptor() ([]byte, []int) { + return file_sielink_proto_rawDescGZIP(), []int{0} +} type PayloadType int32 @@ -88,34 +104,56 @@ const ( PayloadType_AccountingRecord PayloadType = 3 ) -var PayloadType_name = map[int32]string{ - 1: "NmsgContainer", - 2: "LogRecord", - 3: "AccountingRecord", -} -var PayloadType_value = map[string]int32{ - "NmsgContainer": 1, - "LogRecord": 2, - "AccountingRecord": 3, -} +// Enum value maps for PayloadType. +var ( + PayloadType_name = map[int32]string{ + 1: "NmsgContainer", + 2: "LogRecord", + 3: "AccountingRecord", + } + PayloadType_value = map[string]int32{ + "NmsgContainer": 1, + "LogRecord": 2, + "AccountingRecord": 3, + } +) func (x PayloadType) Enum() *PayloadType { p := new(PayloadType) *p = x return p } + func (x PayloadType) String() string { - return proto.EnumName(PayloadType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PayloadType) Descriptor() protoreflect.EnumDescriptor { + return file_sielink_proto_enumTypes[1].Descriptor() +} + +func (PayloadType) Type() protoreflect.EnumType { + return &file_sielink_proto_enumTypes[1] } -func (x *PayloadType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(PayloadType_value, data, "PayloadType") + +func (x PayloadType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *PayloadType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = PayloadType(value) + *x = PayloadType(num) return nil } -func (PayloadType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +// Deprecated: Use PayloadType.Descriptor instead. +func (PayloadType) EnumDescriptor() ([]byte, []int) { + return file_sielink_proto_rawDescGZIP(), []int{1} +} type CompressionType int32 @@ -126,36 +164,58 @@ const ( CompressionType_LZ4 CompressionType = 3 ) -var CompressionType_name = map[int32]string{ - 0: "None", - 1: "Gzip", - 2: "Deflate", - 3: "LZ4", -} -var CompressionType_value = map[string]int32{ - "None": 0, - "Gzip": 1, - "Deflate": 2, - "LZ4": 3, -} +// Enum value maps for CompressionType. +var ( + CompressionType_name = map[int32]string{ + 0: "None", + 1: "Gzip", + 2: "Deflate", + 3: "LZ4", + } + CompressionType_value = map[string]int32{ + "None": 0, + "Gzip": 1, + "Deflate": 2, + "LZ4": 3, + } +) func (x CompressionType) Enum() *CompressionType { p := new(CompressionType) *p = x return p } + func (x CompressionType) String() string { - return proto.EnumName(CompressionType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CompressionType) Descriptor() protoreflect.EnumDescriptor { + return file_sielink_proto_enumTypes[2].Descriptor() +} + +func (CompressionType) Type() protoreflect.EnumType { + return &file_sielink_proto_enumTypes[2] } -func (x *CompressionType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CompressionType_value, data, "CompressionType") + +func (x CompressionType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *CompressionType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = CompressionType(value) + *x = CompressionType(num) return nil } -func (CompressionType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +// Deprecated: Use CompressionType.Descriptor instead. +func (CompressionType) EnumDescriptor() ([]byte, []int) { + return file_sielink_proto_rawDescGZIP(), []int{2} +} type AlertLevel int32 @@ -166,360 +226,686 @@ const ( AlertLevel_FatalError AlertLevel = 3 ) -var AlertLevel_name = map[int32]string{ - 0: "Informational", - 1: "Warning", - 2: "RecoverableError", - 3: "FatalError", -} -var AlertLevel_value = map[string]int32{ - "Informational": 0, - "Warning": 1, - "RecoverableError": 2, - "FatalError": 3, -} +// Enum value maps for AlertLevel. +var ( + AlertLevel_name = map[int32]string{ + 0: "Informational", + 1: "Warning", + 2: "RecoverableError", + 3: "FatalError", + } + AlertLevel_value = map[string]int32{ + "Informational": 0, + "Warning": 1, + "RecoverableError": 2, + "FatalError": 3, + } +) func (x AlertLevel) Enum() *AlertLevel { p := new(AlertLevel) *p = x return p } + func (x AlertLevel) String() string { - return proto.EnumName(AlertLevel_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AlertLevel) Descriptor() protoreflect.EnumDescriptor { + return file_sielink_proto_enumTypes[3].Descriptor() +} + +func (AlertLevel) Type() protoreflect.EnumType { + return &file_sielink_proto_enumTypes[3] } -func (x *AlertLevel) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(AlertLevel_value, data, "AlertLevel") + +func (x AlertLevel) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *AlertLevel) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = AlertLevel(value) + *x = AlertLevel(num) return nil } -func (AlertLevel) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +// Deprecated: Use AlertLevel.Descriptor instead. +func (AlertLevel) EnumDescriptor() ([]byte, []int) { + return file_sielink_proto_rawDescGZIP(), []int{3} +} type Message struct { - ProtocolVersion []uint32 `protobuf:"varint,1,rep,name=protocolVersion" json:"protocolVersion,omitempty"` - MessageType *MessageType `protobuf:"varint,2,req,name=messageType,enum=sielink.MessageType" json:"messageType,omitempty"` - Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` - Topology *Topology `protobuf:"bytes,4,opt,name=topology" json:"topology,omitempty"` - Heartbeat *uint32 `protobuf:"varint,5,opt,name=heartbeat" json:"heartbeat,omitempty"` - Alert *Alert `protobuf:"bytes,6,opt,name=alert" json:"alert,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState `protogen:"open.v1"` + // protocolVersion lists all versions of the protocol + // supported by the message sender. Both peers must + // use the highest mutually supported version. + ProtocolVersion []uint32 `protobuf:"varint,1,rep,name=protocolVersion" json:"protocolVersion,omitempty"` + // The messageType informs the recipient which of the + // following fields are expected to be populated, if any. + MessageType *MessageType `protobuf:"varint,2,req,name=messageType,enum=sielink.MessageType" json:"messageType,omitempty"` + // The Payload is populated only for messages of type DataMessage. + Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` + // The Topology is populated only for messages of type TopologyMessage. + Topology *Topology `protobuf:"bytes,4,opt,name=topology" json:"topology,omitempty"` + // The heartbeat value is a time interval in milliseconds, + // and tells the recipient to expect another heartbeat within + // that time interval. + // + // heartbeat can be set for any message type. Type HeartbeatMessage + // can be used if only the heartbeat is sent. + Heartbeat *uint32 `protobuf:"varint,5,opt,name=heartbeat" json:"heartbeat,omitempty"` + // Alert is populated only for messages of type AlertMessage. + Alert *Alert `protobuf:"bytes,6,opt,name=alert" json:"alert,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Message) Reset() { + *x = Message{} + mi := &file_sielink_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Message) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Message) ProtoMessage() {} + +func (x *Message) ProtoReflect() protoreflect.Message { + mi := &file_sielink_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +// Deprecated: Use Message.ProtoReflect.Descriptor instead. +func (*Message) Descriptor() ([]byte, []int) { + return file_sielink_proto_rawDescGZIP(), []int{0} +} -func (m *Message) GetProtocolVersion() []uint32 { - if m != nil { - return m.ProtocolVersion +func (x *Message) GetProtocolVersion() []uint32 { + if x != nil { + return x.ProtocolVersion } return nil } -func (m *Message) GetMessageType() MessageType { - if m != nil && m.MessageType != nil { - return *m.MessageType +func (x *Message) GetMessageType() MessageType { + if x != nil && x.MessageType != nil { + return *x.MessageType } return MessageType_DataMessage } -func (m *Message) GetPayload() *Payload { - if m != nil { - return m.Payload +func (x *Message) GetPayload() *Payload { + if x != nil { + return x.Payload } return nil } -func (m *Message) GetTopology() *Topology { - if m != nil { - return m.Topology +func (x *Message) GetTopology() *Topology { + if x != nil { + return x.Topology } return nil } -func (m *Message) GetHeartbeat() uint32 { - if m != nil && m.Heartbeat != nil { - return *m.Heartbeat +func (x *Message) GetHeartbeat() uint32 { + if x != nil && x.Heartbeat != nil { + return *x.Heartbeat } return 0 } -func (m *Message) GetAlert() *Alert { - if m != nil { - return m.Alert +func (x *Message) GetAlert() *Alert { + if x != nil { + return x.Alert } return nil } +// A Payload carries data for eventual publication or other processing. type Payload struct { - Channel *uint32 `protobuf:"varint,1,req,name=channel" json:"channel,omitempty"` - PayloadType *PayloadType `protobuf:"varint,2,opt,name=payloadType,enum=sielink.PayloadType" json:"payloadType,omitempty"` - CompressionType *CompressionType `protobuf:"varint,3,opt,name=compressionType,enum=sielink.CompressionType" json:"compressionType,omitempty"` - Data []byte `protobuf:"bytes,4,opt,name=data" json:"data,omitempty"` - LinkLoss *LossCounter `protobuf:"bytes,5,opt,name=linkLoss" json:"linkLoss,omitempty"` - PathLoss *LossCounter `protobuf:"bytes,6,opt,name=pathLoss" json:"pathLoss,omitempty"` - SourceSite *uint32 `protobuf:"varint,7,opt,name=sourceSite" json:"sourceSite,omitempty"` - SourceContributor *uint32 `protobuf:"varint,8,opt,name=sourceContributor" json:"sourceContributor,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Payload) Reset() { *m = Payload{} } -func (m *Payload) String() string { return proto.CompactTextString(m) } -func (*Payload) ProtoMessage() {} -func (*Payload) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func (m *Payload) GetChannel() uint32 { - if m != nil && m.Channel != nil { - return *m.Channel + state protoimpl.MessageState `protogen:"open.v1"` + // Data is segmented into channels, some of which correspond + // to SIE channel numbers. + Channel *uint32 `protobuf:"varint,1,req,name=channel" json:"channel,omitempty"` + PayloadType *PayloadType `protobuf:"varint,2,opt,name=payloadType,enum=sielink.PayloadType" json:"payloadType,omitempty"` + CompressionType *CompressionType `protobuf:"varint,3,opt,name=compressionType,enum=sielink.CompressionType" json:"compressionType,omitempty"` + Data []byte `protobuf:"bytes,4,opt,name=data" json:"data,omitempty"` + // The loss markers `linkLoss` and `pathLoss` track + // loss of sielink Payloads from queue overflows. + // The `linkLoss` counters are added to `pathLoss` + // and reset on each hop. + LinkLoss *LossCounter `protobuf:"bytes,5,opt,name=linkLoss" json:"linkLoss,omitempty"` + PathLoss *LossCounter `protobuf:"bytes,6,opt,name=pathLoss" json:"pathLoss,omitempty"` + // sourceSite identifies the site at which the Payload + // was first submitted. + SourceSite *uint32 `protobuf:"varint,7,opt,name=sourceSite" json:"sourceSite,omitempty"` + // sourceContributor contains the SIE source id of the + // uploading client, if known. The identifiers in the + // enclosed payloads (for NmsgContainer payloadType) are + // not modified in transit. + SourceContributor *uint32 `protobuf:"varint,8,opt,name=sourceContributor" json:"sourceContributor,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Payload) Reset() { + *x = Payload{} + mi := &file_sielink_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Payload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Payload) ProtoMessage() {} + +func (x *Payload) ProtoReflect() protoreflect.Message { + mi := &file_sielink_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Payload.ProtoReflect.Descriptor instead. +func (*Payload) Descriptor() ([]byte, []int) { + return file_sielink_proto_rawDescGZIP(), []int{1} +} + +func (x *Payload) GetChannel() uint32 { + if x != nil && x.Channel != nil { + return *x.Channel } return 0 } -func (m *Payload) GetPayloadType() PayloadType { - if m != nil && m.PayloadType != nil { - return *m.PayloadType +func (x *Payload) GetPayloadType() PayloadType { + if x != nil && x.PayloadType != nil { + return *x.PayloadType } return PayloadType_NmsgContainer } -func (m *Payload) GetCompressionType() CompressionType { - if m != nil && m.CompressionType != nil { - return *m.CompressionType +func (x *Payload) GetCompressionType() CompressionType { + if x != nil && x.CompressionType != nil { + return *x.CompressionType } return CompressionType_None } -func (m *Payload) GetData() []byte { - if m != nil { - return m.Data +func (x *Payload) GetData() []byte { + if x != nil { + return x.Data } return nil } -func (m *Payload) GetLinkLoss() *LossCounter { - if m != nil { - return m.LinkLoss +func (x *Payload) GetLinkLoss() *LossCounter { + if x != nil { + return x.LinkLoss } return nil } -func (m *Payload) GetPathLoss() *LossCounter { - if m != nil { - return m.PathLoss +func (x *Payload) GetPathLoss() *LossCounter { + if x != nil { + return x.PathLoss } return nil } -func (m *Payload) GetSourceSite() uint32 { - if m != nil && m.SourceSite != nil { - return *m.SourceSite +func (x *Payload) GetSourceSite() uint32 { + if x != nil && x.SourceSite != nil { + return *x.SourceSite } return 0 } -func (m *Payload) GetSourceContributor() uint32 { - if m != nil && m.SourceContributor != nil { - return *m.SourceContributor +func (x *Payload) GetSourceContributor() uint32 { + if x != nil && x.SourceContributor != nil { + return *x.SourceContributor } return 0 } type LossCounter struct { - Bytes *uint64 `protobuf:"varint,1,opt,name=bytes" json:"bytes,omitempty"` - Payloads *uint64 `protobuf:"varint,2,opt,name=payloads" json:"payloads,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState `protogen:"open.v1"` + Bytes *uint64 `protobuf:"varint,1,opt,name=bytes" json:"bytes,omitempty"` + Payloads *uint64 `protobuf:"varint,2,opt,name=payloads" json:"payloads,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LossCounter) Reset() { + *x = LossCounter{} + mi := &file_sielink_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LossCounter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LossCounter) ProtoMessage() {} + +func (x *LossCounter) ProtoReflect() protoreflect.Message { + mi := &file_sielink_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *LossCounter) Reset() { *m = LossCounter{} } -func (m *LossCounter) String() string { return proto.CompactTextString(m) } -func (*LossCounter) ProtoMessage() {} -func (*LossCounter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +// Deprecated: Use LossCounter.ProtoReflect.Descriptor instead. +func (*LossCounter) Descriptor() ([]byte, []int) { + return file_sielink_proto_rawDescGZIP(), []int{2} +} -func (m *LossCounter) GetBytes() uint64 { - if m != nil && m.Bytes != nil { - return *m.Bytes +func (x *LossCounter) GetBytes() uint64 { + if x != nil && x.Bytes != nil { + return *x.Bytes } return 0 } -func (m *LossCounter) GetPayloads() uint64 { - if m != nil && m.Payloads != nil { - return *m.Payloads +func (x *LossCounter) GetPayloads() uint64 { + if x != nil && x.Payloads != nil { + return *x.Payloads } return 0 } +// The exchange of Topology messages coordinates the routing of +// Payloads among the submission hosts. type Topology struct { - Path []*Path `protobuf:"bytes,1,rep,name=path" json:"path,omitempty"` - Subscription []*Subscription `protobuf:"bytes,2,rep,name=subscription" json:"subscription,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState `protogen:"open.v1"` + // `path` contains the shortest known path for each known site, + // except for the site receiving the topology message. + Path []*Path `protobuf:"bytes,1,rep,name=path" json:"path,omitempty"` + // `subscription` selects the data the sender wishes to receive. + Subscription []*Subscription `protobuf:"bytes,2,rep,name=subscription" json:"subscription,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Topology) Reset() { + *x = Topology{} + mi := &file_sielink_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Topology) Reset() { *m = Topology{} } -func (m *Topology) String() string { return proto.CompactTextString(m) } -func (*Topology) ProtoMessage() {} -func (*Topology) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } +func (x *Topology) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Topology) ProtoMessage() {} + +func (x *Topology) ProtoReflect() protoreflect.Message { + mi := &file_sielink_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Topology.ProtoReflect.Descriptor instead. +func (*Topology) Descriptor() ([]byte, []int) { + return file_sielink_proto_rawDescGZIP(), []int{3} +} -func (m *Topology) GetPath() []*Path { - if m != nil { - return m.Path +func (x *Topology) GetPath() []*Path { + if x != nil { + return x.Path } return nil } -func (m *Topology) GetSubscription() []*Subscription { - if m != nil { - return m.Subscription +func (x *Topology) GetSubscription() []*Subscription { + if x != nil { + return x.Subscription } return nil } +// A Path is an ordered list of sites with a metric reflecting the +// cost of traversing the full path. The sites are listed in order +// from the furthest (destination) to the closest (next hop). type Path struct { - Metric *uint64 `protobuf:"varint,1,req,name=metric" json:"metric,omitempty"` - Site []uint32 `protobuf:"varint,2,rep,name=site" json:"site,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState `protogen:"open.v1"` + Metric *uint64 `protobuf:"varint,1,req,name=metric" json:"metric,omitempty"` + Site []uint32 `protobuf:"varint,2,rep,name=site" json:"site,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *Path) Reset() { *m = Path{} } -func (m *Path) String() string { return proto.CompactTextString(m) } -func (*Path) ProtoMessage() {} -func (*Path) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } +func (x *Path) Reset() { + *x = Path{} + mi := &file_sielink_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Path) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Path) ProtoMessage() {} -func (m *Path) GetMetric() uint64 { - if m != nil && m.Metric != nil { - return *m.Metric +func (x *Path) ProtoReflect() protoreflect.Message { + mi := &file_sielink_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Path.ProtoReflect.Descriptor instead. +func (*Path) Descriptor() ([]byte, []int) { + return file_sielink_proto_rawDescGZIP(), []int{4} +} + +func (x *Path) GetMetric() uint64 { + if x != nil && x.Metric != nil { + return *x.Metric } return 0 } -func (m *Path) GetSite() []uint32 { - if m != nil { - return m.Site +func (x *Path) GetSite() []uint32 { + if x != nil { + return x.Site } return nil } +// Subscription messages supply a list of channels the sender wishes +// to receive, and an optional source site. If the source site is populated +// and nonzero, the message reqeusts only data submitted to that site on the +// supplied channels. Otherwise, it requests data from any site. type Subscription struct { - SourceSite *uint32 `protobuf:"varint,1,opt,name=sourceSite" json:"sourceSite,omitempty"` - Channel []uint32 `protobuf:"varint,2,rep,name=channel" json:"channel,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState `protogen:"open.v1"` + SourceSite *uint32 `protobuf:"varint,1,opt,name=sourceSite" json:"sourceSite,omitempty"` + Channel []uint32 `protobuf:"varint,2,rep,name=channel" json:"channel,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Subscription) Reset() { + *x = Subscription{} + mi := &file_sielink_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Subscription) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Subscription) ProtoMessage() {} + +func (x *Subscription) ProtoReflect() protoreflect.Message { + mi := &file_sielink_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *Subscription) Reset() { *m = Subscription{} } -func (m *Subscription) String() string { return proto.CompactTextString(m) } -func (*Subscription) ProtoMessage() {} -func (*Subscription) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } +// Deprecated: Use Subscription.ProtoReflect.Descriptor instead. +func (*Subscription) Descriptor() ([]byte, []int) { + return file_sielink_proto_rawDescGZIP(), []int{5} +} -func (m *Subscription) GetSourceSite() uint32 { - if m != nil && m.SourceSite != nil { - return *m.SourceSite +func (x *Subscription) GetSourceSite() uint32 { + if x != nil && x.SourceSite != nil { + return *x.SourceSite } return 0 } -func (m *Subscription) GetChannel() []uint32 { - if m != nil { - return m.Channel +func (x *Subscription) GetChannel() []uint32 { + if x != nil { + return x.Channel } return nil } +// Alert messages are used to communicate error conditions and +// other out-of-band information to the peer. With the exception +// of FatalError alerts, they do not affect the operation of the +// protocol. type Alert struct { - Level *AlertLevel `protobuf:"varint,1,req,name=level,enum=sielink.AlertLevel" json:"level,omitempty"` - Message *string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` - Code *uint32 `protobuf:"varint,3,opt,name=code" json:"code,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState `protogen:"open.v1"` + Level *AlertLevel `protobuf:"varint,1,req,name=level,enum=sielink.AlertLevel" json:"level,omitempty"` + Message *string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` + Code *uint32 `protobuf:"varint,3,opt,name=code" json:"code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Alert) Reset() { + *x = Alert{} + mi := &file_sielink_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Alert) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Alert) Reset() { *m = Alert{} } -func (m *Alert) String() string { return proto.CompactTextString(m) } -func (*Alert) ProtoMessage() {} -func (*Alert) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } +func (*Alert) ProtoMessage() {} -func (m *Alert) GetLevel() AlertLevel { - if m != nil && m.Level != nil { - return *m.Level +func (x *Alert) ProtoReflect() protoreflect.Message { + mi := &file_sielink_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Alert.ProtoReflect.Descriptor instead. +func (*Alert) Descriptor() ([]byte, []int) { + return file_sielink_proto_rawDescGZIP(), []int{6} +} + +func (x *Alert) GetLevel() AlertLevel { + if x != nil && x.Level != nil { + return *x.Level } return AlertLevel_Informational } -func (m *Alert) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message +func (x *Alert) GetMessage() string { + if x != nil && x.Message != nil { + return *x.Message } return "" } -func (m *Alert) GetCode() uint32 { - if m != nil && m.Code != nil { - return *m.Code +func (x *Alert) GetCode() uint32 { + if x != nil && x.Code != nil { + return *x.Code } return 0 } -func init() { - proto.RegisterType((*Message)(nil), "sielink.Message") - proto.RegisterType((*Payload)(nil), "sielink.Payload") - proto.RegisterType((*LossCounter)(nil), "sielink.LossCounter") - proto.RegisterType((*Topology)(nil), "sielink.Topology") - proto.RegisterType((*Path)(nil), "sielink.Path") - proto.RegisterType((*Subscription)(nil), "sielink.Subscription") - proto.RegisterType((*Alert)(nil), "sielink.Alert") - proto.RegisterEnum("sielink.MessageType", MessageType_name, MessageType_value) - proto.RegisterEnum("sielink.PayloadType", PayloadType_name, PayloadType_value) - proto.RegisterEnum("sielink.CompressionType", CompressionType_name, CompressionType_value) - proto.RegisterEnum("sielink.AlertLevel", AlertLevel_name, AlertLevel_value) -} - -func init() { proto.RegisterFile("sielink.proto", fileDescriptor0) } - -var fileDescriptor0 = []byte{ - // 697 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x53, 0x5d, 0x6f, 0xd3, 0x3c, - 0x14, 0x7e, 0x9b, 0xa4, 0x4b, 0x77, 0xd2, 0x8f, 0xcc, 0xdb, 0x8b, 0x22, 0x84, 0xd0, 0x88, 0xb8, - 0x28, 0x15, 0x4c, 0xa8, 0x42, 0x48, 0x88, 0x0b, 0x34, 0xf6, 0xc1, 0x90, 0xba, 0x69, 0xf2, 0x26, - 0x90, 0xb8, 0xc2, 0x4d, 0xbd, 0x26, 0x22, 0x8d, 0x23, 0xdb, 0x1d, 0x2a, 0x3f, 0x81, 0xff, 0xc9, - 0xff, 0xc0, 0x76, 0x3e, 0x9a, 0x76, 0x12, 0x77, 0x3e, 0xe7, 0x3c, 0xe7, 0xf1, 0xf1, 0xe3, 0xe7, - 0x40, 0x4f, 0x24, 0x34, 0x4d, 0xb2, 0x1f, 0x47, 0x39, 0x67, 0x92, 0x21, 0xb7, 0x0c, 0xc3, 0xdf,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 0x3e, 0x67, 0x77, 0x8c, 0x2f, 0x88, 0xfe, 0x2e, 0x92, 0x2a, 0x02, 0xd5, 0xf6, 0x95, - 0xf0, 0x4c, 0x5d, 0xa8, 0x38, 0xd4, 0x00, 0xfa, 0xda, 0x7b, 0xca, 0xc9, 0x34, 0xa5, 0x67, 0x9c, - 0x33, 0xae, 0xc8, 0xfa, 0x00, 0xe7, 0x4a, 0xaa, 0xb4, 0x88, 0xed, 0xbf, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x86, 0x25, 0x97, 0x29, 0x62, 0x05, 0x00, 0x00, +var File_sielink_proto protoreflect.FileDescriptor + +const file_sielink_proto_rawDesc = "" + + "\n" + + "\rsielink.proto\x12\asielink\"\x8a\x02\n" + + "\aMessage\x12(\n" + + "\x0fprotocolVersion\x18\x01 \x03(\rR\x0fprotocolVersion\x126\n" + + "\vmessageType\x18\x02 \x02(\x0e2\x14.sielink.MessageTypeR\vmessageType\x12*\n" + + "\apayload\x18\x03 \x01(\v2\x10.sielink.PayloadR\apayload\x12-\n" + + "\btopology\x18\x04 \x01(\v2\x11.sielink.TopologyR\btopology\x12\x1c\n" + + "\theartbeat\x18\x05 \x01(\rR\theartbeat\x12$\n" + + "\x05alert\x18\x06 \x01(\v2\x0e.sielink.AlertR\x05alert\"\xe5\x02\n" + + "\aPayload\x12\x18\n" + + "\achannel\x18\x01 \x02(\rR\achannel\x126\n" + + "\vpayloadType\x18\x02 \x01(\x0e2\x14.sielink.PayloadTypeR\vpayloadType\x12B\n" + + "\x0fcompressionType\x18\x03 \x01(\x0e2\x18.sielink.CompressionTypeR\x0fcompressionType\x12\x12\n" + + "\x04data\x18\x04 \x01(\fR\x04data\x120\n" + + "\blinkLoss\x18\x05 \x01(\v2\x14.sielink.LossCounterR\blinkLoss\x120\n" + + "\bpathLoss\x18\x06 \x01(\v2\x14.sielink.LossCounterR\bpathLoss\x12\x1e\n" + + "\n" + + "sourceSite\x18\a \x01(\rR\n" + + "sourceSite\x12,\n" + + "\x11sourceContributor\x18\b \x01(\rR\x11sourceContributor\"?\n" + + "\vLossCounter\x12\x14\n" + + "\x05bytes\x18\x01 \x01(\x04R\x05bytes\x12\x1a\n" + + "\bpayloads\x18\x02 \x01(\x04R\bpayloads\"h\n" + + "\bTopology\x12!\n" + + "\x04path\x18\x01 \x03(\v2\r.sielink.PathR\x04path\x129\n" + + "\fsubscription\x18\x02 \x03(\v2\x15.sielink.SubscriptionR\fsubscription\"2\n" + + "\x04Path\x12\x16\n" + + "\x06metric\x18\x01 \x02(\x04R\x06metric\x12\x12\n" + + "\x04site\x18\x02 \x03(\rR\x04site\"H\n" + + "\fSubscription\x12\x1e\n" + + "\n" + + "sourceSite\x18\x01 \x01(\rR\n" + + "sourceSite\x12\x18\n" + + "\achannel\x18\x02 \x03(\rR\achannel\"`\n" + + "\x05Alert\x12)\n" + + "\x05level\x18\x01 \x02(\x0e2\x13.sielink.AlertLevelR\x05level\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x12\x12\n" + + "\x04code\x18\x03 \x01(\rR\x04code*p\n" + + "\vMessageType\x12\x0f\n" + + "\vDataMessage\x10\x00\x12\x13\n" + + "\x0fTopologyMessage\x10\x01\x12\x10\n" + + "\fAlertMessage\x10\x02\x12\r\n" + + "\tHeartbeat\x10\x03\x12\f\n" + + "\bShutdown\x10\x04\x12\f\n" + + "\bFinished\x10\x05*E\n" + + "\vPayloadType\x12\x11\n" + + "\rNmsgContainer\x10\x01\x12\r\n" + + "\tLogRecord\x10\x02\x12\x14\n" + + "\x10AccountingRecord\x10\x03*;\n" + + "\x0fCompressionType\x12\b\n" + + "\x04None\x10\x00\x12\b\n" + + "\x04Gzip\x10\x01\x12\v\n" + + "\aDeflate\x10\x02\x12\a\n" + + "\x03LZ4\x10\x03*R\n" + + "\n" + + "AlertLevel\x12\x11\n" + + "\rInformational\x10\x00\x12\v\n" + + "\aWarning\x10\x01\x12\x14\n" + + "\x10RecoverableError\x10\x02\x12\x0e\n" + + "\n" + + "FatalError\x10\x03" + +var ( + file_sielink_proto_rawDescOnce sync.Once + file_sielink_proto_rawDescData []byte +) + +func file_sielink_proto_rawDescGZIP() []byte { + file_sielink_proto_rawDescOnce.Do(func() { + file_sielink_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_sielink_proto_rawDesc), len(file_sielink_proto_rawDesc))) + }) + return file_sielink_proto_rawDescData +} + +var file_sielink_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_sielink_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_sielink_proto_goTypes = []any{ + (MessageType)(0), // 0: sielink.MessageType + (PayloadType)(0), // 1: sielink.PayloadType + (CompressionType)(0), // 2: sielink.CompressionType + (AlertLevel)(0), // 3: sielink.AlertLevel + (*Message)(nil), // 4: sielink.Message + (*Payload)(nil), // 5: sielink.Payload + (*LossCounter)(nil), // 6: sielink.LossCounter + (*Topology)(nil), // 7: sielink.Topology + (*Path)(nil), // 8: sielink.Path + (*Subscription)(nil), // 9: sielink.Subscription + (*Alert)(nil), // 10: sielink.Alert +} +var file_sielink_proto_depIdxs = []int32{ + 0, // 0: sielink.Message.messageType:type_name -> sielink.MessageType + 5, // 1: sielink.Message.payload:type_name -> sielink.Payload + 7, // 2: sielink.Message.topology:type_name -> sielink.Topology + 10, // 3: sielink.Message.alert:type_name -> sielink.Alert + 1, // 4: sielink.Payload.payloadType:type_name -> sielink.PayloadType + 2, // 5: sielink.Payload.compressionType:type_name -> sielink.CompressionType + 6, // 6: sielink.Payload.linkLoss:type_name -> sielink.LossCounter + 6, // 7: sielink.Payload.pathLoss:type_name -> sielink.LossCounter + 8, // 8: sielink.Topology.path:type_name -> sielink.Path + 9, // 9: sielink.Topology.subscription:type_name -> sielink.Subscription + 3, // 10: sielink.Alert.level:type_name -> sielink.AlertLevel + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_sielink_proto_init() } +func file_sielink_proto_init() { + if File_sielink_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_sielink_proto_rawDesc), len(file_sielink_proto_rawDesc)), + NumEnums: 4, + NumMessages: 7, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_sielink_proto_goTypes, + DependencyIndexes: file_sielink_proto_depIdxs, + EnumInfos: file_sielink_proto_enumTypes, + MessageInfos: file_sielink_proto_msgTypes, + }.Build() + File_sielink_proto = out.File + file_sielink_proto_goTypes = nil + file_sielink_proto_depIdxs = nil } From f22283d4d417887376542eb06e442463fbe0269d Mon Sep 17 00:00:00 2001 From: Chris Mikkelson Date: Tue, 26 Aug 2025 10:42:17 -0500 Subject: [PATCH 4/7] Update protobuf imports Replace deprecated github.com/golang/protobuf with google.golang.org/protobuf --- go.mod | 10 +++++----- go.sum | 13 ++++--------- rawlink/confmessage.go | 2 +- rawlink/link_test.go | 2 +- rawlink/message.go | 4 ++-- rawlink/sender.go | 4 ++-- sielink.go | 2 +- 7 files changed, 16 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index b2d7d07..936bb8a 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ module github.com/farsightsec/sielink -go 1.19 +go 1.23.0 + +toolchain go1.24.6 require ( - github.com/golang/protobuf v1.5.3 - golang.org/x/net v0.17.0 + golang.org/x/net v0.43.0 + google.golang.org/protobuf v1.36.8 ) - -require google.golang.org/protobuf v1.33.0 // indirect diff --git a/go.sum b/go.sum index f11b37b..8d95720 100644 --- a/go.sum +++ b/go.sum @@ -1,13 +1,8 @@ -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc= +google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= diff --git a/rawlink/confmessage.go b/rawlink/confmessage.go index c369f27..d8fc14f 100644 --- a/rawlink/confmessage.go +++ b/rawlink/confmessage.go @@ -9,8 +9,8 @@ package rawlink import ( - "github.com/golang/protobuf/proto" "github.com/farsightsec/sielink" + "google.golang.org/protobuf/proto" ) func (l *Link) setHeartbeat(hbtime uint32) { diff --git a/rawlink/link_test.go b/rawlink/link_test.go index 6a3eb19..6fe9a33 100644 --- a/rawlink/link_test.go +++ b/rawlink/link_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/farsightsec/sielink" "github.com/farsightsec/sielink/rawlink" diff --git a/rawlink/message.go b/rawlink/message.go index 4e1a520..0c48b50 100644 --- a/rawlink/message.go +++ b/rawlink/message.go @@ -9,9 +9,9 @@ package rawlink import ( - "github.com/golang/protobuf/proto" - "golang.org/x/net/websocket" "github.com/farsightsec/sielink" + "golang.org/x/net/websocket" + "google.golang.org/protobuf/proto" ) func readMessage(c *websocket.Conn, m *sielink.Message) error { diff --git a/rawlink/sender.go b/rawlink/sender.go index cf7f634..8b14ff7 100644 --- a/rawlink/sender.go +++ b/rawlink/sender.go @@ -11,9 +11,9 @@ package rawlink import ( "time" - "github.com/golang/protobuf/proto" - "golang.org/x/net/websocket" "github.com/farsightsec/sielink" + "golang.org/x/net/websocket" + "google.golang.org/protobuf/proto" ) func sendHeartbeat(c *websocket.Conn, d time.Duration) { diff --git a/sielink.go b/sielink.go index fdd58d0..3e1f4f7 100644 --- a/sielink.go +++ b/sielink.go @@ -11,7 +11,7 @@ package sielink import ( "fmt" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // ProtocolVersion is the version of the protocol implemented From 8161ec1c398714bcec352d41a5dae9e26491a60d Mon Sep 17 00:00:00 2001 From: Chris Mikkelson Date: Tue, 26 Aug 2025 10:42:32 -0500 Subject: [PATCH 5/7] gofmt changes --- rawlink/link.go | 1 - rawlink/reader.go | 3 +-- rawlink/start.go | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/rawlink/link.go b/rawlink/link.go index 6386175..caf408a 100644 --- a/rawlink/link.go +++ b/rawlink/link.go @@ -9,7 +9,6 @@ // Package rawlink implements the base sielink Link protocol. It is not intended // to be used directly, but different usage profiles of the Link protocol may embed // a Link instance and implement their operations on top of it. -// package rawlink import ( diff --git a/rawlink/reader.go b/rawlink/reader.go index d0d849a..4e3b1dc 100644 --- a/rawlink/reader.go +++ b/rawlink/reader.go @@ -12,8 +12,8 @@ import ( "fmt" "time" - "golang.org/x/net/websocket" "github.com/farsightsec/sielink" + "golang.org/x/net/websocket" ) type recoverError struct{ rerr interface{} } @@ -27,7 +27,6 @@ func (r recoverError) Error() string { // It returns when it enocunters a read error (which it returns), receives a // fatal Alert from its peer (which it returns), or receives a Finished message // from its peer, in which case it returns nil. -// func (l *Link) runReader(c *websocket.Conn, rshut chan<- struct{}) (err error) { defer func() { // The l.ControlFunc call needs to be in this closure for diff --git a/rawlink/start.go b/rawlink/start.go index 644c271..02afe7f 100644 --- a/rawlink/start.go +++ b/rawlink/start.go @@ -12,8 +12,8 @@ import ( "fmt" "time" - "golang.org/x/net/websocket" "github.com/farsightsec/sielink" + "golang.org/x/net/websocket" ) func (l *Link) runConnection(c *websocket.Conn) (err error) { From 8413e357ac315ba70d14aa55878137ec2cc7148f Mon Sep 17 00:00:00 2001 From: Chris Mikkelson Date: Thu, 28 Aug 2025 13:26:12 -0500 Subject: [PATCH 6/7] reader.go: interface{} -> any --- rawlink/reader.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rawlink/reader.go b/rawlink/reader.go index 4e3b1dc..46a5dfe 100644 --- a/rawlink/reader.go +++ b/rawlink/reader.go @@ -16,7 +16,7 @@ import ( "golang.org/x/net/websocket" ) -type recoverError struct{ rerr interface{} } +type recoverError struct{ rerr any } func (r recoverError) Error() string { return fmt.Sprintf("panic: %v", r.rerr) From 981dad3ca41f133485e12a6daece3ae869f9e578 Mon Sep 17 00:00:00 2001 From: Chris Mikkelson Date: Thu, 28 Aug 2025 13:31:52 -0500 Subject: [PATCH 7/7] client.go: quiet "copy lock" warning for TlsConfig. --- client/client.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/client.go b/client/client.go index f7b9b43..9d36a5c 100644 --- a/client/client.go +++ b/client/client.go @@ -147,9 +147,11 @@ func dialConfig(conf *websocket.Config) (conn *websocket.Conn, err error) { var c net.Conn if useTLS { - tlsc := new(tls.Config) + var tlsc *tls.Config if conf.TlsConfig != nil { - *tlsc = *conf.TlsConfig + tlsc = conf.TlsConfig.Clone() + } else { + tlsc = new(tls.Config) } tlsc.ServerName = serverName c, err = tls.Dial("tcp", addr, tlsc)