[quagga-dev 14960] Re: CI Testresult: FAILED (Re: [quagga-dev, 14955, 5/5] doc: add blurb on use of protobuf with FPM)

2016-03-21 Thread Avneesh Sachdev
Hmm, looks like I failed to include one of the fixes for the build, my
apologies.

Let me re-spin the patches, will spam you guys again in a bit.

Thanks,
Avneesh

On Mon, Mar 21, 2016 at 12:20 PM,  wrote:

> Continous Integration Result: FAILED
>
> See below for issues.
> This is an EXPERIMENTAL automated CI system.
> For questions and feedback, feel free to email
> Martin Winter .
>
> Patches applied :
>   Patchwork 1872: http://patchwork.quagga.net/patch/1872
>[quagga-dev,14956,1/5] Add support for protobuf.
>   Patchwork 1870: http://patchwork.quagga.net/patch/1870
>[quagga-dev,14954,2/5] build: turn off automake portability warnings
>   Patchwork 1873: http://patchwork.quagga.net/patch/1873
>[quagga-dev,14957,3/5] Add protobuf support for FPM.
>   Patchwork 1874: http://patchwork.quagga.net/patch/1874
>[quagga-dev,14958,4/5] zebra: optionally use protobuf with FPM
>   Patchwork 1871: http://patchwork.quagga.net/patch/1871
>[quagga-dev,14955,5/5] doc: add blurb on use of protobuf with FPM
> Tested on top of Git : 86c5d2e (as of 20160315.231717 UTC)
> CI System Testrun URL: https://ci1.netdef.org/browse/QUAGGA-QPWORK-259/
>
>
> Get source and apply patch from patchwork: Successful
> 
>
> Building Stage: Failed
> 
> FreeBSD9 amd64 build: Successful
> CentOS7 amd64 build: Successful
> NetBSD6 amd64 build: Successful
> Ubuntu1404 amd64 build: Successful
> Debian8 amd64 build: Successful
> CentOS6 amd64 build: Successful
> Ubuntu1204 amd64 build: Successful
> FreeBSD10 amd64 build: Successful
> NetBSD7 amd64 build: Successful
> FreeBSD8 amd64 build: Successful
>
> Make failed for OmniOS amd64 build
>see log in attachment omnios_amd64_make.log
> Make failed for Openbsd58 amd64 build
>see log in attachment openbsd58_amd64_make.log
>
> Regards,
>   NetDEF/OpenSourceRouting Continous Integration (CI) System
>
> ---
> OpenSourceRouting.org is a project of the Network Device Education
> Foundation,
> For more information, see www.netdef.org and www.opensourcerouting.org
> For questions in regards to this CI System, contact Martin Winter,
> mwin...@netdef.org
>
___
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev

[quagga-dev 14959] CI Testresult: FAILED (Re: [quagga-dev, 14955, 5/5] doc: add blurb on use of protobuf with FPM)

2016-03-21 Thread cisystem
ction: router_zebra_cmd
From cli: "router zebra" to New cli: "router zebra"
Original Protocol: VTYSH_RIPD to New Protocol: VTYSH_RIPNGD
Duplicate CLI Function: no_router_zebra_cmd
From cli: "no router zebra" to New cli: "no router zebra"
Original Protocol: VTYSH_RIPD to New Protocol: VTYSH_RIPNGD
Duplicate CLI Function: match_interface_cmd
From cli: "match interface WORD" to New cli: "match interface WORD"
Original Protocol: VTYSH_RIPNGD to New Protocol: VTYSH_ZEBRA
Duplicate CLI Function: no_match_interface_cmd
From cli: "no match interface" to New cli: "no match interface"
Original Protocol: VTYSH_RIPNGD to New Protocol: VTYSH_ZEBRA
Duplicate CLI Function: no_match_interface_val_cmd
From cli: "no match interface WORD" to New cli: "no match interface 
WORD"
Original Protocol: VTYSH_RIPNGD to New Protocol: VTYSH_ZEBRA
Duplicate CLI Function: match_ip_next_hop_cmd
From cli: "match ip next-hop (<1-199>|<1300-2699>|WORD)" to New cli: 
"match ip next-hop (<1-199>|<1300-2699>|WORD)"
Original Protocol: VTYSH_RIPD to New Protocol: VTYSH_ZEBRA
Duplicate CLI Function: no_match_ip_next_hop_cmd
From cli: "no match ip next-hop" to New cli: "no match ip next-hop"
Original Protocol: VTYSH_RIPD to New Protocol: VTYSH_ZEBRA
Duplicate CLI Function: no_match_ip_next_hop_val_cmd
From cli: "no match ip next-hop (<1-199>|<1300-2699>|WORD)" to New cli: 
"no match ip next-hop (<1-199>|<1300-2699>|WORD)"
Original Protocol: VTYSH_RIPD to New Protocol: VTYSH_ZEBRA
Duplicate CLI Function: match_ip_next_hop_prefix_list_cmd
From cli: "match ip next-hop prefix-list WORD" to New cli: "match ip 
next-hop prefix-list WORD"
Original Protocol: VTYSH_RIPD to New Protocol: VTYSH_ZEBRA
Duplicate CLI Function: no_match_ip_next_hop_prefix_list_cmd
From cli: "no match ip next-hop prefix-list" to New cli: "no match ip 
next-hop prefix-list"
Original Protocol: VTYSH_RIPD to New Protocol: VTYSH_ZEBRA
Duplicate CLI Function: no_match_ip_next_hop_prefix_list_val_cmd
From cli: "no match ip next-hop prefix-list WORD" to New cli: "no match 
ip next-hop prefix-list WORD"
Original Protocol: VTYSH_RIPD to New Protocol: VTYSH_ZEBRA
Duplicate CLI Function: match_ip_address_cmd
From cli: "match ip address (<1-199>|<1300-2699>|WORD)" to New cli: 
"match ip address (<1-199>|<1300-2699>|WORD)"
Original Protocol: VTYSH_RIPD to New Protocol: VTYSH_ZEBRA
Duplicate CLI Function: no_match_ip_address_cmd
From cli: "no match ip address" to New cli: "no match ip address"
Original Protocol: VTYSH_RIPD to New Protocol: VTYSH_ZEBRA
Duplicate CLI Function: no_match_ip_address_val_cmd
From cli: "no match ip address (<1-199>|<1300-2699>|WORD)" to New cli: 
"no match ip address (<1-199>|<1300-2699>|WORD)"
Original Protocol: VTYSH_RIPD to New Protocol: VTYSH_ZEBRA
Duplicate CLI Function: match_ip_address_prefix_list_cmd
From cli: "match ip address prefix-list WORD" to New cli: "match ip 
address prefix-list WORD"
Original Protocol: VTYSH_RIPD to New Protocol: VTYSH_ZEBRA
Duplicate CLI Function: no_match_ip_address_prefix_list_cmd
From cli: "no match ip address prefix-list" to New cli: "no match ip 
address prefix-list"
Original Protocol: VTYSH_RIPD to New Protocol: VTYSH_ZEBRA
Duplicate CLI Function: no_match_ip_address_prefix_list_val_cmd
From cli: "no match ip address prefix-list WORD" to New cli: "no match 
ip address prefix-list WORD"
Original Protocol: VTYSH_RIPD to New Protocol: VTYSH_ZEBRA
  CC   vtysh_cmd.o
  CCLD vtysh
make[2]: Leaving directory `/export/home/ci/cibuild.259/quagga-source/vtysh'
Making all in ospfclient
make[2]: Entering directory 
`/export/home/ci/cibuild.259/quagga-source/ospfclient'
  CC   ospf_apiclient.lo
  CCLD libospfapiclient.la
ld: warning: file ../lib/.libs/libzebra.so: linked to 
/export/home/ci/cibuild.259/quagga-source/lib/.libs/libzebra.so: attempted 
multiple inclusion of file
  CC   ospfclient-ospfclient.o
  CCLD ospfclient
ld: warning: file ../ospfd/.libs/libospf.so: linked to 
/export/home/ci/cibuild.259/quagga-source/ospfd/.libs/libospf.so: attempted 
multiple inclusion of file
ld: warning: file ../lib/.libs/libzebra.so: linked to 
/export/home/ci/cibuild.259/quagga-source/lib/.libs/libzebra.so: attempted 
multiple inclusion of file
make[2]: Leaving directory 
`/export/home/ci/cibuild.259/quagga-source/ospfclient

[quagga-dev 14955] [PATCH 5/5] doc: add blurb on use of protobuf with FPM

2016-03-21 Thread Avneesh Sachdev
Add text about using protobuf as an alternative format for the FPM
interface.

Signed-off-by: Avneesh Sachdev 
---
 doc/main.texi | 28 ++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/main.texi b/doc/main.texi
index 4c11d24..f30d07c 100644
--- a/doc/main.texi
+++ b/doc/main.texi
@@ -346,8 +346,32 @@ routes that it may have picked up from the kernel. The 
existing
 interaction of zebra with the kernel remains unchanged -- that is, the
 kernel continues to receive FIB updates as before.
 
-The format of the messages exchanged with the FPM is defined by the
-file @file{fpm/fpm.h} in the quagga tree.
+The encapsulation header for the messages exchanged with the FPM is
+defined by the file @file{fpm/fpm.h} in the quagga tree. The routes
+themselves are encoded in netlink or protobuf format, with netlink
+being the default.
+
+Protobuf is one of a number of new serialization formats wherein the
+message schema is expressed in a purpose-built language. Code for
+encoding/decoding to/from the wire format is generated from the
+schema. Protobuf messages can be extended easily while maintaining
+backward-compatibility with older code. Protobuf has the following
+advantages over netlink:
+
+@itemize
+@item
+Code for serialization/deserialization is generated
+automatically. This reduces the likelihood of bugs, allows third-party
+programs to be integrated quickly, and makes it easy to add fields.
+@item
+The message format is not tied to an OS (Linux), and can be evolved
+independently.
+@end itemize
+
+As mentioned before, zebra encodes routes sent to the FPM in netlink
+format by default. The format can be controlled via the
+@code{--fpm_format} command-line option to zebra, which currently
+takes the values @code{netlink} and @code{protobuf}.
 
 The zebra FPM interface uses replace semantics. That is, if a 'route
 add' message for a prefix is followed by another 'route add' message,
-- 
1.9.1


___
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev


[quagga-dev 14956] [PATCH 1/5] Add support for protobuf.

2016-03-21 Thread Avneesh Sachdev
Infrastructure that allows protocol buffers to be used in Quagga. The
changes below comprise of:

  - Build hooks

  - Protobuf definitions for common types.

  - Library routines for working with protobuf, including functions
that help translate between common quagga types and their protobuf
equivalents.

Changes:

  * qpb/{Makefile.am,README.txt,qpb.h,.gitignore}

Add the qpb library, which provides shared code and definitions
for using protocol buffers in quagga code.

  * qpb/qpb.proto

Protobuf definitions that can be shared by all of quagga.

  * qpb/linear_allocator.h

An allocator that allocates memory by walking down towards the end
of a buffer. This is used to cheaply allocate/deallocate memory on
the stack for protobuf operations.

  * qpb/qpb_allocator.[ch]

Thin layer that allows a linear allocator to be used with the
protobuf-c library.

  * common.am

This is an automake fragment that is intended to be shared by
Makefile.am files in the tree. It currently includes definitions
related to protobuf.

  * configure.ac

- Add logic to optionally build protobuf code.

  By default, protobuf support is enabled if the protobuf C
  compiler (protoc-c) is available, and the associated header
  files/library can be found.

  The user can choose to override this behavior via the new
  --disable-protobuf/--enable-protobuf flags.

- Include the quagga protobuf library (qpb) in the build.

  * .gitignore

Ignore source code generated by protobuf compiler.

  * Makefile.am

Add 'qpb' to the list of subdirectories.

Signed-off-by: Avneesh Sachdev 
---
 .gitignore |   3 +
 Makefile.am|   4 +-
 common.am  |  39 ++
 configure.ac   |  47 ++-
 qpb/.gitignore |  15 ++
 qpb/Makefile.am|  29 
 qpb/README.txt |   1 +
 qpb/linear_allocator.h | 207 +++
 qpb/qpb.h  | 372 +
 qpb/qpb.proto  | 121 
 qpb/qpb_allocator.c|  67 +
 qpb/qpb_allocator.h| 113 +++
 12 files changed, 1015 insertions(+), 3 deletions(-)
 create mode 100644 common.am
 create mode 100644 qpb/.gitignore
 create mode 100644 qpb/Makefile.am
 create mode 100644 qpb/README.txt
 create mode 100644 qpb/linear_allocator.h
 create mode 100644 qpb/qpb.h
 create mode 100644 qpb/qpb.proto
 create mode 100644 qpb/qpb_allocator.c
 create mode 100644 qpb/qpb_allocator.h

diff --git a/.gitignore b/.gitignore
index e8de252..a281555 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,3 +38,6 @@ build
 m4/*.m4
 !m4/ax_sys_weak_alias.m4
 cscope.*
+*.pb.h
+*.pb-c.h
+*.pb-c.c
diff --git a/Makefile.am b/Makefile.am
index d2efb20..87ba3d0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,10 +1,10 @@
 ## Process this file with automake to produce Makefile.in.
 
-SUBDIRS = lib @ZEBRA@ @BGPD@ @RIPD@ @RIPNGD@ @OSPFD@ @OSPF6D@ \
+SUBDIRS = lib qpb @ZEBRA@ @BGPD@ @RIPD@ @RIPNGD@ @OSPFD@ @OSPF6D@ \
  @ISISD@ @PIMD@ @WATCHQUAGGA@ @VTYSH@ @OSPFCLIENT@ @DOC@ m4 
@pkgsrcdir@ \
  redhat @SOLARIS@ tests
 
-DIST_SUBDIRS = lib zebra bgpd ripd ripngd ospfd ospf6d \
+DIST_SUBDIRS = lib qpb zebra bgpd ripd ripngd ospfd ospf6d \
  isisd watchquagga vtysh ospfclient doc m4 pkgsrc redhat tests \
  solaris pimd
 
diff --git a/common.am b/common.am
new file mode 100644
index 000..dc79479
--- /dev/null
+++ b/common.am
@@ -0,0 +1,39 @@
+#
+# Automake fragment intended to be shared by Makefile.am files in the
+# tree.
+#
+
+if HAVE_PROTOBUF
+
+# Uncomment to use an non-system version of libprotobuf-c.
+#
+# Q_PROTOBUF_C_CLIENT_INCLUDES = -I$(top_srcdir)/third-party/protobuf-c/src
+# Q_PROTOBUF_C_CLIENT_LDOPTS = 
$(top_builddir)/third-party/protobuf-c/src/libprotobuf-c.la
+
+Q_PROTOBUF_C_CLIENT_INCLUDES=
+Q_PROTOBUF_C_CLIENT_LDOPTS=-lprotobuf-c
+
+Q_PROTOC=protoc
+Q_PROTOC_C=protoc-c
+
+Q_PROTOBUF_CFILES = $(filter %.pb-c.c,$(SOURCES))
+
+Q_PROTOBUF_SRCS = $(Q_PROTOBUF_CFILES) $(Q_PROTOBUF_HFILES)
+
+# Rules
+%.pb.h: %.proto
+   $(Q_PROTOC) $(PROTOBUF_INCLUDES) --cpp_out=$(top_srcdir) 
$(top_srcdir)/$(PROTOBUF_PACKAGE)/$^
+
+%.pb-c.c %.pb-c.h: %.proto
+   $(Q_PROTOC_C) $(PROTOBUF_INCLUDES) --c_out=$(top_srcdir) 
$(top_srcdir)/$(PROTOBUF_PACKAGE)/$^
+
+#
+# Information about how to link to various libraries.
+#
+Q_QUAGGA_PB_CLIENT_LDOPTS = $(top_srcdir)/qpb/libquagga_pb.la 
$(Q_PROTOBUF_C_CLIENT_LDOPTS)
+
+endif  # HAVE_PROTOBUF
+
+Q_CLEANFILES = $(Q_PROTOBUF_SRCS)
+
+Q_BUILT_SRCS = $(Q_PROTOBUF_SRCS)
diff --git a/configure.ac b/configure.ac
index 3003e62..12d7793 100755
--- a/configure.ac
+++ b/configure.ac
@@ -302,6 +302,8 @@ AC_ARG_ENABLE(fpm,
   AS_HELP_STRING([--enable-fpm], [enable Forwarding Plane Manager support]))
 AC_ARG_ENABLE(werror,
   AS_HELP_STRING([--enable-werror], [enable -Werror (recommended for 
developers only)]))
+AC_ARG_ENABLE([protobuf],
+A

[quagga-dev 14958] [PATCH 4/5] zebra: optionally use protobuf with FPM

2016-03-21 Thread Avneesh Sachdev
Change zebra so that it can optionally use protobuf serialization when
communicating with a Forwarding Plane Manager component.

  * zebra/main.c

Add the --fpm-format/-F command line option. This allows the user
to control the format (protbuf|netlink) that is used to
communicate with the FPM.

  * zebra/zebra_fpm.c

- zebra_init_msg_format(),

  This new function is invoked on process startup to determine the
  FPM format that should be used.

- zfpm_init()

  Change to accept any 'FPM message format' specified by the user
  (via the new command line flag).

- zebra_encode_route()

  Tweak to use the selected FPM format.

  * zebra_fpm_protobuf.c

New code to build protobuf messages to be sent to the FPM.

  * zebra/Makefile.am

- Include common.am

- Build new file zebra_fpm_protobuf.c when protobuf is available.

- Link with the fpm_pb library.

Signed-off-by: Avneesh Sachdev 
---
 zebra/Makefile.am  |  10 +-
 zebra/main.c   |  14 +-
 zebra/zebra_fpm.c  | 139 +---
 zebra/zebra_fpm.h  |   3 +-
 zebra/zebra_fpm_private.h  |   5 +
 zebra/zebra_fpm_protobuf.c | 311 +
 6 files changed, 454 insertions(+), 28 deletions(-)
 create mode 100644 zebra/zebra_fpm_protobuf.c

diff --git a/zebra/Makefile.am b/zebra/Makefile.am
index 96dc6f0..f3265b1 100644
--- a/zebra/Makefile.am
+++ b/zebra/Makefile.am
@@ -1,3 +1,5 @@
+include ../common.am
+
 ## Process this file with automake to produce Makefile.in.
 
 AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
@@ -20,6 +22,10 @@ if HAVE_NETLINK
 othersrc = zebra_fpm_netlink.c
 endif
 
+if HAVE_PROTOBUF
+protobuf_srcs = zebra_fpm_protobuf.c
+endif
+
 AM_CFLAGS = $(WERROR)
 
 sbin_PROGRAMS = zebra
@@ -30,7 +36,7 @@ zebra_SOURCES = \
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)
+   $(othersrc) $(protobuf_srcs)
 
 testzebra_SOURCES = test_main.c zebra_rib.c interface.c connected.c debug.c \
zebra_vty.c \
@@ -42,7 +48,7 @@ noinst_HEADERS = \
rt_netlink.h zebra_fpm.h zebra_fpm_private.h \
ioctl_solaris.h
 
-zebra_LDADD = $(otherobj) ../lib/libzebra.la $(LIBCAP)
+zebra_LDADD = $(otherobj) ../lib/libzebra.la $(LIBCAP) 
$(Q_FPM_PB_CLIENT_LDOPTS)
 
 testzebra_LDADD = ../lib/libzebra.la $(LIBCAP)
 
diff --git a/zebra/main.c b/zebra/main.c
index f3c08f1..9a34b04 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -71,6 +71,7 @@ struct option longopts[] =
   { "batch",   no_argument,   NULL, 'b'},
   { "daemon",  no_argument,   NULL, 'd'},
   { "keep_kernel", no_argument,   NULL, 'k'},
+  { "fpm_format",  required_argument, NULL, 'F'},
   { "config_file", required_argument, NULL, 'f'},
   { "pid_file",required_argument, NULL, 'i'},
   { "socket",  required_argument, NULL, 'z'},
@@ -130,6 +131,7 @@ usage (char *progname, int status)
  "-b, --batchRuns in batch mode\n"\
  "-d, --daemon   Runs in daemon mode\n"\
  "-f, --config_file  Set configuration file name\n"\
+ "-F, --fpm_format   Set fpm format to 'netlink' or 'protobuf'\n"\
  "-i, --pid_file Set process identifier file name\n"\
  "-z, --socket   Set path of zebra socket\n"\
  "-k, --keep_kernel  Don't delete old routes which installed by "\
@@ -295,6 +297,7 @@ main (int argc, char **argv)
   char *progname;
   struct thread thread;
   char *zserv_path = NULL;
+  char *fpm_format = NULL;
 
   /* Set umask before anything for security */
   umask (0027);
@@ -310,9 +313,9 @@ main (int argc, char **argv)
   int opt;
   
 #ifdef HAVE_NETLINK  
-  opt = getopt_long (argc, argv, "bdkf:i:z:hA:P:ru:g:vs:C", longopts, 0);
+  opt = getopt_long (argc, argv, "bdkf:F:i:z:hA:P:ru:g:vs:C", longopts, 0);
 #else
-  opt = getopt_long (argc, argv, "bdkf:i:z:hA:P:ru:g:vC", longopts, 0);
+  opt = getopt_long (argc, argv, "bdkf:F:i:z:hA:P:ru:g:vC", longopts, 0);
 #endif /* HAVE_NETLINK */
 
   if (opt == EOF)
@@ -336,6 +339,9 @@ main (int argc, char **argv)
case 'f':
  config_file = optarg;
  break;
+   case 'F':
+ fpm_format = optarg;
+ break;
case 'A':
  vty_addr = optarg;
  break;
@@ -423,9 +429,9 @@ main (int argc, char **argv)
 #endif /* HAVE_SNMP */
 
 #ifdef HAVE_FPM
-  zfpm_init (zebrad.master, 1, 0);
+  zfpm_init (zebrad.master, 1, 0, fpm_format);
 #else
-  zfpm_init (zebrad.master, 0, 0);
+  zfpm_init (zebrad.master, 0, 0, fpm_format);
 #endif
 
   /* Process the configuration file. Among other configuration
diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c
index 292dbb6..f788df5 100644
--- a/zebra/zebra_fpm.c
+++ b/zebra/zebra_f

[quagga-dev 14957] [PATCH 3/5] Add protobuf support for FPM.

2016-03-21 Thread Avneesh Sachdev
Code that allows a client to convey routes to a Forwarding Plane
Manager component using protobuf instead of netlink..

  * fpm/fpm.proto

Protobuf definitions pertaining to the Forwarding Plane Manager.
In particular, this file defines the AddRoute and DeleteRoute
messages.

  * fpm/fpm.h

Tweak FPM message header definition to also allow messages to be
encoded in protobuf format.

  * fpm/{fpm_pb.h,.gitignore,.Makefile.am}

Add the fpm_pb library, which contains code for interfacing with
the FPM using protobuf.

  * configure.ac

Generate fpm/Makefile.

  * Makefile.am

Add fpm subdirectory to build.

  * common.am

Add flags to be used by clients of the fpm_pb library.

Signed-off-by: Avneesh Sachdev 
---
 Makefile.am |   7 ++--
 common.am   |   2 +
 configure.ac|   1 +
 fpm/.gitignore  |  15 +++
 fpm/Makefile.am |  28 +
 fpm/fpm.h   |  38 ++
 fpm/fpm.proto   | 119 
 fpm/fpm_pb.h|  63 ++
 8 files changed, 261 insertions(+), 12 deletions(-)
 create mode 100644 fpm/.gitignore
 create mode 100644 fpm/Makefile.am
 create mode 100644 fpm/fpm.proto
 create mode 100644 fpm/fpm_pb.h

diff --git a/Makefile.am b/Makefile.am
index 87ba3d0..0cd75be 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,10 +1,10 @@
 ## Process this file with automake to produce Makefile.in.
 
-SUBDIRS = lib qpb @ZEBRA@ @BGPD@ @RIPD@ @RIPNGD@ @OSPFD@ @OSPF6D@ \
+SUBDIRS = lib qpb fpm @ZEBRA@ @BGPD@ @RIPD@ @RIPNGD@ @OSPFD@ @OSPF6D@ \
  @ISISD@ @PIMD@ @WATCHQUAGGA@ @VTYSH@ @OSPFCLIENT@ @DOC@ m4 
@pkgsrcdir@ \
  redhat @SOLARIS@ tests
 
-DIST_SUBDIRS = lib qpb zebra bgpd ripd ripngd ospfd ospf6d \
+DIST_SUBDIRS = lib qpb fpm zebra bgpd ripd ripngd ospfd ospf6d \
  isisd watchquagga vtysh ospfclient doc m4 pkgsrc redhat tests \
  solaris pimd
 
@@ -12,8 +12,7 @@ EXTRA_DIST = aclocal.m4 SERVICES TODO REPORTING-BUGS 
INSTALL.quagga.txt \
update-autotools \
vtysh/Makefile.in vtysh/Makefile.am \
tools/rrcheck.pl tools/rrlookup.pl tools/zc.pl \
-   tools/zebra.el tools/multiple-bgpd.sh \
-   fpm/fpm.h
+   tools/zebra.el tools/multiple-bgpd.sh
 
 if HAVE_LATEX
 
diff --git a/common.am b/common.am
index dc79479..ac7a323 100644
--- a/common.am
+++ b/common.am
@@ -32,6 +32,8 @@ Q_PROTOBUF_SRCS = $(Q_PROTOBUF_CFILES) $(Q_PROTOBUF_HFILES)
 #
 Q_QUAGGA_PB_CLIENT_LDOPTS = $(top_srcdir)/qpb/libquagga_pb.la 
$(Q_PROTOBUF_C_CLIENT_LDOPTS)
 
+Q_FPM_PB_CLIENT_LDOPTS = $(top_srcdir)/fpm/libfpm_pb.la 
$(Q_QUAGGA_PB_CLIENT_LDOPTS)
+
 endif  # HAVE_PROTOBUF
 
 Q_CLEANFILES = $(Q_PROTOBUF_SRCS)
diff --git a/configure.ac b/configure.ac
index 51be70a..d2091d0 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1604,6 +1604,7 @@ AC_CONFIG_FILES([Makefile lib/Makefile qpb/Makefile 
zebra/Makefile ripd/Makefile
  tests/libzebra.tests/Makefile
  redhat/Makefile
  pkgsrc/Makefile
+ fpm/Makefile
  redhat/quagga.spec 
  lib/version.h
  doc/defines.texi
diff --git a/fpm/.gitignore b/fpm/.gitignore
new file mode 100644
index 000..b133c52
--- /dev/null
+++ b/fpm/.gitignore
@@ -0,0 +1,15 @@
+Makefile
+Makefile.in
+*.o
+tags
+TAGS
+.deps
+.nfs*
+*.lo
+*.la
+*.a
+*.libs
+.arch-inventory
+.arch-ids
+*~
+*.loT
diff --git a/fpm/Makefile.am b/fpm/Makefile.am
new file mode 100644
index 000..849b87f
--- /dev/null
+++ b/fpm/Makefile.am
@@ -0,0 +1,28 @@
+include ../common.am
+
+AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib 
$(Q_PROTOBUF_C_CLIENT_INCLUDES)
+
+PROTOBUF_INCLUDES=-I$(top_srcdir)
+PROTOBUF_PACKAGE = fpm
+
+lib_LTLIBRARIES = libfpm_pb.la
+libfpm_pb_la_LDFLAGS = -version-info 0:0:0
+
+if HAVE_PROTOBUF
+protobuf_srcs =
+
+protobuf_srcs_nodist = \
+   fpm.pb-c.c
+endif
+
+libfpm_pb_la_SOURCES = \
+   fpm.h   \
+   fpm_pb.h\
+   $(protobuf_srcs)
+
+nodist_libfpm_pb_la_SOURCES = $(protobuf_srcs_nodist)
+
+CLEANFILES = $(Q_CLEANFILES)
+
+BUILT_SOURCES = $(Q_PROTOBUF_SRCS)
+EXTRA_DIST = fpm.proto
diff --git a/fpm/fpm.h b/fpm/fpm.h
index 96f05f4..6ffe37b 100644
--- a/fpm/fpm.h
+++ b/fpm/fpm.h
@@ -94,6 +94,10 @@
  */
 #define FPM_MAX_MSG_LEN 4096
 
+#ifdef __SUNPRO_C
+#pragma pack(1)
+#endif
+
 /*
  * Header that precedes each fpm message to/from the FPM.
  */
@@ -112,13 +116,13 @@ typedef struct fpm_msg_hdr_t_
   /*
* Length of entire message, including the header, in network byte
* order.
-   *
-   * Note that msg_len is rounded up to make sure that message is at
-   * the desired alignment. This means that some payloads may need
-   * padding at the end.
*/
   uint16_t msg_len;
-} fpm_msg_hdr_t;
+} __attribute__ ((packed)) fpm_msg_hdr_t;
+
+#ifdef __SUNPRO_C
+#pragma pack()
+#endif
 
 /*
  * The current version of th

[quagga-dev 14953] [PATCH 0/5] Protobuf support, and protobuf as FPM format [Take 2]

2016-03-21 Thread Avneesh Sachdev
Hi,

This is take 2 of a patch set related to use of protobuf as a
messaging/serialization format. The original patch set is:

  https://lists.quagga.net/pipermail/quagga-dev/2016-March/014964.html

Changes since the last submission:

  - Fix 'make dist' and build issues on OpenBSD.

  - Replace references to 'GNU Zebra' with 'Quagga'.

  - Remove HAVE_IPV6 ifdefs.

  - Break out automake warning tweak into a separate patch.

  - Add some text to documentation comparing protobuf with netlink.

  - Omit vtysh "invoke" patches.

Here is a quick overview of the salient patches:

  - Patch 1

Infrastructure for using protobuf in quagga. This includes
build-related changes, protobuf definitions for common quagga
types and a library of routines to convert between quagga and
protobuf types.

  - Patches 3 & 4

These patches modify zebra to optionally use protobuf as the
message format over the FPM interface. The netlink format is still
supported and remains the default.

Note that the code that defines the message format between zebra and
FPM is dual-licensed as before (choice between GPLv2 and ISC). For
protobuf, this includes the definitions in qpb/qpb.proto and
fpm.proto.

Please let me know if you have any questions about this work.

Thanks,
Avneesh

Avneesh Sachdev (5):
  Add support for protobuf.
  build: turn off automake portability warnings
  Add protobuf support for FPM.
  zebra: optionally use protobuf with FPM
  doc: add blurb on use of protobuf with FPM

 .gitignore |   3 +
 Makefile.am|   7 +-
 common.am  |  41 +
 configure.ac   |  53 ++-
 doc/main.texi  |  28 +++-
 fpm/.gitignore |  15 ++
 fpm/Makefile.am|  28 
 fpm/fpm.h  |  38 -
 fpm/fpm.proto  | 119 +++
 fpm/fpm_pb.h   |  63 
 qpb/.gitignore |  15 ++
 qpb/Makefile.am|  29 
 qpb/README.txt |   1 +
 qpb/linear_allocator.h | 207 +
 qpb/qpb.h  | 372 +
 qpb/qpb.proto  | 121 +++
 qpb/qpb_allocator.c|  67 
 qpb/qpb_allocator.h| 113 ++
 zebra/Makefile.am  |  10 +-
 zebra/main.c   |  14 +-
 zebra/zebra_fpm.c  | 139 ++---
 zebra/zebra_fpm.h  |   3 +-
 zebra/zebra_fpm_private.h  |   5 +
 zebra/zebra_fpm_protobuf.c | 311 +
 24 files changed, 1758 insertions(+), 44 deletions(-)
 create mode 100644 common.am
 create mode 100644 fpm/.gitignore
 create mode 100644 fpm/Makefile.am
 create mode 100644 fpm/fpm.proto
 create mode 100644 fpm/fpm_pb.h
 create mode 100644 qpb/.gitignore
 create mode 100644 qpb/Makefile.am
 create mode 100644 qpb/README.txt
 create mode 100644 qpb/linear_allocator.h
 create mode 100644 qpb/qpb.h
 create mode 100644 qpb/qpb.proto
 create mode 100644 qpb/qpb_allocator.c
 create mode 100644 qpb/qpb_allocator.h
 create mode 100644 zebra/zebra_fpm_protobuf.c

-- 
1.9.1


___
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev


[quagga-dev 14954] [PATCH 2/5] build: turn off automake portability warnings

2016-03-21 Thread Avneesh Sachdev
Modify configure.ac to disable portability warnings for automake --
our automake code (in particular common.am) uses some constructs
specific to gmake.

Signed-off-by: Avneesh Sachdev 
---
 configure.ac | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 12d7793..51be70a 100755
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,10 @@ AC_CANONICAL_BUILD()
 AC_CANONICAL_HOST()
 AC_CANONICAL_TARGET()
 
-AM_INIT_AUTOMAKE(1.6)
+# Disable portability warnings -- our automake code (in particular
+# common.am) uses some constructs specific to gmake.
+AM_INIT_AUTOMAKE([1.6 -Wno-portability])
+
 AM_SILENT_RULES([yes])
 AC_CONFIG_HEADERS(config.h)
 
-- 
1.9.1


___
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev


[quagga-dev 14952] IPv6 BGP default route ignored when using SLAAC

2016-03-21 Thread gall
I've been using quagga for a long time to implement router-style
"loopback" addresses on multi-homed hosts, i.e. I configure a /128 on
the lo device and announce it via BGP.  The host receives a default
route ::/0 and I use BGP policies to select which interface to prefer
for outbound traffic.  At the same time, the host uses SLAAC to
set up a default route on each interface as a fallback.

Here is an example using Quagga 0.99.22.4 on Linux 3.2.0 which works
as desired:

$ ip -6 r l | grep default
default via fe80::2a94:fff:fefd:5bc0 dev eth2  proto zebra  metric 10 
default via fe80::2a94:fff:fefd:5bc0 dev eth0  proto kernel  metric 1024  
expires 1794sec hoplimit 64
default via fe80::2a94:fff:fefd:5bc0 dev eth2  proto kernel  metric 1024  
expires 1783sec hoplimit 64
default via fe80::2a94:fff:fefd:4940 dev eth3  proto kernel  metric 1024  
expires 1676sec hoplimit 64
default via fe80::2a94:fff:fefd:4940 dev eth1  proto kernel  metric 1024  
expires 1794sec hoplimit 64

zebrad> sh ipv6 ro 
Codes: K - kernel route, C - connected, S - static, R - RIPng,
   O - OSPFv6, I - IS-IS, B - BGP, A - Babel,
   > - selected route, * - FIB route

B>* ::/0 [20/10] via fe80::2a94:fff:fefd:5bc0, eth2, 03w3d01h
C>* ::1/128 is directly connected, lo
C>* 2001:620::1a/128 is directly connected, lo
C>* 2001:620:0:ff::3/128 is directly connected, lo
C>* 2001:620:0:800c::/64 is directly connected, eth0
C>* 2001:620:0:800d::/64 is directly connected, eth2
C>* 2001:620:0:800e::/64 is directly connected, eth1
C>* 2001:620:0:800f::/64 is directly connected, eth3
C * fe80::/64 is directly connected, eth3
C * fe80::/64 is directly connected, eth1
C * fe80::/64 is directly connected, eth2
C>* fe80::/64 is directly connected, eth0
zebrad> sh ipv6 ro ::/0
Routing entry for ::/0
  Known via "bgp", distance 20, metric 10, best
  Last update 03w3d01h ago
  * fe80::2a94:fff:fefd:5bc0, via eth2

The BGP route is installed in the kernel with metric 10 as expected.
If the host looses its BGP peers, it still has the default routes via
SLAAC.

On another system running Quagga 0.99.23.1 and Linux 3.16.0, the BGP
route doesn't get installed:

$ ip -6 r l | grep default
default via fe80::207:7dff:fe76:5980 dev eth0  proto ra  metric 1024  expires 
1631sec hoplimit 64
default via fe80::207:7dff:fe76:5940 dev eth4  proto ra  metric 1024  expires 
1709sec hoplimit 64

zebrad> sh ipv6 ro
Codes: K - kernel route, C - connected, S - static, R - RIPng,
   O - OSPFv6, I - IS-IS, B - BGP, A - Babel,
   > - selected route, * - FIB route

B   ::/0 [20/1] via fe80::207:7dff:fe76:5940, eth4, 04w3d23h
K>* ::/0 via fe80::207:7dff:fe76:5940, eth4
C>* ::1/128 is directly connected, lo
C>* 2001:620::10/128 is directly connected, lo
C>* 2001:620:0:8018::/64 is directly connected, eth0
C>* 2001:620:0:8019::/64 is directly connected, eth4
C * fe80::/64 is directly connected, eth4
C>* fe80::/64 is directly connected, eth0
zebrad> sh ipv6 ro ::/0
Routing entry for ::/0
  Known via "bgp", distance 20, metric 1
  Last update 04w3d23h ago
fe80::207:7dff:fe76:5940, via eth4

Routing entry for ::/0
  Known via "kernel", distance 0, metric 1024, best
  * fe80::207:7dff:fe76:5940, via eth4

The difference is that zebrad now picks up one of the default routes
from SLAAC with an administrative distance of 0, which makes it
impossible to override with BGP.

The obvious difference is that the 3.16 kernel uses proto "ra" instead
of proto "kernel" for the routes learned via SLAAC (i don't know in
which kernel version this started to happen).  I'm totally unfamiliar
with the Quagga code, but a glance at
zebra/rt_netlink.c:netlink_routing_table() seems to suggest that
routes of type "kernel" are always ignored due to

  if (rtm->rtm_protocol == RTPROT_KERNEL)
return 0;

Since the routes in question are now using proto "ra", they are no
longer ignored, hence the different behaviour of zebrad.

So, my question is whether this is really how it's supposed to be.  If
so, how can I override it?  I do believe that I should be able to do
that.  If it's a bug, maybe routes of type RTPROT_RA should be ignored
as well?

--
Alex

___
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev