Skip to content

Commit

Permalink
lib: add new gRPC-based northbound plugin
Browse files Browse the repository at this point in the history
This is an experimental plugin for now. Full documentation will
come later.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
  • Loading branch information
rwestphal committed Apr 26, 2019
1 parent 8398113 commit ec2ac5f
Show file tree
Hide file tree
Showing 12 changed files with 1,438 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
*.pb.h
*.pb-c.h
*.pb-c.c
*.pb.cc
*_clippy.c

### dist
Expand Down
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ include zebra/subdir.am
include watchfrr/subdir.am
include qpb/subdir.am
include fpm/subdir.am
include grpc/subdir.am
include tools/subdir.am
include solaris/subdir.am

Expand Down Expand Up @@ -198,6 +199,7 @@ EXTRA_DIST += \
doc/user/Makefile \
eigrpd/Makefile \
fpm/Makefile \
grpc/Makefile \
isisd/Makefile \
ldpd/Makefile \
lib/Makefile \
Expand Down
24 changes: 24 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,15 @@ dnl Check CC and friends
dnl --------------------
dnl note orig_cflags is also used further down
orig_cflags="$CFLAGS"
orig_cxxflags="$CXXFLAGS"
AC_LANG([C])
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AM_PROG_CC_C_O
dnl remove autoconf default "-g -O2"
CFLAGS="$orig_cflags"
CXXFLAGS="$orig_cxxflags"
AC_PROG_CC_C99
dnl NB: see C11 below

Expand Down Expand Up @@ -447,6 +450,8 @@ AC_ARG_ENABLE([confd],
AS_HELP_STRING([--enable-confd=ARG], [enable confd integration]))
AC_ARG_ENABLE([sysrepo],
AS_HELP_STRING([--enable-sysrepo], [enable sysrepo integration]))
AC_ARG_ENABLE([grpc],
AS_HELP_STRING([--enable-grpc], [enable the gRPC northbound plugin]))
AC_ARG_ENABLE([zeromq],
AS_HELP_STRING([--enable-zeromq], [enable ZeroMQ handler (libfrrzmq)]))
AC_ARG_WITH([libpam],
Expand Down Expand Up @@ -1678,6 +1683,25 @@ if test "$enable_sysrepo" = "yes"; then
fi
AM_CONDITIONAL([SYSREPO], [test "x$enable_sysrepo" = "xyes"])

dnl ---------------
dnl gRPC
dnl ---------------
if test "$enable_grpc" = "yes"; then
PKG_CHECK_MODULES([GRPC], [grpc grpc++ protobuf], [
AC_CHECK_PROGS([PROTOC], [protoc], [/bin/false])
if test "$PROTOC" = "/bin/false"; then
AC_MSG_FAILURE([grpc requested but protoc not found.])
fi
AC_DEFINE([HAVE_GRPC], [1], [Enable the gRPC northbound plugin])
GRPC=true
], [
GRPC=false
AC_MSG_ERROR([grpc/grpc++ were not found on your system.])
])
fi
AM_CONDITIONAL([GRPC], [test "x$enable_grpc" = "xyes"])

dnl ---------------
dnl math
dnl ---------------
Expand Down
10 changes: 10 additions & 0 deletions grpc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
all: ALWAYS
@$(MAKE) -s -C .. grpc/libfrrgrpc_pb.la
%: ALWAYS
@$(MAKE) -s -C .. grpc/$@

Makefile:
#nothing
ALWAYS:
.PHONY: ALWAYS makefiles
.SUFFIXES:
Loading

0 comments on commit ec2ac5f

Please sign in to comment.