summaryrefslogtreecommitdiffstats
path: root/lib/zebra.h
diff options
context:
space:
mode:
authorpaul <paul>2003-03-01 11:32:28 +0000
committerpaul <paul>2003-03-01 11:32:28 +0000
commit8a3864b2f7268f4016b6cbb81c6e05b10e684140 (patch)
treec69d48b5776a238c28eeaa0e88e1efe530ab6a92 /lib/zebra.h
parentd71717f92ca1892f7b30b553c4ab588e0095c5c7 (diff)
downloadquagga-d7a522e27cfde9a01fac2e66cd694444e688dd4f.tar.bz2
quagga-d7a522e27cfde9a01fac2e66cd694444e688dd4f.tar.xz
Import of Zebra CVS 20030301-11:30zebra_org_20030301
Diffstat (limited to 'lib/zebra.h')
-rw-r--r--lib/zebra.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/zebra.h b/lib/zebra.h
index 06302b3d..a34f5d4a 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -28,8 +28,15 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#ifdef SUNOS_5
#define _XPG4_2
#define __EXTENSIONS__
+typedef unsigned int u_int32_t;
+typedef unsigned short u_int16_t;
+typedef unsigned short u_int8_t;
#endif /* SUNOS_5 */
+#ifndef HAVE_SOCKLEN_T
+typedef int socklen_t;
+#endif /* HAVE_SOCKLEN_T */
+
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
@@ -309,4 +316,43 @@ typedef u_char safi_t;
typedef u_int16_t zebra_size_t;
typedef u_int8_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 */