routeros_rust 0.0.21

Mikrotik API for Rust
Documentation
  • Coverage
  • 0%
    0 out of 7 items documented0 out of 6 items with examples
  • Size
  • Source code size: 11.89 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 696.79 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 18s Average build duration of successful builds.
  • all releases: 18s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • woowe/Mikrotik-rust
    7 7 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Wooowe

Router Os

Mikrotik API for Rust

This API gives you the ability to connect to your mikrotik router over a tcp connection.

Build Status

Installation

Add router_os via your Cargo.toml:

[dependencies]
routeros_rust = "*"

or

[dependencies.routeros_rust]
git = "https://github.com/Wooowe/mikrotik-rust"

Usage

extern crate router_os;

use router_os::ApiRos;
use std::net::TcpStream;

fn main() {
    let mut stream = TcpStream::connect("192.168.1.1:8728").unwrap();

    let mut apiros = ApiRos::new(&mut stream);
    apiros.login("admin".to_string(), "".to_string());

    apiros.write_sentence(vec!["/ip/address/print".to_string()]);

    loop {
        let reply = apiros.read_sentence();

        if reply.len() == 0 {
            continue;
        }

        if reply[0] == "!done" {
            break;
        }
    }
}