dispatch classifies the packet, updates flow state, and decides on a verdict. It MUST call packet.Verdict exactly once.
(p platform.Packet)
| 105 | // dispatch classifies the packet, updates flow state, and decides on a |
| 106 | // verdict. It MUST call packet.Verdict exactly once. |
| 107 | func (e *Engine) dispatch(p platform.Packet) { |
| 108 | parsed, err := parse(p.Raw) |
| 109 | if err != nil { |
| 110 | p.Verdict(platform.Accept) |
| 111 | return |
| 112 | } |
| 113 | |
| 114 | key, relevant := e.flowKey(p.Dir, parsed) |
| 115 | if !relevant { |
| 116 | p.Verdict(platform.Accept) |
| 117 | return |
| 118 | } |
| 119 | |
| 120 | if p.Dir == platform.DirOutbound { |
| 121 | e.handleOutbound(key, parsed, p) |
| 122 | return |
| 123 | } |
| 124 | e.handleInbound(key, parsed, p) |
| 125 | } |
| 126 | |
| 127 | // flowState is what we stash alongside each conntrack.Connection so each |
| 128 | // flow can independently choose its own SNI, strategy, and IP-ID delta. |
no test coverage detected