where can I find the IP address ?
Le Thu, 26 Apr 2001 17:22:03 GMT+1
Eric PENNAMEN <[email protected]> à écrit :
Quoted 6 lines
Je ne suis pas un expert Linux et je ne pourrais peut etre pas
t'aider mais je le probleme n'es-t pas tres clair :
Est il de recuperer l'adresse IP du poste (transfert de donne entre le script
et le driver au chargement) ?
ou bien que le driver doit ouvrir dans le kernel une socket a l'adresse IP donne dans le script et que tu ne sais pas comment faire ?
en fait mon driver commande une sorte de carte réseau dont l'ip est attribué dans un script, le but est de recuperer l'ip attribuée. je crois que ca correspond plus a ta première proposition
mais effectivement j'ai bien quelques idées mais elles n'ont abouti a rien (appel ioctl, utiliser la structure device qui doit contenir l'adresse du protocol utilisé dev->pa_addr [ malheureusement je me fais jeter à la compil car ce champs n'existerait pas ... a til disparu depuis les noyaux 2.2.14 ??])
pourtant c'est ce que preconise le bouquin de rubini (edition 1)
voila si t'as une piste ...
merci
Quoted 58 lines
sébastien person a écrit :
Début du message transféré :
Date: Wed, 25 Apr 2001 16:45:48 +0200
From: sébastien person <[email protected]>
To: Helge Hafting <[email protected]>
Subject: Re: Fw: where can I find the IP address ?Le Wed, 25 Apr 2001 15:17:59 +0200
Helge Hafting <[email protected]> à écrit :Quoted 11 lines
Quoted 10 lines · sébastien person
Début du message transféré :
Date: Tue, 24 Apr 2001 16:43:18 +0200
From: sébastien person <[email protected]>
To: liste noyau linux <[email protected]>
Subject: where can I find the IP address ?I'm dealing with a driver wich need the IP address for specifics using.
Quoted 8 lines
The IP address of what?
Rememeber, a computer can have an arbitrary number of different IP addresses assigned to various interfaces. It may even have several IP addresses on the same network card.So, which of them do you want?
Helge Hafting
Yes that's right. In fact (excuse my bad english), my driver is 'iconfiged- up' with an IP in a script, and there is only one IP attach to the adapter. The adapter is a serial modem wich will work like an ethernet card, I'm working on the encapsulation of packets on the serial line and I need the IP that ifconfig attach to it.
I've seen in the rubini linux device driver that it exists one field in the struture that contain the IP but it doesn't exist in my structure so I though that I can find it elsewhere. So the IP that I need for the driver of the device, is the one the device is attached to. I expect to explain myself clearly else don't hesitate to tell me more.
thanks
sebastien person
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
______________________________________________________
Boîte aux lettres - Caramail - http://www.caramail.com
Quoted 6 lines · On Thu, 26 Apr 2001, [ISO-8859-1] sébastien person wrote:
Le Thu, 26 Apr 2001 17:22:03 GMT+1
Eric PENNAMEN <[email protected]> à écrit :Quoted 3 lines
Je ne suis pas un expert Linux et je ne pourrais peut etre pas t'aider mais je le probleme n'es-t pas tres clair :
Est il de recuperer l'adresse IP du poste (transfert de donne
entre le script
Quoted 4 lines
Quoted 3 lines
et le driver au chargement) ?
ou bien que le driver doit ouvrir dans le kernel une socket a l'adresse IP donne dans le script et que tu ne sais pas comment faire ?
[SNIPPED..]
Each device, when accessed, gets a pointer to a 'struct ifreq' this structure contains the IP address as well as other network parameters. See ../linux/net/core/dev.c and /usr/include/linux/if.h.
This is readily address from user-space. I don't know if the required stuff is public so it might require some work from a module.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).
"Memory is like gasoline. You use it up when you are running. Of course you get it all back when you reboot..."; Actual explanation obtained from the Micro$oft help desk.