From d7af6acb42055ed1e0571bdc4d7dbbfa46c5835e Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Tue, 5 Mar 2024 11:04:21 +0000 Subject: [PATCH] chore(aya-ebpf): Rename BpfContext -> EbpfContext Signed-off-by: Dave Tucker --- ebpf/aya-ebpf/src/lib.rs | 2 +- ebpf/aya-ebpf/src/maps/perf/perf_event_array.rs | 6 +++--- ebpf/aya-ebpf/src/maps/perf/perf_event_byte_array.rs | 6 +++--- ebpf/aya-ebpf/src/maps/program_array.rs | 6 +++--- ebpf/aya-ebpf/src/maps/sock_hash.rs | 2 +- ebpf/aya-ebpf/src/maps/sock_map.rs | 2 +- ebpf/aya-ebpf/src/maps/stack_trace.rs | 4 ++-- ebpf/aya-ebpf/src/programs/device.rs | 4 ++-- ebpf/aya-ebpf/src/programs/fentry.rs | 4 ++-- ebpf/aya-ebpf/src/programs/fexit.rs | 4 ++-- ebpf/aya-ebpf/src/programs/lsm.rs | 4 ++-- ebpf/aya-ebpf/src/programs/perf_event.rs | 4 ++-- ebpf/aya-ebpf/src/programs/probe.rs | 4 ++-- ebpf/aya-ebpf/src/programs/raw_tracepoint.rs | 4 ++-- ebpf/aya-ebpf/src/programs/sk_buff.rs | 4 ++-- ebpf/aya-ebpf/src/programs/sk_lookup.rs | 4 ++-- ebpf/aya-ebpf/src/programs/sk_msg.rs | 4 ++-- ebpf/aya-ebpf/src/programs/sock.rs | 4 ++-- ebpf/aya-ebpf/src/programs/sock_addr.rs | 4 ++-- ebpf/aya-ebpf/src/programs/sock_ops.rs | 4 ++-- ebpf/aya-ebpf/src/programs/sockopt.rs | 4 ++-- ebpf/aya-ebpf/src/programs/sysctl.rs | 4 ++-- ebpf/aya-ebpf/src/programs/tc.rs | 4 ++-- ebpf/aya-ebpf/src/programs/tp_btf.rs | 4 ++-- ebpf/aya-ebpf/src/programs/tracepoint.rs | 4 ++-- ebpf/aya-ebpf/src/programs/xdp.rs | 4 ++-- 26 files changed, 52 insertions(+), 52 deletions(-) diff --git a/ebpf/aya-ebpf/src/lib.rs b/ebpf/aya-ebpf/src/lib.rs index 20d75958..d02b0229 100644 --- a/ebpf/aya-ebpf/src/lib.rs +++ b/ebpf/aya-ebpf/src/lib.rs @@ -36,7 +36,7 @@ use helpers::{bpf_get_current_comm, bpf_get_current_pid_tgid, bpf_get_current_ui pub const TASK_COMM_LEN: usize = 16; -pub trait BpfContext { +pub trait EbpfContext { fn as_ptr(&self) -> *mut c_void; #[inline] diff --git a/ebpf/aya-ebpf/src/maps/perf/perf_event_array.rs b/ebpf/aya-ebpf/src/maps/perf/perf_event_array.rs index f7c874a6..6d0e51e8 100644 --- a/ebpf/aya-ebpf/src/maps/perf/perf_event_array.rs +++ b/ebpf/aya-ebpf/src/maps/perf/perf_event_array.rs @@ -4,7 +4,7 @@ use crate::{ bindings::{bpf_map_def, bpf_map_type::BPF_MAP_TYPE_PERF_EVENT_ARRAY, BPF_F_CURRENT_CPU}, helpers::bpf_perf_event_output, maps::PinningType, - BpfContext, + EbpfContext, }; #[repr(transparent)] @@ -50,11 +50,11 @@ impl PerfEventArray { } } - pub fn output(&self, ctx: &C, data: &T, flags: u32) { + pub fn output(&self, ctx: &C, data: &T, flags: u32) { self.output_at_index(ctx, BPF_F_CURRENT_CPU as u32, data, flags) } - pub fn output_at_index(&self, ctx: &C, index: u32, data: &T, flags: u32) { + pub fn output_at_index(&self, ctx: &C, index: u32, data: &T, flags: u32) { let flags = u64::from(flags) << 32 | u64::from(index); unsafe { bpf_perf_event_output( diff --git a/ebpf/aya-ebpf/src/maps/perf/perf_event_byte_array.rs b/ebpf/aya-ebpf/src/maps/perf/perf_event_byte_array.rs index d583b7c2..f7cf75cf 100644 --- a/ebpf/aya-ebpf/src/maps/perf/perf_event_byte_array.rs +++ b/ebpf/aya-ebpf/src/maps/perf/perf_event_byte_array.rs @@ -4,7 +4,7 @@ use crate::{ bindings::{bpf_map_def, bpf_map_type::BPF_MAP_TYPE_PERF_EVENT_ARRAY, BPF_F_CURRENT_CPU}, helpers::bpf_perf_event_output, maps::PinningType, - BpfContext, + EbpfContext, }; #[repr(transparent)] @@ -47,11 +47,11 @@ impl PerfEventByteArray { } } - pub fn output(&self, ctx: &C, data: &[u8], flags: u32) { + pub fn output(&self, ctx: &C, data: &[u8], flags: u32) { self.output_at_index(ctx, BPF_F_CURRENT_CPU as u32, data, flags) } - pub fn output_at_index(&self, ctx: &C, index: u32, data: &[u8], flags: u32) { + pub fn output_at_index(&self, ctx: &C, index: u32, data: &[u8], flags: u32) { let flags = u64::from(flags) << 32 | u64::from(index); unsafe { bpf_perf_event_output( diff --git a/ebpf/aya-ebpf/src/maps/program_array.rs b/ebpf/aya-ebpf/src/maps/program_array.rs index 05e1949d..786b98a7 100644 --- a/ebpf/aya-ebpf/src/maps/program_array.rs +++ b/ebpf/aya-ebpf/src/maps/program_array.rs @@ -6,7 +6,7 @@ use crate::{ bindings::{bpf_map_def, bpf_map_type::BPF_MAP_TYPE_PROG_ARRAY}, helpers::bpf_tail_call, maps::PinningType, - BpfContext, + EbpfContext, }; /// A BPF map that stores an array of program indices for tail calling. @@ -81,7 +81,7 @@ impl ProgramArray { /// On success, this function **does not return** into the original program. /// On failure, a negative error is returned, wrapped in `Err()`. #[cfg(not(unstable))] - pub unsafe fn tail_call(&self, ctx: &C, index: u32) -> Result<(), c_long> { + pub unsafe fn tail_call(&self, ctx: &C, index: u32) -> Result<(), c_long> { let res = bpf_tail_call(ctx.as_ptr(), self.def.get() as *mut _, index); if res != 0 { Err(res) @@ -104,7 +104,7 @@ impl ProgramArray { /// On success, this function **does not return** into the original program. /// On failure, a negative error is returned, wrapped in `Err()`. #[cfg(unstable)] - pub unsafe fn tail_call(&self, ctx: &C, index: u32) -> Result { + pub unsafe fn tail_call(&self, ctx: &C, index: u32) -> Result { let res = bpf_tail_call(ctx.as_ptr(), self.def.get() as *mut _, index); if res != 0 { Err(res) diff --git a/ebpf/aya-ebpf/src/maps/sock_hash.rs b/ebpf/aya-ebpf/src/maps/sock_hash.rs index 3a0f3e12..3ccf52b8 100644 --- a/ebpf/aya-ebpf/src/maps/sock_hash.rs +++ b/ebpf/aya-ebpf/src/maps/sock_hash.rs @@ -10,7 +10,7 @@ use crate::{ }, maps::PinningType, programs::{SkBuffContext, SkLookupContext, SkMsgContext}, - BpfContext, + EbpfContext, }; #[repr(transparent)] diff --git a/ebpf/aya-ebpf/src/maps/sock_map.rs b/ebpf/aya-ebpf/src/maps/sock_map.rs index 78a5431b..5d741a9a 100644 --- a/ebpf/aya-ebpf/src/maps/sock_map.rs +++ b/ebpf/aya-ebpf/src/maps/sock_map.rs @@ -10,7 +10,7 @@ use crate::{ }, maps::PinningType, programs::{SkBuffContext, SkLookupContext, SkMsgContext}, - BpfContext, + EbpfContext, }; #[repr(transparent)] diff --git a/ebpf/aya-ebpf/src/maps/stack_trace.rs b/ebpf/aya-ebpf/src/maps/stack_trace.rs index 647e3dd4..6685b4c5 100644 --- a/ebpf/aya-ebpf/src/maps/stack_trace.rs +++ b/ebpf/aya-ebpf/src/maps/stack_trace.rs @@ -4,7 +4,7 @@ use crate::{ bindings::{bpf_map_def, bpf_map_type::BPF_MAP_TYPE_STACK_TRACE}, helpers::bpf_get_stackid, maps::PinningType, - BpfContext, + EbpfContext, }; #[repr(transparent)] @@ -45,7 +45,7 @@ impl StackTrace { } } - pub unsafe fn get_stackid(&self, ctx: &C, flags: u64) -> Result { + pub unsafe fn get_stackid(&self, ctx: &C, flags: u64) -> Result { let ret = bpf_get_stackid(ctx.as_ptr(), self.def.get() as *mut _, flags); if ret < 0 { Err(ret) diff --git a/ebpf/aya-ebpf/src/programs/device.rs b/ebpf/aya-ebpf/src/programs/device.rs index 876756d5..899aa7fc 100644 --- a/ebpf/aya-ebpf/src/programs/device.rs +++ b/ebpf/aya-ebpf/src/programs/device.rs @@ -1,6 +1,6 @@ use core::ffi::c_void; -use crate::{bindings::bpf_cgroup_dev_ctx, BpfContext}; +use crate::{bindings::bpf_cgroup_dev_ctx, EbpfContext}; pub struct DeviceContext { pub device: *mut bpf_cgroup_dev_ctx, @@ -12,7 +12,7 @@ impl DeviceContext { } } -impl BpfContext for DeviceContext { +impl EbpfContext for DeviceContext { fn as_ptr(&self) -> *mut c_void { self.device as *mut _ } diff --git a/ebpf/aya-ebpf/src/programs/fentry.rs b/ebpf/aya-ebpf/src/programs/fentry.rs index 769c9859..af82ca7c 100644 --- a/ebpf/aya-ebpf/src/programs/fentry.rs +++ b/ebpf/aya-ebpf/src/programs/fentry.rs @@ -1,6 +1,6 @@ use core::ffi::c_void; -use crate::{args::FromBtfArgument, BpfContext}; +use crate::{args::FromBtfArgument, EbpfContext}; pub struct FEntryContext { ctx: *mut c_void, @@ -36,7 +36,7 @@ impl FEntryContext { } } -impl BpfContext for FEntryContext { +impl EbpfContext for FEntryContext { fn as_ptr(&self) -> *mut c_void { self.ctx } diff --git a/ebpf/aya-ebpf/src/programs/fexit.rs b/ebpf/aya-ebpf/src/programs/fexit.rs index d5b7ea25..d9728832 100644 --- a/ebpf/aya-ebpf/src/programs/fexit.rs +++ b/ebpf/aya-ebpf/src/programs/fexit.rs @@ -1,6 +1,6 @@ use core::ffi::c_void; -use crate::{args::FromBtfArgument, BpfContext}; +use crate::{args::FromBtfArgument, EbpfContext}; pub struct FExitContext { ctx: *mut c_void, @@ -36,7 +36,7 @@ impl FExitContext { } } -impl BpfContext for FExitContext { +impl EbpfContext for FExitContext { fn as_ptr(&self) -> *mut c_void { self.ctx } diff --git a/ebpf/aya-ebpf/src/programs/lsm.rs b/ebpf/aya-ebpf/src/programs/lsm.rs index fd67a7d5..0ad29590 100644 --- a/ebpf/aya-ebpf/src/programs/lsm.rs +++ b/ebpf/aya-ebpf/src/programs/lsm.rs @@ -1,6 +1,6 @@ use core::ffi::c_void; -use crate::{args::FromBtfArgument, BpfContext}; +use crate::{args::FromBtfArgument, EbpfContext}; pub struct LsmContext { ctx: *mut c_void, @@ -55,7 +55,7 @@ impl LsmContext { } } -impl BpfContext for LsmContext { +impl EbpfContext for LsmContext { fn as_ptr(&self) -> *mut c_void { self.ctx } diff --git a/ebpf/aya-ebpf/src/programs/perf_event.rs b/ebpf/aya-ebpf/src/programs/perf_event.rs index f303b28d..b0460f6d 100644 --- a/ebpf/aya-ebpf/src/programs/perf_event.rs +++ b/ebpf/aya-ebpf/src/programs/perf_event.rs @@ -1,6 +1,6 @@ use core::ffi::c_void; -use crate::BpfContext; +use crate::EbpfContext; pub struct PerfEventContext { ctx: *mut c_void, @@ -12,7 +12,7 @@ impl PerfEventContext { } } -impl BpfContext for PerfEventContext { +impl EbpfContext for PerfEventContext { fn as_ptr(&self) -> *mut c_void { self.ctx } diff --git a/ebpf/aya-ebpf/src/programs/probe.rs b/ebpf/aya-ebpf/src/programs/probe.rs index 4c7c507f..330ac0ae 100644 --- a/ebpf/aya-ebpf/src/programs/probe.rs +++ b/ebpf/aya-ebpf/src/programs/probe.rs @@ -6,7 +6,7 @@ use crate::bindings::pt_regs; use crate::bindings::user_pt_regs as pt_regs; #[cfg(bpf_target_arch = "riscv64")] use crate::bindings::user_regs_struct as pt_regs; -use crate::{args::FromPtRegs, BpfContext}; +use crate::{args::FromPtRegs, EbpfContext}; pub struct ProbeContext { pub regs: *mut pt_regs, @@ -64,7 +64,7 @@ impl ProbeContext { } } -impl BpfContext for ProbeContext { +impl EbpfContext for ProbeContext { fn as_ptr(&self) -> *mut c_void { self.regs as *mut c_void } diff --git a/ebpf/aya-ebpf/src/programs/raw_tracepoint.rs b/ebpf/aya-ebpf/src/programs/raw_tracepoint.rs index cc140244..2c2c1b4d 100644 --- a/ebpf/aya-ebpf/src/programs/raw_tracepoint.rs +++ b/ebpf/aya-ebpf/src/programs/raw_tracepoint.rs @@ -1,6 +1,6 @@ use core::ffi::c_void; -use crate::BpfContext; +use crate::EbpfContext; pub struct RawTracePointContext { ctx: *mut c_void, @@ -12,7 +12,7 @@ impl RawTracePointContext { } } -impl BpfContext for RawTracePointContext { +impl EbpfContext for RawTracePointContext { fn as_ptr(&self) -> *mut c_void { self.ctx } diff --git a/ebpf/aya-ebpf/src/programs/sk_buff.rs b/ebpf/aya-ebpf/src/programs/sk_buff.rs index 517b9a18..becdf85d 100644 --- a/ebpf/aya-ebpf/src/programs/sk_buff.rs +++ b/ebpf/aya-ebpf/src/programs/sk_buff.rs @@ -10,7 +10,7 @@ use aya_ebpf_bindings::helpers::{ }; use aya_ebpf_cty::c_long; -use crate::{bindings::__sk_buff, BpfContext}; +use crate::{bindings::__sk_buff, EbpfContext}; pub struct SkBuff { pub skb: *mut __sk_buff, @@ -430,7 +430,7 @@ impl SkBuffContext { } } -impl BpfContext for SkBuffContext { +impl EbpfContext for SkBuffContext { fn as_ptr(&self) -> *mut c_void { self.skb.as_ptr() } diff --git a/ebpf/aya-ebpf/src/programs/sk_lookup.rs b/ebpf/aya-ebpf/src/programs/sk_lookup.rs index 5c37066e..02532f57 100644 --- a/ebpf/aya-ebpf/src/programs/sk_lookup.rs +++ b/ebpf/aya-ebpf/src/programs/sk_lookup.rs @@ -1,6 +1,6 @@ use core::ffi::c_void; -use crate::{bindings::bpf_sk_lookup, BpfContext}; +use crate::{bindings::bpf_sk_lookup, EbpfContext}; pub struct SkLookupContext { pub lookup: *mut bpf_sk_lookup, @@ -12,7 +12,7 @@ impl SkLookupContext { } } -impl BpfContext for SkLookupContext { +impl EbpfContext for SkLookupContext { fn as_ptr(&self) -> *mut c_void { self.lookup as *mut _ } diff --git a/ebpf/aya-ebpf/src/programs/sk_msg.rs b/ebpf/aya-ebpf/src/programs/sk_msg.rs index 6cecc7a1..cee6d4d2 100644 --- a/ebpf/aya-ebpf/src/programs/sk_msg.rs +++ b/ebpf/aya-ebpf/src/programs/sk_msg.rs @@ -3,7 +3,7 @@ use core::ffi::c_void; use crate::{ bindings::sk_msg_md, helpers::{bpf_msg_pop_data, bpf_msg_push_data}, - BpfContext, + EbpfContext, }; pub struct SkMsgContext { @@ -46,7 +46,7 @@ impl SkMsgContext { } } -impl BpfContext for SkMsgContext { +impl EbpfContext for SkMsgContext { fn as_ptr(&self) -> *mut c_void { self.msg as *mut _ } diff --git a/ebpf/aya-ebpf/src/programs/sock.rs b/ebpf/aya-ebpf/src/programs/sock.rs index 0a04888c..64bd02fb 100644 --- a/ebpf/aya-ebpf/src/programs/sock.rs +++ b/ebpf/aya-ebpf/src/programs/sock.rs @@ -1,6 +1,6 @@ use core::ffi::c_void; -use crate::{bindings::bpf_sock, BpfContext}; +use crate::{bindings::bpf_sock, EbpfContext}; pub struct SockContext { pub sock: *mut bpf_sock, @@ -12,7 +12,7 @@ impl SockContext { } } -impl BpfContext for SockContext { +impl EbpfContext for SockContext { fn as_ptr(&self) -> *mut c_void { self.sock as *mut _ } diff --git a/ebpf/aya-ebpf/src/programs/sock_addr.rs b/ebpf/aya-ebpf/src/programs/sock_addr.rs index 294ff636..d882c058 100644 --- a/ebpf/aya-ebpf/src/programs/sock_addr.rs +++ b/ebpf/aya-ebpf/src/programs/sock_addr.rs @@ -1,6 +1,6 @@ use core::ffi::c_void; -use crate::{bindings::bpf_sock_addr, BpfContext}; +use crate::{bindings::bpf_sock_addr, EbpfContext}; pub struct SockAddrContext { pub sock_addr: *mut bpf_sock_addr, @@ -12,7 +12,7 @@ impl SockAddrContext { } } -impl BpfContext for SockAddrContext { +impl EbpfContext for SockAddrContext { fn as_ptr(&self) -> *mut c_void { self.sock_addr as *mut _ } diff --git a/ebpf/aya-ebpf/src/programs/sock_ops.rs b/ebpf/aya-ebpf/src/programs/sock_ops.rs index 9b23c213..9934a7a6 100644 --- a/ebpf/aya-ebpf/src/programs/sock_ops.rs +++ b/ebpf/aya-ebpf/src/programs/sock_ops.rs @@ -2,7 +2,7 @@ use core::ffi::c_void; use aya_ebpf_bindings::helpers::bpf_sock_ops_cb_flags_set; -use crate::{bindings::bpf_sock_ops, BpfContext}; +use crate::{bindings::bpf_sock_ops, EbpfContext}; pub struct SockOpsContext { pub ops: *mut bpf_sock_ops, @@ -63,7 +63,7 @@ impl SockOpsContext { } } -impl BpfContext for SockOpsContext { +impl EbpfContext for SockOpsContext { fn as_ptr(&self) -> *mut c_void { self.ops as *mut _ } diff --git a/ebpf/aya-ebpf/src/programs/sockopt.rs b/ebpf/aya-ebpf/src/programs/sockopt.rs index a1440895..21e162d9 100644 --- a/ebpf/aya-ebpf/src/programs/sockopt.rs +++ b/ebpf/aya-ebpf/src/programs/sockopt.rs @@ -1,6 +1,6 @@ use core::ffi::c_void; -use crate::{bindings::bpf_sockopt, BpfContext}; +use crate::{bindings::bpf_sockopt, EbpfContext}; pub struct SockoptContext { pub sockopt: *mut bpf_sockopt, @@ -12,7 +12,7 @@ impl SockoptContext { } } -impl BpfContext for SockoptContext { +impl EbpfContext for SockoptContext { fn as_ptr(&self) -> *mut c_void { self.sockopt as *mut _ } diff --git a/ebpf/aya-ebpf/src/programs/sysctl.rs b/ebpf/aya-ebpf/src/programs/sysctl.rs index fedbd5d7..fb1a76c1 100644 --- a/ebpf/aya-ebpf/src/programs/sysctl.rs +++ b/ebpf/aya-ebpf/src/programs/sysctl.rs @@ -1,6 +1,6 @@ use core::ffi::c_void; -use crate::{bindings::bpf_sysctl, BpfContext}; +use crate::{bindings::bpf_sysctl, EbpfContext}; pub struct SysctlContext { pub sysctl: *mut bpf_sysctl, @@ -12,7 +12,7 @@ impl SysctlContext { } } -impl BpfContext for SysctlContext { +impl EbpfContext for SysctlContext { fn as_ptr(&self) -> *mut c_void { self.sysctl as *mut _ } diff --git a/ebpf/aya-ebpf/src/programs/tc.rs b/ebpf/aya-ebpf/src/programs/tc.rs index 60dd0f2f..7c349d5b 100644 --- a/ebpf/aya-ebpf/src/programs/tc.rs +++ b/ebpf/aya-ebpf/src/programs/tc.rs @@ -1,6 +1,6 @@ use aya_ebpf_cty::{c_long, c_void}; -use crate::{bindings::__sk_buff, programs::sk_buff::SkBuff, BpfContext}; +use crate::{bindings::__sk_buff, programs::sk_buff::SkBuff, EbpfContext}; pub struct TcContext { pub skb: SkBuff, @@ -187,7 +187,7 @@ impl TcContext { } } -impl BpfContext for TcContext { +impl EbpfContext for TcContext { fn as_ptr(&self) -> *mut c_void { self.skb.as_ptr() } diff --git a/ebpf/aya-ebpf/src/programs/tp_btf.rs b/ebpf/aya-ebpf/src/programs/tp_btf.rs index ccefdbf1..0c8a7991 100644 --- a/ebpf/aya-ebpf/src/programs/tp_btf.rs +++ b/ebpf/aya-ebpf/src/programs/tp_btf.rs @@ -1,6 +1,6 @@ use core::ffi::c_void; -use crate::{args::FromBtfArgument, BpfContext}; +use crate::{args::FromBtfArgument, EbpfContext}; pub struct BtfTracePointContext { ctx: *mut c_void, @@ -45,7 +45,7 @@ impl BtfTracePointContext { } } -impl BpfContext for BtfTracePointContext { +impl EbpfContext for BtfTracePointContext { fn as_ptr(&self) -> *mut c_void { self.ctx } diff --git a/ebpf/aya-ebpf/src/programs/tracepoint.rs b/ebpf/aya-ebpf/src/programs/tracepoint.rs index 4087b7b8..c1f2dd66 100644 --- a/ebpf/aya-ebpf/src/programs/tracepoint.rs +++ b/ebpf/aya-ebpf/src/programs/tracepoint.rs @@ -1,6 +1,6 @@ use core::ffi::c_void; -use crate::{helpers::bpf_probe_read, BpfContext}; +use crate::{helpers::bpf_probe_read, EbpfContext}; pub struct TracePointContext { ctx: *mut c_void, @@ -16,7 +16,7 @@ impl TracePointContext { } } -impl BpfContext for TracePointContext { +impl EbpfContext for TracePointContext { fn as_ptr(&self) -> *mut c_void { self.ctx } diff --git a/ebpf/aya-ebpf/src/programs/xdp.rs b/ebpf/aya-ebpf/src/programs/xdp.rs index 19563767..7513b46d 100644 --- a/ebpf/aya-ebpf/src/programs/xdp.rs +++ b/ebpf/aya-ebpf/src/programs/xdp.rs @@ -1,6 +1,6 @@ use core::ffi::c_void; -use crate::{bindings::xdp_md, BpfContext}; +use crate::{bindings::xdp_md, EbpfContext}; pub struct XdpContext { pub ctx: *mut xdp_md, @@ -34,7 +34,7 @@ impl XdpContext { } } -impl BpfContext for XdpContext { +impl EbpfContext for XdpContext { fn as_ptr(&self) -> *mut c_void { self.ctx as *mut _ }