From e97a59c5390fc05ba75673fb4ff7e061c1e73e4f Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Fri, 29 Jul 2016 13:54:18 +0000 Subject: config: curve out code specific to default neighbor config setting Signed-off-by: ISHIDA Wataru --- docs/sources/lib.md | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'docs/sources/lib.md') diff --git a/docs/sources/lib.md b/docs/sources/lib.md index fd4182ca..7688e71f 100644 --- a/docs/sources/lib.md +++ b/docs/sources/lib.md @@ -42,7 +42,7 @@ func main() { }, } - if err := config.SetDefaultConfigValues(nil, b); err != nil { + if err := config.SetDefaultConfigValues(b); err != nil { log.Fatal(err) } @@ -51,25 +51,18 @@ func main() { } // neighbor configuration - if err := s.AddNeighbor(&config.Neighbor{ + n := &config.Neighbor{ Config: config.NeighborConfig{ NeighborAddress: "10.0.255.1", PeerAs: 65001, }, - Timers: config.Timers{ - Config: config.TimersConfig{ - HoldTime: 90, - KeepaliveInterval: 30, - }, - }, - AfiSafis: []config.AfiSafi{ - config.AfiSafi{ - Config: config.AfiSafiConfig{ - AfiSafiName: config.AFI_SAFI_TYPE_IPV4_UNICAST, - }, - }, - }, - }); err != nil { + } + + if err := config.SetDefaultNeighborConfigValues(n, b.Global.Config.As); err != nil { + log.Fatal(err) + } + + if err := s.AddNeighbor(n); err != nil { log.Fatal(err) } -- cgit v1.2.3