-
Notifications
You must be signed in to change notification settings - Fork 715
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
api: Define protobuf structures of BGP NLRI and Path Attributes #1729
api: Define protobuf structures of BGP NLRI and Path Attributes #1729
Conversation
Great, can you add some tests of grpc with this new API? I'm thinking about using gogo/protobuf but concern of Any type a bit. |
I think this change would be great. One thing to consider would be taking this opportunity to remove the |
"gobgp/lib" can be independent from "gobgpapi" package, this patch removes the usage of utility function "ToPathApi()" in this package. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Example of protoc command: $ export PROTOBUF=${HOME}/protobuf/src $ export GOBGP=${GOPATH}/src/github.com/osrg/gobgp $ protoc \ -I ${PROTOBUF} \ -I ${GOBGP}/api \ --go_out=plugins=grpc:${GOBGP}/api \ ${GOBGP}/api/gobgp.proto \ ${GOBGP}/api/attribute.proto Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
I guess that we are on the same page. Once I push this pr, I want to make api/ include only code to access to the gRPC APIs and handy functions to handle the protobuf structures. That should remove lots of dependencies. I want to move grpc_server.go and util.go to somewhere else. Then I want to remove client/ and rewrite gobgp/*.go to use only api/. |
810d543
to
0ca90f7
Compare
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
0ca90f7
to
417f8ba
Compare
I've updated to move |
Thanks a lot, pushed. I think that it's better to remove the usage of logrus and just return an error. I'll take care of such minor issues. |
Currently, the gRPC client need to serialize the NLRI and Path Attributes into bytes representation when calling AddPath gRPC API, but this requires the client side applications have the implementation to encode/decode the BGP attributes. Then it can be difficult to implement gRPC client with the languages other than Go.
This PR defines the protobuf structures of BGP NLRI and Path Attributes and enable to call AddPath API with these structures.
For the discussion about this improvements and sample code of gRPC client written in Python, see #1457.