Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - Variables
 - func PBToFlow(pb *Record) *model.Record
 - func RegisterCollectorServer(s grpc.ServiceRegistrar, srv CollectorServer)
 - type CollectorClient
 - type CollectorReply
 - type CollectorServer
 - type DataLink
 - type Direction
 - type DupMapEntry
 - func (*DupMapEntry) Descriptor() ([]byte, []int)deprecated
 - func (x *DupMapEntry) GetDirection() Direction
 - func (x *DupMapEntry) GetInterface() string
 - func (x *DupMapEntry) GetUdn() string
 - func (*DupMapEntry) ProtoMessage()
 - func (x *DupMapEntry) ProtoReflect() protoreflect.Message
 - func (x *DupMapEntry) Reset()
 - func (x *DupMapEntry) String() string
 
- type IP
 - type IP_Ipv4
 - type IP_Ipv6
 - type Network
 - func (*Network) Descriptor() ([]byte, []int)deprecated
 - func (x *Network) GetDscp() uint32
 - func (x *Network) GetDstAddr() *IP
 - func (x *Network) GetSrcAddr() *IP
 - func (*Network) ProtoMessage()
 - func (x *Network) ProtoReflect() protoreflect.Message
 - func (x *Network) Reset()
 - func (x *Network) String() string
 
- type NetworkEvent
 - type Record
 - func (*Record) Descriptor() ([]byte, []int)deprecated
 - func (x *Record) GetAgentIp() *IP
 - func (x *Record) GetBytes() uint64
 - func (x *Record) GetDataLink() *DataLink
 - func (x *Record) GetDirection() Direction
 - func (x *Record) GetDnsErrno() uint32
 - func (x *Record) GetDnsFlags() uint32
 - func (x *Record) GetDnsId() uint32
 - func (x *Record) GetDnsLatency() *durationpb.Duration
 - func (x *Record) GetDupList() []*DupMapEntry
 - func (x *Record) GetDuplicate() bool
 - func (x *Record) GetEthProtocol() uint32
 - func (x *Record) GetFlags() uint32
 - func (x *Record) GetFlowEncrypted() uint32
 - func (x *Record) GetFlowEncryptedRet() uint32
 - func (x *Record) GetIcmpCode() uint32
 - func (x *Record) GetIcmpType() uint32
 - func (x *Record) GetInterface() string
 - func (x *Record) GetNetwork() *Network
 - func (x *Record) GetNetworkEventsMetadata() []*NetworkEvent
 - func (x *Record) GetPackets() uint64
 - func (x *Record) GetPktDropBytes() uint64
 - func (x *Record) GetPktDropLatestDropCause() uint32
 - func (x *Record) GetPktDropLatestFlags() uint32
 - func (x *Record) GetPktDropLatestState() uint32
 - func (x *Record) GetPktDropPackets() uint64
 - func (x *Record) GetSampling() uint32
 - func (x *Record) GetTimeFlowEnd() *timestamppb.Timestamp
 - func (x *Record) GetTimeFlowRtt() *durationpb.Duration
 - func (x *Record) GetTimeFlowStart() *timestamppb.Timestamp
 - func (x *Record) GetTransport() *Transport
 - func (x *Record) GetXlat() *Xlat
 - func (*Record) ProtoMessage()
 - func (x *Record) ProtoReflect() protoreflect.Message
 - func (x *Record) Reset()
 - func (x *Record) String() string
 
- type Records
 - type Transport
 - func (*Transport) Descriptor() ([]byte, []int)deprecated
 - func (x *Transport) GetDstPort() uint32
 - func (x *Transport) GetProtocol() uint32
 - func (x *Transport) GetSrcPort() uint32
 - func (*Transport) ProtoMessage()
 - func (x *Transport) ProtoReflect() protoreflect.Message
 - func (x *Transport) Reset()
 - func (x *Transport) String() string
 
- type UnimplementedCollectorServer
 - type UnsafeCollectorServer
 - type Xlat
 - func (*Xlat) Descriptor() ([]byte, []int)deprecated
 - func (x *Xlat) GetDstAddr() *IP
 - func (x *Xlat) GetDstPort() uint32
 - func (x *Xlat) GetSrcAddr() *IP
 - func (x *Xlat) GetSrcPort() uint32
 - func (x *Xlat) GetZoneId() uint32
 - func (*Xlat) ProtoMessage()
 - func (x *Xlat) ProtoReflect() protoreflect.Message
 - func (x *Xlat) Reset()
 - func (x *Xlat) String() string
 
Constants ¶
const (
	Collector_Send_FullMethodName = "/pbflow.Collector/Send"
)
    Variables ¶
var ( Direction_name = map[int32]string{ 0: "INGRESS", 1: "EGRESS", } Direction_value = map[string]int32{ "INGRESS": 0, "EGRESS": 1, } )
Enum value maps for Direction.
var Collector_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pbflow.Collector", HandlerType: (*CollectorServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Send", Handler: _Collector_Send_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/flow.proto", }
Collector_ServiceDesc is the grpc.ServiceDesc for Collector service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_proto_flow_proto protoreflect.FileDescriptor
    Functions ¶
func RegisterCollectorServer ¶
func RegisterCollectorServer(s grpc.ServiceRegistrar, srv CollectorServer)
Types ¶
type CollectorClient ¶
type CollectorClient interface {
	Send(ctx context.Context, in *Records, opts ...grpc.CallOption) (*CollectorReply, error)
}
    CollectorClient is the client API for Collector service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewCollectorClient ¶
func NewCollectorClient(cc grpc.ClientConnInterface) CollectorClient
type CollectorReply ¶
type CollectorReply struct {
	// contains filtered or unexported fields
}
    intentionally empty
        
          
            func (*CollectorReply) Descriptor
            deprecated
            
          
  
    
  
      
      func (*CollectorReply) Descriptor() ([]byte, []int)
Deprecated: Use CollectorReply.ProtoReflect.Descriptor instead.
func (*CollectorReply) ProtoMessage ¶
func (*CollectorReply) ProtoMessage()
func (*CollectorReply) ProtoReflect ¶
func (x *CollectorReply) ProtoReflect() protoreflect.Message
func (*CollectorReply) Reset ¶
func (x *CollectorReply) Reset()
func (*CollectorReply) String ¶
func (x *CollectorReply) String() string
type CollectorServer ¶
type CollectorServer interface {
	Send(context.Context, *Records) (*CollectorReply, error)
	// contains filtered or unexported methods
}
    CollectorServer is the server API for Collector service. All implementations must embed UnimplementedCollectorServer for forward compatibility.
type DataLink ¶
type DataLink struct {
	SrcMac uint64 `protobuf:"varint,1,opt,name=src_mac,json=srcMac,proto3" json:"src_mac,omitempty"`
	DstMac uint64 `protobuf:"varint,2,opt,name=dst_mac,json=dstMac,proto3" json:"dst_mac,omitempty"`
	// contains filtered or unexported fields
}
    
        
          
            func (*DataLink) Descriptor
            deprecated
            
          
  
    
  
      
      
    func (*DataLink) ProtoMessage ¶
func (*DataLink) ProtoMessage()
func (*DataLink) ProtoReflect ¶
func (x *DataLink) ProtoReflect() protoreflect.Message
type Direction ¶
type Direction int32
as defined by field 61 in https://www.iana.org/assignments/ipfix/ipfix.xhtml
func (Direction) Descriptor ¶
func (Direction) Descriptor() protoreflect.EnumDescriptor
        
          
            func (Direction) EnumDescriptor
            deprecated
            
          
  
    
  
      
      
    func (Direction) Number ¶
func (x Direction) Number() protoreflect.EnumNumber
func (Direction) Type ¶
func (Direction) Type() protoreflect.EnumType
type DupMapEntry ¶ added in v0.3.3
type DupMapEntry struct {
	Interface string    `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"`
	Direction Direction `protobuf:"varint,2,opt,name=direction,proto3,enum=pbflow.Direction" json:"direction,omitempty"`
	Udn       string    `protobuf:"bytes,3,opt,name=udn,proto3" json:"udn,omitempty"`
	// contains filtered or unexported fields
}
    
        
          
            func (*DupMapEntry) Descriptor
            deprecated
            
          
  
    
      added in
      v0.3.3
    
  
      
      func (*DupMapEntry) Descriptor() ([]byte, []int)
Deprecated: Use DupMapEntry.ProtoReflect.Descriptor instead.
func (*DupMapEntry) GetDirection ¶ added in v0.3.3
func (x *DupMapEntry) GetDirection() Direction
func (*DupMapEntry) GetInterface ¶ added in v0.3.3
func (x *DupMapEntry) GetInterface() string
func (*DupMapEntry) GetUdn ¶
func (x *DupMapEntry) GetUdn() string
func (*DupMapEntry) ProtoMessage ¶ added in v0.3.3
func (*DupMapEntry) ProtoMessage()
func (*DupMapEntry) ProtoReflect ¶ added in v0.3.3
func (x *DupMapEntry) ProtoReflect() protoreflect.Message
func (*DupMapEntry) Reset ¶ added in v0.3.3
func (x *DupMapEntry) Reset()
func (*DupMapEntry) String ¶ added in v0.3.3
func (x *DupMapEntry) String() string
type IP ¶
type IP struct {
	// Types that are assignable to IpFamily:
	//
	//	*IP_Ipv4
	//	*IP_Ipv6
	IpFamily isIP_IpFamily `protobuf_oneof:"ip_family"`
	// contains filtered or unexported fields
}
    
        
          
            func (*IP) Descriptor
            deprecated
            
          
  
    
  
      
      
    func (*IP) GetIpFamily ¶
func (m *IP) GetIpFamily() isIP_IpFamily
func (*IP) ProtoMessage ¶
func (*IP) ProtoMessage()
func (*IP) ProtoReflect ¶
func (x *IP) ProtoReflect() protoreflect.Message
type IP_Ipv4 ¶
type IP_Ipv4 struct {
	Ipv4 uint32 `protobuf:"fixed32,1,opt,name=ipv4,proto3,oneof"`
}
    type Network ¶
type Network struct {
	SrcAddr *IP    `protobuf:"bytes,1,opt,name=src_addr,json=srcAddr,proto3" json:"src_addr,omitempty"`
	DstAddr *IP    `protobuf:"bytes,2,opt,name=dst_addr,json=dstAddr,proto3" json:"dst_addr,omitempty"`
	Dscp    uint32 `protobuf:"varint,3,opt,name=dscp,proto3" json:"dscp,omitempty"`
	// contains filtered or unexported fields
}
    
        
          
            func (*Network) Descriptor
            deprecated
            
          
  
    
  
      
      
    func (*Network) GetDstAddr ¶
func (*Network) GetSrcAddr ¶
func (*Network) ProtoMessage ¶
func (*Network) ProtoMessage()
func (*Network) ProtoReflect ¶
func (x *Network) ProtoReflect() protoreflect.Message
type NetworkEvent ¶
type NetworkEvent struct {
	Events map[string]string `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}
    
        
          
            func (*NetworkEvent) Descriptor
            deprecated
            
          
  
    
  
      
      func (*NetworkEvent) Descriptor() ([]byte, []int)
Deprecated: Use NetworkEvent.ProtoReflect.Descriptor instead.
func (*NetworkEvent) GetEvents ¶
func (x *NetworkEvent) GetEvents() map[string]string
func (*NetworkEvent) ProtoMessage ¶
func (*NetworkEvent) ProtoMessage()
func (*NetworkEvent) ProtoReflect ¶
func (x *NetworkEvent) ProtoReflect() protoreflect.Message
func (*NetworkEvent) Reset ¶
func (x *NetworkEvent) Reset()
func (*NetworkEvent) String ¶
func (x *NetworkEvent) String() string
type Record ¶
type Record struct {
	// protocol as defined by ETH_P_* in linux/if_ether.h
	// https://github.com/torvalds/linux/blob/master/include/uapi/linux/if_ether.h
	EthProtocol   uint32                 `protobuf:"varint,1,opt,name=eth_protocol,json=ethProtocol,proto3" json:"eth_protocol,omitempty"`
	Direction     Direction              `protobuf:"varint,2,opt,name=direction,proto3,enum=pbflow.Direction" json:"direction,omitempty"`
	TimeFlowStart *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=time_flow_start,json=timeFlowStart,proto3" json:"time_flow_start,omitempty"`
	TimeFlowEnd   *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=time_flow_end,json=timeFlowEnd,proto3" json:"time_flow_end,omitempty"`
	// OSI-layer attributes
	DataLink  *DataLink  `protobuf:"bytes,5,opt,name=data_link,json=dataLink,proto3" json:"data_link,omitempty"`
	Network   *Network   `protobuf:"bytes,6,opt,name=network,proto3" json:"network,omitempty"`
	Transport *Transport `protobuf:"bytes,7,opt,name=transport,proto3" json:"transport,omitempty"`
	Bytes     uint64     `protobuf:"varint,8,opt,name=bytes,proto3" json:"bytes,omitempty"`
	Packets   uint64     `protobuf:"varint,9,opt,name=packets,proto3" json:"packets,omitempty"`
	Interface string     `protobuf:"bytes,10,opt,name=interface,proto3" json:"interface,omitempty"`
	// Deprecated / unused
	Duplicate bool `protobuf:"varint,11,opt,name=duplicate,proto3" json:"duplicate,omitempty"`
	// Agent IP address to help identifying the source of the flow
	AgentIp                *IP                  `protobuf:"bytes,12,opt,name=agent_ip,json=agentIp,proto3" json:"agent_ip,omitempty"`
	Flags                  uint32               `protobuf:"varint,13,opt,name=flags,proto3" json:"flags,omitempty"`
	IcmpType               uint32               `protobuf:"varint,14,opt,name=icmp_type,json=icmpType,proto3" json:"icmp_type,omitempty"`
	IcmpCode               uint32               `protobuf:"varint,15,opt,name=icmp_code,json=icmpCode,proto3" json:"icmp_code,omitempty"`
	PktDropBytes           uint64               `protobuf:"varint,16,opt,name=pkt_drop_bytes,json=pktDropBytes,proto3" json:"pkt_drop_bytes,omitempty"`
	PktDropPackets         uint64               `protobuf:"varint,17,opt,name=pkt_drop_packets,json=pktDropPackets,proto3" json:"pkt_drop_packets,omitempty"`
	PktDropLatestFlags     uint32               `protobuf:"varint,18,opt,name=pkt_drop_latest_flags,json=pktDropLatestFlags,proto3" json:"pkt_drop_latest_flags,omitempty"`
	PktDropLatestState     uint32               `protobuf:"varint,19,opt,name=pkt_drop_latest_state,json=pktDropLatestState,proto3" json:"pkt_drop_latest_state,omitempty"`
	PktDropLatestDropCause uint32               `` /* 135-byte string literal not displayed */
	DnsId                  uint32               `protobuf:"varint,21,opt,name=dns_id,json=dnsId,proto3" json:"dns_id,omitempty"`
	DnsFlags               uint32               `protobuf:"varint,22,opt,name=dns_flags,json=dnsFlags,proto3" json:"dns_flags,omitempty"`
	DnsLatency             *durationpb.Duration `protobuf:"bytes,23,opt,name=dns_latency,json=dnsLatency,proto3" json:"dns_latency,omitempty"`
	TimeFlowRtt            *durationpb.Duration `protobuf:"bytes,24,opt,name=time_flow_rtt,json=timeFlowRtt,proto3" json:"time_flow_rtt,omitempty"`
	DnsErrno               uint32               `protobuf:"varint,25,opt,name=dns_errno,json=dnsErrno,proto3" json:"dns_errno,omitempty"`
	DupList                []*DupMapEntry       `protobuf:"bytes,26,rep,name=dup_list,json=dupList,proto3" json:"dup_list,omitempty"`
	NetworkEventsMetadata  []*NetworkEvent      `` /* 127-byte string literal not displayed */
	Xlat                   *Xlat                `protobuf:"bytes,28,opt,name=xlat,proto3" json:"xlat,omitempty"`
	Sampling               uint32               `protobuf:"varint,29,opt,name=sampling,proto3" json:"sampling,omitempty"`
	FlowEncrypted          uint32               `protobuf:"varint,30,opt,name=flow_encrypted,json=flowEncrypted,proto3" json:"flow_encrypted,omitempty"`
	FlowEncryptedRet       uint32               `protobuf:"varint,31,opt,name=flow_encrypted_ret,json=flowEncryptedRet,proto3" json:"flow_encrypted_ret,omitempty"`
	// contains filtered or unexported fields
}
    func FlowToPB ¶
FlowToPB is an auxiliary function to convert a single flow record, as returned by the eBPF agent, into a protobuf-encoded message ready to be sent to the collector via kafka
        
          
            func (*Record) Descriptor
            deprecated
            
          
  
    
  
      
      
    func (*Record) GetAgentIp ¶ added in v0.2.4
func (*Record) GetDataLink ¶
func (*Record) GetDirection ¶
func (*Record) GetDnsErrno ¶ added in v0.3.3
func (*Record) GetDnsFlags ¶ added in v0.3.2
func (*Record) GetDnsLatency ¶ added in v0.3.2
func (x *Record) GetDnsLatency() *durationpb.Duration
func (*Record) GetDupList ¶ added in v0.3.3
func (x *Record) GetDupList() []*DupMapEntry
func (*Record) GetDuplicate ¶ added in v0.2.2
func (*Record) GetEthProtocol ¶
func (*Record) GetFlowEncrypted ¶
func (*Record) GetFlowEncryptedRet ¶
func (*Record) GetIcmpCode ¶ added in v0.3.2
func (*Record) GetIcmpType ¶ added in v0.3.2
func (*Record) GetInterface ¶
func (*Record) GetNetwork ¶
func (*Record) GetNetworkEventsMetadata ¶
func (x *Record) GetNetworkEventsMetadata() []*NetworkEvent
func (*Record) GetPackets ¶
func (*Record) GetPktDropBytes ¶ added in v0.3.2
func (*Record) GetPktDropLatestDropCause ¶ added in v0.3.2
func (*Record) GetPktDropLatestFlags ¶ added in v0.3.2
func (*Record) GetPktDropLatestState ¶ added in v0.3.2
func (*Record) GetPktDropPackets ¶ added in v0.3.2
func (*Record) GetSampling ¶
func (*Record) GetTimeFlowEnd ¶
func (x *Record) GetTimeFlowEnd() *timestamppb.Timestamp
func (*Record) GetTimeFlowRtt ¶ added in v0.3.2
func (x *Record) GetTimeFlowRtt() *durationpb.Duration
func (*Record) GetTimeFlowStart ¶
func (x *Record) GetTimeFlowStart() *timestamppb.Timestamp
func (*Record) GetTransport ¶
func (*Record) ProtoMessage ¶
func (*Record) ProtoMessage()
func (*Record) ProtoReflect ¶
func (x *Record) ProtoReflect() protoreflect.Message
type Records ¶
type Records struct {
	Entries []*Record `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
	// contains filtered or unexported fields
}
    func FlowsToPB ¶
FlowsToPB is an auxiliary function to convert flow records, as returned by the eBPF agent, into protobuf-encoded messages ready to be sent to the collector via GRPC
        
          
            func (*Records) Descriptor
            deprecated
            
          
  
    
  
      
      
    func (*Records) GetEntries ¶
func (*Records) ProtoMessage ¶
func (*Records) ProtoMessage()
func (*Records) ProtoReflect ¶
func (x *Records) ProtoReflect() protoreflect.Message
type Transport ¶
type Transport struct {
	SrcPort uint32 `protobuf:"varint,1,opt,name=src_port,json=srcPort,proto3" json:"src_port,omitempty"`
	DstPort uint32 `protobuf:"varint,2,opt,name=dst_port,json=dstPort,proto3" json:"dst_port,omitempty"`
	// protocol as defined by IPPROTO_* in linux/in.h
	// https://github.com/torvalds/linux/blob/master/include/uapi/linux/in.h
	Protocol uint32 `protobuf:"varint,3,opt,name=protocol,proto3" json:"protocol,omitempty"`
	// contains filtered or unexported fields
}
    
        
          
            func (*Transport) Descriptor
            deprecated
            
          
  
    
  
      
      
    func (*Transport) GetDstPort ¶
func (*Transport) GetProtocol ¶
func (*Transport) GetSrcPort ¶
func (*Transport) ProtoMessage ¶
func (*Transport) ProtoMessage()
func (*Transport) ProtoReflect ¶
func (x *Transport) ProtoReflect() protoreflect.Message
type UnimplementedCollectorServer ¶
type UnimplementedCollectorServer struct{}
    UnimplementedCollectorServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedCollectorServer) Send ¶
func (UnimplementedCollectorServer) Send(context.Context, *Records) (*CollectorReply, error)
type UnsafeCollectorServer ¶
type UnsafeCollectorServer interface {
	// contains filtered or unexported methods
}
    UnsafeCollectorServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CollectorServer will result in compilation errors.
type Xlat ¶
type Xlat struct {
	SrcAddr *IP    `protobuf:"bytes,1,opt,name=src_addr,json=srcAddr,proto3" json:"src_addr,omitempty"`
	DstAddr *IP    `protobuf:"bytes,2,opt,name=dst_addr,json=dstAddr,proto3" json:"dst_addr,omitempty"`
	SrcPort uint32 `protobuf:"varint,3,opt,name=src_port,json=srcPort,proto3" json:"src_port,omitempty"`
	DstPort uint32 `protobuf:"varint,4,opt,name=dst_port,json=dstPort,proto3" json:"dst_port,omitempty"`
	ZoneId  uint32 `protobuf:"varint,5,opt,name=zone_id,json=zoneId,proto3" json:"zone_id,omitempty"`
	// contains filtered or unexported fields
}
    
        
          
            func (*Xlat) Descriptor
            deprecated
            
          
  
    
  
      
      
    func (*Xlat) GetDstAddr ¶
func (*Xlat) GetDstPort ¶
func (*Xlat) GetSrcAddr ¶
func (*Xlat) GetSrcPort ¶
func (*Xlat) ProtoMessage ¶
func (*Xlat) ProtoMessage()
func (*Xlat) ProtoReflect ¶
func (x *Xlat) ProtoReflect() protoreflect.Message