merge boringtun into burrow

This commit is contained in:
Conrad Kramer 2023-09-16 10:45:53 -07:00
parent e643d9dd41
commit 28af9003d0
39 changed files with 3122 additions and 228 deletions

View file

@ -1,4 +1,5 @@
use std::io;
use tokio::io::unix::AsyncFd;
use tracing::instrument;
@ -16,7 +17,7 @@ impl TunInterface {
}
#[instrument]
pub async fn write(&self, buf: &[u8]) -> io::Result<usize> {
pub async fn send(&self, buf: &[u8]) -> io::Result<usize> {
loop {
let mut guard = self.inner.writable().await?;
match guard.try_io(|inner| inner.get_ref().send(buf)) {
@ -27,7 +28,7 @@ impl TunInterface {
}
#[instrument]
pub async fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
pub async fn recv(&mut self, buf: &mut [u8]) -> io::Result<usize> {
loop {
let mut guard = self.inner.readable_mut().await?;
match guard.try_io(|inner| (*inner).get_mut().recv(buf)) {