summaryrefslogtreecommitdiffhomepage
path: root/api
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-07-29 02:46:38 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-03 14:18:18 +0900
commit46b21a1725111dff416f483a12171d03359df3bf (patch)
tree07205415b6457c4c6b344c424a0afd197fda8240 /api
parent28ae39ae03a2d6c6727c82a93172003f5bd99d5d (diff)
mrt: support mrt rib dump of neighbor's local rib
This feature can be used in route-server env. CLI syntax changed like below $ gobgp mrt dump rib global [<interval>] $ gobgp mrt dump rib neighbor <neighbor addr> [<interval>] Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'api')
-rw-r--r--api/gobgp.pb.go7
-rw-r--r--api/gobgp.proto1
-rw-r--r--api/util.go20
3 files changed, 25 insertions, 3 deletions
diff --git a/api/gobgp.pb.go b/api/gobgp.pb.go
index 40a1e596..901abcad 100644
--- a/api/gobgp.pb.go
+++ b/api/gobgp.pb.go
@@ -633,9 +633,10 @@ func (m *PolicyArguments) GetApplyPolicy() *ApplyPolicy {
}
type MrtArguments struct {
- Resource Resource `protobuf:"varint,1,opt,name=resource,enum=api.Resource" json:"resource,omitempty"`
- Af *AddressFamily `protobuf:"bytes,2,opt,name=af" json:"af,omitempty"`
- Interval uint64 `protobuf:"varint,3,opt,name=interval" json:"interval,omitempty"`
+ Resource Resource `protobuf:"varint,1,opt,name=resource,enum=api.Resource" json:"resource,omitempty"`
+ Af *AddressFamily `protobuf:"bytes,2,opt,name=af" json:"af,omitempty"`
+ Interval uint64 `protobuf:"varint,3,opt,name=interval" json:"interval,omitempty"`
+ NeighborAddress string `protobuf:"bytes,4,opt,name=neighbor_address" json:"neighbor_address,omitempty"`
}
func (m *MrtArguments) Reset() { *m = MrtArguments{} }
diff --git a/api/gobgp.proto b/api/gobgp.proto
index b80964eb..e50e3c71 100644
--- a/api/gobgp.proto
+++ b/api/gobgp.proto
@@ -76,6 +76,7 @@ message MrtArguments {
Resource resource = 1;
AddressFamily af = 2;
uint64 interval = 3;
+ string neighbor_address = 4;
}
enum Resource {
diff --git a/api/util.go b/api/util.go
index 677d4f6a..d1bd4649 100644
--- a/api/util.go
+++ b/api/util.go
@@ -26,3 +26,23 @@ var AF_RTC *AddressFamily = &AddressFamily{AFI_IP, SAFI_ROUTE_TARGET_CONSTRAINTS
func (lhs *AddressFamily) Equal(rhs *AddressFamily) bool {
return lhs.Afi == rhs.Afi && lhs.Safi == rhs.Safi
}
+
+func (af *AddressFamily) ShortString() string {
+ switch {
+ case af.Equal(AF_IPV4_UC):
+ return "ipv4"
+ case af.Equal(AF_IPV6_UC):
+ return "ipv6"
+ case af.Equal(AF_IPV4_VPN):
+ return "vpnv4"
+ case af.Equal(AF_IPV4_VPN):
+ return "vpnv6"
+ case af.Equal(AF_EVPN):
+ return "evpn"
+ case af.Equal(AF_ENCAP):
+ return "encap"
+ case af.Equal(AF_RTC):
+ return "rtc"
+ }
+ return "unknown"
+}