Esempio n. 1
0
File: rip.go Progetto: udhos/nexthop
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)
}
Esempio n. 2
0
File: rip.go Progetto: udhos/nexthop
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
}
Esempio n. 3
0
File: bgp.go Progetto: udhos/nexthop
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
}