|
|
@ -182,19 +182,19 @@ unsafe fn try_{{crate_name}}(ctx: XdpContext) -> Result<u32, u32> {
|
|
|
|
{%- when "classifier" %}
|
|
|
|
{%- when "classifier" %}
|
|
|
|
use aya_bpf::{
|
|
|
|
use aya_bpf::{
|
|
|
|
macros::classifier,
|
|
|
|
macros::classifier,
|
|
|
|
programs::SkBuffContext,
|
|
|
|
programs::TcContext,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
use aya_log_ebpf::info;
|
|
|
|
use aya_log_ebpf::info;
|
|
|
|
|
|
|
|
|
|
|
|
#[classifier(name="{{crate_name}}")]
|
|
|
|
#[classifier(name="{{crate_name}}")]
|
|
|
|
pub fn {{crate_name}}(ctx: SkBuffContext) -> i32 {
|
|
|
|
pub fn {{crate_name}}(ctx: TcContext) -> i32 {
|
|
|
|
match unsafe { try_{{crate_name}}(ctx) } {
|
|
|
|
match unsafe { try_{{crate_name}}(ctx) } {
|
|
|
|
Ok(ret) => ret,
|
|
|
|
Ok(ret) => ret,
|
|
|
|
Err(ret) => ret,
|
|
|
|
Err(ret) => ret,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unsafe fn try_{{crate_name}}(ctx: SkBuffContext) -> Result<i32, i32> {
|
|
|
|
unsafe fn try_{{crate_name}}(ctx: TcContext) -> Result<i32, i32> {
|
|
|
|
info!(&ctx, "received a packet");
|
|
|
|
info!(&ctx, "received a packet");
|
|
|
|
Ok(0)
|
|
|
|
Ok(0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|