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
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
|
|