[Click] How to Get local IP Address

Zhiwei Yu linux_vpn at yahoo.com
Wed Jan 26 02:19:31 EST 2005


Hi, Eddie,

Thank you for your reply.


--- Eddie Kohler <kohler at cs.ucla.edu> wrote:

> ZW
> 
> I'm not sure I understand what's going on.
> 
> > I am looking for a solution to get all local
> addresses
> > in Click.  I have tried 2 methods, but neither
> works
> > with Click.  
> > 
> > At first, I tried to get from NETLINK in the user
> > space, as long as I load my element, the system
> > crashs.  I think it's easy to explain that Click
> > elements are actually running in the kernel space,
> the
> > netlink socket should not work with click.
> 
> Are you running a Click configuration in kernel
> space or in user space?  Are you 
> using click-install or just plain 'click'?
> 

I think I am running Click configuration in kernel
space.  I used click-install to install my
configuration and a kernel module was inserted.

> > After that, I have tried to get the device list
> from
> > "struct net_device * base_dev" in the kernel
> space, I
> > cannot compile my code, because the compiler
> always
> > complains some parameter is undeclared, although I
> > included <linux/netdevice.h> and
> <linux/inetdevice.h>.
> >  I really don't know how to handle this kind of
> > problems.  Any comments and helps will be greatly
> > appreciated.
> 
> Again, are you compiling in kernel space or user
> space?

I compiled in user space, I put my element source code
under elemets\standard directory, but the object file
appeared in linuxmodule\ and I cannot figure out why. 
I think the compiler get the header file from
/usr/include instead of /usr/src/linux/include. 
That's why there are so many complaints from the
compiler.

Actually, I use AddressInfo to configure NIC, is there
a way to get local addresses from AddressInfo
elements.

Regards,
ZW

> Eddie
> 



		
__________________________________ 
Do you Yahoo!? 
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com 


More information about the click mailing list