Skip to content

Commit 08f21fb

Browse files
authored
Add Flow ID (#27)
* Add Flow ID * replace FlowId with uint64
1 parent da9336b commit 08f21fb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

api.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"sync"
99
"time"
1010

11-
"github.com/google/uuid"
1211
capture "github.com/kubeshark/api2/pkg/proto/capture/v1"
1312
protoCommon "github.com/kubeshark/api2/pkg/proto/common/v1"
1413
"github.com/kubeshark/gopacket"
@@ -723,6 +722,7 @@ type OutputChannelItem struct {
723722
Capture *Capture
724723
Checksums []string
725724
MatcherKey string
725+
FlowId uint64
726726
}
727727

728728
type ReadProgress struct {
@@ -757,7 +757,7 @@ type Dissector interface {
757757
Dissect(b *bufio.Reader, reader TcpReader) (err error)
758758
Analyze(item *OutputChannelItem, resolvedSource *Resolution, resolvedDestination *Resolution) *Entry
759759
Summarize(entry *Entry) *BaseEntry
760-
Summarize2(entry *Entry, id uuid.UUID) *capture.BaseEntry
760+
Summarize2(entry *Entry, id uint64) *capture.BaseEntry
761761
Represent(request interface{}, response interface{}, event *Event, data interface{}) (representation *Representation)
762762
Macros() map[string]string
763763
NewResponseRequestMatcher() RequestResponseMatcher
@@ -787,6 +787,7 @@ func (e *Emitting) Emit(item *OutputChannelItem) {
787787
item.Stream = e.Stream.GetPcapId()
788788
item.Index = e.Stream.GetIndex()
789789
item.Tls = e.Stream.GetTls()
790+
item.FlowId = e.Stream.GetFlowID()
790791
e.Stream.IncrementItemCount()
791792
e.OutputChannel <- item
792793
}
@@ -894,6 +895,7 @@ type Entry struct {
894895
NetworkProps *protoCommon.NetworkProperties `json:"networkProps"`
895896
CaptureSource protoCommon.CaptureSource `json:"captureSource"`
896897
SubProtocol protoCommon.DissectedSubProtocol `json:"subProtocol"`
898+
FlowId uint64 `json:"flowId"`
897899
}
898900

899901
func (e *Entry) BuildId() {
@@ -1133,6 +1135,7 @@ type TcpStream interface {
11331135
GetChecksums() []string
11341136
GetNetworkProps() *protoCommon.NetworkProperties
11351137
GetCaptureSource() protoCommon.CaptureSource
1138+
GetFlowID() uint64
11361139
Lock()
11371140
Unlock()
11381141
}

0 commit comments

Comments
 (0)