aya_obj/programs/
cgroup_sock.rs1use crate::generated::bpf_attach_type;
3
4#[derive(Copy, Clone, Debug, Default)]
6pub enum CgroupSockAttachType {
7 PostBind4,
9 PostBind6,
11 #[default]
13 SockCreate,
14 SockRelease,
16}
17
18impl From<CgroupSockAttachType> for bpf_attach_type {
19 fn from(s: CgroupSockAttachType) -> Self {
20 match s {
21 CgroupSockAttachType::PostBind4 => Self::BPF_CGROUP_INET4_POST_BIND,
22 CgroupSockAttachType::PostBind6 => Self::BPF_CGROUP_INET6_POST_BIND,
23 CgroupSockAttachType::SockCreate => Self::BPF_CGROUP_INET_SOCK_CREATE,
24 CgroupSockAttachType::SockRelease => Self::BPF_CGROUP_INET_SOCK_RELEASE,
25 }
26 }
27}