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