s2n_quic_xdp/lib.rs
1// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4type Result<T = (), E = std::io::Error> = core::result::Result<T, E>;
5
6/// Emits a log line if the `s2n_quic_xdp_trace` cfg option is enabled. Otherwise, the trace is a
7/// no-op.
8macro_rules! trace {
9 ($($fmt:tt)*) => {{
10 if cfg!(s2n_quic_xdp_trace) {
11 let args = format!($($fmt)*);
12 println!("{}:{}: {}", module_path!(), line!(), args);
13 }
14 }}
15}
16
17/// Low-level bindings to various linux userspace APIs
18mod bindings;
19
20/// Default BPF programs to direct QUIC traffic
21pub mod bpf;
22/// Primitive types for AF-XDP kernel APIs
23pub mod if_xdp;
24/// Implementations of the IO traits from [`s2n_quic_core::io`]
25pub mod io;
26/// Helpers for creating mmap'd regions
27pub mod mmap;
28/// Structures for tracking ring cursors and synchronizing with the kernel
29pub mod ring;
30/// Structure for opening and reference counting an AF-XDP socket
31pub mod socket;
32/// Helpers for making API calls to AF-XDP sockets
33pub mod syscall;
34/// A shared region of memory for holding frame (packet) data
35pub mod umem;