diff --git a/pkg/arvo/gen/hood/ames-snub.hoon b/pkg/arvo/gen/hood/ames-snub.hoon new file mode 100644 index 000000000..575e29c9d --- /dev/null +++ b/pkg/arvo/gen/hood/ames-snub.hoon @@ -0,0 +1,10 @@ +:: Helm: Set Ames Blocklist +:: +/? 310 +:: +:::: + :: +:- %say +|= [^ ships=(list ship) ~] +:- %helm-ames-snub +ships diff --git a/pkg/arvo/lib/hood/helm.hoon b/pkg/arvo/lib/hood/helm.hoon index aecb91c20..6b29348a2 100644 --- a/pkg/arvo/lib/hood/helm.hoon +++ b/pkg/arvo/lib/hood/helm.hoon @@ -202,6 +202,10 @@ |= ships=(list ship) abet:(emit %pass /helm/prod %arvo %a %prod ships) :: +++ poke-ames-snub + |= ships=(list ship) + abet:(emit %pass /helm/snub %arvo %a %snub ships) +:: ++ poke-atom |= ato=@ =+ len=(scow %ud (met 3 ato)) @@ -273,6 +277,7 @@ == ?+ mark ~|([%poke-helm-bad-mark mark] !!) %helm-ames-prod =;(f (f !<(_+<.f vase)) poke-ames-prod) + %helm-ames-snub =;(f (f !<(_+<.f vase)) poke-ames-snub) %helm-ames-sift =;(f (f !<(_+<.f vase)) poke-ames-sift) %helm-ames-verb =;(f (f !<(_+<.f vase)) poke-ames-verb) %helm-ames-wake =;(f (f !<(_+<.f vase)) poke-ames-wake) diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index d9cd3fdcc..9bca8c59b 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -360,6 +360,7 @@ :: %init: vane boot :: %prod: re-send a packet per flow, to all peers if .ships is ~ :: %sift: limit verbosity to .ships + :: %snub: set packet blacklist to .ships :: %spew: set verbosity toggles :: %trim: release memory :: %vega: kernel reload notification @@ -375,6 +376,7 @@ $>(%init vane-task) [%prod ships=(list ship)] [%sift ships=(list ship)] + [%snub ships=(list ship)] [%spew veb=(list verb)] [%stir arg=@t] $>(%trim vane-task) diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index 75ba7ba8d..41b64dd71 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -607,19 +607,20 @@ :: life: our $life; how many times we've rekeyed :: crypto-core: interface for encryption and signing :: bug: debug printing configuration -:: corks(STALE):wires for cork flows pending publisher update +:: snub: blocklist for incoming packets :: :: Note: .corks is only still present for unreleased migration reasons :: +:: +$ ames-state $: peers=(map ship ship-state) =unix=duct =life crypto-core=acru:ames =bug - corks=(set wire) ::TODO unused, remove in next version of state + corks=(set wire) + snub=(set ship) == -:: +$ ames-state-4 ames-state-5 +$ ames-state-5 $: peers=(map ship ship-state-5) @@ -686,6 +687,17 @@ crypto-core=acru:ames =bug == +:: ++$ ames-state-8 + $: peers=(map ship ship-state) + =unix=duct + =life + crypto-core=acru:ames + =bug + corks=(set wire) + == +:: + :: $bug: debug printing configuration :: :: veb: verbosity toggles @@ -842,7 +854,14 @@ :: =< =* adult-gate . =| queued-events=(qeu queued-event) - =| cached-state=(unit $%([%5 ames-state-5] [%6 ames-state-6] [%7 ames-state-7] [%8 ^ames-state])) + =| $= cached-state + %- unit + $% [%5 ames-state-5] + [%6 ames-state-6] + [%7 ames-state-7] + [%8 ames-state-8] + [%9 ^ames-state] + == :: |= [now=@da eny=@ rof=roof] =* larval-gate . @@ -964,7 +983,7 @@ :: lifecycle arms; mostly pass-throughs to the contained adult ames :: ++ scry scry:adult-core - ++ stay [%8 %larva queued-events ames-state.adult-gate] + ++ stay [%9 %larva queued-events ames-state.adult-gate] ++ load |= $= old $% $: %4 @@ -996,6 +1015,13 @@ [%adult state=ames-state-7] == == $: %8 + $% $: %larva + events=(qeu queued-event) + state=ames-state-8 + == + [%adult state=ames-state-8] + == == + $: %9 $% $: %larva events=(qeu queued-event) state=_ames-state.adult-gate @@ -1040,12 +1066,22 @@ =. queued-events events.old larval-gate :: - [%8 %adult *] (load:adult-core %8 state.old) + [%8 %adult *] + =. cached-state `[%8 state.old] + ~> %slog.0^leaf/"ames: larva reload" + larval-gate :: [%8 %larva *] + ~> %slog.0^leaf/"ames: larva: load" + =. queued-events events.old + larval-gate + :: + [%9 %adult *] (load:adult-core %9 state.old) + :: + [%9 %larva *] ~> %slog.1^leaf/"ames: larva: load" =. queued-events events.old - =. adult-gate (load:adult-core %8 state.old) + =. adult-gate (load:adult-core %9 state.old) larval-gate :: == @@ -1064,7 +1100,9 @@ ~> %slog.0^leaf/"ames: init daily recork timer" :- [[/ames]~ %pass /recork %b %wait `@da`(add now ~d1)]~ 8+(state-7-to-8:load:adult-core +.u.cached-state) - ?> ?=(%8 -.u.cached-state) + =? u.cached-state ?=(%8 -.u.cached-state) + 9+(state-8-to-9:load:adult-core +.u.cached-state) + ?> ?=(%9 -.u.cached-state) =. ames-state.adult-gate +.u.cached-state [moz larval-core(cached-state ~)] -- @@ -1103,6 +1141,7 @@ %jilt (on-jilt:event-core ship.task) %prod (on-prod:event-core ships.task) %sift (on-sift:event-core ships.task) + %snub (on-snub:event-core ships.task) %spew (on-spew:event-core veb.task) %stir (on-stir:event-core arg.task) %trim on-trim:event-core @@ -1139,15 +1178,15 @@ [moves ames-gate] :: +stay: extract state before reload :: -++ stay [%8 %adult ames-state] +++ stay [%9 %adult ames-state] :: +load: load in old state after reload :: ++ load =< |= $= old-state - $% [%8 ^ames-state] + $% [%9 ^ames-state] == ^+ ames-gate - ?> ?=(%8 -.old-state) + ?> ?=(%9 -.old-state) ames-gate(ames-state +.old-state) :: |% @@ -1211,7 +1250,7 @@ :: ++ state-7-to-8 |= ames-state=ames-state-7 - ^- ^^ames-state + ^- ames-state-8 :* peers.ames-state unix-duct.ames-state life.ames-state @@ -1219,6 +1258,17 @@ bug.ames-state *(set wire) == + ++ state-8-to-9 + |= ames-state=ames-state-8 + ^- ^^ames-state + :* peers.ames-state + unix-duct.ames-state + life.ames-state + crypto-core.ames-state + bug.ames-state + corks.ames-state + *(set ship) + == -- :: +scry: dereference namespace :: @@ -1431,6 +1481,13 @@ ^+ event-core =. ships.bug.ames-state (sy ships) event-core + :: +on-snub: handle request to change ship blacklist + :: + ++ on-snub + |= ships=(list ship) + ^+ event-core + =. snub.ames-state (sy ships) + event-core :: +on-spew: handle request to set verbosity toggles on debug output :: ++ on-spew @@ -1562,11 +1619,13 @@ ~/ %on-hear-packet |= [=lane =packet dud=(unit goof)] ^+ event-core - %- %^ trace odd.veb sndr.packet - |.("received packet") + %- (trace odd.veb sndr.packet |.("received packet")) :: ?: =(our sndr.packet) event-core + ?: (~(has in snub.ames-state) sndr.packet) + %- (trace rcv.veb sndr.packet |.("snubbed")) + event-core :: %. +< ::