diff --git a/container.go b/container.go index a89d7e0..bd4a7a2 100644 --- a/container.go +++ b/container.go @@ -16,7 +16,7 @@ import ( "io" "math/rand" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) const ( diff --git a/nmsg.go b/nmsg.go index c605f8b..7141e1b 100644 --- a/nmsg.go +++ b/nmsg.go @@ -13,7 +13,7 @@ package nmsg import ( "hash/crc32" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // Container size limits to avoid silly fragmentation and memory diff --git a/nmsg.pb.go b/nmsg.pb.go index 6b05995..03df28b 100644 --- a/nmsg.pb.go +++ b/nmsg.pb.go @@ -1,223 +1,401 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc (unknown) // source: nmsg.proto -// DO NOT EDIT! -/* -Package nmsg is a generated protocol buffer package. +package nmsg -It is generated from these files: - nmsg.proto +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -It has these top-level messages: - Nmsg - NmsgFragment - NmsgPayload -*/ -package nmsg +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) +) -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +type Nmsg struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payloads []*NmsgPayload `protobuf:"bytes,1,rep,name=payloads" json:"payloads,omitempty"` + PayloadCrcs []uint32 `protobuf:"varint,2,rep,name=payload_crcs,json=payloadCrcs" json:"payload_crcs,omitempty"` + Sequence *uint32 `protobuf:"varint,3,opt,name=sequence" json:"sequence,omitempty"` + SequenceId *uint64 `protobuf:"varint,4,opt,name=sequence_id,json=sequenceId" json:"sequence_id,omitempty"` +} -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +func (x *Nmsg) Reset() { + *x = Nmsg{} + if protoimpl.UnsafeEnabled { + mi := &file_nmsg_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} -// 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 +func (x *Nmsg) String() string { + return protoimpl.X.MessageStringOf(x) +} -type Nmsg struct { - Payloads []*NmsgPayload `protobuf:"bytes,1,rep,name=payloads" json:"payloads,omitempty"` - PayloadCrcs []uint32 `protobuf:"varint,2,rep,name=payload_crcs" json:"payload_crcs,omitempty"` - Sequence *uint32 `protobuf:"varint,3,opt,name=sequence" json:"sequence,omitempty"` - SequenceId *uint64 `protobuf:"varint,4,opt,name=sequence_id" json:"sequence_id,omitempty"` - XXX_unrecognized []byte `json:"-"` +func (*Nmsg) ProtoMessage() {} + +func (x *Nmsg) ProtoReflect() protoreflect.Message { + mi := &file_nmsg_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) } -func (m *Nmsg) Reset() { *m = Nmsg{} } -func (m *Nmsg) String() string { return proto.CompactTextString(m) } -func (*Nmsg) ProtoMessage() {} -func (*Nmsg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +// Deprecated: Use Nmsg.ProtoReflect.Descriptor instead. +func (*Nmsg) Descriptor() ([]byte, []int) { + return file_nmsg_proto_rawDescGZIP(), []int{0} +} -func (m *Nmsg) GetPayloads() []*NmsgPayload { - if m != nil { - return m.Payloads +func (x *Nmsg) GetPayloads() []*NmsgPayload { + if x != nil { + return x.Payloads } return nil } -func (m *Nmsg) GetPayloadCrcs() []uint32 { - if m != nil { - return m.PayloadCrcs +func (x *Nmsg) GetPayloadCrcs() []uint32 { + if x != nil { + return x.PayloadCrcs } return nil } -func (m *Nmsg) GetSequence() uint32 { - if m != nil && m.Sequence != nil { - return *m.Sequence +func (x *Nmsg) GetSequence() uint32 { + if x != nil && x.Sequence != nil { + return *x.Sequence } return 0 } -func (m *Nmsg) GetSequenceId() uint64 { - if m != nil && m.SequenceId != nil { - return *m.SequenceId +func (x *Nmsg) GetSequenceId() uint64 { + if x != nil && x.SequenceId != nil { + return *x.SequenceId } return 0 } type NmsgFragment struct { - Id *uint32 `protobuf:"varint,1,req,name=id" json:"id,omitempty"` - Current *uint32 `protobuf:"varint,2,req,name=current" json:"current,omitempty"` - Last *uint32 `protobuf:"varint,3,req,name=last" json:"last,omitempty"` - Fragment []byte `protobuf:"bytes,4,req,name=fragment" json:"fragment,omitempty"` - Crc *uint32 `protobuf:"varint,5,opt,name=crc" json:"crc,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *uint32 `protobuf:"varint,1,req,name=id" json:"id,omitempty"` + Current *uint32 `protobuf:"varint,2,req,name=current" json:"current,omitempty"` + Last *uint32 `protobuf:"varint,3,req,name=last" json:"last,omitempty"` + Fragment []byte `protobuf:"bytes,4,req,name=fragment" json:"fragment,omitempty"` + Crc *uint32 `protobuf:"varint,5,opt,name=crc" json:"crc,omitempty"` } -func (m *NmsgFragment) Reset() { *m = NmsgFragment{} } -func (m *NmsgFragment) String() string { return proto.CompactTextString(m) } -func (*NmsgFragment) ProtoMessage() {} -func (*NmsgFragment) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (x *NmsgFragment) Reset() { + *x = NmsgFragment{} + if protoimpl.UnsafeEnabled { + mi := &file_nmsg_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NmsgFragment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NmsgFragment) ProtoMessage() {} -func (m *NmsgFragment) GetId() uint32 { - if m != nil && m.Id != nil { - return *m.Id +func (x *NmsgFragment) ProtoReflect() protoreflect.Message { + mi := &file_nmsg_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 NmsgFragment.ProtoReflect.Descriptor instead. +func (*NmsgFragment) Descriptor() ([]byte, []int) { + return file_nmsg_proto_rawDescGZIP(), []int{1} +} + +func (x *NmsgFragment) GetId() uint32 { + if x != nil && x.Id != nil { + return *x.Id } return 0 } -func (m *NmsgFragment) GetCurrent() uint32 { - if m != nil && m.Current != nil { - return *m.Current +func (x *NmsgFragment) GetCurrent() uint32 { + if x != nil && x.Current != nil { + return *x.Current } return 0 } -func (m *NmsgFragment) GetLast() uint32 { - if m != nil && m.Last != nil { - return *m.Last +func (x *NmsgFragment) GetLast() uint32 { + if x != nil && x.Last != nil { + return *x.Last } return 0 } -func (m *NmsgFragment) GetFragment() []byte { - if m != nil { - return m.Fragment +func (x *NmsgFragment) GetFragment() []byte { + if x != nil { + return x.Fragment } return nil } -func (m *NmsgFragment) GetCrc() uint32 { - if m != nil && m.Crc != nil { - return *m.Crc +func (x *NmsgFragment) GetCrc() uint32 { + if x != nil && x.Crc != nil { + return *x.Crc } return 0 } type NmsgPayload struct { - Vid *uint32 `protobuf:"varint,1,req,name=vid" json:"vid,omitempty"` - Msgtype *uint32 `protobuf:"varint,2,req,name=msgtype" json:"msgtype,omitempty"` - TimeSec *int64 `protobuf:"varint,3,req,name=time_sec" json:"time_sec,omitempty"` - TimeNsec *uint32 `protobuf:"fixed32,4,req,name=time_nsec" json:"time_nsec,omitempty"` - Payload []byte `protobuf:"bytes,5,opt,name=payload" json:"payload,omitempty"` - Source *uint32 `protobuf:"varint,7,opt,name=source" json:"source,omitempty"` - Operator *uint32 `protobuf:"varint,8,opt,name=operator" json:"operator,omitempty"` - Group *uint32 `protobuf:"varint,9,opt,name=group" json:"group,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *NmsgPayload) Reset() { *m = NmsgPayload{} } -func (m *NmsgPayload) String() string { return proto.CompactTextString(m) } -func (*NmsgPayload) ProtoMessage() {} -func (*NmsgPayload) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } - -func (m *NmsgPayload) GetVid() uint32 { - if m != nil && m.Vid != nil { - return *m.Vid + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Vid *uint32 `protobuf:"varint,1,req,name=vid" json:"vid,omitempty"` + Msgtype *uint32 `protobuf:"varint,2,req,name=msgtype" json:"msgtype,omitempty"` + TimeSec *int64 `protobuf:"varint,3,req,name=time_sec,json=timeSec" json:"time_sec,omitempty"` + TimeNsec *uint32 `protobuf:"fixed32,4,req,name=time_nsec,json=timeNsec" json:"time_nsec,omitempty"` + Payload []byte `protobuf:"bytes,5,opt,name=payload" json:"payload,omitempty"` + Source *uint32 `protobuf:"varint,7,opt,name=source" json:"source,omitempty"` + Operator *uint32 `protobuf:"varint,8,opt,name=operator" json:"operator,omitempty"` + Group *uint32 `protobuf:"varint,9,opt,name=group" json:"group,omitempty"` +} + +func (x *NmsgPayload) Reset() { + *x = NmsgPayload{} + if protoimpl.UnsafeEnabled { + mi := &file_nmsg_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NmsgPayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NmsgPayload) ProtoMessage() {} + +func (x *NmsgPayload) ProtoReflect() protoreflect.Message { + mi := &file_nmsg_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 NmsgPayload.ProtoReflect.Descriptor instead. +func (*NmsgPayload) Descriptor() ([]byte, []int) { + return file_nmsg_proto_rawDescGZIP(), []int{2} +} + +func (x *NmsgPayload) GetVid() uint32 { + if x != nil && x.Vid != nil { + return *x.Vid } return 0 } -func (m *NmsgPayload) GetMsgtype() uint32 { - if m != nil && m.Msgtype != nil { - return *m.Msgtype +func (x *NmsgPayload) GetMsgtype() uint32 { + if x != nil && x.Msgtype != nil { + return *x.Msgtype } return 0 } -func (m *NmsgPayload) GetTimeSec() int64 { - if m != nil && m.TimeSec != nil { - return *m.TimeSec +func (x *NmsgPayload) GetTimeSec() int64 { + if x != nil && x.TimeSec != nil { + return *x.TimeSec } return 0 } -func (m *NmsgPayload) GetTimeNsec() uint32 { - if m != nil && m.TimeNsec != nil { - return *m.TimeNsec +func (x *NmsgPayload) GetTimeNsec() uint32 { + if x != nil && x.TimeNsec != nil { + return *x.TimeNsec } return 0 } -func (m *NmsgPayload) GetPayload() []byte { - if m != nil { - return m.Payload +func (x *NmsgPayload) GetPayload() []byte { + if x != nil { + return x.Payload } return nil } -func (m *NmsgPayload) GetSource() uint32 { - if m != nil && m.Source != nil { - return *m.Source +func (x *NmsgPayload) GetSource() uint32 { + if x != nil && x.Source != nil { + return *x.Source } return 0 } -func (m *NmsgPayload) GetOperator() uint32 { - if m != nil && m.Operator != nil { - return *m.Operator +func (x *NmsgPayload) GetOperator() uint32 { + if x != nil && x.Operator != nil { + return *x.Operator } return 0 } -func (m *NmsgPayload) GetGroup() uint32 { - if m != nil && m.Group != nil { - return *m.Group +func (x *NmsgPayload) GetGroup() uint32 { + if x != nil && x.Group != nil { + return *x.Group } return 0 } -func init() { - proto.RegisterType((*Nmsg)(nil), "nmsg.Nmsg") - proto.RegisterType((*NmsgFragment)(nil), "nmsg.NmsgFragment") - proto.RegisterType((*NmsgPayload)(nil), "nmsg.NmsgPayload") -} - -func init() { proto.RegisterFile("nmsg.proto", fileDescriptor0) } - -var fileDescriptor0 = []byte{ - // 259 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x4c, 0x8f, 0xb1, 0x4e, 0xc3, 0x30, - 0x10, 0x86, 0x15, 0xc7, 0x25, 0xe9, 0xc5, 0x05, 0x6a, 0x18, 0x3c, 0x46, 0x61, 0xe9, 0xd4, 0x81, - 0x87, 0x60, 0x44, 0x8c, 0x6c, 0x91, 0xe5, 0x9a, 0x50, 0xa9, 0x89, 0x8d, 0xed, 0x20, 0xf5, 0x35, - 0x78, 0x62, 0xee, 0xdc, 0x54, 0xea, 0x94, 0xf8, 0xfb, 0xef, 0xbe, 0xbb, 0x03, 0x98, 0xc6, 0x38, - 0xec, 0x7d, 0x70, 0xc9, 0x49, 0x4e, 0xff, 0xdd, 0x37, 0xf0, 0x77, 0xfc, 0xca, 0x17, 0xa8, 0xbd, - 0x3e, 0x9f, 0x9c, 0x3e, 0x44, 0x55, 0xb4, 0xe5, 0xae, 0x79, 0xdd, 0xee, 0x73, 0x31, 0xa5, 0x1f, - 0x97, 0x44, 0x3e, 0x83, 0x58, 0x8a, 0x7a, 0x13, 0x4c, 0x54, 0x0c, 0x0b, 0x37, 0xf2, 0x11, 0xea, - 0x68, 0x7f, 0x66, 0x3b, 0x19, 0xab, 0xca, 0xb6, 0x40, 0xf2, 0x04, 0xcd, 0x95, 0xf4, 0xc7, 0x83, - 0xe2, 0x08, 0x79, 0xf7, 0x09, 0x82, 0x5c, 0x6f, 0x41, 0x0f, 0xa3, 0x9d, 0x92, 0x04, 0x60, 0x98, - 0x15, 0x2d, 0xc3, 0x86, 0x07, 0xa8, 0xcc, 0x1c, 0x02, 0x62, 0x74, 0x12, 0x10, 0xc0, 0x4f, 0x3a, - 0x26, 0xf4, 0xb1, 0xcb, 0x84, 0xaf, 0xa5, 0x0d, 0x65, 0x6c, 0x27, 0x64, 0x03, 0x25, 0x6e, 0xa0, - 0x56, 0x34, 0xae, 0xfb, 0x2b, 0xa0, 0xb9, 0x5d, 0x13, 0xc3, 0xdf, 0x5b, 0x35, 0x46, 0xe9, 0xec, - 0xed, 0xa2, 0x46, 0x59, 0x3a, 0x8e, 0xb6, 0x8f, 0xd6, 0x64, 0x7d, 0x29, 0xb7, 0xb0, 0xce, 0x64, - 0x22, 0x44, 0xfe, 0x8a, 0xba, 0x96, 0x4b, 0xf3, 0x0c, 0x21, 0xef, 0xe1, 0x2e, 0xba, 0x39, 0xe0, - 0x89, 0x55, 0x3e, 0x11, 0x2d, 0xce, 0xdb, 0xa0, 0x93, 0x0b, 0xaa, 0xce, 0x64, 0x03, 0xab, 0x21, - 0xb8, 0xd9, 0xab, 0x35, 0x3d, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x73, 0x07, 0x52, 0x34, 0x6b, - 0x01, 0x00, 0x00, +var File_nmsg_proto protoreflect.FileDescriptor + +var file_nmsg_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x6e, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x6e, 0x6d, + 0x73, 0x67, 0x22, 0x95, 0x01, 0x0a, 0x04, 0x4e, 0x6d, 0x73, 0x67, 0x12, 0x2d, 0x0a, 0x08, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x6e, 0x6d, 0x73, 0x67, 0x2e, 0x4e, 0x6d, 0x73, 0x67, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x52, 0x08, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x72, 0x63, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, + 0x52, 0x0b, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x72, 0x63, 0x73, 0x12, 0x1a, 0x0a, + 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x71, + 0x75, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, + 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x22, 0x7a, 0x0a, 0x0c, 0x4e, 0x6d, + 0x73, 0x67, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x02, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x02, 0x28, 0x0d, 0x52, 0x07, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x73, 0x74, 0x18, 0x03, 0x20, 0x02, + 0x28, 0x0d, 0x52, 0x04, 0x6c, 0x61, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x61, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x02, 0x28, 0x0c, 0x52, 0x08, 0x66, 0x72, 0x61, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x72, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x03, 0x63, 0x72, 0x63, 0x22, 0xd5, 0x01, 0x0a, 0x0b, 0x4e, 0x6d, 0x73, 0x67, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x02, 0x28, 0x0d, 0x52, 0x03, 0x76, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x02, 0x28, 0x0d, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x03, + 0x20, 0x02, 0x28, 0x03, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x63, 0x12, 0x1b, 0x0a, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73, 0x65, 0x63, 0x18, 0x04, 0x20, 0x02, 0x28, 0x07, + 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x4e, 0x73, 0x65, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, +} + +var ( + file_nmsg_proto_rawDescOnce sync.Once + file_nmsg_proto_rawDescData = file_nmsg_proto_rawDesc +) + +func file_nmsg_proto_rawDescGZIP() []byte { + file_nmsg_proto_rawDescOnce.Do(func() { + file_nmsg_proto_rawDescData = protoimpl.X.CompressGZIP(file_nmsg_proto_rawDescData) + }) + return file_nmsg_proto_rawDescData +} + +var file_nmsg_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_nmsg_proto_goTypes = []interface{}{ + (*Nmsg)(nil), // 0: nmsg.Nmsg + (*NmsgFragment)(nil), // 1: nmsg.NmsgFragment + (*NmsgPayload)(nil), // 2: nmsg.NmsgPayload +} +var file_nmsg_proto_depIdxs = []int32{ + 2, // 0: nmsg.Nmsg.payloads:type_name -> nmsg.NmsgPayload + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_nmsg_proto_init() } +func file_nmsg_proto_init() { + if File_nmsg_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_nmsg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Nmsg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_nmsg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NmsgFragment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_nmsg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NmsgPayload); 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_nmsg_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_nmsg_proto_goTypes, + DependencyIndexes: file_nmsg_proto_depIdxs, + MessageInfos: file_nmsg_proto_msgTypes, + }.Build() + File_nmsg_proto = out.File + file_nmsg_proto_rawDesc = nil + file_nmsg_proto_goTypes = nil + file_nmsg_proto_depIdxs = nil } diff --git a/nmsg_base/base.go b/nmsg_base/base.go index 750d8ce..2b2f267 100644 --- a/nmsg_base/base.go +++ b/nmsg_base/base.go @@ -11,7 +11,7 @@ package nmsg_base import ( "github.com/dnstap/golang-dnstap" "github.com/farsightsec/go-nmsg" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) func (p *Ncap) GetVid() uint32 { return 1 } diff --git a/nmsg_base/dns.pb.go b/nmsg_base/dns.pb.go index a51317d..b64c8d8 100644 --- a/nmsg_base/dns.pb.go +++ b/nmsg_base/dns.pb.go @@ -1,152 +1,216 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc (unknown) // source: dns.proto -// DO NOT EDIT! - -/* -Package nmsg_base is a generated protocol buffer package. - -It is generated from these files: - dns.proto - dnsqr.proto - email.proto - encode.proto - http.proto - ipconn.proto - linkpair.proto - logline.proto - ncap.proto - packet.proto - pkt.proto - xml.proto - -It has these top-level messages: - Dns - DnsQR - Email - Encode - Http - IPConn - Linkpair - LogLine - Ncap - Packet - Pkt - Xml -*/ -package nmsg_base -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +package nmsg_base -// 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" +) -// 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 Dns struct { - Section *uint32 `protobuf:"varint,6,opt,name=section" json:"section,omitempty"` - Qname []byte `protobuf:"bytes,7,opt,name=qname" json:"qname,omitempty"` - Qtype *uint32 `protobuf:"varint,8,opt,name=qtype" json:"qtype,omitempty"` - Qclass *uint32 `protobuf:"varint,9,opt,name=qclass" json:"qclass,omitempty"` - Rrname []byte `protobuf:"bytes,1,opt,name=rrname" json:"rrname,omitempty"` - Rrtype *uint32 `protobuf:"varint,2,opt,name=rrtype" json:"rrtype,omitempty"` - Rrclass *uint32 `protobuf:"varint,3,opt,name=rrclass" json:"rrclass,omitempty"` - Rrttl *uint32 `protobuf:"varint,4,opt,name=rrttl" json:"rrttl,omitempty"` - Rdata [][]byte `protobuf:"bytes,5,rep,name=rdata" json:"rdata,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Dns) Reset() { *m = Dns{} } -func (m *Dns) String() string { return proto.CompactTextString(m) } -func (*Dns) ProtoMessage() {} -func (*Dns) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -func (m *Dns) GetSection() uint32 { - if m != nil && m.Section != nil { - return *m.Section + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Section *uint32 `protobuf:"varint,6,opt,name=section" json:"section,omitempty"` + Qname []byte `protobuf:"bytes,7,opt,name=qname" json:"qname,omitempty"` + Qtype *uint32 `protobuf:"varint,8,opt,name=qtype" json:"qtype,omitempty"` + Qclass *uint32 `protobuf:"varint,9,opt,name=qclass" json:"qclass,omitempty"` + Rrname []byte `protobuf:"bytes,1,opt,name=rrname" json:"rrname,omitempty"` + Rrtype *uint32 `protobuf:"varint,2,opt,name=rrtype" json:"rrtype,omitempty"` + Rrclass *uint32 `protobuf:"varint,3,opt,name=rrclass" json:"rrclass,omitempty"` + Rrttl *uint32 `protobuf:"varint,4,opt,name=rrttl" json:"rrttl,omitempty"` + Rdata [][]byte `protobuf:"bytes,5,rep,name=rdata" json:"rdata,omitempty"` +} + +func (x *Dns) Reset() { + *x = Dns{} + if protoimpl.UnsafeEnabled { + mi := &file_dns_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Dns) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Dns) ProtoMessage() {} + +func (x *Dns) ProtoReflect() protoreflect.Message { + mi := &file_dns_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 Dns.ProtoReflect.Descriptor instead. +func (*Dns) Descriptor() ([]byte, []int) { + return file_dns_proto_rawDescGZIP(), []int{0} +} + +func (x *Dns) GetSection() uint32 { + if x != nil && x.Section != nil { + return *x.Section } return 0 } -func (m *Dns) GetQname() []byte { - if m != nil { - return m.Qname +func (x *Dns) GetQname() []byte { + if x != nil { + return x.Qname } return nil } -func (m *Dns) GetQtype() uint32 { - if m != nil && m.Qtype != nil { - return *m.Qtype +func (x *Dns) GetQtype() uint32 { + if x != nil && x.Qtype != nil { + return *x.Qtype } return 0 } -func (m *Dns) GetQclass() uint32 { - if m != nil && m.Qclass != nil { - return *m.Qclass +func (x *Dns) GetQclass() uint32 { + if x != nil && x.Qclass != nil { + return *x.Qclass } return 0 } -func (m *Dns) GetRrname() []byte { - if m != nil { - return m.Rrname +func (x *Dns) GetRrname() []byte { + if x != nil { + return x.Rrname } return nil } -func (m *Dns) GetRrtype() uint32 { - if m != nil && m.Rrtype != nil { - return *m.Rrtype +func (x *Dns) GetRrtype() uint32 { + if x != nil && x.Rrtype != nil { + return *x.Rrtype } return 0 } -func (m *Dns) GetRrclass() uint32 { - if m != nil && m.Rrclass != nil { - return *m.Rrclass +func (x *Dns) GetRrclass() uint32 { + if x != nil && x.Rrclass != nil { + return *x.Rrclass } return 0 } -func (m *Dns) GetRrttl() uint32 { - if m != nil && m.Rrttl != nil { - return *m.Rrttl +func (x *Dns) GetRrttl() uint32 { + if x != nil && x.Rrttl != nil { + return *x.Rrttl } return 0 } -func (m *Dns) GetRdata() [][]byte { - if m != nil { - return m.Rdata +func (x *Dns) GetRdata() [][]byte { + if x != nil { + return x.Rdata } return nil } -func init() { - proto.RegisterType((*Dns)(nil), "nmsg.base.Dns") +var File_dns_proto protoreflect.FileDescriptor + +var file_dns_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x64, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6e, 0x6d, 0x73, + 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x22, 0xd9, 0x01, 0x0a, 0x03, 0x44, 0x6e, 0x73, 0x12, 0x18, + 0x0a, 0x07, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x07, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x71, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x71, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x71, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x71, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x71, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, + 0x72, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x72, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x72, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x72, 0x72, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x72, 0x72, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x72, + 0x72, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x72, 0x74, 0x74, 0x6c, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x72, 0x72, 0x74, 0x74, 0x6c, 0x12, 0x14, 0x0a, 0x05, + 0x72, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x05, 0x72, 0x64, 0x61, + 0x74, 0x61, } -func init() { proto.RegisterFile("dns.proto", fileDescriptor0) } +var ( + file_dns_proto_rawDescOnce sync.Once + file_dns_proto_rawDescData = file_dns_proto_rawDesc +) + +func file_dns_proto_rawDescGZIP() []byte { + file_dns_proto_rawDescOnce.Do(func() { + file_dns_proto_rawDescData = protoimpl.X.CompressGZIP(file_dns_proto_rawDescData) + }) + return file_dns_proto_rawDescData +} -var fileDescriptor0 = []byte{ - // 148 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0xc9, 0x2b, 0xd6, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcc, 0xcb, 0x2d, 0x4e, 0xd7, 0x4b, 0x4a, 0x2c, 0x4e, - 0x55, 0x9a, 0xcc, 0xc8, 0xc5, 0xec, 0x92, 0x57, 0x2c, 0xc4, 0xcf, 0xc5, 0x5e, 0x9c, 0x9a, 0x5c, - 0x92, 0x99, 0x9f, 0x27, 0xc1, 0xa6, 0xc0, 0xa8, 0xc1, 0x2b, 0xc4, 0xcb, 0xc5, 0x5a, 0x98, 0x97, - 0x98, 0x9b, 0x2a, 0xc1, 0x0e, 0xe4, 0xf2, 0x80, 0xb9, 0x25, 0x95, 0x05, 0xa9, 0x12, 0x1c, 0x60, - 0x59, 0x3e, 0x2e, 0xb6, 0xc2, 0xe4, 0x9c, 0xc4, 0xe2, 0x62, 0x09, 0x4e, 0x18, 0xbf, 0xa8, 0x08, - 0xac, 0x9c, 0x11, 0xac, 0x1c, 0xcc, 0x07, 0xab, 0x67, 0x02, 0xcb, 0x03, 0x8d, 0x2f, 0x2a, 0x82, - 0x68, 0x60, 0x86, 0x19, 0x0f, 0x54, 0x50, 0x92, 0x23, 0xc1, 0x02, 0xe7, 0xa6, 0x24, 0x96, 0x24, - 0x4a, 0xb0, 0x2a, 0x30, 0x6b, 0xf0, 0x00, 0x02, 0x00, 0x00, 0xff, 0xff, 0x75, 0x4a, 0x12, 0x4c, - 0xac, 0x00, 0x00, 0x00, +var file_dns_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_dns_proto_goTypes = []interface{}{ + (*Dns)(nil), // 0: nmsg.base.Dns +} +var file_dns_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_dns_proto_init() } +func file_dns_proto_init() { + if File_dns_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_dns_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Dns); 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_dns_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_dns_proto_goTypes, + DependencyIndexes: file_dns_proto_depIdxs, + MessageInfos: file_dns_proto_msgTypes, + }.Build() + File_dns_proto = out.File + file_dns_proto_rawDesc = nil + file_dns_proto_goTypes = nil + file_dns_proto_depIdxs = nil } diff --git a/nmsg_base/dnsqr.pb.go b/nmsg_base/dnsqr.pb.go index 9452635..d7d1722 100644 --- a/nmsg_base/dnsqr.pb.go +++ b/nmsg_base/dnsqr.pb.go @@ -1,17 +1,24 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc (unknown) // source: dnsqr.proto -// DO NOT EDIT! package nmsg_base -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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 DnsQRType int32 @@ -26,44 +33,66 @@ const ( DnsQRType_UDP_RESPONSE_ONLY DnsQRType = 7 ) -var DnsQRType_name = map[int32]string{ - 0: "UDP_INVALID", - 1: "UDP_QUERY_RESPONSE", - 2: "UDP_UNANSWERED_QUERY", - 3: "UDP_UNSOLICITED_RESPONSE", - 4: "TCP", - 5: "ICMP", - 6: "UDP_QUERY_ONLY", - 7: "UDP_RESPONSE_ONLY", -} -var DnsQRType_value = map[string]int32{ - "UDP_INVALID": 0, - "UDP_QUERY_RESPONSE": 1, - "UDP_UNANSWERED_QUERY": 2, - "UDP_UNSOLICITED_RESPONSE": 3, - "TCP": 4, - "ICMP": 5, - "UDP_QUERY_ONLY": 6, - "UDP_RESPONSE_ONLY": 7, -} +// Enum value maps for DnsQRType. +var ( + DnsQRType_name = map[int32]string{ + 0: "UDP_INVALID", + 1: "UDP_QUERY_RESPONSE", + 2: "UDP_UNANSWERED_QUERY", + 3: "UDP_UNSOLICITED_RESPONSE", + 4: "TCP", + 5: "ICMP", + 6: "UDP_QUERY_ONLY", + 7: "UDP_RESPONSE_ONLY", + } + DnsQRType_value = map[string]int32{ + "UDP_INVALID": 0, + "UDP_QUERY_RESPONSE": 1, + "UDP_UNANSWERED_QUERY": 2, + "UDP_UNSOLICITED_RESPONSE": 3, + "TCP": 4, + "ICMP": 5, + "UDP_QUERY_ONLY": 6, + "UDP_RESPONSE_ONLY": 7, + } +) func (x DnsQRType) Enum() *DnsQRType { p := new(DnsQRType) *p = x return p } + func (x DnsQRType) String() string { - return proto.EnumName(DnsQRType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DnsQRType) Descriptor() protoreflect.EnumDescriptor { + return file_dnsqr_proto_enumTypes[0].Descriptor() +} + +func (DnsQRType) Type() protoreflect.EnumType { + return &file_dnsqr_proto_enumTypes[0] } -func (x *DnsQRType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DnsQRType_value, data, "DnsQRType") + +func (x DnsQRType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *DnsQRType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = DnsQRType(value) + *x = DnsQRType(num) return nil } -func (DnsQRType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +// Deprecated: Use DnsQRType.Descriptor instead. +func (DnsQRType) EnumDescriptor() ([]byte, []int) { + return file_dnsqr_proto_rawDescGZIP(), []int{0} +} type UdpChecksum int32 @@ -74,261 +103,407 @@ const ( UdpChecksum_CORRECT UdpChecksum = 3 ) -var UdpChecksum_name = map[int32]string{ - 0: "ERROR", - 1: "ABSENT", - 2: "INCORRECT", - 3: "CORRECT", -} -var UdpChecksum_value = map[string]int32{ - "ERROR": 0, - "ABSENT": 1, - "INCORRECT": 2, - "CORRECT": 3, -} +// Enum value maps for UdpChecksum. +var ( + UdpChecksum_name = map[int32]string{ + 0: "ERROR", + 1: "ABSENT", + 2: "INCORRECT", + 3: "CORRECT", + } + UdpChecksum_value = map[string]int32{ + "ERROR": 0, + "ABSENT": 1, + "INCORRECT": 2, + "CORRECT": 3, + } +) func (x UdpChecksum) Enum() *UdpChecksum { p := new(UdpChecksum) *p = x return p } + func (x UdpChecksum) String() string { - return proto.EnumName(UdpChecksum_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (x *UdpChecksum) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(UdpChecksum_value, data, "UdpChecksum") + +func (UdpChecksum) Descriptor() protoreflect.EnumDescriptor { + return file_dnsqr_proto_enumTypes[1].Descriptor() +} + +func (UdpChecksum) Type() protoreflect.EnumType { + return &file_dnsqr_proto_enumTypes[1] +} + +func (x UdpChecksum) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *UdpChecksum) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = UdpChecksum(value) + *x = UdpChecksum(num) return nil } -func (UdpChecksum) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +// Deprecated: Use UdpChecksum.Descriptor instead. +func (UdpChecksum) EnumDescriptor() ([]byte, []int) { + return file_dnsqr_proto_rawDescGZIP(), []int{1} +} type DnsQR struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Type *DnsQRType `protobuf:"varint,1,req,name=type,enum=nmsg.base.DnsQRType" json:"type,omitempty"` - QueryIp []byte `protobuf:"bytes,2,req,name=query_ip" json:"query_ip,omitempty"` - ResponseIp []byte `protobuf:"bytes,3,req,name=response_ip" json:"response_ip,omitempty"` + QueryIp []byte `protobuf:"bytes,2,req,name=query_ip,json=queryIp" json:"query_ip,omitempty"` + ResponseIp []byte `protobuf:"bytes,3,req,name=response_ip,json=responseIp" json:"response_ip,omitempty"` Proto *uint32 `protobuf:"varint,4,req,name=proto" json:"proto,omitempty"` - QueryPort *uint32 `protobuf:"varint,5,req,name=query_port" json:"query_port,omitempty"` - ResponsePort *uint32 `protobuf:"varint,6,req,name=response_port" json:"response_port,omitempty"` + QueryPort *uint32 `protobuf:"varint,5,req,name=query_port,json=queryPort" json:"query_port,omitempty"` + ResponsePort *uint32 `protobuf:"varint,6,req,name=response_port,json=responsePort" json:"response_port,omitempty"` Id *uint32 `protobuf:"varint,7,req,name=id" json:"id,omitempty"` Qname []byte `protobuf:"bytes,8,opt,name=qname" json:"qname,omitempty"` Qtype *uint32 `protobuf:"varint,9,opt,name=qtype" json:"qtype,omitempty"` Qclass *uint32 `protobuf:"varint,10,opt,name=qclass" json:"qclass,omitempty"` Rcode *uint32 `protobuf:"varint,11,opt,name=rcode" json:"rcode,omitempty"` - QueryPacket [][]byte `protobuf:"bytes,12,rep,name=query_packet" json:"query_packet,omitempty"` - QueryTimeSec []int64 `protobuf:"varint,13,rep,name=query_time_sec" json:"query_time_sec,omitempty"` - QueryTimeNsec []int32 `protobuf:"fixed32,14,rep,name=query_time_nsec" json:"query_time_nsec,omitempty"` - ResponsePacket [][]byte `protobuf:"bytes,15,rep,name=response_packet" json:"response_packet,omitempty"` - ResponseTimeSec []int64 `protobuf:"varint,16,rep,name=response_time_sec" json:"response_time_sec,omitempty"` - ResponseTimeNsec []int32 `protobuf:"fixed32,17,rep,name=response_time_nsec" json:"response_time_nsec,omitempty"` + QueryPacket [][]byte `protobuf:"bytes,12,rep,name=query_packet,json=queryPacket" json:"query_packet,omitempty"` + QueryTimeSec []int64 `protobuf:"varint,13,rep,name=query_time_sec,json=queryTimeSec" json:"query_time_sec,omitempty"` + QueryTimeNsec []int32 `protobuf:"fixed32,14,rep,name=query_time_nsec,json=queryTimeNsec" json:"query_time_nsec,omitempty"` + ResponsePacket [][]byte `protobuf:"bytes,15,rep,name=response_packet,json=responsePacket" json:"response_packet,omitempty"` + ResponseTimeSec []int64 `protobuf:"varint,16,rep,name=response_time_sec,json=responseTimeSec" json:"response_time_sec,omitempty"` + ResponseTimeNsec []int32 `protobuf:"fixed32,17,rep,name=response_time_nsec,json=responseTimeNsec" json:"response_time_nsec,omitempty"` Tcp []byte `protobuf:"bytes,18,opt,name=tcp" json:"tcp,omitempty"` Icmp []byte `protobuf:"bytes,19,opt,name=icmp" json:"icmp,omitempty"` Timeout *float64 `protobuf:"fixed64,20,opt,name=timeout" json:"timeout,omitempty"` - UdpChecksum *UdpChecksum `protobuf:"varint,21,opt,name=udp_checksum,enum=nmsg.base.UdpChecksum" json:"udp_checksum,omitempty"` - ResolverAddressZeroed *bool `protobuf:"varint,22,opt,name=resolver_address_zeroed" json:"resolver_address_zeroed,omitempty"` - XXX_unrecognized []byte `json:"-"` + UdpChecksum *UdpChecksum `protobuf:"varint,21,opt,name=udp_checksum,json=udpChecksum,enum=nmsg.base.UdpChecksum" json:"udp_checksum,omitempty"` + ResolverAddressZeroed *bool `protobuf:"varint,22,opt,name=resolver_address_zeroed,json=resolverAddressZeroed" json:"resolver_address_zeroed,omitempty"` } -func (m *DnsQR) Reset() { *m = DnsQR{} } -func (m *DnsQR) String() string { return proto.CompactTextString(m) } -func (*DnsQR) ProtoMessage() {} -func (*DnsQR) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } +func (x *DnsQR) Reset() { + *x = DnsQR{} + if protoimpl.UnsafeEnabled { + mi := &file_dnsqr_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} -func (m *DnsQR) GetType() DnsQRType { - if m != nil && m.Type != nil { - return *m.Type +func (x *DnsQR) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DnsQR) ProtoMessage() {} + +func (x *DnsQR) ProtoReflect() protoreflect.Message { + mi := &file_dnsqr_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 DnsQR.ProtoReflect.Descriptor instead. +func (*DnsQR) Descriptor() ([]byte, []int) { + return file_dnsqr_proto_rawDescGZIP(), []int{0} +} + +func (x *DnsQR) GetType() DnsQRType { + if x != nil && x.Type != nil { + return *x.Type } return DnsQRType_UDP_INVALID } -func (m *DnsQR) GetQueryIp() []byte { - if m != nil { - return m.QueryIp +func (x *DnsQR) GetQueryIp() []byte { + if x != nil { + return x.QueryIp } return nil } -func (m *DnsQR) GetResponseIp() []byte { - if m != nil { - return m.ResponseIp +func (x *DnsQR) GetResponseIp() []byte { + if x != nil { + return x.ResponseIp } return nil } -func (m *DnsQR) GetProto() uint32 { - if m != nil && m.Proto != nil { - return *m.Proto +func (x *DnsQR) GetProto() uint32 { + if x != nil && x.Proto != nil { + return *x.Proto } return 0 } -func (m *DnsQR) GetQueryPort() uint32 { - if m != nil && m.QueryPort != nil { - return *m.QueryPort +func (x *DnsQR) GetQueryPort() uint32 { + if x != nil && x.QueryPort != nil { + return *x.QueryPort } return 0 } -func (m *DnsQR) GetResponsePort() uint32 { - if m != nil && m.ResponsePort != nil { - return *m.ResponsePort +func (x *DnsQR) GetResponsePort() uint32 { + if x != nil && x.ResponsePort != nil { + return *x.ResponsePort } return 0 } -func (m *DnsQR) GetId() uint32 { - if m != nil && m.Id != nil { - return *m.Id +func (x *DnsQR) GetId() uint32 { + if x != nil && x.Id != nil { + return *x.Id } return 0 } -func (m *DnsQR) GetQname() []byte { - if m != nil { - return m.Qname +func (x *DnsQR) GetQname() []byte { + if x != nil { + return x.Qname } return nil } -func (m *DnsQR) GetQtype() uint32 { - if m != nil && m.Qtype != nil { - return *m.Qtype +func (x *DnsQR) GetQtype() uint32 { + if x != nil && x.Qtype != nil { + return *x.Qtype } return 0 } -func (m *DnsQR) GetQclass() uint32 { - if m != nil && m.Qclass != nil { - return *m.Qclass +func (x *DnsQR) GetQclass() uint32 { + if x != nil && x.Qclass != nil { + return *x.Qclass } return 0 } -func (m *DnsQR) GetRcode() uint32 { - if m != nil && m.Rcode != nil { - return *m.Rcode +func (x *DnsQR) GetRcode() uint32 { + if x != nil && x.Rcode != nil { + return *x.Rcode } return 0 } -func (m *DnsQR) GetQueryPacket() [][]byte { - if m != nil { - return m.QueryPacket +func (x *DnsQR) GetQueryPacket() [][]byte { + if x != nil { + return x.QueryPacket } return nil } -func (m *DnsQR) GetQueryTimeSec() []int64 { - if m != nil { - return m.QueryTimeSec +func (x *DnsQR) GetQueryTimeSec() []int64 { + if x != nil { + return x.QueryTimeSec } return nil } -func (m *DnsQR) GetQueryTimeNsec() []int32 { - if m != nil { - return m.QueryTimeNsec +func (x *DnsQR) GetQueryTimeNsec() []int32 { + if x != nil { + return x.QueryTimeNsec } return nil } -func (m *DnsQR) GetResponsePacket() [][]byte { - if m != nil { - return m.ResponsePacket +func (x *DnsQR) GetResponsePacket() [][]byte { + if x != nil { + return x.ResponsePacket } return nil } -func (m *DnsQR) GetResponseTimeSec() []int64 { - if m != nil { - return m.ResponseTimeSec +func (x *DnsQR) GetResponseTimeSec() []int64 { + if x != nil { + return x.ResponseTimeSec } return nil } -func (m *DnsQR) GetResponseTimeNsec() []int32 { - if m != nil { - return m.ResponseTimeNsec +func (x *DnsQR) GetResponseTimeNsec() []int32 { + if x != nil { + return x.ResponseTimeNsec } return nil } -func (m *DnsQR) GetTcp() []byte { - if m != nil { - return m.Tcp +func (x *DnsQR) GetTcp() []byte { + if x != nil { + return x.Tcp } return nil } -func (m *DnsQR) GetIcmp() []byte { - if m != nil { - return m.Icmp +func (x *DnsQR) GetIcmp() []byte { + if x != nil { + return x.Icmp } return nil } -func (m *DnsQR) GetTimeout() float64 { - if m != nil && m.Timeout != nil { - return *m.Timeout +func (x *DnsQR) GetTimeout() float64 { + if x != nil && x.Timeout != nil { + return *x.Timeout } return 0 } -func (m *DnsQR) GetUdpChecksum() UdpChecksum { - if m != nil && m.UdpChecksum != nil { - return *m.UdpChecksum +func (x *DnsQR) GetUdpChecksum() UdpChecksum { + if x != nil && x.UdpChecksum != nil { + return *x.UdpChecksum } return UdpChecksum_ERROR } -func (m *DnsQR) GetResolverAddressZeroed() bool { - if m != nil && m.ResolverAddressZeroed != nil { - return *m.ResolverAddressZeroed +func (x *DnsQR) GetResolverAddressZeroed() bool { + if x != nil && x.ResolverAddressZeroed != nil { + return *x.ResolverAddressZeroed } return false } -func init() { - proto.RegisterType((*DnsQR)(nil), "nmsg.base.DnsQR") - proto.RegisterEnum("nmsg.base.DnsQRType", DnsQRType_name, DnsQRType_value) - proto.RegisterEnum("nmsg.base.UdpChecksum", UdpChecksum_name, UdpChecksum_value) -} - -func init() { proto.RegisterFile("dnsqr.proto", fileDescriptor1) } - -var fileDescriptor1 = []byte{ - // 491 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x54, 0x92, 0xdb, 0x6e, 0x9b, 0x40, - 0x10, 0x86, 0x6b, 0xe3, 0xe3, 0x70, 0xf4, 0xc6, 0x71, 0xb6, 0x55, 0xa5, 0x5a, 0xb9, 0xaa, 0xa2, - 0xca, 0x17, 0x79, 0x82, 0xba, 0x98, 0x0b, 0x24, 0x17, 0x1c, 0xc0, 0xad, 0x72, 0x85, 0x28, 0xac, - 0x5a, 0x2b, 0xe1, 0xb8, 0xb8, 0x52, 0xfa, 0x48, 0x7d, 0xb1, 0xbe, 0x46, 0x87, 0x25, 0xc1, 0xce, - 0x1d, 0xf3, 0xfd, 0x33, 0xff, 0xfc, 0xcb, 0x2e, 0xc8, 0x49, 0xc6, 0xcb, 0x6a, 0x55, 0x54, 0x79, - 0x9d, 0x93, 0x69, 0x96, 0xf2, 0x9f, 0xab, 0x1f, 0x11, 0x67, 0xd7, 0xff, 0x24, 0x18, 0x6e, 0x32, - 0x7e, 0xe7, 0x91, 0x6b, 0x18, 0xd4, 0x4f, 0x05, 0xa3, 0xbd, 0x65, 0xff, 0xa3, 0x76, 0x3b, 0x5f, - 0x75, 0x3d, 0x2b, 0xa1, 0x07, 0xa8, 0x11, 0x03, 0x26, 0xe5, 0x91, 0x55, 0x4f, 0xe1, 0xa1, 0xa0, - 0x7d, 0xec, 0x53, 0xc8, 0x05, 0xc8, 0x15, 0xe3, 0x45, 0x9e, 0x71, 0xd6, 0x40, 0x49, 0x40, 0x15, - 0x86, 0x62, 0x11, 0x1d, 0x60, 0xa9, 0x12, 0x02, 0xd0, 0x4e, 0x15, 0x79, 0x55, 0xd3, 0xa1, 0x60, - 0x97, 0xa0, 0x76, 0x73, 0x02, 0x8f, 0x04, 0x06, 0xe8, 0x1f, 0x12, 0x3a, 0x16, 0xdf, 0xe8, 0x52, - 0x66, 0x51, 0xca, 0xe8, 0x64, 0xd9, 0x6b, 0x4d, 0x4b, 0x11, 0x70, 0x8a, 0xa5, 0x4a, 0x34, 0x18, - 0x95, 0xf1, 0x63, 0xc4, 0x39, 0x05, 0x51, 0xa3, 0x5c, 0xc5, 0x79, 0xc2, 0xa8, 0x2c, 0xca, 0x39, - 0x28, 0xcf, 0x3b, 0xa3, 0xf8, 0x81, 0xd5, 0x54, 0x59, 0x4a, 0xe8, 0xb1, 0x00, 0xad, 0xa5, 0xf5, - 0x21, 0x65, 0x21, 0x67, 0x31, 0x55, 0x91, 0x4b, 0xe4, 0x0a, 0xf4, 0x33, 0x9e, 0x35, 0x82, 0x86, - 0x82, 0xde, 0x08, 0xa7, 0x98, 0xad, 0x93, 0x2e, 0x9c, 0xde, 0xc2, 0xac, 0x13, 0x3a, 0x33, 0x43, - 0x98, 0xbd, 0x03, 0xf2, 0x5a, 0x12, 0x7e, 0x33, 0xe1, 0x27, 0x83, 0x54, 0xc7, 0x05, 0x25, 0xe2, - 0x44, 0x0a, 0x0c, 0x0e, 0x71, 0x5a, 0xd0, 0x0b, 0x51, 0xe9, 0x30, 0x6e, 0xba, 0xf3, 0x63, 0x4d, - 0xe7, 0x08, 0x7a, 0xe4, 0x13, 0x28, 0xc7, 0xa4, 0x08, 0xe3, 0x5f, 0x2c, 0x7e, 0xe0, 0xc7, 0x94, - 0x5e, 0x22, 0xd5, 0x6e, 0x17, 0x67, 0x17, 0xb3, 0x4f, 0x0a, 0xf3, 0x59, 0x25, 0x1f, 0xe0, 0x0a, - 0xb7, 0xe6, 0x8f, 0xbf, 0x59, 0x15, 0x46, 0x49, 0x82, 0xdf, 0x3c, 0xfc, 0xc3, 0xaa, 0x9c, 0x25, - 0x74, 0x81, 0x83, 0x93, 0x9b, 0xbf, 0x3d, 0x98, 0x9e, 0x6e, 0x52, 0x07, 0x79, 0xbf, 0xd9, 0x85, - 0xb6, 0xf3, 0x6d, 0xbd, 0xb5, 0x37, 0xc6, 0x1b, 0xfc, 0x35, 0xa4, 0x01, 0x77, 0x7b, 0xcb, 0xbb, - 0x0f, 0x3d, 0xcb, 0xdf, 0xb9, 0x8e, 0x6f, 0x19, 0x3d, 0x42, 0x61, 0xde, 0xf0, 0xbd, 0xb3, 0x76, - 0xfc, 0xef, 0x96, 0x67, 0x6d, 0xda, 0x16, 0xa3, 0x4f, 0xde, 0x03, 0x6d, 0x15, 0xdf, 0xdd, 0xda, - 0xa6, 0x1d, 0xa0, 0xd4, 0xcd, 0x49, 0x64, 0x0c, 0x52, 0x60, 0xee, 0x8c, 0x01, 0x99, 0xc0, 0xc0, - 0x36, 0xbf, 0xee, 0x8c, 0x21, 0xbe, 0x03, 0xed, 0xb4, 0xc2, 0x75, 0xb6, 0xf7, 0xc6, 0x08, 0xdf, - 0xc1, 0xac, 0x61, 0x2f, 0x83, 0x2d, 0x1e, 0xdf, 0x7c, 0xc6, 0x78, 0x67, 0x87, 0x9b, 0xc2, 0xd0, - 0xf2, 0x3c, 0xd7, 0xc3, 0x9c, 0x00, 0xa3, 0xf5, 0x17, 0xdf, 0x72, 0x02, 0xcc, 0xa6, 0xc2, 0xd4, - 0x76, 0x4c, 0xd7, 0xf3, 0x2c, 0x33, 0xc0, 0x40, 0x32, 0x8c, 0x5f, 0x0a, 0xe9, 0x7f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x04, 0x82, 0x9b, 0xdb, 0xf1, 0x02, 0x00, 0x00, +var File_dnsqr_proto protoreflect.FileDescriptor + +var file_dnsqr_proto_rawDesc = []byte{ + 0x0a, 0x0b, 0x64, 0x6e, 0x73, 0x71, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6e, + 0x6d, 0x73, 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x22, 0xd8, 0x05, 0x0a, 0x05, 0x44, 0x6e, 0x73, + 0x51, 0x52, 0x12, 0x28, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x02, 0x28, 0x0e, + 0x32, 0x14, 0x2e, 0x6e, 0x6d, 0x73, 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x44, 0x6e, 0x73, + 0x51, 0x52, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x69, 0x70, 0x18, 0x02, 0x20, 0x02, 0x28, 0x0c, 0x52, 0x07, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x49, 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x5f, 0x69, 0x70, 0x18, 0x03, 0x20, 0x02, 0x28, 0x0c, 0x52, 0x0a, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x49, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x18, 0x04, 0x20, 0x02, 0x28, 0x0d, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, + 0x0a, 0x0a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x02, + 0x28, 0x0d, 0x52, 0x09, 0x71, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x23, 0x0a, + 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, + 0x20, 0x02, 0x28, 0x0d, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x6f, + 0x72, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x07, 0x20, 0x02, 0x28, 0x0d, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x05, 0x71, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x71, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x71, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, + 0x71, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x21, 0x0a, 0x0c, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x0c, 0x20, 0x03, + 0x28, 0x0c, 0x52, 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x12, + 0x24, 0x0a, 0x0e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, + 0x63, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x54, 0x69, + 0x6d, 0x65, 0x53, 0x65, 0x63, 0x12, 0x26, 0x0a, 0x0f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73, 0x65, 0x63, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0f, 0x52, 0x0d, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x4e, 0x73, 0x65, 0x63, 0x12, 0x27, 0x0a, + 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, + 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x10, 0x20, 0x03, 0x28, + 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x53, + 0x65, 0x63, 0x12, 0x2c, 0x0a, 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73, 0x65, 0x63, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0f, 0x52, 0x10, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x4e, 0x73, 0x65, 0x63, + 0x12, 0x10, 0x0a, 0x03, 0x74, 0x63, 0x70, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x74, + 0x63, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6d, 0x70, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x69, 0x63, 0x6d, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x12, 0x39, 0x0a, 0x0c, 0x75, 0x64, 0x70, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, + 0x18, 0x15, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x6e, 0x6d, 0x73, 0x67, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x55, 0x64, 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x52, 0x0b, + 0x75, 0x64, 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x36, 0x0a, 0x17, 0x72, + 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, + 0x7a, 0x65, 0x72, 0x6f, 0x65, 0x64, 0x18, 0x16, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x72, 0x65, + 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5a, 0x65, 0x72, + 0x6f, 0x65, 0x64, 0x2a, 0xaa, 0x01, 0x0a, 0x09, 0x44, 0x6e, 0x73, 0x51, 0x52, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x44, 0x50, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, + 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x55, 0x44, 0x50, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, + 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x55, 0x44, + 0x50, 0x5f, 0x55, 0x4e, 0x41, 0x4e, 0x53, 0x57, 0x45, 0x52, 0x45, 0x44, 0x5f, 0x51, 0x55, 0x45, + 0x52, 0x59, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x55, 0x44, 0x50, 0x5f, 0x55, 0x4e, 0x53, 0x4f, + 0x4c, 0x49, 0x43, 0x49, 0x54, 0x45, 0x44, 0x5f, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, + 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x43, 0x50, 0x10, 0x04, 0x12, 0x08, 0x0a, 0x04, 0x49, + 0x43, 0x4d, 0x50, 0x10, 0x05, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x44, 0x50, 0x5f, 0x51, 0x55, 0x45, + 0x52, 0x59, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x55, 0x44, 0x50, + 0x5f, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x07, + 0x2a, 0x40, 0x0a, 0x0b, 0x55, 0x64, 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, + 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x42, + 0x53, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x49, 0x4e, 0x43, 0x4f, 0x52, 0x52, + 0x45, 0x43, 0x54, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x52, 0x52, 0x45, 0x43, 0x54, + 0x10, 0x03, +} + +var ( + file_dnsqr_proto_rawDescOnce sync.Once + file_dnsqr_proto_rawDescData = file_dnsqr_proto_rawDesc +) + +func file_dnsqr_proto_rawDescGZIP() []byte { + file_dnsqr_proto_rawDescOnce.Do(func() { + file_dnsqr_proto_rawDescData = protoimpl.X.CompressGZIP(file_dnsqr_proto_rawDescData) + }) + return file_dnsqr_proto_rawDescData +} + +var file_dnsqr_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_dnsqr_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_dnsqr_proto_goTypes = []interface{}{ + (DnsQRType)(0), // 0: nmsg.base.DnsQRType + (UdpChecksum)(0), // 1: nmsg.base.UdpChecksum + (*DnsQR)(nil), // 2: nmsg.base.DnsQR +} +var file_dnsqr_proto_depIdxs = []int32{ + 0, // 0: nmsg.base.DnsQR.type:type_name -> nmsg.base.DnsQRType + 1, // 1: nmsg.base.DnsQR.udp_checksum:type_name -> nmsg.base.UdpChecksum + 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_dnsqr_proto_init() } +func file_dnsqr_proto_init() { + if File_dnsqr_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_dnsqr_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DnsQR); 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_dnsqr_proto_rawDesc, + NumEnums: 2, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_dnsqr_proto_goTypes, + DependencyIndexes: file_dnsqr_proto_depIdxs, + EnumInfos: file_dnsqr_proto_enumTypes, + MessageInfos: file_dnsqr_proto_msgTypes, + }.Build() + File_dnsqr_proto = out.File + file_dnsqr_proto_rawDesc = nil + file_dnsqr_proto_goTypes = nil + file_dnsqr_proto_depIdxs = nil } diff --git a/nmsg_base/email.pb.go b/nmsg_base/email.pb.go index 45d1524..2c5ba0b 100644 --- a/nmsg_base/email.pb.go +++ b/nmsg_base/email.pb.go @@ -1,17 +1,24 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc (unknown) // source: email.proto -// DO NOT EDIT! package nmsg_base -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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 EmailType int32 @@ -23,141 +30,262 @@ const ( EmailType_rej_user EmailType = 4 ) -var EmailType_name = map[int32]string{ - 0: "unknown", - 1: "spamtrap", - 2: "rej_network", - 3: "rej_content", - 4: "rej_user", -} -var EmailType_value = map[string]int32{ - "unknown": 0, - "spamtrap": 1, - "rej_network": 2, - "rej_content": 3, - "rej_user": 4, -} +// Enum value maps for EmailType. +var ( + EmailType_name = map[int32]string{ + 0: "unknown", + 1: "spamtrap", + 2: "rej_network", + 3: "rej_content", + 4: "rej_user", + } + EmailType_value = map[string]int32{ + "unknown": 0, + "spamtrap": 1, + "rej_network": 2, + "rej_content": 3, + "rej_user": 4, + } +) func (x EmailType) Enum() *EmailType { p := new(EmailType) *p = x return p } + func (x EmailType) String() string { - return proto.EnumName(EmailType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EmailType) Descriptor() protoreflect.EnumDescriptor { + return file_email_proto_enumTypes[0].Descriptor() } -func (x *EmailType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EmailType_value, data, "EmailType") + +func (EmailType) Type() protoreflect.EnumType { + return &file_email_proto_enumTypes[0] +} + +func (x EmailType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *EmailType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = EmailType(value) + *x = EmailType(num) return nil } -func (EmailType) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +// Deprecated: Use EmailType.Descriptor instead. +func (EmailType) EnumDescriptor() ([]byte, []int) { + return file_email_proto_rawDescGZIP(), []int{0} +} type Email struct { - Type *EmailType `protobuf:"varint,8,opt,name=type,enum=nmsg.base.EmailType" json:"type,omitempty"` - Headers []byte `protobuf:"bytes,2,opt,name=headers" json:"headers,omitempty"` - Srcip []byte `protobuf:"bytes,3,opt,name=srcip" json:"srcip,omitempty"` - Srchost []byte `protobuf:"bytes,4,opt,name=srchost" json:"srchost,omitempty"` - Helo []byte `protobuf:"bytes,5,opt,name=helo" json:"helo,omitempty"` - From []byte `protobuf:"bytes,6,opt,name=from" json:"from,omitempty"` - Rcpt [][]byte `protobuf:"bytes,7,rep,name=rcpt" json:"rcpt,omitempty"` - Bodyurl [][]byte `protobuf:"bytes,9,rep,name=bodyurl" json:"bodyurl,omitempty"` - Body []byte `protobuf:"bytes,10,opt,name=body" json:"body,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Email) Reset() { *m = Email{} } -func (m *Email) String() string { return proto.CompactTextString(m) } -func (*Email) ProtoMessage() {} -func (*Email) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } - -func (m *Email) GetType() EmailType { - if m != nil && m.Type != nil { - return *m.Type + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type *EmailType `protobuf:"varint,8,opt,name=type,enum=nmsg.base.EmailType" json:"type,omitempty"` + Headers []byte `protobuf:"bytes,2,opt,name=headers" json:"headers,omitempty"` + Srcip []byte `protobuf:"bytes,3,opt,name=srcip" json:"srcip,omitempty"` + Srchost []byte `protobuf:"bytes,4,opt,name=srchost" json:"srchost,omitempty"` + Helo []byte `protobuf:"bytes,5,opt,name=helo" json:"helo,omitempty"` + From []byte `protobuf:"bytes,6,opt,name=from" json:"from,omitempty"` + Rcpt [][]byte `protobuf:"bytes,7,rep,name=rcpt" json:"rcpt,omitempty"` + Bodyurl [][]byte `protobuf:"bytes,9,rep,name=bodyurl" json:"bodyurl,omitempty"` + Body []byte `protobuf:"bytes,10,opt,name=body" json:"body,omitempty"` +} + +func (x *Email) Reset() { + *x = Email{} + if protoimpl.UnsafeEnabled { + mi := &file_email_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Email) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Email) ProtoMessage() {} + +func (x *Email) ProtoReflect() protoreflect.Message { + mi := &file_email_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 Email.ProtoReflect.Descriptor instead. +func (*Email) Descriptor() ([]byte, []int) { + return file_email_proto_rawDescGZIP(), []int{0} +} + +func (x *Email) GetType() EmailType { + if x != nil && x.Type != nil { + return *x.Type } return EmailType_unknown } -func (m *Email) GetHeaders() []byte { - if m != nil { - return m.Headers +func (x *Email) GetHeaders() []byte { + if x != nil { + return x.Headers } return nil } -func (m *Email) GetSrcip() []byte { - if m != nil { - return m.Srcip +func (x *Email) GetSrcip() []byte { + if x != nil { + return x.Srcip } return nil } -func (m *Email) GetSrchost() []byte { - if m != nil { - return m.Srchost +func (x *Email) GetSrchost() []byte { + if x != nil { + return x.Srchost } return nil } -func (m *Email) GetHelo() []byte { - if m != nil { - return m.Helo +func (x *Email) GetHelo() []byte { + if x != nil { + return x.Helo } return nil } -func (m *Email) GetFrom() []byte { - if m != nil { - return m.From +func (x *Email) GetFrom() []byte { + if x != nil { + return x.From } return nil } -func (m *Email) GetRcpt() [][]byte { - if m != nil { - return m.Rcpt +func (x *Email) GetRcpt() [][]byte { + if x != nil { + return x.Rcpt } return nil } -func (m *Email) GetBodyurl() [][]byte { - if m != nil { - return m.Bodyurl +func (x *Email) GetBodyurl() [][]byte { + if x != nil { + return x.Bodyurl } return nil } -func (m *Email) GetBody() []byte { - if m != nil { - return m.Body +func (x *Email) GetBody() []byte { + if x != nil { + return x.Body } return nil } -func init() { - proto.RegisterType((*Email)(nil), "nmsg.base.Email") - proto.RegisterEnum("nmsg.base.EmailType", EmailType_name, EmailType_value) -} - -func init() { proto.RegisterFile("email.proto", fileDescriptor2) } - -var fileDescriptor2 = []byte{ - // 222 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x44, 0x8e, 0x41, 0x4e, 0xc3, 0x30, - 0x10, 0x45, 0x49, 0x93, 0x90, 0x66, 0x52, 0xc0, 0x8a, 0x58, 0xcc, 0xb2, 0xea, 0x0a, 0xb1, 0xc8, - 0x82, 0x3b, 0x70, 0x03, 0xc4, 0x16, 0xb9, 0xe9, 0x40, 0x4a, 0x13, 0x8f, 0x35, 0x76, 0x54, 0xf5, - 0x40, 0xdc, 0x13, 0xdb, 0x28, 0x74, 0xf9, 0xdf, 0x7b, 0xb6, 0x06, 0x1a, 0x9a, 0xf4, 0x71, 0xec, - 0xac, 0xb0, 0xe7, 0xb6, 0x36, 0x93, 0xfb, 0xea, 0xf6, 0xda, 0xd1, 0xee, 0x27, 0x83, 0xf2, 0x35, - 0xaa, 0x76, 0x07, 0x85, 0xbf, 0x58, 0xc2, 0xf5, 0x36, 0x7b, 0xba, 0x7f, 0x79, 0xec, 0xfe, 0x9b, - 0x2e, 0xf9, 0xb7, 0xe0, 0xda, 0x07, 0xa8, 0x06, 0xd2, 0x07, 0x12, 0x87, 0xab, 0x90, 0x6d, 0xda, - 0x3b, 0x28, 0x9d, 0xf4, 0x47, 0x8b, 0x79, 0x9a, 0xc1, 0x87, 0x39, 0xb0, 0xf3, 0x58, 0x24, 0xb0, - 0x81, 0x62, 0xa0, 0x91, 0xb1, 0x5c, 0xd6, 0xa7, 0xf0, 0x84, 0xb7, 0xcb, 0x92, 0xde, 0x7a, 0xac, - 0xb6, 0xf9, 0xdf, 0xd3, 0x3d, 0x1f, 0x2e, 0xb3, 0x8c, 0x58, 0x27, 0x10, 0x74, 0x04, 0x08, 0x31, - 0x7e, 0x7e, 0x87, 0xfa, 0x7a, 0x46, 0x03, 0xd5, 0x6c, 0x4e, 0x86, 0xcf, 0x46, 0xdd, 0x84, 0x6e, - 0xed, 0xac, 0x9e, 0xbc, 0x68, 0xab, 0xb2, 0xf0, 0x4d, 0x23, 0xf4, 0xfd, 0x61, 0xc8, 0x9f, 0x59, - 0x4e, 0x6a, 0xb5, 0x80, 0x9e, 0x8d, 0x27, 0xe3, 0x55, 0x1e, 0xfb, 0x08, 0x66, 0x47, 0xa2, 0x8a, - 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6b, 0xe2, 0x02, 0x36, 0x18, 0x01, 0x00, 0x00, +var File_email_proto protoreflect.FileDescriptor + +var file_email_proto_rawDesc = []byte{ + 0x0a, 0x0b, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6e, + 0x6d, 0x73, 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x22, 0xe5, 0x01, 0x0a, 0x05, 0x45, 0x6d, 0x61, + 0x69, 0x6c, 0x12, 0x28, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x14, 0x2e, 0x6e, 0x6d, 0x73, 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x61, + 0x69, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x72, 0x63, 0x69, 0x70, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x72, 0x63, 0x69, 0x70, 0x12, 0x18, 0x0a, 0x07, + 0x73, 0x72, 0x63, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, + 0x72, 0x63, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x6c, 0x6f, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x65, 0x6c, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, + 0x6f, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x12, + 0x0a, 0x04, 0x72, 0x63, 0x70, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x72, 0x63, + 0x70, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6f, 0x64, 0x79, 0x75, 0x72, 0x6c, 0x18, 0x09, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x07, 0x62, 0x6f, 0x64, 0x79, 0x75, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x2a, 0x56, 0x0a, 0x09, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, + 0x07, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x73, 0x70, + 0x61, 0x6d, 0x74, 0x72, 0x61, 0x70, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x72, 0x65, 0x6a, 0x5f, + 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x72, 0x65, 0x6a, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x72, 0x65, + 0x6a, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x10, 0x04, +} + +var ( + file_email_proto_rawDescOnce sync.Once + file_email_proto_rawDescData = file_email_proto_rawDesc +) + +func file_email_proto_rawDescGZIP() []byte { + file_email_proto_rawDescOnce.Do(func() { + file_email_proto_rawDescData = protoimpl.X.CompressGZIP(file_email_proto_rawDescData) + }) + return file_email_proto_rawDescData +} + +var file_email_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_email_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_email_proto_goTypes = []interface{}{ + (EmailType)(0), // 0: nmsg.base.EmailType + (*Email)(nil), // 1: nmsg.base.Email +} +var file_email_proto_depIdxs = []int32{ + 0, // 0: nmsg.base.Email.type:type_name -> nmsg.base.EmailType + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_email_proto_init() } +func file_email_proto_init() { + if File_email_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_email_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Email); 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_email_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_email_proto_goTypes, + DependencyIndexes: file_email_proto_depIdxs, + EnumInfos: file_email_proto_enumTypes, + MessageInfos: file_email_proto_msgTypes, + }.Build() + File_email_proto = out.File + file_email_proto_rawDesc = nil + file_email_proto_goTypes = nil + file_email_proto_depIdxs = nil } diff --git a/nmsg_base/encode.pb.go b/nmsg_base/encode.pb.go index d00ada9..2f8b711 100644 --- a/nmsg_base/encode.pb.go +++ b/nmsg_base/encode.pb.go @@ -1,17 +1,24 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc (unknown) // source: encode.proto -// DO NOT EDIT! package nmsg_base -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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 EncodeType int32 @@ -23,81 +30,195 @@ const ( EncodeType_XML EncodeType = 4 ) -var EncodeType_name = map[int32]string{ - 0: "TEXT", - 1: "JSON", - 2: "YAML", - 3: "MSGPACK", - 4: "XML", -} -var EncodeType_value = map[string]int32{ - "TEXT": 0, - "JSON": 1, - "YAML": 2, - "MSGPACK": 3, - "XML": 4, -} +// Enum value maps for EncodeType. +var ( + EncodeType_name = map[int32]string{ + 0: "TEXT", + 1: "JSON", + 2: "YAML", + 3: "MSGPACK", + 4: "XML", + } + EncodeType_value = map[string]int32{ + "TEXT": 0, + "JSON": 1, + "YAML": 2, + "MSGPACK": 3, + "XML": 4, + } +) func (x EncodeType) Enum() *EncodeType { p := new(EncodeType) *p = x return p } + func (x EncodeType) String() string { - return proto.EnumName(EncodeType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (x *EncodeType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EncodeType_value, data, "EncodeType") + +func (EncodeType) Descriptor() protoreflect.EnumDescriptor { + return file_encode_proto_enumTypes[0].Descriptor() +} + +func (EncodeType) Type() protoreflect.EnumType { + return &file_encode_proto_enumTypes[0] +} + +func (x EncodeType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *EncodeType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = EncodeType(value) + *x = EncodeType(num) return nil } -func (EncodeType) EnumDescriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +// Deprecated: Use EncodeType.Descriptor instead. +func (EncodeType) EnumDescriptor() ([]byte, []int) { + return file_encode_proto_rawDescGZIP(), []int{0} +} type Encode struct { - Type *EncodeType `protobuf:"varint,1,req,name=type,enum=nmsg.base.EncodeType" json:"type,omitempty"` - Payload []byte `protobuf:"bytes,2,req,name=payload" json:"payload,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type *EncodeType `protobuf:"varint,1,req,name=type,enum=nmsg.base.EncodeType" json:"type,omitempty"` + Payload []byte `protobuf:"bytes,2,req,name=payload" json:"payload,omitempty"` } -func (m *Encode) Reset() { *m = Encode{} } -func (m *Encode) String() string { return proto.CompactTextString(m) } -func (*Encode) ProtoMessage() {} -func (*Encode) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } +func (x *Encode) Reset() { + *x = Encode{} + if protoimpl.UnsafeEnabled { + mi := &file_encode_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Encode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Encode) ProtoMessage() {} + +func (x *Encode) ProtoReflect() protoreflect.Message { + mi := &file_encode_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 Encode.ProtoReflect.Descriptor instead. +func (*Encode) Descriptor() ([]byte, []int) { + return file_encode_proto_rawDescGZIP(), []int{0} +} -func (m *Encode) GetType() EncodeType { - if m != nil && m.Type != nil { - return *m.Type +func (x *Encode) GetType() EncodeType { + if x != nil && x.Type != nil { + return *x.Type } return EncodeType_TEXT } -func (m *Encode) GetPayload() []byte { - if m != nil { - return m.Payload +func (x *Encode) GetPayload() []byte { + if x != nil { + return x.Payload } return nil } -func init() { - proto.RegisterType((*Encode)(nil), "nmsg.base.Encode") - proto.RegisterEnum("nmsg.base.EncodeType", EncodeType_name, EncodeType_value) +var File_encode_proto protoreflect.FileDescriptor + +var file_encode_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, + 0x6e, 0x6d, 0x73, 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x22, 0x4d, 0x0a, 0x06, 0x45, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x02, 0x28, + 0x0e, 0x32, 0x15, 0x2e, 0x6e, 0x6d, 0x73, 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6e, + 0x63, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x02, 0x28, 0x0c, 0x52, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2a, 0x40, 0x0a, 0x0a, 0x45, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x45, 0x58, 0x54, 0x10, 0x00, + 0x12, 0x08, 0x0a, 0x04, 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x59, 0x41, + 0x4d, 0x4c, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x53, 0x47, 0x50, 0x41, 0x43, 0x4b, 0x10, + 0x03, 0x12, 0x07, 0x0a, 0x03, 0x58, 0x4d, 0x4c, 0x10, 0x04, } -func init() { proto.RegisterFile("encode.proto", fileDescriptor3) } +var ( + file_encode_proto_rawDescOnce sync.Once + file_encode_proto_rawDescData = file_encode_proto_rawDesc +) -var fileDescriptor3 = []byte{ - // 148 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x49, 0xcd, 0x4b, 0xce, - 0x4f, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcc, 0xcb, 0x2d, 0x4e, 0xd7, 0x4b, - 0x4a, 0x2c, 0x4e, 0x55, 0xb2, 0xe3, 0x62, 0x73, 0x05, 0x4b, 0x09, 0x29, 0x73, 0xb1, 0x94, 0x54, - 0x16, 0xa4, 0x4a, 0x30, 0x2a, 0x30, 0x69, 0xf0, 0x19, 0x89, 0xea, 0xc1, 0xd5, 0xe8, 0x41, 0x14, - 0x84, 0x00, 0x25, 0x85, 0xf8, 0xb9, 0xd8, 0x0b, 0x12, 0x2b, 0x73, 0xf2, 0x13, 0x53, 0x24, 0x98, - 0x80, 0xea, 0x78, 0xb4, 0x1c, 0xb8, 0xb8, 0x90, 0xa4, 0x39, 0xb8, 0x58, 0x42, 0x5c, 0x23, 0x42, - 0x04, 0x18, 0x40, 0x2c, 0xaf, 0x60, 0x7f, 0x3f, 0x01, 0x46, 0x10, 0x2b, 0xd2, 0xd1, 0xd7, 0x47, - 0x80, 0x49, 0x88, 0x9b, 0x8b, 0xdd, 0x37, 0xd8, 0x3d, 0xc0, 0xd1, 0xd9, 0x5b, 0x80, 0x59, 0x88, - 0x9d, 0x8b, 0x39, 0x02, 0x28, 0xca, 0x02, 0x08, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x9e, 0xfe, 0xff, - 0x9b, 0x00, 0x00, 0x00, +func file_encode_proto_rawDescGZIP() []byte { + file_encode_proto_rawDescOnce.Do(func() { + file_encode_proto_rawDescData = protoimpl.X.CompressGZIP(file_encode_proto_rawDescData) + }) + return file_encode_proto_rawDescData +} + +var file_encode_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_encode_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_encode_proto_goTypes = []interface{}{ + (EncodeType)(0), // 0: nmsg.base.EncodeType + (*Encode)(nil), // 1: nmsg.base.Encode +} +var file_encode_proto_depIdxs = []int32{ + 0, // 0: nmsg.base.Encode.type:type_name -> nmsg.base.EncodeType + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_encode_proto_init() } +func file_encode_proto_init() { + if File_encode_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_encode_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Encode); 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_encode_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_encode_proto_goTypes, + DependencyIndexes: file_encode_proto_depIdxs, + EnumInfos: file_encode_proto_enumTypes, + MessageInfos: file_encode_proto_msgTypes, + }.Build() + File_encode_proto = out.File + file_encode_proto_rawDesc = nil + file_encode_proto_goTypes = nil + file_encode_proto_depIdxs = nil } diff --git a/nmsg_base/http.pb.go b/nmsg_base/http.pb.go index a969f90..42ab325 100644 --- a/nmsg_base/http.pb.go +++ b/nmsg_base/http.pb.go @@ -1,17 +1,24 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc (unknown) // source: http.proto -// DO NOT EDIT! package nmsg_base -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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 HttpType int32 @@ -20,208 +27,339 @@ const ( HttpType_sinkhole HttpType = 1 ) -var HttpType_name = map[int32]string{ - 1: "sinkhole", -} -var HttpType_value = map[string]int32{ - "sinkhole": 1, -} +// Enum value maps for HttpType. +var ( + HttpType_name = map[int32]string{ + 1: "sinkhole", + } + HttpType_value = map[string]int32{ + "sinkhole": 1, + } +) func (x HttpType) Enum() *HttpType { p := new(HttpType) *p = x return p } + func (x HttpType) String() string { - return proto.EnumName(HttpType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (HttpType) Descriptor() protoreflect.EnumDescriptor { + return file_http_proto_enumTypes[0].Descriptor() } -func (x *HttpType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(HttpType_value, data, "HttpType") + +func (HttpType) Type() protoreflect.EnumType { + return &file_http_proto_enumTypes[0] +} + +func (x HttpType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *HttpType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = HttpType(value) + *x = HttpType(num) return nil } -func (HttpType) EnumDescriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } + +// Deprecated: Use HttpType.Descriptor instead. +func (HttpType) EnumDescriptor() ([]byte, []int) { + return file_http_proto_rawDescGZIP(), []int{0} +} type Http struct { - Type *HttpType `protobuf:"varint,1,req,name=type,enum=nmsg.base.HttpType" json:"type,omitempty"` - Srcip []byte `protobuf:"bytes,2,opt,name=srcip" json:"srcip,omitempty"` - Srchost []byte `protobuf:"bytes,3,opt,name=srchost" json:"srchost,omitempty"` - Srcport *uint32 `protobuf:"varint,4,opt,name=srcport" json:"srcport,omitempty"` - Dstip []byte `protobuf:"bytes,5,opt,name=dstip" json:"dstip,omitempty"` - Dstport *uint32 `protobuf:"varint,6,opt,name=dstport" json:"dstport,omitempty"` - Request []byte `protobuf:"bytes,7,opt,name=request" json:"request,omitempty"` - P0FGenre []byte `protobuf:"bytes,65,opt,name=p0f_genre" json:"p0f_genre,omitempty"` - P0FDetail []byte `protobuf:"bytes,66,opt,name=p0f_detail" json:"p0f_detail,omitempty"` - P0FDist *int32 `protobuf:"varint,67,opt,name=p0f_dist" json:"p0f_dist,omitempty"` - P0FLink []byte `protobuf:"bytes,68,opt,name=p0f_link" json:"p0f_link,omitempty"` - P0FTos []byte `protobuf:"bytes,69,opt,name=p0f_tos" json:"p0f_tos,omitempty"` - P0FFw *uint32 `protobuf:"varint,70,opt,name=p0f_fw" json:"p0f_fw,omitempty"` - P0FNat *uint32 `protobuf:"varint,71,opt,name=p0f_nat" json:"p0f_nat,omitempty"` - P0FReal *uint32 `protobuf:"varint,72,opt,name=p0f_real" json:"p0f_real,omitempty"` - P0FScore *int32 `protobuf:"varint,73,opt,name=p0f_score" json:"p0f_score,omitempty"` - P0FMflags *uint32 `protobuf:"varint,74,opt,name=p0f_mflags" json:"p0f_mflags,omitempty"` - P0FUptime *int32 `protobuf:"varint,75,opt,name=p0f_uptime" json:"p0f_uptime,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Http) Reset() { *m = Http{} } -func (m *Http) String() string { return proto.CompactTextString(m) } -func (*Http) ProtoMessage() {} -func (*Http) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } - -func (m *Http) GetType() HttpType { - if m != nil && m.Type != nil { - return *m.Type + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type *HttpType `protobuf:"varint,1,req,name=type,enum=nmsg.base.HttpType" json:"type,omitempty"` + Srcip []byte `protobuf:"bytes,2,opt,name=srcip" json:"srcip,omitempty"` + Srchost []byte `protobuf:"bytes,3,opt,name=srchost" json:"srchost,omitempty"` + Srcport *uint32 `protobuf:"varint,4,opt,name=srcport" json:"srcport,omitempty"` + Dstip []byte `protobuf:"bytes,5,opt,name=dstip" json:"dstip,omitempty"` + Dstport *uint32 `protobuf:"varint,6,opt,name=dstport" json:"dstport,omitempty"` + Request []byte `protobuf:"bytes,7,opt,name=request" json:"request,omitempty"` + P0FGenre []byte `protobuf:"bytes,65,opt,name=p0f_genre,json=p0fGenre" json:"p0f_genre,omitempty"` + P0FDetail []byte `protobuf:"bytes,66,opt,name=p0f_detail,json=p0fDetail" json:"p0f_detail,omitempty"` + P0FDist *int32 `protobuf:"varint,67,opt,name=p0f_dist,json=p0fDist" json:"p0f_dist,omitempty"` + P0FLink []byte `protobuf:"bytes,68,opt,name=p0f_link,json=p0fLink" json:"p0f_link,omitempty"` + P0FTos []byte `protobuf:"bytes,69,opt,name=p0f_tos,json=p0fTos" json:"p0f_tos,omitempty"` + P0FFw *uint32 `protobuf:"varint,70,opt,name=p0f_fw,json=p0fFw" json:"p0f_fw,omitempty"` + P0FNat *uint32 `protobuf:"varint,71,opt,name=p0f_nat,json=p0fNat" json:"p0f_nat,omitempty"` + P0FReal *uint32 `protobuf:"varint,72,opt,name=p0f_real,json=p0fReal" json:"p0f_real,omitempty"` + P0FScore *int32 `protobuf:"varint,73,opt,name=p0f_score,json=p0fScore" json:"p0f_score,omitempty"` + P0FMflags *uint32 `protobuf:"varint,74,opt,name=p0f_mflags,json=p0fMflags" json:"p0f_mflags,omitempty"` + P0FUptime *int32 `protobuf:"varint,75,opt,name=p0f_uptime,json=p0fUptime" json:"p0f_uptime,omitempty"` +} + +func (x *Http) Reset() { + *x = Http{} + if protoimpl.UnsafeEnabled { + mi := &file_http_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Http) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Http) ProtoMessage() {} + +func (x *Http) ProtoReflect() protoreflect.Message { + mi := &file_http_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 Http.ProtoReflect.Descriptor instead. +func (*Http) Descriptor() ([]byte, []int) { + return file_http_proto_rawDescGZIP(), []int{0} +} + +func (x *Http) GetType() HttpType { + if x != nil && x.Type != nil { + return *x.Type } return HttpType_sinkhole } -func (m *Http) GetSrcip() []byte { - if m != nil { - return m.Srcip +func (x *Http) GetSrcip() []byte { + if x != nil { + return x.Srcip } return nil } -func (m *Http) GetSrchost() []byte { - if m != nil { - return m.Srchost +func (x *Http) GetSrchost() []byte { + if x != nil { + return x.Srchost } return nil } -func (m *Http) GetSrcport() uint32 { - if m != nil && m.Srcport != nil { - return *m.Srcport +func (x *Http) GetSrcport() uint32 { + if x != nil && x.Srcport != nil { + return *x.Srcport } return 0 } -func (m *Http) GetDstip() []byte { - if m != nil { - return m.Dstip +func (x *Http) GetDstip() []byte { + if x != nil { + return x.Dstip } return nil } -func (m *Http) GetDstport() uint32 { - if m != nil && m.Dstport != nil { - return *m.Dstport +func (x *Http) GetDstport() uint32 { + if x != nil && x.Dstport != nil { + return *x.Dstport } return 0 } -func (m *Http) GetRequest() []byte { - if m != nil { - return m.Request +func (x *Http) GetRequest() []byte { + if x != nil { + return x.Request } return nil } -func (m *Http) GetP0FGenre() []byte { - if m != nil { - return m.P0FGenre +func (x *Http) GetP0FGenre() []byte { + if x != nil { + return x.P0FGenre } return nil } -func (m *Http) GetP0FDetail() []byte { - if m != nil { - return m.P0FDetail +func (x *Http) GetP0FDetail() []byte { + if x != nil { + return x.P0FDetail } return nil } -func (m *Http) GetP0FDist() int32 { - if m != nil && m.P0FDist != nil { - return *m.P0FDist +func (x *Http) GetP0FDist() int32 { + if x != nil && x.P0FDist != nil { + return *x.P0FDist } return 0 } -func (m *Http) GetP0FLink() []byte { - if m != nil { - return m.P0FLink +func (x *Http) GetP0FLink() []byte { + if x != nil { + return x.P0FLink } return nil } -func (m *Http) GetP0FTos() []byte { - if m != nil { - return m.P0FTos +func (x *Http) GetP0FTos() []byte { + if x != nil { + return x.P0FTos } return nil } -func (m *Http) GetP0FFw() uint32 { - if m != nil && m.P0FFw != nil { - return *m.P0FFw +func (x *Http) GetP0FFw() uint32 { + if x != nil && x.P0FFw != nil { + return *x.P0FFw } return 0 } -func (m *Http) GetP0FNat() uint32 { - if m != nil && m.P0FNat != nil { - return *m.P0FNat +func (x *Http) GetP0FNat() uint32 { + if x != nil && x.P0FNat != nil { + return *x.P0FNat } return 0 } -func (m *Http) GetP0FReal() uint32 { - if m != nil && m.P0FReal != nil { - return *m.P0FReal +func (x *Http) GetP0FReal() uint32 { + if x != nil && x.P0FReal != nil { + return *x.P0FReal } return 0 } -func (m *Http) GetP0FScore() int32 { - if m != nil && m.P0FScore != nil { - return *m.P0FScore +func (x *Http) GetP0FScore() int32 { + if x != nil && x.P0FScore != nil { + return *x.P0FScore } return 0 } -func (m *Http) GetP0FMflags() uint32 { - if m != nil && m.P0FMflags != nil { - return *m.P0FMflags +func (x *Http) GetP0FMflags() uint32 { + if x != nil && x.P0FMflags != nil { + return *x.P0FMflags } return 0 } -func (m *Http) GetP0FUptime() int32 { - if m != nil && m.P0FUptime != nil { - return *m.P0FUptime +func (x *Http) GetP0FUptime() int32 { + if x != nil && x.P0FUptime != nil { + return *x.P0FUptime } return 0 } -func init() { - proto.RegisterType((*Http)(nil), "nmsg.base.Http") - proto.RegisterEnum("nmsg.base.HttpType", HttpType_name, HttpType_value) -} - -func init() { proto.RegisterFile("http.proto", fileDescriptor4) } - -var fileDescriptor4 = []byte{ - // 268 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x4c, 0xd0, 0x4d, 0x4f, 0xf3, 0x30, - 0x0c, 0x07, 0x70, 0xb5, 0x4f, 0xbb, 0x75, 0xd6, 0xb6, 0x67, 0x94, 0x8b, 0x8f, 0x83, 0xd3, 0xc4, - 0xa1, 0x42, 0x7c, 0x03, 0xde, 0x07, 0x5c, 0xb9, 0xa3, 0xb2, 0xa5, 0x2f, 0x22, 0x6d, 0x42, 0xe2, - 0x09, 0xf1, 0x41, 0xf9, 0x3e, 0x38, 0x56, 0x3b, 0x71, 0xf4, 0xef, 0x6f, 0xc7, 0x56, 0x00, 0x1a, - 0x22, 0x5b, 0x58, 0x67, 0xc8, 0xe4, 0xb3, 0xbe, 0xf3, 0x75, 0xf1, 0x5e, 0x7a, 0x75, 0xfe, 0x13, - 0x43, 0xb2, 0xe5, 0x24, 0x3f, 0x83, 0x84, 0xbe, 0xad, 0xc2, 0x68, 0x1d, 0x6f, 0x96, 0x57, 0xa7, - 0xc5, 0xb1, 0xa5, 0x08, 0xf1, 0x2b, 0x47, 0xf9, 0x02, 0x52, 0xef, 0x76, 0xad, 0xc5, 0x78, 0x1d, - 0x6d, 0xe6, 0xf9, 0x7f, 0x98, 0x72, 0xd9, 0x18, 0x4f, 0xf8, 0xef, 0x0f, 0x58, 0xe3, 0x08, 0x13, - 0x86, 0x45, 0x18, 0xd8, 0x7b, 0xe2, 0x81, 0x74, 0xcc, 0xb9, 0x94, 0x7c, 0x22, 0x39, 0x83, 0x53, - 0x9f, 0x07, 0xc5, 0x2f, 0x4c, 0xa5, 0xe3, 0x04, 0x66, 0xf6, 0xb2, 0x7a, 0xab, 0x55, 0xef, 0x14, - 0x5e, 0x0b, 0xe5, 0x00, 0x81, 0xf6, 0x8a, 0xca, 0x56, 0xe3, 0x8d, 0xd8, 0x0a, 0x32, 0xb1, 0x96, - 0x07, 0x6f, 0x59, 0xd2, 0x51, 0x74, 0xdb, 0x7f, 0xe0, 0xdd, 0xb8, 0x2c, 0x08, 0x19, 0x8f, 0xf7, - 0x02, 0x4b, 0x98, 0x04, 0xa8, 0xbe, 0xf0, 0x61, 0x5c, 0x1e, 0xea, 0xbe, 0x24, 0x7c, 0x14, 0x18, - 0xde, 0x70, 0xaa, 0xd4, 0xb8, 0x15, 0x19, 0xce, 0xf1, 0x3b, 0xc3, 0xe7, 0x3c, 0xc9, 0xa2, 0xe1, - 0x9c, 0xae, 0xd2, 0x65, 0xed, 0xf1, 0x59, 0xda, 0x06, 0x3b, 0x58, 0x6a, 0x3b, 0x85, 0x2f, 0xa1, - 0xef, 0x02, 0x21, 0x3b, 0xfe, 0xdb, 0x1c, 0x32, 0xcf, 0x87, 0x35, 0x46, 0xab, 0x55, 0xf4, 0x1b, - 0x00, 0x00, 0xff, 0xff, 0xa3, 0x64, 0x11, 0x56, 0x89, 0x01, 0x00, 0x00, +var File_http_proto protoreflect.FileDescriptor + +var file_http_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6e, 0x6d, + 0x73, 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x22, 0xf4, 0x03, 0x0a, 0x04, 0x48, 0x74, 0x74, 0x70, + 0x12, 0x27, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x02, 0x28, 0x0e, 0x32, 0x13, + 0x2e, 0x6e, 0x6d, 0x73, 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x72, 0x63, + 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x72, 0x63, 0x69, 0x70, 0x12, + 0x18, 0x0a, 0x07, 0x73, 0x72, 0x63, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x07, 0x73, 0x72, 0x63, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x72, 0x63, + 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x73, 0x72, 0x63, 0x70, + 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x73, 0x74, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x64, 0x73, 0x74, 0x69, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x73, 0x74, + 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x64, 0x73, 0x74, 0x70, + 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, + 0x09, 0x70, 0x30, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x72, 0x65, 0x18, 0x41, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x08, 0x70, 0x30, 0x66, 0x47, 0x65, 0x6e, 0x72, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x30, + 0x66, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x42, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, + 0x70, 0x30, 0x66, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x30, 0x66, + 0x5f, 0x64, 0x69, 0x73, 0x74, 0x18, 0x43, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x30, 0x66, + 0x44, 0x69, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x30, 0x66, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, + 0x18, 0x44, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x30, 0x66, 0x4c, 0x69, 0x6e, 0x6b, 0x12, + 0x17, 0x0a, 0x07, 0x70, 0x30, 0x66, 0x5f, 0x74, 0x6f, 0x73, 0x18, 0x45, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x06, 0x70, 0x30, 0x66, 0x54, 0x6f, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x70, 0x30, 0x66, 0x5f, + 0x66, 0x77, 0x18, 0x46, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x70, 0x30, 0x66, 0x46, 0x77, 0x12, + 0x17, 0x0a, 0x07, 0x70, 0x30, 0x66, 0x5f, 0x6e, 0x61, 0x74, 0x18, 0x47, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x06, 0x70, 0x30, 0x66, 0x4e, 0x61, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x30, 0x66, 0x5f, + 0x72, 0x65, 0x61, 0x6c, 0x18, 0x48, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x70, 0x30, 0x66, 0x52, + 0x65, 0x61, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x30, 0x66, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, + 0x18, 0x49, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x30, 0x66, 0x53, 0x63, 0x6f, 0x72, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x30, 0x66, 0x5f, 0x6d, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x4a, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x70, 0x30, 0x66, 0x4d, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x12, + 0x1d, 0x0a, 0x0a, 0x70, 0x30, 0x66, 0x5f, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x4b, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x30, 0x66, 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2a, 0x18, + 0x0a, 0x08, 0x48, 0x74, 0x74, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x73, 0x69, + 0x6e, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0x10, 0x01, +} + +var ( + file_http_proto_rawDescOnce sync.Once + file_http_proto_rawDescData = file_http_proto_rawDesc +) + +func file_http_proto_rawDescGZIP() []byte { + file_http_proto_rawDescOnce.Do(func() { + file_http_proto_rawDescData = protoimpl.X.CompressGZIP(file_http_proto_rawDescData) + }) + return file_http_proto_rawDescData +} + +var file_http_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_http_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_http_proto_goTypes = []interface{}{ + (HttpType)(0), // 0: nmsg.base.HttpType + (*Http)(nil), // 1: nmsg.base.Http +} +var file_http_proto_depIdxs = []int32{ + 0, // 0: nmsg.base.Http.type:type_name -> nmsg.base.HttpType + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_http_proto_init() } +func file_http_proto_init() { + if File_http_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_http_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Http); 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_http_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_http_proto_goTypes, + DependencyIndexes: file_http_proto_depIdxs, + EnumInfos: file_http_proto_enumTypes, + MessageInfos: file_http_proto_msgTypes, + }.Build() + File_http_proto = out.File + file_http_proto_rawDesc = nil + file_http_proto_goTypes = nil + file_http_proto_depIdxs = nil } diff --git a/nmsg_base/ipconn.pb.go b/nmsg_base/ipconn.pb.go index 33cfa1c..37ef118 100644 --- a/nmsg_base/ipconn.pb.go +++ b/nmsg_base/ipconn.pb.go @@ -1,80 +1,178 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc (unknown) // source: ipconn.proto -// DO NOT EDIT! package nmsg_base -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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 IPConn struct { - Proto *uint32 `protobuf:"varint,1,opt,name=proto" json:"proto,omitempty"` - Srcip []byte `protobuf:"bytes,2,opt,name=srcip" json:"srcip,omitempty"` - Srcport *uint32 `protobuf:"varint,3,opt,name=srcport" json:"srcport,omitempty"` - Dstip []byte `protobuf:"bytes,4,opt,name=dstip" json:"dstip,omitempty"` - Dstport *uint32 `protobuf:"varint,5,opt,name=dstport" json:"dstport,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Proto *uint32 `protobuf:"varint,1,opt,name=proto" json:"proto,omitempty"` + Srcip []byte `protobuf:"bytes,2,opt,name=srcip" json:"srcip,omitempty"` + Srcport *uint32 `protobuf:"varint,3,opt,name=srcport" json:"srcport,omitempty"` + Dstip []byte `protobuf:"bytes,4,opt,name=dstip" json:"dstip,omitempty"` + Dstport *uint32 `protobuf:"varint,5,opt,name=dstport" json:"dstport,omitempty"` +} + +func (x *IPConn) Reset() { + *x = IPConn{} + if protoimpl.UnsafeEnabled { + mi := &file_ipconn_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IPConn) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IPConn) ProtoMessage() {} + +func (x *IPConn) ProtoReflect() protoreflect.Message { + mi := &file_ipconn_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) } -func (m *IPConn) Reset() { *m = IPConn{} } -func (m *IPConn) String() string { return proto.CompactTextString(m) } -func (*IPConn) ProtoMessage() {} -func (*IPConn) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} } +// Deprecated: Use IPConn.ProtoReflect.Descriptor instead. +func (*IPConn) Descriptor() ([]byte, []int) { + return file_ipconn_proto_rawDescGZIP(), []int{0} +} -func (m *IPConn) GetProto() uint32 { - if m != nil && m.Proto != nil { - return *m.Proto +func (x *IPConn) GetProto() uint32 { + if x != nil && x.Proto != nil { + return *x.Proto } return 0 } -func (m *IPConn) GetSrcip() []byte { - if m != nil { - return m.Srcip +func (x *IPConn) GetSrcip() []byte { + if x != nil { + return x.Srcip } return nil } -func (m *IPConn) GetSrcport() uint32 { - if m != nil && m.Srcport != nil { - return *m.Srcport +func (x *IPConn) GetSrcport() uint32 { + if x != nil && x.Srcport != nil { + return *x.Srcport } return 0 } -func (m *IPConn) GetDstip() []byte { - if m != nil { - return m.Dstip +func (x *IPConn) GetDstip() []byte { + if x != nil { + return x.Dstip } return nil } -func (m *IPConn) GetDstport() uint32 { - if m != nil && m.Dstport != nil { - return *m.Dstport +func (x *IPConn) GetDstport() uint32 { + if x != nil && x.Dstport != nil { + return *x.Dstport } return 0 } -func init() { - proto.RegisterType((*IPConn)(nil), "nmsg.base.IPConn") +var File_ipconn_proto protoreflect.FileDescriptor + +var file_ipconn_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x69, 0x70, 0x63, 0x6f, 0x6e, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, + 0x6e, 0x6d, 0x73, 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x22, 0x7e, 0x0a, 0x06, 0x49, 0x50, 0x43, + 0x6f, 0x6e, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x72, 0x63, + 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x72, 0x63, 0x69, 0x70, 0x12, + 0x18, 0x0a, 0x07, 0x73, 0x72, 0x63, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x07, 0x73, 0x72, 0x63, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x73, 0x74, + 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x64, 0x73, 0x74, 0x69, 0x70, 0x12, + 0x18, 0x0a, 0x07, 0x64, 0x73, 0x74, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x07, 0x64, 0x73, 0x74, 0x70, 0x6f, 0x72, 0x74, +} + +var ( + file_ipconn_proto_rawDescOnce sync.Once + file_ipconn_proto_rawDescData = file_ipconn_proto_rawDesc +) + +func file_ipconn_proto_rawDescGZIP() []byte { + file_ipconn_proto_rawDescOnce.Do(func() { + file_ipconn_proto_rawDescData = protoimpl.X.CompressGZIP(file_ipconn_proto_rawDescData) + }) + return file_ipconn_proto_rawDescData +} + +var file_ipconn_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_ipconn_proto_goTypes = []interface{}{ + (*IPConn)(nil), // 0: nmsg.base.IPConn +} +var file_ipconn_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() { proto.RegisterFile("ipconn.proto", fileDescriptor5) } - -var fileDescriptor5 = []byte{ - // 109 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0xc9, 0x2c, 0x48, 0xce, - 0xcf, 0xcb, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcc, 0xcb, 0x2d, 0x4e, 0xd7, 0x4b, - 0x4a, 0x2c, 0x4e, 0x55, 0x0a, 0xe7, 0x62, 0xf3, 0x0c, 0x70, 0x06, 0x4a, 0x09, 0xf1, 0x72, 0xb1, - 0x82, 0x65, 0x25, 0x18, 0x15, 0x18, 0x35, 0x78, 0x41, 0xdc, 0xe2, 0xa2, 0xe4, 0xcc, 0x02, 0x09, - 0x26, 0x20, 0x97, 0x47, 0x88, 0x9f, 0x8b, 0x1d, 0xc8, 0x2d, 0xc8, 0x2f, 0x2a, 0x91, 0x60, 0x86, - 0xc9, 0xa7, 0x14, 0x97, 0x00, 0xe5, 0x59, 0x60, 0xf2, 0x40, 0x2e, 0x58, 0x9e, 0x15, 0x24, 0x0f, - 0x08, 0x00, 0x00, 0xff, 0xff, 0x83, 0x37, 0xd2, 0x7d, 0x72, 0x00, 0x00, 0x00, +func init() { file_ipconn_proto_init() } +func file_ipconn_proto_init() { + if File_ipconn_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ipconn_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IPConn); 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_ipconn_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ipconn_proto_goTypes, + DependencyIndexes: file_ipconn_proto_depIdxs, + MessageInfos: file_ipconn_proto_msgTypes, + }.Build() + File_ipconn_proto = out.File + file_ipconn_proto_rawDesc = nil + file_ipconn_proto_goTypes = nil + file_ipconn_proto_depIdxs = nil } diff --git a/nmsg_base/linkpair.pb.go b/nmsg_base/linkpair.pb.go index ceb8b0e..011e0b0 100644 --- a/nmsg_base/linkpair.pb.go +++ b/nmsg_base/linkpair.pb.go @@ -1,17 +1,24 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc (unknown) // source: linkpair.proto -// DO NOT EDIT! package nmsg_base -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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 Linktype int32 @@ -20,91 +27,206 @@ const ( Linktype_redirect Linktype = 1 ) -var Linktype_name = map[int32]string{ - 0: "anchor", - 1: "redirect", -} -var Linktype_value = map[string]int32{ - "anchor": 0, - "redirect": 1, -} +// Enum value maps for Linktype. +var ( + Linktype_name = map[int32]string{ + 0: "anchor", + 1: "redirect", + } + Linktype_value = map[string]int32{ + "anchor": 0, + "redirect": 1, + } +) func (x Linktype) Enum() *Linktype { p := new(Linktype) *p = x return p } + func (x Linktype) String() string { - return proto.EnumName(Linktype_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (x *Linktype) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Linktype_value, data, "Linktype") + +func (Linktype) Descriptor() protoreflect.EnumDescriptor { + return file_linkpair_proto_enumTypes[0].Descriptor() +} + +func (Linktype) Type() protoreflect.EnumType { + return &file_linkpair_proto_enumTypes[0] +} + +func (x Linktype) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *Linktype) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = Linktype(value) + *x = Linktype(num) return nil } -func (Linktype) EnumDescriptor() ([]byte, []int) { return fileDescriptor6, []int{0} } + +// Deprecated: Use Linktype.Descriptor instead. +func (Linktype) EnumDescriptor() ([]byte, []int) { + return file_linkpair_proto_rawDescGZIP(), []int{0} +} type Linkpair struct { - Type *Linktype `protobuf:"varint,1,req,name=type,enum=nmsg.base.Linktype" json:"type,omitempty"` - Src []byte `protobuf:"bytes,2,req,name=src" json:"src,omitempty"` - Dst []byte `protobuf:"bytes,3,req,name=dst" json:"dst,omitempty"` - Headers []byte `protobuf:"bytes,5,opt,name=headers" json:"headers,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type *Linktype `protobuf:"varint,1,req,name=type,enum=nmsg.base.Linktype" json:"type,omitempty"` + Src []byte `protobuf:"bytes,2,req,name=src" json:"src,omitempty"` + Dst []byte `protobuf:"bytes,3,req,name=dst" json:"dst,omitempty"` + Headers []byte `protobuf:"bytes,5,opt,name=headers" json:"headers,omitempty"` } -func (m *Linkpair) Reset() { *m = Linkpair{} } -func (m *Linkpair) String() string { return proto.CompactTextString(m) } -func (*Linkpair) ProtoMessage() {} -func (*Linkpair) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{0} } +func (x *Linkpair) Reset() { + *x = Linkpair{} + if protoimpl.UnsafeEnabled { + mi := &file_linkpair_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Linkpair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Linkpair) ProtoMessage() {} + +func (x *Linkpair) ProtoReflect() protoreflect.Message { + mi := &file_linkpair_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 Linkpair.ProtoReflect.Descriptor instead. +func (*Linkpair) Descriptor() ([]byte, []int) { + return file_linkpair_proto_rawDescGZIP(), []int{0} +} -func (m *Linkpair) GetType() Linktype { - if m != nil && m.Type != nil { - return *m.Type +func (x *Linkpair) GetType() Linktype { + if x != nil && x.Type != nil { + return *x.Type } return Linktype_anchor } -func (m *Linkpair) GetSrc() []byte { - if m != nil { - return m.Src +func (x *Linkpair) GetSrc() []byte { + if x != nil { + return x.Src } return nil } -func (m *Linkpair) GetDst() []byte { - if m != nil { - return m.Dst +func (x *Linkpair) GetDst() []byte { + if x != nil { + return x.Dst } return nil } -func (m *Linkpair) GetHeaders() []byte { - if m != nil { - return m.Headers +func (x *Linkpair) GetHeaders() []byte { + if x != nil { + return x.Headers } return nil } -func init() { - proto.RegisterType((*Linkpair)(nil), "nmsg.base.Linkpair") - proto.RegisterEnum("nmsg.base.Linktype", Linktype_name, Linktype_value) +var File_linkpair_proto protoreflect.FileDescriptor + +var file_linkpair_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x6c, 0x69, 0x6e, 0x6b, 0x70, 0x61, 0x69, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x09, 0x6e, 0x6d, 0x73, 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x22, 0x71, 0x0a, 0x08, 0x4c, + 0x69, 0x6e, 0x6b, 0x70, 0x61, 0x69, 0x72, 0x12, 0x27, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x01, 0x20, 0x02, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6e, 0x6d, 0x73, 0x67, 0x2e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x74, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x73, 0x72, 0x63, 0x18, 0x02, 0x20, 0x02, 0x28, 0x0c, 0x52, 0x03, 0x73, + 0x72, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x74, 0x18, 0x03, 0x20, 0x02, 0x28, 0x0c, 0x52, + 0x03, 0x64, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2a, 0x24, + 0x0a, 0x08, 0x4c, 0x69, 0x6e, 0x6b, 0x74, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x61, 0x6e, + 0x63, 0x68, 0x6f, 0x72, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, + 0x63, 0x74, 0x10, 0x01, } -func init() { proto.RegisterFile("linkpair.proto", fileDescriptor6) } +var ( + file_linkpair_proto_rawDescOnce sync.Once + file_linkpair_proto_rawDescData = file_linkpair_proto_rawDesc +) -var fileDescriptor6 = []byte{ - // 149 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0xcb, 0xc9, 0xcc, 0xcb, - 0x2e, 0x48, 0xcc, 0x2c, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcc, 0xcb, 0x2d, 0x4e, - 0xd7, 0x4b, 0x4a, 0x2c, 0x4e, 0x55, 0x8a, 0xe0, 0xe2, 0xf0, 0x81, 0x4a, 0x0a, 0x29, 0x72, 0xb1, - 0x94, 0x54, 0x16, 0xa4, 0x4a, 0x30, 0x2a, 0x30, 0x69, 0xf0, 0x19, 0x09, 0xeb, 0xc1, 0x55, 0xe9, - 0x81, 0x94, 0x80, 0xa4, 0x84, 0xb8, 0xb9, 0x98, 0x8b, 0x8b, 0x92, 0x25, 0x98, 0x80, 0x2a, 0x78, - 0x40, 0x9c, 0x94, 0xe2, 0x12, 0x09, 0x66, 0x30, 0x87, 0x9f, 0x8b, 0x3d, 0x23, 0x35, 0x31, 0x25, - 0xb5, 0xa8, 0x58, 0x82, 0x55, 0x81, 0x51, 0x83, 0x47, 0x4b, 0x05, 0x62, 0x32, 0x58, 0x1b, 0x17, - 0x17, 0x5b, 0x62, 0x5e, 0x72, 0x46, 0x7e, 0x91, 0x00, 0x83, 0x10, 0x0f, 0x17, 0x47, 0x51, 0x6a, - 0x4a, 0x66, 0x51, 0x6a, 0x72, 0x89, 0x00, 0x23, 0x20, 0x00, 0x00, 0xff, 0xff, 0x64, 0x13, 0x33, - 0xdf, 0x9b, 0x00, 0x00, 0x00, +func file_linkpair_proto_rawDescGZIP() []byte { + file_linkpair_proto_rawDescOnce.Do(func() { + file_linkpair_proto_rawDescData = protoimpl.X.CompressGZIP(file_linkpair_proto_rawDescData) + }) + return file_linkpair_proto_rawDescData +} + +var file_linkpair_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_linkpair_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_linkpair_proto_goTypes = []interface{}{ + (Linktype)(0), // 0: nmsg.base.Linktype + (*Linkpair)(nil), // 1: nmsg.base.Linkpair +} +var file_linkpair_proto_depIdxs = []int32{ + 0, // 0: nmsg.base.Linkpair.type:type_name -> nmsg.base.Linktype + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_linkpair_proto_init() } +func file_linkpair_proto_init() { + if File_linkpair_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_linkpair_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Linkpair); 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_linkpair_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_linkpair_proto_goTypes, + DependencyIndexes: file_linkpair_proto_depIdxs, + EnumInfos: file_linkpair_proto_enumTypes, + MessageInfos: file_linkpair_proto_msgTypes, + }.Build() + File_linkpair_proto = out.File + file_linkpair_proto_rawDesc = nil + file_linkpair_proto_goTypes = nil + file_linkpair_proto_depIdxs = nil } diff --git a/nmsg_base/logline.pb.go b/nmsg_base/logline.pb.go index aac48be..fd248f7 100644 --- a/nmsg_base/logline.pb.go +++ b/nmsg_base/logline.pb.go @@ -1,55 +1,150 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc (unknown) // source: logline.proto -// DO NOT EDIT! package nmsg_base -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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 LogLine struct { - Category []byte `protobuf:"bytes,1,opt,name=category" json:"category,omitempty"` - Message []byte `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Category []byte `protobuf:"bytes,1,opt,name=category" json:"category,omitempty"` + Message []byte `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` +} + +func (x *LogLine) Reset() { + *x = LogLine{} + if protoimpl.UnsafeEnabled { + mi := &file_logline_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogLine) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *LogLine) Reset() { *m = LogLine{} } -func (m *LogLine) String() string { return proto.CompactTextString(m) } -func (*LogLine) ProtoMessage() {} -func (*LogLine) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{0} } +func (*LogLine) ProtoMessage() {} -func (m *LogLine) GetCategory() []byte { - if m != nil { - return m.Category +func (x *LogLine) ProtoReflect() protoreflect.Message { + mi := &file_logline_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 LogLine.ProtoReflect.Descriptor instead. +func (*LogLine) Descriptor() ([]byte, []int) { + return file_logline_proto_rawDescGZIP(), []int{0} +} + +func (x *LogLine) GetCategory() []byte { + if x != nil { + return x.Category } return nil } -func (m *LogLine) GetMessage() []byte { - if m != nil { - return m.Message +func (x *LogLine) GetMessage() []byte { + if x != nil { + return x.Message } return nil } -func init() { - proto.RegisterType((*LogLine)(nil), "nmsg.base.LogLine") +var File_logline_proto protoreflect.FileDescriptor + +var file_logline_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x6c, 0x6f, 0x67, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x09, 0x6e, 0x6d, 0x73, 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x22, 0x3f, 0x0a, 0x07, 0x4c, 0x6f, + 0x67, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, + 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, } -func init() { proto.RegisterFile("logline.proto", fileDescriptor7) } +var ( + file_logline_proto_rawDescOnce sync.Once + file_logline_proto_rawDescData = file_logline_proto_rawDesc +) -var fileDescriptor7 = []byte{ - // 93 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0xcd, 0xc9, 0x4f, 0xcf, - 0xc9, 0xcc, 0x4b, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcc, 0xcb, 0x2d, 0x4e, 0xd7, - 0x4b, 0x4a, 0x2c, 0x4e, 0x55, 0xd2, 0xe1, 0x62, 0xf7, 0xc9, 0x4f, 0xf7, 0x01, 0xca, 0x09, 0x09, - 0x70, 0x71, 0x24, 0x27, 0x96, 0xa4, 0xa6, 0xe7, 0x17, 0x55, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0xf0, - 0x08, 0xf1, 0x73, 0xb1, 0xe7, 0xa6, 0x16, 0x17, 0x27, 0xa6, 0xa7, 0x4a, 0x30, 0x81, 0x04, 0x00, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x6e, 0x4e, 0xe7, 0x48, 0x48, 0x00, 0x00, 0x00, +func file_logline_proto_rawDescGZIP() []byte { + file_logline_proto_rawDescOnce.Do(func() { + file_logline_proto_rawDescData = protoimpl.X.CompressGZIP(file_logline_proto_rawDescData) + }) + return file_logline_proto_rawDescData +} + +var file_logline_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_logline_proto_goTypes = []interface{}{ + (*LogLine)(nil), // 0: nmsg.base.LogLine +} +var file_logline_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_logline_proto_init() } +func file_logline_proto_init() { + if File_logline_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_logline_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogLine); 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_logline_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_logline_proto_goTypes, + DependencyIndexes: file_logline_proto_depIdxs, + MessageInfos: file_logline_proto_msgTypes, + }.Build() + File_logline_proto = out.File + file_logline_proto_rawDesc = nil + file_logline_proto_goTypes = nil + file_logline_proto_depIdxs = nil } diff --git a/nmsg_base/ncap.pb.go b/nmsg_base/ncap.pb.go index ea6ee57..b20d347 100644 --- a/nmsg_base/ncap.pb.go +++ b/nmsg_base/ncap.pb.go @@ -1,17 +1,24 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc (unknown) // source: ncap.proto -// DO NOT EDIT! package nmsg_base -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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 NcapType int32 @@ -21,34 +28,56 @@ const ( NcapType_Legacy NcapType = 2 ) -var NcapType_name = map[int32]string{ - 0: "IPV4", - 1: "IPV6", - 2: "Legacy", -} -var NcapType_value = map[string]int32{ - "IPV4": 0, - "IPV6": 1, - "Legacy": 2, -} +// Enum value maps for NcapType. +var ( + NcapType_name = map[int32]string{ + 0: "IPV4", + 1: "IPV6", + 2: "Legacy", + } + NcapType_value = map[string]int32{ + "IPV4": 0, + "IPV6": 1, + "Legacy": 2, + } +) func (x NcapType) Enum() *NcapType { p := new(NcapType) *p = x return p } + func (x NcapType) String() string { - return proto.EnumName(NcapType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (NcapType) Descriptor() protoreflect.EnumDescriptor { + return file_ncap_proto_enumTypes[0].Descriptor() +} + +func (NcapType) Type() protoreflect.EnumType { + return &file_ncap_proto_enumTypes[0] +} + +func (x NcapType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (x *NcapType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(NcapType_value, data, "NcapType") + +// Deprecated: Do not use. +func (x *NcapType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = NcapType(value) + *x = NcapType(num) return nil } -func (NcapType) EnumDescriptor() ([]byte, []int) { return fileDescriptor8, []int{0} } + +// Deprecated: Use NcapType.Descriptor instead. +func (NcapType) EnumDescriptor() ([]byte, []int) { + return file_ncap_proto_rawDescGZIP(), []int{0} +} type NcapLegacyType int32 @@ -58,123 +87,245 @@ const ( NcapLegacyType_Ncap_ICMP NcapLegacyType = 2 ) -var NcapLegacyType_name = map[int32]string{ - 0: "Ncap_UDP", - 1: "Ncap_TCP", - 2: "Ncap_ICMP", -} -var NcapLegacyType_value = map[string]int32{ - "Ncap_UDP": 0, - "Ncap_TCP": 1, - "Ncap_ICMP": 2, -} +// Enum value maps for NcapLegacyType. +var ( + NcapLegacyType_name = map[int32]string{ + 0: "Ncap_UDP", + 1: "Ncap_TCP", + 2: "Ncap_ICMP", + } + NcapLegacyType_value = map[string]int32{ + "Ncap_UDP": 0, + "Ncap_TCP": 1, + "Ncap_ICMP": 2, + } +) func (x NcapLegacyType) Enum() *NcapLegacyType { p := new(NcapLegacyType) *p = x return p } + func (x NcapLegacyType) String() string { - return proto.EnumName(NcapLegacyType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (NcapLegacyType) Descriptor() protoreflect.EnumDescriptor { + return file_ncap_proto_enumTypes[1].Descriptor() +} + +func (NcapLegacyType) Type() protoreflect.EnumType { + return &file_ncap_proto_enumTypes[1] } -func (x *NcapLegacyType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(NcapLegacyType_value, data, "NcapLegacyType") + +func (x NcapLegacyType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *NcapLegacyType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = NcapLegacyType(value) + *x = NcapLegacyType(num) return nil } -func (NcapLegacyType) EnumDescriptor() ([]byte, []int) { return fileDescriptor8, []int{1} } + +// Deprecated: Use NcapLegacyType.Descriptor instead. +func (NcapLegacyType) EnumDescriptor() ([]byte, []int) { + return file_ncap_proto_rawDescGZIP(), []int{1} +} type Ncap struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Type *NcapType `protobuf:"varint,1,req,name=type,enum=nmsg.base.NcapType" json:"type,omitempty"` Payload []byte `protobuf:"bytes,2,req,name=payload" json:"payload,omitempty"` // legacy NCAP fields - Ltype *NcapLegacyType `protobuf:"varint,3,opt,name=ltype,enum=nmsg.base.NcapLegacyType" json:"ltype,omitempty"` - Srcip []byte `protobuf:"bytes,4,opt,name=srcip" json:"srcip,omitempty"` - Dstip []byte `protobuf:"bytes,5,opt,name=dstip" json:"dstip,omitempty"` - Lint0 *uint32 `protobuf:"varint,6,opt,name=lint0" json:"lint0,omitempty"` - Lint1 *uint32 `protobuf:"varint,7,opt,name=lint1" json:"lint1,omitempty"` - XXX_unrecognized []byte `json:"-"` + Ltype *NcapLegacyType `protobuf:"varint,3,opt,name=ltype,enum=nmsg.base.NcapLegacyType" json:"ltype,omitempty"` + Srcip []byte `protobuf:"bytes,4,opt,name=srcip" json:"srcip,omitempty"` + Dstip []byte `protobuf:"bytes,5,opt,name=dstip" json:"dstip,omitempty"` + Lint0 *uint32 `protobuf:"varint,6,opt,name=lint0" json:"lint0,omitempty"` + Lint1 *uint32 `protobuf:"varint,7,opt,name=lint1" json:"lint1,omitempty"` +} + +func (x *Ncap) Reset() { + *x = Ncap{} + if protoimpl.UnsafeEnabled { + mi := &file_ncap_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ncap) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ncap) ProtoMessage() {} + +func (x *Ncap) ProtoReflect() protoreflect.Message { + mi := &file_ncap_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) } -func (m *Ncap) Reset() { *m = Ncap{} } -func (m *Ncap) String() string { return proto.CompactTextString(m) } -func (*Ncap) ProtoMessage() {} -func (*Ncap) Descriptor() ([]byte, []int) { return fileDescriptor8, []int{0} } +// Deprecated: Use Ncap.ProtoReflect.Descriptor instead. +func (*Ncap) Descriptor() ([]byte, []int) { + return file_ncap_proto_rawDescGZIP(), []int{0} +} -func (m *Ncap) GetType() NcapType { - if m != nil && m.Type != nil { - return *m.Type +func (x *Ncap) GetType() NcapType { + if x != nil && x.Type != nil { + return *x.Type } return NcapType_IPV4 } -func (m *Ncap) GetPayload() []byte { - if m != nil { - return m.Payload +func (x *Ncap) GetPayload() []byte { + if x != nil { + return x.Payload } return nil } -func (m *Ncap) GetLtype() NcapLegacyType { - if m != nil && m.Ltype != nil { - return *m.Ltype +func (x *Ncap) GetLtype() NcapLegacyType { + if x != nil && x.Ltype != nil { + return *x.Ltype } return NcapLegacyType_Ncap_UDP } -func (m *Ncap) GetSrcip() []byte { - if m != nil { - return m.Srcip +func (x *Ncap) GetSrcip() []byte { + if x != nil { + return x.Srcip } return nil } -func (m *Ncap) GetDstip() []byte { - if m != nil { - return m.Dstip +func (x *Ncap) GetDstip() []byte { + if x != nil { + return x.Dstip } return nil } -func (m *Ncap) GetLint0() uint32 { - if m != nil && m.Lint0 != nil { - return *m.Lint0 +func (x *Ncap) GetLint0() uint32 { + if x != nil && x.Lint0 != nil { + return *x.Lint0 } return 0 } -func (m *Ncap) GetLint1() uint32 { - if m != nil && m.Lint1 != nil { - return *m.Lint1 +func (x *Ncap) GetLint1() uint32 { + if x != nil && x.Lint1 != nil { + return *x.Lint1 } return 0 } -func init() { - proto.RegisterType((*Ncap)(nil), "nmsg.base.Ncap") - proto.RegisterEnum("nmsg.base.NcapType", NcapType_name, NcapType_value) - proto.RegisterEnum("nmsg.base.NcapLegacyType", NcapLegacyType_name, NcapLegacyType_value) -} - -func init() { proto.RegisterFile("ncap.proto", fileDescriptor8) } - -var fileDescriptor8 = []byte{ - // 218 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0xca, 0x4b, 0x4e, 0x2c, - 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcc, 0xcb, 0x2d, 0x4e, 0xd7, 0x4b, 0x4a, 0x2c, - 0x4e, 0x55, 0x5a, 0xc0, 0xc8, 0xc5, 0xe2, 0x07, 0x94, 0x11, 0x52, 0xe4, 0x62, 0x29, 0xa9, 0x2c, - 0x48, 0x95, 0x60, 0x54, 0x60, 0xd2, 0xe0, 0x33, 0x12, 0xd6, 0x83, 0x2b, 0xd1, 0x03, 0x49, 0x87, - 0x00, 0xa5, 0x84, 0xf8, 0xb9, 0xd8, 0x0b, 0x12, 0x2b, 0x73, 0xf2, 0x13, 0x53, 0x24, 0x98, 0x80, - 0xaa, 0x78, 0x84, 0x34, 0xb8, 0x58, 0x73, 0xc0, 0x9a, 0x98, 0x15, 0x18, 0x81, 0x9a, 0x24, 0xd1, - 0x34, 0xf9, 0xa4, 0xa6, 0x27, 0x26, 0x57, 0x82, 0xb5, 0xf2, 0x72, 0xb1, 0x16, 0x17, 0x25, 0x67, - 0x16, 0x48, 0xb0, 0x00, 0x55, 0xf2, 0x80, 0xb8, 0x29, 0xc5, 0x25, 0x40, 0x2e, 0x2b, 0x8c, 0x9b, - 0x93, 0x99, 0x57, 0x62, 0x20, 0xc1, 0x06, 0xe4, 0xf2, 0xc2, 0xb8, 0x86, 0x12, 0xec, 0x20, 0xae, - 0x96, 0x16, 0x17, 0x07, 0xdc, 0x09, 0x1c, 0x5c, 0x2c, 0x9e, 0x01, 0x61, 0x26, 0x02, 0x0c, 0x50, - 0x96, 0x99, 0x00, 0xa3, 0x10, 0x17, 0x17, 0x1b, 0xc4, 0x26, 0x01, 0x26, 0x2d, 0x6b, 0x2e, 0x3e, - 0x34, 0x9b, 0x79, 0x20, 0xba, 0xe3, 0x43, 0x5d, 0x02, 0x80, 0xba, 0x60, 0xbc, 0x10, 0xe7, 0x00, - 0xa0, 0x4e, 0x5e, 0x2e, 0x4e, 0x30, 0xcf, 0xd3, 0xd9, 0x37, 0x40, 0x80, 0x09, 0x10, 0x00, 0x00, - 0xff, 0xff, 0x36, 0x82, 0xd0, 0xf3, 0x23, 0x01, 0x00, 0x00, +var File_ncap_proto protoreflect.FileDescriptor + +var file_ncap_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x6e, 0x63, 0x61, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6e, 0x6d, + 0x73, 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x22, 0xd2, 0x01, 0x0a, 0x04, 0x4e, 0x63, 0x61, 0x70, + 0x12, 0x27, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x02, 0x28, 0x0e, 0x32, 0x13, + 0x2e, 0x6e, 0x6d, 0x73, 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x4e, 0x63, 0x61, 0x70, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x02, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x12, 0x2f, 0x0a, 0x05, 0x6c, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x6e, 0x6d, 0x73, 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x4e, + 0x63, 0x61, 0x70, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x6c, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x72, 0x63, 0x69, 0x70, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x72, 0x63, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x73, + 0x74, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x64, 0x73, 0x74, 0x69, 0x70, + 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x74, 0x30, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x6c, 0x69, 0x6e, 0x74, 0x30, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x74, 0x31, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x74, 0x31, 0x2a, 0x2a, 0x0a, 0x08, + 0x4e, 0x63, 0x61, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x50, 0x56, 0x34, + 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x50, 0x56, 0x36, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, + 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x10, 0x02, 0x2a, 0x3b, 0x0a, 0x0e, 0x4e, 0x63, 0x61, 0x70, + 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x4e, 0x63, + 0x61, 0x70, 0x5f, 0x55, 0x44, 0x50, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4e, 0x63, 0x61, 0x70, + 0x5f, 0x54, 0x43, 0x50, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x63, 0x61, 0x70, 0x5f, 0x49, + 0x43, 0x4d, 0x50, 0x10, 0x02, +} + +var ( + file_ncap_proto_rawDescOnce sync.Once + file_ncap_proto_rawDescData = file_ncap_proto_rawDesc +) + +func file_ncap_proto_rawDescGZIP() []byte { + file_ncap_proto_rawDescOnce.Do(func() { + file_ncap_proto_rawDescData = protoimpl.X.CompressGZIP(file_ncap_proto_rawDescData) + }) + return file_ncap_proto_rawDescData +} + +var file_ncap_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_ncap_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_ncap_proto_goTypes = []interface{}{ + (NcapType)(0), // 0: nmsg.base.NcapType + (NcapLegacyType)(0), // 1: nmsg.base.NcapLegacyType + (*Ncap)(nil), // 2: nmsg.base.Ncap +} +var file_ncap_proto_depIdxs = []int32{ + 0, // 0: nmsg.base.Ncap.type:type_name -> nmsg.base.NcapType + 1, // 1: nmsg.base.Ncap.ltype:type_name -> nmsg.base.NcapLegacyType + 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_ncap_proto_init() } +func file_ncap_proto_init() { + if File_ncap_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ncap_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ncap); 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_ncap_proto_rawDesc, + NumEnums: 2, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ncap_proto_goTypes, + DependencyIndexes: file_ncap_proto_depIdxs, + EnumInfos: file_ncap_proto_enumTypes, + MessageInfos: file_ncap_proto_msgTypes, + }.Build() + File_ncap_proto = out.File + file_ncap_proto_rawDesc = nil + file_ncap_proto_goTypes = nil + file_ncap_proto_depIdxs = nil } diff --git a/nmsg_base/packet.pb.go b/nmsg_base/packet.pb.go index 51fcc85..fdfc680 100644 --- a/nmsg_base/packet.pb.go +++ b/nmsg_base/packet.pb.go @@ -1,17 +1,24 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc (unknown) // source: packet.proto -// DO NOT EDIT! package nmsg_base -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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 PacketType int32 @@ -23,70 +30,185 @@ const ( PacketType_IP PacketType = 1 ) -var PacketType_name = map[int32]string{ - 1: "IP", -} -var PacketType_value = map[string]int32{ - "IP": 1, -} +// Enum value maps for PacketType. +var ( + PacketType_name = map[int32]string{ + 1: "IP", + } + PacketType_value = map[string]int32{ + "IP": 1, + } +) func (x PacketType) Enum() *PacketType { p := new(PacketType) *p = x return p } + func (x PacketType) String() string { - return proto.EnumName(PacketType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (x *PacketType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(PacketType_value, data, "PacketType") + +func (PacketType) Descriptor() protoreflect.EnumDescriptor { + return file_packet_proto_enumTypes[0].Descriptor() +} + +func (PacketType) Type() protoreflect.EnumType { + return &file_packet_proto_enumTypes[0] +} + +func (x PacketType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *PacketType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = PacketType(value) + *x = PacketType(num) return nil } -func (PacketType) EnumDescriptor() ([]byte, []int) { return fileDescriptor9, []int{0} } + +// Deprecated: Use PacketType.Descriptor instead. +func (PacketType) EnumDescriptor() ([]byte, []int) { + return file_packet_proto_rawDescGZIP(), []int{0} +} type Packet struct { - PayloadType *PacketType `protobuf:"varint,1,req,name=payload_type,enum=nmsg.base.PacketType" json:"payload_type,omitempty"` - Payload []byte `protobuf:"bytes,2,req,name=payload" json:"payload,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PayloadType *PacketType `protobuf:"varint,1,req,name=payload_type,json=payloadType,enum=nmsg.base.PacketType" json:"payload_type,omitempty"` + Payload []byte `protobuf:"bytes,2,req,name=payload" json:"payload,omitempty"` } -func (m *Packet) Reset() { *m = Packet{} } -func (m *Packet) String() string { return proto.CompactTextString(m) } -func (*Packet) ProtoMessage() {} -func (*Packet) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{0} } +func (x *Packet) Reset() { + *x = Packet{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Packet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Packet) ProtoMessage() {} + +func (x *Packet) ProtoReflect() protoreflect.Message { + mi := &file_packet_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 Packet.ProtoReflect.Descriptor instead. +func (*Packet) Descriptor() ([]byte, []int) { + return file_packet_proto_rawDescGZIP(), []int{0} +} -func (m *Packet) GetPayloadType() PacketType { - if m != nil && m.PayloadType != nil { - return *m.PayloadType +func (x *Packet) GetPayloadType() PacketType { + if x != nil && x.PayloadType != nil { + return *x.PayloadType } return PacketType_IP } -func (m *Packet) GetPayload() []byte { - if m != nil { - return m.Payload +func (x *Packet) GetPayload() []byte { + if x != nil { + return x.Payload } return nil } -func init() { - proto.RegisterType((*Packet)(nil), "nmsg.base.Packet") - proto.RegisterEnum("nmsg.base.PacketType", PacketType_name, PacketType_value) +var File_packet_proto protoreflect.FileDescriptor + +var file_packet_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, + 0x6e, 0x6d, 0x73, 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x22, 0x5c, 0x0a, 0x06, 0x50, 0x61, 0x63, + 0x6b, 0x65, 0x74, 0x12, 0x38, 0x0a, 0x0c, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x02, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6e, 0x6d, 0x73, 0x67, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x0b, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x02, 0x28, 0x0c, 0x52, 0x07, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2a, 0x14, 0x0a, 0x0a, 0x50, 0x61, 0x63, 0x6b, 0x65, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x49, 0x50, 0x10, 0x01, } -func init() { proto.RegisterFile("packet.proto", fileDescriptor9) } +var ( + file_packet_proto_rawDescOnce sync.Once + file_packet_proto_rawDescData = file_packet_proto_rawDesc +) -var fileDescriptor9 = []byte{ - // 111 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x48, 0x4c, 0xce, - 0x4e, 0x2d, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcc, 0xcb, 0x2d, 0x4e, 0xd7, 0x4b, - 0x4a, 0x2c, 0x4e, 0x55, 0x72, 0xe3, 0x62, 0x0b, 0x00, 0x4b, 0x09, 0x69, 0x83, 0x14, 0x55, 0xe6, - 0xe4, 0x27, 0xa6, 0xc4, 0x97, 0x54, 0x16, 0xa4, 0x4a, 0x30, 0x2a, 0x30, 0x69, 0xf0, 0x19, 0x89, - 0xea, 0xc1, 0xd5, 0xea, 0x41, 0x14, 0x86, 0x00, 0x25, 0x85, 0xf8, 0xb9, 0xd8, 0xa1, 0x8a, 0x25, - 0x98, 0x80, 0xea, 0x78, 0xb4, 0x44, 0xb8, 0xb8, 0x90, 0xa4, 0xd9, 0xb8, 0x98, 0x3c, 0x03, 0x04, - 0x18, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf6, 0x3e, 0xce, 0x93, 0x77, 0x00, 0x00, 0x00, +func file_packet_proto_rawDescGZIP() []byte { + file_packet_proto_rawDescOnce.Do(func() { + file_packet_proto_rawDescData = protoimpl.X.CompressGZIP(file_packet_proto_rawDescData) + }) + return file_packet_proto_rawDescData +} + +var file_packet_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_packet_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_packet_proto_goTypes = []interface{}{ + (PacketType)(0), // 0: nmsg.base.PacketType + (*Packet)(nil), // 1: nmsg.base.Packet +} +var file_packet_proto_depIdxs = []int32{ + 0, // 0: nmsg.base.Packet.payload_type:type_name -> nmsg.base.PacketType + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_packet_proto_init() } +func file_packet_proto_init() { + if File_packet_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_packet_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Packet); 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_packet_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_packet_proto_goTypes, + DependencyIndexes: file_packet_proto_depIdxs, + EnumInfos: file_packet_proto_enumTypes, + MessageInfos: file_packet_proto_msgTypes, + }.Build() + File_packet_proto = out.File + file_packet_proto_rawDesc = nil + file_packet_proto_goTypes = nil + file_packet_proto_depIdxs = nil } diff --git a/nmsg_base/pkt.pb.go b/nmsg_base/pkt.pb.go index e4466a3..4020972 100644 --- a/nmsg_base/pkt.pb.go +++ b/nmsg_base/pkt.pb.go @@ -1,55 +1,150 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc (unknown) // source: pkt.proto -// DO NOT EDIT! package nmsg_base -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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 Pkt struct { - Payload []byte `protobuf:"bytes,1,req,name=payload" json:"payload,omitempty"` - LenFrame *uint32 `protobuf:"varint,2,opt,name=len_frame" json:"len_frame,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload []byte `protobuf:"bytes,1,req,name=payload" json:"payload,omitempty"` + LenFrame *uint32 `protobuf:"varint,2,opt,name=len_frame,json=lenFrame" json:"len_frame,omitempty"` +} + +func (x *Pkt) Reset() { + *x = Pkt{} + if protoimpl.UnsafeEnabled { + mi := &file_pkt_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Pkt) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Pkt) Reset() { *m = Pkt{} } -func (m *Pkt) String() string { return proto.CompactTextString(m) } -func (*Pkt) ProtoMessage() {} -func (*Pkt) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{0} } +func (*Pkt) ProtoMessage() {} -func (m *Pkt) GetPayload() []byte { - if m != nil { - return m.Payload +func (x *Pkt) ProtoReflect() protoreflect.Message { + mi := &file_pkt_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 Pkt.ProtoReflect.Descriptor instead. +func (*Pkt) Descriptor() ([]byte, []int) { + return file_pkt_proto_rawDescGZIP(), []int{0} +} + +func (x *Pkt) GetPayload() []byte { + if x != nil { + return x.Payload } return nil } -func (m *Pkt) GetLenFrame() uint32 { - if m != nil && m.LenFrame != nil { - return *m.LenFrame +func (x *Pkt) GetLenFrame() uint32 { + if x != nil && x.LenFrame != nil { + return *x.LenFrame } return 0 } -func init() { - proto.RegisterType((*Pkt)(nil), "nmsg.base.Pkt") +var File_pkt_proto protoreflect.FileDescriptor + +var file_pkt_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x70, 0x6b, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6e, 0x6d, 0x73, + 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x22, 0x3c, 0x0a, 0x03, 0x50, 0x6b, 0x74, 0x12, 0x18, 0x0a, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x02, 0x28, 0x0c, 0x52, 0x07, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x65, 0x6e, 0x5f, 0x66, + 0x72, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x6c, 0x65, 0x6e, 0x46, + 0x72, 0x61, 0x6d, 0x65, } -func init() { proto.RegisterFile("pkt.proto", fileDescriptor10) } +var ( + file_pkt_proto_rawDescOnce sync.Once + file_pkt_proto_rawDescData = file_pkt_proto_rawDesc +) -var fileDescriptor10 = []byte{ - // 89 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x2c, 0xc8, 0x2e, 0xd1, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcc, 0xcb, 0x2d, 0x4e, 0xd7, 0x4b, 0x4a, 0x2c, 0x4e, - 0x55, 0xd2, 0xe4, 0x62, 0x0e, 0xc8, 0x2e, 0x11, 0xe2, 0xe7, 0x62, 0x2f, 0x48, 0xac, 0xcc, 0xc9, - 0x4f, 0x4c, 0x91, 0x60, 0x54, 0x60, 0xd2, 0xe0, 0x11, 0x12, 0xe4, 0xe2, 0xcc, 0x49, 0xcd, 0x8b, - 0x4f, 0x2b, 0x4a, 0xcc, 0x4d, 0x95, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x05, 0x04, 0x00, 0x00, 0xff, - 0xff, 0x9d, 0xda, 0xa2, 0xb6, 0x41, 0x00, 0x00, 0x00, +func file_pkt_proto_rawDescGZIP() []byte { + file_pkt_proto_rawDescOnce.Do(func() { + file_pkt_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkt_proto_rawDescData) + }) + return file_pkt_proto_rawDescData +} + +var file_pkt_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_pkt_proto_goTypes = []interface{}{ + (*Pkt)(nil), // 0: nmsg.base.Pkt +} +var file_pkt_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_pkt_proto_init() } +func file_pkt_proto_init() { + if File_pkt_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pkt_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Pkt); 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_pkt_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_pkt_proto_goTypes, + DependencyIndexes: file_pkt_proto_depIdxs, + MessageInfos: file_pkt_proto_msgTypes, + }.Build() + File_pkt_proto = out.File + file_pkt_proto_rawDesc = nil + file_pkt_proto_goTypes = nil + file_pkt_proto_depIdxs = nil } diff --git a/nmsg_base/xml.pb.go b/nmsg_base/xml.pb.go index 5608860..2d60ad9 100644 --- a/nmsg_base/xml.pb.go +++ b/nmsg_base/xml.pb.go @@ -1,55 +1,150 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc (unknown) // source: xml.proto -// DO NOT EDIT! package nmsg_base -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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 Xml struct { - Xmltype []byte `protobuf:"bytes,1,req,name=xmltype" json:"xmltype,omitempty"` - Xmlpayload []byte `protobuf:"bytes,2,req,name=xmlpayload" json:"xmlpayload,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Xmltype []byte `protobuf:"bytes,1,req,name=xmltype" json:"xmltype,omitempty"` + Xmlpayload []byte `protobuf:"bytes,2,req,name=xmlpayload" json:"xmlpayload,omitempty"` +} + +func (x *Xml) Reset() { + *x = Xml{} + if protoimpl.UnsafeEnabled { + mi := &file_xml_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Xml) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Xml) Reset() { *m = Xml{} } -func (m *Xml) String() string { return proto.CompactTextString(m) } -func (*Xml) ProtoMessage() {} -func (*Xml) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{0} } +func (*Xml) ProtoMessage() {} -func (m *Xml) GetXmltype() []byte { - if m != nil { - return m.Xmltype +func (x *Xml) ProtoReflect() protoreflect.Message { + mi := &file_xml_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 Xml.ProtoReflect.Descriptor instead. +func (*Xml) Descriptor() ([]byte, []int) { + return file_xml_proto_rawDescGZIP(), []int{0} +} + +func (x *Xml) GetXmltype() []byte { + if x != nil { + return x.Xmltype } return nil } -func (m *Xml) GetXmlpayload() []byte { - if m != nil { - return m.Xmlpayload +func (x *Xml) GetXmlpayload() []byte { + if x != nil { + return x.Xmlpayload } return nil } -func init() { - proto.RegisterType((*Xml)(nil), "nmsg.base.Xml") +var File_xml_proto protoreflect.FileDescriptor + +var file_xml_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x78, 0x6d, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6e, 0x6d, 0x73, + 0x67, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x22, 0x3f, 0x0a, 0x03, 0x58, 0x6d, 0x6c, 0x12, 0x18, 0x0a, + 0x07, 0x78, 0x6d, 0x6c, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x02, 0x28, 0x0c, 0x52, 0x07, + 0x78, 0x6d, 0x6c, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x78, 0x6d, 0x6c, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x02, 0x28, 0x0c, 0x52, 0x0a, 0x78, 0x6d, 0x6c, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, } -func init() { proto.RegisterFile("xml.proto", fileDescriptor11) } +var ( + file_xml_proto_rawDescOnce sync.Once + file_xml_proto_rawDescData = file_xml_proto_rawDesc +) -var fileDescriptor11 = []byte{ - // 86 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0xac, 0xc8, 0xcd, 0xd1, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcc, 0xcb, 0x2d, 0x4e, 0xd7, 0x4b, 0x4a, 0x2c, 0x4e, - 0x55, 0xd2, 0xe2, 0x62, 0x8e, 0xc8, 0xcd, 0x11, 0xe2, 0xe7, 0x62, 0x07, 0x4a, 0x97, 0x54, 0x16, - 0xa4, 0x4a, 0x30, 0x2a, 0x30, 0x69, 0xf0, 0x08, 0x09, 0x71, 0x71, 0x01, 0x05, 0x0a, 0x12, 0x2b, - 0x73, 0xf2, 0x13, 0x53, 0x24, 0x98, 0x40, 0x62, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb0, 0x92, - 0x10, 0x81, 0x42, 0x00, 0x00, 0x00, +func file_xml_proto_rawDescGZIP() []byte { + file_xml_proto_rawDescOnce.Do(func() { + file_xml_proto_rawDescData = protoimpl.X.CompressGZIP(file_xml_proto_rawDescData) + }) + return file_xml_proto_rawDescData +} + +var file_xml_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_xml_proto_goTypes = []interface{}{ + (*Xml)(nil), // 0: nmsg.base.Xml +} +var file_xml_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_xml_proto_init() } +func file_xml_proto_init() { + if File_xml_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_xml_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Xml); 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_xml_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_xml_proto_goTypes, + DependencyIndexes: file_xml_proto_depIdxs, + MessageInfos: file_xml_proto_msgTypes, + }.Build() + File_xml_proto = out.File + file_xml_proto_rawDesc = nil + file_xml_proto_goTypes = nil + file_xml_proto_depIdxs = nil } diff --git a/payload.go b/payload.go index 70180bb..3f43c67 100644 --- a/payload.go +++ b/payload.go @@ -12,7 +12,7 @@ import ( "encoding/binary" "time" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // Payload encapsulates an nmsg message in a NmsgPayload, suitable for sending to