diff --git a/apps/bmp-streamer/BUILD.bazel b/apps/bmp-streamer/BUILD.bazel index aab071ebb57a663fe72f74bfa83f2789afd5e26d..ba5c57ce4134d4da9da747198d92e0c0504424c5 100644 --- a/apps/bmp-streamer/BUILD.bazel +++ b/apps/bmp-streamer/BUILD.bazel @@ -7,12 +7,13 @@ go_library( visibility = ["//visibility:private"], deps = [ "//apps/bmp-streamer/pkg/apiserver:go_default_library", - "//apps/bmp-streamer/pkg/bmpsrvapi:go_default_library", + "//apps/bmp-streamer/pkg/bmpstreamer:go_default_library", "//apps/bmp-streamer/pkg/config:go_default_library", + "//lib/grpchelper:go_default_library", "//protocols/bgp/server:go_default_library", - "@com_github_grpc_ecosystem_go_grpc_prometheus//:go_default_library", - "@com_github_sirupsen_logrus//:go_default_library", - "@org_golang_google_grpc//:go_default_library", + "//vendor/github.com/grpc-ecosystem/go-grpc-prometheus:go_default_library", + "//vendor/github.com/sirupsen/logrus:go_default_library", + "//vendor/google.golang.org/grpc:go_default_library", ], ) diff --git a/apps/bmp-streamer/client/BUILD.bazel b/apps/bmp-streamer/client/BUILD.bazel index c1b602cfe85558b4c9e3f54b7a885efcca7caa9e..9f53e3a35d1eab986a914eb263d27bd967082222 100644 --- a/apps/bmp-streamer/client/BUILD.bazel +++ b/apps/bmp-streamer/client/BUILD.bazel @@ -6,10 +6,11 @@ go_library( importpath = "github.com/bio-routing/bio-rd/apps/bmp-streamer/client", visibility = ["//visibility:private"], deps = [ - "//apps/bmp-streamer/pkg/bmpsrvapi:go_default_library", + "//apps/bmp-streamer/pkg/bmpstreamer:go_default_library", "//net:go_default_library", - "@com_github_sirupsen_logrus//:go_default_library", - "@org_golang_google_grpc//:go_default_library", + "//net/api:go_default_library", + "//vendor/github.com/sirupsen/logrus:go_default_library", + "//vendor/google.golang.org/grpc:go_default_library", ], ) diff --git a/apps/bmp-streamer/pkg/apiserver/BUILD.bazel b/apps/bmp-streamer/pkg/apiserver/BUILD.bazel index d3647d909d6038875e5d9e47ee001f14025cdf37..e4644eec6d10356fcdd2da08f6fb4914ff03a8fd 100644 --- a/apps/bmp-streamer/pkg/apiserver/BUILD.bazel +++ b/apps/bmp-streamer/pkg/apiserver/BUILD.bazel @@ -6,11 +6,10 @@ go_library( importpath = "github.com/bio-routing/bio-rd/apps/bmp-streamer/pkg/apiserver", visibility = ["//visibility:public"], deps = [ - "//apps/bmp-streamer/pkg/bmpsrvapi:go_default_library", + "//apps/bmp-streamer/pkg/bmpstreamer:go_default_library", "//net:go_default_library", "//protocols/bgp/packet:go_default_library", "//protocols/bgp/server:go_default_library", - "//protocols/bgp/types:go_default_library", "//route:go_default_library", "//routingtable:go_default_library", ], @@ -21,10 +20,12 @@ go_test( srcs = ["server_test.go"], embed = [":go_default_library"], deps = [ - "//apps/bmp-streamer/pkg/bmpsrvapi:go_default_library", + "//apps/bmp-streamer/pkg/bmpstreamer:go_default_library", "//net:go_default_library", + "//net/api:go_default_library", "//protocols/bgp/types:go_default_library", "//route:go_default_library", - "@com_github_stretchr_testify//assert:go_default_library", + "//route/api:go_default_library", + "//vendor/github.com/stretchr/testify/assert:go_default_library", ], ) diff --git a/apps/bmp-streamer/pkg/apiserver/server.go b/apps/bmp-streamer/pkg/apiserver/server.go index 4b173f7d50e2cf2cc94d8cf840993aec2bde9f39..b4dd11477a8062c63f4f4fefacc9cf55588d98aa 100644 --- a/apps/bmp-streamer/pkg/apiserver/server.go +++ b/apps/bmp-streamer/pkg/apiserver/server.go @@ -25,8 +25,9 @@ func New(bmpServer *server.BMPServer) *APIServer { func (u update) toRIBUpdate() *pb.RIBUpdate { toSend := &pb.RIBUpdate{ - Peer: u.route.Paths()[0].BGPPath.Source.ToProto(), - Route: u.route.ToProto(), + Advertisement: u.advertisement, + Peer: u.route.Paths()[0].BGPPath.Source.ToProto(), + Route: u.route.ToProto(), } return toSend diff --git a/apps/bmp-streamer/pkg/apiserver/server_test.go b/apps/bmp-streamer/pkg/apiserver/server_test.go index afa295496860bb70da32069baf6c7210ce4ce09e..62364af3c013aca8c5da813f5816e2bdb556466c 100644 --- a/apps/bmp-streamer/pkg/apiserver/server_test.go +++ b/apps/bmp-streamer/pkg/apiserver/server_test.go @@ -3,10 +3,12 @@ package apiserver import ( "testing" - pb "github.com/bio-routing/bio-rd/apps/bmp-streamer/pkg/bmpsrvapi" + pb "github.com/bio-routing/bio-rd/apps/bmp-streamer/pkg/bmpstreamer" "github.com/bio-routing/bio-rd/net" + apinet "github.com/bio-routing/bio-rd/net/api" "github.com/bio-routing/bio-rd/protocols/bgp/types" "github.com/bio-routing/bio-rd/route" + apiroute "github.com/bio-routing/bio-rd/route/api" "github.com/stretchr/testify/assert" ) @@ -20,8 +22,7 @@ func TestUpdateToRIBUpdate(t *testing.T) { name: "Basics advert.", u: update{ advertisement: true, - prefix: net.NewPfx(net.IPv4(200), 8), - path: &route.Path{ + route: route.NewRoute(net.NewPfx(net.IPv4(200), 8), &route.Path{ Type: route.BGPPathType, BGPPath: &route.BGPPath{ PathIdentifier: 10, @@ -58,61 +59,63 @@ func TestUpdateToRIBUpdate(t *testing.T) { OriginatorID: 5, ClusterList: []uint32{3, 4, 5}, }, - }, + }), }, expected: &pb.RIBUpdate{ - Peer: &pb.IP{ - Lower: 220, - IPVersion: 4, + Peer: &apinet.IP{ + Lower: 220, + IsLegacy: true, }, Advertisement: true, - Route: &pb.Route{ - Pfx: &pb.Prefix{ - Address: &pb.IP{ - Lower: 200, - IPVersion: 4, + Route: &apiroute.Route{ + Pfx: &apinet.Prefix{ + Address: &apinet.IP{ + Lower: 200, + IsLegacy: true, }, Pfxlen: 8, }, - Path: &pb.Path{ - Type: route.BGPPathType, - BGPPath: &pb.BGPPath{ - PathIdentifier: 10, - NextHop: &pb.IP{ - Lower: 210, - IPVersion: 4, - }, - LocalPref: 20, - ASPath: []*pb.ASPathSegment{ - { - ASSequence: true, - ASNs: []uint32{100, 200, 300}, + Paths: []*apiroute.Path{ + { + Type: route.BGPPathType, + BGPPath: &apiroute.BGPPath{ + PathIdentifier: 10, + NextHop: &apinet.IP{ + Lower: 210, + IsLegacy: true, }, - }, - Origin: 1, - MED: 1000, - EBGP: true, - BGPIdentifier: 1337, - Source: &pb.IP{ - Lower: 220, - IPVersion: 4, - }, - Communities: []uint32{10000, 20000}, - LargeCommunities: []*pb.LargeCommunity{ - { - GlobalAdministrator: 1, - DataPart1: 2, - DataPart2: 3, + LocalPref: 20, + ASPath: []*apiroute.ASPathSegment{ + { + ASSequence: true, + ASNs: []uint32{100, 200, 300}, + }, }, - }, - ClusterList: []uint32{3, 4, 5}, - UnknownAttributes: []*pb.UnknownAttribute{ - { - Optional: true, - Transitive: true, - Partial: true, - TypeCode: 222, - Value: []byte{1, 1, 1, 1}, + Origin: 1, + MED: 1000, + EBGP: true, + BGPIdentifier: 1337, + Source: &apinet.IP{ + Lower: 220, + IsLegacy: true, + }, + Communities: []uint32{10000, 20000}, + LargeCommunities: []*apiroute.LargeCommunity{ + { + GlobalAdministrator: 1, + DataPart1: 2, + DataPart2: 3, + }, + }, + ClusterList: []uint32{3, 4, 5}, + UnknownAttributes: []*apiroute.UnknownAttribute{ + { + Optional: true, + Transitive: true, + Partial: true, + TypeCode: 222, + Value: []byte{1, 1, 1, 1}, + }, }, }, }, diff --git a/apps/bmp-streamer/pkg/bmpstreamer/BUILD.bazel b/apps/bmp-streamer/pkg/bmpstreamer/BUILD.bazel index d276bf1241b7c34efeb203a030596cbccfb83a43..2767e766f748994e8ac6600563e5161377b206ce 100644 --- a/apps/bmp-streamer/pkg/bmpstreamer/BUILD.bazel +++ b/apps/bmp-streamer/pkg/bmpstreamer/BUILD.bazel @@ -2,22 +2,30 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") proto_library( - name = "bmpsrvapi_proto", - srcs = ["api.proto"], + name = "bmpstreamer_proto", + srcs = ["bmp.proto"], visibility = ["//visibility:public"], + deps = [ + "//github.com/bio-routing/bio-rd/net/api:api_proto", + "//github.com/bio-routing/bio-rd/route/api:api_proto", + ], ) go_proto_library( - name = "bmpsrvapi_go_proto", + name = "bmpstreamer_go_proto", compilers = ["@io_bazel_rules_go//proto:go_grpc"], - importpath = "github.com/bio-routing/bio-rd/apps/bmp-streamer/pkg/bmpsrvapi", - proto = ":bmpsrvapi_proto", + importpath = "github.com/bio-routing/bio-rd/apps/bmp-streamer/pkg/bmpstreamer", + proto = ":bmpstreamer_proto", visibility = ["//visibility:public"], + deps = [ + "//github.com/bio-routing/bio-rd/net/api:go_default_library", + "//github.com/bio-routing/bio-rd/route/api:go_default_library", + ], ) go_library( name = "go_default_library", - embed = [":bmpsrvapi_go_proto"], - importpath = "github.com/bio-routing/bio-rd/apps/bmp-streamer/pkg/bmpsrvapi", + embed = [":bmpstreamer_go_proto"], + importpath = "github.com/bio-routing/bio-rd/apps/bmp-streamer/pkg/bmpstreamer", visibility = ["//visibility:public"], ) diff --git a/apps/bmp-streamer/pkg/config/BUILD.bazel b/apps/bmp-streamer/pkg/config/BUILD.bazel index 3864466b81ae58857d4e9d61015841cf486012a8..997db4799f83fbb0fc2de4fc8068b3d0db7d805b 100644 --- a/apps/bmp-streamer/pkg/config/BUILD.bazel +++ b/apps/bmp-streamer/pkg/config/BUILD.bazel @@ -5,5 +5,5 @@ go_library( srcs = ["config.go"], importpath = "github.com/bio-routing/bio-rd/apps/bmp-streamer/pkg/config", visibility = ["//visibility:public"], - deps = ["@in_gopkg_yaml_v2//:go_default_library"], + deps = ["//vendor/gopkg.in/yaml.v2:go_default_library"], ) diff --git a/net/api/BUILD.bazel b/net/api/BUILD.bazel index 720db1c0ca8d6b7e4e68a99dd6a4a23a80a6556b..59196d7dba5222eca0ac66140d91a4bff4119342 100644 --- a/net/api/BUILD.bazel +++ b/net/api/BUILD.bazel @@ -2,21 +2,21 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") proto_library( - name = "api_proto", + name = "bio_net_proto", srcs = ["net.proto"], visibility = ["//visibility:public"], ) go_proto_library( - name = "api_go_proto", + name = "bio_net_go_proto", importpath = "github.com/bio-routing/bio-rd/net/api", - proto = ":api_proto", + proto = ":bio_net_proto", visibility = ["//visibility:public"], ) go_library( name = "go_default_library", - embed = [":api_go_proto"], + embed = [":bio_net_go_proto"], importpath = "github.com/bio-routing/bio-rd/net/api", visibility = ["//visibility:public"], ) diff --git a/net/api/net.pb.go b/net/api/net.pb.go deleted file mode 100644 index 6c617e3044b22031991d61809481ae3a42efd359..0000000000000000000000000000000000000000 --- a/net/api/net.pb.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/bio-routing/bio-rd/net/api/net.proto - -/* -Package api is a generated protocol buffer package. - -It is generated from these files: - github.com/bio-routing/bio-rd/net/api/net.proto - -It has these top-level messages: - Prefix - IP -*/ -package api - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type Prefix struct { - Address *IP `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` - Pfxlen uint32 `protobuf:"varint,2,opt,name=pfxlen" json:"pfxlen,omitempty"` -} - -func (m *Prefix) Reset() { *m = Prefix{} } -func (m *Prefix) String() string { return proto.CompactTextString(m) } -func (*Prefix) ProtoMessage() {} -func (*Prefix) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -func (m *Prefix) GetAddress() *IP { - if m != nil { - return m.Address - } - return nil -} - -func (m *Prefix) GetPfxlen() uint32 { - if m != nil { - return m.Pfxlen - } - return 0 -} - -type IP struct { - Higher uint64 `protobuf:"varint,1,opt,name=higher" json:"higher,omitempty"` - Lower uint64 `protobuf:"varint,2,opt,name=lower" json:"lower,omitempty"` - IsLegacy bool `protobuf:"varint,3,opt,name=is_legacy,json=isLegacy" json:"is_legacy,omitempty"` -} - -func (m *IP) Reset() { *m = IP{} } -func (m *IP) String() string { return proto.CompactTextString(m) } -func (*IP) ProtoMessage() {} -func (*IP) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func (m *IP) GetHigher() uint64 { - if m != nil { - return m.Higher - } - return 0 -} - -func (m *IP) GetLower() uint64 { - if m != nil { - return m.Lower - } - return 0 -} - -func (m *IP) GetIsLegacy() bool { - if m != nil { - return m.IsLegacy - } - return false -} - -func init() { - proto.RegisterType((*Prefix)(nil), "api.Prefix") - proto.RegisterType((*IP)(nil), "api.IP") -} - -func init() { proto.RegisterFile("github.com/bio-routing/bio-rd/net/api/net.proto", fileDescriptor0) } - -var fileDescriptor0 = []byte{ - // 193 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0xce, 0xc1, 0x6a, 0x84, 0x30, - 0x10, 0x06, 0x60, 0xa2, 0x56, 0x6d, 0x4a, 0x2f, 0xa1, 0x14, 0xa1, 0x17, 0xeb, 0xc9, 0x4b, 0x13, - 0x68, 0x1f, 0xa1, 0x27, 0xa1, 0x50, 0xc9, 0x0b, 0x94, 0xa8, 0x31, 0x0e, 0x58, 0x13, 0x92, 0xc8, - 0xba, 0x6f, 0xbf, 0x18, 0xdd, 0xd3, 0xcc, 0x37, 0xc3, 0x0f, 0x3f, 0x66, 0x0a, 0xfc, 0xb4, 0x76, - 0xb4, 0xd7, 0xff, 0xac, 0x03, 0xfd, 0x61, 0xf5, 0xea, 0x61, 0x51, 0xc7, 0x3e, 0xb0, 0x45, 0x7a, - 0x26, 0x0c, 0xec, 0x93, 0x1a, 0xab, 0xbd, 0x26, 0xb1, 0x30, 0x50, 0x7d, 0xe3, 0xb4, 0xb5, 0x72, - 0x84, 0x8d, 0xbc, 0xe3, 0x4c, 0x0c, 0x83, 0x95, 0xce, 0x15, 0xa8, 0x44, 0xf5, 0xd3, 0x67, 0x46, - 0x85, 0x01, 0xda, 0xb4, 0xfc, 0x7e, 0x27, 0xaf, 0x38, 0x35, 0xe3, 0x36, 0xcb, 0xa5, 0x88, 0x4a, - 0x54, 0x3f, 0xf3, 0x53, 0xd5, 0x2f, 0x8e, 0x9a, 0x76, 0xff, 0x4e, 0xa0, 0x26, 0x69, 0x43, 0x3e, - 0xe1, 0xa7, 0xc8, 0x0b, 0x7e, 0x98, 0xf5, 0x45, 0xda, 0x10, 0x4a, 0xf8, 0x01, 0xf2, 0x86, 0x1f, - 0xc1, 0xfd, 0xcd, 0x52, 0x89, 0xfe, 0x5a, 0xc4, 0x25, 0xaa, 0x73, 0x9e, 0x83, 0xfb, 0x09, 0xee, - 0xd2, 0xd0, 0xf0, 0xeb, 0x16, 0x00, 0x00, 0xff, 0xff, 0x19, 0xac, 0x48, 0x5d, 0xd4, 0x00, 0x00, - 0x00, -} diff --git a/net/api/net.proto b/net/api/net.proto index 9253389210be8b159900aa46b68bdf08752e6ee5..dfd7bad01b06df2e4571cc5f80ad64567b58c774 100644 --- a/net/api/net.proto +++ b/net/api/net.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package bio.net; +go_package api; message Prefix { IP address = 1; diff --git a/net/prefix_test.go b/net/prefix_test.go index 62151e1dec162006e2fb3c6b7606116dcfaf5bd7..52e2aea669be427ac6421bdf00a7bed0f946e6e9 100644 --- a/net/prefix_test.go +++ b/net/prefix_test.go @@ -11,7 +11,7 @@ func TestPrefixToProto(t *testing.T) { tests := []struct { name string pfx Prefix - expected api.Prefix + expected *api.Prefix }{ { name: "IPv4", @@ -22,7 +22,7 @@ func TestPrefixToProto(t *testing.T) { }, pfxlen: 24, }, - expected: api.Prefix{ + expected: &api.Prefix{ Address: &api.IP{ Lower: 200, IsLegacy: true, @@ -40,7 +40,7 @@ func TestPrefixToProto(t *testing.T) { }, pfxlen: 64, }, - expected: api.Prefix{ + expected: &api.Prefix{ Address: &api.IP{ Higher: 100, Lower: 200, diff --git a/route/BUILD.bazel b/route/BUILD.bazel index 3673d29995e0ef11a14bbd7043135457f7ea1d7e..df60f6b8d968059f9b3380b485794cc849e7b30d 100644 --- a/route/BUILD.bazel +++ b/route/BUILD.bazel @@ -13,7 +13,9 @@ go_library( visibility = ["//visibility:public"], deps = [ "//net:go_default_library", + "//net/api:go_default_library", "//protocols/bgp/types:go_default_library", + "//route/api:go_default_library", "//vendor/github.com/taktv6/tflow2/convert:go_default_library", ], ) @@ -25,11 +27,14 @@ go_test( "bgp_test.go", "path_test.go", "route_test.go", + "static_test.go", ], embed = [":go_default_library"], deps = [ "//net:go_default_library", + "//net/api:go_default_library", "//protocols/bgp/types:go_default_library", + "//route/api:go_default_library", "//vendor/github.com/stretchr/testify/assert:go_default_library", ], ) diff --git a/route/api/route.pb.go b/route/api/route.pb.go deleted file mode 100644 index 0aff4db4fedae53378b18c49295ad764e4867c18..0000000000000000000000000000000000000000 --- a/route/api/route.pb.go +++ /dev/null @@ -1,392 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/bio-routing/bio-rd/route/api/route.proto - -/* -Package bio_route is a generated protocol buffer package. - -It is generated from these files: - github.com/bio-routing/bio-rd/route/api/route.proto - -It has these top-level messages: - Route - Path - StaticPath - BGPPath - ASPathSegment - LargeCommunity - UnknownAttribute -*/ -package bio_route - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import bio_net "github.com/bio-routing/bio-rd/net/api" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type Route struct { - Pfx *bio_net.Prefix `protobuf:"bytes,1,opt,name=pfx" json:"pfx,omitempty"` - Paths []*Path `protobuf:"bytes,2,rep,name=paths" json:"paths,omitempty"` -} - -func (m *Route) Reset() { *m = Route{} } -func (m *Route) String() string { return proto.CompactTextString(m) } -func (*Route) ProtoMessage() {} -func (*Route) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -func (m *Route) GetPfx() *bio_net.Prefix { - if m != nil { - return m.Pfx - } - return nil -} - -func (m *Route) GetPaths() []*Path { - if m != nil { - return m.Paths - } - return nil -} - -type Path struct { - Type uint32 `protobuf:"varint,1,opt,name=type" json:"type,omitempty"` - BGPPath *BGPPath `protobuf:"bytes,2,opt,name=BGP_path,json=BGPPath" json:"BGP_path,omitempty"` - StaticPath *StaticPath `protobuf:"bytes,3,opt,name=static_path,json=staticPath" json:"static_path,omitempty"` -} - -func (m *Path) Reset() { *m = Path{} } -func (m *Path) String() string { return proto.CompactTextString(m) } -func (*Path) ProtoMessage() {} -func (*Path) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func (m *Path) GetType() uint32 { - if m != nil { - return m.Type - } - return 0 -} - -func (m *Path) GetBGPPath() *BGPPath { - if m != nil { - return m.BGPPath - } - return nil -} - -func (m *Path) GetStaticPath() *StaticPath { - if m != nil { - return m.StaticPath - } - return nil -} - -type StaticPath struct { - NextHop *bio_net.IP `protobuf:"bytes,1,opt,name=next_hop,json=nextHop" json:"next_hop,omitempty"` -} - -func (m *StaticPath) Reset() { *m = StaticPath{} } -func (m *StaticPath) String() string { return proto.CompactTextString(m) } -func (*StaticPath) ProtoMessage() {} -func (*StaticPath) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } - -func (m *StaticPath) GetNextHop() *bio_net.IP { - if m != nil { - return m.NextHop - } - return nil -} - -type BGPPath struct { - PathIdentifier uint32 `protobuf:"varint,1,opt,name=path_identifier,json=pathIdentifier" json:"path_identifier,omitempty"` - NextHop *bio_net.IP `protobuf:"bytes,2,opt,name=next_hop,json=nextHop" json:"next_hop,omitempty"` - LocalPref uint32 `protobuf:"varint,3,opt,name=local_pref,json=localPref" json:"local_pref,omitempty"` - ASPath []*ASPathSegment `protobuf:"bytes,4,rep,name=AS_path,json=ASPath" json:"AS_path,omitempty"` - Origin uint32 `protobuf:"varint,5,opt,name=origin" json:"origin,omitempty"` - MED uint32 `protobuf:"varint,6,opt,name=MED" json:"MED,omitempty"` - EBGP bool `protobuf:"varint,7,opt,name=EBGP" json:"EBGP,omitempty"` - BGPIdentifier uint32 `protobuf:"varint,8,opt,name=BGP_identifier,json=BGPIdentifier" json:"BGP_identifier,omitempty"` - Source *bio_net.IP `protobuf:"bytes,9,opt,name=source" json:"source,omitempty"` - Communities []uint32 `protobuf:"varint,10,rep,packed,name=communities" json:"communities,omitempty"` - LargeCommunities []*LargeCommunity `protobuf:"bytes,11,rep,name=large_communities,json=largeCommunities" json:"large_communities,omitempty"` - OriginatorId uint32 `protobuf:"varint,12,opt,name=originator_id,json=originatorId" json:"originator_id,omitempty"` - ClusterList []uint32 `protobuf:"varint,13,rep,packed,name=cluster_list,json=clusterList" json:"cluster_list,omitempty"` - UnknownAttributes []*UnknownAttribute `protobuf:"bytes,14,rep,name=unknown_attributes,json=unknownAttributes" json:"unknown_attributes,omitempty"` -} - -func (m *BGPPath) Reset() { *m = BGPPath{} } -func (m *BGPPath) String() string { return proto.CompactTextString(m) } -func (*BGPPath) ProtoMessage() {} -func (*BGPPath) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } - -func (m *BGPPath) GetPathIdentifier() uint32 { - if m != nil { - return m.PathIdentifier - } - return 0 -} - -func (m *BGPPath) GetNextHop() *bio_net.IP { - if m != nil { - return m.NextHop - } - return nil -} - -func (m *BGPPath) GetLocalPref() uint32 { - if m != nil { - return m.LocalPref - } - return 0 -} - -func (m *BGPPath) GetASPath() []*ASPathSegment { - if m != nil { - return m.ASPath - } - return nil -} - -func (m *BGPPath) GetOrigin() uint32 { - if m != nil { - return m.Origin - } - return 0 -} - -func (m *BGPPath) GetMED() uint32 { - if m != nil { - return m.MED - } - return 0 -} - -func (m *BGPPath) GetEBGP() bool { - if m != nil { - return m.EBGP - } - return false -} - -func (m *BGPPath) GetBGPIdentifier() uint32 { - if m != nil { - return m.BGPIdentifier - } - return 0 -} - -func (m *BGPPath) GetSource() *bio_net.IP { - if m != nil { - return m.Source - } - return nil -} - -func (m *BGPPath) GetCommunities() []uint32 { - if m != nil { - return m.Communities - } - return nil -} - -func (m *BGPPath) GetLargeCommunities() []*LargeCommunity { - if m != nil { - return m.LargeCommunities - } - return nil -} - -func (m *BGPPath) GetOriginatorId() uint32 { - if m != nil { - return m.OriginatorId - } - return 0 -} - -func (m *BGPPath) GetClusterList() []uint32 { - if m != nil { - return m.ClusterList - } - return nil -} - -func (m *BGPPath) GetUnknownAttributes() []*UnknownAttribute { - if m != nil { - return m.UnknownAttributes - } - return nil -} - -type ASPathSegment struct { - ASSequence bool `protobuf:"varint,1,opt,name=AS_sequence,json=ASSequence" json:"AS_sequence,omitempty"` - ASNs []uint32 `protobuf:"varint,2,rep,packed,name=ASNs" json:"ASNs,omitempty"` -} - -func (m *ASPathSegment) Reset() { *m = ASPathSegment{} } -func (m *ASPathSegment) String() string { return proto.CompactTextString(m) } -func (*ASPathSegment) ProtoMessage() {} -func (*ASPathSegment) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } - -func (m *ASPathSegment) GetASSequence() bool { - if m != nil { - return m.ASSequence - } - return false -} - -func (m *ASPathSegment) GetASNs() []uint32 { - if m != nil { - return m.ASNs - } - return nil -} - -type LargeCommunity struct { - GlobalAdministrator uint32 `protobuf:"varint,1,opt,name=global_administrator,json=globalAdministrator" json:"global_administrator,omitempty"` - DataPart1 uint32 `protobuf:"varint,2,opt,name=data_part1,json=dataPart1" json:"data_part1,omitempty"` - DataPart2 uint32 `protobuf:"varint,3,opt,name=data_part2,json=dataPart2" json:"data_part2,omitempty"` -} - -func (m *LargeCommunity) Reset() { *m = LargeCommunity{} } -func (m *LargeCommunity) String() string { return proto.CompactTextString(m) } -func (*LargeCommunity) ProtoMessage() {} -func (*LargeCommunity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } - -func (m *LargeCommunity) GetGlobalAdministrator() uint32 { - if m != nil { - return m.GlobalAdministrator - } - return 0 -} - -func (m *LargeCommunity) GetDataPart1() uint32 { - if m != nil { - return m.DataPart1 - } - return 0 -} - -func (m *LargeCommunity) GetDataPart2() uint32 { - if m != nil { - return m.DataPart2 - } - return 0 -} - -type UnknownAttribute struct { - Optional bool `protobuf:"varint,1,opt,name=optional" json:"optional,omitempty"` - Transitive bool `protobuf:"varint,2,opt,name=transitive" json:"transitive,omitempty"` - Partial bool `protobuf:"varint,3,opt,name=partial" json:"partial,omitempty"` - TypeCode uint32 `protobuf:"varint,4,opt,name=type_code,json=typeCode" json:"type_code,omitempty"` - Value []byte `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *UnknownAttribute) Reset() { *m = UnknownAttribute{} } -func (m *UnknownAttribute) String() string { return proto.CompactTextString(m) } -func (*UnknownAttribute) ProtoMessage() {} -func (*UnknownAttribute) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } - -func (m *UnknownAttribute) GetOptional() bool { - if m != nil { - return m.Optional - } - return false -} - -func (m *UnknownAttribute) GetTransitive() bool { - if m != nil { - return m.Transitive - } - return false -} - -func (m *UnknownAttribute) GetPartial() bool { - if m != nil { - return m.Partial - } - return false -} - -func (m *UnknownAttribute) GetTypeCode() uint32 { - if m != nil { - return m.TypeCode - } - return 0 -} - -func (m *UnknownAttribute) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func init() { - proto.RegisterType((*Route)(nil), "bio.route.Route") - proto.RegisterType((*Path)(nil), "bio.route.Path") - proto.RegisterType((*StaticPath)(nil), "bio.route.StaticPath") - proto.RegisterType((*BGPPath)(nil), "bio.route.BGPPath") - proto.RegisterType((*ASPathSegment)(nil), "bio.route.ASPathSegment") - proto.RegisterType((*LargeCommunity)(nil), "bio.route.LargeCommunity") - proto.RegisterType((*UnknownAttribute)(nil), "bio.route.UnknownAttribute") -} - -func init() { - proto.RegisterFile("github.com/bio-routing/bio-rd/route/api/route.proto", fileDescriptor0) -} - -var fileDescriptor0 = []byte{ - // 682 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0x5d, 0x4f, 0xdb, 0x3c, - 0x14, 0x56, 0xe9, 0x57, 0x7a, 0xda, 0x14, 0xf0, 0xcb, 0xfb, 0x2a, 0x2f, 0x68, 0x5b, 0x29, 0x62, - 0xe3, 0x86, 0x56, 0xc0, 0xb4, 0xfb, 0x16, 0x58, 0xc7, 0xc4, 0xa6, 0xcc, 0xd1, 0xae, 0x23, 0x37, - 0x71, 0x5b, 0x6b, 0xa9, 0x9d, 0x39, 0x0e, 0x83, 0xcb, 0xfd, 0x8e, 0xfd, 0x8d, 0xfd, 0xc0, 0xc9, - 0x76, 0x5a, 0x52, 0xa6, 0xed, 0xee, 0x9c, 0xe7, 0x39, 0x5f, 0x4f, 0xce, 0x89, 0xe1, 0x62, 0xce, - 0xd4, 0x22, 0x9f, 0x0e, 0x22, 0xb1, 0x1c, 0x4e, 0x99, 0x38, 0x95, 0x22, 0x57, 0x8c, 0xcf, 0xad, - 0x1d, 0x0f, 0xb5, 0x4b, 0x87, 0x24, 0x65, 0xd6, 0x1a, 0xa4, 0x52, 0x28, 0x81, 0x5a, 0x53, 0x26, - 0x06, 0x06, 0xd8, 0x1f, 0xfe, 0x3d, 0x9f, 0x53, 0x65, 0xb2, 0x39, 0x55, 0x36, 0xb7, 0xff, 0x09, - 0xea, 0x58, 0x67, 0xa2, 0x43, 0xa8, 0xa6, 0xb3, 0x7b, 0xaf, 0xd2, 0xab, 0x9c, 0xb4, 0xcf, 0xb7, - 0x07, 0xba, 0xa4, 0x8e, 0xf2, 0x25, 0x9d, 0xb1, 0x7b, 0xac, 0x39, 0x74, 0x0c, 0xf5, 0x94, 0xa8, - 0x45, 0xe6, 0x6d, 0xf5, 0xaa, 0xeb, 0x20, 0x3b, 0x88, 0x4f, 0xd4, 0x02, 0x5b, 0xb6, 0xff, 0xbd, - 0x02, 0x35, 0xed, 0x23, 0x04, 0x35, 0xf5, 0x90, 0x52, 0x53, 0xd3, 0xc5, 0xc6, 0x46, 0xa7, 0xe0, - 0x8c, 0x27, 0x7e, 0xa8, 0x23, 0xbd, 0x2d, 0xd3, 0x0b, 0x95, 0xca, 0x8c, 0x27, 0xbe, 0xa9, 0xd4, - 0x2c, 0x0c, 0xf4, 0x06, 0xda, 0x99, 0x22, 0x8a, 0x45, 0x36, 0xa3, 0x6a, 0x32, 0xfe, 0x2d, 0x65, - 0x04, 0x86, 0x35, 0x49, 0x90, 0xad, 0xed, 0xfe, 0x6b, 0x80, 0x47, 0x06, 0xbd, 0x04, 0x87, 0xd3, - 0x7b, 0x15, 0x2e, 0x44, 0x5a, 0x08, 0x6c, 0xaf, 0x05, 0xde, 0xf8, 0xb8, 0xa9, 0xc9, 0x77, 0x22, - 0xed, 0xff, 0xac, 0xc1, 0xba, 0xf3, 0x2b, 0xd8, 0xd6, 0x2d, 0x43, 0x16, 0x53, 0xae, 0xd8, 0x8c, - 0x51, 0x59, 0xe8, 0xe8, 0x6a, 0xf8, 0x66, 0x8d, 0x6e, 0x14, 0xdf, 0xfa, 0x73, 0x71, 0xf4, 0x0c, - 0x20, 0x11, 0x11, 0x49, 0xc2, 0x54, 0xd2, 0x99, 0x51, 0xe2, 0xe2, 0x96, 0x41, 0xf4, 0x37, 0x46, - 0x67, 0xd0, 0x1c, 0x05, 0x56, 0x65, 0xcd, 0x7c, 0x5e, 0xaf, 0xa4, 0x72, 0x14, 0xe8, 0x99, 0x02, - 0x3a, 0x5f, 0x52, 0xae, 0x70, 0xc3, 0xba, 0xe8, 0x3f, 0x68, 0x08, 0xc9, 0xe6, 0x8c, 0x7b, 0x75, - 0x53, 0xad, 0xf0, 0xd0, 0x0e, 0x54, 0x3f, 0x5c, 0x5f, 0x79, 0x0d, 0x03, 0x6a, 0x53, 0x6f, 0xe2, - 0x7a, 0x3c, 0xf1, 0xbd, 0x66, 0xaf, 0x72, 0xe2, 0x60, 0x63, 0xa3, 0x63, 0xe8, 0xea, 0x4d, 0x94, - 0xf4, 0x39, 0x26, 0xc1, 0x1d, 0x4f, 0xfc, 0x92, 0xbc, 0x23, 0x68, 0x64, 0x22, 0x97, 0x11, 0xf5, - 0x5a, 0xbf, 0x8b, 0x2b, 0x28, 0xd4, 0x83, 0x76, 0x24, 0x96, 0xcb, 0x9c, 0x33, 0xc5, 0x68, 0xe6, - 0x41, 0xaf, 0x7a, 0xe2, 0xe2, 0x32, 0x84, 0xde, 0xc2, 0x6e, 0x42, 0xe4, 0x9c, 0x86, 0xe5, 0xb8, - 0xb6, 0x11, 0xfa, 0x7f, 0x49, 0xe8, 0xad, 0x8e, 0xb9, 0x2c, 0x42, 0x1e, 0xf0, 0x4e, 0x52, 0xf6, - 0x75, 0x9d, 0x23, 0x70, 0xad, 0x4a, 0xa2, 0x84, 0x0c, 0x59, 0xec, 0x75, 0xcc, 0xd0, 0x9d, 0x47, - 0xf0, 0x26, 0x46, 0x87, 0xd0, 0x89, 0x92, 0x3c, 0x53, 0x54, 0x86, 0x09, 0xcb, 0x94, 0xe7, 0x16, - 0xf3, 0x58, 0xec, 0x96, 0x65, 0x0a, 0xbd, 0x07, 0x94, 0xf3, 0x2f, 0x5c, 0x7c, 0xe3, 0x21, 0x51, - 0x4a, 0xb2, 0x69, 0xae, 0x68, 0xe6, 0x75, 0xcd, 0x40, 0x07, 0xa5, 0x81, 0x3e, 0xdb, 0xa0, 0xd1, - 0x2a, 0x06, 0xef, 0xe6, 0x4f, 0x90, 0xac, 0x7f, 0x05, 0xee, 0xc6, 0x82, 0xd0, 0x0b, 0x68, 0x8f, - 0x82, 0x30, 0xa3, 0x5f, 0x73, 0xca, 0x23, 0x7b, 0xff, 0x0e, 0x86, 0x51, 0x10, 0x14, 0x88, 0xde, - 0xc7, 0x28, 0xf8, 0x68, 0x7f, 0x24, 0x17, 0x1b, 0x5b, 0xff, 0x36, 0xdd, 0x4d, 0xf9, 0xe8, 0x0c, - 0xf6, 0xe6, 0x89, 0x98, 0x92, 0x24, 0x24, 0xf1, 0x92, 0x71, 0x96, 0x29, 0xa9, 0x15, 0x16, 0x87, - 0xf8, 0x8f, 0xe5, 0x46, 0x65, 0x4a, 0x5f, 0x59, 0x4c, 0x14, 0x09, 0x53, 0x22, 0xd5, 0x99, 0xb9, - 0x47, 0x17, 0xb7, 0x34, 0xe2, 0x6b, 0x60, 0x83, 0x3e, 0x5f, 0x1d, 0xe1, 0x8a, 0x3e, 0xef, 0xff, - 0xa8, 0xc0, 0xce, 0x53, 0xc5, 0x68, 0x1f, 0x1c, 0x91, 0x2a, 0x26, 0x38, 0x49, 0x0a, 0x29, 0x6b, - 0x1f, 0x3d, 0x07, 0x50, 0x92, 0xf0, 0x8c, 0x29, 0x76, 0x47, 0x4d, 0x3b, 0x07, 0x97, 0x10, 0xe4, - 0x41, 0x53, 0xb7, 0x62, 0x24, 0x31, 0xcd, 0x1c, 0xbc, 0x72, 0xd1, 0x01, 0xb4, 0xf4, 0x83, 0x10, - 0x46, 0x22, 0xa6, 0x5e, 0xcd, 0x0c, 0xe2, 0x68, 0xe0, 0x52, 0xc4, 0x14, 0xed, 0x41, 0xfd, 0x8e, - 0x24, 0x39, 0x35, 0x87, 0xdd, 0xc1, 0xd6, 0x99, 0x36, 0xcc, 0x93, 0x75, 0xf1, 0x2b, 0x00, 0x00, - 0xff, 0xff, 0xe9, 0x5f, 0x53, 0x36, 0x25, 0x05, 0x00, 0x00, -} diff --git a/route/api/route.proto b/route/api/route.proto index eff70408ac421e0d47be93e4bbb1c4f92b2b8fac..761edd7b358e1a8dc590ba05f9a5ff4de4eddc8b 100644 --- a/route/api/route.proto +++ b/route/api/route.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package bio.route; +go_package api; import "github.com/bio-routing/bio-rd/net/api/net.proto";