aya_obj/programs/
cgroup_sockopt.rs

1//! Cgroup socket option programs.
2use crate::generated::bpf_attach_type;
3
4/// Defines where to attach a `CgroupSockopt` program.
5#[derive(Copy, Clone, Debug)]
6pub enum CgroupSockoptAttachType {
7    /// Attach to GetSockopt.
8    Get,
9    /// Attach to SetSockopt.
10    Set,
11}
12
13impl From<CgroupSockoptAttachType> for bpf_attach_type {
14    fn from(s: CgroupSockoptAttachType) -> Self {
15        match s {
16            CgroupSockoptAttachType::Get => Self::BPF_CGROUP_GETSOCKOPT,
17            CgroupSockoptAttachType::Set => Self::BPF_CGROUP_SETSOCKOPT,
18        }
19    }
20}