Insn.BpfRaw.decode: def of bend-osdev-bpf@0.1.0.0 Import: import bend-osdev-bpf@0.1.0.0/insn.bend as Insn Lines 241-295 of bend-osdev-bpf@0.1.0.0/insn.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-bpf@0.1.0.0/insn.bend&start_line=241&end_line=295 import Base # the instruction a sock_filter holds, or None for an opcode classic BPF does # not define; fields the instruction does not use are ignored def BpfRaw.decode(r: BpfRaw) -> Maybe<&2, BpfOp>: match r: case BpfRaw{+code, +jt, +jf, +k}: BpfRaw.decode.pick(U32.is_eq(code, 32), BpfLdAbs{BpfW{}, k}, BpfRaw.decode.pick(U32.is_eq(code, 40), BpfLdAbs{BpfH{}, k}, BpfRaw.decode.pick(U32.is_eq(code, 48), BpfLdAbs{BpfB{}, k}, BpfRaw.decode.pick(U32.is_eq(code, 64), BpfLdInd{BpfW{}, k}, BpfRaw.decode.pick(U32.is_eq(code, 72), BpfLdInd{BpfH{}, k}, BpfRaw.decode.pick(U32.is_eq(code, 80), BpfLdInd{BpfB{}, k}, BpfRaw.decode.pick(U32.is_eq(code, 0), BpfLdImm{k}, BpfRaw.decode.pick(U32.is_eq(code, 128), BpfLdLen{}, BpfRaw.decode.pick(U32.is_eq(code, 96), BpfLdMem{k}, BpfRaw.decode.pick(U32.is_eq(code, 1), BpfLdxImm{k}, BpfRaw.decode.pick(U32.is_eq(code, 97), BpfLdxMem{k}, BpfRaw.decode.pick(U32.is_eq(code, 129), BpfLdxLen{}, BpfRaw.decode.pick(U32.is_eq(code, 177), BpfLdxMsh{k}, BpfRaw.decode.pick(U32.is_eq(code, 2), BpfSt{k}, BpfRaw.decode.pick(U32.is_eq(code, 3), BpfStx{k}, BpfRaw.decode.pick(U32.is_eq(code, 4), BpfAlu{BpfAdd{}, BpfK{k}}, BpfRaw.decode.pick(U32.is_eq(code, 12), BpfAlu{BpfAdd{}, BpfX{}}, BpfRaw.decode.pick(U32.is_eq(code, 20), BpfAlu{BpfSub{}, BpfK{k}}, BpfRaw.decode.pick(U32.is_eq(code, 28), BpfAlu{BpfSub{}, BpfX{}}, BpfRaw.decode.pick(U32.is_eq(code, 36), BpfAlu{BpfMul{}, BpfK{k}}, BpfRaw.decode.pick(U32.is_eq(code, 44), BpfAlu{BpfMul{}, BpfX{}}, BpfRaw.decode.pick(U32.is_eq(code, 52), BpfAlu{BpfDiv{}, BpfK{k}}, BpfRaw.decode.pick(U32.is_eq(code, 60), BpfAlu{BpfDiv{}, BpfX{}}, BpfRaw.decode.pick(U32.is_eq(code, 68), BpfAlu{BpfOr{}, BpfK{k}}, BpfRaw.decode.pick(U32.is_eq(code, 76), BpfAlu{BpfOr{}, BpfX{}}, BpfRaw.decode.pick(U32.is_eq(code, 84), BpfAlu{BpfAnd{}, BpfK{k}}, BpfRaw.decode.pick(U32.is_eq(code, 92), BpfAlu{BpfAnd{}, BpfX{}}, BpfRaw.decode.pick(U32.is_eq(code, 100), BpfAlu{BpfLsh{}, BpfK{k}}, BpfRaw.decode.pick(U32.is_eq(code, 108), BpfAlu{BpfLsh{}, BpfX{}}, BpfRaw.decode.pick(U32.is_eq(code, 116), BpfAlu{BpfRsh{}, BpfK{k}}, BpfRaw.decode.pick(U32.is_eq(code, 124), BpfAlu{BpfRsh{}, BpfX{}}, BpfRaw.decode.pick(U32.is_eq(code, 148), BpfAlu{BpfMod{}, BpfK{k}}, BpfRaw.decode.pick(U32.is_eq(code, 156), BpfAlu{BpfMod{}, BpfX{}}, BpfRaw.decode.pick(U32.is_eq(code, 164), BpfAlu{BpfXor{}, BpfK{k}}, BpfRaw.decode.pick(U32.is_eq(code, 172), BpfAlu{BpfXor{}, BpfX{}}, BpfRaw.decode.pick(U32.is_eq(code, 132), BpfNeg{}, BpfRaw.decode.pick(U32.is_eq(code, 5), BpfJa{k}, BpfRaw.decode.pick(U32.is_eq(code, 21), BpfJmp{BpfJeq{}, BpfK{k}, jt, jf}, BpfRaw.decode.pick(U32.is_eq(code, 29), BpfJmp{BpfJeq{}, BpfX{}, jt, jf}, BpfRaw.decode.pick(U32.is_eq(code, 37), BpfJmp{BpfJgt{}, BpfK{k}, jt, jf}, BpfRaw.decode.pick(U32.is_eq(code, 45), BpfJmp{BpfJgt{}, BpfX{}, jt, jf}, BpfRaw.decode.pick(U32.is_eq(code, 53), BpfJmp{BpfJge{}, BpfK{k}, jt, jf}, BpfRaw.decode.pick(U32.is_eq(code, 61), BpfJmp{BpfJge{}, BpfX{}, jt, jf}, BpfRaw.decode.pick(U32.is_eq(code, 69), BpfJmp{BpfJset{}, BpfK{k}, jt, jf}, BpfRaw.decode.pick(U32.is_eq(code, 77), BpfJmp{BpfJset{}, BpfX{}, jt, jf}, BpfRaw.decode.pick(U32.is_eq(code, 6), BpfRet{BpfRetK{k}}, BpfRaw.decode.pick(U32.is_eq(code, 22), BpfRet{BpfRetA{}}, BpfRaw.decode.pick(U32.is_eq(code, 7), BpfTax{}, BpfRaw.decode.pick(U32.is_eq(code, 135), BpfTxa{}, None{}))))))))))))))))))))))))))))))))))))))))))))))))) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/insn.bend&name=BpfAluOp https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/insn.bend&name=BpfCond https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/insn.bend&name=BpfOp https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/insn.bend&name=BpfRaw https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/insn.bend&name=BpfRaw.decode.pick https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/insn.bend&name=BpfRval https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/insn.bend&name=BpfSize https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/insn.bend&name=BpfSrc