8000 GitHub - arcjustin/bpf-ins
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

arcjustin/bpf-ins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bpf-ins

Build Status crates.io mio Lines of Code

A crate for encoding and decoding eBPF instructions.

Usage

use bpf_ins::{Instruction, Register};

//
// return 0
//
let instructions = [
    Instruction::mov32(Register::R0, 0), // mov r0, 0
    Instruction::exit(),                 // exit
];

let mut encoded = vec![];
for instruction in &instructions {
    let (x, y) = instruction.encode();
    encoded.push(x);
    if let Some(y) = y {
        encoded.push(y);
    }
}

License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages

0