Skip to content

Commit 3d1aaae

Browse files
sandersmsartek-koltun
authored andcommitted
refactor(buf): standard format updates for evpn and cloud
Signed-off-by: Mark Sanders <marksanders194@gmail.com>
1 parent b169a78 commit 3d1aaae

18 files changed

+2559
-2750
lines changed

network/cloud/bgp.proto

Lines changed: 93 additions & 95 deletions
Large diffs are not rendered by default.

network/cloud/cloudrpc.proto

Lines changed: 1605 additions & 1750 deletions
Large diffs are not rendered by default.

network/cloud/device.proto

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@
44
syntax = "proto3";
55
package opi_api.network.cloud.v1alpha1;
66

7-
option java_package = "opi_api.network.cloud.v1alpha1";
8-
option java_multiple_files = true;
9-
option java_outer_classname = "DeviceProto";
10-
11-
option go_package = "github.com/opiproject/opi-api/network/cloud/v1alpha1/gen/go";
12-
7+
import "google/api/resource.proto";
8+
import "google/protobuf/timestamp.proto";
139
import "network/opinetcommon/networktypes.proto";
1410

15-
import "google/protobuf/timestamp.proto";
16-
import "google/api/resource.proto";
11+
option go_package = "github.com/opiproject/opi-api/network/cloud/v1alpha1/gen/go";
12+
option java_multiple_files = true;
13+
option java_outer_classname = "DeviceProto";
14+
option java_package = "opi_api.network.cloud.v1alpha1";
1715

1816
// device capabilities indicate the capabilities of software/hardware
1917
// as exposed by current firmware of the device. This can help cloud controller
@@ -64,7 +62,7 @@ message DeviceSpec {
6462
// number and type of pcie functions exposed
6563
PCIeFunctionsSpec pcie_functions = 5;
6664
// ovelay routing
67-
bool overlay_routing_enabled = 6;
65+
bool overlay_routing_enabled = 6;
6866
// system name is used as named identifier in protocols (e.g. LLDP)
6967
string systemname = 7;
7068
// management network details
@@ -122,15 +120,15 @@ message DeviceStatus {
122120
// system events happened during device operations
123121
message SystemEvent {
124122
// event timestamp
125-
google.protobuf.Timestamp event_time = 1;
123+
google.protobuf.Timestamp event_time = 1;
126124
// name of the event
127-
string event_description = 2;
125+
string event_description = 2;
128126
}
129127

130128
// critical alerts effecting the health of the system
131129
message SystemAlert {
132130
// alert timestamp
133-
google.protobuf.Timestamp alert_time = 1;
131+
google.protobuf.Timestamp alert_time = 1;
134132
// name of the alert
135-
string alert_description = 2;
133+
string alert_description = 2;
136134
}

network/cloud/interface.proto

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
syntax = "proto3";
55
package opi_api.network.cloud.v1alpha1;
66

7-
option java_package = "opi_api.network.cloud.v1alpha1";
8-
option java_multiple_files = true;
9-
option java_outer_classname = "InterfaceProto";
7+
import "google/api/resource.proto";
8+
import "network/opinetcommon/networktypes.proto";
109

1110
option go_package = "github.com/opiproject/opi-api/network/cloud/v1alpha1/gen/go";
12-
13-
import "network/opinetcommon/networktypes.proto";
14-
import "google/api/resource.proto";
11+
option java_multiple_files = true;
12+
option java_outer_classname = "InterfaceProto";
13+
option java_package = "opi_api.network.cloud.v1alpha1";
1514

1615
// interface - ethernet interface (layer2 and layer3 configuration)
1716
message Interface {
@@ -43,9 +42,9 @@ message InterfaceSpec {
4342
// layer3 interface configuration
4443
L3IfSpec l3_if_spec = 5;
4544
// loopback interface configuration
46-
LoopbackIfSpec loopback_if_spec = 6;
45+
LoopbackIfSpec loopback_if_spec = 6;
4746
// control interface configuration
48-
ControlIfSpec control_if_spec = 7;
47+
ControlIfSpec control_if_spec = 7;
4948
// host facing interface's configuration
5049
HostIfSpec host_if_spec = 8;
5150
}
@@ -121,15 +120,15 @@ message HostIfSpec {
121120
bytes mac_address = 3;
122121
// interface name (this can be populated from what is obtaine from the driver
123122
// for easier troublsehooting, or other operations
124-
string ifname = 4;
123+
string ifname = 4;
125124
}
126125

127126
// operational status of uplink interface
128127
message UplinkIfStatus {
129128
// hw specific index associated with this uplink, useful for operations
130-
int32 hw_if_idx = 1;
129+
int32 hw_if_idx = 1;
131130
// hw port number is hw identifier of the port, usefor for operations
132-
int32 hw_port_number = 2;
131+
int32 hw_port_number = 2;
133132
}
134133

135134
// operational status of loopback interface
@@ -155,16 +154,16 @@ message InterfaceStatus {
155154
// encoded interface index of this interface
156155
// (-- api-linter: core::0141::forbidden-types=disabled
157156
// aip.dev/not-precedent: interface index is an opaque uint32 value. --)
158-
uint32 if_index = 1;
157+
uint32 if_index = 1;
159158
// operational status of the interface
160-
IfStatus oper_status = 2;
159+
IfStatus oper_status = 2;
161160
oneof ifstatus {
162161
// uplink specific status
163-
UplinkIfStatus uplink_if_status = 3;
162+
UplinkIfStatus uplink_if_status = 3;
164163
// loopback interface specific status
165164
LoopbackIfStatus loopback_if_status = 4;
166165
// host interface specific status
167-
HostIfStatus host_if_status = 5;
166+
HostIfStatus host_if_status = 5;
168167
}
169168
}
170169

@@ -173,17 +172,17 @@ enum IfType {
173172
// unspecified
174173
IF_TYPE_UNSPECIFIED = 0;
175174
// uplink interface
176-
IF_TYPE_UPLINK = 1;
175+
IF_TYPE_UPLINK = 1;
177176
// uplink port-channel interface
178-
IF_TYPE_UPLINK_PC = 2;
177+
IF_TYPE_UPLINK_PC = 2;
179178
// L3 interface
180-
IF_TYPE_L3 = 3;
179+
IF_TYPE_L3 = 3;
181180
// loopback interface
182-
IF_TYPE_LOOPBACK = 4;
181+
IF_TYPE_LOOPBACK = 4;
183182
// inband management/control interface
184-
IF_TYPE_CONTROL = 5;
183+
IF_TYPE_CONTROL = 5;
185184
// host visible PF/VF device
186-
IF_TYPE_HOST = 6;
185+
IF_TYPE_HOST = 6;
187186
}
188187

189188
// IfStatus status reflects the operational status of Interface
@@ -193,7 +192,7 @@ enum IfStatus {
193192
// unknown
194193
IF_STATUS_UNSPECIFIED = 0;
195194
// interface is up
196-
IF_STATUS_UP = 1;
195+
IF_STATUS_UP = 1;
197196
// interface is down
198-
IF_STATUS_DOWN = 2;
197+
IF_STATUS_DOWN = 2;
199198
}

network/cloud/mapping.proto

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
syntax = "proto3";
55
package opi_api.network.cloud.v1alpha1;
66

7-
option java_package = "opi_api.network.cloud.v1alpha1";
8-
option java_multiple_files = true;
9-
option java_outer_classname = "MappingProto";
7+
import "google/api/resource.proto";
8+
import "network/opinetcommon/networktypes.proto";
109

1110
option go_package = "github.com/opiproject/opi-api/network/cloud/v1alpha1/gen/go";
12-
13-
import "network/opinetcommon/networktypes.proto";
14-
import "google/api/resource.proto";
11+
option java_multiple_files = true;
12+
option java_outer_classname = "MappingProto";
13+
option java_package = "opi_api.network.cloud.v1alpha1";
1514

1615
// mapping object
1716
message Mapping {
@@ -41,21 +40,21 @@ message MappingSpec {
4140
string subnet_name_ref = 3;
4241
// mapping's destination information
4342
oneof dstinfo {
44-
// if IP is that of local vnic, corresponding vnic id
45-
// this is mandatory attribute for local IP mappings
46-
string vnic_name_ref = 4;
47-
// Tunnel ID of the remote TEP for remote mapping
48-
// this is mandatory attribute for remote MAC/IP mappings for
49-
// non-ECMP cases
50-
string tunnel_name_ref = 5;
51-
// overlay nexthop/TEP group for remote mappings
52-
// this is mandatory attribute for remote MAC/IP mappings for ECMP cases
53-
string nh_group_name_ref = 6;
43+
// if IP is that of local vnic, corresponding vnic id
44+
// this is mandatory attribute for local IP mappings
45+
string vnic_name_ref = 4;
46+
// Tunnel ID of the remote TEP for remote mapping
47+
// this is mandatory attribute for remote MAC/IP mappings for
48+
// non-ECMP cases
49+
string tunnel_name_ref = 5;
50+
// overlay nexthop/TEP group for remote mappings
51+
// this is mandatory attribute for remote MAC/IP mappings for ECMP cases
52+
string nh_group_name_ref = 6;
5453
}
5554
// overlay MAC address of this mapping
5655
bytes mac_addr = 7;
5756
// fabric encap information specific to this mapping, if any
58-
network.opinetcommon.v1alpha1.Encap encap = 8;
57+
network.opinetcommon.v1alpha1.Encap encap = 8;
5958
// public IP, if overlay IP has corresponding public IP
6059
network.opinetcommon.v1alpha1.IPAddress public_ip = 9;
6160
// tag/label/security group of this IP mapping, these tags/labels/SGs can be
@@ -87,7 +86,7 @@ message MappingStatus {
8786
// L3MappingKey is the 2nd-ary key of the remote IP mapping
8887
message L3MappingKey {
8988
// virtual private cloud of the IP mapping
90-
string vpc_name_ref = 1;
89+
string vpc_name_ref = 1;
9190
// private/overlay IP of the mapping
9291
network.opinetcommon.v1alpha1.IPAddress ip_address = 2;
9392
}
@@ -115,7 +114,7 @@ message MappingLookupFilter {
115114
// MAC mapping key
116115
L2MappingKey mac_key = 5;
117116
// IP address
118-
network.opinetcommon.v1alpha1.IPAddress ip_address = 6;
117+
network.opinetcommon.v1alpha1.IPAddress ip_address = 6;
119118
// MAC address
120119
bytes mac_address = 7;
121120
// VPC id
@@ -128,16 +127,16 @@ enum MappingType {
128127
// unspecified
129128
MAPPING_TYPE_UNSPECIFIED = 0;
130129
// MAPPING_TYPE_VPC is used for regular VPC endpoints and is the default
131-
MAPPING_TYPE_VPC = 1;
130+
MAPPING_TYPE_VPC = 1;
132131
// MAPPING_TYPE_SERVICE is used for mappings that represent service endpoints
133-
MAPPING_TYPE_SERVICE = 2;
132+
MAPPING_TYPE_SERVICE = 2;
134133
// MAPPING_TYPE_LB_VIP is used for mappings that represent load balancer service VIP
135-
MAPPING_TYPE_LB_VIP = 3;
134+
MAPPING_TYPE_LB_VIP = 3;
136135
}
137136

138137
// mapping key type can be L2 or L3
139138
enum MappingKeyType {
140-
// unspecified
139+
// unspecified
141140
MAPPING_KEY_TYPE_UNSPECIFIED = 0;
142141
// l2 mapping
143142
MAPPING_KEY_TYPE_L2 = 1;

network/cloud/networkpolicy.proto

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
syntax = "proto3";
55
package opi_api.network.cloud.v1alpha1;
66

7-
option java_package = "opi_api.network.cloud.v1alpha1";
8-
option java_multiple_files = true;
9-
option java_outer_classname = "NetworkPolicyProto";
7+
import "google/api/resource.proto";
8+
import "network/opinetcommon/networktypes.proto";
109

1110
option go_package = "github.com/opiproject/opi-api/network/cloud/v1alpha1/gen/go";
12-
13-
import "network/opinetcommon/networktypes.proto";
14-
import "google/api/resource.proto";
11+
option java_multiple_files = true;
12+
option java_outer_classname = "NetworkPolicyProto";
13+
option java_package = "opi_api.network.cloud.v1alpha1";
1514

1615
// security policy object
1716
message SecurityPolicy {
@@ -48,7 +47,7 @@ message SecurityPolicySpec {
4847
// that is also not set then default "deny" action is enforced
4948
// When no policy is configured on subnet and vnic, this knob doesn't
5049
// apply and traffic is allowed in that case
51-
network.opinetcommon.v1alpha1.SecurityRuleAction default_security_action = 4;
50+
network.opinetcommon.v1alpha1.SecurityRuleAction default_security_action = 4;
5251
// list of security rules
5352
repeated SecurityRuleInfo rules = 5;
5453
// PolicyRuleFormat indicates whether the policy is set of flattened rules
@@ -58,7 +57,7 @@ message SecurityPolicySpec {
5857

5958
// SecurityRuleInfo is a single rule in the security policy
6059
message SecurityRuleInfo {
61-
// rule id needed for incremental rule ADD/DEL/UPD
60+
// rule id needed for incremental rule ADD/DEL/UPD
6261
// (-- api-linter: core::0122::name-suffix=disabled
6362
// aip.dev/not-precedent: security rule info is user assigned name for each rule. --)
6463
string rule_name = 1;
@@ -73,7 +72,7 @@ message SecurityRuleAttrs {
7372
// packet, the first such matching rule in the policy is picked (i.e., based
7473
// on the order, first in the list of such matching rules)
7574
// range:0-65534
76-
int32 priority= 1;
75+
int32 priority = 1;
7776
// rule match criteria
7877
network.opinetcommon.v1alpha1.RuleMatch match = 2;
7978
// action to take when this rule is matched
@@ -142,11 +141,11 @@ message ALGSpec {
142141
// ALG specific options, if any
143142
oneof alg_options {
144143
// ftp alg options
145-
FTPOptions ftp_options = 3;
146-
// dns alg options
147-
DNSOptions dns_options = 4;
144+
FTPOptions ftp_options = 3;
145+
// dns alg options
146+
DNSOptions dns_options = 4;
148147
// msrpc options
149-
MSRPCOptions msrpc_options = 5;
148+
MSRPCOptions msrpc_options = 5;
150149
// sunrpc options
151150
SunRPCOptions sunrpc_options = 6;
152151
}
@@ -195,8 +194,7 @@ message SecurityRuleSpec {
195194
}
196195

197196
// operational status of the security rule, if any
198-
message SecurityRuleStatus {
199-
}
197+
message SecurityRuleStatus {}
200198

201199
// security profile object
202200
message SecurityProfile {
@@ -263,8 +261,7 @@ message SecurityProfileSpec {
263261
}
264262

265263
// operational status of security profile, if any
266-
message SecurityProfileStatus {
267-
}
264+
message SecurityProfileStatus {}
268265

269266
// PolicyLookupMatch captures all the policy lookup match conditions
270267
message PolicyLookupMatch {
@@ -310,7 +307,7 @@ message SecurityPolicyLookupRequest {
310307
// lookup_info is mandatory
311308
oneof lookup_info {
312309
// security policy uuid to do the lookup in
313-
string policy_name_ref= 1;
310+
string policy_name_ref = 1;
314311
// vnic specific policies will be evaluated when vnic info is provided
315312
VnicLookupInfo vnic_lookup_info = 2;
316313
}
@@ -334,7 +331,7 @@ message PolicyLookupResult {
334331

335332
// types of security policies
336333
enum SecurityPolicyType {
337-
// unspecified
334+
// unspecified
338335
SECURITY_POLICY_TYPE_UNSPECIFIED = 0;
339336
// UNDERLAY security policy object is singleton object per DSC
340337
SECURITY_POLICY_TYPE_UNDERLAY = 1;
@@ -349,17 +346,17 @@ enum ALGType {
349346
// unspecified
350347
ALG_TYPE_UNSPECIFIED = 0;
351348
// TFTP ALG
352-
ALG_TYPE_TFTP = 1;
349+
ALG_TYPE_TFTP = 1;
353350
// FTP ALG
354-
ALG_TYPE_FTP = 2;
351+
ALG_TYPE_FTP = 2;
355352
// DNS ALG
356-
ALG_TYPE_DNS = 3;
353+
ALG_TYPE_DNS = 3;
357354
// SUNRPC ALG
358-
ALG_TYPE_SUNRPC = 4;
355+
ALG_TYPE_SUNRPC = 4;
359356
// MSRPC ALG
360-
ALG_TYPE_MSRPC = 5;
357+
ALG_TYPE_MSRPC = 5;
361358
// RTSP ALG
362-
ALG_TYPE_RTSP = 6;
359+
ALG_TYPE_RTSP = 6;
363360
}
364361

365362
// PolicyRuleFormat captures what format is used for the rules in a given
@@ -381,5 +378,5 @@ enum PolicyRuleFormat {
381378
// as match conditions
382379
// In this format, ALL the rules must use SrcIPList, DstIPList,
383380
// PortList, ICMPMatchList attributes only, whereever applicable
384-
POLICY_RULE_FORMAT_COMPACT = 2;
381+
POLICY_RULE_FORMAT_COMPACT = 2;
385382
}

0 commit comments

Comments
 (0)