diff --git a/aya/src/programs/cgroup_device.rs b/aya/src/programs/cgroup_device.rs index 229757420..716deae01 100644 --- a/aya/src/programs/cgroup_device.rs +++ b/aya/src/programs/cgroup_device.rs @@ -99,25 +99,6 @@ impl CgroupDevice { } } - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`CgroupDeviceLink`] is dropped, the link is - /// detached. - pub fn take_link( - &mut self, - link_id: CgroupDeviceLinkId, - ) -> Result { - self.data.take_link(link_id) - } - - /// Detaches the program - /// - /// See [CgroupDevice::attach]. - pub fn detach(&mut self, link_id: CgroupDeviceLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - /// Queries the cgroup for attached programs. pub fn query(target_fd: T) -> Result, ProgramError> { let target_fd = target_fd.as_fd(); @@ -179,5 +160,6 @@ define_link_wrapper!( /// The type returned by [CgroupDevice::attach]. Can be passed to [CgroupDevice::detach]. CgroupDeviceLinkId, CgroupDeviceLinkInner, - CgroupDeviceLinkIdInner + CgroupDeviceLinkIdInner, + CgroupDevice, ); diff --git a/aya/src/programs/cgroup_skb.rs b/aya/src/programs/cgroup_skb.rs index 7286a36a4..3b9aed22c 100644 --- a/aya/src/programs/cgroup_skb.rs +++ b/aya/src/programs/cgroup_skb.rs @@ -125,22 +125,6 @@ impl CgroupSkb { } } - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`CgroupSkbLink`] is dropped, the link is - /// detached. - pub fn take_link(&mut self, link_id: CgroupSkbLinkId) -> Result { - self.data.take_link(link_id) - } - - /// Detaches the program. - /// - /// See [CgroupSkb::attach]. - pub fn detach(&mut self, link_id: CgroupSkbLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - /// Creates a program from a pinned entry on a bpffs. /// /// Existing links will not be populated. To work with existing links you should use [`crate::programs::links::PinnedLink`]. @@ -195,7 +179,8 @@ define_link_wrapper!( /// The type returned by [CgroupSkb::attach]. Can be passed to [CgroupSkb::detach]. CgroupSkbLinkId, CgroupSkbLinkInner, - CgroupSkbLinkIdInner + CgroupSkbLinkIdInner, + CgroupSkb, ); /// Defines where to attach a [`CgroupSkb`] program. diff --git a/aya/src/programs/cgroup_sock.rs b/aya/src/programs/cgroup_sock.rs index 55cbf75f8..79e118b68 100644 --- a/aya/src/programs/cgroup_sock.rs +++ b/aya/src/programs/cgroup_sock.rs @@ -103,22 +103,6 @@ impl CgroupSock { } } - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`CgroupSockLink`] is dropped, the link is - /// detached. - pub fn take_link(&mut self, link_id: CgroupSockLinkId) -> Result { - self.data.take_link(link_id) - } - - /// Detaches the program. - /// - /// See [CgroupSock::attach]. - pub fn detach(&mut self, link_id: CgroupSockLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - /// Creates a program from a pinned entry on a bpffs. /// /// Existing links will not be populated. To work with existing links you should use [`crate::programs::links::PinnedLink`]. @@ -170,5 +154,6 @@ define_link_wrapper!( /// The type returned by [CgroupSock::attach]. Can be passed to [CgroupSock::detach]. CgroupSockLinkId, CgroupSockLinkInner, - CgroupSockLinkIdInner + CgroupSockLinkIdInner, + CgroupSock, ); diff --git a/aya/src/programs/cgroup_sock_addr.rs b/aya/src/programs/cgroup_sock_addr.rs index 5827fa3ea..2a10fce6d 100644 --- a/aya/src/programs/cgroup_sock_addr.rs +++ b/aya/src/programs/cgroup_sock_addr.rs @@ -104,25 +104,6 @@ impl CgroupSockAddr { } } - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`CgroupSockAddrLink`] is dropped, the link is - /// detached. - pub fn take_link( - &mut self, - link_id: CgroupSockAddrLinkId, - ) -> Result { - self.data.take_link(link_id) - } - - /// Detaches the program. - /// - /// See [CgroupSockAddr::attach]. - pub fn detach(&mut self, link_id: CgroupSockAddrLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - /// Creates a program from a pinned entry on a bpffs. /// /// Existing links will not be populated. To work with existing links you should use [`crate::programs::links::PinnedLink`]. @@ -174,5 +155,6 @@ define_link_wrapper!( /// The type returned by [CgroupSockAddr::attach]. Can be passed to [CgroupSockAddr::detach]. CgroupSockAddrLinkId, CgroupSockAddrLinkInner, - CgroupSockAddrLinkIdInner + CgroupSockAddrLinkIdInner, + CgroupSockAddr, ); diff --git a/aya/src/programs/cgroup_sockopt.rs b/aya/src/programs/cgroup_sockopt.rs index c0cbe3205..6832d9fab 100644 --- a/aya/src/programs/cgroup_sockopt.rs +++ b/aya/src/programs/cgroup_sockopt.rs @@ -103,25 +103,6 @@ impl CgroupSockopt { } } - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`CgroupSockoptLink`] is dropped, the link is - /// detached. - pub fn take_link( - &mut self, - link_id: CgroupSockoptLinkId, - ) -> Result { - self.data.take_link(link_id) - } - - /// Detaches the program. - /// - /// See [CgroupSockopt::attach]. - pub fn detach(&mut self, link_id: CgroupSockoptLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - /// Creates a program from a pinned entry on a bpffs. /// /// Existing links will not be populated. To work with existing links you should use [`crate::programs::links::PinnedLink`]. @@ -173,5 +154,6 @@ define_link_wrapper!( /// The type returned by [CgroupSockopt::attach]. Can be passed to [CgroupSockopt::detach]. CgroupSockoptLinkId, CgroupSockoptLinkInner, - CgroupSockoptLinkIdInner + CgroupSockoptLinkIdInner, + CgroupSockopt, ); diff --git a/aya/src/programs/cgroup_sysctl.rs b/aya/src/programs/cgroup_sysctl.rs index edb51367b..ad4f595b9 100644 --- a/aya/src/programs/cgroup_sysctl.rs +++ b/aya/src/programs/cgroup_sysctl.rs @@ -97,25 +97,6 @@ impl CgroupSysctl { ))) } } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`CgroupSysctlLink`] is dropped, the link is - /// detached. - pub fn take_link( - &mut self, - link_id: CgroupSysctlLinkId, - ) -> Result { - self.data.take_link(link_id) - } - - /// Detaches the program. - /// - /// See [CgroupSysctl::attach]. - pub fn detach(&mut self, link_id: CgroupSysctlLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } } #[derive(Debug, Hash, Eq, PartialEq)] @@ -154,5 +135,6 @@ define_link_wrapper!( /// The type returned by [CgroupSysctl::attach]. Can be passed to [CgroupSysctl::detach]. CgroupSysctlLinkId, CgroupSysctlLinkInner, - CgroupSysctlLinkIdInner + CgroupSysctlLinkIdInner, + CgroupSysctl, ); diff --git a/aya/src/programs/extension.rs b/aya/src/programs/extension.rs index f8a15b70b..703bed5d3 100644 --- a/aya/src/programs/extension.rs +++ b/aya/src/programs/extension.rs @@ -151,23 +151,6 @@ impl Extension { .links .insert(ExtensionLink::new(FdLink::new(link_fd))) } - - /// Detaches the extension. - /// - /// Detaching restores the original code overridden by the extension program. - /// See [Extension::attach]. - pub fn detach(&mut self, link_id: ExtensionLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`ExtensionLink`] is dropped, the link is - /// detached. - pub fn take_link(&mut self, link_id: ExtensionLinkId) -> Result { - self.data.take_link(link_id) - } } /// Retrieves the FD of the BTF object for the provided `prog_fd` and the BTF ID of the function @@ -216,5 +199,6 @@ define_link_wrapper!( /// The type returned by [Extension::attach]. Can be passed to [Extension::detach]. ExtensionLinkId, FdLink, - FdLinkId + FdLinkId, + Extension, ); diff --git a/aya/src/programs/fentry.rs b/aya/src/programs/fentry.rs index b74bb6e7f..96c7fce52 100644 --- a/aya/src/programs/fentry.rs +++ b/aya/src/programs/fentry.rs @@ -67,22 +67,6 @@ impl FEntry { pub fn attach(&mut self) -> Result { attach_raw_tracepoint(&mut self.data, None) } - - /// Detaches the program. - /// - /// See [FEntry::attach]. - pub fn detach(&mut self, link_id: FEntryLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`FEntryLink`] is dropped, the link is - /// detached. - pub fn take_link(&mut self, link_id: FEntryLinkId) -> Result { - self.data.take_link(link_id) - } } define_link_wrapper!( @@ -91,5 +75,6 @@ define_link_wrapper!( /// The type returned by [FEntry::attach]. Can be passed to [FEntry::detach]. FEntryLinkId, FdLink, - FdLinkId + FdLinkId, + FEntry, ); diff --git a/aya/src/programs/fexit.rs b/aya/src/programs/fexit.rs index a97123b8f..da32f6b25 100644 --- a/aya/src/programs/fexit.rs +++ b/aya/src/programs/fexit.rs @@ -67,21 +67,6 @@ impl FExit { pub fn attach(&mut self) -> Result { attach_raw_tracepoint(&mut self.data, None) } - - /// Detaches the program. - /// - /// See [FExit::attach]. - pub fn detach(&mut self, link_id: FExitLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned `FExitLink` is dropped, the link is detached. - pub fn take_link(&mut self, link_id: FExitLinkId) -> Result { - self.data.take_link(link_id) - } } define_link_wrapper!( @@ -90,5 +75,6 @@ define_link_wrapper!( /// The type returned by [FExit::attach]. Can be passed to [FExit::detach]. FExitLinkId, FdLink, - FdLinkId + FdLinkId, + FExit, ); diff --git a/aya/src/programs/iter.rs b/aya/src/programs/iter.rs index 901105357..ab0bd4dc0 100644 --- a/aya/src/programs/iter.rs +++ b/aya/src/programs/iter.rs @@ -82,21 +82,6 @@ impl Iter { .links .insert(IterLink::new(PerfLinkInner::FdLink(FdLink::new(link_fd)))) } - - /// Detaches the program. - /// - /// See [`Self::attach`]. - pub fn detach(&mut self, link_id: IterLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`IterLink`] is dropped, the link is detached. - pub fn take_link(&mut self, link_id: IterLinkId) -> Result { - self.data.take_link(link_id) - } } /// An iterator descriptor. @@ -142,7 +127,8 @@ define_link_wrapper!( /// The type returned by [`Iter::attach`]. Can be passed to [`Iter::detach`]. IterLinkId, PerfLinkInner, - PerfLinkIdInner + PerfLinkIdInner, + Iter, ); impl IterLink { diff --git a/aya/src/programs/kprobe.rs b/aya/src/programs/kprobe.rs index 28ce4704d..9e43983a3 100644 --- a/aya/src/programs/kprobe.rs +++ b/aya/src/programs/kprobe.rs @@ -81,22 +81,6 @@ impl KProbe { attach(&mut self.data, self.kind, fn_name.as_ref(), offset, None) } - /// Detaches the program. - /// - /// See [KProbe::attach]. - pub fn detach(&mut self, link_id: KProbeLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`KProbeLink`] is dropped, the link is - /// detached. - pub fn take_link(&mut self, link_id: KProbeLinkId) -> Result { - self.data.take_link(link_id) - } - /// Creates a program from a pinned entry on a bpffs. /// /// Existing links will not be populated. To work with existing links you should use [`crate::programs::links::PinnedLink`]. @@ -115,7 +99,8 @@ define_link_wrapper!( /// The type returned by [KProbe::attach]. Can be passed to [KProbe::detach]. KProbeLinkId, PerfLinkInner, - PerfLinkIdInner + PerfLinkIdInner, + KProbe, ); /// The type returned when attaching a [`KProbe`] fails. diff --git a/aya/src/programs/links.rs b/aya/src/programs/links.rs index 9e8ac1c0e..12ca8085b 100644 --- a/aya/src/programs/links.rs +++ b/aya/src/programs/links.rs @@ -322,7 +322,7 @@ impl Link for ProgAttachLink { } macro_rules! define_link_wrapper { - (#[$doc1:meta] $wrapper:ident, #[$doc2:meta] $wrapper_id:ident, $base:ident, $base_id:ident) => { + (#[$doc1:meta] $wrapper:ident, #[$doc2:meta] $wrapper_id:ident, $base:ident, $base_id:ident, $program:ident,) => { #[$doc2] #[derive(Debug, Hash, Eq, PartialEq)] pub struct $wrapper_id($base_id); @@ -381,6 +381,23 @@ macro_rules! define_link_wrapper { w.0.take().unwrap() } } + + impl $program { + /// Detaches the program. + /// + /// See [`Self::attach`]. + pub fn detach(&mut self, link_id: $wrapper_id) -> Result<(), ProgramError> { + self.data.links.remove(link_id) + } + + /// Takes ownership of the link referenced by the provided `link_id`. + /// + /// The caller takes the responsibility of managing the lifetime of the link. When the + /// returned [`$wrapper`] is dropped, the link is detached. + pub fn take_link(&mut self, link_id: $wrapper_id) -> Result<$wrapper, ProgramError> { + self.data.links.forget(link_id) + } + } }; } diff --git a/aya/src/programs/lirc_mode2.rs b/aya/src/programs/lirc_mode2.rs index d63dc8d6a..ae901a250 100644 --- a/aya/src/programs/lirc_mode2.rs +++ b/aya/src/programs/lirc_mode2.rs @@ -84,17 +84,17 @@ impl LircMode2 { /// Detaches the program. /// - /// See [LircMode2::attach]. + /// See [`Self::attach`]. pub fn detach(&mut self, link_id: LircLinkId) -> Result<(), ProgramError> { self.data.links.remove(link_id) } /// Takes ownership of the link referenced by the provided `link_id`. /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`LircLink`] is dropped, the link is detached. + /// The caller takes the responsibility of managing the lifetime of the link. When the returned + /// [`LircLink`] is dropped, the link is detached. pub fn take_link(&mut self, link_id: LircLinkId) -> Result { - self.data.take_link(link_id) + self.data.links.forget(link_id) } /// Queries the lirc device for attached programs. diff --git a/aya/src/programs/lsm.rs b/aya/src/programs/lsm.rs index 6dfa64355..bcf9d052e 100644 --- a/aya/src/programs/lsm.rs +++ b/aya/src/programs/lsm.rs @@ -73,21 +73,6 @@ impl Lsm { pub fn attach(&mut self) -> Result { attach_raw_tracepoint(&mut self.data, None) } - - /// Detaches the program. - /// - /// See [Lsm::attach]. - pub fn detach(&mut self, link_id: LsmLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`LsmLink`] is dropped, the link is detached. - pub fn take_link(&mut self, link_id: LsmLinkId) -> Result { - self.data.take_link(link_id) - } } define_link_wrapper!( @@ -96,5 +81,6 @@ define_link_wrapper!( /// The type returned by [Lsm::attach]. Can be passed to [Lsm::detach]. LsmLinkId, FdLink, - FdLinkId + FdLinkId, + Lsm, ); diff --git a/aya/src/programs/mod.rs b/aya/src/programs/mod.rs index b21aadc09..f9fbeec8c 100644 --- a/aya/src/programs/mod.rs +++ b/aya/src/programs/mod.rs @@ -572,10 +572,6 @@ impl ProgramData { fn fd(&self) -> Result<&ProgramFd, ProgramError> { self.fd.as_ref().ok_or(ProgramError::NotLoaded) } - - pub(crate) fn take_link(&mut self, link_id: T::Id) -> Result { - self.links.forget(link_id) - } } fn unload_program(data: &mut ProgramData) -> Result<(), ProgramError> { diff --git a/aya/src/programs/perf_event.rs b/aya/src/programs/perf_event.rs index 84f409832..73d448655 100644 --- a/aya/src/programs/perf_event.rs +++ b/aya/src/programs/perf_event.rs @@ -183,22 +183,6 @@ impl PerfEvent { let link = perf_attach(prog_fd, fd)?; self.data.links.insert(PerfEventLink::new(link)) } - - /// Detaches the program. - /// - /// See [PerfEvent::attach]. - pub fn detach(&mut self, link_id: PerfEventLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`PerfEventLink`] is dropped, the link is - /// detached. - pub fn take_link(&mut self, link_id: PerfEventLinkId) -> Result { - self.data.take_link(link_id) - } } impl TryFrom for FdLink { @@ -231,5 +215,6 @@ define_link_wrapper!( /// The type returned by [PerfEvent::attach]. Can be passed to [PerfEvent::detach]. PerfEventLinkId, PerfLinkInner, - PerfLinkIdInner + PerfLinkIdInner, + PerfEvent, ); diff --git a/aya/src/programs/raw_trace_point.rs b/aya/src/programs/raw_trace_point.rs index 13c0d17fd..53e76fd41 100644 --- a/aya/src/programs/raw_trace_point.rs +++ b/aya/src/programs/raw_trace_point.rs @@ -52,25 +52,6 @@ impl RawTracePoint { let tp_name_c = CString::new(tp_name).unwrap(); attach_raw_tracepoint(&mut self.data, Some(&tp_name_c)) } - - /// Detaches from a tracepoint. - /// - /// See [RawTracePoint::attach]. - pub fn detach(&mut self, link_id: RawTracePointLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`RawTracePointLink`] is dropped, the link is - /// detached. - pub fn take_link( - &mut self, - link_id: RawTracePointLinkId, - ) -> Result { - self.data.take_link(link_id) - } } define_link_wrapper!( @@ -79,5 +60,6 @@ define_link_wrapper!( /// The type returned by [RawTracePoint::attach]. Can be passed to [RawTracePoint::detach]. RawTracePointLinkId, FdLink, - FdLinkId + FdLinkId, + RawTracePoint, ); diff --git a/aya/src/programs/sk_lookup.rs b/aya/src/programs/sk_lookup.rs index c9c3fb886..8d70ee34b 100644 --- a/aya/src/programs/sk_lookup.rs +++ b/aya/src/programs/sk_lookup.rs @@ -81,22 +81,6 @@ impl SkLookup { .links .insert(SkLookupLink::new(FdLink::new(link_fd))) } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`SkLookupLink`] is dropped, the link is - /// detached. - pub fn take_link(&mut self, link_id: SkLookupLinkId) -> Result { - self.data.take_link(link_id) - } - - /// Detaches the program. - /// - /// See [SkLookup::attach]. - pub fn detach(&mut self, link_id: SkLookupLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } } define_link_wrapper!( @@ -105,5 +89,6 @@ define_link_wrapper!( /// The type returned by [SkLookup::attach]. Can be passed to [SkLookup::detach]. SkLookupLinkId, FdLink, - FdLinkId + FdLinkId, + SkLookup, ); diff --git a/aya/src/programs/sk_msg.rs b/aya/src/programs/sk_msg.rs index 45b333e1c..a30319f14 100644 --- a/aya/src/programs/sk_msg.rs +++ b/aya/src/programs/sk_msg.rs @@ -89,22 +89,6 @@ impl SkMsg { self.data.links.insert(SkMsgLink::new(link)) } - - /// Detaches the program from a sockmap. - /// - /// See [SkMsg::attach]. - pub fn detach(&mut self, link_id: SkMsgLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`SkMsgLink`] is dropped, the link is - /// detached. - pub fn take_link(&mut self, link_id: SkMsgLinkId) -> Result { - self.data.take_link(link_id) - } } define_link_wrapper!( @@ -113,5 +97,6 @@ define_link_wrapper!( /// The type returned by [SkMsg::attach]. Can be passed to [SkMsg::detach]. SkMsgLinkId, ProgAttachLink, - ProgAttachLinkId + ProgAttachLinkId, + SkMsg, ); diff --git a/aya/src/programs/sk_skb.rs b/aya/src/programs/sk_skb.rs index 16a538745..c6c55c6c0 100644 --- a/aya/src/programs/sk_skb.rs +++ b/aya/src/programs/sk_skb.rs @@ -96,21 +96,6 @@ impl SkSkb { self.data.links.insert(SkSkbLink::new(link)) } - /// Detaches the program. - /// - /// See [SkSkb::attach]. - pub fn detach(&mut self, link_id: SkSkbLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`SkSkbLink`] is dropped, the link is detached. - pub fn take_link(&mut self, link_id: SkSkbLinkId) -> Result { - self.data.take_link(link_id) - } - /// Creates a program from a pinned entry on a bpffs. /// /// Existing links will not be populated. To work with existing links you should use [`crate::programs::links::PinnedLink`]. @@ -129,5 +114,6 @@ define_link_wrapper!( /// The type returned by [SkSkb::attach]. Can be passed to [SkSkb::detach]. SkSkbLinkId, ProgAttachLink, - ProgAttachLinkId + ProgAttachLinkId, + SkSkb, ); diff --git a/aya/src/programs/sock_ops.rs b/aya/src/programs/sock_ops.rs index 75c3a97f1..9f2028bd9 100644 --- a/aya/src/programs/sock_ops.rs +++ b/aya/src/programs/sock_ops.rs @@ -92,22 +92,6 @@ impl SockOps { .insert(SockOpsLink::new(SockOpsLinkInner::ProgAttach(link))) } } - - /// Detaches the program. - /// - /// See [SockOps::attach]. - pub fn detach(&mut self, link_id: SockOpsLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`SockOpsLink`] is dropped, the link is - /// detached. - pub fn take_link(&mut self, link_id: SockOpsLinkId) -> Result { - self.data.take_link(link_id) - } } #[derive(Debug, Hash, Eq, PartialEq)] @@ -146,5 +130,6 @@ define_link_wrapper!( /// The type returned by [SockOps::attach]. Can be passed to [SockOps::detach]. SockOpsLinkId, SockOpsLinkInner, - SockOpsLinkIdInner + SockOpsLinkIdInner, + SockOps, ); diff --git a/aya/src/programs/socket_filter.rs b/aya/src/programs/socket_filter.rs index 78152bd82..662705875 100644 --- a/aya/src/programs/socket_filter.rs +++ b/aya/src/programs/socket_filter.rs @@ -100,21 +100,20 @@ impl SocketFilter { /// Detaches the program. /// - /// See [SocketFilter::attach]. + /// See [`Self::attach``]. pub fn detach(&mut self, link_id: SocketFilterLinkId) -> Result<(), ProgramError> { self.data.links.remove(link_id) } /// Takes ownership of the link referenced by the provided `link_id`. /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`SocketFilterLink`] is dropped, the link is - /// detached. + /// The caller takes the responsibility of managing the lifetime of the link. When the returned + /// [`SocketFilterLink`] is dropped, the link is detached. pub fn take_link( &mut self, link_id: SocketFilterLinkId, ) -> Result { - self.data.take_link(link_id) + self.data.links.forget(link_id) } } diff --git a/aya/src/programs/tc.rs b/aya/src/programs/tc.rs index 5a2e6c2c0..69d1bfd1e 100644 --- a/aya/src/programs/tc.rs +++ b/aya/src/programs/tc.rs @@ -315,25 +315,6 @@ impl SchedClassifier { } } - /// Detaches the program. - /// - /// See [SchedClassifier::attach]. - pub fn detach(&mut self, link_id: SchedClassifierLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`SchedClassifierLink`] is dropped, the link is - /// detached. - pub fn take_link( - &mut self, - link_id: SchedClassifierLinkId, - ) -> Result { - self.data.take_link(link_id) - } - /// Creates a program from a pinned entry on a bpffs. /// /// Existing links will not be populated. To work with existing links you should use [`crate::programs::links::PinnedLink`]. @@ -490,7 +471,8 @@ define_link_wrapper!( /// The type returned by [SchedClassifier::attach]. Can be passed to [SchedClassifier::detach]. SchedClassifierLinkId, TcLinkInner, - TcLinkIdInner + TcLinkIdInner, + SchedClassifier, ); impl SchedClassifierLink { diff --git a/aya/src/programs/tp_btf.rs b/aya/src/programs/tp_btf.rs index 549d5ae76..1ee31d02f 100644 --- a/aya/src/programs/tp_btf.rs +++ b/aya/src/programs/tp_btf.rs @@ -71,25 +71,6 @@ impl BtfTracePoint { pub fn attach(&mut self) -> Result { attach_raw_tracepoint(&mut self.data, None) } - - /// Detaches the program. - /// - /// See [BtfTracePoint::attach]. - pub fn detach(&mut self, link_id: BtfTracePointLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`BtfTracePointLink`] is dropped, the link is - /// detached. - pub fn take_link( - &mut self, - link_id: BtfTracePointLinkId, - ) -> Result { - self.data.take_link(link_id) - } } define_link_wrapper!( @@ -98,5 +79,6 @@ define_link_wrapper!( /// The type returned by [BtfTracePoint::attach]. Can be passed to [BtfTracePoint::detach]. BtfTracePointLinkId, FdLink, - FdLinkId + FdLinkId, + BtfTracePoint, ); diff --git a/aya/src/programs/trace_point.rs b/aya/src/programs/trace_point.rs index 3e3cea964..075c60070 100644 --- a/aya/src/programs/trace_point.rs +++ b/aya/src/programs/trace_point.rs @@ -81,22 +81,6 @@ impl TracePoint { let link = perf_attach(prog_fd, fd)?; self.data.links.insert(TracePointLink::new(link)) } - - /// Detaches from a trace point. - /// - /// See [TracePoint::attach]. - pub fn detach(&mut self, link_id: TracePointLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`TracePointLink`] is dropped, the link is - /// detached. - pub fn take_link(&mut self, link_id: TracePointLinkId) -> Result { - self.data.take_link(link_id) - } } define_link_wrapper!( @@ -105,7 +89,8 @@ define_link_wrapper!( /// The type returned by [TracePoint::attach]. Can be passed to [TracePoint::detach]. TracePointLinkId, PerfLinkInner, - PerfLinkIdInner + PerfLinkIdInner, + TracePoint, ); impl TryFrom for FdLink { diff --git a/aya/src/programs/uprobe.rs b/aya/src/programs/uprobe.rs index afd0f6252..c45fda84d 100644 --- a/aya/src/programs/uprobe.rs +++ b/aya/src/programs/uprobe.rs @@ -97,22 +97,6 @@ impl UProbe { attach(&mut self.data, self.kind, path, sym_offset + offset, pid) } - /// Detaches the program. - /// - /// See [UProbe::attach]. - pub fn detach(&mut self, link_id: UProbeLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`UProbeLink`] is dropped, the link is - /// detached. - pub fn take_link(&mut self, link_id: UProbeLinkId) -> Result { - self.data.take_link(link_id) - } - /// Creates a program from a pinned entry on a bpffs. /// /// Existing links will not be populated. To work with existing links you should use [`crate::programs::links::PinnedLink`]. @@ -179,7 +163,8 @@ define_link_wrapper!( /// The type returned by [UProbe::attach]. Can be passed to [UProbe::detach]. UProbeLinkId, PerfLinkInner, - PerfLinkIdInner + PerfLinkIdInner, + UProbe, ); impl TryFrom for FdLink { diff --git a/aya/src/programs/xdp.rs b/aya/src/programs/xdp.rs index e21dd2f23..6c087f123 100644 --- a/aya/src/programs/xdp.rs +++ b/aya/src/programs/xdp.rs @@ -190,21 +190,6 @@ impl Xdp { Ok(Self { data, attach_type }) } - /// Detaches the program. - /// - /// See [Xdp::attach]. - pub fn detach(&mut self, link_id: XdpLinkId) -> Result<(), ProgramError> { - self.data.links.remove(link_id) - } - - /// Takes ownership of the link referenced by the provided `link_id`. - /// - /// The caller takes the responsibility of managing the lifetime of the - /// link. When the returned [`XdpLink`] is dropped, the link is detached. - pub fn take_link(&mut self, link_id: XdpLinkId) -> Result { - self.data.take_link(link_id) - } - /// Atomically replaces the program referenced by the provided link. /// /// Ownership of the link will transfer to this program. @@ -343,5 +328,6 @@ define_link_wrapper!( /// The type returned by [Xdp::attach]. Can be passed to [Xdp::detach]. XdpLinkId, XdpLinkInner, - XdpLinkIdInner + XdpLinkIdInner, + Xdp, ); diff --git a/xtask/public-api/aya.txt b/xtask/public-api/aya.txt index d3a82a446..f208954cb 100644 --- a/xtask/public-api/aya.txt +++ b/xtask/public-api/aya.txt @@ -2528,9 +2528,10 @@ pub mod aya::programs::cgroup_device pub struct aya::programs::cgroup_device::CgroupDevice impl aya::programs::cgroup_device::CgroupDevice pub fn aya::programs::cgroup_device::CgroupDevice::attach(&mut self, cgroup: T, mode: aya::programs::links::CgroupAttachMode) -> core::result::Result -pub fn aya::programs::cgroup_device::CgroupDevice::detach(&mut self, link_id: aya::programs::cgroup_device::CgroupDeviceLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_device::CgroupDevice::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_device::CgroupDevice::query(target_fd: T) -> core::result::Result, aya::programs::ProgramError> +impl aya::programs::cgroup_device::CgroupDevice +pub fn aya::programs::cgroup_device::CgroupDevice::detach(&mut self, link_id: aya::programs::cgroup_device::CgroupDeviceLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_device::CgroupDevice::take_link(&mut self, link_id: aya::programs::cgroup_device::CgroupDeviceLinkId) -> core::result::Result impl aya::programs::cgroup_device::CgroupDevice pub fn aya::programs::cgroup_device::CgroupDevice::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -2679,10 +2680,11 @@ pub fn aya::programs::cgroup_skb::CgroupSkbAttachType::from(t: T) -> T pub struct aya::programs::cgroup_skb::CgroupSkb impl aya::programs::cgroup_skb::CgroupSkb pub fn aya::programs::cgroup_skb::CgroupSkb::attach(&mut self, cgroup: T, attach_type: aya::programs::cgroup_skb::CgroupSkbAttachType, mode: aya::programs::links::CgroupAttachMode) -> core::result::Result -pub fn aya::programs::cgroup_skb::CgroupSkb::detach(&mut self, link_id: aya::programs::cgroup_skb::CgroupSkbLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_skb::CgroupSkb::expected_attach_type(&self) -> &core::option::Option pub fn aya::programs::cgroup_skb::CgroupSkb::from_pin>(path: P, expected_attach_type: aya::programs::cgroup_skb::CgroupSkbAttachType) -> core::result::Result pub fn aya::programs::cgroup_skb::CgroupSkb::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::cgroup_skb::CgroupSkb +pub fn aya::programs::cgroup_skb::CgroupSkb::detach(&mut self, link_id: aya::programs::cgroup_skb::CgroupSkbLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_skb::CgroupSkb::take_link(&mut self, link_id: aya::programs::cgroup_skb::CgroupSkbLinkId) -> core::result::Result impl aya::programs::cgroup_skb::CgroupSkb pub fn aya::programs::cgroup_skb::CgroupSkb::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -2794,9 +2796,10 @@ pub use aya::programs::cgroup_sock::CgroupSockAttachType pub struct aya::programs::cgroup_sock::CgroupSock impl aya::programs::cgroup_sock::CgroupSock pub fn aya::programs::cgroup_sock::CgroupSock::attach(&mut self, cgroup: T, mode: aya::programs::links::CgroupAttachMode) -> core::result::Result -pub fn aya::programs::cgroup_sock::CgroupSock::detach(&mut self, link_id: aya::programs::cgroup_sock::CgroupSockLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sock::CgroupSock::from_pin>(path: P, attach_type: aya_obj::programs::cgroup_sock::CgroupSockAttachType) -> core::result::Result pub fn aya::programs::cgroup_sock::CgroupSock::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::cgroup_sock::CgroupSock +pub fn aya::programs::cgroup_sock::CgroupSock::detach(&mut self, link_id: aya::programs::cgroup_sock::CgroupSockLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sock::CgroupSock::take_link(&mut self, link_id: aya::programs::cgroup_sock::CgroupSockLinkId) -> core::result::Result impl aya::programs::cgroup_sock::CgroupSock pub fn aya::programs::cgroup_sock::CgroupSock::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -2908,9 +2911,10 @@ pub use aya::programs::cgroup_sock_addr::CgroupSockAddrAttachType pub struct aya::programs::cgroup_sock_addr::CgroupSockAddr impl aya::programs::cgroup_sock_addr::CgroupSockAddr pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::attach(&mut self, cgroup: T, mode: aya::programs::links::CgroupAttachMode) -> core::result::Result -pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::detach(&mut self, link_id: aya::programs::cgroup_sock_addr::CgroupSockAddrLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::from_pin>(path: P, attach_type: aya_obj::programs::cgroup_sock_addr::CgroupSockAddrAttachType) -> core::result::Result pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::cgroup_sock_addr::CgroupSockAddr +pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::detach(&mut self, link_id: aya::programs::cgroup_sock_addr::CgroupSockAddrLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::take_link(&mut self, link_id: aya::programs::cgroup_sock_addr::CgroupSockAddrLinkId) -> core::result::Result impl aya::programs::cgroup_sock_addr::CgroupSockAddr pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -3022,9 +3026,10 @@ pub use aya::programs::cgroup_sockopt::CgroupSockoptAttachType pub struct aya::programs::cgroup_sockopt::CgroupSockopt impl aya::programs::cgroup_sockopt::CgroupSockopt pub fn aya::programs::cgroup_sockopt::CgroupSockopt::attach(&mut self, cgroup: T, mode: aya::programs::links::CgroupAttachMode) -> core::result::Result -pub fn aya::programs::cgroup_sockopt::CgroupSockopt::detach(&mut self, link_id: aya::programs::cgroup_sockopt::CgroupSockoptLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sockopt::CgroupSockopt::from_pin>(path: P, attach_type: aya_obj::programs::cgroup_sockopt::CgroupSockoptAttachType) -> core::result::Result pub fn aya::programs::cgroup_sockopt::CgroupSockopt::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::cgroup_sockopt::CgroupSockopt +pub fn aya::programs::cgroup_sockopt::CgroupSockopt::detach(&mut self, link_id: aya::programs::cgroup_sockopt::CgroupSockoptLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sockopt::CgroupSockopt::take_link(&mut self, link_id: aya::programs::cgroup_sockopt::CgroupSockoptLinkId) -> core::result::Result impl aya::programs::cgroup_sockopt::CgroupSockopt pub fn aya::programs::cgroup_sockopt::CgroupSockopt::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -3135,8 +3140,9 @@ pub mod aya::programs::cgroup_sysctl pub struct aya::programs::cgroup_sysctl::CgroupSysctl impl aya::programs::cgroup_sysctl::CgroupSysctl pub fn aya::programs::cgroup_sysctl::CgroupSysctl::attach(&mut self, cgroup: T, mode: aya::programs::links::CgroupAttachMode) -> core::result::Result -pub fn aya::programs::cgroup_sysctl::CgroupSysctl::detach(&mut self, link_id: aya::programs::cgroup_sysctl::CgroupSysctlLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sysctl::CgroupSysctl::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::cgroup_sysctl::CgroupSysctl +pub fn aya::programs::cgroup_sysctl::CgroupSysctl::detach(&mut self, link_id: aya::programs::cgroup_sysctl::CgroupSysctlLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sysctl::CgroupSysctl::take_link(&mut self, link_id: aya::programs::cgroup_sysctl::CgroupSysctlLinkId) -> core::result::Result impl aya::programs::cgroup_sysctl::CgroupSysctl pub fn aya::programs::cgroup_sysctl::CgroupSysctl::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -3283,8 +3289,9 @@ pub struct aya::programs::extension::Extension impl aya::programs::extension::Extension pub fn aya::programs::extension::Extension::attach(&mut self) -> core::result::Result pub fn aya::programs::extension::Extension::attach_to_program(&mut self, program: &aya::programs::ProgramFd, func_name: &str) -> core::result::Result -pub fn aya::programs::extension::Extension::detach(&mut self, link_id: aya::programs::extension::ExtensionLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::extension::Extension::load(&mut self, program: aya::programs::ProgramFd, func_name: &str) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::extension::Extension +pub fn aya::programs::extension::Extension::detach(&mut self, link_id: aya::programs::extension::ExtensionLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::extension::Extension::take_link(&mut self, link_id: aya::programs::extension::ExtensionLinkId) -> core::result::Result impl aya::programs::extension::Extension pub fn aya::programs::extension::Extension::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -3401,8 +3408,9 @@ pub mod aya::programs::fentry pub struct aya::programs::fentry::FEntry impl aya::programs::fentry::FEntry pub fn aya::programs::fentry::FEntry::attach(&mut self) -> core::result::Result -pub fn aya::programs::fentry::FEntry::detach(&mut self, link_id: aya::programs::fentry::FEntryLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::fentry::FEntry::load(&mut self, fn_name: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::fentry::FEntry +pub fn aya::programs::fentry::FEntry::detach(&mut self, link_id: aya::programs::fentry::FEntryLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::fentry::FEntry::take_link(&mut self, link_id: aya::programs::fentry::FEntryLinkId) -> core::result::Result impl aya::programs::fentry::FEntry pub fn aya::programs::fentry::FEntry::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -3519,8 +3527,9 @@ pub mod aya::programs::fexit pub struct aya::programs::fexit::FExit impl aya::programs::fexit::FExit pub fn aya::programs::fexit::FExit::attach(&mut self) -> core::result::Result -pub fn aya::programs::fexit::FExit::detach(&mut self, link_id: aya::programs::fexit::FExitLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::fexit::FExit::load(&mut self, fn_name: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::fexit::FExit +pub fn aya::programs::fexit::FExit::detach(&mut self, link_id: aya::programs::fexit::FExitLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::fexit::FExit::take_link(&mut self, link_id: aya::programs::fexit::FExitLinkId) -> core::result::Result impl aya::programs::fexit::FExit pub fn aya::programs::fexit::FExit::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -3637,8 +3646,9 @@ pub mod aya::programs::iter pub struct aya::programs::iter::Iter impl aya::programs::iter::Iter pub fn aya::programs::iter::Iter::attach(&mut self) -> core::result::Result -pub fn aya::programs::iter::Iter::detach(&mut self, link_id: aya::programs::iter::IterLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::iter::Iter::load(&mut self, iter_type: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::iter::Iter +pub fn aya::programs::iter::Iter::detach(&mut self, link_id: aya::programs::iter::IterLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::iter::Iter::take_link(&mut self, link_id: aya::programs::iter::IterLinkId) -> core::result::Result impl aya::programs::iter::Iter pub fn aya::programs::iter::Iter::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -3822,10 +3832,11 @@ pub fn aya::programs::kprobe::KProbeError::from(t: T) -> T pub struct aya::programs::kprobe::KProbe impl aya::programs::kprobe::KProbe pub fn aya::programs::kprobe::KProbe::attach>(&mut self, fn_name: T, offset: u64) -> core::result::Result -pub fn aya::programs::kprobe::KProbe::detach(&mut self, link_id: aya::programs::kprobe::KProbeLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::kprobe::KProbe::from_pin>(path: P, kind: aya::programs::ProbeKind) -> core::result::Result pub fn aya::programs::kprobe::KProbe::kind(&self) -> aya::programs::ProbeKind pub fn aya::programs::kprobe::KProbe::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::kprobe::KProbe +pub fn aya::programs::kprobe::KProbe::detach(&mut self, link_id: aya::programs::kprobe::KProbeLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::kprobe::KProbe::take_link(&mut self, link_id: aya::programs::kprobe::KProbeLinkId) -> core::result::Result impl aya::programs::kprobe::KProbe pub fn aya::programs::kprobe::KProbe::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -4525,8 +4536,9 @@ pub mod aya::programs::lsm pub struct aya::programs::lsm::Lsm impl aya::programs::lsm::Lsm pub fn aya::programs::lsm::Lsm::attach(&mut self) -> core::result::Result -pub fn aya::programs::lsm::Lsm::detach(&mut self, link_id: aya::programs::lsm::LsmLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::lsm::Lsm::load(&mut self, lsm_hook_name: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::lsm::Lsm +pub fn aya::programs::lsm::Lsm::detach(&mut self, link_id: aya::programs::lsm::LsmLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::lsm::Lsm::take_link(&mut self, link_id: aya::programs::lsm::LsmLinkId) -> core::result::Result impl aya::programs::lsm::Lsm pub fn aya::programs::lsm::Lsm::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -4828,8 +4840,9 @@ pub fn aya::programs::perf_event::SamplePolicy::from(t: T) -> T pub struct aya::programs::perf_event::PerfEvent impl aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::attach(&mut self, perf_type: aya::programs::perf_event::PerfTypeId, config: u64, scope: aya::programs::perf_event::PerfEventScope, sample_policy: aya::programs::perf_event::SamplePolicy, inherit: bool) -> core::result::Result -pub fn aya::programs::perf_event::PerfEvent::detach(&mut self, link_id: aya::programs::perf_event::PerfEventLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::perf_event::PerfEvent::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::perf_event::PerfEvent +pub fn aya::programs::perf_event::PerfEvent::detach(&mut self, link_id: aya::programs::perf_event::PerfEventLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::perf_event::PerfEvent::take_link(&mut self, link_id: aya::programs::perf_event::PerfEventLinkId) -> core::result::Result impl aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -4948,8 +4961,9 @@ pub mod aya::programs::raw_trace_point pub struct aya::programs::raw_trace_point::RawTracePoint impl aya::programs::raw_trace_point::RawTracePoint pub fn aya::programs::raw_trace_point::RawTracePoint::attach(&mut self, tp_name: &str) -> core::result::Result -pub fn aya::programs::raw_trace_point::RawTracePoint::detach(&mut self, link_id: aya::programs::raw_trace_point::RawTracePointLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::raw_trace_point::RawTracePoint::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::raw_trace_point::RawTracePoint +pub fn aya::programs::raw_trace_point::RawTracePoint::detach(&mut self, link_id: aya::programs::raw_trace_point::RawTracePointLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::raw_trace_point::RawTracePoint::take_link(&mut self, link_id: aya::programs::raw_trace_point::RawTracePointLinkId) -> core::result::Result impl aya::programs::raw_trace_point::RawTracePoint pub fn aya::programs::raw_trace_point::RawTracePoint::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -5066,8 +5080,9 @@ pub mod aya::programs::sk_lookup pub struct aya::programs::sk_lookup::SkLookup impl aya::programs::sk_lookup::SkLookup pub fn aya::programs::sk_lookup::SkLookup::attach(&mut self, netns: T) -> core::result::Result -pub fn aya::programs::sk_lookup::SkLookup::detach(&mut self, link_id: aya::programs::sk_lookup::SkLookupLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::sk_lookup::SkLookup::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::sk_lookup::SkLookup +pub fn aya::programs::sk_lookup::SkLookup::detach(&mut self, link_id: aya::programs::sk_lookup::SkLookupLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::sk_lookup::SkLookup::take_link(&mut self, link_id: aya::programs::sk_lookup::SkLookupLinkId) -> core::result::Result impl aya::programs::sk_lookup::SkLookup pub fn aya::programs::sk_lookup::SkLookup::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -5184,8 +5199,9 @@ pub mod aya::programs::sk_msg pub struct aya::programs::sk_msg::SkMsg impl aya::programs::sk_msg::SkMsg pub fn aya::programs::sk_msg::SkMsg::attach(&mut self, map: &aya::maps::sock::SockMapFd) -> core::result::Result -pub fn aya::programs::sk_msg::SkMsg::detach(&mut self, link_id: aya::programs::sk_msg::SkMsgLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::sk_msg::SkMsg::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::sk_msg::SkMsg +pub fn aya::programs::sk_msg::SkMsg::detach(&mut self, link_id: aya::programs::sk_msg::SkMsgLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::sk_msg::SkMsg::take_link(&mut self, link_id: aya::programs::sk_msg::SkMsgLinkId) -> core::result::Result impl aya::programs::sk_msg::SkMsg pub fn aya::programs::sk_msg::SkMsg::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -5338,9 +5354,10 @@ pub fn aya::programs::sk_skb::SkSkbKind::from(t: T) -> T pub struct aya::programs::sk_skb::SkSkb impl aya::programs::sk_skb::SkSkb pub fn aya::programs::sk_skb::SkSkb::attach(&mut self, map: &aya::maps::sock::SockMapFd) -> core::result::Result -pub fn aya::programs::sk_skb::SkSkb::detach(&mut self, link_id: aya::programs::sk_skb::SkSkbLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::sk_skb::SkSkb::from_pin>(path: P, kind: aya::programs::sk_skb::SkSkbKind) -> core::result::Result pub fn aya::programs::sk_skb::SkSkb::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::sk_skb::SkSkb +pub fn aya::programs::sk_skb::SkSkb::detach(&mut self, link_id: aya::programs::sk_skb::SkSkbLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::sk_skb::SkSkb::take_link(&mut self, link_id: aya::programs::sk_skb::SkSkbLinkId) -> core::result::Result impl aya::programs::sk_skb::SkSkb pub fn aya::programs::sk_skb::SkSkb::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -5455,8 +5472,9 @@ pub mod aya::programs::sock_ops pub struct aya::programs::sock_ops::SockOps impl aya::programs::sock_ops::SockOps pub fn aya::programs::sock_ops::SockOps::attach(&mut self, cgroup: T, mode: aya::programs::links::CgroupAttachMode) -> core::result::Result -pub fn aya::programs::sock_ops::SockOps::detach(&mut self, link_id: aya::programs::sock_ops::SockOpsLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::sock_ops::SockOps::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::sock_ops::SockOps +pub fn aya::programs::sock_ops::SockOps::detach(&mut self, link_id: aya::programs::sock_ops::SockOpsLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::sock_ops::SockOps::take_link(&mut self, link_id: aya::programs::sock_ops::SockOpsLinkId) -> core::result::Result impl aya::programs::sock_ops::SockOps pub fn aya::programs::sock_ops::SockOps::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -5865,10 +5883,11 @@ impl aya::programs::tc::SchedClassifier pub fn aya::programs::tc::SchedClassifier::attach(&mut self, interface: &str, attach_type: aya::programs::tc::TcAttachType) -> core::result::Result pub fn aya::programs::tc::SchedClassifier::attach_to_link(&mut self, link: aya::programs::tc::SchedClassifierLink) -> core::result::Result pub fn aya::programs::tc::SchedClassifier::attach_with_options(&mut self, interface: &str, attach_type: aya::programs::tc::TcAttachType, options: aya::programs::tc::TcAttachOptions) -> core::result::Result -pub fn aya::programs::tc::SchedClassifier::detach(&mut self, link_id: aya::programs::tc::SchedClassifierLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::tc::SchedClassifier::from_pin>(path: P) -> core::result::Result pub fn aya::programs::tc::SchedClassifier::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::tc::SchedClassifier::query_tcx(interface: &str, attach_type: aya::programs::tc::TcAttachType) -> core::result::Result<(u64, alloc::vec::Vec), aya::programs::ProgramError> +impl aya::programs::tc::SchedClassifier +pub fn aya::programs::tc::SchedClassifier::detach(&mut self, link_id: aya::programs::tc::SchedClassifierLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::tc::SchedClassifier::take_link(&mut self, link_id: aya::programs::tc::SchedClassifierLinkId) -> core::result::Result impl aya::programs::tc::SchedClassifier pub fn aya::programs::tc::SchedClassifier::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -5999,8 +6018,9 @@ pub mod aya::programs::tp_btf pub struct aya::programs::tp_btf::BtfTracePoint impl aya::programs::tp_btf::BtfTracePoint pub fn aya::programs::tp_btf::BtfTracePoint::attach(&mut self) -> core::result::Result -pub fn aya::programs::tp_btf::BtfTracePoint::detach(&mut self, link_id: aya::programs::tp_btf::BtfTracePointLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::tp_btf::BtfTracePoint::load(&mut self, tracepoint: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::tp_btf::BtfTracePoint +pub fn aya::programs::tp_btf::BtfTracePoint::detach(&mut self, link_id: aya::programs::tp_btf::BtfTracePointLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::tp_btf::BtfTracePoint::take_link(&mut self, link_id: aya::programs::tp_btf::BtfTracePointLinkId) -> core::result::Result impl aya::programs::tp_btf::BtfTracePoint pub fn aya::programs::tp_btf::BtfTracePoint::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -6153,8 +6173,9 @@ pub fn aya::programs::trace_point::TracePointError::from(t: T) -> T pub struct aya::programs::trace_point::TracePoint impl aya::programs::trace_point::TracePoint pub fn aya::programs::trace_point::TracePoint::attach(&mut self, category: &str, name: &str) -> core::result::Result -pub fn aya::programs::trace_point::TracePoint::detach(&mut self, link_id: aya::programs::trace_point::TracePointLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::trace_point::TracePoint::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::trace_point::TracePoint +pub fn aya::programs::trace_point::TracePoint::detach(&mut self, link_id: aya::programs::trace_point::TracePointLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::trace_point::TracePoint::take_link(&mut self, link_id: aya::programs::trace_point::TracePointLinkId) -> core::result::Result impl aya::programs::trace_point::TracePoint pub fn aya::programs::trace_point::TracePoint::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -6316,10 +6337,11 @@ pub fn aya::programs::uprobe::UProbeError::from(t: T) -> T pub struct aya::programs::uprobe::UProbe impl aya::programs::uprobe::UProbe pub fn aya::programs::uprobe::UProbe::attach>(&mut self, fn_name: core::option::Option<&str>, offset: u64, target: T, pid: core::option::Option) -> core::result::Result -pub fn aya::programs::uprobe::UProbe::detach(&mut self, link_id: aya::programs::uprobe::UProbeLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::uprobe::UProbe::from_pin>(path: P, kind: aya::programs::ProbeKind) -> core::result::Result pub fn aya::programs::uprobe::UProbe::kind(&self) -> aya::programs::ProbeKind pub fn aya::programs::uprobe::UProbe::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::uprobe::UProbe +pub fn aya::programs::uprobe::UProbe::detach(&mut self, link_id: aya::programs::uprobe::UProbeLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::uprobe::UProbe::take_link(&mut self, link_id: aya::programs::uprobe::UProbeLinkId) -> core::result::Result impl aya::programs::uprobe::UProbe pub fn aya::programs::uprobe::UProbe::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -6473,9 +6495,10 @@ impl aya::programs::xdp::Xdp pub fn aya::programs::xdp::Xdp::attach(&mut self, interface: &str, flags: aya::programs::xdp::XdpFlags) -> core::result::Result pub fn aya::programs::xdp::Xdp::attach_to_if_index(&mut self, if_index: u32, flags: aya::programs::xdp::XdpFlags) -> core::result::Result pub fn aya::programs::xdp::Xdp::attach_to_link(&mut self, link: aya::programs::xdp::XdpLink) -> core::result::Result -pub fn aya::programs::xdp::Xdp::detach(&mut self, link_id: aya::programs::xdp::XdpLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::xdp::Xdp::from_pin>(path: P, attach_type: aya_obj::programs::xdp::XdpAttachType) -> core::result::Result pub fn aya::programs::xdp::Xdp::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::xdp::Xdp +pub fn aya::programs::xdp::Xdp::detach(&mut self, link_id: aya::programs::xdp::XdpLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::xdp::Xdp::take_link(&mut self, link_id: aya::programs::xdp::XdpLinkId) -> core::result::Result impl aya::programs::xdp::Xdp pub fn aya::programs::xdp::Xdp::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -7630,8 +7653,9 @@ pub fn aya::programs::xdp::XdpError::from(t: T) -> T pub struct aya::programs::BtfTracePoint impl aya::programs::tp_btf::BtfTracePoint pub fn aya::programs::tp_btf::BtfTracePoint::attach(&mut self) -> core::result::Result -pub fn aya::programs::tp_btf::BtfTracePoint::detach(&mut self, link_id: aya::programs::tp_btf::BtfTracePointLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::tp_btf::BtfTracePoint::load(&mut self, tracepoint: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::tp_btf::BtfTracePoint +pub fn aya::programs::tp_btf::BtfTracePoint::detach(&mut self, link_id: aya::programs::tp_btf::BtfTracePointLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::tp_btf::BtfTracePoint::take_link(&mut self, link_id: aya::programs::tp_btf::BtfTracePointLinkId) -> core::result::Result impl aya::programs::tp_btf::BtfTracePoint pub fn aya::programs::tp_btf::BtfTracePoint::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -7679,9 +7703,10 @@ pub fn aya::programs::tp_btf::BtfTracePoint::from(t: T) -> T pub struct aya::programs::CgroupDevice impl aya::programs::cgroup_device::CgroupDevice pub fn aya::programs::cgroup_device::CgroupDevice::attach(&mut self, cgroup: T, mode: aya::programs::links::CgroupAttachMode) -> core::result::Result -pub fn aya::programs::cgroup_device::CgroupDevice::detach(&mut self, link_id: aya::programs::cgroup_device::CgroupDeviceLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_device::CgroupDevice::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_device::CgroupDevice::query(target_fd: T) -> core::result::Result, aya::programs::ProgramError> +impl aya::programs::cgroup_device::CgroupDevice +pub fn aya::programs::cgroup_device::CgroupDevice::detach(&mut self, link_id: aya::programs::cgroup_device::CgroupDeviceLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_device::CgroupDevice::take_link(&mut self, link_id: aya::programs::cgroup_device::CgroupDeviceLinkId) -> core::result::Result impl aya::programs::cgroup_device::CgroupDevice pub fn aya::programs::cgroup_device::CgroupDevice::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -7729,10 +7754,11 @@ pub fn aya::programs::cgroup_device::CgroupDevice::from(t: T) -> T pub struct aya::programs::CgroupSkb impl aya::programs::cgroup_skb::CgroupSkb pub fn aya::programs::cgroup_skb::CgroupSkb::attach(&mut self, cgroup: T, attach_type: aya::programs::cgroup_skb::CgroupSkbAttachType, mode: aya::programs::links::CgroupAttachMode) -> core::result::Result -pub fn aya::programs::cgroup_skb::CgroupSkb::detach(&mut self, link_id: aya::programs::cgroup_skb::CgroupSkbLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_skb::CgroupSkb::expected_attach_type(&self) -> &core::option::Option pub fn aya::programs::cgroup_skb::CgroupSkb::from_pin>(path: P, expected_attach_type: aya::programs::cgroup_skb::CgroupSkbAttachType) -> core::result::Result pub fn aya::programs::cgroup_skb::CgroupSkb::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::cgroup_skb::CgroupSkb +pub fn aya::programs::cgroup_skb::CgroupSkb::detach(&mut self, link_id: aya::programs::cgroup_skb::CgroupSkbLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_skb::CgroupSkb::take_link(&mut self, link_id: aya::programs::cgroup_skb::CgroupSkbLinkId) -> core::result::Result impl aya::programs::cgroup_skb::CgroupSkb pub fn aya::programs::cgroup_skb::CgroupSkb::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -7778,9 +7804,10 @@ pub fn aya::programs::cgroup_skb::CgroupSkb::from(t: T) -> T pub struct aya::programs::CgroupSock impl aya::programs::cgroup_sock::CgroupSock pub fn aya::programs::cgroup_sock::CgroupSock::attach(&mut self, cgroup: T, mode: aya::programs::links::CgroupAttachMode) -> core::result::Result -pub fn aya::programs::cgroup_sock::CgroupSock::detach(&mut self, link_id: aya::programs::cgroup_sock::CgroupSockLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sock::CgroupSock::from_pin>(path: P, attach_type: aya_obj::programs::cgroup_sock::CgroupSockAttachType) -> core::result::Result pub fn aya::programs::cgroup_sock::CgroupSock::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::cgroup_sock::CgroupSock +pub fn aya::programs::cgroup_sock::CgroupSock::detach(&mut self, link_id: aya::programs::cgroup_sock::CgroupSockLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sock::CgroupSock::take_link(&mut self, link_id: aya::programs::cgroup_sock::CgroupSockLinkId) -> core::result::Result impl aya::programs::cgroup_sock::CgroupSock pub fn aya::programs::cgroup_sock::CgroupSock::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -7826,9 +7853,10 @@ pub fn aya::programs::cgroup_sock::CgroupSock::from(t: T) -> T pub struct aya::programs::CgroupSockAddr impl aya::programs::cgroup_sock_addr::CgroupSockAddr pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::attach(&mut self, cgroup: T, mode: aya::programs::links::CgroupAttachMode) -> core::result::Result -pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::detach(&mut self, link_id: aya::programs::cgroup_sock_addr::CgroupSockAddrLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::from_pin>(path: P, attach_type: aya_obj::programs::cgroup_sock_addr::CgroupSockAddrAttachType) -> core::result::Result pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::cgroup_sock_addr::CgroupSockAddr +pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::detach(&mut self, link_id: aya::programs::cgroup_sock_addr::CgroupSockAddrLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::take_link(&mut self, link_id: aya::programs::cgroup_sock_addr::CgroupSockAddrLinkId) -> core::result::Result impl aya::programs::cgroup_sock_addr::CgroupSockAddr pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -7874,9 +7902,10 @@ pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::from(t: T) -> T pub struct aya::programs::CgroupSockopt impl aya::programs::cgroup_sockopt::CgroupSockopt pub fn aya::programs::cgroup_sockopt::CgroupSockopt::attach(&mut self, cgroup: T, mode: aya::programs::links::CgroupAttachMode) -> core::result::Result -pub fn aya::programs::cgroup_sockopt::CgroupSockopt::detach(&mut self, link_id: aya::programs::cgroup_sockopt::CgroupSockoptLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sockopt::CgroupSockopt::from_pin>(path: P, attach_type: aya_obj::programs::cgroup_sockopt::CgroupSockoptAttachType) -> core::result::Result pub fn aya::programs::cgroup_sockopt::CgroupSockopt::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::cgroup_sockopt::CgroupSockopt +pub fn aya::programs::cgroup_sockopt::CgroupSockopt::detach(&mut self, link_id: aya::programs::cgroup_sockopt::CgroupSockoptLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sockopt::CgroupSockopt::take_link(&mut self, link_id: aya::programs::cgroup_sockopt::CgroupSockoptLinkId) -> core::result::Result impl aya::programs::cgroup_sockopt::CgroupSockopt pub fn aya::programs::cgroup_sockopt::CgroupSockopt::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -7922,8 +7951,9 @@ pub fn aya::programs::cgroup_sockopt::CgroupSockopt::from(t: T) -> T pub struct aya::programs::CgroupSysctl impl aya::programs::cgroup_sysctl::CgroupSysctl pub fn aya::programs::cgroup_sysctl::CgroupSysctl::attach(&mut self, cgroup: T, mode: aya::programs::links::CgroupAttachMode) -> core::result::Result -pub fn aya::programs::cgroup_sysctl::CgroupSysctl::detach(&mut self, link_id: aya::programs::cgroup_sysctl::CgroupSysctlLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sysctl::CgroupSysctl::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::cgroup_sysctl::CgroupSysctl +pub fn aya::programs::cgroup_sysctl::CgroupSysctl::detach(&mut self, link_id: aya::programs::cgroup_sysctl::CgroupSysctlLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sysctl::CgroupSysctl::take_link(&mut self, link_id: aya::programs::cgroup_sysctl::CgroupSysctlLinkId) -> core::result::Result impl aya::programs::cgroup_sysctl::CgroupSysctl pub fn aya::programs::cgroup_sysctl::CgroupSysctl::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -7972,8 +8002,9 @@ pub struct aya::programs::Extension impl aya::programs::extension::Extension pub fn aya::programs::extension::Extension::attach(&mut self) -> core::result::Result pub fn aya::programs::extension::Extension::attach_to_program(&mut self, program: &aya::programs::ProgramFd, func_name: &str) -> core::result::Result -pub fn aya::programs::extension::Extension::detach(&mut self, link_id: aya::programs::extension::ExtensionLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::extension::Extension::load(&mut self, program: aya::programs::ProgramFd, func_name: &str) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::extension::Extension +pub fn aya::programs::extension::Extension::detach(&mut self, link_id: aya::programs::extension::ExtensionLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::extension::Extension::take_link(&mut self, link_id: aya::programs::extension::ExtensionLinkId) -> core::result::Result impl aya::programs::extension::Extension pub fn aya::programs::extension::Extension::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -8021,8 +8052,9 @@ pub fn aya::programs::extension::Extension::from(t: T) -> T pub struct aya::programs::FEntry impl aya::programs::fentry::FEntry pub fn aya::programs::fentry::FEntry::attach(&mut self) -> core::result::Result -pub fn aya::programs::fentry::FEntry::detach(&mut self, link_id: aya::programs::fentry::FEntryLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::fentry::FEntry::load(&mut self, fn_name: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::fentry::FEntry +pub fn aya::programs::fentry::FEntry::detach(&mut self, link_id: aya::programs::fentry::FEntryLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::fentry::FEntry::take_link(&mut self, link_id: aya::programs::fentry::FEntryLinkId) -> core::result::Result impl aya::programs::fentry::FEntry pub fn aya::programs::fentry::FEntry::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -8070,8 +8102,9 @@ pub fn aya::programs::fentry::FEntry::from(t: T) -> T pub struct aya::programs::FExit impl aya::programs::fexit::FExit pub fn aya::programs::fexit::FExit::attach(&mut self) -> core::result::Result -pub fn aya::programs::fexit::FExit::detach(&mut self, link_id: aya::programs::fexit::FExitLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::fexit::FExit::load(&mut self, fn_name: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::fexit::FExit +pub fn aya::programs::fexit::FExit::detach(&mut self, link_id: aya::programs::fexit::FExitLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::fexit::FExit::take_link(&mut self, link_id: aya::programs::fexit::FExitLinkId) -> core::result::Result impl aya::programs::fexit::FExit pub fn aya::programs::fexit::FExit::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -8119,8 +8152,9 @@ pub fn aya::programs::fexit::FExit::from(t: T) -> T pub struct aya::programs::Iter impl aya::programs::iter::Iter pub fn aya::programs::iter::Iter::attach(&mut self) -> core::result::Result -pub fn aya::programs::iter::Iter::detach(&mut self, link_id: aya::programs::iter::IterLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::iter::Iter::load(&mut self, iter_type: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::iter::Iter +pub fn aya::programs::iter::Iter::detach(&mut self, link_id: aya::programs::iter::IterLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::iter::Iter::take_link(&mut self, link_id: aya::programs::iter::IterLinkId) -> core::result::Result impl aya::programs::iter::Iter pub fn aya::programs::iter::Iter::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -8168,10 +8202,11 @@ pub fn aya::programs::iter::Iter::from(t: T) -> T pub struct aya::programs::KProbe impl aya::programs::kprobe::KProbe pub fn aya::programs::kprobe::KProbe::attach>(&mut self, fn_name: T, offset: u64) -> core::result::Result -pub fn aya::programs::kprobe::KProbe::detach(&mut self, link_id: aya::programs::kprobe::KProbeLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::kprobe::KProbe::from_pin>(path: P, kind: aya::programs::ProbeKind) -> core::result::Result pub fn aya::programs::kprobe::KProbe::kind(&self) -> aya::programs::ProbeKind pub fn aya::programs::kprobe::KProbe::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::kprobe::KProbe +pub fn aya::programs::kprobe::KProbe::detach(&mut self, link_id: aya::programs::kprobe::KProbeLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::kprobe::KProbe::take_link(&mut self, link_id: aya::programs::kprobe::KProbeLinkId) -> core::result::Result impl aya::programs::kprobe::KProbe pub fn aya::programs::kprobe::KProbe::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -8303,8 +8338,9 @@ pub fn aya::programs::lirc_mode2::LircMode2::from(t: T) -> T pub struct aya::programs::Lsm impl aya::programs::lsm::Lsm pub fn aya::programs::lsm::Lsm::attach(&mut self) -> core::result::Result -pub fn aya::programs::lsm::Lsm::detach(&mut self, link_id: aya::programs::lsm::LsmLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::lsm::Lsm::load(&mut self, lsm_hook_name: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::lsm::Lsm +pub fn aya::programs::lsm::Lsm::detach(&mut self, link_id: aya::programs::lsm::LsmLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::lsm::Lsm::take_link(&mut self, link_id: aya::programs::lsm::LsmLinkId) -> core::result::Result impl aya::programs::lsm::Lsm pub fn aya::programs::lsm::Lsm::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -8352,8 +8388,9 @@ pub fn aya::programs::lsm::Lsm::from(t: T) -> T pub struct aya::programs::PerfEvent impl aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::attach(&mut self, perf_type: aya::programs::perf_event::PerfTypeId, config: u64, scope: aya::programs::perf_event::PerfEventScope, sample_policy: aya::programs::perf_event::SamplePolicy, inherit: bool) -> core::result::Result -pub fn aya::programs::perf_event::PerfEvent::detach(&mut self, link_id: aya::programs::perf_event::PerfEventLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::perf_event::PerfEvent::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::perf_event::PerfEvent +pub fn aya::programs::perf_event::PerfEvent::detach(&mut self, link_id: aya::programs::perf_event::PerfEventLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::perf_event::PerfEvent::take_link(&mut self, link_id: aya::programs::perf_event::PerfEventLinkId) -> core::result::Result impl aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -8499,8 +8536,9 @@ pub fn aya::programs::ProgramInfo::from(t: T) -> T pub struct aya::programs::RawTracePoint impl aya::programs::raw_trace_point::RawTracePoint pub fn aya::programs::raw_trace_point::RawTracePoint::attach(&mut self, tp_name: &str) -> core::result::Result -pub fn aya::programs::raw_trace_point::RawTracePoint::detach(&mut self, link_id: aya::programs::raw_trace_point::RawTracePointLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::raw_trace_point::RawTracePoint::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::raw_trace_point::RawTracePoint +pub fn aya::programs::raw_trace_point::RawTracePoint::detach(&mut self, link_id: aya::programs::raw_trace_point::RawTracePointLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::raw_trace_point::RawTracePoint::take_link(&mut self, link_id: aya::programs::raw_trace_point::RawTracePointLinkId) -> core::result::Result impl aya::programs::raw_trace_point::RawTracePoint pub fn aya::programs::raw_trace_point::RawTracePoint::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -8550,10 +8588,11 @@ impl aya::programs::tc::SchedClassifier pub fn aya::programs::tc::SchedClassifier::attach(&mut self, interface: &str, attach_type: aya::programs::tc::TcAttachType) -> core::result::Result pub fn aya::programs::tc::SchedClassifier::attach_to_link(&mut self, link: aya::programs::tc::SchedClassifierLink) -> core::result::Result pub fn aya::programs::tc::SchedClassifier::attach_with_options(&mut self, interface: &str, attach_type: aya::programs::tc::TcAttachType, options: aya::programs::tc::TcAttachOptions) -> core::result::Result -pub fn aya::programs::tc::SchedClassifier::detach(&mut self, link_id: aya::programs::tc::SchedClassifierLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::tc::SchedClassifier::from_pin>(path: P) -> core::result::Result pub fn aya::programs::tc::SchedClassifier::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::tc::SchedClassifier::query_tcx(interface: &str, attach_type: aya::programs::tc::TcAttachType) -> core::result::Result<(u64, alloc::vec::Vec), aya::programs::ProgramError> +impl aya::programs::tc::SchedClassifier +pub fn aya::programs::tc::SchedClassifier::detach(&mut self, link_id: aya::programs::tc::SchedClassifierLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::tc::SchedClassifier::take_link(&mut self, link_id: aya::programs::tc::SchedClassifierLinkId) -> core::result::Result impl aya::programs::tc::SchedClassifier pub fn aya::programs::tc::SchedClassifier::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -8601,8 +8640,9 @@ pub fn aya::programs::tc::SchedClassifier::from(t: T) -> T pub struct aya::programs::SkLookup impl aya::programs::sk_lookup::SkLookup pub fn aya::programs::sk_lookup::SkLookup::attach(&mut self, netns: T) -> core::result::Result -pub fn aya::programs::sk_lookup::SkLookup::detach(&mut self, link_id: aya::programs::sk_lookup::SkLookupLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::sk_lookup::SkLookup::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::sk_lookup::SkLookup +pub fn aya::programs::sk_lookup::SkLookup::detach(&mut self, link_id: aya::programs::sk_lookup::SkLookupLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::sk_lookup::SkLookup::take_link(&mut self, link_id: aya::programs::sk_lookup::SkLookupLinkId) -> core::result::Result impl aya::programs::sk_lookup::SkLookup pub fn aya::programs::sk_lookup::SkLookup::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -8650,8 +8690,9 @@ pub fn aya::programs::sk_lookup::SkLookup::from(t: T) -> T pub struct aya::programs::SkMsg impl aya::programs::sk_msg::SkMsg pub fn aya::programs::sk_msg::SkMsg::attach(&mut self, map: &aya::maps::sock::SockMapFd) -> core::result::Result -pub fn aya::programs::sk_msg::SkMsg::detach(&mut self, link_id: aya::programs::sk_msg::SkMsgLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::sk_msg::SkMsg::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::sk_msg::SkMsg +pub fn aya::programs::sk_msg::SkMsg::detach(&mut self, link_id: aya::programs::sk_msg::SkMsgLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::sk_msg::SkMsg::take_link(&mut self, link_id: aya::programs::sk_msg::SkMsgLinkId) -> core::result::Result impl aya::programs::sk_msg::SkMsg pub fn aya::programs::sk_msg::SkMsg::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -8699,9 +8740,10 @@ pub fn aya::programs::sk_msg::SkMsg::from(t: T) -> T pub struct aya::programs::SkSkb impl aya::programs::sk_skb::SkSkb pub fn aya::programs::sk_skb::SkSkb::attach(&mut self, map: &aya::maps::sock::SockMapFd) -> core::result::Result -pub fn aya::programs::sk_skb::SkSkb::detach(&mut self, link_id: aya::programs::sk_skb::SkSkbLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::sk_skb::SkSkb::from_pin>(path: P, kind: aya::programs::sk_skb::SkSkbKind) -> core::result::Result pub fn aya::programs::sk_skb::SkSkb::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::sk_skb::SkSkb +pub fn aya::programs::sk_skb::SkSkb::detach(&mut self, link_id: aya::programs::sk_skb::SkSkbLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::sk_skb::SkSkb::take_link(&mut self, link_id: aya::programs::sk_skb::SkSkbLinkId) -> core::result::Result impl aya::programs::sk_skb::SkSkb pub fn aya::programs::sk_skb::SkSkb::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -8747,8 +8789,9 @@ pub fn aya::programs::sk_skb::SkSkb::from(t: T) -> T pub struct aya::programs::SockOps impl aya::programs::sock_ops::SockOps pub fn aya::programs::sock_ops::SockOps::attach(&mut self, cgroup: T, mode: aya::programs::links::CgroupAttachMode) -> core::result::Result -pub fn aya::programs::sock_ops::SockOps::detach(&mut self, link_id: aya::programs::sock_ops::SockOpsLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::sock_ops::SockOps::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::sock_ops::SockOps +pub fn aya::programs::sock_ops::SockOps::detach(&mut self, link_id: aya::programs::sock_ops::SockOpsLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::sock_ops::SockOps::take_link(&mut self, link_id: aya::programs::sock_ops::SockOpsLinkId) -> core::result::Result impl aya::programs::sock_ops::SockOps pub fn aya::programs::sock_ops::SockOps::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -8845,8 +8888,9 @@ pub fn aya::programs::socket_filter::SocketFilter::from(t: T) -> T pub struct aya::programs::TracePoint impl aya::programs::trace_point::TracePoint pub fn aya::programs::trace_point::TracePoint::attach(&mut self, category: &str, name: &str) -> core::result::Result -pub fn aya::programs::trace_point::TracePoint::detach(&mut self, link_id: aya::programs::trace_point::TracePointLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::trace_point::TracePoint::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::trace_point::TracePoint +pub fn aya::programs::trace_point::TracePoint::detach(&mut self, link_id: aya::programs::trace_point::TracePointLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::trace_point::TracePoint::take_link(&mut self, link_id: aya::programs::trace_point::TracePointLinkId) -> core::result::Result impl aya::programs::trace_point::TracePoint pub fn aya::programs::trace_point::TracePoint::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -8894,10 +8938,11 @@ pub fn aya::programs::trace_point::TracePoint::from(t: T) -> T pub struct aya::programs::UProbe impl aya::programs::uprobe::UProbe pub fn aya::programs::uprobe::UProbe::attach>(&mut self, fn_name: core::option::Option<&str>, offset: u64, target: T, pid: core::option::Option) -> core::result::Result -pub fn aya::programs::uprobe::UProbe::detach(&mut self, link_id: aya::programs::uprobe::UProbeLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::uprobe::UProbe::from_pin>(path: P, kind: aya::programs::ProbeKind) -> core::result::Result pub fn aya::programs::uprobe::UProbe::kind(&self) -> aya::programs::ProbeKind pub fn aya::programs::uprobe::UProbe::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::uprobe::UProbe +pub fn aya::programs::uprobe::UProbe::detach(&mut self, link_id: aya::programs::uprobe::UProbeLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::uprobe::UProbe::take_link(&mut self, link_id: aya::programs::uprobe::UProbeLinkId) -> core::result::Result impl aya::programs::uprobe::UProbe pub fn aya::programs::uprobe::UProbe::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> @@ -8945,9 +8990,10 @@ impl aya::programs::xdp::Xdp pub fn aya::programs::xdp::Xdp::attach(&mut self, interface: &str, flags: aya::programs::xdp::XdpFlags) -> core::result::Result pub fn aya::programs::xdp::Xdp::attach_to_if_index(&mut self, if_index: u32, flags: aya::programs::xdp::XdpFlags) -> core::result::Result pub fn aya::programs::xdp::Xdp::attach_to_link(&mut self, link: aya::programs::xdp::XdpLink) -> core::result::Result -pub fn aya::programs::xdp::Xdp::detach(&mut self, link_id: aya::programs::xdp::XdpLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::xdp::Xdp::from_pin>(path: P, attach_type: aya_obj::programs::xdp::XdpAttachType) -> core::result::Result pub fn aya::programs::xdp::Xdp::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> +impl aya::programs::xdp::Xdp +pub fn aya::programs::xdp::Xdp::detach(&mut self, link_id: aya::programs::xdp::XdpLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::xdp::Xdp::take_link(&mut self, link_id: aya::programs::xdp::XdpLinkId) -> core::result::Result impl aya::programs::xdp::Xdp pub fn aya::programs::xdp::Xdp::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError>