zebra: add developer test functions for FPM code
Add test functions for the zebra code that interfaces with the
Forwarding Plane Manager. These functions can be invoked in a
development build via the recently-added 'invoke' command.
For example:
# invoke zebra function zfpm_dt_benchmark_protobuf_encode 100000
Changes:
* zebra/zebra_fpm_dt.c
Add the following functions. Each function encodes or decodes a
route in a particular FPM format a specified number of times.
- zfpm_dt_benchmark_netlink_encode()
- zfpm_dt_benchmark_protobuf_encode()
- zfpm_dt_benchmark_protobuf_decode()
* zebra/Makefile.am
Compile zebra_fpm_dt when building a development build.
Signed-off-by: Avneesh Sachdev <avneesh@sproute.com>
diff --git a/zebra/Makefile.am b/zebra/Makefile.am
index ab09a36..abd3797 100644
--- a/zebra/Makefile.am
+++ b/zebra/Makefile.am
@@ -26,6 +26,10 @@
protobuf_srcs = zebra_fpm_protobuf.c
endif
+if DEV_BUILD
+dev_srcs = zebra_fpm_dt.c
+endif
+
AM_CFLAGS = $(WERROR)
sbin_PROGRAMS = zebra
@@ -36,7 +40,7 @@
zserv.c main.c interface.c connected.c zebra_rib.c zebra_routemap.c \
redistribute.c debug.c rtadv.c zebra_snmp.c zebra_vty.c \
irdp_main.c irdp_interface.c irdp_packet.c router-id.c zebra_fpm.c \
- $(othersrc) $(protobuf_srcs)
+ $(othersrc) $(protobuf_srcs) $(dev_srcs)
testzebra_SOURCES = test_main.c zebra_rib.c interface.c connected.c debug.c \
zebra_vty.c \