Skip to main content

aya_obj/programs/
sk_skb.rs

1//! Sk skb programs.
2use crate::generated::bpf_attach_type;
3
4/// Defines the kind of a `SkSkb` program.
5#[derive(Copy, Clone, Debug)]
6pub enum SkSkbKind {
7    /// A Stream Parser
8    StreamParser,
9    /// A Stream Verdict
10    StreamVerdict,
11}
12
13impl From<SkSkbKind> for bpf_attach_type {
14    fn from(s: SkSkbKind) -> Self {
15        match s {
16            SkSkbKind::StreamParser => Self::BPF_SK_SKB_STREAM_PARSER,
17            SkSkbKind::StreamVerdict => Self::BPF_SK_SKB_STREAM_VERDICT,
18        }
19    }
20}