Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

Commit

Permalink
no-op on bad mugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ixv committed Apr 13, 2019
1 parent 46c9247 commit b8e8a1c
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions sys/vane/ames.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,21 @@
::
|%
++ bite :: packet to cake
|= pac=rock ^- cake
|= pac=rock
^- (unit cake)
=+ [mag=(end 5 1 pac) bod=(rsh 5 1 pac)]
=+ :* vez=(end 0 3 mag) :: protocol version
chk=(cut 0 [3 20] mag) :: checksum
wix=(bex +((cut 0 [23 2] mag))) :: width of receiver
vix=(bex +((cut 0 [25 2] mag))) :: width of sender
tay=(cut 0 [27 5] mag) :: message type
==
?> =(protocol-version vez)
?> =(chk (end 0 20 (mug bod)))
:: XX these packets should be firewalled in vere so that they don't
:: make it into the event log
::
?. =(protocol-version vez) ~
?. =(chk (end 0 20 (mug bod))) ~
%- some
:+ [(end 3 wix bod) (cut 3 [wix vix] bod)]
(kins tay)
(rsh 3 (add wix vix) bod)
Expand Down Expand Up @@ -606,19 +611,19 @@
~/ %gnaw
|= [kay=cape ryn=lane pac=rock] :: process packet
^- [p=(list boon) q=fort]
?. =(protocol-version (end 0 3 pac)) [~ fox]
=+ kec=(bite pac)
?: (goop p.p.kec)
=/ kec=(unit cake) (bite pac)
?~ kec [~ fox]
?: (goop p.p.u.kec)
[~ fox]
?. =(our q.p.kec)
?. =(our q.p.u.kec)
[~ fox]
=; zap=[p=(list boon) q=fort]
[(weld p.zap next) q.zap]
=< zork
=< zank
:: ~& [%hear p.p.kec ryn `@p`(mug (shaf %flap pac))]
%- ~(chew la:(ho:um p.p.kec) kay ryn %none (shaf %flap pac))
[q.kec r.kec]
:: ~& [%hear p.p.u.kec ryn `@p`(mug (shaf %flap pac))]
%- ~(chew la:(ho:um p.p.u.kec) kay ryn %none (shaf %flap pac))
[q.u.kec r.u.kec]
::
++ goop :: blacklist
|= him=ship
Expand Down

0 comments on commit b8e8a1c

Please sign in to comment.