Giter Site home page Giter Site logo

wt-382's Issues

Use event loop instead of threads

Threads are annoying to work with, dangerous, more difficult to port, and not resource friendly. Also, on some platforms, it's easier to implement the behaviour as callbacks (on packet receive, possibly from interrupt) than as a thread.

The only reason to use threads is to be able to distribute work over several processors. But IEEE1905.1 doesn't have much work, just some packet processing.

Therefore, we'd prefer to use an event loop.

We can use an existing library, e.g. libev.

Use virtual functions for implementation diversity

Currently, implementation diversity (e.g. how to get statistics from an interface) is governed by a combination of ifdefs and ad-hoc conditions. This makes it more difficult to support multiple implementations in a single system. For example, if a system uses Wifi chips from different vendors that use vendor-specific extensions rather than standard nl80211/cfg80211, we need a different interface implementation for each interface. However a large part of the different implementations can probably be shared.

Therefore, it is more convenient to use virtual functions, i.e. function pointers in the per-interface struct. This way, specific interface implementations only need to override the functions they care about.

Use int instead of specific types

Many internal variables (like the status return of a function) are currently defined as bit-specific types, usually uint8_t. This is potentially bad for efficiency (it may introduce unneeded mask operations). It also makes the code harder to understand.

Replace screenscraping by netlink calls

To get information about network interfaces, currently a tool (e.g. iw) is forked off and the output is screenscraped.

This makes the implementation depend very tightly on the tool that is used. It also adds a hidden dependency: iw may not be installed. Instead we should use netlink directly to get the information.

This will make it easier to extend the functionality with things that are not implemented in e.g. iw.

It does add a dependency on libnl.

Don't use reserved identifiers

The headers are currently protected with FOO_H defines. However, names starting with underscore are reserved by the standard. Replace this with allowed names, e.g. FOO_H.

Test link metric dissemination

Note: dissemination only, not gathering of information. For test purposes, the information itself is simulated.

Note that this test does include the additional EasyMesh metrics.

Test MID handling

In particular, test that repeated MID is ignored. Also test retransmission.

Test relaying

In particular, test neighbor multicast vs. relayed multicast, and relaying of unicast.

Use stdint

Currently, local types like INT8U are used instead of standard uint8_t. stdlib.h is available in every compiler that is less than 15 years old, so there really is never any reason not to use it.

To make matters worse, the INTxU definitions are provided by the Makefile, which makes it really difficult to port to different platforms.

So replace all that with uintX_t and include stdint.h.

Improve build system

  • Use included subdirectories instead of recursive make.
  • Check that parallel build works.
  • Use pkg-config to get libraries.
  • Make it easier to choose options without editing Makefile.
  • Make it a bit more cross-compile friendly.

Rename PLATFORM and FLAVOUR

"linux" platform is actually a "posix" platform (cfr. it also works on Cygwin).

"x86_generic" flavour is actually "generic", not at all tied to x86.

Instead of flavours, we probably want to include/exclude plugins (or extensions) for different platforms, and the generic part is always there. We can still call it flavour, but it should be possible to support multiple. E.g. the simulator could be optional.

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.