net_util/sys/linux.rs
1// Copyright 2022 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5pub mod tap;
6use base::FileReadWriteVolatile;
7pub use tap::Tap;
8
9use crate::TapTCommon;
10
11/// Linux-specific TAP functions
12pub trait TapTLinux {
13 /// Set the size of the vnet hdr.
14 fn set_vnet_hdr_size(&self, size: usize) -> Result<(), crate::Error>;
15
16 /// Get the interface flags
17 fn if_flags(&self) -> u32;
18}
19
20// TODO(b/159159958) implement FileReadWriteVolatile for slirp
21pub trait TapT: FileReadWriteVolatile + TapTCommon + TapTLinux {}
22
23pub mod fakes {
24 pub use super::tap::fakes::FakeTap;
25}