Skip to content

Commit f076303

Browse files
committed
update docs for public release
1 parent 7b460a4 commit f076303

File tree

72 files changed

+7992
-23963
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+7992
-23963
lines changed

Diff for: .gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
polycube-grpc-cpp/build/*
2-
examples/cpp/pcn-helloworld2/build/*
2+
examples/cpp/pcn-helloworldcpp/build/*
33
.vscode/*
44
examples/go/pcn-helloworldgo/helloworldgo
55
examples/go/pcn-transparenthelloworldgo/transparenthelloworldgo
66
examples/go/skeleton-project/skeleton
7-
bash_tests/*
7+
bash_tests/*

Diff for: README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# polycube-grpc-service-libraries
2-
GRPC libraries to allow the writing of a stand-alone Polycube service also in other languages
2+
GRPC libraries to allow the writing of a stand-alone Polycube service also in other languages. If you want to use it you need to use my [Polycube fork](https://github.com/pinoOgni/polycube) because I haven't had a chance to merge the code into the main repo yet.
33

4+
# Current Status
5+
6+
**WARNING**: I'm no longer active in the development of polycube-grpc-service-libraries an probably some documentation and some comments are missing. I still hope there is enough.
7+
8+
9+
# Repository organization
410

511
This repository contains the client side grpc libraries to interface with Polycube and is composed as follows:
612

Diff for: examples/cpp/pcn-helloworld2/README.md

-44
This file was deleted.

Diff for: examples/cpp/pcn-helloworld2/CMakeLists.txt renamed to examples/cpp/pcn-helloworldcpp/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.5.1)
2-
project (pcn-helloworld2)
2+
project (pcn-helloworldcpp)
33
include(cmake/common.cmake)
44

55
add_subdirectory(src)

Diff for: examples/cpp/pcn-helloworldcpp/README.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
This is the first example of a grpc C++ service. Within this directory there are various types of files and directories.
2+
3+
Directory:
4+
* cmake: contains the cmake useful for building the service
5+
* datamodel: contains the yang of the service (FOR NOW NOT USED)
6+
* src: Contains all the helloworld 1.0 service code and other files that make up the grpc service. Of all the files contained here, only the following are used:
7+
* helloworldcpp_client.cc represents the CONTROLPLANE. Here is the main of the service and a few things need to be done to get everything to work:
8+
* PolycubeClient polycubeclientgrpc; in this way we can use the methods of the polycube-grpc library (C++)
9+
* use the RegisterHandlerHTTPVERB methods to associate the controlplane methods to a url
10+
* launch the ReadTheStream method of the polycube-grpc library in a thread
11+
* join the newly launched thread
12+
* helloworldcpp_client.h represents the CONTROLPLANE.
13+
* Here there is not only the prototype of the method but also the implementation. Each method that is implemented here and that needs to contact Polycube for its work, will have to make a call to a suitable method of the polycube-grpc library.
14+
* For example, the Helloworld setAction method is used to set an action in the DATAPLANE that is to set a value in an eBPF map, this is reduced to calling the TableSet method with appropriate parameters.
15+
* Note that there is also the create_cube method which is used to create a cube
16+
* IMPORTANT: here, the developer will be able to decide the logic with which to manage the relationship between service and cube, so for example manage the cubes with IDs and have a vector of cubes or similar
17+
* IMPORTANT: here, the developer must also manage the logic of the ports, obviously if the service has the concept of port in itself
18+
* LESS IMPORTANT: right now in this file, the developer will also have to put the helpocommands method which will then be registered on the appropriate url and which returns a description on how to use the service from polycubectl
19+
* Helloworldcpp_dp_egress.h, Helloworldcpp_dp_egress.c Helloworldcpp_dp_ingress.h and Helloworldcpp_dp_ingress.c which correspond to the dataplane
20+
* Helloworldcpp-lib.cpp, Helloworldcpp.cpp, Helloworldcpp.h, Ports.cpp and Ports.h NOW as of now they are not needed, I don't know if they will be used in the future
21+
* first_client.cc, first_polycube_client.cc, router_client.cc and second_client.cc DO NOT do the service but are test files
22+
23+
24+
NOTE: To make everything work, you will need to include the polycube-grpc library in the controlplane files
25+
26+
27+
28+
29+
30+
31+
# Examples gRPC remote services in C++
32+
33+
##
34+
35+
36+
37+
38+
39+
40+
## Observations
41+
42+
Within each example, for logic reasons, or because it is still being implemented, there are some directories or files that are not necessary to develop a simple service. In particular, the directories
43+
* cmake: contains some files for loading the files as variables and another one used for the compiler of gRPC/ProtoBuf
44+
* datamodel: contains the datamodel of the Polycube helloworld service

Diff for: examples/cpp/pcn-helloworld2/datamodel/helloworld2.yang renamed to examples/cpp/pcn-helloworldcpp/datamodel/helloworld2.yang

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
module helloworld2 {
1+
module helloworldcpp {
22
yang-version 1.1;
3-
namespace "http://polycube.network/helloworld2";
4-
prefix "helloworld2";
3+
namespace "http://polycube.network/helloworldcpp";
4+
prefix "helloworldcpp";
55

66
import polycube-base { prefix "polycube-base"; }
77
import polycube-standard-base { prefix "polycube-standard-base"; }
88

99
organization "Polycube open source project";
10-
description "YANG data model for the Polycube Helloworld2 service";
10+
description "YANG data model for the Polycube Helloworldcpp service";
1111

12-
polycube-base:service-description "Helloworld2 Service";
12+
polycube-base:service-description "Helloworldcpp Service";
1313
polycube-base:service-version "2.0";
14-
polycube-base:service-name "helloworld2";
14+
polycube-base:service-name "helloworldcpp";
1515
polycube-base:service-min-kernel-version "4.14.0";
1616

1717
uses "polycube-standard-base:standard-base-yang-module";

0 commit comments

Comments
 (0)