lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Displaying the DHCP assigned IP address (lwip on nios2)


From: Jim Gibbons
Subject: Re: [lwip-users] Displaying the DHCP assigned IP address (lwip on nios2)
Date: Thu, 04 Aug 2005 09:38:03 -0700
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Network interfaces are created by netif_add, which returns a pointer (struct netif *).  As these interfaces are created, they are also recorded in netif_list, which is exported by netif.h.  You can either retain the pointer returned by netif_add, or traverse netif_list to find your interface structures.

netif_add allocates the netif structures with a call to mem_malloc, so you should always be accessing them via a pointer.

Pointers to structures are really essential in this code.  If you aren't comfortable with them, you may need to step aside from your implementation problems and study them a bit.

Aidan Hammel wrote:
When I try: netif->ip_addr.addr I get the following error:

error: invalid type argument of `->'

I've declared netif like this: struct netif netif;
 
I'm a bit of a novice when it comes to pointers, whenever I think I understand them, they stop working!
 
I'm also not sure how to check the dhcp state...
 
Thanks,
 
Aidan


From: Jim Gibbons [mailto:address@hidden]
Sent: 02 August 2005 16:53
To: address@hidden; Mailing list for lwIP users
Subject: Re: [lwip-users] Displaying the DHCP assigned IP address (lwip on nios2)

I'm getting it from netif->ip_addr.addr.  It's important to wait until DHCP reaches the BOUND state.

Lists wrote:
This is probably a really basic request, but can anybody please tell me what
variable the dhcp assigned IP address is stored in and how to display it? I've
tried netif.ip_addr, but with no luck. It's just one of those things that should
be really easy, but is really bogging me down.
 
Thanks, Aidan


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users
  

--
Jim Gibbons
address@hidden
Gibbons and Associates, Inc.
TEL: (408) 984-1441
900 Lafayette, Suite 704, Santa Clara, CA
FAX: (408) 247-6395



--
E-mail signature
Jim Gibbons
address@hidden
Gibbons and Associates, Inc.
TEL: (408) 984-1441
900 Lafayette, Suite 704, Santa Clara, CA
FAX: (408) 247-6395



reply via email to

[Prev in Thread] Current Thread [Next in Thread]