diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile.am | 2 | ||||
-rw-r--r-- | lib/confirm.h | 28 | ||||
-rw-r--r-- | lib/memtypes.c | 2 | ||||
-rw-r--r-- | lib/stream.c | 14 | ||||
-rw-r--r-- | lib/stream.h | 1 | ||||
-rw-r--r-- | lib/zassert.h | 15 |
6 files changed, 48 insertions, 14 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index d6d3022a..c11d1959 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -31,7 +31,7 @@ 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 + command_queue.h qlib_init.h qafi_safi.h confirm.h EXTRA_DIST = regex.c regex-gnu.h memtypes.awk route_types.awk route_types.txt diff --git a/lib/confirm.h b/lib/confirm.h new file mode 100644 index 00000000..caccf742 --- /dev/null +++ b/lib/confirm.h @@ -0,0 +1,28 @@ +/* Compile time CONFIRM gizmo + * 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. + */ + +/*============================================================================== + * Compile time CONFIRM gizmo + * + * Two forms: CONFIRM(e) for use at top (file) level + * confirm(e) for use inside compound statements + */ +#ifndef CONFIRM + + #define CONFIRM(e) extern void CONFIRMATION(char CONFIRM[(e) ? 1 : -1]) ; + #define confirm(e) { CONFIRM(e) } + +#endif diff --git a/lib/memtypes.c b/lib/memtypes.c index 7c4c6f61..96dd8f4a 100644 --- a/lib/memtypes.c +++ b/lib/memtypes.c @@ -119,6 +119,8 @@ struct memory_list memory_list_bgp[] = { MTYPE_BGP_SESSION, "BGP session" }, { MTYPE_BGP_CONNECTION, "BGP connection" }, { MTYPE_BGP_NOTIFY, "BGP notification" }, + { MTYPE_BGP_ROUTE_REFRESH, "BGP route refresh" }, + { MTYPE_BGP_ORF_ENTRY, "BGP ORF entry" }, { MTYPE_ATTR, "BGP attribute" }, { MTYPE_ATTR_EXTRA, "BGP extra attributes" }, { MTYPE_AS_PATH, "BGP aspath" }, diff --git a/lib/stream.c b/lib/stream.c index 36bbba1e..dc636361 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -236,6 +236,20 @@ stream_set_getp (struct stream *s, size_t pos) s->getp = pos; } +void +stream_set_endp (struct stream *s, size_t pos) +{ + STREAM_VERIFY_SANE(s); + + if (!ENDP_VALID (s, pos)) + { + STREAM_BOUND_WARN (s, "set endp"); + return ; + } + + s->endp = pos; +} + /* Forward pointer. */ void stream_forward_getp (struct stream *s, size_t size) diff --git a/lib/stream.h b/lib/stream.h index 4c8a4fa9..957bf495 100644 --- a/lib/stream.h +++ b/lib/stream.h @@ -147,6 +147,7 @@ extern size_t stream_get_size (struct stream *); extern u_char *stream_get_data (struct stream *); extern void stream_set_getp (struct stream *, size_t); +extern void stream_set_endp (struct stream *, size_t); extern void stream_forward_getp (struct stream *, size_t); extern void stream_forward_endp (struct stream *, size_t); diff --git a/lib/zassert.h b/lib/zassert.h index 424688b9..a766eb7b 100644 --- a/lib/zassert.h +++ b/lib/zassert.h @@ -5,6 +5,8 @@ #ifndef _QUAGGA_ASSERT_H #define _QUAGGA_ASSERT_H +#include "confirm.h" + extern void _zlog_assert_failed (const char *assertion, const char *file, unsigned int line, const char *function) __attribute__ ((noreturn)); @@ -61,17 +63,4 @@ extern void _zlog_abort_err (const char *mess, int err, const char *file, #define zabort_err(MS, ERR) _zlog_abort_err(MS, ERR, __FILE__, __LINE__, \ __ASSERT_FUNCTION) -/*============================================================================== - * Compile time CONFIRM gizmo - * - * Two forms: CONFIRM(e) for use at top (file) level - * confirm(e) for use inside compound statements - */ -#ifndef CONFIRM - - #define CONFIRM(e) extern void CONFIRMATION(char CONFIRM[(e) ? 1 : -1]) ; - #define confirm(e) { CONFIRM(e) } - -#endif - #endif /* _QUAGGA_ASSERT_H */ |