lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] Proposing change to netif state member


From: Bill Auerbach
Subject: [lwip-devel] Proposing change to netif state member
Date: Mon, 19 Mar 2012 13:32:43 -0400

It would be nice to override the void type in void *state in struct netif.h.  This is the pointer to be used by the Ethernet hardware port or other user-code and it would be nice to use it with the correct type instead of casting whenever its used.  Even currently where an assignment is made to a variable of the correct type, a cast isnt required in C but it is in C++.  I would like to use for example netif->state->somethingInMyPort;

Im proposing something like this:

  /** This field can be set by the device driver and could point

   *  to state information for the device. */

#ifdef NETIF_STATE_TYPE

  NETIF_STATE_TYPE state;

#else

  void *state;

#endif

And in cc.h I can use:

#define NETIF_STATE_TYPE struct myPortDescriptor *

Then all my uses of netif->state are of the correct type and I dont need to cast it.

Bill


reply via email to

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