summaryrefslogtreecommitdiffstats
path: root/verigraph/src/main/proto/verigraph.proto
blob: feb8ff078af6aeb556c6c5124d395c9762627207 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
syntax = "proto3";

package verigraph;

option java_multiple_files = true;
option java_package = "it.polito.verigraph.grpc";
option java_outer_classname = "VerigraphProto";

// The service definition.
service Verigraph {
  // Obtains a list of graphs
  rpc GetGraphs (GetRequest) returns (stream GraphGrpc) {}
  // Obtains a graph
  rpc GetGraph (RequestID) returns (GraphGrpc) {}
  // Obtains a list of Nodes
  rpc GetNodes (RequestID) returns (stream NodeGrpc) {}
  // Obtains a node
  rpc GetNode (RequestID) returns (NodeGrpc) {}
  // Obtains a list of Neighbours
  rpc GetNeighbours (RequestID) returns (stream NeighbourGrpc) {}
  // Obtains a Neighbour
  rpc GetNeighbour (RequestID) returns (NeighbourGrpc) {}

  // Creates a graph
  rpc CreateGraph (GraphGrpc) returns (NewGraph) {}
  // Delete a graph
  rpc DeleteGraph (RequestID) returns (Status) {}
  // Updates a graph
  rpc UpdateGraph (GraphGrpc) returns (NewGraph) {}
  // Verify a policy
  rpc VerifyPolicy (Policy) returns (VerificationGrpc) {}

  // Creates a Node
  rpc CreateNode (NodeGrpc) returns (NewNode) {}
  // Delete a Node
  rpc DeleteNode (RequestID) returns (Status) {}
  // Updates a Node
  rpc UpdateNode (NodeGrpc) returns (NewNode) {}
  // Configures a Node
  rpc ConfigureNode (ConfigurationGrpc) returns (Status) {}

  // Creates a neighbour
  rpc CreateNeighbour (NeighbourGrpc) returns (NewNeighbour) {}
  // Delete a neighbour
  rpc DeleteNeighbour (RequestID) returns (Status) {}
  // Updates a neighbour
  rpc UpdateNeighbour (NeighbourGrpc) returns (NewNeighbour) {}
}

message GetRequest {
}

message RequestID {
  int64 idGraph = 1;
  int64 idNode = 2;
  int64 idNeighbour = 3;
}

message Policy{
int64 idGraph = 1;
string source = 2;
  string destination = 3;
  enum PolicyType {
   reachability = 0;
   isolation = 1;
   traversal = 2;
}
PolicyType type = 4;
string middlebox = 5;
}

message ConfigurationGrpc{
int64 idGraph = 1;
int64 idNode = 2;
string description = 3;
string configuration = 4;
string id = 5;
}

message NodeGrpc{
int64 idGraph = 1;
string name = 2;
int64 id = 3;//long
enum FunctionalType {
antispam = 0;
   cache = 1;
   dpi = 2;
   endhost = 3;
   endpoint = 4;
   fieldmodifier = 5;
   firewall = 6;
   mailclient = 7;
   mailserver = 8;
   nat = 9;
   vpnaccess = 10;
   vpnexit = 11;
   webclient = 12;
   webserver = 13;
}
FunctionalType functional_type = 4;
repeated NeighbourGrpc neighbour = 5;
ConfigurationGrpc configuration = 6;
string errorMessage = 7;
}

message GraphGrpc{
int64 id = 1;//long
repeated NodeGrpc node = 2;
string errorMessage = 3;
}

message NeighbourGrpc{
int64 idGraph = 1;
  int64 idNode = 2;
string name = 3;
  int64 id = 4;//long
  string errorMessage = 5;
}

message NewGraph{
bool success = 1;
GraphGrpc graph = 2;
string errorMessage = 3;
}

message NewNode{
bool success = 1;
NodeGrpc node = 2;
string errorMessage = 3;
}

message NewNeighbour{
bool success = 1;
NeighbourGrpc neighbour = 2;
string errorMessage = 3;
}

message TestGrpc {
  repeated NodeGrpc node = 1;
  string result = 2;
}

message VerificationGrpc{
bool successOfOperation = 1;
string result = 2;
string comment = 3;
repeated TestGrpc test = 4;
string errorMessage = 5;
}

message Status{
bool success = 1;
string errorMessage = 2;
}