Ejemplo n.º 1
0
func makePeerAndHandler() (*Peer, *FSMHandler) {
	p := &Peer{
		fsm:      NewFSM(&config.Global{}, &config.Neighbor{}, table.NewRoutingPolicy()),
		outgoing: channels.NewInfiniteChannel(),
	}

	h := &FSMHandler{
		fsm:      p.fsm,
		errorCh:  make(chan FsmStateReason, 2),
		incoming: channels.NewInfiniteChannel(),
		outgoing: p.outgoing,
	}

	return p, h

}
Ejemplo n.º 2
0
func makePeerAndHandler() (*Peer, *FSMHandler) {
	gConf := config.Global{}
	pConf := config.Neighbor{}

	p := &Peer{
		gConf: gConf,
		conf:  pConf,
	}

	p.fsm = NewFSM(&gConf, &pConf, table.NewRoutingPolicy())

	incoming := make(chan *FsmMsg, 4096)
	p.outgoing = make(chan *bgp.BGPMessage, 4096)

	h := &FSMHandler{
		fsm:      p.fsm,
		errorCh:  make(chan FsmStateReason, 2),
		incoming: incoming,
		outgoing: p.outgoing,
	}

	return p, h

}