Giter Club home page Giter Club logo

wifi-rs's Introduction

WiFi-rs

A rust crate to interface and manage Wi-Fi networks.

This is a command-line counterpart of managing networks instead of via a GUI.

Features

  • Connect to a WiFi (Windows, Linux, MacOS).
  • Disconnect from a WiFi network (Windows, Linux, MacOS).
  • Create hotspot (Windows, Linux).

Currently supported network types

Note that only open, WEP and WPA-PSK networks are supported at the moment.

It is also supposed that IP configuration is obtained via DHCP.

Supported Operating Systems

  • Windows
  • Linux
  • MacOS

Example

extern crate wifi_rs;
use wifi_rs::prelude::*;
use wifi_rs::{WiFi, Config};

fn main() -> Result<(), WifiConnectionError> {
    let config = Some(Config {
        interface: Some("wlo1"),
    });

    let mut wifi = WiFi::new(config);

    match wifi.connect("AndroidAPSD22", "belm4235") {
        Ok(result) => println!(
            "{}",
            if result == true {
                "Connection Successfull."
            } else {
                "Invalid password."
            }
        ),
        Err(err) => println!("The following error occurred: {:?}", err),
    }

    Ok(())
}

Todos

Windows

  • Support for Windows.
  • Bundle windows profile sample as literals.
  • Add hotspot functionality.
  • Use tempfile crate on windows to generate windows profile temporary file.
  • Fix the implementation for is_wifi_enabled for windows.
  • Add implementation for WifiInterface trait.
  • Add get network type feature.

Linux

  • Support for linux.
  • Add disconnect feature.
  • Add hotspot functionality.
  • Add get network type feature.

MacOS

  • Add support for MacOS.
  • Add hotspot functionality.
  • Add get network type feature.

General

  • Return detailed error messages.
  • Write documentation.
  • Update wifi-CLI with recent updates.

Contribution

Any feature you feel is missing, why not send in a Pull Request, and let's help make this project better. Or are there any bugs, kindly create an issue, so we could work together towards fixing it.

Support

Love this project, please show some love by staring the project ๐Ÿ˜ƒ.

wifi-rs's People

Contributors

toksdotdev avatar phoenix-chen avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.