Giter VIP home page Giter VIP logo

tik4net's Introduction

tik4net

Unique complex mikrotik API communication solution.

The tik4net project provides easy to use API to connect and manage mikrotik routers via mikrotik API protocol. It has 3 parts:

  • Basic ADO.NET like API - to perform R/W access to mikrotik in both sync and async code (tik4net.dll).
  • O/R mapper like highlevel API with imported mikrotik strong-typed entities. (tik4net.objects.dll)
  • Tools - semi-automatic generators of custom entity C# code (for usage with tik4net.objects.dll)

Features

  • Easy to use with O/R mapper like highlevel API
  • Low level access supported by low level API
  • Stable interface and backward compatibility
  • Broad range of .NET runtimes supported (including .NET core 2 and Xamarin)
  • New mikrotik v.6.43 login process supported
  • Includes MNDP discovery helper
  • Easy to understand and well documented code

Binaries

Stable

In development (v 3.6)

  • Download as sources.

Getting started and documentation

Mikrotik API wiki:

Project wiki:

Examples:

   using (ITikConnection connection = ConnectionFactory.CreateConnection(TikConnectionType.Api_v2)) // Use TikConnectionType.Api for mikrotikversion prior v6.45
   {
      connection.Open(HOST, USER, PASS);
   ITikCommand cmd = connection.CreateCommand("/system/identity/print");
   var identity = cmd.ExecuteScalar(); 
   Console.WriteLine("Identity: {0}", identity);
   var logs = connection.LoadList<Log>();
   foreach (Log log in logs)
   {
       Console.WriteLine("{0}[{1}]: {2}", log.Time, log.Topics, log.Message);
   }
   var firewallFilter = new FirewallFilter()
   {
      Chain = FirewallFilter.ChainType.Forward,
      Action = FirewallFilter.ActionType.Accept,
   };
   connection.Save(firewallFilter);
   ITikCommand torchCmd = connection.CreateCommand("/tool/torch", 
      connection.CreateParameter("interface", "ether1"), 
      connection.CreateParameter("port", "any"),
      connection.CreateParameter("src-address", "0.0.0.0/0"),
      connection.CreateParameter("dst-address", "0.0.0.0/0"));

  torchCmd.ExecuteAsync(response =>
      {
         Console.WriteLine("Row: " + response.GetResponseField("tx"));
      });
  Console.WriteLine("Press ENTER");
  Console.ReadLine();
  torchCmd.Cancel();

Looking for help

  • Importing other classes
  • Looking for betatesters

Roadmap & future

  • create highlevel classes for all mikrotik entities (you can still generate your own classes)
  • create tiklink project - easy use-to wrapper over mikrotik router with fluent API
  • convert examples to separate unittests (in progress)
  • create and contribute to tiktop (see linux iftop) project

REMARKS: This project is rewritten version of deprecated tik4net at googlecode (last version was 0.9.7.)

Licenses

  • Apache 2.0.

tik4net's People

Contributors

danikf avatar deantwo avatar techladsjamie avatar h44z avatar dj3mu avatar lu-shaobin avatar chbw avatar daveschmid avatar hackerprod avatar mortengjesing avatar sebastienwarin avatar soerendd 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.