Re: [OT] Programming network devices

ollie (ollie@sis.com.tw)
Thu, 07 Oct 1999 16:58:16 +0800


This is a multi-part message in MIME format.
--------------0AEC81CDE60301901BD6F74B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

--------------0AEC81CDE60301901BD6F74B
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

X-Mozilla-Status2: 00000000
Message-ID: <37FBF845.2358BD64@sis.com.tw>
Date: Thu, 07 Oct 1999 09:32:53 +0800
From: ollie <ollie@sis.com.tw>
Organization: Silicon Integrated System Corp.
X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.2.12 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: Linux Lists <lists@cyclades.com>
Subject: Re: [OT] Programming network devices
References: <Pine.LNX.3.96.991006151505.8418A-100000@main.cyclades.com>
Content-Type: text/plain; charset=big5
Content-Transfer-Encoding: 7bit

Linux Lists wrote:

> Hello,
>
> I need to develop a configuration utility to a network device. All I need
> this application to do (I guess) is to open this netdev, send an IOCTL to
> it, and then close it. At least that's how I'm used to do it with serial
> ports ... :)
>
> The info I need is: is there any good resource of information on how to
> write such an application ?? I tried looking at the ifconfig (net-tools)
> code, but that's too (read much more) complex for what I need.

I am working on a Gnome Applet which monitor & configure our SiS 900
chip/card.

Basically, you need a (rather dummy) socket and ifreq structure. Open the
socket
with AF_INET and SOCK_DGRAM. Assign the interface you want to
configure in ifreq.ifr_name the call ioctl with various SIOC**** to get/set
value you want about an interface.

For more information, take a look at /usr/include/net/if.h and
/usr/include/bits/ioctls.h

ollie

--------------0AEC81CDE60301901BD6F74B--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/