Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 43 additions & 41 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/google/uuid"
capture "github.com/kubeshark/api2/pkg/proto/capture/v1"
common "github.com/kubeshark/api2/pkg/proto/common/v1"
protoCommon "github.com/kubeshark/api2/pkg/proto/common/v1"
"github.com/kubeshark/gopacket"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -364,9 +363,10 @@ type ResolutionSummary struct {
}

type Extension struct {
Protocol *Protocol
Path string
Dissector Dissector
Protocol *Protocol
SubProtocol *protoCommon.DissectedSubProtocol
Path string
Dissector Dissector
}

type VLAN struct {
Expand Down Expand Up @@ -714,7 +714,7 @@ type OutputChannelItem struct {
Protocol Protocol
Timestamp int64
ConnectionInfo *ConnectionInfo
NetworkProps *common.NetworkProperties
NetworkProps *protoCommon.NetworkProperties
CaptureSource protoCommon.CaptureSource
Pair *RequestResponsePair
Data *GenericMessage
Expand Down Expand Up @@ -858,41 +858,42 @@ type Event struct {

// {Worker}/{Stream}-{Index} uniquely identifies an item
type Entry struct {
Id string `json:"id"`
Index int64 `json:"index"`
Stream string `json:"stream"`
Worker string `json:"worker"`
Node *Node `json:"node"`
Protocol Protocol `json:"protocol"`
Tls bool `json:"tls"`
Source *Resolution `json:"src"`
Destination *Resolution `json:"dst"`
Timestamp int64 `json:"timestamp"`
StartTime time.Time `json:"startTime"`
Request interface{} `json:"request"`
Response interface{} `json:"response"`
RequestRef string `json:"requestRef"`
ResponseRef string `json:"responseRef"`
RequestSize int `json:"requestSize"`
ResponseSize int `json:"responseSize"`
ElapsedTime int64 `json:"elapsedTime"`
Passed bool `json:"passed"`
Failed bool `json:"failed"`
Error *Error `json:"error"`
EntryFile string `json:"entryFile"`
Record string `json:"record"`
Event *Event `json:"event"`
EventRef string `json:"eventRef"`
Base *BaseEntry `json:"base"`
Capture *Capture `json:"capture"`
Checksums []string `json:"checksums"`
Duplicate string `json:"duplicate"`
Data interface{} `json:"data"`
DataRef string `json:"dataRef"`
Size int `json:"size"`
MatcherKey string `json:"matcherKey"`
NetworkProps *common.NetworkProperties
CaptureSource protoCommon.CaptureSource
Id string `json:"id"`
Index int64 `json:"index"`
Stream string `json:"stream"`
Worker string `json:"worker"`
Node *Node `json:"node"`
Protocol Protocol `json:"protocol"`
Tls bool `json:"tls"`
Source *Resolution `json:"src"`
Destination *Resolution `json:"dst"`
Timestamp int64 `json:"timestamp"`
StartTime time.Time `json:"startTime"`
Request interface{} `json:"request"`
Response interface{} `json:"response"`
RequestRef string `json:"requestRef"`
ResponseRef string `json:"responseRef"`
RequestSize int `json:"requestSize"`
ResponseSize int `json:"responseSize"`
ElapsedTime int64 `json:"elapsedTime"`
Passed bool `json:"passed"`
Failed bool `json:"failed"`
Error *Error `json:"error"`
EntryFile string `json:"entryFile"`
Record string `json:"record"`
Event *Event `json:"event"`
EventRef string `json:"eventRef"`
Base *BaseEntry `json:"base"`
Capture *Capture `json:"capture"`
Checksums []string `json:"checksums"`
Duplicate string `json:"duplicate"`
Data interface{} `json:"data"`
DataRef string `json:"dataRef"`
Size int `json:"size"`
MatcherKey string `json:"matcherKey"`
NetworkProps *protoCommon.NetworkProperties `json:"networkProps"`
CaptureSource protoCommon.CaptureSource `json:"captureSource"`
SubProtocol protoCommon.DissectedSubProtocol `json:"subProtocol"`
}

func (e *Entry) BuildId() {
Expand Down Expand Up @@ -1130,7 +1131,8 @@ type TcpStream interface {
GetTls() bool
GetCapture() *Capture
GetChecksums() []string
GetNetworkProps() *common.NetworkProperties
GetNetworkProps() *protoCommon.NetworkProperties
GetCaptureSource() protoCommon.CaptureSource
Lock()
Unlock()
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22.5

require (
github.com/google/uuid v1.6.0
github.com/kubeshark/api2 v0.0.0-20250616171331-0bb2df0d448a
github.com/kubeshark/api2 v0.0.0-20250721140118-e9883b737a5e
github.com/kubeshark/gopacket v1.1.30
k8s.io/api v0.27.2
)
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubeshark/api2 v0.0.0-20250616171331-0bb2df0d448a h1:+0APmVFqmmpibP2oluAdyqnD05z17iq+sSQvSXj2w2A=
github.com/kubeshark/api2 v0.0.0-20250616171331-0bb2df0d448a/go.mod h1:naOqOy71RRXeKPVH7/Vr2cGbyRDLg9sPKDBeOxdNCWU=
github.com/kubeshark/api2 v0.0.0-20250721140118-e9883b737a5e h1:D3iK1id1o03JWZ0s0d/bNvFhsN5hBGiol45ZvxpSG10=
github.com/kubeshark/api2 v0.0.0-20250721140118-e9883b737a5e/go.mod h1:u+RE/jKLCmogSqEVuTgV3/g5ae2g2Jr/Bz5L/w8rLZc=
github.com/kubeshark/gopacket v1.1.30 h1:Dz6eo7b6+NdVCrgiyKxlGEVTm0L6PwgbVvSomsuwIyU=
github.com/kubeshark/gopacket v1.1.30/go.mod h1:Qo8/i/tdT74CCT7/pjO0L55Pktv5dQfj7M/Arv8MKm8=
github.com/kubeshark/tracerproto v1.0.0 h1:/euPX9KMrKDS92hSMrLuhncYAX22dYlsnM2aD4AYhhE=
Expand All @@ -39,8 +39,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
Expand Down