[quagga-dev 4140] Re: example libzebra zclient utility

Andrew J. Schorr aschorr at telemetry-investments.com
Mon May 15 17:08:06 BST 2006


On Mon, May 15, 2006 at 01:04:07PM +0100, Paul Jakma wrote:
> Oh, various places do:
> 
> switch (route-type)
>  {
>    case ZEBRA_ROUTE_KERNEL:
>    case ZEBRA_ROUTE_RIP:
>    ..
>    case $(ZEBRA_ROUTE_MAX-1):
>       <valid route type stuff>
>    default:
>       <do nothing>
>  }
> 
> No objections to me bashing those out and replacing with:
> 
> #define REDISTABLE(T) ( ((unsigned int)(T) > ZEBRA_ROUTE_SYSTEM) \
>                        && ((unsigned int)(T) < ZEBRA_ROUTE_MAX) )
> if (REDISTABLE(T))
>   <valid route type stuff>
> 
> presumably?

That makes sense to me.  In general, I think we should try to eliminate
places in the code where the various routing protocols are hardwired
and replace them with intelligent use of macros and function calls...

Regards,
Andy



More information about the Quagga-dev mailing list