diff --git a/virtweb_frontend/src/widgets/forms/NWFilterRules.tsx b/virtweb_frontend/src/widgets/forms/NWFilterRules.tsx index ad699dc..fe56dd6 100644 --- a/virtweb_frontend/src/widgets/forms/NWFilterRules.tsx +++ b/virtweb_frontend/src/widgets/forms/NWFilterRules.tsx @@ -13,6 +13,7 @@ import { import { NWFSArp, NWFSArpOrRARP, + NWFSIPBase, NWFSMac, NWFSelector, NWFilterRule, @@ -246,6 +247,14 @@ function NWFSelectorEdit(p: { )} + {p.selector.type === "ipv4" && ( + + )} + + {p.selector.type === "ipv6" && ( + + )} + { onChange?: () => void; } +interface SpecificSelectorEditorWithIPVersion + extends SpecificSelectorEditor { + version: 4 | 6; +} + function NWFSelectorMac( p: SpecificSelectorEditor ): React.ReactElement { @@ -391,3 +405,72 @@ function NWFSelectorArp( ); } + +function NWFSelectorIP( + p: SpecificSelectorEditorWithIPVersion +): React.ReactElement { + return ( + <> + { + p.selector.srcmacaddr = v; + p.onChange?.(); + }} + /> + { + p.selector.srcmacaddr = v; + p.onChange?.(); + }} + /> + { + p.selector.dstmacaddr = v; + p.onChange?.(); + }} + /> + { + p.selector.dstmacaddr = v; + p.onChange?.(); + }} + /> + { + p.selector.srcipaddr = ip; + p.selector.srcipmask = mask; + p.onChange?.(); + }} + /> + { + p.selector.dstipaddr = ip; + p.selector.dstipmask = mask; + p.onChange?.(); + }} + /> + + ); +}