summaryrefslogtreecommitdiffhomepage
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/gobgp.pb.go81
-rw-r--r--api/gobgp.proto12
2 files changed, 93 insertions, 0 deletions
diff --git a/api/gobgp.pb.go b/api/gobgp.pb.go
index d856e19d..e369357c 100644
--- a/api/gobgp.pb.go
+++ b/api/gobgp.pb.go
@@ -19,6 +19,7 @@ It has these top-level messages:
ModStatementArguments
ModPolicyArguments
ModPolicyAssignmentArguments
+ ModGlobalConfigArguments
Path
Destination
Peer
@@ -68,6 +69,7 @@ It has these top-level messages:
RPKI
ROA
Vrf
+ Global
*/
package gobgpapi
@@ -478,6 +480,22 @@ func (m *ModPolicyAssignmentArguments) GetAssignment() *PolicyAssignment {
return nil
}
+type ModGlobalConfigArguments struct {
+ Operation Operation `protobuf:"varint,1,opt,name=operation,enum=gobgpapi.Operation" json:"operation,omitempty"`
+ Global *Global `protobuf:"bytes,2,opt,name=global" json:"global,omitempty"`
+}
+
+func (m *ModGlobalConfigArguments) Reset() { *m = ModGlobalConfigArguments{} }
+func (m *ModGlobalConfigArguments) String() string { return proto.CompactTextString(m) }
+func (*ModGlobalConfigArguments) ProtoMessage() {}
+
+func (m *ModGlobalConfigArguments) GetGlobal() *Global {
+ if m != nil {
+ return m.Global
+ }
+ return nil
+}
+
type Path struct {
Nlri []byte `protobuf:"bytes,1,opt,name=nlri,proto3" json:"nlri,omitempty"`
Pattrs [][]byte `protobuf:"bytes,2,rep,name=pattrs,proto3" json:"pattrs,omitempty"`
@@ -1454,6 +1472,15 @@ func (m *Vrf) Reset() { *m = Vrf{} }
func (m *Vrf) String() string { return proto.CompactTextString(m) }
func (*Vrf) ProtoMessage() {}
+type Global struct {
+ As uint32 `protobuf:"varint,1,opt,name=as" json:"as,omitempty"`
+ RouterId string `protobuf:"bytes,2,opt,name=router_id" json:"router_id,omitempty"`
+}
+
+func (m *Global) Reset() { *m = Global{} }
+func (m *Global) String() string { return proto.CompactTextString(m) }
+func (*Global) ProtoMessage() {}
+
func init() {
proto.RegisterEnum("gobgpapi.Resource", Resource_name, Resource_value)
proto.RegisterEnum("gobgpapi.Operation", Operation_name, Operation_value)
@@ -1474,6 +1501,8 @@ var _ grpc.ClientConn
// Client API for GobgpApi service
type GobgpApiClient interface {
+ GetGlobalConfig(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Global, error)
+ ModGlobalConfig(ctx context.Context, in *ModGlobalConfigArguments, opts ...grpc.CallOption) (*Error, error)
GetNeighbors(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (GobgpApi_GetNeighborsClient, error)
GetNeighbor(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Peer, error)
ModNeighbor(ctx context.Context, in *ModNeighborArguments, opts ...grpc.CallOption) (*Error, error)
@@ -1514,6 +1543,24 @@ func NewGobgpApiClient(cc *grpc.ClientConn) GobgpApiClient {
return &gobgpApiClient{cc}
}
+func (c *gobgpApiClient) GetGlobalConfig(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Global, error) {
+ out := new(Global)
+ err := grpc.Invoke(ctx, "/gobgpapi.GobgpApi/GetGlobalConfig", in, out, c.cc, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *gobgpApiClient) ModGlobalConfig(ctx context.Context, in *ModGlobalConfigArguments, opts ...grpc.CallOption) (*Error, error) {
+ out := new(Error)
+ err := grpc.Invoke(ctx, "/gobgpapi.GobgpApi/ModGlobalConfig", in, out, c.cc, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func (c *gobgpApiClient) GetNeighbors(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (GobgpApi_GetNeighborsClient, error) {
stream, err := grpc.NewClientStream(ctx, &_GobgpApi_serviceDesc.Streams[0], c.cc, "/gobgpapi.GobgpApi/GetNeighbors", opts...)
if err != nil {
@@ -2065,6 +2112,8 @@ func (c *gobgpApiClient) ModPolicyAssignment(ctx context.Context, in *ModPolicyA
// Server API for GobgpApi service
type GobgpApiServer interface {
+ GetGlobalConfig(context.Context, *Arguments) (*Global, error)
+ ModGlobalConfig(context.Context, *ModGlobalConfigArguments) (*Error, error)
GetNeighbors(*Arguments, GobgpApi_GetNeighborsServer) error
GetNeighbor(context.Context, *Arguments) (*Peer, error)
ModNeighbor(context.Context, *ModNeighborArguments) (*Error, error)
@@ -2101,6 +2150,30 @@ func RegisterGobgpApiServer(s *grpc.Server, srv GobgpApiServer) {
s.RegisterService(&_GobgpApi_serviceDesc, srv)
}
+func _GobgpApi_GetGlobalConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
+ in := new(Arguments)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ out, err := srv.(GobgpApiServer).GetGlobalConfig(ctx, in)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func _GobgpApi_ModGlobalConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
+ in := new(ModGlobalConfigArguments)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ out, err := srv.(GobgpApiServer).ModGlobalConfig(ctx, in)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func _GobgpApi_GetNeighbors_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(Arguments)
if err := stream.RecvMsg(m); err != nil {
@@ -2579,6 +2652,14 @@ var _GobgpApi_serviceDesc = grpc.ServiceDesc{
HandlerType: (*GobgpApiServer)(nil),
Methods: []grpc.MethodDesc{
{
+ MethodName: "GetGlobalConfig",
+ Handler: _GobgpApi_GetGlobalConfig_Handler,
+ },
+ {
+ MethodName: "ModGlobalConfig",
+ Handler: _GobgpApi_ModGlobalConfig_Handler,
+ },
+ {
MethodName: "GetNeighbor",
Handler: _GobgpApi_GetNeighbor_Handler,
},
diff --git a/api/gobgp.proto b/api/gobgp.proto
index 98085a10..95ebeb8b 100644
--- a/api/gobgp.proto
+++ b/api/gobgp.proto
@@ -20,6 +20,8 @@ package gobgpapi;
// Interface exported by the server.
service GobgpApi {
+ rpc GetGlobalConfig(Arguments) returns (Global) {}
+ rpc ModGlobalConfig(ModGlobalConfigArguments) returns (Error) {}
rpc GetNeighbors(Arguments) returns (stream Peer) {}
rpc GetNeighbor(Arguments) returns (Peer) {}
rpc ModNeighbor(ModNeighborArguments) returns(Error) {}
@@ -117,6 +119,11 @@ message ModPolicyAssignmentArguments {
PolicyAssignment assignment = 2;
}
+message ModGlobalConfigArguments {
+ Operation operation = 1;
+ Global global = 2;
+}
+
enum Resource {
GLOBAL = 0;
LOCAL = 1;
@@ -528,3 +535,8 @@ message Vrf {
repeated bytes import_rt = 3;
repeated bytes export_rt = 4;
}
+
+message Global {
+ uint32 as = 1;
+ string router_id = 2;
+}