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 ICMPLayer FlowMetric Flow FlowSet FlowSearchReply
Index ¶
- Constants
- Variables
- func BPFFilterToRaw(linkType layers.LinkType, captureLength uint32, filter string) ([]bpf.RawInstruction, error)
- func HashFromValues(ab interface{}, ba interface{}) []byte
- func NewFilterForFlowSet(flowset *FlowSet) *filters.Filter
- func NewFilterForNodeTIDs(uuids []string) *filters.Filter
- func NewFilterForNodes(nodes []*graph.Node) *filters.Filter
- type BPF
- type Enhancer
- type EnhancerPipeline
- type ExpireUpdateFunc
- type Flow
- func (*Flow) Descriptor() ([]byte, []int)
- func (m *Flow) GetANodeTID() string
- func (m *Flow) GetApplication() string
- func (m *Flow) GetBNodeTID() string
- func (f *Flow) GetData() ([]byte, error)
- func (f *Flow) GetDuration() time.Duration
- func (f *Flow) GetField(field string) (interface{}, error)
- func (f *Flow) GetFieldInt64(field string) (_ int64, err error)
- func (f *Flow) GetFieldString(field string) (string, error)
- func (f *Flow) GetFields() []interface{}
- func (m *Flow) GetICMP() *ICMPLayer
- func (m *Flow) GetL3TrackingID() string
- func (m *Flow) GetLast() int64
- func (f *Flow) GetLastTime() time.Time
- func (m *Flow) GetLastUpdateLast() int64
- func (m *Flow) GetLastUpdateMetric() *FlowMetric
- func (m *Flow) GetLastUpdateStart() int64
- func (m *Flow) GetLayersPath() string
- func (m *Flow) GetLink() *FlowLayer
- func (m *Flow) GetMetric() *FlowMetric
- func (m *Flow) GetNetwork() *FlowLayer
- func (m *Flow) GetNodeTID() string
- func (m *Flow) GetParentUUID() string
- func (m *Flow) GetStart() int64
- func (f *Flow) GetStartTime() time.Time
- func (m *Flow) GetTrackingID() string
- func (m *Flow) GetTransport() *FlowLayer
- func (m *Flow) GetUUID() string
- func (f *Flow) Init(key string, now int64, packet *gopacket.Packet, length int64, nodeTID string, ...)
- func (*Flow) ProtoMessage()
- func (m *Flow) Reset()
- func (m *Flow) String() string
- func (f *Flow) Update(now int64, packet *gopacket.Packet, length int64)
- func (f *Flow) UpdateUUID(key string, L2ID int64, L3ID int64)
- type FlowLayer
- func (*FlowLayer) Descriptor() ([]byte, []int)
- func (m *FlowLayer) GetA() string
- func (m *FlowLayer) GetB() string
- func (f *FlowLayer) GetFieldInt64(field string) (int64, error)
- func (m *FlowLayer) GetID() int64
- func (m *FlowLayer) GetProtocol() FlowProtocol
- func (f *FlowLayer) GetStringField(field string) (string, error)
- func (fl *FlowLayer) Hash() []byte
- func (fl *FlowLayer) HashStr() string
- func (f *FlowLayer) MarshalJSON() ([]byte, error)
- func (*FlowLayer) ProtoMessage()
- func (m *FlowLayer) Reset()
- func (m *FlowLayer) String() string
- func (f *FlowLayer) UnmarshalJSON(b []byte) error
- type FlowMetric
- func (f *FlowMetric) Add(m common.Metric) common.Metric
- func (f *FlowMetric) Copy() *FlowMetric
- func (*FlowMetric) Descriptor() ([]byte, []int)
- func (m *FlowMetric) GetABBytes() int64
- func (m *FlowMetric) GetABPackets() int64
- func (m *FlowMetric) GetBABytes() int64
- func (m *FlowMetric) GetBAPackets() int64
- func (f *FlowMetric) GetFieldInt64(field string) (int64, error)
- func (*FlowMetric) ProtoMessage()
- func (m *FlowMetric) Reset()
- func (m *FlowMetric) String() string
- type FlowProtocol
- type FlowSearchReply
- type FlowSet
- func (fs *FlowSet) Dedup(field string) error
- func (*FlowSet) Descriptor() ([]byte, []int)
- func (fs *FlowSet) Filter(filter *filters.Filter) *FlowSet
- func (m *FlowSet) GetEnd() int64
- func (m *FlowSet) GetFlows() []*Flow
- func (m *FlowSet) GetStart() int64
- func (fs *FlowSet) Merge(ofs *FlowSet, context MergeContext) error
- func (*FlowSet) ProtoMessage()
- func (m *FlowSet) Reset()
- func (fs *FlowSet) Slice(from, to int)
- func (fs *FlowSet) Sort(order common.SortOrder, orberBy string)
- func (m *FlowSet) String() string
- type Handler
- type ICMPLayer
- func (*ICMPLayer) Descriptor() ([]byte, []int)
- func (m *ICMPLayer) GetCode() uint32
- func (i *ICMPLayer) GetFieldInt64(field string) (int64, error)
- func (m *ICMPLayer) GetID() uint32
- func (i *ICMPLayer) GetStringField(field string) (string, error)
- func (m *ICMPLayer) GetType() ICMPType
- func (i *ICMPLayer) MarshalJSON() ([]byte, error)
- func (*ICMPLayer) ProtoMessage()
- func (m *ICMPLayer) Reset()
- func (m *ICMPLayer) String() string
- func (i *ICMPLayer) UnmarshalJSON(b []byte) error
- type ICMPType
- type ICMPv4
- type ICMPv6
- type Key
- type MergeContext
- type Packet
- type Packets
- type PcapInject
- type Table
- type TableAllocator
- type TableClient
- type TableQuery
- type TableReply
- type TableServer
Constants ¶
const ( // CaptureLength : default packet capture length (256 bytes) CaptureLength uint32 = 256 )
const (
Namespace = "Flow"
)
Namespace "Flow"
Variables ¶
var ErrFlowProtocol = errors.New("FlowProtocol invalid")
ErrFlowProtocol invalid protocol error
var FlowProtocol_name = map[int32]string{
0: "ETHERNET",
1: "IPV4",
2: "TCPPORT",
3: "UDPPORT",
4: "SCTPPORT",
5: "IPV6",
6: "ICMPV4",
7: "ICMPV6",
}
var FlowProtocol_value = map[string]int32{
"ETHERNET": 0,
"IPV4": 1,
"TCPPORT": 2,
"UDPPORT": 3,
"SCTPPORT": 4,
"IPV6": 5,
"ICMPV4": 6,
"ICMPV6": 7,
}
var ICMPType_name = map[int32]string{
0: "UNKNOWN",
1: "DESTINATION_UNREACHABLE",
2: "ECHO",
3: "NEIGHBOR",
4: "ADDRESS_MASK",
5: "INFO",
6: "PARAMETER_PROBLEM",
7: "REDIRECT",
8: "ROUTER",
9: "SOURCE_QUENCH",
10: "TIME_EXCEEDED",
11: "TIMESTAMP",
12: "PACKET_TOO_BIG",
}
var ICMPType_value = map[string]int32{
"UNKNOWN": 0,
"DESTINATION_UNREACHABLE": 1,
"ECHO": 2,
"NEIGHBOR": 3,
"ADDRESS_MASK": 4,
"INFO": 5,
"PARAMETER_PROBLEM": 6,
"REDIRECT": 7,
"ROUTER": 8,
"SOURCE_QUENCH": 9,
"TIME_EXCEEDED": 10,
"TIMESTAMP": 11,
"PACKET_TOO_BIG": 12,
}
var LayerTypeInGRE = gopacket.RegisterLayerType(55555, gopacket.LayerTypeMetadata{Name: "LayerTypeInGRE", Decoder: gopacket.DecodeFunc(decodeInGRELayer)})
LayerTypeInGRE creates a layer type, should be unique and high, so it doesn't conflict, giving it a name and a decoder to use.
Functions ¶
func BPFFilterToRaw ¶
func BPFFilterToRaw(linkType layers.LinkType, captureLength uint32, filter string) ([]bpf.RawInstruction, error)
BPFFilterToRaw creates a raw binary filter from a BPF expression
func HashFromValues ¶
func HashFromValues(ab interface{}, ba interface{}) []byte
HashFromValues calculates a unique symetric flow layer hash
func NewFilterForFlowSet ¶
NewFilterForFlowSet creates a new filter based on a set of flows
func NewFilterForNodeTIDs ¶
NewFilterForNodeTIDs creates a new filter based on flow NodeTID, ANodeTID, BNodeTID
Types ¶
type BPF ¶
type BPF struct {
// contains filtered or unexported fields
}
BPF describes a filter
type Enhancer ¶
type Enhancer interface {
Enhance(flow *Flow)
}
Enhancer should Enhance the flow via this interface
type EnhancerPipeline ¶
type EnhancerPipeline struct {
Enhancers []Enhancer
}
EnhancerPipeline describes a list of flow enhancer
func NewEnhancerPipeline ¶
func NewEnhancerPipeline(enhancers ...Enhancer) *EnhancerPipeline
NewEnhancerPipeline registers a list of flow Enhancer
func (*EnhancerPipeline) AddEnhancer ¶
func (e *EnhancerPipeline) AddEnhancer(en Enhancer)
AddEnhancer registers a new flow enhancer
func (*EnhancerPipeline) Enhance ¶
func (e *EnhancerPipeline) Enhance(flows []*Flow)
Enhance a list of flows
func (*EnhancerPipeline) EnhanceFlow ¶
func (e *EnhancerPipeline) EnhanceFlow(flow *Flow)
EnhanceFlow enhance a flow from with all registered enhancer
type ExpireUpdateFunc ¶
type ExpireUpdateFunc func(f []*Flow)
ExpireUpdateFunc defines expire and updates callback
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"` // Application is the last layer which is not a payload. Application string `protobuf:"bytes,3,opt,name=Application" json:"Application,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"` ICMP *ICMPLayer `protobuf:"bytes,23,opt,name=ICMP" json:"ICMP,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"` Start int64 `protobuf:"varint,10,opt,name=Start" json:"Start"` Last int64 `protobuf:"varint,11,opt,name=Last" json:"Last"` LastUpdateStart int64 `protobuf:"varint,12,opt,name=LastUpdateStart" json:"LastUpdateStart"` LastUpdateLast int64 `protobuf:"varint,13,opt,name=LastUpdateLast" json:"LastUpdateLast"` // 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,50,opt,name=TrackingID" json:"TrackingID,omitempty"` L3TrackingID string `protobuf:"bytes,51,opt,name=L3TrackingID" json:"L3TrackingID,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"` // Topology info NodeTID string `protobuf:"bytes,33,opt,name=NodeTID" json:"NodeTID,omitempty"` ANodeTID string `protobuf:"bytes,34,opt,name=ANodeTID" json:"ANodeTID,omitempty"` BNodeTID string `protobuf:"bytes,35,opt,name=BNodeTID" json:"BNodeTID,omitempty"` }
func (*Flow) Descriptor ¶
func (*Flow) GetANodeTID ¶
func (*Flow) GetApplication ¶
func (*Flow) GetBNodeTID ¶
func (*Flow) GetFieldInt64 ¶
GetFieldInt64 returns the value of a Flow field
func (*Flow) GetFieldString ¶
GetFieldString returns the value of a Flow field
func (*Flow) GetFields ¶
func (f *Flow) GetFields() []interface{}
GetFields returns the list of valid field of a Flow
func (*Flow) GetL3TrackingID ¶
func (*Flow) GetLastUpdateLast ¶
func (*Flow) GetLastUpdateMetric ¶
func (m *Flow) GetLastUpdateMetric() *FlowMetric
func (*Flow) GetLastUpdateStart ¶
func (*Flow) GetLayersPath ¶
func (*Flow) GetMetric ¶
func (m *Flow) GetMetric() *FlowMetric
func (*Flow) GetNetwork ¶
func (*Flow) GetNodeTID ¶
func (*Flow) GetParentUUID ¶
func (*Flow) GetTrackingID ¶
func (*Flow) GetTransport ¶
func (*Flow) Init ¶
func (f *Flow) Init(key string, now int64, packet *gopacket.Packet, length int64, nodeTID string, parentUUID string, L2ID int64, L3ID int64)
Init a flow based on flow key and gopacket
func (*Flow) ProtoMessage ¶
func (*Flow) ProtoMessage()
type FlowLayer ¶
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"` ID int64 `protobuf:"varint,5,opt,name=ID" json:"ID"` }
func (*FlowLayer) Descriptor ¶
func (*FlowLayer) GetFieldInt64 ¶
GetFieldInt64 returns the value of a flow field
func (*FlowLayer) GetProtocol ¶
func (m *FlowLayer) GetProtocol() FlowProtocol
func (*FlowLayer) GetStringField ¶
GetStringField returns the value of a flow field
func (*FlowLayer) MarshalJSON ¶
MarshalJSON serialize a FlowLayer in JSON
func (*FlowLayer) ProtoMessage ¶
func (*FlowLayer) ProtoMessage()
func (*FlowLayer) UnmarshalJSON ¶
UnmarshalJSON deserialize a JSON object in FlowLayer
type FlowMetric ¶
type FlowMetric struct { ABPackets int64 `protobuf:"varint,2,opt,name=ABPackets" json:"ABPackets"` ABBytes int64 `protobuf:"varint,3,opt,name=ABBytes" json:"ABBytes"` BAPackets int64 `protobuf:"varint,4,opt,name=BAPackets" json:"BAPackets"` BABytes int64 `protobuf:"varint,5,opt,name=BABytes" json:"BABytes"` }
func (*FlowMetric) Add ¶
func (f *FlowMetric) Add(m common.Metric) common.Metric
Add sum flow metrics
func (*FlowMetric) Descriptor ¶
func (*FlowMetric) Descriptor() ([]byte, []int)
func (*FlowMetric) GetABBytes ¶
func (m *FlowMetric) GetABBytes() int64
func (*FlowMetric) GetABPackets ¶
func (m *FlowMetric) GetABPackets() int64
func (*FlowMetric) GetBABytes ¶
func (m *FlowMetric) GetBABytes() int64
func (*FlowMetric) GetBAPackets ¶
func (m *FlowMetric) GetBAPackets() int64
func (*FlowMetric) GetFieldInt64 ¶
func (f *FlowMetric) GetFieldInt64(field string) (int64, error)
GetFieldInt64 returns the field value
func (*FlowMetric) ProtoMessage ¶
func (*FlowMetric) ProtoMessage()
func (*FlowMetric) Reset ¶
func (m *FlowMetric) Reset()
func (*FlowMetric) String ¶
func (m *FlowMetric) String() string
type FlowProtocol ¶
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 FlowProtocol_ICMPV4 FlowProtocol = 6 FlowProtocol_ICMPV6 FlowProtocol = 7 )
func (FlowProtocol) EnumDescriptor ¶
func (FlowProtocol) EnumDescriptor() ([]byte, []int)
func (FlowProtocol) String ¶
func (x FlowProtocol) String() string
func (FlowProtocol) Value ¶
func (x FlowProtocol) Value() int32
Value returns int32 value of a FlowProtocol
type FlowSearchReply ¶
type FlowSearchReply struct {
FlowSet *FlowSet `protobuf:"bytes,1,opt,name=FlowSet" json:"FlowSet,omitempty"`
}
func (*FlowSearchReply) Descriptor ¶
func (*FlowSearchReply) Descriptor() ([]byte, []int)
func (*FlowSearchReply) GetFlowSet ¶
func (m *FlowSearchReply) GetFlowSet() *FlowSet
func (*FlowSearchReply) ProtoMessage ¶
func (*FlowSearchReply) ProtoMessage()
func (*FlowSearchReply) Reset ¶
func (m *FlowSearchReply) Reset()
func (*FlowSearchReply) String ¶
func (m *FlowSearchReply) String() string
type FlowSet ¶
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 (*FlowSet) Descriptor ¶
func (*FlowSet) Merge ¶
func (fs *FlowSet) Merge(ofs *FlowSet, context MergeContext) error
Merge merges two FlowSet. If Sorted both of the FlowSet have to be sorted first. If Dedup both of the FlowSet have to be dedup first too.
func (*FlowSet) ProtoMessage ¶
func (*FlowSet) ProtoMessage()
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler defines a flow callback called every time
func NewFlowHandler ¶
func NewFlowHandler(callback ExpireUpdateFunc, every time.Duration) *Handler
NewFlowHandler creates a flow callback handler that will be asynchronously called every time
type ICMPLayer ¶
type ICMPLayer struct { Type ICMPType `protobuf:"varint,1,opt,name=Type,enum=flow.ICMPType" json:"Type,omitempty"` Code uint32 `protobuf:"varint,2,opt,name=Code" json:"Code,omitempty"` ID uint32 `protobuf:"varint,3,opt,name=ID" json:"ID,omitempty"` }
func (*ICMPLayer) Descriptor ¶
func (*ICMPLayer) GetFieldInt64 ¶
GetFieldInt64 returns the value of a ICMP field
func (*ICMPLayer) GetStringField ¶
GetStringField returns the value of a ICMP field
func (*ICMPLayer) MarshalJSON ¶
MarshalJSON serialize a ICMPLayer in JSON
func (*ICMPLayer) ProtoMessage ¶
func (*ICMPLayer) ProtoMessage()
func (*ICMPLayer) UnmarshalJSON ¶
UnmarshalJSON deserialize a JSON object in ICMPLayer
type ICMPType ¶
type ICMPType int32
const ( ICMPType_UNKNOWN ICMPType = 0 ICMPType_DESTINATION_UNREACHABLE ICMPType = 1 ICMPType_ECHO ICMPType = 2 ICMPType_NEIGHBOR ICMPType = 3 ICMPType_ADDRESS_MASK ICMPType = 4 ICMPType_INFO ICMPType = 5 ICMPType_PARAMETER_PROBLEM ICMPType = 6 ICMPType_REDIRECT ICMPType = 7 ICMPType_ROUTER ICMPType = 8 ICMPType_SOURCE_QUENCH ICMPType = 9 ICMPType_TIME_EXCEEDED ICMPType = 10 ICMPType_TIMESTAMP ICMPType = 11 ICMPType_PACKET_TOO_BIG ICMPType = 12 )
func (ICMPType) EnumDescriptor ¶
type Key ¶
type Key string
Key describes a unique flow Key
func KeyFromGoPacket ¶
KeyFromGoPacket returns the unique flow key The unique key is calculated based on parentUUID, network, transport and applicable layers
type MergeContext ¶
type MergeContext struct { Sort bool SortBy string SortOrder common.SortOrder Dedup bool DedupBy string }
MergeContext describes a mechanism to merge flow sets
type Packet ¶
type Packet struct {
// contains filtered or unexported fields
}
Packet describes one packet
type Packets ¶
Packets represents a suite of parent/child Packet
func PacketsFromGoPacket ¶
PacketsFromGoPacket split original packet into multiple packets in case of encapsulation like GRE, VXLAN, etc.
func PacketsFromSFlowSample ¶
func PacketsFromSFlowSample(sample *layers.SFlowFlowSample, t int64, bpf *BPF) []*Packets
PacketsFromSFlowSample returns an array of Packets as a sample contains mutlple records which generate a Packets each.
type PcapInject ¶
PcapInject replay a pcap file
func NewPcapInject ¶
func NewPcapInject(r io.ReadCloser, packetsChan chan *Packets, replay bool, bpfFilter string) (*PcapInject, error)
NewPcapInject reads a pcap from a file reader and inject it in a flow table
func (*PcapInject) FeedFlowTable ¶
func (p *PcapInject) FeedFlowTable()
FeedFlowTable mechanism, inject pcap in a flow table
type Table ¶
type Table struct { PacketsChan chan *Packets // contains filtered or unexported fields }
Table store the flow table and related metrics mechanism
func NewTable ¶
func NewTable(updateHandler *Handler, expireHandler *Handler, pipeline *EnhancerPipeline) *Table
NewTable creates a new flow table
func (*Table) SetNodeTID ¶
SetNodeTID set the nodeTID of a flow table
type TableAllocator ¶
TableAllocator aims to create/allocate a new flow table
func NewTableAllocator ¶
func NewTableAllocator(update, expire time.Duration, pipeline *EnhancerPipeline) *TableAllocator
NewTableAllocator creates a new flow table
func (*TableAllocator) Alloc ¶
func (a *TableAllocator) Alloc(flowCallBack ExpireUpdateFunc) *Table
Alloc instanciate/allocate a new table
func (*TableAllocator) QueryTable ¶
func (a *TableAllocator) QueryTable(query *TableQuery) *TableReply
QueryTable search/query within the flow table
func (*TableAllocator) Release ¶
func (a *TableAllocator) Release(t *Table)
Release release/destroy a flow table
type TableClient ¶
type TableClient struct { shttp.DefaultWSServerEventHandler WSServer *shttp.WSServer // contains filtered or unexported fields }
TableClient describes a mechanism to Query a flow table via flowSet in JSON
func NewTableClient ¶
func NewTableClient(w *shttp.WSServer) *TableClient
NewTableClient creates a new table client based on websocket
func (*TableClient) LookupFlows ¶
func (f *TableClient) LookupFlows(flowSearchQuery filters.SearchQuery) (*FlowSet, error)
LookupFlows query flow table based on a filter search query
func (*TableClient) LookupFlowsByNodes ¶
func (f *TableClient) LookupFlowsByNodes(hnmap topology.HostNodeTIDMap, flowSearchQuery filters.SearchQuery) (*FlowSet, error)
LookupFlowsByNodes query flow table based on multiple nodes
type TableQuery ¶
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 ¶
type TableReply struct { Obj [][]byte // contains filtered or unexported fields }
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 ¶
type TableServer struct { shttp.DefaultWSClientEventHandler WSAsyncClientPool *shttp.WSAsyncClientPool TableAllocator *TableAllocator }
TableServer describes a mechanism to Query a flow table via Websocket
func NewServer ¶
func NewServer(allocator *TableAllocator, wspool *shttp.WSAsyncClientPool) *TableServer
NewServer creates a new flow table query server based on websocket
func (*TableServer) OnMessage ¶
func (s *TableServer) OnMessage(c *shttp.WSAsyncClient, msg shttp.WSMessage)
OnMessage TableQuery
func (*TableServer) OnTableQuery ¶
func (s *TableServer) OnTableQuery(c *shttp.WSAsyncClient, msg shttp.WSMessage)
OnTableQuery event