This commit is contained in:
@@ -130,49 +130,49 @@ class BaseExpr(BaseModel):
|
||||
extra = "forbid"
|
||||
|
||||
class MetaExpr(BaseExpr):
|
||||
kind: Literal["meta"] = Field("meta", const=True)
|
||||
kind: Literal["meta"] = Field(default="meta")
|
||||
key: MetaKey
|
||||
op: Op = Op.eq
|
||||
value: str
|
||||
|
||||
class EtherExpr(BaseExpr):
|
||||
kind: Literal["ether"] = Field("ether", const=True)
|
||||
kind: Literal["ether"] = Field(default="ether")
|
||||
field: EtherField
|
||||
op: Op = Op.eq
|
||||
value: str
|
||||
|
||||
class IPExpr(BaseExpr):
|
||||
kind: Literal["ip"] = Field("ip", const=True)
|
||||
kind: Literal["ip"] = Field(default="ip")
|
||||
side: IPDir
|
||||
op: Op = Op.eq
|
||||
value: str
|
||||
|
||||
class ProtoPortExpr(BaseExpr):
|
||||
kind: Literal["l4"] = Field("l4", const=True)
|
||||
kind: Literal["l4"] = Field(default="l4")
|
||||
proto: Proto
|
||||
sport: Optional[str] = None
|
||||
dport: Optional[str] = None
|
||||
|
||||
class CTEexpr(BaseExpr):
|
||||
kind: Literal["ct"] = Field("ct", const=True)
|
||||
kind: Literal["ct"] = Field(default="ct")
|
||||
state: ConntrackState
|
||||
|
||||
class VerdictExpr(BaseExpr):
|
||||
kind: Literal["verdict"] = Field("verdict", const=True)
|
||||
kind: Literal["verdict"] = Field(default="verdict")
|
||||
verdict: Verdict
|
||||
|
||||
class RejectExpr(BaseExpr):
|
||||
kind: Literal["reject"] = Field("reject", const=True)
|
||||
kind: Literal["reject"] = Field(default="reject")
|
||||
reject_type: RejectType
|
||||
icmp_type: Optional[IcmpType] = None
|
||||
|
||||
class LogExpr(BaseExpr):
|
||||
kind: Literal["log"] = Field("log", const=True)
|
||||
kind: Literal["log"] = Field(default="log")
|
||||
prefix: Optional[str] = None
|
||||
group: Optional[LogGroup] = None
|
||||
|
||||
class RawExpr(BaseExpr):
|
||||
kind: Literal["raw"] = Field("raw", const=True)
|
||||
kind: Literal["raw"] = Field(default="raw")
|
||||
snippet: str
|
||||
|
||||
# Combine into a discriminated union
|
||||
|
||||
Reference in New Issue
Block a user