summaryrefslogtreecommitdiffhomepage
path: root/api/gobgp.pb.go
diff options
context:
space:
mode:
authorNaoto Hanaue <hanaue.naoto@po.ntts.co.jp>2015-05-25 11:50:42 +0900
committerNaoto Hanaue <hanaue.naoto@po.ntts.co.jp>2015-05-26 17:28:44 +0900
commitfd4f6a91efb81646281ae8175433872627ec8611 (patch)
treef657b1c3bec445ed48dd82a009f61a34533209db /api/gobgp.pb.go
parentfa5d2fe25ee3670a5ba2e66431dfd617f48737af (diff)
cli: add the add/del commands to routepolicy
% gobgp -u 10.0.255.1 policy routepolicy PolicyName policy0: StatementName st0: Conditions: PrefixSet: ps0 192.168.0.0/16 16..24 NeighborSet: ns2 10.0.0.4 AsPathLength: MatchOption: ALL Actions: REJECT % gobgp -u 10.0.255.1 policy routepolicy add policy1 st0 conditions --prefix ps2 --neighbor ns0 --aspath-len eq,5 --option all % gobgp -u 10.0.255.1 policy routepolicy add policy1 st0 actions --route-action accept % gobgp -u 10.0.255.1 policy routepolicy del policy0 % gobgp -u 10.0.255.1 policy routepolicy PolicyName policy1: StatementName st0: Conditions: PrefixSet: ps2 192.168.20.0/24 NeighborSet: ns0 10.0.0.2 10.0.0.3 AsPathLength: eq 5 MatchOption: ALL Actions: ACCEPT
Diffstat (limited to 'api/gobgp.pb.go')
-rw-r--r--api/gobgp.pb.go74
1 files changed, 69 insertions, 5 deletions
diff --git a/api/gobgp.pb.go b/api/gobgp.pb.go
index fda0a608..76443c48 100644
--- a/api/gobgp.pb.go
+++ b/api/gobgp.pb.go
@@ -989,7 +989,7 @@ type Conditions struct {
MatchPrefixSet *PrefixSet `protobuf:"bytes,1,opt,name=match_prefix_set" json:"match_prefix_set,omitempty"`
MatchNeighborSet *NeighborSet `protobuf:"bytes,2,opt,name=match_neighbor_set" json:"match_neighbor_set,omitempty"`
MatchAsPathLength *AsPathLength `protobuf:"bytes,3,opt,name=match_as_path_length" json:"match_as_path_length,omitempty"`
- MatchSetOptions int64 `protobuf:"varint,4,opt,name=match_set_options" json:"match_set_options,omitempty"`
+ MatchSetOptions string `protobuf:"bytes,4,opt,name=match_set_options" json:"match_set_options,omitempty"`
}
func (m *Conditions) Reset() { *m = Conditions{} }
@@ -1018,8 +1018,7 @@ func (m *Conditions) GetMatchAsPathLength() *AsPathLength {
}
type Actions struct {
- AcceptRoute bool `protobuf:"varint,1,opt,name=accept_route" json:"accept_route,omitempty"`
- RejectRoute bool `protobuf:"varint,2,opt,name=reject_route" json:"reject_route,omitempty"`
+ RouteAction string `protobuf:"bytes,1,opt,name=route_action" json:"route_action,omitempty"`
}
func (m *Actions) Reset() { *m = Actions{} }
@@ -1083,9 +1082,9 @@ func (m *RoutingPolicy) GetPolicyDifinition() []*PolicyDefinition {
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"`
+ DefaultImportPolicy string `protobuf:"bytes,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"`
+ DefaultExportPolicy string `protobuf:"bytes,4,opt,name=default_export_policy" json:"default_export_policy,omitempty"`
}
func (m *ApplyPolicy) Reset() { *m = ApplyPolicy{} }
@@ -1146,6 +1145,7 @@ type GrpcClient interface {
ModPolicyNeighbor(ctx context.Context, opts ...grpc.CallOption) (Grpc_ModPolicyNeighborClient, error)
GetPolicyRoutePolicies(ctx context.Context, in *PolicyArguments, opts ...grpc.CallOption) (Grpc_GetPolicyRoutePoliciesClient, error)
GetPolicyRoutePolicy(ctx context.Context, in *PolicyArguments, opts ...grpc.CallOption) (*PolicyDefinition, error)
+ ModPolicyRoutePolicy(ctx context.Context, opts ...grpc.CallOption) (Grpc_ModPolicyRoutePolicyClient, error)
}
type grpcClient struct {
@@ -1549,6 +1549,37 @@ func (c *grpcClient) GetPolicyRoutePolicy(ctx context.Context, in *PolicyArgumen
return out, nil
}
+func (c *grpcClient) ModPolicyRoutePolicy(ctx context.Context, opts ...grpc.CallOption) (Grpc_ModPolicyRoutePolicyClient, error) {
+ stream, err := grpc.NewClientStream(ctx, &_Grpc_serviceDesc.Streams[9], c.cc, "/api.Grpc/ModPolicyRoutePolicy", opts...)
+ if err != nil {
+ return nil, err
+ }
+ x := &grpcModPolicyRoutePolicyClient{stream}
+ return x, nil
+}
+
+type Grpc_ModPolicyRoutePolicyClient interface {
+ Send(*PolicyArguments) error
+ Recv() (*Error, error)
+ grpc.ClientStream
+}
+
+type grpcModPolicyRoutePolicyClient struct {
+ grpc.ClientStream
+}
+
+func (x *grpcModPolicyRoutePolicyClient) Send(m *PolicyArguments) error {
+ return x.ClientStream.SendMsg(m)
+}
+
+func (x *grpcModPolicyRoutePolicyClient) Recv() (*Error, error) {
+ m := new(Error)
+ if err := x.ClientStream.RecvMsg(m); err != nil {
+ return nil, err
+ }
+ return m, nil
+}
+
// Server API for Grpc service
type GrpcServer interface {
@@ -1573,6 +1604,7 @@ type GrpcServer interface {
ModPolicyNeighbor(Grpc_ModPolicyNeighborServer) error
GetPolicyRoutePolicies(*PolicyArguments, Grpc_GetPolicyRoutePoliciesServer) error
GetPolicyRoutePolicy(context.Context, *PolicyArguments) (*PolicyDefinition, error)
+ ModPolicyRoutePolicy(Grpc_ModPolicyRoutePolicyServer) error
}
func RegisterGrpcServer(s *grpc.Server, srv GrpcServer) {
@@ -1927,6 +1959,32 @@ func _Grpc_GetPolicyRoutePolicy_Handler(srv interface{}, ctx context.Context, co
return out, nil
}
+func _Grpc_ModPolicyRoutePolicy_Handler(srv interface{}, stream grpc.ServerStream) error {
+ return srv.(GrpcServer).ModPolicyRoutePolicy(&grpcModPolicyRoutePolicyServer{stream})
+}
+
+type Grpc_ModPolicyRoutePolicyServer interface {
+ Send(*Error) error
+ Recv() (*PolicyArguments, error)
+ grpc.ServerStream
+}
+
+type grpcModPolicyRoutePolicyServer struct {
+ grpc.ServerStream
+}
+
+func (x *grpcModPolicyRoutePolicyServer) Send(m *Error) error {
+ return x.ServerStream.SendMsg(m)
+}
+
+func (x *grpcModPolicyRoutePolicyServer) Recv() (*PolicyArguments, error) {
+ m := new(PolicyArguments)
+ if err := x.ServerStream.RecvMsg(m); err != nil {
+ return nil, err
+ }
+ return m, nil
+}
+
var _Grpc_serviceDesc = grpc.ServiceDesc{
ServiceName: "api.Grpc",
HandlerType: (*GrpcServer)(nil),
@@ -2029,5 +2087,11 @@ var _Grpc_serviceDesc = grpc.ServiceDesc{
Handler: _Grpc_GetPolicyRoutePolicies_Handler,
ServerStreams: true,
},
+ {
+ StreamName: "ModPolicyRoutePolicy",
+ Handler: _Grpc_ModPolicyRoutePolicy_Handler,
+ ServerStreams: true,
+ ClientStreams: true,
+ },
},
}