feat: add DSCP rule for Tproxy UDP packets (#996)

* feat: add `DSCP` rule for Tproxy UDP packets

* fix: fix compatibility issue with non_linux platform

* chore: remove redundant lines for DSCP
This commit is contained in:
pretze
2024-01-20 10:19:42 +08:00
committed by GitHub
parent 90ea6ab278
commit 25d6ad220d
9 changed files with 102 additions and 1 deletions

View File

@@ -147,6 +147,7 @@ type Metadata struct {
SpecialProxy string `json:"specialProxy"`
SpecialRules string `json:"specialRules"`
RemoteDst string `json:"remoteDestination"`
DSCP uint8 `json:"dscp"`
RawSrcAddr net.Addr `json:"-"`
RawDstAddr net.Addr `json:"-"`

View File

@@ -14,6 +14,7 @@ const (
SrcPort
DstPort
InPort
DSCP
InUser
InName
InType
@@ -73,6 +74,8 @@ func (rt RuleType) String() string {
return "RuleSet"
case Network:
return "Network"
case DSCP:
return "DSCP"
case Uid:
return "Uid"
case SubRules: