]> git.proxmox.com Git - mirror_frr.git/commit - lib/zclient.h
lib: updates to zapi_route
authorRenato Westphal <renato@opensourcerouting.org>
Sun, 20 Aug 2017 00:25:12 +0000 (21:25 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Wed, 23 Aug 2017 20:45:17 +0000 (17:45 -0300)
commitbb1b9c47ca090ce4484e1f8061f17b5c33f578ee
tree0b6f114b78a84f0dffeb7de41a685d33e152879e
parent81c11e3feafcd20e32cb2d437f39603d645e6880
lib: updates to zapi_route

This patch introduces the following changes to the zapi_route structure
and associated code:
* Use a fixed-size array to store the nexthops instead of a pointer. This
  makes the zapi_route() function much easier to use when we have multiple
  nexthops to send. It's also much more efficient to put everything on
  the stack rather than allocating an array in the heap every time we
  need to send a route to zebra;

* Use the new 'zapi_nexthop' structure. This will allow the client daemons
  to send labeled routes without having to allocate memory for the labels
  (the 'nexthop' structure was designed to be memory efficient and doesn't
  have room for MPLS labels, only a pointer). Also, 'zapi_nexthop' is more
  compact and more clean from an API perspective;

* Embed the route prefix inside the zapi_route structure. Since the
  route's prefix is sent along with its nexthops and attributes, it makes
  sense to pack everything inside the same structure.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
babeld/kernel.c
lib/zclient.c
lib/zclient.h