netflow

package
Version: v0.0.0-...-8992419 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package netflow is a generated protocol buffer package.

It is generated from these files:

netflow.proto

It has these top-level messages:

Pfx
Flow
Intf
Flows

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAnnotatorServer

func RegisterAnnotatorServer(s *grpc.Server, srv AnnotatorServer)

Types

type AnnotatorClient

type AnnotatorClient interface {
	Annotate(ctx context.Context, in *Flow, opts ...grpc.CallOption) (*Flow, error)
}

func NewAnnotatorClient

func NewAnnotatorClient(cc *grpc.ClientConn) AnnotatorClient

type AnnotatorServer

type AnnotatorServer interface {
	Annotate(context.Context, *Flow) (*Flow, error)
}

type Flow

type Flow struct {
	// Router flow was received from
	Router []byte `protobuf:"bytes,1,opt,name=router,proto3" json:"router,omitempty"`
	// Address family
	Family uint32 `protobuf:"varint,2,opt,name=family" json:"family,omitempty"`
	// SRC IP address
	SrcAddr []byte `protobuf:"bytes,3,opt,name=src_addr,json=srcAddr,proto3" json:"src_addr,omitempty"`
	// DST IP address
	DstAddr []byte `protobuf:"bytes,4,opt,name=dst_addr,json=dstAddr,proto3" json:"dst_addr,omitempty"`
	// Protocol
	Protocol uint32 `protobuf:"varint,5,opt,name=protocol" json:"protocol,omitempty"`
	// Number of packets
	Packets uint32 `protobuf:"varint,6,opt,name=packets" json:"packets,omitempty"`
	// Size of flow
	Size uint64 `protobuf:"varint,7,opt,name=size" json:"size,omitempty"`
	// SNMP interface id flow was received on
	IntIn uint32 `protobuf:"varint,8,opt,name=int_in,json=intIn" json:"int_in,omitempty"`
	// SNMP interface if flow was transmitted on
	IntOut uint32 `protobuf:"varint,9,opt,name=int_out,json=intOut" json:"int_out,omitempty"`
	// Next Hop IP address
	NextHop []byte `protobuf:"bytes,10,opt,name=next_hop,json=nextHop,proto3" json:"next_hop,omitempty"`
	// SRC ASN
	SrcAs uint32 `protobuf:"varint,11,opt,name=src_as,json=srcAs" json:"src_as,omitempty"`
	// DST ASN
	DstAs uint32 `protobuf:"varint,12,opt,name=dst_as,json=dstAs" json:"dst_as,omitempty"`
	// NEXT HOP ASN
	NextHopAs uint32 `protobuf:"varint,13,opt,name=next_hop_as,json=nextHopAs" json:"next_hop_as,omitempty"`
	// Unix timestamp
	Timestamp int64 `protobuf:"varint,14,opt,name=timestamp" json:"timestamp,omitempty"`
	// SRC prefix
	SrcPfx *Pfx `protobuf:"bytes,15,opt,name=src_pfx,json=srcPfx" json:"src_pfx,omitempty"`
	// DST perfix
	DstPfx *Pfx `protobuf:"bytes,16,opt,name=dst_pfx,json=dstPfx" json:"dst_pfx,omitempty"`
	// SRC port
	SrcPort uint32 `protobuf:"varint,17,opt,name=src_port,json=srcPort" json:"src_port,omitempty"`
	// DST port
	DstPort uint32 `protobuf:"varint,18,opt,name=dst_port,json=dstPort" json:"dst_port,omitempty"`
	// Samplerate
	Samplerate uint64 `protobuf:"varint,19,opt,name=samplerate" json:"samplerate,omitempty"`
}

Flow defines a network flow

func (*Flow) Descriptor

func (*Flow) Descriptor() ([]byte, []int)

func (*Flow) GetDstAddr

func (m *Flow) GetDstAddr() []byte

func (*Flow) GetDstAs

func (m *Flow) GetDstAs() uint32

func (*Flow) GetDstPfx

func (m *Flow) GetDstPfx() *Pfx

func (*Flow) GetDstPort

func (m *Flow) GetDstPort() uint32

func (*Flow) GetFamily

func (m *Flow) GetFamily() uint32

func (*Flow) GetIntIn

func (m *Flow) GetIntIn() uint32

func (*Flow) GetIntOut

func (m *Flow) GetIntOut() uint32

func (*Flow) GetNextHop

func (m *Flow) GetNextHop() []byte

func (*Flow) GetNextHopAs

func (m *Flow) GetNextHopAs() uint32

func (*Flow) GetPackets

func (m *Flow) GetPackets() uint32

func (*Flow) GetProtocol

func (m *Flow) GetProtocol() uint32

func (*Flow) GetRouter

func (m *Flow) GetRouter() []byte

func (*Flow) GetSamplerate

func (m *Flow) GetSamplerate() uint64

func (*Flow) GetSize

func (m *Flow) GetSize() uint64

func (*Flow) GetSrcAddr

func (m *Flow) GetSrcAddr() []byte

func (*Flow) GetSrcAs

func (m *Flow) GetSrcAs() uint32

func (*Flow) GetSrcPfx

func (m *Flow) GetSrcPfx() *Pfx

func (*Flow) GetSrcPort

func (m *Flow) GetSrcPort() uint32

func (*Flow) GetTimestamp

func (m *Flow) GetTimestamp() int64

func (*Flow) ProtoMessage

func (*Flow) ProtoMessage()

func (*Flow) Reset

func (m *Flow) Reset()

func (*Flow) String

func (m *Flow) String() string

type Flows

type Flows struct {
	// Group of flows
	Flows []*Flow `protobuf:"bytes,1,rep,name=flows" json:"flows,omitempty"`
	// Mapping of interface names to IDs
	InterfaceMapping []*Intf `protobuf:"bytes,2,rep,name=interface_mapping,json=interfaceMapping" json:"interface_mapping,omitempty"`
}

Flows defines a groups of flows

func (*Flows) Descriptor

func (*Flows) Descriptor() ([]byte, []int)

func (*Flows) GetFlows

func (m *Flows) GetFlows() []*Flow

func (*Flows) GetInterfaceMapping

func (m *Flows) GetInterfaceMapping() []*Intf

func (*Flows) ProtoMessage

func (*Flows) ProtoMessage()

func (*Flows) Reset

func (m *Flows) Reset()

func (*Flows) String

func (m *Flows) String() string

type Intf

type Intf struct {
	// ID is an interface ID
	Id uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
	// name is an interfaces name
	Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
}

Intf groups an interfaces ID and name

func (*Intf) Descriptor

func (*Intf) Descriptor() ([]byte, []int)

func (*Intf) GetId

func (m *Intf) GetId() uint32

func (*Intf) GetName

func (m *Intf) GetName() string

func (*Intf) ProtoMessage

func (*Intf) ProtoMessage()

func (*Intf) Reset

func (m *Intf) Reset()

func (*Intf) String

func (m *Intf) String() string

type Pfx

type Pfx struct {
	// IPv4 or IPv6 address
	IP []byte `protobuf:"bytes,1,opt,name=IP,proto3" json:"IP,omitempty"`
	// Netmask
	Mask []byte `protobuf:"bytes,2,opt,name=mask,proto3" json:"mask,omitempty"`
}

Pfx defines an IP prefix

func (*Pfx) Descriptor

func (*Pfx) Descriptor() ([]byte, []int)

func (*Pfx) GetIP

func (m *Pfx) GetIP() []byte

func (*Pfx) GetMask

func (m *Pfx) GetMask() []byte

func (*Pfx) ProtoMessage

func (*Pfx) ProtoMessage()

func (*Pfx) Reset

func (m *Pfx) Reset()

func (*Pfx) String

func (m *Pfx) String() string

func (*Pfx) ToIPNet

func (pfx *Pfx) ToIPNet() *net.IPNet

ToIPNet returns the net.IPNet representation for the Prefix

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL