Documentation ¶
Overview ¶
Package flow is a generated protocol buffer package.
It is generated from these files:
flow/flow.proto
It has these top-level messages:
FlowEndpointStatistics FlowEndpointsStatistics FlowStatistics Flow
Index ¶
- Constants
- Variables
- func HashFromValues(ab interface{}, ba interface{}) []byte
- func Var8bin(v []byte) []byte
- type ExpireUpdateFunc
- type Flow
- func FlowFromGoPacket(ft *Table, packet *gopacket.Packet, length uint64, setter FlowProbeNodeSetter) *Flow
- func FlowsFromSFlowSample(ft *Table, sample *layers.SFlowFlowSample, setter FlowProbeNodeSetter) []*Flow
- func FromData(data []byte) (*Flow, error)
- func GenerateTestFlows(t *testing.T, ft *Table, baseSeed int64, uuid string) []*Flow
- func GenerateTestFlowsSymmetric(t *testing.T, ft *Table, baseSeed int64, uuid string) []*Flow
- func (*Flow) Descriptor() ([]byte, []int)
- func (flow *Flow) GetData() ([]byte, error)
- func (flow *Flow) GetLayerHash(ltype FlowEndpointType) string
- func (m *Flow) GetStatistics() *FlowStatistics
- func (*Flow) ProtoMessage()
- func (m *Flow) Reset()
- func (m *Flow) String() string
- func (flow *Flow) UpdateUUIDs(key string)
- type FlowEndpointLayer
- type FlowEndpointStatistics
- type FlowEndpointType
- type FlowEndpointsStatistics
- func (*FlowEndpointsStatistics) Descriptor() ([]byte, []int)
- func (m *FlowEndpointsStatistics) GetAB() *FlowEndpointStatistics
- func (m *FlowEndpointsStatistics) GetBA() *FlowEndpointStatistics
- func (s *FlowEndpointsStatistics) MarshalJSON() ([]byte, error)
- func (*FlowEndpointsStatistics) ProtoMessage()
- func (m *FlowEndpointsStatistics) Reset()
- func (m *FlowEndpointsStatistics) String() string
- func (s *FlowEndpointsStatistics) UnmarshalJSON(b []byte) error
- type FlowHandler
- type FlowKey
- type FlowProbeNodeSetter
- type FlowQueryFilter
- type FlowSearchQuery
- type FlowSearchReply
- type FlowSet
- type FlowSetBandwidth
- type FlowStatistics
- func (*FlowStatistics) Descriptor() ([]byte, []int)
- func (fs *FlowStatistics) DumpInfo(layerSeparator ...string) string
- func (m *FlowStatistics) GetEndpoints() []*FlowEndpointsStatistics
- func (fs *FlowStatistics) GetEndpointsType(eptype FlowEndpointType) *FlowEndpointsStatistics
- func (fs *FlowStatistics) GetLayerHash(ltype FlowEndpointType) (hash []byte)
- func (fs *FlowStatistics) Init(now int64, packet *gopacket.Packet, length uint64)
- func (*FlowStatistics) ProtoMessage()
- func (m *FlowStatistics) Reset()
- func (m *FlowStatistics) String() string
- func (fs *FlowStatistics) Update(now int64, packet *gopacket.Packet, length uint64)
- type HostNodeIDMap
- type ProtocolType
- type Table
- func NewTable(updateHandler *FlowHandler, expireHandler *FlowHandler) *Table
- func NewTableFromFlows(flows []*Flow, updateHandler *FlowHandler, expireHandler *FlowHandler) *Table
- func NewTestFlowTableComplex(t *testing.T, updateHandler *FlowHandler, expireHandler *FlowHandler) *Table
- func NewTestFlowTableSimple(t *testing.T) *Table
- func (ft *Table) Expire(now time.Time)
- func (ft *Table) FilterLast(last time.Duration) []*Flow
- func (ft *Table) Flush()
- func (ft *Table) GetFlow(key string) *Flow
- func (ft *Table) GetFlows(filters ...FlowQueryFilter) *FlowSet
- func (ft *Table) GetOrCreateFlow(key string) (*Flow, bool)
- func (ft *Table) GetTime() int64
- func (ft *Table) Query(query *TableQuery) *TableReply
- func (ft *Table) RegisterDefault(fn func())
- func (ft *Table) SelectLayer(endpointType FlowEndpointType, list []string) *FlowSet
- func (ft *Table) Start()
- func (ft *Table) Stop()
- func (ft *Table) String() string
- func (ft *Table) Update(flows []*Flow)
- func (ft *Table) Updated(now time.Time)
- func (ft *Table) Window(start, end int64) *FlowSet
- type TableAllocator
- type TableClient
- type TableQuery
- type TableReply
- type TableServer
Constants ¶
View Source
const (
Namespace = "Flow"
)
Variables ¶
View Source
var FlowEndpointLayer_name = map[int32]string{
0: "LINK",
1: "NETWORK",
2: "TRANSPORT",
}
View Source
var FlowEndpointLayer_value = map[string]int32{
"LINK": 0,
"NETWORK": 1,
"TRANSPORT": 2,
}
View Source
var FlowEndpointType_name = map[int32]string{
0: "ETHERNET",
1: "IPV4",
2: "TCPPORT",
3: "UDPPORT",
4: "SCTPPORT",
5: "IPV6",
}
View Source
var FlowEndpointType_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 ExpireUpdateFunc ¶ added in v0.3.0
type ExpireUpdateFunc func(f []*Flow)
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 Statistics *FlowStatistics `protobuf:"bytes,3,opt,name=Statistics" json:"Statistics,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"` // Topology info ProbeNodeUUID string `protobuf:"bytes,11,opt,name=ProbeNodeUUID" json:"ProbeNodeUUID,omitempty"` IfSrcNodeUUID string `protobuf:"bytes,14,opt,name=IfSrcNodeUUID" json:"IfSrcNodeUUID,omitempty"` IfDstNodeUUID string `protobuf:"bytes,19,opt,name=IfDstNodeUUID" json:"IfDstNodeUUID,omitempty"` }
func FlowFromGoPacket ¶ added in v0.3.0
func FlowsFromSFlowSample ¶ added in v0.3.0
func FlowsFromSFlowSample(ft *Table, sample *layers.SFlowFlowSample, setter FlowProbeNodeSetter) []*Flow
func GenerateTestFlows ¶ added in v0.3.0
func GenerateTestFlowsSymmetric ¶ added in v0.3.0
func (*Flow) Descriptor ¶
func (*Flow) GetLayerHash ¶ added in v0.4.0
func (flow *Flow) GetLayerHash(ltype FlowEndpointType) string
func (*Flow) GetStatistics ¶
func (m *Flow) GetStatistics() *FlowStatistics
func (*Flow) ProtoMessage ¶
func (*Flow) ProtoMessage()
func (*Flow) UpdateUUIDs ¶ added in v0.4.0
type FlowEndpointLayer ¶ added in v0.3.0
type FlowEndpointLayer int32
const ( FlowEndpointLayer_LINK FlowEndpointLayer = 0 FlowEndpointLayer_NETWORK FlowEndpointLayer = 1 FlowEndpointLayer_TRANSPORT FlowEndpointLayer = 2 )
func (FlowEndpointLayer) EnumDescriptor ¶ added in v0.3.0
func (FlowEndpointLayer) EnumDescriptor() ([]byte, []int)
func (FlowEndpointLayer) String ¶ added in v0.3.0
func (x FlowEndpointLayer) String() string
type FlowEndpointStatistics ¶
type FlowEndpointStatistics struct { Value string `protobuf:"bytes,2,opt,name=Value" json:"Value,omitempty"` Packets uint64 `protobuf:"varint,5,opt,name=Packets" json:"Packets,omitempty"` Bytes uint64 `protobuf:"varint,6,opt,name=Bytes" json:"Bytes,omitempty"` }
func (*FlowEndpointStatistics) Descriptor ¶
func (*FlowEndpointStatistics) Descriptor() ([]byte, []int)
func (*FlowEndpointStatistics) ProtoMessage ¶
func (*FlowEndpointStatistics) ProtoMessage()
func (*FlowEndpointStatistics) Reset ¶
func (m *FlowEndpointStatistics) Reset()
func (*FlowEndpointStatistics) String ¶
func (m *FlowEndpointStatistics) String() string
type FlowEndpointType ¶
type FlowEndpointType int32
const ( FlowEndpointType_ETHERNET FlowEndpointType = 0 FlowEndpointType_IPV4 FlowEndpointType = 1 FlowEndpointType_TCPPORT FlowEndpointType = 2 FlowEndpointType_UDPPORT FlowEndpointType = 3 FlowEndpointType_SCTPPORT FlowEndpointType = 4 FlowEndpointType_IPV6 FlowEndpointType = 5 )
func (FlowEndpointType) EnumDescriptor ¶
func (FlowEndpointType) EnumDescriptor() ([]byte, []int)
func (FlowEndpointType) String ¶
func (x FlowEndpointType) String() string
func (FlowEndpointType) Value ¶
func (x FlowEndpointType) Value() int32
type FlowEndpointsStatistics ¶
type FlowEndpointsStatistics struct { Type FlowEndpointType `protobuf:"varint,1,opt,name=Type,enum=flow.FlowEndpointType" json:"Type,omitempty"` Hash []byte `protobuf:"bytes,2,opt,name=Hash,proto3" json:"Hash,omitempty"` AB *FlowEndpointStatistics `protobuf:"bytes,3,opt,name=AB" json:"AB,omitempty"` BA *FlowEndpointStatistics `protobuf:"bytes,4,opt,name=BA" json:"BA,omitempty"` }
func (*FlowEndpointsStatistics) Descriptor ¶
func (*FlowEndpointsStatistics) Descriptor() ([]byte, []int)
func (*FlowEndpointsStatistics) GetAB ¶
func (m *FlowEndpointsStatistics) GetAB() *FlowEndpointStatistics
func (*FlowEndpointsStatistics) GetBA ¶
func (m *FlowEndpointsStatistics) GetBA() *FlowEndpointStatistics
func (*FlowEndpointsStatistics) MarshalJSON ¶ added in v0.2.0
func (s *FlowEndpointsStatistics) MarshalJSON() ([]byte, error)
func (*FlowEndpointsStatistics) ProtoMessage ¶
func (*FlowEndpointsStatistics) ProtoMessage()
func (*FlowEndpointsStatistics) Reset ¶
func (m *FlowEndpointsStatistics) Reset()
func (*FlowEndpointsStatistics) String ¶
func (m *FlowEndpointsStatistics) String() string
func (*FlowEndpointsStatistics) UnmarshalJSON ¶ added in v0.2.0
func (s *FlowEndpointsStatistics) UnmarshalJSON(b []byte) error
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, duration time.Duration) *FlowHandler
type FlowProbeNodeSetter ¶ added in v0.4.0
type FlowQueryFilter ¶ added in v0.4.0
type FlowQueryFilter struct { // TODO add more filter elements NodeUUIDs []string }
type FlowSearchQuery ¶ added in v0.4.0
type FlowSearchQuery struct {
NodeUUIDs []string
}
type FlowSearchReply ¶ added in v0.4.0
type FlowSearchReply struct {
FlowSet *FlowSet
}
type FlowSet ¶ added in v0.4.0
func NewFlowSet ¶ added in v0.4.0
func NewFlowSet() *FlowSet
func (*FlowSet) Bandwidth ¶ added in v0.4.0
func (fs *FlowSet) Bandwidth() (fsbw FlowSetBandwidth)
type FlowSetBandwidth ¶ added in v0.4.0
type FlowSetBandwidth struct { ABpackets uint64 ABbytes uint64 BApackets uint64 BAbytes uint64 Duration int64 NBFlow uint64 }
func (FlowSetBandwidth) String ¶ added in v0.4.0
func (fsbw FlowSetBandwidth) String() string
type FlowStatistics ¶
type FlowStatistics struct { Start int64 `protobuf:"varint,1,opt,name=Start" json:"Start,omitempty"` Last int64 `protobuf:"varint,2,opt,name=Last" json:"Last,omitempty"` Endpoints []*FlowEndpointsStatistics `protobuf:"bytes,3,rep,name=Endpoints" json:"Endpoints,omitempty"` }
func (*FlowStatistics) Descriptor ¶
func (*FlowStatistics) Descriptor() ([]byte, []int)
func (*FlowStatistics) DumpInfo ¶ added in v0.3.0
func (fs *FlowStatistics) DumpInfo(layerSeparator ...string) string
func (*FlowStatistics) GetEndpoints ¶
func (m *FlowStatistics) GetEndpoints() []*FlowEndpointsStatistics
func (*FlowStatistics) GetEndpointsType ¶ added in v0.3.0
func (fs *FlowStatistics) GetEndpointsType(eptype FlowEndpointType) *FlowEndpointsStatistics
func (*FlowStatistics) GetLayerHash ¶ added in v0.4.0
func (fs *FlowStatistics) GetLayerHash(ltype FlowEndpointType) (hash []byte)
func (*FlowStatistics) Init ¶ added in v0.4.0
func (fs *FlowStatistics) Init(now int64, packet *gopacket.Packet, length uint64)
func (*FlowStatistics) ProtoMessage ¶
func (*FlowStatistics) ProtoMessage()
func (*FlowStatistics) Reset ¶
func (m *FlowStatistics) Reset()
func (*FlowStatistics) String ¶
func (m *FlowStatistics) String() string
type HostNodeIDMap ¶ added in v0.4.0
type ProtocolType ¶ added in v0.3.0
type ProtocolType int
const ( ETH ProtocolType = 1 + iota IPv4 IPv6 TCP UDP )
type Table ¶ added in v0.4.0
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 (*Table) FilterLast ¶ added in v0.4.0
Return a new flow.Table that contain <last> active flows
func (*Table) GetFlows ¶ added in v0.4.0
func (ft *Table) GetFlows(filters ...FlowQueryFilter) *FlowSet
func (*Table) GetOrCreateFlow ¶ added in v0.4.0
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) SelectLayer ¶ added in v0.4.0
func (ft *Table) SelectLayer(endpointType FlowEndpointType, list []string) *FlowSet
type TableAllocator ¶ added in v0.4.0
func NewTableAllocator ¶ added in v0.4.0
func NewTableAllocator(update, updateWindow, expire, expireWindow 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) LookupFlowsByNodes ¶ added in v0.4.0
func (f *TableClient) LookupFlowsByNodes(hnmap HostNodeIDMap) (*FlowSet, error)
type TableQuery ¶ added in v0.4.0
type TableQuery struct {
Obj interface{}
}
type TableReply ¶ added in v0.4.0
type TableReply struct { Status int Obj json.RawMessage }
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)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.