Exemple #1
0
func cmdShowRipRoutes(ctx command.ConfContext, node *command.CmdNode, line string, c command.CmdClient) {
	rip := ctx.(*Rip)
	if rip.router == nil {
		c.Sendln("RIP not running")
		return
	}
	rip.router.ShowRoutes(c)
}
Exemple #2
0
func ripCtx(ctx command.ConfContext, c command.CmdClient) *Rip {
	if rip, ok := ctx.(*Rip); ok {
		return rip
	}
	// non-rip context is a bogus state used for unit testing
	err := fmt.Errorf("ripCtx: not a true Rip context: %v", ctx)
	log.Printf("%v", err)
	c.Sendln(fmt.Sprintf("%v", err))
	return nil
}
Exemple #3
0
func bgpCtx(ctx command.ConfContext, c command.CmdClient) *Bgp {
	if bgp, ok := ctx.(*Bgp); ok {
		return bgp
	}
	// non-bgp context is a bogus state used for unit testing
	err := fmt.Errorf("bgpCtx: not a true Bgp context: %v", ctx)
	log.Printf("%v", err)
	c.Sendln(fmt.Sprintf("%v", err))
	return nil
}