ConfigSource requests the configuration source be changed to the specified source. The name of the original source is returned.
(args *ipc.ConfigSource, oldSource *string)
| 290 | // ConfigSource requests the configuration source be changed to the specified |
| 291 | // source. The name of the original source is returned. |
| 292 | func (s *SeesawEngine) ConfigSource(args *ipc.ConfigSource, oldSource *string) error { |
| 293 | if args == nil { |
| 294 | return errors.New("args is nil") |
| 295 | } |
| 296 | ctx := args.Ctx |
| 297 | s.trace("ConfigSource", ctx) |
| 298 | if ctx == nil { |
| 299 | return errContext |
| 300 | } |
| 301 | |
| 302 | if !ctx.CanWrite() { |
| 303 | return errAccess |
| 304 | } |
| 305 | |
| 306 | if oldSource != nil { |
| 307 | *oldSource = s.engine.notifier.Source().String() |
| 308 | } |
| 309 | newSource := args.Source |
| 310 | if newSource == "" { |
| 311 | return nil |
| 312 | } |
| 313 | source, err := config.SourceByName(newSource) |
| 314 | if err != nil { |
| 315 | return err |
| 316 | } |
| 317 | s.engine.notifier.SetSource(source) |
| 318 | return nil |
| 319 | } |
| 320 | |
| 321 | // BGPNeighbors returns a list of the BGP neighbors that we are peering with. |
| 322 | func (s *SeesawEngine) BGPNeighbors(ctx *ipc.Context, reply *quagga.Neighbors) error { |