You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working on #6, looking at #10, #9 and #8. I see that we have a lack of high-level stack of bpf instructions.
Personally, I see it as the following:
structInsnStack{head:RefToInsn// points on the first instruction that will be executed
tail:RefToInsn// points on `exit` instuction, unless it is an invalid bpf program}implInsnStack{pubfncreate() -> Self{//...}pubfndisassemble() -> String{//...}//may be a bunch of functions from #6 ... I am ok if we remove `insn_builder` modulepubfnpatch(patch:MbuffStructure){//...}pubfnvalidate() -> Result<ValidInsnStack,ValidationError>{// <- the same as InsnStack but `tail` always points to `exit` Insn :smile://...}}pubfnparse_assemble(raw_bpf_asm:String) -> InsnStack{//...}
RefToInsn can be any type of reference, however, we could not use Box here.
Having that structure we can provide API to easily manipulate its content.
PS1: again as in #12 we need to do some prototype here.
PS2: I also don't like that we have the bunch of different structures that in some or other way represent bpf instruction, but I don't see the solution to this problem right now.
The text was updated successfully, but these errors were encountered:
Hi, having this kind of structure to unify program handling seems a good thing. Thanks for proposing!
Apart from the .patch() use case—for which we might have to change the number of instructions if we ever get something good enough in the future—what would we earn with a stack over some vector / array of instructions as we had this far?
Working on #6, looking at #10, #9 and #8. I see that we have a lack of high-level stack of
bpf
instructions.Personally, I see it as the following:
RefToInsn
can be any type of reference, however, we could not useBox
here.Having that structure we can provide API to easily manipulate its content.
@qmonnet, thoughts?
PS1: again as in #12 we need to do some prototype here.
PS2: I also don't like that we have the bunch of different structures that in some or other way represent
bpf
instruction, but I don't see the solution to this problem right now.The text was updated successfully, but these errors were encountered: