xref: /aosp_15_r20/tools/netsim/rust/capture/src/lib.rs (revision cf78ab8cffb8fc9207af348f23af247fb04370a6)
1*cf78ab8cSAndroid Build Coastguard Worker // Copyright 2024 Google LLC
2*cf78ab8cSAndroid Build Coastguard Worker //
3*cf78ab8cSAndroid Build Coastguard Worker // Licensed under the Apache License, Version 2.0 (the "License");
4*cf78ab8cSAndroid Build Coastguard Worker // you may not use this file except in compliance with the License.
5*cf78ab8cSAndroid Build Coastguard Worker // You may obtain a copy of the License at
6*cf78ab8cSAndroid Build Coastguard Worker //
7*cf78ab8cSAndroid Build Coastguard Worker //     https://www.apache.org/licenses/LICENSE-2.0
8*cf78ab8cSAndroid Build Coastguard Worker //
9*cf78ab8cSAndroid Build Coastguard Worker // Unless required by applicable law or agreed to in writing, software
10*cf78ab8cSAndroid Build Coastguard Worker // distributed under the License is distributed on an "AS IS" BASIS,
11*cf78ab8cSAndroid Build Coastguard Worker // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*cf78ab8cSAndroid Build Coastguard Worker // See the License for the specific language governing permissions and
13*cf78ab8cSAndroid Build Coastguard Worker // limitations under the License.
14*cf78ab8cSAndroid Build Coastguard Worker 
15*cf78ab8cSAndroid Build Coastguard Worker //! A library for reading and writing pcap (packet capture) files in Rust.
16*cf78ab8cSAndroid Build Coastguard Worker //!
17*cf78ab8cSAndroid Build Coastguard Worker //! This crate provides an asynchronous API for working with pcap files,
18*cf78ab8cSAndroid Build Coastguard Worker //! allowing you to read and write packet capture data efficiently.
19*cf78ab8cSAndroid Build Coastguard Worker //! It supports both reading from and writing to pcap files, and it
20*cf78ab8cSAndroid Build Coastguard Worker //! handles the parsing and serialization of pcap headers and packet records.
21*cf78ab8cSAndroid Build Coastguard Worker //!
22*cf78ab8cSAndroid Build Coastguard Worker //! # Features
23*cf78ab8cSAndroid Build Coastguard Worker //!
24*cf78ab8cSAndroid Build Coastguard Worker //! * **Asynchronous API:** Built on top of Tokio, enabling efficient asynchronous
25*cf78ab8cSAndroid Build Coastguard Worker //!   reading and writing of pcap files.
26*cf78ab8cSAndroid Build Coastguard Worker //! * **Zero-copy:** Uses the `zerocopy` crate for zero-cost conversions between
27*cf78ab8cSAndroid Build Coastguard Worker //!   structs and byte slices, improving performance.
28*cf78ab8cSAndroid Build Coastguard Worker //! * **Standard pcap format:**  Supports the standard pcap file format, ensuring
29*cf78ab8cSAndroid Build Coastguard Worker //!   compatibility with other pcap tools.
30*cf78ab8cSAndroid Build Coastguard Worker //!
31*cf78ab8cSAndroid Build Coastguard Worker 
32*cf78ab8cSAndroid Build Coastguard Worker pub mod pcap;
33