New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface control #14

Merged
merged 5 commits into from Jul 22, 2015

Conversation

Projects
None yet
3 participants
@tuomasjjrasanen
Contributor

tuomasjjrasanen commented Jun 26, 2015

Hi

This pull request consists of 5 commits, aimed to provide support for setting
the interface in monitor mode automatically at start-up and thus getting rid of
manual interface management.

To enable a monitor interface automatically at start-up, two different methods
are used, in the given order:

  1. Try to set the current interface to monitor mode.
  2. If modifying the current interface fails (e.g. it is in use and busy), then
    horst adds a virtual monitor interface to the current interface and uses it
    instead.

All wireless interface modifications are carried out using Netlink APIs, so the
implementation is Linux-only (ifctrl-nl80211.c). However, internally all
functionality is hidden behind platform-independent ifctrl.h, so adding
support for new platforms does not need to touch any other code than the
platform-specific module implementing the internal API.

tuomasjjrasanen added some commits Jun 7, 2015

New func: ifctrl_iwadd_monitor(): add virtual 802.11 monitor interfaces
Function ifctrl_iwadd_monitor() is the first function in the new internal
interface control API declared in ifctrl.h. Currently, there's only a
Linux-specific implementation (using Netlink), ifctrl-nl80211.c, but the
ifctrl.h is designed to not expose any implementation details to make it easy to
switch the implementation on build time. So, if someone comes up with an
implementation for another platform, say OSX for example, she would need to just
write and compile OSX-specific module, and then link horst with it instead of
ifctrl-nl80211.o.
Obtain a monitoring interface automatically at start-up
Previously, the current interface had to be already in monitor mode when horst
was started. Otherwise horst exited with an error. This commit enhances horst to
obtain a monitor interface automatically at start-up using two different
strategies, in the given order:

1. Try to set the current interface to monitor mode.

2. If modifying the current interface fails (e.g. it is in use and busy), then
   horst adds a virtual monitor interface to the current interface and uses it
   instead.
@tuomasjjrasanen

This comment has been minimized.

Show comment
Hide comment
@tuomasjjrasanen

tuomasjjrasanen Jul 21, 2015

Contributor

I updated the pull request quite drastically, the mutable_interface configuration option was removed as Bruno questioned its usefulness, and rightly so. It was just complicating things.

Contributor

tuomasjjrasanen commented Jul 21, 2015

I updated the pull request quite drastically, the mutable_interface configuration option was removed as Bruno questioned its usefulness, and rightly so. It was just complicating things.

br101 added a commit that referenced this pull request Jul 22, 2015

@br101 br101 merged commit ba64b5b into br101:master Jul 22, 2015

@xmw

This comment has been minimized.

Show comment
Hide comment
@xmw

xmw Jul 22, 2015

Any change to see a new release in the near future?
I'm asking for Gentoo/Linux, I'd prefer packaging your release instead of this git commit.

xmw commented Jul 22, 2015

Any change to see a new release in the near future?
I'm asking for Gentoo/Linux, I'd prefer packaging your release instead of this git commit.

@br101

This comment has been minimized.

Show comment
Hide comment
@br101

br101 Jul 22, 2015

Owner

Yes, I think this new feature deserves a new release. But we need to test more before that. Can you try on gentoo?

Owner

br101 commented Jul 22, 2015

Yes, I think this new feature deserves a new release. But we need to test more before that. Can you try on gentoo?

@tuomasjjrasanen tuomasjjrasanen deleted the tuomasjjrasanen:interface_control branch Jul 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment