|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Mark S. Mathews (mark
linux-wlan.com)Date: Sat Mar 17 2001 - 19:41:55 CST
On Sat, 17 Mar 2001, Karlis Peisenieks wrote:
> On Sat, 17 Mar 2001, Mark S. Mathews wrote:
>
> > equivalent in the bsd's. The reason I was considering a
> > unix domain socket rather than a char device is that I felt it might be a
> > tad more portable. If I were to do a char device, I'd probably implement
>
> What do you mean by portable - there will still be plenty of os dependent
> code I think (in any case).
Agreed.
> > it as a misc device with the minor number allocated at runtime
> > (usermode apps would retrieve the minor number via an ioctl query)....and
Do the ioctl against a socket opened on the network device.
> Hmm, to call ioctl, you need file descriptor. To get file descriptor you
> need to open file. To open file you need to known minor and major.
>
> At least on linux you can either allocate some major number (there are
> plenty of them free, so you can take one I think), or make kernel do that
> for you and then find out by name in /proc/devices (well I am not sure
> that you can do this on other bsds).
>
> Anyway - the only stuff different on different systems will have to be
> script/code that creates chardevice node in file system as well as
> character device code in kernel (and that will definetly be different for
> different os).
>
> > I agree that netlink is a perfect solution (and very nicely done, thanks
> > AC). Additionally, I love its simplicity. It isn't particularly well
> > documented, but the source is pretty straightforward.
>
> Yes, its not that hard to find out what some 4 functions do :).
>
> Anyway, why don't you consider having os dependent "communications with
> user space" part with well defined interface, which on linux would
> translate into netlink calls (with not much additional stuff - possibly
> macros) and to some other userspace interface on other os, with the same
> for userspace app (like that is done in so many programs, e.g. pppd,
> zebra) as you will have to have different executables anyway.
>
> I think that if you have to write 5 lines of code for one os and 100
> different lines for other - that should not be reason why you would choose
> to write 100 "logically common" but still different lines for each os.
All true. This whole thing is just an partially formed thought at the
moment. Thanks for some additional points to ponder.
-M
--Mark S. Mathews
AbsoluteValue Systems Web: http://www.linux-wlan.com P.O. Box 410670 e-mail: mark
linux-wlan.com Melbourne, FL 32941-0670 Phone: 321.259.0737 USA Fax: 321.259.0286
----------------------------------------------- The Linux WLAN User's Mailing List For more information about this list see: http://www.absoval.com/linux-wlan/lists.html
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]