flow

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2016 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package flow is a generated protocol buffer package.

It is generated from these files:

flow/flow.proto
flow/set.proto
flow/request.proto

It has these top-level messages:

FlowLayer
FlowMetric
Flow
FlowSet
TermStringFilter
TermInt64Filter
NeStringFilter
NeInt64Filter
GtInt64Filter
LtInt64Filter
GteInt64Filter
LteInt64Filter
Filter
BoolFilter
Range
FlowSearchQuery
FlowSearchReply

Index

Constants

View Source
const (
	Namespace = "Flow"
)

Variables

View Source
var BoolFilterOp_name = map[int32]string{
	0: "OR",
	1: "AND",
	2: "NOT",
}
View Source
var BoolFilterOp_value = map[string]int32{
	"OR":  0,
	"AND": 1,
	"NOT": 2,
}
View Source
var ErrFieldNotFound = errors.New("Flow field not found")
View Source
var ErrFlowProtocol = errors.New("FlowProtocol invalid")
View Source
var FlowProtocol_name = map[int32]string{
	0: "ETHERNET",
	1: "IPV4",
	2: "TCPPORT",
	3: "UDPPORT",
	4: "SCTPPORT",
	5: "IPV6",
}
View Source
var FlowProtocol_value = map[string]int32{
	"ETHERNET": 0,
	"IPV4":     1,
	"TCPPORT":  2,
	"UDPPORT":  3,
	"SCTPPORT": 4,
	"IPV6":     5,
}

Functions

func HashFromValues added in v0.4.0

func HashFromValues(ab interface{}, ba interface{}) []byte

Types

type BoolFilter added in v0.5.0

type BoolFilter struct {
	Op      BoolFilterOp `protobuf:"varint,1,opt,name=Op,enum=flow.BoolFilterOp" json:"Op,omitempty"`
	Filters []*Filter    `protobuf:"bytes,2,rep,name=Filters" json:"Filters,omitempty"`
}

func (*BoolFilter) Descriptor added in v0.5.0

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

func (*BoolFilter) Eval added in v0.5.0

func (b *BoolFilter) Eval(flow *Flow) bool

func (*BoolFilter) Expression added in v0.5.0

func (b *BoolFilter) Expression() string

func (*BoolFilter) GetFilters added in v0.5.0

func (m *BoolFilter) GetFilters() []*Filter

func (*BoolFilter) ProtoMessage added in v0.5.0

func (*BoolFilter) ProtoMessage()

func (*BoolFilter) Reset added in v0.5.0

func (m *BoolFilter) Reset()

func (*BoolFilter) String added in v0.5.0

func (m *BoolFilter) String() string

type BoolFilterOp added in v0.5.0

type BoolFilterOp int32
const (
	BoolFilterOp_OR  BoolFilterOp = 0
	BoolFilterOp_AND BoolFilterOp = 1
	BoolFilterOp_NOT BoolFilterOp = 2
)

func (BoolFilterOp) EnumDescriptor added in v0.5.0

func (BoolFilterOp) EnumDescriptor() ([]byte, []int)

func (BoolFilterOp) String added in v0.5.0

func (x BoolFilterOp) String() string

type ExpireUpdateFunc added in v0.3.0

type ExpireUpdateFunc func(f []*Flow)

type Filter added in v0.5.0

type Filter struct {
	TermStringFilter *TermStringFilter `protobuf:"bytes,1,opt,name=TermStringFilter" json:"TermStringFilter,omitempty"`
	TermInt64Filter  *TermInt64Filter  `protobuf:"bytes,2,opt,name=TermInt64Filter" json:"TermInt64Filter,omitempty"`
	GtInt64Filter    *GtInt64Filter    `protobuf:"bytes,3,opt,name=GtInt64Filter" json:"GtInt64Filter,omitempty"`
	LtInt64Filter    *LtInt64Filter    `protobuf:"bytes,4,opt,name=LtInt64Filter" json:"LtInt64Filter,omitempty"`
	GteInt64Filter   *GteInt64Filter   `protobuf:"bytes,5,opt,name=GteInt64Filter" json:"GteInt64Filter,omitempty"`
	LteInt64Filter   *LteInt64Filter   `protobuf:"bytes,6,opt,name=LteInt64Filter" json:"LteInt64Filter,omitempty"`
	BoolFilter       *BoolFilter       `protobuf:"bytes,7,opt,name=BoolFilter" json:"BoolFilter,omitempty"`
}

func NewFilterForNodes added in v0.5.0

func NewFilterForNodes(uuids []string) *Filter

func (*Filter) Descriptor added in v0.5.0

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

func (*Filter) Eval added in v0.5.0

func (f *Filter) Eval(flow *Flow) bool

func (*Filter) Expression added in v0.5.0

func (f *Filter) Expression() string

func (*Filter) GetBoolFilter added in v0.5.0

func (m *Filter) GetBoolFilter() *BoolFilter

func (*Filter) GetGtInt64Filter added in v0.5.0

func (m *Filter) GetGtInt64Filter() *GtInt64Filter

func (*Filter) GetGteInt64Filter added in v0.5.0

func (m *Filter) GetGteInt64Filter() *GteInt64Filter

func (*Filter) GetLtInt64Filter added in v0.5.0

func (m *Filter) GetLtInt64Filter() *LtInt64Filter

func (*Filter) GetLteInt64Filter added in v0.5.0

func (m *Filter) GetLteInt64Filter() *LteInt64Filter

func (*Filter) GetTermInt64Filter added in v0.5.0

func (m *Filter) GetTermInt64Filter() *TermInt64Filter

func (*Filter) GetTermStringFilter added in v0.5.0

func (m *Filter) GetTermStringFilter() *TermStringFilter

func (*Filter) ProtoMessage added in v0.5.0

func (*Filter) ProtoMessage()

func (*Filter) Reset added in v0.5.0

func (m *Filter) Reset()

func (*Filter) String added in v0.5.0

func (m *Filter) String() string

type Flow

type Flow struct {
	// Flow Universally Unique IDentifier
	// flow.UUID is unique in the universe, as it should be used as a key of an
	// hashtable. By design 2 different flows, their UUID are always different.
	// flow.UUID can be used as Database Index.
	UUID       string `protobuf:"bytes,1,opt,name=UUID" json:"UUID,omitempty"`
	LayersPath string `protobuf:"bytes,2,opt,name=LayersPath" json:"LayersPath,omitempty"`
	// Data Flow info
	Link      *FlowLayer `protobuf:"bytes,20,opt,name=Link" json:"Link,omitempty"`
	Network   *FlowLayer `protobuf:"bytes,21,opt,name=Network" json:"Network,omitempty"`
	Transport *FlowLayer `protobuf:"bytes,22,opt,name=Transport" json:"Transport,omitempty"`
	// Data Flow Metric info from the 1st layer
	// amount of data between two updates
	LastUpdateMetric *FlowMetric `protobuf:"bytes,31,opt,name=LastUpdateMetric" json:"LastUpdateMetric,omitempty"`
	// Total amount of data for the whole flow duration
	Metric *FlowMetric `protobuf:"bytes,32,opt,name=Metric" json:"Metric,omitempty"`
	// Flow Tracking IDentifier, from 1st packet bytes
	// flow.TrackingID could be used to identify an unique flow whatever it has
	// been captured on the infrastructure. flow.TrackingID is calculated from
	// the bytes of the first packet of his session.
	// flow.TrackingID can be used as a Tag.
	TrackingID string `protobuf:"bytes,5,opt,name=TrackingID" json:"TrackingID,omitempty"`
	// Flow Parent UUID is used as reference to the parent flow
	// Flow.ParentUUID is the same value that point to his parent flow.UUID
	ParentUUID string `protobuf:"bytes,6,opt,name=ParentUUID" json:"ParentUUID,omitempty"`
	// Topology info
	NodeUUID  string `protobuf:"bytes,11,opt,name=NodeUUID" json:"NodeUUID,omitempty"`
	ANodeUUID string `protobuf:"bytes,14,opt,name=ANodeUUID" json:"ANodeUUID,omitempty"`
	BNodeUUID string `protobuf:"bytes,19,opt,name=BNodeUUID" json:"BNodeUUID,omitempty"`
}

func FlowsFromGoPacket added in v0.7.0

func FlowsFromGoPacket(ft *Table, packet *gopacket.Packet, length int64, setter FlowProbeNodeSetter) []*Flow

func FlowsFromSFlowSample added in v0.3.0

func FlowsFromSFlowSample(ft *Table, sample *layers.SFlowFlowSample, setter FlowProbeNodeSetter) []*Flow

func FromData

func FromData(data []byte) (*Flow, error)

func GenerateTestFlows added in v0.3.0

func GenerateTestFlows(t *testing.T, ft *Table, baseSeed int64, uuid string) []*Flow

func GenerateTestFlowsSymmetric added in v0.3.0

func GenerateTestFlowsSymmetric(t *testing.T, ft *Table, baseSeed int64, uuid string) []*Flow

func (*Flow) Descriptor

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

func (*Flow) DumpInfo added in v0.7.0

func (f *Flow) DumpInfo(layerSeparator ...string) string

func (*Flow) GetData

func (flow *Flow) GetData() ([]byte, error)

func (*Flow) GetFieldInt64 added in v0.7.0

func (f *Flow) GetFieldInt64(field string) (int64, error)

func (*Flow) GetFieldString added in v0.7.0

func (f *Flow) GetFieldString(field string) (string, error)

func (*Flow) GetLastUpdateMetric added in v0.7.0

func (m *Flow) GetLastUpdateMetric() *FlowMetric
func (m *Flow) GetLink() *FlowLayer

func (*Flow) GetMetric added in v0.7.0

func (m *Flow) GetMetric() *FlowMetric

func (*Flow) GetNetwork added in v0.7.0

func (m *Flow) GetNetwork() *FlowLayer

func (*Flow) GetTransport added in v0.7.0

func (m *Flow) GetTransport() *FlowLayer

func (*Flow) Init added in v0.7.0

func (f *Flow) Init(now int64, packet *gopacket.Packet, length int64)

func (*Flow) ProtoMessage

func (*Flow) ProtoMessage()

func (*Flow) Reset

func (m *Flow) Reset()

func (*Flow) String

func (m *Flow) String() string

func (*Flow) Update added in v0.7.0

func (f *Flow) Update(now int64, packet *gopacket.Packet, length int64)

func (*Flow) UpdateUUIDs added in v0.4.0

func (flow *Flow) UpdateUUIDs(key string, parentUUID string)

type FlowHandler added in v0.4.0

type FlowHandler struct {
	// contains filtered or unexported fields
}

func NewFlowHandler added in v0.4.0

func NewFlowHandler(callback ExpireUpdateFunc, every time.Duration) *FlowHandler

type FlowKey

type FlowKey string

func FlowKeyFromGoPacket added in v0.4.0

func FlowKeyFromGoPacket(p *gopacket.Packet, parentUUID string) FlowKey

func (FlowKey) String

func (f FlowKey) String() string

type FlowLayer added in v0.7.0

type FlowLayer struct {
	Protocol FlowProtocol `protobuf:"varint,1,opt,name=Protocol,enum=flow.FlowProtocol" json:"Protocol,omitempty"`
	A        string       `protobuf:"bytes,3,opt,name=A" json:"A,omitempty"`
	B        string       `protobuf:"bytes,4,opt,name=B" json:"B,omitempty"`
}

func (*FlowLayer) Descriptor added in v0.7.0

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

func (*FlowLayer) GetField added in v0.7.0

func (f *FlowLayer) GetField(fields []string) (string, error)

func (*FlowLayer) Hash added in v0.7.0

func (fl *FlowLayer) Hash() []byte

func (*FlowLayer) HashStr added in v0.7.0

func (fl *FlowLayer) HashStr() string

func (*FlowLayer) MarshalJSON added in v0.7.0

func (s *FlowLayer) MarshalJSON() ([]byte, error)

func (*FlowLayer) ProtoMessage added in v0.7.0

func (*FlowLayer) ProtoMessage()

func (*FlowLayer) Reset added in v0.7.0

func (m *FlowLayer) Reset()

func (*FlowLayer) String added in v0.7.0

func (m *FlowLayer) String() string

func (*FlowLayer) UnmarshalJSON added in v0.7.0

func (s *FlowLayer) UnmarshalJSON(b []byte) error

type FlowMetric added in v0.7.0

type FlowMetric struct {
	Start     int64 `protobuf:"varint,1,opt,name=Start" json:"Start,omitempty"`
	Last      int64 `protobuf:"varint,2,opt,name=Last" json:"Last,omitempty"`
	ABPackets int64 `protobuf:"varint,3,opt,name=ABPackets" json:"ABPackets,omitempty"`
	ABBytes   int64 `protobuf:"varint,4,opt,name=ABBytes" json:"ABBytes,omitempty"`
	BAPackets int64 `protobuf:"varint,5,opt,name=BAPackets" json:"BAPackets,omitempty"`
	BABytes   int64 `protobuf:"varint,6,opt,name=BABytes" json:"BABytes,omitempty"`
}

func (*FlowMetric) Copy added in v0.7.0

func (fm *FlowMetric) Copy() *FlowMetric

func (*FlowMetric) Descriptor added in v0.7.0

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

func (*FlowMetric) GetField added in v0.7.0

func (f *FlowMetric) GetField(fields []string) (int64, error)

func (*FlowMetric) ProtoMessage added in v0.7.0

func (*FlowMetric) ProtoMessage()

func (*FlowMetric) Reset added in v0.7.0

func (m *FlowMetric) Reset()

func (*FlowMetric) String added in v0.7.0

func (m *FlowMetric) String() string

type FlowProbeNodeSetter added in v0.4.0

type FlowProbeNodeSetter interface {
	SetProbeNode(flow *Flow) bool
}

type FlowProtocol added in v0.7.0

type FlowProtocol int32
const (
	FlowProtocol_ETHERNET FlowProtocol = 0
	FlowProtocol_IPV4     FlowProtocol = 1
	FlowProtocol_TCPPORT  FlowProtocol = 2
	FlowProtocol_UDPPORT  FlowProtocol = 3
	FlowProtocol_SCTPPORT FlowProtocol = 4
	FlowProtocol_IPV6     FlowProtocol = 5
)

func (FlowProtocol) EnumDescriptor added in v0.7.0

func (FlowProtocol) EnumDescriptor() ([]byte, []int)

func (FlowProtocol) String added in v0.7.0

func (x FlowProtocol) String() string

func (FlowProtocol) Value added in v0.7.0

func (x FlowProtocol) Value() int32

type FlowSearchQuery added in v0.4.0

type FlowSearchQuery struct {
	Filter *Filter `protobuf:"bytes,1,opt,name=Filter" json:"Filter,omitempty"`
	Range  *Range  `protobuf:"bytes,2,opt,name=Range" json:"Range,omitempty"`
	Sort   bool    `protobuf:"varint,3,opt,name=Sort" json:"Sort,omitempty"`
	Dedup  bool    `protobuf:"varint,4,opt,name=Dedup" json:"Dedup,omitempty"`
}

func (*FlowSearchQuery) Descriptor added in v0.5.0

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

func (*FlowSearchQuery) GetFilter added in v0.5.0

func (m *FlowSearchQuery) GetFilter() *Filter

func (*FlowSearchQuery) GetRange added in v0.6.0

func (m *FlowSearchQuery) GetRange() *Range

func (*FlowSearchQuery) ProtoMessage added in v0.5.0

func (*FlowSearchQuery) ProtoMessage()

func (*FlowSearchQuery) Reset added in v0.5.0

func (m *FlowSearchQuery) Reset()

func (*FlowSearchQuery) String added in v0.5.0

func (m *FlowSearchQuery) String() string

type FlowSearchReply added in v0.4.0

type FlowSearchReply struct {
	FlowSet *FlowSet `protobuf:"bytes,1,opt,name=FlowSet" json:"FlowSet,omitempty"`
}

func (*FlowSearchReply) Descriptor added in v0.5.0

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

func (*FlowSearchReply) GetFlowSet added in v0.5.0

func (m *FlowSearchReply) GetFlowSet() *FlowSet

func (*FlowSearchReply) ProtoMessage added in v0.5.0

func (*FlowSearchReply) ProtoMessage()

func (*FlowSearchReply) Reset added in v0.5.0

func (m *FlowSearchReply) Reset()

func (*FlowSearchReply) String added in v0.5.0

func (m *FlowSearchReply) String() string

type FlowSet added in v0.4.0

type FlowSet struct {
	Flows []*Flow `protobuf:"bytes,1,rep,name=Flows" json:"Flows,omitempty"`
	Start int64   `protobuf:"varint,2,opt,name=Start" json:"Start,omitempty"`
	End   int64   `protobuf:"varint,3,opt,name=End" json:"End,omitempty"`
}

func NewFlowSet added in v0.4.0

func NewFlowSet() *FlowSet

func (*FlowSet) AvgBandwidth added in v0.5.0

func (fs *FlowSet) AvgBandwidth() (fsbw FlowSetBandwidth)

func (*FlowSet) Bandwidth added in v0.4.0

func (fs *FlowSet) Bandwidth() (fsbw FlowSetBandwidth)

func (*FlowSet) Dedup added in v0.7.0

func (fs *FlowSet) Dedup()

func (*FlowSet) Descriptor added in v0.5.0

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

func (*FlowSet) Filter added in v0.5.0

func (fs *FlowSet) Filter(filter *Filter) *FlowSet

func (*FlowSet) GetFlows added in v0.5.0

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

func (*FlowSet) Merge added in v0.4.0

func (fs *FlowSet) Merge(ofs *FlowSet, context MergeContext)

func (*FlowSet) ProtoMessage added in v0.5.0

func (*FlowSet) ProtoMessage()

func (*FlowSet) Reset added in v0.5.0

func (m *FlowSet) Reset()

func (*FlowSet) Slice added in v0.7.0

func (fs *FlowSet) Slice(from, to int)

func (*FlowSet) Sort added in v0.7.0

func (fs *FlowSet) Sort()

func (*FlowSet) String added in v0.5.0

func (m *FlowSet) String() string

type FlowSetBandwidth added in v0.4.0

type FlowSetBandwidth struct {
	ABpackets int64
	ABbytes   int64
	BApackets int64
	BAbytes   int64
	Duration  int64
	NBFlow    uint64
}

func (FlowSetBandwidth) String added in v0.4.0

func (fsbw FlowSetBandwidth) String() string

type GetAttr added in v0.5.0

type GetAttr interface {
	GetAttr(name string) interface{}
}

type GtInt64Filter added in v0.5.0

type GtInt64Filter struct {
	Key   string `protobuf:"bytes,1,opt,name=Key" json:"Key,omitempty"`
	Value int64  `protobuf:"varint,2,opt,name=Value" json:"Value,omitempty"`
}

func (*GtInt64Filter) Descriptor added in v0.5.0

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

func (*GtInt64Filter) Eval added in v0.5.0

func (r *GtInt64Filter) Eval(f *Flow) bool

func (*GtInt64Filter) Expression added in v0.5.0

func (r *GtInt64Filter) Expression() string

func (*GtInt64Filter) ProtoMessage added in v0.5.0

func (*GtInt64Filter) ProtoMessage()

func (*GtInt64Filter) Reset added in v0.5.0

func (m *GtInt64Filter) Reset()

func (*GtInt64Filter) String added in v0.5.0

func (m *GtInt64Filter) String() string

type GteInt64Filter added in v0.5.0

type GteInt64Filter struct {
	Key   string `protobuf:"bytes,1,opt,name=Key" json:"Key,omitempty"`
	Value int64  `protobuf:"varint,2,opt,name=Value" json:"Value,omitempty"`
}

func (*GteInt64Filter) Descriptor added in v0.5.0

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

func (*GteInt64Filter) Eval added in v0.5.0

func (r *GteInt64Filter) Eval(f *Flow) bool

func (*GteInt64Filter) Expression added in v0.5.0

func (r *GteInt64Filter) Expression() string

func (*GteInt64Filter) ProtoMessage added in v0.5.0

func (*GteInt64Filter) ProtoMessage()

func (*GteInt64Filter) Reset added in v0.5.0

func (m *GteInt64Filter) Reset()

func (*GteInt64Filter) String added in v0.5.0

func (m *GteInt64Filter) String() string

type HostNodeIDMap added in v0.4.0

type HostNodeIDMap map[string][]string

type LtInt64Filter added in v0.5.0

type LtInt64Filter struct {
	Key   string `protobuf:"bytes,1,opt,name=Key" json:"Key,omitempty"`
	Value int64  `protobuf:"varint,2,opt,name=Value" json:"Value,omitempty"`
}

func (*LtInt64Filter) Descriptor added in v0.5.0

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

func (*LtInt64Filter) Eval added in v0.5.0

func (r *LtInt64Filter) Eval(f *Flow) bool

func (*LtInt64Filter) Expression added in v0.5.0

func (r *LtInt64Filter) Expression() string

func (*LtInt64Filter) ProtoMessage added in v0.5.0

func (*LtInt64Filter) ProtoMessage()

func (*LtInt64Filter) Reset added in v0.5.0

func (m *LtInt64Filter) Reset()

func (*LtInt64Filter) String added in v0.5.0

func (m *LtInt64Filter) String() string

type LteInt64Filter added in v0.5.0

type LteInt64Filter struct {
	Key   string `protobuf:"bytes,1,opt,name=Key" json:"Key,omitempty"`
	Value int64  `protobuf:"varint,2,opt,name=Value" json:"Value,omitempty"`
}

func (*LteInt64Filter) Descriptor added in v0.5.0

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

func (*LteInt64Filter) Eval added in v0.5.0

func (r *LteInt64Filter) Eval(f *Flow) bool

func (*LteInt64Filter) Expression added in v0.5.0

func (r *LteInt64Filter) Expression() string

func (*LteInt64Filter) ProtoMessage added in v0.5.0

func (*LteInt64Filter) ProtoMessage()

func (*LteInt64Filter) Reset added in v0.5.0

func (m *LteInt64Filter) Reset()

func (*LteInt64Filter) String added in v0.5.0

func (m *LteInt64Filter) String() string

type MergeContext added in v0.7.0

type MergeContext struct {
	Sorted bool
	Dedup  bool
}

type NeInt64Filter added in v0.5.0

type NeInt64Filter struct {
	Key   string `protobuf:"bytes,1,opt,name=Key" json:"Key,omitempty"`
	Value int64  `protobuf:"varint,2,opt,name=Value" json:"Value,omitempty"`
}

func (*NeInt64Filter) Descriptor added in v0.5.0

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

func (*NeInt64Filter) ProtoMessage added in v0.5.0

func (*NeInt64Filter) ProtoMessage()

func (*NeInt64Filter) Reset added in v0.5.0

func (m *NeInt64Filter) Reset()

func (*NeInt64Filter) String added in v0.5.0

func (m *NeInt64Filter) String() string

type NeStringFilter added in v0.5.0

type NeStringFilter struct {
	Key   string `protobuf:"bytes,1,opt,name=Key" json:"Key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=Value" json:"Value,omitempty"`
}

func (*NeStringFilter) Descriptor added in v0.5.0

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

func (*NeStringFilter) ProtoMessage added in v0.5.0

func (*NeStringFilter) ProtoMessage()

func (*NeStringFilter) Reset added in v0.5.0

func (m *NeStringFilter) Reset()

func (*NeStringFilter) String added in v0.5.0

func (m *NeStringFilter) String() string

type ProtocolType added in v0.3.0

type ProtocolType int
const (
	ETH ProtocolType = 1 + iota
	IPv4
	IPv6
	TCP
	UDP
	SCTP
	GRE
)

type Range added in v0.6.0

type Range struct {
	From int64 `protobuf:"varint,1,opt,name=From" json:"From,omitempty"`
	To   int64 `protobuf:"varint,2,opt,name=To" json:"To,omitempty"`
}

func (*Range) Descriptor added in v0.6.0

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

func (*Range) ProtoMessage added in v0.6.0

func (*Range) ProtoMessage()

func (*Range) Reset added in v0.6.0

func (m *Range) Reset()

func (*Range) String added in v0.6.0

func (m *Range) String() string

type Table added in v0.4.0

type Table struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewTable added in v0.4.0

func NewTable(updateHandler *FlowHandler, expireHandler *FlowHandler) *Table

func NewTableFromFlows added in v0.4.0

func NewTableFromFlows(flows []*Flow, updateHandler *FlowHandler, expireHandler *FlowHandler) *Table

func NewTestFlowTableComplex added in v0.4.0

func NewTestFlowTableComplex(t *testing.T, updateHandler *FlowHandler, expireHandler *FlowHandler) *Table

func NewTestFlowTableSimple added in v0.3.0

func NewTestFlowTableSimple(t *testing.T) *Table

func (*Table) Expire added in v0.4.0

func (ft *Table) Expire(now time.Time)

func (*Table) FilterLast added in v0.4.0

func (ft *Table) FilterLast(last time.Duration) []*Flow

Return a new flow.Table that contain <last> active flows

func (*Table) Flush added in v0.4.0

func (ft *Table) Flush()

func (*Table) GetFlow added in v0.4.0

func (ft *Table) GetFlow(key string) *Flow

func (*Table) GetFlows added in v0.4.0

func (ft *Table) GetFlows(query *FlowSearchQuery) *FlowSet

func (*Table) GetOrCreateFlow added in v0.4.0

func (ft *Table) GetOrCreateFlow(key string) (*Flow, bool)

func (*Table) GetTime added in v0.4.0

func (ft *Table) GetTime() int64

func (*Table) Query added in v0.4.0

func (ft *Table) Query(query *TableQuery) *TableReply

func (*Table) RegisterDefault added in v0.4.0

func (ft *Table) RegisterDefault(fn func())

func (*Table) Run added in v0.7.0

func (ft *Table) Run()

func (*Table) SelectLayer added in v0.4.0

func (ft *Table) SelectLayer(protocol FlowProtocol, list []string) *FlowSet

func (*Table) Start added in v0.4.0

func (ft *Table) Start()

func (*Table) Stop added in v0.4.0

func (ft *Table) Stop()

func (*Table) String added in v0.4.0

func (ft *Table) String() string

func (*Table) Update added in v0.4.0

func (ft *Table) Update(flows []*Flow)

func (*Table) Updated added in v0.4.0

func (ft *Table) Updated(now time.Time)

func (*Table) Window added in v0.4.0

func (ft *Table) Window(start, end int64) *FlowSet
Window returns a FlowSet with flows fitting in the given time range

Need to Rlock the table before calling. Returned flows may not be unique

type TableAllocator added in v0.4.0

type TableAllocator struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewTableAllocator added in v0.4.0

func NewTableAllocator(update, expire time.Duration) *TableAllocator

func (*TableAllocator) Alloc added in v0.4.0

func (a *TableAllocator) Alloc(flowCallBack ExpireUpdateFunc) *Table

func (*TableAllocator) Flush added in v0.4.0

func (a *TableAllocator) Flush()

func (*TableAllocator) QueryTable added in v0.4.0

func (a *TableAllocator) QueryTable(query *TableQuery) *TableReply

func (*TableAllocator) Release added in v0.4.0

func (a *TableAllocator) Release(t *Table)

type TableClient added in v0.4.0

type TableClient struct {
	shttp.DefaultWSServerEventHandler
	WSServer *shttp.WSServer
	// contains filtered or unexported fields
}

func NewTableClient added in v0.4.0

func NewTableClient(w *shttp.WSServer) *TableClient

func (*TableClient) LookupFlows added in v0.5.0

func (f *TableClient) LookupFlows(flowSearchQuery *FlowSearchQuery) (*FlowSet, error)

func (*TableClient) LookupFlowsByNodes added in v0.4.0

func (f *TableClient) LookupFlowsByNodes(hnmap HostNodeIDMap, flowSearchQuery *FlowSearchQuery) (*FlowSet, error)

func (*TableClient) OnMessage added in v0.4.0

func (f *TableClient) OnMessage(c *shttp.WSClient, m shttp.WSMessage)

type TableQuery added in v0.4.0

type TableQuery struct {
	Type string
	Obj  []byte
}

TableQuery contains a type and a query obj as an array of bytes. The query can be encoded in different ways according the type.

type TableReply added in v0.4.0

type TableReply struct {
	Status int
	Obj    [][]byte
}

TableReply is the response to a TableQuery containing a Status and an array of replies that can be encoded in many ways, ex: json, protobuf.

type TableServer added in v0.4.0

type TableServer struct {
	shttp.DefaultWSClientEventHandler
	WSAsyncClient  *shttp.WSAsyncClient
	TableAllocator *TableAllocator
}

func NewServer added in v0.4.0

func NewServer(allocator *TableAllocator, client *shttp.WSAsyncClient) *TableServer

func (*TableServer) OnMessage added in v0.4.0

func (s *TableServer) OnMessage(msg shttp.WSMessage)

func (*TableServer) OnTableQuery added in v0.5.0

func (s *TableServer) OnTableQuery(msg shttp.WSMessage)

type TermInt64Filter added in v0.5.0

type TermInt64Filter struct {
	Key   string `protobuf:"bytes,1,opt,name=Key" json:"Key,omitempty"`
	Value int64  `protobuf:"varint,2,opt,name=value" json:"value,omitempty"`
}

func (*TermInt64Filter) Descriptor added in v0.5.0

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

func (*TermInt64Filter) Eval added in v0.5.0

func (t *TermInt64Filter) Eval(f *Flow) bool

func (*TermInt64Filter) Expression added in v0.5.0

func (t *TermInt64Filter) Expression() string

func (*TermInt64Filter) ProtoMessage added in v0.5.0

func (*TermInt64Filter) ProtoMessage()

func (*TermInt64Filter) Reset added in v0.5.0

func (m *TermInt64Filter) Reset()

func (*TermInt64Filter) String added in v0.5.0

func (m *TermInt64Filter) String() string

type TermStringFilter added in v0.5.0

type TermStringFilter struct {
	Key   string `protobuf:"bytes,1,opt,name=Key" json:"Key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
}

func (*TermStringFilter) Descriptor added in v0.5.0

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

func (*TermStringFilter) Eval added in v0.5.0

func (t *TermStringFilter) Eval(f *Flow) bool

func (*TermStringFilter) Expression added in v0.5.0

func (t *TermStringFilter) Expression() string

func (*TermStringFilter) ProtoMessage added in v0.5.0

func (*TermStringFilter) ProtoMessage()

func (*TermStringFilter) Reset added in v0.5.0

func (m *TermStringFilter) Reset()

func (*TermStringFilter) String added in v0.5.0

func (m *TermStringFilter) String() string

Source Files

  • allocator.go
  • client.go
  • filters.go
  • flow.go
  • flow.pb.go
  • hash.go
  • request.pb.go
  • server.go
  • set.go
  • set.pb.go
  • statistics.go
  • table.go
  • testhelper.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL