Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gRPC northbound plugin #4082

Merged
merged 3 commits into from
May 7, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
lib: add new gRPC-based northbound plugin
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
commit ec2ac5f28a83c39b2df02279482494129ddaea28
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will it be possible to compile frr with C-only ?
I mean, I expect no implicit dependency with C compiler

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. The autoconf documentation says that AC_PROG_CXX will set CXX to g++ if it fails to find a C++ compiler, without returning an error. This means a C++ compiler won't be required to build FRR (except if you want to build the gRPC module).

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