lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [patch #8680] Add support for LwIP static route table


From: Pradip De
Subject: [lwip-devel] [patch #8680] Add support for LwIP static route table
Date: Wed, 14 Dec 2016 21:16:41 +0000 (UTC)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36

Follow-up Comment #22, patch #8680 (project lwip):

Thanks for the discussion and input and thanks David for the patches.

One of the things with using a routing table is adding/removing a
corresponding route(typically a /64) along with an address addition/removal.
This is why I had included the netif_[add/remove]_address_with route()
functions in LwIP core.
 
However, if the responsibility to add and remove these routes can be delegated
to the application then I think my route table implementation (in 
lwip_rt_table_impl.diff) can be used by applications that require simple route
addition/deletion and lookup functionality. 
There is a small pending correction of moving the definition of
LWIP_IPV6_NUM_ROUTE_ENTRIES from opt.h but I would be happy to do that. 
 
Alternatively, if we choose to allow the LwIP core to help with this when
adding addresses(instead of having the application handle that) then we could
potentially surface 2 more hooks in opt.h for addition/removal of a static
route: something to the tune of the following:

/**
 * LWIP_HOOK_IP6_ADD_STATIC_ROUTE(prefix, netif, gateway, idx):
 * - called from ip6_route() (IPv6)
 * - prefix: An IPv6 prefix (address and prefix length)
 * - netif:  Target netif to point the route to.
 * - gateway: Optional Gateway IP6 address, or NULL if unused.  
 * - idx:    Optional returned index of added route entry
 * 
 */
#ifdef __DOXYGEN__
#define LWIP_HOOK_IP6_ADD_STATIC_ROUTE(prefix, netif, gateway, idx)
#endif


#ifdef __DOXYGEN__
#define LWIP_HOOK_IP6_REMOVE_STATIC_ROUTE(prefix)
#endif

Then we can add a couple of helper functions which are encapsulated with
#ifdefs of the above two hooks.


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?8680>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

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