All of lore.kernel.org
 help / color / mirror / Atom feed
* nl80211 userspace
@ 2007-02-14 19:04 Johannes Berg
  2007-02-15  8:17 ` Nick Kossifidis
  0 siblings, 1 reply; 8+ messages in thread
From: Johannes Berg @ 2007-02-14 19:04 UTC (permalink / raw)
  To: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1871 bytes --]

Hi,

I've been playing a bit with parsing a modified nl80211 header file to
get a tool and

 http://git.sipsolutions.net/pynl80211.git/

is what I currently have. It doesn't
actually send netlink messages yet but that ought to be trivial to add,
I'm too lazy right now to look up all the exact binary stuff. Python
does have a "struct" module that can be used to pack things into binary
so it's really easy :)

Anyway. The repository contains a modified nl80211.h and the tool relies on
a lot of things to be correct in it, see parse.py.

Examples:
$ ./wificonf.py help configure 
./wificonf.py configure ifindex [ssid=...] [transmit_power=...] [frag_threshold=...] [channel=...] [rx_sensitivity=...]
        ifindex: interface name or index
        ssid: string (1-32 bytes)
        transmit_power: u32
        frag_threshold: u32
        channel: u32
        rx_sensitivity: u32
$ ./wificonf.py help set_roaming_control
./wificonf.py set_roaming_control ifindex roaming_control
        ifindex: interface name or index
        roaming_control: kernel, userspace 
$ ./wificonf.py configure eth1 ssid="my ssid" channel=7 frag_threshold=580
TODO: construct a netlink message with command number 9
and the following attributes
        1: 4
        18: 'my ssid'
        20: 580
        12: 7
$ ./wificonf.py set_fixed_bssid eth1 0:1:2:3:4:ff
TODO: construct a netlink message with command number 17
and the following attributes
        1: 4
        15: '\x00\x01\x02\x03\x04\xff'

(ifindex is looked up via sysfs: /sys/class/net/<name>/ifindex)

Obviously parsing the response netlink message is missing too :)

Included also is a check shell script that will use wificonf's parser to
make sure the header file was parsed correctly wrt the numbers of the
constants (since I don't have a C parser built into it.)

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nl80211 userspace
  2007-02-14 19:04 nl80211 userspace Johannes Berg
@ 2007-02-15  8:17 ` Nick Kossifidis
  2007-02-15  9:54   ` Michael Buesch
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Nick Kossifidis @ 2007-02-15  8:17 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

I think it would be nice to have ifconfig for all interface
configuration as they have done in openbsd, it's better to have one
tool for all. What do you think ?

2007/2/14, Johannes Berg <johannes@sipsolutions.net>:
> Hi,
>
> I've been playing a bit with parsing a modified nl80211 header file to
> get a tool and
>
>  http://git.sipsolutions.net/pynl80211.git/
>
> is what I currently have. It doesn't
> actually send netlink messages yet but that ought to be trivial to add,
> I'm too lazy right now to look up all the exact binary stuff. Python
> does have a "struct" module that can be used to pack things into binary
> so it's really easy :)
>
> Anyway. The repository contains a modified nl80211.h and the tool relies on
> a lot of things to be correct in it, see parse.py.
>
> Examples:
> $ ./wificonf.py help configure
> ./wificonf.py configure ifindex [ssid=...] [transmit_power=...] [frag_threshold=...] [channel=...] [rx_sensitivity=...]
>         ifindex: interface name or index
>         ssid: string (1-32 bytes)
>         transmit_power: u32
>         frag_threshold: u32
>         channel: u32
>         rx_sensitivity: u32
> $ ./wificonf.py help set_roaming_control
> ./wificonf.py set_roaming_control ifindex roaming_control
>         ifindex: interface name or index
>         roaming_control: kernel, userspace
> $ ./wificonf.py configure eth1 ssid="my ssid" channel=7 frag_threshold=580
> TODO: construct a netlink message with command number 9
> and the following attributes
>         1: 4
>         18: 'my ssid'
>         20: 580
>         12: 7
> $ ./wificonf.py set_fixed_bssid eth1 0:1:2:3:4:ff
> TODO: construct a netlink message with command number 17
> and the following attributes
>         1: 4
>         15: '\x00\x01\x02\x03\x04\xff'
>
> (ifindex is looked up via sysfs: /sys/class/net/<name>/ifindex)
>
> Obviously parsing the response netlink message is missing too :)
>
> Included also is a check shell script that will use wificonf's parser to
> make sure the header file was parsed correctly wrt the numbers of the
> constants (since I don't have a C parser built into it.)
>
> johannes
>
>


-- 
As you read this post global entropy rises. Have Fun ;-)
Nick

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nl80211 userspace
  2007-02-15  8:17 ` Nick Kossifidis
@ 2007-02-15  9:54   ` Michael Buesch
  2007-02-15 14:19   ` John W. Linville
  2007-02-15 15:04   ` Johannes Berg
  2 siblings, 0 replies; 8+ messages in thread
From: Michael Buesch @ 2007-02-15  9:54 UTC (permalink / raw)
  To: Nick Kossifidis; +Cc: Johannes Berg, linux-wireless

On Thursday 15 February 2007 09:17, Nick Kossifidis wrote:
> I think it would be nice to have ifconfig for all interface
> configuration as they have done in openbsd, it's better to have one
> tool for all. What do you think ?

Well, I think it's better to have a seperate tool, but I guess
that's only a matter of taste if we want to have it seperate
or included into some existing program.

But, I think python is not quite the best programming language
for this, as we don't want to install python on small embedded systems.

-- 
Greetings Michael.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nl80211 userspace
  2007-02-15  8:17 ` Nick Kossifidis
  2007-02-15  9:54   ` Michael Buesch
@ 2007-02-15 14:19   ` John W. Linville
  2007-02-15 15:05     ` Johannes Berg
  2007-02-15 15:04   ` Johannes Berg
  2 siblings, 1 reply; 8+ messages in thread
From: John W. Linville @ 2007-02-15 14:19 UTC (permalink / raw)
  To: Nick Kossifidis; +Cc: Johannes Berg, linux-wireless

On Thu, Feb 15, 2007 at 10:17:50AM +0200, Nick Kossifidis wrote:
> I think it would be nice to have ifconfig for all interface
> configuration as they have done in openbsd, it's better to have one
> tool for all. What do you think ?

I think I'd lean to a separate tool, analagous to ethtool.

Anyway, the problem with using ifconfig is that it is generally
considered to be deprecated in favor of 'ip' (i.e. the iproute2
utility).  So increasing dependence on ifconfig would seem to be a
bad idea.

John

P.S.  Michael is, of course, right that the tool for users probably
should not rely on python (or perl, et al).  FWIW, I got the
impression that Johannes's tool was meant to use in the short-run
for developers...?
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nl80211 userspace
  2007-02-15  8:17 ` Nick Kossifidis
  2007-02-15  9:54   ` Michael Buesch
  2007-02-15 14:19   ` John W. Linville
@ 2007-02-15 15:04   ` Johannes Berg
  2 siblings, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2007-02-15 15:04 UTC (permalink / raw)
  To: Nick Kossifidis; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]

On Thu, 2007-02-15 at 10:17 +0200, Nick Kossifidis wrote:
> I think it would be nice to have ifconfig for all interface
> configuration as they have done in openbsd, it's better to have one
> tool for all. What do you think ?

What are you trying to say?

If you think that it should be in the "ip" tool (which does all ip
stuff... ifconfig is dead...) then I think I'll have to tell you to get
lost.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nl80211 userspace
  2007-02-15 14:19   ` John W. Linville
@ 2007-02-15 15:05     ` Johannes Berg
  2007-02-15 19:46       ` Luis R. Rodriguez
  0 siblings, 1 reply; 8+ messages in thread
From: Johannes Berg @ 2007-02-15 15:05 UTC (permalink / raw)
  To: John W. Linville; +Cc: Nick Kossifidis, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 463 bytes --]

On Thu, 2007-02-15 at 09:19 -0500, John W. Linville wrote:

> P.S.  Michael is, of course, right that the tool for users probably
> should not rely on python (or perl, et al).  FWIW, I got the
> impression that Johannes's tool was meant to use in the short-run
> for developers...?

Yes. The advantage is that you don't even need to recompile it for new
commands. And hey, maybe we can hack it up to generate the C code for
the real tool :P

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nl80211 userspace
  2007-02-15 15:05     ` Johannes Berg
@ 2007-02-15 19:46       ` Luis R. Rodriguez
  2007-02-15 19:48         ` Luis R. Rodriguez
  0 siblings, 1 reply; 8+ messages in thread
From: Luis R. Rodriguez @ 2007-02-15 19:46 UTC (permalink / raw)
  To: Johannes Berg; +Cc: John W. Linville, Nick Kossifidis, linux-wireless

On 2/15/07, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Thu, 2007-02-15 at 09:19 -0500, John W. Linville wrote:
>
> > P.S.  Michael is, of course, right that the tool for users probably
> > should not rely on python (or perl, et al).  FWIW, I got the
> > impression that Johannes's tool was meant to use in the short-run
> > for developers...?
>
> Yes. The advantage is that you don't even need to recompile it for new
> commands. And hey, maybe we can hack it up to generate the C code for
> the real tool :P

I think the tool we should rely on next should be based on
wpa_supplicant/wpa_cli codebase. wpa_supplicant already handles wext,
directly through ioclt(), but nevertheless it does call the right
ioctls. As such, it doesn't depend on iwlib so distributions who
decide to ditch iwconfig won't need a the old library and still get
backward compatibility . Extending it to support nl80211 would benefit
the wpa_supplicant codebase and we can take advantage and fork our own
new utility out of it. How about calling it "iw" as ifconfig's
replacement is called "ip" ?

  Luis

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nl80211 userspace
  2007-02-15 19:46       ` Luis R. Rodriguez
@ 2007-02-15 19:48         ` Luis R. Rodriguez
  0 siblings, 0 replies; 8+ messages in thread
From: Luis R. Rodriguez @ 2007-02-15 19:48 UTC (permalink / raw)
  To: Johannes Berg; +Cc: John W. Linville, Nick Kossifidis, linux-wireless

On 2/15/07, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
> On 2/15/07, Johannes Berg <johannes@sipsolutions.net> wrote:
> > On Thu, 2007-02-15 at 09:19 -0500, John W. Linville wrote:
> >
> > > P.S.  Michael is, of course, right that the tool for users probably
> > > should not rely on python (or perl, et al).  FWIW, I got the
> > > impression that Johannes's tool was meant to use in the short-run
> > > for developers...?
> >
> > Yes. The advantage is that you don't even need to recompile it for new
> > commands. And hey, maybe we can hack it up to generate the C code for
> > the real tool :P
>
> I think the tool we should rely on next should be based on
> wpa_supplicant/wpa_cli codebase. wpa_supplicant already handles wext,
> directly through ioclt(), but nevertheless it does call the right
> ioctls. As such, it doesn't depend on iwlib so distributions who
> decide to ditch iwconfig won't need a the old library and still get
> backward compatibility . Extending it to support nl80211 would benefit
> the wpa_supplicant codebase and we can take advantage and fork our own
> new utility out of it. How about calling it "iw" as ifconfig's
> replacement is called "ip" ?

Oh and also -- what we can do for the userspace tool is rely on the
old wext ioctls for each call until the respective nl80211 interface
to cfg80211 is added. We can move forward replacing the ioctls as we
go with each release of this new tool.

  Luis

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-02-15 19:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-14 19:04 nl80211 userspace Johannes Berg
2007-02-15  8:17 ` Nick Kossifidis
2007-02-15  9:54   ` Michael Buesch
2007-02-15 14:19   ` John W. Linville
2007-02-15 15:05     ` Johannes Berg
2007-02-15 19:46       ` Luis R. Rodriguez
2007-02-15 19:48         ` Luis R. Rodriguez
2007-02-15 15:04   ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.