summaryrefslogtreecommitdiffhomepage
path: root/api
diff options
context:
space:
mode:
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"
+}