diff --git a/api/grpc/pola.pb.go b/api/grpc/pola.pb.go index 1962267..1a08360 100644 --- a/api/grpc/pola.pb.go +++ b/api/grpc/pola.pb.go @@ -190,10 +190,11 @@ type SrPolicy struct { SrcRouterId string `protobuf:"bytes,4,opt,name=srcRouterId,proto3" json:"srcRouterId,omitempty"` DstRouterId string `protobuf:"bytes,5,opt,name=dstRouterId,proto3" json:"dstRouterId,omitempty"` Color uint32 `protobuf:"varint,6,opt,name=color,proto3" json:"color,omitempty"` - PolicyName string `protobuf:"bytes,7,opt,name=policyName,proto3" json:"policyName,omitempty"` - Type SrPolicyType `protobuf:"varint,8,opt,name=type,proto3,enum=pb.SrPolicyType" json:"type,omitempty"` - SegmentList []*Segment `protobuf:"bytes,9,rep,name=segmentList,proto3" json:"segmentList,omitempty"` - Metric MetricType `protobuf:"varint,10,opt,name=metric,proto3,enum=pb.MetricType" json:"metric,omitempty"` + Preference uint32 `protobuf:"varint,7,opt,name=preference,proto3" json:"preference,omitempty"` + PolicyName string `protobuf:"bytes,8,opt,name=policyName,proto3" json:"policyName,omitempty"` + Type SrPolicyType `protobuf:"varint,9,opt,name=type,proto3,enum=pb.SrPolicyType" json:"type,omitempty"` + SegmentList []*Segment `protobuf:"bytes,10,rep,name=segmentList,proto3" json:"segmentList,omitempty"` + Metric MetricType `protobuf:"varint,11,opt,name=metric,proto3,enum=pb.MetricType" json:"metric,omitempty"` } func (x *SrPolicy) Reset() { @@ -270,6 +271,13 @@ func (x *SrPolicy) GetColor() uint32 { return 0 } +func (x *SrPolicy) GetPreference() uint32 { + if x != nil { + return x.Preference + } + return 0 +} + func (x *SrPolicy) GetPolicyName() string { if x != nil { return x.PolicyName @@ -874,7 +882,7 @@ var file_pola_proto_rawDesc = []byte{ 0x07, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x73, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6c, 0x6f, 0x41, 0x64, - 0x64, 0x72, 0x22, 0xdf, 0x02, 0x0a, 0x08, 0x53, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, + 0x64, 0x72, 0x22, 0xff, 0x02, 0x0a, 0x08, 0x53, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x28, 0x0a, 0x0f, 0x70, 0x63, 0x65, 0x70, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x70, 0x63, 0x65, 0x70, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x72, 0x63, @@ -886,15 +894,17 @@ var file_pola_proto_rawDesc = []byte{ 0x20, 0x0a, 0x0b, 0x64, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x6c, + 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x70, 0x72, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x72, 0x50, 0x6f, 0x6c, + 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2d, 0x0a, - 0x0b, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x09, 0x20, 0x03, + 0x0b, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x06, - 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x70, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x22, 0x51, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x28, 0x0a, 0x08, 0x73, diff --git a/api/grpc/pola.proto b/api/grpc/pola.proto index 23df1be..1dc0963 100644 --- a/api/grpc/pola.proto +++ b/api/grpc/pola.proto @@ -40,10 +40,11 @@ message SrPolicy { string srcRouterId = 4; string dstRouterId = 5; uint32 color = 6; - string policyName = 7; - SrPolicyType type = 8; - repeated Segment segmentList = 9; - MetricType metric = 10; + uint32 preference = 7; + string policyName = 8; + SrPolicyType type = 9; + repeated Segment segmentList = 10; + MetricType metric = 11; } message CreateSrPolicyInput {