Skip to content
Snippets Groups Projects
Commit cb622cba authored by Oliver Herms's avatar Oliver Herms
Browse files

RIS: Implement initial dump signaling in ObserveFIB

parent bfebb0f2
No related branches found
No related tags found
No related merge requests found
......@@ -10,8 +10,6 @@ import (
api1 "github.com/bio-routing/bio-rd/route/api"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
......@@ -415,6 +413,7 @@ func (m *ObserveRIBRequest) GetAfisafi() ObserveRIBRequest_AFISAFI {
type RIBUpdate struct {
Advertisement bool `protobuf:"varint,1,opt,name=advertisement,proto3" json:"advertisement,omitempty"`
IsInitialDump bool `protobuf:"varint,3,opt,name=is_initial_dump,json=isInitialDump,proto3" json:"is_initial_dump,omitempty"`
Route *api1.Route `protobuf:"bytes,2,opt,name=route,proto3" json:"route,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
......@@ -453,6 +452,13 @@ func (m *RIBUpdate) GetAdvertisement() bool {
return false
}
func (m *RIBUpdate) GetIsInitialDump() bool {
if m != nil {
return m.IsInitialDump
}
return false
}
func (m *RIBUpdate) GetRoute() *api1.Route {
if m != nil {
return m.Route
......@@ -702,56 +708,58 @@ func init() {
}
var fileDescriptor_ffe1202aa518913f = []byte{
// 633 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xdb, 0x4e, 0xdb, 0x4c,
0x10, 0xc6, 0x04, 0x62, 0x32, 0xf9, 0x7f, 0x0e, 0x4b, 0x29, 0xc1, 0xbd, 0x68, 0x6a, 0x55, 0x95,
0x11, 0xaa, 0x83, 0x42, 0x45, 0x55, 0xf5, 0x24, 0x10, 0x22, 0xb2, 0x04, 0x6d, 0xb4, 0x88, 0x4a,
0xed, 0x45, 0x91, 0x13, 0xaf, 0xe9, 0x4a, 0xf8, 0xd0, 0x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, 0x97, 0x6a, 0x50, 0x97, 0xef, 0xc6, 0xce, 0xcf, 0x00, 0x00, 0x00, 0xff,
0xff, 0x61, 0xf9, 0x2b, 0x4e, 0xdd, 0x06, 0x00, 0x00,
// 659 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x4d, 0x4f, 0xdb, 0x4c,
0x10, 0x66, 0x09, 0xc4, 0x64, 0xf2, 0x42, 0x60, 0x79, 0x29, 0xc1, 0x3d, 0x34, 0xb5, 0x2a, 0x14,
0x84, 0xea, 0xa0, 0x50, 0x51, 0x55, 0xfd, 0x12, 0x08, 0x11, 0x59, 0x82, 0x36, 0x5a, 0x44, 0x0f,
0x3d, 0x34, 0x72, 0xe2, 0x35, 0x5d, 0x09, 0x7f, 0x74, 0x77, 0x13, 0x91, 0x63, 0x7f, 0x41, 0x7f,
0x46, 0x4f, 0xfd, 0x8f, 0x95, 0x77, 0x1d, 0xc7, 0x2e, 0x94, 0x16, 0x2a, 0x2e, 0x89, 0x77, 0x66,
0x9f, 0x99, 0x67, 0x1e, 0xcd, 0xcc, 0xc2, 0xee, 0x39, 0x93, 0x9f, 0x87, 0x7d, 0x7b, 0x10, 0x05,
0xad, 0x3e, 0x8b, 0x9e, 0xf2, 0x68, 0x28, 0x59, 0x78, 0xae, 0xbf, 0xbd, 0xd6, 0x20, 0xf0, 0x5a,
0x9c, 0x89, 0x96, 0x1b, 0xb3, 0xe4, 0xdf, 0x8e, 0x79, 0x24, 0x23, 0x6c, 0xf4, 0x59, 0x64, 0x73,
0x26, 0xcc, 0xd6, 0xcd, 0xe8, 0x90, 0x4a, 0x85, 0x0c, 0xa9, 0xd4, 0x48, 0xf3, 0x0f, 0xe9, 0x92,
0x23, 0xd5, 0xc9, 0x92, 0x2f, 0x0d, 0xb2, 0x3e, 0x01, 0x1c, 0x77, 0x4f, 0x08, 0xfd, 0x32, 0xa4,
0x42, 0xe2,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, 0x0d, 0xa5, 0xe3, 0xee, 0x09, 0x5e, 0xcd, 0xe0, 0xd3, 0x35, 0x66,
0xfe, 0x5f, 0x34, 0xea, 0xd4, 0xd6, 0x4c, 0x82, 0xe9, 0x50, 0x99, 0xc3, 0x4c, 0x37, 0x4c, 0x0e,
0x93, 0x5b, 0x0b, 0xd6, 0x0c, 0xee, 0xe8, 0x3d, 0xa4, 0x39, 0x61, 0xb3, 0x70, 0xab, 0x20, 0xa4,
0xf9, 0xf0, 0x5a, 0x5f, 0x16, 0xe8, 0x10, 0x2a, 0xd9, 0x44, 0xe3, 0x8d, 0xfc, 0xdd, 0xc2, 0x2e,
0x31, 0xcd, 0xeb, 0x5c, 0x59, 0x94, 0x37, 0x00, 0xd3, 0xd9, 0xcb, 0xd1, 0xb9, 0x32, 0x90, 0x26,
0x9e, 0x0a, 0x3b, 0x19, 0xac, 0x1d, 0x84, 0x5f, 0x82, 0x91, 0xb6, 0x0e, 0x5e, 0xff, 0x4d, 0x73,
0x9a, 0x6b, 0x57, 0x1d, 0xf1, 0xc5, 0x78, 0x07, 0x1d, 0x6c, 0x7f, 0xdc, 0xfa, 0xeb, 0x27, 0xad,
0x5f, 0x56, 0x0f, 0xcc, 0xee, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x57, 0x19, 0x12, 0xf0, 0x06,
0x07, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
const _ = grpc.SupportPackageIsVersion4
// RoutingInformationServiceClient is the client API for RoutingInformationService service.
//
......@@ -766,10 +774,10 @@ type RoutingInformationServiceClient interface {
}
type routingInformationServiceClient struct {
cc grpc.ClientConnInterface
cc *grpc.ClientConn
}
func NewRoutingInformationServiceClient(cc grpc.ClientConnInterface) RoutingInformationServiceClient {
func NewRoutingInformationServiceClient(cc *grpc.ClientConn) RoutingInformationServiceClient {
return &routingInformationServiceClient{cc}
}
......@@ -883,29 +891,6 @@ type RoutingInformationServiceServer interface {
DumpRIB(*DumpRIBRequest, RoutingInformationService_DumpRIBServer) error
}
// UnimplementedRoutingInformationServiceServer can be embedded to have forward compatible implementations.
type UnimplementedRoutingInformationServiceServer struct {
}
func (*UnimplementedRoutingInformationServiceServer) LPM(ctx context.Context, req *LPMRequest) (*LPMResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method LPM not implemented")
}
func (*UnimplementedRoutingInformationServiceServer) Get(ctx context.Context, req *GetRequest) (*GetResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (*UnimplementedRoutingInformationServiceServer) GetRouters(ctx context.Context, req *GetRoutersRequest) (*GetRoutersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRouters not implemented")
}
func (*UnimplementedRoutingInformationServiceServer) GetLonger(ctx context.Context, req *GetLongerRequest) (*GetLongerResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetLonger not implemented")
}
func (*UnimplementedRoutingInformationServiceServer) ObserveRIB(req *ObserveRIBRequest, srv RoutingInformationService_ObserveRIBServer) error {
return status.Errorf(codes.Unimplemented, "method ObserveRIB not implemented")
}
func (*UnimplementedRoutingInformationServiceServer) DumpRIB(req *DumpRIBRequest, srv RoutingInformationService_DumpRIBServer) error {
return status.Errorf(codes.Unimplemented, "method DumpRIB not implemented")
}
func RegisterRoutingInformationServiceServer(s *grpc.Server, srv RoutingInformationServiceServer) {
s.RegisterService(&_RoutingInformationService_serviceDesc, srv)
}
......
......@@ -57,6 +57,7 @@ message ObserveRIBRequest {
message RIBUpdate {
bool advertisement = 1;
bool is_initial_dump = 3;
bio.route.Route route = 2;
}
......
......@@ -267,8 +267,17 @@ func newRIBClient(fifo *updateFIFO) *ribClient {
}
func (r *ribClient) AddPath(pfx *net.Prefix, path *route.Path) error {
return r.addPath(pfx, path, false)
}
func (r *ribClient) AddPathInitialDump(pfx *net.Prefix, path *route.Path) error {
return r.addPath(pfx, path, true)
}
func (r *ribClient) addPath(pfx *net.Prefix, path *route.Path, isInitalDump bool) error {
r.fifo.queue(&pb.RIBUpdate{
Advertisement: true,
IsInitialDump: isInitalDump,
Route: &routeapi.Route{
Pfx: pfx.ToProto(),
Paths: []*routeapi.Path{
......@@ -297,6 +306,4 @@ func (r *ribClient) RemovePath(pfx *net.Prefix, path *route.Path) bool {
func (r *ribClient) RefreshRoute(*net.Prefix, []*route.Path) {}
// ReplacePath is here to fulfill an interface
func (r *ribClient) ReplacePath(*net.Prefix, *route.Path, *route.Path) {
}
func (r *ribClient) ReplacePath(*net.Prefix, *route.Path, *route.Path) {}
......@@ -10,8 +10,6 @@ import (
api1 "github.com/bio-routing/bio-rd/route/api"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
......@@ -247,11 +245,11 @@ var fileDescriptor_2d4ce551e16bb738 = []byte{
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
const _ = grpc.SupportPackageIsVersion4
// BgpServiceClient is the client API for BgpService service.
//
......@@ -263,10 +261,10 @@ type BgpServiceClient interface {
}
type bgpServiceClient struct {
cc grpc.ClientConnInterface
cc *grpc.ClientConn
}
func NewBgpServiceClient(cc grpc.ClientConnInterface) BgpServiceClient {
func NewBgpServiceClient(cc *grpc.ClientConn) BgpServiceClient {
return &bgpServiceClient{cc}
}
......@@ -350,20 +348,6 @@ type BgpServiceServer interface {
DumpRIBOut(*DumpRIBRequest, BgpService_DumpRIBOutServer) error
}
// UnimplementedBgpServiceServer can be embedded to have forward compatible implementations.
type UnimplementedBgpServiceServer struct {
}
func (*UnimplementedBgpServiceServer) ListSessions(ctx context.Context, req *ListSessionsRequest) (*ListSessionsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListSessions not implemented")
}
func (*UnimplementedBgpServiceServer) DumpRIBIn(req *DumpRIBRequest, srv BgpService_DumpRIBInServer) error {
return status.Errorf(codes.Unimplemented, "method DumpRIBIn not implemented")
}
func (*UnimplementedBgpServiceServer) DumpRIBOut(req *DumpRIBRequest, srv BgpService_DumpRIBOutServer) error {
return status.Errorf(codes.Unimplemented, "method DumpRIBOut not implemented")
}
func RegisterBgpServiceServer(s *grpc.Server, srv BgpServiceServer) {
s.RegisterService(&_BgpService_serviceDesc, srv)
}
......
......@@ -70,6 +70,10 @@ func (u *UpdateSender) Destroy() {
u.destroyCh <- struct{}{}
}
func (u *UpdateSender) AddPathInitialDump(pfx *bnet.Prefix, p *route.Path) error {
return u.AddPath(pfx, p)
}
// AddPath adds path p for pfx to toSend queue
func (u *UpdateSender) AddPath(pfx *bnet.Prefix, p *route.Path) error {
u.toSendMu.Lock()
......
......@@ -27,6 +27,10 @@ func New() (*Kernel, error) {
return k, nil
}
func (k *Kernel) AddPathInitialDump(pfx *net.Prefix, path *route.Path) error {
return k.AddPath(pfx, path)
}
func (k *Kernel) AddPath(pfx *net.Prefix, path *route.Path) error {
return k.osKernel.AddPath(pfx, path)
}
......
......@@ -124,7 +124,7 @@ func (a *AdjRIBIn) UpdateNewClient(client routingtable.RouteTableClient) error {
continue
}
err := client.AddPath(route.Prefix(), path)
err := client.AddPathInitialDump(route.Prefix(), path)
if err != nil {
log.WithField("Sender", "AdjRIBOutAddPath").WithError(err).Error("Could not send update to client")
}
......
......@@ -116,6 +116,10 @@ func (a *AdjRIBOut) bgpChecks(pfx *bnet.Prefix, p *route.Path) (retPath *route.P
return p, true
}
func (a *AdjRIBOut) AddPathInitialDump(pfx *bnet.Prefix, p *route.Path) error {
return a.AddPath(pfx, p)
}
// AddPath adds path p to prefix `pfx`
func (a *AdjRIBOut) AddPath(pfx *bnet.Prefix, p *route.Path) error {
p, propagate := a.bgpChecks(pfx, p)
......
......@@ -9,6 +9,7 @@ import (
// RouteTableClient is the interface that every route table client must implement
type RouteTableClient interface {
AddPath(pfx *net.Prefix, path *route.Path) error
AddPathInitialDump(pfx *net.Prefix, path *route.Path) error
RemovePath(*net.Prefix, *route.Path) bool
ReplacePath(*net.Prefix, *route.Path, *route.Path)
RefreshRoute(*net.Prefix, []*route.Path)
......@@ -33,6 +34,7 @@ type AdjRIBIn interface {
// AdjRIBOut is the interface any AdjRIBOut must implement
type AdjRIBOut interface {
AdjRIB
AddPathInitialDump(pfx *net.Prefix, path *route.Path) error
ReplacePath(*net.Prefix, *route.Path, *route.Path)
RefreshRoute(*net.Prefix, []*route.Path)
}
......@@ -24,12 +24,19 @@ func (m MockClient) Dump() []*route.Route {
func (m MockClient) AddPath(*net.Prefix, *route.Path) error {
return nil
}
func (m MockClient) AddPathInitialDump(*net.Prefix, *route.Path) error {
return nil
}
func (m MockClient) RemovePath(*net.Prefix, *route.Path) bool {
return false
}
func (m MockClient) UpdateNewClient(RouteTableClient) error {
return nil
}
func (m MockClient) Register(RouteTableClient) {
return
}
......
......@@ -110,7 +110,7 @@ func (a *LocRIB) UpdateNewClient(client routingtable.RouteTableClient) error {
}
for _, p := range r.Paths()[:n] {
client.AddPath(r.Prefix(), p)
client.AddPathInitialDump(r.Prefix(), p)
}
}
......@@ -145,6 +145,10 @@ func (a *LocRIB) RouteCount() int64 {
return a.rt.GetRouteCount()
}
func (a *LocRIB) AddPathInitialDump(pfx *net.Prefix, p *route.Path) error {
return a.AddPath(pfx, p)
}
// AddPath replaces the path for prefix `pfx`. If the prefix doesn't exist it is added.
func (a *LocRIB) AddPath(pfx *net.Prefix, p *route.Path) error {
a.mu.Lock()
......
......@@ -41,6 +41,10 @@ func (m *RTMockClient) AddPath(pfx *net.Prefix, p *route.Path) error {
return nil
}
func (m *RTMockClient) AddPathInitialDump(pfx *net.Prefix, p *route.Path) error {
return nil
}
func (m *RTMockClient) UpdateNewClient(client RouteTableClient) error {
return fmt.Errorf("Not implemented")
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment