mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-10-22 07:51:30 +00:00
* Update passive_tapper.go and tls_utils.go * Update go.mod, go.sum, and 18 more files... * go fmt * Update http_reader.go, passive_tapper.go, and 3 more files... * Update status_controller.go and status_provider.go Co-authored-by: RamiBerm <rami.berman@up9.com>
40 lines
827 B
Go
40 lines
827 B
Go
package tap
|
|
|
|
type OutboundLinkProtocol string
|
|
|
|
const (
|
|
TLSProtocol OutboundLinkProtocol = "tls"
|
|
)
|
|
|
|
type OutboundLink struct {
|
|
Src string
|
|
DstIP string
|
|
DstPort int
|
|
SuggestedResolvedName string
|
|
SuggestedProtocol OutboundLinkProtocol
|
|
}
|
|
|
|
func NewOutboundLinkWriter() *OutboundLinkWriter {
|
|
return &OutboundLinkWriter{
|
|
OutChan: make(chan *OutboundLink),
|
|
}
|
|
}
|
|
|
|
type OutboundLinkWriter struct {
|
|
OutChan chan *OutboundLink
|
|
}
|
|
|
|
func (olw *OutboundLinkWriter) WriteOutboundLink(src string, DstIP string, DstPort int, SuggestedResolvedName string, SuggestedProtocol OutboundLinkProtocol) {
|
|
olw.OutChan <- &OutboundLink{
|
|
Src: src,
|
|
DstIP: DstIP,
|
|
DstPort: DstPort,
|
|
SuggestedResolvedName: SuggestedResolvedName,
|
|
SuggestedProtocol: SuggestedProtocol,
|
|
}
|
|
}
|
|
|
|
func (olw *OutboundLinkWriter) Stop() {
|
|
close(olw.OutChan)
|
|
}
|