summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Hall <GMCH@hestia.halldom.com>2010-01-24 18:46:20 +0000
committerChris Hall <GMCH@hestia.halldom.com>2010-01-24 18:46:20 +0000
commitc21f7fd3e23791cb6ea8a3b0b968af8892c75931 (patch)
tree0a9ee21a4feecec514223bdb7656c8b6ee2a2668 /lib
parent0341d5ce47c301b4a4d92b77a83930da4fdc8fb3 (diff)
downloadquagga-c21f7fd3e23791cb6ea8a3b0b968af8892c75931.tar.bz2
quagga-c21f7fd3e23791cb6ea8a3b0b968af8892c75931.tar.xz
Getting BGP Engine to start and removing warnings.
Finish the wiring required to get bgp_msg_read to process OPEN messages into the connection's open_state, and be able to check for correct peer AS, etc. Removed bugs preventing messages from being written. Added BGP Id check to collision detection logic. Removed as many warnings from comilation as possible. Replaced horrible FIFO kludge in the process. (Introduced the even more horrible miyagi kludge.) modified: bgpd/bgp_advertise.c modified: bgpd/bgp_advertise.h modified: bgpd/bgp_connection.c modified: bgpd/bgp_connection.h modified: bgpd/bgp_debug.c modified: bgpd/bgp_fsm.c modified: bgpd/bgp_msg_read.c modified: bgpd/bgp_msg_write.c modified: bgpd/bgp_network.c modified: bgpd/bgp_nexthop.c modified: bgpd/bgp_notification.c modified: bgpd/bgp_open.c modified: bgpd/bgp_packet.c modified: bgpd/bgp_session.c modified: bgpd/bgp_session.h modified: bgpd/bgpd.c modified: lib/Makefile.am modified: lib/distribute.c modified: lib/if_rmap.c new file: lib/miyagi.h modified: lib/prefix.h modified: lib/sockopt.c modified: lib/stream.c modified: lib/thread.c modified: lib/vty.c modified: lib/zebra.h modified: tests/bgp_capability_test.c modified: tests/bgp_mp_attr_test.c modified: tests/ecommunity_test.c modified: tests/heavy-thread.c modified: tests/heavy-wq.c modified: tests/heavy.c modified: tests/main.c modified: tests/test-checksum.c modified: tests/test-sig.c modified: watchquagga/watchquagga.c modified: zebra/if_netlink.c modified: zebra/ioctl.c modified: zebra/rt_netlink.c modified: zebra/rtread_netlink.c
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am3
-rw-r--r--lib/distribute.c19
-rw-r--r--lib/if_rmap.c19
-rw-r--r--lib/miyagi.h40
-rw-r--r--lib/prefix.h24
-rw-r--r--lib/sockopt.c2
-rw-r--r--lib/stream.c6
-rw-r--r--lib/thread.c130
-rw-r--r--lib/vty.c9
-rw-r--r--lib/zebra.h32
10 files changed, 146 insertions, 138 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index c11d1959..7d97bfcb 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -31,7 +31,8 @@ pkginclude_HEADERS = \
privs.h sigevent.h pqueue.h jhash.h zassert.h memtypes.h \
workqueue.h route_types.h symtab.h heap.h \
qtime.h qpthreads.h mqueue.h qpselect.h qtimers.h qpnexus.h \
- command_queue.h qlib_init.h qafi_safi.h confirm.h
+ command_queue.h qlib_init.h qafi_safi.h \
+ confirm.h miyagi.h
EXTRA_DIST = regex.c regex-gnu.h memtypes.awk route_types.awk route_types.txt
diff --git a/lib/distribute.c b/lib/distribute.c
index 6e7ccc67..0e1c9458 100644
--- a/lib/distribute.c
+++ b/lib/distribute.c
@@ -20,6 +20,7 @@
*/
#include <zebra.h>
+#include "miyagi.h"
#include "hash.h"
#include "if.h"
@@ -68,15 +69,8 @@ distribute_lookup (const char *ifname)
struct distribute key;
struct distribute *dist;
- union {
- const char* waxon ;
- char* waxoff ;
- } miyagi ;
-
- miyagi.waxon = ifname ;
-
/* temporary reference */
- key.ifname = miyagi.waxoff ;
+ key.ifname = miyagi(ifname) ;
dist = hash_lookup (disthash, &key);
@@ -114,15 +108,8 @@ distribute_get (const char *ifname)
{
struct distribute key;
- union {
- const char* waxon ;
- char* waxoff ;
- } miyagi ;
-
- miyagi.waxon = ifname ;
-
/* temporary reference */
- key.ifname = miyagi.waxoff ;
+ key.ifname = miyagi(ifname) ;
return hash_get (disthash, &key, (void * (*) (void *))distribute_hash_alloc);
}
diff --git a/lib/if_rmap.c b/lib/if_rmap.c
index dfb66260..9ef5ed94 100644
--- a/lib/if_rmap.c
+++ b/lib/if_rmap.c
@@ -20,6 +20,7 @@
*/
#include <zebra.h>
+#include "miyagi.h"
#include "hash.h"
#include "command.h"
@@ -63,15 +64,8 @@ if_rmap_lookup (const char *ifname)
struct if_rmap key;
struct if_rmap *if_rmap;
- union {
- const char* waxon ;
- char* waxoff ;
- } miyagi ;
-
- miyagi.waxon = ifname ;
-
/* temporary reference */
- key.ifname = miyagi.waxoff ;
+ key.ifname = miyagi(ifname) ;
if_rmap = hash_lookup (ifrmaphash, &key);
@@ -107,15 +101,8 @@ if_rmap_get (const char *ifname)
{
struct if_rmap key;
- union {
- const char* waxon ;
- char* waxoff ;
- } miyagi ;
-
- miyagi.waxon = ifname ;
-
/* temporary reference */
- key.ifname = miyagi.waxoff ;
+ key.ifname = miyagi(ifname) ;
return (struct if_rmap *) hash_get (ifrmaphash, &key, if_rmap_hash_alloc);
}
diff --git a/lib/miyagi.h b/lib/miyagi.h
new file mode 100644
index 00000000..569d2da9
--- /dev/null
+++ b/lib/miyagi.h
@@ -0,0 +1,40 @@
+/* Kludge to discard "const" from pointer
+ * Copyright (C) 2009 Chris Hall (GMCH), Highwayman
+ *.
+ * This file is part of GNU Zebra.
+ *
+ * GNU Zebra is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Zebra; see the file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef _ZEBRA_MIYAGI_H
+#define _ZEBRA_MIYAGI_H
+
+#ifndef Inline
+#define Inline static inline
+#endif
+
+/*==============================================================================
+ * Ghastly kludge to discard "const" from pointer
+ */
+Inline void*
+miyagi(const void* ptr)
+{
+ union {
+ const void* waxon ;
+ void* waxoff ;
+ } shuffle ;
+
+ shuffle.waxon = ptr ;
+
+ return shuffle.waxoff ;
+} ;
+
+#endif /* _ZEBRA_MIYAGI_H */
diff --git a/lib/prefix.h b/lib/prefix.h
index a7598b7e..1ccd4dd6 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with GNU Zebra; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * 02111-1307, USA.
*/
#ifndef _ZEBRA_PREFIX_H
@@ -25,6 +25,10 @@
#include "sockunion.h"
+#ifndef Inline
+#define Inline static inline
+#endif
+
/*
* A struct prefix contains an address family, a prefix length, and an
* address. This can represent either a 'network prefix' as defined
@@ -39,14 +43,14 @@ struct prefix
{
u_char family;
u_char prefixlen;
- union
+ union
{
u_char prefix;
struct in_addr prefix4;
#ifdef HAVE_IPV6
struct in6_addr prefix6;
#endif /* HAVE_IPV6 */
- struct
+ struct
{
struct in_addr id;
struct in_addr adv_router;
@@ -171,6 +175,12 @@ extern void apply_mask_ipv4 (struct prefix_ipv4 *);
#define PREFIX_COPY_IPV4(DST, SRC) \
*((struct prefix_ipv4 *)(DST)) = *((const struct prefix_ipv4 *)(SRC));
+Inline void
+prefix_copy_ipv4(struct prefix* dst, struct prefix* src)
+{
+ *dst = *src ;
+} ;
+
extern int prefix_ipv4_any (const struct prefix_ipv4 *);
extern void apply_classful_mask_ipv4 (struct prefix_ipv4 *);
@@ -193,7 +203,13 @@ extern int str2prefix_ipv6 (const char *, struct prefix_ipv6 *);
extern void apply_mask_ipv6 (struct prefix_ipv6 *);
#define PREFIX_COPY_IPV6(DST, SRC) \
- *((struct prefix_ipv6 *)(DST)) = *((const struct prefix_ipv6 *)(SRC));
+ *((struct prefix_ipv6 *)(DST)) = *((const struct prefix_ipv6 *)(SRC));
+
+Inline void
+prefix_copy_ipv6(struct prefix* dst, struct prefix* src)
+{
+ *dst = *src ;
+} ;
extern int ip6_masklen (struct in6_addr);
extern void masklen2ip6 (int, struct in6_addr *);
diff --git a/lib/sockopt.c b/lib/sockopt.c
index 1f84aaca..3e4580ac 100644
--- a/lib/sockopt.c
+++ b/lib/sockopt.c
@@ -624,7 +624,7 @@ sockopt_tcp_signature (int sock, union sockunion *su, const char *password)
int
sockopt_ttl (int family, int sock, int ttl)
{
- char* msg ;
+ const char* msg ;
int ret ;
ret = 0 ;
diff --git a/lib/stream.c b/lib/stream.c
index 79ce1791..14c7c589 100644
--- a/lib/stream.c
+++ b/lib/stream.c
@@ -158,7 +158,7 @@ struct stream *
stream_dup_pending (struct stream *s)
{
struct stream *new;
- int new_endp ;
+ size_t new_endp ;
STREAM_VERIFY_SANE (s);
@@ -1050,13 +1050,13 @@ stream_transfer(void* p, struct stream* s, void* limit)
size_t have = s->endp ;
STREAM_VERIFY_SANE(s);
- assert((p + have) <= limit) ;
+ assert(((uint8_t*)p + have) <= (uint8_t*)limit) ;
memcpy(p, s->data, have) ;
s->getp = s->endp = 0;
- return p + have ;
+ return (uint8_t*)p + have ;
} ;
/* Stream first in first out queue. */
diff --git a/lib/thread.c b/lib/thread.c
index 09a082cf..e581dd6f 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -16,12 +16,13 @@
* You should have received a copy of the GNU General Public License
* along with GNU Zebra; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * 02111-1307, USA.
*/
/* #define DEBUG */
#include <zebra.h>
+#include "miyagi.h"
#include "thread.h"
#include "memory.h"
@@ -30,7 +31,7 @@
#include "command.h"
#include "sigevent.h"
#include "qpthreads.h"
-
+
/* Recent absolute time of day */
struct timeval recent_time;
static struct timeval last_recent_time;
@@ -39,7 +40,7 @@ static struct timeval relative_time;
static struct timeval relative_time_base;
/* init flag */
static unsigned short timers_inited;
-
+
/* cpu stats needs to be qpthread safe. */
static qpt_mutex_t thread_mutex;
#define LOCK qpt_mutex_lock(&thread_mutex);
@@ -52,7 +53,7 @@ static struct hash *cpu_record = NULL;
#include "qpnexus.h"
static sigset_t newmask;
#endif
-
+
/* Struct timeval's tv_usec one second value. */
#define TIMER_SECOND_MICRO 1000000L
@@ -104,7 +105,7 @@ timeval_elapsed (struct timeval a, struct timeval b)
return (((a.tv_sec - b.tv_sec) * TIMER_SECOND_MICRO)
+ (a.tv_usec - b.tv_usec));
}
-
+
#ifndef HAVE_CLOCK_MONOTONIC
static void
quagga_gettimeofday_relative_adjust (void)
@@ -131,9 +132,9 @@ static int
quagga_gettimeofday (struct timeval *tv)
{
int ret;
-
+
assert (tv);
-
+
if (!(ret = gettimeofday (&recent_time, NULL)))
{
/* init... */
@@ -208,7 +209,7 @@ quagga_gettime (enum quagga_clkid clkid, struct timeval *tv)
}
}
-/* time_t value in terms of stabilised absolute time.
+/* time_t value in terms of stabilised absolute time.
* replacement for POSIX time()
*/
time_t
@@ -227,14 +228,14 @@ recent_relative_time (void)
{
return relative_time;
}
-
+
static unsigned int
cpu_record_hash_key (struct cpu_thread_history *a)
{
return (uintptr_t) a->func;
}
-static int
+static int
cpu_record_hash_cmp (const struct cpu_thread_history *a,
const struct cpu_thread_history *b)
{
@@ -255,12 +256,13 @@ static void
cpu_record_hash_free (void *a)
{
struct cpu_thread_history *hist = a;
-
- XFREE (MTYPE_THREAD_FUNCNAME, hist->funcname);
+ char* funcname = miyagi(hist->funcname) ;
+
+ XFREE (MTYPE_THREAD_FUNCNAME, funcname);
XFREE (MTYPE_THREAD_STATS, hist);
}
-static inline void
+static inline void
vty_out_cpu_thread_history(struct vty* vty,
struct cpu_thread_history *a)
{
@@ -285,14 +287,14 @@ vty_out_cpu_thread_history(struct vty* vty,
}
static void
-cpu_record_hash_print(struct hash_backet *bucket,
+cpu_record_hash_print(struct hash_backet *bucket,
void *args[])
{
struct cpu_thread_history *totals = args[0];
struct vty *vty = args[1];
thread_type *filter = args[2];
struct cpu_thread_history *a = bucket->data;
-
+
a = bucket->data;
if ( !(a->types & *filter) )
return;
@@ -398,7 +400,7 @@ DEFUN_CALL(show_thread_cpu,
cpu_record_print(vty, filter);
return CMD_SUCCESS;
}
-
+
/* List allocation and head/tail print out. */
static void
thread_list_debug (struct thread_list *list)
@@ -427,7 +429,7 @@ thread_master_debug (struct thread_master *m)
printf ("total alloc: [%ld]\n", m->alloc);
printf ("-----------\n");
}
-
+
/* Allocate new thread master. */
struct thread_master *
thread_master_create ()
@@ -437,11 +439,11 @@ thread_master_create ()
sigdelset (&newmask, SIGMQUEUE);
#endif
- if (cpu_record == NULL)
- cpu_record
- = hash_create_size (1011, (unsigned int (*) (void *))cpu_record_hash_key,
+ if (cpu_record == NULL)
+ cpu_record
+ = hash_create_size (1011, (unsigned int (*) (void *))cpu_record_hash_key,
(int (*) (const void *, const void *))cpu_record_hash_cmp);
-
+
return (struct thread_master *) XCALLOC (MTYPE_THREAD_MASTER,
sizeof (struct thread_master));
}
@@ -462,8 +464,8 @@ thread_list_add (struct thread_list *list, struct thread *thread)
/* Add a new thread just before the point. */
static void
-thread_list_add_before (struct thread_list *list,
- struct thread *point,
+thread_list_add_before (struct thread_list *list,
+ struct thread *point,
struct thread *thread)
{
thread->next = point;
@@ -534,7 +536,7 @@ thread_master_free (struct thread_master *m)
thread_list_free (m, &m->ready);
thread_list_free (m, &m->unuse);
thread_list_free (m, &m->background);
-
+
XFREE (MTYPE_THREAD_MASTER, m);
LOCK
@@ -568,7 +570,7 @@ unsigned long
thread_timer_remain_second (struct thread *thread)
{
quagga_get_relative (NULL);
-
+
if (thread->u.sands.tv_sec - relative_time.tv_sec > 0)
return thread->u.sands.tv_sec - relative_time.tv_sec;
else
@@ -577,7 +579,7 @@ thread_timer_remain_second (struct thread *thread)
/* Trim blankspace and "()"s */
static char *
-strip_funcname (const char *funcname)
+strip_funcname (const char *funcname)
{
char buff[100];
char tmp, *ret, *e, *b = buff;
@@ -625,7 +627,7 @@ thread_get (struct thread_master *m, u_char type,
thread->master = m;
thread->func = func;
thread->arg = arg;
-
+
thread->funcname = strip_funcname(funcname);
return thread;
@@ -633,7 +635,7 @@ thread_get (struct thread_master *m, u_char type,
/* Add new read thread. */
struct thread *
-funcname_thread_add_read (struct thread_master *m,
+funcname_thread_add_read (struct thread_master *m,
int (*func) (struct thread *), void *arg, int fd, const char* funcname)
{
struct thread *thread;
@@ -679,10 +681,10 @@ funcname_thread_add_write (struct thread_master *m,
static struct thread *
funcname_thread_add_timer_timeval (struct thread_master *m,
- int (*func) (struct thread *),
+ int (*func) (struct thread *),
int type,
- void *arg,
- struct timeval *time_relative,
+ void *arg,
+ struct timeval *time_relative,
const char* funcname)
{
struct thread *thread;
@@ -694,7 +696,7 @@ funcname_thread_add_timer_timeval (struct thread_master *m,
assert (type == THREAD_TIMER || type == THREAD_BACKGROUND);
assert (time_relative);
-
+
list = ((type == THREAD_TIMER) ? &m->timer : &m->background);
thread = thread_get (m, type, func, arg, funcname);
@@ -721,7 +723,7 @@ funcname_thread_add_timer_timeval (struct thread_master *m,
/* Add timer event thread. */
struct thread *
funcname_thread_add_timer (struct thread_master *m,
- int (*func) (struct thread *),
+ int (*func) (struct thread *),
void *arg, long timer, const char* funcname)
{
struct timeval trel;
@@ -731,14 +733,14 @@ funcname_thread_add_timer (struct thread_master *m,
trel.tv_sec = timer;
trel.tv_usec = 0;
- return funcname_thread_add_timer_timeval (m, func, THREAD_TIMER, arg,
+ return funcname_thread_add_timer_timeval (m, func, THREAD_TIMER, arg,
&trel, funcname);
}
/* Add timer event thread with "millisecond" resolution */
struct thread *
funcname_thread_add_timer_msec (struct thread_master *m,
- int (*func) (struct thread *),
+ int (*func) (struct thread *),
void *arg, long timer, const char* funcname)
{
struct timeval trel;
@@ -748,7 +750,7 @@ funcname_thread_add_timer_msec (struct thread_master *m,
trel.tv_sec = timer / 1000;
trel.tv_usec = 1000*(timer % 1000);
- return funcname_thread_add_timer_timeval (m, func, THREAD_TIMER,
+ return funcname_thread_add_timer_timeval (m, func, THREAD_TIMER,
arg, &trel, funcname);
}
@@ -756,13 +758,13 @@ funcname_thread_add_timer_msec (struct thread_master *m,
struct thread *
funcname_thread_add_background (struct thread_master *m,
int (*func) (struct thread *),
- void *arg, long delay,
+ void *arg, long delay,
const char *funcname)
{
struct timeval trel;
-
+
assert (m != NULL);
-
+
if (delay)
{
trel.tv_sec = delay / 1000;
@@ -799,7 +801,7 @@ void
thread_cancel (struct thread *thread)
{
struct thread_list *list;
-
+
switch (thread->type)
{
case THREAD_READ:
@@ -887,9 +889,9 @@ thread_process_fd (struct thread_list *list, fd_set *fdset, fd_set *mfdset)
struct thread *thread;
struct thread *next;
int ready = 0;
-
+
assert (list);
-
+
for (thread = list->head; thread; thread = next)
{
next = thread->next;
@@ -913,7 +915,7 @@ thread_timer_process (struct thread_list *list, struct timeval *timenow)
{
struct thread *thread;
unsigned int ready = 0;
-
+
for (thread = list->head; thread; thread = thread->next)
{
if (timeval_cmp (*timenow, thread->u.sands) < 0)
@@ -942,38 +944,44 @@ thread_fetch (struct thread_master *m, struct thread *fetch)
while (1)
{
int num = 0;
-
+
/* Signals are highest priority */
if (!qpthreads_enabled)
quagga_sigevent_process ();
-
+
/* Normal event are the next highest priority. */
if ((thread = thread_trim_head (&m->event)) != NULL)
return thread_run (m, thread, fetch);
-
+
/* If there are any ready threads from previous scheduler runs,
- * process top of them.
+ * process top of them.
*/
if ((thread = thread_trim_head (&m->ready)) != NULL)
return thread_run (m, thread, fetch);
-
+
/* Structure copy. */
readfd = m->readfd;
writefd = m->writefd;
exceptfd = m->exceptfd;
-
+
/* Calculate select wait timer if nothing else to do */
quagga_get_relative (NULL);
timer_wait = thread_timer_wait (&m->timer, &timer_val);
timer_wait_bg = thread_timer_wait (&m->background, &timer_val_bg);
-
+
if (timer_wait_bg &&
(!timer_wait || (timeval_cmp (*timer_wait, *timer_wait_bg) > 0)))
timer_wait = timer_wait_bg;
-
+
/* TODO: remove this */
#ifdef USE_MQUEUE
- num = pselect (FD_SETSIZE, &readfd, &writefd, &exceptfd, timer_wait, &newmask);
+ {
+ struct timespec spec ;
+ spec.tv_sec = timer_wait->tv_sec ;
+ spec.tv_nsec = timer_wait->tv_usec * 1000 ;
+ num = pselect (FD_SETSIZE, &readfd, &writefd, &exceptfd, &spec,
+ &newmask);
+ } ;
#else
num = select (FD_SETSIZE, &readfd, &writefd, &exceptfd, timer_wait);
#endif
@@ -1001,7 +1009,7 @@ thread_fetch (struct thread_master *m, struct thread *fetch)
list in front of the I/O threads. */
quagga_get_relative (NULL);
thread_timer_process (&m->timer, &relative_time);
-
+
/* Got IO, process it */
if (num > 0)
{
@@ -1022,7 +1030,7 @@ thread_fetch (struct thread_master *m, struct thread *fetch)
/* Background timer/events, lowest priority */
thread_timer_process (&m->background, &relative_time);
-
+
if ((thread = thread_trim_head (&m->ready)) != NULL)
return thread_run (m, thread, fetch);
}
@@ -1093,13 +1101,13 @@ thread_consumed_time (RUSAGE_T *now, RUSAGE_T *start, unsigned long *cputime)
return timeval_elapsed (now->real, start->real);
}
-/* We should aim to yield after THREAD_YIELD_TIME_SLOT milliseconds.
+/* We should aim to yield after THREAD_YIELD_TIME_SLOT milliseconds.
Note: we are using real (wall clock) time for this calculation.
It could be argued that CPU time may make more sense in certain
contexts. The things to consider are whether the thread may have
blocked (in which case wall time increases, but CPU time does not),
or whether the system is heavily loaded with other processes competing
- for CPU time. On balance, wall clock time seems to make sense.
+ for CPU time. On balance, wall clock time seems to make sense.
Plus it has the added benefit that gettimeofday should be faster
than calling getrusage. */
int
@@ -1146,12 +1154,12 @@ thread_call (struct thread *thread)
if (!thread->hist)
{
struct cpu_thread_history tmp;
-
+
tmp.func = thread->func;
tmp.funcname = thread->funcname;
-
+
LOCK
- thread->hist = hash_get (cpu_record, &tmp,
+ thread->hist = hash_get (cpu_record, &tmp,
(void * (*) (void *))cpu_record_hash_alloc);
UNLOCK
}
@@ -1199,12 +1207,12 @@ thread_call (struct thread *thread)
/* Execute thread */
struct thread *
funcname_thread_execute (struct thread_master *m,
- int (*func)(struct thread *),
+ int (*func)(struct thread *),
void *arg,
int val,
const char* funcname)
{
- struct thread dummy;
+ struct thread dummy;
memset (&dummy, 0, sizeof (struct thread));
diff --git a/lib/vty.c b/lib/vty.c
index fdc36925..e154a575 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -21,6 +21,7 @@
*/
#include <zebra.h>
+#include "miyagi.h"
#include "linklist.h"
#include "thread.h"
@@ -2931,10 +2932,10 @@ vty_log_fixed (const char *buf, size_t len)
if (!vtyvec)
return;
- iov[0].iov_base = (void *)buf;
- iov[0].iov_len = len;
- iov[1].iov_base = (void *)"\r\n";
- iov[1].iov_len = 2;
+ iov[0].iov_base = miyagi(buf) ;
+ iov[0].iov_len = len;
+ iov[1].iov_base = miyagi("\r\n") ;
+ iov[1].iov_len = 2;
for (i = 0; i < vector_active (vtyvec); i++)
{
diff --git a/lib/zebra.h b/lib/zebra.h
index 65aad161..799cfc3d 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -525,28 +525,6 @@ extern const char *zserv_command_string (unsigned int command);
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); \
@@ -554,14 +532,4 @@ struct fifo
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 */