diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-12-09 17:28:48 +0000 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2010-02-04 22:37:31 +0100 |
commit | a8c48bb76f291c673438d2061753d05a0d9b3276 (patch) | |
tree | aa392be05e955ad5684f2d35463fd45380070780 /lib | |
parent | 6c9463d3f240f79fd46665c3b21e5152e51804f5 (diff) | |
download | quagga-a8c48bb76f291c673438d2061753d05a0d9b3276.tar.bz2 quagga-a8c48bb76f291c673438d2061753d05a0d9b3276.tar.xz |
bgp: move cleanup fifo code
This patch started while looking at the compiler aliasing warnings
from FIFO_HEAD() in BGP. Then I realized the FIFO code was only
being used in BGP, so it made sense to move it from zebra to
BGP. In the process convert from macro's to inline and add more
type safety.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/zebra.h | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/lib/zebra.h b/lib/zebra.h index 2dc84514..5d863599 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -538,43 +538,4 @@ typedef u_int8_t safi_t; typedef u_int16_t zebra_size_t; typedef u_int16_t zebra_command_t; -/* FIFO -- first in first out structure and macros. */ -struct fifo -{ - struct fifo *next; - struct fifo *prev; -}; - -#define FIFO_INIT(F) \ - do { \ - struct fifo *Xfifo = (struct fifo *)(F); \ - Xfifo->next = Xfifo->prev = Xfifo; \ - } while (0) - -#define FIFO_ADD(F,N) \ - do { \ - struct fifo *Xfifo = (struct fifo *)(F); \ - struct fifo *Xnode = (struct fifo *)(N); \ - Xnode->next = Xfifo; \ - Xnode->prev = Xfifo->prev; \ - Xfifo->prev = Xfifo->prev->next = Xnode; \ - } while (0) - -#define FIFO_DEL(N) \ - do { \ - struct fifo *Xnode = (struct fifo *)(N); \ - Xnode->prev->next = Xnode->next; \ - Xnode->next->prev = Xnode->prev; \ - } while (0) - -#define FIFO_HEAD(F) \ - ((((struct fifo *)(F))->next == (struct fifo *)(F)) \ - ? NULL : (F)->next) - -#define FIFO_EMPTY(F) \ - (((struct fifo *)(F))->next == (struct fifo *)(F)) - -#define FIFO_TOP(F) \ - (FIFO_EMPTY(F) ? NULL : ((struct fifo *)(F))->next) - #endif /* _ZEBRA_H */ |