Skip to content

Commit

Permalink
V3 (#106)
Browse files Browse the repository at this point in the history
* compatible with low-version rustc

* pass clippy

* Bump version

* prepare to support windows-tap

* update

* prepare to support windows-tap (#101)

* compatible with low-version rustc

* pass clippy

* Bump version

* prepare to support windows-tap

* update

* support windows-tap

* support windows-tap

* fix

* cargo fmt

* cargo clippy

* cargo clippy

* deliver layer2 for tap

* deliver layer2

* Update device.rs

* refine

* fix codec

* adjust 'AbstractDevice'

* remove tap_packet

* change

* fix bsd error

* fix bsd error

* fix bsd error

* fix bsd error

* fix bsd error

* fix bsd error

* fix bsd error

* fix linux error

* cargo clippy

* cargo clippy

* fix linux error

* fix cargo.toml

* fix some errors

* cargo fmt

* fix windows example

* fix windows example

* Bump version

* cargo clippy

* fix error

* fix error

* fix error

* update linux

* update config

* fix macos error

* fix macos

* update recv

* config linux

* fix some errors

* Remove the MTU on Tun

* fix error

* fix macos

* fix error

* fix example

* fix android

* refine

* fix windows async

* fix async windows

* fix freebsd

* fix freebsd

* update readme

* Update README.md

* windows async

* windows shutdown

* AsyncDevice Drop

* update linux

* Remove useless code

* shutdown

* tap drop

* add shutdown

* add shutdown

* add shutdown

* add shutdown

* add feature experimental

* add feature experimental

* add feature experimental

* add feature experimental

* fix features

* fix features

* fix bug

* remove shutdown

* windows enable

* windows enable

* windows enable

* update experimental

* update experimental

* cargo clippy

* update experimental

* add flag

* recv Interest ERROR

* address_with_prefix

* use IntoAddress

* clippy

* set_destination

* rename variable name

* update cargo.toml

* cargo clippy ios&android

* fix shutdown

* update macos

* update macos

* refine macos route

* update freebsd

* update freebsd

* update freebsd

* update freebsd

* update freebsd

* update freebsd

* update freebsd

* add tap for freebsd

* select fd

* add tap for freebsd

* update

* update

* update

* select pipe macos

* update readme

* linux if_indextoname

* Change method name

* use write_all

* ioctl_read tungetiff

* fmt

* fmt

* linux from_raw_fd

* fmt

* get name from libc

* test freebsd

* revert freebsd

* add into_raw_fd

* freebsd

* freebsd

* freebsd

* revert freebsd

* platform from_raw_fd

* packet_information default is true in iOS|macos

* update freebsd

* update freebsd

* update freebsd

* update freebsd

* update freebsd

* mac address

* mac address

* mac address

* mac address

* add set mac address for freebsd

* update

* update freebsd

* update freebsd

* update freebsd mac

* open len

* open mac_address for windows

* linux set/get mac addr

* linux set/get mac addr

* linux set/get mac addr

* windows tap

* cargo fmt

* cargo fmt

* cargo clippy

* cargo clippy windows

* cargo clippy windows

* remove println

* map_err

* windows code

* ping-tap

* cargo fmt

* cargo fmt

* cargo clippy

* fix doc

* fix doc

* fix doc

* cargo fmt

---------

Co-authored-by: lubeilin <1791778603@qq.com>
Co-authored-by: lbl <49143209+lbl8603@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 30, 2024
1 parent 6746129 commit 7600687
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tun2"
version = "3.0.0"
version = "3.0.1"
edition = "2021"
authors = ["meh. <meh@schizofreni.co>", "@ssrlive"]
license = "WTFPL"
Expand Down
92 changes: 46 additions & 46 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
// Version 2, December 2004
//
// Copyleft (ↄ) meh. <meh@schizofreni.co> | http://meh.schizofreni.co
//
// Everyone is permitted to copy and distribute verbatim or modified
// copies of this license document, and changing it is allowed as long
// as the name is changed.
//
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
// TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
//
// 0. You just DO WHAT THE FUCK YOU WANT TO.

mod error;
pub use crate::error::{BoxError, Error, Result};

mod address;
pub use crate::address::IntoAddress;

mod device;
pub use crate::device::AbstractDevice;

mod configuration;
pub use crate::configuration::{Configuration, Layer};

pub mod platform;
pub use crate::platform::create;
#[cfg(unix)]
pub use crate::platform::create_with_fd;

#[cfg(feature = "async")]
pub mod r#async;
#[cfg(feature = "async")]
pub use r#async::*;

pub fn configure() -> Configuration {
Configuration::default()
}

#[cfg(unix)]
pub const DEFAULT_MTU: u16 = 1500;
#[cfg(windows)]
pub const DEFAULT_MTU: u16 = 0xFFFF; // 65535

pub const PACKET_INFORMATION_LENGTH: usize = 4;
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
// Version 2, December 2004
//
// Copyleft (ↄ) meh. <meh@schizofreni.co> | http://meh.schizofreni.co
//
// Everyone is permitted to copy and distribute verbatim or modified
// copies of this license document, and changing it is allowed as long
// as the name is changed.
//
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
// TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
//
// 0. You just DO WHAT THE FUCK YOU WANT TO.
#![cfg_attr(docsrs, feature(doc_cfg))]
mod error;
pub use crate::error::{BoxError, Error, Result};

mod address;
pub use crate::address::IntoAddress;

mod device;
pub use crate::device::AbstractDevice;

mod configuration;
pub use crate::configuration::{Configuration, Layer};

pub mod platform;
pub use crate::platform::create;
#[cfg(unix)]
pub use crate::platform::create_with_fd;

#[cfg(feature = "async")]
pub mod r#async;
#[cfg(feature = "async")]
pub use r#async::*;

pub fn configure() -> Configuration {
Configuration::default()
}

#[cfg(unix)]
pub const DEFAULT_MTU: u16 = 1500;
#[cfg(windows)]
pub const DEFAULT_MTU: u16 = 0xFFFF; // 65535

pub const PACKET_INFORMATION_LENGTH: usize = 4;

0 comments on commit 7600687

Please sign in to comment.