Skip to content

Commit

Permalink
Implement async runtime for example 'access_point'
Browse files Browse the repository at this point in the history
  • Loading branch information
josephrhobbs committed Jul 25, 2024
1 parent 9c226ed commit 9e771cc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ cidr = "0.2.3"
[dependencies.pnet]
version = "0.35.0"

[dependencies.tokio]
version = "1"
features = ["full"]

[dependencies.proton_arp]
path = "proton_arp"

Expand Down
9 changes: 7 additions & 2 deletions examples/access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@ use cidr::Ipv4Cidr;

use proton::AccessPoint;

fn main() {

#[tokio::main]
async fn main() {
let mut ap = AccessPoint::new(
Ipv4Addr::new(10, 0, 0, 1), // External IPv4 address
Ipv4Cidr::new( // Internal network range
Ipv4Addr::new(10, 0, 0, 0), // Network address
24, // Network length
).unwrap(),
Default::default() // MAC address management policy (default: public)
);


let result = ap.run().await;

println!("{:#?}", result);
}

0 comments on commit 9e771cc

Please sign in to comment.