summaryrefslogtreecommitdiffhomepage
path: root/api/grpc_server.go
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2017-11-07 13:34:47 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-11-12 13:57:11 +0900
commitab8ba077e5882220c652e255507f8450ca61d664 (patch)
tree41b8cda2d16e476682d949187e148ba7e3ab34b1 /api/grpc_server.go
parentab9532119159e36cadf1ace3cf44773d40971729 (diff)
cli: Support address families when adding neighbor
Currently, "gobgp" command does not support to configure address families capability when adding a new neighbor. This patch introduces a new option field to "gobgp neighbor add" command and enables to configure address families capability. Example: Specify address family names in comma separated format $ gobgp neighbor add 10.0.0.3 as 65003 family ipv4-unicast,l2vpn-evpn $ gobgp neighbor 10.0.0.3 ...(snip)... Neighbor capabilities: multiprotocol: ipv4-unicast: advertised l2vpn-evpn: advertised route-refresh: advertised 4-octet-as: advertised ...(snip)... Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'api/grpc_server.go')
-rw-r--r--api/grpc_server.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/grpc_server.go b/api/grpc_server.go
index d1b82aeb..161bc826 100644
--- a/api/grpc_server.go
+++ b/api/grpc_server.go
@@ -100,7 +100,7 @@ func NewMpGracefulRestartFromConfigStruct(c *config.MpGracefulRestart) *MpGracef
func NewAfiSafiConfigFromConfigStruct(c *config.AfiSafi) *AfiSafiConfig {
return &AfiSafiConfig{
- Family: uint32(c.State.Family),
+ Family: extractFamilyFromConfigAfiSafi(c),
Enabled: c.Config.Enabled,
}
}
@@ -223,7 +223,7 @@ func NewPeerFromConfigStruct(pconf *config.Neighbor) *Peer {
prefixLimits := make([]*PrefixLimit, 0, len(pconf.AfiSafis))
afiSafis := make([]*AfiSafi, 0, len(pconf.AfiSafis))
for _, f := range pconf.AfiSafis {
- families = append(families, uint32(f.State.Family))
+ families = append(families, extractFamilyFromConfigAfiSafi(&f))
if prefixLimit := NewPrefixLimitFromConfigStruct(&f); prefixLimit != nil {
prefixLimits = append(prefixLimits, prefixLimit)
}