simple_prog.rs 425 B

12345678910111213141516171819
  1. // Socket Filter program for testing with an arbitrary program.
  2. // This is mainly used in tests with consideration for old kernels.
  3. #![no_std]
  4. #![no_main]
  5. use aya_ebpf::{macros::socket_filter, programs::SkBuffContext};
  6. // Introduced in kernel v3.19.
  7. #[socket_filter]
  8. pub fn simple_prog(_ctx: SkBuffContext) -> i64 {
  9. 0
  10. }
  11. #[cfg(not(test))]
  12. #[panic_handler]
  13. fn panic(_info: &core::panic::PanicInfo) -> ! {
  14. loop {}
  15. }