summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorkishiguro <ishi@hash-set.com>2017-01-19 18:15:58 -0800
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-01-25 06:09:23 -0800
commit1ff6a7300b11519584a545e50216daa346602670 (patch)
tree83ab447a211192704a0efaae21de070608ce4ef9
parentbb42a6832f14edb65c06256bfb4d7029faf9f3bb (diff)
Add client API for EnableZebra.
-rw-r--r--client/client.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/client/client.go b/client/client.go
index fee3e3b9..521c4b38 100644
--- a/client/client.go
+++ b/client/client.go
@@ -113,6 +113,18 @@ func (cli *Client) GetServer() (*config.Global, error) {
}, nil
}
+func (cli *Client) EnableZebra(c *config.Zebra) error {
+ req := &api.EnableZebraRequest{
+ Url: c.Config.Url,
+ Version: uint32(c.Config.Version),
+ }
+ for _, t := range c.Config.RedistributeRouteTypeList {
+ req.RouteTypes = append(req.RouteTypes, string(t))
+ }
+ _, err := cli.cli.EnableZebra(context.Background(), req)
+ return err
+}
+
func (cli *Client) getNeighbor(name string, afi int, vrf string) ([]*config.Neighbor, error) {
ret, err := cli.cli.GetNeighbor(context.Background(), &api.GetNeighborRequest{EnableAdvertised: name != ""})
if err != nil {