diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-07-29 13:54:18 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-07-29 16:31:35 +0900 |
commit | e97a59c5390fc05ba75673fb4ff7e061c1e73e4f (patch) | |
tree | 07813290b57b33708e2b70a6724b0573a4e230fe /docs/sources | |
parent | 4fec73235a5fe507bfdd6e9c1bc19325b2d65dbd (diff) |
config: curve out code specific to default neighbor config setting
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'docs/sources')
-rw-r--r-- | docs/sources/lib.md | 25 |
1 files changed, 9 insertions, 16 deletions
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) } |