Пристрій сам каже, що він таке, і шаблон чіпляється без натискань. Системна група знімається тією ж SNMP-сесією, що й обхід топології: три зайві PDU дешевші за окремий чек із власним розкладом. Збіг за префіксом на межі компонента: моделей у виробника тисячі, і повний збіг означав би рядок на кожну коробку. Довший префікс перемагає. Дванадцять вбудованих правил на основних виробників. Шаблони тільки додаються, ніколи не знімаються: автоматика знає модель пристрою, але не знає, чому цьому хосту дали ще один шаблон руками. DiscoveredDevice отримав device_id: зіставляти за адресою не можна — за одним NAT кілька хостів мають ту саму адресу опитування. Заразом дубль перевірки перестав давати «внутрішню помилку». Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
813 lines
27 KiB
Go
813 lines
27 KiB
Go
// =====================================================================
|
||
// NetPulse :: discovery.proto
|
||
// Автовиявлення сусідів (LLDP/CDP/ARP/FDB) та інвентаризація інтерфейсів.
|
||
//
|
||
// Агент НЕ вирішує, хто з ким з'єднаний. Він доповідає сире:
|
||
// "на порту X я бачу chassis-id Y, port-id Z". Резолвер на сервері
|
||
// зводить це в topo.links і виставляє confidence. Так автовиявлення
|
||
// лишається відтворюваним і не залежить від версії агента.
|
||
// =====================================================================
|
||
|
||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||
// versions:
|
||
// protoc-gen-go v1.36.12
|
||
// protoc (unknown)
|
||
// source: netpulse/v1/discovery.proto
|
||
|
||
package netpulsev1
|
||
|
||
import (
|
||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||
reflect "reflect"
|
||
sync "sync"
|
||
unsafe "unsafe"
|
||
)
|
||
|
||
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 NeighborRecord struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
// Пристрій, який доповідає (той, що ми опитали).
|
||
DeviceId string `protobuf:"bytes,1,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
|
||
// Локальний порт. Якщо агент ще не знає interface_id — заповнює
|
||
// local_if_index/local_port_name, і сервер резолвить сам.
|
||
LocalInterfaceId string `protobuf:"bytes,2,opt,name=local_interface_id,json=localInterfaceId,proto3" json:"local_interface_id,omitempty"`
|
||
LocalIfIndex int64 `protobuf:"varint,3,opt,name=local_if_index,json=localIfIndex,proto3" json:"local_if_index,omitempty"`
|
||
LocalPortName string `protobuf:"bytes,4,opt,name=local_port_name,json=localPortName,proto3" json:"local_port_name,omitempty"`
|
||
Proto DiscoveryProto `protobuf:"varint,5,opt,name=proto,proto3,enum=netpulse.v1.DiscoveryProto" json:"proto,omitempty"`
|
||
// Те, що видно з іншого боку. Порожні поля — норма: CDP не дає
|
||
// chassis_id у форматі LLDP, ARP не дає port_id взагалі.
|
||
RemoteChassisId string `protobuf:"bytes,6,opt,name=remote_chassis_id,json=remoteChassisId,proto3" json:"remote_chassis_id,omitempty"`
|
||
RemoteSystemName string `protobuf:"bytes,7,opt,name=remote_system_name,json=remoteSystemName,proto3" json:"remote_system_name,omitempty"`
|
||
RemotePortId string `protobuf:"bytes,8,opt,name=remote_port_id,json=remotePortId,proto3" json:"remote_port_id,omitempty"`
|
||
RemotePortDescr string `protobuf:"bytes,9,opt,name=remote_port_descr,json=remotePortDescr,proto3" json:"remote_port_descr,omitempty"`
|
||
RemoteMgmtIp string `protobuf:"bytes,10,opt,name=remote_mgmt_ip,json=remoteMgmtIp,proto3" json:"remote_mgmt_ip,omitempty"`
|
||
RemoteMac string `protobuf:"bytes,11,opt,name=remote_mac,json=remoteMac,proto3" json:"remote_mac,omitempty"`
|
||
RemotePlatform string `protobuf:"bytes,12,opt,name=remote_platform,json=remotePlatform,proto3" json:"remote_platform,omitempty"`
|
||
RemoteCapabilities []string `protobuf:"bytes,13,rep,name=remote_capabilities,json=remoteCapabilities,proto3" json:"remote_capabilities,omitempty"` // bridge, router, wlan-ap
|
||
SeenAt *timestamppb.Timestamp `protobuf:"bytes,14,opt,name=seen_at,json=seenAt,proto3" json:"seen_at,omitempty"`
|
||
// Сирий запис як його віддав пристрій — для розбору спірних випадків.
|
||
RawJson []byte `protobuf:"bytes,15,opt,name=raw_json,json=rawJson,proto3" json:"raw_json,omitempty"`
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *NeighborRecord) Reset() {
|
||
*x = NeighborRecord{}
|
||
mi := &file_netpulse_v1_discovery_proto_msgTypes[0]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *NeighborRecord) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*NeighborRecord) ProtoMessage() {}
|
||
|
||
func (x *NeighborRecord) ProtoReflect() protoreflect.Message {
|
||
mi := &file_netpulse_v1_discovery_proto_msgTypes[0]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use NeighborRecord.ProtoReflect.Descriptor instead.
|
||
func (*NeighborRecord) Descriptor() ([]byte, []int) {
|
||
return file_netpulse_v1_discovery_proto_rawDescGZIP(), []int{0}
|
||
}
|
||
|
||
func (x *NeighborRecord) GetDeviceId() string {
|
||
if x != nil {
|
||
return x.DeviceId
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *NeighborRecord) GetLocalInterfaceId() string {
|
||
if x != nil {
|
||
return x.LocalInterfaceId
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *NeighborRecord) GetLocalIfIndex() int64 {
|
||
if x != nil {
|
||
return x.LocalIfIndex
|
||
}
|
||
return 0
|
||
}
|
||
|
||
func (x *NeighborRecord) GetLocalPortName() string {
|
||
if x != nil {
|
||
return x.LocalPortName
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *NeighborRecord) GetProto() DiscoveryProto {
|
||
if x != nil {
|
||
return x.Proto
|
||
}
|
||
return DiscoveryProto_DISCOVERY_PROTO_UNSPECIFIED
|
||
}
|
||
|
||
func (x *NeighborRecord) GetRemoteChassisId() string {
|
||
if x != nil {
|
||
return x.RemoteChassisId
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *NeighborRecord) GetRemoteSystemName() string {
|
||
if x != nil {
|
||
return x.RemoteSystemName
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *NeighborRecord) GetRemotePortId() string {
|
||
if x != nil {
|
||
return x.RemotePortId
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *NeighborRecord) GetRemotePortDescr() string {
|
||
if x != nil {
|
||
return x.RemotePortDescr
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *NeighborRecord) GetRemoteMgmtIp() string {
|
||
if x != nil {
|
||
return x.RemoteMgmtIp
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *NeighborRecord) GetRemoteMac() string {
|
||
if x != nil {
|
||
return x.RemoteMac
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *NeighborRecord) GetRemotePlatform() string {
|
||
if x != nil {
|
||
return x.RemotePlatform
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *NeighborRecord) GetRemoteCapabilities() []string {
|
||
if x != nil {
|
||
return x.RemoteCapabilities
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *NeighborRecord) GetSeenAt() *timestamppb.Timestamp {
|
||
if x != nil {
|
||
return x.SeenAt
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *NeighborRecord) GetRawJson() []byte {
|
||
if x != nil {
|
||
return x.RawJson
|
||
}
|
||
return nil
|
||
}
|
||
|
||
type InterfaceRecord struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
DeviceId string `protobuf:"bytes,1,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
|
||
IfIndex int64 `protobuf:"varint,2,opt,name=if_index,json=ifIndex,proto3" json:"if_index,omitempty"`
|
||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||
Alias string `protobuf:"bytes,4,opt,name=alias,proto3" json:"alias,omitempty"`
|
||
Mac string `protobuf:"bytes,5,opt,name=mac,proto3" json:"mac,omitempty"`
|
||
Mtu uint32 `protobuf:"varint,6,opt,name=mtu,proto3" json:"mtu,omitempty"`
|
||
Type string `protobuf:"bytes,7,opt,name=type,proto3" json:"type,omitempty"` // ethernetCsmacd, ieee8023adLag, l3ipvlan
|
||
SpeedBps uint64 `protobuf:"varint,8,opt,name=speed_bps,json=speedBps,proto3" json:"speed_bps,omitempty"`
|
||
Duplex string `protobuf:"bytes,9,opt,name=duplex,proto3" json:"duplex,omitempty"`
|
||
AdminStatus string `protobuf:"bytes,10,opt,name=admin_status,json=adminStatus,proto3" json:"admin_status,omitempty"` // up | down | testing | unknown
|
||
OperStatus string `protobuf:"bytes,11,opt,name=oper_status,json=operStatus,proto3" json:"oper_status,omitempty"`
|
||
ParentIfIndex int64 `protobuf:"varint,12,opt,name=parent_if_index,json=parentIfIndex,proto3" json:"parent_if_index,omitempty"` // для членів LAG
|
||
IpAddresses []string `protobuf:"bytes,13,rep,name=ip_addresses,json=ipAddresses,proto3" json:"ip_addresses,omitempty"` // CIDR: 10.0.0.1/24
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *InterfaceRecord) Reset() {
|
||
*x = InterfaceRecord{}
|
||
mi := &file_netpulse_v1_discovery_proto_msgTypes[1]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *InterfaceRecord) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*InterfaceRecord) ProtoMessage() {}
|
||
|
||
func (x *InterfaceRecord) ProtoReflect() protoreflect.Message {
|
||
mi := &file_netpulse_v1_discovery_proto_msgTypes[1]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use InterfaceRecord.ProtoReflect.Descriptor instead.
|
||
func (*InterfaceRecord) Descriptor() ([]byte, []int) {
|
||
return file_netpulse_v1_discovery_proto_rawDescGZIP(), []int{1}
|
||
}
|
||
|
||
func (x *InterfaceRecord) GetDeviceId() string {
|
||
if x != nil {
|
||
return x.DeviceId
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *InterfaceRecord) GetIfIndex() int64 {
|
||
if x != nil {
|
||
return x.IfIndex
|
||
}
|
||
return 0
|
||
}
|
||
|
||
func (x *InterfaceRecord) GetName() string {
|
||
if x != nil {
|
||
return x.Name
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *InterfaceRecord) GetAlias() string {
|
||
if x != nil {
|
||
return x.Alias
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *InterfaceRecord) GetMac() string {
|
||
if x != nil {
|
||
return x.Mac
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *InterfaceRecord) GetMtu() uint32 {
|
||
if x != nil {
|
||
return x.Mtu
|
||
}
|
||
return 0
|
||
}
|
||
|
||
func (x *InterfaceRecord) GetType() string {
|
||
if x != nil {
|
||
return x.Type
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *InterfaceRecord) GetSpeedBps() uint64 {
|
||
if x != nil {
|
||
return x.SpeedBps
|
||
}
|
||
return 0
|
||
}
|
||
|
||
func (x *InterfaceRecord) GetDuplex() string {
|
||
if x != nil {
|
||
return x.Duplex
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *InterfaceRecord) GetAdminStatus() string {
|
||
if x != nil {
|
||
return x.AdminStatus
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *InterfaceRecord) GetOperStatus() string {
|
||
if x != nil {
|
||
return x.OperStatus
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *InterfaceRecord) GetParentIfIndex() int64 {
|
||
if x != nil {
|
||
return x.ParentIfIndex
|
||
}
|
||
return 0
|
||
}
|
||
|
||
func (x *InterfaceRecord) GetIpAddresses() []string {
|
||
if x != nil {
|
||
return x.IpAddresses
|
||
}
|
||
return nil
|
||
}
|
||
|
||
type DiscoveredDevice struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
|
||
Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"`
|
||
Mac string `protobuf:"bytes,3,opt,name=mac,proto3" json:"mac,omitempty"`
|
||
SysName string `protobuf:"bytes,4,opt,name=sys_name,json=sysName,proto3" json:"sys_name,omitempty"`
|
||
SysDescr string `protobuf:"bytes,5,opt,name=sys_descr,json=sysDescr,proto3" json:"sys_descr,omitempty"`
|
||
SysObjectId string `protobuf:"bytes,6,opt,name=sys_object_id,json=sysObjectId,proto3" json:"sys_object_id,omitempty"`
|
||
Vendor string `protobuf:"bytes,7,opt,name=vendor,proto3" json:"vendor,omitempty"`
|
||
Model string `protobuf:"bytes,8,opt,name=model,proto3" json:"model,omitempty"`
|
||
// Які транспорти відповіли під час сканування.
|
||
ReachableVia []Transport `protobuf:"varint,9,rep,packed,name=reachable_via,json=reachableVia,proto3,enum=netpulse.v1.Transport" json:"reachable_via,omitempty"`
|
||
// Здогад агента про тип пристрою — сервер може перевизначити.
|
||
GuessedKind string `protobuf:"bytes,10,opt,name=guessed_kind,json=guessedKind,proto3" json:"guessed_kind,omitempty"`
|
||
SeenAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=seen_at,json=seenAt,proto3" json:"seen_at,omitempty"`
|
||
// Заповнене, якщо це не знахідка сканування, а системна інформація
|
||
// про вже відомий хост. Адреси для зіставлення мало: за одним NAT
|
||
// цілком може стояти кілька хостів з тією самою адресою опитування.
|
||
DeviceId string `protobuf:"bytes,12,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *DiscoveredDevice) Reset() {
|
||
*x = DiscoveredDevice{}
|
||
mi := &file_netpulse_v1_discovery_proto_msgTypes[2]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *DiscoveredDevice) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*DiscoveredDevice) ProtoMessage() {}
|
||
|
||
func (x *DiscoveredDevice) ProtoReflect() protoreflect.Message {
|
||
mi := &file_netpulse_v1_discovery_proto_msgTypes[2]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use DiscoveredDevice.ProtoReflect.Descriptor instead.
|
||
func (*DiscoveredDevice) Descriptor() ([]byte, []int) {
|
||
return file_netpulse_v1_discovery_proto_rawDescGZIP(), []int{2}
|
||
}
|
||
|
||
func (x *DiscoveredDevice) GetAddress() string {
|
||
if x != nil {
|
||
return x.Address
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *DiscoveredDevice) GetHostname() string {
|
||
if x != nil {
|
||
return x.Hostname
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *DiscoveredDevice) GetMac() string {
|
||
if x != nil {
|
||
return x.Mac
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *DiscoveredDevice) GetSysName() string {
|
||
if x != nil {
|
||
return x.SysName
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *DiscoveredDevice) GetSysDescr() string {
|
||
if x != nil {
|
||
return x.SysDescr
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *DiscoveredDevice) GetSysObjectId() string {
|
||
if x != nil {
|
||
return x.SysObjectId
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *DiscoveredDevice) GetVendor() string {
|
||
if x != nil {
|
||
return x.Vendor
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *DiscoveredDevice) GetModel() string {
|
||
if x != nil {
|
||
return x.Model
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *DiscoveredDevice) GetReachableVia() []Transport {
|
||
if x != nil {
|
||
return x.ReachableVia
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *DiscoveredDevice) GetGuessedKind() string {
|
||
if x != nil {
|
||
return x.GuessedKind
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *DiscoveredDevice) GetSeenAt() *timestamppb.Timestamp {
|
||
if x != nil {
|
||
return x.SeenAt
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *DiscoveredDevice) GetDeviceId() string {
|
||
if x != nil {
|
||
return x.DeviceId
|
||
}
|
||
return ""
|
||
}
|
||
|
||
type DiscoveryReport struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
|
||
// Порожній, якщо це фонове періодичне виявлення, а не запуск із UI.
|
||
RunId string `protobuf:"bytes,2,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"`
|
||
Neighbors []*NeighborRecord `protobuf:"bytes,3,rep,name=neighbors,proto3" json:"neighbors,omitempty"`
|
||
Interfaces []*InterfaceRecord `protobuf:"bytes,4,rep,name=interfaces,proto3" json:"interfaces,omitempty"`
|
||
Devices []*DiscoveredDevice `protobuf:"bytes,5,rep,name=devices,proto3" json:"devices,omitempty"`
|
||
// Звіт розбитий на частини: сервер має чекати final = true,
|
||
// перш ніж закривати run і чистити застарілих сусідів.
|
||
Final bool `protobuf:"varint,6,opt,name=final,proto3" json:"final,omitempty"`
|
||
Part uint32 `protobuf:"varint,7,opt,name=part,proto3" json:"part,omitempty"`
|
||
StartedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"`
|
||
FinishedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=finished_at,json=finishedAt,proto3" json:"finished_at,omitempty"`
|
||
Errors []*Error `protobuf:"bytes,10,rep,name=errors,proto3" json:"errors,omitempty"`
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *DiscoveryReport) Reset() {
|
||
*x = DiscoveryReport{}
|
||
mi := &file_netpulse_v1_discovery_proto_msgTypes[3]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *DiscoveryReport) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*DiscoveryReport) ProtoMessage() {}
|
||
|
||
func (x *DiscoveryReport) ProtoReflect() protoreflect.Message {
|
||
mi := &file_netpulse_v1_discovery_proto_msgTypes[3]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use DiscoveryReport.ProtoReflect.Descriptor instead.
|
||
func (*DiscoveryReport) Descriptor() ([]byte, []int) {
|
||
return file_netpulse_v1_discovery_proto_rawDescGZIP(), []int{3}
|
||
}
|
||
|
||
func (x *DiscoveryReport) GetAgentId() string {
|
||
if x != nil {
|
||
return x.AgentId
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *DiscoveryReport) GetRunId() string {
|
||
if x != nil {
|
||
return x.RunId
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *DiscoveryReport) GetNeighbors() []*NeighborRecord {
|
||
if x != nil {
|
||
return x.Neighbors
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *DiscoveryReport) GetInterfaces() []*InterfaceRecord {
|
||
if x != nil {
|
||
return x.Interfaces
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *DiscoveryReport) GetDevices() []*DiscoveredDevice {
|
||
if x != nil {
|
||
return x.Devices
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *DiscoveryReport) GetFinal() bool {
|
||
if x != nil {
|
||
return x.Final
|
||
}
|
||
return false
|
||
}
|
||
|
||
func (x *DiscoveryReport) GetPart() uint32 {
|
||
if x != nil {
|
||
return x.Part
|
||
}
|
||
return 0
|
||
}
|
||
|
||
func (x *DiscoveryReport) GetStartedAt() *timestamppb.Timestamp {
|
||
if x != nil {
|
||
return x.StartedAt
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *DiscoveryReport) GetFinishedAt() *timestamppb.Timestamp {
|
||
if x != nil {
|
||
return x.FinishedAt
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *DiscoveryReport) GetErrors() []*Error {
|
||
if x != nil {
|
||
return x.Errors
|
||
}
|
||
return nil
|
||
}
|
||
|
||
type DiscoveryAck struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
Accepted bool `protobuf:"varint,1,opt,name=accepted,proto3" json:"accepted,omitempty"`
|
||
// Скільки записів сервер зміг зіставити з інвентарем.
|
||
NeighborsResolved uint32 `protobuf:"varint,2,opt,name=neighbors_resolved,json=neighborsResolved,proto3" json:"neighbors_resolved,omitempty"`
|
||
LinksCreated uint32 `protobuf:"varint,3,opt,name=links_created,json=linksCreated,proto3" json:"links_created,omitempty"`
|
||
DevicesCreated uint32 `protobuf:"varint,4,opt,name=devices_created,json=devicesCreated,proto3" json:"devices_created,omitempty"`
|
||
Error *Error `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"`
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *DiscoveryAck) Reset() {
|
||
*x = DiscoveryAck{}
|
||
mi := &file_netpulse_v1_discovery_proto_msgTypes[4]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *DiscoveryAck) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*DiscoveryAck) ProtoMessage() {}
|
||
|
||
func (x *DiscoveryAck) ProtoReflect() protoreflect.Message {
|
||
mi := &file_netpulse_v1_discovery_proto_msgTypes[4]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use DiscoveryAck.ProtoReflect.Descriptor instead.
|
||
func (*DiscoveryAck) Descriptor() ([]byte, []int) {
|
||
return file_netpulse_v1_discovery_proto_rawDescGZIP(), []int{4}
|
||
}
|
||
|
||
func (x *DiscoveryAck) GetAccepted() bool {
|
||
if x != nil {
|
||
return x.Accepted
|
||
}
|
||
return false
|
||
}
|
||
|
||
func (x *DiscoveryAck) GetNeighborsResolved() uint32 {
|
||
if x != nil {
|
||
return x.NeighborsResolved
|
||
}
|
||
return 0
|
||
}
|
||
|
||
func (x *DiscoveryAck) GetLinksCreated() uint32 {
|
||
if x != nil {
|
||
return x.LinksCreated
|
||
}
|
||
return 0
|
||
}
|
||
|
||
func (x *DiscoveryAck) GetDevicesCreated() uint32 {
|
||
if x != nil {
|
||
return x.DevicesCreated
|
||
}
|
||
return 0
|
||
}
|
||
|
||
func (x *DiscoveryAck) GetError() *Error {
|
||
if x != nil {
|
||
return x.Error
|
||
}
|
||
return nil
|
||
}
|
||
|
||
var File_netpulse_v1_discovery_proto protoreflect.FileDescriptor
|
||
|
||
const file_netpulse_v1_discovery_proto_rawDesc = "" +
|
||
"\n" +
|
||
"\x1bnetpulse/v1/discovery.proto\x12\vnetpulse.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x18netpulse/v1/common.proto\"\xf7\x04\n" +
|
||
"\x0eNeighborRecord\x12\x1b\n" +
|
||
"\tdevice_id\x18\x01 \x01(\tR\bdeviceId\x12,\n" +
|
||
"\x12local_interface_id\x18\x02 \x01(\tR\x10localInterfaceId\x12$\n" +
|
||
"\x0elocal_if_index\x18\x03 \x01(\x03R\flocalIfIndex\x12&\n" +
|
||
"\x0flocal_port_name\x18\x04 \x01(\tR\rlocalPortName\x121\n" +
|
||
"\x05proto\x18\x05 \x01(\x0e2\x1b.netpulse.v1.DiscoveryProtoR\x05proto\x12*\n" +
|
||
"\x11remote_chassis_id\x18\x06 \x01(\tR\x0fremoteChassisId\x12,\n" +
|
||
"\x12remote_system_name\x18\a \x01(\tR\x10remoteSystemName\x12$\n" +
|
||
"\x0eremote_port_id\x18\b \x01(\tR\fremotePortId\x12*\n" +
|
||
"\x11remote_port_descr\x18\t \x01(\tR\x0fremotePortDescr\x12$\n" +
|
||
"\x0eremote_mgmt_ip\x18\n" +
|
||
" \x01(\tR\fremoteMgmtIp\x12\x1d\n" +
|
||
"\n" +
|
||
"remote_mac\x18\v \x01(\tR\tremoteMac\x12'\n" +
|
||
"\x0fremote_platform\x18\f \x01(\tR\x0eremotePlatform\x12/\n" +
|
||
"\x13remote_capabilities\x18\r \x03(\tR\x12remoteCapabilities\x123\n" +
|
||
"\aseen_at\x18\x0e \x01(\v2\x1a.google.protobuf.TimestampR\x06seenAt\x12\x19\n" +
|
||
"\braw_json\x18\x0f \x01(\fR\arawJson\"\xef\x02\n" +
|
||
"\x0fInterfaceRecord\x12\x1b\n" +
|
||
"\tdevice_id\x18\x01 \x01(\tR\bdeviceId\x12\x19\n" +
|
||
"\bif_index\x18\x02 \x01(\x03R\aifIndex\x12\x12\n" +
|
||
"\x04name\x18\x03 \x01(\tR\x04name\x12\x14\n" +
|
||
"\x05alias\x18\x04 \x01(\tR\x05alias\x12\x10\n" +
|
||
"\x03mac\x18\x05 \x01(\tR\x03mac\x12\x10\n" +
|
||
"\x03mtu\x18\x06 \x01(\rR\x03mtu\x12\x12\n" +
|
||
"\x04type\x18\a \x01(\tR\x04type\x12\x1b\n" +
|
||
"\tspeed_bps\x18\b \x01(\x04R\bspeedBps\x12\x16\n" +
|
||
"\x06duplex\x18\t \x01(\tR\x06duplex\x12!\n" +
|
||
"\fadmin_status\x18\n" +
|
||
" \x01(\tR\vadminStatus\x12\x1f\n" +
|
||
"\voper_status\x18\v \x01(\tR\n" +
|
||
"operStatus\x12&\n" +
|
||
"\x0fparent_if_index\x18\f \x01(\x03R\rparentIfIndex\x12!\n" +
|
||
"\fip_addresses\x18\r \x03(\tR\vipAddresses\"\x96\x03\n" +
|
||
"\x10DiscoveredDevice\x12\x18\n" +
|
||
"\aaddress\x18\x01 \x01(\tR\aaddress\x12\x1a\n" +
|
||
"\bhostname\x18\x02 \x01(\tR\bhostname\x12\x10\n" +
|
||
"\x03mac\x18\x03 \x01(\tR\x03mac\x12\x19\n" +
|
||
"\bsys_name\x18\x04 \x01(\tR\asysName\x12\x1b\n" +
|
||
"\tsys_descr\x18\x05 \x01(\tR\bsysDescr\x12\"\n" +
|
||
"\rsys_object_id\x18\x06 \x01(\tR\vsysObjectId\x12\x16\n" +
|
||
"\x06vendor\x18\a \x01(\tR\x06vendor\x12\x14\n" +
|
||
"\x05model\x18\b \x01(\tR\x05model\x12;\n" +
|
||
"\rreachable_via\x18\t \x03(\x0e2\x16.netpulse.v1.TransportR\freachableVia\x12!\n" +
|
||
"\fguessed_kind\x18\n" +
|
||
" \x01(\tR\vguessedKind\x123\n" +
|
||
"\aseen_at\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\x06seenAt\x12\x1b\n" +
|
||
"\tdevice_id\x18\f \x01(\tR\bdeviceId\"\xc3\x03\n" +
|
||
"\x0fDiscoveryReport\x12\x19\n" +
|
||
"\bagent_id\x18\x01 \x01(\tR\aagentId\x12\x15\n" +
|
||
"\x06run_id\x18\x02 \x01(\tR\x05runId\x129\n" +
|
||
"\tneighbors\x18\x03 \x03(\v2\x1b.netpulse.v1.NeighborRecordR\tneighbors\x12<\n" +
|
||
"\n" +
|
||
"interfaces\x18\x04 \x03(\v2\x1c.netpulse.v1.InterfaceRecordR\n" +
|
||
"interfaces\x127\n" +
|
||
"\adevices\x18\x05 \x03(\v2\x1d.netpulse.v1.DiscoveredDeviceR\adevices\x12\x14\n" +
|
||
"\x05final\x18\x06 \x01(\bR\x05final\x12\x12\n" +
|
||
"\x04part\x18\a \x01(\rR\x04part\x129\n" +
|
||
"\n" +
|
||
"started_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\tstartedAt\x12;\n" +
|
||
"\vfinished_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\n" +
|
||
"finishedAt\x12*\n" +
|
||
"\x06errors\x18\n" +
|
||
" \x03(\v2\x12.netpulse.v1.ErrorR\x06errors\"\xd1\x01\n" +
|
||
"\fDiscoveryAck\x12\x1a\n" +
|
||
"\baccepted\x18\x01 \x01(\bR\baccepted\x12-\n" +
|
||
"\x12neighbors_resolved\x18\x02 \x01(\rR\x11neighborsResolved\x12#\n" +
|
||
"\rlinks_created\x18\x03 \x01(\rR\flinksCreated\x12'\n" +
|
||
"\x0fdevices_created\x18\x04 \x01(\rR\x0edevicesCreated\x12(\n" +
|
||
"\x05error\x18\x05 \x01(\v2\x12.netpulse.v1.ErrorR\x05errorB\xaa\x01\n" +
|
||
"\x0fcom.netpulse.v1B\x0eDiscoveryProtoP\x01Z:github.com/netpulse/netpulse/gen/go/netpulse/v1;netpulsev1\xa2\x02\x03NXX\xaa\x02\vNetpulse.V1\xca\x02\vNetpulse\\V1\xe2\x02\x17Netpulse\\V1\\GPBMetadata\xea\x02\fNetpulse::V1b\x06proto3"
|
||
|
||
var (
|
||
file_netpulse_v1_discovery_proto_rawDescOnce sync.Once
|
||
file_netpulse_v1_discovery_proto_rawDescData []byte
|
||
)
|
||
|
||
func file_netpulse_v1_discovery_proto_rawDescGZIP() []byte {
|
||
file_netpulse_v1_discovery_proto_rawDescOnce.Do(func() {
|
||
file_netpulse_v1_discovery_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_netpulse_v1_discovery_proto_rawDesc), len(file_netpulse_v1_discovery_proto_rawDesc)))
|
||
})
|
||
return file_netpulse_v1_discovery_proto_rawDescData
|
||
}
|
||
|
||
var file_netpulse_v1_discovery_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||
var file_netpulse_v1_discovery_proto_goTypes = []any{
|
||
(*NeighborRecord)(nil), // 0: netpulse.v1.NeighborRecord
|
||
(*InterfaceRecord)(nil), // 1: netpulse.v1.InterfaceRecord
|
||
(*DiscoveredDevice)(nil), // 2: netpulse.v1.DiscoveredDevice
|
||
(*DiscoveryReport)(nil), // 3: netpulse.v1.DiscoveryReport
|
||
(*DiscoveryAck)(nil), // 4: netpulse.v1.DiscoveryAck
|
||
(DiscoveryProto)(0), // 5: netpulse.v1.DiscoveryProto
|
||
(*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp
|
||
(Transport)(0), // 7: netpulse.v1.Transport
|
||
(*Error)(nil), // 8: netpulse.v1.Error
|
||
}
|
||
var file_netpulse_v1_discovery_proto_depIdxs = []int32{
|
||
5, // 0: netpulse.v1.NeighborRecord.proto:type_name -> netpulse.v1.DiscoveryProto
|
||
6, // 1: netpulse.v1.NeighborRecord.seen_at:type_name -> google.protobuf.Timestamp
|
||
7, // 2: netpulse.v1.DiscoveredDevice.reachable_via:type_name -> netpulse.v1.Transport
|
||
6, // 3: netpulse.v1.DiscoveredDevice.seen_at:type_name -> google.protobuf.Timestamp
|
||
0, // 4: netpulse.v1.DiscoveryReport.neighbors:type_name -> netpulse.v1.NeighborRecord
|
||
1, // 5: netpulse.v1.DiscoveryReport.interfaces:type_name -> netpulse.v1.InterfaceRecord
|
||
2, // 6: netpulse.v1.DiscoveryReport.devices:type_name -> netpulse.v1.DiscoveredDevice
|
||
6, // 7: netpulse.v1.DiscoveryReport.started_at:type_name -> google.protobuf.Timestamp
|
||
6, // 8: netpulse.v1.DiscoveryReport.finished_at:type_name -> google.protobuf.Timestamp
|
||
8, // 9: netpulse.v1.DiscoveryReport.errors:type_name -> netpulse.v1.Error
|
||
8, // 10: netpulse.v1.DiscoveryAck.error:type_name -> netpulse.v1.Error
|
||
11, // [11:11] is the sub-list for method output_type
|
||
11, // [11:11] is the sub-list for method input_type
|
||
11, // [11:11] is the sub-list for extension type_name
|
||
11, // [11:11] is the sub-list for extension extendee
|
||
0, // [0:11] is the sub-list for field type_name
|
||
}
|
||
|
||
func init() { file_netpulse_v1_discovery_proto_init() }
|
||
func file_netpulse_v1_discovery_proto_init() {
|
||
if File_netpulse_v1_discovery_proto != nil {
|
||
return
|
||
}
|
||
file_netpulse_v1_common_proto_init()
|
||
type x struct{}
|
||
out := protoimpl.TypeBuilder{
|
||
File: protoimpl.DescBuilder{
|
||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_netpulse_v1_discovery_proto_rawDesc), len(file_netpulse_v1_discovery_proto_rawDesc)),
|
||
NumEnums: 0,
|
||
NumMessages: 5,
|
||
NumExtensions: 0,
|
||
NumServices: 0,
|
||
},
|
||
GoTypes: file_netpulse_v1_discovery_proto_goTypes,
|
||
DependencyIndexes: file_netpulse_v1_discovery_proto_depIdxs,
|
||
MessageInfos: file_netpulse_v1_discovery_proto_msgTypes,
|
||
}.Build()
|
||
File_netpulse_v1_discovery_proto = out.File
|
||
file_netpulse_v1_discovery_proto_goTypes = nil
|
||
file_netpulse_v1_discovery_proto_depIdxs = nil
|
||
}
|