Re: Accessing a user space variable from a kernel module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 01, 2002 at 05:12:35PM -0400, Jeremy Andrus wrote:
> 
> of the card. This is stored in the kernel module. How can I either send 
> (make available?) the IP address to the kernel module, or send (make 

This is probably not what you want but I think you can get the info you are
looking for by jumping through these hoops:

strace ifconfig
    - shows ifconfig reads the info from /proc/net
    - which means that the ip address is in the kernel

look at ifconfig source to see how it figures out the ipaddress from /proc

then look at the procfs code in the kernel and find out how it gets the
information it displays. 

or

strace host foo.bar.com

shows it uses the socket function call.  figure out how that works and get the
sysname and domain name from the system_utsname struct that the kernel holds.
I do not know how to get to the system_utsname but you will see that it is
used by the kernel for the syscall sethostname which for 2.4.18 is found in
kernel/sys.c

warning:  i give no guarantees that either of these will work but there is a
chance :)

or you could just write a char device, insmod, mknod, and write the ip address to
that.

good luck,
-nick

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux