Files
kubeshark/tap/api/api.go
2021-08-17 15:06:27 +03:00

49 lines
793 B
Go

package api
import (
"bufio"
"plugin"
"time"
)
type Extension struct {
Name string
Path string
Plug *plugin.Plugin
InboundPorts []string
OutboundPorts []string
Dissector Dissector
}
type ConnectionInfo struct {
ClientIP string
ClientPort string
ServerIP string
ServerPort string
IsOutgoing bool
}
type TcpID struct {
SrcIP string
DstIP string
SrcPort string
DstPort string
}
type GenericMessage struct {
IsRequest bool
CaptureTime time.Time
Orig interface{}
}
type RequestResponsePair struct {
Request GenericMessage `json:"request"`
Response GenericMessage `json:"response"`
}
type Dissector interface {
Register(*Extension)
Ping()
Dissect(b *bufio.Reader, isClient bool, tcpID *TcpID) *RequestResponsePair
}