Chore: move find connection process to tunnel (#2016)

This commit is contained in:
Kr328
2022-03-12 19:07:53 +08:00
committed by GitHub
parent 9683c297a7
commit b866f06414
16 changed files with 84 additions and 64 deletions

View File

@ -63,15 +63,16 @@ func (t Type) MarshalJSON() ([]byte, error) {
// Metadata is used to store connection address
type Metadata struct {
NetWork NetWork `json:"network"`
Type Type `json:"type"`
SrcIP net.IP `json:"sourceIP"`
DstIP net.IP `json:"destinationIP"`
SrcPort string `json:"sourcePort"`
DstPort string `json:"destinationPort"`
AddrType int `json:"-"`
Host string `json:"host"`
DNSMode DNSMode `json:"dnsMode"`
NetWork NetWork `json:"network"`
Type Type `json:"type"`
SrcIP net.IP `json:"sourceIP"`
DstIP net.IP `json:"destinationIP"`
SrcPort string `json:"sourcePort"`
DstPort string `json:"destinationPort"`
AddrType int `json:"-"`
Host string `json:"host"`
DNSMode DNSMode `json:"dnsMode"`
ProcessPath string `json:"processPath"`
}
func (m *Metadata) RemoteAddress() string {

View File

@ -11,6 +11,7 @@ const (
SrcPort
DstPort
Process
ProcessPath
MATCH
)
@ -36,6 +37,8 @@ func (rt RuleType) String() string {
return "DstPort"
case Process:
return "Process"
case ProcessPath:
return "ProcessPath"
case MATCH:
return "Match"
default:
@ -49,4 +52,5 @@ type Rule interface {
Adapter() string
Payload() string
ShouldResolveIP() bool
ShouldFindProcess() bool
}