summaryrefslogtreecommitdiffhomepage
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/gobgp.pb.go53
-rw-r--r--api/gobgp.proto10
2 files changed, 62 insertions, 1 deletions
diff --git a/api/gobgp.pb.go b/api/gobgp.pb.go
index 8a54a2c7..2d8767a8 100644
--- a/api/gobgp.pb.go
+++ b/api/gobgp.pb.go
@@ -40,6 +40,7 @@ It has these top-level messages:
Statement
PolicyDefinition
RoutingPolicy
+ ApplyPolicy
*/
package api
@@ -1062,6 +1063,31 @@ func (m *RoutingPolicy) GetPolicyDifinition() []*PolicyDefinition {
return nil
}
+type ApplyPolicy struct {
+ ImportPolicies []*PolicyDefinition `protobuf:"bytes,1,rep,name=import_policies" json:"import_policies,omitempty"`
+ DefaultImportPolicy int64 `protobuf:"varint,2,opt,name=default_import_policy" json:"default_import_policy,omitempty"`
+ ExportPolicies []*PolicyDefinition `protobuf:"bytes,3,rep,name=export_policies" json:"export_policies,omitempty"`
+ DefaultExportPolicy int64 `protobuf:"varint,4,opt,name=default_export_policy" json:"default_export_policy,omitempty"`
+}
+
+func (m *ApplyPolicy) Reset() { *m = ApplyPolicy{} }
+func (m *ApplyPolicy) String() string { return proto.CompactTextString(m) }
+func (*ApplyPolicy) ProtoMessage() {}
+
+func (m *ApplyPolicy) GetImportPolicies() []*PolicyDefinition {
+ if m != nil {
+ return m.ImportPolicies
+ }
+ return nil
+}
+
+func (m *ApplyPolicy) GetExportPolicies() []*PolicyDefinition {
+ if m != nil {
+ return m.ExportPolicies
+ }
+ return nil
+}
+
func init() {
proto.RegisterEnum("api.Resource", Resource_name, Resource_value)
proto.RegisterEnum("api.Operation", Operation_name, Operation_value)
@@ -1093,6 +1119,7 @@ type GrpcClient interface {
Enable(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Error, error)
Disable(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Error, error)
ModPath(ctx context.Context, opts ...grpc.CallOption) (Grpc_ModPathClient, error)
+ GetNeighborPolicy(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*ApplyPolicy, error)
GetPolicyPrefixes(ctx context.Context, in *PolicyArguments, opts ...grpc.CallOption) (Grpc_GetPolicyPrefixesClient, error)
GetPolicyPrefix(ctx context.Context, in *PolicyArguments, opts ...grpc.CallOption) (*PrefixSet, error)
ModPolicyPrefix(ctx context.Context, opts ...grpc.CallOption) (Grpc_ModPolicyPrefixClient, error)
@@ -1309,6 +1336,15 @@ func (x *grpcModPathClient) Recv() (*Error, error) {
return m, nil
}
+func (c *grpcClient) GetNeighborPolicy(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*ApplyPolicy, error) {
+ out := new(ApplyPolicy)
+ err := grpc.Invoke(ctx, "/api.Grpc/GetNeighborPolicy", in, out, c.cc, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func (c *grpcClient) GetPolicyPrefixes(ctx context.Context, in *PolicyArguments, opts ...grpc.CallOption) (Grpc_GetPolicyPrefixesClient, error) {
stream, err := grpc.NewClientStream(ctx, &_Grpc_serviceDesc.Streams[4], c.cc, "/api.Grpc/GetPolicyPrefixes", opts...)
if err != nil {
@@ -1478,6 +1514,7 @@ type GrpcServer interface {
Enable(context.Context, *Arguments) (*Error, error)
Disable(context.Context, *Arguments) (*Error, error)
ModPath(Grpc_ModPathServer) error
+ GetNeighborPolicy(context.Context, *Arguments) (*ApplyPolicy, error)
GetPolicyPrefixes(*PolicyArguments, Grpc_GetPolicyPrefixesServer) error
GetPolicyPrefix(context.Context, *PolicyArguments) (*PrefixSet, error)
ModPolicyPrefix(Grpc_ModPolicyPrefixServer) error
@@ -1676,6 +1713,18 @@ func (x *grpcModPathServer) Recv() (*ModPathArguments, error) {
return m, nil
}
+func _Grpc_GetNeighborPolicy_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
+ in := new(Arguments)
+ if err := codec.Unmarshal(buf, in); err != nil {
+ return nil, err
+ }
+ out, err := srv.(GrpcServer).GetNeighborPolicy(ctx, in)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func _Grpc_GetPolicyPrefixes_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(PolicyArguments)
if err := stream.RecvMsg(m); err != nil {
@@ -1838,6 +1887,10 @@ var _Grpc_serviceDesc = grpc.ServiceDesc{
Handler: _Grpc_Disable_Handler,
},
{
+ MethodName: "GetNeighborPolicy",
+ Handler: _Grpc_GetNeighborPolicy_Handler,
+ },
+ {
MethodName: "GetPolicyPrefix",
Handler: _Grpc_GetPolicyPrefix_Handler,
},
diff --git a/api/gobgp.proto b/api/gobgp.proto
index 98a72228..362c619a 100644
--- a/api/gobgp.proto
+++ b/api/gobgp.proto
@@ -32,6 +32,7 @@ service Grpc {
rpc Enable(Arguments) returns (Error) {}
rpc Disable(Arguments) returns (Error) {}
rpc ModPath(stream ModPathArguments) returns (stream Error) {}
+ rpc GetNeighborPolicy(Arguments) returns (ApplyPolicy) {}
rpc GetPolicyPrefixes(PolicyArguments) returns (stream PrefixSet) {}
rpc GetPolicyPrefix(PolicyArguments) returns (PrefixSet) {}
rpc ModPolicyPrefix(stream PolicyArguments) returns (stream Error) {}
@@ -382,7 +383,7 @@ message Statement {
Actions actions = 3;
}
-message PolicyDefinition{
+message PolicyDefinition {
string policy_definition_name = 1;
repeated Statement statement_list = 2;
}
@@ -390,3 +391,10 @@ message PolicyDefinition{
message RoutingPolicy {
repeated PolicyDefinition policy_difinition = 1;
}
+
+message ApplyPolicy {
+ repeated PolicyDefinition import_policies = 1;
+ int64 default_import_policy = 2;
+ repeated PolicyDefinition export_policies = 3;
+ int64 default_export_policy = 4;
+} \ No newline at end of file