Define a type for the eBPF helper functions
qmonnet opened this issue · comments
So we declare a type for a verifier function:
pub type Verifier = fn(prog: &[u8]) -> Result<(), Error>;
Would be nice to have the same for the helpers. So that instead of:
pub fn register_helper(&mut self,
key: u32,
function: fn (u64, u64, u64, u64, u64) -> u64)
-> Result<(), Error>
... we'd have something like:
pub fn register_helper(&mut self,
key: u32,
function: Helper) -> Result<(), Error>
(EbpfHelper
or Helper
, I don't really know what sounds best. Maybe just Helper
if people call that with the rbpf::
prefix already?)
From discussion on #32.